@retikz/core 0.1.0 → 0.2.0-alpha.1

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.
Files changed (87) hide show
  1. package/dist/es/compile/anchor-cache.d.ts +12 -0
  2. package/dist/es/compile/anchor-cache.d.ts.map +1 -0
  3. package/dist/es/compile/anchor-cache.js +41 -0
  4. package/dist/es/compile/compile.d.ts +2 -2
  5. package/dist/es/compile/compile.d.ts.map +1 -1
  6. package/dist/es/compile/compile.js +148 -40
  7. package/dist/es/compile/index.d.ts +1 -0
  8. package/dist/es/compile/index.d.ts.map +1 -1
  9. package/dist/es/compile/name-stack.d.ts +81 -0
  10. package/dist/es/compile/name-stack.d.ts.map +1 -0
  11. package/dist/es/compile/name-stack.js +104 -0
  12. package/dist/es/compile/node.d.ts +8 -4
  13. package/dist/es/compile/node.d.ts.map +1 -1
  14. package/dist/es/compile/node.js +13 -5
  15. package/dist/es/compile/path/anchor.d.ts +11 -5
  16. package/dist/es/compile/path/anchor.d.ts.map +1 -1
  17. package/dist/es/compile/path/anchor.js +24 -13
  18. package/dist/es/compile/path/index.d.ts +9 -3
  19. package/dist/es/compile/path/index.d.ts.map +1 -1
  20. package/dist/es/compile/path/index.js +17 -16
  21. package/dist/es/compile/path/relative.d.ts +10 -4
  22. package/dist/es/compile/path/relative.d.ts.map +1 -1
  23. package/dist/es/compile/path/relative.js +16 -8
  24. package/dist/es/compile/position.d.ts +19 -3
  25. package/dist/es/compile/position.d.ts.map +1 -1
  26. package/dist/es/compile/position.js +28 -8
  27. package/dist/es/compile/scope.d.ts +66 -0
  28. package/dist/es/compile/scope.d.ts.map +1 -0
  29. package/dist/es/compile/scope.js +256 -0
  30. package/dist/es/index.d.ts +2 -2
  31. package/dist/es/index.d.ts.map +1 -1
  32. package/dist/es/index.js +3 -1
  33. package/dist/es/ir/index.d.ts +2 -0
  34. package/dist/es/ir/index.d.ts.map +1 -1
  35. package/dist/es/ir/scene.d.ts +18 -3542
  36. package/dist/es/ir/scene.d.ts.map +1 -1
  37. package/dist/es/ir/scene.js +11 -3
  38. package/dist/es/ir/scope.d.ts +190 -0
  39. package/dist/es/ir/scope.d.ts.map +1 -0
  40. package/dist/es/ir/scope.js +29 -0
  41. package/dist/es/ir/transform.d.ts +204 -0
  42. package/dist/es/ir/transform.d.ts.map +1 -0
  43. package/dist/es/ir/transform.js +56 -0
  44. package/dist/lib/compile/anchor-cache.cjs +41 -0
  45. package/dist/lib/compile/anchor-cache.d.ts +12 -0
  46. package/dist/lib/compile/anchor-cache.d.ts.map +1 -0
  47. package/dist/lib/compile/compile.cjs +148 -40
  48. package/dist/lib/compile/compile.d.ts +2 -2
  49. package/dist/lib/compile/compile.d.ts.map +1 -1
  50. package/dist/lib/compile/index.d.ts +1 -0
  51. package/dist/lib/compile/index.d.ts.map +1 -1
  52. package/dist/lib/compile/name-stack.cjs +104 -0
  53. package/dist/lib/compile/name-stack.d.ts +81 -0
  54. package/dist/lib/compile/name-stack.d.ts.map +1 -0
  55. package/dist/lib/compile/node.cjs +13 -5
  56. package/dist/lib/compile/node.d.ts +8 -4
  57. package/dist/lib/compile/node.d.ts.map +1 -1
  58. package/dist/lib/compile/path/anchor.cjs +23 -12
  59. package/dist/lib/compile/path/anchor.d.ts +11 -5
  60. package/dist/lib/compile/path/anchor.d.ts.map +1 -1
  61. package/dist/lib/compile/path/index.cjs +17 -16
  62. package/dist/lib/compile/path/index.d.ts +9 -3
  63. package/dist/lib/compile/path/index.d.ts.map +1 -1
  64. package/dist/lib/compile/path/relative.cjs +16 -8
  65. package/dist/lib/compile/path/relative.d.ts +10 -4
  66. package/dist/lib/compile/path/relative.d.ts.map +1 -1
  67. package/dist/lib/compile/position.cjs +28 -8
  68. package/dist/lib/compile/position.d.ts +19 -3
  69. package/dist/lib/compile/position.d.ts.map +1 -1
  70. package/dist/lib/compile/scope.cjs +261 -0
  71. package/dist/lib/compile/scope.d.ts +66 -0
  72. package/dist/lib/compile/scope.d.ts.map +1 -0
  73. package/dist/lib/index.cjs +4 -0
  74. package/dist/lib/index.d.ts +2 -2
  75. package/dist/lib/index.d.ts.map +1 -1
  76. package/dist/lib/ir/index.d.ts +2 -0
  77. package/dist/lib/ir/index.d.ts.map +1 -1
  78. package/dist/lib/ir/scene.cjs +11 -3
  79. package/dist/lib/ir/scene.d.ts +18 -3542
  80. package/dist/lib/ir/scene.d.ts.map +1 -1
  81. package/dist/lib/ir/scope.cjs +30 -0
  82. package/dist/lib/ir/scope.d.ts +190 -0
  83. package/dist/lib/ir/scope.d.ts.map +1 -0
  84. package/dist/lib/ir/transform.cjs +56 -0
  85. package/dist/lib/ir/transform.d.ts +204 -0
  86. package/dist/lib/ir/transform.d.ts.map +1 -0
  87. package/package.json +1 -1
