@eigenpal/docx-js-editor 0.0.32 → 0.0.33

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.
Files changed (73) hide show
  1. package/README.md +10 -2
  2. package/dist/FindReplaceDialog-KNJETYJX.js +1 -0
  3. package/dist/{FindReplaceDialog-N4J5OB7O.mjs → FindReplaceDialog-YW3R4FHM.mjs} +1 -1
  4. package/dist/FootnotePropertiesDialog-7QX54WQT.js +1 -0
  5. package/dist/FootnotePropertiesDialog-LNFJXQUG.mjs +1 -0
  6. package/dist/HyperlinkDialog-GBAYMTUE.js +1 -0
  7. package/dist/{HyperlinkDialog-YQSQFHOP.mjs → HyperlinkDialog-HNYTXDCB.mjs} +1 -1
  8. package/dist/ImagePositionDialog-B4RLP2W5.mjs +1 -0
  9. package/dist/ImagePositionDialog-M65BYQQE.js +1 -0
  10. package/dist/ImagePropertiesDialog-JOGW3WDU.mjs +1 -0
  11. package/dist/ImagePropertiesDialog-O4WQSF5M.js +1 -0
  12. package/dist/PageSetupDialog-2GIBTKMJ.js +1 -0
  13. package/dist/PageSetupDialog-Q7SHEZIJ.mjs +1 -0
  14. package/dist/TablePropertiesDialog-LMXWX3FI.mjs +1 -0
  15. package/dist/TablePropertiesDialog-WOZ4ES3H.js +1 -0
  16. package/dist/chunk-377ZVTSE.js +2 -0
  17. package/dist/chunk-3OKYQQQ5.js +111 -0
  18. package/dist/chunk-AU5NVRHP.js +2 -0
  19. package/dist/chunk-DC65PJYE.js +4 -0
  20. package/dist/chunk-FW5LYOOZ.mjs +111 -0
  21. package/dist/chunk-GZOCOWWB.mjs +2 -0
  22. package/dist/chunk-N6RUBUT2.js +261 -0
  23. package/dist/chunk-QSUPYUOP.js +2 -0
  24. package/dist/chunk-SZHPMPSO.mjs +261 -0
  25. package/dist/chunk-X5A54T6S.mjs +4 -0
  26. package/dist/chunk-YKBSKEBS.mjs +2 -0
  27. package/dist/chunk-Z26WOH6R.mjs +2 -0
  28. package/dist/clipboard-Cu80iVDh.d.ts +1181 -0
  29. package/dist/clipboard-dFROLI95.d.mts +1181 -0
  30. package/dist/index.css +1 -1
  31. package/dist/index.d.mts +15 -5
  32. package/dist/index.d.ts +15 -5
  33. package/dist/index.js +9 -9
  34. package/dist/index.mjs +9 -9
  35. package/dist/{react-CAc4htNH.d.ts → react-1nBq3zH9.d.ts} +3 -1
  36. package/dist/{react-B2h6vE3D.d.mts → react-Dr8Nm-0u.d.mts} +3 -1
  37. package/dist/react.css +1 -1
  38. package/dist/react.d.mts +2 -2
  39. package/dist/react.d.ts +2 -2
  40. package/dist/react.js +1 -1
  41. package/dist/react.mjs +1 -1
  42. package/dist/ui.d.mts +22 -20
  43. package/dist/ui.d.ts +22 -20
  44. package/dist/ui.js +1 -1
  45. package/dist/ui.mjs +1 -1
  46. package/i18n/de.json +745 -0
  47. package/i18n/en.json +745 -0
  48. package/i18n/pl.json +745 -0
  49. package/package.json +5 -3
  50. package/dist/FindReplaceDialog-AQFR4OCT.js +0 -1
  51. package/dist/FootnotePropertiesDialog-UFUIHLDW.mjs +0 -1
  52. package/dist/FootnotePropertiesDialog-YYIZU5U6.js +0 -1
  53. package/dist/HyperlinkDialog-HGZ2S37Z.js +0 -1
  54. package/dist/ImagePositionDialog-DQ4JWS4F.js +0 -1
  55. package/dist/ImagePositionDialog-HT6J2SHV.mjs +0 -1
  56. package/dist/ImagePropertiesDialog-3VK2S2AF.mjs +0 -1
  57. package/dist/ImagePropertiesDialog-GJMGLM6G.js +0 -1
  58. package/dist/PageSetupDialog-2SKHDRTF.js +0 -1
  59. package/dist/PageSetupDialog-SMQJXEBL.mjs +0 -1
  60. package/dist/TablePropertiesDialog-FI5E3RCB.mjs +0 -1
  61. package/dist/TablePropertiesDialog-STZOGHJB.js +0 -1
  62. package/dist/chunk-6AJI5NPH.mjs +0 -111
  63. package/dist/chunk-AZRYS2WF.mjs +0 -2
  64. package/dist/chunk-CTYOM6BE.js +0 -2
  65. package/dist/chunk-EEV6TUOX.mjs +0 -261
  66. package/dist/chunk-EF3LLEN7.js +0 -4
  67. package/dist/chunk-HWWZOJMR.mjs +0 -4
  68. package/dist/chunk-PJVI53AH.js +0 -2
  69. package/dist/chunk-UMDJQ3Q4.js +0 -111
  70. package/dist/chunk-WH2EK2HU.js +0 -261
  71. package/dist/chunk-XWBCP563.mjs +0 -2
  72. package/dist/clipboard-B7N7Kx2X.d.ts +0 -386
  73. package/dist/clipboard-BkM7Zvgs.d.mts +0 -386
