sldeditor 0.0.1 → 0.1.0

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.
@@ -1 +1 @@
1
- {"version":3,"file":"AnnotationLayer.d.ts","sourceRoot":"","sources":["../../src/canvas/AnnotationLayer.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAaH,wBAAgB,eAAe,4CAoD9B"}
1
+ {"version":3,"file":"AnnotationLayer.d.ts","sourceRoot":"","sources":["../../src/canvas/AnnotationLayer.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAYH,wBAAgB,eAAe,4CAoD9B"}
@@ -1 +1 @@
1
- {"version":3,"file":"CanvasSvg.d.ts","sourceRoot":"","sources":["../../src/canvas/CanvasSvg.tsx"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAyDH,wBAAgB,SAAS,4CAgRxB"}
1
+ {"version":3,"file":"CanvasSvg.d.ts","sourceRoot":"","sources":["../../src/canvas/CanvasSvg.tsx"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AA0DH,wBAAgB,SAAS,4CAiRxB"}
@@ -0,0 +1,20 @@
1
+ /**
2
+ * Edit affordances for the selected wire's polyline path.
3
+ *
4
+ * Two handle kinds:
5
+ * - Vertex handle (filled): drag a corner; adjacent segments are
6
+ * synced to stay axis-aligned (H stays H, V stays V).
7
+ * - Midpoint handle (hollow): drag a segment perpendicular to its
8
+ * axis; inserts two new corners so the segment shifts in parallel.
9
+ *
10
+ * Endpoints (path[0], path[n-1]) are not draggable — they're locked to
11
+ * terminals / bus anchors. A vertex with no remaining degree of freedom
12
+ * (both neighbors are endpoint-adjacent on perpendicular axes — i.e.
13
+ * the corner of a pure L) gets no handle: use the midpoint to add bends.
14
+ *
15
+ * The drag source is `internal.wireRenders[id].path` (works for both
16
+ * manual paths and auto-routed paths — first edit materializes the
17
+ * auto-routed path into `Wire.path`).
18
+ */
19
+ export declare function WireHandles(): import("react/jsx-runtime").JSX.Element | null;
20
+ //# sourceMappingURL=WireHandles.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"WireHandles.d.ts","sourceRoot":"","sources":["../../src/canvas/WireHandles.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAiBH,wBAAgB,WAAW,mDA0D1B"}
@@ -1 +1 @@
1
- {"version":3,"file":"PanTool.d.ts","sourceRoot":"","sources":["../../../src/canvas/tools/PanTool.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAQH,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AAyBpC,eAAO,MAAM,OAAO,EAAE,IA0JrB,CAAC"}
1
+ {"version":3,"file":"PanTool.d.ts","sourceRoot":"","sources":["../../../src/canvas/tools/PanTool.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAQH,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AAuBpC,eAAO,MAAM,OAAO,EAAE,IA4HrB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"SelectTool.d.ts","sourceRoot":"","sources":["../../../src/canvas/tools/SelectTool.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAWH,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AAyCpC,eAAO,MAAM,UAAU,EAAE,IA0ZxB,CAAC"}
1
+ {"version":3,"file":"SelectTool.d.ts","sourceRoot":"","sources":["../../../src/canvas/tools/SelectTool.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAWH,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AAsCpC,eAAO,MAAM,UAAU,EAAE,IA2XxB,CAAC"}
@@ -1,4 +1,4 @@
1
- import { Wire, WireId } from '../model';
1
+ import { Wire, WireEnd, WireId } from '../model';
2
2
  import { InternalModel } from './internal-model';
3
3
  type Pt = [number, number];
4
4
  export interface WireRoute {
@@ -6,5 +6,18 @@ export interface WireRoute {
6
6
  path: Pt[];
7
7
  }
8
8
  export declare function routeWire(wire: Wire, model: InternalModel): WireRoute | null;
9
+ /**
10
+ * Resolve the current world coordinate of a wire endpoint.
11
+ *
12
+ * For terminal ends this is just the terminal's world position. For bus
13
+ * ends it's the projection of `approach` onto the bus axis (clamped to
14
+ * the bus span) — `approach` is the nearby interior point that indicates
15
+ * where the user wants the wire to meet the bus. With no approach, the
16
+ * bus center is returned.
17
+ *
18
+ * Used by `compile.ts` to rebase the first/last point of a user-edited
19
+ * `Wire.path` whenever the connected element has moved.
20
+ */
21
+ export declare function wireEndWorld(end: WireEnd, approach: Pt | null, model: InternalModel): Pt | null;
9
22
  export {};
10
23
  //# sourceMappingURL=auto-route.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"auto-route.d.ts","sourceRoot":"","sources":["../../src/compiler/auto-route.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,IAAI,EAAW,MAAM,EAAE,MAAM,UAAU,CAAC;AACtD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAEtD,KAAK,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;AAE3B,MAAM,WAAW,SAAS;IACxB,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,EAAE,EAAE,CAAC;CACZ;AAED,wBAAgB,SAAS,CAAC,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,aAAa,GAAG,SAAS,GAAG,IAAI,CA6B5E"}
1
+ {"version":3,"file":"auto-route.d.ts","sourceRoot":"","sources":["../../src/compiler/auto-route.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AACtD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAEtD,KAAK,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;AAE3B,MAAM,WAAW,SAAS;IACxB,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,EAAE,EAAE,CAAC;CACZ;AAED,wBAAgB,SAAS,CAAC,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,aAAa,GAAG,SAAS,GAAG,IAAI,CA6B5E;AAeD;;;;;;;;;;;GAWG;AACH,wBAAgB,YAAY,CAC1B,GAAG,EAAE,OAAO,EACZ,QAAQ,EAAE,EAAE,GAAG,IAAI,EACnB,KAAK,EAAE,aAAa,GACnB,EAAE,GAAG,IAAI,CAgBX"}
@@ -1 +1 @@
1
- {"version":3,"file":"compile.d.ts","sourceRoot":"","sources":["../../src/compiler/compile.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAGH,OAAO,KAAK,EAGV,WAAW,EAOZ,MAAM,UAAU,CAAC;AAIlB,OAAO,EAKL,KAAK,aAAa,EAEnB,MAAM,kBAAkB,CAAC;AAyB1B,wBAAgB,OAAO,CAAC,OAAO,EAAE,WAAW,GAAG,aAAa,CA0N3D"}
1
+ {"version":3,"file":"compile.d.ts","sourceRoot":"","sources":["../../src/compiler/compile.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAGH,OAAO,KAAK,EAGV,WAAW,EAOZ,MAAM,UAAU,CAAC;AAKlB,OAAO,EAKL,KAAK,aAAa,EAEnB,MAAM,kBAAkB,CAAC;AAyB1B,wBAAgB,OAAO,CAAC,OAAO,EAAE,WAAW,GAAG,aAAa,CA6O3D"}
@@ -1 +1 @@
1
- {"version":3,"file":"ContextualToolbar.d.ts","sourceRoot":"","sources":["../../src/components/ContextualToolbar.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAYH,wBAAgB,iBAAiB,4CAoLhC"}
1
+ {"version":3,"file":"ContextualToolbar.d.ts","sourceRoot":"","sources":["../../src/components/ContextualToolbar.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAYH,wBAAgB,iBAAiB,4CAmNhC"}
@@ -130,6 +130,8 @@ export declare const messages: {
130
130
  readonly 'ctx.deleteHintNode': "断开此电气节点上的所有连接(保留元件)";
131
131
  readonly 'ctx.deleteHintWire': "移除这一根连线(其它同节点连线保留)";
132
132
  readonly 'ctx.deleteHintElement': "移除选中元件及其连接的连线";
133
+ readonly 'ctx.resetWirePath': "恢复自动走线";
134
+ readonly 'ctx.resetWirePathHint': "清除手动调整的拐点,让连线回到自动路由";
133
135
  readonly 'menu.undo': "撤销";
134
136
  readonly 'menu.redo': "重做";
135
137
  readonly 'menu.cut': "剪切";
@@ -298,6 +300,8 @@ export declare const messages: {
298
300
  readonly 'ctx.deleteHintNode': "Disconnect every wire on this node (elements stay)";
299
301
  readonly 'ctx.deleteHintWire': "Remove only this wire (siblings on the same node stay)";
300
302
  readonly 'ctx.deleteHintElement': "Remove the selection and its wires";
303
+ readonly 'ctx.resetWirePath': "Reset to auto-route";
304
+ readonly 'ctx.resetWirePathHint': "Drop manual corners and let the router re-draw this wire";
301
305
  readonly 'menu.undo': "Undo";
302
306
  readonly 'menu.redo': "Redo";
303
307
  readonly 'menu.cut': "Cut";
@@ -1 +1 @@
1
- {"version":3,"file":"messages.d.ts","sourceRoot":"","sources":["../../src/i18n/messages.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,eAAO,MAAM,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAqXX,CAAC;AAEX,MAAM,MAAM,MAAM,GAAG,MAAM,OAAO,QAAQ,CAAC;AAC3C,MAAM,MAAM,SAAS,GAAG,MAAM,CAAC,OAAO,QAAQ,CAAC,CAAC,IAAI,CAAC,CAAC"}
1
+ {"version":3,"file":"messages.d.ts","sourceRoot":"","sources":["../../src/i18n/messages.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,eAAO,MAAM,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAyXX,CAAC;AAEX,MAAM,MAAM,MAAM,GAAG,MAAM,OAAO,QAAQ,CAAC;AAC3C,MAAM,MAAM,SAAS,GAAG,MAAM,CAAC,OAAO,QAAQ,CAAC,CAAC,IAAI,CAAC,CAAC"}
@@ -0,0 +1,15 @@
1
+ import { ResolvedElement, ResolvedPlacement } from '../compiler';
2
+ import { LabelMode, LibraryEntry, LibraryLabelAnchor } from '../model';
3
+ /** Vertical step between stacked label lines, in canvas units. */
4
+ export declare const LABEL_LINE_HEIGHT = 9;
5
+ /** Font size used for element structural labels, in canvas units. */
6
+ export declare const LABEL_FONT_SIZE = 7;
7
+ export declare function labelLines(re: ResolvedElement, mode: LabelMode): string[];
8
+ export declare function fallbackAnchor(lib: LibraryEntry): LibraryLabelAnchor;
9
+ /**
10
+ * Project the library-local anchor through the element's placement so the
11
+ * label lands next to the symbol regardless of rotation/mirror, but the text
12
+ * itself stays upright (we never rotate the label group).
13
+ */
14
+ export declare function anchorWorld(anchor: LibraryLabelAnchor, place: ResolvedPlacement): [number, number];
15
+ //# sourceMappingURL=element-labels.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"element-labels.d.ts","sourceRoot":"","sources":["../../src/lib/element-labels.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AACtE,OAAO,KAAK,EAAE,SAAS,EAAE,YAAY,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC;AAE5E,kEAAkE;AAClE,eAAO,MAAM,iBAAiB,IAAI,CAAC;AAEnC,qEAAqE;AACrE,eAAO,MAAM,eAAe,IAAI,CAAC;AAEjC,wBAAgB,UAAU,CAAC,EAAE,EAAE,eAAe,EAAE,IAAI,EAAE,SAAS,GAAG,MAAM,EAAE,CAazE;AAED,wBAAgB,cAAc,CAAC,GAAG,EAAE,YAAY,GAAG,kBAAkB,CAIpE;AAED;;;;GAIG;AACH,wBAAgB,WAAW,CACzB,MAAM,EAAE,kBAAkB,EAC1B,KAAK,EAAE,iBAAiB,GACvB,CAAC,MAAM,EAAE,MAAM,CAAC,CAkBlB"}
@@ -1 +1 @@
1
- {"version":3,"file":"export-dxf.d.ts","sourceRoot":"","sources":["../../src/lib/export-dxf.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,OAAO,EAEL,KAAK,aAAa,EAGnB,MAAM,aAAa,CAAC;AACrB,OAAO,KAAK,EACV,SAAS,EAGT,cAAc,EACf,MAAM,UAAU,CAAC;AAElB,MAAM,WAAW,gBAAgB;IAC/B,0DAA0D;IAC1D,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,uDAAuD;IACvD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,qFAAqF;IACrF,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB;iEAC6D;IAC7D,WAAW,CAAC,EAAE,cAAc,EAAE,CAAC;CAChC;AAeD,wBAAgB,cAAc,CAC5B,KAAK,EAAE,aAAa,EACpB,IAAI,GAAE,gBAAqB,GAC1B,MAAM,CAyER;AAED,wBAAsB,WAAW,CAC/B,KAAK,EAAE,aAAa,EACpB,QAAQ,SAAgB,EACxB,IAAI,CAAC,EAAE,gBAAgB,GACtB,OAAO,CAAC,IAAI,CAAC,CAUf"}
1
+ {"version":3,"file":"export-dxf.d.ts","sourceRoot":"","sources":["../../src/lib/export-dxf.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,OAAO,EAEL,KAAK,aAAa,EAEnB,MAAM,aAAa,CAAC;AACrB,OAAO,KAAK,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAS1D,MAAM,WAAW,gBAAgB;IAC/B,0DAA0D;IAC1D,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,uDAAuD;IACvD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,qFAAqF;IACrF,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB;iEAC6D;IAC7D,WAAW,CAAC,EAAE,cAAc,EAAE,CAAC;CAChC;AAaD,wBAAgB,cAAc,CAC5B,KAAK,EAAE,aAAa,EACpB,IAAI,GAAE,gBAAqB,GAC1B,MAAM,CAyER;AAED,wBAAsB,WAAW,CAC/B,KAAK,EAAE,aAAa,EACpB,QAAQ,SAAgB,EACxB,IAAI,CAAC,EAAE,gBAAgB,GACtB,OAAO,CAAC,IAAI,CAAC,CAUf"}
@@ -1,9 +1,15 @@
1
1
  import { InternalModel } from '../compiler';
2
+ import { LabelMode, TextAnnotation } from '../model';
2
3
  export interface ExportOptions {
3
4
  /** Title used as the suggested filename / SVG <title>. */
4
5
  title?: string;
5
6
  /** Background fill (`'transparent'` skips the rect). Default white. */
6
7
  background?: string;
8
+ /** Element label visibility. Mirrors `DiagramFile.meta.labelMode`. Default 'all'. */
9
+ labelMode?: LabelMode;
10
+ /** Free text annotations from `DiagramFile.annotations` — `InternalModel`
11
+ * doesn't carry them, so the caller passes them through. */
12
+ annotations?: TextAnnotation[];
7
13
  }
8
14
  export declare function buildExportSvg(model: InternalModel, opts?: ExportOptions): string;
9
15
  export declare function downloadSvg(model: InternalModel, filename?: string, opts?: ExportOptions): Promise<void>;
@@ -1 +1 @@
1
- {"version":3,"file":"export-image.d.ts","sourceRoot":"","sources":["../../src/lib/export-image.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,EAAkB,KAAK,aAAa,EAAE,MAAM,aAAa,CAAC;AAYjE,MAAM,WAAW,aAAa;IAC5B,0DAA0D;IAC1D,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,uEAAuE;IACvE,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,wBAAgB,cAAc,CAC5B,KAAK,EAAE,aAAa,EACpB,IAAI,GAAE,aAAkB,GACvB,MAAM,CAwDR;AA0ED,wBAAsB,WAAW,CAC/B,KAAK,EAAE,aAAa,EACpB,QAAQ,SAAgB,EACxB,IAAI,CAAC,EAAE,aAAa,GACnB,OAAO,CAAC,IAAI,CAAC,CAMf;AAED,wBAAsB,WAAW,CAC/B,KAAK,EAAE,aAAa,EACpB,QAAQ,SAAgB,EACxB,IAAI,CAAC,EAAE,aAAa,GAAG;IAAE,KAAK,CAAC,EAAE,MAAM,CAAA;CAAE,GACxC,OAAO,CAAC,IAAI,CAAC,CA0Bf"}
1
+ {"version":3,"file":"export-image.d.ts","sourceRoot":"","sources":["../../src/lib/export-image.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,EAAkB,KAAK,aAAa,EAAE,MAAM,aAAa,CAAC;AACjE,OAAO,KAAK,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAqB1D,MAAM,WAAW,aAAa;IAC5B,0DAA0D;IAC1D,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,uEAAuE;IACvE,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,qFAAqF;IACrF,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB;iEAC6D;IAC7D,WAAW,CAAC,EAAE,cAAc,EAAE,CAAC;CAChC;AAED,wBAAgB,cAAc,CAC5B,KAAK,EAAE,aAAa,EACpB,IAAI,GAAE,aAAkB,GACvB,MAAM,CA0GR;AAqHD,wBAAsB,WAAW,CAC/B,KAAK,EAAE,aAAa,EACpB,QAAQ,SAAgB,EACxB,IAAI,CAAC,EAAE,aAAa,GACnB,OAAO,CAAC,IAAI,CAAC,CAMf;AAED,wBAAsB,WAAW,CAC/B,KAAK,EAAE,aAAa,EACpB,QAAQ,SAAgB,EACxB,IAAI,CAAC,EAAE,aAAa,GAAG;IAAE,KAAK,CAAC,EAAE,MAAM,CAAA;CAAE,GACxC,OAAO,CAAC,IAAI,CAAC,CA0Bf"}
@@ -1,3 +1,4 @@
1
1
  export type { AnnotationId, Bus, BusId, BusLayout, DiagramFile, DiagramMeta, DiagramVersion, Element, ElementId, LabelMode, NodeId, ParamValue, PinName, Placement, TerminalRef, TextAnnotation, Wire, WireEnd, WireId, } from './types';
2
2
  export type { LibraryEntry, LibraryTerminal, LibraryStretchable, LibraryStateField, LibraryParamField, LibraryLabelAnchor, LibrarySource, Orientation, } from './library';
3
+ export { normalizePath } from './wire-path';
3
4
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/model/index.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,YAAY,EACZ,GAAG,EACH,KAAK,EACL,SAAS,EACT,WAAW,EACX,WAAW,EACX,cAAc,EACd,OAAO,EACP,SAAS,EACT,SAAS,EACT,MAAM,EACN,UAAU,EACV,OAAO,EACP,SAAS,EACT,WAAW,EACX,cAAc,EACd,IAAI,EACJ,OAAO,EACP,MAAM,GACP,MAAM,SAAS,CAAC;AAEjB,YAAY,EACV,YAAY,EACZ,eAAe,EACf,kBAAkB,EAClB,iBAAiB,EACjB,iBAAiB,EACjB,kBAAkB,EAClB,aAAa,EACb,WAAW,GACZ,MAAM,WAAW,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/model/index.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,YAAY,EACZ,GAAG,EACH,KAAK,EACL,SAAS,EACT,WAAW,EACX,WAAW,EACX,cAAc,EACd,OAAO,EACP,SAAS,EACT,SAAS,EACT,MAAM,EACN,UAAU,EACV,OAAO,EACP,SAAS,EACT,WAAW,EACX,cAAc,EACd,IAAI,EACJ,OAAO,EACP,MAAM,GACP,MAAM,SAAS,CAAC;AAEjB,YAAY,EACV,YAAY,EACZ,eAAe,EACf,kBAAkB,EAClB,iBAAiB,EACjB,iBAAiB,EACjB,kBAAkB,EAClB,aAAa,EACb,WAAW,GACZ,MAAM,WAAW,CAAC;AAEnB,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC"}
@@ -0,0 +1,19 @@
1
+ /**
2
+ * Wire path normalization. The Wire.path field accepts any polyline, but
3
+ * the editor's invariants assume the path is orthogonal (segments are H or V)
4
+ * and free of redundant points. This module enforces those invariants.
5
+ *
6
+ * normalizePath is called from `store.updateWirePath` (so user edits stay
7
+ * clean) and from the compiler when materializing a Wire.path into a
8
+ * WireRender (so legacy / persisted dirty paths render correctly).
9
+ *
10
+ * Operations:
11
+ * - drop consecutive duplicates
12
+ * - insert an L-corner on any diagonal segment (vertical-first, matching
13
+ * the auto-router's convention)
14
+ * - collapse collinear interior points (three points sharing an x or y)
15
+ */
16
+ type Pt = [number, number];
17
+ export declare function normalizePath(path: readonly Pt[]): Pt[];
18
+ export {};
19
+ //# sourceMappingURL=wire-path.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"wire-path.d.ts","sourceRoot":"","sources":["../../src/model/wire-path.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,KAAK,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;AAI3B,wBAAgB,aAAa,CAAC,IAAI,EAAE,SAAS,EAAE,EAAE,GAAG,EAAE,EAAE,CAkDvD"}