@elixpo/lixsketch 5.4.7 → 5.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (218) hide show
  1. package/dist/react/AIRenderer-M4LMJ66J.js +1105 -0
  2. package/dist/react/AIRenderer-M4LMJ66J.js.map +7 -0
  3. package/dist/react/Arrow-BJDAXPMH.js +8 -0
  4. package/dist/react/Arrow-BJDAXPMH.js.map +7 -0
  5. package/dist/react/Circle-KPG7TKIX.js +8 -0
  6. package/dist/react/Circle-KPG7TKIX.js.map +7 -0
  7. package/dist/react/CodeShape-K4DIZAIV.js +8 -0
  8. package/dist/react/CodeShape-K4DIZAIV.js.map +7 -0
  9. package/dist/react/CopyPaste-4CKJRHJ3.js +569 -0
  10. package/dist/react/CopyPaste-4CKJRHJ3.js.map +7 -0
  11. package/dist/react/EraserTrail-PA6IQLQN.js +20 -0
  12. package/dist/react/EraserTrail-PA6IQLQN.js.map +7 -0
  13. package/dist/react/EventDispatcher-SRFH6LQZ.js +463 -0
  14. package/dist/react/EventDispatcher-SRFH6LQZ.js.map +7 -0
  15. package/dist/react/Frame-6UR5XPAX.js +10 -0
  16. package/dist/react/Frame-6UR5XPAX.js.map +7 -0
  17. package/dist/react/FreehandStroke-CK24NUT3.js +8 -0
  18. package/dist/react/FreehandStroke-CK24NUT3.js.map +7 -0
  19. package/dist/react/GraphEngine-QE5B2PMR.js +340 -0
  20. package/dist/react/GraphEngine-QE5B2PMR.js.map +7 -0
  21. package/dist/react/GraphMathParser-2WMTY4IE.js +10 -0
  22. package/dist/react/GraphMathParser-2WMTY4IE.js.map +7 -0
  23. package/dist/react/IconShape-KMIA6T2H.js +10 -0
  24. package/dist/react/IconShape-KMIA6T2H.js.map +7 -0
  25. package/dist/react/ImageShape-CHHGBXUQ.js +10 -0
  26. package/dist/react/ImageShape-CHHGBXUQ.js.map +7 -0
  27. package/dist/react/LayerOrder-XCHF4MSS.js +66 -0
  28. package/dist/react/LayerOrder-XCHF4MSS.js.map +7 -0
  29. package/dist/react/Line-2KOQEEGA.js +10 -0
  30. package/dist/react/Line-2KOQEEGA.js.map +7 -0
  31. package/dist/react/LixScriptParser-JYWJX375.js +1033 -0
  32. package/dist/react/LixScriptParser-JYWJX375.js.map +7 -0
  33. package/dist/react/MermaidFlowchartRenderer-4QBAZ5MB.js +412 -0
  34. package/dist/react/MermaidFlowchartRenderer-4QBAZ5MB.js.map +7 -0
  35. package/dist/react/MermaidSequenceParser-UKG2NSZY.js +8 -0
  36. package/dist/react/MermaidSequenceParser-UKG2NSZY.js.map +7 -0
  37. package/dist/react/MermaidSequenceRenderer-HPLHY5II.js +387 -0
  38. package/dist/react/MermaidSequenceRenderer-HPLHY5II.js.map +7 -0
  39. package/dist/react/Rectangle-6FE7RN6W.js +8 -0
  40. package/dist/react/Rectangle-6FE7RN6W.js.map +7 -0
  41. package/dist/react/ResizeCode-WAMDTKSW.js +2 -0
  42. package/dist/react/ResizeCode-WAMDTKSW.js.map +7 -0
  43. package/dist/react/ResizeShapes-LKEQTITP.js +250 -0
  44. package/dist/react/ResizeShapes-LKEQTITP.js.map +7 -0
  45. package/dist/react/SceneSerializer-4U4B24JM.js +739 -0
  46. package/dist/react/SceneSerializer-4U4B24JM.js.map +7 -0
  47. package/dist/react/Selection-VVUHY5YJ.js +34 -0
  48. package/dist/react/Selection-VVUHY5YJ.js.map +7 -0
  49. package/dist/react/SketchEngine-YA4RG3KX.js +413 -0
  50. package/dist/react/SketchEngine-YA4RG3KX.js.map +7 -0
  51. package/dist/react/TextShape-54ZJ66E3.js +8 -0
  52. package/dist/react/TextShape-54ZJ66E3.js.map +7 -0
  53. package/dist/react/UndoRedo-M2JZUBKN.js +30 -0
  54. package/dist/react/UndoRedo-M2JZUBKN.js.map +7 -0
  55. package/dist/react/ZoomPan-U3TXC5AJ.js +186 -0
  56. package/dist/react/ZoomPan-U3TXC5AJ.js.map +7 -0
  57. package/dist/react/arrowTool-CWEMIRXK.js +17 -0
  58. package/dist/react/arrowTool-CWEMIRXK.js.map +7 -0
  59. package/dist/react/boxicons-5JNJQPUP.woff +0 -0
  60. package/dist/react/boxicons-6NVWQSCQ.eot +0 -0
  61. package/dist/react/boxicons-AQ5N6WP7.woff2 +0 -0
  62. package/dist/react/boxicons-GDR4JU3X.ttf +0 -0
  63. package/dist/react/boxicons-NNFHLMOR.svg +1660 -0
  64. package/dist/react/chunk-2OQXI7QB.js +564 -0
  65. package/dist/react/chunk-2OQXI7QB.js.map +7 -0
  66. package/dist/react/chunk-5OUBTHHO.js +187 -0
  67. package/dist/react/chunk-5OUBTHHO.js.map +7 -0
  68. package/dist/react/chunk-6PFXZKL2.js +628 -0
  69. package/dist/react/chunk-6PFXZKL2.js.map +7 -0
  70. package/dist/react/chunk-6SFNWGGZ.js +453 -0
  71. package/dist/react/chunk-6SFNWGGZ.js.map +7 -0
  72. package/dist/react/chunk-7TZSIR6V.js +210 -0
  73. package/dist/react/chunk-7TZSIR6V.js.map +7 -0
  74. package/dist/react/chunk-AJAZC37E.js +662 -0
  75. package/dist/react/chunk-AJAZC37E.js.map +7 -0
  76. package/dist/react/chunk-BU4D2WYQ.js +1213 -0
  77. package/dist/react/chunk-BU4D2WYQ.js.map +7 -0
  78. package/dist/react/chunk-BZE4CEBG.js +747 -0
  79. package/dist/react/chunk-BZE4CEBG.js.map +7 -0
  80. package/dist/react/chunk-CB2RANCB.js +212 -0
  81. package/dist/react/chunk-CB2RANCB.js.map +7 -0
  82. package/dist/react/chunk-DNAG7ML6.js +128 -0
  83. package/dist/react/chunk-DNAG7ML6.js.map +7 -0
  84. package/dist/react/chunk-HZWLPXFN.js +198 -0
  85. package/dist/react/chunk-HZWLPXFN.js.map +7 -0
  86. package/dist/react/chunk-I6HCCIXB.js +572 -0
  87. package/dist/react/chunk-I6HCCIXB.js.map +7 -0
  88. package/dist/react/chunk-IZ5OGWGW.js +235 -0
  89. package/dist/react/chunk-IZ5OGWGW.js.map +7 -0
  90. package/dist/react/chunk-JJCJNLNN.js +1490 -0
  91. package/dist/react/chunk-JJCJNLNN.js.map +7 -0
  92. package/dist/react/chunk-JQ3IRFDP.js +222 -0
  93. package/dist/react/chunk-JQ3IRFDP.js.map +7 -0
  94. package/dist/react/chunk-L5OARZJ7.js +1134 -0
  95. package/dist/react/chunk-L5OARZJ7.js.map +7 -0
  96. package/dist/react/chunk-LHRTXNVE.js +1600 -0
  97. package/dist/react/chunk-LHRTXNVE.js.map +7 -0
  98. package/dist/react/chunk-Q2GA4MBZ.js +1653 -0
  99. package/dist/react/chunk-Q2GA4MBZ.js.map +7 -0
  100. package/dist/react/chunk-QNSE5BAY.js +519 -0
  101. package/dist/react/chunk-QNSE5BAY.js.map +7 -0
  102. package/dist/react/chunk-QXFBG7OM.js +191 -0
  103. package/dist/react/chunk-QXFBG7OM.js.map +7 -0
  104. package/dist/react/chunk-T6ZVV5ZO.js +714 -0
  105. package/dist/react/chunk-T6ZVV5ZO.js.map +7 -0
  106. package/dist/react/chunk-URB6MY46.js +974 -0
  107. package/dist/react/chunk-URB6MY46.js.map +7 -0
  108. package/dist/react/chunk-VN62KLOC.js +931 -0
  109. package/dist/react/chunk-VN62KLOC.js.map +7 -0
  110. package/dist/react/chunk-VQVEPJSA.js +158 -0
  111. package/dist/react/chunk-VQVEPJSA.js.map +7 -0
  112. package/dist/react/chunk-XISEAGBV.js +1632 -0
  113. package/dist/react/chunk-XISEAGBV.js.map +7 -0
  114. package/dist/react/chunk-YKJUBFHE.js +575 -0
  115. package/dist/react/chunk-YKJUBFHE.js.map +7 -0
  116. package/dist/react/circleTool-NUATSEI2.js +14 -0
  117. package/dist/react/circleTool-NUATSEI2.js.map +7 -0
  118. package/dist/react/codeTool-MHCB2FNB.js +38 -0
  119. package/dist/react/codeTool-MHCB2FNB.js.map +7 -0
  120. package/dist/react/eraserTool-2GS2LQCS.js +103 -0
  121. package/dist/react/eraserTool-2GS2LQCS.js.map +7 -0
  122. package/dist/react/frameTool-PWVKKXSP.js +14 -0
  123. package/dist/react/frameTool-PWVKKXSP.js.map +7 -0
  124. package/dist/react/freehandTool-SLYGASVP.js +14 -0
  125. package/dist/react/freehandTool-SLYGASVP.js.map +7 -0
  126. package/dist/react/iconTool-GPZ7O7NH.js +18 -0
  127. package/dist/react/iconTool-GPZ7O7NH.js.map +7 -0
  128. package/dist/react/imageTool-D5R4XGEU.js +15 -0
  129. package/dist/react/imageTool-D5R4XGEU.js.map +7 -0
  130. package/dist/react/index.js +5342 -0
  131. package/dist/react/index.js.map +7 -0
  132. package/dist/react/laserTool-XVMV63AV.js +239 -0
  133. package/dist/react/laserTool-XVMV63AV.js.map +7 -0
  134. package/dist/react/lineTool-WNI5EMZ5.js +14 -0
  135. package/dist/react/lineTool-WNI5EMZ5.js.map +7 -0
  136. package/dist/react/lixCode-OJMVUXXI.ttf +0 -0
  137. package/dist/react/lixDefault-JEAPAUJL.ttf +0 -0
  138. package/dist/react/lixFancy-BPXYM5CQ.ttf +0 -0
  139. package/dist/react/lixFont-CPKEUDVM.woff2 +0 -0
  140. package/dist/react/rectangleTool-U7DZ6ZTA.js +14 -0
  141. package/dist/react/rectangleTool-U7DZ6ZTA.js.map +7 -0
  142. package/dist/react/styles.css +6627 -0
  143. package/dist/react/textTool-M7S6F3VC.js +21 -0
  144. package/dist/react/textTool-M7S6F3VC.js.map +7 -0
  145. package/package.json +39 -5
  146. package/src/EngineShortcuts.js +83 -27
  147. package/src/core/AIRenderer.js +30 -18
  148. package/src/core/GraphEngine.js +64 -41
  149. package/src/core/MermaidFlowchartRenderer.js +153 -88
  150. package/src/core/MermaidSequenceRenderer.js +168 -93
  151. package/src/core/SceneSerializer.js +86 -2
  152. package/src/core/Selection.js +119 -19
  153. package/src/core/UndoRedo.js +82 -15
  154. package/src/core/ZoomPan.js +15 -5
  155. package/src/index.js +14 -1
  156. package/src/react/LixSketchCanvas.jsx +347 -0
  157. package/src/react/components/AppMenu.jsx +475 -0
  158. package/src/react/components/Footer.jsx +85 -0
  159. package/src/react/components/Toolbar.jsx +140 -0
  160. package/src/react/components/canvas/CanvasLoadingOverlay.jsx +76 -0
  161. package/src/react/components/canvas/ContextMenu.jsx +466 -0
  162. package/src/react/components/canvas/FindBar.jsx +177 -0
  163. package/src/react/components/canvas/ImageSourcePicker.jsx +133 -0
  164. package/src/react/components/canvas/MultiSelectActions.jsx +120 -0
  165. package/src/react/components/canvas/SVGCanvas.jsx +145 -0
  166. package/src/react/components/canvas/SaveStatusIndicator.jsx +29 -0
  167. package/src/react/components/modals/CanvasPropertiesModal.jsx +358 -0
  168. package/src/react/components/modals/CommandPalette.jsx +307 -0
  169. package/src/react/components/modals/ExportImageModal.jsx +287 -0
  170. package/src/react/components/modals/GraphModal.jsx +174 -0
  171. package/src/react/components/modals/HelpModal.jsx +208 -0
  172. package/src/react/components/modals/LixScriptModal.jsx +130 -0
  173. package/src/react/components/modals/ShortcutsModal.jsx +125 -0
  174. package/src/react/components/sidebars/ArrowSidebar.jsx +173 -0
  175. package/src/react/components/sidebars/CircleSidebar.jsx +134 -0
  176. package/src/react/components/sidebars/FrameSidebar.jsx +263 -0
  177. package/src/react/components/sidebars/IconSidebar.jsx +279 -0
  178. package/src/react/components/sidebars/ImageSidebar.jsx +69 -0
  179. package/src/react/components/sidebars/LineSidebar.jsx +109 -0
  180. package/src/react/components/sidebars/PaintbrushSidebar.jsx +119 -0
  181. package/src/react/components/sidebars/RectangleSidebar.jsx +165 -0
  182. package/src/react/components/sidebars/ShapeSidebar.jsx +130 -0
  183. package/src/react/components/sidebars/TextSidebar.jsx +174 -0
  184. package/src/react/hooks/inertStores.js +58 -0
  185. package/src/react/hooks/useSketchEngine.js +76 -0
  186. package/src/react/hooks/useTranslation.js +92 -0
  187. package/src/react/index.js +41 -0
  188. package/src/react/store/useSketchStore.js +234 -0
  189. package/src/react/store/useUIStore.js +196 -0
  190. package/src/react/styles/arrowSidebar.css +263 -0
  191. package/src/react/styles/canvasStroke.css +47 -0
  192. package/src/react/styles/canvasTools.css +769 -0
  193. package/src/react/styles/circleSidebar.css +206 -0
  194. package/src/react/styles/fonts/fonts.css +29 -0
  195. package/src/react/styles/fonts/lixCode.ttf +0 -0
  196. package/src/react/styles/fonts/lixDefault.ttf +0 -0
  197. package/src/react/styles/fonts/lixDocs.ttf +0 -0
  198. package/src/react/styles/fonts/lixFancy.ttf +0 -0
  199. package/src/react/styles/fonts/lixFont.woff2 +0 -0
  200. package/src/react/styles/lineSidebar.css +207 -0
  201. package/src/react/styles/paintbrushSidebar.css +247 -0
  202. package/src/react/styles/squareSidebar.css +206 -0
  203. package/src/react/styles/writeText.css +149 -0
  204. package/src/react/styles.css +175 -0
  205. package/src/react/toolsEnum.js +20 -0
  206. package/src/react/utils/toast.js +18 -0
  207. package/src/shapes/Frame.js +7 -1
  208. package/src/shapes/Line.js +11 -5
  209. package/src/tools/arrowTool.js +30 -4
  210. package/src/tools/circleTool.js +33 -9
  211. package/src/tools/codeTool.js +5 -3
  212. package/src/tools/frameTool.js +47 -7
  213. package/src/tools/freehandTool.js +12 -4
  214. package/src/tools/iconTool.js +7 -1
  215. package/src/tools/imageTool.js +7 -1
  216. package/src/tools/lineTool.js +27 -3
  217. package/src/tools/rectangleTool.js +45 -8
  218. package/src/tools/textTool.js +23 -6
