@eigenpal/docx-editor-react 1.4.0 → 1.6.0
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/{FindReplaceDialog-ETVJEMEM.js → FindReplaceDialog-HM63BMXE.js} +1 -1
- package/dist/{FindReplaceDialog-2ZH4XD5C.mjs → FindReplaceDialog-KU5TEIBJ.mjs} +1 -1
- package/dist/FootnotePropertiesDialog-TV2BGQDC.js +1 -0
- package/dist/FootnotePropertiesDialog-W3YHM4BV.mjs +1 -0
- package/dist/HyperlinkDialog-7MEQJIYP.js +1 -0
- package/dist/{HyperlinkDialog-PSJ6P3E3.mjs → HyperlinkDialog-ZYH7ZHRF.mjs} +1 -1
- package/dist/ImagePositionDialog-HEWYR6Q3.mjs +1 -0
- package/dist/ImagePositionDialog-LSCCQORZ.js +1 -0
- package/dist/ImagePropertiesDialog-RAB47C6M.mjs +1 -0
- package/dist/ImagePropertiesDialog-Z4M6XKFG.js +1 -0
- package/dist/PageSetupDialog-AIGIXO3E.mjs +1 -0
- package/dist/{PageSetupDialog-UKXK6X35.js → PageSetupDialog-LWYOYKEU.js} +1 -1
- package/dist/SplitCellDialog-45W7SDPY.js +1 -0
- package/dist/SplitCellDialog-IFBKYCD6.mjs +1 -0
- package/dist/TablePropertiesDialog-TMLKGOOW.mjs +1 -0
- package/dist/TablePropertiesDialog-VCDCPM3R.js +1 -0
- package/dist/WatermarkDialog-KRL7WMIS.mjs +1 -0
- package/dist/WatermarkDialog-XGLAH3TK.js +1 -0
- package/dist/chunk-4Y4JFAPY.mjs +2 -0
- package/dist/chunk-74OM4KEH.js +2 -0
- package/dist/chunk-BABMU5KA.mjs +2 -0
- package/dist/chunk-GDJM7SOG.js +2 -0
- package/dist/chunk-GWXEFL3H.js +1 -0
- package/dist/chunk-J72K2BOS.mjs +2 -0
- package/dist/{chunk-B5AYO5OG.js → chunk-LNONBJQM.js} +1 -1
- package/dist/{chunk-K5DD2LSK.mjs → chunk-O6M2HAIZ.mjs} +1 -1
- package/dist/chunk-OCA7BO3G.mjs +1 -0
- package/dist/chunk-OMYLJAPA.mjs +2 -0
- package/dist/chunk-P5ZOUQIK.mjs +1 -0
- package/dist/{chunk-JGPOALUP.js → chunk-PSBO3UDN.js} +1 -1
- package/dist/chunk-QD7BVJV3.js +2 -0
- package/dist/{chunk-2YRWZCRK.mjs → chunk-WFGAQC2B.mjs} +1 -1
- package/dist/chunk-WNWY6WX7.js +2 -0
- package/dist/chunk-YY52FSUR.js +1 -0
- package/dist/dialogs.js +1 -1
- package/dist/dialogs.mjs +1 -1
- package/dist/hooks.js +1 -1
- package/dist/hooks.mjs +1 -1
- package/dist/index.d.mts +75 -3
- package/dist/index.d.ts +75 -3
- package/dist/index.js +9 -9
- package/dist/index.mjs +9 -9
- package/dist/styles.css +1 -1
- package/dist/ui.d.mts +106 -32
- package/dist/ui.d.ts +106 -32
- package/dist/ui.js +7 -7
- package/dist/ui.mjs +7 -7
- package/package.json +4 -4
- package/dist/FootnotePropertiesDialog-INLVLE26.mjs +0 -1
- package/dist/FootnotePropertiesDialog-WCGK6MV3.js +0 -1
- package/dist/HyperlinkDialog-G5FFKLWY.js +0 -1
- package/dist/ImagePositionDialog-DTGYFFAR.js +0 -1
- package/dist/ImagePositionDialog-FKBG2MSL.mjs +0 -1
- package/dist/ImagePropertiesDialog-SO6RAOT6.js +0 -1
- package/dist/ImagePropertiesDialog-T77XMKJF.mjs +0 -1
- package/dist/PageSetupDialog-CCJAZEIN.mjs +0 -1
- package/dist/SplitCellDialog-NPGW4JGQ.mjs +0 -1
- package/dist/SplitCellDialog-RNP37SKZ.js +0 -1
- package/dist/TablePropertiesDialog-3QNCWNEG.mjs +0 -1
- package/dist/TablePropertiesDialog-AQVM7FGA.js +0 -1
- package/dist/WatermarkDialog-6QSGGPXJ.mjs +0 -1
- package/dist/WatermarkDialog-CYTWCE75.js +0 -1
- package/dist/chunk-3L2QMHNA.mjs +0 -2
- package/dist/chunk-4SYDL233.js +0 -1
- package/dist/chunk-53P6TCSE.js +0 -2
- package/dist/chunk-5BSDRI3Z.js +0 -1
- package/dist/chunk-72ZQJWN2.mjs +0 -2
- package/dist/chunk-AYHZMFCQ.mjs +0 -1
- package/dist/chunk-EKDRHOOJ.js +0 -2
- package/dist/chunk-ICVBXT6V.mjs +0 -2
- package/dist/chunk-IL65NW44.mjs +0 -2
- package/dist/chunk-P3ADI7OT.mjs +0 -1
- package/dist/chunk-PGHNUFNT.js +0 -2
- package/dist/chunk-UT6DJWGC.js +0 -2
package/dist/chunk-UT6DJWGC.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
'use strict';var chunkGNIO6SOS_js=require('./chunk-GNIO6SOS.js'),react=require('react'),jsxRuntime=require('react/jsx-runtime');var J={position:"fixed",top:0,left:0,right:0,bottom:0,backgroundColor:"rgba(0, 0, 0, 0.5)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:1e4},Q={backgroundColor:"white",borderRadius:"8px",boxShadow:"0 4px 20px rgba(0, 0, 0, 0.15)",minWidth:"400px",maxWidth:"500px",width:"100%",margin:"20px"},Z={display:"flex",justifyContent:"space-between",alignItems:"center",padding:"16px 20px",borderBottom:"1px solid var(--doc-border)"},ee={margin:0,fontSize:"18px",fontWeight:600,color:"var(--doc-text)"},te={background:"none",border:"none",fontSize:"20px",cursor:"pointer",color:"var(--doc-text-muted)",padding:"4px 8px",lineHeight:1},re={padding:"20px"},v={marginBottom:"16px"},E={display:"block",marginBottom:"6px",fontSize:"14px",fontWeight:500,color:"var(--doc-text)"},x={width:"100%",padding:"10px 12px",border:"1px solid var(--doc-border-input)",borderRadius:"4px",fontSize:"14px",boxSizing:"border-box",outline:"none"},oe={...x,borderColor:"var(--doc-error)"},ie={...x,cursor:"pointer"},le={color:"var(--doc-error)",fontSize:"12px",marginTop:"4px"},z={color:"var(--doc-text-muted)",fontSize:"12px",marginTop:"4px"},ne={display:"flex",borderBottom:"1px solid var(--doc-border)",marginBottom:"16px"},H={padding:"10px 16px",border:"none",background:"none",cursor:"pointer",fontSize:"14px",color:"var(--doc-text-muted)",borderBottom:"2px solid transparent",marginBottom:"-1px"},F={...H,color:"var(--doc-link)",borderBottomColor:"var(--doc-link)",fontWeight:500},ae={display:"flex",justifyContent:"flex-end",gap:"12px",padding:"16px 20px",borderTop:"1px solid var(--doc-border)"},C={padding:"10px 20px",borderRadius:"4px",fontSize:"14px",fontWeight:500,cursor:"pointer",border:"none"},se={...C,backgroundColor:"var(--doc-link)",color:"white"},pe={...C,backgroundColor:"var(--doc-bg-hover)",color:"var(--doc-text)",border:"1px solid var(--doc-border-input)"},de={...C,backgroundColor:"var(--doc-error)",color:"white"},ce={...C,backgroundColor:"var(--doc-border-input)",color:"var(--doc-text-muted)",cursor:"not-allowed"};function G(t){if(!t||t.trim()==="")return false;let e=t.trim();if(e.startsWith("mailto:")||e.startsWith("tel:"))return e.length>7;if(e.startsWith("ftp://"))return e.length>6;try{let d=e.match(/^https?:\/\//)?e:`https://${e}`,k=new URL(d);return k.protocol==="http:"||k.protocol==="https:"}catch{return false}}function M(t){if(!t)return "";let e=t.trim();return e.startsWith("mailto:")||e.startsWith("tel:")||e.startsWith("ftp://")||e.match(/^https?:\/\//)?e:`https://${e}`}function ge(t){if(!t)return "unknown";let e=t.trim().toLowerCase();return e.startsWith("mailto:")?"email":e.startsWith("tel:")?"phone":e.startsWith("ftp://")?"ftp":e.startsWith("http://")||e.startsWith("https://")?"web":e.includes("@")&&!e.includes(" ")?"email":"web"}function ue({isOpen:t,onClose:e,onSubmit:d,onRemove:k,initialData:s,selectedText:h="",isEditing:n=false,bookmarks:R=[],className:$,style:K}){let{t:r}=chunkGNIO6SOS_js.b(),[l,g]=react.useState("url"),[p,L]=react.useState(""),[D,_]=react.useState(""),[b,N]=react.useState(""),[O,P]=react.useState(""),[y,m]=react.useState(""),[B,f]=react.useState(false),Y=react.useRef(null),U=react.useRef(null);react.useEffect(()=>{t&&(s?(s.bookmark?(g("bookmark"),N(s.bookmark)):(g("url"),L(s.url||"")),_(s.displayText||""),P(s.tooltip||"")):(g("url"),L(""),_(h),N(""),P("")),m(""),f(false));},[t,s,h]),react.useEffect(()=>{t&&setTimeout(()=>{l==="url"?Y.current?.focus():U.current?.focus();},100);},[t,l]);let V=react.useCallback(()=>{l==="url"&&p.trim()?G(p)?m(""):m(r("dialogs.hyperlink.invalidUrl")):m("");},[l,p,r]),S=react.useCallback(o=>{if(o?.preventDefault(),l==="url"){if(!p.trim()){m(r("dialogs.hyperlink.urlRequired")),f(true);return}if(!G(p)){m(r("dialogs.hyperlink.invalidUrl")),f(true);return}}else if(l==="bookmark"&&!b)return;let T={displayText:D.trim()||void 0,tooltip:O.trim()||void 0};l==="url"?T.url=M(p):T.bookmark=b,d(T);},[l,p,b,D,O,d]),X=react.useCallback(o=>{o.key==="Escape"?e():o.key==="Enter"&&!o.shiftKey&&o.target.tagName!=="TEXTAREA"&&(o.preventDefault(),S());},[e,S]),j=react.useCallback(o=>{o.target===o.currentTarget&&e();},[e]);if(!t)return null;let q=R.length>0,A=l==="url"&&p.trim()&&!y||l==="bookmark"&&b;return jsxRuntime.jsx("div",{className:`docx-hyperlink-dialog-overlay ${$||""}`,style:{...J,...K},onClick:j,onKeyDown:X,role:"dialog","aria-modal":"true","aria-labelledby":"hyperlink-dialog-title",children:jsxRuntime.jsxs("div",{className:"docx-hyperlink-dialog",style:Q,children:[jsxRuntime.jsxs("div",{className:"docx-hyperlink-dialog-header",style:Z,children:[jsxRuntime.jsx("h2",{id:"hyperlink-dialog-title",style:ee,children:r(n?"dialogs.hyperlink.titleEdit":"dialogs.hyperlink.titleInsert")}),jsxRuntime.jsx("button",{type:"button",className:"docx-hyperlink-dialog-close",style:te,onClick:e,"aria-label":r("common.closeDialog"),children:"\xD7"})]}),jsxRuntime.jsxs("form",{className:"docx-hyperlink-dialog-body",style:re,onSubmit:S,children:[q&&jsxRuntime.jsxs("div",{className:"docx-hyperlink-dialog-tabs",style:ne,children:[jsxRuntime.jsx("button",{type:"button",className:`docx-hyperlink-dialog-tab ${l==="url"?"active":""}`,style:l==="url"?F:H,onClick:()=>g("url"),"aria-selected":l==="url",children:r("dialogs.hyperlink.tabWebAddress")}),jsxRuntime.jsx("button",{type:"button",className:`docx-hyperlink-dialog-tab ${l==="bookmark"?"active":""}`,style:l==="bookmark"?F:H,onClick:()=>g("bookmark"),"aria-selected":l==="bookmark",children:r("dialogs.hyperlink.tabBookmark")})]}),l==="url"&&jsxRuntime.jsxs("div",{className:"docx-hyperlink-dialog-field",style:v,children:[jsxRuntime.jsx("label",{htmlFor:"hyperlink-url",style:E,children:r("dialogs.hyperlink.urlLabel")}),jsxRuntime.jsx("input",{ref:Y,id:"hyperlink-url",type:"text",className:"docx-hyperlink-dialog-input",style:y&&B?oe:x,value:p,onChange:o=>{L(o.target.value),B&&m("");},onBlur:()=>{f(true),V();},placeholder:r("dialogs.hyperlink.urlPlaceholder"),"aria-invalid":!!y,"aria-describedby":y?"url-error":"url-hint"}),y&&B&&jsxRuntime.jsx("div",{id:"url-error",style:le,children:y}),!y&&jsxRuntime.jsx("div",{id:"url-hint",style:z,children:r("dialogs.hyperlink.urlHint")})]}),l==="bookmark"&&jsxRuntime.jsxs("div",{className:"docx-hyperlink-dialog-field",style:v,children:[jsxRuntime.jsx("label",{htmlFor:"hyperlink-bookmark",style:E,children:r("dialogs.hyperlink.bookmarkLabel")}),jsxRuntime.jsxs("select",{ref:U,id:"hyperlink-bookmark",className:"docx-hyperlink-dialog-select",style:ie,value:b,onChange:o=>N(o.target.value),children:[jsxRuntime.jsx("option",{value:"",children:r("dialogs.hyperlink.bookmarkPlaceholder")}),R.map(o=>jsxRuntime.jsx("option",{value:o.name,children:o.label||o.name},o.name))]})]}),jsxRuntime.jsxs("div",{className:"docx-hyperlink-dialog-field",style:v,children:[jsxRuntime.jsx("label",{htmlFor:"hyperlink-display-text",style:E,children:r("dialogs.hyperlink.displayTextLabel")}),jsxRuntime.jsx("input",{id:"hyperlink-display-text",type:"text",className:"docx-hyperlink-dialog-input",style:x,value:D,onChange:o=>_(o.target.value),placeholder:r("dialogs.hyperlink.displayTextPlaceholder")}),jsxRuntime.jsx("div",{style:z,children:r("dialogs.hyperlink.displayTextHint")})]}),jsxRuntime.jsxs("div",{className:"docx-hyperlink-dialog-field",style:v,children:[jsxRuntime.jsx("label",{htmlFor:"hyperlink-tooltip",style:E,children:r("dialogs.hyperlink.tooltipLabel")}),jsxRuntime.jsx("input",{id:"hyperlink-tooltip",type:"text",className:"docx-hyperlink-dialog-input",style:x,value:O,onChange:o=>P(o.target.value),placeholder:r("dialogs.hyperlink.tooltipPlaceholder")})]})]}),jsxRuntime.jsxs("div",{className:"docx-hyperlink-dialog-footer",style:ae,children:[n&&k&&jsxRuntime.jsx("button",{type:"button",className:"docx-hyperlink-dialog-remove",style:de,onClick:k,children:r("dialogs.hyperlink.removeLink")}),jsxRuntime.jsx("div",{style:{flex:1}}),jsxRuntime.jsx("button",{type:"button",className:"docx-hyperlink-dialog-cancel",style:pe,onClick:e,children:r("common.cancel")}),jsxRuntime.jsx("button",{type:"submit",className:"docx-hyperlink-dialog-submit",style:A?se:ce,onClick:S,disabled:!A,children:r(n?"common.update":"common.insert")})]})]})})}function be(t,e){return {url:M(t),displayText:e}}function xe(t,e){return {bookmark:t,displayText:e}}function he(t){return !!t.url&&!t.bookmark}function fe(t){return !!t.bookmark}function Se(t){return t.displayText?t.displayText:t.url?t.url.replace(/^https?:\/\//,""):t.bookmark?t.bookmark:""}function Te(t){return t.startsWith("mailto:")?t:`mailto:${t}`}function ve(t){return t.startsWith("tel:")?t:`tel:${t.replace(/[\s\-\(\)\.]/g,"")}`}function Ee(t){return t.filter(e=>!e.name.startsWith("_")).map(e=>({name:e.name,label:e.name})).sort((e,d)=>e.name.localeCompare(d.name))}function Ce(){let[t,e]=react.useState({isOpen:false,isEditing:false}),d=react.useCallback(n=>{e({isOpen:true,selectedText:n,initialData:void 0,isEditing:false});},[]),k=react.useCallback(n=>{e({isOpen:true,initialData:n,selectedText:n.displayText,isEditing:true});},[]),s=react.useCallback(()=>{e(n=>({...n,isOpen:false}));},[]),h=react.useCallback(()=>{e(n=>({...n,isOpen:!n.isOpen}));},[]);return {state:t,openInsert:d,openEdit:k,close:s,toggle:h}}var Le=ue;
|
|
2
|
-
exports.a=G;exports.b=M;exports.c=ge;exports.d=ue;exports.e=be;exports.f=xe;exports.g=he;exports.h=fe;exports.i=Se;exports.j=Te;exports.k=ve;exports.l=Ee;exports.m=Ce;exports.n=Le;
|