@@ -0,0 +1,256 @@
1
+ import { rect } from "../geometry/rect.js";
2
+ import { resolvePosition } from "./position.js";
3
+ //#region src/compile/scope.ts
4
+ /**
5
+ * 把 IR 6 变体 transforms 展平为 Scene 3 变体(Cartesian translate / rotate / scale)
6
+ * @description 4 个 translate 变体(translate / polar-translate / at-translate / offset-translate)
7
+ * 各自构造对应 Position 字面量并调用 `resolvePosition` 拿到 Cartesian (x, y),再写成 Cartesian translate;
8
+ * rotate / scale 直接透传。referent 未解析时返回 null(上游负责发 warn / throw)
9
+ */
10
+ var lowerScopeTransforms = (transforms, nameStack, nodeDistance) => {
11
+ const out = [];
12
+ for (const t of transforms) switch (t.kind) {
13
+ case "translate":
14
+ out.push({
15
+ kind: "translate",
16
+ x: t.x,
17
+ y: t.y
18
+ });
19
+ break;
20
+ case "polar-translate": {
21
+ const polar = {
22
+ angle: t.angle,
23
+ radius: t.radius
24
+ };
25
+ if (t.origin !== void 0) polar.origin = t.origin;
26
+ const resolved = resolvePosition(polar, nameStack, nodeDistance);
27
+ if (!resolved) return null;
28
+ out.push({
29
+ kind: "translate",
30
+ x: resolved[0],
31
+ y: resolved[1]
32
+ });
33
+ break;
34
+ }
35
+ case "at-translate": {
36
+ const at = {
37
+ direction: t.direction,
38
+ of: t.of
39
+ };
40
+ if (t.distance !== void 0) at.distance = t.distance;
41
+ const resolved = resolvePosition(at, nameStack, nodeDistance);
42
+ if (!resolved) return null;
43
+ out.push({
44
+ kind: "translate",
45
+ x: resolved[0],
46
+ y: resolved[1]
47
+ });
48
+ break;
49
+ }
50
+ case "offset-translate": {
51
+ const resolved = resolvePosition({
52
+ of: t.of,
53
+ offset: t.offset ?? [0, 0]
54
+ }, nameStack, nodeDistance);
55
+ if (!resolved) return null;
56
+ out.push({
57
+ kind: "translate",
58
+ x: resolved[0],
59
+ y: resolved[1]
60
+ });
61
+ break;
62
+ }
63
+ case "rotate": {
64
+ const r = {
65
+ kind: "rotate",
66
+ degrees: t.degrees
67
+ };
68
+ if (t.cx !== void 0) r.cx = t.cx;
69
+ if (t.cy !== void 0) r.cy = t.cy;
70
+ out.push(r);
71
+ break;
72
+ }
73
+ case "scale": {
74
+ const s = {
75
+ kind: "scale",
76
+ x: t.x
77
+ };
78
+ if (t.y !== void 0) s.y = t.y;
79
+ out.push(s);
80
+ break;
81
+ }
82
+ }
83
+ return out;
84
+ };
85
+ /**
86
+ * 把局部坐标点 (x, y) 按 Cartesian-only transform 链 apply 到全局坐标
87
+ * @description 数组语义与 SVG `transform="t0 t1 t2"` / TikZ scope option 顺序一致:
88
+ * array[0] 是最外层(最后 apply 到 local),array[last] 是最内层(最先 apply);
89
+ * 即对局部点 P,结果 = t0(t1(t2(P)))。实现上从数组尾部往头部迭代依次 apply。
90
+ * 只接受已被 `lowerScopeTransforms` 展平后的 3 变体(translate / rotate / scale)
91
+ */
92
+ var applyTransformChain = (local, chain) => {
93
+ let x = local[0];
94
+ let y = local[1];
95
+ for (let i = chain.length - 1; i >= 0; i--) {
96
+ const t = chain[i];
97
+ if (t.kind === "translate") {
98
+ x += t.x;
99
+ y += t.y;
100
+ } else if (t.kind === "rotate") {
101
+ const cx = t.cx ?? 0;
102
+ const cy = t.cy ?? 0;
103
+ const rad = t.degrees * Math.PI / 180;
104
+ const cos = Math.cos(rad);
105
+ const sin = Math.sin(rad);
106
+ const dx = x - cx;
107
+ const dy = y - cy;
108
+ x = cx + dx * cos - dy * sin;
109
+ y = cy + dx * sin + dy * cos;
110
+ } else {
111
+ const sy = t.y ?? t.x;
112
+ x *= t.x;
113
+ y *= sy;
114
+ }
115
+ }
116
+ return [x, y];
117
+ };
118
+ /**
119
+ * 把全局坐标点反向投影回 scope 局部坐标系(`applyTransformChain` 的逆)
120
+ * @description chain = [t0, t1, t2](array[0] 最外层、最后 apply)的逆 =
121
+ * 按数组正序应用每个 transform 的逆:t0^-1 / t1^-1 / t2^-1。
122
+ * translate(-x, -y) / rotate(-deg, cx, cy) / scale(1/x, 1/y)。
123
+ * scale 分量为 0 时反向投影未定义——退化为返回原点 (0, 0) 当前层,避免 NaN 污染下游。
124
+ * 作用:referent 全局点 → 当前 scope 局部坐标系,配合 `applyTransformChain` 实现
125
+ * "referent 全局 + relative 部分在当前 scope 局部度量 + 末端正向投影回全局" 的语义。
126
+ */
127
+ var inverseTransformChain = (global, chain) => {
128
+ let x = global[0];
129
+ let y = global[1];
130
+ for (const t of chain) if (t.kind === "translate") {
131
+ x -= t.x;
132
+ y -= t.y;
133
+ } else if (t.kind === "rotate") {
134
+ const cx = t.cx ?? 0;
135
+ const cy = t.cy ?? 0;
136
+ const rad = -t.degrees * Math.PI / 180;
137
+ const cos = Math.cos(rad);
138
+ const sin = Math.sin(rad);
139
+ const dx = x - cx;
140
+ const dy = y - cy;
141
+ x = cx + dx * cos - dy * sin;
142
+ y = cy + dx * sin + dy * cos;
143
+ } else {
144
+ const sy = t.y ?? t.x;
145
+ if (t.x === 0 || sy === 0) {
146
+ x = 0;
147
+ y = 0;
148
+ continue;
149
+ }
150
+ x /= t.x;
151
+ y /= sy;
152
+ }
153
+ return [x, y];
154
+ };
155
+ /**
156
+ * 复制 NodeLayout 并把 rect 中心点 + rotate + 尺寸全部按 scope transform chain 投到全局
157
+ * @description rect 中心走 `applyTransformChain`;chain 里的 rotate 累加到 `rect.rotate`(弧度)、
158
+ * scale 乘进 rect.width / height / margin——这样 path 端点的 boundary clip 取的是与 SVG `<g>`
159
+ * 实际渲染一致的视觉尺寸 / 朝向,跨 / 入 / 出 rotate / scale scope 的 path 都贴节点视觉边界。
160
+ * 非均匀 scale 与 rotate 在 chain 中混合时,按"累加 rotate + 分量相乘 scale"近似(uniform scale 精确,
161
+ * anisotropic + rotate 的剪切耦合不展开——alpha 阶段限制)。
162
+ */
163
+ var projectLayoutToGlobal = (layout, chain) => {
164
+ const [gx, gy] = applyTransformChain([layout.rect.x, layout.rect.y], chain);
165
+ let rotateAccumRad = 0;
166
+ let scaleX = 1;
167
+ let scaleY = 1;
168
+ for (const t of chain) if (t.kind === "rotate") rotateAccumRad += t.degrees * Math.PI / 180;
169
+ else if (t.kind === "scale") {
170
+ scaleX *= t.x;
171
+ scaleY *= t.y ?? t.x;
172
+ }
173
+ const globalRect = {
174
+ ...layout.rect,
175
+ x: gx,
176
+ y: gy,
177
+ rotate: (layout.rect.rotate ?? 0) + rotateAccumRad,
178
+ width: layout.rect.width * scaleX,
179
+ height: layout.rect.height * scaleY
180
+ };
181
+ const marginScale = Math.max(Math.abs(scaleX), Math.abs(scaleY));
182
+ return {
183
+ ...layout,
184
+ rect: globalRect,
185
+ margin: layout.margin * marginScale
186
+ };
187
+ };
188
+ /**
189
+ * 收集一组 NodeLayout 的全局 axis-aligned bounding box
190
+ * @description 每个 layout 的 4 角点已是全局坐标系(Pass 1 累积 chain apply 后),
191
+ * 取每个 layout 的 rotate-aware `north-west` / `north-east` / `south-west` / `south-east`
192
+ * 4 角点(rect.anchor 已含 layout.rect.rotate 处理)并求 AABB;
193
+ * layout 是 0×0(coordinate / 空 scope 占位)时退化为单点也合法;
194
+ * 空 layouts 数组返回 null(调用方按"empty scope + fallback origin"退化为 0×0 占位)
195
+ */
196
+ var computeScopeBoundingBox = (layouts) => {
197
+ if (layouts.length === 0) return null;
198
+ let minX = Infinity;
199
+ let minY = Infinity;
200
+ let maxX = -Infinity;
201
+ let maxY = -Infinity;
202
+ for (const layout of layouts) {
203
+ const corners = [
204
+ rect.anchor(layout.rect, "north-west"),
205
+ rect.anchor(layout.rect, "north-east"),
206
+ rect.anchor(layout.rect, "south-west"),
207
+ rect.anchor(layout.rect, "south-east")
208
+ ];
209
+ for (const [cx, cy] of corners) {
210
+ if (cx < minX) minX = cx;
211
+ if (cy < minY) minY = cy;
212
+ if (cx > maxX) maxX = cx;
213
+ if (cy > maxY) maxY = cy;
214
+ }
215
+ }
216
+ return {
217
+ x: (minX + maxX) / 2,
218
+ y: (minY + maxY) / 2,
219
+ width: maxX - minX,
220
+ height: maxY - minY
221
+ };
222
+ };
223
+ /**
224
+ * 用 scope id + bbox 构造 synthetic rectangle NodeLayout
225
+ * @description bbox 为 null 时退化为 fallbackOrigin 的 0×0 占位(空 scope 仍要有可引用句柄)。
226
+ * synthetic layout 完全复用 rectangle 路径:`scope.id.<keyword>` / `scope.id.<deg>` / `scope.id` 作为 referent
227
+ * 走与普通 rectangle Node 完全一致的 anchorOf / boundaryPointOf / 中心点取值
228
+ */
229
+ var registerScopeAsLayout = (id, bbox, fallbackOrigin) => {
230
+ const box = bbox ?? {
231
+ x: fallbackOrigin[0],
232
+ y: fallbackOrigin[1],
233
+ width: 0,
234
+ height: 0
235
+ };
236
+ return {
237
+ id,
238
+ shape: "rectangle",
239
+ rect: {
240
+ x: box.x,
241
+ y: box.y,
242
+ width: box.width,
243
+ height: box.height,
244
+ rotate: 0
245
+ },
246
+ rotateDeg: 0,
247
+ margin: 0,
248
+ textWidth: box.width,
249
+ textHeight: box.height,
250
+ align: "middle",
251
+ lineHeight: 0,
252
+ fontSize: 0
253
+ };
254
+ };
255
+ //#endregion
256
+ export { applyTransformChain, computeScopeBoundingBox, inverseTransformChain, lowerScopeTransforms, projectLayoutToGlobal, registerScopeAsLayout };
@@ -2,8 +2,8 @@
2
2
  * @retikz/core 公开 API
