@elixpo/lixsketch 5.6.9 → 5.6.11

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 (165) hide show
  1. package/dist/react/{AIRenderer-R5M2CIDO.js → AIRenderer-JNEZYDYQ.js} +4 -4
  2. package/dist/react/Arrow-QMR77LGQ.js +9 -0
  3. package/dist/react/Circle-5WL5HZA5.js +11 -0
  4. package/dist/react/{CopyPaste-PPDS3AD6.js → CopyPaste-V7AY56H3.js} +74 -30
  5. package/dist/react/CopyPaste-V7AY56H3.js.map +7 -0
  6. package/dist/react/{EventDispatcher-UV7LFSAS.js → EventDispatcher-E4OJCMY6.js} +154 -57
  7. package/dist/react/{EventDispatcher-UV7LFSAS.js.map → EventDispatcher-E4OJCMY6.js.map} +3 -3
  8. package/dist/react/Frame-OZCDVPMI.js +11 -0
  9. package/dist/react/FreehandStroke-QSSYWBFK.js +9 -0
  10. package/dist/react/IconShape-HXUV4VRT.js +10 -0
  11. package/dist/react/ImageShape-JGLT2UGG.js +10 -0
  12. package/dist/react/Line-YONPLUYT.js +11 -0
  13. package/dist/react/{MermaidFlowchartRenderer-EL3Q2MNW.js → MermaidFlowchartRenderer-FSH43RUP.js} +26 -7
  14. package/dist/react/{MermaidFlowchartRenderer-EL3Q2MNW.js.map → MermaidFlowchartRenderer-FSH43RUP.js.map} +2 -2
  15. package/dist/react/{MermaidSequenceRenderer-K4KHHEVC.js → MermaidSequenceRenderer-FRPNOF2V.js} +11 -9
  16. package/dist/react/{MermaidSequenceRenderer-K4KHHEVC.js.map → MermaidSequenceRenderer-FRPNOF2V.js.map} +2 -2
  17. package/dist/react/{MermaidStructuredRenderer-6LN3WISP.js → MermaidStructuredRenderer-BZGQLRIH.js} +13 -6
  18. package/dist/react/{MermaidStructuredRenderer-6LN3WISP.js.map → MermaidStructuredRenderer-BZGQLRIH.js.map} +2 -2
  19. package/dist/react/Rectangle-7KMA3SC6.js +11 -0
  20. package/dist/react/{SceneSerializer-H6KMQCO2.js → SceneSerializer-7O72LEZP.js} +13 -12
  21. package/dist/react/{SceneSerializer-H6KMQCO2.js.map → SceneSerializer-7O72LEZP.js.map} +1 -1
  22. package/dist/react/{Selection-CFWRGVKH.js → Selection-S4FYSZIF.js} +5 -5
  23. package/dist/react/{SketchEngine-UFLZJQXS.js → SketchEngine-VTWURP2K.js} +26 -26
  24. package/dist/react/{UndoRedo-RXO7YHA2.js → UndoRedo-YLQJ6DXW.js} +8 -2
  25. package/dist/react/{ZoomPan-RR7KUYZT.js → ZoomPan-AEKWKUCH.js} +2 -2
  26. package/dist/react/{arrowTool-DO327FKU.js → arrowTool-C4RDWQEX.js} +3 -3
  27. package/dist/react/{chunk-X5ENBMGL.js → chunk-2U47AU6Y.js} +3 -3
  28. package/dist/react/{chunk-X5ENBMGL.js.map → chunk-2U47AU6Y.js.map} +1 -1
  29. package/dist/react/{chunk-RK3NVAER.js → chunk-75OPJOWN.js} +7 -7
  30. package/dist/react/chunk-75OPJOWN.js.map +7 -0
  31. package/dist/react/{chunk-DODPOWNX.js → chunk-CWE5IFG7.js} +5 -5
  32. package/dist/react/{chunk-DODPOWNX.js.map → chunk-CWE5IFG7.js.map} +1 -1
  33. package/dist/react/{chunk-O7KXLFZN.js → chunk-IS2MKWGH.js} +8 -7
  34. package/dist/react/chunk-IS2MKWGH.js.map +7 -0
  35. package/dist/react/{chunk-ZNZAICWY.js → chunk-JEHOEQ6Z.js} +13 -5
  36. package/dist/react/chunk-JEHOEQ6Z.js.map +7 -0
  37. package/dist/react/{chunk-BOZEDUAF.js → chunk-JYBJXTLM.js} +40 -15
  38. package/dist/react/chunk-JYBJXTLM.js.map +7 -0
  39. package/dist/react/{chunk-6LWUR7XB.js → chunk-LXEHYCKH.js} +4 -4
  40. package/dist/react/{chunk-6LWUR7XB.js.map → chunk-LXEHYCKH.js.map} +1 -1
  41. package/dist/react/chunk-M7OYYJC6.js +17 -0
  42. package/dist/react/chunk-M7OYYJC6.js.map +7 -0
  43. package/dist/react/chunk-MS4TIQ6Z.js +131 -0
  44. package/dist/react/chunk-MS4TIQ6Z.js.map +7 -0
  45. package/dist/react/{chunk-2ALS5JGS.js → chunk-OCJN32IL.js} +2 -2
  46. package/dist/react/{chunk-KZBKYHZO.js → chunk-P7VIYR6R.js} +8 -5
  47. package/dist/react/chunk-P7VIYR6R.js.map +7 -0
  48. package/dist/react/{chunk-KC26KJW4.js → chunk-PX2635H5.js} +32 -10
  49. package/dist/react/chunk-PX2635H5.js.map +7 -0
  50. package/dist/react/{chunk-37PF7FG2.js → chunk-SDG4U7TP.js} +7 -6
  51. package/dist/react/chunk-SDG4U7TP.js.map +7 -0
  52. package/dist/react/{chunk-CGMUXYPJ.js → chunk-STJERZ25.js} +8 -4
  53. package/dist/react/chunk-STJERZ25.js.map +7 -0
  54. package/dist/react/{chunk-VZPH7OAM.js → chunk-TCWCC4Z4.js} +7 -3
  55. package/dist/react/chunk-TCWCC4Z4.js.map +7 -0
  56. package/dist/react/{chunk-VZX55VQL.js → chunk-TFCBCWL5.js} +90 -33
  57. package/dist/react/chunk-TFCBCWL5.js.map +7 -0
  58. package/dist/react/{chunk-GQLXUZHQ.js → chunk-TWHJ6PJK.js} +5 -3
  59. package/dist/react/chunk-TWHJ6PJK.js.map +7 -0
  60. package/dist/react/{chunk-NH3NVSWT.js → chunk-UCOK4V5Z.js} +4 -3
  61. package/dist/react/{chunk-NH3NVSWT.js.map → chunk-UCOK4V5Z.js.map} +2 -2
  62. package/dist/react/{chunk-W7XUY4GR.js → chunk-VJDNKJBX.js} +56 -4
  63. package/dist/react/chunk-VJDNKJBX.js.map +7 -0
  64. package/dist/react/{chunk-BT2EIJD4.js → chunk-WCA3FGWE.js} +6 -3
  65. package/dist/react/chunk-WCA3FGWE.js.map +7 -0
  66. package/dist/react/{chunk-I7TVGJFF.js → chunk-Y3FJMYPX.js} +4 -4
  67. package/dist/react/{chunk-I7TVGJFF.js.map → chunk-Y3FJMYPX.js.map} +1 -1
  68. package/dist/react/{chunk-7DD2JRBC.js → chunk-YCGLGY4C.js} +2 -2
  69. package/dist/react/{circleTool-NK4RVDAR.js → circleTool-QQV2QEVF.js} +4 -4
  70. package/dist/react/{codeTool-3WF4HEOW.js → codeTool-PTCPSZ4L.js} +5 -5
  71. package/dist/react/{frameTool-VCNV2NG2.js → frameTool-7GQPLU4Y.js} +4 -4
  72. package/dist/react/{freehandTool-TBAOD46K.js → freehandTool-3RJXTVAK.js} +4 -4
  73. package/dist/react/{iconTool-65JCAKYF.js → iconTool-DW5YJX7P.js} +5 -5
  74. package/dist/react/{imageTool-UQZUBOK2.js → imageTool-7GZQKWYT.js} +5 -5
  75. package/dist/react/index.js +68 -63
  76. package/dist/react/index.js.map +2 -2
  77. package/dist/react/{lineTool-762KBYOM.js → lineTool-5CY7BHND.js} +4 -4
  78. package/dist/react/{rectangleTool-IQK3HZK6.js → rectangleTool-DK4QL4QW.js} +4 -4
  79. package/dist/react/styles.css +4 -0
  80. package/dist/react/{textTool-ITG2SBJK.js → textTool-GP5QQYF3.js} +6 -6
  81. package/package.json +1 -1
  82. package/src/core/CopyPaste.js +66 -18
  83. package/src/core/EventDispatcher.js +71 -47
  84. package/src/core/MermaidFlowchartRenderer.js +34 -8
  85. package/src/core/MermaidSequenceRenderer.js +10 -8
  86. package/src/core/MermaidStructuredRenderer.js +12 -5
  87. package/src/core/ScreenSpaceControls.js +102 -13
  88. package/src/core/Selection.js +26 -7
  89. package/src/core/SelectionGesture.js +50 -0
  90. package/src/core/UndoRedo.js +108 -35
  91. package/src/react/components/sidebars/CircleSidebar.jsx +11 -5
  92. package/src/react/components/sidebars/IconSidebar.jsx +10 -4
  93. package/src/react/components/sidebars/RectangleSidebar.jsx +11 -5
  94. package/src/react/components/sidebars/ShapeSidebar.jsx +29 -37
  95. package/src/react/components/sidebars/TextSidebar.jsx +10 -4
  96. package/src/react/store/useUIStore.js +8 -1
  97. package/src/react/styles.css +13 -0
  98. package/src/react/utils/canvasBackgrounds.js +11 -2
  99. package/src/shapes/Arrow.js +4 -3
  100. package/src/shapes/Circle.js +58 -2
  101. package/src/shapes/Frame.js +11 -4
  102. package/src/shapes/FreehandStroke.js +2 -1
  103. package/src/shapes/Line.js +47 -20
  104. package/src/shapes/Rectangle.js +3 -1
  105. package/src/tools/arrowTool.js +1 -1
  106. package/src/tools/circleTool.js +5 -2
  107. package/src/tools/codeTool.js +1 -1
  108. package/src/tools/frameTool.js +3 -2
  109. package/src/tools/freehandTool.js +1 -1
  110. package/src/tools/iconTool.js +4 -3
  111. package/src/tools/imageTool.js +3 -2
  112. package/src/tools/lineTool.js +5 -1
  113. package/src/tools/rectangleTool.js +1 -1
  114. package/src/tools/shapeRecognitionTool.js +1 -1
  115. package/src/tools/textTool.js +2 -2
  116. package/src/utils/themeColors.js +13 -0
  117. package/dist/react/Arrow-EF7ALH2Y.js +0 -8
  118. package/dist/react/Circle-HMM5PKJ2.js +0 -10
  119. package/dist/react/CopyPaste-PPDS3AD6.js.map +0 -7
  120. package/dist/react/Frame-DELCMYV6.js +0 -11
  121. package/dist/react/FreehandStroke-WXIJKD5I.js +0 -9
  122. package/dist/react/IconShape-PZHMZSLR.js +0 -10
  123. package/dist/react/ImageShape-ZMBZARRI.js +0 -10
  124. package/dist/react/Line-VPVPL6ET.js +0 -10
  125. package/dist/react/Rectangle-4U4CD2ER.js +0 -10
  126. package/dist/react/chunk-37PF7FG2.js.map +0 -7
  127. package/dist/react/chunk-BOZEDUAF.js.map +0 -7
  128. package/dist/react/chunk-BT2EIJD4.js.map +0 -7
  129. package/dist/react/chunk-CGMUXYPJ.js.map +0 -7
  130. package/dist/react/chunk-GQLXUZHQ.js.map +0 -7
  131. package/dist/react/chunk-KC26KJW4.js.map +0 -7
  132. package/dist/react/chunk-KZBKYHZO.js.map +0 -7
  133. package/dist/react/chunk-O7KXLFZN.js.map +0 -7
  134. package/dist/react/chunk-PAKA6HUX.js +0 -59
  135. package/dist/react/chunk-PAKA6HUX.js.map +0 -7
  136. package/dist/react/chunk-RK3NVAER.js.map +0 -7
  137. package/dist/react/chunk-VZPH7OAM.js.map +0 -7
  138. package/dist/react/chunk-VZX55VQL.js.map +0 -7
  139. package/dist/react/chunk-W7XUY4GR.js.map +0 -7
  140. package/dist/react/chunk-ZNZAICWY.js.map +0 -7
  141. /package/dist/react/{AIRenderer-R5M2CIDO.js.map → AIRenderer-JNEZYDYQ.js.map} +0 -0
  142. /package/dist/react/{Arrow-EF7ALH2Y.js.map → Arrow-QMR77LGQ.js.map} +0 -0
  143. /package/dist/react/{Circle-HMM5PKJ2.js.map → Circle-5WL5HZA5.js.map} +0 -0
  144. /package/dist/react/{Frame-DELCMYV6.js.map → Frame-OZCDVPMI.js.map} +0 -0
  145. /package/dist/react/{FreehandStroke-WXIJKD5I.js.map → FreehandStroke-QSSYWBFK.js.map} +0 -0
  146. /package/dist/react/{IconShape-PZHMZSLR.js.map → IconShape-HXUV4VRT.js.map} +0 -0
  147. /package/dist/react/{ImageShape-ZMBZARRI.js.map → ImageShape-JGLT2UGG.js.map} +0 -0
  148. /package/dist/react/{Line-VPVPL6ET.js.map → Line-YONPLUYT.js.map} +0 -0
  149. /package/dist/react/{Rectangle-4U4CD2ER.js.map → Rectangle-7KMA3SC6.js.map} +0 -0
  150. /package/dist/react/{Selection-CFWRGVKH.js.map → Selection-S4FYSZIF.js.map} +0 -0
  151. /package/dist/react/{SketchEngine-UFLZJQXS.js.map → SketchEngine-VTWURP2K.js.map} +0 -0
  152. /package/dist/react/{UndoRedo-RXO7YHA2.js.map → UndoRedo-YLQJ6DXW.js.map} +0 -0
  153. /package/dist/react/{ZoomPan-RR7KUYZT.js.map → ZoomPan-AEKWKUCH.js.map} +0 -0
  154. /package/dist/react/{arrowTool-DO327FKU.js.map → arrowTool-C4RDWQEX.js.map} +0 -0
  155. /package/dist/react/{chunk-2ALS5JGS.js.map → chunk-OCJN32IL.js.map} +0 -0
  156. /package/dist/react/{chunk-7DD2JRBC.js.map → chunk-YCGLGY4C.js.map} +0 -0
  157. /package/dist/react/{circleTool-NK4RVDAR.js.map → circleTool-QQV2QEVF.js.map} +0 -0
  158. /package/dist/react/{codeTool-3WF4HEOW.js.map → codeTool-PTCPSZ4L.js.map} +0 -0
  159. /package/dist/react/{frameTool-VCNV2NG2.js.map → frameTool-7GQPLU4Y.js.map} +0 -0
  160. /package/dist/react/{freehandTool-TBAOD46K.js.map → freehandTool-3RJXTVAK.js.map} +0 -0
  161. /package/dist/react/{iconTool-65JCAKYF.js.map → iconTool-DW5YJX7P.js.map} +0 -0
  162. /package/dist/react/{imageTool-UQZUBOK2.js.map → imageTool-7GZQKWYT.js.map} +0 -0
  163. /package/dist/react/{lineTool-762KBYOM.js.map → lineTool-5CY7BHND.js.map} +0 -0
  164. /package/dist/react/{rectangleTool-IQK3HZK6.js.map → rectangleTool-DK4QL4QW.js.map} +0 -0
  165. /package/dist/react/{textTool-ITG2SBJK.js.map → textTool-GP5QQYF3.js.map} +0 -0
