@elixpo/lixsketch 5.5.14 → 5.5.16

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 (32) hide show
  1. package/dist/react/{AIRenderer-ATIKGFB4.js → AIRenderer-HI7TYROT.js} +2 -2
  2. package/dist/react/Arrow-EF7ALH2Y.js +8 -0
  3. package/dist/react/{CopyPaste-UTU5MPKY.js → CopyPaste-AAHQTNVL.js} +4 -4
  4. package/dist/react/{Frame-6UR5XPAX.js → Frame-WPQZQLNT.js} +2 -2
  5. package/dist/react/{MermaidStructuredRenderer-26WGA6YD.js → MermaidStructuredRenderer-H42SKKN2.js} +28 -9
  6. package/dist/react/{MermaidStructuredRenderer-26WGA6YD.js.map → MermaidStructuredRenderer-H42SKKN2.js.map} +2 -2
  7. package/dist/react/Rectangle-2LNCIQDZ.js +8 -0
  8. package/dist/react/{SceneSerializer-34VQFJN7.js → SceneSerializer-YK44QZ6B.js} +4 -4
  9. package/dist/react/{SketchEngine-P3XNZA56.js → SketchEngine-B7XCB3BS.js} +7 -7
  10. package/dist/react/{chunk-Z4YVT54E.js → chunk-24TW3M7X.js} +11 -1
  11. package/dist/react/chunk-24TW3M7X.js.map +7 -0
  12. package/dist/react/{chunk-BU4D2WYQ.js → chunk-2AYTBFV5.js} +19 -1
  13. package/dist/react/{chunk-BU4D2WYQ.js.map → chunk-2AYTBFV5.js.map} +2 -2
  14. package/dist/react/{chunk-XISEAGBV.js → chunk-BT2EIJD4.js} +24 -5
  15. package/dist/react/chunk-BT2EIJD4.js.map +7 -0
  16. package/dist/react/index.js +2 -2
  17. package/package.json +1 -1
  18. package/src/core/MermaidStructuredRenderer.js +33 -9
  19. package/src/shapes/Arrow.js +27 -5
  20. package/src/shapes/Frame.js +22 -0
  21. package/src/shapes/Rectangle.js +14 -1
  22. package/dist/react/Arrow-BJDAXPMH.js +0 -8
  23. package/dist/react/Rectangle-2F7BAXG4.js +0 -8
  24. package/dist/react/chunk-XISEAGBV.js.map +0 -7
  25. package/dist/react/chunk-Z4YVT54E.js.map +0 -7
  26. /package/dist/react/{AIRenderer-ATIKGFB4.js.map → AIRenderer-HI7TYROT.js.map} +0 -0
  27. /package/dist/react/{Arrow-BJDAXPMH.js.map → Arrow-EF7ALH2Y.js.map} +0 -0
  28. /package/dist/react/{CopyPaste-UTU5MPKY.js.map → CopyPaste-AAHQTNVL.js.map} +0 -0
  29. /package/dist/react/{Frame-6UR5XPAX.js.map → Frame-WPQZQLNT.js.map} +0 -0
  30. /package/dist/react/{Rectangle-2F7BAXG4.js.map → Rectangle-2LNCIQDZ.js.map} +0 -0
  31. /package/dist/react/{SceneSerializer-34VQFJN7.js.map → SceneSerializer-YK44QZ6B.js.map} +0 -0
  32. /package/dist/react/{SketchEngine-P3XNZA56.js.map → SketchEngine-B7XCB3BS.js.map} +0 -0
@@ -1156,7 +1156,7 @@ function initAIRenderer() {
1156
1156
  }
1157
1157
  async function loadStructuredRenderer() {
1158
1158
  if (_structured) return;
1159
- _structured = await import("./MermaidStructuredRenderer-26WGA6YD.js");
1159
+ _structured = await import("./MermaidStructuredRenderer-H42SKKN2.js");
1160
1160
  }
