sldeditor 0.0.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.
- package/LICENSE +25 -0
- package/README.md +117 -0
- package/THIRD_PARTY_NOTICES.md +31 -0
- package/dist/OneLineEditor.d.ts +24 -0
- package/dist/OneLineEditor.d.ts.map +1 -0
- package/dist/canvas/AnnotationLayer.d.ts +18 -0
- package/dist/canvas/AnnotationLayer.d.ts.map +1 -0
- package/dist/canvas/BusHandles.d.ts +10 -0
- package/dist/canvas/BusHandles.d.ts.map +1 -0
- package/dist/canvas/BusLayer.d.ts +8 -0
- package/dist/canvas/BusLayer.d.ts.map +1 -0
- package/dist/canvas/BusbarPreview.d.ts +7 -0
- package/dist/canvas/BusbarPreview.d.ts.map +1 -0
- package/dist/canvas/CanvasSvg.d.ts +11 -0
- package/dist/canvas/CanvasSvg.d.ts.map +1 -0
- package/dist/canvas/ElementHoverLabel.d.ts +9 -0
- package/dist/canvas/ElementHoverLabel.d.ts.map +1 -0
- package/dist/canvas/ElementLayer.d.ts +17 -0
- package/dist/canvas/ElementLayer.d.ts.map +1 -0
- package/dist/canvas/FreeAnnotationLayer.d.ts +18 -0
- package/dist/canvas/FreeAnnotationLayer.d.ts.map +1 -0
- package/dist/canvas/MarqueeOverlay.d.ts +6 -0
- package/dist/canvas/MarqueeOverlay.d.ts.map +1 -0
- package/dist/canvas/PlaceGhost.d.ts +16 -0
- package/dist/canvas/PlaceGhost.d.ts.map +1 -0
- package/dist/canvas/SelectionOverlay.d.ts +7 -0
- package/dist/canvas/SelectionOverlay.d.ts.map +1 -0
- package/dist/canvas/TerminalLayer.d.ts +13 -0
- package/dist/canvas/TerminalLayer.d.ts.map +1 -0
- package/dist/canvas/WireLayer.d.ts +11 -0
- package/dist/canvas/WireLayer.d.ts.map +1 -0
- package/dist/canvas/WirePreview.d.ts +8 -0
- package/dist/canvas/WirePreview.d.ts.map +1 -0
- package/dist/canvas/drop-on-bus.d.ts +45 -0
- package/dist/canvas/drop-on-bus.d.ts.map +1 -0
- package/dist/canvas/fit-to-content.d.ts +22 -0
- package/dist/canvas/fit-to-content.d.ts.map +1 -0
- package/dist/canvas/grid.d.ts +14 -0
- package/dist/canvas/grid.d.ts.map +1 -0
- package/dist/canvas/hit-test.d.ts +14 -0
- package/dist/canvas/hit-test.d.ts.map +1 -0
- package/dist/canvas/hover-bus.d.ts +7 -0
- package/dist/canvas/hover-bus.d.ts.map +1 -0
- package/dist/canvas/index.d.ts +11 -0
- package/dist/canvas/index.d.ts.map +1 -0
- package/dist/canvas/marquee-bus.d.ts +17 -0
- package/dist/canvas/marquee-bus.d.ts.map +1 -0
- package/dist/canvas/resolve-wire-target.d.ts +4 -0
- package/dist/canvas/resolve-wire-target.d.ts.map +1 -0
- package/dist/canvas/synthetic-pointer-cancel.d.ts +12 -0
- package/dist/canvas/synthetic-pointer-cancel.d.ts.map +1 -0
- package/dist/canvas/tools/BusbarTool.d.ts +3 -0
- package/dist/canvas/tools/BusbarTool.d.ts.map +1 -0
- package/dist/canvas/tools/PanTool.d.ts +3 -0
- package/dist/canvas/tools/PanTool.d.ts.map +1 -0
- package/dist/canvas/tools/PlaceTool.d.ts +3 -0
- package/dist/canvas/tools/PlaceTool.d.ts.map +1 -0
- package/dist/canvas/tools/SelectTool.d.ts +3 -0
- package/dist/canvas/tools/SelectTool.d.ts.map +1 -0
- package/dist/canvas/tools/TextTool.d.ts +3 -0
- package/dist/canvas/tools/TextTool.d.ts.map +1 -0
- package/dist/canvas/tools/WireTool.d.ts +3 -0
- package/dist/canvas/tools/WireTool.d.ts.map +1 -0
- package/dist/canvas/tools/index.d.ts +4 -0
- package/dist/canvas/tools/index.d.ts.map +1 -0
- package/dist/canvas/tools/types.d.ts +25 -0
- package/dist/canvas/tools/types.d.ts.map +1 -0
- package/dist/canvas/touch.d.ts +20 -0
- package/dist/canvas/touch.d.ts.map +1 -0
- package/dist/canvas/transform-attr.d.ts +3 -0
- package/dist/canvas/transform-attr.d.ts.map +1 -0
- package/dist/canvas/useHoverHighlight.d.ts +3 -0
- package/dist/canvas/useHoverHighlight.d.ts.map +1 -0
- package/dist/canvas/useKeyboardShortcuts.d.ts +15 -0
- package/dist/canvas/useKeyboardShortcuts.d.ts.map +1 -0
- package/dist/canvas/useTools.d.ts +4 -0
- package/dist/canvas/useTools.d.ts.map +1 -0
- package/dist/canvas/useViewport.d.ts +18 -0
- package/dist/canvas/useViewport.d.ts.map +1 -0
- package/dist/canvas/viewport-bus.d.ts +4 -0
- package/dist/canvas/viewport-bus.d.ts.map +1 -0
- package/dist/canvas/wire-target-bus.d.ts +14 -0
- package/dist/canvas/wire-target-bus.d.ts.map +1 -0
- package/dist/canvas/zoom-bus.d.ts +11 -0
- package/dist/canvas/zoom-bus.d.ts.map +1 -0
- package/dist/compiler/auto-layout.d.ts +18 -0
- package/dist/compiler/auto-layout.d.ts.map +1 -0
- package/dist/compiler/auto-route.d.ts +10 -0
- package/dist/compiler/auto-route.d.ts.map +1 -0
- package/dist/compiler/compile.d.ts +4 -0
- package/dist/compiler/compile.d.ts.map +1 -0
- package/dist/compiler/index.d.ts +6 -0
- package/dist/compiler/index.d.ts.map +1 -0
- package/dist/compiler/internal-model.d.ts +73 -0
- package/dist/compiler/internal-model.d.ts.map +1 -0
- package/dist/compiler/library-index.d.ts +4 -0
- package/dist/compiler/library-index.d.ts.map +1 -0
- package/dist/compiler/transforms.d.ts +7 -0
- package/dist/compiler/transforms.d.ts.map +1 -0
- package/dist/compiler/union-find.d.ts +14 -0
- package/dist/compiler/union-find.d.ts.map +1 -0
- package/dist/components/ContextMenu.d.ts +26 -0
- package/dist/components/ContextMenu.d.ts.map +1 -0
- package/dist/components/ContextualToolbar.d.ts +12 -0
- package/dist/components/ContextualToolbar.d.ts.map +1 -0
- package/dist/components/EditorShell.d.ts +2 -0
- package/dist/components/EditorShell.d.ts.map +1 -0
- package/dist/components/ExportMenu.d.ts +8 -0
- package/dist/components/ExportMenu.d.ts.map +1 -0
- package/dist/components/FileMenu.d.ts +11 -0
- package/dist/components/FileMenu.d.ts.map +1 -0
- package/dist/components/FloatingToolbar.d.ts +2 -0
- package/dist/components/FloatingToolbar.d.ts.map +1 -0
- package/dist/components/LeftPanel.d.ts +2 -0
- package/dist/components/LeftPanel.d.ts.map +1 -0
- package/dist/components/LibraryPopover.d.ts +8 -0
- package/dist/components/LibraryPopover.d.ts.map +1 -0
- package/dist/components/OnboardingCard.d.ts +13 -0
- package/dist/components/OnboardingCard.d.ts.map +1 -0
- package/dist/components/PropertyPanel.d.ts +8 -0
- package/dist/components/PropertyPanel.d.ts.map +1 -0
- package/dist/components/RightPanel.d.ts +2 -0
- package/dist/components/RightPanel.d.ts.map +1 -0
- package/dist/components/ViewToolbar.d.ts +19 -0
- package/dist/components/ViewToolbar.d.ts.map +1 -0
- package/dist/components/ui/button.d.ts +12 -0
- package/dist/components/ui/button.d.ts.map +1 -0
- package/dist/components/ui/tooltip.d.ts +18 -0
- package/dist/components/ui/tooltip.d.ts.map +1 -0
- package/dist/components/ui/upward-popover.d.ts +8 -0
- package/dist/components/ui/upward-popover.d.ts.map +1 -0
- package/dist/element-library/index.d.ts +14 -0
- package/dist/element-library/index.d.ts.map +1 -0
- package/dist/hooks/editor-tier.d.ts +32 -0
- package/dist/hooks/editor-tier.d.ts.map +1 -0
- package/dist/hooks/use-editor-tier.d.ts +6 -0
- package/dist/hooks/use-editor-tier.d.ts.map +1 -0
- package/dist/hooks/use-onboarding.d.ts +15 -0
- package/dist/hooks/use-onboarding.d.ts.map +1 -0
- package/dist/hooks/use-panels.d.ts +16 -0
- package/dist/hooks/use-panels.d.ts.map +1 -0
- package/dist/hooks/use-theme.d.ts +24 -0
- package/dist/hooks/use-theme.d.ts.map +1 -0
- package/dist/i18n/index.d.ts +14 -0
- package/dist/i18n/index.d.ts.map +1 -0
- package/dist/i18n/library.d.ts +14 -0
- package/dist/i18n/library.d.ts.map +1 -0
- package/dist/i18n/messages.d.ts +348 -0
- package/dist/i18n/messages.d.ts.map +1 -0
- package/dist/index.d.ts +20 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/lib/export-dxf.d.ts +16 -0
- package/dist/lib/export-dxf.d.ts.map +1 -0
- package/dist/lib/export-image.d.ts +13 -0
- package/dist/lib/export-image.d.ts.map +1 -0
- package/dist/lib/file-io.d.ts +26 -0
- package/dist/lib/file-io.d.ts.map +1 -0
- package/dist/lib/utils.d.ts +3 -0
- package/dist/lib/utils.d.ts.map +1 -0
- package/dist/model/index.d.ts +3 -0
- package/dist/model/index.d.ts.map +1 -0
- package/dist/model/library.d.ts +115 -0
- package/dist/model/library.d.ts.map +1 -0
- package/dist/model/types.d.ts +78 -0
- package/dist/model/types.d.ts.map +1 -0
- package/dist/sldeditor.cjs +193 -0
- package/dist/sldeditor.cjs.map +1 -0
- package/dist/sldeditor.js +11601 -0
- package/dist/sldeditor.js.map +1 -0
- package/dist/store/id-allocator.d.ts +11 -0
- package/dist/store/id-allocator.d.ts.map +1 -0
- package/dist/store/index.d.ts +3 -0
- package/dist/store/index.d.ts.map +1 -0
- package/dist/store/store.d.ts +104 -0
- package/dist/store/store.d.ts.map +1 -0
- package/dist/style.css +1 -0
- package/package.json +107 -0
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Dispatch a synthetic `pointercancel` on the canvas host. Used by the
|
|
3
|
+
* pinch-zoom hijack (useViewport) and the long-press → context-menu path
|
|
4
|
+
* (CanvasSvg) to interrupt the active tool's in-progress gesture so it
|
|
5
|
+
* runs its cancel cleanup instead of committing on the next pointerup.
|
|
6
|
+
*
|
|
7
|
+
* Best-effort: the `PointerEvent` constructor is missing on some older
|
|
8
|
+
* touch browsers; failing silently is fine because the only downside is
|
|
9
|
+
* the tool gesture lingering until the user lifts the finger naturally.
|
|
10
|
+
*/
|
|
11
|
+
export declare function dispatchSyntheticPointerCancel(host: EventTarget, pointerId: number): void;
|
|
12
|
+
//# sourceMappingURL=synthetic-pointer-cancel.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"synthetic-pointer-cancel.d.ts","sourceRoot":"","sources":["../../src/canvas/synthetic-pointer-cancel.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,wBAAgB,8BAA8B,CAC5C,IAAI,EAAE,WAAW,EACjB,SAAS,EAAE,MAAM,GAChB,IAAI,CAaN"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BusbarTool.d.ts","sourceRoot":"","sources":["../../../src/canvas/tools/BusbarTool.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAIH,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AASpC,eAAO,MAAM,UAAU,EAAE,IAqExB,CAAC"}
|
|
@@ -0,0 +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"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PlaceTool.d.ts","sourceRoot":"","sources":["../../../src/canvas/tools/PlaceTool.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAMH,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AAepC,eAAO,MAAM,SAAS,EAAE,IAkFvB,CAAC"}
|
|
@@ -0,0 +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"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TextTool.d.ts","sourceRoot":"","sources":["../../../src/canvas/tools/TextTool.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAKH,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AAEpC,eAAO,MAAM,QAAQ,EAAE,IA0BtB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WireTool.d.ts","sourceRoot":"","sources":["../../../src/canvas/tools/WireTool.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAOH,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AAEpC,eAAO,MAAM,QAAQ,EAAE,IA0EtB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/canvas/tools/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AAQ5C,eAAO,MAAM,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,IAAI,CAOtC,CAAC;AAEF,YAAY,EAAE,IAAI,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { ToolId } from '../../store';
|
|
2
|
+
import { ViewportApi } from '../useViewport';
|
|
3
|
+
export type { ToolId } from '../../store';
|
|
4
|
+
export interface ToolContext {
|
|
5
|
+
viewport: ViewportApi;
|
|
6
|
+
hostEl: HTMLElement;
|
|
7
|
+
}
|
|
8
|
+
export interface Tool {
|
|
9
|
+
id: ToolId;
|
|
10
|
+
cursor?: string;
|
|
11
|
+
onActivate?(ctx: ToolContext): void;
|
|
12
|
+
onDeactivate?(ctx: ToolContext): void;
|
|
13
|
+
onPointerDown?(e: PointerEvent, ctx: ToolContext): void;
|
|
14
|
+
onPointerMove?(e: PointerEvent, ctx: ToolContext): void;
|
|
15
|
+
onPointerUp?(e: PointerEvent, ctx: ToolContext): void;
|
|
16
|
+
/** Called for `pointercancel` (gesture interrupted, e.g. by multi-touch
|
|
17
|
+
* pinch hijack). If omitted, useTools falls back to `onPointerUp` —
|
|
18
|
+
* define this when commit-on-up shouldn't fire on cancellation. */
|
|
19
|
+
onPointerCancel?(e: PointerEvent, ctx: ToolContext): void;
|
|
20
|
+
onPointerLeave?(e: PointerEvent, ctx: ToolContext): void;
|
|
21
|
+
/** Native `dblclick` — pointerdown's `detail` field isn't reliable for
|
|
22
|
+
* double-click count, so tools that need it subscribe here separately. */
|
|
23
|
+
onDoubleClick?(e: MouseEvent, ctx: ToolContext): void;
|
|
24
|
+
}
|
|
25
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/canvas/tools/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAElD,YAAY,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAE1C,MAAM,WAAW,WAAW;IAC1B,QAAQ,EAAE,WAAW,CAAC;IACtB,MAAM,EAAE,WAAW,CAAC;CACrB;AAED,MAAM,WAAW,IAAI;IACnB,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,UAAU,CAAC,CAAC,GAAG,EAAE,WAAW,GAAG,IAAI,CAAC;IACpC,YAAY,CAAC,CAAC,GAAG,EAAE,WAAW,GAAG,IAAI,CAAC;IACtC,aAAa,CAAC,CAAC,CAAC,EAAE,YAAY,EAAE,GAAG,EAAE,WAAW,GAAG,IAAI,CAAC;IACxD,aAAa,CAAC,CAAC,CAAC,EAAE,YAAY,EAAE,GAAG,EAAE,WAAW,GAAG,IAAI,CAAC;IACxD,WAAW,CAAC,CAAC,CAAC,EAAE,YAAY,EAAE,GAAG,EAAE,WAAW,GAAG,IAAI,CAAC;IACtD;;wEAEoE;IACpE,eAAe,CAAC,CAAC,CAAC,EAAE,YAAY,EAAE,GAAG,EAAE,WAAW,GAAG,IAAI,CAAC;IAC1D,cAAc,CAAC,CAAC,CAAC,EAAE,YAAY,EAAE,GAAG,EAAE,WAAW,GAAG,IAAI,CAAC;IACzD;+EAC2E;IAC3E,aAAa,CAAC,CAAC,CAAC,EAAE,UAAU,EAAE,GAAG,EAAE,WAAW,GAAG,IAAI,CAAC;CACvD"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Phone-class UX helpers shared by the drawing tools (place / wire / busbar /
|
|
3
|
+
* text). On a narrow coarse-pointer viewport the user expects a "one-shot"
|
|
4
|
+
* gesture: pick a tool, place / wire / etc. once, and snap back to the
|
|
5
|
+
* default pan tool. Desktop and tablet keep the sticky-tool behavior since
|
|
6
|
+
* the keyboard / stylus makes re-entry cheap and multi-place is common.
|
|
7
|
+
*
|
|
8
|
+
* The viewport-width gate keeps tablet (iPad ≈ 768px portrait, also a
|
|
9
|
+
* coarse pointer) on the desktop-style flow — the unified bottom bar /
|
|
10
|
+
* full-screen library are only the phone form factor.
|
|
11
|
+
*/
|
|
12
|
+
export declare function exitToPanOnPhone(): void;
|
|
13
|
+
/**
|
|
14
|
+
* On a phone-class viewport, drop the currently armed place kind without
|
|
15
|
+
* leaving place mode. PlaceTool calls this after each successful placement
|
|
16
|
+
* so the LibraryPopover (hidden while armed on mobile) reappears for the
|
|
17
|
+
* next pick. Sticky `lastPlaceKind` is preserved by `setPlaceKind(null)`.
|
|
18
|
+
*/
|
|
19
|
+
export declare function disarmPlaceOnPhone(): void;
|
|
20
|
+
//# sourceMappingURL=touch.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"touch.d.ts","sourceRoot":"","sources":["../../src/canvas/touch.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAeH,wBAAgB,gBAAgB,IAAI,IAAI,CAGvC;AAED;;;;;GAKG;AACH,wBAAgB,kBAAkB,IAAI,IAAI,CAGzC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"transform-attr.d.ts","sourceRoot":"","sources":["../../src/canvas/transform-attr.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAErD,wBAAgB,aAAa,CAAC,CAAC,EAAE,iBAAiB,GAAG,MAAM,CAK1D"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useHoverHighlight.d.ts","sourceRoot":"","sources":["../../src/canvas/useHoverHighlight.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAa,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AASlD,wBAAgB,iBAAiB,CAC/B,OAAO,EAAE,SAAS,CAAC,cAAc,GAAG,IAAI,CAAC,GACxC,IAAI,CAgGN"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Global editor shortcuts. Runs once via the OneLineEditor root component
|
|
3
|
+
* and reads/writes the store via `getState`. Shortcuts are inert when
|
|
4
|
+
* focus is in an editable input/textarea so the property panel doesn't
|
|
5
|
+
* eat the user's typing.
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* Step out of drawing state. Wire/busbar tools always return to select.
|
|
9
|
+
* Place tool clears its placeKind first; if no kind is selected, returns to
|
|
10
|
+
* select. For non-drawing tools, falls back to clearing selection. Shared
|
|
11
|
+
* between Esc and the canvas right-click handler.
|
|
12
|
+
*/
|
|
13
|
+
export declare function exitDrawingState(): void;
|
|
14
|
+
export declare function useKeyboardShortcuts(): void;
|
|
15
|
+
//# sourceMappingURL=useKeyboardShortcuts.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useKeyboardShortcuts.d.ts","sourceRoot":"","sources":["../../src/canvas/useKeyboardShortcuts.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAgBH;;;;;GAKG;AACH,wBAAgB,gBAAgB,IAAI,IAAI,CAiCvC;AAGD,wBAAgB,oBAAoB,IAAI,IAAI,CAoH3C"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useTools.d.ts","sourceRoot":"","sources":["../../src/canvas/useTools.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAa,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAIlD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAEjD,wBAAgB,QAAQ,CACtB,OAAO,EAAE,SAAS,CAAC,cAAc,GAAG,IAAI,CAAC,EACzC,QAAQ,EAAE,WAAW,GACpB,IAAI,CAyCN"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { RefObject } from 'react';
|
|
2
|
+
export interface Viewport {
|
|
3
|
+
tx: number;
|
|
4
|
+
ty: number;
|
|
5
|
+
scale: number;
|
|
6
|
+
}
|
|
7
|
+
export interface ViewportApi {
|
|
8
|
+
/** Convert a clientX/Y (CSS pixels relative to the viewport) → SVG coords. */
|
|
9
|
+
screenToSvg(clientX: number, clientY: number): [number, number];
|
|
10
|
+
/** Read-only snapshot of the current transform. */
|
|
11
|
+
getViewport(): Viewport;
|
|
12
|
+
/** Update one or more viewport fields. */
|
|
13
|
+
setViewport(patch: Partial<Viewport>): void;
|
|
14
|
+
/** Subscribe to viewport changes; returns an unsubscribe fn. */
|
|
15
|
+
subscribe(listener: (vp: Viewport) => void): () => void;
|
|
16
|
+
}
|
|
17
|
+
export declare function useViewport(hostRef: RefObject<HTMLDivElement | null>, groupRef: RefObject<SVGGElement | null>, initial?: Viewport): ViewportApi;
|
|
18
|
+
//# sourceMappingURL=useViewport.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useViewport.d.ts","sourceRoot":"","sources":["../../src/canvas/useViewport.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAqB,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAI1D,MAAM,WAAW,QAAQ;IACvB,EAAE,EAAE,MAAM,CAAC;IACX,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,WAAW;IAC1B,8EAA8E;IAC9E,WAAW,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAChE,mDAAmD;IACnD,WAAW,IAAI,QAAQ,CAAC;IACxB,0CAA0C;IAC1C,WAAW,CAAC,KAAK,EAAE,OAAO,CAAC,QAAQ,CAAC,GAAG,IAAI,CAAC;IAC5C,gEAAgE;IAChE,SAAS,CAAC,QAAQ,EAAE,CAAC,EAAE,EAAE,QAAQ,KAAK,IAAI,GAAG,MAAM,IAAI,CAAC;CACzD;AAWD,wBAAgB,WAAW,CACzB,OAAO,EAAE,SAAS,CAAC,cAAc,GAAG,IAAI,CAAC,EACzC,QAAQ,EAAE,SAAS,CAAC,WAAW,GAAG,IAAI,CAAC,EACvC,OAAO,GAAE,QAAqC,GAC7C,WAAW,CAkSb"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"viewport-bus.d.ts","sourceRoot":"","sources":["../../src/canvas/viewport-bus.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAIjD,wBAAgB,cAAc,CAAC,GAAG,EAAE,WAAW,GAAG,IAAI,GAAG,IAAI,CAE5D;AAED,wBAAgB,cAAc,IAAI,WAAW,GAAG,IAAI,CAEnD"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { WireEnd } from '../model';
|
|
2
|
+
export interface WireTarget {
|
|
3
|
+
ref: WireEnd;
|
|
4
|
+
/** World-frame coords of where the connection will physically attach. */
|
|
5
|
+
world: [number, number];
|
|
6
|
+
/** True when the target is a bare bus id. */
|
|
7
|
+
isBus: boolean;
|
|
8
|
+
}
|
|
9
|
+
type Listener = (target: WireTarget | null) => void;
|
|
10
|
+
export declare function publishWireTarget(t: WireTarget | null): void;
|
|
11
|
+
export declare function getWireTarget(): WireTarget | null;
|
|
12
|
+
export declare function subscribeWireTarget(fn: Listener): () => void;
|
|
13
|
+
export {};
|
|
14
|
+
//# sourceMappingURL=wire-target-bus.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"wire-target-bus.d.ts","sourceRoot":"","sources":["../../src/canvas/wire-target-bus.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AAExC,MAAM,WAAW,UAAU;IACzB,GAAG,EAAE,OAAO,CAAC;IACb,yEAAyE;IACzE,KAAK,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACxB,6CAA6C;IAC7C,KAAK,EAAE,OAAO,CAAC;CAChB;AAED,KAAK,QAAQ,GAAG,CAAC,MAAM,EAAE,UAAU,GAAG,IAAI,KAAK,IAAI,CAAC;AAKpD,wBAAgB,iBAAiB,CAAC,CAAC,EAAE,UAAU,GAAG,IAAI,GAAG,IAAI,CAa5D;AAED,wBAAgB,aAAa,IAAI,UAAU,GAAG,IAAI,CAEjD;AAED,wBAAgB,mBAAmB,CAAC,EAAE,EAAE,QAAQ,GAAG,MAAM,IAAI,CAK5D"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tiny pub/sub for the live viewport scale. Lets chrome (TopBar zoom %) read
|
|
3
|
+
* the value without forcing the gesture path through React state. Updated
|
|
4
|
+
* by `useViewport` after every transform change.
|
|
5
|
+
*/
|
|
6
|
+
type Listener = (scale: number) => void;
|
|
7
|
+
export declare function publishScale(scale: number): void;
|
|
8
|
+
export declare function getScale(): number;
|
|
9
|
+
export declare function subscribeScale(fn: Listener): () => void;
|
|
10
|
+
export {};
|
|
11
|
+
//# sourceMappingURL=zoom-bus.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"zoom-bus.d.ts","sourceRoot":"","sources":["../../src/canvas/zoom-bus.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,KAAK,QAAQ,GAAG,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;AAKxC,wBAAgB,YAAY,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAIhD;AAED,wBAAgB,QAAQ,IAAI,MAAM,CAEjC;AAED,wBAAgB,cAAc,CAAC,EAAE,EAAE,QAAQ,GAAG,MAAM,IAAI,CAKvD"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { Bus, BusId, Element, ElementId, LibraryEntry, Wire } from '../model';
|
|
2
|
+
import { BusGeometry, ResolvedPlacement } from './internal-model';
|
|
3
|
+
interface AutoLayoutInput {
|
|
4
|
+
/** Devices only. Buses are in `buses`. */
|
|
5
|
+
elements: Element[];
|
|
6
|
+
buses: Bus[];
|
|
7
|
+
wires: Wire[];
|
|
8
|
+
library: ReadonlyMap<string, LibraryEntry>;
|
|
9
|
+
userLayout: ReadonlyMap<ElementId, ResolvedPlacement>;
|
|
10
|
+
userBusLayout: ReadonlyMap<BusId, BusGeometry>;
|
|
11
|
+
}
|
|
12
|
+
export interface AutoLayoutOutput {
|
|
13
|
+
devices: Map<ElementId, ResolvedPlacement>;
|
|
14
|
+
buses: Map<BusId, BusGeometry>;
|
|
15
|
+
}
|
|
16
|
+
export declare function autoLayout(input: AutoLayoutInput): AutoLayoutOutput;
|
|
17
|
+
export {};
|
|
18
|
+
//# sourceMappingURL=auto-layout.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"auto-layout.d.ts","sourceRoot":"","sources":["../../src/compiler/auto-layout.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyCG;AAEH,OAAO,KAAK,EACV,GAAG,EACH,KAAK,EACL,OAAO,EACP,SAAS,EACT,YAAY,EAGZ,IAAI,EAEL,MAAM,UAAU,CAAC;AAClB,OAAO,EAEL,KAAK,WAAW,EAChB,KAAK,iBAAiB,EACvB,MAAM,kBAAkB,CAAC;AAsB1B,UAAU,eAAe;IACvB,0CAA0C;IAC1C,QAAQ,EAAE,OAAO,EAAE,CAAC;IACpB,KAAK,EAAE,GAAG,EAAE,CAAC;IACb,KAAK,EAAE,IAAI,EAAE,CAAC;IACd,OAAO,EAAE,WAAW,CAAC,MAAM,EAAE,YAAY,CAAC,CAAC;IAC3C,UAAU,EAAE,WAAW,CAAC,SAAS,EAAE,iBAAiB,CAAC,CAAC;IACtD,aAAa,EAAE,WAAW,CAAC,KAAK,EAAE,WAAW,CAAC,CAAC;CAChD;AAED,MAAM,WAAW,gBAAgB;IAC/B,OAAO,EAAE,GAAG,CAAC,SAAS,EAAE,iBAAiB,CAAC,CAAC;IAC3C,KAAK,EAAE,GAAG,CAAC,KAAK,EAAE,WAAW,CAAC,CAAC;CAChC;AA8BD,wBAAgB,UAAU,CAAC,KAAK,EAAE,eAAe,GAAG,gBAAgB,CA2oCnE"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Wire, WireId } from '../model';
|
|
2
|
+
import { InternalModel } from './internal-model';
|
|
3
|
+
type Pt = [number, number];
|
|
4
|
+
export interface WireRoute {
|
|
5
|
+
wireId: WireId;
|
|
6
|
+
path: Pt[];
|
|
7
|
+
}
|
|
8
|
+
export declare function routeWire(wire: Wire, model: InternalModel): WireRoute | null;
|
|
9
|
+
export {};
|
|
10
|
+
//# sourceMappingURL=auto-route.d.ts.map
|
|
@@ -0,0 +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"}
|
|
@@ -0,0 +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"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { compile } from './compile';
|
|
2
|
+
export { LIBRARY, getLibraryEntry } from './library-index';
|
|
3
|
+
export { busAxisFromRot, emptyInternalModel, resolvePlacement, } from './internal-model';
|
|
4
|
+
export type { BusGeometry, ConnectivityNode, Diagnostic, InternalModel, ResolvedBus, ResolvedElement, ResolvedPlacement, TerminalGeometry, WireRender, } from './internal-model';
|
|
5
|
+
export { orientationVec, transformOrientation, transformPoint, } from './transforms';
|
|
6
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/compiler/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAC3D,OAAO,EACL,cAAc,EACd,kBAAkB,EAClB,gBAAgB,GACjB,MAAM,kBAAkB,CAAC;AAC1B,YAAY,EACV,WAAW,EACX,gBAAgB,EAChB,UAAU,EACV,aAAa,EACb,WAAW,EACX,eAAe,EACf,iBAAiB,EACjB,gBAAgB,EAChB,UAAU,GACX,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EACL,cAAc,EACd,oBAAoB,EACpB,cAAc,GACf,MAAM,cAAc,CAAC"}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { Bus, BusId, Element, ElementId, LibraryEntry, NodeId, Orientation, Placement, TerminalRef, WireEnd } from '../model';
|
|
2
|
+
/** Element + the resolved library record for its `kind`. */
|
|
3
|
+
export interface ResolvedElement {
|
|
4
|
+
element: Element;
|
|
5
|
+
/** Undefined if `kind` is unknown to the library — render as placeholder. */
|
|
6
|
+
libraryDef?: LibraryEntry;
|
|
7
|
+
}
|
|
8
|
+
/** Placement after defaults applied (rot=0, mirror=false). Devices only. */
|
|
9
|
+
export interface ResolvedPlacement {
|
|
10
|
+
at: [number, number];
|
|
11
|
+
rot: 0 | 90 | 180 | 270;
|
|
12
|
+
mirror: boolean;
|
|
13
|
+
}
|
|
14
|
+
/** Bus geometry resolved at compile time. `axis` derived from `rot`. */
|
|
15
|
+
export interface BusGeometry {
|
|
16
|
+
at: [number, number];
|
|
17
|
+
span: number;
|
|
18
|
+
rot: 0 | 90 | 180 | 270;
|
|
19
|
+
axis: 'x' | 'y';
|
|
20
|
+
}
|
|
21
|
+
export interface ResolvedBus {
|
|
22
|
+
bus: Bus;
|
|
23
|
+
geometry: BusGeometry;
|
|
24
|
+
}
|
|
25
|
+
export interface TerminalGeometry {
|
|
26
|
+
ref: TerminalRef;
|
|
27
|
+
elementId: ElementId;
|
|
28
|
+
pin: string;
|
|
29
|
+
/** Canvas coordinates (after rot/mirror/translate). */
|
|
30
|
+
world: [number, number];
|
|
31
|
+
/** Cardinal direction the terminal exits in canvas frame. */
|
|
32
|
+
orientation: Orientation;
|
|
33
|
+
}
|
|
34
|
+
export interface ConnectivityNode {
|
|
35
|
+
id: NodeId;
|
|
36
|
+
/** Mixed: device terminal refs (`X.Y`) and bare bus ids (`X`). */
|
|
37
|
+
terminals: WireEnd[];
|
|
38
|
+
}
|
|
39
|
+
/** Compile-time issue. Non-fatal; renderer keeps drawing. */
|
|
40
|
+
export interface Diagnostic {
|
|
41
|
+
/** Stable code (`E001`..`W999`). */
|
|
42
|
+
code: string;
|
|
43
|
+
severity: 'error' | 'warning';
|
|
44
|
+
message: string;
|
|
45
|
+
/** JSON Pointer pointing into the source DiagramFile, when applicable. */
|
|
46
|
+
pointer?: string;
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Per-wire rendered path. One polyline per visible wire in the diagram.
|
|
50
|
+
* Selection / hit-test / user-route override all key on `wireId`.
|
|
51
|
+
*/
|
|
52
|
+
export interface WireRender {
|
|
53
|
+
wireId: import('../model').WireId;
|
|
54
|
+
path: [number, number][];
|
|
55
|
+
/** True if this came from `Wire.path` (user-edited); false = auto-routed. */
|
|
56
|
+
userEdited?: boolean;
|
|
57
|
+
}
|
|
58
|
+
export interface InternalModel {
|
|
59
|
+
elements: Map<ElementId, ResolvedElement>;
|
|
60
|
+
buses: Map<BusId, ResolvedBus>;
|
|
61
|
+
terminals: Map<TerminalRef, TerminalGeometry>;
|
|
62
|
+
nodes: Map<NodeId, ConnectivityNode>;
|
|
63
|
+
layout: Map<ElementId, ResolvedPlacement>;
|
|
64
|
+
/** Rendered polyline per wire id. */
|
|
65
|
+
wireRenders: Map<import('../model').WireId, WireRender>;
|
|
66
|
+
terminalToNode: Map<WireEnd, NodeId>;
|
|
67
|
+
elementToTerminals: Map<ElementId, TerminalRef[]>;
|
|
68
|
+
diagnostics: Diagnostic[];
|
|
69
|
+
}
|
|
70
|
+
export declare function emptyInternalModel(): InternalModel;
|
|
71
|
+
export declare function resolvePlacement(p?: Placement): ResolvedPlacement;
|
|
72
|
+
export declare function busAxisFromRot(rot: 0 | 90 | 180 | 270): 'x' | 'y';
|
|
73
|
+
//# sourceMappingURL=internal-model.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"internal-model.d.ts","sourceRoot":"","sources":["../../src/compiler/internal-model.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"library-index.d.ts","sourceRoot":"","sources":["../../src/compiler/library-index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAE7C,eAAO,MAAM,OAAO,EAAE,WAAW,CAAC,MAAM,EAAE,YAAY,CAErD,CAAC;AAEF,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,YAAY,GAAG,SAAS,CAEtE"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { Orientation } from '../model';
|
|
2
|
+
import { ResolvedPlacement } from './internal-model';
|
|
3
|
+
export declare function transformPoint(local: [number, number], p: ResolvedPlacement): [number, number];
|
|
4
|
+
export declare function transformOrientation(o: Orientation, p: ResolvedPlacement): Orientation;
|
|
5
|
+
/** Unit vector pointing the way an exit-line should leave a terminal. */
|
|
6
|
+
export declare function orientationVec(o: Orientation): [number, number];
|
|
7
|
+
//# sourceMappingURL=transforms.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"transforms.d.ts","sourceRoot":"","sources":["../../src/compiler/transforms.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAC5C,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAE1D,wBAAgB,cAAc,CAC5B,KAAK,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,EACvB,CAAC,EAAE,iBAAiB,GACnB,CAAC,MAAM,EAAE,MAAM,CAAC,CAiBlB;AAgBD,wBAAgB,oBAAoB,CAClC,CAAC,EAAE,WAAW,EACd,CAAC,EAAE,iBAAiB,GACnB,WAAW,CAKb;AAED,yEAAyE;AACzE,wBAAgB,cAAc,CAAC,CAAC,EAAE,WAAW,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAW/D"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tiny Union-Find (disjoint set) keyed by string. Used to merge `connections`
|
|
3
|
+
* into ConnectivityNode equivalence classes.
|
|
4
|
+
*/
|
|
5
|
+
export declare class UnionFind<K> {
|
|
6
|
+
private parent;
|
|
7
|
+
private rank;
|
|
8
|
+
add(k: K): void;
|
|
9
|
+
find(k: K): K;
|
|
10
|
+
union(a: K, b: K): void;
|
|
11
|
+
/** Group all known keys by their representative. Insertion order preserved. */
|
|
12
|
+
groups(): Map<K, K[]>;
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=union-find.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"union-find.d.ts","sourceRoot":"","sources":["../../src/compiler/union-find.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,qBAAa,SAAS,CAAC,CAAC;IACtB,OAAO,CAAC,MAAM,CAAmB;IACjC,OAAO,CAAC,IAAI,CAAwB;IAEpC,GAAG,CAAC,CAAC,EAAE,CAAC,GAAG,IAAI;IAOf,IAAI,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC;IAYb,KAAK,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,GAAG,IAAI;IAcvB,+EAA+E;IAC/E,MAAM,IAAI,GAAG,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC;CAUtB"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
export interface ContextMenuItem {
|
|
3
|
+
type?: 'item';
|
|
4
|
+
label: string;
|
|
5
|
+
shortcut?: string;
|
|
6
|
+
icon?: React.ComponentType<{
|
|
7
|
+
className?: string;
|
|
8
|
+
}>;
|
|
9
|
+
onSelect: () => void;
|
|
10
|
+
disabled?: boolean;
|
|
11
|
+
destructive?: boolean;
|
|
12
|
+
}
|
|
13
|
+
export interface ContextMenuSeparator {
|
|
14
|
+
type: 'separator';
|
|
15
|
+
}
|
|
16
|
+
export type ContextMenuEntry = ContextMenuItem | ContextMenuSeparator;
|
|
17
|
+
interface ContextMenuApi {
|
|
18
|
+
open: (x: number, y: number, items: ContextMenuEntry[]) => void;
|
|
19
|
+
close: () => void;
|
|
20
|
+
}
|
|
21
|
+
export declare function useContextMenu(): ContextMenuApi;
|
|
22
|
+
export declare function ContextMenuHost({ children }: {
|
|
23
|
+
children: ReactNode;
|
|
24
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
25
|
+
export {};
|
|
26
|
+
//# sourceMappingURL=ContextMenu.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ContextMenu.d.ts","sourceRoot":"","sources":["../../src/components/ContextMenu.tsx"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EASL,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AAGf,MAAM,WAAW,eAAe;IAC9B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,IAAI,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;QAAE,SAAS,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IACnD,QAAQ,EAAE,MAAM,IAAI,CAAC;IACrB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB;AACD,MAAM,WAAW,oBAAoB;IACnC,IAAI,EAAE,WAAW,CAAC;CACnB;AACD,MAAM,MAAM,gBAAgB,GAAG,eAAe,GAAG,oBAAoB,CAAC;AAEtE,UAAU,cAAc;IACtB,IAAI,EAAE,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,gBAAgB,EAAE,KAAK,IAAI,CAAC;IAChE,KAAK,EAAE,MAAM,IAAI,CAAC;CACnB;AAID,wBAAgB,cAAc,IAAI,cAAc,CAM/C;AAWD,wBAAgB,eAAe,CAAC,EAAE,QAAQ,EAAE,EAAE;IAAE,QAAQ,EAAE,SAAS,CAAA;CAAE,2CAiIpE"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Canva-style contextual floating toolbar that follows the selected element
|
|
3
|
+
* (or selection bbox) — and the selected wire/node, since v0.4. Renders the
|
|
4
|
+
* relevant primary actions (rotate / mirror / delete for elements, delete
|
|
5
|
+
* for nodes) right next to the work, so the eye doesn't need to travel.
|
|
6
|
+
*
|
|
7
|
+
* Position is updated each frame via rAF + DOM transform — no React state in
|
|
8
|
+
* the hot loop. The toolbar reads from the canvas DOM each frame which means
|
|
9
|
+
* it tracks pan, zoom, and element/wire moves "for free".
|
|
10
|
+
*/
|
|
11
|
+
export declare function ContextualToolbar(): import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
//# sourceMappingURL=ContextualToolbar.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ContextualToolbar.d.ts","sourceRoot":"","sources":["../../src/components/ContextualToolbar.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAYH,wBAAgB,iBAAiB,4CAoLhC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"EditorShell.d.ts","sourceRoot":"","sources":["../../src/components/EditorShell.tsx"],"names":[],"mappings":"AAsEA,wBAAgB,WAAW,4CA2B1B"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Export menu — render the current diagram to SVG or PNG and trigger a
|
|
3
|
+
* download. Reads the InternalModel from the store so the file matches what
|
|
4
|
+
* the canvas shows minus UI chrome (selection halos, terminal hit rects,
|
|
5
|
+
* etc.). Exported alongside `FileMenu` for embedding apps.
|
|
6
|
+
*/
|
|
7
|
+
export declare function ExportMenu(): import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
//# sourceMappingURL=ExportMenu.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ExportMenu.d.ts","sourceRoot":"","sources":["../../src/components/ExportMenu.tsx"],"names":[],"mappings":"AAAA;;;;;GAKG;AAUH,wBAAgB,UAAU,4CA6FzB"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* File menu — New / Open / Save / Save As, plus ⌘O / ⌘S / ⌘⇧S keyboard
|
|
3
|
+
* shortcuts. Renders as a dropdown button. Self-contained: reads/writes the
|
|
4
|
+
* editor store directly and prompts the OS file picker (FS Access API where
|
|
5
|
+
* available, hidden input fallback otherwise).
|
|
6
|
+
*
|
|
7
|
+
* Exported from the library so that embedding apps that want a "local file"
|
|
8
|
+
* mode without backend can drop it into their own toolbar.
|
|
9
|
+
*/
|
|
10
|
+
export declare function FileMenu(): import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
//# sourceMappingURL=FileMenu.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FileMenu.d.ts","sourceRoot":"","sources":["../../src/components/FileMenu.tsx"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAcH,wBAAgB,QAAQ,4CAmFvB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FloatingToolbar.d.ts","sourceRoot":"","sources":["../../src/components/FloatingToolbar.tsx"],"names":[],"mappings":"AA+JA,wBAAgB,eAAe,4CAyG9B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LeftPanel.d.ts","sourceRoot":"","sources":["../../src/components/LeftPanel.tsx"],"names":[],"mappings":"AASA,wBAAgB,SAAS,mDA0CxB"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Element library popover. Visible whenever the place tool is active —
|
|
3
|
+
* the FloatingToolbar's "元件" button toggles that tool, and picking an
|
|
4
|
+
* entry here arms `placeKind`. Closing (X) returns to the select tool so
|
|
5
|
+
* the place state and the popover stay in lockstep.
|
|
6
|
+
*/
|
|
7
|
+
export declare function LibraryPopover(): import("react/jsx-runtime").JSX.Element | null;
|
|
8
|
+
//# sourceMappingURL=LibraryPopover.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LibraryPopover.d.ts","sourceRoot":"","sources":["../../src/components/LibraryPopover.tsx"],"names":[],"mappings":"AAAA;;;;;GAKG;AAkEH,wBAAgB,cAAc,mDAwE7B"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* First-visit onboarding card. Surfaces the canonical drawing flow:
|
|
3
|
+
* busbar first → drag elements off the bus → chain from terminals.
|
|
4
|
+
*
|
|
5
|
+
* Visibility: shown until the user dismisses it (persisted to localStorage),
|
|
6
|
+
* regardless of whether the canvas is empty — the card and the sample
|
|
7
|
+
* diagram together form the first-impression. The wrapper is
|
|
8
|
+
* `pointer-events: none` so users can press-and-drag right through it
|
|
9
|
+
* (e.g., the busbar drag the card just told them to perform); only the
|
|
10
|
+
* dismiss controls accept clicks.
|
|
11
|
+
*/
|
|
12
|
+
export declare function OnboardingCard(): import("react/jsx-runtime").JSX.Element | null;
|
|
13
|
+
//# sourceMappingURL=OnboardingCard.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"OnboardingCard.d.ts","sourceRoot":"","sources":["../../src/components/OnboardingCard.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAMH,wBAAgB,cAAc,mDAoD7B"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Right-panel property editor — minimal by design. Shows only what the user
|
|
3
|
+
* needs to *configure* (name, note, kind-specific state). Transformations
|
|
4
|
+
* (rotate/mirror/delete) live on the contextual floating toolbar; type label
|
|
5
|
+
* lives in the panel header.
|
|
6
|
+
*/
|
|
7
|
+
export declare function PropertyPanel(): import("react/jsx-runtime").JSX.Element | null;
|
|
8
|
+
//# sourceMappingURL=PropertyPanel.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PropertyPanel.d.ts","sourceRoot":"","sources":["../../src/components/PropertyPanel.tsx"],"names":[],"mappings":"AAAA;;;;;GAKG;AAmBH,wBAAgB,aAAa,mDAqE5B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RightPanel.d.ts","sourceRoot":"","sources":["../../src/components/RightPanel.tsx"],"names":[],"mappings":"AAQA,wBAAgB,UAAU,mDA4DzB"}
|