@retikz/core 0.2.0-alpha.5 → 0.2.0-alpha.6

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 (123) hide show
  1. package/dist/es/compile/anchor-cache.d.ts +10 -0
  2. package/dist/es/compile/anchor-cache.d.ts.map +1 -1
  3. package/dist/es/compile/anchor-cache.js +25 -1
  4. package/dist/es/compile/index.d.ts +0 -1
  5. package/dist/es/compile/index.d.ts.map +1 -1
  6. package/dist/es/compile/path/anchor.d.ts.map +1 -1
  7. package/dist/es/compile/path/anchor.js +17 -18
  8. package/dist/es/compile/path/index.d.ts.map +1 -1
  9. package/dist/es/compile/path/index.js +10 -4
  10. package/dist/es/geometry/_edge.d.ts +29 -0
  11. package/dist/es/geometry/_edge.d.ts.map +1 -0
  12. package/dist/es/geometry/_edge.js +35 -0
  13. package/dist/es/geometry/circle.d.ts +3 -0
  14. package/dist/es/geometry/circle.d.ts.map +1 -1
  15. package/dist/es/geometry/circle.js +7 -0
  16. package/dist/es/geometry/diamond.d.ts +3 -0
  17. package/dist/es/geometry/diamond.d.ts.map +1 -1
  18. package/dist/es/geometry/diamond.js +29 -0
  19. package/dist/es/geometry/ellipse.d.ts +3 -0
  20. package/dist/es/geometry/ellipse.d.ts.map +1 -1
  21. package/dist/es/geometry/ellipse.js +7 -0
  22. package/dist/es/geometry/rect.d.ts +3 -0
  23. package/dist/es/geometry/rect.d.ts.map +1 -1
  24. package/dist/es/geometry/rect.js +6 -0
  25. package/dist/es/index.d.ts +3 -3
  26. package/dist/es/index.d.ts.map +1 -1
  27. package/dist/es/index.js +5 -4
  28. package/dist/es/ir/coordinate.d.ts +2 -2
  29. package/dist/es/ir/node.d.ts +2 -2
  30. package/dist/es/ir/path/path.d.ts +662 -167
  31. package/dist/es/ir/path/path.d.ts.map +1 -1
  32. package/dist/es/ir/path/step.d.ts +930 -192
  33. package/dist/es/ir/path/step.d.ts.map +1 -1
  34. package/dist/es/ir/path/target.d.ts +71 -1
  35. package/dist/es/ir/path/target.d.ts.map +1 -1
  36. package/dist/es/ir/path/target.js +24 -3
  37. package/dist/es/ir/scope.d.ts +932 -194
  38. package/dist/es/ir/scope.d.ts.map +1 -1
  39. package/dist/es/parsers/index.d.ts +1 -0
  40. package/dist/es/parsers/index.d.ts.map +1 -1
  41. package/dist/es/parsers/parseNodeTarget.d.ts +4 -0
  42. package/dist/es/parsers/parseNodeTarget.d.ts.map +1 -0
  43. package/dist/es/parsers/parseNodeTarget.js +33 -0
  44. package/dist/es/parsers/parseTargetSugar.d.ts +4 -2
  45. package/dist/es/parsers/parseTargetSugar.d.ts.map +1 -1
  46. package/dist/es/parsers/parseTargetSugar.js +6 -3
  47. package/dist/es/parsers/parseWay.d.ts +1 -1
  48. package/dist/es/parsers/parseWay.d.ts.map +1 -1
  49. package/dist/es/shapes/circle.d.ts.map +1 -1
  50. package/dist/es/shapes/circle.js +1 -0
  51. package/dist/es/shapes/diamond.d.ts.map +1 -1
  52. package/dist/es/shapes/diamond.js +1 -0
  53. package/dist/es/shapes/ellipse.d.ts.map +1 -1
  54. package/dist/es/shapes/ellipse.js +1 -0
  55. package/dist/es/shapes/rectangle.d.ts.map +1 -1
  56. package/dist/es/shapes/rectangle.js +1 -0
  57. package/dist/es/shapes/types.d.ts +6 -0
  58. package/dist/es/shapes/types.d.ts.map +1 -1
  59. package/dist/lib/compile/anchor-cache.cjs +25 -0
  60. package/dist/lib/compile/anchor-cache.d.ts +10 -0
  61. package/dist/lib/compile/anchor-cache.d.ts.map +1 -1
  62. package/dist/lib/compile/index.d.ts +0 -1
  63. package/dist/lib/compile/index.d.ts.map +1 -1
  64. package/dist/lib/compile/path/anchor.cjs +16 -17
  65. package/dist/lib/compile/path/anchor.d.ts.map +1 -1
  66. package/dist/lib/compile/path/index.cjs +10 -4
  67. package/dist/lib/compile/path/index.d.ts.map +1 -1
  68. package/dist/lib/geometry/_edge.cjs +38 -0
  69. package/dist/lib/geometry/_edge.d.ts +29 -0
  70. package/dist/lib/geometry/_edge.d.ts.map +1 -0
  71. package/dist/lib/geometry/circle.cjs +7 -0
  72. package/dist/lib/geometry/circle.d.ts +3 -0
  73. package/dist/lib/geometry/circle.d.ts.map +1 -1
  74. package/dist/lib/geometry/diamond.cjs +29 -0
  75. package/dist/lib/geometry/diamond.d.ts +3 -0
  76. package/dist/lib/geometry/diamond.d.ts.map +1 -1
  77. package/dist/lib/geometry/ellipse.cjs +7 -0
  78. package/dist/lib/geometry/ellipse.d.ts +3 -0
  79. package/dist/lib/geometry/ellipse.d.ts.map +1 -1
  80. package/dist/lib/geometry/rect.cjs +6 -0
  81. package/dist/lib/geometry/rect.d.ts +3 -0
  82. package/dist/lib/geometry/rect.d.ts.map +1 -1
  83. package/dist/lib/index.cjs +6 -2
  84. package/dist/lib/index.d.ts +3 -3
  85. package/dist/lib/index.d.ts.map +1 -1
  86. package/dist/lib/ir/coordinate.d.ts +2 -2
  87. package/dist/lib/ir/node.d.ts +2 -2
  88. package/dist/lib/ir/path/path.d.ts +662 -167
  89. package/dist/lib/ir/path/path.d.ts.map +1 -1
  90. package/dist/lib/ir/path/step.d.ts +930 -192
  91. package/dist/lib/ir/path/step.d.ts.map +1 -1
  92. package/dist/lib/ir/path/target.cjs +25 -2
  93. package/dist/lib/ir/path/target.d.ts +71 -1
  94. package/dist/lib/ir/path/target.d.ts.map +1 -1
  95. package/dist/lib/ir/scope.d.ts +932 -194
  96. package/dist/lib/ir/scope.d.ts.map +1 -1
  97. package/dist/lib/parsers/index.d.ts +1 -0
  98. package/dist/lib/parsers/index.d.ts.map +1 -1
  99. package/dist/lib/parsers/parseNodeTarget.cjs +33 -0
  100. package/dist/lib/parsers/parseNodeTarget.d.ts +4 -0
  101. package/dist/lib/parsers/parseNodeTarget.d.ts.map +1 -0
  102. package/dist/lib/parsers/parseTargetSugar.cjs +6 -3
  103. package/dist/lib/parsers/parseTargetSugar.d.ts +4 -2
  104. package/dist/lib/parsers/parseTargetSugar.d.ts.map +1 -1
  105. package/dist/lib/parsers/parseWay.d.ts +1 -1
  106. package/dist/lib/parsers/parseWay.d.ts.map +1 -1
  107. package/dist/lib/shapes/circle.cjs +1 -0
  108. package/dist/lib/shapes/circle.d.ts.map +1 -1
  109. package/dist/lib/shapes/diamond.cjs +1 -0
  110. package/dist/lib/shapes/diamond.d.ts.map +1 -1
  111. package/dist/lib/shapes/ellipse.cjs +1 -0
  112. package/dist/lib/shapes/ellipse.d.ts.map +1 -1
  113. package/dist/lib/shapes/rectangle.cjs +1 -0
  114. package/dist/lib/shapes/rectangle.d.ts.map +1 -1
  115. package/dist/lib/shapes/types.d.ts +6 -0
  116. package/dist/lib/shapes/types.d.ts.map +1 -1
  117. package/package.json +1 -1
  118. package/dist/es/compile/parseTarget.d.ts +0 -20
  119. package/dist/es/compile/parseTarget.d.ts.map +0 -1
  120. package/dist/es/compile/parseTarget.js +0 -36
  121. package/dist/lib/compile/parseTarget.cjs +0 -36
  122. package/dist/lib/compile/parseTarget.d.ts +0 -20
  123. package/dist/lib/compile/parseTarget.d.ts.map +0 -1
