@retikz/core 0.1.0-rc.2 → 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 (105) 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 +14 -6
  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/arrow-geometry.js +1 -1
  19. package/dist/es/compile/path/index.d.ts +9 -3
  20. package/dist/es/compile/path/index.d.ts.map +1 -1
  21. package/dist/es/compile/path/index.js +17 -16
  22. package/dist/es/compile/path/relative.d.ts +10 -4
  23. package/dist/es/compile/path/relative.d.ts.map +1 -1
  24. package/dist/es/compile/path/relative.js +16 -8
  25. package/dist/es/compile/path/shrink.d.ts.map +1 -1
  26. package/dist/es/compile/path/shrink.js +2 -1
  27. package/dist/es/compile/position.d.ts +19 -3
  28. package/dist/es/compile/position.d.ts.map +1 -1
  29. package/dist/es/compile/position.js +28 -8
  30. package/dist/es/compile/scope.d.ts +66 -0
  31. package/dist/es/compile/scope.d.ts.map +1 -0
  32. package/dist/es/compile/scope.js +256 -0
  33. package/dist/es/index.d.ts +3 -3
  34. package/dist/es/index.d.ts.map +1 -1
  35. package/dist/es/index.js +4 -2
  36. package/dist/es/ir/index.d.ts +2 -0
  37. package/dist/es/ir/index.d.ts.map +1 -1
  38. package/dist/es/ir/node.d.ts +1 -1
  39. package/dist/es/ir/node.js +2 -2
  40. package/dist/es/ir/path/arrow.d.ts +3 -1
  41. package/dist/es/ir/path/arrow.d.ts.map +1 -1
  42. package/dist/es/ir/path/arrow.js +5 -3
  43. package/dist/es/ir/path/path.js +1 -1
  44. package/dist/es/ir/scene.d.ts +18 -3542
  45. package/dist/es/ir/scene.d.ts.map +1 -1
  46. package/dist/es/ir/scene.js +11 -3
  47. package/dist/es/ir/scope.d.ts +190 -0
  48. package/dist/es/ir/scope.d.ts.map +1 -0
  49. package/dist/es/ir/scope.js +29 -0
  50. package/dist/es/ir/transform.d.ts +204 -0
  51. package/dist/es/ir/transform.d.ts.map +1 -0
  52. package/dist/es/ir/transform.js +56 -0
  53. package/dist/lib/compile/anchor-cache.cjs +41 -0
  54. package/dist/lib/compile/anchor-cache.d.ts +12 -0
  55. package/dist/lib/compile/anchor-cache.d.ts.map +1 -0
  56. package/dist/lib/compile/compile.cjs +148 -40
  57. package/dist/lib/compile/compile.d.ts +2 -2
  58. package/dist/lib/compile/compile.d.ts.map +1 -1
  59. package/dist/lib/compile/index.d.ts +1 -0
  60. package/dist/lib/compile/index.d.ts.map +1 -1
  61. package/dist/lib/compile/name-stack.cjs +104 -0
  62. package/dist/lib/compile/name-stack.d.ts +81 -0
  63. package/dist/lib/compile/name-stack.d.ts.map +1 -0
  64. package/dist/lib/compile/node.cjs +14 -6
  65. package/dist/lib/compile/node.d.ts +8 -4
  66. package/dist/lib/compile/node.d.ts.map +1 -1
  67. package/dist/lib/compile/path/anchor.cjs +23 -12
  68. package/dist/lib/compile/path/anchor.d.ts +11 -5
  69. package/dist/lib/compile/path/anchor.d.ts.map +1 -1
  70. package/dist/lib/compile/path/arrow-geometry.cjs +1 -1
  71. package/dist/lib/compile/path/index.cjs +17 -16
  72. package/dist/lib/compile/path/index.d.ts +9 -3
  73. package/dist/lib/compile/path/index.d.ts.map +1 -1
  74. package/dist/lib/compile/path/relative.cjs +16 -8
  75. package/dist/lib/compile/path/relative.d.ts +10 -4
  76. package/dist/lib/compile/path/relative.d.ts.map +1 -1
  77. package/dist/lib/compile/path/shrink.cjs +2 -1
  78. package/dist/lib/compile/path/shrink.d.ts.map +1 -1
  79. package/dist/lib/compile/position.cjs +28 -8
  80. package/dist/lib/compile/position.d.ts +19 -3
  81. package/dist/lib/compile/position.d.ts.map +1 -1
  82. package/dist/lib/compile/scope.cjs +261 -0
  83. package/dist/lib/compile/scope.d.ts +66 -0
  84. package/dist/lib/compile/scope.d.ts.map +1 -0
  85. package/dist/lib/index.cjs +5 -0
  86. package/dist/lib/index.d.ts +3 -3
  87. package/dist/lib/index.d.ts.map +1 -1
  88. package/dist/lib/ir/index.d.ts +2 -0
  89. package/dist/lib/ir/index.d.ts.map +1 -1
  90. package/dist/lib/ir/node.cjs +2 -2
  91. package/dist/lib/ir/node.d.ts +1 -1
  92. package/dist/lib/ir/path/arrow.cjs +5 -2
  93. package/dist/lib/ir/path/arrow.d.ts +3 -1
  94. package/dist/lib/ir/path/arrow.d.ts.map +1 -1
  95. package/dist/lib/ir/path/path.cjs +1 -1
  96. package/dist/lib/ir/scene.cjs +11 -3
  97. package/dist/lib/ir/scene.d.ts +18 -3542
  98. package/dist/lib/ir/scene.d.ts.map +1 -1
  99. package/dist/lib/ir/scope.cjs +30 -0
  100. package/dist/lib/ir/scope.d.ts +190 -0
  101. package/dist/lib/ir/scope.d.ts.map +1 -0
  102. package/dist/lib/ir/transform.cjs +56 -0
  103. package/dist/lib/ir/transform.d.ts +204 -0
  104. package/dist/lib/ir/transform.d.ts.map +1 -0
  105. 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,9 +2,9 @@
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';
7
- export { ARROW_SHAPES, HOLLOW_ARROW_SHAPES, ARROW_MARKER_DEFAULT_SIZE, ARROW_MARKER_HOLLOW_DEFAULT_LINE_WIDTH, NODE_SHAPES, NODE_TEXT_ALIGNS, } 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
+ 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<>) */
10
10
  MovePathCommand, LinePathCommand, QuadPathCommand, CubicPathCommand, ArcPathCommand, EllipseArcPathCommand, ClosePathCommand, ArrowEndSpec, GroupPrim, Transform,
