@yft-design/engine 0.0.30 → 0.0.32
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/core/distanceField.d.ts +1 -1
- package/dist/index.js +51 -52
- package/dist/model/alphaHit.d.ts +2 -0
- package/dist/model/document.d.ts +2 -0
- package/dist/model/scene.d.ts +4 -0
- package/dist/model/textDecorationBounds.d.ts +3 -0
- package/dist/model/textLayout.d.ts +13 -0
- package/dist/model/textTransform.d.ts +18 -0
- package/dist/render/SceneRenderer.d.ts +2 -0
- package/dist/render/textHighlight.d.ts +6 -0
- package/package.json +1 -1
package/dist/model/alphaHit.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { SceneNode } from './scene';
|
|
2
|
+
import { GroupNode } from './scene';
|
|
2
3
|
export interface AlphaHitContext {
|
|
3
4
|
selection: readonly SceneNode[];
|
|
4
5
|
hasSelectableBelow: () => boolean;
|
|
@@ -6,3 +7,4 @@ export interface AlphaHitContext {
|
|
|
6
7
|
}
|
|
7
8
|
export declare const isHitTransparent: (node: SceneNode, x: number, y: number, ctx: AlphaHitContext) => boolean;
|
|
8
9
|
export declare const clearAlphaHitMask: (node: SceneNode) => void;
|
|
10
|
+
export declare const drillChildAtPoint: (group: GroupNode, x: number, y: number, selection: readonly SceneNode[]) => SceneNode | null;
|
package/dist/model/document.d.ts
CHANGED
|
@@ -122,6 +122,8 @@ export declare class EngineDocument {
|
|
|
122
122
|
objectsIntersectingRect(left: number, top: number, right: number, bottom: number): SceneNode[];
|
|
123
123
|
setSelection(targets: SceneNode[], reason?: 'create' | 'update'): void;
|
|
124
124
|
clearSelection(): void;
|
|
125
|
+
private _transformGestureAt;
|
|
126
|
+
get transformGestureAt(): number;
|
|
125
127
|
applyTransform(targets: SceneNode[], props: (target: SceneNode) => Partial<SerializedNode>, phase: 'moving' | 'scaling' | 'rotating' | 'cornerRadius' | 'modified', detail?: {
|
|
126
128
|
action?: string;
|
|
127
129
|
before?: Map<SceneNode, SerializedNode>;
|
package/dist/model/scene.d.ts
CHANGED
|
@@ -148,6 +148,7 @@ export declare class TextNode extends SceneNode {
|
|
|
148
148
|
};
|
|
149
149
|
get aCoords(): CornerPoints;
|
|
150
150
|
get inkACoords(): CornerPoints;
|
|
151
|
+
private get textInkACoords();
|
|
151
152
|
get contentTopY(): number;
|
|
152
153
|
cursorCoord(flatIndex: number): {
|
|
153
154
|
x: number;
|
|
@@ -247,6 +248,7 @@ export declare class GroupNode extends SceneNode {
|
|
|
247
248
|
y: number;
|
|
248
249
|
};
|
|
249
250
|
containsPoint(x: number, y: number, hitBand?: number): boolean;
|
|
251
|
+
get inkACoords(): CornerPoints;
|
|
250
252
|
childAtPoint(x: number, y: number, hitBand?: number): SceneNode | null;
|
|
251
253
|
containsDeep(node: SceneNode): boolean;
|
|
252
254
|
adoptChild(child: SceneNode, index?: number): void;
|
|
@@ -258,6 +260,7 @@ export declare class TableNode extends GroupNode {
|
|
|
258
260
|
private _layout;
|
|
259
261
|
private readonly _childFactory;
|
|
260
262
|
private _placedShift;
|
|
263
|
+
get inkACoords(): CornerPoints;
|
|
261
264
|
selectedCells: CellPosition[];
|
|
262
265
|
cellAnchor: CellPosition | null;
|
|
263
266
|
cellRange: CellSelectionRange | null;
|
|
@@ -358,6 +361,7 @@ export declare class MaskNode extends SceneNode {
|
|
|
358
361
|
}
|
|
359
362
|
export declare class PuzzleNode extends GroupNode {
|
|
360
363
|
constructor(raw: SerializedNode, childFactory: (raw: SerializedNode) => SceneNode | null);
|
|
364
|
+
get inkACoords(): CornerPoints;
|
|
361
365
|
private reconcileIncompleteLayout;
|
|
362
366
|
private reconcileOverlappingChildren;
|
|
363
367
|
get layoutParams(): {
|
|
@@ -29,6 +29,19 @@ export declare const verticalLineInkRun: (line: TextLineLayout, style: TextStyle
|
|
|
29
29
|
end: number;
|
|
30
30
|
};
|
|
31
31
|
export declare const GENERIC_FONTS: Set<string>;
|
|
32
|
+
export declare const aggregateLineInk: (layout: TextLayout, style: TextStyleProps, options?: {
|
|
33
|
+
vertical?: boolean;
|
|
34
|
+
inkMeasure?: InkMeasureFn;
|
|
35
|
+
align?: unknown;
|
|
36
|
+
}) => {
|
|
37
|
+
lo: number;
|
|
38
|
+
hi: number;
|
|
39
|
+
firstTop: number;
|
|
40
|
+
} | null;
|
|
41
|
+
export declare const anchorInkRange: (lo: number, hi: number, boxWidth: number, align: unknown) => {
|
|
42
|
+
lo: number;
|
|
43
|
+
hi: number;
|
|
44
|
+
};
|
|
32
45
|
export interface TextStyleProps {
|
|
33
46
|
fontFamily: string;
|
|
34
47
|
fontSize: number;
|
|
@@ -1,5 +1,23 @@
|
|
|
1
|
+
import type { TextLayout } from './textLayout';
|
|
1
2
|
export type TextTransformKind = 'arc' | 'circle' | 'waist' | 'flag' | 'arch' | 'scroll';
|
|
2
3
|
export declare const textTransformKindOf: (raw: {
|
|
3
4
|
textTransform?: unknown;
|
|
4
5
|
type?: unknown;
|
|
5
6
|
}) => TextTransformKind | null;
|
|
7
|
+
export type WarpTransformKind = 'arch' | 'waist' | 'flag';
|
|
8
|
+
export declare const warpTextKindOf: (raw: {
|
|
9
|
+
textTransform?: unknown;
|
|
10
|
+
type?: unknown;
|
|
11
|
+
warpStrength?: unknown;
|
|
12
|
+
}) => WarpTransformKind | null;
|
|
13
|
+
export interface WarpInkExtent {
|
|
14
|
+
left: number;
|
|
15
|
+
right: number;
|
|
16
|
+
top: number;
|
|
17
|
+
bottom: number;
|
|
18
|
+
}
|
|
19
|
+
export declare const computeWarpInkExtent: (kind: WarpTransformKind, layout: TextLayout, raw: Record<string, unknown>, ink: {
|
|
20
|
+
lo: number;
|
|
21
|
+
hi: number;
|
|
22
|
+
firstTop: number;
|
|
23
|
+
}, contentTopY: number) => WarpInkExtent | null;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { type Mat } from '../core/mat2d';
|
|
2
2
|
import { TextNode, type SceneNode } from '../model/scene';
|
|
3
|
+
import type { EngineDocument } from '../model/document';
|
|
3
4
|
import type { GradientRampCache } from './gradientRamp';
|
|
4
5
|
import type { SourceManager } from './SourceManager';
|
|
5
6
|
import type { TextRenderer } from './TextRenderer';
|
|
@@ -28,6 +29,7 @@ export interface SceneRendererHost {
|
|
|
28
29
|
readonly isExporting: () => boolean;
|
|
29
30
|
readonly renderEpoch?: RenderEpoch;
|
|
30
31
|
readonly bakeKReuseFloor?: number;
|
|
32
|
+
readonly document?: Pick<EngineDocument, 'transformGestureAt'>;
|
|
31
33
|
requestRenderAll: () => void;
|
|
32
34
|
}
|
|
33
35
|
export interface FrameState {
|