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.
Files changed (177) hide show
  1. package/LICENSE +25 -0
  2. package/README.md +117 -0
  3. package/THIRD_PARTY_NOTICES.md +31 -0
  4. package/dist/OneLineEditor.d.ts +24 -0
  5. package/dist/OneLineEditor.d.ts.map +1 -0
  6. package/dist/canvas/AnnotationLayer.d.ts +18 -0
  7. package/dist/canvas/AnnotationLayer.d.ts.map +1 -0
  8. package/dist/canvas/BusHandles.d.ts +10 -0
  9. package/dist/canvas/BusHandles.d.ts.map +1 -0
  10. package/dist/canvas/BusLayer.d.ts +8 -0
  11. package/dist/canvas/BusLayer.d.ts.map +1 -0
  12. package/dist/canvas/BusbarPreview.d.ts +7 -0
  13. package/dist/canvas/BusbarPreview.d.ts.map +1 -0
  14. package/dist/canvas/CanvasSvg.d.ts +11 -0
  15. package/dist/canvas/CanvasSvg.d.ts.map +1 -0
  16. package/dist/canvas/ElementHoverLabel.d.ts +9 -0
  17. package/dist/canvas/ElementHoverLabel.d.ts.map +1 -0
  18. package/dist/canvas/ElementLayer.d.ts +17 -0
  19. package/dist/canvas/ElementLayer.d.ts.map +1 -0
  20. package/dist/canvas/FreeAnnotationLayer.d.ts +18 -0
  21. package/dist/canvas/FreeAnnotationLayer.d.ts.map +1 -0
  22. package/dist/canvas/MarqueeOverlay.d.ts +6 -0
  23. package/dist/canvas/MarqueeOverlay.d.ts.map +1 -0
  24. package/dist/canvas/PlaceGhost.d.ts +16 -0
  25. package/dist/canvas/PlaceGhost.d.ts.map +1 -0
  26. package/dist/canvas/SelectionOverlay.d.ts +7 -0
  27. package/dist/canvas/SelectionOverlay.d.ts.map +1 -0
  28. package/dist/canvas/TerminalLayer.d.ts +13 -0
  29. package/dist/canvas/TerminalLayer.d.ts.map +1 -0
  30. package/dist/canvas/WireLayer.d.ts +11 -0
  31. package/dist/canvas/WireLayer.d.ts.map +1 -0
  32. package/dist/canvas/WirePreview.d.ts +8 -0
  33. package/dist/canvas/WirePreview.d.ts.map +1 -0
  34. package/dist/canvas/drop-on-bus.d.ts +45 -0
  35. package/dist/canvas/drop-on-bus.d.ts.map +1 -0
  36. package/dist/canvas/fit-to-content.d.ts +22 -0
  37. package/dist/canvas/fit-to-content.d.ts.map +1 -0
  38. package/dist/canvas/grid.d.ts +14 -0
  39. package/dist/canvas/grid.d.ts.map +1 -0
  40. package/dist/canvas/hit-test.d.ts +14 -0
  41. package/dist/canvas/hit-test.d.ts.map +1 -0
  42. package/dist/canvas/hover-bus.d.ts +7 -0
  43. package/dist/canvas/hover-bus.d.ts.map +1 -0
  44. package/dist/canvas/index.d.ts +11 -0
  45. package/dist/canvas/index.d.ts.map +1 -0
  46. package/dist/canvas/marquee-bus.d.ts +17 -0
  47. package/dist/canvas/marquee-bus.d.ts.map +1 -0
  48. package/dist/canvas/resolve-wire-target.d.ts +4 -0
  49. package/dist/canvas/resolve-wire-target.d.ts.map +1 -0
  50. package/dist/canvas/synthetic-pointer-cancel.d.ts +12 -0
  51. package/dist/canvas/synthetic-pointer-cancel.d.ts.map +1 -0
  52. package/dist/canvas/tools/BusbarTool.d.ts +3 -0
  53. package/dist/canvas/tools/BusbarTool.d.ts.map +1 -0
  54. package/dist/canvas/tools/PanTool.d.ts +3 -0
  55. package/dist/canvas/tools/PanTool.d.ts.map +1 -0
  56. package/dist/canvas/tools/PlaceTool.d.ts +3 -0
  57. package/dist/canvas/tools/PlaceTool.d.ts.map +1 -0
  58. package/dist/canvas/tools/SelectTool.d.ts +3 -0
  59. package/dist/canvas/tools/SelectTool.d.ts.map +1 -0
  60. package/dist/canvas/tools/TextTool.d.ts +3 -0
  61. package/dist/canvas/tools/TextTool.d.ts.map +1 -0
  62. package/dist/canvas/tools/WireTool.d.ts +3 -0
  63. package/dist/canvas/tools/WireTool.d.ts.map +1 -0
  64. package/dist/canvas/tools/index.d.ts +4 -0
  65. package/dist/canvas/tools/index.d.ts.map +1 -0
  66. package/dist/canvas/tools/types.d.ts +25 -0
  67. package/dist/canvas/tools/types.d.ts.map +1 -0
  68. package/dist/canvas/touch.d.ts +20 -0
  69. package/dist/canvas/touch.d.ts.map +1 -0
  70. package/dist/canvas/transform-attr.d.ts +3 -0
  71. package/dist/canvas/transform-attr.d.ts.map +1 -0
  72. package/dist/canvas/useHoverHighlight.d.ts +3 -0
  73. package/dist/canvas/useHoverHighlight.d.ts.map +1 -0
  74. package/dist/canvas/useKeyboardShortcuts.d.ts +15 -0
  75. package/dist/canvas/useKeyboardShortcuts.d.ts.map +1 -0
  76. package/dist/canvas/useTools.d.ts +4 -0
  77. package/dist/canvas/useTools.d.ts.map +1 -0
  78. package/dist/canvas/useViewport.d.ts +18 -0
  79. package/dist/canvas/useViewport.d.ts.map +1 -0
  80. package/dist/canvas/viewport-bus.d.ts +4 -0
  81. package/dist/canvas/viewport-bus.d.ts.map +1 -0
  82. package/dist/canvas/wire-target-bus.d.ts +14 -0
  83. package/dist/canvas/wire-target-bus.d.ts.map +1 -0
  84. package/dist/canvas/zoom-bus.d.ts +11 -0
  85. package/dist/canvas/zoom-bus.d.ts.map +1 -0
  86. package/dist/compiler/auto-layout.d.ts +18 -0
  87. package/dist/compiler/auto-layout.d.ts.map +1 -0
  88. package/dist/compiler/auto-route.d.ts +10 -0
  89. package/dist/compiler/auto-route.d.ts.map +1 -0
  90. package/dist/compiler/compile.d.ts +4 -0
  91. package/dist/compiler/compile.d.ts.map +1 -0
  92. package/dist/compiler/index.d.ts +6 -0
  93. package/dist/compiler/index.d.ts.map +1 -0
  94. package/dist/compiler/internal-model.d.ts +73 -0
  95. package/dist/compiler/internal-model.d.ts.map +1 -0
  96. package/dist/compiler/library-index.d.ts +4 -0
  97. package/dist/compiler/library-index.d.ts.map +1 -0
  98. package/dist/compiler/transforms.d.ts +7 -0
  99. package/dist/compiler/transforms.d.ts.map +1 -0
  100. package/dist/compiler/union-find.d.ts +14 -0
  101. package/dist/compiler/union-find.d.ts.map +1 -0
  102. package/dist/components/ContextMenu.d.ts +26 -0
  103. package/dist/components/ContextMenu.d.ts.map +1 -0
  104. package/dist/components/ContextualToolbar.d.ts +12 -0
  105. package/dist/components/ContextualToolbar.d.ts.map +1 -0
  106. package/dist/components/EditorShell.d.ts +2 -0
  107. package/dist/components/EditorShell.d.ts.map +1 -0
  108. package/dist/components/ExportMenu.d.ts +8 -0
  109. package/dist/components/ExportMenu.d.ts.map +1 -0
  110. package/dist/components/FileMenu.d.ts +11 -0
  111. package/dist/components/FileMenu.d.ts.map +1 -0
  112. package/dist/components/FloatingToolbar.d.ts +2 -0
  113. package/dist/components/FloatingToolbar.d.ts.map +1 -0
  114. package/dist/components/LeftPanel.d.ts +2 -0
  115. package/dist/components/LeftPanel.d.ts.map +1 -0
  116. package/dist/components/LibraryPopover.d.ts +8 -0
  117. package/dist/components/LibraryPopover.d.ts.map +1 -0
  118. package/dist/components/OnboardingCard.d.ts +13 -0
  119. package/dist/components/OnboardingCard.d.ts.map +1 -0
  120. package/dist/components/PropertyPanel.d.ts +8 -0
  121. package/dist/components/PropertyPanel.d.ts.map +1 -0
  122. package/dist/components/RightPanel.d.ts +2 -0
  123. package/dist/components/RightPanel.d.ts.map +1 -0
  124. package/dist/components/ViewToolbar.d.ts +19 -0
  125. package/dist/components/ViewToolbar.d.ts.map +1 -0
  126. package/dist/components/ui/button.d.ts +12 -0
  127. package/dist/components/ui/button.d.ts.map +1 -0
  128. package/dist/components/ui/tooltip.d.ts +18 -0
  129. package/dist/components/ui/tooltip.d.ts.map +1 -0
  130. package/dist/components/ui/upward-popover.d.ts +8 -0
  131. package/dist/components/ui/upward-popover.d.ts.map +1 -0
  132. package/dist/element-library/index.d.ts +14 -0
  133. package/dist/element-library/index.d.ts.map +1 -0
  134. package/dist/hooks/editor-tier.d.ts +32 -0
  135. package/dist/hooks/editor-tier.d.ts.map +1 -0
  136. package/dist/hooks/use-editor-tier.d.ts +6 -0
  137. package/dist/hooks/use-editor-tier.d.ts.map +1 -0
  138. package/dist/hooks/use-onboarding.d.ts +15 -0
  139. package/dist/hooks/use-onboarding.d.ts.map +1 -0
  140. package/dist/hooks/use-panels.d.ts +16 -0
  141. package/dist/hooks/use-panels.d.ts.map +1 -0
  142. package/dist/hooks/use-theme.d.ts +24 -0
  143. package/dist/hooks/use-theme.d.ts.map +1 -0
  144. package/dist/i18n/index.d.ts +14 -0
  145. package/dist/i18n/index.d.ts.map +1 -0
  146. package/dist/i18n/library.d.ts +14 -0
  147. package/dist/i18n/library.d.ts.map +1 -0
  148. package/dist/i18n/messages.d.ts +348 -0
  149. package/dist/i18n/messages.d.ts.map +1 -0
  150. package/dist/index.d.ts +20 -0
  151. package/dist/index.d.ts.map +1 -0
  152. package/dist/lib/export-dxf.d.ts +16 -0
  153. package/dist/lib/export-dxf.d.ts.map +1 -0
  154. package/dist/lib/export-image.d.ts +13 -0
  155. package/dist/lib/export-image.d.ts.map +1 -0
  156. package/dist/lib/file-io.d.ts +26 -0
  157. package/dist/lib/file-io.d.ts.map +1 -0
  158. package/dist/lib/utils.d.ts +3 -0
  159. package/dist/lib/utils.d.ts.map +1 -0
  160. package/dist/model/index.d.ts +3 -0
  161. package/dist/model/index.d.ts.map +1 -0
  162. package/dist/model/library.d.ts +115 -0
  163. package/dist/model/library.d.ts.map +1 -0
  164. package/dist/model/types.d.ts +78 -0
  165. package/dist/model/types.d.ts.map +1 -0
  166. package/dist/sldeditor.cjs +193 -0
  167. package/dist/sldeditor.cjs.map +1 -0
  168. package/dist/sldeditor.js +11601 -0
  169. package/dist/sldeditor.js.map +1 -0
  170. package/dist/store/id-allocator.d.ts +11 -0
  171. package/dist/store/id-allocator.d.ts.map +1 -0
  172. package/dist/store/index.d.ts +3 -0
  173. package/dist/store/index.d.ts.map +1 -0
  174. package/dist/store/store.d.ts +104 -0
  175. package/dist/store/store.d.ts.map +1 -0
  176. package/dist/style.css +1 -0
  177. package/package.json +107 -0