@@ -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,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,EAAE,EACF,UAAU,EACV,aAAa,EACb,gB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eAAe,EACf,eAAe,EACf,eAAe,EACf,gBAAgB,EAChB,cAAc,EACd,qBAAqB,EACrB,gBAAgB,EAChB,YAAY,EACZ,SAAS,EACT,SAAS;AACT,6BAA6B;AAC7B,kBAAkB,EAClB,eAAe,EACf,cAAc,EACd,MAAM,EACN,KAAK,GACN,MAAM,aAAa,CAAC;AAGrB,YAAY,EACV,QAAQ,EACR,WAAW,EACX,YAAY,EACZ,cAAc,EACd,cAAc,GACf,MAAM,WAAW,CAAC;AACnB,OAAO,EAAE,aAAa,EAAE,gBAAgB,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAG5E,YAAY,EACV,OAAO,EACP,MAAM,EACN,QAAQ,EACR,MAAM,EACN,eAAe,EACf,QAAQ,EACR,UAAU,GACX,MAAM,WAAW,CAAC;AACnB,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAIhE,YAAY,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"}
package/dist/es/index.js CHANGED
@@ -4,12 +4,14 @@ import { AT_DIRECTIONS, AtPositionSchema } from "./ir/position/at-position.js";
4
4
  import { OffsetPositionSchema } from "./ir/position/offset-position.js";
