integration-modules 0.1.12 → 0.1.13
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/index.cjs +1 -1
- package/dist/index.mjs +0 -1
- package/package.json +1 -1
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=(r,
|
|
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-BPjNyr3D.js"),u=require("./chunks/EmojiBoardWidget-DwyWXjjk.js"),g=require("./chunks/ShapeBoardWidget-ZKB_BDkq.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