sldeditor 0.0.2 → 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.
- package/dist/canvas/CanvasSvg.d.ts.map +1 -1
- package/dist/canvas/WireHandles.d.ts +20 -0
- package/dist/canvas/WireHandles.d.ts.map +1 -0
- package/dist/compiler/auto-route.d.ts +14 -1
- package/dist/compiler/auto-route.d.ts.map +1 -1
- package/dist/compiler/compile.d.ts.map +1 -1
- package/dist/components/ContextualToolbar.d.ts.map +1 -1
- package/dist/i18n/messages.d.ts +4 -0
- package/dist/i18n/messages.d.ts.map +1 -1
- package/dist/model/index.d.ts +1 -0
- package/dist/model/index.d.ts.map +1 -1
- package/dist/model/wire-path.d.ts +19 -0
- package/dist/model/wire-path.d.ts.map +1 -0
- package/dist/sldeditor.cjs +50 -45
- package/dist/sldeditor.cjs.map +1 -1
- package/dist/sldeditor.js +4391 -4086
- package/dist/sldeditor.js.map +1 -1
- package/dist/store/store.d.ts +4 -0
- package/dist/store/store.d.ts.map +1 -1
- package/dist/style.css +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CanvasSvg.d.ts","sourceRoot":"","sources":["../../src/canvas/CanvasSvg.tsx"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;
|
|
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,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,
|
|
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;
|
|
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,
|
|
1
|
+
{"version":3,"file":"ContextualToolbar.d.ts","sourceRoot":"","sources":["../../src/components/ContextualToolbar.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAYH,wBAAgB,iBAAiB,4CAmNhC"}
|
package/dist/i18n/messages.d.ts
CHANGED
|
@@ -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
|
|
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"}
|
package/dist/model/index.d.ts
CHANGED
|
@@ -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"}
|