@elixpo/lixsketch 5.5.10 → 5.5.12
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.
- package/dist/react/{AIRenderer-46WIFF2B.js → AIRenderer-PWWLWI6U.js} +84 -16
- package/dist/react/AIRenderer-PWWLWI6U.js.map +7 -0
- package/dist/react/{MermaidFlowchartRenderer-A26B2SM3.js → MermaidFlowchartRenderer-4YEMAYQC.js} +18 -3
- package/dist/react/MermaidFlowchartRenderer-4YEMAYQC.js.map +7 -0
- package/dist/react/{MermaidSequenceRenderer-OF4JK77D.js → MermaidSequenceRenderer-KCUHO7UI.js} +106 -4
- package/dist/react/MermaidSequenceRenderer-KCUHO7UI.js.map +7 -0
- package/dist/react/MermaidStructuredRenderer-GGOOGON5.js +365 -0
- package/dist/react/MermaidStructuredRenderer-GGOOGON5.js.map +7 -0
- package/dist/react/{SketchEngine-BCRJ62CV.js → SketchEngine-NPF2XN6Z.js} +2 -2
- package/dist/react/index.js +61 -127
- package/dist/react/index.js.map +3 -3
- package/package.json +1 -1
- package/src/core/AIRenderer.js +95 -11
- package/src/core/MermaidFlowchartRenderer.js +18 -3
- package/src/core/MermaidSequenceRenderer.js +116 -7
- package/src/core/MermaidStructuredRenderer.js +363 -0
- package/src/react/LixSketchCanvas.jsx +1 -1
- package/src/react/components/canvas/FindBar.jsx +1 -1
- package/src/react/components/modals/CanvasPropertiesModal.jsx +1 -1
- package/src/react/components/modals/LixScriptModal.jsx +22 -96
- package/src/react/components/sidebars/ArrowSidebar.jsx +6 -6
- package/src/react/components/sidebars/CircleSidebar.jsx +3 -3
- package/src/react/components/sidebars/FrameSidebar.jsx +1 -1
- package/src/react/components/sidebars/LineSidebar.jsx +4 -4
- package/src/react/components/sidebars/PaintbrushSidebar.jsx +5 -5
- package/src/react/components/sidebars/RectangleSidebar.jsx +4 -4
- package/src/react/components/sidebars/TextSidebar.jsx +5 -5
- package/src/react/store/useUIStore.js +1 -1
- package/dist/react/AIRenderer-46WIFF2B.js.map +0 -7
- package/dist/react/MermaidFlowchartRenderer-A26B2SM3.js.map +0 -7
- package/dist/react/MermaidSequenceRenderer-OF4JK77D.js.map +0 -7
- /package/dist/react/{SketchEngine-BCRJ62CV.js.map → SketchEngine-NPF2XN6Z.js.map} +0 -0
|
@@ -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, '&')\n .replace(/</g, '<')\n .replace(/>/g, '>')\n .replace(/\"/g, '"');\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;AACjG;AAEO,SAAS,wBAAwB,KAAK;AACzC,QAAM,SAAS,YAAY,GAAG,EAAE,CAAC,GAAG,YAAY,KAAK;AACrD,MAAI,WAAW,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,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
|
+
}
|
|
@@ -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-
|
|
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-
|
|
417
|
+
//# sourceMappingURL=SketchEngine-NPF2XN6Z.js.map
|
package/dist/react/index.js
CHANGED
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
} from "./chunk-DNAG7ML6.js";
|
|
10
10
|
|
|
11
11
|
// src/react/LixSketchCanvas.jsx
|
|
12
|
-
import { useCallback as
|
|
12
|
+
import { useCallback as useCallback16, useEffect as useEffect15, useRef as useRef11, useState as useState20 } from "react";
|
|
13
13
|
|
|
14
14
|
// src/react/store/useSketchStore.js
|
|
15
15
|
import { create } from "zustand";
|
|
@@ -331,7 +331,7 @@ var useUIStore = create2((set, get) => ({
|
|
|
331
331
|
setCanvasLoading: (loading, message) => set({ canvasLoading: loading, canvasLoadingMessage: message || "Loading canvas..." }),
|
|
332
332
|
// --- Theme ---
|
|
333
333
|
// Issue #38 bug #1: light by default. Dark stays available via toggle.
|
|
334
|
-
theme: "
|
|
334
|
+
theme: "light",
|
|
335
335
|
setTheme: (newTheme) => {
|
|
336
336
|
const prev = get().theme;
|
|
337
337
|
const resolve = (t) => t === "system" ? window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light" : t;
|
|
@@ -427,7 +427,7 @@ function useSketchEngine(svgRef, ready = true) {
|
|
|
427
427
|
setZoom: (zoom) => useSketchStore_default.setState({ zoom }),
|
|
428
428
|
getState: () => useSketchStore_default.getState()
|
|
429
429
|
};
|
|
430
|
-
const { SketchEngine } = await import("./SketchEngine-
|
|
430
|
+
const { SketchEngine } = await import("./SketchEngine-NPF2XN6Z.js");
|
|
431
431
|
if (cancelled) return;
|
|
432
432
|
const engine = new SketchEngine(svgRef.current);
|
|
433
433
|
await engine.init();
|
|
@@ -1469,7 +1469,7 @@ function ColorGrid({ colors, selected, onSelect }) {
|
|
|
1469
1469
|
"button",
|
|
1470
1470
|
{
|
|
1471
1471
|
onClick: () => onSelect(c),
|
|
1472
|
-
className: `w-7 h-7 rounded-md border-[1.5px] transition-all duration-100 ${selected === c ? "border-[#
|
|
1472
|
+
className: `w-7 h-7 rounded-md border-[1.5px] transition-all duration-100 ${selected === c ? "border-[#7667a8] scale-110" : "border-white/[0.08] hover:border-white/20"}`,
|
|
1473
1473
|
style: !isTrans ? { backgroundColor: c } : void 0,
|
|
1474
1474
|
children: isTrans && /* @__PURE__ */ jsx6("svg", { className: "w-full h-full text-text-dim", viewBox: "0 0 20 20", children: /* @__PURE__ */ jsx6("line", { x1: "4", y1: "16", x2: "16", y2: "4", stroke: "currentColor", strokeWidth: "2" }) })
|
|
1475
1475
|
},
|
|
@@ -1541,7 +1541,7 @@ function RectangleSidebar() {
|
|
|
1541
1541
|
"button",
|
|
1542
1542
|
{
|
|
1543
1543
|
onClick: () => updateThickness(w),
|
|
1544
|
-
className: `w-9 h-8 flex items-center justify-center rounded-lg transition-all duration-100 ${thickness === w ? "bg-[#
|
|
1544
|
+
className: `w-9 h-8 flex items-center justify-center rounded-lg transition-all duration-100 ${thickness === w ? "bg-[#7667a8]/20 text-[#7667a8]" : "text-text-muted hover:bg-white/[0.06]"}`,
|
|
1545
1545
|
children: /* @__PURE__ */ jsx6("div", { className: "w-5 rounded-full bg-current", style: { height: Math.max(1, w) } })
|
|
1546
1546
|
},
|
|
1547
1547
|
w
|
|
@@ -1558,7 +1558,7 @@ function RectangleSidebar() {
|
|
|
1558
1558
|
"button",
|
|
1559
1559
|
{
|
|
1560
1560
|
onClick: () => updateStyle(s.v),
|
|
1561
|
-
className: `w-11 h-8 flex items-center justify-center rounded-lg transition-all duration-100 ${lineStyle === s.v ? "bg-[#
|
|
1561
|
+
className: `w-11 h-8 flex items-center justify-center rounded-lg transition-all duration-100 ${lineStyle === s.v ? "bg-[#7667a8]/20" : "hover:bg-white/[0.06]"}`,
|
|
1562
1562
|
children: /* @__PURE__ */ jsx6("svg", { width: "28", height: "4", viewBox: "0 0 28 4", children: /* @__PURE__ */ jsx6("line", { x1: "0", y1: "2", x2: "28", y2: "2", stroke: "#fff", strokeWidth: "2", strokeDasharray: s.d, strokeLinecap: "round" }) })
|
|
1563
1563
|
},
|
|
1564
1564
|
s.v
|
|
@@ -1571,7 +1571,7 @@ function RectangleSidebar() {
|
|
|
1571
1571
|
"button",
|
|
1572
1572
|
{
|
|
1573
1573
|
onClick: () => updateFill(f.value),
|
|
1574
|
-
className: `flex items-center gap-2 px-2.5 py-1.5 rounded-lg text-xs transition-all duration-100 ${fillStyle === f.value ? "bg-[#
|
|
1574
|
+
className: `flex items-center gap-2 px-2.5 py-1.5 rounded-lg text-xs transition-all duration-100 ${fillStyle === f.value ? "bg-[#7667a8] text-white" : "text-text-secondary hover:bg-white/[0.06]"}`,
|
|
1575
1575
|
children: [
|
|
1576
1576
|
/* @__PURE__ */ jsx6("span", { className: "w-1.5 h-1.5 rounded-full bg-current" }),
|
|
1577
1577
|
t(f.label)
|
|
@@ -1672,7 +1672,7 @@ function CircleSidebar() {
|
|
|
1672
1672
|
"button",
|
|
1673
1673
|
{
|
|
1674
1674
|
onClick: () => updateThickness(w),
|
|
1675
|
-
className: `w-9 h-8 flex items-center justify-center rounded-lg transition-all duration-100 ${thickness === w ? "bg-[#
|
|
1675
|
+
className: `w-9 h-8 flex items-center justify-center rounded-lg transition-all duration-100 ${thickness === w ? "bg-[#7667a8]/20 text-[#7667a8]" : "text-text-muted hover:bg-white/[0.06]"}`,
|
|
1676
1676
|
children: /* @__PURE__ */ jsx7("div", { className: "w-5 rounded-full bg-current", style: { height: Math.max(1, w) } })
|
|
1677
1677
|
},
|
|
1678
1678
|
w
|
|
@@ -1685,7 +1685,7 @@ function CircleSidebar() {
|
|
|
1685
1685
|
"button",
|
|
1686
1686
|
{
|
|
1687
1687
|
onClick: () => updateStyle(s.v),
|
|
1688
|
-
className: `w-11 h-8 flex items-center justify-center rounded-lg transition-all duration-100 ${lineStyle === s.v ? "bg-[#
|
|
1688
|
+
className: `w-11 h-8 flex items-center justify-center rounded-lg transition-all duration-100 ${lineStyle === s.v ? "bg-[#7667a8]/20" : "hover:bg-white/[0.06]"}`,
|
|
1689
1689
|
children: /* @__PURE__ */ jsx7("svg", { width: "28", height: "4", viewBox: "0 0 28 4", children: /* @__PURE__ */ jsx7("line", { x1: "0", y1: "2", x2: "28", y2: "2", stroke: "#fff", strokeWidth: "2", strokeDasharray: s.d, strokeLinecap: "round" }) })
|
|
1690
1690
|
},
|
|
1691
1691
|
s.v
|
|
@@ -1698,7 +1698,7 @@ function CircleSidebar() {
|
|
|
1698
1698
|
"button",
|
|
1699
1699
|
{
|
|
1700
1700
|
onClick: () => updateFill(f.value),
|
|
1701
|
-
className: `flex items-center gap-2 px-2.5 py-1.5 rounded-lg text-xs transition-all duration-100 ${fillStyle === f.value ? "bg-[#
|
|
1701
|
+
className: `flex items-center gap-2 px-2.5 py-1.5 rounded-lg text-xs transition-all duration-100 ${fillStyle === f.value ? "bg-[#7667a8] text-white" : "text-text-secondary hover:bg-white/[0.06]"}`,
|
|
1702
1702
|
children: [
|
|
1703
1703
|
/* @__PURE__ */ jsx7("span", { className: "w-1.5 h-1.5 rounded-full bg-current" }),
|
|
1704
1704
|
t(f.label)
|
|
@@ -1721,7 +1721,7 @@ function ColorGrid3({ colors, selected, onSelect }) {
|
|
|
1721
1721
|
"button",
|
|
1722
1722
|
{
|
|
1723
1723
|
onClick: () => onSelect(c),
|
|
1724
|
-
className: `w-7 h-7 rounded-md border-[1.5px] transition-all duration-100 ${selected === c ? "border-[#
|
|
1724
|
+
className: `w-7 h-7 rounded-md border-[1.5px] transition-all duration-100 ${selected === c ? "border-[#7667a8] scale-110" : "border-white/[0.08] hover:border-white/20"}`,
|
|
1725
1725
|
style: { backgroundColor: c }
|
|
1726
1726
|
},
|
|
1727
1727
|
c
|
|
@@ -1775,7 +1775,7 @@ function LineSidebar() {
|
|
|
1775
1775
|
"button",
|
|
1776
1776
|
{
|
|
1777
1777
|
onClick: () => updateThickness(w),
|
|
1778
|
-
className: `w-9 h-8 flex items-center justify-center rounded-lg transition-all duration-100 ${thickness === w ? "bg-[#
|
|
1778
|
+
className: `w-9 h-8 flex items-center justify-center rounded-lg transition-all duration-100 ${thickness === w ? "bg-[#7667a8]/20 text-[#7667a8]" : "text-text-muted hover:bg-white/[0.06]"}`,
|
|
1779
1779
|
children: /* @__PURE__ */ jsx8("div", { className: "w-5 rounded-full bg-current", style: { height: Math.max(1, w) } })
|
|
1780
1780
|
},
|
|
1781
1781
|
w
|
|
@@ -1788,7 +1788,7 @@ function LineSidebar() {
|
|
|
1788
1788
|
"button",
|
|
1789
1789
|
{
|
|
1790
1790
|
onClick: () => updateStyle(s.v),
|
|
1791
|
-
className: `w-11 h-8 flex items-center justify-center rounded-lg transition-all duration-100 ${lineStyle === s.v ? "bg-[#
|
|
1791
|
+
className: `w-11 h-8 flex items-center justify-center rounded-lg transition-all duration-100 ${lineStyle === s.v ? "bg-[#7667a8]/20" : "hover:bg-white/[0.06]"}`,
|
|
1792
1792
|
children: /* @__PURE__ */ jsx8("svg", { width: "28", height: "4", viewBox: "0 0 28 4", children: /* @__PURE__ */ jsx8("line", { x1: "0", y1: "2", x2: "28", y2: "2", stroke: "#fff", strokeWidth: "2", strokeDasharray: s.d, strokeLinecap: "round" }) })
|
|
1793
1793
|
},
|
|
1794
1794
|
s.v
|
|
@@ -1801,7 +1801,7 @@ function LineSidebar() {
|
|
|
1801
1801
|
"button",
|
|
1802
1802
|
{
|
|
1803
1803
|
onClick: () => updateSloppiness(s.v),
|
|
1804
|
-
className: `w-8 h-8 flex items-center justify-center rounded-lg text-xs transition-all duration-100 ${sloppiness === s.v ? "bg-[#
|
|
1804
|
+
className: `w-8 h-8 flex items-center justify-center rounded-lg text-xs transition-all duration-100 ${sloppiness === s.v ? "bg-[#7667a8]/20 text-accent-blue" : "text-text-muted hover:bg-white/6"}`,
|
|
1805
1805
|
children: s.l
|
|
1806
1806
|
},
|
|
1807
1807
|
s.v
|
|
@@ -1847,7 +1847,7 @@ function ColorGrid4({ colors, selected, onSelect }) {
|
|
|
1847
1847
|
"button",
|
|
1848
1848
|
{
|
|
1849
1849
|
onClick: () => onSelect(c),
|
|
1850
|
-
className: `w-7 h-7 rounded-md border-[1.5px] transition-all duration-100 ${selected === c ? "border-[#
|
|
1850
|
+
className: `w-7 h-7 rounded-md border-[1.5px] transition-all duration-100 ${selected === c ? "border-[#7667a8] scale-110" : "border-white/[0.08] hover:border-white/20"}`,
|
|
1851
1851
|
style: { backgroundColor: c }
|
|
1852
1852
|
},
|
|
1853
1853
|
c
|
|
@@ -1900,7 +1900,7 @@ function ArrowSidebar() {
|
|
|
1900
1900
|
"button",
|
|
1901
1901
|
{
|
|
1902
1902
|
onClick: () => updateHead(h.value),
|
|
1903
|
-
className: `w-10 h-8 flex items-center justify-center rounded-lg transition-all duration-100 ${headStyle === h.value ? "bg-[#
|
|
1903
|
+
className: `w-10 h-8 flex items-center justify-center rounded-lg transition-all duration-100 ${headStyle === h.value ? "bg-[#7667a8]/20 text-[#7667a8]" : "text-text-secondary hover:bg-white/[0.06]"}`,
|
|
1904
1904
|
children: /* @__PURE__ */ jsx9(SvgIcon, { svg: h.svg })
|
|
1905
1905
|
},
|
|
1906
1906
|
h.value
|
|
@@ -1925,7 +1925,7 @@ function ArrowSidebar() {
|
|
|
1925
1925
|
"button",
|
|
1926
1926
|
{
|
|
1927
1927
|
onClick: () => updateThickness(w),
|
|
1928
|
-
className: `w-9 h-8 flex items-center justify-center rounded-lg transition-all duration-100 ${thickness === w ? "bg-[#
|
|
1928
|
+
className: `w-9 h-8 flex items-center justify-center rounded-lg transition-all duration-100 ${thickness === w ? "bg-[#7667a8]/20 text-[#7667a8]" : "text-text-secondary hover:bg-white/[0.06]"}`,
|
|
1929
1929
|
children: /* @__PURE__ */ jsx9("div", { className: "w-5 rounded-full bg-current", style: { height: Math.max(1, w) } })
|
|
1930
1930
|
},
|
|
1931
1931
|
w
|
|
@@ -1938,7 +1938,7 @@ function ArrowSidebar() {
|
|
|
1938
1938
|
"button",
|
|
1939
1939
|
{
|
|
1940
1940
|
onClick: () => updateOutline(s.v),
|
|
1941
|
-
className: `w-11 h-8 flex items-center justify-center rounded-lg transition-all duration-100 ${outlineStyle === s.v ? "bg-[#
|
|
1941
|
+
className: `w-11 h-8 flex items-center justify-center rounded-lg transition-all duration-100 ${outlineStyle === s.v ? "bg-[#7667a8]/20" : "hover:bg-white/[0.06]"}`,
|
|
1942
1942
|
children: /* @__PURE__ */ jsx9("svg", { width: "28", height: "4", viewBox: "0 0 28 4", children: /* @__PURE__ */ jsx9("line", { x1: "0", y1: "2", x2: "28", y2: "2", stroke: "#fff", strokeWidth: "2", strokeDasharray: s.d, strokeLinecap: "round" }) })
|
|
1943
1943
|
},
|
|
1944
1944
|
s.v
|
|
@@ -1956,7 +1956,7 @@ function ArrowSidebar() {
|
|
|
1956
1956
|
"button",
|
|
1957
1957
|
{
|
|
1958
1958
|
onClick: () => updateType(a.v),
|
|
1959
|
-
className: `flex items-center gap-2 px-2.5 py-1.5 rounded-lg text-xs transition-all duration-100 ${arrowType === a.v ? "bg-[#
|
|
1959
|
+
className: `flex items-center gap-2 px-2.5 py-1.5 rounded-lg text-xs transition-all duration-100 ${arrowType === a.v ? "bg-[#7667a8] text-white" : "text-text-secondary hover:bg-white/[0.06]"}`,
|
|
1960
1960
|
children: [
|
|
1961
1961
|
/* @__PURE__ */ jsx9("i", { className: `bx ${a.i} text-sm` }),
|
|
1962
1962
|
" ",
|
|
@@ -1972,7 +1972,7 @@ function ArrowSidebar() {
|
|
|
1972
1972
|
"button",
|
|
1973
1973
|
{
|
|
1974
1974
|
onClick: () => updateCurvature(c.v),
|
|
1975
|
-
className: `flex-1 py-1 rounded-md text-xs text-center transition-all duration-100 ${curvature === c.v ? "bg-[#
|
|
1975
|
+
className: `flex-1 py-1 rounded-md text-xs text-center transition-all duration-100 ${curvature === c.v ? "bg-[#7667a8]/20 text-[#7667a8]" : "text-text-secondary hover:bg-white/[0.06]"}`,
|
|
1976
1976
|
children: c.l
|
|
1977
1977
|
},
|
|
1978
1978
|
c.v
|
|
@@ -1995,7 +1995,7 @@ function ColorGrid5({ colors, selected, onSelect }) {
|
|
|
1995
1995
|
"button",
|
|
1996
1996
|
{
|
|
1997
1997
|
onClick: () => onSelect(c),
|
|
1998
|
-
className: `w-7 h-7 rounded-md border-[1.5px] transition-all duration-100 ${selected === c ? "border-[#
|
|
1998
|
+
className: `w-7 h-7 rounded-md border-[1.5px] transition-all duration-100 ${selected === c ? "border-[#7667a8] scale-110" : "border-white/[0.08] hover:border-white/20"}`,
|
|
1999
1999
|
style: { backgroundColor: c }
|
|
2000
2000
|
},
|
|
2001
2001
|
c
|
|
@@ -2050,7 +2050,7 @@ function PaintbrushSidebar() {
|
|
|
2050
2050
|
"button",
|
|
2051
2051
|
{
|
|
2052
2052
|
onClick: () => updateThickness(w),
|
|
2053
|
-
className: `w-9 h-8 flex items-center justify-center rounded-lg transition-all duration-100 ${thickness === w ? "bg-[#
|
|
2053
|
+
className: `w-9 h-8 flex items-center justify-center rounded-lg transition-all duration-100 ${thickness === w ? "bg-[#7667a8]/20 text-[#7667a8]" : "text-text-muted hover:bg-white/[0.06]"}`,
|
|
2054
2054
|
children: /* @__PURE__ */ jsx10("div", { className: "w-5 rounded-full bg-current", style: { height: Math.max(1, w) } })
|
|
2055
2055
|
},
|
|
2056
2056
|
w
|
|
@@ -2067,7 +2067,7 @@ function PaintbrushSidebar() {
|
|
|
2067
2067
|
"button",
|
|
2068
2068
|
{
|
|
2069
2069
|
onClick: () => updateTaper(t2.v),
|
|
2070
|
-
className: `flex items-center gap-2 px-2.5 py-1.5 rounded-lg text-xs transition-all duration-100 ${taper === t2.v ? "bg-[#
|
|
2070
|
+
className: `flex items-center gap-2 px-2.5 py-1.5 rounded-lg text-xs transition-all duration-100 ${taper === t2.v ? "bg-[#7667a8] text-white" : "text-text-secondary hover:bg-white/[0.06]"}`,
|
|
2071
2071
|
children: [
|
|
2072
2072
|
/* @__PURE__ */ jsx10("i", { className: `bx ${t2.i} text-sm` }),
|
|
2073
2073
|
" ",
|
|
@@ -2088,7 +2088,7 @@ function PaintbrushSidebar() {
|
|
|
2088
2088
|
"button",
|
|
2089
2089
|
{
|
|
2090
2090
|
onClick: () => updateRoughness(r.v),
|
|
2091
|
-
className: `flex items-center gap-2 px-2.5 py-1.5 rounded-lg text-xs transition-all duration-100 ${roughness === r.v ? "bg-[#
|
|
2091
|
+
className: `flex items-center gap-2 px-2.5 py-1.5 rounded-lg text-xs transition-all duration-100 ${roughness === r.v ? "bg-[#7667a8] text-white" : "text-text-secondary hover:bg-white/[0.06]"}`,
|
|
2092
2092
|
children: [
|
|
2093
2093
|
/* @__PURE__ */ jsx10("i", { className: `bx ${r.i} text-sm` }),
|
|
2094
2094
|
" ",
|
|
@@ -2114,7 +2114,7 @@ function PaintbrushSidebar() {
|
|
|
2114
2114
|
step: "0.05",
|
|
2115
2115
|
value: opacity,
|
|
2116
2116
|
onChange: (e) => updateOpacity(parseFloat(e.target.value)),
|
|
2117
|
-
className: "w-28 h-1 bg-white/10 rounded-full appearance-none cursor-pointer accent-[#
|
|
2117
|
+
className: "w-28 h-1 bg-white/10 rounded-full appearance-none cursor-pointer accent-[#7667a8]"
|
|
2118
2118
|
}
|
|
2119
2119
|
)
|
|
2120
2120
|
] }),
|
|
@@ -2214,7 +2214,7 @@ function TextSidebar() {
|
|
|
2214
2214
|
"button",
|
|
2215
2215
|
{
|
|
2216
2216
|
onClick: () => updateColor(c),
|
|
2217
|
-
className: `w-7 h-7 rounded-md border-[1.5px] transition-all duration-100 ${textColor === c ? "border-[#
|
|
2217
|
+
className: `w-7 h-7 rounded-md border-[1.5px] transition-all duration-100 ${textColor === c ? "border-[#7667a8] scale-110" : "border-white/[0.08] hover:border-white/20"}`,
|
|
2218
2218
|
style: { backgroundColor: c }
|
|
2219
2219
|
},
|
|
2220
2220
|
c
|
|
@@ -2230,7 +2230,7 @@ function TextSidebar() {
|
|
|
2230
2230
|
"button",
|
|
2231
2231
|
{
|
|
2232
2232
|
onClick: () => updateFont(f.value),
|
|
2233
|
-
className: `flex items-center px-2.5 py-1.5 rounded-lg text-xs transition-all duration-100 ${font === f.value ? "bg-[#
|
|
2233
|
+
className: `flex items-center px-2.5 py-1.5 rounded-lg text-xs transition-all duration-100 ${font === f.value ? "bg-[#7667a8] text-white" : "text-text-secondary hover:bg-white/[0.06]"}`,
|
|
2234
2234
|
style: { fontFamily: f.value },
|
|
2235
2235
|
children: f.label
|
|
2236
2236
|
},
|
|
@@ -2245,7 +2245,7 @@ function TextSidebar() {
|
|
|
2245
2245
|
"button",
|
|
2246
2246
|
{
|
|
2247
2247
|
onClick: () => updateSize(s),
|
|
2248
|
-
className: `w-8 h-8 flex items-center justify-center rounded-lg text-xs transition-all duration-100 ${fontSize === s ? "bg-[#
|
|
2248
|
+
className: `w-8 h-8 flex items-center justify-center rounded-lg text-xs transition-all duration-100 ${fontSize === s ? "bg-[#7667a8]/20 text-[#7667a8]" : "text-text-muted hover:bg-white/[0.06]"}`,
|
|
2249
2249
|
children: s
|
|
2250
2250
|
},
|
|
2251
2251
|
s
|
|
@@ -2259,7 +2259,7 @@ function TextSidebar() {
|
|
|
2259
2259
|
"button",
|
|
2260
2260
|
{
|
|
2261
2261
|
onClick: toggleCodeMode,
|
|
2262
|
-
className: `flex items-center gap-2 px-2.5 py-1.5 rounded-lg text-xs transition-all duration-100 ${codeMode ? "bg-[#
|
|
2262
|
+
className: `flex items-center gap-2 px-2.5 py-1.5 rounded-lg text-xs transition-all duration-100 ${codeMode ? "bg-[#7667a8] text-white" : "text-text-secondary hover:bg-white/[0.06]"}`,
|
|
2263
2263
|
children: [
|
|
2264
2264
|
/* @__PURE__ */ jsx11("div", { className: `w-6 h-3 rounded-full transition-all duration-150 relative ${codeMode ? "bg-white/30" : "bg-white/10"}`, children: /* @__PURE__ */ jsx11("div", { className: `absolute top-0.5 w-2 h-2 rounded-full bg-white transition-all duration-150 ${codeMode ? "left-3.5" : "left-0.5"}` }) }),
|
|
2265
2265
|
codeMode ? t("sidebar.on") : t("sidebar.off")
|
|
@@ -2270,7 +2270,7 @@ function TextSidebar() {
|
|
|
2270
2270
|
"button",
|
|
2271
2271
|
{
|
|
2272
2272
|
onClick: () => updateLanguage(lang),
|
|
2273
|
-
className: `px-1.5 py-0.5 rounded text-[9px] transition-all duration-100 ${language === lang ? "bg-[#
|
|
2273
|
+
className: `px-1.5 py-0.5 rounded text-[9px] transition-all duration-100 ${language === lang ? "bg-[#7667a8]/20 text-[#7667a8]" : "text-text-dim hover:bg-white/[0.06] hover:text-text-secondary"}`,
|
|
2274
2274
|
children: lang
|
|
2275
2275
|
},
|
|
2276
2276
|
lang
|
|
@@ -2387,7 +2387,7 @@ function FrameSidebar() {
|
|
|
2387
2387
|
type: "text",
|
|
2388
2388
|
value: frameName,
|
|
2389
2389
|
onChange: updateName,
|
|
2390
|
-
className: "w-32 px-2.5 py-1.5 bg-white/[0.05] border border-white/[0.1] rounded-lg text-white text-xs outline-none focus:border-[#
|
|
2390
|
+
className: "w-32 px-2.5 py-1.5 bg-white/[0.05] border border-white/[0.1] rounded-lg text-white text-xs outline-none focus:border-[#7667a8]/50 transition-all duration-150 font-[lixFont]",
|
|
2391
2391
|
spellCheck: false
|
|
2392
2392
|
}
|
|
2393
2393
|
)
|
|
@@ -3386,7 +3386,7 @@ function FindBar() {
|
|
|
3386
3386
|
rect.setAttribute("width", w + 8);
|
|
3387
3387
|
rect.setAttribute("height", h + 8);
|
|
3388
3388
|
rect.setAttribute("fill", "rgba(91, 87, 209, 0.15)");
|
|
3389
|
-
rect.setAttribute("stroke", "#
|
|
3389
|
+
rect.setAttribute("stroke", "#7667a8");
|
|
3390
3390
|
rect.setAttribute("stroke-width", "2");
|
|
3391
3391
|
rect.setAttribute("stroke-dasharray", "4,2");
|
|
3392
3392
|
rect.setAttribute("rx", "4");
|
|
@@ -4500,73 +4500,33 @@ function HelpModal() {
|
|
|
4500
4500
|
}
|
|
4501
4501
|
|
|
4502
4502
|
// src/react/components/modals/LixScriptModal.jsx
|
|
4503
|
-
import {
|
|
4503
|
+
import { useEffect as useEffect13 } from "react";
|
|
4504
4504
|
import { jsx as jsx24, jsxs as jsxs24 } from "react/jsx-runtime";
|
|
4505
|
-
var SAMPLE = `# LixScript \u2014 paste shapes / arrows in a simple DSL.
|
|
4506
|
-
# Hit Cmd/Ctrl+Enter to render onto the canvas.
|
|
4507
|
-
|
|
4508
|
-
rect A "Idea" 100 100 220 90
|
|
4509
|
-
rect B "Plan" 400 100 220 90
|
|
4510
|
-
rect C "Ship" 700 100 220 90
|
|
4511
|
-
|
|
4512
|
-
arrow A -> B
|
|
4513
|
-
arrow B -> C
|
|
4514
|
-
`;
|
|
4515
4505
|
function LixScriptModal() {
|
|
4516
|
-
const open = useUIStore_default((
|
|
4517
|
-
const toggle = useUIStore_default((
|
|
4518
|
-
const [source, setSource] = useState19(SAMPLE);
|
|
4519
|
-
const [busy, setBusy] = useState19(false);
|
|
4520
|
-
const [status, setStatus] = useState19(null);
|
|
4521
|
-
const taRef = useRef10(null);
|
|
4506
|
+
const open = useUIStore_default((state) => state.aiModalOpen);
|
|
4507
|
+
const toggle = useUIStore_default((state) => state.toggleAIModal);
|
|
4522
4508
|
useEffect13(() => {
|
|
4523
4509
|
if (!open) return;
|
|
4524
|
-
|
|
4525
|
-
|
|
4526
|
-
if (e.key === "Escape") toggle();
|
|
4510
|
+
const onKeyDown = (event) => {
|
|
4511
|
+
if (event.key === "Escape") toggle();
|
|
4527
4512
|
};
|
|
4528
|
-
document.addEventListener("keydown",
|
|
4529
|
-
return () => document.removeEventListener("keydown",
|
|
4513
|
+
document.addEventListener("keydown", onKeyDown);
|
|
4514
|
+
return () => document.removeEventListener("keydown", onKeyDown);
|
|
4530
4515
|
}, [open, toggle]);
|
|
4531
|
-
const render = useCallback15(async () => {
|
|
4532
|
-
if (busy) return;
|
|
4533
|
-
setBusy(true);
|
|
4534
|
-
setStatus(null);
|
|
4535
|
-
try {
|
|
4536
|
-
const mod = await import("./LixScriptParser-JYWJX375.js");
|
|
4537
|
-
const parsed = mod.parseLixScript(source);
|
|
4538
|
-
const resolved = mod.resolveShapeRefs ? mod.resolveShapeRefs(parsed) : parsed;
|
|
4539
|
-
mod.renderLixScript(resolved);
|
|
4540
|
-
setStatus({ tone: "success", message: `Rendered ${Array.isArray(resolved) ? resolved.length : "?"} elements.` });
|
|
4541
|
-
setTimeout(() => {
|
|
4542
|
-
toggle();
|
|
4543
|
-
}, 700);
|
|
4544
|
-
} catch (err) {
|
|
4545
|
-
console.warn("[LixScriptModal] parse failed:", err);
|
|
4546
|
-
setStatus({ tone: "error", message: err?.message || "Parse failed." });
|
|
4547
|
-
} finally {
|
|
4548
|
-
setBusy(false);
|
|
4549
|
-
}
|
|
4550
|
-
}, [source, busy, toggle]);
|
|
4551
|
-
const handleKeyDown = useCallback15((e) => {
|
|
4552
|
-
if ((e.ctrlKey || e.metaKey) && e.key === "Enter") {
|
|
4553
|
-
e.preventDefault();
|
|
4554
|
-
render();
|
|
4555
|
-
}
|
|
4556
|
-
}, [render]);
|
|
4557
4516
|
if (!open) return null;
|
|
4558
4517
|
return /* @__PURE__ */ jsx24(
|
|
4559
4518
|
"div",
|
|
4560
4519
|
{
|
|
4561
|
-
className: "fixed inset-0 z-[1100] flex items-center justify-center bg-black/
|
|
4520
|
+
className: "fixed inset-0 z-[1100] flex items-center justify-center bg-black/40 backdrop-blur-sm font-[lixFont]",
|
|
4562
4521
|
onClick: toggle,
|
|
4563
4522
|
role: "dialog",
|
|
4564
4523
|
"aria-modal": "true",
|
|
4524
|
+
"aria-labelledby": "lixscript-coming-soon-title",
|
|
4565
4525
|
children: /* @__PURE__ */ jsxs24(
|
|
4566
4526
|
"div",
|
|
4567
4527
|
{
|
|
4568
|
-
onClick: (
|
|
4569
|
-
className: "relative w-[
|
|
4528
|
+
onClick: (event) => event.stopPropagation(),
|
|
4529
|
+
className: "relative w-[520px] max-w-[94vw] bg-surface border border-border-light rounded-2xl px-8 py-10 shadow-2xl text-center",
|
|
4570
4530
|
children: [
|
|
4571
4531
|
/* @__PURE__ */ jsx24(
|
|
4572
4532
|
"button",
|
|
@@ -4577,36 +4537,10 @@ function LixScriptModal() {
|
|
|
4577
4537
|
children: /* @__PURE__ */ jsx24("i", { className: "bx bx-x text-lg" })
|
|
4578
4538
|
}
|
|
4579
4539
|
),
|
|
4580
|
-
/* @__PURE__ */
|
|
4581
|
-
|
|
4582
|
-
|
|
4583
|
-
|
|
4584
|
-
/* @__PURE__ */ jsx24("p", { className: "text-text-dim text-[11px]", children: "Type shapes + arrows, render directly. No AI involved." })
|
|
4585
|
-
] })
|
|
4586
|
-
] }),
|
|
4587
|
-
/* @__PURE__ */ jsx24(
|
|
4588
|
-
"textarea",
|
|
4589
|
-
{
|
|
4590
|
-
ref: taRef,
|
|
4591
|
-
value: source,
|
|
4592
|
-
onChange: (e) => setSource(e.target.value),
|
|
4593
|
-
onKeyDown: handleKeyDown,
|
|
4594
|
-
spellCheck: false,
|
|
4595
|
-
className: "w-full h-[260px] resize-none bg-surface-card border border-border-light rounded-lg px-3 py-2 text-[12px] text-text-primary font-[lixCode] outline-none focus:border-accent-blue/50"
|
|
4596
|
-
}
|
|
4597
|
-
),
|
|
4598
|
-
/* @__PURE__ */ jsxs24("div", { className: "flex items-center justify-between", children: [
|
|
4599
|
-
status ? /* @__PURE__ */ jsx24("span", { className: `text-[11px] ${status.tone === "error" ? "text-red-400" : "text-green-400"}`, children: status.message }) : /* @__PURE__ */ jsx24("span", { className: "text-text-dim text-[11px]", children: "Cmd/Ctrl+Enter to render \xB7 Esc to close" }),
|
|
4600
|
-
/* @__PURE__ */ jsx24(
|
|
4601
|
-
"button",
|
|
4602
|
-
{
|
|
4603
|
-
onClick: render,
|
|
4604
|
-
disabled: busy,
|
|
4605
|
-
className: "px-3 py-1.5 rounded-lg bg-accent-blue text-text-primary text-[12px] font-medium hover:bg-accent-blue-hover transition-colors disabled:opacity-50 disabled:pointer-events-none",
|
|
4606
|
-
children: busy ? "Rendering\u2026" : "Render"
|
|
4607
|
-
}
|
|
4608
|
-
)
|
|
4609
|
-
] })
|
|
4540
|
+
/* @__PURE__ */ jsx24("div", { className: "mx-auto mb-5 w-12 h-12 rounded-xl bg-accent-blue/10 border border-accent-blue/25 flex items-center justify-center", children: /* @__PURE__ */ jsx24("i", { className: "bx bx-plug text-2xl text-accent-blue" }) }),
|
|
4541
|
+
/* @__PURE__ */ jsx24("span", { className: "inline-flex px-2.5 py-1 rounded-full bg-[#a97852]/15 text-[#8f6244] text-[10px] font-semibold uppercase tracking-wider", children: "Coming soon" }),
|
|
4542
|
+
/* @__PURE__ */ jsx24("h2", { id: "lixscript-coming-soon-title", className: "mt-4 text-text-primary text-xl font-medium", children: "LixScript MCP" }),
|
|
4543
|
+
/* @__PURE__ */ jsx24("p", { className: "mt-2 text-text-muted text-sm leading-relaxed", children: "LixScript is being prepared as the programmable MCP interface for LixSketch. This workspace panel will become available with the supported platform integration." })
|
|
4610
4544
|
]
|
|
4611
4545
|
}
|
|
4612
4546
|
)
|
|
@@ -4615,9 +4549,9 @@ function LixScriptModal() {
|
|
|
4615
4549
|
}
|
|
4616
4550
|
|
|
4617
4551
|
// src/react/components/modals/GraphModal.jsx
|
|
4618
|
-
import { useCallback as
|
|
4552
|
+
import { useCallback as useCallback15, useEffect as useEffect14, useRef as useRef10, useState as useState19 } from "react";
|
|
4619
4553
|
import { jsx as jsx25, jsxs as jsxs25 } from "react/jsx-runtime";
|
|
4620
|
-
var
|
|
4554
|
+
var SAMPLE = `# One equation per line. Comments start with #.
|
|
4621
4555
|
# Hit Cmd/Ctrl+Enter to render onto the canvas.
|
|
4622
4556
|
|
|
4623
4557
|
y = x^2
|
|
@@ -4631,11 +4565,11 @@ function parseEquations(text) {
|
|
|
4631
4565
|
function GraphModal() {
|
|
4632
4566
|
const open = useUIStore_default((s) => s.graphModalOpen);
|
|
4633
4567
|
const toggle = useUIStore_default((s) => s.toggleGraphModal);
|
|
4634
|
-
const [source, setSource] =
|
|
4635
|
-
const [settings, setSettings] =
|
|
4636
|
-
const [busy, setBusy] =
|
|
4637
|
-
const [status, setStatus] =
|
|
4638
|
-
const taRef =
|
|
4568
|
+
const [source, setSource] = useState19(SAMPLE);
|
|
4569
|
+
const [settings, setSettings] = useState19(DEFAULT_SETTINGS);
|
|
4570
|
+
const [busy, setBusy] = useState19(false);
|
|
4571
|
+
const [status, setStatus] = useState19(null);
|
|
4572
|
+
const taRef = useRef10(null);
|
|
4639
4573
|
useEffect14(() => {
|
|
4640
4574
|
if (!open) return;
|
|
4641
4575
|
requestAnimationFrame(() => taRef.current?.focus());
|
|
@@ -4645,7 +4579,7 @@ function GraphModal() {
|
|
|
4645
4579
|
document.addEventListener("keydown", onKey);
|
|
4646
4580
|
return () => document.removeEventListener("keydown", onKey);
|
|
4647
4581
|
}, [open, toggle]);
|
|
4648
|
-
const render =
|
|
4582
|
+
const render = useCallback15(async () => {
|
|
4649
4583
|
if (busy) return;
|
|
4650
4584
|
setBusy(true);
|
|
4651
4585
|
setStatus(null);
|
|
@@ -4677,7 +4611,7 @@ function GraphModal() {
|
|
|
4677
4611
|
setBusy(false);
|
|
4678
4612
|
}
|
|
4679
4613
|
}, [source, settings, busy, toggle]);
|
|
4680
|
-
const handleKeyDown =
|
|
4614
|
+
const handleKeyDown = useCallback15((e) => {
|
|
4681
4615
|
if ((e.ctrlKey || e.metaKey) && e.key === "Enter") {
|
|
4682
4616
|
e.preventDefault();
|
|
4683
4617
|
render();
|
|
@@ -4816,10 +4750,10 @@ function LixSketchCanvas({
|
|
|
4816
4750
|
className = "",
|
|
4817
4751
|
style = null
|
|
4818
4752
|
}) {
|
|
4819
|
-
const wrapperRef =
|
|
4820
|
-
const lastSceneJsonRef =
|
|
4821
|
-
const debounceRef =
|
|
4822
|
-
const [bootstrapped, setBootstrapped] =
|
|
4753
|
+
const wrapperRef = useRef11(null);
|
|
4754
|
+
const lastSceneJsonRef = useRef11("");
|
|
4755
|
+
const debounceRef = useRef11(null);
|
|
4756
|
+
const [bootstrapped, setBootstrapped] = useState20(false);
|
|
4823
4757
|
useEffect15(() => {
|
|
4824
4758
|
installImageUploadBridge(onUploadImage);
|
|
4825
4759
|
}, [onUploadImage]);
|
|
@@ -4978,7 +4912,7 @@ function LixSketchCanvas({
|
|
|
4978
4912
|
"button",
|
|
4979
4913
|
{
|
|
4980
4914
|
type: "button",
|
|
4981
|
-
title: "LixScript \u2014
|
|
4915
|
+
title: "LixScript MCP \u2014 coming soon",
|
|
4982
4916
|
onClick: () => useUIStore_default.getState().toggleAIModal?.(),
|
|
4983
4917
|
className: "w-9 h-9 flex items-center justify-center rounded-lg bg-surface border border-border-light text-text-muted hover:text-text-primary hover:bg-surface-hover transition-colors",
|
|
4984
4918
|
children: /* @__PURE__ */ jsx26("i", { className: "bx bx-code-alt text-base" })
|