@@ -5,10 +5,10 @@ import {
5
5
  handleMouseUpIcon,
6
6
  startDrag,
7
7
  stopDrag
8
- } from "./chunk-O7KXLFZN.js";
9
- import "./chunk-PAKA6HUX.js";
10
- import "./chunk-X5ENBMGL.js";
11
- import "./chunk-VZX55VQL.js";
8
+ } from "./chunk-IS2MKWGH.js";
9
+ import "./chunk-MS4TIQ6Z.js";
10
+ import "./chunk-2U47AU6Y.js";
11
+ import "./chunk-TFCBCWL5.js";
12
12
  export {
13
13
  handleMouseDownIcon,
14
14
  handleMouseMoveIcon,
@@ -16,4 +16,4 @@ export {
16
16
  startDrag,
17
17
  stopDrag
18
18
  };
19
- //# sourceMappingURL=iconTool-65JCAKYF.js.map
19
+ //# sourceMappingURL=iconTool-DW5YJX7P.js.map
@@ -3,14 +3,14 @@ import {
3
3
  handleMouseDownImage,
4
4
  handleMouseMoveImage,
5
5
  handleMouseUpImage
6
- } from "./chunk-37PF7FG2.js";
6
+ } from "./chunk-SDG4U7TP.js";
7
7
  import "./chunk-DNAG7ML6.js";