@@ -1,5 +1,7 @@
1
1
  const require__transform = require("./_transform.cjs");
2
+ const require__edge = require("./_edge.cjs");
2
3
  //#region src/geometry/ellipse.ts
4
+ var DEG_TO_RAD = Math.PI / 180;
3
5
  var SQRT_HALF = Math.SQRT1_2;
4
6
  /** 椭圆相关基础工具 */
5
7
  var ellipse = {
@@ -61,6 +63,11 @@ var ellipse = {
61
63
  const b = ly / e.ry;
62
64
  const t = 1 / Math.sqrt(a * a + b * b);
63
65
  return require__transform.localToWorld(e, [lx * t, ly * t]);
66
+ },
67
+ /** 边上比例点:side 的 90° 周长弧段 t∈[0,1] 处(等角,落真实椭圆周;含旋转) */
68
+ edgePoint: (e, side, t) => {
69
+ const rad = require__edge.edgeAngleDeg(side, t) * DEG_TO_RAD;
70
+ return require__transform.localToWorld(e, [e.rx * Math.cos(rad), e.ry * Math.sin(rad)]);
64
71
  }
65
72
  };
66
73
  //#endregion
@@ -1,3 +1,4 @@
1
+ import { Side } from './_edge';
1
2
  import { Position } from './point';
