kopia lustrzana https://github.com/Tldraw/Tldraw
Update test-text.spec.ts
rodzic
5711530f1b
commit
4d19b78ca4
|
@ -157,7 +157,7 @@ test.describe('text measurement', () => {
|
||||||
measureTextSpansOptions
|
measureTextSpansOptions
|
||||||
)
|
)
|
||||||
|
|
||||||
expect(formatLines(spans)).toEqual([[' ', 'testing', ' '], ['testing']])
|
expect(formatLines(spans)).toEqual([[' ', 'testing', ' ', 'testing']])
|
||||||
})
|
})
|
||||||
|
|
||||||
test('should place starting whitespace on its own line if it has to', async () => {
|
test('should place starting whitespace on its own line if it has to', async () => {
|
||||||
|
@ -284,7 +284,7 @@ test.describe('text measurement', () => {
|
||||||
return editor.getShape(id) as TLNoteShape
|
return editor.getShape(id) as TLNoteShape
|
||||||
})
|
})
|
||||||
|
|
||||||
expect(shape.props.fontSizeAdjustment).toEqual(28)
|
expect(shape.props.fontSizeAdjustment).toEqual(27)
|
||||||
})
|
})
|
||||||
|
|
||||||
test('for auto-font-sizing shapes, should auto-size text that have long words', async () => {
|
test('for auto-font-sizing shapes, should auto-size text that have long words', async () => {
|
||||||
|
@ -306,7 +306,7 @@ test.describe('text measurement', () => {
|
||||||
return editor.getShape(id) as TLNoteShape
|
return editor.getShape(id) as TLNoteShape
|
||||||
})
|
})
|
||||||
|
|
||||||
expect(shape.props.fontSizeAdjustment).toEqual(21)
|
expect(shape.props.fontSizeAdjustment).toEqual(20)
|
||||||
})
|
})
|
||||||
|
|
||||||
test('for auto-font-sizing shapes, should wrap text that has words that are way too long', async () => {
|
test('for auto-font-sizing shapes, should wrap text that has words that are way too long', async () => {
|
||||||
|
|
|
@ -221,9 +221,9 @@ export class ArrowShapeUtil extends ShapeUtil<TLArrowShape> {
|
||||||
isPrecise: boolean;
|
isPrecise: boolean;
|
||||||
}>;
|
}>;
|
||||||
point: ObjectValidator< {
|
point: ObjectValidator< {
|
||||||
|
type: "point";
|
||||||
x: number;
|
x: number;
|
||||||
y: number;
|
y: number;
|
||||||
type: "point";
|
|
||||||
}>;
|
}>;
|
||||||
}, never>;
|
}, never>;
|
||||||
end: UnionValidator<"type", {
|
end: UnionValidator<"type", {
|
||||||
|
@ -235,9 +235,9 @@ export class ArrowShapeUtil extends ShapeUtil<TLArrowShape> {
|
||||||
isPrecise: boolean;
|
isPrecise: boolean;
|
||||||
}>;
|
}>;
|
||||||
point: ObjectValidator< {
|
point: ObjectValidator< {
|
||||||
|
type: "point";
|
||||||
x: number;
|
x: number;
|
||||||
y: number;
|
y: number;
|
||||||
type: "point";
|
|
||||||
}>;
|
}>;
|
||||||
}, never>;
|
}, never>;
|
||||||
bend: Validator<number>;
|
bend: Validator<number>;
|
||||||
|
@ -1058,10 +1058,10 @@ export class LineShapeUtil extends ShapeUtil<TLLineShape> {
|
||||||
size: EnumStyleProp<"l" | "m" | "s" | "xl">;
|
size: EnumStyleProp<"l" | "m" | "s" | "xl">;
|
||||||
spline: EnumStyleProp<"cubic" | "line">;
|
spline: EnumStyleProp<"cubic" | "line">;
|
||||||
points: DictValidator<string, {
|
points: DictValidator<string, {
|
||||||
id: string;
|
|
||||||
x: number;
|
x: number;
|
||||||
y: number;
|
y: number;
|
||||||
index: IndexKey;
|
index: IndexKey;
|
||||||
|
id: string;
|
||||||
}>;
|
}>;
|
||||||
};
|
};
|
||||||
// (undocumented)
|
// (undocumented)
|
||||||
|
|
|
@ -1645,7 +1645,7 @@
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"kind": "Content",
|
"kind": "Content",
|
||||||
"text": "<{\n x: number;\n y: number;\n type: \"point\";\n }>;\n }, never>;\n end: import(\"@tldraw/editor\")."
|
"text": "<{\n type: \"point\";\n x: number;\n y: number;\n }>;\n }, never>;\n end: import(\"@tldraw/editor\")."
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"kind": "Reference",
|
"kind": "Reference",
|
||||||
|
@ -1690,7 +1690,7 @@
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"kind": "Content",
|
"kind": "Content",
|
||||||
"text": "<{\n x: number;\n y: number;\n type: \"point\";\n }>;\n }, never>;\n bend: import(\"@tldraw/editor\")."
|
"text": "<{\n type: \"point\";\n x: number;\n y: number;\n }>;\n }, never>;\n bend: import(\"@tldraw/editor\")."
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"kind": "Reference",
|
"kind": "Reference",
|
||||||
|
@ -12374,7 +12374,7 @@
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"kind": "Content",
|
"kind": "Content",
|
||||||
"text": "<string, {\n id: string;\n x: number;\n y: number;\n index: import(\"@tldraw/editor\")."
|
"text": "<string, {\n x: number;\n y: number;\n index: import(\"@tldraw/editor\")."
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"kind": "Reference",
|
"kind": "Reference",
|
||||||
|
@ -12383,7 +12383,7 @@
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"kind": "Content",
|
"kind": "Content",
|
||||||
"text": ";\n }>;\n }"
|
"text": ";\n id: string;\n }>;\n }"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"kind": "Content",
|
"kind": "Content",
|
||||||
|
|
|
@ -47,9 +47,9 @@ export const arrowShapeProps: {
|
||||||
isPrecise: boolean;
|
isPrecise: boolean;
|
||||||
} & {}>;
|
} & {}>;
|
||||||
point: T.ObjectValidator<{
|
point: T.ObjectValidator<{
|
||||||
|
type: "point";
|
||||||
x: number;
|
x: number;
|
||||||
y: number;
|
y: number;
|
||||||
type: "point";
|
|
||||||
} & {}>;
|
} & {}>;
|
||||||
}, never>;
|
}, never>;
|
||||||
end: T.UnionValidator<"type", {
|
end: T.UnionValidator<"type", {
|
||||||
|
@ -61,9 +61,9 @@ export const arrowShapeProps: {
|
||||||
isPrecise: boolean;
|
isPrecise: boolean;
|
||||||
} & {}>;
|
} & {}>;
|
||||||
point: T.ObjectValidator<{
|
point: T.ObjectValidator<{
|
||||||
|
type: "point";
|
||||||
x: number;
|
x: number;
|
||||||
y: number;
|
y: number;
|
||||||
type: "point";
|
|
||||||
} & {}>;
|
} & {}>;
|
||||||
}, never>;
|
}, never>;
|
||||||
bend: T.Validator<number>;
|
bend: T.Validator<number>;
|
||||||
|
@ -666,10 +666,10 @@ export const lineShapeProps: {
|
||||||
size: EnumStyleProp<"l" | "m" | "s" | "xl">;
|
size: EnumStyleProp<"l" | "m" | "s" | "xl">;
|
||||||
spline: EnumStyleProp<"cubic" | "line">;
|
spline: EnumStyleProp<"cubic" | "line">;
|
||||||
points: T.DictValidator<string, {
|
points: T.DictValidator<string, {
|
||||||
id: string;
|
|
||||||
x: number;
|
x: number;
|
||||||
y: number;
|
y: number;
|
||||||
index: IndexKey;
|
index: IndexKey;
|
||||||
|
id: string;
|
||||||
} & {}>;
|
} & {}>;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -364,7 +364,7 @@
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"kind": "Content",
|
"kind": "Content",
|
||||||
"text": "<{\n x: number;\n y: number;\n type: \"point\";\n } & {}>;\n }, never>;\n end: "
|
"text": "<{\n type: \"point\";\n x: number;\n y: number;\n } & {}>;\n }, never>;\n end: "
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"kind": "Reference",
|
"kind": "Reference",
|
||||||
|
@ -409,7 +409,7 @@
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"kind": "Content",
|
"kind": "Content",
|
||||||
"text": "<{\n x: number;\n y: number;\n type: \"point\";\n } & {}>;\n }, never>;\n bend: "
|
"text": "<{\n type: \"point\";\n x: number;\n y: number;\n } & {}>;\n }, never>;\n bend: "
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"kind": "Reference",
|
"kind": "Reference",
|
||||||
|
@ -2818,7 +2818,7 @@
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"kind": "Content",
|
"kind": "Content",
|
||||||
"text": "<string, {\n id: string;\n x: number;\n y: number;\n index: "
|
"text": "<string, {\n x: number;\n y: number;\n index: "
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"kind": "Reference",
|
"kind": "Reference",
|
||||||
|
@ -2827,7 +2827,7 @@
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"kind": "Content",
|
"kind": "Content",
|
||||||
"text": ";\n } & {}>;\n}"
|
"text": ";\n id: string;\n } & {}>;\n}"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"fileUrlPath": "packages/tlschema/src/shapes/TLLineShape.ts",
|
"fileUrlPath": "packages/tlschema/src/shapes/TLLineShape.ts",
|
||||||
|
|
Ładowanie…
Reference in New Issue