3
3
  * @description 任何 framework adapter(@retikz/react、@retikz/vue、@retikz/canvas、@retikz/ssr)只能 import 本文件导出内容,不准走子路径。本包零 React/零 DOM 依赖
4
4
  */
5
- export { PositionSchema, PolarPositionSchema, AtPositionSchema, OffsetPositionSchema, AT_DIRECTIONS, TargetSchema, RelativeTargetSchema, RelativeAccumulateTargetSchema, MoveStepSchema, LineStepSchema, FoldStepSchema, CycleStepSchema, CurveStepSchema, CubicStepSchema, BendStepSchema, ArcStepSchema, CirclePathStepSchema, EllipsePathStepSchema, ControlPointSchema, StepLabelSchema, StepSchema, NodeSchema, NodeLabelSchema, CoordinateSchema, FontSchema, TextBlockSchema, LineSpecSchema, PathSchema, ArrowDetailSchema, ArrowEndDetailSchema, ChildSchema, SceneSchema, CURRENT_IR_VERSION, } from './ir';
6
- export type { IRPosition, IRAtPosition, IROffsetPosition, AtDirection, IRTarget, IRRelativeTarget, IRRelativeAccumulateTarget, IRMoveStep, IRLineStep, IRFoldStep, IRCycleStep, IRCurveStep, IRCubicStep, IRBendStep, IRArcStep, IRCirclePathStep, IREllipsePathStep, IRControlPoint, IRStepLabel, IRStep, IRNode, IRNodeLabel, IRCoordinate, IRFont, IRLineSpec, IRTextBlock, IRPath, IRChild, IR, ArrowShape, IRArrowDetail, IRArrowEndDetail, NodeShape, NodeTextAlign, } from './ir';
5
+ export { PositionSchema, PolarPositionSchema, AtPositionSchema, OffsetPositionSchema, AT_DIRECTIONS, TargetSchema, RelativeTargetSchema, RelativeAccumulateTargetSchema, MoveStepSchema, LineStepSchema, FoldStepSchema, CycleStepSchema, CurveStepSchema, CubicStepSchema, BendStepSchema, ArcStepSchema, CirclePathStepSchema, EllipsePathStepSchema, ControlPointSchema, StepLabelSchema, StepSchema, NodeSchema, NodeLabelSchema, CoordinateSchema, FontSchema, TextBlockSchema, LineSpecSchema, PathSchema, ArrowDetailSchema, ArrowEndDetailSchema, ScopeSchema, TransformSchema, ChildSchema, SceneSchema, CURRENT_IR_VERSION, } from './ir';
6
+ export type { IRPosition, IRAtPosition, IROffsetPosition, AtDirection, IRTarget, IRRelativeTarget, IRRelativeAccumulateTarget, IRMoveStep, IRLineStep, IRFoldStep, IRCycleStep, IRCurveStep, IRCubicStep, IRBendStep, IRArcStep, IRCirclePathStep, IREllipsePathStep, IRControlPoint, IRStepLabel, IRStep, IRNode, IRNodeLabel, IRCoordinate, IRFont, IRLineSpec, IRTextBlock, IRPath, IRScope, IRTransform, IRTranslateTransform, IRPolarTranslateTransform, IRAtTranslateTransform, IROffsetTranslateTransform, IRRotateTransform, IRScaleTransform, IRChild, IR, ArrowShape, IRArrowDetail, IRArrowEndDetail, NodeShape, NodeTextAlign, } from './ir';
7
7
  export { ARROW_SHAPES, DEFAULT_ARROW_SHAPE, HOLLOW_ARROW_SHAPES, ARROW_MARKER_DEFAULT_SIZE, ARROW_MARKER_HOLLOW_DEFAULT_LINE_WIDTH, NODE_SHAPES, NODE_TEXT_ALIGNS, } from './ir';