1161
1161
  function mermaidHeader(src) {
1162
1162
  return src.split("\n").map((line) => line.trim()).find((line) => line && !line.startsWith("%%"))?.toLowerCase() || "";
@@ -1252,4 +1252,4 @@ export {
1252
1252
  parseMermaid,
1253
1253
  renderAIDiagram
1254
1254
  };
1255
- //# sourceMappingURL=AIRenderer-ATIKGFB4.js.map
1255
+ //# sourceMappingURL=AIRenderer-HI7TYROT.js.map
@@ -0,0 +1,8 @@
1
+ "use client";
2
+ import {
3
+ Arrow
4
+ } from "./chunk-BT2EIJD4.js";
5
+ export {
6
+ Arrow
7
+ };
8
+ //# sourceMappingURL=Arrow-EF7ALH2Y.js.map
@@ -10,7 +10,7 @@ import {
10
10
  } from "./chunk-JQ3IRFDP.js";
11
11
  import {
12
12
  Frame
13
- } from "./chunk-BU4D2WYQ.js";
13
+ } from "./chunk-2AYTBFV5.js";
14
14
  import {
15
15
  FreehandStroke
16
16
  } from "./chunk-HKYUJUD7.js";
@@ -20,13 +20,13 @@ import {
20
20
  } from "./chunk-DNAG7ML6.js";
21
21
  import {
22
22
  Rectangle
23
- } from "./chunk-Z4YVT54E.js";
23
+ } from "./chunk-24TW3M7X.js";
24
24
  import {
25
25
  Circle
26
26
  } from "./chunk-GZ6NPDAB.js";
27
27
  import {
28
28
  Arrow
29
- } from "./chunk-XISEAGBV.js";
29
+ } from "./chunk-BT2EIJD4.js";
30
30
  import {
31
31
  Line
32
32
  } from "./chunk-6PFXZKL2.js";
@@ -570,4 +570,4 @@ export {
570
570
  initCopyPaste,
571
571
  pasteClipboard
572
572
  };
573
- //# sourceMappingURL=CopyPaste-UTU5MPKY.js.map
573
+ //# sourceMappingURL=CopyPaste-AAHQTNVL.js.map
@@ -1,10 +1,10 @@
1
1
  "use client";
2
2
  import {
3
3
  Frame
4
- } from "./chunk-BU4D2WYQ.js";
4
+ } from "./chunk-2AYTBFV5.js";
5
5
  import "./chunk-BZE4CEBG.js";
6
6
  import "./chunk-L5OARZJ7.js";
7
7
  export {
8
8
  Frame
9
9
  };
10
- //# sourceMappingURL=Frame-6UR5XPAX.js.map
10
+ //# sourceMappingURL=Frame-WPQZQLNT.js.map
@@ -308,10 +308,12 @@ function renderEROnCanvas(diagram) {
308
308
  strokeWidth: 1.5,
309
309
  fill: entity.color.fill,
310
310
  fillStyle: "solid",
311
- roughness: 1,
311
+ roughness: 0,
312
+ fillWeight: 0.5,
312
313
  label: entity.name,
313
314
  labelColor: contrastText(entity.color.fill),
314
- labelFontSize: 15
315
+ labelFontSize: 15,
316
+ labelBg: false
315
317
  }), frame);
316
318
  if (!first) first = header;
317
319
  entityShapes.set(entity.name, { shape: header, x, y, width: entity.width, height: entity.headerHeight });
@@ -326,10 +328,12 @@ function renderEROnCanvas(diagram) {
326
328
  strokeWidth: 1,
327
329
  fill: TK.panel,
328
330
  fillStyle: "solid",
329
- roughness: 0.4,
331
+ roughness: 0,
332
+ fillWeight: 0.5,
330
333
  label: [attribute.type, attribute.name, attribute.key].filter(Boolean).join(" "),
331
334
  labelColor: TK.text,
332
- labelFontSize: 11
335
+ labelFontSize: 11,
336
+ labelBg: false
333
337
  }
334
338
  ), frame));
335
339
  }