5
5
  import { FontSchema } from "./ir/font.js";
6
6
  import { LineSpecSchema, TextBlockSchema } from "./ir/text.js";
7
- import { ARROW_MARKER_DEFAULT_SIZE, ARROW_MARKER_HOLLOW_DEFAULT_LINE_WIDTH, ARROW_SHAPES, ArrowDetailSchema, ArrowEndDetailSchema, HOLLOW_ARROW_SHAPES } from "./ir/path/arrow.js";
7
+ import { ARROW_MARKER_DEFAULT_SIZE, ARROW_MARKER_HOLLOW_DEFAULT_LINE_WIDTH, ARROW_SHAPES, ArrowDetailSchema, ArrowEndDetailSchema, DEFAULT_ARROW_SHAPE, HOLLOW_ARROW_SHAPES } from "./ir/path/arrow.js";
8
8
  import { RelativeAccumulateTargetSchema, RelativeTargetSchema, TargetSchema } from "./ir/path/target.js";
9
9
  import { ArcStepSchema, BendStepSchema, CirclePathStepSchema, ControlPointSchema, CubicStepSchema, CurveStepSchema, CycleStepSchema, EllipsePathStepSchema, FoldStepSchema, LineStepSchema, MoveStepSchema, StepLabelSchema, StepSchema } from "./ir/path/step.js";
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, 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"}
@@ -21,7 +21,7 @@ export declare const NODE_TEXT_ALIGNS: {
21
21
  export type NodeTextAlign = ValueOf<typeof NODE_TEXT_ALIGNS>;
22
22
  /**
23
23
  * 节点附属标签 label(TikZ `[label=above:foo]` 同义)
24
- * @description 可挂多个;label 不参与 layout。position 支持 8 方向枚举或数字角度(polar 约定:0°=+x,90°=+y 屏幕下方);默认 position='above',distance=4
24
+ * @description 可挂多个;label 不参与 layout。position 支持 8 方向枚举或数字角度(polar 约定:0°=+x,90°=+y 屏幕下方);默认 position='above',distance=12
25
25
  */
26
26
  export declare const NodeLabelSchema: z.ZodObject<{
27
27
  text: z.ZodString;
@@ -24,12 +24,12 @@ var NODE_TEXT_ALIGNS = {
24
24
  };
25
25
  /**
26
26
  * 节点附属标签 label(TikZ `[label=above:foo]` 同义)
27
- * @description 可挂多个;label 不参与 layout。position 支持 8 方向枚举或数字角度(polar 约定:0°=+x,90°=+y 屏幕下方);默认 position='above',distance=4
27
+ * @description 可挂多个;label 不参与 layout。position 支持 8 方向枚举或数字角度(polar 约定:0°=+x,90°=+y 屏幕下方);默认 position='above',distance=12
28
28
  */
29
29
  var NodeLabelSchema = z.object({
30
30
  text: z.string().describe("Label text content; rendered as a single line."),
31
31
  position: z.union([z.nativeEnum(AT_DIRECTIONS), z.number()]).optional().describe("Placement around the node border: 8-direction enum (above / right / above-left / ...) or numeric angle in degrees (`label=30:foo` for radial placement). Default `above`. Numeric uses the polar convention (0° = +x, 90° = +y, screen-down)."),
32
- distance: z.number().nonnegative().optional().describe("Gap between the node border and the label center, in user units. Default 4."),
32
+ distance: z.number().nonnegative().optional().describe("Gap between the node border and the label center, in user units. Default 12."),
33
33
  textColor: z.string().optional().describe("Label text color; falls back to currentColor."),
34
34
  opacity: z.number().min(0).max(1).optional().describe("Label-only opacity 0..1; multiplied with the node opacity if both are set."),
35
35
  font: FontSchema.optional().describe("Label font overrides; missing fields inherit from the parent node font, then renderer defaults.")
@@ -2,7 +2,7 @@ import { z } from 'zod';
2
2
  import { ValueOf } from '../../types';
3
3
  /**
4
4
  * 箭头形状常量(用 const 而非 TS enum 避免 reverse-mapping 和字面量不互通)
5
- * @description normal 实心三角(默认);open 空心三角(UML 泛化/继承);stealth 尖锐倒钩;diamond 实心菱形(UML 组合);openDiamond 空心菱形(聚合);circle 实心圆点;openCircle 空心圆点
5
+ * @description normal 实心三角;open 空心三角(UML 泛化/继承);stealth 尖锐倒钩(默认);diamond 实心菱形(UML 组合);openDiamond 空心菱形(聚合);circle 实心圆点;openCircle 空心圆点
6
6
  */
7
7
  export declare const ARROW_SHAPES: {
8
8
  readonly normal: "normal";
@@ -15,6 +15,8 @@ export declare const ARROW_SHAPES: {
15
15
  };
16
16
  /** 箭头形状字面量类型 */
17
17
  export type ArrowShape = ValueOf<typeof ARROW_SHAPES>;
18
+ /** 箭头默认形状 */
19
+ export declare const DEFAULT_ARROW_SHAPE: "stealth";
18
20
  /**
19
21
  * 空心 shape 集合(fill 字段在这些 shape 上 silent no-op)
20
22
  * @description compile 与 render 都引用此表判定 fill 是否丢弃;空心 shape 用 color 主导描边、lineWidth 控描边粗
@@ -1 +1 @@
1
- {"version":3,"file":"arrow.d.ts","sourceRoot":"","sources":["../../../../src/ir/path/arrow.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC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mBAAmB,iBAA6D,CAAC;AAE9F,wCAAwC;AACxC,eAAO,MAAM,yBAAyB,IAAI,CAAC;AAE3C,0CAA0C;AAC1C,eAAO,MAAM,sCAAsC,MAAM,CAAC;AAE1D;;;GAGG;AACH,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA2D9B,CAAC;AAEJ;;;GAGG;AACH,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAS7B,CAAC;AAEF,gBAAgB;AAChB,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC;AACpE,mBAAmB;AACnB,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC"}
@@ -2,7 +2,7 @@ import { z } from "zod";
2
2
  //#region src/ir/path/arrow.ts
3
3
  /**
4
4
  * 箭头形状常量(用 const 而非 TS enum 避免 reverse-mapping 和字面量不互通)
5
- * @description normal 实心三角(默认);open 空心三角(UML 泛化/继承);stealth 尖锐倒钩;diamond 实心菱形(UML 组合);openDiamond 空心菱形(聚合);circle 实心圆点;openCircle 空心圆点
5
+ * @description normal 实心三角;open 空心三角(UML 泛化/继承);stealth 尖锐倒钩(默认);diamond 实心菱形(UML 组合);openDiamond 空心菱形(聚合);circle 实心圆点;openCircle 空心圆点
6
6
  */
7
7
  var ARROW_SHAPES = {
8
8
  normal: "normal",
@@ -13,6 +13,8 @@ var ARROW_SHAPES = {
13
13
  circle: "circle",
14
14
  openCircle: "openCircle"
15
15
  };
16
+ /** 箭头默认形状 */
17
+ var DEFAULT_ARROW_SHAPE = ARROW_SHAPES.stealth;
16
18
  /**
17
19
  * 空心 shape 集合(fill 字段在这些 shape 上 silent no-op)
18
20
  * @description compile 与 render 都引用此表判定 fill 是否丢弃;空心 shape 用 color 主导描边、lineWidth 控描边粗
@@ -31,7 +33,7 @@ var ARROW_MARKER_HOLLOW_DEFAULT_LINE_WIDTH = 1.5;
31
33
  * @description 顶层 8 字段全 optional;fill 在空心 shape 上 silent no-op(schema 不拒绝、compile/render 丢字段);start/end 子对象用相同字段集(无 start/end 递归)
32
34
  */
33
35
  var ArrowEndDetailSchema = z.object({
34
- shape: z.nativeEnum(ARROW_SHAPES).optional().describe("Arrow tip shape. Defaults to `normal` (filled triangle). Other values: `open` (hollow triangle), `stealth` (sharp barb), `diamond`, `openDiamond`, `circle`, `openCircle`."),
36
+ shape: z.nativeEnum(ARROW_SHAPES).optional().describe("Arrow tip shape. Defaults to `stealth` (sharp barb). Other values: `normal` (filled triangle), `open` (hollow triangle), `diamond`, `openDiamond`, `circle`, `openCircle`."),
35
37
  scale: z.number().positive().optional().describe("Uniform tip scale factor; multiplies `length` and `width` (e.g. `length=10, scale=1.5` → effective 15). Defaults to 1."),
36
38
  length: z.number().nonnegative().optional().describe("Tip length in user units (the dimension along the path direction). Defaults to ~6."),
37
39
  width: z.number().nonnegative().optional().describe("Tip width in user units (perpendicular to the path). Defaults to ~6."),
@@ -49,4 +51,4 @@ var ArrowDetailSchema = ArrowEndDetailSchema.extend({
49
51
  end: ArrowEndDetailSchema.optional().describe("End-end override (effective only when `arrow` includes an end arrow: `->` / `<->`). Fields merge into the top-level defaults; omitted fields inherit, present fields override.")
50
52
  }).describe("Path-level arrow detail. Top-level visual fields (shape / scale / length / width / color / fill / opacity / lineWidth) act as shared defaults for both ends; `start` / `end` sub-objects per-field override the defaults.");
51
53
  //#endregion
52
- export { ARROW_MARKER_DEFAULT_SIZE, ARROW_MARKER_HOLLOW_DEFAULT_LINE_WIDTH, ARROW_SHAPES, ArrowDetailSchema, ArrowEndDetailSchema, HOLLOW_ARROW_SHAPES };
54
+ export { ARROW_MARKER_DEFAULT_SIZE, ARROW_MARKER_HOLLOW_DEFAULT_LINE_WIDTH, ARROW_SHAPES, ArrowDetailSchema, ArrowEndDetailSchema, DEFAULT_ARROW_SHAPE, HOLLOW_ARROW_SHAPES };
@@ -13,7 +13,7 @@ var PathSchema = z.object({
13
13
  "<-",
14
14
  "<->"
15
15
  ]).optional().describe("Path-level arrow direction. omitted/`none` = no arrows; `->` = arrow at end; `<-` = at start; `<->` = both."),
16
- arrowDetail: ArrowDetailSchema.optional().describe("Detailed arrow visual config (shape / scale / length / width / color / fill / opacity / lineWidth) with optional `start` / `end` per-end overrides. Omitted = built-in defaults (shape `normal`, all visuals inherit from path stroke / opacity)."),
16
+ arrowDetail: ArrowDetailSchema.optional().describe("Detailed arrow visual config (shape / scale / length / width / color / fill / opacity / lineWidth) with optional `start` / `end` per-end overrides. Omitted = built-in defaults (shape `stealth`, all visuals inherit from path stroke / opacity)."),
17
17
  fill: z.string().optional().describe("Fill color of the closed region; any CSS color. Omitted = no fill (stroke only). Pairs with `cycle` step for filled shapes."),
18
18
  fillRule: z.enum(["nonzero", "evenodd"]).optional().describe("How self-intersecting / nested sub-paths are filled. `nonzero` (default) winds-by-direction; `evenodd` toggles fill on each crossing — useful for ring / donut shapes."),
19
19
  lineCap: z.enum([