@elixpo/lixsketch 5.5.9 → 5.5.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 (43) hide show
  1. package/dist/react/{AIRenderer-46WIFF2B.js → AIRenderer-PWWLWI6U.js} +84 -16
  2. package/dist/react/AIRenderer-PWWLWI6U.js.map +7 -0
  3. package/dist/react/{CopyPaste-4CKJRHJ3.js → CopyPaste-SA72NDFN.js} +2 -2
  4. package/dist/react/{EventDispatcher-AD2BPPPS.js → EventDispatcher-BZQRHROG.js} +2 -2
  5. package/dist/react/{MermaidFlowchartRenderer-A26B2SM3.js → MermaidFlowchartRenderer-4YEMAYQC.js} +18 -3
  6. package/dist/react/MermaidFlowchartRenderer-4YEMAYQC.js.map +7 -0
  7. package/dist/react/{MermaidSequenceRenderer-OF4JK77D.js → MermaidSequenceRenderer-KCUHO7UI.js} +106 -4
  8. package/dist/react/MermaidSequenceRenderer-KCUHO7UI.js.map +7 -0
  9. package/dist/react/MermaidStructuredRenderer-GGOOGON5.js +365 -0
  10. package/dist/react/MermaidStructuredRenderer-GGOOGON5.js.map +7 -0
  11. package/dist/react/{SceneSerializer-4U4B24JM.js → SceneSerializer-ZPHV6IUP.js} +2 -2
  12. package/dist/react/{SketchEngine-XWWTA2MT.js → SketchEngine-NPF2XN6Z.js} +7 -7
  13. package/dist/react/TextShape-U6ZZKB35.js +8 -0
  14. package/dist/react/{chunk-QXFBG7OM.js → chunk-42O6W7DF.js} +18 -1
  15. package/dist/react/chunk-42O6W7DF.js.map +7 -0
  16. package/dist/react/{chunk-YVCENC7J.js → chunk-5QIT2WBE.js} +19 -116
  17. package/dist/react/chunk-5QIT2WBE.js.map +7 -0
  18. package/dist/react/index.js +34 -100
  19. package/dist/react/index.js.map +3 -3
  20. package/dist/react/{textTool-KY4AYUTC.js → textTool-HY5NMM7H.js} +2 -2
  21. package/package.json +1 -1
  22. package/src/core/AIRenderer.js +95 -11
  23. package/src/core/MermaidFlowchartRenderer.js +18 -3
  24. package/src/core/MermaidSequenceRenderer.js +116 -7
  25. package/src/core/MermaidStructuredRenderer.js +363 -0
  26. package/src/react/LixSketchCanvas.jsx +1 -1
  27. package/src/react/components/modals/LixScriptModal.jsx +22 -96
  28. package/src/react/components/sidebars/TextSidebar.jsx +1 -1
  29. package/src/react/store/useUIStore.js +1 -1
  30. package/src/shapes/TextShape.js +19 -0
  31. package/src/tools/textTool.js +23 -157
  32. package/dist/react/AIRenderer-46WIFF2B.js.map +0 -7
  33. package/dist/react/MermaidFlowchartRenderer-A26B2SM3.js.map +0 -7
  34. package/dist/react/MermaidSequenceRenderer-OF4JK77D.js.map +0 -7
  35. package/dist/react/TextShape-54ZJ66E3.js +0 -8
  36. package/dist/react/chunk-QXFBG7OM.js.map +0 -7
  37. package/dist/react/chunk-YVCENC7J.js.map +0 -7
  38. /package/dist/react/{CopyPaste-4CKJRHJ3.js.map → CopyPaste-SA72NDFN.js.map} +0 -0
  39. /package/dist/react/{EventDispatcher-AD2BPPPS.js.map → EventDispatcher-BZQRHROG.js.map} +0 -0
  40. /package/dist/react/{SceneSerializer-4U4B24JM.js.map → SceneSerializer-ZPHV6IUP.js.map} +0 -0
  41. /package/dist/react/{SketchEngine-XWWTA2MT.js.map → SketchEngine-NPF2XN6Z.js.map} +0 -0
  42. /package/dist/react/{TextShape-54ZJ66E3.js.map → TextShape-U6ZZKB35.js.map} +0 -0
  43. /package/dist/react/{textTool-KY4AYUTC.js.map → textTool-HY5NMM7H.js.map} +0 -0