2
3
  import { RectAnchor } from './rect';
3
4
  /** 椭圆:中心 + 半长轴 rx / 半短轴 ry + 可选旋转 */
@@ -27,5 +28,7 @@ export declare const ellipse: {
27
28
  * @description 椭圆方程 (x/rx)² + (y/ry)² = 1;沿 (lx,ly) 缩放 t 倍命中 t = 1 / √((lx/rx)² + (ly/ry)²)
28
29
  */
29
30
  boundaryPoint: (e: Ellipse, toward: Position) => Position;
31
+ /** 边上比例点:side 的 90° 周长弧段 t∈[0,1] 处(等角,落真实椭圆周;含旋转) */
32
+ edgePoint: (e: Ellipse, side: Side, t: number) => Position;
30
33
  };
31
34
  //# sourceMappingURL=ellipse.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ellipse.d.ts","sourceRoot":"","sources":["../../../src/geometry/ellipse.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AACxC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;AAEzC,qCAAqC;AACrC,MAAM,MAAM,OAAO,GAAG;IACpB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,aAAa;IACb,EAAE,EAAE,MAAM,CAAC;IACX,aAAa;IACb,EAAE,EAAE,MAAM,CAAC;IACX,cAAc;IACd,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,CAAC;AAIF,eAAe;AACf,eAAO,MAAM,OAAO;IAClB,SAAS;gBACG,OAAO,KAAG,QAAQ;IAC9B,0BAA0B;kBACZ,OAAO,KAAK,QAAQ,KAAG,OAAO;IAI9C;;;OAGG;gBACW,OAAO,QAAQ,UAAU,KAAG,QAAQ;IAqClD;;;OAGG;uBACkB,OAAO,UAAU,QAAQ,KAAG,QAAQ;CAQxD,CAAC"}