8
- import "./chunk-PAKA6HUX.js";
9
- import "./chunk-X5ENBMGL.js";
10
- import "./chunk-VZX55VQL.js";
8
+ import "./chunk-MS4TIQ6Z.js";
9
+ import "./chunk-2U47AU6Y.js";
10
+ import "./chunk-TFCBCWL5.js";
11
11
  export {
12
12
  handleMouseDownImage,
13
13
  handleMouseMoveImage,
14
14
  handleMouseUpImage
15
15
  };
16
- //# sourceMappingURL=imageTool-UQZUBOK2.js.map
16
+ //# sourceMappingURL=imageTool-7GZQKWYT.js.map
@@ -20,7 +20,7 @@ import { create } from "zustand";
20
20
  // src/react/utils/canvasBackgrounds.js
21
21
  var CANVAS_BACKGROUNDS = {
22
22
  light: [
23
- { color: "#FBE4DB", label: "menu.canvasBg.white" },
23
+ { color: "#FFFFFF", label: "menu.canvasBg.white" },
24
24
  { color: "#F6DBC0", label: "menu.canvasBg.cream" },
25
25
  { color: "#F5EED2", label: "menu.canvasBg.paper" },
26
26
  { color: "#F5F2ED", label: "menu.canvasBg.skyTint" },
@@ -34,12 +34,21 @@ var CANVAS_BACKGROUNDS = {
34
34
  { color: "#1B1615", label: "menu.canvasBg.darkBrown" }
35
35
  ]
36
36
  };
37
- var DEFAULT_CANVAS_BACKGROUNDS = { dark: "#15111f", light: "#F5F2ED" };
37
+ var DEFAULT_CANVAS_BACKGROUNDS = { dark: "#15111f", light: "#FFFFFF" };
38
+ var LEGACY_LIGHT_DEFAULT = "#F5F2ED";
39
+ var LIGHT_DEFAULT_MIGRATION_KEY = "lixsketch-canvas-light-default-v2";
38
40
  var canvasBackgroundStorageKey = (theme) => `lixsketch-canvas-background-${theme}`;
39
41
  function readCanvasBackground(theme, storage) {
40
42
  const resolved = theme === "light" ? "light" : "dark";
41
43
  try {
42
44
  const stored = storage?.getItem(canvasBackgroundStorageKey(resolved));
45
+ if (resolved === "light" && storage?.getItem(LIGHT_DEFAULT_MIGRATION_KEY) !== "1") {
46
+ storage?.setItem?.(LIGHT_DEFAULT_MIGRATION_KEY, "1");
47
+ if (stored?.toLowerCase() === LEGACY_LIGHT_DEFAULT.toLowerCase()) {
48
+ storage?.setItem?.(canvasBackgroundStorageKey(resolved), DEFAULT_CANVAS_BACKGROUNDS.light);
49
+ return DEFAULT_CANVAS_BACKGROUNDS.light;
50
+ }
51
+ }
43
52
  const match = CANVAS_BACKGROUNDS[resolved].find(({ color }) => color.toLowerCase() === stored?.toLowerCase());
44
53
  if (match) return match.color;
45
54
  } catch {
@@ -423,6 +432,13 @@ function invertShapeColors(prevResolved, nextResolved) {
423
432
  shape.strokeColor = to;
424
433
  changed = true;
425
434
  }
435
+ if (shape.labelColor !== void 0) {
436
+ const labelColor = normalize(shape.labelColor);
437
+ if (labelColor === from || labelColor === "#e0e0e0" || labelColor === "#e8e3f3") {
438
+ shape.labelColor = to;
439
+ changed = true;
440
+ }
441
+ }
426
442
  }
427
443
  if (changed && typeof shape.draw === "function") {
428
444
  shape.draw();
@@ -450,7 +466,7 @@ function applyTheme(theme) {
450
466
  body.classList.remove("theme-dark", "theme-light");
451
467
  body.classList.add(`theme-${resolved}`);
452
468
  const svgEl = window.svg;
453
- if (svgEl) svgEl.style.background = resolved === "light" ? "#fbf9fd" : "#15111f";
469
+ if (svgEl) svgEl.style.background = resolved === "light" ? "#ffffff" : "#15111f";
454
470
  }
455
471
  var useUIStore = create2((set, get) => ({
456
472
  // --- Modals ---
@@ -625,7 +641,7 @@ function useSketchEngine(svgRef, ready = true) {
625
641
  setZoom: (zoom) => useSketchStore_default.setState({ zoom }),
626
642
  getState: () => useSketchStore_default.getState()
627
643
  };
628
- const { SketchEngine } = await import("./SketchEngine-UFLZJQXS.js");
644
+ const { SketchEngine } = await import("./SketchEngine-VTWURP2K.js");
629
645
  if (cancelled) return;
630
646
  const engine = new SketchEngine(svgRef.current);
631
647
  await engine.init();
@@ -1801,7 +1817,7 @@ function AppMenu() {
1801
1817
  // src/react/components/sidebars/ShapeSidebar.jsx
1802
1818
  import { useState as useState5, useRef as useRef5, useEffect as useEffect6 } from "react";
1803
1819
  import { jsx as jsx6, jsxs as jsxs6 } from "react/jsx-runtime";
1804
- function ToolbarButton({ icon, preview, children, tooltip }) {
1820
+ function ToolbarButton({ icon, preview, children, tooltip, label = tooltip }) {
1805
1821
  const [open, setOpen] = useState5(false);
1806
1822
  const ref = useRef5(null);
1807
1823
  useEffect6(() => {
@@ -1816,11 +1832,15 @@ function ToolbarButton({ icon, preview, children, tooltip }) {
1816
1832
  /* @__PURE__ */ jsxs6(
1817
1833
  "button",
1818
1834
  {
1835
+ type: "button",
1819
1836
  onClick: () => setOpen(!open),
1820
1837
  title: tooltip,
1821
- className: `h-9 flex items-center gap-1.5 px-3 rounded-lg transition-all duration-100 ${open ? "bg-accent-blue/20 text-accent-blue" : "text-text-muted hover:text-text-primary hover:bg-surface-hover"}`,
1838
+ "aria-expanded": open,
1839
+ "aria-haspopup": "dialog",
1840
+ className: `h-9 flex cursor-pointer items-center gap-1.5 rounded-lg border px-2.5 transition-all duration-100 ${open ? "border-border-accent bg-accent-blue/20 text-accent-blue" : "border-transparent text-text-muted hover:border-border-light hover:bg-surface-hover hover:text-text-primary"}`,
1822
1841
  children: [
1823
1842
  preview || icon && /* @__PURE__ */ jsx6("i", { className: `bx ${icon} text-base` }),
1843
+ label && /* @__PURE__ */ jsx6("span", { className: "whitespace-nowrap text-[11px] font-medium", children: label }),
1824
1844
  /* @__PURE__ */ jsx6("svg", { className: `w-2 h-2 opacity-40 transition-transform duration-100 ${open ? "rotate-180" : ""}`, viewBox: "0 0 8 5", fill: "none", stroke: "currentColor", strokeWidth: "1.5", children: /* @__PURE__ */ jsx6("path", { d: "M1 1l3 3 3-3" }) })
1825
1845
  ]
1826
1846
  }
@@ -1832,7 +1852,7 @@ function ToolbarButton({ icon, preview, children, tooltip }) {
1832
1852
  ] });
1833
1853
  }
1834
1854
  function Divider() {
1835
- return /* @__PURE__ */ jsx6("div", { className: "w-px h-5 bg-surface-hover mx-0.5 shrink-0" });
1855
+ return /* @__PURE__ */ jsx6("div", { className: "mx-0.5 h-6 w-px shrink-0 bg-border-light", "aria-hidden": "true" });
1836
1856
  }
1837
1857
  function ShapeSidebar({ visible, children }) {
1838
1858
  const viewMode = useSketchStore_default((s) => s.viewMode);
@@ -1840,8 +1860,8 @@ function ShapeSidebar({ visible, children }) {
1840
1860
  return /* @__PURE__ */ jsx6(
1841
1861
  "div",
1842
1862
  {
1843
- className: `absolute bottom-14 left-1/2 -translate-x-1/2 bg-surface border border-border-light rounded-xl px-2 py-1.5 z-[999] font-[lixFont] transition-all duration-200 ${show ? "opacity-100 pointer-events-auto translate-y-0" : "opacity-0 pointer-events-none translate-y-2"}`,
1844
- children: /* @__PURE__ */ jsx6("div", { className: "flex items-center gap-0.5", children })
1863
+ className: `absolute bottom-14 left-1/2 z-[999] max-w-[calc(100vw-24px)] -translate-x-1/2 overflow-x-auto rounded-xl border border-border-light bg-surface px-1.5 py-1.5 font-[lixFont] transition-all duration-200 ${show ? "opacity-100 pointer-events-auto translate-y-0" : "opacity-0 pointer-events-none translate-y-2"}`,
1864
+ children: /* @__PURE__ */ jsx6("div", { className: "flex min-w-max items-center gap-1", children })
1845
1865
  }
1846
1866
  );
1847
1867
  }
@@ -1852,50 +1872,25 @@ function LayerControls() {
1852
1872
  if (!shape || !window.__layerOrder) return;
1853
1873
  window.__layerOrder[method](shape);
1854
1874
  };
1855
- return /* @__PURE__ */ jsxs6("div", { className: "flex items-center gap-0.5", children: [
1856
- /* @__PURE__ */ jsx6(
1857
- "button",
1858
- {
1859
- onClick: () => doLayer("sendToBack"),
1860
- title: t("sidebar.sendToBack", { defaultValue: "Send to back" }),
1861
- className: "h-9 w-8 flex items-center justify-center rounded-lg text-text-muted hover:text-text-primary hover:bg-surface-hover transition-all duration-100",
1862
- children: /* @__PURE__ */ jsx6("i", { className: "bx bx-chevrons-down text-base" })
1863
- }
1864
- ),
1865
- /* @__PURE__ */ jsx6(
1866
- "button",
1867
- {
1868
- onClick: () => doLayer("sendBackward"),
1869
- title: t("sidebar.sendBackward"),
1870
- className: "h-9 w-8 flex items-center justify-center rounded-lg text-text-muted hover:text-text-primary hover:bg-surface-hover transition-all duration-100",
1871
- children: /* @__PURE__ */ jsx6("i", { className: "bx bx-chevron-down text-base" })
1872
- }
1873
- ),
1874
- /* @__PURE__ */ jsx6(
1875
- "button",
1876
- {
1877
- onClick: () => doLayer("bringForward"),
1878
- title: t("sidebar.bringForward"),
1879
- className: "h-9 w-8 flex items-center justify-center rounded-lg text-text-muted hover:text-text-primary hover:bg-surface-hover transition-all duration-100",
1880
- children: /* @__PURE__ */ jsx6("i", { className: "bx bx-chevron-up text-base" })
1881
- }
1882
- ),
1883
- /* @__PURE__ */ jsx6(
1884
- "button",
1885
- {
1886
- onClick: () => doLayer("bringToFront"),
1887
- title: t("sidebar.bringToFront", { defaultValue: "Bring to front" }),
1888
- className: "h-9 w-8 flex items-center justify-center rounded-lg text-text-muted hover:text-text-primary hover:bg-surface-hover transition-all duration-100",
1889
- children: /* @__PURE__ */ jsx6("i", { className: "bx bx-chevrons-up text-base" })
1890
- }
1891
- )
1875
+ const actions = [
1876
+ ["sendToBack", "bx-chevrons-down", t("sidebar.sendToBack", { defaultValue: "Send to back" })],
1877
+ ["sendBackward", "bx-chevron-down", t("sidebar.sendBackward")],
1878
+ ["bringForward", "bx-chevron-up", t("sidebar.bringForward")],
1879
+ ["bringToFront", "bx-chevrons-up", t("sidebar.bringToFront", { defaultValue: "Bring to front" })]
1880
+ ];
1881
+ return /* @__PURE__ */ jsxs6(ToolbarButton, { icon: "bx-layer", tooltip: "Arrange", label: "Arrange", children: [
1882
+ /* @__PURE__ */ jsx6("p", { className: "mb-2 text-xs uppercase tracking-wider text-text-muted", children: "Layer order" }),
1883
+ /* @__PURE__ */ jsx6("div", { className: "grid grid-cols-2 gap-1", children: actions.map(([method, icon, label]) => /* @__PURE__ */ jsxs6("button", { type: "button", onClick: () => doLayer(method), className: "flex min-w-32 cursor-pointer items-center gap-2 rounded-lg px-2.5 py-2 text-left text-xs text-text-secondary transition hover:bg-surface-hover hover:text-text-primary", children: [
1884
+ /* @__PURE__ */ jsx6("i", { className: `bx ${icon} text-base`, "aria-hidden": "true" }),
1885
+ /* @__PURE__ */ jsx6("span", { children: label })
1886
+ ] }, method)) })
1892
1887
  ] });
1893
1888
  }
1894
1889
 
1895
1890
  // src/react/components/sidebars/RectangleSidebar.jsx
1896
1891
  import { useState as useState6, useCallback as useCallback2 } from "react";
1897
1892
  import { jsx as jsx7, jsxs as jsxs7 } from "react/jsx-runtime";
1898
- var STROKE_COLORS = ["#1a1a20", "#ffffff", "#FF8383", "#3A994C", "#56A2E8", "#FFD700", "#FF69B4", "#A855F7"];
1893
+ var STROKE_COLORS = ["#000000", "#ffffff", "#FF8383", "#3A994C", "#56A2E8", "#FFD700", "#FF69B4", "#A855F7"];
1899
1894
  var BG_COLORS = ["transparent", "#f0f0f0", "#ffcccb", "#90ee90", "#add8e6", "#FFE4B5", "#DDA0DD", "#2d2d2d"];
1900
1895
  var FILLS = [
1901
1896
  { value: "hachure", label: "sidebar.fill.hachure" },
@@ -1923,7 +1918,10 @@ function RectangleSidebar() {
1923
1918
  const { t } = useTranslation();
1924
1919
  const activeTool = useSketchStore_default((s) => s.activeTool);
1925
1920
  const selectedShapeSidebar = useSketchStore_default((s) => s.selectedShapeSidebar);
1926
- const [strokeColor, setStrokeColor] = useState6("#fff");
1921
+ const theme = useUIStore_default((s) => s.theme);
1922
+ const resolvedTheme = theme === "system" && typeof window !== "undefined" ? window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light" : theme;
1923
+ const [strokeColor, setStrokeColor] = useState6(null);
1924
+ const displayedStrokeColor = strokeColor ?? (resolvedTheme === "light" ? "#000000" : "#ffffff");
1927
1925
  const [bgColor, setBgColor] = useState6("transparent");
1928
1926
  const [thickness, setThickness] = useState6(2);
1929
1927
  const [lineStyle, setLineStyle] = useState6("solid");
@@ -1957,10 +1955,10 @@ function RectangleSidebar() {
1957
1955
  ToolbarButton,
1958
1956
  {
1959
1957
  tooltip: t("sidebar.strokeColor"),
1960
- preview: /* @__PURE__ */ jsx7("span", { className: "w-4 h-4 rounded-md border border-white/20", style: { backgroundColor: strokeColor } }),
1958
+ preview: /* @__PURE__ */ jsx7("span", { className: "w-4 h-4 rounded-md border border-white/20", style: { backgroundColor: displayedStrokeColor } }),
1961
1959
  children: [
1962
1960
  /* @__PURE__ */ jsx7("p", { className: "text-xs text-text-muted uppercase tracking-wider mb-2", children: t("sidebar.sectionHeader.stroke") }),
1963
- /* @__PURE__ */ jsx7(ColorGrid, { colors: STROKE_COLORS, selected: strokeColor, onSelect: updateStroke })
1961
+ /* @__PURE__ */ jsx7(ColorGrid, { colors: STROKE_COLORS, selected: displayedStrokeColor, onSelect: updateStroke })
1964
1962
  ]
1965
1963
  }
1966
1964
  ),
@@ -2001,7 +1999,7 @@ function RectangleSidebar() {
2001
1999
  {
2002
2000
  onClick: () => updateStyle(s.v),
2003
2001
  className: `w-11 h-8 flex items-center justify-center rounded-lg transition-all duration-100 ${lineStyle === s.v ? "bg-[#7667a8]/20" : "hover:bg-white/[0.06]"}`,
2004
- children: /* @__PURE__ */ jsx7("svg", { width: "28", height: "4", viewBox: "0 0 28 4", children: /* @__PURE__ */ jsx7("line", { x1: "0", y1: "2", x2: "28", y2: "2", stroke: "#fff", strokeWidth: "2", strokeDasharray: s.d, strokeLinecap: "round" }) })
2002
+ children: /* @__PURE__ */ jsx7("svg", { width: "28", height: "4", viewBox: "0 0 28 4", children: /* @__PURE__ */ jsx7("line", { x1: "0", y1: "2", x2: "28", y2: "2", stroke: "currentColor", strokeWidth: "2", strokeDasharray: s.d, strokeLinecap: "round" }) })
2005
2003
  },
2006
2004
  s.v
2007
2005
  )) })
@@ -2030,7 +2028,7 @@ function RectangleSidebar() {
2030
2028
  // src/react/components/sidebars/CircleSidebar.jsx
2031
2029
  import { useState as useState7, useCallback as useCallback3 } from "react";
2032
2030
  import { jsx as jsx8, jsxs as jsxs8 } from "react/jsx-runtime";
2033
- var STROKE_COLORS2 = ["#1a1a20", "#ffffff", "#FF8383", "#3A994C", "#56A2E8", "#FFD700", "#FF69B4", "#A855F7"];
2031
+ var STROKE_COLORS2 = ["#000000", "#ffffff", "#FF8383", "#3A994C", "#56A2E8", "#FFD700", "#FF69B4", "#A855F7"];
2034
2032
  var BG_COLORS2 = ["transparent", "#f0f0f0", "#ffcccb", "#90ee90", "#add8e6", "#FFE4B5", "#DDA0DD", "#2d2d2d"];
2035
2033
  var FILLS2 = [
2036
2034
  { value: "hachure", label: "sidebar.fill.hachure" },
@@ -2058,7 +2056,10 @@ function CircleSidebar() {
2058
2056
  const { t } = useTranslation();
2059
2057
  const activeTool = useSketchStore_default((s) => s.activeTool);
2060
2058
  const selectedShapeSidebar = useSketchStore_default((s) => s.selectedShapeSidebar);
2061
- const [strokeColor, setStrokeColor] = useState7("#fff");
2059
+ const theme = useUIStore_default((s) => s.theme);
2060
+ const resolvedTheme = theme === "system" && typeof window !== "undefined" ? window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light" : theme;
2061
+ const [strokeColor, setStrokeColor] = useState7(null);
2062
+ const displayedStrokeColor = strokeColor ?? (resolvedTheme === "light" ? "#000000" : "#ffffff");
2062
2063
  const [bgColor, setBgColor] = useState7("transparent");
2063
2064
  const [thickness, setThickness] = useState7(2);
2064
2065
  const [lineStyle, setLineStyle] = useState7("solid");
@@ -2088,10 +2089,10 @@ function CircleSidebar() {
2088
2089
  ToolbarButton,
2089
2090
  {
2090
2091
  tooltip: t("sidebar.strokeColor"),
2091
- preview: /* @__PURE__ */ jsx8("span", { className: "w-4 h-4 rounded-md border border-white/20", style: { backgroundColor: strokeColor } }),
2092
+ preview: /* @__PURE__ */ jsx8("span", { className: "w-4 h-4 rounded-md border border-white/20", style: { backgroundColor: displayedStrokeColor } }),
2092
2093
  children: [
2093
2094
  /* @__PURE__ */ jsx8("p", { className: "text-xs text-text-muted uppercase tracking-wider mb-2", children: t("sidebar.sectionHeader.stroke") }),
2094
- /* @__PURE__ */ jsx8(ColorGrid2, { colors: STROKE_COLORS2, selected: strokeColor, onSelect: updateStroke })
2095
+ /* @__PURE__ */ jsx8(ColorGrid2, { colors: STROKE_COLORS2, selected: displayedStrokeColor, onSelect: updateStroke })
2095
2096
  ]
2096
2097
  }
2097
2098
  ),
@@ -2128,7 +2129,7 @@ function CircleSidebar() {
2128
2129
  {
2129
2130
  onClick: () => updateStyle(s.v),
2130
2131
  className: `w-11 h-8 flex items-center justify-center rounded-lg transition-all duration-100 ${lineStyle === s.v ? "bg-[#7667a8]/20" : "hover:bg-white/[0.06]"}`,
2131
- children: /* @__PURE__ */ jsx8("svg", { width: "28", height: "4", viewBox: "0 0 28 4", children: /* @__PURE__ */ jsx8("line", { x1: "0", y1: "2", x2: "28", y2: "2", stroke: "#fff", strokeWidth: "2", strokeDasharray: s.d, strokeLinecap: "round" }) })
2132
+ children: /* @__PURE__ */ jsx8("svg", { width: "28", height: "4", viewBox: "0 0 28 4", children: /* @__PURE__ */ jsx8("line", { x1: "0", y1: "2", x2: "28", y2: "2", stroke: "currentColor", strokeWidth: "2", strokeDasharray: s.d, strokeLinecap: "round" }) })
2132
2133
  },
2133
2134
  s.v
2134
2135
  )) })
@@ -2610,7 +2611,7 @@ function PaintbrushSidebar() {
2610
2611
  // src/react/components/sidebars/TextSidebar.jsx
2611
2612
  import { useState as useState12, useCallback as useCallback8, useEffect as useEffect8 } from "react";
2612
2613
  import { Fragment as Fragment6, jsx as jsx13, jsxs as jsxs13 } from "react/jsx-runtime";
2613
- var TEXT_COLORS = ["#1a1a20", "#ffffff", "#FF8383", "#3A994C", "#56A2E8", "#FFD700", "#FF69B4", "#A855F7"];
2614
+ var TEXT_COLORS = ["#000000", "#ffffff", "#FF8383", "#3A994C", "#56A2E8", "#FFD700", "#FF69B4", "#A855F7"];
2614
2615
  var FONTS = [
2615
2616
  { value: "lixFont", label: "Lix" },
2616
2617
  { value: "lixCode", label: "Code" },
@@ -2644,7 +2645,10 @@ function TextSidebar() {
2644
2645
  const { t } = useTranslation();
2645
2646
  const activeTool = useSketchStore_default((s) => s.activeTool);
2646
2647
  const selectedShapeSidebar = useSketchStore_default((s) => s.selectedShapeSidebar);
2647
- const [textColor, setTextColor] = useState12("#fff");
2648
+ const theme = useUIStore_default((s) => s.theme);
2649
+ const resolvedTheme = theme === "system" && typeof window !== "undefined" ? window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light" : theme;
2650
+ const [textColor, setTextColor] = useState12(null);
2651
+ const displayedTextColor = textColor ?? (resolvedTheme === "light" ? "#000000" : "#ffffff");
2648
2652
  const [fontSize, setFontSize] = useState12("S");
2649
2653
  const [font, setFont] = useState12("lixFont");
2650
2654
  const [codeMode, setCodeMode] = useState12(false);
@@ -2691,14 +2695,14 @@ function TextSidebar() {
2691
2695
  ToolbarButton,
2692
2696
  {
2693
2697
  tooltip: t("sidebar.textColor"),
2694
- preview: /* @__PURE__ */ jsx13("span", { className: "w-4 h-4 rounded-md border border-white/20", style: { backgroundColor: textColor } }),
2698
+ preview: /* @__PURE__ */ jsx13("span", { className: "w-4 h-4 rounded-md border border-white/20", style: { backgroundColor: displayedTextColor } }),
2695
2699
  children: [
2696
2700
  /* @__PURE__ */ jsx13("p", { className: "text-xs text-text-muted uppercase tracking-wider mb-2", children: t("sidebar.color") }),
2697
2701
  /* @__PURE__ */ jsx13("div", { className: "grid grid-cols-4 gap-1.5", children: TEXT_COLORS.map((c) => /* @__PURE__ */ jsx13(
2698
2702
  "button",
2699
2703
  {
2700
2704
  onClick: () => updateColor(c),
2701
- className: `w-7 h-7 rounded-md border-[1.5px] transition-all duration-100 ${textColor === c ? "border-[#7667a8] scale-110" : "border-white/[0.08] hover:border-white/20"}`,
2705
+ className: `w-7 h-7 rounded-md border-[1.5px] transition-all duration-100 ${displayedTextColor.toLowerCase() === c.toLowerCase() ? "border-[#7667a8] scale-110" : "border-white/[0.08] hover:border-white/20"}`,
2702
2706
  style: { backgroundColor: c }
2703
2707
  },
2704
2708
  c
@@ -3092,7 +3096,7 @@ function IconSidebar() {
3092
3096
  const requestSequenceRef = useRef6(0);
3093
3097
  useEffect10(() => {
3094
3098
  if (!visible) return;
3095
- const frame = requestAnimationFrame(() => searchInputRef.current?.focus());
3099
+ const frame = requestAnimationFrame(() => searchInputRef.current?.focus({ preventScroll: true }));
3096
3100
  return () => cancelAnimationFrame(frame);
3097
3101
  }, [visible]);
3098
3102
  useEffect10(() => {
@@ -3164,10 +3168,11 @@ function IconSidebar() {
3164
3168
  });
3165
3169
  }
3166
3170
  }, []);
3171
+ if (!visible) return null;
3167
3172
  return /* @__PURE__ */ jsxs15(
3168
3173
  "div",
3169
3174
  {
3170
- className: `absolute top-[60px] right-2 bottom-[112px] w-[300px] bg-surface border border-border-light rounded-2xl z-[999] font-[lixFont] flex flex-col transition-transform duration-200 ${visible ? "translate-x-0" : "translate-x-full"}`,
3175
+ className: "absolute top-[60px] right-2 bottom-[112px] w-[300px] bg-surface border border-border-light rounded-2xl z-[999] font-[lixFont] flex flex-col",
3171
3176
  children: [
3172
3177
  /* @__PURE__ */ jsxs15("div", { className: "px-3.5 pt-3.5 pb-2 shrink-0", children: [
3173
3178
  /* @__PURE__ */ jsxs15("div", { className: "flex items-center justify-between mb-2.5", children: [
@@ -5106,7 +5111,7 @@ var _saveScene = null;
5106
5111
  var _loadScene = null;
5107
5112
  async function ensureSceneSerializer() {
5108
5113
  if (_saveScene && _loadScene) return;
5109
- const m = await import("./SceneSerializer-H6KMQCO2.js");
5114
+ const m = await import("./SceneSerializer-7O72LEZP.js");
5110
5115
  _saveScene = m.saveScene;
5111
5116
  _loadScene = m.loadScene;
5112
5117
  }