@@ -0,0 +1,365 @@
1
+ "use client";
2
+
3
+ // src/core/MermaidStructuredRenderer.js
4
+ var NS = "http://www.w3.org/2000/svg";
5
+ var PALETTE = [
6
+ { fill: "#dfeee4", stroke: "#5f836c" },
7
+ { fill: "#f4e3d4", stroke: "#a97852" },
8
+ { fill: "#e9e1ef", stroke: "#7e6b91" },
9
+ { fill: "#f3edc9", stroke: "#9a8745" },
10
+ { fill: "#dcebed", stroke: "#5d7f82" },
11
+ { fill: "#f1dedc", stroke: "#9a6863" }
12
+ ];
13
+ function escapeXml(value) {
14
+ return String(value ?? "").replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;");
15
+ }
16
+ function isDark() {
17
+ return typeof document !== "undefined" && document.body?.classList.contains("theme-dark");
18
+ }
19
+ function theme() {
20
+ return isDark() ? { bg: "#20232a", text: "#f0eee8", line: "#aaa89f", frame: "#77766f", panel: "#292d34" } : { bg: "#fbfaf6", text: "#343832", line: "#6e746c", frame: "#b9b7ac", panel: "#f5f2ea" };
21
+ }
22
+ function sourceLines(src) {
23
+ return src.split("\n").map((line) => line.trim()).filter((line) => line && !line.startsWith("%%"));
24
+ }
25
+ function detectStructuredMermaid(src) {
26
+ const header = sourceLines(src)[0]?.toLowerCase() || "";
27
+ if (header === "erdiagram") return "er";
28
+ if (/^pie(?:\s|$)/.test(header) || /^xychart(?:-beta)?(?:\s|$)/.test(header)) return "chart";
29
+ return null;
30
+ }
31
+ function parseERDiagram(src) {
32
+ const lines = sourceLines(src);
33
+ if (lines[0]?.toLowerCase() !== "erdiagram") return null;
34
+ const entityMap = /* @__PURE__ */ new Map();
35
+ const relationships = [];
36
+ let current = null;
37
+ const ensureEntity = (name) => {
38
+ if (!entityMap.has(name)) entityMap.set(name, { name, attributes: [] });
39
+ return entityMap.get(name);
40
+ };
41
+ for (let index = 1; index < lines.length; index++) {
42
+ const line = lines[index];
43
+ const entityStart = line.match(/^([\w-]+)\s*\{$/);
44
+ if (entityStart) {
45
+ current = ensureEntity(entityStart[1]);
46
+ continue;
47
+ }
48
+ if (line === "}") {
49
+ current = null;
50
+ continue;
51
+ }
52
+ if (current) {
53
+ const attribute = line.match(/^(\S+)\s+(\S+)(?:\s+(.+))?$/);
54
+ if (attribute) {
55
+ current.attributes.push({
56
+ type: attribute[1],
57
+ name: attribute[2],
58
+ key: attribute[3] || ""
59
+ });
60
+ }
61
+ continue;
62
+ }
63
+ const relation = line.match(/^([\w-]+)\s+([|o}{.]+)(?:--|\.\.)([|o}{.]+)\s+([\w-]+)\s*:\s*(.+)$/);
64
+ if (relation) {
65
+ ensureEntity(relation[1]);
66
+ ensureEntity(relation[4]);
67
+ relationships.push({
68
+ from: relation[1],
69
+ fromCardinality: relation[2],
70
+ toCardinality: relation[3],
71
+ to: relation[4],
72
+ label: relation[5]
73
+ });
74
+ }
75
+ }
76
+ if (entityMap.size === 0) return null;
77
+ return { type: "erDiagram", title: "Entity relationship diagram", entities: [...entityMap.values()], relationships };
78
+ }
79
+ function layoutER(diagram) {
80
+ const width = 230;
81
+ const headerHeight = 44;
82
+ const rowHeight = 30;
83
+ const columns = Math.max(1, Math.ceil(Math.sqrt(diagram.entities.length)));
84
+ return diagram.entities.map((entity, index) => ({
85
+ ...entity,
86
+ x: 60 + index % columns * 330,
87
+ y: 55 + Math.floor(index / columns) * 270,
88
+ width,
89
+ headerHeight,
90
+ rowHeight,
91
+ height: headerHeight + Math.max(1, entity.attributes.length) * rowHeight,
92
+ color: PALETTE[index % PALETTE.length]
93
+ }));
94
+ }
95
+ function renderERPreviewSVG(diagram) {
96
+ if (!diagram?.entities?.length) return "";
97
+ const TK = theme();
98
+ const entities = layoutER(diagram);
99
+ const byName = new Map(entities.map((entity) => [entity.name, entity]));
100
+ const maxX = Math.max(...entities.map((entity) => entity.x + entity.width)) + 60;
101
+ const maxY = Math.max(...entities.map((entity) => entity.y + entity.height)) + 55;
102
+ let content = `<rect width="${maxX}" height="${maxY}" rx="10" fill="${TK.bg}"/>`;
103
+ content += `<defs><marker id="er-arrow" markerWidth="9" markerHeight="7" refX="8" refY="3.5" orient="auto"><path d="M1 1 L8 3.5 L1 6" fill="none" stroke="${TK.line}" stroke-width="1.4"/></marker></defs>`;
104
+ for (const relation of diagram.relationships) {
105
+ const from = byName.get(relation.from);
106
+ const to = byName.get(relation.to);
107
+ if (!from || !to) continue;
108
+ const x1 = from.x + from.width / 2;
109
+ const y1 = from.y + from.height / 2;
110
+ const x2 = to.x + to.width / 2;
111
+ const y2 = to.y + to.height / 2;
112
+ const mx = (x1 + x2) / 2;
113
+ const my = (y1 + y2) / 2;
114
+ content += `<line x1="${x1}" y1="${y1}" x2="${x2}" y2="${y2}" stroke="${TK.line}" stroke-width="1.6" marker-end="url(#er-arrow)"/>`;
115
+ content += `<text x="${mx}" y="${my - 8}" text-anchor="middle" fill="${TK.text}" font-size="12" font-family="lixFont">${escapeXml(`${relation.fromCardinality} ${relation.label} ${relation.toCardinality}`)}</text>`;
116
+ }
117
+ for (const entity of entities) {
118
+ content += `<g><rect x="${entity.x}" y="${entity.y}" width="${entity.width}" height="${entity.height}" rx="8" fill="${TK.panel}" stroke="${entity.color.stroke}" stroke-width="1.5"/>`;
119
+ content += `<rect x="${entity.x}" y="${entity.y}" width="${entity.width}" height="${entity.headerHeight}" rx="8" fill="${entity.color.fill}" stroke="${entity.color.stroke}" stroke-width="1.5"/>`;
120
+ content += `<text x="${entity.x + entity.width / 2}" y="${entity.y + 27}" text-anchor="middle" fill="#343832" font-size="14" font-weight="600" font-family="lixFont">${escapeXml(entity.name)}</text>`;
121
+ const attributes = entity.attributes.length ? entity.attributes : [{ type: "", name: "No attributes", key: "" }];
122
+ attributes.forEach((attribute, row) => {
123
+ const y = entity.y + entity.headerHeight + row * entity.rowHeight;
124
+ content += `<line x1="${entity.x}" y1="${y}" x2="${entity.x + entity.width}" y2="${y}" stroke="${TK.frame}" stroke-width="0.8"/>`;
125
+ content += `<text x="${entity.x + 10}" y="${y + 20}" fill="${TK.text}" font-size="11" font-family="lixCode">${escapeXml([attribute.type, attribute.name, attribute.key].filter(Boolean).join(" "))}</text>`;
126
+ });
127
+ content += "</g>";
128
+ }
129
+ return `<svg xmlns="${NS}" width="600" height="450" viewBox="0 0 ${maxX} ${maxY}">${content}</svg>`;
130
+ }
131
+ function numberList(value) {
132
+ return value.replace(/^\[|\]$/g, "").split(",").map((item) => Number(item.trim())).filter(Number.isFinite);
133
+ }
134
+ function parseChartDiagram(src) {
135
+ const lines = sourceLines(src);
136
+ const header = lines[0]?.toLowerCase() || "";
137
+ if (/^pie(?:\s|$)/.test(header)) {
138
+ let title2 = lines[0].replace(/^pie(?:\s+showData)?\s*/i, "").replace(/^title\s+/i, "").trim() || "Pie chart";
139
+ const values = [];
140
+ for (let index = 1; index < lines.length; index++) {
141
+ const titleMatch = lines[index].match(/^title\s+(.+)$/i);
142
+ if (titleMatch) {
143
+ title2 = titleMatch[1];
144
+ continue;
145
+ }
146
+ const item = lines[index].match(/^"?(.+?)"?\s*:\s*(-?\d+(?:\.\d+)?)$/);
147
+ if (item) values.push({ label: item[1], value: Number(item[2]) });
148
+ }
149
+ return values.length ? { type: "chart", kind: "pie", title: title2, categories: values.map((v) => v.label), series: [{ name: title2, values: values.map((v) => v.value) }] } : null;
150
+ }
151
+ if (!/^xychart(?:-beta)?(?:\s|$)/.test(header)) return null;
152
+ let title = "Chart";
153
+ let categories = [];
154
+ const series = [];
155
+ for (let index = 1; index < lines.length; index++) {
156
+ const titleMatch = lines[index].match(/^title\s+"?(.+?)"?$/i);
157
+ const axisMatch = lines[index].match(/^x-axis(?:\s+".*?")?\s+(\[.+\])/i);
158
+ const seriesMatch = lines[index].match(/^(bar|line)(?:\s+"?([^"\[]+)"?)?\s+(\[.+\])$/i);
159
+ if (titleMatch) title = titleMatch[1];
160
+ else if (axisMatch) categories = axisMatch[1].replace(/^\[|\]$/g, "").split(",").map((v) => v.trim().replace(/^"|"$/g, ""));
161
+ else if (seriesMatch) series.push({ kind: seriesMatch[1].toLowerCase(), name: seriesMatch[2]?.trim() || seriesMatch[1], values: numberList(seriesMatch[3]) });
162
+ }
163
+ const maxItems = Math.max(0, ...series.map((item) => item.values.length));
164
+ if (!categories.length) categories = Array.from({ length: maxItems }, (_, index) => String(index + 1));
165
+ return series.length ? { type: "chart", kind: "xy", title, categories, series } : null;
166
+ }
167
+ function renderChartPreviewSVG(chart) {
168
+ if (!chart?.series?.length) return "";
169
+ const TK = theme();
170
+ const width = 720;
171
+ const height = 450;
172
+ const left = 70;
173
+ const top = 60;
174
+ const plotWidth = 580;
175
+ const plotHeight = 300;
176
+ const values = chart.series.flatMap((series) => series.values);
177
+ const maximum = Math.max(1, ...values.map(Math.abs));
178
+ const categoryCount = Math.max(1, chart.categories.length);
179
+ const slot = plotWidth / categoryCount;
180
+ let content = `<rect width="${width}" height="${height}" rx="10" fill="${TK.bg}"/><text x="${width / 2}" y="32" text-anchor="middle" fill="${TK.text}" font-size="18" font-family="lixFont">${escapeXml(chart.title)}</text>`;
181
+ content += `<line x1="${left}" y1="${top}" x2="${left}" y2="${top + plotHeight}" stroke="${TK.line}"/><line x1="${left}" y1="${top + plotHeight}" x2="${left + plotWidth}" y2="${top + plotHeight}" stroke="${TK.line}"/>`;
182
+ chart.categories.forEach((category, index) => {
183
+ content += `<text x="${left + slot * (index + 0.5)}" y="${top + plotHeight + 24}" text-anchor="middle" fill="${TK.text}" font-size="11" font-family="lixFont">${escapeXml(category)}</text>`;
184
+ });
185
+ chart.series.forEach((series, seriesIndex) => {
186
+ const color = PALETTE[seriesIndex % PALETTE.length];
187
+ if (series.kind === "line") {
188
+ const points = series.values.map((value, index) => `${left + slot * (index + 0.5)},${top + plotHeight - Math.abs(value) / maximum * plotHeight}`).join(" ");
189
+ content += `<polyline points="${points}" fill="none" stroke="${color.stroke}" stroke-width="3"/>`;
190
+ series.values.forEach((value, index) => content += `<circle cx="${left + slot * (index + 0.5)}" cy="${top + plotHeight - Math.abs(value) / maximum * plotHeight}" r="5" fill="${color.fill}" stroke="${color.stroke}" stroke-width="2"/>`);
191
+ } else {
192
+ const barWidth = Math.max(12, slot * 0.7 / chart.series.length);
193
+ series.values.forEach((value, index) => {
194
+ const barHeight = Math.abs(value) / maximum * plotHeight;
195
+ const x = left + slot * index + slot * 0.15 + seriesIndex * barWidth;
196
+ content += `<rect x="${x}" y="${top + plotHeight - barHeight}" width="${barWidth}" height="${barHeight}" rx="4" fill="${color.fill}" stroke="${color.stroke}" stroke-width="1.5"/><text x="${x + barWidth / 2}" y="${top + plotHeight - barHeight - 7}" text-anchor="middle" fill="${TK.text}" font-size="10" font-family="lixFont">${value}</text>`;
197
+ });
198
+ }
199
+ });
200
+ return `<svg xmlns="${NS}" width="600" height="450" viewBox="0 0 ${width} ${height}">${content}</svg>`;
201
+ }
202
+ function push(shape, frame) {
203
+ if (!shape) return null;
204
+ window.shapes.push(shape);
205
+ if (window.pushCreateAction) window.pushCreateAction(shape);
206
+ if (frame?.addShapeToFrame) frame.addShapeToFrame(shape);
207
+ return shape;
208
+ }
209
+ function canvasOrigin(width, height) {
210
+ const vb = window.currentViewBox || { x: 0, y: 0, width: window.innerWidth, height: window.innerHeight };
211
+ return { x: vb.x + vb.width / 2 - width / 2, y: vb.y + vb.height / 2 - height / 2 };
212
+ }
213
+ function createFrame(x, y, width, height, name, type) {
214
+ const TK = theme();
215
+ const frame = new window.Frame(x - 45, y - 45, width + 90, height + 90, {
216
+ stroke: TK.frame,
217
+ strokeWidth: 1,
218
+ fill: "transparent",
219
+ opacity: 0.75,
220
+ frameName: name
221
+ });
222
+ frame._diagramType = type;
223
+ push(frame);
224
+ return frame;
225
+ }
226
+ function renderEROnCanvas(diagram) {
227
+ if (!diagram?.entities?.length || !window.Rectangle || !window.Arrow || !window.Frame) return false;
228
+ const TK = theme();
229
+ const entities = layoutER(diagram);
230
+ const width = Math.max(...entities.map((entity) => entity.x + entity.width)) + 40;
231
+ const height = Math.max(...entities.map((entity) => entity.y + entity.height)) + 40;
232
+ const origin = canvasOrigin(width, height);
233
+ const frame = createFrame(origin.x, origin.y, width, height, diagram.title, "mermaid-er");
234
+ const entityShapes = /* @__PURE__ */ new Map();
235
+ let first = null;
236
+ for (const entity of entities) {
237
+ const x = origin.x + entity.x;
238
+ const y = origin.y + entity.y;
239
+ const header = push(new window.Rectangle(x, y, entity.width, entity.headerHeight, {
240
+ stroke: entity.color.stroke,
241
+ strokeWidth: 1.5,
242
+ fill: entity.color.fill,
243
+ fillStyle: "solid",
244
+ roughness: 1,
245
+ label: entity.name,
246
+ labelColor: "#343832",
247
+ labelFontSize: 15
248
+ }), frame);
249
+ if (!first) first = header;
250
+ entityShapes.set(entity.name, { shape: header, x, y, width: entity.width, height: entity.headerHeight });
251
+ const attributes = entity.attributes.length ? entity.attributes : [{ type: "", name: "No attributes", key: "" }];
252
+ attributes.forEach((attribute, row) => push(new window.Rectangle(
253
+ x,
254
+ y + entity.headerHeight + row * entity.rowHeight,
255
+ entity.width,
256
+ entity.rowHeight,
257
+ {
258
+ stroke: TK.frame,
259
+ strokeWidth: 1,
260
+ fill: TK.panel,
261
+ fillStyle: "solid",
262
+ roughness: 0.4,
263
+ label: [attribute.type, attribute.name, attribute.key].filter(Boolean).join(" "),
264
+ labelColor: TK.text,
265
+ labelFontSize: 11
266
+ }
267
+ ), frame));
268
+ }
269
+ for (const relation of diagram.relationships) {
270
+ const from = entityShapes.get(relation.from);
271
+ const to = entityShapes.get(relation.to);
272
+ if (!from || !to) continue;
273
+ const start = { x: from.x + from.width / 2, y: from.y + from.height / 2 };
274
+ const end = { x: to.x + to.width / 2, y: to.y + to.height / 2 };
275
+ const arrow = push(new window.Arrow(start, end, {
276
+ stroke: TK.line,
277
+ strokeWidth: 1.5,
278
+ roughness: 1,
279
+ label: `${relation.fromCardinality} ${relation.label} ${relation.toCardinality}`,
280
+ labelColor: TK.text
281
+ }), frame);
282
+ if (arrow && window.__autoAttach) {
283
+ window.__autoAttach(arrow, from.shape, true, start);
284
+ window.__autoAttach(arrow, to.shape, false, end);
285
+ }
286
+ }
287
+ if (first?.selectShape) {
288
+ window.currentShape = first;
289
+ first.selectShape();
290
+ }
291
+ return true;
292
+ }
293
+ function renderChartOnCanvas(chart) {
294
+ if (!chart?.series?.length || !window.Rectangle || !window.Circle || !window.Line || !window.Frame) return false;
295
+ const TK = theme();
296
+ const width = 720;
297
+ const height = 450;
298
+ const origin = canvasOrigin(width, height);
299
+ const frame = createFrame(origin.x, origin.y, width, height, chart.title, "mermaid-chart");
300
+ const left = origin.x + 70;
301
+ const top = origin.y + 65;
302
+ const plotWidth = 580;
303
+ const plotHeight = 300;
304
+ const values = chart.series.flatMap((series) => series.values);
305
+ const maximum = Math.max(1, ...values.map(Math.abs));
306
+ const slot = plotWidth / Math.max(1, chart.categories.length);
307
+ let first = null;
308
+ push(new window.Line({ x: left, y: top }, { x: left, y: top + plotHeight }, { stroke: TK.line, strokeWidth: 1.5, roughness: 0 }), frame);
309
+ push(new window.Line({ x: left, y: top + plotHeight }, { x: left + plotWidth, y: top + plotHeight }, { stroke: TK.line, strokeWidth: 1.5, roughness: 0 }), frame);
310
+ chart.series.forEach((series, seriesIndex) => {
311
+ const color = PALETTE[seriesIndex % PALETTE.length];
312
+ if (series.kind === "line") {
313
+ let previous = null;
314
+ series.values.forEach((value, index) => {
315
+ const point = { x: left + slot * (index + 0.5), y: top + plotHeight - Math.abs(value) / maximum * plotHeight };
316
+ const dot = push(new window.Circle(point.x, point.y, 8, 8, {
317
+ stroke: color.stroke,
318
+ strokeWidth: 2,
319
+ fill: color.fill,
320
+ fillStyle: "solid",
321
+ roughness: 0.5,
322
+ label: String(value),
323
+ labelColor: TK.text,
324
+ labelFontSize: 9
325
+ }), frame);
326
+ if (!first) first = dot;
327
+ if (previous) push(new window.Line(previous, point, { stroke: color.stroke, strokeWidth: 3, roughness: 0.5 }), frame);
328
+ previous = point;
329
+ });
330
+ } else {
331
+ const barWidth = Math.max(18, slot * 0.7 / chart.series.length);
332
+ series.values.forEach((value, index) => {
333
+ const barHeight = Math.max(8, Math.abs(value) / maximum * plotHeight);
334
+ const x = left + slot * index + slot * 0.15 + seriesIndex * barWidth;
335
+ const bar = push(new window.Rectangle(x, top + plotHeight - barHeight, barWidth, barHeight, {
336
+ stroke: color.stroke,
337
+ strokeWidth: 1.5,
338
+ fill: color.fill,
339
+ fillStyle: "solid",
340
+ roughness: 0.7,
341
+ label: `${chart.categories[index] || index + 1}
342
+ ${value}`,
343
+ labelColor: "#343832",
344
+ labelFontSize: 11
345
+ }), frame);
346
+ if (!first) first = bar;
347
+ });
348
+ }
349
+ });
350
+ if (first?.selectShape) {
351
+ window.currentShape = first;
352
+ first.selectShape();
353
+ }
354
+ return true;
355
+ }
356
+ export {
357
+ detectStructuredMermaid,
358
+ parseChartDiagram,
359
+ parseERDiagram,
360
+ renderChartOnCanvas,
361
+ renderChartPreviewSVG,
362
+ renderEROnCanvas,
363
+ renderERPreviewSVG
364
+ };
365
+ //# sourceMappingURL=MermaidStructuredRenderer-GGOOGON5.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/core/MermaidStructuredRenderer.js"],
4
+ "sourcesContent": ["/* eslint-disable */\n/**\n * Native renderers for Mermaid ER and chart diagrams.\n *\n * Preview is SVG, while canvas placement deliberately creates ordinary\n * LixSketch shapes. That keeps entities, attributes, relationships, bars,\n * points, and legend items independently selectable and editable.\n */\n\nconst NS = 'http://www.w3.org/2000/svg';\nconst PALETTE = [\n { fill: '#dfeee4', stroke: '#5f836c' },\n { fill: '#f4e3d4', stroke: '#a97852' },\n { fill: '#e9e1ef', stroke: '#7e6b91' },\n { fill: '#f3edc9', stroke: '#9a8745' },\n { fill: '#dcebed', stroke: '#5d7f82' },\n { fill: '#f1dedc', stroke: '#9a6863' },\n];\n\nfunction escapeXml(value) {\n return String(value ?? '')\n .replace(/&/g, '&amp;')\n .replace(/</g, '&lt;')\n .replace(/>/g, '&gt;')\n .replace(/\"/g, '&quot;');\n}\n\nfunction isDark() {\n return typeof document !== 'undefined' && document.body?.classList.contains('theme-dark');\n}\n\nfunction theme() {\n return isDark()\n ? { bg: '#20232a', text: '#f0eee8', line: '#aaa89f', frame: '#77766f', panel: '#292d34' }\n : { bg: '#fbfaf6', text: '#343832', line: '#6e746c', frame: '#b9b7ac', panel: '#f5f2ea' };\n}\n\nfunction sourceLines(src) {\n return src.split('\\n').map(line => line.trim()).filter(line => line && !line.startsWith('%%'));\n}\n\nexport function detectStructuredMermaid(src) {\n const header = sourceLines(src)[0]?.toLowerCase() || '';\n if (header === 'erdiagram') return 'er';\n if (/^pie(?:\\s|$)/.test(header) || /^xychart(?:-beta)?(?:\\s|$)/.test(header)) return 'chart';\n return null;\n}\n\n// ---------------------------------------------------------------------\n// Entity relationship diagrams\n// ---------------------------------------------------------------------\n\nexport function parseERDiagram(src) {\n const lines = sourceLines(src);\n if (lines[0]?.toLowerCase() !== 'erdiagram') return null;\n\n const entityMap = new Map();\n const relationships = [];\n let current = null;\n\n const ensureEntity = (name) => {\n if (!entityMap.has(name)) entityMap.set(name, { name, attributes: [] });\n return entityMap.get(name);\n };\n\n for (let index = 1; index < lines.length; index++) {\n const line = lines[index];\n const entityStart = line.match(/^([\\w-]+)\\s*\\{$/);\n if (entityStart) {\n current = ensureEntity(entityStart[1]);\n continue;\n }\n if (line === '}') {\n current = null;\n continue;\n }\n if (current) {\n const attribute = line.match(/^(\\S+)\\s+(\\S+)(?:\\s+(.+))?$/);\n if (attribute) {\n current.attributes.push({\n type: attribute[1],\n name: attribute[2],\n key: attribute[3] || '',\n });\n }\n continue;\n }\n\n // CUSTOMER ||--o{ ORDER : places\n const relation = line.match(/^([\\w-]+)\\s+([|o}{.]+)(?:--|\\.\\.)([|o}{.]+)\\s+([\\w-]+)\\s*:\\s*(.+)$/);\n if (relation) {\n ensureEntity(relation[1]);\n ensureEntity(relation[4]);\n relationships.push({\n from: relation[1],\n fromCardinality: relation[2],\n toCardinality: relation[3],\n to: relation[4],\n label: relation[5],\n });\n }\n }\n\n if (entityMap.size === 0) return null;\n return { type: 'erDiagram', title: 'Entity relationship diagram', entities: [...entityMap.values()], relationships };\n}\n\nfunction layoutER(diagram) {\n const width = 230;\n const headerHeight = 44;\n const rowHeight = 30;\n const columns = Math.max(1, Math.ceil(Math.sqrt(diagram.entities.length)));\n return diagram.entities.map((entity, index) => ({\n ...entity,\n x: 60 + (index % columns) * 330,\n y: 55 + Math.floor(index / columns) * 270,\n width,\n headerHeight,\n rowHeight,\n height: headerHeight + Math.max(1, entity.attributes.length) * rowHeight,\n color: PALETTE[index % PALETTE.length],\n }));\n}\n\nexport function renderERPreviewSVG(diagram) {\n if (!diagram?.entities?.length) return '';\n const TK = theme();\n const entities = layoutER(diagram);\n const byName = new Map(entities.map(entity => [entity.name, entity]));\n const maxX = Math.max(...entities.map(entity => entity.x + entity.width)) + 60;\n const maxY = Math.max(...entities.map(entity => entity.y + entity.height)) + 55;\n let content = `<rect width=\"${maxX}\" height=\"${maxY}\" rx=\"10\" fill=\"${TK.bg}\"/>`;\n content += `<defs><marker id=\"er-arrow\" markerWidth=\"9\" markerHeight=\"7\" refX=\"8\" refY=\"3.5\" orient=\"auto\"><path d=\"M1 1 L8 3.5 L1 6\" fill=\"none\" stroke=\"${TK.line}\" stroke-width=\"1.4\"/></marker></defs>`;\n\n for (const relation of diagram.relationships) {\n const from = byName.get(relation.from);\n const to = byName.get(relation.to);\n if (!from || !to) continue;\n const x1 = from.x + from.width / 2;\n const y1 = from.y + from.height / 2;\n const x2 = to.x + to.width / 2;\n const y2 = to.y + to.height / 2;\n const mx = (x1 + x2) / 2;\n const my = (y1 + y2) / 2;\n content += `<line x1=\"${x1}\" y1=\"${y1}\" x2=\"${x2}\" y2=\"${y2}\" stroke=\"${TK.line}\" stroke-width=\"1.6\" marker-end=\"url(#er-arrow)\"/>`;\n content += `<text x=\"${mx}\" y=\"${my - 8}\" text-anchor=\"middle\" fill=\"${TK.text}\" font-size=\"12\" font-family=\"lixFont\">${escapeXml(`${relation.fromCardinality} ${relation.label} ${relation.toCardinality}`)}</text>`;\n }\n\n for (const entity of entities) {\n content += `<g><rect x=\"${entity.x}\" y=\"${entity.y}\" width=\"${entity.width}\" height=\"${entity.height}\" rx=\"8\" fill=\"${TK.panel}\" stroke=\"${entity.color.stroke}\" stroke-width=\"1.5\"/>`;\n content += `<rect x=\"${entity.x}\" y=\"${entity.y}\" width=\"${entity.width}\" height=\"${entity.headerHeight}\" rx=\"8\" fill=\"${entity.color.fill}\" stroke=\"${entity.color.stroke}\" stroke-width=\"1.5\"/>`;\n content += `<text x=\"${entity.x + entity.width / 2}\" y=\"${entity.y + 27}\" text-anchor=\"middle\" fill=\"#343832\" font-size=\"14\" font-weight=\"600\" font-family=\"lixFont\">${escapeXml(entity.name)}</text>`;\n const attributes = entity.attributes.length ? entity.attributes : [{ type: '', name: 'No attributes', key: '' }];\n attributes.forEach((attribute, row) => {\n const y = entity.y + entity.headerHeight + row * entity.rowHeight;\n content += `<line x1=\"${entity.x}\" y1=\"${y}\" x2=\"${entity.x + entity.width}\" y2=\"${y}\" stroke=\"${TK.frame}\" stroke-width=\"0.8\"/>`;\n content += `<text x=\"${entity.x + 10}\" y=\"${y + 20}\" fill=\"${TK.text}\" font-size=\"11\" font-family=\"lixCode\">${escapeXml([attribute.type, attribute.name, attribute.key].filter(Boolean).join(' '))}</text>`;\n });\n content += '</g>';\n }\n return `<svg xmlns=\"${NS}\" width=\"600\" height=\"450\" viewBox=\"0 0 ${maxX} ${maxY}\">${content}</svg>`;\n}\n\n// ---------------------------------------------------------------------\n// Pie and XY charts\n// ---------------------------------------------------------------------\n\nfunction numberList(value) {\n return value.replace(/^\\[|\\]$/g, '').split(',').map(item => Number(item.trim())).filter(Number.isFinite);\n}\n\nexport function parseChartDiagram(src) {\n const lines = sourceLines(src);\n const header = lines[0]?.toLowerCase() || '';\n if (/^pie(?:\\s|$)/.test(header)) {\n let title = lines[0].replace(/^pie(?:\\s+showData)?\\s*/i, '').replace(/^title\\s+/i, '').trim() || 'Pie chart';\n const values = [];\n for (let index = 1; index < lines.length; index++) {\n const titleMatch = lines[index].match(/^title\\s+(.+)$/i);\n if (titleMatch) { title = titleMatch[1]; continue; }\n const item = lines[index].match(/^\"?(.+?)\"?\\s*:\\s*(-?\\d+(?:\\.\\d+)?)$/);\n if (item) values.push({ label: item[1], value: Number(item[2]) });\n }\n return values.length ? { type: 'chart', kind: 'pie', title, categories: values.map(v => v.label), series: [{ name: title, values: values.map(v => v.value) }] } : null;\n }\n if (!/^xychart(?:-beta)?(?:\\s|$)/.test(header)) return null;\n let title = 'Chart';\n let categories = [];\n const series = [];\n for (let index = 1; index < lines.length; index++) {\n const titleMatch = lines[index].match(/^title\\s+\"?(.+?)\"?$/i);\n const axisMatch = lines[index].match(/^x-axis(?:\\s+\".*?\")?\\s+(\\[.+\\])/i);\n const seriesMatch = lines[index].match(/^(bar|line)(?:\\s+\"?([^\"\\[]+)\"?)?\\s+(\\[.+\\])$/i);\n if (titleMatch) title = titleMatch[1];\n else if (axisMatch) categories = axisMatch[1].replace(/^\\[|\\]$/g, '').split(',').map(v => v.trim().replace(/^\"|\"$/g, ''));\n else if (seriesMatch) series.push({ kind: seriesMatch[1].toLowerCase(), name: seriesMatch[2]?.trim() || seriesMatch[1], values: numberList(seriesMatch[3]) });\n }\n const maxItems = Math.max(0, ...series.map(item => item.values.length));\n if (!categories.length) categories = Array.from({ length: maxItems }, (_, index) => String(index + 1));\n return series.length ? { type: 'chart', kind: 'xy', title, categories, series } : null;\n}\n\nexport function renderChartPreviewSVG(chart) {\n if (!chart?.series?.length) return '';\n const TK = theme();\n const width = 720;\n const height = 450;\n const left = 70;\n const top = 60;\n const plotWidth = 580;\n const plotHeight = 300;\n const values = chart.series.flatMap(series => series.values);\n const maximum = Math.max(1, ...values.map(Math.abs));\n const categoryCount = Math.max(1, chart.categories.length);\n const slot = plotWidth / categoryCount;\n let content = `<rect width=\"${width}\" height=\"${height}\" rx=\"10\" fill=\"${TK.bg}\"/><text x=\"${width / 2}\" y=\"32\" text-anchor=\"middle\" fill=\"${TK.text}\" font-size=\"18\" font-family=\"lixFont\">${escapeXml(chart.title)}</text>`;\n content += `<line x1=\"${left}\" y1=\"${top}\" x2=\"${left}\" y2=\"${top + plotHeight}\" stroke=\"${TK.line}\"/><line x1=\"${left}\" y1=\"${top + plotHeight}\" x2=\"${left + plotWidth}\" y2=\"${top + plotHeight}\" stroke=\"${TK.line}\"/>`;\n\n chart.categories.forEach((category, index) => {\n content += `<text x=\"${left + slot * (index + .5)}\" y=\"${top + plotHeight + 24}\" text-anchor=\"middle\" fill=\"${TK.text}\" font-size=\"11\" font-family=\"lixFont\">${escapeXml(category)}</text>`;\n });\n\n chart.series.forEach((series, seriesIndex) => {\n const color = PALETTE[seriesIndex % PALETTE.length];\n if (series.kind === 'line') {\n const points = series.values.map((value, index) => `${left + slot * (index + .5)},${top + plotHeight - Math.abs(value) / maximum * plotHeight}`).join(' ');\n content += `<polyline points=\"${points}\" fill=\"none\" stroke=\"${color.stroke}\" stroke-width=\"3\"/>`;\n series.values.forEach((value, index) => content += `<circle cx=\"${left + slot * (index + .5)}\" cy=\"${top + plotHeight - Math.abs(value) / maximum * plotHeight}\" r=\"5\" fill=\"${color.fill}\" stroke=\"${color.stroke}\" stroke-width=\"2\"/>`);\n } else {\n const barWidth = Math.max(12, slot * .7 / chart.series.length);\n series.values.forEach((value, index) => {\n const barHeight = Math.abs(value) / maximum * plotHeight;\n const x = left + slot * index + slot * .15 + seriesIndex * barWidth;\n content += `<rect x=\"${x}\" y=\"${top + plotHeight - barHeight}\" width=\"${barWidth}\" height=\"${barHeight}\" rx=\"4\" fill=\"${color.fill}\" stroke=\"${color.stroke}\" stroke-width=\"1.5\"/><text x=\"${x + barWidth / 2}\" y=\"${top + plotHeight - barHeight - 7}\" text-anchor=\"middle\" fill=\"${TK.text}\" font-size=\"10\" font-family=\"lixFont\">${value}</text>`;\n });\n }\n });\n return `<svg xmlns=\"${NS}\" width=\"600\" height=\"450\" viewBox=\"0 0 ${width} ${height}\">${content}</svg>`;\n}\n\n// ---------------------------------------------------------------------\n// Native canvas placement helpers\n// ---------------------------------------------------------------------\n\nfunction push(shape, frame) {\n if (!shape) return null;\n window.shapes.push(shape);\n if (window.pushCreateAction) window.pushCreateAction(shape);\n if (frame?.addShapeToFrame) frame.addShapeToFrame(shape);\n return shape;\n}\n\nfunction canvasOrigin(width, height) {\n const vb = window.currentViewBox || { x: 0, y: 0, width: window.innerWidth, height: window.innerHeight };\n return { x: vb.x + vb.width / 2 - width / 2, y: vb.y + vb.height / 2 - height / 2 };\n}\n\nfunction createFrame(x, y, width, height, name, type) {\n const TK = theme();\n const frame = new window.Frame(x - 45, y - 45, width + 90, height + 90, {\n stroke: TK.frame, strokeWidth: 1, fill: 'transparent', opacity: .75, frameName: name,\n });\n frame._diagramType = type;\n push(frame);\n return frame;\n}\n\nexport function renderEROnCanvas(diagram) {\n if (!diagram?.entities?.length || !window.Rectangle || !window.Arrow || !window.Frame) return false;\n const TK = theme();\n const entities = layoutER(diagram);\n const width = Math.max(...entities.map(entity => entity.x + entity.width)) + 40;\n const height = Math.max(...entities.map(entity => entity.y + entity.height)) + 40;\n const origin = canvasOrigin(width, height);\n const frame = createFrame(origin.x, origin.y, width, height, diagram.title, 'mermaid-er');\n const entityShapes = new Map();\n let first = null;\n\n for (const entity of entities) {\n const x = origin.x + entity.x;\n const y = origin.y + entity.y;\n const header = push(new window.Rectangle(x, y, entity.width, entity.headerHeight, {\n stroke: entity.color.stroke, strokeWidth: 1.5, fill: entity.color.fill, fillStyle: 'solid', roughness: 1,\n label: entity.name, labelColor: '#343832', labelFontSize: 15,\n }), frame);\n if (!first) first = header;\n entityShapes.set(entity.name, { shape: header, x, y, width: entity.width, height: entity.headerHeight });\n const attributes = entity.attributes.length ? entity.attributes : [{ type: '', name: 'No attributes', key: '' }];\n attributes.forEach((attribute, row) => push(new window.Rectangle(\n x, y + entity.headerHeight + row * entity.rowHeight, entity.width, entity.rowHeight,\n { stroke: TK.frame, strokeWidth: 1, fill: TK.panel, fillStyle: 'solid', roughness: .4,\n label: [attribute.type, attribute.name, attribute.key].filter(Boolean).join(' '), labelColor: TK.text, labelFontSize: 11 }\n ), frame));\n }\n\n for (const relation of diagram.relationships) {\n const from = entityShapes.get(relation.from);\n const to = entityShapes.get(relation.to);\n if (!from || !to) continue;\n const start = { x: from.x + from.width / 2, y: from.y + from.height / 2 };\n const end = { x: to.x + to.width / 2, y: to.y + to.height / 2 };\n const arrow = push(new window.Arrow(start, end, {\n stroke: TK.line, strokeWidth: 1.5, roughness: 1,\n label: `${relation.fromCardinality} ${relation.label} ${relation.toCardinality}`, labelColor: TK.text,\n }), frame);\n if (arrow && window.__autoAttach) {\n window.__autoAttach(arrow, from.shape, true, start);\n window.__autoAttach(arrow, to.shape, false, end);\n }\n }\n if (first?.selectShape) { window.currentShape = first; first.selectShape(); }\n return true;\n}\n\nexport function renderChartOnCanvas(chart) {\n if (!chart?.series?.length || !window.Rectangle || !window.Circle || !window.Line || !window.Frame) return false;\n const TK = theme();\n const width = 720;\n const height = 450;\n const origin = canvasOrigin(width, height);\n const frame = createFrame(origin.x, origin.y, width, height, chart.title, 'mermaid-chart');\n const left = origin.x + 70;\n const top = origin.y + 65;\n const plotWidth = 580;\n const plotHeight = 300;\n const values = chart.series.flatMap(series => series.values);\n const maximum = Math.max(1, ...values.map(Math.abs));\n const slot = plotWidth / Math.max(1, chart.categories.length);\n let first = null;\n\n push(new window.Line({ x: left, y: top }, { x: left, y: top + plotHeight }, { stroke: TK.line, strokeWidth: 1.5, roughness: 0 }), frame);\n push(new window.Line({ x: left, y: top + plotHeight }, { x: left + plotWidth, y: top + plotHeight }, { stroke: TK.line, strokeWidth: 1.5, roughness: 0 }), frame);\n\n chart.series.forEach((series, seriesIndex) => {\n const color = PALETTE[seriesIndex % PALETTE.length];\n if (series.kind === 'line') {\n let previous = null;\n series.values.forEach((value, index) => {\n const point = { x: left + slot * (index + .5), y: top + plotHeight - Math.abs(value) / maximum * plotHeight };\n const dot = push(new window.Circle(point.x, point.y, 8, 8, {\n stroke: color.stroke, strokeWidth: 2, fill: color.fill, fillStyle: 'solid', roughness: .5,\n label: String(value), labelColor: TK.text, labelFontSize: 9,\n }), frame);\n if (!first) first = dot;\n if (previous) push(new window.Line(previous, point, { stroke: color.stroke, strokeWidth: 3, roughness: .5 }), frame);\n previous = point;\n });\n } else {\n const barWidth = Math.max(18, slot * .7 / chart.series.length);\n series.values.forEach((value, index) => {\n const barHeight = Math.max(8, Math.abs(value) / maximum * plotHeight);\n const x = left + slot * index + slot * .15 + seriesIndex * barWidth;\n const bar = push(new window.Rectangle(x, top + plotHeight - barHeight, barWidth, barHeight, {\n stroke: color.stroke, strokeWidth: 1.5, fill: color.fill, fillStyle: 'solid', roughness: .7,\n label: `${chart.categories[index] || index + 1}\\n${value}`, labelColor: '#343832', labelFontSize: 11,\n }), frame);\n if (!first) first = bar;\n });\n }\n });\n if (first?.selectShape) { window.currentShape = first; first.selectShape(); }\n return true;\n}\n"],
5
+ "mappings": ";;;AASA,IAAM,KAAK;AACX,IAAM,UAAU;AAAA,EACZ,EAAE,MAAM,WAAW,QAAQ,UAAU;AAAA,EACrC,EAAE,MAAM,WAAW,QAAQ,UAAU;AAAA,EACrC,EAAE,MAAM,WAAW,QAAQ,UAAU;AAAA,EACrC,EAAE,MAAM,WAAW,QAAQ,UAAU;AAAA,EACrC,EAAE,MAAM,WAAW,QAAQ,UAAU;AAAA,EACrC,EAAE,MAAM,WAAW,QAAQ,UAAU;AACzC;AAEA,SAAS,UAAU,OAAO;AACtB,SAAO,OAAO,SAAS,EAAE,EACpB,QAAQ,MAAM,OAAO,EACrB,QAAQ,MAAM,MAAM,EACpB,QAAQ,MAAM,MAAM,EACpB,QAAQ,MAAM,QAAQ;AAC/B;AAEA,SAAS,SAAS;AACd,SAAO,OAAO,aAAa,eAAe,SAAS,MAAM,UAAU,SAAS,YAAY;AAC5F;AAEA,SAAS,QAAQ;AACb,SAAO,OAAO,IACR,EAAE,IAAI,WAAW,MAAM,WAAW,MAAM,WAAW,OAAO,WAAW,OAAO,UAAU,IACtF,EAAE,IAAI,WAAW,MAAM,WAAW,MAAM,WAAW,OAAO,WAAW,OAAO,UAAU;AAChG;AAEA,SAAS,YAAY,KAAK;AACtB,SAAO,IAAI,MAAM,IAAI,EAAE,IAAI,UAAQ,KAAK,KAAK,CAAC,EAAE,OAAO,UAAQ,QAAQ,CAAC,KAAK,WAAW,IAAI,CAAC;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AQ,CAAC;AAAA,EAAK,KAAK;AAAA,UAAI,YAAY;AAAA,UAAW,eAAe;AAAA,QACtG,CAAC,GAAG,KAAK;AACT,YAAI,CAAC,MAAO,SAAQ;AAAA,MACxB,CAAC;AAAA,IACL;AAAA,EACJ,CAAC;AACD,MAAI,OAAO,aAAa;AAAE,WAAO,eAAe;AAAO,UAAM,YAAY;AAAA,EAAG;AAC5E,SAAO;AACX;",
6
+ "names": ["title"]
7
+ }
@@ -30,7 +30,7 @@ import "./chunk-BZE4CEBG.js";
30
30
  import "./chunk-L5OARZJ7.js";
31
31
  import {
32
32
  TextShape
33
- } from "./chunk-QXFBG7OM.js";
33
+ } from "./chunk-42O6W7DF.js";
34
34
 