@@ -337,14 +341,18 @@ function renderEROnCanvas(diagram) {
337
341
  const from = entityShapes.get(relation.from);
338
342
  const to = entityShapes.get(relation.to);
339
343
  if (!from || !to) continue;
340
- const start = { x: from.x + from.width / 2, y: from.y + from.height / 2 };
341
- const end = { x: to.x + to.width / 2, y: to.y + to.height / 2 };
344
+ const fromCenter = { x: from.x + from.width / 2, y: from.y + from.height / 2 };
345
+ const toCenter = { x: to.x + to.width / 2, y: to.y + to.height / 2 };
346
+ const start = rectBoundaryPoint(from, toCenter);
347
+ const end = rectBoundaryPoint(to, fromCenter);
342
348
  const arrow = push(new window.Arrow(start, end, {
343
349
  stroke: TK.line,
344
350
  strokeWidth: 1.5,
345
- roughness: 1,
351
+ roughness: 0,
346
352
  label: `${relation.fromCardinality} ${relation.label} ${relation.toCardinality}`,
347
- labelColor: TK.text
353
+ labelColor: TK.text,
354
+ labelBg: false,
355
+ labelOffsetY: -12
348
356
  }), frame);
349
357
  if (arrow && window.__autoAttach) {
350
358
  window.__autoAttach(arrow, from.shape, true, start);
@@ -357,6 +365,17 @@ function renderEROnCanvas(diagram) {
357
365
  }
358
366
  return true;
359
367
  }
368
+ function rectBoundaryPoint(box, target) {
369
+ const cx = box.x + box.width / 2;
370
+ const cy = box.y + box.height / 2;
371
+ const dx = target.x - cx;
372
+ const dy = target.y - cy;
373
+ const hw = box.width / 2;
374
+ const hh = box.height / 2;
375
+ if (dx === 0 && dy === 0) return { x: cx, y: cy };
376
+ const scale = 1 / Math.max(Math.abs(dx) / hw, Math.abs(dy) / hh);
377
+ return { x: cx + dx * scale, y: cy + dy * scale };
378
+ }
360
379
  function renderChartOnCanvas(chart) {
361
380
  if (!chart?.series?.length || !window.Rectangle || !window.Circle || !window.Line || !window.FreehandStroke || !window.Frame) return false;
362
381
  if (chart.kind === "pie") return renderPieOnCanvas(chart);
@@ -489,4 +508,4 @@ export {
489
508
  renderEROnCanvas,
490
509
  renderERPreviewSVG
491
510
  };
492
- //# sourceMappingURL=MermaidStructuredRenderer-26WGA6YD.js.map
511
+ //# sourceMappingURL=MermaidStructuredRenderer-H42SKKN2.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
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: '#8b7abb', stroke: '#665793' },\n { fill: '#a992cf', stroke: '#7762a6' },\n { fill: '#c2addc', stroke: '#8974aa' },\n { fill: '#7765a6', stroke: '#584883' },\n { fill: '#9d83c1', stroke: '#725b9a' },\n { fill: '#d1c3e7', stroke: '#927daf' },\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 contrastText(fill) {\n const raw = String(fill || '').replace('#', '');\n const hex = raw.length === 3 ? raw.split('').map(char => char + char).join('') : raw;\n if (!/^[0-9a-f]{6}$/i.test(hex)) return theme().text;\n const red = parseInt(hex.slice(0, 2), 16);\n const green = parseInt(hex.slice(2, 4), 16);\n const blue = parseInt(hex.slice(4, 6), 16);\n const luminance = .299 * red + .587 * green + .114 * blue;\n return luminance > 145 ? '#34304a' : '#ffffff';\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=\"${contrastText(entity.color.fill)}\" 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\n if (chart.kind === 'pie') {\n const values = chart.series[0].values.map(value => Math.max(0, value));\n const total = values.reduce((sum, value) => sum + value, 0);\n if (total <= 0) return '';\n const cx = 255;\n const cy = 235;\n const radius = 145;\n let startAngle = -Math.PI / 2;\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\n values.forEach((value, index) => {\n const endAngle = startAngle + value / total * Math.PI * 2;\n const x1 = cx + Math.cos(startAngle) * radius;\n const y1 = cy + Math.sin(startAngle) * radius;\n const x2 = cx + Math.cos(endAngle) * radius;\n const y2 = cy + Math.sin(endAngle) * radius;\n const largeArc = endAngle - startAngle > Math.PI ? 1 : 0;\n const color = PALETTE[index % PALETTE.length];\n content += `<path d=\"M ${cx} ${cy} L ${x1} ${y1} A ${radius} ${radius} 0 ${largeArc} 1 ${x2} ${y2} Z\" fill=\"${color.fill}\" stroke=\"${TK.bg}\" stroke-width=\"3\"/>`;\n const percent = Math.round(value / total * 100);\n const legendY = 125 + index * 42;\n content += `<rect x=\"460\" y=\"${legendY - 14}\" width=\"18\" height=\"18\" rx=\"4\" fill=\"${color.fill}\" stroke=\"${color.stroke}\"/><text x=\"488\" y=\"${legendY}\" fill=\"${TK.text}\" font-size=\"12\" font-family=\"lixFont\">${escapeXml(chart.categories[index] || index + 1)} \u2014 ${value} (${percent}%)</text>`;\n startAngle = endAngle;\n });\n return `<svg xmlns=\"${NS}\" width=\"600\" height=\"450\" viewBox=\"0 0 ${width} ${height}\">${content}</svg>`;\n }\n\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 pushText(text, x, y, fontSize, fill, frame) {\n if (!window.TextShape || !window.svg) return null;\n const group = document.createElementNS(NS, 'g');\n group.setAttribute('data-type', 'text-group');\n group.setAttribute('transform', `translate(${x}, ${y})`);\n group.setAttribute('data-x', x);\n group.setAttribute('data-y', y);\n\n const element = document.createElementNS(NS, 'text');\n element.setAttribute('x', 0);\n element.setAttribute('y', 0);\n element.setAttribute('dominant-baseline', 'central');\n element.setAttribute('fill', fill);\n element.setAttribute('font-size', fontSize);\n element.setAttribute('font-family', 'lixFont, sans-serif');\n element.setAttribute('data-initial-font', 'lixFont');\n element.setAttribute('data-initial-color', fill);\n element.setAttribute('data-initial-size', `${fontSize}px`);\n element.textContent = text;\n group.appendChild(element);\n window.svg.appendChild(group);\n return push(new window.TextShape(group), frame);\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\nfunction selectOnlyFrame(frame) {\n if (!frame) return;\n if (window.multiSelection?.clearSelection) window.multiSelection.clearSelection();\n if (window.currentShape && window.currentShape !== frame && typeof window.currentShape.removeSelection === 'function') {\n window.currentShape.removeSelection();\n }\n if (window.__deselectTextElement) window.__deselectTextElement();\n window.currentShape = frame;\n if (typeof frame.selectFrame === 'function') frame.selectFrame();\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: contrastText(entity.color.fill), 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.FreehandStroke || !window.Frame) return false;\n if (chart.kind === 'pie') return renderPieOnCanvas(chart);\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 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 const linePoints = series.values.map((value, index) => {\n const point = { x: left + slot * (index + .5), y: top + plotHeight - Math.abs(value) / maximum * plotHeight };\n 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: contrastText(color.fill), labelFontSize: 9,\n }), frame);\n return [point.x, point.y, .5];\n });\n if (linePoints.length > 1) {\n push(new window.FreehandStroke(linePoints, {\n stroke: color.stroke,\n strokeWidth: 3,\n thinning: 0,\n roughness: 0,\n strokeStyle: 'solid',\n }), frame);\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 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: contrastText(color.fill), labelFontSize: 11,\n }), frame);\n });\n }\n });\n selectOnlyFrame(frame);\n return true;\n}\n\nfunction renderPieOnCanvas(chart) {\n if (!window.FreehandStroke || !window.TextShape) return false;\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-pie');\n const values = chart.series[0].values.map(value => Math.max(0, value));\n const total = values.reduce((sum, value) => sum + value, 0);\n if (total <= 0) return false;\n\n const cx = origin.x + 255;\n const cy = origin.y + 235;\n const radius = 145;\n let startAngle = -Math.PI / 2;\n\n values.forEach((value, index) => {\n const sweep = value / total * Math.PI * 2;\n const endAngle = startAngle + sweep;\n const steps = Math.max(6, Math.ceil(sweep / (Math.PI / 60)));\n const points = [[cx, cy, .5]];\n for (let step = 0; step <= steps; step++) {\n const angle = startAngle + sweep * (step / steps);\n points.push([\n cx + Math.cos(angle) * radius,\n cy + Math.sin(angle) * radius,\n .5,\n ]);\n }\n const color = PALETTE[index % PALETTE.length];\n push(new window.FreehandStroke(points, {\n stroke: color.fill,\n strokeWidth: 3,\n outlineStroke: theme().bg,\n outlineWidth: 3,\n closedFill: true,\n roughness: 0,\n strokeStyle: 'solid',\n }), frame);\n const percent = Math.round(value / total * 100);\n const legendY = origin.y + 125 + index * 42;\n push(new window.Rectangle(origin.x + 460, legendY - 14, 18, 18, {\n stroke: color.stroke,\n strokeWidth: 1,\n fill: color.fill,\n fillStyle: 'solid',\n roughness: .5,\n }), frame);\n pushText(\n `${chart.categories[index] || index + 1} \u2014 ${value} (${percent}%)`,\n origin.x + 488,\n legendY,\n 12,\n theme().text,\n frame,\n );\n startAngle = endAngle;\n });\n\n selectOnlyFrame(frame);\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;A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AI;AAAA,QACvB,KAAK,KAAK,IAAI,KAAK,IAAI;AAAA,QACvB;AAAA,MACJ,CAAC;AAAA,IACL;AACA,UAAM,QAAQ,QAAQ,QAAQ,QAAQ,MAAM;AAC5C,SAAK,IAAI,OAAO,eAAe,QAAQ;AAAA,MACnC,QAAQ,MAAM;AAAA,MACd,aAAa;AAAA,MACb,eAAe,MAAM,EAAE;AAAA,MACvB,cAAc;AAAA,MACd,YAAY;AAAA,MACZ,WAAW;AAAA,MACX,aAAa;AAAA,IACjB,CAAC,GAAG,KAAK;AACT,UAAM,UAAU,KAAK,MAAM,QAAQ,QAAQ,GAAG;AAC9C,UAAM,UAAU,OAAO,IAAI,MAAM,QAAQ;AACzC,SAAK,IAAI,OAAO,UAAU,OAAO,IAAI,KAAK,UAAU,IAAI,IAAI,IAAI;AAAA,MAC5D,QAAQ,MAAM;AAAA,MACd,aAAa;AAAA,MACb,MAAM,MAAM;AAAA,MACZ,WAAW;AAAA,MACX,WAAW;AAAA,IACf,CAAC,GAAG,KAAK;AACT;AAAA,MACI,GAAG,MAAM,WAAW,KAAK,KAAK,QAAQ,CAAC,WAAM,KAAK,KAAK,OAAO;AAAA,MAC9D,OAAO,IAAI;AAAA,MACX;AAAA,MACA;AAAA,MACA,MAAM,EAAE;AAAA,MACR;AAAA,IACJ;AACA,iBAAa;AAAA,EACjB,CAAC;AAED,kBAAgB,KAAK;AACrB,SAAO;AACX;",
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: '#8b7abb', stroke: '#665793' },\n { fill: '#a992cf', stroke: '#7762a6' },\n { fill: '#c2addc', stroke: '#8974aa' },\n { fill: '#7765a6', stroke: '#584883' },\n { fill: '#9d83c1', stroke: '#725b9a' },\n { fill: '#d1c3e7', stroke: '#927daf' },\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 contrastText(fill) {\n const raw = String(fill || '').replace('#', '');\n const hex = raw.length === 3 ? raw.split('').map(char => char + char).join('') : raw;\n if (!/^[0-9a-f]{6}$/i.test(hex)) return theme().text;\n const red = parseInt(hex.slice(0, 2), 16);\n const green = parseInt(hex.slice(2, 4), 16);\n const blue = parseInt(hex.slice(4, 6), 16);\n const luminance = .299 * red + .587 * green + .114 * blue;\n return luminance > 145 ? '#34304a' : '#ffffff';\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=\"${contrastText(entity.color.fill)}\" 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\n if (chart.kind === 'pie') {\n const values = chart.series[0].values.map(value => Math.max(0, value));\n const total = values.reduce((sum, value) => sum + value, 0);\n if (total <= 0) return '';\n const cx = 255;\n const cy = 235;\n const radius = 145;\n let startAngle = -Math.PI / 2;\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\n values.forEach((value, index) => {\n const endAngle = startAngle + value / total * Math.PI * 2;\n const x1 = cx + Math.cos(startAngle) * radius;\n const y1 = cy + Math.sin(startAngle) * radius;\n const x2 = cx + Math.cos(endAngle) * radius;\n const y2 = cy + Math.sin(endAngle) * radius;\n const largeArc = endAngle - startAngle > Math.PI ? 1 : 0;\n const color = PALETTE[index % PALETTE.length];\n content += `<path d=\"M ${cx} ${cy} L ${x1} ${y1} A ${radius} ${radius} 0 ${largeArc} 1 ${x2} ${y2} Z\" fill=\"${color.fill}\" stroke=\"${TK.bg}\" stroke-width=\"3\"/>`;\n const percent = Math.round(value / total * 100);\n const legendY = 125 + index * 42;\n content += `<rect x=\"460\" y=\"${legendY - 14}\" width=\"18\" height=\"18\" rx=\"4\" fill=\"${color.fill}\" stroke=\"${color.stroke}\"/><text x=\"488\" y=\"${legendY}\" fill=\"${TK.text}\" font-size=\"12\" font-family=\"lixFont\">${escapeXml(chart.categories[index] || index + 1)} \u2014 ${value} (${percent}%)</text>`;\n startAngle = endAngle;\n });\n return `<svg xmlns=\"${NS}\" width=\"600\" height=\"450\" viewBox=\"0 0 ${width} ${height}\">${content}</svg>`;\n }\n\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 pushText(text, x, y, fontSize, fill, frame) {\n if (!window.TextShape || !window.svg) return null;\n const group = document.createElementNS(NS, 'g');\n group.setAttribute('data-type', 'text-group');\n group.setAttribute('transform', `translate(${x}, ${y})`);\n group.setAttribute('data-x', x);\n group.setAttribute('data-y', y);\n\n const element = document.createElementNS(NS, 'text');\n element.setAttribute('x', 0);\n element.setAttribute('y', 0);\n element.setAttribute('dominant-baseline', 'central');\n element.setAttribute('fill', fill);\n element.setAttribute('font-size', fontSize);\n element.setAttribute('font-family', 'lixFont, sans-serif');\n element.setAttribute('data-initial-font', 'lixFont');\n element.setAttribute('data-initial-color', fill);\n element.setAttribute('data-initial-size', `${fontSize}px`);\n element.textContent = text;\n group.appendChild(element);\n window.svg.appendChild(group);\n return push(new window.TextShape(group), frame);\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\nfunction selectOnlyFrame(frame) {\n if (!frame) return;\n if (window.multiSelection?.clearSelection) window.multiSelection.clearSelection();\n if (window.currentShape && window.currentShape !== frame && typeof window.currentShape.removeSelection === 'function') {\n window.currentShape.removeSelection();\n }\n if (window.__deselectTextElement) window.__deselectTextElement();\n window.currentShape = frame;\n if (typeof frame.selectFrame === 'function') frame.selectFrame();\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: 0, fillWeight: 0.5,\n label: entity.name, labelColor: contrastText(entity.color.fill), labelFontSize: 15, labelBg: false,\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: 0, fillWeight: 0.5,\n label: [attribute.type, attribute.name, attribute.key].filter(Boolean).join(' '), labelColor: TK.text, labelFontSize: 11, labelBg: false }\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 fromCenter = { x: from.x + from.width / 2, y: from.y + from.height / 2 };\n const toCenter = { x: to.x + to.width / 2, y: to.y + to.height / 2 };\n // Anchor the arrow at the actual box boundary (not the box center) so\n // it terminates at the entity edge instead of drawing through \u2014 and\n // over \u2014 the header label, and so autoAttach's nearest-side check\n // (which compares against this point) resolves to the side actually\n // facing the other entity rather than whichever side happens to be\n // closest to the geometric center on a short, wide header box.\n const start = rectBoundaryPoint(from, toCenter);\n const end = rectBoundaryPoint(to, fromCenter);\n const arrow = push(new window.Arrow(start, end, {\n stroke: TK.line, strokeWidth: 1.5, roughness: 0,\n label: `${relation.fromCardinality} ${relation.label} ${relation.toCardinality}`,\n labelColor: TK.text, labelBg: false, labelOffsetY: -12,\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\n// Intersection of the line from `box`'s center toward `target` with box's\n// own rectangular boundary. Used to anchor ER relationship arrows exactly\n// at the entity edge instead of the entity center.\nfunction rectBoundaryPoint(box, target) {\n const cx = box.x + box.width / 2;\n const cy = box.y + box.height / 2;\n const dx = target.x - cx;\n const dy = target.y - cy;\n const hw = box.width / 2;\n const hh = box.height / 2;\n if (dx === 0 && dy === 0) return { x: cx, y: cy };\n const scale = 1 / Math.max(Math.abs(dx) / hw, Math.abs(dy) / hh);\n return { x: cx + dx * scale, y: cy + dy * scale };\n}\n\nexport function renderChartOnCanvas(chart) {\n if (!chart?.series?.length || !window.Rectangle || !window.Circle || !window.Line || !window.FreehandStroke || !window.Frame) return false;\n if (chart.kind === 'pie') return renderPieOnCanvas(chart);\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 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 const linePoints = series.values.map((value, index) => {\n const point = { x: left + slot * (index + .5), y: top + plotHeight - Math.abs(value) / maximum * plotHeight };\n 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: contrastText(color.fill), labelFontSize: 9,\n }), frame);\n return [point.x, point.y, .5];\n });\n if (linePoints.length > 1) {\n push(new window.FreehandStroke(linePoints, {\n stroke: color.stroke,\n strokeWidth: 3,\n thinning: 0,\n roughness: 0,\n strokeStyle: 'solid',\n }), frame);\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 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: contrastText(color.fill), labelFontSize: 11,\n }), frame);\n });\n }\n });\n selectOnlyFrame(frame);\n return true;\n}\n\nfunction renderPieOnCanvas(chart) {\n if (!window.FreehandStroke || !window.TextShape) return false;\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-pie');\n const values = chart.series[0].values.map(value => Math.max(0, value));\n const total = values.reduce((sum, value) => sum + value, 0);\n if (total <= 0) return false;\n\n const cx = origin.x + 255;\n const cy = origin.y + 235;\n const radius = 145;\n let startAngle = -Math.PI / 2;\n\n values.forEach((value, index) => {\n const sweep = value / total * Math.PI * 2;\n const endAngle = startAngle + sweep;\n const steps = Math.max(6, Math.ceil(sweep / (Math.PI / 60)));\n const points = [[cx, cy, .5]];\n for (let step = 0; step <= steps; step++) {\n const angle = startAngle + sweep * (step / steps);\n points.push([\n cx + Math.cos(angle) * radius,\n cy + Math.sin(angle) * radius,\n .5,\n ]);\n }\n const color = PALETTE[index % PALETTE.length];\n push(new window.FreehandStroke(points, {\n stroke: color.fill,\n strokeWidth: 3,\n outlineStroke: theme().bg,\n outlineWidth: 3,\n closedFill: true,\n roughness: 0,\n strokeStyle: 'solid',\n }), frame);\n const percent = Math.round(value / total * 100);\n const legendY = origin.y + 125 + index * 42;\n push(new window.Rectangle(origin.x + 460, legendY - 14, 18, 18, {\n stroke: color.stroke,\n strokeWidth: 1,\n fill: color.fill,\n fillStyle: 'solid',\n roughness: .5,\n }), frame);\n pushText(\n `${chart.categories[index] || index + 1} \u2014 ${value} (${percent}%)`,\n origin.x + 488,\n legendY,\n 12,\n theme().text,\n frame,\n );\n startAngle = endAngle;\n });\n\n selectOnlyFrame(frame);\n return true;\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,EA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AAA,IACf,CAAC,GAAG,KAAK;AACT;AAAA,MACI,GAAG,MAAM,WAAW,KAAK,KAAK,QAAQ,CAAC,WAAM,KAAK,KAAK,OAAO;AAAA,MAC9D,OAAO,IAAI;AAAA,MACX;AAAA,MACA;AAAA,MACA,MAAM,EAAE;AAAA,MACR;AAAA,IACJ;AACA,iBAAa;AAAA,EACjB,CAAC;AAED,kBAAgB,KAAK;AACrB,SAAO;AACX;",
6
6
  "names": ["title", "values", "content"]
7
7
  }
@@ -0,0 +1,8 @@
1
+ "use client";
2
+ import {
3
+ Rectangle
4
+ } from "./chunk-24TW3M7X.js";
5
+ export {
6
+ Rectangle
7
+ };
8
+ //# sourceMappingURL=Rectangle-2LNCIQDZ.js.map
@@ -10,19 +10,19 @@ import {
10
10
  } from "./chunk-JQ3IRFDP.js";
11
11
  import {
12
12
  Frame
13
- } from "./chunk-BU4D2WYQ.js";
13
+ } from "./chunk-2AYTBFV5.js";
14
14
  import {
15
15
  FreehandStroke
16
16
  } from "./chunk-HKYUJUD7.js";
