integration-modules 0.1.13 → 0.1.14
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/chunks/{Board-LDrQezYP.js → Board-CENI1zTY.js} +1 -2
- package/dist/chunks/Board-CENI1zTY.js.map +1 -0
- package/dist/chunks/{Board-BPjNyr3D.js → Board-DBlzUx0o.js} +2 -2
- package/dist/chunks/Board-DBlzUx0o.js.map +1 -0
- package/dist/chunks/{EmojiBoardWidget-C9Nx3caB.js → EmojiBoardWidget-94JjolG3.js} +69 -70
- package/dist/chunks/EmojiBoardWidget-94JjolG3.js.map +1 -0
- package/dist/chunks/{EmojiBoardWidget-DwyWXjjk.js → EmojiBoardWidget-jQpQl320.js} +2 -2
- package/dist/chunks/EmojiBoardWidget-jQpQl320.js.map +1 -0
- package/dist/chunks/{ShapeBoardWidget-BFWxWu8h.js → ShapeBoardWidget-C9nNKwtj.js} +9 -9
- package/dist/chunks/ShapeBoardWidget-C9nNKwtj.js.map +1 -0
- package/dist/chunks/{ShapeBoardWidget-ZKB_BDkq.js → ShapeBoardWidget-D1TcdWRO.js} +2 -2
- package/dist/chunks/ShapeBoardWidget-D1TcdWRO.js.map +1 -0
- package/dist/emoji/index.cjs +1 -1
- package/dist/emoji/index.js +2 -2
- package/dist/index.cjs +1 -1
- package/dist/index.mjs +5 -5
- package/dist/shape/index.cjs +1 -1
- package/dist/shape/index.js +1 -1
- package/package.json +1 -1
- package/dist/chunks/Board-BPjNyr3D.js.map +0 -1
- package/dist/chunks/Board-LDrQezYP.js.map +0 -1
- package/dist/chunks/EmojiBoardWidget-C9Nx3caB.js.map +0 -1
- package/dist/chunks/EmojiBoardWidget-DwyWXjjk.js.map +0 -1
- package/dist/chunks/ShapeBoardWidget-BFWxWu8h.js.map +0 -1
- package/dist/chunks/ShapeBoardWidget-ZKB_BDkq.js.map +0 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";var v=Object.create;var u=Object.defineProperty;var W=Object.getOwnPropertyDescriptor;var S=Object.getOwnPropertyNames;var B=Object.getPrototypeOf,N=Object.prototype.hasOwnProperty;var C=(e,i,r,h)=>{if(i&&typeof i=="object"||typeof i=="function")for(let n of S(i))!N.call(e,n)&&n!==r&&u(e,n,{get:()=>i[n],enumerable:!(h=W(i,n))||h.enumerable});return e};var A=(e,i,r)=>(r=e!=null?v(B(e)):{},C(i||!e||!e.__esModule?u(r,"default",{value:e,enumerable:!0}):r,e));const t=require("./Board-
|
|
2
|
-
//# sourceMappingURL=ShapeBoardWidget-
|
|
1
|
+
"use strict";var v=Object.create;var u=Object.defineProperty;var W=Object.getOwnPropertyDescriptor;var S=Object.getOwnPropertyNames;var B=Object.getPrototypeOf,N=Object.prototype.hasOwnProperty;var C=(e,i,r,h)=>{if(i&&typeof i=="object"||typeof i=="function")for(let n of S(i))!N.call(e,n)&&n!==r&&u(e,n,{get:()=>i[n],enumerable:!(h=W(i,n))||h.enumerable});return e};var A=(e,i,r)=>(r=e!=null?v(B(e)):{},C(i||!e||!e.__esModule?u(r,"default",{value:e,enumerable:!0}):r,e));const t=require("./Board-DBlzUx0o.js"),a=require("react"),I={square:t.jsxRuntimeExports.jsx("svg",{width:"40",height:"40",children:t.jsxRuntimeExports.jsx("rect",{x:"4",y:"4",width:"32",height:"32",stroke:"black",fill:"none",strokeWidth:"2"})}),circle:t.jsxRuntimeExports.jsx("svg",{width:"40",height:"40",children:t.jsxRuntimeExports.jsx("circle",{cx:"20",cy:"20",r:"14",stroke:"black",fill:"none",strokeWidth:"2"})}),triangle:t.jsxRuntimeExports.jsx("svg",{width:"40",height:"40",children:t.jsxRuntimeExports.jsx("polygon",{points:"20,6 34,34 6,34",stroke:"black",fill:"none",strokeWidth:"2"})}),star:t.jsxRuntimeExports.jsx("svg",{width:"40",height:"40",children:t.jsxRuntimeExports.jsx("polygon",{points:"20,4 25,16 38,16 27,24 32,36 20,28 8,36 13,24 2,16 15,16",stroke:"black",fill:"none",strokeWidth:"2"})}),stick:t.jsxRuntimeExports.jsx("svg",{width:"40",height:"40",children:t.jsxRuntimeExports.jsx("rect",{x:"16",y:"4",width:"8",height:"32",stroke:"black",fill:"none",strokeWidth:"2"})}),line:t.jsxRuntimeExports.jsx("svg",{width:"40",height:"40",children:t.jsxRuntimeExports.jsx("line",{x1:"4",y1:"20",x2:"36",y2:"20",stroke:"black",strokeWidth:"2"})}),arrow:t.jsxRuntimeExports.jsxs("svg",{width:"40",height:"40",children:[t.jsxRuntimeExports.jsx("line",{x1:"4",y1:"20",x2:"30",y2:"20",stroke:"black",strokeWidth:"2"}),t.jsxRuntimeExports.jsx("polygon",{points:"30,14 38,20 30,26",fill:"black"})]}),dblarrow:t.jsxRuntimeExports.jsxs("svg",{width:"40",height:"40",children:[t.jsxRuntimeExports.jsx("polygon",{points:"4,20 12,14 12,26",fill:"black"}),t.jsxRuntimeExports.jsx("line",{x1:"12",y1:"20",x2:"28",y2:"20",stroke:"black",strokeWidth:"2"}),t.jsxRuntimeExports.jsx("polygon",{points:"28,14 36,20 28,26",fill:"black"})]}),parallelogram:t.jsxRuntimeExports.jsx("svg",{width:"40",height:"40",viewBox:"0 0 40 40",children:t.jsxRuntimeExports.jsx("polygon",{points:"8,8 34,8 26,32 0,32",stroke:"black",fill:"none",strokeWidth:"2"})}),roundedRect:t.jsxRuntimeExports.jsx("svg",{width:"40",height:"40",viewBox:"0 0 40 40",children:t.jsxRuntimeExports.jsx("rect",{x:"6",y:"10",width:"28",height:"20",rx:"4",ry:"4",stroke:"black",fill:"none",strokeWidth:"2"})}),capsule:t.jsxRuntimeExports.jsx("svg",{width:"40",height:"40",viewBox:"0 0 40 40",children:t.jsxRuntimeExports.jsx("rect",{x:"6",y:"14",width:"28",height:"12",rx:"6",ry:"6",stroke:"black",fill:"none",strokeWidth:"2"})}),pentagon:t.jsxRuntimeExports.jsx("svg",{width:"40",height:"40",viewBox:"0 0 40 40",children:t.jsxRuntimeExports.jsx("polygon",{points:"20,6 34,15 28,32 12,32 6,15",stroke:"black",fill:"none",strokeWidth:"2"})}),chevron:t.jsxRuntimeExports.jsx("svg",{width:"40",height:"40",viewBox:"0 0 100 100",children:t.jsxRuntimeExports.jsx("polyline",{points:"0,0 50,100 100,0",fill:"none",stroke:"black",strokeWidth:"5"})}),table3x3:t.jsxRuntimeExports.jsxs("svg",{width:"40",height:"40",viewBox:"0 0 40 40",children:[t.jsxRuntimeExports.jsx("rect",{x:"4",y:"4",width:"32",height:"32",stroke:"black",fill:"none",strokeWidth:"2"}),t.jsxRuntimeExports.jsx("line",{x1:"14",y1:"4",x2:"14",y2:"36",stroke:"black",strokeWidth:"2"}),t.jsxRuntimeExports.jsx("line",{x1:"26",y1:"4",x2:"26",y2:"36",stroke:"black",strokeWidth:"2"}),t.jsxRuntimeExports.jsx("line",{x1:"4",y1:"14",x2:"36",y2:"14",stroke:"black",strokeWidth:"2"}),t.jsxRuntimeExports.jsx("line",{x1:"4",y1:"26",x2:"36",y2:"26",stroke:"black",strokeWidth:"2"})]}),pyramid:t.jsxRuntimeExports.jsxs("svg",{width:"40",height:"40",viewBox:"0 0 40 40",children:[t.jsxRuntimeExports.jsx("polygon",{points:"20,4 36,36 4,36",stroke:"black",fill:"none",strokeWidth:"2"}),t.jsxRuntimeExports.jsx("line",{x1:"15",y1:"12",x2:"25",y2:"12",stroke:"black",strokeWidth:"2"}),t.jsxRuntimeExports.jsx("line",{x1:"11",y1:"20",x2:"28",y2:"20",stroke:"black",strokeWidth:"2"}),t.jsxRuntimeExports.jsx("line",{x1:"7",y1:"28",x2:"32",y2:"28",stroke:"black",strokeWidth:"2"})]}),circleArrow:t.jsxRuntimeExports.jsxs("svg",{width:"40",height:"40",viewBox:"0 0 40 40",children:[t.jsxRuntimeExports.jsx("circle",{cx:"20",cy:"20",r:"14",stroke:"black",fill:"none",strokeWidth:"2"}),t.jsxRuntimeExports.jsx("line",{x1:"20",y1:"6",x2:"20",y2:"0",stroke:"black",strokeWidth:"2"}),t.jsxRuntimeExports.jsx("polygon",{points:"18,2 22,2 20,0",fill:"black"})]}),table3x3LeftMerge:t.jsxRuntimeExports.jsxs("svg",{width:"40",height:"40",viewBox:"0 0 40 40",children:[t.jsxRuntimeExports.jsx("rect",{x:"4",y:"4",width:"32",height:"32",stroke:"black",fill:"none",strokeWidth:"2"}),t.jsxRuntimeExports.jsx("line",{x1:"14",y1:"4",x2:"14",y2:"36",stroke:"black",strokeWidth:"2"}),t.jsxRuntimeExports.jsx("line",{x1:"26",y1:"4",x2:"26",y2:"36",stroke:"black",strokeWidth:"2"}),t.jsxRuntimeExports.jsx("line",{x1:"14",y1:"16",x2:"36",y2:"16",stroke:"black",strokeWidth:"2"}),t.jsxRuntimeExports.jsx("line",{x1:"14",y1:"28",x2:"36",y2:"28",stroke:"black",strokeWidth:"2"})]})},P="data:image/svg+xml,%3csvg%20width='50'%20height='50'%20viewBox='0%200%2050%2050'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M3%201.5H47C47.8284%201.5%2048.5%202.17157%2048.5%203V47C48.5%2047.8284%2047.8284%2048.5%2047%2048.5H3C2.17157%2048.5%201.5%2047.8284%201.5%2047V3C1.5%202.17157%202.17157%201.5%203%201.5Z'%20stroke='black'%20stroke-width='3'/%3e%3c/svg%3e",T="data:image/svg+xml,%3csvg%20width='50'%20height='50'%20viewBox='0%200%2050%2050'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M3%201.5H47C47.8284%201.5%2048.5%202.17157%2048.5%203V47C48.5%2047.8284%2047.8284%2048.5%2047%2048.5H3C2.17157%2048.5%201.5%2047.8284%201.5%2047V3C1.5%202.17157%202.17157%201.5%203%201.5Z'%20stroke='%230000FF'%20stroke-width='3'/%3e%3c/svg%3e",m=()=>{const[e,i]=a.useState(!1),r=a.useRef(null),h=s=>{s.stopPropagation(),i(l=>!l)};a.useEffect(()=>{if(!e)return;const s=l=>{r.current&&!r.current.contains(l.target)&&i(!1)};return window.addEventListener("pointerdown",s),()=>window.removeEventListener("pointerdown",s)},[e]);const n=s=>l=>{l.stopPropagation(),l.dataTransfer.setData(t.DND_SHAPE,JSON.stringify({shapeId:s.id})),l.dataTransfer.effectAllowed="copy"};return t.jsxRuntimeExports.jsxs("div",{className:"left-toolbar-container",ref:r,onClick:s=>s.stopPropagation(),children:[t.jsxRuntimeExports.jsx("div",{className:`toolbar-card ${e?"toolbar-card--open":""}`,children:t.jsxRuntimeExports.jsx("button",{onClick:h,className:`toolbar-btn toolbar-btn--icon toolbar-btn--shape ${e?"toolbar-btn--active":""}`,children:t.jsxRuntimeExports.jsx("div",{className:`toolbar-shape-plate ${e?"toolbar-shape-plate--active":""}`,children:t.jsxRuntimeExports.jsx("img",{src:e?T:P,alt:"Фигуры",draggable:!1})})})}),e&&t.jsxRuntimeExports.jsx("div",{className:"palette-wrapper",onClick:s=>s.stopPropagation(),children:t.jsxRuntimeExports.jsx("div",{className:"shape-panel",children:t.jsxRuntimeExports.jsx("div",{className:"shape-grid",children:t.SHAPES.map(s=>t.jsxRuntimeExports.jsx("button",{className:"shape-item",draggable:!0,onDragStart:n(s),title:s.name,children:I[s.id]},s.id))})})}),t.jsxRuntimeExports.jsx(t.ShapeNode,{shapeOpen:e})]})},E={shape:t.ShapeNode},d=({children:e})=>t.jsxRuntimeExports.jsx("div",{children:e}),D=({nodeTypes:e})=>{const i=t.useStickersStore(p=>p.setStickers),r=a.useRef(null),[h,n]=a.useState(()=>d),s={...E,...e||{}};a.useEffect(()=>{(async()=>{try{const[o,c]=await Promise.all([t.shapesApi.getAll(),t.shapesApi.getBoard()]),R=new Map(o.map(x=>[String(x.id),x.shapeId]));let j=30,k=30;const g=[];for(const x of c){const w=x.width??140,y=x.height??140,b=x.rotation??0,f=R.get(String(x.shapeId))??"square";g.push({id:x.id,stickerId:x.id,type:"shape",shapeId:f,shapeDbId:x.shapeId,x:j,y:k,width:w,height:y,rotation:b,zIndex:1,fill:"transparent",stroke:"#000"}),j+=24,k+=24}i(g)}catch(o){console.warn("Не удалось загрузить доску для фигур:",o)}})()},[i]),a.useEffect(()=>{let p=!0;return import("@xyflow/react").then(o=>{if(!p)return;const c=(o&&(o.Widget||o.default||(o==null?void 0:o.widget)||(o==null?void 0:o.XyflowWidget)))??null;typeof c=="function"||a.isValidElement(c)?n(()=>c):n(()=>d)}).catch(()=>{p&&n(()=>d)}),()=>{p=!1}},[]);const l=h||d;return t.jsxRuntimeExports.jsx(l,{children:t.jsxRuntimeExports.jsxs("div",{className:"relative flex h-screen w-screen bg-gray-100",children:[t.jsxRuntimeExports.jsx(m,{}),t.jsxRuntimeExports.jsx(t.Board,{ref:r,nodeTypes:s})]})})};exports.ShapeBoardWidget=D;exports.ShapeToolbar=m;exports.shapeNodeTypes=E;
|
|
2
|
+
//# sourceMappingURL=ShapeBoardWidget-D1TcdWRO.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ShapeBoardWidget-D1TcdWRO.js","sources":["../../src/components/shapeIcons.jsx","../../src/assets/shape_add.svg","../../src/assets/shape_add_active.svg","../../src/components/ShapeToolbar.jsx","../../src/features/shape/public/shapeNodeTypes.js","../../src/widgets/ShapeBoardWidget.jsx"],"sourcesContent":["import React from \"react\";\r\n\r\nexport const SHAPE_ICONS = {\r\n square: (\r\n <svg width=\"40\" height=\"40\">\r\n <rect x=\"4\" y=\"4\" width=\"32\" height=\"32\" stroke=\"black\" fill=\"none\" strokeWidth=\"2\"/>\r\n </svg>\r\n ),\r\n\r\n circle: (\r\n <svg width=\"40\" height=\"40\">\r\n <circle cx=\"20\" cy=\"20\" r=\"14\" stroke=\"black\" fill=\"none\" strokeWidth=\"2\"/>\r\n </svg>\r\n ),\r\n\r\n triangle: (\r\n <svg width=\"40\" height=\"40\">\r\n <polygon points=\"20,6 34,34 6,34\" stroke=\"black\" fill=\"none\" strokeWidth=\"2\"/>\r\n </svg>\r\n ),\r\n\r\n star: (\r\n <svg width=\"40\" height=\"40\">\r\n <polygon\r\n points=\"20,4 25,16 38,16 27,24 32,36 20,28 8,36 13,24 2,16 15,16\"\r\n stroke=\"black\"\r\n fill=\"none\"\r\n strokeWidth=\"2\"\r\n />\r\n </svg>\r\n ),\r\n\r\n stick: (\r\n <svg width=\"40\" height=\"40\">\r\n <rect x=\"16\" y=\"4\" width=\"8\" height=\"32\" stroke=\"black\" fill=\"none\" strokeWidth=\"2\" />\r\n </svg>\r\n ),\r\n\r\n line: (\r\n <svg width=\"40\" height=\"40\">\r\n <line x1=\"4\" y1=\"20\" x2=\"36\" y2=\"20\" stroke=\"black\" strokeWidth=\"2\" />\r\n </svg>\r\n ),\r\n\r\n arrow: (\r\n <svg width=\"40\" height=\"40\">\r\n <line x1=\"4\" y1=\"20\" x2=\"30\" y2=\"20\" stroke=\"black\" strokeWidth=\"2\"/>\r\n <polygon points=\"30,14 38,20 30,26\" fill=\"black\"/>\r\n </svg>\r\n ),\r\n\r\n dblarrow: (\r\n <svg width=\"40\" height=\"40\">\r\n <polygon points=\"4,20 12,14 12,26\" fill=\"black\"/>\r\n <line x1=\"12\" y1=\"20\" x2=\"28\" y2=\"20\" stroke=\"black\" strokeWidth=\"2\"/>\r\n <polygon points=\"28,14 36,20 28,26\" fill=\"black\"/>\r\n </svg>\r\n ),\r\n\r\n parallelogram: (\r\n <svg width=\"40\" height=\"40\" viewBox=\"0 0 40 40\">\r\n <polygon points=\"8,8 34,8 26,32 0,32\" stroke=\"black\" fill=\"none\" strokeWidth=\"2\"/>\r\n </svg>\r\n ),\r\n\r\n roundedRect: (\r\n <svg width=\"40\" height=\"40\" viewBox=\"0 0 40 40\">\r\n <rect x=\"6\" y=\"10\" width=\"28\" height=\"20\" rx=\"4\" ry=\"4\" stroke=\"black\" fill=\"none\" strokeWidth=\"2\"/>\r\n </svg>\r\n ),\r\n\r\n capsule: (\r\n <svg width=\"40\" height=\"40\" viewBox=\"0 0 40 40\">\r\n <rect x=\"6\" y=\"14\" width=\"28\" height=\"12\" rx=\"6\" ry=\"6\" stroke=\"black\" fill=\"none\" strokeWidth=\"2\"/>\r\n </svg>\r\n ),\r\n\r\n pentagon: (\r\n <svg width=\"40\" height=\"40\" viewBox=\"0 0 40 40\">\r\n <polygon points=\"20,6 34,15 28,32 12,32 6,15\" stroke=\"black\" fill=\"none\" strokeWidth=\"2\"/>\r\n </svg>\r\n ),\r\n\r\n chevron: (\r\n <svg width=\"40\" height=\"40\" viewBox=\"0 0 100 100\">\r\n <polyline\r\n points=\"0,0 50,100 100,0\"\r\n fill=\"none\"\r\n stroke=\"black\"\r\n strokeWidth=\"5\"\r\n />\r\n </svg>\r\n ),\r\n table3x3: (\r\n <svg width=\"40\" height=\"40\" viewBox=\"0 0 40 40\">\r\n <rect x=\"4\" y=\"4\" width=\"32\" height=\"32\" stroke=\"black\" fill=\"none\" strokeWidth=\"2\"/>\r\n\r\n <line x1=\"14\" y1=\"4\" x2=\"14\" y2=\"36\" stroke=\"black\" strokeWidth=\"2\"/>\r\n <line x1=\"26\" y1=\"4\" x2=\"26\" y2=\"36\" stroke=\"black\" strokeWidth=\"2\"/>\r\n\r\n <line x1=\"4\" y1=\"14\" x2=\"36\" y2=\"14\" stroke=\"black\" strokeWidth=\"2\"/>\r\n <line x1=\"4\" y1=\"26\" x2=\"36\" y2=\"26\" stroke=\"black\" strokeWidth=\"2\"/>\r\n </svg>\r\n ),\r\n\r\n pyramid: (\r\n <svg width=\"40\" height=\"40\" viewBox=\"0 0 40 40\">\r\n <polygon points=\"20,4 36,36 4,36\" stroke=\"black\" fill=\"none\" strokeWidth=\"2\" />\r\n <line x1=\"15\" y1=\"12\" x2=\"25\" y2=\"12\" stroke=\"black\" strokeWidth=\"2\" />\r\n <line x1=\"11\" y1=\"20\" x2=\"28\" y2=\"20\" stroke=\"black\" strokeWidth=\"2\" />\r\n <line x1=\"7\" y1=\"28\" x2=\"32\" y2=\"28\" stroke=\"black\" strokeWidth=\"2\" />\r\n </svg>\r\n ),\r\n circleArrow: (\r\n <svg width=\"40\" height=\"40\" viewBox=\"0 0 40 40\">\r\n <circle cx=\"20\" cy=\"20\" r=\"14\" stroke=\"black\" fill=\"none\" strokeWidth=\"2\"/>\r\n <line x1=\"20\" y1=\"6\" x2=\"20\" y2=\"0\" stroke=\"black\" strokeWidth=\"2\"/>\r\n <polygon points=\"18,2 22,2 20,0\" fill=\"black\"/>\r\n </svg>\r\n ),\r\n\r\n table3x3LeftMerge: (\r\n <svg width=\"40\" height=\"40\" viewBox=\"0 0 40 40\">\r\n <rect x=\"4\" y=\"4\" width=\"32\" height=\"32\" stroke=\"black\" fill=\"none\" strokeWidth=\"2\"/>\r\n <line x1=\"14\" y1=\"4\" x2=\"14\" y2=\"36\" stroke=\"black\" strokeWidth=\"2\"/>\r\n <line x1=\"26\" y1=\"4\" x2=\"26\" y2=\"36\" stroke=\"black\" strokeWidth=\"2\"/>\r\n <line x1=\"14\" y1=\"16\" x2=\"36\" y2=\"16\" stroke=\"black\" strokeWidth=\"2\"/>\r\n <line x1=\"14\" y1=\"28\" x2=\"36\" y2=\"28\" stroke=\"black\" strokeWidth=\"2\"/>\r\n </svg>\r\n ),\r\n};\r\n","export default \"data:image/svg+xml,%3csvg%20width='50'%20height='50'%20viewBox='0%200%2050%2050'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M3%201.5H47C47.8284%201.5%2048.5%202.17157%2048.5%203V47C48.5%2047.8284%2047.8284%2048.5%2047%2048.5H3C2.17157%2048.5%201.5%2047.8284%201.5%2047V3C1.5%202.17157%202.17157%201.5%203%201.5Z'%20stroke='black'%20stroke-width='3'/%3e%3c/svg%3e\"","export default \"data:image/svg+xml,%3csvg%20width='50'%20height='50'%20viewBox='0%200%2050%2050'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M3%201.5H47C47.8284%201.5%2048.5%202.17157%2048.5%203V47C48.5%2047.8284%2047.8284%2048.5%2047%2048.5H3C2.17157%2048.5%201.5%2047.8284%201.5%2047V3C1.5%202.17157%202.17157%201.5%203%201.5Z'%20stroke='%230000FF'%20stroke-width='3'/%3e%3c/svg%3e\"","\r\nimport React, { useState, useRef, useEffect } from 'react';\r\nimport { SHAPES } from '../features/shape/constants.jsx';\r\nimport { SHAPE_ICONS } from \"./shapeIcons.jsx\";\r\nimport { DND_SHAPE } from '../features/board/constants.js';\r\nimport shapeAdd from '../assets/shape_add.svg';\r\nimport shapeAddActive from '../assets/shape_add_active.svg';\r\nimport '../styles/stickerPalette.css';\r\nimport { ShapeNode } from '../features/shape/ui/ShapeNode.jsx';\r\n\r\nexport const ShapeToolbar = () => {\r\n const [shapeOpen, setShapeOpen] = useState(false);\r\n const wrapperRef = useRef(null);\r\n\r\n const toggleShape = (e) => {\r\n e.stopPropagation();\r\n setShapeOpen((v) => !v);\r\n };\r\n\r\n useEffect(() => {\r\n if (!shapeOpen) return;\r\n const handler = (e) => {\r\n if (wrapperRef.current && !wrapperRef.current.contains(e.target)) {\r\n setShapeOpen(false);\r\n }\r\n };\r\n window.addEventListener('pointerdown', handler);\r\n return () => window.removeEventListener('pointerdown', handler);\r\n }, [shapeOpen]);\r\n\r\n const onShapeDragStart = (shape) => (e) => {\r\n e.stopPropagation();\r\n e.dataTransfer.setData(DND_SHAPE, JSON.stringify({ shapeId: shape.id }));\r\n e.dataTransfer.effectAllowed = 'copy';\r\n };\r\n\r\n return (\r\n <div className=\"left-toolbar-container\" ref={wrapperRef} onClick={(e) => e.stopPropagation()}>\r\n <div className={`toolbar-card ${shapeOpen ? 'toolbar-card--open' : ''}`}>\r\n <button onClick={toggleShape} className={`toolbar-btn toolbar-btn--icon toolbar-btn--shape ${shapeOpen ? 'toolbar-btn--active' : ''}`}>\r\n <div className={`toolbar-shape-plate ${shapeOpen ? 'toolbar-shape-plate--active' : ''}`}>\r\n <img src={shapeOpen ? shapeAddActive : shapeAdd} alt=\"Фигуры\" draggable={false} />\r\n </div>\r\n </button>\r\n </div>\r\n {shapeOpen && (\r\n <div className=\"palette-wrapper\" onClick={(e) => e.stopPropagation()}>\r\n <div className=\"shape-panel\">\r\n <div className=\"shape-grid\">\r\n {SHAPES.map((shape) => (\r\n <button\r\n key={shape.id}\r\n className=\"shape-item\"\r\n draggable\r\n onDragStart={onShapeDragStart(shape)}\r\n title={shape.name}\r\n >\r\n {SHAPE_ICONS[shape.id]}\r\n </button>\r\n ))}\r\n </div>\r\n </div>\r\n </div>\r\n )}\r\n <ShapeNode shapeOpen={shapeOpen} />\r\n </div>\r\n );\r\n};","import { ShapeNode } from '../ui/ShapeNode.jsx'\r\n\r\nexport const shapeNodeTypes = {\r\n shape: ShapeNode,\r\n}\r\n","import React, { useEffect, useRef, useState } from 'react'\r\nimport { ShapeToolbar } from '../components/ShapeToolbar.jsx'\r\nimport { Board } from '../features/board/ui/Board.jsx'\r\nimport { useStickersStore } from '../entities/stickers/model/useStickersStore.js'\r\nimport { shapesApi } from '../shared/api/shapesApi.js'\r\nimport { shapeNodeTypes } from '../features/shape/public/shapeNodeTypes.js'\r\n\r\nconst SafeFallbackWidget = ({ children }) => <div>{children}</div>\r\n\r\n/**\r\n * @typedef {import('@xyflow/react').NodeProps} NodeProps\r\n * @typedef {Record<string, React.ComponentType<NodeProps>>} NodeTypes\r\n */\r\n\r\n/**\r\n * @param {{ nodeTypes?: NodeTypes }} props\r\n */\r\nexport const ShapeBoardWidget = ({ nodeTypes }) => {\r\n const setStickers = useStickersStore((state) => state.setStickers)\r\n const boardRef = useRef(null)\r\n const [WidgetComp, setWidgetComp] = useState(() => SafeFallbackWidget)\r\n\r\n const mergedNodeTypes = {\r\n ...shapeNodeTypes,\r\n ...(nodeTypes || {}),\r\n }\r\n\r\n useEffect(() => {\r\n const loadBoard = async () => {\r\n try {\r\n const [allShapes, boardShapes] = await Promise.all([\r\n shapesApi.getAll(),\r\n shapesApi.getBoard(),\r\n ])\r\n\r\n const shapeKeyByDbId = new Map(allShapes.map((x) => [String(x.id), x.shapeId]))\r\n\r\n let x = 30\r\n let y = 30\r\n const items = []\r\n\r\n for (const s of boardShapes) {\r\n const w = s.width ?? 140\r\n const h = s.height ?? 140\r\n const r = s.rotation ?? 0\r\n\r\n const shapeKey = shapeKeyByDbId.get(String(s.shapeId)) ?? 'square'\r\n\r\n items.push({\r\n id: s.id,\r\n stickerId: s.id,\r\n type: 'shape',\r\n shapeId: shapeKey,\r\n shapeDbId: s.shapeId,\r\n x,\r\n y,\r\n width: w,\r\n height: h,\r\n rotation: r,\r\n zIndex: 1,\r\n fill: 'transparent',\r\n stroke: '#000',\r\n })\r\n\r\n x += 24\r\n y += 24\r\n }\r\n\r\n setStickers(items)\r\n } catch (e) {\r\n console.warn('Не удалось загрузить доску для фигур:', e)\r\n }\r\n }\r\n\r\n loadBoard()\r\n }, [setStickers])\r\n\r\n useEffect(() => {\r\n let mounted = true\r\n\r\n import('@xyflow/react')\r\n .then((mod) => {\r\n if (!mounted) {\r\n return\r\n }\r\n\r\n const candidate =\r\n (mod && (mod.Widget || mod.default || mod?.widget || mod?.XyflowWidget)) ?? null\r\n\r\n if (typeof candidate === 'function' || React.isValidElement(candidate)) {\r\n setWidgetComp(() => candidate)\r\n } else {\r\n setWidgetComp(() => SafeFallbackWidget)\r\n }\r\n })\r\n .catch(() => {\r\n if (mounted) {\r\n setWidgetComp(() => SafeFallbackWidget)\r\n }\r\n })\r\n\r\n return () => {\r\n mounted = false\r\n }\r\n }, [])\r\n\r\n const Wrapper = WidgetComp || SafeFallbackWidget\r\n\r\n return (\r\n <Wrapper>\r\n <div className=\"relative flex h-screen w-screen bg-gray-100\">\r\n <ShapeToolbar />\r\n <Board ref={boardRef} nodeTypes={mergedNodeTypes} />\r\n </div>\r\n </Wrapper>\r\n )\r\n}\r\n"],"names":["SHAPE_ICONS","jsx","jsxs","shapeAdd","shapeAddActive","ShapeToolbar","shapeOpen","setShapeOpen","useState","wrapperRef","useRef","toggleShape","e","v","useEffect","handler","onShapeDragStart","shape","DND_SHAPE","SHAPES","ShapeNode","shapeNodeTypes","SafeFallbackWidget","children","ShapeBoardWidget","nodeTypes","setStickers","useStickersStore","state","boardRef","WidgetComp","setWidgetComp","mergedNodeTypes","allShapes","boardShapes","shapesApi","shapeKeyByDbId","x","y","items","s","h","r","shapeKey","mounted","mod","candidate","React","Wrapper","Board"],"mappings":"khBAEaA,EAAc,CACvB,+BACK,MAAI,CAAA,MAAM,KAAK,OAAO,KACnB,SAACC,EAAA,kBAAA,IAAA,OAAA,CAAK,EAAE,IAAI,EAAE,IAAI,MAAM,KAAK,OAAO,KAAK,OAAO,QAAQ,KAAK,OAAO,YAAY,GAAA,CAAG,CACvF,CAAA,EAGJ,+BACK,MAAI,CAAA,MAAM,KAAK,OAAO,KACnB,iCAAC,SAAO,CAAA,GAAG,KAAK,GAAG,KAAK,EAAE,KAAK,OAAO,QAAQ,KAAK,OAAO,YAAY,GAAA,CAAG,CAC7E,CAAA,EAGJ,SACKA,EAAAA,kBAAAA,IAAA,MAAA,CAAI,MAAM,KAAK,OAAO,KACnB,SAAAA,wBAAC,UAAQ,CAAA,OAAO,kBAAkB,OAAO,QAAQ,KAAK,OAAO,YAAY,GAAG,CAAA,EAChF,EAGJ,KACKA,EAAAA,kBAAAA,IAAA,MAAA,CAAI,MAAM,KAAK,OAAO,KACnB,SAAAA,EAAA,kBAAA,IAAC,UAAA,CACG,OAAO,2DACP,OAAO,QACP,KAAK,OACL,YAAY,GAAA,CAAA,EAEpB,EAGJ,8BACK,MAAI,CAAA,MAAM,KAAK,OAAO,KACnB,SAACA,EAAA,kBAAA,IAAA,OAAA,CAAK,EAAE,KAAK,EAAE,IAAI,MAAM,IAAI,OAAO,KAAK,OAAO,QAAQ,KAAK,OAAO,YAAY,GAAA,CAAI,CACxF,CAAA,EAGJ,6BACK,MAAI,CAAA,MAAM,KAAK,OAAO,KACnB,iCAAC,OAAK,CAAA,GAAG,IAAI,GAAG,KAAK,GAAG,KAAK,GAAG,KAAK,OAAO,QAAQ,YAAY,GAAA,CAAI,CACxE,CAAA,EAGJ,MACKC,EAAAA,kBAAAA,KAAA,MAAA,CAAI,MAAM,KA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K,CACP,GAAIC,EAAE,GACN,UAAWA,EAAE,GACb,KAAM,QACN,QAASG,EACT,UAAWH,EAAE,QACb,EAAAH,EACA,EAAAC,EACA,MAAO,EACP,OAAQG,EACR,SAAUC,EACV,OAAQ,EACR,KAAM,cACN,OAAQ,MAAA,CACX,EAEIL,GAAA,GACAC,GAAA,EACT,CAEAZ,EAAYa,CAAK,QACZ3B,EAAG,CACA,QAAA,KAAK,wCAAyCA,CAAC,CAC3D,CAAA,IAGM,EACX,CAACc,CAAW,CAAC,EAEhBZ,EAAAA,UAAU,IAAM,CACZ,IAAI8B,EAAU,GAEd,cAAO,eAAe,EACjB,KAAMC,GAAQ,CACX,GAAI,CAACD,EACD,OAGE,MAAAE,GACDD,IAAQA,EAAI,QAAUA,EAAI,UAAWA,GAAA,YAAAA,EAAK,UAAUA,GAAA,YAAAA,EAAK,iBAAkB,KAE5E,OAAOC,GAAc,YAAcC,EAAM,eAAeD,CAAS,EACjEf,EAAc,IAAMe,CAAS,EAE7Bf,EAAc,IAAMT,CAAkB,CAC1C,CACH,EACA,MAAM,IAAM,CACLsB,GACAb,EAAc,IAAMT,CAAkB,CAC1C,CACH,EAEE,IAAM,CACCsB,EAAA,EAAA,CAElB,EAAG,CAAE,CAAA,EAEL,MAAMI,EAAUlB,GAAcR,EAE9B,OACKrB,EAAA,kBAAA,IAAA+C,EAAA,CACG,SAAC9C,EAAAA,kBAAAA,KAAA,MAAA,CAAI,UAAU,8CACX,SAAA,CAAAD,EAAA,kBAAA,IAACI,EAAa,EAAA,EACbJ,EAAA,kBAAA,IAAAgD,EAAA,MAAA,CAAM,IAAKpB,EAAU,UAAWG,EAAiB,CAAA,CACtD,CAAA,CACJ,CAAA,CAER"}
|
package/dist/emoji/index.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("../chunks/Board-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("../chunks/Board-DBlzUx0o.js");const e=require("../chunks/EmojiBoardWidget-jQpQl320.js");exports.EmojiBoardWidget=e.EmojiBoardWidget;exports.emojiNodeTypes=e.emojiNodeTypes;
|
|
2
2
|
//# sourceMappingURL=index.cjs.map
|
package/dist/emoji/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import "../chunks/Board-
|
|
2
|
-
import { E as m, e as r } from "../chunks/EmojiBoardWidget-
|
|
1
|
+
import "../chunks/Board-CENI1zTY.js";
|
|
2
|
+
import { E as m, e as r } from "../chunks/EmojiBoardWidget-94JjolG3.js";
|
|
3
3
|
export {
|
|
4
4
|
m as EmojiBoardWidget,
|
|
5
5
|
r as emojiNodeTypes
|
package/dist/index.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";var O=Object.create;var b=Object.defineProperty;var J=Object.getOwnPropertyDescriptor;var _=Object.getOwnPropertyNames;var P=Object.getPrototypeOf,q=Object.prototype.hasOwnProperty;var v=(i,r,d,p)=>{if(r&&typeof r=="object"||typeof r=="function")for(let n of _(r))!q.call(i,n)&&n!==d&&b(i,n,{get:()=>r[n],enumerable:!(p=J(r,n))||p.enumerable});return i};var C=(i,r,d)=>(d=i!=null?O(P(i)):{},v(r||!i||!i.__esModule?b(d,"default",{value:i,enumerable:!0}):d,i));Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./chunks/Board-
|
|
1
|
+
"use strict";var O=Object.create;var b=Object.defineProperty;var J=Object.getOwnPropertyDescriptor;var _=Object.getOwnPropertyNames;var P=Object.getPrototypeOf,q=Object.prototype.hasOwnProperty;var v=(i,r,d,p)=>{if(r&&typeof r=="object"||typeof r=="function")for(let n of _(r))!q.call(i,n)&&n!==d&&b(i,n,{get:()=>r[n],enumerable:!(p=J(r,n))||p.enumerable});return i};var C=(i,r,d)=>(d=i!=null?O(P(i)):{},v(r||!i||!i.__esModule?b(d,"default",{value:i,enumerable:!0}):d,i));Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./chunks/Board-DBlzUx0o.js"),u=require("./chunks/EmojiBoardWidget-jQpQl320.js"),g=require("./chunks/ShapeBoardWidget-D1TcdWRO.js"),l=require("react"),h=({children:i})=>e.jsxRuntimeExports.jsx("div",{children:i}),z=({nodeTypes:i})=>{const r=e.useStickersStore(o=>o.setStickers),d=l.useRef(null),[p,n]=l.useState(()=>h),k={...u.emojiNodeTypes,...g.shapeNodeTypes,...i||{}};async function M(o){if(e.EMOJI_MAP&&e.EMOJI_MAP[o])return e.EMOJI_MAP[o];try{const t=await e.stickersApi.getById(o);if(t!=null&&t.name){const a=e.EMOJI_CATALOG.find(f=>f.name===t.name);if(a)return a.url}}catch(t){console.warn("getEmojiUrlForStickerId: backend lookup failed",t)}return""}l.useEffect(()=>{(async()=>{var t;try{const[a,f,A]=await Promise.all([e.stickersApi.getBoard(),e.shapesApi.getAll(),e.shapesApi.getBoard()]),R=new Map(f.map(s=>[String(s.id),s.shapeId]));let y=30,m=30,E=1;const I=[];for(const s of a){const x=s.width??e.EMOJI_W,j=s.height??e.EMOJI_H;let c=((t=e.EMOJI_MAP)==null?void 0:t[String(s.stickerId)])??"";c||(c=await M(s.stickerId)),I.push({id:s.id,x:y,y:m,color:"transparent",width:x,height:j,text:"",zIndex:E,stickerId:s.stickerId,imageUrl:c,type:"emoji"}),y+=24,m+=24,E+=1}let S=500,B=30,w=1e4;const W=[];for(const s of A){const x=s.width??140,j=s.height??140,c=s.rotation??0,N=R.get(String(s.shapeId))??"square";W.push({id:s.id,stickerId:s.id,type:"shape",shapeId:N,shapeDbId:s.shapeId,x:S,y:B,width:x,height:j,rotation:c,zIndex:w,fill:"transparent",stroke:"#000"}),S+=24,B+=24,w+=1}r([...I,...W])}catch(a){console.warn("Не удалось загрузить доску:",a)}})()},[r]),l.useEffect(()=>{let o=!0;return import("@xyflow/react").then(t=>{if(!o)return;const a=(t&&(t.Widget||t.default||(t==null?void 0:t.widget)||(t==null?void 0:t.XyflowWidget)))??null;typeof a=="function"||l.isValidElement(a)?n(()=>a):n(()=>h)}).catch(()=>{o&&n(()=>h)}),()=>{o=!1}},[]);const T=p||h;return e.jsxRuntimeExports.jsx(T,{children:e.jsxRuntimeExports.jsxs("div",{className:"relative flex h-screen w-screen bg-gray-100",children:[e.jsxRuntimeExports.jsxs("div",{className:"flex flex-col",children:[e.jsxRuntimeExports.jsx(u.EmojiToolbar,{}),e.jsxRuntimeExports.jsx(g.ShapeToolbar,{})]}),e.jsxRuntimeExports.jsx(e.Board,{ref:d,nodeTypes:k})]})})};exports.EmojiBoardWidget=u.EmojiBoardWidget;exports.emojiNodeTypes=u.emojiNodeTypes;exports.ShapeBoardWidget=g.ShapeBoardWidget;exports.shapeNodeTypes=g.shapeNodeTypes;exports.CombinedBoardWidget=z;
|
|
2
2
|
//# sourceMappingURL=index.cjs.map
|
package/dist/index.mjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { u as O, j as r, B as v, s as w, a as E, E as z, b as C, c as i, d as J } from "./chunks/Board-
|
|
2
|
-
import { e as R, a as F } from "./chunks/EmojiBoardWidget-
|
|
3
|
-
import { E as Z } from "./chunks/EmojiBoardWidget-
|
|
4
|
-
import { s as U, a as D } from "./chunks/ShapeBoardWidget-
|
|
5
|
-
import { S as ee } from "./chunks/ShapeBoardWidget-
|
|
1
|
+
import { u as O, j as r, B as v, s as w, a as E, E as z, b as C, c as i, d as J } from "./chunks/Board-CENI1zTY.js";
|
|
2
|
+
import { e as R, a as F } from "./chunks/EmojiBoardWidget-94JjolG3.js";
|
|
3
|
+
import { E as Z } from "./chunks/EmojiBoardWidget-94JjolG3.js";
|
|
4
|
+
import { s as U, a as D } from "./chunks/ShapeBoardWidget-C9nNKwtj.js";
|
|
5
|
+
import { S as ee } from "./chunks/ShapeBoardWidget-C9nNKwtj.js";
|
|
6
6
|
import K, { useRef as P, useState as q, useEffect as k } from "react";
|
|
7
7
|
const n = ({ children: c }) => /* @__PURE__ */ r.jsx("div", { children: c }), X = ({ nodeTypes: c }) => {
|
|
8
8
|
const f = O((s) => s.setStickers), b = P(null), [B, d] = q(() => n), W = {
|
package/dist/shape/index.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../chunks/ShapeBoardWidget-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../chunks/ShapeBoardWidget-D1TcdWRO.js");exports.ShapeBoardWidget=e.ShapeBoardWidget;exports.shapeNodeTypes=e.shapeNodeTypes;
|
|
2
2
|
//# sourceMappingURL=index.cjs.map
|
package/dist/shape/index.js
CHANGED