@@ -0,0 +1,19 @@
1
+ /**
2
+ * View menu collapsed into a single popover trigger. Designed to be embedded
3
+ * inline inside another bar (no outer positioning). Used by FloatingToolbar
4
+ * at `dense` and below, where it stands in for the standalone ViewToolbar.
5
+ *
6
+ * `stacked` switches the trigger to the unified-bar's tab-bar look (icon on
7
+ * top, "视图" label below) so it matches the other phone-class buttons.
8
+ */
9
+ export declare function ViewMenuButton({ stacked }?: {
10
+ stacked?: boolean;
11
+ }): import("react/jsx-runtime").JSX.Element;
12
+ /**
13
+ * Bottom-right view toolbar. Above `dense` (>520px) it renders an expanded
14
+ * row with explicit zoom controls. At `dense` and below it returns null —
15
+ * its content is rendered as an embedded ViewMenuButton inside the unified
16
+ * FloatingToolbar bottom bar so the chrome stays on a single line.
17
+ */
18
+ export declare function ViewToolbar(): import("react/jsx-runtime").JSX.Element | null;
19
+ //# sourceMappingURL=ViewToolbar.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ViewToolbar.d.ts","sourceRoot":"","sources":["../../src/components/ViewToolbar.tsx"],"names":[],"mappings":"AA8TA;;;;;;;GAOG;AACH,wBAAgB,cAAc,CAAC,EAAE,OAAO,EAAE,GAAE;IAAE,OAAO,CAAC,EAAE,OAAO,CAAA;CAAO,2CA8DrE;AAED;;;;;GAKG;AACH,wBAAgB,WAAW,mDAI1B"}
@@ -0,0 +1,12 @@
1
+ import { VariantProps } from 'class-variance-authority';
2
+ import * as React from 'react';
3
+ declare const buttonVariants: (props?: ({
4
+ variant?: "link" | "default" | "outline" | "destructive" | "secondary" | "ghost" | null | undefined;
5
+ size?: "default" | "icon" | "sm" | "lg" | null | undefined;
6
+ } & import('class-variance-authority/types').ClassProp) | undefined) => string;
7
+ export interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement>, VariantProps<typeof buttonVariants> {
8
+ asChild?: boolean;
9
+ }
10
+ export declare const Button: React.ForwardRefExoticComponent<ButtonProps & React.RefAttributes<HTMLButtonElement>>;
11
+ export { buttonVariants };
12
+ //# sourceMappingURL=button.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"button.d.ts","sourceRoot":"","sources":["../../../src/components/ui/button.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAIlE,QAAA,MAAM,cAAc;;;8EA2BnB,CAAC;AAEF,MAAM,WAAW,WACf,SAAQ,KAAK,CAAC,oBAAoB,CAAC,iBAAiB,CAAC,EACnD,YAAY,CAAC,OAAO,cAAc,CAAC;IACrC,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED,eAAO,MAAM,MAAM,uFAWlB,CAAC;AAGF,OAAO,EAAE,cAAc,EAAE,CAAC"}
@@ -0,0 +1,18 @@
1
+ import { ReactElement, ReactNode } from 'react';
2
+ export interface TooltipProps {
3
+ content: ReactNode;
4
+ children: ReactElement<{
5
+ ref?: React.Ref<HTMLElement>;
6
+ onPointerEnter?: (e: React.PointerEvent) => void;
7
+ onPointerLeave?: (e: React.PointerEvent) => void;
8
+ onFocus?: (e: React.FocusEvent) => void;
9
+ onBlur?: (e: React.FocusEvent) => void;
10
+ 'aria-describedby'?: string;
11
+ }>;
12
+ /** Force-disable (e.g. when the trigger is disabled). */
13
+ disabled?: boolean;
14
+ /** Override the default 350ms hover delay. */
15
+ delayMs?: number;
16
+ }
17
+ export declare function Tooltip({ content, children, disabled, delayMs, }: TooltipProps): import("react/jsx-runtime").JSX.Element;
18
+ //# sourceMappingURL=tooltip.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tooltip.d.ts","sourceRoot":"","sources":["../../../src/components/ui/tooltip.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAOL,KAAK,YAAY,EACjB,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AAWf,MAAM,WAAW,YAAY;IAC3B,OAAO,EAAE,SAAS,CAAC;IACnB,QAAQ,EAAE,YAAY,CAAC;QACrB,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC;QAC7B,cAAc,CAAC,EAAE,CAAC,CAAC,EAAE,KAAK,CAAC,YAAY,KAAK,IAAI,CAAC;QACjD,cAAc,CAAC,EAAE,CAAC,CAAC,EAAE,KAAK,CAAC,YAAY,KAAK,IAAI,CAAC;QACjD,OAAO,CAAC,EAAE,CAAC,CAAC,EAAE,KAAK,CAAC,UAAU,KAAK,IAAI,CAAC;QACxC,MAAM,CAAC,EAAE,CAAC,CAAC,EAAE,KAAK,CAAC,UAAU,KAAK,IAAI,CAAC;QACvC,kBAAkB,CAAC,EAAE,MAAM,CAAC;KAC7B,CAAC,CAAC;IACH,yDAAyD;IACzD,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,8CAA8C;IAC9C,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,wBAAgB,OAAO,CAAC,EACtB,OAAO,EACP,QAAQ,EACR,QAAQ,EACR,OAAuB,GACxB,EAAE,YAAY,2CAgHd"}
@@ -0,0 +1,8 @@
1
+ import { ReactNode } from 'react';
2
+ export declare function UpwardPopover({ open, onOpenChange, trigger, children, }: {
3
+ open: boolean;
4
+ onOpenChange: (next: boolean) => void;
5
+ trigger: ReactNode;
6
+ children: ReactNode;
7
+ }): import("react/jsx-runtime").JSX.Element;
8
+ //# sourceMappingURL=upward-popover.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"upward-popover.d.ts","sourceRoot":"","sources":["../../../src/components/ui/upward-popover.tsx"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAqB,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAE1D,wBAAgB,aAAa,CAAC,EAC5B,IAAI,EACJ,YAAY,EACZ,OAAO,EACP,QAAQ,GACT,EAAE;IACD,IAAI,EAAE,OAAO,CAAC;IACd,YAAY,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;IACtC,OAAO,EAAE,SAAS,CAAC;IACnB,QAAQ,EAAE,SAAS,CAAC;CACrB,2CA8BA"}
@@ -0,0 +1,14 @@
1
+ import { LibraryEntry } from '../model/library';
2
+ /** All library entries, in filesystem order. */
3
+ export declare const libraryEntries: LibraryEntry[];
4
+ /** O(1) lookup by `LibraryEntry.id`. */
5
+ export declare const libraryById: Record<string, LibraryEntry>;
6
+ /**
7
+ * Display order and Chinese labels for palette categories.
8
+ * Categories not listed here fall through to the end with their raw id.
9
+ */
10
+ export declare const CATEGORY_ORDER: readonly string[];
11
+ export declare const CATEGORY_LABELS: Record<string, string>;
12
+ /** Entries grouped by category, preserving filesystem order within each group. */
13
+ export declare const libraryByCategory: Record<string, LibraryEntry[]>;
14
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/element-library/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAMrD,gDAAgD;AAChD,eAAO,MAAM,cAAc,EAAE,YAAY,EAExC,CAAC;AAEF,wCAAwC;AACxC,eAAO,MAAM,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,YAAY,CAEpD,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,cAAc,EAAE,SAAS,MAAM,EAc3C,CAAC;AAEF,eAAO,MAAM,eAAe,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAclD,CAAC;AAEF,kFAAkF;AAClF,eAAO,MAAM,iBAAiB,EAAE,MAAM,CAAC,MAAM,EAAE,YAAY,EAAE,CAMzD,CAAC"}
@@ -0,0 +1,32 @@
1
+ import { RefObject } from 'react';
2
+ export type Tier = 'full' | 'tight' | 'compact' | 'dense' | 'mini';
3
+ /**
4
+ * Width thresholds. The key is the *next-tier-down* boundary: at or above
5
+ * `tight` (900) the layout is `full`; below 900 it's `tight`, etc. Names line
6
+ * up with what each tier collapses:
7
+ * - `tight`: FloatingToolbar tool labels off and ViewToolbar's zoom-% pill
8
+ * hides. The centered main toolbar (≈ 510px wide with labels)
9
+ * otherwise collides with the right-anchored ViewToolbar
10
+ * anywhere below ~880px.
11
+ * - `compact`: outline tab also goes icon-only.
12
+ * - `dense`: ToolHint pill hidden; ViewToolbar collapses to one popover.
13
+ * - `mini`: FloatingToolbar's [Undo/Redo/Layout] group collapses too.
14
+ */
15
+ export declare const BREAKPOINTS: {
16
+ readonly tight: 1024;
17
+ readonly compact: 720;
18
+ readonly dense: 520;
19
+ readonly mini: 380;
20
+ };
21
+ export declare function atLeast(t: Tier, min: Tier): boolean;
22
+ export declare function tierForWidth(w: number): Tier;
23
+ export declare const TierContext: import('react').Context<Tier>;
24
+ export declare function useEditorTier(): Tier;
25
+ /**
26
+ * Track the `clientWidth` of an element via ResizeObserver. Lives where the
27
+ * ref does (e.g., directly in `EditorShell`) — the layout effect needs the
28
+ * ref to be already attached, which it is in the same component but isn't
29
+ * yet when a child reads it. Returns `null` until the first measurement.
30
+ */
31
+ export declare function useObservedWidth(ref: RefObject<HTMLElement | null>): number | null;
32
+ //# sourceMappingURL=editor-tier.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"editor-tier.d.ts","sourceRoot":"","sources":["../../src/hooks/editor-tier.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAKL,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AAEf,MAAM,MAAM,IAAI,GAAG,MAAM,GAAG,OAAO,GAAG,SAAS,GAAG,OAAO,GAAG,MAAM,CAAC;AAEnE;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,WAAW;;;;;CAKd,CAAC;AAUX,wBAAgB,OAAO,CAAC,CAAC,EAAE,IAAI,EAAE,GAAG,EAAE,IAAI,GAAG,OAAO,CAEnD;AAED,wBAAgB,YAAY,CAAC,CAAC,EAAE,MAAM,GAAG,IAAI,CAM5C;AAED,eAAO,MAAM,WAAW,+BAA8B,CAAC;AAEvD,wBAAgB,aAAa,IAAI,IAAI,CAEpC;AAED;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAC9B,GAAG,EAAE,SAAS,CAAC,WAAW,GAAG,IAAI,CAAC,GACjC,MAAM,GAAG,IAAI,CAgBf"}
@@ -0,0 +1,6 @@
1
+ import { ReactNode } from 'react';
2
+ export declare function EditorTierProvider({ width, children, }: {
3
+ width: number | null;
4
+ children: ReactNode;
5
+ }): import("react/jsx-runtime").JSX.Element;
6
+ //# sourceMappingURL=use-editor-tier.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"use-editor-tier.d.ts","sourceRoot":"","sources":["../../src/hooks/use-editor-tier.tsx"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAGvC,wBAAgB,kBAAkB,CAAC,EACjC,KAAK,EACL,QAAQ,GACT,EAAE;IACD,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,QAAQ,EAAE,SAAS,CAAC;CACrB,2CAGA"}
@@ -0,0 +1,15 @@
1
+ /**
2
+ * One-shot onboarding-card dismissal flag, persisted to localStorage.
3
+ *
4
+ * Mirrors `usePanels` / `useTheme` patterns: a tiny Zustand store with a
5
+ * boolean and a setter. Once dismissed, the card stays hidden across
6
+ * reloads; clearing storage (or calling `reset`) brings it back.
7
+ */
8
+ interface OnboardingState {
9
+ dismissed: boolean;
10
+ dismiss: () => void;
11
+ reset: () => void;
12
+ }
13
+ export declare const useOnboarding: import('zustand').UseBoundStore<import('zustand').StoreApi<OnboardingState>>;
14
+ export {};
15
+ //# sourceMappingURL=use-onboarding.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"use-onboarding.d.ts","sourceRoot":"","sources":["../../src/hooks/use-onboarding.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAwBH,UAAU,eAAe;IACvB,SAAS,EAAE,OAAO,CAAC;IACnB,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,KAAK,EAAE,MAAM,IAAI,CAAC;CACnB;AAED,eAAO,MAAM,aAAa,8EAUvB,CAAC"}
@@ -0,0 +1,16 @@
1
+ /**
2
+ * Tiny Zustand store for cross-component panel open/closed state.
3
+ *
4
+ * The outline panel toggle lives at bottom-left and persists across reloads.
5
+ * The library popover is no longer tracked here — it follows the editor's
6
+ * active tool (`activeTool === 'place'`) so the toolbar button behaves like
7
+ * any other mutually-exclusive tool.
8
+ */
9
+ interface PanelState {
10
+ outlineOpen: boolean;
11
+ setOutlineOpen: (open: boolean) => void;
12
+ toggleOutline: () => void;
13
+ }
14
+ export declare const usePanels: import('zustand').UseBoundStore<import('zustand').StoreApi<PanelState>>;
15
+ export {};
16
+ //# sourceMappingURL=use-panels.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"use-panels.d.ts","sourceRoot":"","sources":["../../src/hooks/use-panels.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAUH,UAAU,UAAU;IAClB,WAAW,EAAE,OAAO,CAAC;IACrB,cAAc,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;IACxC,aAAa,EAAE,MAAM,IAAI,CAAC;CAC3B;AAyBD,eAAO,MAAM,SAAS,yEAUnB,CAAC"}
@@ -0,0 +1,24 @@
1
+ export type Theme = 'light' | 'dark';
2
+ /**
3
+ * Resolve the theme to apply at startup. Exported so that `src/demo/main.tsx`
4
+ * can apply the class before React mounts and avoid FOUC.
5
+ *
6
+ * Falls back to the OS `prefers-color-scheme` when no stored preference exists.
7
+ */
8
+ export declare function getInitialTheme(): Theme;
9
+ /** Reflect a `Theme` value onto `<html>`'s class list. */
10
+ export declare function applyTheme(theme: Theme): void;
11
+ /**
12
+ * Theme hook.
13
+ *
14
+ * - First visit: matches `prefers-color-scheme`. Continues to follow OS changes
15
+ * until the user explicitly toggles, after which the explicit choice is
16
+ * persisted and "owns" the theme.
17
+ * - `setTheme` / `toggle` always persist (they are explicit user actions).
18
+ */
19
+ export declare function useTheme(): {
20
+ theme: Theme;
21
+ setTheme: (next: Theme) => void;
22
+ toggle: () => void;
23
+ };
24
+ //# sourceMappingURL=use-theme.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"use-theme.d.ts","sourceRoot":"","sources":["../../src/hooks/use-theme.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,KAAK,GAAG,OAAO,GAAG,MAAM,CAAC;AA6BrC;;;;;GAKG;AACH,wBAAgB,eAAe,IAAI,KAAK,CAGvC;AAED,0DAA0D;AAC1D,wBAAgB,UAAU,CAAC,KAAK,EAAE,KAAK,GAAG,IAAI,CAG7C;AAED;;;;;;;GAOG;AACH,wBAAgB,QAAQ;;qBAqBc,KAAK;;EAc1C"}
@@ -0,0 +1,14 @@
1
+ import { Locale, LocaleKey } from './messages';
2
+ export type { Locale, LocaleKey };
3
+ interface LocaleState {
4
+ locale: Locale;
5
+ setLocale: (loc: Locale) => void;
6
+ toggle: () => void;
7
+ }
8
+ export declare const useLocale: import('zustand').UseBoundStore<import('zustand').StoreApi<LocaleState>>;
9
+ type Params = Record<string, string | number>;
10
+ /** Translate from a non-React context. Reads the current locale from the store. */
11
+ export declare function t(key: LocaleKey, params?: Params): string;
12
+ /** Hook for components: returns a translator bound to the current locale. */
13
+ export declare function useT(): (key: LocaleKey, params?: Params) => string;
14
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/i18n/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAGH,OAAO,EAAY,KAAK,MAAM,EAAE,KAAK,SAAS,EAAE,MAAM,YAAY,CAAC;AAEnE,YAAY,EAAE,MAAM,EAAE,SAAS,EAAE,CAAC;AA0BlC,UAAU,WAAW;IACnB,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;IACjC,MAAM,EAAE,MAAM,IAAI,CAAC;CACpB;AAED,eAAO,MAAM,SAAS,0EAWnB,CAAC;AAEJ,KAAK,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC,CAAC;AAa9C,mFAAmF;AACnF,wBAAgB,CAAC,CAAC,GAAG,EAAE,SAAS,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,CAEzD;AAED,6EAA6E;AAC7E,wBAAgB,IAAI,IAAI,CAAC,GAAG,EAAE,SAAS,EAAE,MAAM,CAAC,EAAE,MAAM,KAAK,MAAM,CAGlE"}
@@ -0,0 +1,14 @@
1
+ /**
2
+ * Translation table for `LibraryEntry` user-facing strings: display name,
3
+ * description, state labels, param labels.
4
+ *
5
+ * Kept separate from the strict `messages.ts` map because keys are derived
6
+ * from runtime data (entry id + field name) and would balloon the typed
7
+ * key union. Falls back to the JSON-defined value when no translation exists.
8
+ *
9
+ * Key shape: `<entryId>.name`, `<entryId>.desc`, `<entryId>.state.<name>`,
10
+ * `<entryId>.param.<name>`.
11
+ */
12
+ /** Returns a translator that re-renders on locale change. */
13
+ export declare function useLibT(): (key: string, fallback?: string) => string;
14
+ //# sourceMappingURL=library.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"library.d.ts","sourceRoot":"","sources":["../../src/i18n/library.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AA6NH,6DAA6D;AAC7D,wBAAgB,OAAO,IAAI,CAAC,GAAG,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,MAAM,KAAK,MAAM,CAGpE"}
@@ -0,0 +1,348 @@
1
+ /**
2
+ * Flat translation table keyed by dot-namespaced ids.
3
+ *
4
+ * Both locales must define the same key set — TypeScript enforces this via
5
+ * the `LocaleKey` type derived from `messages.zh`. Placeholder syntax is
6
+ * `{name}` and is substituted by the `t()` helper.
7
+ */
8
+ export declare const messages: {
9
+ readonly zh: {
10
+ readonly 'common.unnamed': "未命名";
11
+ readonly 'common.close': "关闭";
12
+ readonly 'common.yes': "是";
13
+ readonly 'common.no': "否";
14
+ readonly 'topbar.theme.toLight': "切换到亮色";
15
+ readonly 'topbar.theme.toDark': "切换到暗色";
16
+ readonly 'topbar.theme.currentDark': "当前:暗色主题";
17
+ readonly 'topbar.theme.currentLight': "当前:亮色主题";
18
+ readonly 'topbar.lang.toEnglish': "Switch to English";
19
+ readonly 'topbar.lang.toChinese': "切换到中文";
20
+ readonly 'topbar.lang.currentEnglish': "Current: English";
21
+ readonly 'topbar.lang.currentChinese': "当前:中文";
22
+ readonly 'topbar.export.label': "导出";
23
+ readonly 'topbar.export.tooltip': "SVG 矢量(可编辑)、PNG 位图(2× 高清)或 DXF(CAD)";
24
+ readonly 'topbar.export.pngFailed': "导出 PNG 失败:{err}";
25
+ readonly 'topbar.export.dxfFailed': "导出 DXF 失败:{err}";
26
+ readonly 'topbar.file.label': "文件";
27
+ readonly 'topbar.file.tooltip': "打开本地 .json 图、保存、或另存为";
28
+ readonly 'topbar.file.current': "当前:{name}";
29
+ readonly 'topbar.file.new': "新建";
30
+ readonly 'topbar.file.open': "打开…";
31
+ readonly 'topbar.file.save': "保存";
32
+ readonly 'topbar.file.saveAs': "另存为…";
33
+ readonly 'topbar.file.newConfirm': "新建会清空当前未保存的内容,是否继续?";
34
+ readonly 'topbar.file.openFailed': "打开失败:{err}";
35
+ readonly 'topbar.file.saveFailed': "保存失败:{err}";
36
+ readonly 'topbar.file.fileDescription': "OneLineEditor 图纸";
37
+ readonly 'outline.title': "大纲";
38
+ readonly 'outline.collapse': "折叠";
39
+ readonly 'outline.collapseAria': "折叠大纲";
40
+ readonly 'outline.empty': "(无设备 — 从元件库拖入开始)";
41
+ readonly 'props.title': "属性";
42
+ readonly 'props.node': "电气节点";
43
+ readonly 'props.wire': "连线";
44
+ readonly 'props.bus': "母线";
45
+ readonly 'props.nSelected': "{n} 选中";
46
+ readonly 'props.empty': "未选中";
47
+ readonly 'props.multi': "已选中 {n} 个元件";
48
+ readonly 'props.name': "名称";
49
+ readonly 'props.note': "备注";
50
+ readonly 'props.nodeNotFound': "电气节点 {id} 不存在";
51
+ readonly 'props.wireNotFound': "连线 {id} 不存在";
52
+ readonly 'props.nodeStats': "{terminals} 个端子 · {elements} 个元件";
53
+ readonly 'props.selectElement': "选中 {label}";
54
+ readonly 'props.selectWholeNode': "选中整个电气节点";
55
+ readonly 'view.zoomOut': "缩小";
56
+ readonly 'view.zoomOutHint': "按预设档位缩小;也可滚轮 ↓ 或 ⌘−";
57
+ readonly 'view.reset': "重置到 100%";
58
+ readonly 'view.current': "当前 {z}%";
59
+ readonly 'view.zoomIn': "放大";
60
+ readonly 'view.zoomInHint': "按预设档位放大;也可滚轮 ↑ 或 ⌘+";
61
+ readonly 'view.fit': "适配视图";
62
+ readonly 'view.fitHint': "自动缩放并居中所有元件";
63
+ readonly 'view.gridHide': "隐藏网格";
64
+ readonly 'view.gridShow': "显示网格";
65
+ readonly 'view.gridHotkey': "G";
66
+ readonly 'view.gridHideHint': "同时关闭对齐吸附(拖动可自由放置)";
67
+ readonly 'view.gridShowHint': "同时开启对齐吸附(拖动会贴到 10px 网格)";
68
+ readonly 'view.gridHideAria': "隐藏网格并关闭吸附";
69
+ readonly 'view.gridShowAria': "显示网格并开启吸附";
70
+ readonly 'view.label': "标签";
71
+ readonly 'view.labelOff': "关闭标签";
72
+ readonly 'view.labelId': "仅显示 ID";
73
+ readonly 'view.labelAll': "ID + 参数";
74
+ readonly 'view.labelHint': "点击循环切换:关闭 → 仅 ID → ID + 参数";
75
+ readonly 'library.title': "元件库";
76
+ readonly 'library.empty': "没有匹配的元件";
77
+ readonly 'library.searchPlaceholder': "搜索元件…";
78
+ readonly 'library.searchAria': "搜索元件";
79
+ readonly 'library.clearSearch': "清除搜索";
80
+ readonly 'library.itemHint': "单击进入放置模式或拖到画布";
81
+ readonly 'tool.select': "选择";
82
+ readonly 'tool.selectHint': "点选元件,框选多个,或右键打开菜单";
83
+ readonly 'tool.pan': "平移";
84
+ readonly 'tool.panHint': "拖动画布;空格键可临时切换";
85
+ readonly 'tool.wire': "连线";
86
+ readonly 'tool.wireHint': "从一个端子拖动到另一个端子完成连线";
87
+ readonly 'tool.bus': "母线";
88
+ readonly 'tool.busHint': "画布上拖动一段母线,按下定起点、释放定终点";
89
+ readonly 'tool.place': "元件";
90
+ readonly 'tool.placeHint': "点击画布放置;或从端子/母线拖出,同时放置并连接";
91
+ readonly 'tool.text': "文字";
92
+ readonly 'tool.textHint': "点击画布放置一段文字注释;双击文字可重新编辑";
93
+ readonly 'mode.selectWithSel': "拖动元件移动 · 拖端子连线 · 右键打开菜单";
94
+ readonly 'mode.selectEmpty': "点选元件 · 拖动移动 · 框选多个 · 右键打开菜单";
95
+ readonly 'mode.pan': "拖动画布 · 滚轮缩放 · 按住空格可在其他工具下临时平移";
96
+ readonly 'mode.wireDragging': "拖到另一个端子或母线上释放完成连线";
97
+ readonly 'mode.wireInit': "从端子按下,拖动到另一个端子或母线上释放";
98
+ readonly 'mode.busDragging': "拖动决定母线方向,释放定终点";
99
+ readonly 'mode.busInit': "在画布按下定起点,拖动后释放定终点";
100
+ readonly 'mode.placeNoKind': "从左侧元件库选择一种元件";
101
+ readonly 'mode.placeFromTerm': "拖到目标位置释放,新元件将连接到起点端子";
102
+ readonly 'mode.placeNormal': "点击空白放置;或从已有端子 / 母线拖出,同时放置并连接";
103
+ readonly 'mode.text': "点击画布放置文字;双击已有文字可编辑;选中后可拖动 / 删除";
104
+ readonly 'mode.escSelect': "Esc 清除选择";
105
+ readonly 'mode.escOther': "右键 / Esc 取消";
106
+ readonly 'tool.placeNoKindTooltip': "从左侧元件库选择一个元件后点击画布放置";
107
+ readonly 'tool.undo': "撤销";
108
+ readonly 'tool.undoHint': "撤销上一次编辑(移动 / 旋转 / 删除等)";
109
+ readonly 'tool.redo': "重做";
110
+ readonly 'tool.redoHint': "重做被撤销的操作";
111
+ readonly 'layout.label': "布局";
112
+ readonly 'layout.hint': "自动排版整个图或仅选中范围,并填补空缺";
113
+ readonly 'layout.allAuto': "重新自动布局";
114
+ readonly 'layout.selAuto': "重新自动布局选区";
115
+ readonly 'layout.allFill': "填补未排版位置";
116
+ readonly 'layout.selFill': "填补未排版选区";
117
+ readonly 'tool.more': "更多";
118
+ readonly 'tool.moreHint': "撤销 / 重做 / 布局";
119
+ readonly 'view.menu': "视图";
120
+ readonly 'view.menuHint': "缩放、适配、网格";
121
+ readonly 'ctx.ariaNode': "选中节点操作";
122
+ readonly 'ctx.ariaWire': "选中连线操作";
123
+ readonly 'ctx.ariaElement': "选中元件操作";
124
+ readonly 'ctx.rotate': "旋转 90°";
125
+ readonly 'ctx.rotateHint': "顺时针旋转选中元件,连线随端子自动重排";
126
+ readonly 'ctx.mirror': "水平镜像";
127
+ readonly 'ctx.mirrorTitle': "镜像";
128
+ readonly 'ctx.mirrorHint': "左右翻转选中元件";
129
+ readonly 'ctx.delete': "删除";
130
+ readonly 'ctx.deleteHintNode': "断开此电气节点上的所有连接(保留元件)";
131
+ readonly 'ctx.deleteHintWire': "移除这一根连线(其它同节点连线保留)";
132
+ readonly 'ctx.deleteHintElement': "移除选中元件及其连接的连线";
133
+ readonly 'menu.undo': "撤销";
134
+ readonly 'menu.redo': "重做";
135
+ readonly 'menu.cut': "剪切";
136
+ readonly 'menu.copy': "复制";
137
+ readonly 'menu.paste': "粘贴";
138
+ readonly 'menu.rotate': "旋转 90°";
139
+ readonly 'menu.mirror': "镜像";
140
+ readonly 'menu.selectAll': "全选";
141
+ readonly 'menu.disconnect': "断开此连线";
142
+ readonly 'menu.delete': "删除";
143
+ readonly 'io.parseFailed': "JSON 解析失败:{err}";
144
+ readonly 'io.notObject': "文件不是 JSON 对象";
145
+ readonly 'io.versionMismatch': "版本不兼容:期望 \"1\",实际 {actual}";
146
+ readonly 'io.elementsMissing': "elements 字段缺失或不是数组";
147
+ readonly 'compile.duplicateId': "元件 ID 重复:\"{id}\"";
148
+ readonly 'compile.unknownKind': "未知元件类型 kind=\"{kind}\"";
149
+ readonly 'compile.invalidTermRef': "非法端子引用 \"{ref}\"";
150
+ readonly 'compile.elementMissing': "引用了不存在的元件 \"{id}\"";
151
+ readonly 'compile.missingPin': "元件 \"{id}\" (kind={kind}) 没有引脚 \"{pin}\",可用引脚: {available}";
152
+ readonly 'compile.singleTerminal': "节点只包含一个端子,已忽略";
153
+ readonly 'compile.layoutMissingElement': "layout 键 \"{id}\" 引用了不存在的元件";
154
+ readonly 'compile.elementUnconnected': "元件 \"{id}\" 没有任何连接";
155
+ readonly 'cat.busbar': "母线 / 接线";
156
+ readonly 'cat.switching': "开关";
157
+ readonly 'cat.protection': "保护";
158
+ readonly 'cat.motor-control': "电机控制";
159
+ readonly 'cat.transformer': "变压器";
160
+ readonly 'cat.instrument-transformer': "互感器";
161
+ readonly 'cat.measurement': "测量仪表";
162
+ readonly 'cat.source': "电源";
163
+ readonly 'cat.load': "负荷";
164
+ readonly 'cat.storage': "储能";
165
+ readonly 'cat.compensation': "无功补偿";
166
+ readonly 'cat.grounding': "中性点接地";
167
+ readonly 'cat.renewable': "新能源 / 电力电子";
168
+ readonly 'onboard.title': "上手三步";
169
+ readonly 'onboard.step1.title': "画母线";
170
+ readonly 'onboard.step1.body': "选择 母线 工具(B),在画布上按下拖动";
171
+ readonly 'onboard.step2.title': "从母线拖出元件";
172
+ readonly 'onboard.step2.body': "切到 元件(P)选一种,按住母线拖到目标位置 — 自动连接";
173
+ readonly 'onboard.step3.title': "继续串接";
174
+ readonly 'onboard.step3.body': "从任意端子拖出,落到目标即与该端子相连";
175
+ readonly 'onboard.dismiss': "知道了";
176
+ };
177
+ readonly en: {
178
+ readonly 'common.unnamed': "Untitled";
179
+ readonly 'common.close': "Close";
180
+ readonly 'common.yes': "Yes";
181
+ readonly 'common.no': "No";
182
+ readonly 'topbar.theme.toLight': "Switch to light";
183
+ readonly 'topbar.theme.toDark': "Switch to dark";
184
+ readonly 'topbar.theme.currentDark': "Current: dark theme";
185
+ readonly 'topbar.theme.currentLight': "Current: light theme";
186
+ readonly 'topbar.lang.toEnglish': "Switch to English";
187
+ readonly 'topbar.lang.toChinese': "切换到中文";
188
+ readonly 'topbar.lang.currentEnglish': "Current: English";
189
+ readonly 'topbar.lang.currentChinese': "Current: Chinese";
190
+ readonly 'topbar.export.label': "Export";
191
+ readonly 'topbar.export.tooltip': "SVG vector (editable), PNG bitmap (2× HiDPI), or DXF (CAD)";
192
+ readonly 'topbar.export.pngFailed': "PNG export failed: {err}";
193
+ readonly 'topbar.export.dxfFailed': "DXF export failed: {err}";
194
+ readonly 'topbar.file.label': "File";
195
+ readonly 'topbar.file.tooltip': "Open a local .json diagram, save, or save as";
196
+ readonly 'topbar.file.current': "Current: {name}";
197
+ readonly 'topbar.file.new': "New";
198
+ readonly 'topbar.file.open': "Open…";
199
+ readonly 'topbar.file.save': "Save";
200
+ readonly 'topbar.file.saveAs': "Save as…";
201
+ readonly 'topbar.file.newConfirm': "New will discard any unsaved changes. Continue?";
202
+ readonly 'topbar.file.openFailed': "Open failed: {err}";
203
+ readonly 'topbar.file.saveFailed': "Save failed: {err}";
204
+ readonly 'topbar.file.fileDescription': "OneLineEditor diagram";
205
+ readonly 'outline.title': "Outline";
206
+ readonly 'outline.collapse': "Collapse";
207
+ readonly 'outline.collapseAria': "Collapse outline";
208
+ readonly 'outline.empty': "(No elements — drag from the library to start)";
209
+ readonly 'props.title': "Properties";
210
+ readonly 'props.node': "Electrical node";
211
+ readonly 'props.wire': "Wire";
212
+ readonly 'props.bus': "Bus";
213
+ readonly 'props.nSelected': "{n} selected";
214
+ readonly 'props.empty': "Nothing selected";
215
+ readonly 'props.multi': "{n} elements selected";
216
+ readonly 'props.name': "Name";
217
+ readonly 'props.note': "Note";
218
+ readonly 'props.nodeNotFound': "Electrical node {id} not found";
219
+ readonly 'props.wireNotFound': "Wire {id} not found";
220
+ readonly 'props.nodeStats': "{terminals} terminals · {elements} elements";
221
+ readonly 'props.selectElement': "Select {label}";
222
+ readonly 'props.selectWholeNode': "Select whole electrical node";
223
+ readonly 'view.zoomOut': "Zoom out";
224
+ readonly 'view.zoomOutHint': "Step zoom out; also wheel ↓ or ⌘−";
225
+ readonly 'view.reset': "Reset to 100%";
226
+ readonly 'view.current': "Current {z}%";
227
+ readonly 'view.zoomIn': "Zoom in";
228
+ readonly 'view.zoomInHint': "Step zoom in; also wheel ↑ or ⌘+";
229
+ readonly 'view.fit': "Fit view";
230
+ readonly 'view.fitHint': "Auto-zoom and center all elements";
231
+ readonly 'view.gridHide': "Hide grid";
232
+ readonly 'view.gridShow': "Show grid";
233
+ readonly 'view.gridHotkey': "G";
234
+ readonly 'view.gridHideHint': "Also disables snap-to-grid (free placement)";
235
+ readonly 'view.gridShowHint': "Also enables snap-to-grid (snaps to 10px on drag)";
236
+ readonly 'view.gridHideAria': "Hide grid and disable snap";
237
+ readonly 'view.gridShowAria': "Show grid and enable snap";
238
+ readonly 'view.label': "Labels";
239
+ readonly 'view.labelOff': "Hide labels";
240
+ readonly 'view.labelId': "ID only";
241
+ readonly 'view.labelAll': "ID + params";
242
+ readonly 'view.labelHint': "Cycle: off → ID → ID + params";
243
+ readonly 'library.title': "Library";
244
+ readonly 'library.empty': "No matching elements";
245
+ readonly 'library.searchPlaceholder': "Search elements…";
246
+ readonly 'library.searchAria': "Search elements";
247
+ readonly 'library.clearSearch': "Clear search";
248
+ readonly 'library.itemHint': "Click to enter place mode, or drag onto the canvas";
249
+ readonly 'tool.select': "Select";
250
+ readonly 'tool.selectHint': "Click to pick, marquee for multiple, right-click for menu";
251
+ readonly 'tool.pan': "Pan";
252
+ readonly 'tool.panHint': "Drag the canvas; Space toggles temporarily";
253
+ readonly 'tool.wire': "Wire";
254
+ readonly 'tool.wireHint': "Drag from one terminal to another to wire";
255
+ readonly 'tool.bus': "Busbar";
256
+ readonly 'tool.busHint': "Drag on the canvas — press to set start, release to set end";
257
+ readonly 'tool.place': "Place";
258
+ readonly 'tool.placeHint': "Click to place; or drag from a terminal/bus to place and connect";
259
+ readonly 'tool.text': "Text";
260
+ readonly 'tool.textHint': "Click the canvas to drop a text note; double-click an existing one to edit";
261
+ readonly 'mode.selectWithSel': "Drag elements · drag terminals to wire · right-click for menu";
262
+ readonly 'mode.selectEmpty': "Click to pick · drag to move · marquee for multiple · right-click for menu";
263
+ readonly 'mode.pan': "Drag the canvas · scroll to zoom · hold Space to pan in any tool";
264
+ readonly 'mode.wireDragging': "Release on another terminal or busbar to complete the wire";
265
+ readonly 'mode.wireInit': "Press on a terminal, drag to another terminal or busbar, release";
266
+ readonly 'mode.busDragging': "Drag sets bus direction; release sets the end";
267
+ readonly 'mode.busInit': "Press on the canvas to set start, drag, release to set end";
268
+ readonly 'mode.placeNoKind': "Pick an element kind from the library on the left";
269
+ readonly 'mode.placeFromTerm': "Release at the target — the new element will connect back to the source terminal";
270
+ readonly 'mode.placeNormal': "Click empty space to place; or drag from a terminal / bus to place and connect";
271
+ readonly 'mode.text': "Click to drop text · double-click to edit · drag selected to move · Del to remove";
272
+ readonly 'mode.escSelect': "Esc clears selection";
273
+ readonly 'mode.escOther': "Right-click / Esc to cancel";
274
+ readonly 'tool.placeNoKindTooltip': "Pick a kind in the library on the left, then click the canvas";
275
+ readonly 'tool.undo': "Undo";
276
+ readonly 'tool.undoHint': "Undo the last edit (move / rotate / delete, etc.)";
277
+ readonly 'tool.redo': "Redo";
278
+ readonly 'tool.redoHint': "Redo the last undone edit";
279
+ readonly 'layout.label': "Layout";
280
+ readonly 'layout.hint': "Auto-layout the whole diagram or just the selection, fill gaps";
281
+ readonly 'layout.allAuto': "Auto-layout all";
282
+ readonly 'layout.selAuto': "Auto-layout selection";
283
+ readonly 'layout.allFill': "Fill unplaced";
284
+ readonly 'layout.selFill': "Fill unplaced in selection";
285
+ readonly 'tool.more': "More";
286
+ readonly 'tool.moreHint': "Undo / redo / layout";
287
+ readonly 'view.menu': "View";
288
+ readonly 'view.menuHint': "Zoom, fit, grid";
289
+ readonly 'ctx.ariaNode': "Node actions";
290
+ readonly 'ctx.ariaWire': "Wire actions";
291
+ readonly 'ctx.ariaElement': "Element actions";
292
+ readonly 'ctx.rotate': "Rotate 90°";
293
+ readonly 'ctx.rotateHint': "Rotate selection clockwise; wires re-route through new terminals";
294
+ readonly 'ctx.mirror': "Mirror horizontally";
295
+ readonly 'ctx.mirrorTitle': "Mirror";
296
+ readonly 'ctx.mirrorHint': "Flip selection left-right";
297
+ readonly 'ctx.delete': "Delete";
298
+ readonly 'ctx.deleteHintNode': "Disconnect every wire on this node (elements stay)";
299
+ readonly 'ctx.deleteHintWire': "Remove only this wire (siblings on the same node stay)";
300
+ readonly 'ctx.deleteHintElement': "Remove the selection and its wires";
301
+ readonly 'menu.undo': "Undo";
302
+ readonly 'menu.redo': "Redo";
303
+ readonly 'menu.cut': "Cut";
304
+ readonly 'menu.copy': "Copy";
305
+ readonly 'menu.paste': "Paste";
306
+ readonly 'menu.rotate': "Rotate 90°";
307
+ readonly 'menu.mirror': "Mirror";
308
+ readonly 'menu.selectAll': "Select all";
309
+ readonly 'menu.disconnect': "Disconnect this wire";
310
+ readonly 'menu.delete': "Delete";
311
+ readonly 'io.parseFailed': "JSON parse failed: {err}";
312
+ readonly 'io.notObject': "File is not a JSON object";
313
+ readonly 'io.versionMismatch': "Version mismatch: expected \"1\", got {actual}";
314
+ readonly 'io.elementsMissing': "`elements` is missing or not an array";
315
+ readonly 'compile.duplicateId': "Duplicate element id: \"{id}\"";
316
+ readonly 'compile.unknownKind': "Unknown element kind=\"{kind}\"";
317
+ readonly 'compile.invalidTermRef': "Invalid terminal reference \"{ref}\"";
318
+ readonly 'compile.elementMissing': "Reference to unknown element \"{id}\"";
319
+ readonly 'compile.missingPin': "Element \"{id}\" (kind={kind}) has no pin \"{pin}\"; available: {available}";
320
+ readonly 'compile.singleTerminal': "Node has only one terminal — ignored";
321
+ readonly 'compile.layoutMissingElement': "layout key \"{id}\" references an unknown element";
322
+ readonly 'compile.elementUnconnected': "Element \"{id}\" has no connections";
323
+ readonly 'cat.busbar': "Busbar / wiring";
324
+ readonly 'cat.switching': "Switching";
325
+ readonly 'cat.protection': "Protection";
326
+ readonly 'cat.motor-control': "Motor control";
327
+ readonly 'cat.transformer': "Transformer";
328
+ readonly 'cat.instrument-transformer': "Instrument transformer";
329
+ readonly 'cat.measurement': "Measurement";
330
+ readonly 'cat.source': "Source";
331
+ readonly 'cat.load': "Load";
332
+ readonly 'cat.storage': "Storage";
333
+ readonly 'cat.compensation': "Compensation";
334
+ readonly 'cat.grounding': "Grounding";
335
+ readonly 'cat.renewable': "Renewables / power electronics";
336
+ readonly 'onboard.title': "Quick start";
337
+ readonly 'onboard.step1.title': "Draw a busbar";
338
+ readonly 'onboard.step1.body': "Pick the busbar tool (B), then press and drag on the canvas";
339
+ readonly 'onboard.step2.title': "Drag elements from the bus";
340
+ readonly 'onboard.step2.body': "Switch to Place (P), pick a kind, then drag from the bus — it auto-connects";
341
+ readonly 'onboard.step3.title': "Chain the next one";
342
+ readonly 'onboard.step3.body': "Drag from any terminal — the new element drops pre-connected";
343
+ readonly 'onboard.dismiss': "Got it";
344
+ };
345
+ };
346
+ export type Locale = keyof typeof messages;
347
+ export type LocaleKey = keyof (typeof messages)['zh'];
348
+ //# sourceMappingURL=messages.d.ts.map
@@ -0,0 +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"}