@superdoc-dev/template-builder 0.2.0-next.2 → 0.2.0-next.3
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.d.ts.map +1 -1
- package/dist/index.js +4 -4
- package/dist/index.mjs +217 -220
- package/dist/types.d.ts +7 -7
- package/dist/types.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.tsx"],"names":[],"mappings":"AASA,OAAO,KAAK,KAAK,KAAK,MAAM,SAAS,CAAC;AACtC,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAElD,cAAc,SAAS,CAAC;AACxB,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.tsx"],"names":[],"mappings":"AASA,OAAO,KAAK,KAAK,KAAK,MAAM,SAAS,CAAC;AACtC,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAElD,cAAc,SAAS,CAAC;AACxB,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,CAAC;AAwGhC,QAAA,MAAM,uBAAuB,oJA2jB3B,CAAC;AAIH,eAAe,uBAAuB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";var Ae=Object.create;var
|
|
1
|
+
"use strict";var Ae=Object.create;var be=Object.defineProperty;var Me=Object.getOwnPropertyDescriptor;var Ie=Object.getOwnPropertyNames;var De=Object.getPrototypeOf,Le=Object.prototype.hasOwnProperty;var We=(o,u,f,d)=>{if(u&&typeof u=="object"||typeof u=="function")for(let r of Ie(u))!Le.call(o,r)&&r!==f&&be(o,r,{get:()=>u[r],enumerable:!(d=Me(u,r))||d.enumerable});return o};var Be=(o,u,f)=>(f=o!=null?Ae(De(o)):{},We(u||!o||!o.__esModule?be(f,"default",{value:o,enumerable:!0}):f,o));Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const i=require("react");var ie={exports:{}},ne={};/**
|
|
2
2
|
* @license React
|
|
3
3
|
* react-jsx-runtime.production.js
|
|
4
4
|
*
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
*
|
|
7
7
|
* This source code is licensed under the MIT license found in the
|
|
8
8
|
* LICENSE file in the root directory of this source tree.
|
|
9
|
-
*/var
|
|
9
|
+
*/var he;function Ve(){if(he)return ne;he=1;var o=Symbol.for("react.transitional.element"),u=Symbol.for("react.fragment");function f(d,r,l){var F=null;if(l!==void 0&&(F=""+l),r.key!==void 0&&(F=""+r.key),"key"in r){l={};for(var D in r)D!=="key"&&(l[D]=r[D])}else l=r;return r=l.ref,{$$typeof:o,type:d,key:F,ref:r!==void 0?r:null,props:l}}return ne.Fragment=u,ne.jsx=f,ne.jsxs=f,ne}var oe={};/**
|
|
10
10
|
* @license React
|
|
11
11
|
* react-jsx-runtime.development.js
|
|
12
12
|
*
|
|
@@ -14,9 +14,9 @@
|
|
|
14
14
|
*
|
|
15
15
|
* This source code is licensed under the MIT license found in the
|
|
16
16
|
* LICENSE file in the root directory of this source tree.
|
|
17
|
-
*/var
|
|
17
|
+
*/var ye;function Ye(){return ye||(ye=1,process.env.NODE_ENV!=="production"&&(function(){function o(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===ce?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case O:return"Fragment";case v:return"Profiler";case Q:return"StrictMode";case b:return"Suspense";case E:return"SuspenseList";case W:return"Activity"}if(typeof e=="object")switch(typeof e.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),e.$$typeof){case q:return"Portal";case A:return e.displayName||"Context";case $:return(e._context.displayName||"Context")+".Consumer";case c:var a=e.render;return e=e.displayName,e||(e=a.displayName||a.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case T:return a=e.displayName||null,a!==null?a:o(e.type)||"Memo";case j:a=e._payload,e=e._init;try{return o(e(a))}catch{}}return null}function u(e){return""+e}function f(e){try{u(e);var a=!1}catch{a=!0}if(a){a=console;var m=a.error,p=typeof Symbol=="function"&&Symbol.toStringTag&&e[Symbol.toStringTag]||e.constructor.name||"Object";return m.call(a,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",p),u(e)}}function d(e){if(e===O)return"<>";if(typeof e=="object"&&e!==null&&e.$$typeof===j)return"<...>";try{var a=o(e);return a?"<"+a+">":"<...>"}catch{return"<...>"}}function r(){var e=Z.A;return e===null?null:e.getOwner()}function l(){return Error("react-stack-top-frame")}function F(e){if(se.call(e,"key")){var a=Object.getOwnPropertyDescriptor(e,"key").get;if(a&&a.isReactWarning)return!1}return e.key!==void 0}function D(e,a){function m(){M||(M=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",a))}m.isReactWarning=!0,Object.defineProperty(e,"key",{get:m,configurable:!0})}function H(){var e=o(this.type);return ee[e]||(ee[e]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),e=this.props.ref,e!==void 0?e:null}function U(e,a,m,p,B,re){var h=m.ref;return e={$$typeof:L,type:e,key:a,props:m,_owner:p},(h!==void 0?h:null)!==null?Object.defineProperty(e,"ref",{enumerable:!1,get:H}):Object.defineProperty(e,"ref",{enumerable:!1,value:null}),e._store={},Object.defineProperty(e._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(e,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(e,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:B}),Object.defineProperty(e,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:re}),Object.freeze&&(Object.freeze(e.props),Object.freeze(e)),e}function P(e,a,m,p,B,re){var h=a.children;if(h!==void 0)if(p)if(K(h)){for(p=0;p<h.length;p++)N(h[p]);Object.freeze&&Object.freeze(h)}else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else N(h);if(se.call(a,"key")){h=o(e);var _=Object.keys(a).filter(function(ue){return ue!=="key"});p=0<_.length?"{key: someKey, "+_.join(": ..., ")+": ...}":"{key: someKey}",G[h+p]||(_=0<_.length?"{"+_.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
|
|
18
18
|
let props = %s;
|
|
19
19
|
<%s {...props} />
|
|
20
20
|
React keys must be passed directly to JSX without using spread:
|
|
21
21
|
let props = %s;
|
|
22
|
-
<%s key={someKey} {...props} />`,p,h,w,h),q[h+p]=!0)}if(h=null,x!==void 0&&(f(x),h=""+x),F(a)&&(f(a.key),h=""+a.key),"key"in a){x={};for(var G in a)G!=="key"&&(x[G]=a[G])}else x=a;return h&&D(x,typeof e=="function"?e.displayName||e.name||"Unknown":e),H(e,h,x,n(),B,re)}function N(e){C(e)?e._store&&(e._store.validated=1):typeof e=="object"&&e!==null&&e.$$typeof===j&&(e._payload.status==="fulfilled"?C(e._payload.value)&&e._payload.value._store&&(e._payload.value._store.validated=1):e._store&&(e._store.validated=1))}function C(e){return typeof e=="object"&&e!==null&&e.$$typeof===L}var V=i,L=Symbol.for("react.transitional.element"),U=Symbol.for("react.portal"),O=Symbol.for("react.fragment"),Q=Symbol.for("react.strict_mode"),E=Symbol.for("react.profiler"),Y=Symbol.for("react.consumer"),A=Symbol.for("react.context"),u=Symbol.for("react.forward_ref"),b=Symbol.for("react.suspense"),R=Symbol.for("react.suspense_list"),T=Symbol.for("react.memo"),j=Symbol.for("react.lazy"),W=Symbol.for("react.activity"),ce=Symbol.for("react.client.reference"),Z=V.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,se=Object.prototype.hasOwnProperty,K=Array.isArray,k=console.createTask?console.createTask:function(){return null};V={react_stack_bottom_frame:function(e){return e()}};var M,ee={},I=V.react_stack_bottom_frame.bind(V,c)(),te=k(l(c)),q={};oe.Fragment=O,oe.jsx=function(e,a,x){var p=1e4>Z.recentlyCreatedOwnerStacks++;return P(e,a,x,!1,p?Error("react-stack-top-frame"):I,p?k(l(e)):te)},oe.jsxs=function(e,a,x){var p=1e4>Z.recentlyCreatedOwnerStacks++;return P(e,a,x,!0,p?Error("react-stack-top-frame"):I,p?k(l(e)):te)}})()),oe}var ye;function Ye(){return ye||(ye=1,process.env.NODE_ENV==="production"?ie.exports=$e():ie.exports=Ve()),ie.exports}var s=Ye();const Ce=({isVisible:o,position:d,availableFields:f,filteredFields:l,filterQuery:n,allowCreate:c,onSelect:F,onClose:D,onCreateField:z})=>{const[H,P]=i.useState(!1),[N,C]=i.useState("");i.useEffect(()=>{o||(P(!1),C(""))},[o]);const V=i.useMemo(()=>({position:"absolute",left:d?.left,top:d?.top,zIndex:1e3,background:"white",border:"1px solid #ddd",borderRadius:"4px",boxShadow:"0 2px 8px rgba(0,0,0,0.1)",padding:"8px 0",minWidth:"200px"}),[d]),L=l??f,U=!!n,O=i.useMemo(()=>{const u=[],b=new Map;return L.forEach(R=>{const T=R.category?.trim()||"Uncategorized",j=b.get(T);if(j!==void 0){u[j].fields.push(R);return}b.set(T,u.length),u.push({category:T,fields:[R]})}),u},[L]),[Q,E]=i.useState({});i.useEffect(()=>{E(u=>{if(O.length===0)return Object.keys(u).length===0?u:{};const b={};let R=Object.keys(u).length!==O.length;return O.forEach(({category:T},j)=>{const W=U?!0:u[T]??j===0;b[T]=W,!R&&u[T]!==W&&(R=!0)}),R?b:u})},[O,U]);const Y=i.useCallback(u=>{E(b=>({...b,[u]:!b[u]}))},[]);if(!o)return null;const A=async()=>{const u=N.trim();if(!u)return;const b={id:`custom_${Date.now()}`,label:u,category:"Custom"};try{if(z){const R=await z(b);F(R||b)}else F(b)}finally{P(!1),C("")}};return s.jsxs("div",{className:"superdoc-field-menu",style:V,children:[U&&s.jsx("div",{style:{padding:"8px 16px",borderBottom:"1px solid #f0f0f0",marginBottom:"4px"},children:s.jsxs("div",{style:{fontSize:"12px",color:"#6b7280"},children:["Filtering results for",s.jsx("span",{style:{fontWeight:600,color:"#111827",marginLeft:"4px"},children:n})]})}),c&&!H&&s.jsx("div",{className:"field-menu-item",onClick:()=>P(!0),style:{padding:"8px 16px",cursor:"pointer",color:"#0066cc",fontWeight:500},children:"+ Create New Field"}),c&&H&&s.jsxs("div",{style:{padding:"8px 16px"},children:[s.jsx("input",{type:"text",value:N,placeholder:"Field name...",onChange:u=>C(u.target.value),onKeyDown:u=>{u.key==="Enter"&&A(),u.key==="Escape"&&(P(!1),C(""))},autoFocus:!0,style:{width:"100%",padding:"4px 8px",border:"1px solid #ddd",borderRadius:"3px"}}),s.jsxs("div",{style:{marginTop:"8px",display:"flex",gap:"8px"},children:[s.jsx("button",{onClick:A,disabled:!N.trim(),style:{padding:"4px 12px",background:N.trim()?"#0066cc":"#ccc",color:"white",border:"none",borderRadius:"3px",cursor:N.trim()?"pointer":"not-allowed"},children:"Create"}),s.jsx("button",{onClick:()=>{P(!1),C("")},style:{padding:"4px 12px",background:"white",border:"1px solid #ddd",borderRadius:"3px",cursor:"pointer"},children:"Cancel"})]})]}),c&&f.length>0&&s.jsx("div",{style:{borderTop:"1px solid #eee",margin:"4px 0"}}),O.length===0?s.jsx("div",{style:{padding:"16px",fontSize:"13px",color:"#6b7280",textAlign:"center"},children:"No matching fields"}):O.map(({category:u,fields:b},R)=>{const T=!!Q[u],j=`${Math.max(b.length*40,0)}px`;return s.jsxs("div",{style:{borderTop:R===0&&c?void 0:"1px solid #f0f0f0"},children:[s.jsxs("button",{type:"button",onClick:()=>Y(u),style:{width:"100%",display:"flex",alignItems:"center",justifyContent:"space-between",padding:"8px 16px",background:"transparent",border:"none",cursor:"pointer",fontWeight:500,textAlign:"left"},children:[s.jsxs("span",{children:[u," (",b.length,")"]}),s.jsx("span",{"aria-hidden":!0,style:{display:"inline-block",width:"8px",height:"8px",borderRight:"2px solid #666",borderBottom:"2px solid #666",transform:T?"rotate(45deg)":"rotate(-45deg)",transition:"transform 0.2s ease",marginLeft:"12px"}})]}),s.jsx("div",{"data-category":u,"aria-hidden":!T,style:{overflow:"hidden",maxHeight:T?j:"0px",opacity:T?1:0,transition:"max-height 0.2s ease, opacity 0.2s ease",pointerEvents:T?"auto":"none"},children:s.jsx("div",{style:{padding:T?"4px 0":0},children:b.map(W=>s.jsx("div",{className:"field-menu-item",onClick:()=>F(W),style:{padding:"8px 16px",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"space-between"},children:s.jsx("span",{style:{fontWeight:500},children:W.label})},W.id))})})]},u)}),s.jsx("div",{style:{borderTop:"1px solid #eee",marginTop:"4px"},children:s.jsx("button",{onClick:D,style:{width:"100%",padding:"6px 16px",background:"#f3f4f6",border:"none",borderRadius:"0 0 4px 4px",cursor:"pointer"},children:"Close"})})]})},Te=({fields:o,onSelect:d,onDelete:f,selectedFieldId:l})=>s.jsxs("div",{className:"superdoc-field-list",style:{width:"250px",background:"white",border:"1px solid #e5e7eb",borderRadius:"8px",padding:"16px"},children:[s.jsxs("h3",{style:{margin:"0 0 16px 0",fontSize:"16px",fontWeight:"600"},children:["Template Fields (",o.length,")"]}),o.length===0?s.jsxs("div",{style:{color:"#9ca3af",fontSize:"14px",textAlign:"center",padding:"20px 0"},children:["No fields yet. Type ","{{"," to add a field."]}):s.jsx("div",{style:{display:"flex",flexDirection:"column",gap:"8px"},children:o.map(n=>s.jsxs("div",{onClick:()=>d(n),style:{position:"relative",padding:"12px",background:l===n.id?"#eff6ff":"#f9fafb",border:l===n.id?"1px solid #3b82f6":"1px solid #e5e7eb",borderRadius:"6px",cursor:"pointer",transition:"all 0.2s"},onMouseEnter:c=>{l!==n.id&&(c.currentTarget.style.background="#f3f4f6")},onMouseLeave:c=>{l!==n.id&&(c.currentTarget.style.background="#f9fafb")},title:n.alias,children:[s.jsx("button",{onClick:c=>{c.stopPropagation(),f(n.id)},style:{position:"absolute",top:"8px",right:"8px",padding:"4px",background:"transparent",border:"none",cursor:"pointer",color:"#9ca3af",transition:"color 0.2s",display:"flex",alignItems:"center",justifyContent:"center"},onMouseEnter:c=>{c.currentTarget.style.color="#ef4444"},onMouseLeave:c=>{c.currentTarget.style.color="#9ca3af"},title:"Delete field",children:s.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:s.jsx("path",{d:"M6 2V1.5C6 1.22386 6.22386 1 6.5 1H9.5C9.77614 1 10 1.22386 10 1.5V2M2 4H14M12.6667 4L12.1991 11.0129C12.129 12.065 12.0939 12.5911 11.8667 12.99C11.6666 13.3412 11.3648 13.6235 11.0011 13.7998C10.588 14 10.0607 14 9.00623 14H6.99377C5.93927 14 5.41202 14 4.99889 13.7998C4.63517 13.6235 4.33339 13.3412 4.13332 12.99C3.90607 12.5911 3.871 12.065 3.80086 11.0129L3.33333 4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}),s.jsxs("div",{style:{paddingRight:"24px"},children:[s.jsx("div",{style:{fontWeight:"500",fontSize:"14px",marginBottom:n.alias&&n.alias!==n.id?"4px":"0"},children:n.id}),n.alias&&n.alias!==n.id&&s.jsx("div",{style:{fontSize:"12px",color:"#4b5563"},children:n.alias})]})]},n.id))})]}),ve=o=>{const d=o.helpers?.structuredContentCommands;return d?.getStructuredContentTags?(d.getStructuredContentTags(o.state)||[]).map(l=>{const c=(l?.node??l)?.attrs??{};return{id:c.id,alias:c.alias||c.label||"",tag:c.tag}}).filter(l=>!!l.id):[]},Ee=(o,d)=>{if(o===d)return!0;if(o.length!==d.length)return!1;for(let f=0;f<o.length;f+=1){const l=o[f],n=d[f];if(!n||l.id!==n.id||l.alias!==n.alias||l.tag!==n.tag||l.position!==n.position)return!1}return!0},ze=o=>{if(!o)return null;if(o===!0)return{selector:"#superdoc-toolbar",config:{},renderDefaultContainer:!0};if(typeof o=="string")return{selector:o,config:{},renderDefaultContainer:!1};const{selector:d,...f}=o;return{selector:d||"#superdoc-toolbar",config:f,renderDefaultContainer:d===void 0}},le=10,He=250,Ue=300,Re=o=>{const d=window.innerWidth-He-le,f=window.innerHeight-Ue-le,l=Math.min(o.left,d),n=Math.min(o.top,f);return new DOMRect(Math.max(l,le),Math.max(n,le),o.width,o.height)},ke=i.forwardRef((o,d)=>{const{document:f,fields:l={},menu:n={},list:c={},toolbar:F,onReady:D,onTrigger:z,onFieldInsert:H,onFieldUpdate:P,onFieldDelete:N,onFieldsChange:C,onFieldSelect:V,onFieldCreate:L,className:U,style:O,documentHeight:Q="600px"}=o,[E,Y]=i.useState(l.initial||[]),[A,u]=i.useState(null),[b,R]=i.useState(!1),[T,j]=i.useState(),[W,ce]=i.useState(""),[Z,se]=i.useState(()=>l.available||[]),K=i.useRef(null),k=i.useRef(null),M=i.useRef(null),ee=i.useRef(l);ee.current=l;const I=i.useRef(null),te=i.useRef(b);i.useEffect(()=>{te.current=b},[b]);const q=n.trigger||"{{",e=ee.current.available||[],a=i.useCallback(t=>{const r=t.trim().toLowerCase();return r?e.filter(y=>{const v=y.label.toLowerCase(),S=y.category?.toLowerCase()||"";return v.includes(r)||S.includes(r)}):e},[e]),x=i.useCallback(t=>{ce(t),se(a(t))},[a]),p=i.useCallback(()=>{x("")},[x]),B=i.useCallback((t,r)=>{if(!k.current?.activeEditor)return!1;const y=k.current.activeEditor,v=`field_${Date.now()}`,S=t==="inline"?y.commands.insertStructuredContentInline?.({attrs:{id:v,alias:r.alias,tag:r.metadata?JSON.stringify(r.metadata):r.category},text:r.defaultValue||r.alias}):y.commands.insertStructuredContentBlock?.({attrs:{id:v,alias:r.alias,tag:r.metadata?JSON.stringify(r.metadata):r.category},text:r.defaultValue||r.alias});if(S){const _={id:v,alias:r.alias,tag:r.category};Y(g=>{const m=[...g,_];return C?.(m),m}),H?.(_)}return S},[H,C]),re=i.useCallback((t,r)=>{if(!k.current?.activeEditor)return!1;const v=k.current.activeEditor.commands.updateStructuredContentById?.(t,{attrs:r});return v&&Y(S=>{const _=S.map(m=>m.id===t?{...m,...r}:m);C?.(_);const g=_.find(m=>m.id===t);return g&&P?.(g),_}),v},[P,C]),h=i.useCallback(t=>{const r=k.current?.activeEditor;if(!r){console.warn("[SuperDocTemplateBuilder] deleteField called without active editor");let g=!1;return Y(m=>{if(!m.some($=>$.id===t))return m;const X=m.filter($=>$.id!==t);return g=!0,C?.(X),X}),g&&(N?.(t),u(m=>m===t?null:m)),g}let y=!1;try{y=r.commands.deleteStructuredContentById?.(t)??!1}catch(g){console.error("[SuperDocTemplateBuilder] Delete command failed:",g)}let v=ve(r);const S=v.some(g=>g.id===t);!y&&S&&(v=v.filter(g=>g.id!==t));let _=!1;return Y(g=>{if(Ee(g,v))return g;const m=g.some($=>$.id===t),X=v.some($=>$.id===t);return m&&!X&&(_=!0),C?.(v),v}),_&&(N?.(t),u(g=>g===t?null:g)),y||_},[N,C]),w=i.useCallback(t=>{if(!k.current?.activeEditor)return;k.current.activeEditor.commands.selectStructuredContentById?.(t),u(t);const y=E.find(v=>v.id===t);y&&V?.(y)},[E,V]),G=i.useCallback(t=>{if(!t)return;const r=ve(t);Y(y=>Ee(y,r)?y:(C?.(r),r))},[C]);i.useEffect(()=>K.current?((async()=>{const{SuperDoc:r}=await import("superdoc"),y={selector:K.current,document:f?.source,documentMode:f?.mode||"editing",onReady:()=>{if(v.activeEditor){const S=v.activeEditor;S.on("update",({editor:_})=>{const{state:g}=_,{from:m}=g.selection;if(m>=q.length){const de=m-q.length;if(g.doc.textBetween(de,m)===q){const pe=_.view.coordsAtPos(m),me=Re(new DOMRect(pe.left,pe.top,0,0)),xe=()=>{const ae=k.current?.activeEditor;if(!ae)return;const Oe=ae.state.selection.from,Pe=ae.state.tr.delete(de,Oe);ae.view.dispatch(Pe)};M.current=xe,I.current=m,j(me),R(!0),p(),z?.({position:{from:de,to:m},bounds:me,cleanup:xe});return}}if(!te.current)return;if(I.current==null){R(!1),p();return}if(m<I.current){R(!1),I.current=null,p();return}const X=g.doc.textBetween(I.current,m);x(X);const $=_.view.coordsAtPos(m),Ne=Re(new DOMRect($.left,$.top,0,0));j(Ne)}),S.on("update",()=>{G(S)}),G(S)}D?.()}},v=new r({...y,...J&&{toolbar:J.selector,modules:{toolbar:{selector:J.selector,toolbarGroups:J.config.toolbarGroups||["center"],excludeItems:J.config.excludeItems||[],...J.config}}}});k.current=v})(),()=>{M.current=null,I.current=null;const r=k.current;r&&typeof r.destroy=="function"&&r.destroy(),k.current=null}):void 0,[f?.source,f?.mode,q,G,D,z,F]);const ue=i.useCallback(async t=>{if(M.current&&(M.current(),M.current=null),I.current=null,p(),t.id.startsWith("custom_")&&L)try{const r=await L(t);if(r){B("inline",{alias:r.label,category:r.category,metadata:r.metadata,defaultValue:r.defaultValue}),R(!1);return}}catch(r){console.error("Field creation failed:",r)}B("inline",{alias:t.label,category:t.category,metadata:t.metadata,defaultValue:t.defaultValue}),R(!1)},[B,L,p]),we=i.useCallback(()=>{R(!1),I.current=null,p(),M.current&&(M.current(),M.current=null)},[p]),_e=i.useCallback(()=>{if(!k.current?.activeEditor||E.length===0)return;const t=E.findIndex(y=>y.id===A),r=t>=0?(t+1)%E.length:0;w(E[r].id)},[E,A,w]),je=i.useCallback(()=>{if(!k.current?.activeEditor||E.length===0)return;const t=E.findIndex(y=>y.id===A),r=t>0?t-1:E.length-1;w(E[r].id)},[E,A,w]),Se=i.useCallback(async t=>{try{await k.current?.export({exportType:["docx"],exportedName:t?.fileName?t?.fileName:"document"})}catch(r){throw console.error("Failed to export DOCX",r),r}},[]);i.useImperativeHandle(d,()=>({insertField:t=>B("inline",t),insertBlockField:t=>B("block",t),updateField:re,deleteField:h,selectField:w,nextField:_e,previousField:je,getFields:()=>E,exportTemplate:Se}));const Fe=n.component||Ce,fe=c.component||Te,J=ze(F);return s.jsxs("div",{className:`superdoc-template-builder ${U||""}`,style:O,children:[s.jsxs("div",{style:{display:"flex",gap:"20px"},children:[c.position==="left"&&s.jsx("div",{className:"superdoc-template-builder-sidebar",children:s.jsx(fe,{fields:E,onSelect:t=>w(t.id),onDelete:h,selectedFieldId:A||void 0})}),s.jsxs("div",{className:"superdoc-template-builder-document",style:{flex:1},children:[J?.renderDefaultContainer&&s.jsx("div",{id:"superdoc-toolbar",className:"superdoc-template-builder-toolbar","data-testid":"template-builder-toolbar"}),s.jsx("div",{ref:K,className:"superdoc-template-builder-editor",style:{height:Q},"data-testid":"template-builder-editor"})]}),c.position==="right"&&s.jsx("div",{className:"superdoc-template-builder-sidebar",children:s.jsx(fe,{fields:E,onSelect:t=>w(t.id),onDelete:h,selectedFieldId:A||void 0})})]}),s.jsx(Fe,{isVisible:b,position:T,availableFields:l.available||[],filteredFields:Z,filterQuery:W,allowCreate:l.allowCreate||!1,onSelect:ue,onClose:we,onCreateField:L})]})});ke.displayName="SuperDocTemplateBuilder";exports.FieldList=Te;exports.FieldMenu=Ce;exports.default=ke;
|
|
22
|
+
<%s key={someKey} {...props} />`,p,h,_,h),G[h+p]=!0)}if(h=null,m!==void 0&&(f(m),h=""+m),F(a)&&(f(a.key),h=""+a.key),"key"in a){m={};for(var J in a)J!=="key"&&(m[J]=a[J])}else m=a;return h&&D(m,typeof e=="function"?e.displayName||e.name||"Unknown":e),U(e,h,m,r(),B,re)}function N(e){C(e)?e._store&&(e._store.validated=1):typeof e=="object"&&e!==null&&e.$$typeof===j&&(e._payload.status==="fulfilled"?C(e._payload.value)&&e._payload.value._store&&(e._payload.value._store.validated=1):e._store&&(e._store.validated=1))}function C(e){return typeof e=="object"&&e!==null&&e.$$typeof===L}var Y=i,L=Symbol.for("react.transitional.element"),q=Symbol.for("react.portal"),O=Symbol.for("react.fragment"),Q=Symbol.for("react.strict_mode"),v=Symbol.for("react.profiler"),$=Symbol.for("react.consumer"),A=Symbol.for("react.context"),c=Symbol.for("react.forward_ref"),b=Symbol.for("react.suspense"),E=Symbol.for("react.suspense_list"),T=Symbol.for("react.memo"),j=Symbol.for("react.lazy"),W=Symbol.for("react.activity"),ce=Symbol.for("react.client.reference"),Z=Y.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,se=Object.prototype.hasOwnProperty,K=Array.isArray,k=console.createTask?console.createTask:function(){return null};Y={react_stack_bottom_frame:function(e){return e()}};var M,ee={},I=Y.react_stack_bottom_frame.bind(Y,l)(),te=k(d(l)),G={};oe.Fragment=O,oe.jsx=function(e,a,m){var p=1e4>Z.recentlyCreatedOwnerStacks++;return P(e,a,m,!1,p?Error("react-stack-top-frame"):I,p?k(d(e)):te)},oe.jsxs=function(e,a,m){var p=1e4>Z.recentlyCreatedOwnerStacks++;return P(e,a,m,!0,p?Error("react-stack-top-frame"):I,p?k(d(e)):te)}})()),oe}var ve;function $e(){return ve||(ve=1,process.env.NODE_ENV==="production"?ie.exports=Ve():ie.exports=Ye()),ie.exports}var s=$e();const Ce=({isVisible:o,position:u,availableFields:f,filteredFields:d,filterQuery:r,allowCreate:l,onSelect:F,onClose:D,onCreateField:H})=>{const[U,P]=i.useState(!1),[N,C]=i.useState("");i.useEffect(()=>{o||(P(!1),C(""))},[o]);const Y=i.useMemo(()=>({position:"absolute",left:u?.left,top:u?.top,zIndex:1e3,background:"white",border:"1px solid #ddd",borderRadius:"4px",boxShadow:"0 2px 8px rgba(0,0,0,0.1)",padding:"8px 0",minWidth:"200px"}),[u]),L=d??f,q=!!r,O=i.useMemo(()=>{const c=[],b=new Map;return L.forEach(E=>{const T=E.category?.trim()||"Uncategorized",j=b.get(T);if(j!==void 0){c[j].fields.push(E);return}b.set(T,c.length),c.push({category:T,fields:[E]})}),c},[L]),[Q,v]=i.useState({});i.useEffect(()=>{v(c=>{if(O.length===0)return Object.keys(c).length===0?c:{};const b={};let E=Object.keys(c).length!==O.length;return O.forEach(({category:T},j)=>{const W=q?!0:c[T]??j===0;b[T]=W,!E&&c[T]!==W&&(E=!0)}),E?b:c})},[O,q]);const $=i.useCallback(c=>{v(b=>({...b,[c]:!b[c]}))},[]);if(!o)return null;const A=async()=>{const c=N.trim();if(!c)return;const b={id:`custom_${Date.now()}`,label:c,category:"Custom"};try{if(H){const E=await H(b);F(E||b)}else F(b)}finally{P(!1),C("")}};return s.jsxs("div",{className:"superdoc-field-menu",style:Y,children:[q&&s.jsx("div",{style:{padding:"8px 16px",borderBottom:"1px solid #f0f0f0",marginBottom:"4px"},children:s.jsxs("div",{style:{fontSize:"12px",color:"#6b7280"},children:["Filtering results for",s.jsx("span",{style:{fontWeight:600,color:"#111827",marginLeft:"4px"},children:r})]})}),l&&!U&&s.jsx("div",{className:"field-menu-item",onClick:()=>P(!0),style:{padding:"8px 16px",cursor:"pointer",color:"#0066cc",fontWeight:500},children:"+ Create New Field"}),l&&U&&s.jsxs("div",{style:{padding:"8px 16px"},children:[s.jsx("input",{type:"text",value:N,placeholder:"Field name...",onChange:c=>C(c.target.value),onKeyDown:c=>{c.key==="Enter"&&A(),c.key==="Escape"&&(P(!1),C(""))},autoFocus:!0,style:{width:"100%",padding:"4px 8px",border:"1px solid #ddd",borderRadius:"3px"}}),s.jsxs("div",{style:{marginTop:"8px",display:"flex",gap:"8px"},children:[s.jsx("button",{onClick:A,disabled:!N.trim(),style:{padding:"4px 12px",background:N.trim()?"#0066cc":"#ccc",color:"white",border:"none",borderRadius:"3px",cursor:N.trim()?"pointer":"not-allowed"},children:"Create"}),s.jsx("button",{onClick:()=>{P(!1),C("")},style:{padding:"4px 12px",background:"white",border:"1px solid #ddd",borderRadius:"3px",cursor:"pointer"},children:"Cancel"})]})]}),l&&f.length>0&&s.jsx("div",{style:{borderTop:"1px solid #eee",margin:"4px 0"}}),O.length===0?s.jsx("div",{style:{padding:"16px",fontSize:"13px",color:"#6b7280",textAlign:"center"},children:"No matching fields"}):O.map(({category:c,fields:b},E)=>{const T=!!Q[c],j=`${Math.max(b.length*40,0)}px`;return s.jsxs("div",{style:{borderTop:E===0&&l?void 0:"1px solid #f0f0f0"},children:[s.jsxs("button",{type:"button",onClick:()=>$(c),style:{width:"100%",display:"flex",alignItems:"center",justifyContent:"space-between",padding:"8px 16px",background:"transparent",border:"none",cursor:"pointer",fontWeight:500,textAlign:"left"},children:[s.jsxs("span",{children:[c," (",b.length,")"]}),s.jsx("span",{"aria-hidden":!0,style:{display:"inline-block",width:"8px",height:"8px",borderRight:"2px solid #666",borderBottom:"2px solid #666",transform:T?"rotate(45deg)":"rotate(-45deg)",transition:"transform 0.2s ease",marginLeft:"12px"}})]}),s.jsx("div",{"data-category":c,"aria-hidden":!T,style:{overflow:"hidden",maxHeight:T?j:"0px",opacity:T?1:0,transition:"max-height 0.2s ease, opacity 0.2s ease",pointerEvents:T?"auto":"none"},children:s.jsx("div",{style:{padding:T?"4px 0":0},children:b.map(W=>s.jsx("div",{className:"field-menu-item",onClick:()=>F(W),style:{padding:"8px 16px",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"space-between"},children:s.jsx("span",{style:{fontWeight:500},children:W.label})},W.id))})})]},c)}),s.jsx("div",{style:{borderTop:"1px solid #eee",marginTop:"4px"},children:s.jsx("button",{onClick:D,style:{width:"100%",padding:"6px 16px",background:"#f3f4f6",border:"none",borderRadius:"0 0 4px 4px",cursor:"pointer"},children:"Close"})})]})},Te=({fields:o,onSelect:u,onDelete:f,selectedFieldId:d})=>s.jsxs("div",{className:"superdoc-field-list",style:{width:"250px",background:"white",border:"1px solid #e5e7eb",borderRadius:"8px",padding:"16px"},children:[s.jsxs("h3",{style:{margin:"0 0 16px 0",fontSize:"16px",fontWeight:"600"},children:["Template Fields (",o.length,")"]}),o.length===0?s.jsxs("div",{style:{color:"#9ca3af",fontSize:"14px",textAlign:"center",padding:"20px 0"},children:["No fields yet. Type ","{{"," to add a field."]}):s.jsx("div",{style:{display:"flex",flexDirection:"column",gap:"8px"},children:o.map(r=>s.jsxs("div",{onClick:()=>u(r),style:{position:"relative",padding:"12px",background:d===r.id?"#eff6ff":"#f9fafb",border:d===r.id?"1px solid #3b82f6":"1px solid #e5e7eb",borderRadius:"6px",cursor:"pointer",transition:"all 0.2s"},onMouseEnter:l=>{d!==r.id&&(l.currentTarget.style.background="#f3f4f6")},onMouseLeave:l=>{d!==r.id&&(l.currentTarget.style.background="#f9fafb")},title:r.alias,children:[s.jsx("button",{onClick:l=>{l.stopPropagation(),f(r.id)},style:{position:"absolute",top:"8px",right:"8px",padding:"4px",background:"transparent",border:"none",cursor:"pointer",color:"#9ca3af",transition:"color 0.2s",display:"flex",alignItems:"center",justifyContent:"center"},onMouseEnter:l=>{l.currentTarget.style.color="#ef4444"},onMouseLeave:l=>{l.currentTarget.style.color="#9ca3af"},title:"Delete field",children:s.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:s.jsx("path",{d:"M6 2V1.5C6 1.22386 6.22386 1 6.5 1H9.5C9.77614 1 10 1.22386 10 1.5V2M2 4H14M12.6667 4L12.1991 11.0129C12.129 12.065 12.0939 12.5911 11.8667 12.99C11.6666 13.3412 11.3648 13.6235 11.0011 13.7998C10.588 14 10.0607 14 9.00623 14H6.99377C5.93927 14 5.41202 14 4.99889 13.7998C4.63517 13.6235 4.33339 13.3412 4.13332 12.99C3.90607 12.5911 3.871 12.065 3.80086 11.0129L3.33333 4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}),s.jsxs("div",{style:{paddingRight:"24px"},children:[s.jsx("div",{style:{fontWeight:"500",fontSize:"14px",marginBottom:r.alias&&r.alias!==r.id?"4px":"0"},children:r.id}),r.alias&&r.alias!==r.id&&s.jsx("div",{style:{fontSize:"12px",color:"#4b5563"},children:r.alias})]})]},r.id))})]}),fe=o=>{const u=o.helpers?.structuredContentCommands;return u?.getStructuredContentTags?(u.getStructuredContentTags(o.state)||[]).map(d=>{const l=(d?.node??d)?.attrs??{};return{id:l.id,alias:l.alias||l.label||"",tag:l.tag}}):[]},Ee=(o,u)=>{if(o===u)return!0;if(o.length!==u.length)return!1;for(let f=0;f<o.length;f+=1){const d=o[f],r=u[f];if(!r||d.id!==r.id||d.alias!==r.alias||d.tag!==r.tag||d.position!==r.position)return!1}return!0},ze=o=>{if(!o)return null;if(o===!0)return{selector:"#superdoc-toolbar",config:{},renderDefaultContainer:!0};if(typeof o=="string")return{selector:o,config:{},renderDefaultContainer:!1};const{selector:u,...f}=o;return{selector:u||"#superdoc-toolbar",config:f,renderDefaultContainer:u===void 0}},le=10,He=250,Ue=300,Re=o=>{const u=window.innerWidth-He-le,f=window.innerHeight-Ue-le,d=Math.min(o.left,u),r=Math.min(o.top,f);return new DOMRect(Math.max(d,le),Math.max(r,le),o.width,o.height)},ke=i.forwardRef((o,u)=>{const{document:f,fields:d={},menu:r={},list:l={},toolbar:F,onReady:D,onTrigger:H,onFieldInsert:U,onFieldUpdate:P,onFieldDelete:N,onFieldsChange:C,onFieldSelect:Y,onFieldCreate:L,className:q,style:O,documentHeight:Q="600px"}=o,[v,$]=i.useState(d.initial||[]),[A,c]=i.useState(null),[b,E]=i.useState(!1),[T,j]=i.useState(),[W,ce]=i.useState(""),[Z,se]=i.useState(()=>d.available||[]),K=i.useRef(null),k=i.useRef(null),M=i.useRef(null),ee=i.useRef(d);ee.current=d;const I=i.useRef(null),te=i.useRef(b);i.useEffect(()=>{te.current=b},[b]);const G=r.trigger||"{{",e=ee.current.available||[],a=i.useCallback(t=>{const n=t.trim().toLowerCase();return n?e.filter(y=>{const R=y.label.toLowerCase(),S=y.category?.toLowerCase()||"";return R.includes(n)||S.includes(n)}):e},[e]),m=i.useCallback(t=>{ce(t),se(a(t))},[a]),p=i.useCallback(()=>{m("")},[m]),B=i.useCallback((t,n)=>{if(!k.current?.activeEditor)return!1;const y=k.current.activeEditor,R=v,S=t==="inline"?y.commands.insertStructuredContentInline?.({attrs:{alias:n.alias,tag:n.metadata?JSON.stringify(n.metadata):n.category},text:n.defaultValue||n.alias}):y.commands.insertStructuredContentBlock?.({attrs:{alias:n.alias,tag:n.metadata?JSON.stringify(n.metadata):n.category},text:n.defaultValue||n.alias});if(S){const w=fe(y);$(w),C?.(w);const x=w.find(g=>!R.some(z=>z.id===g.id));x&&U?.(x)}return S},[U,C,v]),re=i.useCallback((t,n)=>{if(!k.current?.activeEditor)return!1;const R=k.current.activeEditor.commands.updateStructuredContentById?.(t,{attrs:n});return R&&$(S=>{const w=S.map(g=>g.id===t?{...g,...n}:g);C?.(w);const x=w.find(g=>g.id===t);return x&&P?.(x),w}),R},[P,C]),h=i.useCallback(t=>{const n=k.current?.activeEditor;if(!n){console.warn("[SuperDocTemplateBuilder] deleteField called without active editor");let x=!1;return $(g=>{if(!g.some(V=>V.id===t))return g;const z=g.filter(V=>V.id!==t);return x=!0,C?.(z),z}),x&&(N?.(t),c(g=>g===t?null:g)),x}let y=!1;try{y=n.commands.deleteStructuredContentById?.(t)??!1}catch(x){console.error("[SuperDocTemplateBuilder] Delete command failed:",x)}let R=fe(n);const S=R.some(x=>x.id===t);!y&&S&&(R=R.filter(x=>x.id!==t));let w=!1;return $(x=>{if(Ee(x,R))return x;const g=x.some(V=>V.id===t),z=R.some(V=>V.id===t);return g&&!z&&(w=!0),C?.(R),R}),w&&(N?.(t),c(x=>x===t?null:x)),y||w},[N,C]),_=i.useCallback(t=>{if(!k.current?.activeEditor)return;k.current.activeEditor.commands.selectStructuredContentById?.(t),c(t);const y=v.find(R=>R.id===t);y&&Y?.(y)},[v,Y]),J=i.useCallback(t=>{if(!t)return;const n=fe(t);$(y=>Ee(y,n)?y:(C?.(n),n))},[C]);i.useEffect(()=>K.current?((async()=>{const{SuperDoc:n}=await import("superdoc"),y={selector:K.current,document:f?.source,documentMode:f?.mode||"editing",onReady:()=>{if(R.activeEditor){const S=R.activeEditor;S.on("update",({editor:w})=>{const{state:x}=w,{from:g}=x.selection;if(g>=G.length){const de=g-G.length;if(x.doc.textBetween(de,g)===G){const me=w.view.coordsAtPos(g),xe=Re(new DOMRect(me.left,me.top,0,0)),ge=()=>{const ae=k.current?.activeEditor;if(!ae)return;const Oe=ae.state.selection.from,Pe=ae.state.tr.delete(de,Oe);ae.view.dispatch(Pe)};M.current=ge,I.current=g,j(xe),E(!0),p(),H?.({position:{from:de,to:g},bounds:xe,cleanup:ge});return}}if(!te.current)return;if(I.current==null){E(!1),p();return}if(g<I.current){E(!1),I.current=null,p();return}const z=x.doc.textBetween(I.current,g);m(z);const V=w.view.coordsAtPos(g),Ne=Re(new DOMRect(V.left,V.top,0,0));j(Ne)}),S.on("update",()=>{J(S)}),J(S)}D?.()}},R=new n({...y,...X&&{toolbar:X.selector,modules:{toolbar:{selector:X.selector,toolbarGroups:X.config.toolbarGroups||["center"],excludeItems:X.config.excludeItems||[],...X.config}}}});k.current=R})(),()=>{M.current=null,I.current=null;const n=k.current;n&&typeof n.destroy=="function"&&n.destroy(),k.current=null}):void 0,[f?.source,f?.mode,G,J,D,H,F]);const ue=i.useCallback(async t=>{if(M.current&&(M.current(),M.current=null),I.current=null,p(),t.id.startsWith("custom_")&&L)try{const n=await L(t);if(n){B("inline",{alias:n.label,category:n.category,metadata:n.metadata,defaultValue:n.defaultValue}),E(!1);return}}catch(n){console.error("Field creation failed:",n)}B("inline",{alias:t.label,category:t.category,metadata:t.metadata,defaultValue:t.defaultValue}),E(!1)},[B,L,p]),we=i.useCallback(()=>{E(!1),I.current=null,p(),M.current&&(M.current(),M.current=null)},[p]),_e=i.useCallback(()=>{if(!k.current?.activeEditor||v.length===0)return;const t=v.findIndex(y=>y.id===A),n=t>=0?(t+1)%v.length:0;_(v[n].id)},[v,A,_]),je=i.useCallback(()=>{if(!k.current?.activeEditor||v.length===0)return;const t=v.findIndex(y=>y.id===A),n=t>0?t-1:v.length-1;_(v[n].id)},[v,A,_]),Se=i.useCallback(async t=>{try{await k.current?.export({exportType:["docx"],exportedName:t?.fileName?t?.fileName:"document"})}catch(n){throw console.error("Failed to export DOCX",n),n}},[]);i.useImperativeHandle(u,()=>({insertField:t=>B("inline",t),insertBlockField:t=>B("block",t),updateField:re,deleteField:h,selectField:_,nextField:_e,previousField:je,getFields:()=>v,exportTemplate:Se}));const Fe=r.component||Ce,pe=l.component||Te,X=ze(F);return s.jsxs("div",{className:`superdoc-template-builder ${q||""}`,style:O,children:[s.jsxs("div",{style:{display:"flex",gap:"20px"},children:[l.position==="left"&&s.jsx("div",{className:"superdoc-template-builder-sidebar",children:s.jsx(pe,{fields:v,onSelect:t=>_(t.id),onDelete:h,selectedFieldId:A||void 0})}),s.jsxs("div",{className:"superdoc-template-builder-document",style:{flex:1},children:[X?.renderDefaultContainer&&s.jsx("div",{id:"superdoc-toolbar",className:"superdoc-template-builder-toolbar","data-testid":"template-builder-toolbar"}),s.jsx("div",{ref:K,className:"superdoc-template-builder-editor",style:{height:Q},"data-testid":"template-builder-editor"})]}),l.position==="right"&&s.jsx("div",{className:"superdoc-template-builder-sidebar",children:s.jsx(pe,{fields:v,onSelect:t=>_(t.id),onDelete:h,selectedFieldId:A||void 0})})]}),s.jsx(Fe,{isVisible:b,position:T,availableFields:d.available||[],filteredFields:Z,filterQuery:W,allowCreate:d.allowCreate||!1,onSelect:ue,onClose:we,onCreateField:L})]})});ke.displayName="SuperDocTemplateBuilder";exports.FieldList=Te;exports.FieldMenu=Ce;exports.default=ke;
|
package/dist/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import Ae, { useState as z, useEffect as ue, useMemo as
|
|
1
|
+
import Ae, { useState as z, useEffect as ue, useMemo as ve, useCallback as C, forwardRef as Me, useRef as Z, useImperativeHandle as Ie } from "react";
|
|
2
2
|
var ce = { exports: {} }, se = {};
|
|
3
3
|
/**
|
|
4
4
|
* @license React
|
|
@@ -9,12 +9,12 @@ var ce = { exports: {} }, se = {};
|
|
|
9
9
|
* This source code is licensed under the MIT license found in the
|
|
10
10
|
* LICENSE file in the root directory of this source tree.
|
|
11
11
|
*/
|
|
12
|
-
var
|
|
12
|
+
var Ee;
|
|
13
13
|
function De() {
|
|
14
|
-
if (
|
|
15
|
-
|
|
14
|
+
if (Ee) return se;
|
|
15
|
+
Ee = 1;
|
|
16
16
|
var a = Symbol.for("react.transitional.element"), x = Symbol.for("react.fragment");
|
|
17
|
-
function
|
|
17
|
+
function m(c, n, i) {
|
|
18
18
|
var F = null;
|
|
19
19
|
if (i !== void 0 && (F = "" + i), n.key !== void 0 && (F = "" + n.key), "key" in n) {
|
|
20
20
|
i = {};
|
|
@@ -29,7 +29,7 @@ function De() {
|
|
|
29
29
|
props: i
|
|
30
30
|
};
|
|
31
31
|
}
|
|
32
|
-
return se.Fragment = x, se.jsx =
|
|
32
|
+
return se.Fragment = x, se.jsx = m, se.jsxs = m, se;
|
|
33
33
|
}
|
|
34
34
|
var ae = {};
|
|
35
35
|
/**
|
|
@@ -41,9 +41,9 @@ var ae = {};
|
|
|
41
41
|
* This source code is licensed under the MIT license found in the
|
|
42
42
|
* LICENSE file in the root directory of this source tree.
|
|
43
43
|
*/
|
|
44
|
-
var
|
|
44
|
+
var Re;
|
|
45
45
|
function Le() {
|
|
46
|
-
return
|
|
46
|
+
return Re || (Re = 1, process.env.NODE_ENV !== "production" && (function() {
|
|
47
47
|
function a(e) {
|
|
48
48
|
if (e == null) return null;
|
|
49
49
|
if (typeof e == "function")
|
|
@@ -52,13 +52,13 @@ function Le() {
|
|
|
52
52
|
switch (e) {
|
|
53
53
|
case O:
|
|
54
54
|
return "Fragment";
|
|
55
|
-
case
|
|
55
|
+
case y:
|
|
56
56
|
return "Profiler";
|
|
57
57
|
case K:
|
|
58
58
|
return "StrictMode";
|
|
59
59
|
case g:
|
|
60
60
|
return "Suspense";
|
|
61
|
-
case
|
|
61
|
+
case v:
|
|
62
62
|
return "SuspenseList";
|
|
63
63
|
case W:
|
|
64
64
|
return "Activity";
|
|
@@ -67,11 +67,11 @@ function Le() {
|
|
|
67
67
|
switch (typeof e.tag == "number" && console.error(
|
|
68
68
|
"Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."
|
|
69
69
|
), e.$$typeof) {
|
|
70
|
-
case
|
|
70
|
+
case J:
|
|
71
71
|
return "Portal";
|
|
72
72
|
case A:
|
|
73
73
|
return e.displayName || "Context";
|
|
74
|
-
case
|
|
74
|
+
case $:
|
|
75
75
|
return (e._context.displayName || "Context") + ".Consumer";
|
|
76
76
|
case l:
|
|
77
77
|
var s = e.render;
|
|
@@ -90,7 +90,7 @@ function Le() {
|
|
|
90
90
|
function x(e) {
|
|
91
91
|
return "" + e;
|
|
92
92
|
}
|
|
93
|
-
function
|
|
93
|
+
function m(e) {
|
|
94
94
|
try {
|
|
95
95
|
x(e);
|
|
96
96
|
var s = !1;
|
|
@@ -99,8 +99,8 @@ function Le() {
|
|
|
99
99
|
}
|
|
100
100
|
if (s) {
|
|
101
101
|
s = console;
|
|
102
|
-
var
|
|
103
|
-
return
|
|
102
|
+
var u = s.error, d = typeof Symbol == "function" && Symbol.toStringTag && e[Symbol.toStringTag] || e.constructor.name || "Object";
|
|
103
|
+
return u.call(
|
|
104
104
|
s,
|
|
105
105
|
"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
|
|
106
106
|
d
|
|
@@ -133,34 +133,34 @@ function Le() {
|
|
|
133
133
|
return e.key !== void 0;
|
|
134
134
|
}
|
|
135
135
|
function D(e, s) {
|
|
136
|
-
function
|
|
137
|
-
|
|
136
|
+
function u() {
|
|
137
|
+
M || (M = !0, console.error(
|
|
138
138
|
"%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",
|
|
139
139
|
s
|
|
140
140
|
));
|
|
141
141
|
}
|
|
142
|
-
|
|
143
|
-
get:
|
|
142
|
+
u.isReactWarning = !0, Object.defineProperty(e, "key", {
|
|
143
|
+
get: u,
|
|
144
144
|
configurable: !0
|
|
145
145
|
});
|
|
146
146
|
}
|
|
147
|
-
function
|
|
147
|
+
function U() {
|
|
148
148
|
var e = a(this.type);
|
|
149
149
|
return re[e] || (re[e] = !0, console.error(
|
|
150
150
|
"Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release."
|
|
151
151
|
)), e = this.props.ref, e !== void 0 ? e : null;
|
|
152
152
|
}
|
|
153
|
-
function
|
|
154
|
-
var h =
|
|
153
|
+
function G(e, s, u, d, B, oe) {
|
|
154
|
+
var h = u.ref;
|
|
155
155
|
return e = {
|
|
156
156
|
$$typeof: L,
|
|
157
157
|
type: e,
|
|
158
158
|
key: s,
|
|
159
|
-
props:
|
|
159
|
+
props: u,
|
|
160
160
|
_owner: d
|
|
161
161
|
}, (h !== void 0 ? h : null) !== null ? Object.defineProperty(e, "ref", {
|
|
162
162
|
enumerable: !1,
|
|
163
|
-
get:
|
|
163
|
+
get: U
|
|
164
164
|
}) : Object.defineProperty(e, "ref", { enumerable: !1, value: null }), e._store = {}, Object.defineProperty(e._store, "validated", {
|
|
165
165
|
configurable: !1,
|
|
166
166
|
enumerable: !1,
|
|
@@ -183,7 +183,7 @@ function Le() {
|
|
|
183
183
|
value: oe
|
|
184
184
|
}), Object.freeze && (Object.freeze(e.props), Object.freeze(e)), e;
|
|
185
185
|
}
|
|
186
|
-
function P(e, s,
|
|
186
|
+
function P(e, s, u, d, B, oe) {
|
|
187
187
|
var h = s.children;
|
|
188
188
|
if (h !== void 0)
|
|
189
189
|
if (d)
|
|
@@ -198,10 +198,10 @@ function Le() {
|
|
|
198
198
|
else N(h);
|
|
199
199
|
if (ie.call(s, "key")) {
|
|
200
200
|
h = a(e);
|
|
201
|
-
var
|
|
201
|
+
var j = Object.keys(s).filter(function(pe) {
|
|
202
202
|
return pe !== "key";
|
|
203
203
|
});
|
|
204
|
-
d = 0 <
|
|
204
|
+
d = 0 < j.length ? "{key: someKey, " + j.join(": ..., ") + ": ...}" : "{key: someKey}", q[h + d] || (j = 0 < j.length ? "{" + j.join(": ..., ") + ": ...}" : "{}", console.error(
|
|
205
205
|
`A props object containing a "key" prop is being spread into JSX:
|
|
206
206
|
let props = %s;
|
|
207
207
|
<%s {...props} />
|
|
@@ -210,22 +210,22 @@ React keys must be passed directly to JSX without using spread:
|
|
|
210
210
|
<%s key={someKey} {...props} />`,
|
|
211
211
|
d,
|
|
212
212
|
h,
|
|
213
|
-
|
|
213
|
+
j,
|
|
214
214
|
h
|
|
215
|
-
),
|
|
215
|
+
), q[h + d] = !0);
|
|
216
216
|
}
|
|
217
|
-
if (h = null,
|
|
218
|
-
|
|
219
|
-
for (var
|
|
220
|
-
|
|
221
|
-
} else
|
|
217
|
+
if (h = null, u !== void 0 && (m(u), h = "" + u), F(s) && (m(s.key), h = "" + s.key), "key" in s) {
|
|
218
|
+
u = {};
|
|
219
|
+
for (var X in s)
|
|
220
|
+
X !== "key" && (u[X] = s[X]);
|
|
221
|
+
} else u = s;
|
|
222
222
|
return h && D(
|
|
223
|
-
|
|
223
|
+
u,
|
|
224
224
|
typeof e == "function" ? e.displayName || e.name || "Unknown" : e
|
|
225
|
-
),
|
|
225
|
+
), G(
|
|
226
226
|
e,
|
|
227
227
|
h,
|
|
228
|
-
|
|
228
|
+
u,
|
|
229
229
|
n(),
|
|
230
230
|
B,
|
|
231
231
|
oe
|
|
@@ -237,62 +237,62 @@ React keys must be passed directly to JSX without using spread:
|
|
|
237
237
|
function R(e) {
|
|
238
238
|
return typeof e == "object" && e !== null && e.$$typeof === L;
|
|
239
239
|
}
|
|
240
|
-
var
|
|
240
|
+
var Y = Ae, L = Symbol.for("react.transitional.element"), J = Symbol.for("react.portal"), O = Symbol.for("react.fragment"), K = Symbol.for("react.strict_mode"), y = Symbol.for("react.profiler"), $ = Symbol.for("react.consumer"), A = Symbol.for("react.context"), l = Symbol.for("react.forward_ref"), g = Symbol.for("react.suspense"), v = Symbol.for("react.suspense_list"), T = Symbol.for("react.memo"), k = Symbol.for("react.lazy"), W = Symbol.for("react.activity"), fe = Symbol.for("react.client.reference"), ee = Y.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, ie = Object.prototype.hasOwnProperty, te = Array.isArray, w = console.createTask ? console.createTask : function() {
|
|
241
241
|
return null;
|
|
242
242
|
};
|
|
243
|
-
|
|
243
|
+
Y = {
|
|
244
244
|
react_stack_bottom_frame: function(e) {
|
|
245
245
|
return e();
|
|
246
246
|
}
|
|
247
247
|
};
|
|
248
|
-
var
|
|
249
|
-
|
|
248
|
+
var M, re = {}, I = Y.react_stack_bottom_frame.bind(
|
|
249
|
+
Y,
|
|
250
250
|
i
|
|
251
|
-
)(), ne = w(c(i)),
|
|
252
|
-
ae.Fragment = O, ae.jsx = function(e, s,
|
|
251
|
+
)(), ne = w(c(i)), q = {};
|
|
252
|
+
ae.Fragment = O, ae.jsx = function(e, s, u) {
|
|
253
253
|
var d = 1e4 > ee.recentlyCreatedOwnerStacks++;
|
|
254
254
|
return P(
|
|
255
255
|
e,
|
|
256
256
|
s,
|
|
257
|
-
|
|
257
|
+
u,
|
|
258
258
|
!1,
|
|
259
|
-
d ? Error("react-stack-top-frame") :
|
|
259
|
+
d ? Error("react-stack-top-frame") : I,
|
|
260
260
|
d ? w(c(e)) : ne
|
|
261
261
|
);
|
|
262
|
-
}, ae.jsxs = function(e, s,
|
|
262
|
+
}, ae.jsxs = function(e, s, u) {
|
|
263
263
|
var d = 1e4 > ee.recentlyCreatedOwnerStacks++;
|
|
264
264
|
return P(
|
|
265
265
|
e,
|
|
266
266
|
s,
|
|
267
|
-
|
|
267
|
+
u,
|
|
268
268
|
!0,
|
|
269
|
-
d ? Error("react-stack-top-frame") :
|
|
269
|
+
d ? Error("react-stack-top-frame") : I,
|
|
270
270
|
d ? w(c(e)) : ne
|
|
271
271
|
);
|
|
272
272
|
};
|
|
273
273
|
})()), ae;
|
|
274
274
|
}
|
|
275
|
-
var
|
|
275
|
+
var Te;
|
|
276
276
|
function We() {
|
|
277
|
-
return
|
|
277
|
+
return Te || (Te = 1, process.env.NODE_ENV === "production" ? ce.exports = De() : ce.exports = Le()), ce.exports;
|
|
278
278
|
}
|
|
279
279
|
var o = We();
|
|
280
280
|
const Be = ({
|
|
281
281
|
isVisible: a,
|
|
282
282
|
position: x,
|
|
283
|
-
availableFields:
|
|
283
|
+
availableFields: m,
|
|
284
284
|
filteredFields: c,
|
|
285
285
|
filterQuery: n,
|
|
286
286
|
allowCreate: i,
|
|
287
287
|
onSelect: F,
|
|
288
288
|
onClose: D,
|
|
289
|
-
onCreateField:
|
|
289
|
+
onCreateField: U
|
|
290
290
|
}) => {
|
|
291
|
-
const [
|
|
291
|
+
const [G, P] = z(!1), [N, R] = z("");
|
|
292
292
|
ue(() => {
|
|
293
293
|
a || (P(!1), R(""));
|
|
294
294
|
}, [a]);
|
|
295
|
-
const
|
|
295
|
+
const Y = ve(() => ({
|
|
296
296
|
position: "absolute",
|
|
297
297
|
left: x?.left,
|
|
298
298
|
top: x?.top,
|
|
@@ -303,31 +303,31 @@ const Be = ({
|
|
|
303
303
|
boxShadow: "0 2px 8px rgba(0,0,0,0.1)",
|
|
304
304
|
padding: "8px 0",
|
|
305
305
|
minWidth: "200px"
|
|
306
|
-
}), [x]), L = c ??
|
|
306
|
+
}), [x]), L = c ?? m, J = !!n, O = ve(() => {
|
|
307
307
|
const l = [], g = /* @__PURE__ */ new Map();
|
|
308
|
-
return L.forEach((
|
|
309
|
-
const T =
|
|
308
|
+
return L.forEach((v) => {
|
|
309
|
+
const T = v.category?.trim() || "Uncategorized", k = g.get(T);
|
|
310
310
|
if (k !== void 0) {
|
|
311
|
-
l[k].fields.push(
|
|
311
|
+
l[k].fields.push(v);
|
|
312
312
|
return;
|
|
313
313
|
}
|
|
314
|
-
g.set(T, l.length), l.push({ category: T, fields: [
|
|
314
|
+
g.set(T, l.length), l.push({ category: T, fields: [v] });
|
|
315
315
|
}), l;
|
|
316
|
-
}, [L]), [K,
|
|
316
|
+
}, [L]), [K, y] = z({});
|
|
317
317
|
ue(() => {
|
|
318
|
-
|
|
318
|
+
y((l) => {
|
|
319
319
|
if (O.length === 0)
|
|
320
320
|
return Object.keys(l).length === 0 ? l : {};
|
|
321
321
|
const g = {};
|
|
322
|
-
let
|
|
322
|
+
let v = Object.keys(l).length !== O.length;
|
|
323
323
|
return O.forEach(({ category: T }, k) => {
|
|
324
|
-
const W =
|
|
325
|
-
g[T] = W, !
|
|
326
|
-
}),
|
|
324
|
+
const W = J ? !0 : l[T] ?? k === 0;
|
|
325
|
+
g[T] = W, !v && l[T] !== W && (v = !0);
|
|
326
|
+
}), v ? g : l;
|
|
327
327
|
});
|
|
328
|
-
}, [O,
|
|
329
|
-
const
|
|
330
|
-
|
|
328
|
+
}, [O, J]);
|
|
329
|
+
const $ = C((l) => {
|
|
330
|
+
y((g) => ({
|
|
331
331
|
...g,
|
|
332
332
|
[l]: !g[l]
|
|
333
333
|
}));
|
|
@@ -342,17 +342,17 @@ const Be = ({
|
|
|
342
342
|
category: "Custom"
|
|
343
343
|
};
|
|
344
344
|
try {
|
|
345
|
-
if (
|
|
346
|
-
const
|
|
347
|
-
F(
|
|
345
|
+
if (U) {
|
|
346
|
+
const v = await U(g);
|
|
347
|
+
F(v || g);
|
|
348
348
|
} else
|
|
349
349
|
F(g);
|
|
350
350
|
} finally {
|
|
351
351
|
P(!1), R("");
|
|
352
352
|
}
|
|
353
353
|
};
|
|
354
|
-
return /* @__PURE__ */ o.jsxs("div", { className: "superdoc-field-menu", style:
|
|
355
|
-
|
|
354
|
+
return /* @__PURE__ */ o.jsxs("div", { className: "superdoc-field-menu", style: Y, children: [
|
|
355
|
+
J && /* @__PURE__ */ o.jsx(
|
|
356
356
|
"div",
|
|
357
357
|
{
|
|
358
358
|
style: {
|
|
@@ -372,7 +372,7 @@ const Be = ({
|
|
|
372
372
|
] })
|
|
373
373
|
}
|
|
374
374
|
),
|
|
375
|
-
i && !
|
|
375
|
+
i && !G && /* @__PURE__ */ o.jsx(
|
|
376
376
|
"div",
|
|
377
377
|
{
|
|
378
378
|
className: "field-menu-item",
|
|
@@ -386,7 +386,7 @@ const Be = ({
|
|
|
386
386
|
children: "+ Create New Field"
|
|
387
387
|
}
|
|
388
388
|
),
|
|
389
|
-
i &&
|
|
389
|
+
i && G && /* @__PURE__ */ o.jsxs("div", { style: { padding: "8px 16px" }, children: [
|
|
390
390
|
/* @__PURE__ */ o.jsx(
|
|
391
391
|
"input",
|
|
392
392
|
{
|
|
@@ -451,7 +451,7 @@ const Be = ({
|
|
|
451
451
|
}
|
|
452
452
|
)
|
|
453
453
|
] }),
|
|
454
|
-
i &&
|
|
454
|
+
i && m.length > 0 && /* @__PURE__ */ o.jsx(
|
|
455
455
|
"div",
|
|
456
456
|
{
|
|
457
457
|
style: {
|
|
@@ -471,20 +471,20 @@ const Be = ({
|
|
|
471
471
|
},
|
|
472
472
|
children: "No matching fields"
|
|
473
473
|
}
|
|
474
|
-
) : O.map(({ category: l, fields: g },
|
|
474
|
+
) : O.map(({ category: l, fields: g }, v) => {
|
|
475
475
|
const T = !!K[l], k = `${Math.max(g.length * 40, 0)}px`;
|
|
476
476
|
return /* @__PURE__ */ o.jsxs(
|
|
477
477
|
"div",
|
|
478
478
|
{
|
|
479
479
|
style: {
|
|
480
|
-
borderTop:
|
|
480
|
+
borderTop: v === 0 && i ? void 0 : "1px solid #f0f0f0"
|
|
481
481
|
},
|
|
482
482
|
children: [
|
|
483
483
|
/* @__PURE__ */ o.jsxs(
|
|
484
484
|
"button",
|
|
485
485
|
{
|
|
486
486
|
type: "button",
|
|
487
|
-
onClick: () =>
|
|
487
|
+
onClick: () => $(l),
|
|
488
488
|
style: {
|
|
489
489
|
width: "100%",
|
|
490
490
|
display: "flex",
|
|
@@ -583,10 +583,10 @@ const Be = ({
|
|
|
583
583
|
}
|
|
584
584
|
)
|
|
585
585
|
] });
|
|
586
|
-
},
|
|
586
|
+
}, Ve = ({
|
|
587
587
|
fields: a,
|
|
588
588
|
onSelect: x,
|
|
589
|
-
onDelete:
|
|
589
|
+
onDelete: m,
|
|
590
590
|
selectedFieldId: c
|
|
591
591
|
}) => /* @__PURE__ */ o.jsxs(
|
|
592
592
|
"div",
|
|
@@ -645,7 +645,7 @@ const Be = ({
|
|
|
645
645
|
"button",
|
|
646
646
|
{
|
|
647
647
|
onClick: (i) => {
|
|
648
|
-
i.stopPropagation(),
|
|
648
|
+
i.stopPropagation(), m(n.id);
|
|
649
649
|
},
|
|
650
650
|
style: {
|
|
651
651
|
position: "absolute",
|
|
@@ -719,7 +719,7 @@ const Be = ({
|
|
|
719
719
|
)) })
|
|
720
720
|
]
|
|
721
721
|
}
|
|
722
|
-
),
|
|
722
|
+
), xe = (a) => {
|
|
723
723
|
const x = a.helpers?.structuredContentCommands;
|
|
724
724
|
return x?.getStructuredContentTags ? (x.getStructuredContentTags(a.state) || []).map((c) => {
|
|
725
725
|
const i = (c?.node ?? c)?.attrs ?? {};
|
|
@@ -728,17 +728,17 @@ const Be = ({
|
|
|
728
728
|
alias: i.alias || i.label || "",
|
|
729
729
|
tag: i.tag
|
|
730
730
|
};
|
|
731
|
-
})
|
|
731
|
+
}) : [];
|
|
732
732
|
}, we = (a, x) => {
|
|
733
733
|
if (a === x) return !0;
|
|
734
734
|
if (a.length !== x.length) return !1;
|
|
735
|
-
for (let
|
|
736
|
-
const c = a[
|
|
735
|
+
for (let m = 0; m < a.length; m += 1) {
|
|
736
|
+
const c = a[m], n = x[m];
|
|
737
737
|
if (!n || c.id !== n.id || c.alias !== n.alias || c.tag !== n.tag || c.position !== n.position)
|
|
738
738
|
return !1;
|
|
739
739
|
}
|
|
740
740
|
return !0;
|
|
741
|
-
},
|
|
741
|
+
}, Ye = (a) => {
|
|
742
742
|
if (!a) return null;
|
|
743
743
|
if (a === !0)
|
|
744
744
|
return {
|
|
@@ -752,108 +752,105 @@ const Be = ({
|
|
|
752
752
|
config: {},
|
|
753
753
|
renderDefaultContainer: !1
|
|
754
754
|
};
|
|
755
|
-
const { selector: x, ...
|
|
755
|
+
const { selector: x, ...m } = a;
|
|
756
756
|
return {
|
|
757
757
|
selector: x || "#superdoc-toolbar",
|
|
758
|
-
config:
|
|
758
|
+
config: m,
|
|
759
759
|
renderDefaultContainer: x === void 0
|
|
760
760
|
};
|
|
761
|
-
}, de = 10,
|
|
762
|
-
const x = window.innerWidth -
|
|
761
|
+
}, de = 10, $e = 250, ze = 300, _e = (a) => {
|
|
762
|
+
const x = window.innerWidth - $e - de, m = window.innerHeight - ze - de, c = Math.min(a.left, x), n = Math.min(a.top, m);
|
|
763
763
|
return new DOMRect(
|
|
764
764
|
Math.max(c, de),
|
|
765
765
|
Math.max(n, de),
|
|
766
766
|
a.width,
|
|
767
767
|
a.height
|
|
768
768
|
);
|
|
769
|
-
}, He =
|
|
769
|
+
}, He = Me((a, x) => {
|
|
770
770
|
const {
|
|
771
|
-
document:
|
|
771
|
+
document: m,
|
|
772
772
|
fields: c = {},
|
|
773
773
|
menu: n = {},
|
|
774
774
|
list: i = {},
|
|
775
775
|
toolbar: F,
|
|
776
776
|
onReady: D,
|
|
777
|
-
onTrigger:
|
|
778
|
-
onFieldInsert:
|
|
777
|
+
onTrigger: U,
|
|
778
|
+
onFieldInsert: G,
|
|
779
779
|
onFieldUpdate: P,
|
|
780
780
|
onFieldDelete: N,
|
|
781
781
|
onFieldsChange: R,
|
|
782
|
-
onFieldSelect:
|
|
782
|
+
onFieldSelect: Y,
|
|
783
783
|
onFieldCreate: L,
|
|
784
|
-
className:
|
|
784
|
+
className: J,
|
|
785
785
|
style: O,
|
|
786
786
|
documentHeight: K = "600px"
|
|
787
|
-
} = a, [
|
|
787
|
+
} = a, [y, $] = z(
|
|
788
788
|
c.initial || []
|
|
789
|
-
), [A, l] = z(
|
|
789
|
+
), [A, l] = z(
|
|
790
|
+
null
|
|
791
|
+
), [g, v] = z(!1), [T, k] = z(), [W, fe] = z(""), [ee, ie] = z(() => c.available || []), te = Z(null), w = Z(null), M = Z(null), re = Z(c);
|
|
790
792
|
re.current = c;
|
|
791
|
-
const
|
|
793
|
+
const I = Z(null), ne = Z(g);
|
|
792
794
|
ue(() => {
|
|
793
795
|
ne.current = g;
|
|
794
796
|
}, [g]);
|
|
795
|
-
const
|
|
797
|
+
const q = n.trigger || "{{", e = re.current.available || [], s = C(
|
|
796
798
|
(t) => {
|
|
797
799
|
const r = t.trim().toLowerCase();
|
|
798
800
|
return r ? e.filter((b) => {
|
|
799
|
-
const
|
|
800
|
-
return
|
|
801
|
+
const E = b.label.toLowerCase(), S = b.category?.toLowerCase() || "";
|
|
802
|
+
return E.includes(r) || S.includes(r);
|
|
801
803
|
}) : e;
|
|
802
804
|
},
|
|
803
805
|
[e]
|
|
804
|
-
),
|
|
806
|
+
), u = C(
|
|
805
807
|
(t) => {
|
|
806
808
|
fe(t), ie(s(t));
|
|
807
809
|
},
|
|
808
810
|
[s]
|
|
809
811
|
), d = C(() => {
|
|
810
|
-
|
|
811
|
-
}, [
|
|
812
|
+
u("");
|
|
813
|
+
}, [u]), B = C(
|
|
812
814
|
(t, r) => {
|
|
813
815
|
if (!w.current?.activeEditor) return !1;
|
|
814
|
-
const b = w.current.activeEditor,
|
|
816
|
+
const b = w.current.activeEditor, E = y, S = t === "inline" ? b.commands.insertStructuredContentInline?.({
|
|
815
817
|
attrs: {
|
|
816
|
-
id: y,
|
|
817
818
|
alias: r.alias,
|
|
818
819
|
tag: r.metadata ? JSON.stringify(r.metadata) : r.category
|
|
819
820
|
},
|
|
820
821
|
text: r.defaultValue || r.alias
|
|
821
822
|
}) : b.commands.insertStructuredContentBlock?.({
|
|
822
823
|
attrs: {
|
|
823
|
-
id: y,
|
|
824
824
|
alias: r.alias,
|
|
825
825
|
tag: r.metadata ? JSON.stringify(r.metadata) : r.category
|
|
826
826
|
},
|
|
827
827
|
text: r.defaultValue || r.alias
|
|
828
828
|
});
|
|
829
829
|
if (S) {
|
|
830
|
-
const
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
const u = [...m, j];
|
|
837
|
-
return R?.(u), u;
|
|
838
|
-
}), U?.(j);
|
|
830
|
+
const _ = xe(b);
|
|
831
|
+
$(_), R?.(_);
|
|
832
|
+
const f = _.find(
|
|
833
|
+
(p) => !E.some((H) => H.id === p.id)
|
|
834
|
+
);
|
|
835
|
+
f && G?.(f);
|
|
839
836
|
}
|
|
840
837
|
return S;
|
|
841
838
|
},
|
|
842
|
-
[
|
|
839
|
+
[G, R, y]
|
|
843
840
|
), oe = C(
|
|
844
841
|
(t, r) => {
|
|
845
842
|
if (!w.current?.activeEditor) return !1;
|
|
846
|
-
const
|
|
843
|
+
const E = w.current.activeEditor.commands.updateStructuredContentById?.(t, {
|
|
847
844
|
attrs: r
|
|
848
845
|
});
|
|
849
|
-
return
|
|
850
|
-
const
|
|
851
|
-
(
|
|
846
|
+
return E && $((S) => {
|
|
847
|
+
const _ = S.map(
|
|
848
|
+
(p) => p.id === t ? { ...p, ...r } : p
|
|
852
849
|
);
|
|
853
|
-
R?.(
|
|
854
|
-
const
|
|
855
|
-
return
|
|
856
|
-
}),
|
|
850
|
+
R?.(_);
|
|
851
|
+
const f = _.find((p) => p.id === t);
|
|
852
|
+
return f && P?.(f), _;
|
|
853
|
+
}), E;
|
|
857
854
|
},
|
|
858
855
|
[P, R]
|
|
859
856
|
), h = C(
|
|
@@ -863,135 +860,135 @@ const Be = ({
|
|
|
863
860
|
console.warn(
|
|
864
861
|
"[SuperDocTemplateBuilder] deleteField called without active editor"
|
|
865
862
|
);
|
|
866
|
-
let
|
|
867
|
-
return
|
|
868
|
-
if (!
|
|
869
|
-
const
|
|
870
|
-
return
|
|
871
|
-
}),
|
|
863
|
+
let f = !1;
|
|
864
|
+
return $((p) => {
|
|
865
|
+
if (!p.some((V) => V.id === t)) return p;
|
|
866
|
+
const H = p.filter((V) => V.id !== t);
|
|
867
|
+
return f = !0, R?.(H), H;
|
|
868
|
+
}), f && (N?.(t), l((p) => p === t ? null : p)), f;
|
|
872
869
|
}
|
|
873
870
|
let b = !1;
|
|
874
871
|
try {
|
|
875
872
|
b = r.commands.deleteStructuredContentById?.(t) ?? !1;
|
|
876
|
-
} catch (
|
|
873
|
+
} catch (f) {
|
|
877
874
|
console.error(
|
|
878
875
|
"[SuperDocTemplateBuilder] Delete command failed:",
|
|
879
|
-
|
|
876
|
+
f
|
|
880
877
|
);
|
|
881
878
|
}
|
|
882
|
-
let
|
|
883
|
-
const S =
|
|
884
|
-
!b && S && (
|
|
885
|
-
let
|
|
886
|
-
return
|
|
887
|
-
if (we(
|
|
888
|
-
return
|
|
889
|
-
const
|
|
890
|
-
return
|
|
891
|
-
}),
|
|
879
|
+
let E = xe(r);
|
|
880
|
+
const S = E.some((f) => f.id === t);
|
|
881
|
+
!b && S && (E = E.filter((f) => f.id !== t));
|
|
882
|
+
let _ = !1;
|
|
883
|
+
return $((f) => {
|
|
884
|
+
if (we(f, E))
|
|
885
|
+
return f;
|
|
886
|
+
const p = f.some((V) => V.id === t), H = E.some((V) => V.id === t);
|
|
887
|
+
return p && !H && (_ = !0), R?.(E), E;
|
|
888
|
+
}), _ && (N?.(t), l((f) => f === t ? null : f)), b || _;
|
|
892
889
|
},
|
|
893
890
|
[N, R]
|
|
894
|
-
),
|
|
891
|
+
), j = C(
|
|
895
892
|
(t) => {
|
|
896
893
|
if (!w.current?.activeEditor) return;
|
|
897
894
|
w.current.activeEditor.commands.selectStructuredContentById?.(t), l(t);
|
|
898
|
-
const b =
|
|
899
|
-
b &&
|
|
895
|
+
const b = y.find((E) => E.id === t);
|
|
896
|
+
b && Y?.(b);
|
|
900
897
|
},
|
|
901
|
-
[
|
|
902
|
-
),
|
|
898
|
+
[y, Y]
|
|
899
|
+
), X = C(
|
|
903
900
|
(t) => {
|
|
904
901
|
if (!t) return;
|
|
905
|
-
const r =
|
|
906
|
-
|
|
902
|
+
const r = xe(t);
|
|
903
|
+
$((b) => we(b, r) ? b : (R?.(r), r));
|
|
907
904
|
},
|
|
908
905
|
[R]
|
|
909
906
|
);
|
|
910
907
|
ue(() => te.current ? ((async () => {
|
|
911
908
|
const { SuperDoc: r } = await import("superdoc"), b = {
|
|
912
909
|
selector: te.current,
|
|
913
|
-
document:
|
|
914
|
-
documentMode:
|
|
910
|
+
document: m?.source,
|
|
911
|
+
documentMode: m?.mode || "editing",
|
|
915
912
|
onReady: () => {
|
|
916
|
-
if (
|
|
917
|
-
const S =
|
|
918
|
-
S.on("update", ({ editor:
|
|
919
|
-
const { state:
|
|
920
|
-
if (
|
|
921
|
-
const me =
|
|
922
|
-
if (
|
|
923
|
-
const
|
|
924
|
-
new DOMRect(
|
|
925
|
-
),
|
|
913
|
+
if (E.activeEditor) {
|
|
914
|
+
const S = E.activeEditor;
|
|
915
|
+
S.on("update", ({ editor: _ }) => {
|
|
916
|
+
const { state: f } = _, { from: p } = f.selection;
|
|
917
|
+
if (p >= q.length) {
|
|
918
|
+
const me = p - q.length;
|
|
919
|
+
if (f.doc.textBetween(me, p) === q) {
|
|
920
|
+
const he = _.view.coordsAtPos(p), be = _e(
|
|
921
|
+
new DOMRect(he.left, he.top, 0, 0)
|
|
922
|
+
), ye = () => {
|
|
926
923
|
const le = w.current?.activeEditor;
|
|
927
924
|
if (!le) return;
|
|
928
925
|
const Oe = le.state.selection.from, Pe = le.state.tr.delete(me, Oe);
|
|
929
926
|
le.view.dispatch(Pe);
|
|
930
927
|
};
|
|
931
|
-
|
|
932
|
-
position: { from: me, to:
|
|
933
|
-
bounds:
|
|
934
|
-
cleanup:
|
|
928
|
+
M.current = ye, I.current = p, k(be), v(!0), d(), U?.({
|
|
929
|
+
position: { from: me, to: p },
|
|
930
|
+
bounds: be,
|
|
931
|
+
cleanup: ye
|
|
935
932
|
});
|
|
936
933
|
return;
|
|
937
934
|
}
|
|
938
935
|
}
|
|
939
936
|
if (!ne.current)
|
|
940
937
|
return;
|
|
941
|
-
if (
|
|
942
|
-
|
|
938
|
+
if (I.current == null) {
|
|
939
|
+
v(!1), d();
|
|
943
940
|
return;
|
|
944
941
|
}
|
|
945
|
-
if (
|
|
946
|
-
|
|
942
|
+
if (p < I.current) {
|
|
943
|
+
v(!1), I.current = null, d();
|
|
947
944
|
return;
|
|
948
945
|
}
|
|
949
|
-
const
|
|
950
|
-
|
|
951
|
-
|
|
946
|
+
const H = f.doc.textBetween(
|
|
947
|
+
I.current,
|
|
948
|
+
p
|
|
952
949
|
);
|
|
953
|
-
|
|
954
|
-
const
|
|
955
|
-
new DOMRect(
|
|
950
|
+
u(H);
|
|
951
|
+
const V = _.view.coordsAtPos(p), Ne = _e(
|
|
952
|
+
new DOMRect(V.left, V.top, 0, 0)
|
|
956
953
|
);
|
|
957
954
|
k(Ne);
|
|
958
955
|
}), S.on("update", () => {
|
|
959
|
-
|
|
960
|
-
}),
|
|
956
|
+
X(S);
|
|
957
|
+
}), X(S);
|
|
961
958
|
}
|
|
962
959
|
D?.();
|
|
963
960
|
}
|
|
964
|
-
},
|
|
961
|
+
}, E = new r({
|
|
965
962
|
...b,
|
|
966
|
-
...
|
|
967
|
-
toolbar:
|
|
963
|
+
...Q && {
|
|
964
|
+
toolbar: Q.selector,
|
|
968
965
|
modules: {
|
|
969
966
|
toolbar: {
|
|
970
|
-
selector:
|
|
971
|
-
toolbarGroups:
|
|
972
|
-
excludeItems:
|
|
973
|
-
...
|
|
967
|
+
selector: Q.selector,
|
|
968
|
+
toolbarGroups: Q.config.toolbarGroups || ["center"],
|
|
969
|
+
excludeItems: Q.config.excludeItems || [],
|
|
970
|
+
...Q.config
|
|
974
971
|
}
|
|
975
972
|
}
|
|
976
973
|
}
|
|
977
974
|
});
|
|
978
|
-
w.current =
|
|
975
|
+
w.current = E;
|
|
979
976
|
})(), () => {
|
|
980
|
-
|
|
977
|
+
M.current = null, I.current = null;
|
|
981
978
|
const r = w.current;
|
|
982
979
|
r && typeof r.destroy == "function" && r.destroy(), w.current = null;
|
|
983
980
|
}) : void 0, [
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
J,
|
|
981
|
+
m?.source,
|
|
982
|
+
m?.mode,
|
|
987
983
|
q,
|
|
984
|
+
X,
|
|
988
985
|
D,
|
|
989
|
-
|
|
986
|
+
U,
|
|
990
987
|
F
|
|
991
988
|
]);
|
|
992
989
|
const pe = C(
|
|
993
990
|
async (t) => {
|
|
994
|
-
if (
|
|
991
|
+
if (M.current && (M.current(), M.current = null), I.current = null, d(), t.id.startsWith("custom_") && L)
|
|
995
992
|
try {
|
|
996
993
|
const r = await L(t);
|
|
997
994
|
if (r) {
|
|
@@ -1000,7 +997,7 @@ const Be = ({
|
|
|
1000
997
|
category: r.category,
|
|
1001
998
|
metadata: r.metadata,
|
|
1002
999
|
defaultValue: r.defaultValue
|
|
1003
|
-
}),
|
|
1000
|
+
}), v(!1);
|
|
1004
1001
|
return;
|
|
1005
1002
|
}
|
|
1006
1003
|
} catch (r) {
|
|
@@ -1011,26 +1008,26 @@ const Be = ({
|
|
|
1011
1008
|
category: t.category,
|
|
1012
1009
|
metadata: t.metadata,
|
|
1013
1010
|
defaultValue: t.defaultValue
|
|
1014
|
-
}),
|
|
1011
|
+
}), v(!1);
|
|
1015
1012
|
},
|
|
1016
1013
|
[B, L, d]
|
|
1017
1014
|
), je = C(() => {
|
|
1018
|
-
|
|
1015
|
+
v(!1), I.current = null, d(), M.current && (M.current(), M.current = null);
|
|
1019
1016
|
}, [d]), Ce = C(() => {
|
|
1020
|
-
if (!w.current?.activeEditor ||
|
|
1017
|
+
if (!w.current?.activeEditor || y.length === 0)
|
|
1021
1018
|
return;
|
|
1022
|
-
const t =
|
|
1019
|
+
const t = y.findIndex(
|
|
1023
1020
|
(b) => b.id === A
|
|
1024
|
-
), r = t >= 0 ? (t + 1) %
|
|
1025
|
-
|
|
1026
|
-
}, [
|
|
1027
|
-
if (!w.current?.activeEditor ||
|
|
1021
|
+
), r = t >= 0 ? (t + 1) % y.length : 0;
|
|
1022
|
+
j(y[r].id);
|
|
1023
|
+
}, [y, A, j]), ke = C(() => {
|
|
1024
|
+
if (!w.current?.activeEditor || y.length === 0)
|
|
1028
1025
|
return;
|
|
1029
|
-
const t =
|
|
1026
|
+
const t = y.findIndex(
|
|
1030
1027
|
(b) => b.id === A
|
|
1031
|
-
), r = t > 0 ? t - 1 :
|
|
1032
|
-
|
|
1033
|
-
}, [
|
|
1028
|
+
), r = t > 0 ? t - 1 : y.length - 1;
|
|
1029
|
+
j(y[r].id);
|
|
1030
|
+
}, [y, A, j]), Se = C(
|
|
1034
1031
|
async (t) => {
|
|
1035
1032
|
try {
|
|
1036
1033
|
await w.current?.export({
|
|
@@ -1043,36 +1040,36 @@ const Be = ({
|
|
|
1043
1040
|
},
|
|
1044
1041
|
[]
|
|
1045
1042
|
);
|
|
1046
|
-
|
|
1043
|
+
Ie(x, () => ({
|
|
1047
1044
|
insertField: (t) => B("inline", t),
|
|
1048
1045
|
insertBlockField: (t) => B("block", t),
|
|
1049
1046
|
updateField: oe,
|
|
1050
1047
|
deleteField: h,
|
|
1051
|
-
selectField:
|
|
1048
|
+
selectField: j,
|
|
1052
1049
|
nextField: Ce,
|
|
1053
1050
|
previousField: ke,
|
|
1054
|
-
getFields: () =>
|
|
1051
|
+
getFields: () => y,
|
|
1055
1052
|
exportTemplate: Se
|
|
1056
1053
|
}));
|
|
1057
|
-
const Fe = n.component || Be,
|
|
1054
|
+
const Fe = n.component || Be, ge = i.component || Ve, Q = Ye(F);
|
|
1058
1055
|
return /* @__PURE__ */ o.jsxs(
|
|
1059
1056
|
"div",
|
|
1060
1057
|
{
|
|
1061
|
-
className: `superdoc-template-builder ${
|
|
1058
|
+
className: `superdoc-template-builder ${J || ""}`,
|
|
1062
1059
|
style: O,
|
|
1063
1060
|
children: [
|
|
1064
1061
|
/* @__PURE__ */ o.jsxs("div", { style: { display: "flex", gap: "20px" }, children: [
|
|
1065
1062
|
i.position === "left" && /* @__PURE__ */ o.jsx("div", { className: "superdoc-template-builder-sidebar", children: /* @__PURE__ */ o.jsx(
|
|
1066
|
-
|
|
1063
|
+
ge,
|
|
1067
1064
|
{
|
|
1068
|
-
fields:
|
|
1069
|
-
onSelect: (t) =>
|
|
1065
|
+
fields: y,
|
|
1066
|
+
onSelect: (t) => j(t.id),
|
|
1070
1067
|
onDelete: h,
|
|
1071
1068
|
selectedFieldId: A || void 0
|
|
1072
1069
|
}
|
|
1073
1070
|
) }),
|
|
1074
1071
|
/* @__PURE__ */ o.jsxs("div", { className: "superdoc-template-builder-document", style: { flex: 1 }, children: [
|
|
1075
|
-
|
|
1072
|
+
Q?.renderDefaultContainer && /* @__PURE__ */ o.jsx(
|
|
1076
1073
|
"div",
|
|
1077
1074
|
{
|
|
1078
1075
|
id: "superdoc-toolbar",
|
|
@@ -1091,10 +1088,10 @@ const Be = ({
|
|
|
1091
1088
|
)
|
|
1092
1089
|
] }),
|
|
1093
1090
|
i.position === "right" && /* @__PURE__ */ o.jsx("div", { className: "superdoc-template-builder-sidebar", children: /* @__PURE__ */ o.jsx(
|
|
1094
|
-
|
|
1091
|
+
ge,
|
|
1095
1092
|
{
|
|
1096
|
-
fields:
|
|
1097
|
-
onSelect: (t) =>
|
|
1093
|
+
fields: y,
|
|
1094
|
+
onSelect: (t) => j(t.id),
|
|
1098
1095
|
onDelete: h,
|
|
1099
1096
|
selectedFieldId: A || void 0
|
|
1100
1097
|
}
|
|
@@ -1120,7 +1117,7 @@ const Be = ({
|
|
|
1120
1117
|
});
|
|
1121
1118
|
He.displayName = "SuperDocTemplateBuilder";
|
|
1122
1119
|
export {
|
|
1123
|
-
|
|
1120
|
+
Ve as FieldList,
|
|
1124
1121
|
Be as FieldMenu,
|
|
1125
1122
|
He as default
|
|
1126
1123
|
};
|
package/dist/types.d.ts
CHANGED
|
@@ -6,7 +6,7 @@ export interface FieldDefinition {
|
|
|
6
6
|
metadata?: Record<string, any>;
|
|
7
7
|
}
|
|
8
8
|
export interface TemplateField {
|
|
9
|
-
id: string;
|
|
9
|
+
id: string | number;
|
|
10
10
|
alias: string;
|
|
11
11
|
tag?: string;
|
|
12
12
|
position?: number;
|
|
@@ -33,8 +33,8 @@ export interface FieldMenuProps {
|
|
|
33
33
|
export interface FieldListProps {
|
|
34
34
|
fields: TemplateField[];
|
|
35
35
|
onSelect: (field: TemplateField) => void;
|
|
36
|
-
onDelete: (fieldId: string) => void;
|
|
37
|
-
selectedFieldId?: string;
|
|
36
|
+
onDelete: (fieldId: string | number) => void;
|
|
37
|
+
selectedFieldId?: string | number;
|
|
38
38
|
}
|
|
39
39
|
export interface DocumentConfig {
|
|
40
40
|
source?: string | File | Blob;
|
|
@@ -74,7 +74,7 @@ export interface SuperDocTemplateBuilderProps {
|
|
|
74
74
|
onTrigger?: (event: TriggerEvent) => void;
|
|
75
75
|
onFieldInsert?: (field: TemplateField) => void;
|
|
76
76
|
onFieldUpdate?: (field: TemplateField) => void;
|
|
77
|
-
onFieldDelete?: (fieldId: string) => void;
|
|
77
|
+
onFieldDelete?: (fieldId: string | number) => void;
|
|
78
78
|
onFieldsChange?: (fields: TemplateField[]) => void;
|
|
79
79
|
onFieldSelect?: (field: TemplateField | null) => void;
|
|
80
80
|
onFieldCreate?: (field: FieldDefinition) => void | Promise<FieldDefinition | void>;
|
|
@@ -89,9 +89,9 @@ export interface SuperDocTemplateBuilderHandle {
|
|
|
89
89
|
insertBlockField: (field: Partial<FieldDefinition> & {
|
|
90
90
|
alias: string;
|
|
91
91
|
}) => boolean;
|
|
92
|
-
updateField: (id: string, updates: Partial<TemplateField>) => boolean;
|
|
93
|
-
deleteField: (id: string) => boolean;
|
|
94
|
-
selectField: (id: string) => void;
|
|
92
|
+
updateField: (id: string | number, updates: Partial<TemplateField>) => boolean;
|
|
93
|
+
deleteField: (id: string | number) => boolean;
|
|
94
|
+
selectField: (id: string | number) => void;
|
|
95
95
|
nextField: () => void;
|
|
96
96
|
previousField: () => void;
|
|
97
97
|
getFields: () => TemplateField[];
|
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,eAAe;IAC9B,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;CAChC;AAED,MAAM,WAAW,aAAa;IAC5B,EAAE,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"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"}
|