1
+ {"version":3,"file":"ellipse.d.ts","sourceRoot":"","sources":["../../../src/geometry/ellipse.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,IAAI,EAAgB,MAAM,SAAS,CAAC;AAClD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AACxC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;AAIzC,qCAAqC;AACrC,MAAM,MAAM,OAAO,GAAG;IACpB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,aAAa;IACb,EAAE,EAAE,MAAM,CAAC;IACX,aAAa;IACb,EAAE,EAAE,MAAM,CAAC;IACX,cAAc;IACd,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,CAAC;AAIF,eAAe;AACf,eAAO,MAAM,OAAO;IAClB,SAAS;gBACG,OAAO,KAAG,QAAQ;IAC9B,0BAA0B;kBACZ,OAAO,KAAK,QAAQ,KAAG,OAAO;IAI9C;;;OAGG;gBACW,OAAO,QAAQ,UAAU,KAAG,QAAQ;IAqClD;;;OAGG;uBACkB,OAAO,UAAU,QAAQ,KAAG,QAAQ;IAQvD,qDAAqD;mBACtC,OAAO,QAAQ,IAAI,KAAK,MAAM,KAAG,QAAQ;CAIzD,CAAC"}
@@ -1,4 +1,5 @@
1
1
  const require__transform = require("./_transform.cjs");
2
+ const require__edge = require("./_edge.cjs");
2
3
  //#region src/geometry/rect.ts
3
4
  /** 矩形 9 个标准 anchor 名常量(与 RectAnchor 配对,用 RECT_ANCHORS.NORTH 避免拼错) */
4
5
  var RECT_ANCHORS = {
@@ -71,6 +72,11 @@ var rect = {
71
72
  const ty = localY === 0 ? Infinity : halfH / Math.abs(localY);
72
73
  const t = Math.min(tx, ty);
73
74
  return require__transform.localToWorld(r, [localX * t, localY * t]);
75
+ },
76
+ /** 边上比例点:side 直边 t∈[0,1] 处(两角 anchor 线性插值,含旋转);方向见 EDGE_ENDS */
77
+ edgePoint: (r, side, t) => {
78
+ const [a, b] = require__edge.EDGE_ENDS[side];
79
+ return require__edge.lerpPoint(rect.anchor(r, a), rect.anchor(r, b), t);
74
80
  }
75
81
  };
76
82
  /**
@@ -1,3 +1,4 @@
1
+ import { Side } from './_edge';
1
2
  import { Position } from './point';
2
3
  /** 轴对齐矩形:几何中心 + 宽高 + 可选绕中心旋转 */
3
4
  export type Rect = {
@@ -31,6 +32,8 @@ export declare const rect: {
31
32
  anchor: (r: Rect, name: RectAnchor) => Position;
32
33
  /** 从中心向 toward 方向射线与矩形边界交点(含旋转),Path 端点贴 Node 边界用 */
33
34
  boundaryPoint: (r: Rect, toward: Position) => Position;
35
+ /** 边上比例点:side 直边 t∈[0,1] 处(两角 anchor 线性插值,含旋转);方向见 EDGE_ENDS */
36
+ edgePoint: (r: Rect, side: Side, t: number) => Position;
34
37
  };
35
38
  /** rectOutline 的命令算子(供 compile 翻译为 PathCommand;几何在 core 下沉,便于未来 rectangle node shape 复用) */
36
39
  export type RectOutlineOp = {
@@ -1 +1 @@
1
- {"version":3,"file":"rect.d.ts","sourceRoot":"","sources":["../../../src/geometry/rect.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAExC,gCAAgC;AAChC,MAAM,MAAM,IAAI,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,cAAc;IACd,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,qEAAqE;AACrE,eAAO,MAAM,YAAY;;;;;;;;;;CAUf,CAAC;AAEX,+BAA+B;AAC/B,MAAM,MAAM,UAAU,GAAG,CAAC,OAAO,YAAY,CAAC,CAAC,MAAM,OAAO,YAAY,CAAC,CAAC;AAE1E,eAAO,MAAM,IAAI;IACf,WAAW;gBACC,IAAI,KAAG,QAAQ;IAC3B,uBAAuB;kBACT,IAAI,KAAK,QAAQ,KAAG,OAAO;IAMzC,sCAAsC;gBAC1B,IAAI,QAAQ,UAAU,KAAG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IAAI,KAAG,QAAQ;IAC3B,uBAAuB;kBACT,IAAI,KAAK,QAAQ,KAAG,OAAO;IAMzC,sCAAsC;gBAC1B,IAAI,QAAQ,UAAU,KAAG,QAAQ;IAuC7C,qDAAqD;uBAClC,IAAI,UAAU,QAAQ,KAAG,QAAQ;IAUpD,gEAAgE;mBACjD,IAAI,QAAQ,IAAI,KAAK,MAAM,KAAG,QAAQ;CAItD,CAAC;AAEF,4FAA4F;AAC5F,MAAM,MAAM,aAAa,GACrB;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,EAAE,EAAE,QAAQ,CAAA;CAAE,GAC9B;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,EAAE,EAAE,QAAQ,CAAA;CAAE,GAC9B;IAAE,IAAI,EAAE,KAAK,CAAC;IAAC,MAAM,EAAE,QAAQ,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC;IAAC,UAAU,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAA;CAAE,GACvF;IAAE,IAAI,EAAE,OAAO,CAAA;CAAE,CAAC;AAEtB;;;;;GAKG;AACH,eAAO,MAAM,WAAW,GACtB,MAAM,QAAQ,EACd,IAAI,QAAQ,EACZ,iBAAiB,MAAM,KACtB,KAAK,CAAC,aAAa,CAgCrB,CAAC"}
@@ -6,6 +6,8 @@ const require_offset_position = require("./ir/position/offset-position.cjs");
6
6
  const require_font = require("./ir/font.cjs");
7
7
  const require_text = require("./ir/text.cjs");
8
8
  const require_arrow = require("./ir/path/arrow.cjs");
9
+ const require__transform = require("./geometry/_transform.cjs");
10
+ const require_rect = require("./geometry/rect.cjs");
9
11
  const require_target = require("./ir/path/target.cjs");
10
12
  const require_step = require("./ir/path/step.cjs");
11
13
  const require_path = require("./ir/path/path.cjs");
@@ -14,8 +16,6 @@ const require_coordinate = require("./ir/coordinate.cjs");
14
16
  const require_transform = require("./ir/transform.cjs");
15
17
  const require_scope = require("./ir/scope.cjs");
16
18
  const require_scene = require("./ir/scene.cjs");
17
- const require__transform = require("./geometry/_transform.cjs");
18
- const require_rect = require("./geometry/rect.cjs");
19
19
  const require_circle = require("./geometry/circle.cjs");
20
20
  const require_ellipse = require("./geometry/ellipse.cjs");
21
21
  const require_diamond = require("./geometry/diamond.cjs");
@@ -23,6 +23,7 @@ const require_index = require("./shapes/index.cjs");
23
23
  const require_text_metrics = require("./compile/text-metrics.cjs");
24
24
  const require_layout = require("./compile/layout.cjs");
25
25
  const require_compile = require("./compile/compile.cjs");
26
+ const require_parseNodeTarget = require("./parsers/parseNodeTarget.cjs");
26
27
  const require_parseTargetSugar = require("./parsers/parseTargetSugar.cjs");
27
28
  const require_parseWay = require("./parsers/parseWay.cjs");
28
29
  const require_polar = require("./geometry/polar.cjs");
@@ -31,6 +32,7 @@ exports.ARROW_MARKER_DEFAULT_SIZE = require_arrow.ARROW_MARKER_DEFAULT_SIZE;
31
32
  exports.ARROW_MARKER_HOLLOW_DEFAULT_LINE_WIDTH = require_arrow.ARROW_MARKER_HOLLOW_DEFAULT_LINE_WIDTH;
32
33
  exports.ARROW_SHAPES = require_arrow.ARROW_SHAPES;
33
34
  exports.AT_DIRECTIONS = require_at_position.AT_DIRECTIONS;
35
+ exports.AnchorRefSchema = require_target.AnchorRefSchema;
34
36
  exports.ArcStepSchema = require_step.ArcStepSchema;
35
37
  exports.ArrowDefaultSchema = require_scope.ArrowDefaultSchema;
36
38
  exports.ArrowDetailSchema = require_arrow.ArrowDetailSchema;
@@ -61,6 +63,7 @@ exports.NODE_TEXT_ALIGNS = require_node.NODE_TEXT_ALIGNS;
61
63
  exports.NodeDefaultSchema = require_scope.NodeDefaultSchema;
62
64
  exports.NodeLabelSchema = require_node.NodeLabelSchema;
63
65
  exports.NodeSchema = require_node.NodeSchema;
66
+ exports.NodeTargetSchema = require_target.NodeTargetSchema;
64
67
  exports.OffsetPositionSchema = require_offset_position.OffsetPositionSchema;
65
68
  exports.PathDefaultSchema = require_scope.PathDefaultSchema;
66
69
  exports.PathSchema = require_path.PathSchema;
@@ -84,6 +87,7 @@ exports.diamond = require_diamond.diamond;
84
87
  exports.ellipse = require_ellipse.ellipse;
85
88
  exports.fallbackMeasurer = require_text_metrics.fallbackMeasurer;
86
89
  exports.localToWorld = require__transform.localToWorld;
90
+ exports.parseNodeTarget = require_parseNodeTarget.parseNodeTarget;
87
91
  exports.parseTargetSugar = require_parseTargetSugar.parseTargetSugar;
88
92
  exports.parseWay = require_parseWay.parseWay;
89
93
  exports.point = require_point.point;
@@ -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, RectangleStepSchema, ControlPointSchema, StepLabelSchema, StepSchema, NodeSchema, NodeLabelSchema, CoordinateSchema, FontSchema, TextBlockSchema, LineSpecSchema, PathSchema, ArrowDetailSchema, ArrowEndDetailSchema, ScopeSchema, NodeDefaultSchema, PathDefaultSchema, LabelDefaultSchema, ArrowDefaultSchema, 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, IRRectangleStep, IRControlPoint, IRStepLabel, IRStep, IRNode, IRNodeLabel, IRCoordinate, IRFont, IRLineSpec, IRTextBlock, IRPath, IRScope, IRNodeDefault, IRPathDefault, IRLabelDefault, IRArrowDefault, StyleChannel, IRTransform, IRTranslateTransform, IRPolarTranslateTransform, IRAtTranslateTransform, IROffsetTranslateTransform, IRRotateTransform, IRScaleTransform, IRChild, IR, ArrowShape, IRArrowDetail, IRArrowEndDetail, NodeShape, BuiltinShapeName, NodeTextAlign, } from './ir';
5
+ export { PositionSchema, PolarPositionSchema, AtPositionSchema, OffsetPositionSchema, AT_DIRECTIONS, TargetSchema, AnchorRefSchema, NodeTargetSchema, RelativeTargetSchema, RelativeAccumulateTargetSchema, MoveStepSchema, LineStepSchema, FoldStepSchema, CycleStepSchema, CurveStepSchema, CubicStepSchema, BendStepSchema, ArcStepSchema, CirclePathStepSchema, EllipsePathStepSchema, RectangleStepSchema, ControlPointSchema, StepLabelSchema, StepSchema, NodeSchema, NodeLabelSchema, CoordinateSchema, FontSchema, TextBlockSchema, LineSpecSchema, PathSchema, ArrowDetailSchema, ArrowEndDetailSchema, ScopeSchema, NodeDefaultSchema, PathDefaultSchema, LabelDefaultSchema, ArrowDefaultSchema, TransformSchema, ChildSchema, SceneSchema, CURRENT_IR_VERSION, } from './ir';
6
+ export type { IRPosition, IRAtPosition, IROffsetPosition, AtDirection, IRTarget, IRAnchorRef, IRNodeTarget, IRRelativeTarget, IRRelativeAccumulateTarget, IRMoveStep, IRLineStep, IRFoldStep, IRCycleStep, IRCurveStep, IRCubicStep, IRBendStep, IRArcStep, IRCirclePathStep, IREllipsePathStep, IRRectangleStep, IRControlPoint, IRStepLabel, IRStep, IRNode, IRNodeLabel, IRCoordinate, IRFont, IRLineSpec, IRTextBlock, IRPath, IRScope, IRNodeDefault, IRPathDefault, IRLabelDefault, IRArrowDefault, StyleChannel, IRTransform, IRTranslateTransform, IRPolarTranslateTransform, IRAtTranslateTransform, IROffsetTranslateTransform, IRRotateTransform, IRScaleTransform, IRChild, IR, ArrowShape, IRArrowDetail, IRArrowEndDetail, NodeShape, BuiltinShapeName, 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<>) */
@@ -13,7 +13,7 @@ TranslateTransform, RotateTransform, ScaleTransform, Layout, Scene, } from './pr
13
13
  export type { FontSpec, TextMetrics, TextMeasurer, CompileOptions, CompileWarning, } from './compile';
14
14
  export { computeLayout, fallbackMeasurer, compileToScene } from './compile';
15
15
  export type { WayItem, WayDSL, WayCycle, WayVia, WayRelativeItem, WayLabel, WayLabelOp, } from './parsers';
16
- export { parseWay, DrawWay, parseTargetSugar } from './parsers';
16
+ export { parseWay, DrawWay, parseTargetSugar, parseNodeTarget } from './parsers';
17
17
  export type { Position, Rect, RectAnchor, Circle, Ellipse, Diamond, PolarPosition, } from './geometry';
18
18
  export { point, rect, circle, ellipse, diamond, RECT_ANCHORS, polar } from './geometry';
19
19
  export type { ShapeDefinition, ShapeStyle } from './shapes';
@@ -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,mBAAmB,EACnB,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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N,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,eAAe,EAAE,MAAM,WAAW,CAAC;AAIjF,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,eAAe,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAC5D,OAAO,EAAE,cAAc,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAGtE,YAAY,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC"}
@@ -39,6 +39,7 @@ export declare const CoordinateSchema: z.ZodObject<{
39
39
  }>]>;
40
40
  }, "strip", z.ZodTypeAny, {
41
41
  type: "coordinate";
42
+ id: string;
42
43
  position: [number, number] | import('./position').PolarPosition | {
43
44
  direction: "above" | "below" | "left" | "right" | "above-left" | "above-right" | "below-left" | "below-right";
44
45
  of: string;
@@ -47,9 +48,9 @@ export declare const CoordinateSchema: z.ZodObject<{
47
48
  of: string | [number, number] | import('./position').PolarPosition;
48
49
  offset: [number, number];
49
50
  };
50
- id: string;
51
51
  }, {
52
52
  type: "coordinate";
53
+ id: string;
53
54
  position: [number, number] | import('./position').PolarPosition | {
54
55
  direction: "above" | "below" | "left" | "right" | "above-left" | "above-right" | "below-left" | "below-right";
55
56
  of: string;
@@ -58,7 +59,6 @@ export declare const CoordinateSchema: z.ZodObject<{
58
59
  of: string | [number, number] | import('./position').PolarPosition;
59
60
  offset: [number, number];
60
61
  };
61
- id: string;
62
62
  }>;
63
63
  /** Coordinate IR 类型 `{ type:'coordinate', id, position }` */
64
64
  export type IRCoordinate = z.infer<typeof CoordinateSchema>;
@@ -374,6 +374,7 @@ export declare const NodeSchema: z.ZodObject<{
374
374
  shape?: string | undefined;
375
375
  scale?: number | undefined;
376
376
  color?: string | undefined;
377
+ id?: string | undefined;
377
378
  textColor?: string | undefined;
378
379
  label?: {
379
380
  text: string;
@@ -411,7 +412,6 @@ export declare const NodeSchema: z.ZodObject<{
411
412
  drawOpacity?: number | undefined;
412
413
  zIndex?: number | undefined;
413
414
  rotate?: number | undefined;
414
- id?: string | undefined;
415
415
  align?: "left" | "right" | "center" | undefined;
416
416
  lineHeight?: number | undefined;
417
417
  dashed?: boolean | undefined;
@@ -459,6 +459,7 @@ export declare const NodeSchema: z.ZodObject<{
459
459
  shape?: string | undefined;
460
460
  scale?: number | undefined;
461
461
  color?: string | undefined;
462
+ id?: string | undefined;
462
463
  textColor?: string | undefined;
463
464
  label?: {
464
465
  text: string;
@@ -496,7 +497,6 @@ export declare const NodeSchema: z.ZodObject<{
496
497
  drawOpacity?: number | undefined;
497
498
  zIndex?: number | undefined;
498
499
  rotate?: number | undefined;
499
- id?: string | undefined;
500
500
  align?: "left" | "right" | "center" | undefined;
501
501
  lineHeight?: number | undefined;
502
502
  dashed?: boolean | undefined;