@elixpo/lixsketch 5.5.19 → 5.5.21
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/Circle-6POZCUZD.js +9 -0
- package/dist/react/{CopyPaste-JMIXWUUO.js → CopyPaste-FJN7K5LS.js} +43 -14
- package/dist/react/CopyPaste-FJN7K5LS.js.map +7 -0
- package/dist/react/{EventDispatcher-H5EA4KZN.js → EventDispatcher-O7HCQQNM.js} +14 -13
- package/dist/react/{EventDispatcher-H5EA4KZN.js.map → EventDispatcher-O7HCQQNM.js.map} +1 -1
- package/dist/react/Frame-RLSMJJSK.js +11 -0
- package/dist/react/FreehandStroke-U6GYZOM4.js +9 -0
- package/dist/react/{GraphEngine-KQXHNTZQ.js → GraphEngine-MM6ALA2N.js} +105 -148
- package/dist/react/{GraphEngine-KQXHNTZQ.js.map → GraphEngine-MM6ALA2N.js.map} +2 -2
- package/dist/react/IconShape-7OPXAKLK.js +10 -0
- package/dist/react/ImageShape-LRNJQCF3.js +10 -0
- package/dist/react/Line-WWQFBNX5.js +10 -0
- package/dist/react/Rectangle-S7XUKWYD.js +9 -0
- package/dist/react/{SceneSerializer-ARTKPZVR.js → SceneSerializer-GSJR7ZHC.js} +36 -11
- package/dist/react/SceneSerializer-GSJR7ZHC.js.map +7 -0
- package/dist/react/{Selection-YJNZRBON.js → Selection-ZL3G6IAO.js} +5 -4
- package/dist/react/{SketchEngine-ZGYBIZG7.js → SketchEngine-BFLHJPCG.js} +25 -25
- package/dist/react/{UndoRedo-BZ6W4QTV.js → UndoRedo-NL7KLR5B.js} +2 -2
- package/dist/react/{ZoomPan-NYPDJBD5.js → ZoomPan-FAWA5OPS.js} +5 -1
- package/dist/react/ZoomPan-FAWA5OPS.js.map +7 -0
- package/dist/react/{arrowTool-LKFSZKXC.js → arrowTool-CNVGM6RX.js} +3 -3
- package/dist/react/{chunk-RFHMFWVR.js → chunk-2FMFOPGW.js} +5 -6
- package/dist/react/{chunk-RFHMFWVR.js.map → chunk-2FMFOPGW.js.map} +2 -2
- package/dist/react/{chunk-QYNTPZON.js → chunk-2THKDSWW.js} +9 -5
- package/dist/react/chunk-2THKDSWW.js.map +7 -0
- package/dist/react/{chunk-JOPQ27YH.js → chunk-4BLMNGTR.js} +3 -3
- package/dist/react/{chunk-C62SXFBL.js → chunk-4TAS67SL.js} +23 -22
- package/dist/react/chunk-4TAS67SL.js.map +7 -0
- package/dist/react/{chunk-FV3EPR4L.js → chunk-AH4PWNEB.js} +19 -11
- package/dist/react/chunk-AH4PWNEB.js.map +7 -0
- package/dist/react/{chunk-XCJOF6BM.js → chunk-FETTJLCV.js} +5 -1
- package/dist/react/chunk-FETTJLCV.js.map +7 -0
- package/dist/react/{chunk-JJTII2UQ.js → chunk-GC3KTQDA.js} +78 -15
- package/dist/react/chunk-GC3KTQDA.js.map +7 -0
- package/dist/react/{chunk-2V7G2PLX.js → chunk-GPIYXREE.js} +3 -3
- package/dist/react/{chunk-3VSGFP6U.js → chunk-HFQZYCHJ.js} +8 -4
- package/dist/react/chunk-HFQZYCHJ.js.map +7 -0
- package/dist/react/{chunk-C72OHQLE.js → chunk-ILGAFR56.js} +3 -3
- package/dist/react/{chunk-CF7AK4ES.js → chunk-KVAQPCUH.js} +26 -3
- package/dist/react/chunk-KVAQPCUH.js.map +7 -0
- package/dist/react/{chunk-WEWMB35W.js → chunk-OFGJJKPH.js} +3 -3
- package/dist/react/chunk-PAKA6HUX.js +59 -0
- package/dist/react/chunk-PAKA6HUX.js.map +7 -0
- package/dist/react/{chunk-HKYUJUD7.js → chunk-PXFPPO3R.js} +5 -1
- package/dist/react/chunk-PXFPPO3R.js.map +7 -0
- package/dist/react/{chunk-6G3ITAS5.js → chunk-SZD7DKYJ.js} +18 -9
- package/dist/react/chunk-SZD7DKYJ.js.map +7 -0
- package/dist/react/{chunk-N7NZLF6P.js → chunk-TKXKJNTX.js} +5 -1
- package/dist/react/chunk-TKXKJNTX.js.map +7 -0
- package/dist/react/{chunk-MYYBFZD3.js → chunk-U3TB4KRS.js} +45 -6
- package/dist/react/chunk-U3TB4KRS.js.map +7 -0
- package/dist/react/{chunk-UQBT7F4K.js → chunk-V2QTYSBK.js} +2 -2
- package/dist/react/{chunk-73VA5ALZ.js → chunk-XFQECTTF.js} +48 -19
- package/dist/react/chunk-XFQECTTF.js.map +7 -0
- package/dist/react/{chunk-O64N5JPO.js → chunk-YF3TK7SC.js} +2 -2
- package/dist/react/{circleTool-RDOIMKKV.js → circleTool-KICNRQCI.js} +4 -4
- package/dist/react/{codeTool-O2Z7ZXGP.js → codeTool-NCQ73R6M.js} +5 -4
- package/dist/react/{frameTool-Z5ZDCX6H.js → frameTool-Y6KB67DO.js} +4 -4
- package/dist/react/{freehandTool-AAQCTMVM.js → freehandTool-MMULHCQ7.js} +4 -4
- package/dist/react/{iconTool-AUHRLOO2.js → iconTool-LSW2DYGB.js} +5 -4
- package/dist/react/{imageTool-DRKDCPUV.js → imageTool-2DSR32RX.js} +5 -4
- package/dist/react/index.js +141 -66
- package/dist/react/index.js.map +3 -3
- package/dist/react/{lineTool-XLOOZE3E.js → lineTool-N5I7IGT7.js} +4 -4
- package/dist/react/{rectangleTool-AEYDDJCA.js → rectangleTool-YUT7ZK2E.js} +4 -4
- package/dist/react/{textTool-UORBAAJE.js → textTool-IQOYPELP.js} +6 -5
- package/package.json +1 -1
- package/src/core/CopyPaste.js +34 -4
- package/src/core/GraphEngine.js +129 -185
- package/src/core/SceneSerializer.js +26 -0
- package/src/core/ScreenSpaceControls.js +60 -0
- package/src/core/Selection.js +19 -11
- package/src/core/UndoRedo.js +47 -3
- package/src/core/ZoomPan.js +3 -0
- package/src/react/components/canvas/MultiSelectActions.jsx +4 -1
- package/src/react/components/sidebars/IconSidebar.jsx +14 -23
- package/src/react/components/sidebars/ImageSidebar.jsx +47 -24
- package/src/react/store/useUIStore.js +71 -14
- package/src/shapes/Circle.js +2 -0
- package/src/shapes/Frame.js +26 -2
- package/src/shapes/FreehandStroke.js +2 -0
- package/src/shapes/IconShape.js +23 -25
- package/src/shapes/ImageShape.js +6 -2
- package/src/shapes/Rectangle.js +2 -0
- package/src/tools/codeTool.js +3 -2
- package/src/tools/frameTool.js +19 -9
- package/src/tools/iconTool.js +63 -26
- package/src/tools/imageTool.js +80 -14
- package/src/tools/textTool.js +3 -1
- package/dist/react/Circle-QQMKCKFR.js +0 -8
- package/dist/react/CopyPaste-JMIXWUUO.js.map +0 -7
- package/dist/react/Frame-VADA625S.js +0 -10
- package/dist/react/FreehandStroke-BOWDNAVC.js +0 -8
- package/dist/react/IconShape-32EYI2MA.js +0 -10
- package/dist/react/ImageShape-MYP2DVVH.js +0 -10
- package/dist/react/Line-FCCF2BOB.js +0 -10
- package/dist/react/Rectangle-MZ6ZB6KM.js +0 -8
- package/dist/react/SceneSerializer-ARTKPZVR.js.map +0 -7
- package/dist/react/ZoomPan-NYPDJBD5.js.map +0 -7
- package/dist/react/chunk-3VSGFP6U.js.map +0 -7
- package/dist/react/chunk-6G3ITAS5.js.map +0 -7
- package/dist/react/chunk-73VA5ALZ.js.map +0 -7
- package/dist/react/chunk-C62SXFBL.js.map +0 -7
- package/dist/react/chunk-CF7AK4ES.js.map +0 -7
- package/dist/react/chunk-FV3EPR4L.js.map +0 -7
- package/dist/react/chunk-HKYUJUD7.js.map +0 -7
- package/dist/react/chunk-JJTII2UQ.js.map +0 -7
- package/dist/react/chunk-MYYBFZD3.js.map +0 -7
- package/dist/react/chunk-N7NZLF6P.js.map +0 -7
- package/dist/react/chunk-QYNTPZON.js.map +0 -7
- package/dist/react/chunk-XCJOF6BM.js.map +0 -7
- /package/dist/react/{Circle-QQMKCKFR.js.map → Circle-6POZCUZD.js.map} +0 -0
- /package/dist/react/{Frame-VADA625S.js.map → Frame-RLSMJJSK.js.map} +0 -0
- /package/dist/react/{FreehandStroke-BOWDNAVC.js.map → FreehandStroke-U6GYZOM4.js.map} +0 -0
- /package/dist/react/{IconShape-32EYI2MA.js.map → IconShape-7OPXAKLK.js.map} +0 -0
- /package/dist/react/{ImageShape-MYP2DVVH.js.map → ImageShape-LRNJQCF3.js.map} +0 -0
- /package/dist/react/{Line-FCCF2BOB.js.map → Line-WWQFBNX5.js.map} +0 -0
- /package/dist/react/{Rectangle-MZ6ZB6KM.js.map → Rectangle-S7XUKWYD.js.map} +0 -0
- /package/dist/react/{Selection-YJNZRBON.js.map → Selection-ZL3G6IAO.js.map} +0 -0
- /package/dist/react/{SketchEngine-ZGYBIZG7.js.map → SketchEngine-BFLHJPCG.js.map} +0 -0
- /package/dist/react/{UndoRedo-BZ6W4QTV.js.map → UndoRedo-NL7KLR5B.js.map} +0 -0
- /package/dist/react/{arrowTool-LKFSZKXC.js.map → arrowTool-CNVGM6RX.js.map} +0 -0
- /package/dist/react/{chunk-JOPQ27YH.js.map → chunk-4BLMNGTR.js.map} +0 -0
- /package/dist/react/{chunk-2V7G2PLX.js.map → chunk-GPIYXREE.js.map} +0 -0
- /package/dist/react/{chunk-C72OHQLE.js.map → chunk-ILGAFR56.js.map} +0 -0
- /package/dist/react/{chunk-WEWMB35W.js.map → chunk-OFGJJKPH.js.map} +0 -0
- /package/dist/react/{chunk-UQBT7F4K.js.map → chunk-V2QTYSBK.js.map} +0 -0
- /package/dist/react/{chunk-O64N5JPO.js.map → chunk-YF3TK7SC.js.map} +0 -0
- /package/dist/react/{circleTool-RDOIMKKV.js.map → circleTool-KICNRQCI.js.map} +0 -0
- /package/dist/react/{codeTool-O2Z7ZXGP.js.map → codeTool-NCQ73R6M.js.map} +0 -0
- /package/dist/react/{frameTool-Z5ZDCX6H.js.map → frameTool-Y6KB67DO.js.map} +0 -0
- /package/dist/react/{freehandTool-AAQCTMVM.js.map → freehandTool-MMULHCQ7.js.map} +0 -0
- /package/dist/react/{iconTool-AUHRLOO2.js.map → iconTool-LSW2DYGB.js.map} +0 -0
- /package/dist/react/{imageTool-DRKDCPUV.js.map → imageTool-2DSR32RX.js.map} +0 -0
- /package/dist/react/{lineTool-XLOOZE3E.js.map → lineTool-N5I7IGT7.js.map} +0 -0
- /package/dist/react/{rectangleTool-AEYDDJCA.js.map → rectangleTool-YUT7ZK2E.js.map} +0 -0
- /package/dist/react/{textTool-UORBAAJE.js.map → textTool-IQOYPELP.js.map} +0 -0
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/core/SceneSerializer.js"],
|
|
4
|
+
"sourcesContent": ["/* eslint-disable */\n/**\n * SceneSerializer - Save and load .lixsketch scene files\n *\n * Format: JSON with metadata + serialized shapes array\n * File extension: .lixsketch (actually JSON)\n */\n\nimport { Rectangle } from '../shapes/Rectangle.js';\nimport { Circle } from '../shapes/Circle.js';\nimport { Line } from '../shapes/Line.js';\nimport { Arrow } from '../shapes/Arrow.js';\nimport { FreehandStroke } from '../shapes/FreehandStroke.js';\nimport { Frame } from '../shapes/Frame.js';\nimport { TextShape } from '../shapes/TextShape.js';\nimport { CodeShape } from '../shapes/CodeShape.js';\nimport { ImageShape } from '../shapes/ImageShape.js';\nimport { IconShape } from '../shapes/IconShape.js';\n\nconst FORMAT_VERSION = 1;\n\n// Generate a unique session ID for each scene\nlet _sessionID = null;\nexport function getSessionID() {\n if (!_sessionID) {\n _sessionID = `lx-${Date.now().toString(36)}-${Math.random().toString(36).slice(2, 8)}`;\n }\n return _sessionID;\n}\nexport function resetSessionID() {\n _sessionID = null;\n}\n\nfunction cloneOptions(options) {\n return JSON.parse(JSON.stringify(options));\n}\n\nfunction restoreDocBlockLinks(shape, data) {\n const ids = [...new Set((Array.isArray(data.docBlockIds)\n ? data.docBlockIds\n : (data.docBlockId ? [data.docBlockId] : [])).filter(Boolean))];\n shape.docBlockIds = ids;\n delete shape.docBlockId;\n if (ids.length) {\n (shape.group || shape.element)?.setAttribute('data-doc-block-ids', JSON.stringify(ids));\n }\n}\n\n// ============================================================\n// SERIALIZE a single shape to plain data\n// ============================================================\nfunction serializeShape(shape) {\n const base = {\n shapeID: shape.shapeID,\n // Optional many-to-many connections to BlockNote document blocks.\n // Stored with the encrypted scene so navigation survives restore.\n docBlockIds: [...new Set((Array.isArray(shape.docBlockIds)\n ? shape.docBlockIds\n : (shape.docBlockId ? [shape.docBlockId] : [])).filter(Boolean))],\n parentFrame: shape.parentFrame ? shape.parentFrame.shapeID : null,\n // Group membership \u2014 null when the shape isn't part of a group.\n // All shapes sharing a non-null groupId move/resize/rotate as a\n // unit (see Selection.handleMultiSelectionMouseDown).\n groupId: shape.groupId || null,\n };\n\n switch (shape.shapeName) {\n case 'rectangle':\n return {\n ...base,\n type: 'rectangle',\n x: shape.x, y: shape.y,\n width: shape.width, height: shape.height,\n rotation: shape.rotation,\n options: cloneOptions(shape.options),\n };\n\n case 'circle':\n return {\n ...base,\n type: 'circle',\n x: shape.x, y: shape.y,\n rx: shape.rx, ry: shape.ry,\n rotation: shape.rotation,\n options: cloneOptions(shape.options),\n };\n\n case 'line':\n return {\n ...base,\n type: 'line',\n startPoint: { x: shape.startPoint.x, y: shape.startPoint.y },\n endPoint: { x: shape.endPoint.x, y: shape.endPoint.y },\n controlPoint: shape.controlPoint ? { x: shape.controlPoint.x, y: shape.controlPoint.y } : null,\n isCurved: shape.isCurved || false,\n options: cloneOptions(shape.options),\n };\n\n case 'arrow': {\n const data = {\n ...base,\n type: 'arrow',\n startPoint: { x: shape.startPoint.x, y: shape.startPoint.y },\n endPoint: { x: shape.endPoint.x, y: shape.endPoint.y },\n options: cloneOptions(shape.options),\n arrowOutlineStyle: shape.arrowOutlineStyle,\n arrowHeadStyle: shape.arrowHeadStyle,\n arrowCurved: shape.arrowCurved,\n arrowCurveAmount: shape.arrowCurveAmount,\n };\n if (shape.controlPoint1) data.controlPoint1 = { x: shape.controlPoint1.x, y: shape.controlPoint1.y };\n if (shape.controlPoint2) data.controlPoint2 = { x: shape.controlPoint2.x, y: shape.controlPoint2.y };\n // Serialize attachments by shapeID\n if (shape.startAttachment) data.startAttachmentID = shape.startAttachment.shapeID;\n if (shape.endAttachment) data.endAttachmentID = shape.endAttachment.shapeID;\n return data;\n }\n\n case 'freehandStroke':\n return {\n ...base,\n type: 'freehandStroke',\n points: JSON.parse(JSON.stringify(shape.points)),\n rotation: shape.rotation,\n options: cloneOptions(shape.options),\n };\n\n case 'frame':\n return {\n ...base,\n type: 'frame',\n x: shape.x, y: shape.y,\n width: shape.width, height: shape.height,\n rotation: shape.rotation,\n frameName: shape.frameName,\n fillStyle: shape.fillStyle || 'transparent',\n fillColor: shape.fillColor || '#1e1e28',\n gridSize: shape.gridSize || 20,\n gridColor: shape.gridColor || 'rgba(255,255,255,0.06)',\n options: cloneOptions(shape.options),\n // Issue #24 bug #10: filter out null / undefined / shapeID-less\n // children. A stale reference would serialize as `null` and the\n // load path would skip it (logging a misleading \"missing shape\"\n // warning) \u2014 but also previously skewed the order tracking.\n containedShapeIDs: shape.containedShapes\n ? Array.from(shape.containedShapes)\n .filter(s => s && s.shapeID)\n .map(s => s.shapeID)\n : [],\n };\n\n case 'text': {\n const group = shape.group;\n return {\n ...base,\n type: 'text',\n x: shape.x, y: shape.y,\n rotation: shape.rotation,\n groupHTML: group.cloneNode(true).outerHTML,\n };\n }\n\n case 'code': {\n const group = shape.group;\n return {\n ...base,\n type: 'code',\n x: shape.x, y: shape.y,\n rotation: shape.rotation,\n groupHTML: group.cloneNode(true).outerHTML,\n };\n }\n\n case 'image': {\n const el = shape.element;\n return {\n ...base,\n type: 'image',\n x: shape.x, y: shape.y,\n width: shape.width, height: shape.height,\n rotation: shape.rotation,\n href: el.getAttribute('href') || el.getAttributeNS('http://www.w3.org/1999/xlink', 'href') || '',\n sizeBytes: Number(el.__fileSize || el.getAttribute('data-file-size')) || 0,\n cloudinaryId: el.getAttribute('data-cloudinary-id') || null,\n storageProvider: el.getAttribute('data-storage-provider') || 'platform_cloudinary',\n storageCloudName: el.getAttribute('data-storage-cloud-name') || null,\n frameType: shape._frameType || null,\n graphData: shape._frameType === 'graph' && shape._graphData\n ? cloneOptions(shape._graphData)\n : null,\n };\n }\n\n case 'icon': {\n const el = shape.element;\n return {\n ...base,\n type: 'icon',\n x: shape.x, y: shape.y,\n width: shape.width, height: shape.height,\n rotation: shape.rotation,\n elementHTML: el.cloneNode(true).outerHTML,\n viewboxWidth: parseFloat(el.getAttribute('data-viewbox-width')) || 24,\n viewboxHeight: parseFloat(el.getAttribute('data-viewbox-height')) || 24,\n };\n }\n\n default:\n console.warn('[SceneSerializer] Unknown shape type:', shape.shapeName);\n return null;\n }\n}\n\n// ============================================================\n// DESERIALIZE: Create a shape from saved data\n// ============================================================\nfunction deserializeShape(data) {\n const svgEl = window.svg;\n if (!svgEl) return null;\n const ns = 'http://www.w3.org/2000/svg';\n\n switch (data.type) {\n case 'rectangle': {\n const shape = new Rectangle(data.x, data.y, data.width, data.height, data.options || {});\n if (data.rotation) shape.rotation = data.rotation;\n if (data.shapeID) shape.shapeID = data.shapeID;\n return shape;\n }\n\n case 'circle': {\n const shape = new Circle(data.x, data.y, data.rx, data.ry, data.options || {});\n if (data.rotation) shape.rotation = data.rotation;\n if (data.shapeID) shape.shapeID = data.shapeID;\n return shape;\n }\n\n case 'line': {\n const shape = new Line(data.startPoint, data.endPoint, data.options || {});\n if (data.controlPoint) shape.controlPoint = data.controlPoint;\n if (data.isCurved) shape.isCurved = data.isCurved;\n if (data.shapeID) shape.shapeID = data.shapeID;\n return shape;\n }\n\n case 'arrow': {\n const shape = new Arrow(data.startPoint, data.endPoint, data.options || {});\n if (data.controlPoint1) shape.controlPoint1 = data.controlPoint1;\n if (data.controlPoint2) shape.controlPoint2 = data.controlPoint2;\n if (data.arrowOutlineStyle) shape.arrowOutlineStyle = data.arrowOutlineStyle;\n if (data.arrowHeadStyle) shape.arrowHeadStyle = data.arrowHeadStyle;\n if (data.arrowCurved) shape.arrowCurved = data.arrowCurved;\n if (data.arrowCurveAmount) shape.arrowCurveAmount = data.arrowCurveAmount;\n if (data.shapeID) shape.shapeID = data.shapeID;\n return shape;\n }\n\n case 'freehandStroke': {\n const shape = new FreehandStroke(data.points, data.options || {});\n if (data.rotation) shape.rotation = data.rotation;\n if (data.shapeID) shape.shapeID = data.shapeID;\n return shape;\n }\n\n case 'frame': {\n const frameOpts = { ...(data.options || {}), frameName: data.frameName || 'Frame' };\n if (data.fillStyle) frameOpts.fillStyle = data.fillStyle;\n if (data.fillColor) frameOpts.fillColor = data.fillColor;\n if (data.gridSize) frameOpts.gridSize = data.gridSize;\n if (data.gridColor) frameOpts.gridColor = data.gridColor;\n const shape = new Frame(data.x, data.y, data.width, data.height, frameOpts);\n if (data.rotation) shape.rotation = data.rotation;\n if (data.shapeID) shape.shapeID = data.shapeID;\n shape.draw();\n return shape;\n }\n\n case 'text': {\n if (!data.groupHTML) return null;\n const parser = new DOMParser();\n const doc = parser.parseFromString(`<svg xmlns=\"${ns}\">${data.groupHTML}</svg>`, 'image/svg+xml');\n const group = doc.querySelector('g');\n if (!group) return null;\n const imported = svgEl.ownerDocument.importNode(group, true);\n svgEl.appendChild(imported);\n const shape = new TextShape(imported);\n if (data.shapeID) shape.shapeID = data.shapeID;\n return shape;\n }\n\n case 'code': {\n if (!data.groupHTML) return null;\n const parser = new DOMParser();\n const doc = parser.parseFromString(`<svg xmlns=\"${ns}\">${data.groupHTML}</svg>`, 'image/svg+xml');\n const group = doc.querySelector('g');\n if (!group) return null;\n const imported = svgEl.ownerDocument.importNode(group, true);\n svgEl.appendChild(imported);\n const shape = new CodeShape(imported);\n if (data.shapeID) shape.shapeID = data.shapeID;\n return shape;\n }\n\n case 'image': {\n const imgEl = document.createElementNS(ns, 'image');\n imgEl.setAttribute('x', data.x);\n imgEl.setAttribute('y', data.y);\n imgEl.setAttribute('width', data.width);\n imgEl.setAttribute('height', data.height);\n imgEl.setAttribute('href', data.href);\n imgEl.setAttribute('preserveAspectRatio', 'none');\n if (data.sizeBytes) {\n imgEl.__fileSize = Number(data.sizeBytes) || 0;\n imgEl.setAttribute('data-file-size', String(imgEl.__fileSize));\n window.__roomImageBytesUsed = (window.__roomImageBytesUsed || 0) + imgEl.__fileSize;\n }\n if (data.cloudinaryId) imgEl.setAttribute('data-cloudinary-id', data.cloudinaryId);\n if (data.storageProvider) imgEl.setAttribute('data-storage-provider', data.storageProvider);\n if (data.storageCloudName) imgEl.setAttribute('data-storage-cloud-name', data.storageCloudName);\n svgEl.appendChild(imgEl);\n const shape = new ImageShape(imgEl);\n if (data.rotation) shape.rotation = data.rotation;\n if (data.shapeID) shape.shapeID = data.shapeID;\n if (data.frameType === 'graph' && data.graphData) {\n if (typeof window.__hydrateGraphShape === 'function') {\n window.__hydrateGraphShape(shape, data.graphData);\n } else {\n shape._frameType = 'graph';\n shape._graphData = cloneOptions(data.graphData);\n shape.element.setAttribute('data-graph-shape', 'true');\n }\n }\n return shape;\n }\n\n case 'icon': {\n if (!data.elementHTML) return null;\n const parser = new DOMParser();\n // Wrap in <svg> so the parser treats the <g> as a valid child, not a document root\n const doc = parser.parseFromString(`<svg xmlns=\"${ns}\">${data.elementHTML}</svg>`, 'image/svg+xml');\n const iconGroup = doc.querySelector('g');\n if (!iconGroup) return null;\n const imported = svgEl.ownerDocument.importNode(iconGroup, true);\n svgEl.appendChild(imported);\n const shape = new IconShape(imported);\n if (data.shapeID) shape.shapeID = data.shapeID;\n return shape;\n }\n\n default:\n console.warn('[SceneSerializer] Unknown type:', data.type);\n return null;\n }\n}\n\n// ============================================================\n// SAVE: Serialize entire scene to .lixsketch JSON\n// ============================================================\nexport function saveScene(workspaceName = 'Untitled') {\n const allShapes = window.shapes || [];\n const serialized = [];\n\n // Issue #24 bug #10: rebuild containment from each shape's own\n // `parentFrame` ref before serialising. The `containedShapes` array\n // on the frame side drifts over time (eraser, partial deletes, drag\n // out + drag back, etc.), and a missing entry there means the child\n // gets serialised as a top-level shape and the frame restores empty.\n // Each shape knows its own parent, so we trust THAT and override the\n // frame's array at save time.\n const childrenByFrame = new Map();\n for (const s of allShapes) {\n if (s && s.parentFrame && s.shapeID && s !== s.parentFrame) {\n const arr = childrenByFrame.get(s.parentFrame.shapeID) || [];\n arr.push(s.shapeID);\n childrenByFrame.set(s.parentFrame.shapeID, arr);\n }\n }\n\n for (const shape of allShapes) {\n const data = serializeShape(shape);\n if (!data) continue;\n if (data.type === 'frame' && shape.shapeID && childrenByFrame.has(shape.shapeID)) {\n const merged = new Set(data.containedShapeIDs || []);\n for (const id of childrenByFrame.get(shape.shapeID)) merged.add(id);\n data.containedShapeIDs = Array.from(merged);\n }\n serialized.push(data);\n }\n\n const scene = {\n format: 'lixsketch',\n version: FORMAT_VERSION,\n sessionID: getSessionID(),\n name: workspaceName,\n createdAt: new Date().toISOString(),\n viewport: window.currentViewBox ? { ...window.currentViewBox } : null,\n zoom: window.currentZoom || 1,\n shapes: serialized,\n };\n\n return scene;\n}\n\n// ============================================================\n// LOAD: Deserialize .lixsketch JSON and recreate scene\n// ============================================================\nexport function loadScene(sceneData) {\n if (!sceneData || sceneData.format !== 'lixsketch') {\n console.error('[SceneSerializer] Invalid scene format');\n return false;\n }\n\n // Clear current scene\n const svgEl = window.svg;\n if (!svgEl) return false;\n window.__roomImageBytesUsed = 0;\n\n // Remove all existing shape DOM elements\n const existingShapes = window.shapes || [];\n existingShapes.forEach(shape => {\n // For frames, clean up clipGroup and clipPath too\n if (shape.shapeName === 'frame') {\n if (shape.clipGroup && shape.clipGroup.parentNode) {\n shape.clipGroup.parentNode.removeChild(shape.clipGroup);\n }\n if (shape.clipPath && shape.clipPath.parentNode) {\n shape.clipPath.parentNode.removeChild(shape.clipPath);\n }\n }\n if (shape.group && shape.group.parentNode) {\n shape.group.parentNode.removeChild(shape.group);\n } else if (shape.element && shape.element.parentNode) {\n shape.element.parentNode.removeChild(shape.element);\n }\n });\n\n // Clear arrays IN PLACE \u2014 tool modules hold direct references to these\n // arrays from import-time, so replacing them breaks interactivity.\n if (window.shapes) window.shapes.length = 0; else window.shapes = [];\n window.currentShape = null;\n if (window.historyStack) window.historyStack.length = 0; else window.historyStack = [];\n if (window.redoStack) window.redoStack.length = 0; else window.redoStack = [];\n\n // Build ID -> shape map for frame containment and arrow attachments\n const idMap = new Map();\n\n // First pass: create all shapes (frames first to allow containment)\n const frameData = sceneData.shapes.filter(s => s.type === 'frame');\n const otherData = sceneData.shapes.filter(s => s.type !== 'frame');\n\n // Create frames first\n for (const data of frameData) {\n const shape = deserializeShape(data);\n if (shape) {\n // Restore group membership if present.\n if (data.groupId) shape.groupId = data.groupId;\n restoreDocBlockLinks(shape, data);\n window.shapes.push(shape);\n if (data.shapeID) idMap.set(data.shapeID, shape);\n }\n }\n\n // Create all other shapes\n for (const data of otherData) {\n const shape = deserializeShape(data);\n if (shape) {\n if (data.groupId) shape.groupId = data.groupId;\n restoreDocBlockLinks(shape, data);\n window.shapes.push(shape);\n if (data.shapeID) idMap.set(data.shapeID, shape);\n }\n }\n\n // Second pass: restore frame containment\n for (const data of frameData) {\n const frame = idMap.get(data.shapeID);\n if (frame && data.containedShapeIDs && data.containedShapeIDs.length > 0) {\n for (const childID of data.containedShapeIDs) {\n const child = idMap.get(childID);\n if (!child) {\n console.warn(`[SceneSerializer] Frame \"${data.frameName}\" references missing shape: ${childID}`);\n continue;\n }\n try {\n if (typeof frame.addShapeToFrame === 'function') {\n frame.addShapeToFrame(child);\n } else {\n // Fallback: manually set containment\n frame.containedShapes.push(child);\n child.parentFrame = frame;\n }\n } catch (err) {\n console.warn(`[SceneSerializer] Failed to restore containment for ${childID} in frame ${data.shapeID}:`, err);\n // Fallback: at least set the reference\n if (!frame.containedShapes.includes(child)) {\n frame.containedShapes.push(child);\n }\n child.parentFrame = frame;\n }\n }\n }\n }\n\n // Third pass: restore arrow attachments\n for (const data of sceneData.shapes) {\n if (data.type === 'arrow') {\n const arrow = idMap.get(data.shapeID);\n if (!arrow) continue;\n if (data.startAttachmentID) {\n const target = idMap.get(data.startAttachmentID);\n if (target && arrow.setStartAttachment) arrow.setStartAttachment(target);\n }\n if (data.endAttachmentID) {\n const target = idMap.get(data.endAttachmentID);\n if (target && arrow.setEndAttachment) arrow.setEndAttachment(target);\n }\n }\n }\n\n // \u2500\u2500 Fourth pass: frame containment reconciliation (issue #24 bug #10) \u2500\u2500\n //\n // The pass above attaches each child via `frame.addShapeToFrame(child)`,\n // which is supposed to move the child's <g> into the frame's clipGroup.\n // In practice LixScript-rendered scenes were reloading with empty\n // frames \u2014 children present in the shapes array, frame box drawn, but\n // the children's <g> elements stranded at the svg root (so visually\n // they look orphaned). The cause varies (transient `isBeingMovedByFrame`\n // flag carried over from save time, ordering glitches when nested\n // frames are restored, etc.). Rather than chase the source, repair the\n // DOM state here from the authoritative `containedShapes` array.\n for (const data of frameData) {\n const frame = idMap.get(data.shapeID);\n if (!frame) continue;\n\n // Clear stale flags that suppress DOM mutation inside addShapeToFrame.\n delete frame.isBeingMovedByFrame;\n delete frame.isDraggedOutTemporarily;\n\n // Ensure the frame's own clipGroup is direct child of svg \u2014 sub-frames\n // that didn't get re-parented yet are handled in the next loop.\n if (frame.clipGroup && frame.clipGroup.parentNode !== svgEl) {\n svgEl.appendChild(frame.clipGroup);\n }\n\n for (const child of frame.containedShapes || []) {\n if (!child) continue;\n delete child.isBeingMovedByFrame;\n delete child.isDraggedOutTemporarily;\n\n const el = child.group || child.element;\n if (el && el.parentNode !== frame.clipGroup) {\n if (el.parentNode) el.parentNode.removeChild(el);\n frame.clipGroup.appendChild(el);\n }\n // Sub-frames also carry their own clipGroup \u2014 nest it.\n if (child.shapeName === 'frame' && child.clipGroup\n && child.clipGroup.parentNode !== frame.clipGroup) {\n if (child.clipGroup.parentNode) child.clipGroup.parentNode.removeChild(child.clipGroup);\n frame.clipGroup.appendChild(child.clipGroup);\n }\n // Authoritative parent ref \u2014 `addShapeToFrame` should already\n // have set this but the no-op early return when the child was\n // already in containedShapes skips it.\n child.parentFrame = frame;\n }\n\n // Force the clip rect + visual to match. Some saved frames came\n // through with a stale clipRect from before the resize that lost\n // the children visually.\n if (typeof frame.updateClipPath === 'function') frame.updateClipPath();\n if (typeof frame.draw === 'function') {\n try { frame.draw(); } catch (err) { console.warn('[SceneSerializer] frame redraw failed:', err); }\n }\n }\n\n // Restore viewport\n if (sceneData.viewport && svgEl) {\n const vb = sceneData.viewport;\n window.currentViewBox = { ...vb };\n svgEl.setAttribute('viewBox', `${vb.x} ${vb.y} ${vb.width} ${vb.height}`);\n }\n if (sceneData.zoom) {\n window.currentZoom = sceneData.zoom;\n }\n\n console.log(`[SceneSerializer] Loaded ${window.shapes.length} shapes from \"${sceneData.name}\"`);\n window.dispatchEvent(new CustomEvent('lix-doc-canvas-links-changed'));\n\n // Re-sync tool flags so shapes are interactable after restore\n if (window.__sketchEngine && typeof window.__sketchEngine.setActiveTool === 'function') {\n const store = window.__sketchStoreApi;\n const currentTool = store ? store.getState().activeTool : 'select';\n window.__sketchEngine.setActiveTool(currentTool);\n } else {\n // Fallback: ensure selection tool is active\n window.isSelectionToolActive = true;\n }\n\n return true;\n}\n\n// ============================================================\n// DOWNLOAD: Trigger browser download of .lixsketch file\n// ============================================================\nexport function downloadScene(workspaceName = 'Untitled') {\n const scene = saveScene(workspaceName);\n const json = JSON.stringify(scene, null, 2);\n const blob = new Blob([json], { type: 'application/json' });\n const url = URL.createObjectURL(blob);\n\n const a = document.createElement('a');\n a.href = url;\n a.download = `${workspaceName.replace(/[^a-zA-Z0-9_-]/g, '_')}.lixjson`;\n document.body.appendChild(a);\n a.click();\n document.body.removeChild(a);\n URL.revokeObjectURL(url);\n}\n\n// ============================================================\n// UPLOAD: Open file picker and load .lixsketch file\n// ============================================================\n// Validate scene JSON structure before loading\nexport function validateScene(data) {\n if (!data || typeof data !== 'object') return { valid: false, error: 'Not a valid JSON object' };\n if (data.format !== 'lixsketch') return { valid: false, error: 'Not a LixSketch scene file (missing format field)' };\n if (!data.version || data.version > FORMAT_VERSION) return { valid: false, error: `Unsupported version: ${data.version}` };\n if (!Array.isArray(data.shapes)) return { valid: false, error: 'Invalid scene: missing shapes array' };\n return {\n valid: true,\n name: data.name || 'Untitled',\n shapeCount: data.shapes.length,\n sessionID: data.sessionID || null,\n createdAt: data.createdAt || null,\n };\n}\n\nexport function uploadScene() {\n return new Promise((resolve, reject) => {\n const input = document.createElement('input');\n input.type = 'file';\n input.accept = '.lixjson,.json';\n input.onchange = (e) => {\n const file = e.target.files[0];\n if (!file) return resolve(false);\n\n const reader = new FileReader();\n reader.onload = (ev) => {\n try {\n const data = JSON.parse(ev.target.result);\n const validation = validateScene(data);\n if (!validation.valid) {\n console.error('[SceneSerializer] Invalid file:', validation.error);\n resolve({ success: false, error: validation.error });\n return;\n }\n resetSessionID(); // New session for loaded scene\n const result = loadScene(data);\n resolve({ success: result, validation });\n } catch (err) {\n console.error('[SceneSerializer] Failed to parse file:', err);\n resolve({ success: false, error: 'Failed to parse JSON file' });\n }\n };\n reader.readAsText(file);\n };\n input.click();\n });\n}\n\n// ============================================================\n// EXPORT as PNG\n// ============================================================\nexport function exportAsPNG() {\n const svgEl = window.svg;\n if (!svgEl) return;\n\n const clone = svgEl.cloneNode(true);\n // Remove selection UI elements\n const selectionEls = clone.querySelectorAll('[data-selection], .selection-handle, .resize-handle, .rotation-handle');\n selectionEls.forEach(el => el.remove());\n\n const svgData = new XMLSerializer().serializeToString(clone);\n const canvas = document.createElement('canvas');\n const vb = svgEl.viewBox.baseVal;\n canvas.width = vb.width * 2; // 2x for retina\n canvas.height = vb.height * 2;\n const ctx = canvas.getContext('2d');\n ctx.scale(2, 2);\n\n const img = new Image();\n const svgBlob = new Blob([svgData], { type: 'image/svg+xml;charset=utf-8' });\n const url = URL.createObjectURL(svgBlob);\n\n img.onload = () => {\n // Draw dark background\n ctx.fillStyle = '#121212';\n ctx.fillRect(0, 0, vb.width, vb.height);\n ctx.drawImage(img, 0, 0, vb.width, vb.height);\n URL.revokeObjectURL(url);\n\n canvas.toBlob(blob => {\n const a = document.createElement('a');\n a.href = URL.createObjectURL(blob);\n a.download = 'lixsketch-export.png';\n document.body.appendChild(a);\n a.click();\n document.body.removeChild(a);\n }, 'image/png');\n };\n img.src = url;\n}\n\n// ============================================================\n// COPY to clipboard as PNG\n// ============================================================\nexport function copyAsPNG() {\n const svgEl = window.svg;\n if (!svgEl) return;\n\n const clone = svgEl.cloneNode(true);\n const selectionEls = clone.querySelectorAll('[data-selection], .selection-handle, .resize-handle, .rotation-handle');\n selectionEls.forEach(el => el.remove());\n\n const svgData = new XMLSerializer().serializeToString(clone);\n const canvas = document.createElement('canvas');\n const vb = svgEl.viewBox.baseVal;\n canvas.width = vb.width * 2;\n canvas.height = vb.height * 2;\n const ctx = canvas.getContext('2d');\n ctx.scale(2, 2);\n\n const img = new Image();\n const svgBlob = new Blob([svgData], { type: 'image/svg+xml;charset=utf-8' });\n const url = URL.createObjectURL(svgBlob);\n\n img.onload = () => {\n ctx.fillStyle = '#121212';\n ctx.fillRect(0, 0, vb.width, vb.height);\n ctx.drawImage(img, 0, 0, vb.width, vb.height);\n URL.revokeObjectURL(url);\n\n canvas.toBlob(blob => {\n if (!blob) return;\n navigator.clipboard.write([\n new ClipboardItem({ 'image/png': blob })\n ]).catch(err => console.warn('[SceneSerializer] Clipboard write failed:', err));\n }, 'image/png');\n };\n img.src = url;\n}\n\n// ============================================================\n// COPY to clipboard as SVG\n// ============================================================\nexport function copyAsSVG() {\n const svgEl = window.svg;\n if (!svgEl) return;\n\n const clone = svgEl.cloneNode(true);\n const selectionEls = clone.querySelectorAll('[data-selection], .selection-handle, .resize-handle, .rotation-handle');\n selectionEls.forEach(el => el.remove());\n\n const svgData = new XMLSerializer().serializeToString(clone);\n navigator.clipboard.writeText(svgData)\n .catch(err => console.warn('[SceneSerializer] Clipboard write failed:', err));\n}\n\n// ============================================================\n// EXPORT as PDF (uses browser print)\n// ============================================================\nexport function exportAsPDF() {\n const svgEl = window.svg;\n if (!svgEl) return;\n\n const clone = svgEl.cloneNode(true);\n const selectionEls = clone.querySelectorAll('[data-selection], .selection-handle, .resize-handle, .rotation-handle');\n selectionEls.forEach(el => el.remove());\n\n const svgData = new XMLSerializer().serializeToString(clone);\n const printWindow = window.open('', '_blank');\n printWindow.document.write(`\n <!DOCTYPE html>\n <html>\n <head><title>LixSketch Export</title>\n <style>\n body { margin: 0; background: #121212; display: flex; align-items: center; justify-content: center; min-height: 100vh; }\n svg { max-width: 100vw; max-height: 100vh; }\n @media print { body { background: white; } }\n </style>\n </head>\n <body>${svgData}</body>\n </html>\n `);\n printWindow.document.close();\n printWindow.focus();\n setTimeout(() => printWindow.print(), 500);\n}\n\n// ============================================================\n// RESET: Clear the entire canvas\n// ============================================================\nexport function resetCanvas() {\n const svgEl = window.svg;\n if (!svgEl) return;\n\n // Remove all shape DOM elements + frame clipGroups/clipPaths\n const existingShapes = window.shapes || [];\n existingShapes.forEach(shape => {\n if (shape.shapeName === 'frame') {\n if (shape.clipGroup && shape.clipGroup.parentNode) {\n shape.clipGroup.parentNode.removeChild(shape.clipGroup);\n }\n if (shape.clipPath && shape.clipPath.parentNode) {\n shape.clipPath.parentNode.removeChild(shape.clipPath);\n }\n }\n if (shape.group && shape.group.parentNode) {\n shape.group.parentNode.removeChild(shape.group);\n } else if (shape.element && shape.element.parentNode) {\n shape.element.parentNode.removeChild(shape.element);\n }\n });\n\n // Remove selection UI\n svgEl.querySelectorAll(\n '.selection-outline, .resize-anchor, .rotation-anchor, [data-selection]'\n ).forEach(el => el.remove());\n\n // Clear arrays IN PLACE (same reason as loadScene)\n if (window.shapes) window.shapes.length = 0; else window.shapes = [];\n window.currentShape = null;\n if (window.historyStack) window.historyStack.length = 0; else window.historyStack = [];\n if (window.redoStack) window.redoStack.length = 0; else window.redoStack = [];\n\n if (typeof window.clearAllSelections === 'function') {\n window.clearAllSelections();\n }\n if (typeof window.disableAllSideBars === 'function') {\n window.disableAllSideBars();\n }\n\n // Clear auto-save (both legacy and session-scoped keys)\n try {\n localStorage.removeItem('lixsketch-autosave');\n localStorage.removeItem('lixsketch-autosave-meta');\n const sid = window.__sessionID;\n if (sid) {\n localStorage.removeItem(`lixsketch-autosave-${sid}`);\n localStorage.removeItem(`lixsketch-autosave-meta-${sid}`);\n }\n } catch (_) {}\n\n console.log('[SceneSerializer] Canvas reset');\n if (typeof window.__collabSceneChanged === 'function') {\n window.__collabSceneChanged();\n }\n}\n\n// ============================================================\n// FIND: Search for text content on the canvas\n// ============================================================\nexport function findTextOnCanvas(query) {\n const allShapes = window.shapes || [];\n if (!query || query.trim() === '') return [];\n\n const lowerQuery = query.toLowerCase();\n const results = [];\n\n for (const shape of allShapes) {\n let textContent = '';\n\n if (shape.shapeName === 'text' || shape.shapeName === 'code') {\n const group = shape.group;\n if (group) {\n // Get all text content from SVG text/tspan elements\n const textEls = group.querySelectorAll('text, tspan');\n textEls.forEach(el => {\n if (el.textContent) textContent += el.textContent + ' ';\n });\n // Also check foreignObject content\n const foreignEls = group.querySelectorAll('foreignObject *');\n foreignEls.forEach(el => {\n if (el.textContent) textContent += el.textContent + ' ';\n });\n }\n } else if (shape.shapeName === 'frame') {\n textContent = shape.frameName || '';\n }\n\n textContent = textContent.trim();\n if (textContent && textContent.toLowerCase().includes(lowerQuery)) {\n results.push({\n shape,\n text: textContent,\n type: shape.shapeName,\n x: shape.x || 0,\n y: shape.y || 0,\n });\n }\n }\n\n return results;\n}\n\n// ============================================================\n// Initialize bridge for React components\n// ============================================================\nexport function initSceneSerializer() {\n window.__sceneSerializer = {\n save: saveScene,\n load: loadScene,\n download: downloadScene,\n upload: uploadScene,\n exportPNG: exportAsPNG,\n exportPDF: exportAsPDF,\n copyAsPNG,\n copyAsSVG,\n resetCanvas,\n findText: findTextOnCanvas,\n };\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmBA,IAAM,iBAAiB;AAGvB,IAAI,aAAa;AACV,SAAS,eAAe;AAC3B,MAAI,CAAC,YAAY;AACb,iBAAa,MAAM,KAAK,IAAI,EAAE,SAAS,EAAE,CAAC,IAAI,KAAK,OAAO,EAAE,SAAS,EAAE,EAAE,MAAM,GAAG,CAAC,CAAC;AAAA,EACxF;AAC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,iBAAiB;AAC3D,mBAAW,QAAQ,QAAM;AACrB,cAAI,GAAG,YAAa,gBAAe,GAAG,cAAc;AAAA,QACxD,CAAC;AAAA,MACL;AAAA,IACJ,WAAW,MAAM,cAAc,SAAS;AACpC,oBAAc,MAAM,aAAa;AAAA,IACrC;AAEA,kBAAc,YAAY,KAAK;AAC/B,QAAI,eAAe,YAAY,YAAY,EAAE,SAAS,UAAU,GAAG;AAC/D,cAAQ,KAAK;AAAA,QACT;AAAA,QACA,MAAM;AAAA,QACN,MAAM,MAAM;AAAA,QACZ,GAAG,MAAM,KAAK;AAAA,QACd,GAAG,MAAM,KAAK;AAAA,MAClB,CAAC;AAAA,IACL;AAAA,EACJ;AAEA,SAAO;AACX;AAKO,SAAS,sBAAsB;AAClC,SAAO,oBAAoB;AAAA,IACvB,MAAM;AAAA,IACN,MAAM;AAAA,IACN,UAAU;AAAA,IACV,QAAQ;AAAA,IACR,WAAW;AAAA,IACX,WAAW;AAAA,IACX;AAAA,IACA;AAAA,IACA;AAAA,IACA,UAAU;AAAA,EACd;AACJ;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -13,9 +13,10 @@ import {
|
|
|
13
13
|
removeMultiSelectionControls,
|
|
14
14
|
removeMultiSelectionRect,
|
|
15
15
|
selectShapesInRect
|
|
16
|
-
} from "./chunk-
|
|
17
|
-
import "./chunk-
|
|
18
|
-
import "./chunk-
|
|
16
|
+
} from "./chunk-AH4PWNEB.js";
|
|
17
|
+
import "./chunk-PAKA6HUX.js";
|
|
18
|
+
import "./chunk-YF3TK7SC.js";
|
|
19
|
+
import "./chunk-U3TB4KRS.js";
|
|
19
20
|
export {
|
|
20
21
|
clearAllSelections,
|
|
21
22
|
createMultiSelectionControls,
|
|
@@ -31,4 +32,4 @@ export {
|
|
|
31
32
|
removeMultiSelectionRect,
|
|
32
33
|
selectShapesInRect
|
|
33
34
|
};
|
|
34
|
-
//# sourceMappingURL=Selection-
|
|
35
|
+
//# sourceMappingURL=Selection-ZL3G6IAO.js.map
|
|
@@ -161,16 +161,16 @@ var SketchEngine = class {
|
|
|
161
161
|
{ Frame },
|
|
162
162
|
{ FreehandStroke }
|
|
163
163
|
] = await Promise.all([
|
|
164
|
-
import("./Rectangle-
|
|
165
|
-
import("./Circle-
|
|
164
|
+
import("./Rectangle-S7XUKWYD.js"),
|
|
165
|
+
import("./Circle-6POZCUZD.js"),
|
|
166
166
|
import("./Arrow-EF7ALH2Y.js"),
|
|
167
|
-
import("./Line-
|
|
167
|
+
import("./Line-WWQFBNX5.js"),
|
|
168
168
|
import("./TextShape-DY77FFI2.js"),
|
|
169
169
|
import("./CodeShape-TE74XP5V.js"),
|
|
170
|
-
import("./ImageShape-
|
|
171
|
-
import("./IconShape-
|
|
172
|
-
import("./Frame-
|
|
173
|
-
import("./FreehandStroke-
|
|
170
|
+
import("./ImageShape-LRNJQCF3.js"),
|
|
171
|
+
import("./IconShape-7OPXAKLK.js"),
|
|
172
|
+
import("./Frame-RLSMJJSK.js"),
|
|
173
|
+
import("./FreehandStroke-U6GYZOM4.js")
|
|
174
174
|
]);
|
|
175
175
|
window.Rectangle = Rectangle;
|
|
176
176
|
window.Circle = Circle;
|
|
@@ -206,16 +206,16 @@ var SketchEngine = class {
|
|
|
206
206
|
frameTool,
|
|
207
207
|
freehandTool
|
|
208
208
|
] = await Promise.all([
|
|
209
|
-
import("./rectangleTool-
|
|
210
|
-
import("./circleTool-
|
|
211
|
-
import("./arrowTool-
|
|
212
|
-
import("./lineTool-
|
|
213
|
-
import("./textTool-
|
|
214
|
-
import("./codeTool-
|
|
215
|
-
import("./imageTool-
|
|
216
|
-
import("./iconTool-
|
|
217
|
-
import("./frameTool-
|
|
218
|
-
import("./freehandTool-
|
|
209
|
+
import("./rectangleTool-YUT7ZK2E.js"),
|
|
210
|
+
import("./circleTool-KICNRQCI.js"),
|
|
211
|
+
import("./arrowTool-CNVGM6RX.js"),
|
|
212
|
+
import("./lineTool-N5I7IGT7.js"),
|
|
213
|
+
import("./textTool-IQOYPELP.js"),
|
|
214
|
+
import("./codeTool-NCQ73R6M.js"),
|
|
215
|
+
import("./imageTool-2DSR32RX.js"),
|
|
216
|
+
import("./iconTool-LSW2DYGB.js"),
|
|
217
|
+
import("./frameTool-Y6KB67DO.js"),
|
|
218
|
+
import("./freehandTool-MMULHCQ7.js")
|
|
219
219
|
]);
|
|
220
220
|
this._modules.tools = {
|
|
221
221
|
rectangleTool,
|
|
@@ -239,11 +239,11 @@ var SketchEngine = class {
|
|
|
239
239
|
resizeShapes,
|
|
240
240
|
resizeCode
|
|
241
241
|
] = await Promise.all([
|
|
242
|
-
import("./EventDispatcher-
|
|
243
|
-
import("./UndoRedo-
|
|
244
|
-
import("./Selection-
|
|
245
|
-
import("./ZoomPan-
|
|
246
|
-
import("./CopyPaste-
|
|
242
|
+
import("./EventDispatcher-O7HCQQNM.js"),
|
|
243
|
+
import("./UndoRedo-NL7KLR5B.js"),
|
|
244
|
+
import("./Selection-ZL3G6IAO.js"),
|
|
245
|
+
import("./ZoomPan-FAWA5OPS.js"),
|
|
246
|
+
import("./CopyPaste-FJN7K5LS.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-
|
|
265
|
+
const sceneSerializer = await import("./SceneSerializer-GSJR7ZHC.js");
|
|
266
266
|
if (sceneSerializer.initSceneSerializer) sceneSerializer.initSceneSerializer();
|
|
267
267
|
await Promise.all([
|
|
268
268
|
import("./eraserTool-2GS2LQCS.js"),
|
|
@@ -277,7 +277,7 @@ var SketchEngine = class {
|
|
|
277
277
|
if (copyPaste.initCopyPaste) copyPaste.initCopyPaste();
|
|
278
278
|
const aiRenderer = await import("./AIRenderer-SRF7LU5K.js");
|
|
279
279
|
if (aiRenderer.initAIRenderer) aiRenderer.initAIRenderer();
|
|
280
|
-
const graphEngine = await import("./GraphEngine-
|
|
280
|
+
const graphEngine = await import("./GraphEngine-MM6ALA2N.js");
|
|
281
281
|
if (graphEngine.initGraphEngine) graphEngine.initGraphEngine();
|
|
282
282
|
const layerOrder = await import("./LayerOrder-XCHF4MSS.js");
|
|
283
283
|
if (layerOrder.initLayerOrder) layerOrder.initLayerOrder();
|
|
@@ -414,4 +414,4 @@ export {
|
|
|
414
414
|
SketchEngine,
|
|
415
415
|
SketchEngine_default as default
|
|
416
416
|
};
|
|
417
|
-
//# sourceMappingURL=SketchEngine-
|
|
417
|
+
//# sourceMappingURL=SketchEngine-BFLHJPCG.js.map
|
|
@@ -12,7 +12,7 @@ import {
|
|
|
12
12
|
setTextReferences,
|
|
13
13
|
undo,
|
|
14
14
|
updateSelectedElement
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-U3TB4KRS.js";
|
|
16
16
|
export {
|
|
17
17
|
getCurrentSelectedElement,
|
|
18
18
|
pushCreateAction,
|
|
@@ -27,4 +27,4 @@ export {
|
|
|
27
27
|
undo,
|
|
28
28
|
updateSelectedElement
|
|
29
29
|
};
|
|
30
|
-
//# sourceMappingURL=UndoRedo-
|
|
30
|
+
//# sourceMappingURL=UndoRedo-NL7KLR5B.js.map
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
"use client";
|
|
2
|
+
import {
|
|
3
|
+
installScreenSpaceControlSync
|
|
4
|
+
} from "./chunk-PAKA6HUX.js";
|
|
2
5
|
|
|
3
6
|
// src/core/ZoomPan.js
|
|
7
|
+
installScreenSpaceControlSync(freehandCanvas);
|
|
4
8
|
var scrollRate = 50;
|
|
5
9
|
function updateZoomDisplay() {
|
|
6
10
|
zoomPercentSpan.innerText = Math.round(currentZoom * 100) + "%";
|
|
@@ -259,4 +263,4 @@ svg.addEventListener("wheel", (e) => {
|
|
|
259
263
|
`${currentViewBox.x} ${currentViewBox.y} ${currentViewBox.width} ${currentViewBox.height}`
|
|
260
264
|
);
|
|
261
265
|
});
|
|
262
|
-
//# sourceMappingURL=ZoomPan-
|
|
266
|
+
//# sourceMappingURL=ZoomPan-FAWA5OPS.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/core/ZoomPan.js"],
|
|
4
|
+
"sourcesContent": ["/* eslint-disable */\nimport { installScreenSpaceControlSync } from './ScreenSpaceControls.js';\n// Zoom and Pan controls - combined from zoomFunction.js + panCanvas.js\n// Depends on globals: svg, freehandCanvas, currentZoom, currentViewBox, isPanningToolActive, isPanning\n// Depends on globals: minScale, maxScale, zoomInBtn, zoomOutBtn, zoomPercentSpan, panStart, startCanvasX, startCanvasY\n\ninstallScreenSpaceControlSync(freehandCanvas);\n\n// === Zoom Functions ===\nlet currentY = 0;\nconst scrollRate = 50;\n\nfunction updateZoomDisplay() {\n zoomPercentSpan.innerText = Math.round(currentZoom * 100) + \"%\";\n}\n\nfunction updateViewBox(anchorX = null, anchorY = null) {\n const width = window.innerWidth;\n const height = window.innerHeight;\n const scaledWidth = width / currentZoom;\n const scaledHeight = height / currentZoom;\n\n let centerX, centerY;\n\n if (anchorX === null || anchorY === null) {\n centerX = currentViewBox.x + (currentViewBox.width / 2);\n centerY = currentViewBox.y + (currentViewBox.height / 2);\n } else {\n\n centerX = anchorX;\n centerY = anchorY;\n }\n\n const viewBoxX = centerX - (scaledWidth / 2);\n const viewBoxY = centerY - (scaledHeight / 2);\n\n freehandCanvas.setAttribute(\n \"viewBox\",\n `${viewBoxX} ${viewBoxY} ${scaledWidth} ${scaledHeight}`\n );\n\n currentViewBox.x = viewBoxX;\n currentViewBox.y = viewBoxY;\n currentViewBox.width = scaledWidth;\n currentViewBox.height = scaledHeight;\n}\n\nzoomInBtn.addEventListener(\"click\", function() {\n currentZoom *= 1.1;\n if (currentZoom > maxScale) currentZoom = maxScale;\n updateViewBox();\n updateZoomDisplay();\n});\n\nzoomOutBtn.addEventListener(\"click\", function() {\n currentZoom /= 1.1;\n if (currentZoom < minScale) currentZoom = minScale;\n updateViewBox();\n updateZoomDisplay();\n});\n\n// Exposed for React Footer buttons \u2014 zoom from center of canvas\nwindow.zoomFromCenter = function(direction) {\n if (direction > 0) {\n currentZoom *= 1.1;\n if (currentZoom > maxScale) currentZoom = maxScale;\n } else {\n currentZoom /= 1.1;\n if (currentZoom < minScale) currentZoom = minScale;\n }\n updateViewBox(); // null anchors = zoom from center\n updateZoomDisplay();\n // Sync React zoom state\n if (window.__sketchStoreApi && window.__sketchStoreApi.setZoom) {\n window.__sketchStoreApi.setZoom(currentZoom);\n }\n};\n\nwindow.zoomReset = function() {\n // Issue #24 bug #5: reset zoom in place around the current viewport\n // centre \u2014 do NOT recenter to (0, 0). Recentering used to make whatever\n // the user had on screen vanish until they panned back to it.\n const cx = currentViewBox.x + currentViewBox.width / 2;\n const cy = currentViewBox.y + currentViewBox.height / 2;\n\n currentZoom = 1;\n const rect = freehandCanvas.getBoundingClientRect();\n const vbW = rect.width || window.innerWidth;\n const vbH = rect.height || window.innerHeight;\n\n currentViewBox.x = cx - vbW / 2;\n currentViewBox.y = cy - vbH / 2;\n currentViewBox.width = vbW;\n currentViewBox.height = vbH;\n freehandCanvas.setAttribute(\n \"viewBox\",\n `${currentViewBox.x} ${currentViewBox.y} ${vbW} ${vbH}`\n );\n updateZoomDisplay();\n if (window.__sketchStoreApi && window.__sketchStoreApi.setZoom) {\n window.__sketchStoreApi.setZoom(1);\n }\n};\n\nfunction getShapeBoundsForFit(shape) {\n if (!shape) return null;\n\n const selection = window.multiSelection;\n if (selection && typeof selection.getShapeBounds === \"function\") {\n try {\n const bounds = selection.getShapeBounds(shape);\n if (bounds && [bounds.x, bounds.y, bounds.width, bounds.height].every(Number.isFinite)) {\n return bounds;\n }\n } catch {}\n }\n\n // Fall back to the common shape interface when selection is unavailable.\n // Accessing x/y instead of boundingBox preserves freehand move offsets.\n const bounds = {\n x: Number(shape.x),\n y: Number(shape.y),\n width: Number(shape.width),\n height: Number(shape.height),\n };\n return Object.values(bounds).every(Number.isFinite) ? bounds : null;\n}\n\nwindow.zoomFit = function() {\n if (!window.shapes || window.shapes.length === 0) {\n if (window.zoomReset) window.zoomReset();\n return;\n }\n\n let minX = Infinity;\n let minY = Infinity;\n let maxX = -Infinity;\n let maxY = -Infinity;\n\n window.shapes.forEach(shape => {\n const bounds = getShapeBoundsForFit(shape);\n if (!bounds) return;\n \n // Normalize coordinates just in case width/height is negative\n const x1 = Math.min(bounds.x, bounds.x + bounds.width);\n const x2 = Math.max(bounds.x, bounds.x + bounds.width);\n const y1 = Math.min(bounds.y, bounds.y + bounds.height);\n const y2 = Math.max(bounds.y, bounds.y + bounds.height);\n\n minX = Math.min(minX, x1);\n minY = Math.min(minY, y1);\n maxX = Math.max(maxX, x2);\n maxY = Math.max(maxY, y2);\n });\n\n if (minX === Infinity) {\n if (window.zoomReset) window.zoomReset();\n return;\n }\n\n const rect = freehandCanvas.getBoundingClientRect();\n const screenW = rect.width || window.innerWidth;\n const screenH = rect.height || window.innerHeight;\n\n const contentW = maxX - minX;\n const contentH = maxY - minY;\n \n // Add 10% padding\n const paddingX = Math.max(50, contentW * 0.1);\n const paddingY = Math.max(50, contentH * 0.1);\n\n const paddedW = contentW + paddingX * 2;\n const paddedH = contentH + paddingY * 2;\n\n // Calculate required zoom to fit the padded content in the screen\n const zoomX = screenW / paddedW;\n const zoomY = screenH / paddedH;\n \n let newZoom = Math.min(zoomX, zoomY);\n newZoom = Math.max(minScale, Math.min(newZoom, maxScale));\n\n // Center coordinate of the content\n const cx = minX + contentW / 2;\n const cy = minY + contentH / 2;\n\n // Set the new viewBox and zoom\n currentZoom = newZoom;\n const vbW = screenW / currentZoom;\n const vbH = screenH / currentZoom;\n\n currentViewBox.x = cx - vbW / 2;\n currentViewBox.y = cy - vbH / 2;\n currentViewBox.width = vbW;\n currentViewBox.height = vbH;\n\n freehandCanvas.setAttribute(\n \"viewBox\",\n `${currentViewBox.x} ${currentViewBox.y} ${vbW} ${vbH}`\n );\n \n updateZoomDisplay();\n if (window.__sketchStoreApi && window.__sketchStoreApi.setZoom) {\n window.__sketchStoreApi.setZoom(currentZoom);\n }\n};\n\nfreehandCanvas.addEventListener(\"wheel\", function(e) {\n if (!e.ctrlKey) return;\n e.preventDefault();\n\n // Determine the zoom delta\n const delta = e.deltaY > 0 ? -0.1 : 0.1;\n let newZoom = currentZoom + delta;\n if (newZoom < minScale) newZoom = minScale;\n if (newZoom > maxScale) newZoom = maxScale;\n\n // Get canvas bounding rect \u2014 this MUST be the SVG element's actual\n // size, not the window's. In split mode the canvas pane is narrower\n // than the viewport; using window.innerWidth here would produce a\n // viewBox aspect that doesn't match the element, and (with\n // preserveAspectRatio=\"none\" on the host) the content gets stretched\n // / squeezed on every zoom step.\n const rect = freehandCanvas.getBoundingClientRect();\n\n // Calculate mouse position relative to the canvas in pixels\n const mouseX = e.clientX - rect.left;\n const mouseY = e.clientY - rect.top;\n\n // Determine what fraction of the canvas the mouse is at\n const mouseFracX = mouseX / rect.width;\n const mouseFracY = mouseY / rect.height;\n\n // Compute the current viewBox coordinate under the mouse.\n // currentViewBox.width and .height represent the current viewBox dimensions.\n const anchorViewBoxX = currentViewBox.x + mouseFracX * currentViewBox.width;\n const anchorViewBoxY = currentViewBox.y + mouseFracY * currentViewBox.height;\n\n // New viewBox dimensions sized to the *element*, scaled by the new\n // zoom. This keeps the viewBox aspect ratio matching the element so\n // shapes stay undistorted.\n const newViewBoxWidth = rect.width / newZoom;\n const newViewBoxHeight = rect.height / newZoom;\n \n // Compute the new viewBox's x and y so that the anchor remains at the same screen fraction.\n // That means:\n // newViewBox.x + mouseFracX * newViewBoxWidth === anchorViewBoxX\n // Solve for newViewBox.x:\n const newViewBoxX = anchorViewBoxX - mouseFracX * newViewBoxWidth;\n const newViewBoxY = anchorViewBoxY - mouseFracY * newViewBoxHeight;\n \n // Update the viewBox attribute with the new values.\n freehandCanvas.setAttribute(\n \"viewBox\",\n `${newViewBoxX} ${newViewBoxY} ${newViewBoxWidth} ${newViewBoxHeight}`\n );\n \n // Update our state\n currentZoom = newZoom;\n currentViewBox = {\n x: newViewBoxX,\n y: newViewBoxY,\n width: newViewBoxWidth,\n height: newViewBoxHeight\n };\n\n updateZoomDisplay();\n // Sync React zoom state\n if (window.__sketchStoreApi && window.__sketchStoreApi.setZoom) {\n window.__sketchStoreApi.setZoom(currentZoom);\n }\n});\n\n// Function to resize the canvas to fill the screen (initial setup)\nfunction resizeCanvas() {\n const width = window.innerWidth;\n const height = window.innerHeight;\n\n freehandCanvas.style.width = `${width}px`;\n freehandCanvas.style.height = `${height}px`;\n\n // Set initial viewBox based on initial zoom\n updateViewBox(); // Initial center anchor\n}\n\n\n\nlet isMiddleMousePanning = false;\n\nfreehandCanvas.addEventListener(\"mousedown\", function (e) {\n // Middle mouse button panning\n if (e.button === 1) {\n e.preventDefault();\n isMiddleMousePanning = true;\n isPanning = true;\n startCanvasX = e.clientX;\n startCanvasY = e.clientY;\n panStart = { x: e.clientX, y: e.clientY };\n freehandCanvas.style.cursor = 'grabbing';\n return;\n }\n if (isPanningToolActive) {\n isPanning = true;\n startCanvasX = e.clientX;\n startCanvasY = e.clientY;\n panStart = { x: e.clientX, y: e.clientY };\n freehandCanvas.style.cursor = 'grabbing';\n }\n});\n\nfreehandCanvas.addEventListener(\"mousemove\", (e) => {\n if (!isPanning) return;\n\n const dx = e.clientX - panStart.x;\n const dy = e.clientY - panStart.y;\n const dxViewBox = dx / currentZoom;\n const dyViewBox = dy / currentZoom;\n\n currentViewBox.x -= dxViewBox;\n currentViewBox.y -= dyViewBox;\n\n freehandCanvas.setAttribute(\n \"viewBox\",\n `${currentViewBox.x} ${currentViewBox.y} ${currentViewBox.width} ${currentViewBox.height}`\n );\n\n panStart = { x: e.clientX, y: e.clientY };\n});\n\nfreehandCanvas.addEventListener(\"mouseup\", (e) => {\n if (isMiddleMousePanning) {\n isMiddleMousePanning = false;\n isPanning = false;\n freehandCanvas.style.cursor = '';\n return;\n }\n if(isPanningToolActive)\n {\n isPanning = false;\n freehandCanvas.style.cursor = 'grab';\n }\n});\n\nfreehandCanvas.addEventListener(\"mouseleave\", () => {\n if (isMiddleMousePanning) {\n isMiddleMousePanning = false;\n isPanning = false;\n freehandCanvas.style.cursor = '';\n return;\n }\n if(isPanningToolActive)\n {\n isPanning = false;\n freehandCanvas.style.cursor = 'grab';\n }\n});\n\n// Prevent default middle-click auto-scroll behavior\nfreehandCanvas.addEventListener(\"auxclick\", (e) => {\n if (e.button === 1) e.preventDefault();\n});\n\n\nsvg.addEventListener(\"wheel\", (e) => {\n e.preventDefault();\n if (e.ctrlKey) return; // Ignore zoom gestures\n\n if (e.shiftKey) {\n // Pan sideways when Shift is held\n currentViewBox.x += e.deltaY > 0 ? scrollRate : -scrollRate;\n } else {\n // Pan vertically\n currentViewBox.y += e.deltaY > 0 ? scrollRate : -scrollRate;\n }\n\n svg.setAttribute(\n \"viewBox\",\n `${currentViewBox.x} ${currentViewBox.y} ${currentViewBox.width} ${currentViewBox.height}`\n );\n});\n"],
|
|
5
|
+
"mappings": ";;;;;;AAMA,8BAA8B,cAAc;AAI5C,IAAM,aAAa;AAEnB,SAAS,oBAAoB;AAC3B,kBAAgB,YAAY,KAAK,MAAM,cAAc,GAAG,IAAI;AAC9D;AAEA,SAAS,cAAc,UAAU,MAAM,UAAU,MAAM;AACrD,QAAM,QAAQ,OAAO;AACrB,QAAM,SAAS,OAAO;AACtB,QAAM,cAAc,QAAQ;AAC5B,QAAM,eAAe,SAAS;AAE9B,MAAI,SAAS;AAEb,MAAI,YAAY,QAAQ,YAAY,MAAM;AACxC,cAAU,eAAe,IAAK,eAAe,QAAQ;AACrD,cAAU,eAAe,IAAK,eAAe,SAAS;AAAA,EACxD,OAAO;AAEL,cAAU;AACV,cAAU;AAAA,EACZ;AAEA,QAAM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;AAEA,MAAI;AAAA,IACA;AAAA,IACA,GAAG,eAAe,CAAC,IAAI,eAAe,CAAC,IAAI,eAAe,KAAK,IAAI,eAAe,MAAM;AAAA,EAC5F;AACF,CAAC;",
|
|
6
|
+
"names": ["bounds"]
|
|
7
|
+
}
|
|
@@ -5,8 +5,8 @@ import {
|
|
|
5
5
|
handleMouseMove,
|
|
6
6
|
handleMouseUp,
|
|
7
7
|
updateAttachedArrows
|
|
8
|
-
} from "./chunk-
|
|
9
|
-
import "./chunk-
|
|
8
|
+
} from "./chunk-YF3TK7SC.js";
|
|
9
|
+
import "./chunk-U3TB4KRS.js";
|
|
10
10
|
export {
|
|
11
11
|
cleanupAttachments,
|
|
12
12
|
handleMouseDown as handleMouseDownArrow,
|
|
@@ -14,4 +14,4 @@ export {
|
|
|
14
14
|
handleMouseUp as handleMouseUpArrow,
|
|
15
15
|
updateAttachedArrows
|
|
16
16
|
};
|
|
17
|
-
//# sourceMappingURL=arrowTool-
|
|
17
|
+
//# sourceMappingURL=arrowTool-CNVGM6RX.js.map
|
|
@@ -1,13 +1,11 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import {
|
|
3
3
|
updateAttachedArrows
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-YF3TK7SC.js";
|
|
5
5
|
|
|
6
6
|
// src/shapes/ImageShape.js
|
|
7
7
|
var isDragging = false;
|
|
8
8
|
var hoveredFrameImage = null;
|
|
9
|
-
function selectImage() {
|
|
10
|
-
}
|
|
11
9
|
var ImageShape = class {
|
|
12
10
|
constructor(element) {
|
|
13
11
|
this.element = element;
|
|
@@ -201,12 +199,13 @@ var ImageShape = class {
|
|
|
201
199
|
svg.querySelectorAll(".resize-anchor, .rotation-anchor").forEach((el) => el.remove());
|
|
202
200
|
}
|
|
203
201
|
selectShape() {
|
|
204
|
-
|
|
205
|
-
|
|
202
|
+
if (typeof window.__selectImageElement === "function") {
|
|
203
|
+
window.__selectImageElement(this.element, { force: true });
|
|
204
|
+
}
|
|
206
205
|
}
|
|
207
206
|
};
|
|
208
207
|
|
|
209
208
|
export {
|
|
210
209
|
ImageShape
|
|
211
210
|
};
|
|
212
|
-
//# sourceMappingURL=chunk-
|
|
211
|
+
//# sourceMappingURL=chunk-2FMFOPGW.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/shapes/ImageShape.js"],
|
|
4
|
-
"sourcesContent": ["/* eslint-disable */\n// ImageShape class - extracted from imageTool.js\n// Depends on globals: svg, shapes, currentShape\n\nimport { updateAttachedArrows as updateArrowsForShape } from \"../tools/arrowTool.js\";\nlet isDragging = false;\nlet hoveredFrameImage = null;\nfunction selectImage() {} // stub - image selection handled by imageTool\n\nclass ImageShape {\n constructor(element) {\n this.element = element;\n this.shapeName = 'image';\n this.shapeID = element.shapeID || `image-${String(Date.now()).slice(0, 8)}-${Math.floor(Math.random() * 10000)}`;\n\n // Frame attachment properties\n this.parentFrame = null;\n\n // Upload pipeline state\n this.uploadStatus = 'pending'; // 'pending' | 'uploading' | 'done' | 'failed'\n this.uploadAbortController = null;\n this._uploadIndicator = null;\n\n // Update element attributes\n this.element.setAttribute('type', 'image');\n this.element.shapeID = this.shapeID;\n\n // Create a group wrapper for the image to work with frames properly\n this.group = document.createElementNS('http://www.w3.org/2000/svg', 'g');\n this.group.setAttribute('id', this.shapeID);\n\n // Move the image element into the group\n if (this.element.parentNode) {\n this.element.parentNode.removeChild(this.element);\n }\n this.group.appendChild(this.element);\n svg.appendChild(this.group);\n }\n\n showUploadIndicator() {\n if (this._uploadIndicator) return;\n const g = document.createElementNS('http://www.w3.org/2000/svg', 'g');\n g.setAttribute('class', 'upload-indicator');\n\n const x = this.x + 6;\n const y = this.y + 6;\n\n // Background circle\n const bg = document.createElementNS('http://www.w3.org/2000/svg', 'circle');\n bg.setAttribute('cx', x + 10);\n bg.setAttribute('cy', y + 10);\n bg.setAttribute('r', 12);\n bg.setAttribute('fill', 'rgba(0,0,0,0.7)');\n g.appendChild(bg);\n\n // Caution/loading icon (\u26A1 style triangle)\n const icon = document.createElementNS('http://www.w3.org/2000/svg', 'polygon');\n icon.setAttribute('points', `${x+10},${y+3} ${x+17},${y+16} ${x+3},${y+16}`);\n icon.setAttribute('fill', 'none');\n icon.setAttribute('stroke', '#FBBF24');\n icon.setAttribute('stroke-width', '1.5');\n icon.setAttribute('stroke-linejoin', 'round');\n g.appendChild(icon);\n\n // Exclamation mark inside\n const line = document.createElementNS('http://www.w3.org/2000/svg', 'line');\n line.setAttribute('x1', x + 10);\n line.setAttribute('y1', y + 8);\n line.setAttribute('x2', x + 10);\n line.setAttribute('y2', y + 12);\n line.setAttribute('stroke', '#FBBF24');\n line.setAttribute('stroke-width', '1.5');\n line.setAttribute('stroke-linecap', 'round');\n g.appendChild(line);\n\n const dot = document.createElementNS('http://www.w3.org/2000/svg', 'circle');\n dot.setAttribute('cx', x + 10);\n dot.setAttribute('cy', y + 14.5);\n dot.setAttribute('r', 0.8);\n dot.setAttribute('fill', '#FBBF24');\n g.appendChild(dot);\n\n // Pulsing animation\n const animate = document.createElementNS('http://www.w3.org/2000/svg', 'animate');\n animate.setAttribute('attributeName', 'opacity');\n animate.setAttribute('values', '1;0.4;1');\n animate.setAttribute('dur', '1.5s');\n animate.setAttribute('repeatCount', 'indefinite');\n g.appendChild(animate);\n\n // Apply same transform as image (rotation)\n const transform = this.element.getAttribute('transform');\n if (transform) g.setAttribute('transform', transform);\n\n g.style.pointerEvents = 'none';\n this.group.appendChild(g);\n this._uploadIndicator = g;\n }\n\n removeUploadIndicator() {\n if (this._uploadIndicator && this._uploadIndicator.parentNode) {\n this._uploadIndicator.parentNode.removeChild(this._uploadIndicator);\n }\n this._uploadIndicator = null;\n }\n\n updateUploadIndicatorPosition() {\n if (!this._uploadIndicator) return;\n const x = this.x + 6;\n const y = this.y + 6;\n\n const bg = this._uploadIndicator.querySelector('circle');\n if (bg) { bg.setAttribute('cx', x + 10); bg.setAttribute('cy', y + 10); }\n\n const icon = this._uploadIndicator.querySelector('polygon');\n if (icon) icon.setAttribute('points', `${x+10},${y+3} ${x+17},${y+16} ${x+3},${y+16}`);\n\n const line = this._uploadIndicator.querySelector('line');\n if (line) {\n line.setAttribute('x1', x + 10); line.setAttribute('y1', y + 8);\n line.setAttribute('x2', x + 10); line.setAttribute('y2', y + 12);\n }\n\n const dots = this._uploadIndicator.querySelectorAll('circle');\n if (dots[1]) { dots[1].setAttribute('cx', x + 10); dots[1].setAttribute('cy', y + 14.5); }\n\n const transform = this.element.getAttribute('transform');\n if (transform) this._uploadIndicator.setAttribute('transform', transform);\n }\n \n // Position and dimension properties for frame compatibility\n get x() {\n return parseFloat(this.element.getAttribute('x'));\n }\n \n set x(value) {\n this.element.setAttribute('x', value);\n this.element.setAttribute('data-shape-x', value);\n }\n \n get y() {\n return parseFloat(this.element.getAttribute('y'));\n }\n \n set y(value) {\n this.element.setAttribute('y', value);\n this.element.setAttribute('data-shape-y', value);\n }\n \n get width() {\n return parseFloat(this.element.getAttribute('width'));\n }\n \n set width(value) {\n this.element.setAttribute('width', value);\n this.element.setAttribute('data-shape-width', value);\n }\n \n get height() {\n return parseFloat(this.element.getAttribute('height'));\n }\n \n set height(value) {\n this.element.setAttribute('height', value);\n this.element.setAttribute('data-shape-height', value);\n }\n \n get rotation() {\n const transform = this.element.getAttribute('transform');\n if (transform) {\n const rotateMatch = transform.match(/rotate\\(([^,]+)/);\n if (rotateMatch) {\n return parseFloat(rotateMatch[1]);\n }\n }\n return 0;\n }\n \n set rotation(value) {\n const centerX = this.x + this.width / 2;\n const centerY = this.y + this.height / 2;\n this.element.setAttribute('transform', `rotate(${value}, ${centerX}, ${centerY})`);\n this.element.setAttribute('data-shape-rotation', value);\n }\n\n move(dx, dy) {\n this.x += dx;\n this.y += dy;\n\n // Update transform for rotation\n const centerX = this.x + this.width / 2;\n const centerY = this.y + this.height / 2;\n this.element.setAttribute('transform', `rotate(${this.rotation}, ${centerX}, ${centerY})`);\n\n // Only update frame containment if we're actively dragging the shape itself\n // and not being moved by a parent frame\n if (isDragging && !this.isBeingMovedByFrame) {\n this.updateFrameContainment();\n }\n\n this.updateAttachedArrows();\n }\n\n updateAttachedArrows() {\n updateArrowsForShape(this);\n }\n\n updateFrameContainment() {\n // Don't update if we're being moved by a frame\n if (this.isBeingMovedByFrame) return;\n \n let targetFrame = null;\n \n // Find which frame this shape is over\n if (typeof shapes !== 'undefined' && Array.isArray(shapes)) {\n shapes.forEach(shape => {\n if (shape.shapeName === 'frame' && shape.isShapeInFrame(this)) {\n targetFrame = shape;\n }\n });\n }\n \n // If we have a parent frame and we're being dragged, temporarily remove clipping\n if (this.parentFrame && isDragging) {\n this.parentFrame.temporarilyRemoveFromFrame(this);\n }\n \n // Update frame highlighting\n if (hoveredFrameImage && hoveredFrameImage !== targetFrame) {\n hoveredFrameImage.removeHighlight();\n }\n \n if (targetFrame && targetFrame !== hoveredFrameImage) {\n targetFrame.highlightFrame();\n }\n \n hoveredFrameImage = targetFrame;\n }\n\n contains(x, y) {\n const imgX = this.x;\n const imgY = this.y;\n const imgWidth = this.width;\n const imgHeight = this.height;\n \n // Simple bounding box check (could be enhanced for rotation)\n return x >= imgX && x <= imgX + imgWidth && y >= imgY && y <= imgY + imgHeight;\n }\n\n // Add draw method for consistency with other shapes\n draw() {\n // Images don't need redrawing like other shapes, but we need this method for consistency\n // Update any visual state if needed\n }\n\n // Add methods for frame compatibility\n removeSelection() {\n // Remove selection outlines from SVG\n svg.querySelectorAll(\".selection-outline\").forEach(el => el.remove());\n // Remove resize/rotation anchors if present\n svg.querySelectorAll(\".resize-anchor, .rotation-anchor\").forEach(el => el.remove());\n }\n\n selectShape() {\n // Select the image\n selectImage({ target: this.element, stopPropagation: () => {} });\n }\n}\n\nexport { ImageShape };\n"],
|
|
5
|
-
"mappings": ";;;;;;AAKA,IAAI,aAAa;AACjB,IAAI,oBAAoB;
|
|
4
|
+
"sourcesContent": ["/* eslint-disable */\n// ImageShape class - extracted from imageTool.js\n// Depends on globals: svg, shapes, currentShape\n\nimport { updateAttachedArrows as updateArrowsForShape } from \"../tools/arrowTool.js\";\nlet isDragging = false;\nlet hoveredFrameImage = null;\nfunction selectImage() {} // stub - image selection handled by imageTool\n\nclass ImageShape {\n constructor(element) {\n this.element = element;\n this.shapeName = 'image';\n this.shapeID = element.shapeID || `image-${String(Date.now()).slice(0, 8)}-${Math.floor(Math.random() * 10000)}`;\n\n // Frame attachment properties\n this.parentFrame = null;\n\n // Upload pipeline state\n this.uploadStatus = 'pending'; // 'pending' | 'uploading' | 'done' | 'failed'\n this.uploadAbortController = null;\n this._uploadIndicator = null;\n\n // Update element attributes\n this.element.setAttribute('type', 'image');\n this.element.shapeID = this.shapeID;\n\n // Create a group wrapper for the image to work with frames properly\n this.group = document.createElementNS('http://www.w3.org/2000/svg', 'g');\n this.group.setAttribute('id', this.shapeID);\n\n // Move the image element into the group\n if (this.element.parentNode) {\n this.element.parentNode.removeChild(this.element);\n }\n this.group.appendChild(this.element);\n svg.appendChild(this.group);\n }\n\n showUploadIndicator() {\n if (this._uploadIndicator) return;\n const g = document.createElementNS('http://www.w3.org/2000/svg', 'g');\n g.setAttribute('class', 'upload-indicator');\n\n const x = this.x + 6;\n const y = this.y + 6;\n\n // Background circle\n const bg = document.createElementNS('http://www.w3.org/2000/svg', 'circle');\n bg.setAttribute('cx', x + 10);\n bg.setAttribute('cy', y + 10);\n bg.setAttribute('r', 12);\n bg.setAttribute('fill', 'rgba(0,0,0,0.7)');\n g.appendChild(bg);\n\n // Caution/loading icon (\u26A1 style triangle)\n const icon = document.createElementNS('http://www.w3.org/2000/svg', 'polygon');\n icon.setAttribute('points', `${x+10},${y+3} ${x+17},${y+16} ${x+3},${y+16}`);\n icon.setAttribute('fill', 'none');\n icon.setAttribute('stroke', '#FBBF24');\n icon.setAttribute('stroke-width', '1.5');\n icon.setAttribute('stroke-linejoin', 'round');\n g.appendChild(icon);\n\n // Exclamation mark inside\n const line = document.createElementNS('http://www.w3.org/2000/svg', 'line');\n line.setAttribute('x1', x + 10);\n line.setAttribute('y1', y + 8);\n line.setAttribute('x2', x + 10);\n line.setAttribute('y2', y + 12);\n line.setAttribute('stroke', '#FBBF24');\n line.setAttribute('stroke-width', '1.5');\n line.setAttribute('stroke-linecap', 'round');\n g.appendChild(line);\n\n const dot = document.createElementNS('http://www.w3.org/2000/svg', 'circle');\n dot.setAttribute('cx', x + 10);\n dot.setAttribute('cy', y + 14.5);\n dot.setAttribute('r', 0.8);\n dot.setAttribute('fill', '#FBBF24');\n g.appendChild(dot);\n\n // Pulsing animation\n const animate = document.createElementNS('http://www.w3.org/2000/svg', 'animate');\n animate.setAttribute('attributeName', 'opacity');\n animate.setAttribute('values', '1;0.4;1');\n animate.setAttribute('dur', '1.5s');\n animate.setAttribute('repeatCount', 'indefinite');\n g.appendChild(animate);\n\n // Apply same transform as image (rotation)\n const transform = this.element.getAttribute('transform');\n if (transform) g.setAttribute('transform', transform);\n\n g.style.pointerEvents = 'none';\n this.group.appendChild(g);\n this._uploadIndicator = g;\n }\n\n removeUploadIndicator() {\n if (this._uploadIndicator && this._uploadIndicator.parentNode) {\n this._uploadIndicator.parentNode.removeChild(this._uploadIndicator);\n }\n this._uploadIndicator = null;\n }\n\n updateUploadIndicatorPosition() {\n if (!this._uploadIndicator) return;\n const x = this.x + 6;\n const y = this.y + 6;\n\n const bg = this._uploadIndicator.querySelector('circle');\n if (bg) { bg.setAttribute('cx', x + 10); bg.setAttribute('cy', y + 10); }\n\n const icon = this._uploadIndicator.querySelector('polygon');\n if (icon) icon.setAttribute('points', `${x+10},${y+3} ${x+17},${y+16} ${x+3},${y+16}`);\n\n const line = this._uploadIndicator.querySelector('line');\n if (line) {\n line.setAttribute('x1', x + 10); line.setAttribute('y1', y + 8);\n line.setAttribute('x2', x + 10); line.setAttribute('y2', y + 12);\n }\n\n const dots = this._uploadIndicator.querySelectorAll('circle');\n if (dots[1]) { dots[1].setAttribute('cx', x + 10); dots[1].setAttribute('cy', y + 14.5); }\n\n const transform = this.element.getAttribute('transform');\n if (transform) this._uploadIndicator.setAttribute('transform', transform);\n }\n \n // Position and dimension properties for frame compatibility\n get x() {\n return parseFloat(this.element.getAttribute('x'));\n }\n \n set x(value) {\n this.element.setAttribute('x', value);\n this.element.setAttribute('data-shape-x', value);\n }\n \n get y() {\n return parseFloat(this.element.getAttribute('y'));\n }\n \n set y(value) {\n this.element.setAttribute('y', value);\n this.element.setAttribute('data-shape-y', value);\n }\n \n get width() {\n return parseFloat(this.element.getAttribute('width'));\n }\n \n set width(value) {\n this.element.setAttribute('width', value);\n this.element.setAttribute('data-shape-width', value);\n }\n \n get height() {\n return parseFloat(this.element.getAttribute('height'));\n }\n \n set height(value) {\n this.element.setAttribute('height', value);\n this.element.setAttribute('data-shape-height', value);\n }\n \n get rotation() {\n const transform = this.element.getAttribute('transform');\n if (transform) {\n const rotateMatch = transform.match(/rotate\\(([^,]+)/);\n if (rotateMatch) {\n return parseFloat(rotateMatch[1]);\n }\n }\n return 0;\n }\n \n set rotation(value) {\n const centerX = this.x + this.width / 2;\n const centerY = this.y + this.height / 2;\n this.element.setAttribute('transform', `rotate(${value}, ${centerX}, ${centerY})`);\n this.element.setAttribute('data-shape-rotation', value);\n }\n\n move(dx, dy) {\n this.x += dx;\n this.y += dy;\n\n // Update transform for rotation\n const centerX = this.x + this.width / 2;\n const centerY = this.y + this.height / 2;\n this.element.setAttribute('transform', `rotate(${this.rotation}, ${centerX}, ${centerY})`);\n\n // Only update frame containment if we're actively dragging the shape itself\n // and not being moved by a parent frame\n if (isDragging && !this.isBeingMovedByFrame) {\n this.updateFrameContainment();\n }\n\n this.updateAttachedArrows();\n }\n\n updateAttachedArrows() {\n updateArrowsForShape(this);\n }\n\n updateFrameContainment() {\n // Don't update if we're being moved by a frame\n if (this.isBeingMovedByFrame) return;\n \n let targetFrame = null;\n \n // Find which frame this shape is over\n if (typeof shapes !== 'undefined' && Array.isArray(shapes)) {\n shapes.forEach(shape => {\n if (shape.shapeName === 'frame' && shape.isShapeInFrame(this)) {\n targetFrame = shape;\n }\n });\n }\n \n // If we have a parent frame and we're being dragged, temporarily remove clipping\n if (this.parentFrame && isDragging) {\n this.parentFrame.temporarilyRemoveFromFrame(this);\n }\n \n // Update frame highlighting\n if (hoveredFrameImage && hoveredFrameImage !== targetFrame) {\n hoveredFrameImage.removeHighlight();\n }\n \n if (targetFrame && targetFrame !== hoveredFrameImage) {\n targetFrame.highlightFrame();\n }\n \n hoveredFrameImage = targetFrame;\n }\n\n contains(x, y) {\n const imgX = this.x;\n const imgY = this.y;\n const imgWidth = this.width;\n const imgHeight = this.height;\n \n // Simple bounding box check (could be enhanced for rotation)\n return x >= imgX && x <= imgX + imgWidth && y >= imgY && y <= imgY + imgHeight;\n }\n\n // Add draw method for consistency with other shapes\n draw() {\n // Images don't need redrawing like other shapes, but we need this method for consistency\n // Update any visual state if needed\n }\n\n // Add methods for frame compatibility\n removeSelection() {\n // Remove selection outlines from SVG\n svg.querySelectorAll(\".selection-outline\").forEach(el => el.remove());\n // Remove resize/rotation anchors if present\n svg.querySelectorAll(\".resize-anchor, .rotation-anchor\").forEach(el => el.remove());\n }\n\n selectShape() {\n // Image interaction state lives in imageTool. Use its bridge so\n // programmatically-created images (graphs, restored scenes, paste)\n // receive the same drag/resize controls as pointer-selected images.\n if (typeof window.__selectImageElement === 'function') {\n window.__selectImageElement(this.element, { force: true });\n }\n }\n}\n\nexport { ImageShape };\n"],
|
|
5
|
+
"mappings": ";;;;;;AAKA,IAAI,aAAa;AACjB,IAAI,oBAAoB;AAGxB,IAAM,aAAN,MAAiB;AAAA,EACb,YAAY,SAAS;AACjB,SAAK,UAAU;AACf,SAAK,YAAY;AACjB,SAAK,UAAU,QAAQ,WAAW,SAAS,OAAO,KAAK,IAAI,CAAC,EAAE,MAAM,GAAG,CAAC,CAAC,IAAI,KAAK,MAAM,KAAK,OAAO,IAAI,GAAK,CAAC;AAG9G,SAAK,cAAc;AAGnB,SAAK,eAA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AAM,QAAQ,MAAM,GAAG;AACxD,aAAO,QAAQ,WAAS;AACpB,YAAI,MAAM,cAAc,WAAW,MAAM,eAAe,IAAI,GAAG;AAC3D,wBAAc;AAAA,QAClB;AAAA,MACJ,CAAC;AAAA,IACL;AAGA,QAAI,KAAK,eAAe,YAAY;AAChC,WAAK,YAAY,2BAA2B,IAAI;AAAA,IACpD;AAGA,QAAI,qBAAqB,sBAAsB,aAAa;AACxD,wBAAkB,gBAAgB;AAAA,IACtC;AAEA,QAAI,eAAe,gBAAgB,mBAAmB;AAClD,kBAAY,eAAe;AAAA,IAC/B;AAEA,wBAAoB;AAAA,EACxB;AAAA,EAEA,SAAS,GAAG,GAAG;AACX,UAAM,OAAO,KAAK;AAClB,UAAM,OAAO,KAAK;AAClB,UAAM,WAAW,KAAK;AACtB,UAAM,YAAY,KAAK;AAGvB,WAAO,KAAK,QAAQ,KAAK,OAAO,YAAY,KAAK,QAAQ,KAAK,OAAO;AAAA,EACzE;AAAA;AAAA,EAGA,OAAO;AAAA,EAGP;AAAA;AAAA,EAGA,kBAAkB;AAEd,QAAI,iBAAiB,oBAAoB,EAAE,QAAQ,QAAM,GAAG,OAAO,CAAC;AAEpE,QAAI,iBAAiB,kCAAkC,EAAE,QAAQ,QAAM,GAAG,OAAO,CAAC;AAAA,EACtF;AAAA,EAEA,cAAc;AAIV,QAAI,OAAO,OAAO,yBAAyB,YAAY;AACnD,aAAO,qBAAqB,KAAK,SAAS,EAAE,OAAO,KAAK,CAAC;AAAA,IAC7D;AAAA,EACJ;AACJ;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -10,11 +10,14 @@ import {
|
|
|
10
10
|
setCodeLanguage,
|
|
11
11
|
updateCodeBackground,
|
|
12
12
|
wrapCodeElement
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-HFQZYCHJ.js";
|
|
14
|
+
import {
|
|
15
|
+
registerRotationAnchor
|
|
16
|
+
} from "./chunk-PAKA6HUX.js";
|
|
14
17
|
import {
|
|
15
18
|
cleanupAttachments,
|
|
16
19
|
updateAttachedArrows
|
|
17
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-YF3TK7SC.js";
|
|
18
21
|
import {
|
|
19
22
|
pushCreateAction,
|
|
20
23
|
pushDeleteActionWithAttachments,
|
|
@@ -23,7 +26,7 @@ import {
|
|
|
23
26
|
pushTransformAction,
|
|
24
27
|
setTextReferences,
|
|
25
28
|
updateSelectedElement
|
|
26
|
-
} from "./chunk-
|
|
29
|
+
} from "./chunk-U3TB4KRS.js";
|
|
27
30
|
|
|
28
31
|
// src/tools/textTool.js
|
|
29
32
|
function getThemeStroke() {
|
|
@@ -411,6 +414,7 @@ function createSelectionFeedback(groupElement) {
|
|
|
411
414
|
rotationAnchor.style.cursor = "grab";
|
|
412
415
|
rotationAnchor.setAttribute("pointer-events", "all");
|
|
413
416
|
groupElement.appendChild(rotationAnchor);
|
|
417
|
+
registerRotationAnchor(rotationAnchor, { radius: 8, edgeY: selY });
|
|
414
418
|
resizeHandles.rotate = rotationAnchor;
|
|
415
419
|
rotationAnchor.addEventListener("pointerdown", (e) => {
|
|
416
420
|
if (window.isSelectionToolActive) {
|
|
@@ -471,7 +475,7 @@ function updateSelectionFeedback() {
|
|
|
471
475
|
});
|
|
472
476
|
const rotationAnchor = resizeHandles.rotate;
|
|
473
477
|
if (rotationAnchor) {
|
|
474
|
-
const rotationAnchorPos = { x: selX + selWidth / 2, y: selY - 30 };
|
|
478
|
+
const rotationAnchorPos = { x: selX + selWidth / 2, y: selY - 30 / zoom2 };
|
|
475
479
|
rotationAnchor.setAttribute("cx", rotationAnchorPos.x);
|
|
476
480
|
rotationAnchor.setAttribute("cy", rotationAnchorPos.y);
|
|
477
481
|
}
|
|
@@ -1482,4 +1486,4 @@ export {
|
|
|
1482
1486
|
handleTextMouseUp,
|
|
1483
1487
|
updateCodeToggleForShape
|
|
1484
1488
|
};
|
|
1485
|
-
//# sourceMappingURL=chunk-
|
|
1489
|
+
//# sourceMappingURL=chunk-2THKDSWW.js.map
|