@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.
- package/README.md +10 -2
- package/dist/FindReplaceDialog-KNJETYJX.js +1 -0
- package/dist/{FindReplaceDialog-N4J5OB7O.mjs → FindReplaceDialog-YW3R4FHM.mjs} +1 -1
- package/dist/FootnotePropertiesDialog-7QX54WQT.js +1 -0
- package/dist/FootnotePropertiesDialog-LNFJXQUG.mjs +1 -0
- package/dist/HyperlinkDialog-GBAYMTUE.js +1 -0
- package/dist/{HyperlinkDialog-YQSQFHOP.mjs → HyperlinkDialog-HNYTXDCB.mjs} +1 -1
- package/dist/ImagePositionDialog-B4RLP2W5.mjs +1 -0
- package/dist/ImagePositionDialog-M65BYQQE.js +1 -0
- package/dist/ImagePropertiesDialog-JOGW3WDU.mjs +1 -0
- package/dist/ImagePropertiesDialog-O4WQSF5M.js +1 -0
- package/dist/PageSetupDialog-2GIBTKMJ.js +1 -0
- package/dist/PageSetupDialog-Q7SHEZIJ.mjs +1 -0
- package/dist/TablePropertiesDialog-LMXWX3FI.mjs +1 -0
- package/dist/TablePropertiesDialog-WOZ4ES3H.js +1 -0
- package/dist/chunk-377ZVTSE.js +2 -0
- package/dist/chunk-3OKYQQQ5.js +111 -0
- package/dist/chunk-AU5NVRHP.js +2 -0
- package/dist/chunk-DC65PJYE.js +4 -0
- package/dist/chunk-FW5LYOOZ.mjs +111 -0
- package/dist/chunk-GZOCOWWB.mjs +2 -0
- package/dist/chunk-N6RUBUT2.js +261 -0
- package/dist/chunk-QSUPYUOP.js +2 -0
- package/dist/chunk-SZHPMPSO.mjs +261 -0
- package/dist/chunk-X5A54T6S.mjs +4 -0
- package/dist/chunk-YKBSKEBS.mjs +2 -0
- package/dist/chunk-Z26WOH6R.mjs +2 -0
- package/dist/clipboard-Cu80iVDh.d.ts +1181 -0
- package/dist/clipboard-dFROLI95.d.mts +1181 -0
- package/dist/index.css +1 -1
- package/dist/index.d.mts +15 -5
- package/dist/index.d.ts +15 -5
- package/dist/index.js +9 -9
- package/dist/index.mjs +9 -9
- package/dist/{react-CAc4htNH.d.ts → react-1nBq3zH9.d.ts} +3 -1
- package/dist/{react-B2h6vE3D.d.mts → react-Dr8Nm-0u.d.mts} +3 -1
- package/dist/react.css +1 -1
- package/dist/react.d.mts +2 -2
- package/dist/react.d.ts +2 -2
- package/dist/react.js +1 -1
- package/dist/react.mjs +1 -1
- package/dist/ui.d.mts +22 -20
- package/dist/ui.d.ts +22 -20
- package/dist/ui.js +1 -1
- package/dist/ui.mjs +1 -1
- package/i18n/de.json +745 -0
- package/i18n/en.json +745 -0
- package/i18n/pl.json +745 -0
- package/package.json +5 -3
- package/dist/FindReplaceDialog-AQFR4OCT.js +0 -1
- package/dist/FootnotePropertiesDialog-UFUIHLDW.mjs +0 -1
- package/dist/FootnotePropertiesDialog-YYIZU5U6.js +0 -1
- package/dist/HyperlinkDialog-HGZ2S37Z.js +0 -1
- package/dist/ImagePositionDialog-DQ4JWS4F.js +0 -1
- package/dist/ImagePositionDialog-HT6J2SHV.mjs +0 -1
- package/dist/ImagePropertiesDialog-3VK2S2AF.mjs +0 -1
- package/dist/ImagePropertiesDialog-GJMGLM6G.js +0 -1
- package/dist/PageSetupDialog-2SKHDRTF.js +0 -1
- package/dist/PageSetupDialog-SMQJXEBL.mjs +0 -1
- package/dist/TablePropertiesDialog-FI5E3RCB.mjs +0 -1
- package/dist/TablePropertiesDialog-STZOGHJB.js +0 -1
- package/dist/chunk-6AJI5NPH.mjs +0 -111
- package/dist/chunk-AZRYS2WF.mjs +0 -2
- package/dist/chunk-CTYOM6BE.js +0 -2
- package/dist/chunk-EEV6TUOX.mjs +0 -261
- package/dist/chunk-EF3LLEN7.js +0 -4
- package/dist/chunk-HWWZOJMR.mjs +0 -4
- package/dist/chunk-PJVI53AH.js +0 -2
- package/dist/chunk-UMDJQ3Q4.js +0 -111
- package/dist/chunk-WH2EK2HU.js +0 -261
- package/dist/chunk-XWBCP563.mjs +0 -2
- package/dist/clipboard-B7N7Kx2X.d.ts +0 -386
- package/dist/clipboard-BkM7Zvgs.d.mts +0 -386
package/README.md
CHANGED
|
@@ -16,8 +16,6 @@
|
|
|
16
16
|
|
|
17
17
|
Open-source WYSIWYG DOCX editor for the browser. No server required. **[Live demo](https://docx-editor.dev/editor)** | **[Documentation](https://www.docx-editor.dev/docs)**
|
|
18
18
|
|
|
19
|
-
For AI agents: see the [Agent Reference](https://raw.githubusercontent.com/eigenpal/docx-editor/main/AGENTS_README.md) for comprehensive API docs, code examples, and integration patterns.
|
|
20
|
-
|
|
21
19
|
<p align="center">
|
|
22
20
|
<a href="https://docx-editor.dev/editor">
|
|
23
21
|
<img src="https://raw.githubusercontent.com/eigenpal/docx-js-editor/main/assets/editor.png" alt="DOCX JS Editor screenshot" width="700" />
|
|
@@ -27,6 +25,7 @@ For AI agents: see the [Agent Reference](https://raw.githubusercontent.com/eigen
|
|
|
27
25
|
- WYSIWYG editing with Word fidelity — formatting, tables, images, hyperlinks
|
|
28
26
|
- Track changes (suggestion mode) with accept/reject
|
|
29
27
|
- Comments with replies, resolve/reopen, scroll-to-highlight
|
|
28
|
+
- Internationalization (i18n) - [community-contributed translations welcome](https://github.com/eigenpal/docx-js-editor/blob/main/docs/i18n.md#contributing-a-new-locale)
|
|
30
29
|
- Plugin system, undo/redo, find & replace, print preview
|
|
31
30
|
- Client-side only, zero server dependencies
|
|
32
31
|
|
|
@@ -81,6 +80,15 @@ Examples: [Vite](https://github.com/eigenpal/docx-js-editor/tree/main/examples/v
|
|
|
81
80
|
|
|
82
81
|
**[Documentation](https://www.docx-editor.dev/docs)** | **[Props & Ref Methods](https://www.docx-editor.dev/docs/props)** | **[Plugins](https://www.docx-editor.dev/docs/plugins)** | **[Architecture](https://www.docx-editor.dev/docs/architecture)**
|
|
83
82
|
|
|
83
|
+
## Translations
|
|
84
|
+
|
|
85
|
+
Help translate the editor into your language! See the full **[i18n contribution guide](https://github.com/eigenpal/docx-js-editor/blob/main/docs/i18n.md)**.
|
|
86
|
+
|
|
87
|
+
```bash
|
|
88
|
+
bun run i18n:new de # scaffold German locale
|
|
89
|
+
bun run i18n:status # check translation coverage
|
|
90
|
+
```
|
|
91
|
+
|
|
84
92
|
## License
|
|
85
93
|
|
|
86
94
|
MIT
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
'use strict';Object.defineProperty(exports,'__esModule',{value:true});var chunkAU5NVRHP_js=require('./chunk-AU5NVRHP.js');require('./chunk-QSUPYUOP.js'),require('./chunk-H5NTJZO4.js');Object.defineProperty(exports,"FindReplaceDialog",{enumerable:true,get:function(){return chunkAU5NVRHP_js.n}});Object.defineProperty(exports,"createDefaultFindOptions",{enumerable:true,get:function(){return chunkAU5NVRHP_js.a}});Object.defineProperty(exports,"createSearchPattern",{enumerable:true,get:function(){return chunkAU5NVRHP_js.c}});Object.defineProperty(exports,"default",{enumerable:true,get:function(){return chunkAU5NVRHP_js.o}});Object.defineProperty(exports,"escapeRegexString",{enumerable:true,get:function(){return chunkAU5NVRHP_js.b}});Object.defineProperty(exports,"findAllMatches",{enumerable:true,get:function(){return chunkAU5NVRHP_js.d}});Object.defineProperty(exports,"findInDocument",{enumerable:true,get:function(){return chunkAU5NVRHP_js.j}});Object.defineProperty(exports,"findInParagraph",{enumerable:true,get:function(){return chunkAU5NVRHP_js.k}});Object.defineProperty(exports,"getDefaultHighlightOptions",{enumerable:true,get:function(){return chunkAU5NVRHP_js.i}});Object.defineProperty(exports,"getMatchCountText",{enumerable:true,get:function(){return chunkAU5NVRHP_js.g}});Object.defineProperty(exports,"isEmptySearch",{enumerable:true,get:function(){return chunkAU5NVRHP_js.h}});Object.defineProperty(exports,"replaceAllInContent",{enumerable:true,get:function(){return chunkAU5NVRHP_js.e}});Object.defineProperty(exports,"replaceFirstInContent",{enumerable:true,get:function(){return chunkAU5NVRHP_js.f}});Object.defineProperty(exports,"scrollToMatch",{enumerable:true,get:function(){return chunkAU5NVRHP_js.l}});Object.defineProperty(exports,"useFindReplace",{enumerable:true,get:function(){return chunkAU5NVRHP_js.m}});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{n as FindReplaceDialog,a as createDefaultFindOptions,c as createSearchPattern,o as default,b as escapeRegexString,d as findAllMatches,j as findInDocument,k as findInParagraph,i as getDefaultHighlightOptions,g as getMatchCountText,h as isEmptySearch,e as replaceAllInContent,f as replaceFirstInContent,l as scrollToMatch,m as useFindReplace}from'./chunk-
|
|
1
|
+
export{n as FindReplaceDialog,a as createDefaultFindOptions,c as createSearchPattern,o as default,b as escapeRegexString,d as findAllMatches,j as findInDocument,k as findInParagraph,i as getDefaultHighlightOptions,g as getMatchCountText,h as isEmptySearch,e as replaceAllInContent,f as replaceFirstInContent,l as scrollToMatch,m as useFindReplace}from'./chunk-Z26WOH6R.mjs';import'./chunk-GZOCOWWB.mjs';import'./chunk-TAUMSKRE.mjs';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
'use strict';var chunkQSUPYUOP_js=require('./chunk-QSUPYUOP.js');require('./chunk-H5NTJZO4.js');var react=require('react'),jsxRuntime=require('react/jsx-runtime');var T={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},A={backgroundColor:"white",borderRadius:8,boxShadow:"0 4px 20px rgba(0, 0, 0, 0.15)",padding:24,minWidth:400,maxWidth:500},S={marginBottom:16,padding:12,border:"1px solid #e0e0e0",borderRadius:4},r={display:"block",fontSize:12,color:"#666",marginBottom:4},s={width:"100%",padding:"4px 8px",border:"1px solid #ccc",borderRadius:4,fontSize:13,marginBottom:8},h={width:60,padding:"4px 8px",border:"1px solid #ccc",borderRadius:4,fontSize:13,marginBottom:8},D={display:"flex",justifyContent:"flex-end",gap:8,marginTop:16},F={padding:"6px 16px",border:"1px solid #ccc",borderRadius:4,cursor:"pointer",fontSize:13,backgroundColor:"white"},L={...F,backgroundColor:"#2563eb",color:"white",border:"1px solid #2563eb"},x=[{value:"decimal",labelKey:"dialogs.footnoteProperties.formats.decimal"},{value:"lowerRoman",labelKey:"dialogs.footnoteProperties.formats.lowerRoman"},{value:"upperRoman",labelKey:"dialogs.footnoteProperties.formats.upperRoman"},{value:"lowerLetter",labelKey:"dialogs.footnoteProperties.formats.lowerAlpha"},{value:"upperLetter",labelKey:"dialogs.footnoteProperties.formats.upperAlpha"},{value:"chicago",labelKey:"dialogs.footnoteProperties.formats.symbols"}];function G({isOpen:C,onClose:a,onApply:v,footnotePr:l,endnotePr:p}){let{t:o}=chunkQSUPYUOP_js.b(),[u,R]=react.useState(l?.position??"pageBottom"),[d,N]=react.useState(l?.numFmt??"decimal"),[m,E]=react.useState(l?.numStart??1),[c,w]=react.useState(l?.numRestart??"continuous"),[g,k]=react.useState(p?.position??"docEnd"),[b,K]=react.useState(p?.numFmt??"lowerRoman"),[y,O]=react.useState(p?.numStart??1),[f,z]=react.useState(p?.numRestart??"continuous"),B=react.useCallback(()=>{v({position:u,numFmt:d,numStart:m,numRestart:c},{position:g,numFmt:b,numStart:y,numRestart:f}),a();},[u,d,m,c,g,b,y,f,v,a]);return C?jsxRuntime.jsx("div",{style:T,onClick:a,children:jsxRuntime.jsxs("div",{style:A,onClick:t=>t.stopPropagation(),children:[jsxRuntime.jsx("h3",{style:{margin:"0 0 16px",fontSize:16},children:o("dialogs.footnoteProperties.title")}),jsxRuntime.jsxs("div",{style:S,children:[jsxRuntime.jsx("h4",{style:{margin:"0 0 8px",fontSize:14},children:o("dialogs.footnoteProperties.footnotes")}),jsxRuntime.jsx("label",{style:r,children:o("dialogs.footnoteProperties.position")}),jsxRuntime.jsxs("select",{style:s,value:u,onChange:t=>R(t.target.value),children:[jsxRuntime.jsx("option",{value:"pageBottom",children:o("dialogs.footnoteProperties.footnotePositions.bottomOfPage")}),jsxRuntime.jsx("option",{value:"beneathText",children:o("dialogs.footnoteProperties.footnotePositions.belowText")})]}),jsxRuntime.jsx("label",{style:r,children:o("dialogs.footnoteProperties.numberFormat")}),jsxRuntime.jsx("select",{style:s,value:d,onChange:t=>N(t.target.value),children:x.map(t=>jsxRuntime.jsx("option",{value:t.value,children:o(t.labelKey)},t.value))}),jsxRuntime.jsxs("div",{style:{display:"flex",gap:12,alignItems:"center"},children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{style:r,children:o("dialogs.footnoteProperties.startAt")}),jsxRuntime.jsx("input",{type:"number",min:1,style:h,value:m,onChange:t=>E(parseInt(t.target.value,10)||1)})]}),jsxRuntime.jsxs("div",{style:{flex:1},children:[jsxRuntime.jsx("label",{style:r,children:o("dialogs.footnoteProperties.numbering")}),jsxRuntime.jsxs("select",{style:s,value:c,onChange:t=>w(t.target.value),children:[jsxRuntime.jsx("option",{value:"continuous",children:o("dialogs.footnoteProperties.numberingOptions.continuous")}),jsxRuntime.jsx("option",{value:"eachSect",children:o("dialogs.footnoteProperties.numberingOptions.restartSection")}),jsxRuntime.jsx("option",{value:"eachPage",children:o("dialogs.footnoteProperties.numberingOptions.restartPage")})]})]})]})]}),jsxRuntime.jsxs("div",{style:S,children:[jsxRuntime.jsx("h4",{style:{margin:"0 0 8px",fontSize:14},children:o("dialogs.footnoteProperties.endnotes")}),jsxRuntime.jsx("label",{style:r,children:o("dialogs.footnoteProperties.position")}),jsxRuntime.jsxs("select",{style:s,value:g,onChange:t=>k(t.target.value),children:[jsxRuntime.jsx("option",{value:"docEnd",children:o("dialogs.footnoteProperties.endnotePositions.endOfDocument")}),jsxRuntime.jsx("option",{value:"sectEnd",children:o("dialogs.footnoteProperties.endnotePositions.endOfSection")})]}),jsxRuntime.jsx("label",{style:r,children:o("dialogs.footnoteProperties.numberFormat")}),jsxRuntime.jsx("select",{style:s,value:b,onChange:t=>K(t.target.value),children:x.map(t=>jsxRuntime.jsx("option",{value:t.value,children:o(t.labelKey)},t.value))}),jsxRuntime.jsxs("div",{style:{display:"flex",gap:12,alignItems:"center"},children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{style:r,children:o("dialogs.footnoteProperties.startAt")}),jsxRuntime.jsx("input",{type:"number",min:1,style:h,value:y,onChange:t=>O(parseInt(t.target.value,10)||1)})]}),jsxRuntime.jsxs("div",{style:{flex:1},children:[jsxRuntime.jsx("label",{style:r,children:o("dialogs.footnoteProperties.numbering")}),jsxRuntime.jsxs("select",{style:s,value:f,onChange:t=>z(t.target.value),children:[jsxRuntime.jsx("option",{value:"continuous",children:o("dialogs.footnoteProperties.numberingOptions.continuous")}),jsxRuntime.jsx("option",{value:"eachSect",children:o("dialogs.footnoteProperties.numberingOptions.restartSection")})]})]})]})]}),jsxRuntime.jsxs("div",{style:D,children:[jsxRuntime.jsx("button",{style:F,onClick:a,children:o("common.cancel")}),jsxRuntime.jsx("button",{style:L,onClick:B,children:o("common.apply")})]})]})}):null}exports.FootnotePropertiesDialog=G;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import {b}from'./chunk-GZOCOWWB.mjs';import'./chunk-TAUMSKRE.mjs';import {useState,useCallback}from'react';import {jsx,jsxs}from'react/jsx-runtime';var T={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},A={backgroundColor:"white",borderRadius:8,boxShadow:"0 4px 20px rgba(0, 0, 0, 0.15)",padding:24,minWidth:400,maxWidth:500},S={marginBottom:16,padding:12,border:"1px solid #e0e0e0",borderRadius:4},r={display:"block",fontSize:12,color:"#666",marginBottom:4},s={width:"100%",padding:"4px 8px",border:"1px solid #ccc",borderRadius:4,fontSize:13,marginBottom:8},h={width:60,padding:"4px 8px",border:"1px solid #ccc",borderRadius:4,fontSize:13,marginBottom:8},D={display:"flex",justifyContent:"flex-end",gap:8,marginTop:16},F={padding:"6px 16px",border:"1px solid #ccc",borderRadius:4,cursor:"pointer",fontSize:13,backgroundColor:"white"},L={...F,backgroundColor:"#2563eb",color:"white",border:"1px solid #2563eb"},x=[{value:"decimal",labelKey:"dialogs.footnoteProperties.formats.decimal"},{value:"lowerRoman",labelKey:"dialogs.footnoteProperties.formats.lowerRoman"},{value:"upperRoman",labelKey:"dialogs.footnoteProperties.formats.upperRoman"},{value:"lowerLetter",labelKey:"dialogs.footnoteProperties.formats.lowerAlpha"},{value:"upperLetter",labelKey:"dialogs.footnoteProperties.formats.upperAlpha"},{value:"chicago",labelKey:"dialogs.footnoteProperties.formats.symbols"}];function G({isOpen:C,onClose:a,onApply:v,footnotePr:l,endnotePr:p}){let{t:o}=b(),[u,R]=useState(l?.position??"pageBottom"),[d,N]=useState(l?.numFmt??"decimal"),[m,E]=useState(l?.numStart??1),[c,w]=useState(l?.numRestart??"continuous"),[g,k]=useState(p?.position??"docEnd"),[b$1,K]=useState(p?.numFmt??"lowerRoman"),[y,O]=useState(p?.numStart??1),[f,z]=useState(p?.numRestart??"continuous"),B=useCallback(()=>{v({position:u,numFmt:d,numStart:m,numRestart:c},{position:g,numFmt:b$1,numStart:y,numRestart:f}),a();},[u,d,m,c,g,b$1,y,f,v,a]);return C?jsx("div",{style:T,onClick:a,children:jsxs("div",{style:A,onClick:t=>t.stopPropagation(),children:[jsx("h3",{style:{margin:"0 0 16px",fontSize:16},children:o("dialogs.footnoteProperties.title")}),jsxs("div",{style:S,children:[jsx("h4",{style:{margin:"0 0 8px",fontSize:14},children:o("dialogs.footnoteProperties.footnotes")}),jsx("label",{style:r,children:o("dialogs.footnoteProperties.position")}),jsxs("select",{style:s,value:u,onChange:t=>R(t.target.value),children:[jsx("option",{value:"pageBottom",children:o("dialogs.footnoteProperties.footnotePositions.bottomOfPage")}),jsx("option",{value:"beneathText",children:o("dialogs.footnoteProperties.footnotePositions.belowText")})]}),jsx("label",{style:r,children:o("dialogs.footnoteProperties.numberFormat")}),jsx("select",{style:s,value:d,onChange:t=>N(t.target.value),children:x.map(t=>jsx("option",{value:t.value,children:o(t.labelKey)},t.value))}),jsxs("div",{style:{display:"flex",gap:12,alignItems:"center"},children:[jsxs("div",{children:[jsx("label",{style:r,children:o("dialogs.footnoteProperties.startAt")}),jsx("input",{type:"number",min:1,style:h,value:m,onChange:t=>E(parseInt(t.target.value,10)||1)})]}),jsxs("div",{style:{flex:1},children:[jsx("label",{style:r,children:o("dialogs.footnoteProperties.numbering")}),jsxs("select",{style:s,value:c,onChange:t=>w(t.target.value),children:[jsx("option",{value:"continuous",children:o("dialogs.footnoteProperties.numberingOptions.continuous")}),jsx("option",{value:"eachSect",children:o("dialogs.footnoteProperties.numberingOptions.restartSection")}),jsx("option",{value:"eachPage",children:o("dialogs.footnoteProperties.numberingOptions.restartPage")})]})]})]})]}),jsxs("div",{style:S,children:[jsx("h4",{style:{margin:"0 0 8px",fontSize:14},children:o("dialogs.footnoteProperties.endnotes")}),jsx("label",{style:r,children:o("dialogs.footnoteProperties.position")}),jsxs("select",{style:s,value:g,onChange:t=>k(t.target.value),children:[jsx("option",{value:"docEnd",children:o("dialogs.footnoteProperties.endnotePositions.endOfDocument")}),jsx("option",{value:"sectEnd",children:o("dialogs.footnoteProperties.endnotePositions.endOfSection")})]}),jsx("label",{style:r,children:o("dialogs.footnoteProperties.numberFormat")}),jsx("select",{style:s,value:b$1,onChange:t=>K(t.target.value),children:x.map(t=>jsx("option",{value:t.value,children:o(t.labelKey)},t.value))}),jsxs("div",{style:{display:"flex",gap:12,alignItems:"center"},children:[jsxs("div",{children:[jsx("label",{style:r,children:o("dialogs.footnoteProperties.startAt")}),jsx("input",{type:"number",min:1,style:h,value:y,onChange:t=>O(parseInt(t.target.value,10)||1)})]}),jsxs("div",{style:{flex:1},children:[jsx("label",{style:r,children:o("dialogs.footnoteProperties.numbering")}),jsxs("select",{style:s,value:f,onChange:t=>z(t.target.value),children:[jsx("option",{value:"continuous",children:o("dialogs.footnoteProperties.numberingOptions.continuous")}),jsx("option",{value:"eachSect",children:o("dialogs.footnoteProperties.numberingOptions.restartSection")})]})]})]})]}),jsxs("div",{style:D,children:[jsx("button",{style:F,onClick:a,children:o("common.cancel")}),jsx("button",{style:L,onClick:B,children:o("common.apply")})]})]})}):null}export{G as FootnotePropertiesDialog};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
'use strict';Object.defineProperty(exports,'__esModule',{value:true});var chunk377ZVTSE_js=require('./chunk-377ZVTSE.js');require('./chunk-QSUPYUOP.js'),require('./chunk-H5NTJZO4.js');Object.defineProperty(exports,"HyperlinkDialog",{enumerable:true,get:function(){return chunk377ZVTSE_js.d}});Object.defineProperty(exports,"createBookmarkLinkData",{enumerable:true,get:function(){return chunk377ZVTSE_js.f}});Object.defineProperty(exports,"createHyperlinkData",{enumerable:true,get:function(){return chunk377ZVTSE_js.e}});Object.defineProperty(exports,"default",{enumerable:true,get:function(){return chunk377ZVTSE_js.n}});Object.defineProperty(exports,"emailToMailto",{enumerable:true,get:function(){return chunk377ZVTSE_js.j}});Object.defineProperty(exports,"extractBookmarksForDialog",{enumerable:true,get:function(){return chunk377ZVTSE_js.l}});Object.defineProperty(exports,"getDisplayText",{enumerable:true,get:function(){return chunk377ZVTSE_js.i}});Object.defineProperty(exports,"getUrlType",{enumerable:true,get:function(){return chunk377ZVTSE_js.c}});Object.defineProperty(exports,"isBookmarkHyperlinkData",{enumerable:true,get:function(){return chunk377ZVTSE_js.h}});Object.defineProperty(exports,"isExternalHyperlinkData",{enumerable:true,get:function(){return chunk377ZVTSE_js.g}});Object.defineProperty(exports,"isValidUrl",{enumerable:true,get:function(){return chunk377ZVTSE_js.a}});Object.defineProperty(exports,"normalizeUrl",{enumerable:true,get:function(){return chunk377ZVTSE_js.b}});Object.defineProperty(exports,"phoneToTel",{enumerable:true,get:function(){return chunk377ZVTSE_js.k}});Object.defineProperty(exports,"useHyperlinkDialog",{enumerable:true,get:function(){return chunk377ZVTSE_js.m}});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{d as HyperlinkDialog,f as createBookmarkLinkData,e as createHyperlinkData,n as default,j as emailToMailto,l as extractBookmarksForDialog,i as getDisplayText,c as getUrlType,h as isBookmarkHyperlinkData,g as isExternalHyperlinkData,a as isValidUrl,b as normalizeUrl,k as phoneToTel,m as useHyperlinkDialog}from'./chunk-
|
|
1
|
+
export{d as HyperlinkDialog,f as createBookmarkLinkData,e as createHyperlinkData,n as default,j as emailToMailto,l as extractBookmarksForDialog,i as getDisplayText,c as getUrlType,h as isBookmarkHyperlinkData,g as isExternalHyperlinkData,a as isValidUrl,b as normalizeUrl,k as phoneToTel,m as useHyperlinkDialog}from'./chunk-YKBSKEBS.mjs';import'./chunk-GZOCOWWB.mjs';import'./chunk-TAUMSKRE.mjs';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import {b}from'./chunk-GZOCOWWB.mjs';import'./chunk-TAUMSKRE.mjs';import {useState,useEffect,useCallback}from'react';import {jsx,jsxs}from'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:8,boxShadow:"0 4px 20px rgba(0, 0, 0, 0.15)",minWidth:400,maxWidth:480,width:"100%",margin:20},U={padding:"16px 20px 12px",borderBottom:"1px solid var(--doc-border)",fontSize:16,fontWeight:600},X={padding:"16px 20px",display:"flex",flexDirection:"column",gap:16},D={display:"flex",flexDirection:"column",gap:8},k={fontSize:13,fontWeight:600,color:"var(--doc-text)"},a={display:"flex",alignItems:"center",gap:8},n={width:75,fontSize:12,color:"var(--doc-text-muted)"},g={flex:1,padding:"4px 6px",border:"1px solid var(--doc-border)",borderRadius:4,fontSize:12},p={...g},Y={padding:"12px 20px 16px",borderTop:"1px solid var(--doc-border)",display:"flex",justifyContent:"flex-end",gap:8},q={padding:"6px 16px",fontSize:13,border:"1px solid var(--doc-border)",borderRadius:4,cursor:"pointer"};function tt({isOpen:f,onClose:r,onApply:z,currentData:s}){let{t:i}=b(),[v,c]=useState("align"),[u,I]=useState("center"),[y,B]=useState("column"),[b$1,L]=useState(0),[m,P]=useState("align"),[h,N]=useState("top"),[S,A]=useState("paragraph"),[x,E]=useState(0),[C,H]=useState(0),[O,M]=useState(0),[T,V]=useState(0),[R,W]=useState(0);useEffect(()=>{if(!f)return;let t=s?.horizontal,d=s?.vertical;t?.align?(c("align"),I(t.align)):t?.posOffset!=null&&(c("offset"),L(t.posOffset)),t?.relativeTo&&B(t.relativeTo),d?.align?(P("align"),N(d.align)):d?.posOffset!=null&&(P("offset"),E(d.posOffset)),d?.relativeTo&&A(d.relativeTo),H(s?.distTop??0),M(s?.distBottom??0),V(s?.distLeft??0),W(s?.distRight??0);},[f,s]);let w=useCallback(()=>{let t={};t.horizontal={relativeTo:y,...v==="align"?{align:u}:{posOffset:b$1}},t.vertical={relativeTo:S,...m==="align"?{align:h}:{posOffset:x}},t.distTop=C,t.distBottom=O,t.distLeft=T,t.distRight=R,z(t),r();},[v,u,y,b$1,m,h,S,x,C,O,T,R,z,r]),F=useCallback(t=>{t.key==="Escape"&&r(),t.key==="Enter"&&w();},[r,w]);return f?jsx("div",{style:J,onClick:r,onKeyDown:F,children:jsxs("div",{style:Q,onClick:t=>t.stopPropagation(),role:"dialog","aria-label":i("dialogs.imagePosition.title"),children:[jsx("div",{style:U,children:i("dialogs.imagePosition.title")}),jsxs("div",{style:X,children:[jsxs("div",{style:D,children:[jsx("div",{style:k,children:i("dialogs.imagePosition.horizontal")}),jsxs("div",{style:a,children:[jsx("label",{style:n,children:i("dialogs.imagePosition.position")}),jsxs("select",{style:p,value:v,onChange:t=>c(t.target.value),children:[jsx("option",{value:"align",children:i("dialogs.imagePosition.alignment")}),jsx("option",{value:"offset",children:i("dialogs.imagePosition.offset")})]})]}),v==="align"?jsxs("div",{style:a,children:[jsx("label",{style:n,children:i("dialogs.imagePosition.align")}),jsxs("select",{style:p,value:u,onChange:t=>I(t.target.value),children:[jsx("option",{value:"left",children:i("dialogs.imagePosition.alignOptions.left")}),jsx("option",{value:"center",children:i("dialogs.imagePosition.alignOptions.center")}),jsx("option",{value:"right",children:i("dialogs.imagePosition.alignOptions.right")})]})]}):jsxs("div",{style:a,children:[jsx("label",{style:n,children:i("dialogs.imagePosition.offsetPx")}),jsx("input",{type:"number",style:g,value:b$1,onChange:t=>L(Number(t.target.value)||0)})]}),jsxs("div",{style:a,children:[jsx("label",{style:n,children:i("dialogs.imagePosition.relativeTo")}),jsxs("select",{style:p,value:y,onChange:t=>B(t.target.value),children:[jsx("option",{value:"page",children:i("dialogs.imagePosition.relativeOptions.page")}),jsx("option",{value:"column",children:i("dialogs.imagePosition.relativeOptions.column")}),jsx("option",{value:"margin",children:i("dialogs.imagePosition.relativeOptions.margin")}),jsx("option",{value:"character",children:i("dialogs.imagePosition.relativeOptions.character")})]})]})]}),jsxs("div",{style:D,children:[jsx("div",{style:k,children:i("dialogs.imagePosition.vertical")}),jsxs("div",{style:a,children:[jsx("label",{style:n,children:i("dialogs.imagePosition.position")}),jsxs("select",{style:p,value:m,onChange:t=>P(t.target.value),children:[jsx("option",{value:"align",children:i("dialogs.imagePosition.alignment")}),jsx("option",{value:"offset",children:i("dialogs.imagePosition.offset")})]})]}),m==="align"?jsxs("div",{style:a,children:[jsx("label",{style:n,children:i("dialogs.imagePosition.align")}),jsxs("select",{style:p,value:h,onChange:t=>N(t.target.value),children:[jsx("option",{value:"top",children:i("dialogs.imagePosition.alignOptions.top")}),jsx("option",{value:"center",children:i("dialogs.imagePosition.alignOptions.center")}),jsx("option",{value:"bottom",children:i("dialogs.imagePosition.alignOptions.bottom")})]})]}):jsxs("div",{style:a,children:[jsx("label",{style:n,children:i("dialogs.imagePosition.offsetPx")}),jsx("input",{type:"number",style:g,value:x,onChange:t=>E(Number(t.target.value)||0)})]}),jsxs("div",{style:a,children:[jsx("label",{style:n,children:i("dialogs.imagePosition.relativeTo")}),jsxs("select",{style:p,value:S,onChange:t=>A(t.target.value),children:[jsx("option",{value:"page",children:i("dialogs.imagePosition.relativeOptions.page")}),jsx("option",{value:"margin",children:i("dialogs.imagePosition.relativeOptions.margin")}),jsx("option",{value:"paragraph",children:i("dialogs.imagePosition.relativeOptions.paragraph")}),jsx("option",{value:"line",children:i("dialogs.imagePosition.relativeOptions.line")})]})]})]}),jsxs("div",{style:D,children:[jsx("div",{style:k,children:"Distance from text (px)"}),jsxs("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:8},children:[jsxs("div",{style:a,children:[jsx("label",{style:{...n,width:45},children:i("dialogs.imagePosition.alignOptions.top")}),jsx("input",{type:"number",style:g,min:0,value:C,onChange:t=>H(Number(t.target.value)||0)})]}),jsxs("div",{style:a,children:[jsx("label",{style:{...n,width:45},children:i("dialogs.imagePosition.alignOptions.bottom")}),jsx("input",{type:"number",style:g,min:0,value:O,onChange:t=>M(Number(t.target.value)||0)})]}),jsxs("div",{style:a,children:[jsx("label",{style:{...n,width:45},children:i("dialogs.imagePosition.alignOptions.left")}),jsx("input",{type:"number",style:g,min:0,value:T,onChange:t=>V(Number(t.target.value)||0)})]}),jsxs("div",{style:a,children:[jsx("label",{style:{...n,width:45},children:i("dialogs.imagePosition.alignOptions.right")}),jsx("input",{type:"number",style:g,min:0,value:R,onChange:t=>W(Number(t.target.value)||0)})]})]})]})]}),jsxs("div",{style:Y,children:[jsx("button",{type:"button",style:q,onClick:r,children:i("common.cancel")}),jsx("button",{type:"button",style:{...q,backgroundColor:"var(--doc-primary)",color:"white",borderColor:"var(--doc-primary)"},onClick:w,children:i("common.apply")})]})]})}):null}export{tt as ImagePositionDialog};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
'use strict';var chunkQSUPYUOP_js=require('./chunk-QSUPYUOP.js');require('./chunk-H5NTJZO4.js');var 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:8,boxShadow:"0 4px 20px rgba(0, 0, 0, 0.15)",minWidth:400,maxWidth:480,width:"100%",margin:20},U={padding:"16px 20px 12px",borderBottom:"1px solid var(--doc-border)",fontSize:16,fontWeight:600},X={padding:"16px 20px",display:"flex",flexDirection:"column",gap:16},D={display:"flex",flexDirection:"column",gap:8},k={fontSize:13,fontWeight:600,color:"var(--doc-text)"},a={display:"flex",alignItems:"center",gap:8},n={width:75,fontSize:12,color:"var(--doc-text-muted)"},g={flex:1,padding:"4px 6px",border:"1px solid var(--doc-border)",borderRadius:4,fontSize:12},p={...g},Y={padding:"12px 20px 16px",borderTop:"1px solid var(--doc-border)",display:"flex",justifyContent:"flex-end",gap:8},q={padding:"6px 16px",fontSize:13,border:"1px solid var(--doc-border)",borderRadius:4,cursor:"pointer"};function tt({isOpen:f,onClose:r,onApply:z,currentData:s}){let{t:i}=chunkQSUPYUOP_js.b(),[v,c]=react.useState("align"),[u,I]=react.useState("center"),[y,B]=react.useState("column"),[b,L]=react.useState(0),[m,P]=react.useState("align"),[h,N]=react.useState("top"),[S,A]=react.useState("paragraph"),[x,E]=react.useState(0),[C,H]=react.useState(0),[O,M]=react.useState(0),[T,V]=react.useState(0),[R,W]=react.useState(0);react.useEffect(()=>{if(!f)return;let t=s?.horizontal,d=s?.vertical;t?.align?(c("align"),I(t.align)):t?.posOffset!=null&&(c("offset"),L(t.posOffset)),t?.relativeTo&&B(t.relativeTo),d?.align?(P("align"),N(d.align)):d?.posOffset!=null&&(P("offset"),E(d.posOffset)),d?.relativeTo&&A(d.relativeTo),H(s?.distTop??0),M(s?.distBottom??0),V(s?.distLeft??0),W(s?.distRight??0);},[f,s]);let w=react.useCallback(()=>{let t={};t.horizontal={relativeTo:y,...v==="align"?{align:u}:{posOffset:b}},t.vertical={relativeTo:S,...m==="align"?{align:h}:{posOffset:x}},t.distTop=C,t.distBottom=O,t.distLeft=T,t.distRight=R,z(t),r();},[v,u,y,b,m,h,S,x,C,O,T,R,z,r]),F=react.useCallback(t=>{t.key==="Escape"&&r(),t.key==="Enter"&&w();},[r,w]);return f?jsxRuntime.jsx("div",{style:J,onClick:r,onKeyDown:F,children:jsxRuntime.jsxs("div",{style:Q,onClick:t=>t.stopPropagation(),role:"dialog","aria-label":i("dialogs.imagePosition.title"),children:[jsxRuntime.jsx("div",{style:U,children:i("dialogs.imagePosition.title")}),jsxRuntime.jsxs("div",{style:X,children:[jsxRuntime.jsxs("div",{style:D,children:[jsxRuntime.jsx("div",{style:k,children:i("dialogs.imagePosition.horizontal")}),jsxRuntime.jsxs("div",{style:a,children:[jsxRuntime.jsx("label",{style:n,children:i("dialogs.imagePosition.position")}),jsxRuntime.jsxs("select",{style:p,value:v,onChange:t=>c(t.target.value),children:[jsxRuntime.jsx("option",{value:"align",children:i("dialogs.imagePosition.alignment")}),jsxRuntime.jsx("option",{value:"offset",children:i("dialogs.imagePosition.offset")})]})]}),v==="align"?jsxRuntime.jsxs("div",{style:a,children:[jsxRuntime.jsx("label",{style:n,children:i("dialogs.imagePosition.align")}),jsxRuntime.jsxs("select",{style:p,value:u,onChange:t=>I(t.target.value),children:[jsxRuntime.jsx("option",{value:"left",children:i("dialogs.imagePosition.alignOptions.left")}),jsxRuntime.jsx("option",{value:"center",children:i("dialogs.imagePosition.alignOptions.center")}),jsxRuntime.jsx("option",{value:"right",children:i("dialogs.imagePosition.alignOptions.right")})]})]}):jsxRuntime.jsxs("div",{style:a,children:[jsxRuntime.jsx("label",{style:n,children:i("dialogs.imagePosition.offsetPx")}),jsxRuntime.jsx("input",{type:"number",style:g,value:b,onChange:t=>L(Number(t.target.value)||0)})]}),jsxRuntime.jsxs("div",{style:a,children:[jsxRuntime.jsx("label",{style:n,children:i("dialogs.imagePosition.relativeTo")}),jsxRuntime.jsxs("select",{style:p,value:y,onChange:t=>B(t.target.value),children:[jsxRuntime.jsx("option",{value:"page",children:i("dialogs.imagePosition.relativeOptions.page")}),jsxRuntime.jsx("option",{value:"column",children:i("dialogs.imagePosition.relativeOptions.column")}),jsxRuntime.jsx("option",{value:"margin",children:i("dialogs.imagePosition.relativeOptions.margin")}),jsxRuntime.jsx("option",{value:"character",children:i("dialogs.imagePosition.relativeOptions.character")})]})]})]}),jsxRuntime.jsxs("div",{style:D,children:[jsxRuntime.jsx("div",{style:k,children:i("dialogs.imagePosition.vertical")}),jsxRuntime.jsxs("div",{style:a,children:[jsxRuntime.jsx("label",{style:n,children:i("dialogs.imagePosition.position")}),jsxRuntime.jsxs("select",{style:p,value:m,onChange:t=>P(t.target.value),children:[jsxRuntime.jsx("option",{value:"align",children:i("dialogs.imagePosition.alignment")}),jsxRuntime.jsx("option",{value:"offset",children:i("dialogs.imagePosition.offset")})]})]}),m==="align"?jsxRuntime.jsxs("div",{style:a,children:[jsxRuntime.jsx("label",{style:n,children:i("dialogs.imagePosition.align")}),jsxRuntime.jsxs("select",{style:p,value:h,onChange:t=>N(t.target.value),children:[jsxRuntime.jsx("option",{value:"top",children:i("dialogs.imagePosition.alignOptions.top")}),jsxRuntime.jsx("option",{value:"center",children:i("dialogs.imagePosition.alignOptions.center")}),jsxRuntime.jsx("option",{value:"bottom",children:i("dialogs.imagePosition.alignOptions.bottom")})]})]}):jsxRuntime.jsxs("div",{style:a,children:[jsxRuntime.jsx("label",{style:n,children:i("dialogs.imagePosition.offsetPx")}),jsxRuntime.jsx("input",{type:"number",style:g,value:x,onChange:t=>E(Number(t.target.value)||0)})]}),jsxRuntime.jsxs("div",{style:a,children:[jsxRuntime.jsx("label",{style:n,children:i("dialogs.imagePosition.relativeTo")}),jsxRuntime.jsxs("select",{style:p,value:S,onChange:t=>A(t.target.value),children:[jsxRuntime.jsx("option",{value:"page",children:i("dialogs.imagePosition.relativeOptions.page")}),jsxRuntime.jsx("option",{value:"margin",children:i("dialogs.imagePosition.relativeOptions.margin")}),jsxRuntime.jsx("option",{value:"paragraph",children:i("dialogs.imagePosition.relativeOptions.paragraph")}),jsxRuntime.jsx("option",{value:"line",children:i("dialogs.imagePosition.relativeOptions.line")})]})]})]}),jsxRuntime.jsxs("div",{style:D,children:[jsxRuntime.jsx("div",{style:k,children:"Distance from text (px)"}),jsxRuntime.jsxs("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:8},children:[jsxRuntime.jsxs("div",{style:a,children:[jsxRuntime.jsx("label",{style:{...n,width:45},children:i("dialogs.imagePosition.alignOptions.top")}),jsxRuntime.jsx("input",{type:"number",style:g,min:0,value:C,onChange:t=>H(Number(t.target.value)||0)})]}),jsxRuntime.jsxs("div",{style:a,children:[jsxRuntime.jsx("label",{style:{...n,width:45},children:i("dialogs.imagePosition.alignOptions.bottom")}),jsxRuntime.jsx("input",{type:"number",style:g,min:0,value:O,onChange:t=>M(Number(t.target.value)||0)})]}),jsxRuntime.jsxs("div",{style:a,children:[jsxRuntime.jsx("label",{style:{...n,width:45},children:i("dialogs.imagePosition.alignOptions.left")}),jsxRuntime.jsx("input",{type:"number",style:g,min:0,value:T,onChange:t=>V(Number(t.target.value)||0)})]}),jsxRuntime.jsxs("div",{style:a,children:[jsxRuntime.jsx("label",{style:{...n,width:45},children:i("dialogs.imagePosition.alignOptions.right")}),jsxRuntime.jsx("input",{type:"number",style:g,min:0,value:R,onChange:t=>W(Number(t.target.value)||0)})]})]})]})]}),jsxRuntime.jsxs("div",{style:Y,children:[jsxRuntime.jsx("button",{type:"button",style:q,onClick:r,children:i("common.cancel")}),jsxRuntime.jsx("button",{type:"button",style:{...q,backgroundColor:"var(--doc-primary)",color:"white",borderColor:"var(--doc-primary)"},onClick:w,children:i("common.apply")})]})]})}):null}exports.ImagePositionDialog=tt;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import {b}from'./chunk-GZOCOWWB.mjs';import'./chunk-TAUMSKRE.mjs';import {useState,useEffect,useCallback}from'react';import {jsx,jsxs}from'react/jsx-runtime';var I={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},R={backgroundColor:"white",borderRadius:8,boxShadow:"0 4px 20px rgba(0, 0, 0, 0.15)",minWidth:380,maxWidth:440,width:"100%",margin:20},D={padding:"16px 20px 12px",borderBottom:"1px solid var(--doc-border)",fontSize:16,fontWeight:600},E={padding:"16px 20px",display:"flex",flexDirection:"column",gap:16},C={display:"flex",flexDirection:"column",gap:8},w={fontSize:13,fontWeight:600,color:"var(--doc-text)"},v={display:"flex",alignItems:"center",gap:8},S={width:60,fontSize:12,color:"var(--doc-text-muted)"},p={flex:1,padding:"4px 6px",border:"1px solid var(--doc-border)",borderRadius:4,fontSize:12},T={...p},B={...p,minHeight:60,resize:"vertical",fontFamily:"inherit"},K={padding:"12px 20px 16px",borderTop:"1px solid var(--doc-border)",display:"flex",justifyContent:"flex-end",gap:8},W={padding:"6px 16px",fontSize:13,border:"1px solid var(--doc-border)",borderRadius:4,cursor:"pointer"};function F({isOpen:g,onClose:l,onApply:u,currentData:d}){let{t:o}=b(),[y,m]=useState(""),[i,x]=useState(0),[a,c]=useState("#000000"),[s,f]=useState("solid");useEffect(()=>{g&&(m(d?.alt??""),x(d?.borderWidth??0),c(d?.borderColor??"#000000"),f(d?.borderStyle??"solid"));},[g,d]);let b$1=useCallback(()=>{u({alt:y||void 0,borderWidth:i>0?i:void 0,borderColor:i>0?a:void 0,borderStyle:i>0?s:void 0}),l();},[y,i,a,s,u,l]),k=useCallback(t=>{t.key==="Escape"&&l(),t.key==="Enter"&&!t.shiftKey&&b$1();},[l,b$1]);return g?jsx("div",{style:I,onClick:l,onKeyDown:k,children:jsxs("div",{style:R,onClick:t=>t.stopPropagation(),role:"dialog","aria-label":o("dialogs.imageProperties.title"),children:[jsx("div",{style:D,children:o("dialogs.imageProperties.title")}),jsxs("div",{style:E,children:[jsxs("div",{style:C,children:[jsx("div",{style:w,children:o("dialogs.imageProperties.altText")}),jsx("textarea",{style:B,value:y,onChange:t=>m(t.target.value),placeholder:o("dialogs.imageProperties.altTextPlaceholder")})]}),jsxs("div",{style:C,children:[jsx("div",{style:w,children:o("dialogs.imageProperties.border")}),jsxs("div",{style:v,children:[jsx("label",{style:S,children:o("dialogs.imageProperties.width")}),jsx("input",{type:"number",style:{...p,maxWidth:80},min:0,max:20,step:.5,value:i,onChange:t=>x(Number(t.target.value)||0)}),jsx("span",{style:{fontSize:12,color:"var(--doc-text-muted)"},children:o("common.px")})]}),jsxs("div",{style:v,children:[jsx("label",{style:S,children:o("dialogs.imageProperties.style")}),jsxs("select",{style:T,value:s,onChange:t=>f(t.target.value),children:[jsx("option",{value:"solid",children:o("dialogs.imageProperties.borderStyles.solid")}),jsx("option",{value:"dashed",children:o("dialogs.imageProperties.borderStyles.dashed")}),jsx("option",{value:"dotted",children:o("dialogs.imageProperties.borderStyles.dotted")}),jsx("option",{value:"double",children:o("dialogs.imageProperties.borderStyles.double")}),jsx("option",{value:"groove",children:o("dialogs.imageProperties.borderStyles.groove")}),jsx("option",{value:"ridge",children:o("dialogs.imageProperties.borderStyles.ridge")}),jsx("option",{value:"inset",children:o("dialogs.imageProperties.borderStyles.inset")}),jsx("option",{value:"outset",children:o("dialogs.imageProperties.borderStyles.outset")})]})]}),jsxs("div",{style:v,children:[jsx("label",{style:S,children:o("dialogs.imageProperties.color")}),jsx("input",{type:"color",value:a,onChange:t=>c(t.target.value),style:{width:32,height:24,padding:0,border:"1px solid var(--doc-border)",borderRadius:4,cursor:"pointer"}}),jsx("input",{type:"text",style:{...p,maxWidth:90},value:a,onChange:t=>c(t.target.value)})]}),i>0&&jsx("div",{style:{marginTop:4,padding:8,border:`${i}px ${s} ${a}`,borderRadius:4,fontSize:11,color:"var(--doc-text-muted)",textAlign:"center"},children:o("dialogs.imageProperties.preview")})]})]}),jsxs("div",{style:K,children:[jsx("button",{type:"button",style:W,onClick:l,children:o("common.cancel")}),jsx("button",{type:"button",style:{...W,backgroundColor:"var(--doc-primary)",color:"white",borderColor:"var(--doc-primary)"},onClick:b$1,children:o("common.apply")})]})]})}):null}export{F as ImagePropertiesDialog};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
'use strict';var chunkQSUPYUOP_js=require('./chunk-QSUPYUOP.js');require('./chunk-H5NTJZO4.js');var react=require('react'),jsxRuntime=require('react/jsx-runtime');var I={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},R={backgroundColor:"white",borderRadius:8,boxShadow:"0 4px 20px rgba(0, 0, 0, 0.15)",minWidth:380,maxWidth:440,width:"100%",margin:20},D={padding:"16px 20px 12px",borderBottom:"1px solid var(--doc-border)",fontSize:16,fontWeight:600},E={padding:"16px 20px",display:"flex",flexDirection:"column",gap:16},C={display:"flex",flexDirection:"column",gap:8},w={fontSize:13,fontWeight:600,color:"var(--doc-text)"},v={display:"flex",alignItems:"center",gap:8},S={width:60,fontSize:12,color:"var(--doc-text-muted)"},p={flex:1,padding:"4px 6px",border:"1px solid var(--doc-border)",borderRadius:4,fontSize:12},T={...p},B={...p,minHeight:60,resize:"vertical",fontFamily:"inherit"},K={padding:"12px 20px 16px",borderTop:"1px solid var(--doc-border)",display:"flex",justifyContent:"flex-end",gap:8},W={padding:"6px 16px",fontSize:13,border:"1px solid var(--doc-border)",borderRadius:4,cursor:"pointer"};function F({isOpen:g,onClose:l,onApply:u,currentData:d}){let{t:o}=chunkQSUPYUOP_js.b(),[y,m]=react.useState(""),[i,x]=react.useState(0),[a,c]=react.useState("#000000"),[s,f]=react.useState("solid");react.useEffect(()=>{g&&(m(d?.alt??""),x(d?.borderWidth??0),c(d?.borderColor??"#000000"),f(d?.borderStyle??"solid"));},[g,d]);let b=react.useCallback(()=>{u({alt:y||void 0,borderWidth:i>0?i:void 0,borderColor:i>0?a:void 0,borderStyle:i>0?s:void 0}),l();},[y,i,a,s,u,l]),k=react.useCallback(t=>{t.key==="Escape"&&l(),t.key==="Enter"&&!t.shiftKey&&b();},[l,b]);return g?jsxRuntime.jsx("div",{style:I,onClick:l,onKeyDown:k,children:jsxRuntime.jsxs("div",{style:R,onClick:t=>t.stopPropagation(),role:"dialog","aria-label":o("dialogs.imageProperties.title"),children:[jsxRuntime.jsx("div",{style:D,children:o("dialogs.imageProperties.title")}),jsxRuntime.jsxs("div",{style:E,children:[jsxRuntime.jsxs("div",{style:C,children:[jsxRuntime.jsx("div",{style:w,children:o("dialogs.imageProperties.altText")}),jsxRuntime.jsx("textarea",{style:B,value:y,onChange:t=>m(t.target.value),placeholder:o("dialogs.imageProperties.altTextPlaceholder")})]}),jsxRuntime.jsxs("div",{style:C,children:[jsxRuntime.jsx("div",{style:w,children:o("dialogs.imageProperties.border")}),jsxRuntime.jsxs("div",{style:v,children:[jsxRuntime.jsx("label",{style:S,children:o("dialogs.imageProperties.width")}),jsxRuntime.jsx("input",{type:"number",style:{...p,maxWidth:80},min:0,max:20,step:.5,value:i,onChange:t=>x(Number(t.target.value)||0)}),jsxRuntime.jsx("span",{style:{fontSize:12,color:"var(--doc-text-muted)"},children:o("common.px")})]}),jsxRuntime.jsxs("div",{style:v,children:[jsxRuntime.jsx("label",{style:S,children:o("dialogs.imageProperties.style")}),jsxRuntime.jsxs("select",{style:T,value:s,onChange:t=>f(t.target.value),children:[jsxRuntime.jsx("option",{value:"solid",children:o("dialogs.imageProperties.borderStyles.solid")}),jsxRuntime.jsx("option",{value:"dashed",children:o("dialogs.imageProperties.borderStyles.dashed")}),jsxRuntime.jsx("option",{value:"dotted",children:o("dialogs.imageProperties.borderStyles.dotted")}),jsxRuntime.jsx("option",{value:"double",children:o("dialogs.imageProperties.borderStyles.double")}),jsxRuntime.jsx("option",{value:"groove",children:o("dialogs.imageProperties.borderStyles.groove")}),jsxRuntime.jsx("option",{value:"ridge",children:o("dialogs.imageProperties.borderStyles.ridge")}),jsxRuntime.jsx("option",{value:"inset",children:o("dialogs.imageProperties.borderStyles.inset")}),jsxRuntime.jsx("option",{value:"outset",children:o("dialogs.imageProperties.borderStyles.outset")})]})]}),jsxRuntime.jsxs("div",{style:v,children:[jsxRuntime.jsx("label",{style:S,children:o("dialogs.imageProperties.color")}),jsxRuntime.jsx("input",{type:"color",value:a,onChange:t=>c(t.target.value),style:{width:32,height:24,padding:0,border:"1px solid var(--doc-border)",borderRadius:4,cursor:"pointer"}}),jsxRuntime.jsx("input",{type:"text",style:{...p,maxWidth:90},value:a,onChange:t=>c(t.target.value)})]}),i>0&&jsxRuntime.jsx("div",{style:{marginTop:4,padding:8,border:`${i}px ${s} ${a}`,borderRadius:4,fontSize:11,color:"var(--doc-text-muted)",textAlign:"center"},children:o("dialogs.imageProperties.preview")})]})]}),jsxRuntime.jsxs("div",{style:K,children:[jsxRuntime.jsx("button",{type:"button",style:W,onClick:l,children:o("common.cancel")}),jsxRuntime.jsx("button",{type:"button",style:{...W,backgroundColor:"var(--doc-primary)",color:"white",borderColor:"var(--doc-primary)"},onClick:b,children:o("common.apply")})]})]})}):null}exports.ImagePropertiesDialog=F;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
'use strict';var chunkQSUPYUOP_js=require('./chunk-QSUPYUOP.js');require('./chunk-SE5EN2QL.js'),require('./chunk-H5NTJZO4.js');var react=require('react'),jsxRuntime=require('react/jsx-runtime');var E=[{labelKey:"dialogs.pageSetup.pageSizes.letter",width:12240,height:15840},{labelKey:"dialogs.pageSetup.pageSizes.a4",width:11906,height:16838},{labelKey:"dialogs.pageSetup.pageSizes.legal",width:12240,height:20160},{labelKey:"dialogs.pageSetup.pageSizes.a3",width:16838,height:23811},{labelKey:"dialogs.pageSetup.pageSizes.a5",width:8391,height:11906},{labelKey:"dialogs.pageSetup.pageSizes.b5",width:9979,height:14175},{labelKey:"dialogs.pageSetup.pageSizes.executive",width:10440,height:15120}];function f(i){return Math.round(i/1440*100)/100}function x(i){return Math.round(i*1440)}function J(i,l){let b=Math.min(i,l),n=Math.max(i,l);return E.findIndex(a=>Math.abs(a.width-b)<20&&Math.abs(a.height-n)<20)}var O={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:8,boxShadow:"0 4px 20px rgba(0, 0, 0, 0.15)",minWidth:400,maxWidth:480,width:"100%",margin:20},V={padding:"16px 20px 12px",borderBottom:"1px solid var(--doc-border)",fontSize:16,fontWeight:600},X={padding:"16px 20px",display:"flex",flexDirection:"column",gap:14},H={fontSize:12,fontWeight:600,color:"var(--doc-text-muted)",textTransform:"uppercase",letterSpacing:"0.5px"},g={display:"flex",alignItems:"center",gap:12},c={width:80,fontSize:13,color:"var(--doc-text-muted)"},y={flex:1,padding:"6px 8px",border:"1px solid var(--doc-border)",borderRadius:4,fontSize:13},N={...y},C={fontSize:11,color:"var(--doc-text-muted)",width:16},Y={padding:"12px 20px 16px",borderTop:"1px solid var(--doc-border)",display:"flex",justifyContent:"flex-end",gap:8},A={padding:"6px 16px",fontSize:13,border:"1px solid var(--doc-border)",borderRadius:4,cursor:"pointer"},_=12240,B=15840,p=1440;function ae({isOpen:i,onClose:l,onApply:b,currentProps:n}){let{t:a}=chunkQSUPYUOP_js.b(),[u,h]=react.useState(_),[S,m]=react.useState(B),[r,K]=react.useState("portrait"),[P,M]=react.useState(p),[w,R]=react.useState(p),[z,k]=react.useState(p),[T,D]=react.useState(p);react.useEffect(()=>{if(!i)return;let e=n?.pageWidth||_,s=n?.pageHeight||B,j=n?.orientation||(e>s?"landscape":"portrait");h(e),m(s),K(j),M(n?.marginTop??p),R(n?.marginBottom??p),k(n?.marginLeft??p),D(n?.marginRight??p);},[i,n]);let F=react.useCallback(e=>{if(e<0)return;let s=E[e];r==="landscape"?(h(s.height),m(s.width)):(h(s.width),m(s.height));},[r]),G=react.useCallback(e=>{e!==r&&(K(e),h(S),m(u));},[r,u,S]),I=react.useCallback(()=>{b({pageWidth:u,pageHeight:S,orientation:r,marginTop:P,marginBottom:w,marginLeft:z,marginRight:T}),l();},[u,S,r,P,w,z,T,b,l]),U=react.useCallback(e=>{e.key==="Escape"&&l(),e.key==="Enter"&&I();},[l,I]);if(!i)return null;let W=J(u,S);return jsxRuntime.jsx("div",{style:O,onClick:l,onKeyDown:U,children:jsxRuntime.jsxs("div",{style:Q,onClick:e=>e.stopPropagation(),onMouseDown:e=>e.stopPropagation(),role:"dialog","aria-label":a("dialogs.pageSetup.title"),children:[jsxRuntime.jsx("div",{style:V,children:a("dialogs.pageSetup.title")}),jsxRuntime.jsxs("div",{style:X,children:[jsxRuntime.jsx("div",{style:H,children:a("dialogs.pageSetup.pageSize")}),jsxRuntime.jsxs("div",{style:g,children:[jsxRuntime.jsx("label",{style:c,children:a("dialogs.pageSetup.sizeLabel")}),jsxRuntime.jsxs("select",{style:N,value:W,onChange:e=>F(Number(e.target.value)),children:[E.map((e,s)=>jsxRuntime.jsx("option",{value:s,children:a(e.labelKey)},e.labelKey)),W<0&&jsxRuntime.jsx("option",{value:-1,children:a("dialogs.pageSetup.custom")})]})]}),jsxRuntime.jsxs("div",{style:g,children:[jsxRuntime.jsx("label",{style:c,children:a("dialogs.pageSetup.orientation")}),jsxRuntime.jsxs("select",{style:N,value:r,onChange:e=>G(e.target.value),children:[jsxRuntime.jsx("option",{value:"portrait",children:a("dialogs.pageSetup.portrait")}),jsxRuntime.jsx("option",{value:"landscape",children:a("dialogs.pageSetup.landscape")})]})]}),jsxRuntime.jsx("div",{style:{...H,marginTop:4},children:a("dialogs.pageSetup.margins")}),jsxRuntime.jsxs("div",{style:g,children:[jsxRuntime.jsx("label",{style:c,children:a("dialogs.pageSetup.top")}),jsxRuntime.jsx("input",{type:"number",style:y,min:0,max:10,step:.1,value:f(P),onChange:e=>M(x(Number(e.target.value)||0))}),jsxRuntime.jsx("span",{style:C,children:"in"})]}),jsxRuntime.jsxs("div",{style:g,children:[jsxRuntime.jsx("label",{style:c,children:a("dialogs.pageSetup.bottom")}),jsxRuntime.jsx("input",{type:"number",style:y,min:0,max:10,step:.1,value:f(w),onChange:e=>R(x(Number(e.target.value)||0))}),jsxRuntime.jsx("span",{style:C,children:"in"})]}),jsxRuntime.jsxs("div",{style:g,children:[jsxRuntime.jsx("label",{style:c,children:a("dialogs.pageSetup.left")}),jsxRuntime.jsx("input",{type:"number",style:y,min:0,max:10,step:.1,value:f(z),onChange:e=>k(x(Number(e.target.value)||0))}),jsxRuntime.jsx("span",{style:C,children:"in"})]}),jsxRuntime.jsxs("div",{style:g,children:[jsxRuntime.jsx("label",{style:c,children:a("dialogs.pageSetup.right")}),jsxRuntime.jsx("input",{type:"number",style:y,min:0,max:10,step:.1,value:f(T),onChange:e=>D(x(Number(e.target.value)||0))}),jsxRuntime.jsx("span",{style:C,children:"in"})]})]}),jsxRuntime.jsxs("div",{style:Y,children:[jsxRuntime.jsx("button",{type:"button",style:A,onClick:l,children:a("common.cancel")}),jsxRuntime.jsx("button",{type:"button",style:{...A,backgroundColor:"var(--doc-primary)",color:"white",borderColor:"var(--doc-primary)"},onClick:I,children:a("common.apply")})]})]})})}exports.PageSetupDialog=ae;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import {b}from'./chunk-GZOCOWWB.mjs';import'./chunk-LYBG4YI7.mjs';import'./chunk-TAUMSKRE.mjs';import {useState,useEffect,useCallback}from'react';import {jsx,jsxs}from'react/jsx-runtime';var E=[{labelKey:"dialogs.pageSetup.pageSizes.letter",width:12240,height:15840},{labelKey:"dialogs.pageSetup.pageSizes.a4",width:11906,height:16838},{labelKey:"dialogs.pageSetup.pageSizes.legal",width:12240,height:20160},{labelKey:"dialogs.pageSetup.pageSizes.a3",width:16838,height:23811},{labelKey:"dialogs.pageSetup.pageSizes.a5",width:8391,height:11906},{labelKey:"dialogs.pageSetup.pageSizes.b5",width:9979,height:14175},{labelKey:"dialogs.pageSetup.pageSizes.executive",width:10440,height:15120}];function f(i){return Math.round(i/1440*100)/100}function x(i){return Math.round(i*1440)}function J(i,l){let b=Math.min(i,l),n=Math.max(i,l);return E.findIndex(a=>Math.abs(a.width-b)<20&&Math.abs(a.height-n)<20)}var O={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:8,boxShadow:"0 4px 20px rgba(0, 0, 0, 0.15)",minWidth:400,maxWidth:480,width:"100%",margin:20},V={padding:"16px 20px 12px",borderBottom:"1px solid var(--doc-border)",fontSize:16,fontWeight:600},X={padding:"16px 20px",display:"flex",flexDirection:"column",gap:14},H={fontSize:12,fontWeight:600,color:"var(--doc-text-muted)",textTransform:"uppercase",letterSpacing:"0.5px"},g={display:"flex",alignItems:"center",gap:12},c={width:80,fontSize:13,color:"var(--doc-text-muted)"},y={flex:1,padding:"6px 8px",border:"1px solid var(--doc-border)",borderRadius:4,fontSize:13},N={...y},C={fontSize:11,color:"var(--doc-text-muted)",width:16},Y={padding:"12px 20px 16px",borderTop:"1px solid var(--doc-border)",display:"flex",justifyContent:"flex-end",gap:8},A={padding:"6px 16px",fontSize:13,border:"1px solid var(--doc-border)",borderRadius:4,cursor:"pointer"},_=12240,B=15840,p=1440;function ae({isOpen:i,onClose:l,onApply:b$1,currentProps:n}){let{t:a}=b(),[u,h]=useState(_),[S,m]=useState(B),[r,K]=useState("portrait"),[P,M]=useState(p),[w,R]=useState(p),[z,k]=useState(p),[T,D]=useState(p);useEffect(()=>{if(!i)return;let e=n?.pageWidth||_,s=n?.pageHeight||B,j=n?.orientation||(e>s?"landscape":"portrait");h(e),m(s),K(j),M(n?.marginTop??p),R(n?.marginBottom??p),k(n?.marginLeft??p),D(n?.marginRight??p);},[i,n]);let F=useCallback(e=>{if(e<0)return;let s=E[e];r==="landscape"?(h(s.height),m(s.width)):(h(s.width),m(s.height));},[r]),G=useCallback(e=>{e!==r&&(K(e),h(S),m(u));},[r,u,S]),I=useCallback(()=>{b$1({pageWidth:u,pageHeight:S,orientation:r,marginTop:P,marginBottom:w,marginLeft:z,marginRight:T}),l();},[u,S,r,P,w,z,T,b$1,l]),U=useCallback(e=>{e.key==="Escape"&&l(),e.key==="Enter"&&I();},[l,I]);if(!i)return null;let W=J(u,S);return jsx("div",{style:O,onClick:l,onKeyDown:U,children:jsxs("div",{style:Q,onClick:e=>e.stopPropagation(),onMouseDown:e=>e.stopPropagation(),role:"dialog","aria-label":a("dialogs.pageSetup.title"),children:[jsx("div",{style:V,children:a("dialogs.pageSetup.title")}),jsxs("div",{style:X,children:[jsx("div",{style:H,children:a("dialogs.pageSetup.pageSize")}),jsxs("div",{style:g,children:[jsx("label",{style:c,children:a("dialogs.pageSetup.sizeLabel")}),jsxs("select",{style:N,value:W,onChange:e=>F(Number(e.target.value)),children:[E.map((e,s)=>jsx("option",{value:s,children:a(e.labelKey)},e.labelKey)),W<0&&jsx("option",{value:-1,children:a("dialogs.pageSetup.custom")})]})]}),jsxs("div",{style:g,children:[jsx("label",{style:c,children:a("dialogs.pageSetup.orientation")}),jsxs("select",{style:N,value:r,onChange:e=>G(e.target.value),children:[jsx("option",{value:"portrait",children:a("dialogs.pageSetup.portrait")}),jsx("option",{value:"landscape",children:a("dialogs.pageSetup.landscape")})]})]}),jsx("div",{style:{...H,marginTop:4},children:a("dialogs.pageSetup.margins")}),jsxs("div",{style:g,children:[jsx("label",{style:c,children:a("dialogs.pageSetup.top")}),jsx("input",{type:"number",style:y,min:0,max:10,step:.1,value:f(P),onChange:e=>M(x(Number(e.target.value)||0))}),jsx("span",{style:C,children:"in"})]}),jsxs("div",{style:g,children:[jsx("label",{style:c,children:a("dialogs.pageSetup.bottom")}),jsx("input",{type:"number",style:y,min:0,max:10,step:.1,value:f(w),onChange:e=>R(x(Number(e.target.value)||0))}),jsx("span",{style:C,children:"in"})]}),jsxs("div",{style:g,children:[jsx("label",{style:c,children:a("dialogs.pageSetup.left")}),jsx("input",{type:"number",style:y,min:0,max:10,step:.1,value:f(z),onChange:e=>k(x(Number(e.target.value)||0))}),jsx("span",{style:C,children:"in"})]}),jsxs("div",{style:g,children:[jsx("label",{style:c,children:a("dialogs.pageSetup.right")}),jsx("input",{type:"number",style:y,min:0,max:10,step:.1,value:f(T),onChange:e=>D(x(Number(e.target.value)||0))}),jsx("span",{style:C,children:"in"})]})]}),jsxs("div",{style:Y,children:[jsx("button",{type:"button",style:A,onClick:l,children:a("common.cancel")}),jsx("button",{type:"button",style:{...A,backgroundColor:"var(--doc-primary)",color:"white",borderColor:"var(--doc-primary)"},onClick:I,children:a("common.apply")})]})]})})}export{ae as PageSetupDialog};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import {b as b$1}from'./chunk-GZOCOWWB.mjs';import'./chunk-TAUMSKRE.mjs';import {useState,useEffect,useCallback}from'react';import {jsx,jsxs}from'react/jsx-runtime';var T={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},k={backgroundColor:"white",borderRadius:8,boxShadow:"0 4px 20px rgba(0, 0, 0, 0.15)",minWidth:360,maxWidth:440,width:"100%",margin:20},j={padding:"16px 20px 12px",borderBottom:"1px solid var(--doc-border)",fontSize:16,fontWeight:600},R={padding:"16px 20px",display:"flex",flexDirection:"column",gap:12},b={display:"flex",alignItems:"center",gap:12},u={width:80,fontSize:13,color:"var(--doc-text-muted)"},P={flex:1,padding:"6px 8px",border:"1px solid var(--doc-border)",borderRadius:4,fontSize:13},x={...P},z={padding:"12px 20px 16px",borderTop:"1px solid var(--doc-border)",display:"flex",justifyContent:"flex-end",gap:8},m={padding:"6px 16px",fontSize:13,border:"1px solid var(--doc-border)",borderRadius:4,cursor:"pointer"};function I({isOpen:n,onClose:a,onApply:y,currentProps:l}){let{t:e}=b$1(),[s,g]=useState(l?.width||0),[r,f]=useState(l?.widthType||"auto"),[p,h]=useState(l?.justification||"left");useEffect(()=>{n&&(g(l?.width||0),f(l?.widthType||"auto"),h(l?.justification||"left"));},[n,l]);let d=useCallback(()=>{let t={};r==="auto"?(t.width=null,t.widthType="auto"):(t.width=s,t.widthType=r),t.justification=p,y(t),a();},[s,r,p,y,a]),w=useCallback(t=>{t.key==="Escape"&&a(),t.key==="Enter"&&d();},[a,d]);return n?jsx("div",{style:T,onClick:a,onKeyDown:w,children:jsxs("div",{style:k,onClick:t=>t.stopPropagation(),role:"dialog","aria-label":e("dialogs.tableProperties.title"),children:[jsx("div",{style:j,children:e("dialogs.tableProperties.title")}),jsxs("div",{style:R,children:[jsxs("div",{style:b,children:[jsx("label",{style:u,children:e("dialogs.tableProperties.widthType")}),jsxs("select",{style:x,value:r,onChange:t=>f(t.target.value),children:[jsx("option",{value:"auto",children:e("dialogs.tableProperties.widthTypes.auto")}),jsx("option",{value:"dxa",children:e("dialogs.tableProperties.widthTypes.fixed")}),jsx("option",{value:"pct",children:e("dialogs.tableProperties.widthTypes.percentage")})]})]}),r!=="auto"&&jsxs("div",{style:b,children:[jsx("label",{style:u,children:e("dialogs.tableProperties.widthLabel")}),jsx("input",{type:"number",style:P,min:0,step:r==="pct"?5:100,value:s,onChange:t=>g(Number(t.target.value)||0)}),jsx("span",{style:{fontSize:11,color:"var(--doc-text-muted)"},children:e(r==="pct"?"dialogs.tableProperties.units.fiftiethsPercent":"dialogs.tableProperties.units.twips")})]}),jsxs("div",{style:b,children:[jsx("label",{style:u,children:e("dialogs.tableProperties.alignmentLabel")}),jsxs("select",{style:x,value:p,onChange:t=>h(t.target.value),children:[jsx("option",{value:"left",children:e("dialogs.tableProperties.alignOptions.left")}),jsx("option",{value:"center",children:e("dialogs.tableProperties.alignOptions.center")}),jsx("option",{value:"right",children:e("dialogs.tableProperties.alignOptions.right")})]})]})]}),jsxs("div",{style:z,children:[jsx("button",{type:"button",style:m,onClick:a,children:e("common.cancel")}),jsx("button",{type:"button",style:{...m,backgroundColor:"var(--doc-primary)",color:"white",borderColor:"var(--doc-primary)"},onClick:d,children:e("common.apply")})]})]})}):null}export{I as TablePropertiesDialog};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
'use strict';var chunkQSUPYUOP_js=require('./chunk-QSUPYUOP.js');require('./chunk-H5NTJZO4.js');var react=require('react'),jsxRuntime=require('react/jsx-runtime');var T={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},k={backgroundColor:"white",borderRadius:8,boxShadow:"0 4px 20px rgba(0, 0, 0, 0.15)",minWidth:360,maxWidth:440,width:"100%",margin:20},j={padding:"16px 20px 12px",borderBottom:"1px solid var(--doc-border)",fontSize:16,fontWeight:600},R={padding:"16px 20px",display:"flex",flexDirection:"column",gap:12},b={display:"flex",alignItems:"center",gap:12},u={width:80,fontSize:13,color:"var(--doc-text-muted)"},P={flex:1,padding:"6px 8px",border:"1px solid var(--doc-border)",borderRadius:4,fontSize:13},x={...P},z={padding:"12px 20px 16px",borderTop:"1px solid var(--doc-border)",display:"flex",justifyContent:"flex-end",gap:8},m={padding:"6px 16px",fontSize:13,border:"1px solid var(--doc-border)",borderRadius:4,cursor:"pointer"};function I({isOpen:n,onClose:a,onApply:y,currentProps:l}){let{t:e}=chunkQSUPYUOP_js.b(),[s,g]=react.useState(l?.width||0),[r,f]=react.useState(l?.widthType||"auto"),[p,h]=react.useState(l?.justification||"left");react.useEffect(()=>{n&&(g(l?.width||0),f(l?.widthType||"auto"),h(l?.justification||"left"));},[n,l]);let d=react.useCallback(()=>{let t={};r==="auto"?(t.width=null,t.widthType="auto"):(t.width=s,t.widthType=r),t.justification=p,y(t),a();},[s,r,p,y,a]),w=react.useCallback(t=>{t.key==="Escape"&&a(),t.key==="Enter"&&d();},[a,d]);return n?jsxRuntime.jsx("div",{style:T,onClick:a,onKeyDown:w,children:jsxRuntime.jsxs("div",{style:k,onClick:t=>t.stopPropagation(),role:"dialog","aria-label":e("dialogs.tableProperties.title"),children:[jsxRuntime.jsx("div",{style:j,children:e("dialogs.tableProperties.title")}),jsxRuntime.jsxs("div",{style:R,children:[jsxRuntime.jsxs("div",{style:b,children:[jsxRuntime.jsx("label",{style:u,children:e("dialogs.tableProperties.widthType")}),jsxRuntime.jsxs("select",{style:x,value:r,onChange:t=>f(t.target.value),children:[jsxRuntime.jsx("option",{value:"auto",children:e("dialogs.tableProperties.widthTypes.auto")}),jsxRuntime.jsx("option",{value:"dxa",children:e("dialogs.tableProperties.widthTypes.fixed")}),jsxRuntime.jsx("option",{value:"pct",children:e("dialogs.tableProperties.widthTypes.percentage")})]})]}),r!=="auto"&&jsxRuntime.jsxs("div",{style:b,children:[jsxRuntime.jsx("label",{style:u,children:e("dialogs.tableProperties.widthLabel")}),jsxRuntime.jsx("input",{type:"number",style:P,min:0,step:r==="pct"?5:100,value:s,onChange:t=>g(Number(t.target.value)||0)}),jsxRuntime.jsx("span",{style:{fontSize:11,color:"var(--doc-text-muted)"},children:e(r==="pct"?"dialogs.tableProperties.units.fiftiethsPercent":"dialogs.tableProperties.units.twips")})]}),jsxRuntime.jsxs("div",{style:b,children:[jsxRuntime.jsx("label",{style:u,children:e("dialogs.tableProperties.alignmentLabel")}),jsxRuntime.jsxs("select",{style:x,value:p,onChange:t=>h(t.target.value),children:[jsxRuntime.jsx("option",{value:"left",children:e("dialogs.tableProperties.alignOptions.left")}),jsxRuntime.jsx("option",{value:"center",children:e("dialogs.tableProperties.alignOptions.center")}),jsxRuntime.jsx("option",{value:"right",children:e("dialogs.tableProperties.alignOptions.right")})]})]})]}),jsxRuntime.jsxs("div",{style:z,children:[jsxRuntime.jsx("button",{type:"button",style:m,onClick:a,children:e("common.cancel")}),jsxRuntime.jsx("button",{type:"button",style:{...m,backgroundColor:"var(--doc-primary)",color:"white",borderColor:"var(--doc-primary)"},onClick:d,children:e("common.apply")})]})]})}):null}exports.TablePropertiesDialog=I;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
'use strict';var chunkQSUPYUOP_js=require('./chunk-QSUPYUOP.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}=chunkQSUPYUOP_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;
|