8
8
  export type { ScenePrimitive, RectPrim, EllipsePrim, TextPrim, TextLine, PathPrim, PathCommand,
9
9
  /** 7 个 named PathCommand 分支(便于 wrapper / Pick<>) */
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EACL,cAAc,EACd,mBAAmB,EACnB,gBAAgB,EAChB,oBAAoB,EACpB,aAAa,EACb,YAAY,EACZ,oBAAoB,EACpB,8BAA8B,EAC9B,cAAc,EACd,cAAc,EACd,cAAc,EACd,eAAe,EACf,eAAe,EACf,eAAe,EACf,cAAc,EACd,aAAa,EACb,oBAAoB,EACpB,qBAAqB,EACrB,kBAAkB,EAClB,eAAe,EACf,UAAU,EACV,UAAU,EACV,eAAe,EACf,gBAAgB,EAChB,UAAU,EACV,eAAe,EACf,cAAc,EACd,UAAU,EACV,iBAAiB,EACjB,oBAAoB,EACpB,WAAW,EACX,WAAW,EACX,kBAAkB,GACnB,MAAM,MAAM,CAAC;AACd,YAAY,EACV,U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Y,EACV,QAAQ,EACR,IAAI,EACJ,UAAU,EACV,MAAM,EACN,OAAO,EACP,OAAO,EACP,aAAa,GACd,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,YAAY,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AAGxF,YAAY,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EACL,cAAc,EACd,mBAAmB,EACnB,gBAAgB,EAChB,oBAAoB,EACpB,aAAa,EACb,YAAY,EACZ,oBAAoB,EACpB,8BAA8B,EAC9B,cAAc,EACd,cAAc,EACd,cAAc,EACd,eAAe,EACf,eAAe,EACf,eAAe,EACf,cAAc,EACd,aAAa,EACb,oBAAoB,EACpB,qBAAqB,EACrB,kBAAkB,EAClB,eAAe,EACf,UAAU,EACV,UAAU,EACV,eAAe,EACf,gBAAgB,EAChB,UAAU,EACV,eAAe,EACf,cAAc,EACd,UAAU,EACV,iBAAiB,EACjB,oBAAoB,EACpB,WAAW,EACX,eAAe,EACf,WAAW,EACX,WAAW,EACX,kBAAkB,GACnB,MAAM,MAAM,CAAC;AACd,YAAY,EACV,UAAU,EACV,YAAY,EACZ,gBAAgB,EAChB,WAAW,EACX,QAAQ,EACR,gBAAgB,EAChB,0BAA0B,EAC1B,UAAU,EACV,UAAU,EACV,UAAU,EACV,WAAW,EACX,WAAW,EACX,WAAW,EACX,UAAU,EACV,SAAS,EACT,gBAAgB,EAChB,iBAAiB,EACjB,cAAc,EACd,WAAW,EACX,MAAM,EACN,MAAM,EACN,WAAW,EACX,YAAY,EACZ,MAAM,EACN,UAAU,EACV,WAAW,EACX,MAAM,EACN,OAAO,EACP,WAAW,EACX,oBAAoB,EACpB,yBAAyB,EACzB,sBAAsB,EACtB,0BAA0B,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,CAAC"}
package/dist/es/index.js CHANGED
@@ -10,6 +10,8 @@ import { ArcStepSchema, BendStepSchema, CirclePathStepSchema, ControlPointSchema
10
10
  import { PathSchema } from "./ir/path/path.js";
11
11
  import { NODE_SHAPES, NODE_TEXT_ALIGNS, NodeLabelSchema, NodeSchema } from "./ir/node.js";
12
12
  import { CoordinateSchema } from "./ir/coordinate.js";
13
+ import { TransformSchema } from "./ir/transform.js";
14
+ import { ScopeSchema } from "./ir/scope.js";
13
15
  import { CURRENT_IR_VERSION, ChildSchema, SceneSchema } from "./ir/scene.js";
14
16
  import { RECT_ANCHORS, rect } from "./geometry/rect.js";
15
17
  import { circle } from "./geometry/circle.js";
@@ -22,4 +24,4 @@ import { parseTargetSugar } from "./parsers/parseTargetSugar.js";
22
24
  import { DrawWay, parseWay } from "./parsers/parseWay.js";
23
25
  import { polar } from "./geometry/polar.js";
24
26
  import { point } from "./geometry/point.js";
25
- export { ARROW_MARKER_DEFAULT_SIZE, ARROW_MARKER_HOLLOW_DEFAULT_LINE_WIDTH, ARROW_SHAPES, AT_DIRECTIONS, ArcStepSchema, ArrowDetailSchema, ArrowEndDetailSchema, AtPositionSchema, BendStepSchema, CURRENT_IR_VERSION, ChildSchema, CirclePathStepSchema, ControlPointSchema, CoordinateSchema, CubicStepSchema, CurveStepSchema, CycleStepSchema, DEFAULT_ARROW_SHAPE, DrawWay, EllipsePathStepSchema, FoldStepSchema, FontSchema, HOLLOW_ARROW_SHAPES, LineSpecSchema, LineStepSchema, MoveStepSchema, NODE_SHAPES, NODE_TEXT_ALIGNS, NodeLabelSchema, NodeSchema, OffsetPositionSchema, PathSchema, PolarPositionSchema, PositionSchema, RECT_ANCHORS, RelativeAccumulateTargetSchema, RelativeTargetSchema, SceneSchema, StepLabelSchema, StepSchema, TargetSchema, TextBlockSchema, circle, compileToScene, computeLayout, diamond, ellipse, fallbackMeasurer, parseTargetSugar, parseWay, point, polar, rect };
27
+ export { ARROW_MARKER_DEFAULT_SIZE, ARROW_MARKER_HOLLOW_DEFAULT_LINE_WIDTH, ARROW_SHAPES, AT_DIRECTIONS, ArcStepSchema, ArrowDetailSchema, ArrowEndDetailSchema, AtPositionSchema, BendStepSchema, CURRENT_IR_VERSION, ChildSchema, CirclePathStepSchema, ControlPointSchema, CoordinateSchema, CubicStepSchema, CurveStepSchema, CycleStepSchema, DEFAULT_ARROW_SHAPE, DrawWay, EllipsePathStepSchema, FoldStepSchema, FontSchema, HOLLOW_ARROW_SHAPES, LineSpecSchema, LineStepSchema, MoveStepSchema, NODE_SHAPES, NODE_TEXT_ALIGNS, NodeLabelSchema, NodeSchema, OffsetPositionSchema, PathSchema, PolarPositionSchema, PositionSchema, RECT_ANCHORS, RelativeAccumulateTargetSchema, RelativeTargetSchema, SceneSchema, ScopeSchema, StepLabelSchema, StepSchema, TargetSchema, TextBlockSchema, TransformSchema, circle, compileToScene, computeLayout, diamond, ellipse, fallbackMeasurer, parseTargetSugar, parseWay, point, polar, rect };
@@ -4,5 +4,7 @@ export * from './text';
4
4
  export * from './path';
5
5
  export * from './node';
6
6
  export * from './coordinate';
7
+ export * from './transform';
8
+ export * from './scope';
7
9
  export * from './scene';
8
10
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/ir/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,QAAQ,CAAC;AACvB,cAAc,QAAQ,CAAC;AACvB,cAAc,QAAQ,CAAC;AACvB,cAAc,QAAQ,CAAC;AACvB,cAAc,cAAc,CAAC;AAC7B,cAAc,SAAS,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/ir/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,QAAQ,CAAC;AACvB,cAAc,QAAQ,CAAC;AACvB,cAAc,QAAQ,CAAC;AACvB,cAAc,QAAQ,CAAC;AACvB,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC"}