@@ -0,0 +1,206 @@
1
+ .squareSideBar {
2
+ position: fixed;
3
+ bottom: 20px;
4
+ left: 50%;
5
+ transform: translateX(-50%);
6
+ width: auto;
7
+ border-radius: 15px;
8
+ height: auto;
9
+ background-color: #232329;
10
+ overflow: visible;
11
+ padding: 5px 10px;
12
+ transition: 0.5s;
13
+ z-index: 100;
14
+ display: flex;
15
+ flex-direction: row;
16
+ align-items: center;
17
+ filter: blur(0px);
18
+ opacity: 1;
19
+ }
20
+
21
+ .squareSideBar.hidden {
22
+ opacity: 0;
23
+ pointer-events: none;
24
+ filter: blur(10px);
25
+ transform: translateX(-50%) translateY(20px);
26
+ transition: 0.5s;
27
+ z-index: -1;
28
+ }
29
+
30
+ /* Combined Labels */
31
+ .squareColorLabel,
32
+ .squareBackgroundLabel,
33
+ .squareThicknessLabel,
34
+ .squareFillLabel,
35
+ .squareStyleLabel {
36
+ display: none;
37
+ }
38
+
39
+
40
+ /* Combined containers for colors, backgrounds, thickness, and fill */
41
+ .squareColorsSquare,
42
+ .squareBackground,
43
+ .squareThickness,
44
+ .squareFill,
45
+ .squareStyle {
46
+ position: static;
47
+ display: flex;
48
+ justify-content: flex-start;
49
+ flex-wrap: nowrap;
50
+ height: 40px;
51
+ gap: 5px;
52
+ align-items: center;
53
+ padding: 0 8px;
54
+ box-sizing: border-box;
55
+ border-right: 1px solid rgba(255,255,255,0.15);
56
+ }
57
+
58
+ .squareFill {
59
+ border-right: none;
60
+ }
61
+
62
+ .squareThickness, .squareStyle {
63
+ gap: 5px;
64
+ }
65
+
66
+
67
+ /* Combined styles for color, background and fill spans */
68
+ .squareColorsSquare span,
69
+ .squareBackground span,
70
+ .squareFill span {
71
+ position: relative;
72
+ width: 30px;
73
+ height: 30px;
74
+ border-radius: 10px;
75
+ margin: 0 5px;
76
+ cursor: pointer;
77
+ box-sizing: border-box;
78
+ transition: 0.25s;
79
+ flex-shrink: 0; /* Prevent shrinking */
80
+ }
81
+
82
+ /* Combined selected styles for color background and fill spans */
83
+ .squareColorsSquare span.selected,
84
+ .squareBackground span.selected,
85
+ .squareFill span.selected {
86
+ border: 2px solid #3c09d6;
87
+ transform: scale(1.3); /* Using transform instead of scale */
88
+ transition: 0.25s;
89
+ }
90
+
91
+ /* Color-specific styles */
92
+ .squareColorsSquare span:nth-child(1) { background-color: #fff; }
93
+ .squareColorsSquare span:nth-child(2) { background: #FF8383; }
94
+ .squareColorsSquare span:nth-child(3) { background-color: #3A994C; }
95
+ .squareColorsSquare span:nth-child(4) { background-color: #56A2E8; }
96
+ .squareColorsSquare span:nth-child(5) { background: #FFD700; }
97
+
98
+ /* Background-specific styles */
99
+ .squareBackground span:nth-child(1) { background-color: #f0f0f0; }
100
+ .squareBackground span:nth-child(2) { background-color: #ffcccb; }
101
+ .squareBackground span:nth-child(3) { background-color: #90ee90; }
102
+ .squareBackground span:nth-child(4) { background-color: #add8e6; }
103
+ .squareBackground span:nth-child(5) {
104
+ background-color: #ffffe000;
105
+ background-image: linear-gradient(45deg, #ccc 25%, transparent 25%, transparent 75%, #ccc 75%, #ccc),
106
+ linear-gradient(45deg, #ccc 25%, transparent 25%, transparent 75%, #ccc 75%, #ccc);
107
+ background-size: 12px 12px;
108
+ background-position: 0 0, 6px 6px;
109
+ }
110
+
111
+
112
+ /* Thickness styles */
113
+ .squareThickness span {
114
+ width: 40px;
115
+ height: 40px;
116
+ position: relative;
117
+ left: 0;
118
+ border-radius: 10px;
119
+ margin: 0 5px;
120
+ cursor: pointer;
121
+ color: #fff;
122
+ background: #31303B;
123
+ align-items: center;
124
+ justify-content: center;
125
+ display: flex;
126
+ font-size: 30px;
127
+ transition: 0.25s;
128
+ flex-shrink: 0; /* Prevent shrinking */
129
+ }
130
+
131
+ .squareThickness span.selected {
132
+ background: #444480;
133
+ transition: 0.25s;
134
+ }
135
+
136
+ .squareThickness span:nth-child(1) { font-weight: 100; }
137
+ .squareThickness span:nth-child(2) { font-weight: 500; }
138
+ .squareThickness span:nth-child(3) { font-weight: 700; }
139
+
140
+ /* Fill styles */
141
+
142
+
143
+
144
+ .squareFill span {
145
+ width: 30px;
146
+ height: 30px;
147
+ border-radius: 10px;
148
+ margin: 0 5px;
149
+ cursor: pointer;
150
+ box-sizing: border-box;
151
+ transition: 0.25s;
152
+ background: #31303B;
153
+ display: flex;
154
+ align-items: center;
155
+ justify-content: center;
156
+ font-size: 12px;
157
+ color: #fff;
158
+ text-transform: uppercase;
159
+ flex-shrink: 0; /* Prevent shrinking */
160
+ }
161
+
162
+ .squareFill span.selected {
163
+ background: #444480;
164
+ transition: 0.25s;
165
+ }
166
+
167
+ /* Style styles */
168
+ .squareStyle span {
169
+ width: 35px;
170
+ height: 35px;
171
+ left: 5%;
172
+ border-radius: 10px;
173
+ margin: 0; /* Remove left-right margins */
174
+ cursor: pointer;
175
+ color: #fff;
176
+ background: #31303B;
177
+ align-items: center;
178
+ justify-content: center;
179
+ display: flex;
180
+ transition: 0.25s;
181
+ border: 2px solid transparent;
182
+ flex-shrink: 0; /* Prevent shrinking */
183
+ }
184
+
185
+ .squareStyle span.selected {
186
+ background: #444480;
187
+ border: 2px solid #3c09d6;
188
+ transition: 0.25s;
189
+ transform: scale(1.1); /* Using transform instead of scale */
190
+ }
191
+
192
+ .squareStyle span svg {
193
+ width: 30px;
194
+ height: 30px;
195
+ stroke: #fff;
196
+ transition: 0.25s;
197
+ }
198
+
199
+ .squareStyle span.selected svg {
200
+ stroke: #FFD700;
201
+ }
202
+
203
+ .squareFill .squareFillStyleSpan svg {
204
+ pointer-events: none;
205
+ }
206
+
@@ -0,0 +1,149 @@
1
+ @font-face
2
+ {
3
+ font-family: "lixFont";
4
+ src: url(./fonts/lixFont.woff2);
5
+ font-weight: normal;
6
+ font-size: normal;
7
+ }
8
+
9
+ @font-face
10
+ {
11
+ font-family: 'lixCode';
12
+ src: url(./fonts/lixCode.ttf);
13
+ font-weight: normal;
14
+ font-size: normal;
15
+ }
16
+
17
+ @font-face
18
+ {
19
+ font-family: 'lixDefault';
20
+ src: url(./fonts/lixDefault.ttf);
21
+ font-weight: normal;
22
+ font-size: normal;
23
+ }
24
+
25
+ @font-face
26
+ {
27
+ font-family: 'lixFancy';
28
+ src: url(./fonts/lixFancy.ttf);
29
+ font-weight: normal;
30
+ font-size: normal;
31
+ }
32
+
33
+ #textElement
34
+ {
35
+ height: 500px;
36
+ width: auto;
37
+ resize: none;
38
+ background: transparent;
39
+ color: #fff;
40
+ font-family: 'lixFont', sans-serif;
41
+ font-size: 30px;
42
+ border: none;
43
+ outline: none;
44
+ overflow: visible;
45
+ white-space: pre-wrap;
46
+ }
47
+ #textElement::-webkit-scrollbar
48
+ {
49
+ display: none;
50
+ }
51
+
52
+ #freehand-canvas > g
53
+ {
54
+ user-select: none;
55
+ }
56
+
57
+ /* Prevent native browser text selection on SVG text elements during mouse drag */
58
+ #freehand-canvas text,
59
+ #freehand-canvas tspan {
60
+ user-select: none;
61
+ -webkit-user-select: none;
62
+ pointer-events: painted;
63
+ }
64
+
65
+ /* Embedded shape labels */
66
+ .shape-label {
67
+ user-select: none;
68
+ -webkit-user-select: none;
69
+ pointer-events: none;
70
+ }
71
+
72
+ .syntax-highlight-overlay {
73
+ font-family: 'lixCode', 'Courier New', monospace !important;
74
+ white-space: pre !important;
75
+ word-wrap: normal !important;
76
+ overflow-wrap: normal !important;
77
+ }
78
+
79
+ .syntax-highlight-overlay pre {
80
+ margin: 0 !important;
81
+ padding: 0 !important;
82
+ background: transparent !important;
83
+ font-family: inherit !important;
84
+ font-size: inherit !important;
85
+ line-height: inherit !important;
86
+ white-space: pre !important;
87
+ word-wrap: normal !important;
88
+ overflow-wrap: normal !important;
89
+ }
90
+
91
+ .syntax-highlight-overlay code {
92
+ background: transparent !important;
93
+ padding: 0 !important;
94
+ margin: 0 !important;
95
+ border-radius: 0 !important;
96
+ font-family: inherit !important;
97
+ font-size: inherit !important;
98
+ line-height: inherit !important;
99
+ white-space: pre !important;
100
+ word-wrap: normal !important;
101
+ overflow-wrap: normal !important;
102
+ display: inline !important;
103
+ }
104
+
105
+ /* Ensure all highlighting spans are inline and preserve spacing */
106
+ .syntax-highlight-overlay .hljs-keyword,
107
+ .syntax-highlight-overlay .hljs-string,
108
+ .syntax-highlight-overlay .hljs-comment,
109
+ .syntax-highlight-overlay .hljs-number,
110
+ .syntax-highlight-overlay .hljs-function,
111
+ .syntax-highlight-overlay .hljs-variable,
112
+ .syntax-highlight-overlay .hljs-built_in,
113
+ .syntax-highlight-overlay .hljs-type,
114
+ .syntax-highlight-overlay .hljs-class,
115
+ .syntax-highlight-overlay .hljs-tag,
116
+ .syntax-highlight-overlay .hljs-attr,
117
+ .syntax-highlight-overlay .hljs-literal,
118
+ .syntax-highlight-overlay .hljs-operator,
119
+ .syntax-highlight-overlay .hljs-punctuation,
120
+ .syntax-highlight-overlay .hljs-title,
121
+ .syntax-highlight-overlay .hljs-params,
122
+ .syntax-highlight-overlay .hljs-property,
123
+ .syntax-highlight-overlay .hljs-regexp {
124
+ display: inline !important;
125
+ white-space: pre !important;
126
+ word-wrap: normal !important;
127
+ overflow-wrap: normal !important;
128
+ }
129
+
130
+ /* Ensure text editor matches exactly */
131
+ .svg-text-editor {
132
+ scrollbar-width: none;
133
+ -ms-overflow-style: none;
134
+ overflow: visible !important;
135
+ word-break: keep-all !important;
136
+ white-space: pre !important;
137
+ word-wrap: normal !important;
138
+ overflow-wrap: normal !important;
139
+ font-family: inherit !important;
140
+ line-height: inherit !important;
141
+ }
142
+
143
+ .svg-text-editor::-webkit-scrollbar {
144
+ display: none;
145
+ }
146
+
147
+
148
+
149
+
@@ -0,0 +1,175 @@
1
+ /* @elixpo/lixsketch/react — host-agnostic styles for <LixSketchCanvas />.
2
+ * Bundles boxicons (used by toolbar + sidebars). Tokens (--lixsketch-*)
3
+ * are the theming hooks; hosts can override them at any ancestor scope. */
4
+
5
+ @import 'boxicons/css/boxicons.min.css';
6
+
7
+ /* Product CSS — toolbars + per-shape sidebars (copied from sketch.elixpo).
8
+ *
9
+ * NOT bundled here:
10
+ * - canvasStroke.css: ships destructive globals (`* { margin: 0 }`,
11
+ * `svg { width: 100vw }`) that escape the canvas root and break the
12
+ * host page. SVGCanvas.jsx styles its own <svg> directly.
13
+ * - canvasTools.css: hardcodes sketch's dark palette for fixed-position
14
+ * toolbars (`background: #232329`, etc.). The React Toolbar component
15
+ * positions / styles itself via Tailwind utility classes, which pick
16
+ * up the consumer's theme tokens — so we let those drive instead. */
17
+ @import './styles/squareSidebar.css';
18
+ @import './styles/circleSidebar.css';
19
+ @import './styles/arrowSidebar.css';
20
+ @import './styles/lineSidebar.css';
21
+ @import './styles/paintbrushSidebar.css';
22
+ @import './styles/writeText.css';
23
+
24
+ .lixsketch-canvas-root {
25
+ position: relative;
26
+ width: 100%;
27
+ height: 100%;
28
+ background: var(--lixsketch-bg, #0e1014);
29
+ color: var(--lixsketch-fg, #e6e8ec);
30
+ font-family: var(--lixsketch-font, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif);
31
+ overflow: hidden;
32
+ isolation: isolate;
33
+ }
34
+
35
+ .lixsketch-canvas-svg {
36
+ position: absolute;
37
+ inset: 0;
38
+ width: 100%;
39
+ height: 100%;
40
+ display: block;
41
+ background: transparent;
42
+ cursor: default;
43
+ }
44
+
45
+ /* ── Loading overlay ── */
46
+
47
+ .lixsketch-canvas-loading {
48
+ position: absolute;
49
+ inset: 0;
50
+ display: flex;
51
+ align-items: center;
52
+ justify-content: center;
53
+ background: var(--lixsketch-bg, #0e1014);
54
+ z-index: 50;
55
+ }
56
+
57
+ .lixsketch-canvas-spinner {
58
+ width: 28px;
59
+ height: 28px;
60
+ border: 2px solid rgba(155, 123, 247, 0.25);
61
+ border-top-color: #9b7bf7;
62
+ border-radius: 50%;
63
+ animation: lixsketch-spin 0.7s linear infinite;
64
+ }
65
+
66
+ @keyframes lixsketch-spin {
67
+ to { transform: rotate(360deg); }
68
+ }
69
+
70
+ /* ── Toolbar ── */
71
+
72
+ .lixsketch-toolbar {
73
+ position: absolute;
74
+ top: 12px;
75
+ left: 50%;
76
+ transform: translateX(-50%);
77
+ z-index: 40;
78
+ display: flex;
79
+ align-items: center;
80
+ gap: 2px;
81
+ padding: 4px;
82
+ border-radius: 12px;
83
+ background: var(--lixsketch-toolbar-bg, rgba(20, 22, 28, 0.95));
84
+ border: 1px solid var(--lixsketch-border, rgba(255, 255, 255, 0.08));
85
+ box-shadow: 0 6px 24px rgba(0, 0, 0, 0.35), 0 1px 3px rgba(0, 0, 0, 0.2);
86
+ backdrop-filter: blur(8px);
87
+ }
88
+
89
+ .lixsketch-toolbar-spacer {
90
+ width: 1px;
91
+ height: 18px;
92
+ background: var(--lixsketch-border, rgba(255, 255, 255, 0.08));
93
+ margin: 0 4px;
94
+ }
95
+
96
+ .lixsketch-tool-btn {
97
+ display: inline-flex;
98
+ align-items: center;
99
+ justify-content: center;
100
+ gap: 6px;
101
+ width: 32px;
102
+ height: 32px;
103
+ border: none;
104
+ background: transparent;
105
+ color: var(--lixsketch-fg-muted, rgba(230, 232, 236, 0.7));
106
+ border-radius: 8px;
107
+ cursor: pointer;
108
+ padding: 0;
109
+ transition: background 0.12s, color 0.12s, transform 0.06s;
110
+ }
111
+
112
+ .lixsketch-tool-btn:hover {
113
+ background: var(--lixsketch-hover, rgba(255, 255, 255, 0.06));
114
+ color: var(--lixsketch-fg, #e6e8ec);
115
+ }
116
+
117
+ .lixsketch-tool-btn:active {
118
+ transform: scale(0.94);
119
+ }
120
+
121
+ .lixsketch-tool-btn.is-active {
122
+ background: var(--lixsketch-accent-bg, rgba(155, 123, 247, 0.18));
123
+ color: var(--lixsketch-accent, #b69aff);
124
+ }
125
+
126
+ .lixsketch-tool-btn:focus-visible {
127
+ outline: 2px solid var(--lixsketch-accent, #9b7bf7);
128
+ outline-offset: 1px;
129
+ }
130
+
131
+ .lixsketch-tool-btn--exit {
132
+ width: auto;
133
+ padding: 0 10px 0 8px;
134
+ color: var(--lixsketch-fg-muted, rgba(230, 232, 236, 0.7));
135
+ }
136
+
137
+ .lixsketch-tool-btn-label {
138
+ font-size: 12px;
139
+ font-weight: 500;
140
+ letter-spacing: 0.01em;
141
+ }
142
+
143
+ /* ── Embedded content adjustments ──
144
+ When sitting inside another app's layout, hosts often scope the canvas
145
+ to a flex container. Make sure children stay inside our root. */
146
+
147
+ .lixsketch-canvas-root * {
148
+ box-sizing: border-box;
149
+ }
150
+
151
+ .lixsketch-exit-btn {
152
+ position: absolute;
153
+ top: 12px;
154
+ right: 12px;
155
+ z-index: 10000;
156
+ display: inline-flex;
157
+ align-items: center;
158
+ gap: 6px;
159
+ padding: 6px 12px;
160
+ border-radius: 8px;
161
+ background: rgba(20, 22, 28, 0.9);
162
+ border: 1px solid rgba(255, 255, 255, 0.08);
163
+ color: rgba(230, 232, 236, 0.85);
164
+ font-size: 12px;
165
+ font-weight: 500;
166
+ cursor: pointer;
167
+ backdrop-filter: blur(8px);
168
+ transition: background 0.12s, color 0.12s, border-color 0.12s;
169
+ }
170
+ .lixsketch-exit-btn:hover {
171
+ background: rgba(155, 123, 247, 0.12);
172
+ border-color: rgba(155, 123, 247, 0.3);
173
+ color: #b69aff;
174
+ }
175
+ .lixsketch-exit-btn .bx { font-size: 16px; }
@@ -0,0 +1,20 @@
1
+ // Standalone TOOLS enum re-export. The engine's index.js also exports
2
+ // TOOLS but doing it from here lets the React subpath avoid pulling
3
+ // in side-effectful modules (SceneSerializer, shape graph) just to read
4
+ // a constants map. Keep these values in lockstep with src/index.js.
5
+ export const TOOLS = {
6
+ SELECT: 'select',
7
+ PAN: 'pan',
8
+ RECTANGLE: 'rectangle',
9
+ CIRCLE: 'circle',
10
+ LINE: 'line',
11
+ ARROW: 'arrow',
12
+ FREEHAND: 'freehand',
13
+ TEXT: 'text',
14
+ CODE: 'code',
15
+ ERASER: 'eraser',
16
+ LASER: 'laser',
17
+ IMAGE: 'image',
18
+ FRAME: 'frame',
19
+ ICON: 'icon',
20
+ };
@@ -0,0 +1,18 @@
1
+ // Lightweight toast stub for offline mode. Hosts can override by mounting
2
+ // a #lixsketch-toast container; otherwise we fall back to a console log.
3
+ export function showToast(message, options = {}) {
4
+ const tone = options.tone || 'info';
5
+ const root = typeof document !== 'undefined' ? document.getElementById('lixsketch-toast') : null;
6
+ if (!root) {
7
+ console.log(`[lixsketch:${tone}]`, message);
8
+ return;
9
+ }
10
+ const el = document.createElement('div');
11
+ el.className = `lixsketch-toast-item is-${tone}`;
12
+ el.textContent = message;
13
+ root.appendChild(el);
14
+ setTimeout(() => { el.classList.add('is-leaving'); }, 1800);
15
+ setTimeout(() => { try { root.removeChild(el); } catch {} }, 2200);
16
+ }
17
+
18
+ export default { showToast };
@@ -27,7 +27,13 @@ class Frame {
27
27
  this.fillStyle = options.fillStyle || "transparent"; // 'transparent' | 'solid' | 'grid'
28
28
  this.fillColor = options.fillColor || "#1e1e28";
29
29
  this.gridSize = options.gridSize || 20;
30
- this.gridColor = options.gridColor || "rgba(255,255,255,0.06)";
30
+ // Issue #38 follow-up: read the grid stroke from a CSS custom
31
+ // property so the frame grid stays visible in both themes. The
32
+ // var is defined in globals.css for both `body.canvas-mode`
33
+ // (dark-on-light) and `body.canvas-mode.theme-dark` (light-on-dark).
34
+ // The literal here is the dark-theme fallback for environments
35
+ // (tests, embeds) without the canvas-mode CSS in scope.
36
+ this.gridColor = options.gridColor || "var(--lixsketch-grid-fine, rgba(255,255,255,0.06))";
31
37
  this.options = {
32
38
  stroke: options.stroke || "#555",
33
39
  strokeWidth: options.strokeWidth || 1,
@@ -4,7 +4,13 @@
4
4
  import { updateAttachedArrows as updateArrowsForShape } from '../tools/arrowTool.js';
5
5
 
6
6
  const rc = rough.svg(svg);
7
- const lineColor = "#fff";
7
+ // Issue #38 follow-up: read the default stroke from the active theme
8
+ // instead of pinning to a single colour. White was invisible on the new
9
+ // light canvas, near-black is invisible if the user toggles dark.
10
+ function getThemeStroke() {
11
+ if (typeof document === 'undefined') return '#fff';
12
+ return document.body && document.body.classList.contains('theme-dark') ? '#fff' : '#1a1a2e';
13
+ }
8
14
  const lineStrokeWidth = 2;
9
15
  let hoveredFrameLine = null;
10
16
 
@@ -136,7 +142,7 @@ class Line {
136
142
  const pathData = `M ${this.startPoint.x} ${this.startPoint.y} Q ${this.controlPoint.x} ${this.controlPoint.y} ${this.endPoint.x} ${this.endPoint.y}`;
137
143
  lineElement = document.createElementNS('http://www.w3.org/2000/svg', 'path');
138
144
  lineElement.setAttribute('d', pathData);
139
- lineElement.setAttribute('stroke', this.options.stroke || lineColor);
145
+ lineElement.setAttribute('stroke', this.options.stroke || getThemeStroke());
140
146
  lineElement.setAttribute('stroke-width', this.options.strokeWidth || lineStrokeWidth);
141
147
  lineElement.setAttribute('fill', 'none');
142
148
  lineElement.setAttribute('stroke-linecap', 'round');
@@ -151,7 +157,7 @@ class Line {
151
157
  lineElement.setAttribute('y1', this.startPoint.y);
152
158
  lineElement.setAttribute('x2', this.endPoint.x);
153
159
  lineElement.setAttribute('y2', this.endPoint.y);
154
- lineElement.setAttribute('stroke', this.options.stroke || lineColor);
160
+ lineElement.setAttribute('stroke', this.options.stroke || getThemeStroke());
155
161
  lineElement.setAttribute('stroke-width', this.options.strokeWidth || lineStrokeWidth);
156
162
  lineElement.setAttribute('stroke-linecap', 'round');
157
163
  if (this.options.strokeDasharray) {
@@ -548,7 +554,7 @@ removeSelection() {
548
554
  const pathData = `M ${this.startPoint.x} ${this.startPoint.y} Q ${this.controlPoint.x} ${this.controlPoint.y} ${this.endPoint.x} ${this.endPoint.y}`;
549
555
  lineElement = document.createElementNS('http://www.w3.org/2000/svg', 'path');
550
556
  lineElement.setAttribute('d', pathData);
551
- lineElement.setAttribute('stroke', this.options.stroke || lineColor);
557
+ lineElement.setAttribute('stroke', this.options.stroke || getThemeStroke());
552
558
  lineElement.setAttribute('stroke-width', this.options.strokeWidth || lineStrokeWidth);
553
559
  lineElement.setAttribute('fill', 'none');
554
560
  lineElement.setAttribute('stroke-linecap', 'round');
@@ -562,7 +568,7 @@ removeSelection() {
562
568
  lineElement.setAttribute('y1', this.startPoint.y);
563
569
  lineElement.setAttribute('x2', this.endPoint.x);
564
570
  lineElement.setAttribute('y2', this.endPoint.y);
565
- lineElement.setAttribute('stroke', this.options.stroke || lineColor);
571
+ lineElement.setAttribute('stroke', this.options.stroke || getThemeStroke());
566
572
  lineElement.setAttribute('stroke-width', this.options.strokeWidth || lineStrokeWidth);
567
573
  lineElement.setAttribute('stroke-linecap', 'round');
568
574
  lineElement.setAttribute('stroke-dasharray', this.options.strokeDasharray);