@open-pencil/scene-graph 0.13.2
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/README.md +5 -0
- package/dist/chunks/bindings.js +18 -0
- package/dist/chunks/bindings.js.map +1 -0
- package/dist/chunks/coordinate.js +293 -0
- package/dist/chunks/coordinate.js.map +1 -0
- package/dist/chunks/copy.js +576 -0
- package/dist/chunks/copy.js.map +1 -0
- package/dist/chunks/events.js +18 -0
- package/dist/chunks/events.js.map +1 -0
- package/dist/chunks/export-scale.js +19 -0
- package/dist/chunks/export-scale.js.map +1 -0
- package/dist/chunks/font-style.js +95 -0
- package/dist/chunks/font-style.js.map +1 -0
- package/dist/constants.d.ts +2 -0
- package/dist/constants.js +19 -0
- package/dist/constants.js.map +1 -0
- package/dist/constants2.d.ts +10 -0
- package/dist/constants2.d.ts.map +1 -0
- package/dist/coordinate.d.ts +352 -0
- package/dist/coordinate.d.ts.map +1 -0
- package/dist/coordinate.js +2 -0
- package/dist/coordinate2.d.ts +2 -0
- package/dist/copy.d.ts +2 -0
- package/dist/copy.js +2 -0
- package/dist/geometry.d.ts +2 -0
- package/dist/geometry.js +431 -0
- package/dist/geometry.js.map +1 -0
- package/dist/hit-test.d.ts +10 -0
- package/dist/hit-test.d.ts.map +1 -0
- package/dist/hit-test.js +97 -0
- package/dist/hit-test.js.map +1 -0
- package/dist/images.d.ts +2 -0
- package/dist/images.js +45 -0
- package/dist/images.js.map +1 -0
- package/dist/images2.d.ts +5 -0
- package/dist/images2.d.ts.map +1 -0
- package/dist/index.d.ts +9 -0
- package/dist/index.js +9 -0
- package/dist/instances.d.ts +2 -0
- package/dist/instances.js +2 -0
- package/dist/matrix.d.ts +2 -0
- package/dist/matrix.js +2 -0
- package/dist/matrix2.d.ts +17 -0
- package/dist/matrix2.d.ts.map +1 -0
- package/dist/node-defaults.d.ts +9 -0
- package/dist/node-defaults.d.ts.map +1 -0
- package/dist/node-defaults.js +2 -0
- package/dist/parse-path.d.ts +23 -0
- package/dist/parse-path.d.ts.map +1 -0
- package/dist/parse-path.js +159 -0
- package/dist/parse-path.js.map +1 -0
- package/dist/preview.d.ts +12 -0
- package/dist/preview.d.ts.map +1 -0
- package/dist/preview.js +2 -0
- package/dist/primitives.d.ts +2 -0
- package/dist/primitives.js +0 -0
- package/dist/primitives2.d.ts +42 -0
- package/dist/primitives2.d.ts.map +1 -0
- package/dist/resize.d.ts +16 -0
- package/dist/resize.d.ts.map +1 -0
- package/dist/resize.js +136 -0
- package/dist/resize.js.map +1 -0
- package/dist/snap.d.ts +2 -0
- package/dist/snap.js +2 -0
- package/dist/source-metadata.d.ts +7 -0
- package/dist/source-metadata.d.ts.map +1 -0
- package/dist/source-metadata.js +2 -0
- package/dist/text-picture.d.ts +7 -0
- package/dist/text-picture.d.ts.map +1 -0
- package/dist/text-picture.js +2 -0
- package/dist/types.d.ts +2 -0
- package/dist/types.js +1296 -0
- package/dist/types.js.map +1 -0
- package/dist/types2.d.ts +430 -0
- package/dist/types2.d.ts.map +1 -0
- package/dist/undo.d.ts +2 -0
- package/dist/undo.js +2 -0
- package/dist/undo2.d.ts +40 -0
- package/dist/undo2.d.ts.map +1 -0
- package/dist/variables.d.ts +30 -0
- package/dist/variables.d.ts.map +1 -0
- package/dist/variables.js +2 -0
- package/dist/variant-name.d.ts +6 -0
- package/dist/variant-name.d.ts.map +1 -0
- package/dist/variant-name.js +17 -0
- package/dist/variant-name.js.map +1 -0
- package/dist/vector-network.d.ts +2 -0
- package/dist/vector-network.js +2 -0
- package/dist/vector-network2.d.ts +33 -0
- package/dist/vector-network2.d.ts.map +1 -0
- package/package.json +157 -0
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
//#region src/export-scale.ts
|
|
2
|
+
/**
|
|
3
|
+
* Bounds for export scale multipliers. A huge multiplier would allocate an
|
|
4
|
+
* enormous canvas and crash the renderer, so clamp at every boundary the value
|
|
5
|
+
* can enter from: the UI (edits) and the file format (imported/plugin .fig data).
|
|
6
|
+
*/
|
|
7
|
+
const MIN_EXPORT_SCALE = .01;
|
|
8
|
+
const MAX_EXPORT_SCALE = 1024;
|
|
9
|
+
function clampExportScale(scale) {
|
|
10
|
+
return Math.min(MAX_EXPORT_SCALE, Math.max(MIN_EXPORT_SCALE, scale));
|
|
11
|
+
}
|
|
12
|
+
/** Accept a scale only if it is finite and within bounds (no silent clamping). */
|
|
13
|
+
function isValidExportScale(scale) {
|
|
14
|
+
return Number.isFinite(scale) && scale >= .01 && scale <= 1024;
|
|
15
|
+
}
|
|
16
|
+
//#endregion
|
|
17
|
+
export { MAX_EXPORT_SCALE, MIN_EXPORT_SCALE, clampExportScale, isValidExportScale };
|
|
18
|
+
|
|
19
|
+
//# sourceMappingURL=export-scale.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"export-scale.js","names":[],"sources":["../../src/export-scale.ts"],"sourcesContent":["/**\n * Bounds for export scale multipliers. A huge multiplier would allocate an\n * enormous canvas and crash the renderer, so clamp at every boundary the value\n * can enter from: the UI (edits) and the file format (imported/plugin .fig data).\n */\nexport const MIN_EXPORT_SCALE = 0.01\nexport const MAX_EXPORT_SCALE = 1024\n\nexport function clampExportScale(scale: number): number {\n return Math.min(MAX_EXPORT_SCALE, Math.max(MIN_EXPORT_SCALE, scale))\n}\n\n/** Accept a scale only if it is finite and within bounds (no silent clamping). */\nexport function isValidExportScale(scale: number): boolean {\n return Number.isFinite(scale) && scale >= MIN_EXPORT_SCALE && scale <= MAX_EXPORT_SCALE\n}\n"],"mappings":";;;;;;AAKA,MAAa,mBAAmB;AAChC,MAAa,mBAAmB;AAEhC,SAAgB,iBAAiB,OAAuB;CACtD,OAAO,KAAK,IAAI,kBAAkB,KAAK,IAAI,kBAAkB,KAAK,CAAC;AACrE;;AAGA,SAAgB,mBAAmB,OAAwB;CACzD,OAAO,OAAO,SAAS,KAAK,KAAK,SAAA,OAA6B,SAAA;AAChE"}
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
//#region src/font-style.ts
|
|
2
|
+
const FONT_WEIGHT_NAMES = {
|
|
3
|
+
100: "Thin",
|
|
4
|
+
200: "Extra Light",
|
|
5
|
+
300: "Light",
|
|
6
|
+
400: "Regular",
|
|
7
|
+
500: "Medium",
|
|
8
|
+
600: "Semi Bold",
|
|
9
|
+
700: "Bold",
|
|
10
|
+
800: "Extra Bold",
|
|
11
|
+
900: "Black"
|
|
12
|
+
};
|
|
13
|
+
const FONT_WEIGHT_BY_STYLE = new Map([
|
|
14
|
+
{
|
|
15
|
+
weight: 100,
|
|
16
|
+
names: [
|
|
17
|
+
"thin",
|
|
18
|
+
"hairline",
|
|
19
|
+
"extrathin",
|
|
20
|
+
"ultrathin"
|
|
21
|
+
]
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
weight: 200,
|
|
25
|
+
names: ["extralight", "ultralight"]
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
weight: 300,
|
|
29
|
+
names: ["light"]
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
weight: 400,
|
|
33
|
+
names: [
|
|
34
|
+
"regular",
|
|
35
|
+
"normal",
|
|
36
|
+
"book",
|
|
37
|
+
"roman",
|
|
38
|
+
"plain"
|
|
39
|
+
]
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
weight: 500,
|
|
43
|
+
names: ["medium"]
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
weight: 600,
|
|
47
|
+
names: ["semibold", "demibold"]
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
weight: 700,
|
|
51
|
+
names: ["bold"]
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
weight: 800,
|
|
55
|
+
names: ["extrabold", "ultrabold"]
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
weight: 900,
|
|
59
|
+
names: ["black", "heavy"]
|
|
60
|
+
}
|
|
61
|
+
].flatMap(({ names, weight }) => names.map((name) => [name, weight])));
|
|
62
|
+
function normalizeFontStyleName(style) {
|
|
63
|
+
return style.toLowerCase().replace(/italic|oblique/u, "").replace(/[^a-z0-9]+/gu, "");
|
|
64
|
+
}
|
|
65
|
+
function parseFontStyle(style) {
|
|
66
|
+
const raw = style ?? "";
|
|
67
|
+
const italic = /(?:italic|oblique)/iu.test(raw);
|
|
68
|
+
const normalized = normalizeFontStyleName(raw);
|
|
69
|
+
const numericWeight = normalized.match(/(?:^|[^0-9])([1-9]00)(?:[^0-9]|$)/u)?.[1];
|
|
70
|
+
return {
|
|
71
|
+
weight: numericWeight ? Number(numericWeight) : FONT_WEIGHT_BY_STYLE.get(normalized) ?? 400,
|
|
72
|
+
italic
|
|
73
|
+
};
|
|
74
|
+
}
|
|
75
|
+
function styleToWeight(style) {
|
|
76
|
+
return parseFontStyle(style).weight;
|
|
77
|
+
}
|
|
78
|
+
function normalizeFontFamily(family) {
|
|
79
|
+
return family.replace(/\s+(Variable|\d+(?:pt|px|em))$/i, "");
|
|
80
|
+
}
|
|
81
|
+
function styleToVariant(style) {
|
|
82
|
+
const weight = styleToWeight(style);
|
|
83
|
+
const italic = style.toLowerCase().includes("italic");
|
|
84
|
+
if (weight === 400 && !italic) return "regular";
|
|
85
|
+
if (weight === 400 && italic) return "italic";
|
|
86
|
+
return italic ? `${weight}italic` : `${weight}`;
|
|
87
|
+
}
|
|
88
|
+
function weightToStyle(weight, italic = false) {
|
|
89
|
+
const label = (FONT_WEIGHT_NAMES[Math.round(weight / 100) * 100] ?? "Regular").replace(/ /g, "");
|
|
90
|
+
return italic ? `${label} Italic` : label;
|
|
91
|
+
}
|
|
92
|
+
//#endregion
|
|
93
|
+
export { FONT_WEIGHT_NAMES, normalizeFontFamily, normalizeFontStyleName, parseFontStyle, styleToVariant, styleToWeight, weightToStyle };
|
|
94
|
+
|
|
95
|
+
//# sourceMappingURL=font-style.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"font-style.js","names":[],"sources":["../../src/font-style.ts"],"sourcesContent":["export interface FontFamilyStyle {\n family: string\n style: string\n}\n\nexport interface ParsedFontStyle {\n weight: number\n italic: boolean\n}\n\nexport const FONT_WEIGHT_NAMES: Record<number, string> = {\n 100: 'Thin',\n 200: 'Extra Light',\n 300: 'Light',\n 400: 'Regular',\n 500: 'Medium',\n 600: 'Semi Bold',\n 700: 'Bold',\n 800: 'Extra Bold',\n 900: 'Black'\n}\n\nconst FONT_WEIGHT_ALIASES = [\n { weight: 100, names: ['thin', 'hairline', 'extrathin', 'ultrathin'] },\n { weight: 200, names: ['extralight', 'ultralight'] },\n { weight: 300, names: ['light'] },\n { weight: 400, names: ['regular', 'normal', 'book', 'roman', 'plain'] },\n { weight: 500, names: ['medium'] },\n { weight: 600, names: ['semibold', 'demibold'] },\n { weight: 700, names: ['bold'] },\n { weight: 800, names: ['extrabold', 'ultrabold'] },\n { weight: 900, names: ['black', 'heavy'] }\n] as const\n\nconst FONT_WEIGHT_BY_STYLE: ReadonlyMap<string, number> = new Map(\n FONT_WEIGHT_ALIASES.flatMap(({ names, weight }) => names.map((name) => [name, weight] as const))\n)\n\nexport function normalizeFontStyleName(style: string): string {\n return style\n .toLowerCase()\n .replace(/italic|oblique/u, '')\n .replace(/[^a-z0-9]+/gu, '')\n}\n\nexport function parseFontStyle(style: string | undefined): ParsedFontStyle {\n const raw = style ?? ''\n const italic = /(?:italic|oblique)/iu.test(raw)\n const normalized = normalizeFontStyleName(raw)\n const numericWeight = normalized.match(/(?:^|[^0-9])([1-9]00)(?:[^0-9]|$)/u)?.[1]\n return {\n weight: numericWeight ? Number(numericWeight) : (FONT_WEIGHT_BY_STYLE.get(normalized) ?? 400),\n italic\n }\n}\n\nexport function styleToWeight(style: string | undefined): number {\n return parseFontStyle(style).weight\n}\n\nexport function normalizeFontFamily(family: string): string {\n return family.replace(/\\s+(Variable|\\d+(?:pt|px|em))$/i, '')\n}\n\nexport function styleToVariant(style: string): string {\n const weight = styleToWeight(style)\n const italic = style.toLowerCase().includes('italic')\n if (weight === 400 && !italic) return 'regular'\n if (weight === 400 && italic) return 'italic'\n return italic ? `${weight}italic` : `${weight}`\n}\n\nexport function weightToStyle(weight: number, italic = false): string {\n const rounded = Math.round(weight / 100) * 100\n const label = (FONT_WEIGHT_NAMES[rounded] ?? 'Regular').replace(/ /g, '')\n return italic ? `${label} Italic` : label\n}\n"],"mappings":";AAUA,MAAa,oBAA4C;CACvD,KAAK;CACL,KAAK;CACL,KAAK;CACL,KAAK;CACL,KAAK;CACL,KAAK;CACL,KAAK;CACL,KAAK;CACL,KAAK;AACP;AAcA,MAAM,uBAAoD,IAAI,IAC5D;CAZA;EAAE,QAAQ;EAAK,OAAO;GAAC;GAAQ;GAAY;GAAa;EAAW;CAAE;CACrE;EAAE,QAAQ;EAAK,OAAO,CAAC,cAAc,YAAY;CAAE;CACnD;EAAE,QAAQ;EAAK,OAAO,CAAC,OAAO;CAAE;CAChC;EAAE,QAAQ;EAAK,OAAO;GAAC;GAAW;GAAU;GAAQ;GAAS;EAAO;CAAE;CACtE;EAAE,QAAQ;EAAK,OAAO,CAAC,QAAQ;CAAE;CACjC;EAAE,QAAQ;EAAK,OAAO,CAAC,YAAY,UAAU;CAAE;CAC/C;EAAE,QAAQ;EAAK,OAAO,CAAC,MAAM;CAAE;CAC/B;EAAE,QAAQ;EAAK,OAAO,CAAC,aAAa,WAAW;CAAE;CACjD;EAAE,QAAQ;EAAK,OAAO,CAAC,SAAS,OAAO;CAAE;AAIvB,CAAC,CAAC,SAAS,EAAE,OAAO,aAAa,MAAM,KAAK,SAAS,CAAC,MAAM,MAAM,CAAU,CAAC,CACjG;AAEA,SAAgB,uBAAuB,OAAuB;CAC5D,OAAO,MACJ,YAAY,CAAC,CACb,QAAQ,mBAAmB,EAAE,CAAC,CAC9B,QAAQ,gBAAgB,EAAE;AAC/B;AAEA,SAAgB,eAAe,OAA4C;CACzE,MAAM,MAAM,SAAS;CACrB,MAAM,SAAS,uBAAuB,KAAK,GAAG;CAC9C,MAAM,aAAa,uBAAuB,GAAG;CAC7C,MAAM,gBAAgB,WAAW,MAAM,oCAAoC,CAAC,GAAG;CAC/E,OAAO;EACL,QAAQ,gBAAgB,OAAO,aAAa,IAAK,qBAAqB,IAAI,UAAU,KAAK;EACzF;CACF;AACF;AAEA,SAAgB,cAAc,OAAmC;CAC/D,OAAO,eAAe,KAAK,CAAC,CAAC;AAC/B;AAEA,SAAgB,oBAAoB,QAAwB;CAC1D,OAAO,OAAO,QAAQ,mCAAmC,EAAE;AAC7D;AAEA,SAAgB,eAAe,OAAuB;CACpD,MAAM,SAAS,cAAc,KAAK;CAClC,MAAM,SAAS,MAAM,YAAY,CAAC,CAAC,SAAS,QAAQ;CACpD,IAAI,WAAW,OAAO,CAAC,QAAQ,OAAO;CACtC,IAAI,WAAW,OAAO,QAAQ,OAAO;CACrC,OAAO,SAAS,GAAG,OAAO,UAAU,GAAG;AACzC;AAEA,SAAgB,cAAc,QAAgB,SAAS,OAAe;CAEpE,MAAM,SAAS,kBADC,KAAK,MAAM,SAAS,GAAG,IAAI,QACE,UAAA,CAAW,QAAQ,MAAM,EAAE;CACxE,OAAO,SAAS,GAAG,MAAM,WAAW;AACtC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
//#region src/constants.ts
|
|
2
|
+
const BLACK = {
|
|
3
|
+
r: 0,
|
|
4
|
+
g: 0,
|
|
5
|
+
b: 0,
|
|
6
|
+
a: 1
|
|
7
|
+
};
|
|
8
|
+
const TRANSPARENT = {
|
|
9
|
+
r: 0,
|
|
10
|
+
g: 0,
|
|
11
|
+
b: 0,
|
|
12
|
+
a: 0
|
|
13
|
+
};
|
|
14
|
+
const DEFAULT_FONT_FAMILY = "Inter";
|
|
15
|
+
const DEFAULT_STROKE_MITER_LIMIT = 4;
|
|
16
|
+
//#endregion
|
|
17
|
+
export { BLACK, DEFAULT_FONT_FAMILY, DEFAULT_STROKE_MITER_LIMIT, TRANSPARENT };
|
|
18
|
+
|
|
19
|
+
//# sourceMappingURL=constants.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.js","names":[],"sources":["../src/constants.ts"],"sourcesContent":["import type { Color } from './primitives'\n\nexport const BLACK: Color = { r: 0, g: 0, b: 0, a: 1 }\nexport const TRANSPARENT: Color = { r: 0, g: 0, b: 0, a: 0 }\nexport const DEFAULT_FONT_FAMILY = 'Inter'\nexport const DEFAULT_STROKE_MITER_LIMIT = 4\n"],"mappings":";AAEA,MAAa,QAAe;CAAE,GAAG;CAAG,GAAG;CAAG,GAAG;CAAG,GAAG;AAAE;AACrD,MAAa,cAAqB;CAAE,GAAG;CAAG,GAAG;CAAG,GAAG;CAAG,GAAG;AAAE;AAC3D,MAAa,sBAAsB;AACnC,MAAa,6BAA6B"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Color } from "./primitives2.js";
|
|
2
|
+
|
|
3
|
+
//#region src/constants.d.ts
|
|
4
|
+
declare const BLACK: Color;
|
|
5
|
+
declare const TRANSPARENT: Color;
|
|
6
|
+
declare const DEFAULT_FONT_FAMILY = "Inter";
|
|
7
|
+
declare const DEFAULT_STROKE_MITER_LIMIT = 4;
|
|
8
|
+
//#endregion
|
|
9
|
+
export { BLACK, DEFAULT_FONT_FAMILY, DEFAULT_STROKE_MITER_LIMIT, TRANSPARENT };
|
|
10
|
+
//# sourceMappingURL=constants2.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants2.d.ts","names":[],"sources":["../src/constants.ts"],"mappings":";;;cAEa,KAAA,EAAO,KAAkC;AAAA,cACzC,WAAA,EAAa,KAAkC;AAAA,cAC/C,mBAAA;AAAA,cACA,0BAAA"}
|
|
@@ -0,0 +1,352 @@
|
|
|
1
|
+
import { Color, Rect, Vector } from "./primitives2.js";
|
|
2
|
+
import { Mat3 } from "./matrix2.js";
|
|
3
|
+
import { DocumentColorSpace, Effect, Fill, GeometryPath, LayoutGrid, NodeType, SceneGraphEventHandlers, SceneGraphEvents, SceneNode, SharedStyle, SharedStyleKind, SharedStyleType, Stroke, StyleRun, Variable, VariableCollection, VariableType, VariableValue } from "./types2.js";
|
|
4
|
+
import { Emitter } from "nanoevents";
|
|
5
|
+
|
|
6
|
+
//#region src/copy.d.ts
|
|
7
|
+
declare function copyFill(f: Fill): Fill;
|
|
8
|
+
declare function copyStroke(s: Stroke): Stroke;
|
|
9
|
+
declare function copyEffect(e: Effect): Effect;
|
|
10
|
+
declare function copyStyleRun(r: StyleRun): StyleRun;
|
|
11
|
+
/** Record immutable lineage for an internal deep copy without sharing mutable values. */
|
|
12
|
+
declare function markCopySource<T extends object>(source: T, copy: T): T;
|
|
13
|
+
/** Compare internal deep copies in O(1) without traversing large paint or text payloads. */
|
|
14
|
+
declare function hasSameCopySource(left: object, right: object): boolean;
|
|
15
|
+
declare function copyFills(fills: Fill[]): Fill[];
|
|
16
|
+
declare function copyStrokes(strokes: Stroke[]): Stroke[];
|
|
17
|
+
declare function copyEffects(effects: Effect[]): Effect[];
|
|
18
|
+
declare function copyLayoutGrids(grids: LayoutGrid[]): LayoutGrid[];
|
|
19
|
+
declare function copyStyleRuns(runs: StyleRun[]): StyleRun[];
|
|
20
|
+
declare function copyGeometryPaths(paths: GeometryPath[]): GeometryPath[];
|
|
21
|
+
/** Scale geometry path coordinates while preserving independent path fills. */
|
|
22
|
+
declare function scaleGeometryPaths(paths: GeometryPath[], scaleX: number, scaleY: number): GeometryPath[];
|
|
23
|
+
/**
|
|
24
|
+
* Build the init props for a deep-copy clone of `src`.
|
|
25
|
+
* Shares logic between SceneGraph.cloneTree and instance child cloning.
|
|
26
|
+
* Explicitly deep-copies all mutable object/array fields that `...rest`
|
|
27
|
+
* would otherwise share by reference. When adding a mutable SceneNode field,
|
|
28
|
+
* add its copy behavior here or document why sharing is intentional.
|
|
29
|
+
*/
|
|
30
|
+
type NodeCloneMode = 'deep' | 'fig-import';
|
|
31
|
+
declare function cloneNodeProps(src: SceneNode, componentId: string | null, mode?: NodeCloneMode): Partial<SceneNode>;
|
|
32
|
+
//#endregion
|
|
33
|
+
//#region src/instances.d.ts
|
|
34
|
+
declare function copyInstanceComponentProps(component: SceneNode): Partial<SceneNode>;
|
|
35
|
+
declare function createInstance(graph: SceneGraph, componentId: string, parentId: string, overrides?: Partial<SceneNode>): SceneNode | null;
|
|
36
|
+
declare function populateInstanceChildren(graph: SceneGraph, instanceId: string, componentId: string, mode?: NodeCloneMode): void;
|
|
37
|
+
declare function swapInstanceComponent(graph: SceneGraph, instanceId: string, componentId: string): void;
|
|
38
|
+
declare function syncInstances(graph: SceneGraph, componentId: string): void;
|
|
39
|
+
declare function detachInstance(graph: SceneGraph, instanceId: string): void;
|
|
40
|
+
declare function getMainComponent(graph: SceneGraph, instanceId: string): SceneNode | undefined;
|
|
41
|
+
declare function getInstances(graph: SceneGraph, componentId: string): SceneNode[];
|
|
42
|
+
//#endregion
|
|
43
|
+
//#region src/snap.d.ts
|
|
44
|
+
interface SnapGuide {
|
|
45
|
+
axis: 'x' | 'y';
|
|
46
|
+
position: number;
|
|
47
|
+
from: number;
|
|
48
|
+
to: number;
|
|
49
|
+
}
|
|
50
|
+
interface SnapResult {
|
|
51
|
+
dx: number;
|
|
52
|
+
dy: number;
|
|
53
|
+
guides: SnapGuide[];
|
|
54
|
+
}
|
|
55
|
+
declare function computeSnap(movingIds: Set<string>, movingBounds: Rect, allNodes: SceneNode[]): SnapResult;
|
|
56
|
+
declare function computeSelectionBounds(nodes: SceneNode[]): Rect | null;
|
|
57
|
+
//#endregion
|
|
58
|
+
//#region src/export-scale.d.ts
|
|
59
|
+
/**
|
|
60
|
+
* Bounds for export scale multipliers. A huge multiplier would allocate an
|
|
61
|
+
* enormous canvas and crash the renderer, so clamp at every boundary the value
|
|
62
|
+
* can enter from: the UI (edits) and the file format (imported/plugin .fig data).
|
|
63
|
+
*/
|
|
64
|
+
declare const MIN_EXPORT_SCALE = 0.01;
|
|
65
|
+
declare const MAX_EXPORT_SCALE = 1024;
|
|
66
|
+
declare function clampExportScale(scale: number): number;
|
|
67
|
+
/** Accept a scale only if it is finite and within bounds (no silent clamping). */
|
|
68
|
+
declare function isValidExportScale(scale: number): boolean;
|
|
69
|
+
//#endregion
|
|
70
|
+
//#region src/geometry.d.ts
|
|
71
|
+
declare function degToRad(degrees: number): number;
|
|
72
|
+
declare function radToDeg(radians: number): number;
|
|
73
|
+
declare function rotatePoint(px: number, py: number, cx: number, cy: number, rad: number): Vector;
|
|
74
|
+
declare function rotatedCorners(cx: number, cy: number, hw: number, hh: number, rotationDeg: number): [Vector, Vector, Vector, Vector];
|
|
75
|
+
declare function rotatedBBox(x: number, y: number, w: number, h: number, rotationDeg: number): {
|
|
76
|
+
left: number;
|
|
77
|
+
right: number;
|
|
78
|
+
top: number;
|
|
79
|
+
bottom: number;
|
|
80
|
+
centerX: number;
|
|
81
|
+
centerY: number;
|
|
82
|
+
};
|
|
83
|
+
interface VisualBounds {
|
|
84
|
+
minX: number;
|
|
85
|
+
minY: number;
|
|
86
|
+
maxX: number;
|
|
87
|
+
maxY: number;
|
|
88
|
+
}
|
|
89
|
+
declare function computeBounds(items: Iterable<Rect>): Rect;
|
|
90
|
+
declare function polygonVertices(node: {
|
|
91
|
+
width: number;
|
|
92
|
+
height: number;
|
|
93
|
+
pointCount: number;
|
|
94
|
+
type: string;
|
|
95
|
+
starInnerRadius: number;
|
|
96
|
+
}): Vector[];
|
|
97
|
+
declare function strokeOverflow(strokes?: Stroke[]): number;
|
|
98
|
+
declare function effectOverflow(effects?: Effect[]): {
|
|
99
|
+
left: number;
|
|
100
|
+
right: number;
|
|
101
|
+
top: number;
|
|
102
|
+
bottom: number;
|
|
103
|
+
};
|
|
104
|
+
declare function computeAbsoluteBounds(nodes: Iterable<{
|
|
105
|
+
id: string;
|
|
106
|
+
width: number;
|
|
107
|
+
height: number;
|
|
108
|
+
}>, getAbsolutePosition: (id: string) => Vector): Rect;
|
|
109
|
+
declare function computeVisualBounds(nodes: Iterable<{
|
|
110
|
+
id: string;
|
|
111
|
+
width: number;
|
|
112
|
+
height: number;
|
|
113
|
+
rotation?: number;
|
|
114
|
+
strokes?: Stroke[];
|
|
115
|
+
effects?: Effect[];
|
|
116
|
+
}>, getAbsolutePosition: (id: string) => Vector): Rect;
|
|
117
|
+
interface VisualBoundsNode {
|
|
118
|
+
id: string;
|
|
119
|
+
width: number;
|
|
120
|
+
height: number;
|
|
121
|
+
rotation?: number;
|
|
122
|
+
flipX?: boolean;
|
|
123
|
+
flipY?: boolean;
|
|
124
|
+
strokes?: Stroke[];
|
|
125
|
+
effects?: Effect[];
|
|
126
|
+
fillGeometry?: Array<{
|
|
127
|
+
commandsBlob: Uint8Array;
|
|
128
|
+
}>;
|
|
129
|
+
strokeGeometry?: Array<{
|
|
130
|
+
commandsBlob: Uint8Array;
|
|
131
|
+
}>;
|
|
132
|
+
childIds?: string[];
|
|
133
|
+
visible?: boolean;
|
|
134
|
+
type?: string;
|
|
135
|
+
clipsContent?: boolean;
|
|
136
|
+
fontSize?: number;
|
|
137
|
+
textDecoration?: string;
|
|
138
|
+
textUnderlineOffset?: number | null;
|
|
139
|
+
textDecorationThickness?: number | null;
|
|
140
|
+
}
|
|
141
|
+
declare function unionVisualBounds(a: VisualBounds | null, b: VisualBounds | null): VisualBounds | null;
|
|
142
|
+
declare function intersectVisualBounds(a: VisualBounds, b: VisualBounds): VisualBounds | null;
|
|
143
|
+
declare function geometryBlobBounds(paths: Array<{
|
|
144
|
+
commandsBlob: Uint8Array;
|
|
145
|
+
}>): Rect | null;
|
|
146
|
+
declare function nodeVisualBounds(node: VisualBoundsNode, getAbsolutePosition: (id: string) => Vector): VisualBounds;
|
|
147
|
+
declare function computeDescendantVisualBounds(nodeIds: string[], getNode: (id: string) => VisualBoundsNode | undefined, getAbsolutePosition: (id: string) => Vector): VisualBounds | null;
|
|
148
|
+
/**
|
|
149
|
+
* Clip a subject polygon against a convex polygon (e.g. the 4 canvas-space
|
|
150
|
+
* corners of a rotated clipping ancestor).
|
|
151
|
+
*
|
|
152
|
+
* Uses Sutherland–Hodgman polygon clipping with centroid-based interior
|
|
153
|
+
* detection, making it robust to either winding order of the clip polygon.
|
|
154
|
+
* Returns the clipped polygon, or null if the subject is fully outside the
|
|
155
|
+
* clip polygon. When `clipCorners` has fewer than 3 points the subject is
|
|
156
|
+
* returned unchanged (no clipping).
|
|
157
|
+
*
|
|
158
|
+
* Preserving the polygon (rather than collapsing to an AABB) lets callers
|
|
159
|
+
* chain multiple clips without reintroducing corners removed by an inner clip.
|
|
160
|
+
*/
|
|
161
|
+
declare function clipPolygon(subject: Vector[], clipCorners: Vector[]): Vector[] | null;
|
|
162
|
+
/**
|
|
163
|
+
* Clip an axis-aligned VisualBounds rectangle against a convex polygon
|
|
164
|
+
* (e.g. the 4 canvas-space corners of a rotated clipping ancestor).
|
|
165
|
+
*
|
|
166
|
+
* Returns the AABB of the intersection, or null if the bounds are fully
|
|
167
|
+
* outside the clip polygon. Delegates to {@link clipPolygon}.
|
|
168
|
+
*
|
|
169
|
+
* For a non-rotated clip (axis-aligned corners) the result is identical
|
|
170
|
+
* to `intersectVisualBounds`.
|
|
171
|
+
*/
|
|
172
|
+
declare function clipBoundsToPolygon(bounds: VisualBounds, clipCorners: Vector[]): VisualBounds | null;
|
|
173
|
+
//#endregion
|
|
174
|
+
//#region src/font-style.d.ts
|
|
175
|
+
interface FontFamilyStyle {
|
|
176
|
+
family: string;
|
|
177
|
+
style: string;
|
|
178
|
+
}
|
|
179
|
+
interface ParsedFontStyle {
|
|
180
|
+
weight: number;
|
|
181
|
+
italic: boolean;
|
|
182
|
+
}
|
|
183
|
+
declare const FONT_WEIGHT_NAMES: Record<number, string>;
|
|
184
|
+
declare function normalizeFontStyleName(style: string): string;
|
|
185
|
+
declare function parseFontStyle(style: string | undefined): ParsedFontStyle;
|
|
186
|
+
declare function styleToWeight(style: string | undefined): number;
|
|
187
|
+
declare function normalizeFontFamily(family: string): string;
|
|
188
|
+
declare function styleToVariant(style: string): string;
|
|
189
|
+
declare function weightToStyle(weight: number, italic?: boolean): string;
|
|
190
|
+
//#endregion
|
|
191
|
+
//#region src/shared-styles.d.ts
|
|
192
|
+
declare const STYLE_REF_KEYS: {
|
|
193
|
+
readonly fill: "fillStyleId";
|
|
194
|
+
readonly stroke: "strokeStyleId";
|
|
195
|
+
readonly text: "textStyleId";
|
|
196
|
+
readonly effect: "effectStyleId";
|
|
197
|
+
readonly grid: "gridStyleId";
|
|
198
|
+
};
|
|
199
|
+
declare function sharedStyleRefKey(kind: SharedStyleKind): (typeof STYLE_REF_KEYS)[SharedStyleKind];
|
|
200
|
+
declare function sharedStyleTypeForKind(kind: SharedStyleKind): SharedStyleType;
|
|
201
|
+
declare function getSharedStyles(graph: SceneGraph, kind: SharedStyleKind): SharedStyle[];
|
|
202
|
+
declare function styleDetachmentChanges(node: SceneNode, changes: Partial<SceneNode>): Partial<SceneNode>;
|
|
203
|
+
//#endregion
|
|
204
|
+
//#region src/index.d.ts
|
|
205
|
+
declare function generateId(): string;
|
|
206
|
+
declare class SceneGraph {
|
|
207
|
+
nodes: Map<string, SceneNode>;
|
|
208
|
+
images: Map<string, Uint8Array<ArrayBufferLike>>;
|
|
209
|
+
variables: Map<string, Variable>;
|
|
210
|
+
variableCollections: Map<string, VariableCollection>;
|
|
211
|
+
activeMode: Map<string, string>;
|
|
212
|
+
rootId: string;
|
|
213
|
+
figKiwiVersion: number | null;
|
|
214
|
+
/** Deflated kiwi schema bytes from the original .fig file, preserved for roundtrip fidelity. */
|
|
215
|
+
figSchemaDeflated: Uint8Array | null;
|
|
216
|
+
documentColorSpace: DocumentColorSpace;
|
|
217
|
+
readonly emitter: Emitter<SceneGraphEvents>;
|
|
218
|
+
private absPosCache;
|
|
219
|
+
private previewMutationDepth;
|
|
220
|
+
private sourceMetadataPreservationDepth;
|
|
221
|
+
private layoutMutationDepth;
|
|
222
|
+
positionPreviewVersion: number;
|
|
223
|
+
instanceIndex: Map<string, Set<string>>;
|
|
224
|
+
constructor();
|
|
225
|
+
addPage(name: string): SceneNode;
|
|
226
|
+
getPages(includeInternal?: boolean): SceneNode[];
|
|
227
|
+
getAllNodes(): Iterable<SceneNode>;
|
|
228
|
+
getNode(id: string): SceneNode | undefined;
|
|
229
|
+
onNodeEvents(handlers: SceneGraphEventHandlers): () => void;
|
|
230
|
+
countDescendants(nodeId: string): number;
|
|
231
|
+
addVariable(variable: Variable): void;
|
|
232
|
+
removeVariable(id: string): void;
|
|
233
|
+
addCollection(collection: VariableCollection): void;
|
|
234
|
+
createVariable(name: string, type: VariableType, collectionId: string, value?: VariableValue): Variable;
|
|
235
|
+
createCollection(name: string): VariableCollection;
|
|
236
|
+
removeCollection(id: string): void;
|
|
237
|
+
getActiveModeId(collectionId: string): string;
|
|
238
|
+
getNodeVariableModeId(nodeId: string, collectionId: string): string;
|
|
239
|
+
setActiveMode(collectionId: string, modeId: string): void;
|
|
240
|
+
addMode(collectionId: string, modeId: string, name: string, sourceMode?: string): void;
|
|
241
|
+
removeMode(collectionId: string, modeId: string): void;
|
|
242
|
+
renameMode(collectionId: string, modeId: string, name: string): void;
|
|
243
|
+
setDefaultMode(collectionId: string, modeId: string): void;
|
|
244
|
+
resolveVariable(variableId: string, modeId?: string, visited?: Set<string>): VariableValue | undefined;
|
|
245
|
+
resolveColorVariable(variableId: string): Color | undefined;
|
|
246
|
+
resolveNumberVariable(variableId: string): number | undefined;
|
|
247
|
+
resolveColorVariableForNode(nodeId: string, variableId: string): Color | undefined;
|
|
248
|
+
resolveNumberVariableForNode(nodeId: string, variableId: string): number | undefined;
|
|
249
|
+
getVariablesForCollection(collectionId: string): Variable[];
|
|
250
|
+
getVariablesByType(type: VariableType): Variable[];
|
|
251
|
+
bindVariable(nodeId: string, field: string, variableId: string): void;
|
|
252
|
+
unbindVariable(nodeId: string, field: string): void;
|
|
253
|
+
getChildren(id: string): SceneNode[];
|
|
254
|
+
isContainer(id: string): boolean;
|
|
255
|
+
isDescendant(childId: string, ancestorId: string): boolean;
|
|
256
|
+
clearAbsPosCache(): void;
|
|
257
|
+
getAbsolutePosition(id: string): Vector;
|
|
258
|
+
getAbsoluteBounds(id: string): Rect;
|
|
259
|
+
private generateNodeId;
|
|
260
|
+
private registerNode;
|
|
261
|
+
createNode(type: NodeType, parentId: string, overrides?: Partial<SceneNode>): SceneNode;
|
|
262
|
+
createNodeWithId(id: string, type: NodeType, parentId: string | null, overrides?: Partial<SceneNode>): SceneNode;
|
|
263
|
+
static TEXT_PICTURE_KEYS: ReadonlySet<string>;
|
|
264
|
+
static GLYPH_AFFECTING_KEYS: ReadonlySet<string>;
|
|
265
|
+
static LAYOUT_AFFECTING_KEYS: ReadonlySet<string>;
|
|
266
|
+
runPreviewUpdates(fn: () => void): void;
|
|
267
|
+
preserveSourceMetadataDuring(fn: () => void): void;
|
|
268
|
+
withLayoutMutations(fn: () => void): void;
|
|
269
|
+
get isApplyingLayout(): boolean;
|
|
270
|
+
updateNodePositionPreview(id: string, x: number, y: number): void;
|
|
271
|
+
updateNodePreview(id: string, changes: Partial<SceneNode>): void;
|
|
272
|
+
updateNode(id: string, changes: Partial<SceneNode>): void;
|
|
273
|
+
reparentNode(nodeId: string, newParentId: string): void;
|
|
274
|
+
reorderChild(nodeId: string, parentId: string, insertIndex: number): void;
|
|
275
|
+
insertChildAt(childId: string, parentId: string, index: number): void;
|
|
276
|
+
deleteNode(id: string): void;
|
|
277
|
+
hitTest(px: number, py: number, scopeId?: string): SceneNode | null;
|
|
278
|
+
hitTestDeep(px: number, py: number, scopeId?: string): SceneNode | null;
|
|
279
|
+
hitTestFrame(px: number, py: number, excludeIds: Set<string>, scopeId?: string): SceneNode | null;
|
|
280
|
+
cloneTree(sourceId: string, parentId: string, overrides?: Partial<SceneNode>): SceneNode | null;
|
|
281
|
+
createInstance(componentId: string, parentId: string, overrides?: Partial<SceneNode>): SceneNode | null;
|
|
282
|
+
populateInstanceChildren(instanceId: string, componentId: string, mode?: NodeCloneMode): void;
|
|
283
|
+
swapInstanceComponent(instanceId: string, componentId: string): void;
|
|
284
|
+
syncInstances(componentId: string): void;
|
|
285
|
+
detachInstance(instanceId: string): void;
|
|
286
|
+
getMainComponent(instanceId: string): SceneNode | undefined;
|
|
287
|
+
getInstances(componentId: string): SceneNode[];
|
|
288
|
+
flattenTree(parentId?: string, depth?: number): Array<{
|
|
289
|
+
node: SceneNode;
|
|
290
|
+
depth: number;
|
|
291
|
+
}>;
|
|
292
|
+
}
|
|
293
|
+
//#endregion
|
|
294
|
+
//#region src/coordinate.d.ts
|
|
295
|
+
declare function getWorldMatrix(node: SceneNode, graph: SceneGraph): Mat3;
|
|
296
|
+
declare function getAbsolutePosition(node: SceneNode, graph: SceneGraph): Vector;
|
|
297
|
+
declare function getAbsoluteRotation(node: SceneNode, graph: SceneGraph): number;
|
|
298
|
+
declare function getAbsolutePositionFull(node: SceneNode, graph: SceneGraph): {
|
|
299
|
+
x: number;
|
|
300
|
+
y: number;
|
|
301
|
+
boundX: number;
|
|
302
|
+
boundY: number;
|
|
303
|
+
width: number;
|
|
304
|
+
height: number;
|
|
305
|
+
rotation: number;
|
|
306
|
+
centerX: number;
|
|
307
|
+
centerY: number;
|
|
308
|
+
};
|
|
309
|
+
declare function getNodeLocalMatrix(n: SceneNode): Mat3;
|
|
310
|
+
declare function getNodeWorldBounds(node: SceneNode): {
|
|
311
|
+
x: number;
|
|
312
|
+
y: number;
|
|
313
|
+
width: number;
|
|
314
|
+
height: number;
|
|
315
|
+
};
|
|
316
|
+
declare function getWorldHandles(node: SceneNode, graph: SceneGraph): {
|
|
317
|
+
nw: {
|
|
318
|
+
x: number;
|
|
319
|
+
y: number;
|
|
320
|
+
};
|
|
321
|
+
n: {
|
|
322
|
+
x: number;
|
|
323
|
+
y: number;
|
|
324
|
+
};
|
|
325
|
+
ne: {
|
|
326
|
+
x: number;
|
|
327
|
+
y: number;
|
|
328
|
+
};
|
|
329
|
+
e: {
|
|
330
|
+
x: number;
|
|
331
|
+
y: number;
|
|
332
|
+
};
|
|
333
|
+
se: {
|
|
334
|
+
x: number;
|
|
335
|
+
y: number;
|
|
336
|
+
};
|
|
337
|
+
s: {
|
|
338
|
+
x: number;
|
|
339
|
+
y: number;
|
|
340
|
+
};
|
|
341
|
+
sw: {
|
|
342
|
+
x: number;
|
|
343
|
+
y: number;
|
|
344
|
+
};
|
|
345
|
+
w: {
|
|
346
|
+
x: number;
|
|
347
|
+
y: number;
|
|
348
|
+
};
|
|
349
|
+
};
|
|
350
|
+
//#endregion
|
|
351
|
+
export { FONT_WEIGHT_NAMES, FontFamilyStyle, MAX_EXPORT_SCALE, MIN_EXPORT_SCALE, NodeCloneMode, ParsedFontStyle, SceneGraph, SnapGuide, SnapResult, VisualBounds, VisualBoundsNode, clampExportScale, clipBoundsToPolygon, clipPolygon, cloneNodeProps, computeAbsoluteBounds, computeBounds, computeDescendantVisualBounds, computeSelectionBounds, computeSnap, computeVisualBounds, copyEffect, copyEffects, copyFill, copyFills, copyGeometryPaths, copyInstanceComponentProps, copyLayoutGrids, copyStroke, copyStrokes, copyStyleRun, copyStyleRuns, createInstance, degToRad, detachInstance, effectOverflow, generateId, geometryBlobBounds, getAbsolutePosition, getAbsolutePositionFull, getAbsoluteRotation, getInstances, getMainComponent, getNodeLocalMatrix, getNodeWorldBounds, getSharedStyles, getWorldHandles, getWorldMatrix, hasSameCopySource, intersectVisualBounds, isValidExportScale, markCopySource, nodeVisualBounds, normalizeFontFamily, normalizeFontStyleName, parseFontStyle, polygonVertices, populateInstanceChildren, radToDeg, rotatePoint, rotatedBBox, rotatedCorners, scaleGeometryPaths, sharedStyleRefKey, sharedStyleTypeForKind, strokeOverflow, styleDetachmentChanges, styleToVariant, styleToWeight, swapInstanceComponent, syncInstances, unionVisualBounds, weightToStyle };
|
|
352
|
+
//# sourceMappingURL=coordinate.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"coordinate.d.ts","names":[],"sources":["../src/copy.ts","../src/instances.ts","../src/snap.ts","../src/export-scale.ts","../src/geometry.ts","../src/font-style.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-0,0 +1,2 @@
|
|
|
1
|
+
import { getAbsolutePosition, getAbsolutePositionFull, getAbsoluteRotation, getNodeLocalMatrix, getNodeWorldBounds, getWorldHandles, getWorldMatrix } from "./chunks/coordinate.js";
|
|
2
|
+
export { getAbsolutePosition, getAbsolutePositionFull, getAbsoluteRotation, getNodeLocalMatrix, getNodeWorldBounds, getWorldHandles, getWorldMatrix };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { getAbsolutePosition, getAbsolutePositionFull, getAbsoluteRotation, getNodeLocalMatrix, getNodeWorldBounds, getWorldHandles, getWorldMatrix } from "./coordinate.js";
|
|
2
|
+
export { getAbsolutePosition, getAbsolutePositionFull, getAbsoluteRotation, getNodeLocalMatrix, getNodeWorldBounds, getWorldHandles, getWorldMatrix };
|
package/dist/copy.d.ts
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { NodeCloneMode, cloneNodeProps, copyEffect, copyEffects, copyFill, copyFills, copyGeometryPaths, copyLayoutGrids, copyStroke, copyStrokes, copyStyleRun, copyStyleRuns, hasSameCopySource, markCopySource, scaleGeometryPaths } from "./coordinate.js";
|
|
2
|
+
export { NodeCloneMode, cloneNodeProps, copyEffect, copyEffects, copyFill, copyFills, copyGeometryPaths, copyLayoutGrids, copyStroke, copyStrokes, copyStyleRun, copyStyleRuns, hasSameCopySource, markCopySource, scaleGeometryPaths };
|
package/dist/copy.js
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { cloneNodeProps, copyEffect, copyEffects, copyFill, copyFills, copyGeometryPaths, copyLayoutGrids, copyStroke, copyStrokes, copyStyleRun, copyStyleRuns, hasSameCopySource, markCopySource, scaleGeometryPaths } from "./chunks/copy.js";
|
|
2
|
+
export { cloneNodeProps, copyEffect, copyEffects, copyFill, copyFills, copyGeometryPaths, copyLayoutGrids, copyStroke, copyStrokes, copyStyleRun, copyStyleRuns, hasSameCopySource, markCopySource, scaleGeometryPaths };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { VisualBounds, VisualBoundsNode, clipBoundsToPolygon, clipPolygon, computeAbsoluteBounds, computeBounds, computeDescendantVisualBounds, computeVisualBounds, degToRad, effectOverflow, geometryBlobBounds, intersectVisualBounds, nodeVisualBounds, polygonVertices, radToDeg, rotatePoint, rotatedBBox, rotatedCorners, strokeOverflow, unionVisualBounds } from "./coordinate.js";
|
|
2
|
+
export { VisualBounds, VisualBoundsNode, clipBoundsToPolygon, clipPolygon, computeAbsoluteBounds, computeBounds, computeDescendantVisualBounds, computeVisualBounds, degToRad, effectOverflow, geometryBlobBounds, intersectVisualBounds, nodeVisualBounds, polygonVertices, radToDeg, rotatePoint, rotatedBBox, rotatedCorners, strokeOverflow, unionVisualBounds };
|