35
35
  // src/core/SceneSerializer.js
36
36
  var FORMAT_VERSION = 1;
@@ -736,4 +736,4 @@ export {
736
736
  uploadScene,
737
737
  validateScene
738
738
  };
739
- //# sourceMappingURL=SceneSerializer-4U4B24JM.js.map
739
+ //# sourceMappingURL=SceneSerializer-ZPHV6IUP.js.map
@@ -165,7 +165,7 @@ var SketchEngine = class {
165
165
  import("./Circle-KPG7TKIX.js"),
166
166
  import("./Arrow-BJDAXPMH.js"),
167
167
  import("./Line-2KOQEEGA.js"),
168
- import("./TextShape-54ZJ66E3.js"),
168
+ import("./TextShape-U6ZZKB35.js"),
169
169
  import("./CodeShape-K4DIZAIV.js"),
170
170
  import("./ImageShape-CHHGBXUQ.js"),
171
171
  import("./IconShape-KMIA6T2H.js"),
@@ -210,7 +210,7 @@ var SketchEngine = class {
210
210
  import("./circleTool-NUATSEI2.js"),
211
211
  import("./arrowTool-CWEMIRXK.js"),
212
212
  import("./lineTool-WNI5EMZ5.js"),
213
- import("./textTool-KY4AYUTC.js"),
213
+ import("./textTool-HY5NMM7H.js"),
214
214
  import("./codeTool-MHCB2FNB.js"),
215
215
  import("./imageTool-D5R4XGEU.js"),
216
216
  import("./iconTool-GPZ7O7NH.js"),
@@ -239,11 +239,11 @@ var SketchEngine = class {
239
239
  resizeShapes,
240
240
  resizeCode
241
241
  ] = await Promise.all([
242
- import("./EventDispatcher-AD2BPPPS.js"),
242
+ import("./EventDispatcher-BZQRHROG.js"),
243
243
  import("./UndoRedo-M2JZUBKN.js"),
244
244
  import("./Selection-VVUHY5YJ.js"),
245
245
  import("./ZoomPan-NYPDJBD5.js"),
246
- import("./CopyPaste-4CKJRHJ3.js"),
246
+ import("./CopyPaste-SA72NDFN.js"),
247
247
  import("./EraserTrail-PA6IQLQN.js"),
248
248
  import("./ResizeShapes-LKEQTITP.js"),
249
249
  import("./ResizeCode-WAMDTKSW.js")
@@ -262,7 +262,7 @@ var SketchEngine = class {
262
262
  eventDispatcher.initEventDispatcher(this.svg);
263
263
  }
264
264
  window.__sketchInteractionReady = true;
265
- const sceneSerializer = await import("./SceneSerializer-4U4B24JM.js");
265
+ const sceneSerializer = await import("./SceneSerializer-ZPHV6IUP.js");
266
266
  if (sceneSerializer.initSceneSerializer) sceneSerializer.initSceneSerializer();
267
267
  await Promise.all([
268
268
  import("./eraserTool-2GS2LQCS.js"),
@@ -275,7 +275,7 @@ var SketchEngine = class {
275
275
  if (selection.multiSelection) window.multiSelection = selection.multiSelection;
276
276
  if (selection.clearAllSelections) window.clearAllSelections = selection.clearAllSelections;
277
277
  if (copyPaste.initCopyPaste) copyPaste.initCopyPaste();
278
- const aiRenderer = await import("./AIRenderer-46WIFF2B.js");
278
+ const aiRenderer = await import("./AIRenderer-PWWLWI6U.js");
279
279
  if (aiRenderer.initAIRenderer) aiRenderer.initAIRenderer();
280
280
  const graphEngine = await import("./GraphEngine-IHRVGUGG.js");
281
281
  if (graphEngine.initGraphEngine) graphEngine.initGraphEngine();
@@ -414,4 +414,4 @@ export {
414
414
  SketchEngine,
415
415
  SketchEngine_default as default
416
416
  };
417
- //# sourceMappingURL=SketchEngine-XWWTA2MT.js.map
417
+ //# sourceMappingURL=SketchEngine-NPF2XN6Z.js.map
@@ -0,0 +1,8 @@
1
+ "use client";
2
+ import {
3
+ TextShape
4
+ } from "./chunk-42O6W7DF.js";
5
+ export {
6
+ TextShape
7
+ };
8
+ //# sourceMappingURL=TextShape-U6ZZKB35.js.map
@@ -27,9 +27,26 @@ function deselectElement() {
27
27
  function selectElement(el) {
28
28
  selectedElement = el;
29
29
  }
30
+ function removeLegacySoftWrap(groupElement) {
31
+ const textElement = groupElement.querySelector("text");
32
+ if (!textElement || !textElement.hasAttribute("data-wrap-width")) return;
33
+ const source = textElement.getAttribute("data-wrap-source");
34
+ if (source === null) return;
35
+ while (textElement.firstChild) textElement.removeChild(textElement.firstChild);
36
+ const x = textElement.getAttribute("x") || 0;
37
+ source.split("\n").forEach((line, index) => {
38
+ const tspan = textElement.ownerDocument.createElementNS("http://www.w3.org/2000/svg", "tspan");
39
+ tspan.setAttribute("x", x);
40
+ tspan.setAttribute("dy", index === 0 ? "0" : "1.2em");
41
+ tspan.textContent = line || " ";
42
+ textElement.appendChild(tspan);
43
+ });
44
+ textElement.removeAttribute("data-wrap-width");
45
+ }
30
46
  var TextShape = class {
31
47
  constructor(groupElement) {
32
48
  this.group = groupElement;
49
+ removeLegacySoftWrap(groupElement);
33
50
  this.shapeName = "text";
34
51
  this.shapeID = groupElement.getAttribute("id") || `text-${String(Date.now()).slice(0, 8)}-${Math.floor(Math.random() * 1e4)}`;
35
52
  this.parentFrame = null;
@@ -188,4 +205,4 @@ var TextShape = class {
188
205
  export {
189
206
  TextShape
190
207
  };
191
- //# sourceMappingURL=chunk-QXFBG7OM.js.map
208
+ //# sourceMappingURL=chunk-42O6W7DF.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/shapes/TextShape.js"],
4
+ "sourcesContent": ["/* eslint-disable */\n// TextShape class - extracted from writeText.js\n// Depends on globals: svg, shapes, currentShape\n\nfunction extractRotationFromTransform(el) {\n const t = el.getAttribute(\"transform\") || \"\";\n const m = t.match(/rotate\\(([^,)]+)/);\n return m ? parseFloat(m[1]) : 0;\n}\nfunction updateAttachedArrows(wrapper) {\n if (!wrapper || typeof shapes === \"undefined\") return;\n shapes.forEach(s => {\n if (s && s.shapeName === \"arrow\" && typeof s.updateAttachments === \"function\") {\n if ((s.attachedToStart && s.attachedToStart.shape === wrapper) ||\n (s.attachedToEnd && s.attachedToEnd.shape === wrapper)) {\n s.updateAttachments();\n }\n }\n });\n}\nlet isDragging = false;\nlet hoveredFrameText = null;\nlet selectedElement = null;\nfunction updateSelectionFeedback() {}\nfunction deselectElement() { selectedElement = null; }\nfunction selectElement(el) { selectedElement = el; }\n\nfunction removeLegacySoftWrap(groupElement) {\n const textElement = groupElement.querySelector('text');\n if (!textElement || !textElement.hasAttribute('data-wrap-width')) return;\n const source = textElement.getAttribute('data-wrap-source');\n if (source === null) return;\n\n while (textElement.firstChild) textElement.removeChild(textElement.firstChild);\n const x = textElement.getAttribute('x') || 0;\n source.split('\\n').forEach((line, index) => {\n const tspan = textElement.ownerDocument.createElementNS('http://www.w3.org/2000/svg', 'tspan');\n tspan.setAttribute('x', x);\n tspan.setAttribute('dy', index === 0 ? '0' : '1.2em');\n tspan.textContent = line || ' ';\n textElement.appendChild(tspan);\n });\n textElement.removeAttribute('data-wrap-width');\n}\n\nclass TextShape {\n constructor(groupElement) {\n this.group = groupElement;\n removeLegacySoftWrap(groupElement);\n this.shapeName = 'text';\n this.shapeID = groupElement.getAttribute('id') || `text-${String(Date.now()).slice(0, 8)}-${Math.floor(Math.random() * 10000)}`;\n \n // Frame attachment properties\n this.parentFrame = null;\n \n // Update group attributes \u2014 ensure data-type is set for textTool interaction\n this.group.setAttribute('type', 'text');\n this.group.setAttribute('data-type', 'text-group');\n this.group.shapeName = 'text';\n this.group.shapeID = this.shapeID;\n }\n \n // Position and dimension properties for frame compatibility\n get x() {\n const transform = this.group.transform.baseVal.consolidate();\n return transform ? transform.matrix.e : parseFloat(this.group.getAttribute('data-x')) || 0;\n }\n \n set x(value) {\n const transform = this.group.transform.baseVal.consolidate();\n const currentY = transform ? transform.matrix.f : parseFloat(this.group.getAttribute('data-y')) || 0;\n const rotation = extractRotationFromTransform(this.group) || 0;\n const textElement = this.group.querySelector('text');\n if (textElement) {\n const bbox = textElement.getBBox();\n const centerX = bbox.x + bbox.width / 2;\n const centerY = bbox.y + bbox.height / 2;\n this.group.setAttribute('transform', `translate(${value}, ${currentY}) rotate(${rotation}, ${centerX}, ${centerY})`);\n } else {\n this.group.setAttribute('transform', `translate(${value}, ${currentY})`);\n }\n this.group.setAttribute('data-x', value);\n }\n \n get y() {\n const transform = this.group.transform.baseVal.consolidate();\n return transform ? transform.matrix.f : parseFloat(this.group.getAttribute('data-y')) || 0;\n }\n \n set y(value) {\n const transform = this.group.transform.baseVal.consolidate();\n const currentX = transform ? transform.matrix.e : parseFloat(this.group.getAttribute('data-x')) || 0;\n const rotation = extractRotationFromTransform(this.group) || 0;\n const textElement = this.group.querySelector('text');\n if (textElement) {\n const bbox = textElement.getBBox();\n const centerX = bbox.x + bbox.width / 2;\n const centerY = bbox.y + bbox.height / 2;\n this.group.setAttribute('transform', `translate(${currentX}, ${value}) rotate(${rotation}, ${centerX}, ${centerY})`);\n } else {\n this.group.setAttribute('transform', `translate(${currentX}, ${value})`);\n }\n this.group.setAttribute('data-y', value);\n }\n \n get width() {\n const textElement = this.group.querySelector('text');\n if (textElement) {\n return textElement.getBBox().width;\n }\n return 0;\n }\n \n set width(value) {\n // Text width is determined by content and font size, not directly settable\n // This is here for frame compatibility but doesn't change the text\n }\n \n get height() {\n const textElement = this.group.querySelector('text');\n if (textElement) {\n return textElement.getBBox().height;\n }\n return 0;\n }\n \n set height(value) {\n // Text height is determined by content and font size, not directly settable\n // This is here for frame compatibility but doesn't change the text\n }\n \n get rotation() {\n return extractRotationFromTransform(this.group) || 0;\n }\n \n set rotation(value) {\n const currentTransform = this.group.transform.baseVal.consolidate();\n const currentX = currentTransform ? currentTransform.matrix.e : 0;\n const currentY = currentTransform ? currentTransform.matrix.f : 0;\n const textElement = this.group.querySelector('text');\n if (textElement) {\n const bbox = textElement.getBBox();\n const centerX = bbox.x + bbox.width / 2;\n const centerY = bbox.y + bbox.height / 2;\n this.group.setAttribute('transform', `translate(${currentX}, ${currentY}) rotate(${value}, ${centerX}, ${centerY})`);\n }\n }\n\n move(dx, dy) {\n const currentTransform = this.group.transform.baseVal.consolidate();\n const currentX = currentTransform ? currentTransform.matrix.e : 0;\n const currentY = currentTransform ? currentTransform.matrix.f : 0;\n\n this.x = currentX + dx;\n this.y = currentY + dy;\n\n // Only update frame containment if we're actively dragging the shape itself\n // and not being moved by a parent frame\n if (isDragging && !this.isBeingMovedByFrame) {\n this.updateFrameContainment();\n }\n\n this.updateAttachedArrows();\n }\n\n updateAttachedArrows() {\n updateAttachedArrows(this);\n }\n\n updateFrameContainment() {\n // Don't update if we're being moved by a frame\n if (this.isBeingMovedByFrame) return;\n \n let targetFrame = null;\n \n // Find which frame this shape is over\n if (typeof shapes !== 'undefined' && Array.isArray(shapes)) {\n shapes.forEach(shape => {\n if (shape.shapeName === 'frame' && shape.isShapeInFrame(this)) {\n targetFrame = shape;\n }\n });\n }\n \n // If we have a parent frame and we're being dragged, temporarily remove clipping\n if (this.parentFrame && isDragging) {\n this.parentFrame.temporarilyRemoveFromFrame(this);\n }\n \n // Update frame highlighting\n if (hoveredFrameText && hoveredFrameText !== targetFrame) {\n hoveredFrameText.removeHighlight();\n }\n \n if (targetFrame && targetFrame !== hoveredFrameText) {\n targetFrame.highlightFrame();\n }\n \n hoveredFrameText = targetFrame;\n }\n\n contains(x, y) {\n const textElement = this.group.querySelector('text');\n if (!textElement || typeof textElement.getBBox !== 'function') return false;\n\n let bbox;\n try { bbox = textElement.getBBox(); } catch { return false; }\n const padding = 8; // Selection padding\n\n const CTM = this.group.getCTM();\n if (!CTM) return false;\n \n const inverseCTM = CTM.inverse();\n const svgPoint = svg.createSVGPoint();\n svgPoint.x = x;\n svgPoint.y = y;\n const transformedPoint = svgPoint.matrixTransform(inverseCTM);\n \n return transformedPoint.x >= bbox.x - padding && \n transformedPoint.x <= bbox.x + bbox.width + padding &&\n transformedPoint.y >= bbox.y - padding && \n transformedPoint.y <= bbox.y + bbox.height + padding;\n }\n\n // Add draw method for consistency with other shapes\n draw() {\n // Text doesn't need redrawing like other shapes, but we need this method for consistency\n if (selectedElement === this.group) {\n updateSelectionFeedback();\n }\n }\n\n // Add methods for frame compatibility\n removeSelection() {\n if (selectedElement === this.group) {\n deselectElement();\n }\n }\n\n selectShape() {\n // Use the real textTool selectElement (with selection feedback) if available\n if (typeof window !== 'undefined' && window.__selectTextElement) {\n window.__selectTextElement(this.group);\n } else {\n selectElement(this.group);\n }\n }\n}\n\nexport { TextShape };\n"],
5
+ "mappings": ";;;AAIA,SAAS,6BAA6B,IAAI;AACtC,QAAM,IAAI,GAAG,aAAa,WAAW,KAAK;AAC1C,QAAM,IAAI,EAAE,MAAM,kBAAkB;AACpC,SAAO,IAAI,WAAW,EAAE,CAAC,CAAC,IAAI;AAClC;AACA,SAAS,qBAAqB,SAAS;AACnC,MAAI,CAAC,WAAW,OAAO,WAAW,YAAa;AAC/C,SAAO,QAAQ,OAAK;AAChB,QAAI,KAAK,EAAE,cAAc,WAAW,OAAO,EAAE,sBAAsB,YAAY;AAC3E,UAAK,EAAE,mBAAmB,EAAE,gBAAgB,UAAU,WACjD,EAAE,iBAAiB,EAAE,cAAc,UAAU,SAAU;AACxD,UAAE,kBAAkB;AAAA,MACxB;AAAA,IACJ;AAAA,EACJ,CAAC;AACL;AACA,IAAI,aAAa;AACjB,IAAI,mBAAmB;AACvB,IAAI,kBAAkB;AACtB,SAAS,0BAA0B;AAAC;AACpC,SAAS,kBAAkB;AAAE,oBAAkB;AAAM;AACrD,SAAS,cAAc,IAAI;AAAE,oBAAkB;AAAI;AAEnD,SAAS,qBAAqB,cAAc;AACxC,QAAM,cAAc,aAAa,cAAc,MAAM;AACrD,MAAI,CAAC,eAAe,CAAC,YAAY,aAAa,iBAAiB,EAAG;AAClE,QAAM,SAAS,YAAY,aAAa,kBAAkB;AAC1D,MAAI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