@@ -1,2 +0,0 @@
1
- 'use strict';var react=require('react'),jsxRuntime=require('react/jsx-runtime');function _(){return {matchCase:false,matchWholeWord:false,useRegex:false}}function H(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function X(e,n){if(!e)return null;try{let t;n.useRegex?t=e:t=H(e),n.matchWholeWord&&(t=`\\b${t}\\b`);let c=n.matchCase?"g":"gi";return new RegExp(t,c)}catch{return null}}function D(e,n,t){if(!e||!n)return [];let c=[],i=n;t.matchCase||(i=n.toLowerCase());let f=v=>v.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),d;t.matchWholeWord?d=`\\b${f(i)}\\b`:d=f(i);let s=t.matchCase?"g":"gi",p=new RegExp(d,s),h;for(;(h=p.exec(e))!==null;)c.push({start:h.index,end:h.index+h[0].length}),h[0].length===0&&p.lastIndex++;return c}function me(e,n,t,c){let i=X(n,c);return i?e.replace(i,t):e}function be(e,n,t,c,i=0){let f=D(e,n,c),d=f.find(p=>p.start>=i)||f[0];return d?{content:e.substring(0,d.start)+t+e.substring(d.end),replaced:true,matchStart:d.start,matchEnd:d.start+t.length}:{content:e,replaced:false,matchStart:-1,matchEnd:-1}}function Se(e){return e?e.totalCount===0?"No results":e.totalCount===1?"1 match":`${e.currentIndex+1} of ${e.totalCount} matches`:""}function ye(e){return !e||e.trim()===""}function Ce(){return {currentMatchColor:"#FFFF00",otherMatchColor:"#FFFFAA"}}function k(e){if(!e||!e.content)return "";let n="";for(let t of e.content)t.type==="text"?n+=t.text||"":t.type==="tab"?n+=" ":t.type==="break"&&t.breakType==="textWrapping"&&(n+=`
2
- `);return n}function Fe(e){if(!e||!e.content)return "";let n="";for(let t of e.content)if(t.type==="run")n+=k(t);else if(t.type==="hyperlink")for(let c of t.children||[])c.type==="run"&&(n+=k(c));return n}function Re(e,n,t){if(!e||!n)return [];let c=[],i=e.package?.document||e.package?.document;if(!i||!i.content)return c;let f=0;for(let d of i.content)if(d.type==="paragraph"){let s=q(d,n,t,f);c.push(...s),f++;}else if(d.type==="table")for(let s of d.rows||[])for(let p of s.cells||[])for(let h of p.content||[])h.type;return c}function q(e,n,t,c){let i=[],f=Fe(e);if(!f)return i;let d=D(f,n,t);for(let s of d){let p=Te(e,s.start);i.push({paragraphIndex:c,contentIndex:p.contentIndex,startOffset:p.offsetInContent,endOffset:p.offsetInContent+(s.end-s.start),text:f.substring(s.start,s.end)});}return i}function Te(e,n){if(!e||!e.content)return {contentIndex:0,runIndex:0,offsetInContent:n};let t=0,c=0;for(let i of e.content){let f="";if(i.type==="run")f=k(i);else if(i.type==="hyperlink")for(let s of i.children||[])s.type==="run"&&(f+=k(s));let d=f.length;if(t+d>n)return {contentIndex:c,runIndex:c,offsetInContent:n-t};t+=d,c++;}return {contentIndex:Math.max(0,e.content.length-1),runIndex:Math.max(0,e.content.length-1),offsetInContent:0}}function Ie(e,n){if(!e||!n)return;let t=e.querySelector(`[data-paragraph-index="${n.paragraphIndex}"]`);t&&t.scrollIntoView({behavior:"smooth",block:"center"});}function Ee(e){let[n,t]=react.useState({isOpen:false,searchText:"",replaceText:"",options:_(),matches:[],currentIndex:0,replaceMode:e?.initialReplaceMode??false}),c=react.useCallback(o=>{t(r=>({...r,isOpen:true,replaceMode:false,searchText:o||r.searchText,matches:[],currentIndex:0}));},[]),i=react.useCallback(o=>{t(r=>({...r,isOpen:true,replaceMode:true,searchText:o||r.searchText,matches:[],currentIndex:0}));},[]),f=react.useCallback(()=>{t(o=>({...o,isOpen:false}));},[]),d=react.useCallback(()=>{t(o=>({...o,isOpen:!o.isOpen}));},[]),s=react.useCallback(o=>{t(r=>({...r,searchText:o}));},[]),p=react.useCallback(o=>{t(r=>({...r,replaceText:o}));},[]),h=react.useCallback(o=>{t(r=>({...r,options:{...r.options,...o}}));},[]),v=react.useCallback((o,r=0)=>{let E=Math.max(0,Math.min(r,o.length-1));t(L=>({...L,matches:o,currentIndex:o.length>0?E:0})),e?.onMatchesChange?.(o),o.length>0?e?.onCurrentMatchChange?.(o[E],E):e?.onCurrentMatchChange?.(null,-1);},[e]),M=react.useCallback(()=>{let o=0;return t(r=>r.matches.length===0?r:(o=(r.currentIndex+1)%r.matches.length,{...r,currentIndex:o})),o},[]),N=react.useCallback(()=>{let o=0;return t(r=>r.matches.length===0?r:(o=r.currentIndex===0?r.matches.length-1:r.currentIndex-1,{...r,currentIndex:o})),o},[]),w=react.useCallback(o=>{t(r=>r.matches.length===0||o<0||o>=r.matches.length?r:{...r,currentIndex:o});},[]),x=react.useCallback(()=>n.matches.length===0?null:n.matches[n.currentIndex]||null,[n.matches,n.currentIndex]),O=react.useCallback(()=>n.matches.length>0,[n.matches.length]);return {state:n,openFind:c,openReplace:i,close:f,toggle:d,setSearchText:s,setReplaceText:p,setOptions:h,setMatches:v,goToNextMatch:M,goToPreviousMatch:N,goToMatch:w,getCurrentMatch:x,hasMatches:O}}var Me={position:"fixed",top:0,left:0,right:0,bottom:0,backgroundColor:"transparent",display:"flex",alignItems:"flex-start",justifyContent:"flex-end",zIndex:1e4,pointerEvents:"none"},Oe={backgroundColor:"white",borderRadius:"4px",boxShadow:"0 4px 20px rgba(0, 0, 0, 0.2)",minWidth:"360px",maxWidth:"440px",width:"100%",margin:"60px 20px 20px 20px",pointerEvents:"auto"},Le={display:"flex",justifyContent:"space-between",alignItems:"center",padding:"12px 16px",borderBottom:"1px solid var(--doc-border)",backgroundColor:"var(--doc-bg-subtle)",borderTopLeftRadius:"4px",borderTopRightRadius:"4px"},ke={margin:0,fontSize:"14px",fontWeight:600,color:"var(--doc-text)"},Ne={background:"none",border:"none",fontSize:"18px",cursor:"pointer",color:"var(--doc-text-muted)",padding:"2px 6px",lineHeight:1},we={padding:"16px"},Q={display:"flex",alignItems:"center",gap:"8px",marginBottom:"12px"},Z={width:"60px",fontSize:"13px",color:"var(--doc-text)",flexShrink:0},Y={flex:1,padding:"8px 10px",border:"1px solid var(--doc-border-input)",borderRadius:"3px",fontSize:"13px",boxSizing:"border-box",outline:"none"},ee={...Y,borderColor:"var(--doc-link)",boxShadow:"0 0 0 2px rgba(5, 99, 193, 0.1)"},Pe={display:"flex",flexDirection:"column",gap:"6px",marginLeft:"8px"},B={padding:"6px 12px",borderRadius:"3px",fontSize:"12px",fontWeight:500,cursor:"pointer",border:"1px solid var(--doc-border-input)",backgroundColor:"var(--doc-bg-input)",color:"var(--doc-text)",minWidth:"80px",textAlign:"center"},te={...B,backgroundColor:"var(--doc-bg-hover)",color:"var(--doc-text-placeholder)",cursor:"not-allowed"},U={padding:"6px 10px",borderRadius:"3px",fontSize:"14px",cursor:"pointer",border:"1px solid var(--doc-border-input)",backgroundColor:"var(--doc-bg-input)",color:"var(--doc-text)"},ne={...U,color:"var(--doc-border-input)",cursor:"not-allowed"},_e={display:"flex",gap:"16px",marginTop:"4px",marginLeft:"68px"},W={display:"flex",alignItems:"center",gap:"6px",fontSize:"12px",color:"var(--doc-text-muted)",cursor:"pointer"},oe={width:"14px",height:"14px",cursor:"pointer"},re={marginLeft:"68px",fontSize:"12px",color:"var(--doc-text-muted)",marginBottom:"8px"},De={...re,color:"var(--doc-error)"},Ae=({style:e})=>jsxRuntime.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",style:e,children:jsxRuntime.jsx("polyline",{points:"18 15 12 9 6 15"})}),We=({style:e})=>jsxRuntime.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",style:e,children:jsxRuntime.jsx("polyline",{points:"6 9 12 15 18 9"})});function Ye({isOpen:e,onClose:n,onFind:t,onFindNext:c,onFindPrevious:i,onReplace:f,onReplaceAll:d,onHighlightMatches:s,onClearHighlights:p,initialSearchText:h="",replaceMode:v=false,currentResult:M,className:N,style:w}){let[x,O]=react.useState(""),[o,r]=react.useState(""),[E,L]=react.useState(v),[C,ae]=react.useState(false),[F,ce]=react.useState(false),[l,R]=react.useState(null),[ie,K]=react.useState(false),[se,z]=react.useState(false),P=react.useRef(null),$=react.useRef(null);react.useEffect(()=>{M!==void 0&&R(M);},[M]),react.useEffect(()=>{if(e){if(O(h),r(""),L(v),R(null),setTimeout(()=>{P.current?.focus(),P.current?.select();},100),h){let a=t(h,{matchCase:C,matchWholeWord:F});R(a),a?.matches&&s&&s(a.matches);}}else p&&p();},[e,h,v]);let S=react.useCallback(()=>{if(!x.trim()){R(null),p&&p();return}let a=t(x,{matchCase:C,matchWholeWord:F});R(a),a?.matches&&s?s(a.matches):p&&p();},[x,C,F,t,s,p]);react.useEffect(()=>{e&&x.trim()&&S();},[C,F]);let le=react.useCallback(a=>{O(a.target.value);},[]),de=react.useCallback(a=>{a.key==="Enter"?(a.preventDefault(),a.shiftKey?V():l?G():S()):a.key==="Escape"&&n();},[l,S,n]),pe=react.useCallback(a=>{a.key==="Enter"?(a.preventDefault(),j()):a.key==="Escape"&&n();},[n]),G=react.useCallback(()=>{if(!x.trim()){S();return}if(!l){S();return}if(c()&&l){let y=(l.currentIndex+1)%l.totalCount;R({...l,currentIndex:y});}},[x,l,S,c]),V=react.useCallback(()=>{if(!x.trim()){S();return}if(!l){S();return}if(i()&&l){let y=l.currentIndex===0?l.totalCount-1:l.currentIndex-1;R({...l,currentIndex:y});}},[x,l,S,i]),j=react.useCallback(()=>{if(!l||l.totalCount===0)return;if(f(o)){let y=t(x,{matchCase:C,matchWholeWord:F});R(y),y?.matches&&s&&s(y.matches);}},[l,o,x,C,F,f,t,s]),ue=react.useCallback(()=>{if(!x.trim())return;d(x,o,{matchCase:C,matchWholeWord:F})>0&&(R({matches:[],totalCount:0,currentIndex:-1}),p&&p());},[x,o,C,F,d,p]),fe=react.useCallback(()=>{L(a=>{let y=!a;return y&&setTimeout(()=>$.current?.focus(),100),y});},[]),xe=react.useCallback(a=>{a.target,a.currentTarget;},[]),he=react.useCallback(a=>{a.key==="Escape"&&n();},[n]);if(!e)return null;let T=l&&l.totalCount>0,ge=l&&l.totalCount===0&&x.trim();return jsxRuntime.jsx("div",{className:`docx-find-replace-dialog-overlay ${N||""}`,style:{...Me,...w},onClick:xe,onKeyDown:he,children:jsxRuntime.jsxs("div",{className:"docx-find-replace-dialog","data-testid":"find-replace-dialog",style:Oe,role:"dialog","aria-modal":"false","aria-labelledby":"find-replace-dialog-title",children:[jsxRuntime.jsxs("div",{className:"docx-find-replace-dialog-header",style:Le,children:[jsxRuntime.jsx("h2",{id:"find-replace-dialog-title",style:ke,children:E?"Find and Replace":"Find"}),jsxRuntime.jsx("button",{type:"button",className:"docx-find-replace-dialog-close",style:Ne,onClick:n,"aria-label":"Close dialog",children:"\xD7"})]}),jsxRuntime.jsxs("div",{className:"docx-find-replace-dialog-body",style:we,children:[jsxRuntime.jsxs("div",{className:"docx-find-replace-dialog-row",style:Q,children:[jsxRuntime.jsx("label",{htmlFor:"find-text",style:Z,children:"Find:"}),jsxRuntime.jsx("input",{ref:P,id:"find-text",type:"text",className:"docx-find-replace-dialog-input",style:ie?ee:Y,value:x,onChange:le,onKeyDown:de,onFocus:()=>K(true),onBlur:()=>{K(false),x.trim()&&!l&&S();},placeholder:"Enter text to find...","aria-label":"Find text"}),jsxRuntime.jsxs("div",{style:{display:"flex",gap:"4px"},children:[jsxRuntime.jsx("button",{type:"button",className:"docx-find-replace-dialog-nav",style:T?U:ne,onClick:V,disabled:!T,"aria-label":"Find previous",title:"Find Previous (Shift+Enter)",children:jsxRuntime.jsx(Ae,{})}),jsxRuntime.jsx("button",{type:"button",className:"docx-find-replace-dialog-nav",style:T?U:ne,onClick:G,disabled:!T,"aria-label":"Find next",title:"Find Next (Enter)",children:jsxRuntime.jsx(We,{})})]})]}),T&&jsxRuntime.jsxs("div",{className:"docx-find-replace-dialog-status",style:re,children:[l.currentIndex+1," of ",l.totalCount," matches"]}),ge&&jsxRuntime.jsx("div",{className:"docx-find-replace-dialog-status",style:De,children:"No results found"}),E&&jsxRuntime.jsx(jsxRuntime.Fragment,{children:jsxRuntime.jsxs("div",{className:"docx-find-replace-dialog-row",style:Q,children:[jsxRuntime.jsx("label",{htmlFor:"replace-text",style:Z,children:"Replace:"}),jsxRuntime.jsx("input",{ref:$,id:"replace-text",type:"text",className:"docx-find-replace-dialog-input",style:se?ee:Y,value:o,onChange:a=>r(a.target.value),onKeyDown:pe,onFocus:()=>z(true),onBlur:()=>z(false),placeholder:"Enter replacement text...","aria-label":"Replace text"}),jsxRuntime.jsxs("div",{style:Pe,children:[jsxRuntime.jsx("button",{type:"button",className:"docx-find-replace-dialog-button",style:T?B:te,onClick:j,disabled:!T,title:"Replace current match",children:"Replace"}),jsxRuntime.jsx("button",{type:"button",className:"docx-find-replace-dialog-button",style:T?B:te,onClick:ue,disabled:!T,title:"Replace all matches",children:"Replace All"})]})]})}),jsxRuntime.jsxs("div",{className:"docx-find-replace-dialog-options",style:_e,children:[jsxRuntime.jsxs("label",{className:"docx-find-replace-dialog-option",style:W,children:[jsxRuntime.jsx("input",{type:"checkbox",style:oe,checked:C,onChange:a=>ae(a.target.checked)}),"Match case"]}),jsxRuntime.jsxs("label",{className:"docx-find-replace-dialog-option",style:W,children:[jsxRuntime.jsx("input",{type:"checkbox",style:oe,checked:F,onChange:a=>ce(a.target.checked)}),"Whole words"]}),!E&&jsxRuntime.jsx("button",{type:"button",style:{...W,background:"none",border:"none",cursor:"pointer",color:"var(--doc-link)",padding:0},onClick:fe,children:"+ Replace"})]})]})]})})}var je=Ye;exports.a=_;exports.b=H;exports.c=X;exports.d=D;exports.e=me;exports.f=be;exports.g=Se;exports.h=ye;exports.i=Ce;exports.j=Re;exports.k=q;exports.l=Ie;exports.m=Ee;exports.n=Ye;exports.o=je;