17
17
  import {
18
18
  Rectangle
19
- } from "./chunk-Z4YVT54E.js";
19
+ } from "./chunk-24TW3M7X.js";
20
20
  import {
21
21
  Circle
22
22
  } from "./chunk-GZ6NPDAB.js";
23
23
  import {
24
24
  Arrow
25
- } from "./chunk-XISEAGBV.js";
25
+ } from "./chunk-BT2EIJD4.js";
26
26
  import {
27
27
  Line
28
28
  } from "./chunk-6PFXZKL2.js";
@@ -736,4 +736,4 @@ export {
736
736
  uploadScene,
737
737
  validateScene
738
738
  };
739
- //# sourceMappingURL=SceneSerializer-34VQFJN7.js.map
739
+ //# sourceMappingURL=SceneSerializer-YK44QZ6B.js.map
@@ -161,15 +161,15 @@ var SketchEngine = class {
161
161
  { Frame },
162
162
  { FreehandStroke }
163
163
  ] = await Promise.all([
164
- import("./Rectangle-2F7BAXG4.js"),
164
+ import("./Rectangle-2LNCIQDZ.js"),
165
165
  import("./Circle-ZH76FPOR.js"),
166
- import("./Arrow-BJDAXPMH.js"),
166
+ import("./Arrow-EF7ALH2Y.js"),
167
167
  import("./Line-2KOQEEGA.js"),
168
168
  import("./TextShape-QRDG4P7F.js"),
169
169
  import("./CodeShape-TE74XP5V.js"),
170
170
  import("./ImageShape-CHHGBXUQ.js"),
171
171
  import("./IconShape-KMIA6T2H.js"),
172
- import("./Frame-6UR5XPAX.js"),
172
+ import("./Frame-WPQZQLNT.js"),
173
173
  import("./FreehandStroke-BOWDNAVC.js")
174
174
  ]);
175
175
  window.Rectangle = Rectangle;
@@ -243,7 +243,7 @@ var SketchEngine = class {
243
243
  import("./UndoRedo-M2JZUBKN.js"),
244
244
  import("./Selection-XLRY6VYO.js"),
245
245
  import("./ZoomPan-NYPDJBD5.js"),
246
- import("./CopyPaste-UTU5MPKY.js"),
246
+ import("./CopyPaste-AAHQTNVL.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-34VQFJN7.js");
265
+ const sceneSerializer = await import("./SceneSerializer-YK44QZ6B.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-ATIKGFB4.js");
278
+ const aiRenderer = await import("./AIRenderer-HI7TYROT.js");
279
279
  if (aiRenderer.initAIRenderer) aiRenderer.initAIRenderer();
280
280
  const graphEngine = await import("./GraphEngine-KQXHNTZQ.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-P3XNZA56.js.map
417
+ //# sourceMappingURL=SketchEngine-B7XCB3BS.js.map
@@ -41,6 +41,7 @@ var Rectangle = class {
41
41
  this.labelElement = null;
42
42
  this.labelColor = options.labelColor || "#e0e0e0";
43
43
  this.labelFontSize = options.labelFontSize || 14;
44
+ this.labelBg = options.labelBg !== false;
44
45
  this._isEditingLabel = false;
45
46
  this._hitArea = null;
46
47
  this._labelBg = null;
@@ -202,6 +203,15 @@ var Rectangle = class {
202
203
  this.labelElement.setAttribute("font-size", this.labelFontSize);
203
204
  this.labelElement.setAttribute("font-family", "lixFont, sans-serif");
204
205
  this.labelElement.textContent = this.label;
206
+ if (!this.labelBg) {
207
+ if (this._labelBg && this._labelBg.parentNode === this.group) {
208
+ this.group.removeChild(this._labelBg);
209
+ this._labelBg = null;
210
+ }
211
+ if (this.labelElement.parentNode === this.group) this.group.removeChild(this.labelElement);
212
+ this.group.appendChild(this.labelElement);
213
+ return;
214
+ }
205
215
  const canvasBg = window.getComputedStyle(svg).backgroundColor || "#000";
206
216
  if (!this._labelBg) {
207
217
  this._labelBg = document.createElementNS("http://www.w3.org/2000/svg", "rect");
@@ -713,4 +723,4 @@ var Rectangle = class {
713
723
  export {
714
724
  Rectangle
715
725
  };
716
- //# sourceMappingURL=chunk-Z4YVT54E.js.map
726
+ //# sourceMappingURL=chunk-24TW3M7X.js.map