@zeke-02/docx-editor 0.5.2 → 0.5.4
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/LICENSE +204 -0
- package/dist/FindReplaceDialog-7SQOVQWH.js +1 -0
- package/dist/FindReplaceDialog-RK3A7MSK.mjs +1 -0
- package/dist/{FootnotePropertiesDialog-XQ7NIFIU.js → FootnotePropertiesDialog-2Q2SHVMR.js} +1 -1
- package/dist/{FootnotePropertiesDialog-TNVJJCY6.mjs → FootnotePropertiesDialog-ZKQXW3YO.mjs} +1 -1
- package/dist/{HyperlinkDialog-FR4IZZ7E.mjs → HyperlinkDialog-QV3CVFQU.mjs} +1 -1
- package/dist/HyperlinkDialog-XVAF7FVN.js +1 -0
- package/dist/{ImagePositionDialog-JSZSIKF5.mjs → ImagePositionDialog-EGRH3HPP.mjs} +1 -1
- package/dist/{ImagePositionDialog-2YXRAGZS.js → ImagePositionDialog-HIVHUTBT.js} +1 -1
- package/dist/ImagePropertiesDialog-67WLFIIZ.mjs +1 -0
- package/dist/ImagePropertiesDialog-HSM3JJ22.js +1 -0
- package/dist/KeyboardShortcutsDialog-B0UFuR4w.d.ts +395 -0
- package/dist/KeyboardShortcutsDialog-t6JKL4Aj.d.mts +395 -0
- package/dist/PageSetupDialog-642IAVG2.js +1 -0
- package/dist/PageSetupDialog-ERUQDHAY.mjs +1 -0
- package/dist/PluginHost-HS31VIuo.d.mts +16 -0
- package/dist/PluginHost-zILZO7zX.d.ts +16 -0
- package/dist/{SplitCellDialog-NP3JJYHD.mjs → SplitCellDialog-GFWCFCTD.mjs} +1 -1
- package/dist/{SplitCellDialog-JIAC3RYV.js → SplitCellDialog-M7WF7ANE.js} +1 -1
- package/dist/{TablePropertiesDialog-TIK4AA5M.mjs → TablePropertiesDialog-TZ7VCL6V.mjs} +1 -1
- package/dist/{TablePropertiesDialog-T7D4HSVP.js → TablePropertiesDialog-ZKU2FTUX.js} +1 -1
- package/dist/agentApi-B2Y7kexW.d.ts +486 -0
- package/dist/agentApi-BzUJ_kao.d.mts +486 -0
- package/dist/chunk-2XXILKEQ.js +1 -0
- package/dist/chunk-35DG3R42.js +2 -0
- package/dist/chunk-5UX5CD4C.js +1 -0
- package/dist/chunk-7QQSDIWK.mjs +2 -0
- package/dist/chunk-AW5TISUL.js +3 -0
- package/dist/chunk-B45ECEGY.js +18 -0
- package/dist/chunk-B7CCL7SL.mjs +2 -0
- package/dist/chunk-BRMTZRLJ.js +2 -0
- package/dist/chunk-D47GTKGU.js +2 -0
- package/dist/chunk-F5SERL7X.mjs +2 -0
- package/dist/chunk-FWPVBFKQ.mjs +1 -0
- package/dist/chunk-GGQK26JO.js +2 -0
- package/dist/chunk-GM2S2WMT.mjs +1 -0
- package/dist/chunk-HXDMASAR.js +1 -0
- package/dist/chunk-ILYKDR3C.js +1 -0
- package/dist/chunk-JFRDFK7V.mjs +260 -0
- package/dist/chunk-JPF5R2ZM.mjs +1 -0
- package/dist/chunk-KOXCF3CL.mjs +1 -0
- package/dist/chunk-KRLNX56Y.mjs +2 -0
- package/dist/chunk-LWOHVYKW.mjs +1 -0
- package/dist/chunk-MDTA25AN.mjs +60 -0
- package/dist/chunk-MKNSJOCN.js +70 -0
- package/dist/chunk-NIBCC7WQ.js +1 -0
- package/dist/chunk-NLFXR2VH.js +2 -0
- package/dist/chunk-NOLMVQNN.mjs +40 -0
- package/dist/chunk-ONIYA2FU.mjs +2 -0
- package/dist/chunk-RCIZ7OM3.mjs +70 -0
- package/dist/chunk-SGTUE33R.js +260 -0
- package/dist/{chunk-EHFEG3TX.js → chunk-SNZ57XBI.js} +1 -1
- package/dist/chunk-SOTWG3KJ.mjs +1 -0
- package/dist/chunk-TYPGB4KF.js +1 -0
- package/dist/chunk-U7ZW2DOO.mjs +2 -0
- package/dist/chunk-WO3FIV4B.js +40 -0
- package/dist/{chunk-PKEOQIQO.mjs → chunk-WPI3YRFO.mjs} +1 -1
- package/dist/chunk-XGJ2EORY.mjs +1 -0
- package/dist/chunk-XQZTWWRF.mjs +18 -0
- package/dist/chunk-Y3SEHWZ2.js +1 -0
- package/dist/chunk-YBEVHQCT.js +60 -0
- package/dist/chunk-ZVAFVHWR.mjs +3 -0
- package/dist/chunk-ZXPCJWVY.js +2 -0
- package/dist/{agentApi-DLt94vXk.d.mts → content-REFGFfEH.d.mts} +8 -755
- package/dist/{agentApi-DLt94vXk.d.ts → content-REFGFfEH.d.ts} +8 -755
- package/dist/dialogs.d.mts +25 -0
- package/dist/dialogs.d.ts +25 -0
- package/dist/dialogs.js +1 -0
- package/dist/dialogs.mjs +1 -0
- package/dist/document-Cu2vq_wS.d.mts +294 -0
- package/dist/document-CxOagoLQ.d.ts +294 -0
- package/dist/executor-WBHID2RK.mjs +1 -0
- package/dist/executor-Y5VUOAHY.js +1 -0
- package/dist/findReplace-Bue0JaXh.d.ts +138 -0
- package/dist/findReplace-shXbOjFQ.d.mts +138 -0
- package/dist/fork.d.mts +535 -0
- package/dist/fork.d.ts +535 -0
- package/dist/fork.js +1 -0
- package/dist/fork.mjs +1 -0
- package/dist/hooks.d.mts +598 -0
- package/dist/hooks.d.ts +598 -0
- package/dist/hooks.js +1 -0
- package/dist/hooks.mjs +1 -0
- package/dist/index-B5A-J9GC.d.ts +1119 -0
- package/dist/index-bw-PaozF.d.mts +1119 -0
- package/dist/index.d.mts +12 -591
- package/dist/index.d.ts +12 -591
- package/dist/index.js +1 -120
- package/dist/index.mjs +1 -120
- package/dist/layout-bridge-5GYGYKM5.mjs +1 -0
- package/dist/layout-bridge-QQDA7ELH.js +1 -0
- package/dist/plugin-api.d.mts +165 -0
- package/dist/plugin-api.d.ts +165 -0
- package/dist/plugin-api.js +1 -0
- package/dist/plugin-api.mjs +1 -0
- package/dist/processTemplate-BTBTR7AM.js +1 -0
- package/dist/{processTemplate-W2C5PXZB.mjs → processTemplate-MBX2KDLE.mjs} +1 -1
- package/dist/styles.css +1 -1
- package/dist/styles.d.mts +18 -0
- package/dist/styles.d.ts +18 -0
- package/dist/styles.js +1 -0
- package/dist/styles.mjs +1 -0
- package/dist/types-BF48VxkC.d.mts +18 -0
- package/dist/types-BF48VxkC.d.ts +18 -0
- package/dist/types-BnIs4sE7.d.mts +281 -0
- package/dist/types-BnIs4sE7.d.ts +281 -0
- package/dist/types-CW6HFAX6.d.ts +39 -0
- package/dist/types-DIsDCwTG.d.mts +39 -0
- package/dist/ui.d.mts +111 -552
- package/dist/ui.d.ts +111 -552
- package/dist/ui.js +111 -1
- package/dist/ui.mjs +111 -1
- package/dist/useFindReplace-DKy-s3gS.d.ts +261 -0
- package/dist/useFindReplace-vuoKpDKE.d.mts +261 -0
- package/package.json +47 -49
- package/dist/ClipboardManager-CVKX0v9q.d.ts +0 -464
- package/dist/ClipboardManager-V3aaMnWE.d.mts +0 -464
- package/dist/DocumentAgent-BWflKHpH.d.mts +0 -442
- package/dist/DocumentAgent-DsdXtetF.d.ts +0 -442
- package/dist/FindReplaceDialog-L3YF5HIS.mjs +0 -1
- package/dist/FindReplaceDialog-SEBWC5P7.js +0 -1
- package/dist/HyperlinkDialog-WEK6JSAC.js +0 -1
- package/dist/ImagePropertiesDialog-527MFLQO.mjs +0 -1
- package/dist/ImagePropertiesDialog-HG4K3IE7.js +0 -1
- package/dist/PageSetupDialog-GALVJMUB.js +0 -1
- package/dist/PageSetupDialog-TGQIAMI7.mjs +0 -1
- package/dist/TableToolbar-DUgmob2I.d.ts +0 -1273
- package/dist/TableToolbar-YL74HNS1.d.mts +0 -1273
- package/dist/chunk-23SXXIZS.js +0 -111
- package/dist/chunk-3F52AP2Q.js +0 -1
- package/dist/chunk-42O5GXM5.mjs +0 -82
- package/dist/chunk-54ULJEHM.mjs +0 -1
- package/dist/chunk-5XK326FI.mjs +0 -1
- package/dist/chunk-6WPRCJ5A.mjs +0 -1
- package/dist/chunk-76IYR7C7.mjs +0 -1
- package/dist/chunk-AGRIVA4G.js +0 -1
- package/dist/chunk-BTCQ2QI3.mjs +0 -3
- package/dist/chunk-BUEMG4NW.js +0 -1
- package/dist/chunk-BXRC4U3X.mjs +0 -2
- package/dist/chunk-CPAYKE6X.mjs +0 -1
- package/dist/chunk-DACWLFKI.mjs +0 -1
- package/dist/chunk-EPBFWE36.js +0 -2
- package/dist/chunk-FXES3YDB.js +0 -82
- package/dist/chunk-HI66BSGS.mjs +0 -9
- package/dist/chunk-INTPVEO6.mjs +0 -9
- package/dist/chunk-IOAGVW6Q.mjs +0 -2
- package/dist/chunk-JCEWC5QL.mjs +0 -4
- package/dist/chunk-JTIUFACT.js +0 -1
- package/dist/chunk-LUF7PWIC.js +0 -10
- package/dist/chunk-MGEN6GOE.mjs +0 -2
- package/dist/chunk-MOE2ZGUE.js +0 -18
- package/dist/chunk-MWLHJWB6.js +0 -9
- package/dist/chunk-OFYVDN3U.mjs +0 -2
- package/dist/chunk-P4VSHBGZ.js +0 -2
- package/dist/chunk-P5FQHIES.mjs +0 -1
- package/dist/chunk-PBC7XAYZ.js +0 -3
- package/dist/chunk-PEMB6SZT.js +0 -2
- package/dist/chunk-PQMSZTBB.js +0 -9
- package/dist/chunk-Q7UDQXAF.js +0 -1
- package/dist/chunk-QGTAIC5E.js +0 -1
- package/dist/chunk-QVPR2W5S.js +0 -1
- package/dist/chunk-R3QMYPL5.mjs +0 -59
- package/dist/chunk-RBUTXXQJ.mjs +0 -18
- package/dist/chunk-RRWYZ2TS.mjs +0 -111
- package/dist/chunk-S3STEPVO.js +0 -182
- package/dist/chunk-SFUM35DH.js +0 -2
- package/dist/chunk-SNLC6EK2.js +0 -1
- package/dist/chunk-TMTLIGLZ.js +0 -59
- package/dist/chunk-TSE2PWFX.mjs +0 -10
- package/dist/chunk-UKESXQS5.mjs +0 -182
- package/dist/chunk-UWYD42WV.js +0 -4
- package/dist/chunk-UXVACQCY.mjs +0 -1
- package/dist/chunk-W4EIKDM6.mjs +0 -2
- package/dist/chunk-W53SI3XW.mjs +0 -1
- package/dist/chunk-WNS2RBQD.js +0 -2
- package/dist/chunk-Z3KMSHUP.js +0 -1
- package/dist/core-plugins-reexport.d.mts +0 -31
- package/dist/core-plugins-reexport.d.ts +0 -31
- package/dist/core-plugins-reexport.js +0 -1
- package/dist/core-plugins-reexport.mjs +0 -1
- package/dist/core-reexport.d.mts +0 -340
- package/dist/core-reexport.d.ts +0 -340
- package/dist/core-reexport.js +0 -1
- package/dist/core-reexport.mjs +0 -1
- package/dist/documentSerializer-DtS_-oGA.d.mts +0 -664
- package/dist/documentSerializer-Wj1p2ASa.d.ts +0 -664
- package/dist/executor-C3VXF7QA.mjs +0 -1
- package/dist/executor-GDBV3AGV.js +0 -1
- package/dist/headless-reexport.d.mts +0 -197
- package/dist/headless-reexport.d.ts +0 -197
- package/dist/headless-reexport.js +0 -1
- package/dist/headless-reexport.mjs +0 -1
- package/dist/insertOperations-BTH1Asas.d.mts +0 -176
- package/dist/insertOperations-CbUnXAXH.d.ts +0 -176
- package/dist/layout-bridge-EA4DJ227.js +0 -1
- package/dist/layout-bridge-XDPSO6GO.mjs +0 -1
- package/dist/mcp-reexport.d.mts +0 -156
- package/dist/mcp-reexport.d.ts +0 -156
- package/dist/mcp-reexport.js +0 -16
- package/dist/mcp-reexport.mjs +0 -16
- package/dist/processTemplate-MJ2PCSO5.js +0 -1
- package/dist/react-B0W16SV6.d.ts +0 -1330
- package/dist/react-D0Pn1nww.d.mts +0 -1330
- package/dist/react.d.mts +0 -10
- package/dist/react.d.ts +0 -10
- package/dist/react.js +0 -1
- package/dist/react.mjs +0 -1
- package/dist/registry-CH9V-IX0.d.ts +0 -165
- package/dist/registry-CWBKYlNW.d.mts +0 -165
- package/dist/types-UDsUq8D3.d.mts +0 -310
- package/dist/types-jbivc9Lj.d.ts +0 -310
- package/dist/variableDetector-CdQ7ZTzA.d.mts +0 -204
- package/dist/variableDetector-DsRV3A9z.d.ts +0 -204
- package/i18n/de.json +0 -792
- package/i18n/en.json +0 -792
- package/i18n/he.json +0 -792
- package/i18n/pl.json +0 -792
- package/i18n/pt-BR.json +0 -792
- package/i18n/tr.json +0 -792
- package/i18n/zh-CN.json +0 -792
- /package/dist/{chunk-YC5KZSYD.js → chunk-ESZ6JRTW.js} +0 -0
- /package/dist/{chunk-LVGJKS7Y.mjs → chunk-TZMMD6RR.mjs} +0 -0
- /package/dist/{react.css → fork.css} +0 -0
package/dist/ui.mjs
CHANGED
|
@@ -1 +1,111 @@
|
|
|
1
|
-
export{a as ContextMenu,U as InsertImageDialog,ca as InsertSymbolDialog,N as InsertTableDialog,pa as KeyboardShortcutsDialog,A as LoadingIndicator,ja as PasteSpecialDialog,k as PrintButton,l as PrintStyles,g as ResponsePreview,I as ResponsiveToolbar,J as ResponsiveToolbarGroup,ba as SYMBOL_CATEGORIES,t as TableInsertButtons,s as TableMergeButton,u as UnsavedIndicator,Z as calculateFitDimensions,R as clampTableConfig,z as createChangeTracker,P as createDefaultTableConfig,j as createErrorResponse,i as createMockResponse,K as createToolbarItem,L as createToolbarItems,_ as dataUrlToBlob,G as delay,aa as formatFileSize,q as formatPrintPageRange,wa as formatShortcutKeys,S as formatTableDimensions,c as getActionShortcut,f as getAllActions,va as getAllCategories,y as getAllIndicatorPositions,x as getAllIndicatorVariants,F as getAllLoadingSizes,E as getAllLoadingVariants,ma as getAllPasteOptions,ua as getCategoryLabel,ta as getCommonShortcuts,e as getDefaultActions,na as getDefaultPasteOption,o as getDefaultPrintOptions,ra as getDefaultShortcuts,Y as getImageAcceptString,$ as getImageDimensions,D as getLoadingVariantLabel,la as getPasteOption,M as getRecommendedPriority,sa as getShortcutsByCategory,X as getSupportedImageExtensions,ea as getSymbolCategories,ga as getSymbolUnicodeInfo,fa as getSymbolsByCategory,T as getTablePresets,w as getVariantLabel,d as isActionAvailable,oa as isPasteSpecialShortcut,r as isPrintSupported,W as isValidImageFile,Q as isValidTableConfig,n as openPrintWindow,p as parsePageRange,ha as searchSymbols,ia as symbolFromCodePoint,m as triggerPrint,b as useContextMenu,V as useInsertImageDialog,da as useInsertSymbolDialog,O as useInsertTableDialog,qa as useKeyboardShortcutsDialog,B as useLoading,C as useLoadingOperations,ka as usePasteSpecial,h as useResponsePreview,H as useResponsiveToolbar,v as useUnsavedChanges}from'./chunk-RRWYZ2TS.mjs';export{k as AlignmentButtons,j as ColorPicker,g as FontPicker,i as FontSizePicker,D as HorizontalRuler,n as LineSpacingPicker,l as ListButtons,o as StylePicker,r as TableBorderColorPicker,q as TableBorderPicker,s as TableBorderWidthPicker,t as TableCellFillPicker,u as TableMoreDropdown,P as TableToolbar,J as TextContextMenu,C as Toolbar,z as ToolbarButton,A as ToolbarGroup,B as ToolbarSeparator,p as ZoomControl,X as addColumn,V as addRow,m as createDefaultListState,Q as createTableContext,Y as deleteColumn,W as deleteRow,S as getCellAt,R as getColumnCount,N as getDefaultTextContextMenuItems,G as getMarginInUnits,F as getRulerDimensions,T as getTableSplitCellDialogConfig,L as getTextActionLabel,M as getTextActionShortcut,O as isTextActionAvailable,Z as mergeCells,H as parseMarginFromUnits,E as positionToMargin,_ as splitCell,U as splitTableCell,K as useTextContextMenu}from'./chunk-OFYVDN3U.mjs';import'./chunk-42O5GXM5.mjs';export{n as FindReplaceDialog,a as createDefaultFindOptions,c as createSearchPattern,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-W4EIKDM6.mjs';export{d as HyperlinkDialog,m as useHyperlinkDialog}from'./chunk-PKEOQIQO.mjs';import'./chunk-BTCQ2QI3.mjs';import'./chunk-MGEN6GOE.mjs';import'./chunk-P5FQHIES.mjs';import'./chunk-6WPRCJ5A.mjs';import'./chunk-UXVACQCY.mjs';import'./chunk-CPAYKE6X.mjs';import'./chunk-INTPVEO6.mjs';import'./chunk-54ULJEHM.mjs';import'./chunk-LVGJKS7Y.mjs';import'./chunk-TAUMSKRE.mjs';
|
|
1
|
+
import {z,F,x,c as c$1,b,a,y}from'./chunk-ZVAFVHWR.mjs';export{g as AlignmentButtons,f as ColorPicker,w as EditorToolbar,d as FontPicker,e as FontSizePicker,A as HorizontalRuler,j as LineSpacingPicker,i as ListButtons,k as StylePicker,n as TableBorderColorPicker,m as TableBorderPicker,o as TableBorderWidthPicker,p as TableCellFillPicker,q as TableMoreDropdown,G as TextContextMenu,v as Toolbar,s as ToolbarButton,t as ToolbarGroup,u as ToolbarSeparator,l as ZoomControl,h as createDefaultListState,K as getDefaultTextContextMenuItems,D as getMarginInUnits,C as getRulerDimensions,I as getTextActionLabel,J as getTextActionShortcut,L as isTextActionAvailable,E as parseMarginFromUnits,B as positionToMargin,H as useTextContextMenu}from'./chunk-ZVAFVHWR.mjs';export{g as KeyboardShortcutsDialog,a as PasteSpecialDialog,n as formatShortcutKeys,m as getAllCategories,d as getAllPasteOptions,l as getCategoryLabel,k as getCommonShortcuts,e as getDefaultPasteOption,i as getDefaultShortcuts,c as getPasteOption,j as getShortcutsByCategory,f as isPasteSpecialShortcut,h as useKeyboardShortcutsDialog,b as usePasteSpecial}from'./chunk-KRLNX56Y.mjs';export{a as FindReplaceDialog}from'./chunk-JPF5R2ZM.mjs';export{d as HyperlinkDialog,m as useHyperlinkDialog}from'./chunk-WPI3YRFO.mjs';import {a as a$1}from'./chunk-GM2S2WMT.mjs';import {b as b$1}from'./chunk-U7ZW2DOO.mjs';export{d as TableToolbar,l as addColumn,j as addRow,e as createTableContext,m as deleteColumn,k as deleteRow,g as getCellAt,f as getColumnCount,h as getTableSplitCellDialogConfig,n as mergeCells,o as splitCell,i as splitTableCell}from'./chunk-U7ZW2DOO.mjs';import'./chunk-RCIZ7OM3.mjs';export{a as createDefaultFindOptions,c as createSearchPattern,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-F5SERL7X.mjs';import {c}from'./chunk-7QQSDIWK.mjs';import'./chunk-B7CCL7SL.mjs';import'./chunk-ONIYA2FU.mjs';import'./chunk-FWPVBFKQ.mjs';import'./chunk-TZMMD6RR.mjs';import'./chunk-TAUMSKRE.mjs';import nn,{useRef,useState,useEffect,useCallback,useLayoutEffect,useMemo}from'react';import {jsxs,jsx,Fragment}from'react/jsx-runtime';var No={askAI:"contextMenu.aiActions.askAi",rewrite:"contextMenu.aiActions.rewrite",expand:"contextMenu.aiActions.expand",summarize:"contextMenu.aiActions.summarize",translate:"contextMenu.aiActions.translate",explain:"contextMenu.aiActions.explain",fixGrammar:"contextMenu.aiActions.fixGrammar",makeFormal:"contextMenu.aiActions.makeFormal",makeCasual:"contextMenu.aiActions.makeCasual",custom:"contextMenu.aiActions.custom"},zo=()=>jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[jsx("circle",{cx:"8",cy:"8",r:"7",stroke:"currentColor",strokeWidth:"1.5"}),jsx("path",{d:"M8 4v4M8 10v1",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})]}),Wo=()=>jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:jsx("path",{d:"M13 3L3 13M3 3h4v4M13 13h-4v-4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}),Yo=()=>jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:jsx("path",{d:"M8 3v10M3 8h10",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})}),Uo=()=>jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:jsx("path",{d:"M3 4h10M3 8h7M3 12h4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})}),Fo=()=>jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[jsx("path",{d:"M2 3h6M5 3v6M3 5c0 2 1 4 2 4s2-2 2-4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"}),jsx("path",{d:"M9 7l3 6M15 7l-3 6M10 11h4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})]}),Vo=()=>jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[jsx("circle",{cx:"8",cy:"8",r:"6",stroke:"currentColor",strokeWidth:"1.5"}),jsx("path",{d:"M6 6c0-1.1.9-2 2-2s2 .9 2 2c0 1.5-2 1.5-2 3",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"}),jsx("circle",{cx:"8",cy:"12",r:"0.5",fill:"currentColor"})]}),$o=()=>jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[jsx("path",{d:"M4 12l3-8 3 8M5 10h4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),jsx("path",{d:"M12 6l2 2-2 2",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]}),Go=()=>jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[jsx("rect",{x:"3",y:"3",width:"10",height:"10",rx:"1",stroke:"currentColor",strokeWidth:"1.5"}),jsx("path",{d:"M6 7h4M6 9h4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})]}),Ho=()=>jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[jsx("circle",{cx:"8",cy:"8",r:"5",stroke:"currentColor",strokeWidth:"1.5"}),jsx("path",{d:"M6 9c.5.5 1 1 2 1s1.5-.5 2-1",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"}),jsx("circle",{cx:"6",cy:"7",r:"0.5",fill:"currentColor"}),jsx("circle",{cx:"10",cy:"7",r:"0.5",fill:"currentColor"})]}),Ko=()=>jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:jsx("path",{d:"M12 4L4 12M4 4l8 8",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})});function jo(e){switch(e){case "askAI":return jsx(zo,{});case "rewrite":return jsx(Wo,{});case "expand":return jsx(Yo,{});case "summarize":return jsx(Uo,{});case "translate":return jsx(Fo,{});case "explain":return jsx(Vo,{});case "fixGrammar":return jsx($o,{});case "makeFormal":return jsx(Go,{});case "makeCasual":return jsx(Ho,{});case "custom":return jsx(Ko,{});default:return null}}var Zo=({action:e,onClick:t,isHighlighted:o,onMouseEnter:i})=>{let{t:r}=c(),n=r(No[e]),s=y(e),a=jo(e);return jsxs("button",{type:"button",className:`docx-context-menu-item ${o?"docx-context-menu-item-highlighted":""}`,onClick:t,onMouseEnter:i,title:s,role:"menuitem",style:{display:"flex",alignItems:"center",gap:"8px",width:"100%",padding:"8px 12px",border:"none",background:o?"var(--doc-primary-light)":"transparent",cursor:"pointer",fontSize:"13px",color:"var(--doc-text)",textAlign:"left"},children:[jsx("span",{style:{display:"flex",color:"var(--doc-text-muted)"},children:a}),jsx("span",{children:n})]})},Xo=({isOpen:e,onSubmit:t,onClose:o,selectedText:i})=>{let[r,n]=useState(""),s=useRef(null),{t:a}=c();useEffect(()=>{e&&s.current&&s.current.focus();},[e]);let l=p=>{p.preventDefault(),r.trim()&&(t(r.trim()),n(""));},c$1=p=>{p.key==="Escape"&&o();};return e?jsx("div",{className:"docx-custom-prompt-dialog",style:{position:"absolute",top:"100%",left:0,right:0,padding:"8px",background:"white",borderTop:"1px solid var(--doc-border)"},children:jsxs("form",{onSubmit:l,children:[jsxs("div",{style:{marginBottom:"8px",fontSize:"12px",color:"var(--doc-text-muted)"},children:['Selected: "',i.slice(0,50),i.length>50?"...":"",'"']}),jsx("input",{ref:s,type:"text",value:r,onChange:p=>n(p.target.value),onKeyDown:c$1,placeholder:a("contextMenu.customPromptPlaceholder"),style:{width:"100%",padding:"8px",border:"1px solid var(--doc-border-light)",borderRadius:"4px",fontSize:"13px"}}),jsxs("div",{style:{marginTop:"8px",display:"flex",gap:"8px",justifyContent:"flex-end"},children:[jsx("button",{type:"button",onClick:o,style:{padding:"6px 12px",border:"1px solid var(--doc-border-light)",borderRadius:"4px",background:"white",cursor:"pointer",fontSize:"12px"},children:a("common.cancel")}),jsx("button",{type:"submit",disabled:!r.trim(),style:{padding:"6px 12px",border:"none",borderRadius:"4px",background:r.trim()?"var(--doc-primary)":"var(--doc-border)",color:r.trim()?"white":"var(--doc-text-placeholder)",cursor:r.trim()?"pointer":"not-allowed",fontSize:"12px"},children:a("common.send")})]})]})}):null},Qo=({isOpen:e,position:t,selectedText:o,selectionContext:i,onAction:r,onClose:n,actions:s=z,showCustomPrompt:a=true,className:l=""})=>{let c$1=useRef(null),[p,g]=useState(0),[d,m]=useState(false),{t:x}=c(),b=a?[...s,"custom"]:s;useEffect(()=>{if(!e)return;let u=h=>{c$1.current&&!c$1.current.contains(h.target)&&n();};return document.addEventListener("mousedown",u),()=>document.removeEventListener("mousedown",u)},[e,n]),useEffect(()=>{if(!e)return;let u=h=>{switch(h.key){case "Escape":d?m(false):n();break;case "ArrowDown":h.preventDefault(),g(P=>(P+1)%b.length);break;case "ArrowUp":h.preventDefault(),g(P=>(P-1+b.length)%b.length);break;case "Enter":h.preventDefault();let I=b[p];I==="custom"?m(true):(r(I),n());break}};return document.addEventListener("keydown",u),()=>document.removeEventListener("keydown",u)},[e,p,b,r,n,d]),useEffect(()=>{e&&(g(0),m(false));},[e]);let f=useCallback(()=>{let h=b.length*36+16,I=t.x,P=t.y;return typeof window<"u"&&(I+200>window.innerWidth&&(I=window.innerWidth-200-10),P+h>window.innerHeight&&(P=window.innerHeight-h-10),I<10&&(I=10),P<10&&(P=10)),{position:"fixed",top:P,left:I,minWidth:200,background:"white",border:"1px solid var(--doc-border-light)",borderRadius:"8px",boxShadow:"0 2px 10px rgba(0, 0, 0, 0.15)",zIndex:F.contextMenu,padding:"4px 0",overflow:"hidden"}},[t,b.length]),k=u=>{u==="custom"?m(true):(r(u),n());},T=u=>{r("custom",u),n();};return !e||!o?null:jsxs("div",{ref:c$1,className:`docx-context-menu ${l}`,style:f(),role:"menu","aria-label":x("contextMenu.ariaLabel"),children:[jsxs("div",{style:{padding:"8px 12px",borderBottom:"1px solid var(--doc-border)",fontSize:"11px",color:"var(--doc-text-muted)",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:['"',o.slice(0,30),o.length>30?"...":"",'"']}),jsx("div",{role:"group",children:b.map((u,h)=>jsx(Zo,{action:u,onClick:()=>k(u),isHighlighted:h===p,onMouseEnter:()=>g(h)},u))}),a&&jsx(Xo,{isOpen:d,onSubmit:T,onClose:()=>m(false),selectedText:o})]})};function Jo(){let[e,t]=useState(false),[o,i]=useState({x:0,y:0}),[r,n]=useState(""),[s,a]=useState(),l=useCallback((p,g,d)=>{p.preventDefault(),i({x:p.clientX,y:p.clientY}),n(g),a(d),t(true);},[]),c=useCallback(()=>{t(false);},[]);return {isOpen:e,position:o,selectedText:r,selectionContext:s,openMenu:l,closeMenu:c}}function qo(e){return {rewrite:"Ctrl+Shift+R",summarize:"Ctrl+Shift+S",translate:"Ctrl+Shift+T",fixGrammar:"Ctrl+Shift+G"}[e]}function er(e,t,o){return !(!t||t.trim().length===0)}function tr(){return [...z]}function or(){return ["askAI","rewrite","expand","summarize","translate","explain","fixGrammar","makeFormal","makeCasual","custom"]}var rr=()=>jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:jsx("path",{d:"M3 8l4 4 6-8",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})}),Ve=()=>jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:jsx("path",{d:"M4 4l8 8M12 4l-8 8",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"})}),nr=()=>jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[jsx("path",{d:"M2 8a6 6 0 0111.318-2.828M14 8a6 6 0 01-11.318 2.828",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"}),jsx("path",{d:"M13 2v4h-4M3 14v-4h4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]}),ir=()=>jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:jsx("path",{d:"M11 2l3 3-9 9H2v-3l9-9z",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}),sr=()=>jsxs("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{animation:"spin 1s linear infinite"},children:[jsx("circle",{cx:"10",cy:"10",r:"8",stroke:"var(--doc-border)",strokeWidth:"2",fill:"none"}),jsx("path",{d:"M10 2a8 8 0 018 8",stroke:"var(--doc-primary)",strokeWidth:"2",strokeLinecap:"round",fill:"none"}),jsx("style",{children:`
|
|
2
|
+
@keyframes spin {
|
|
3
|
+
from { transform: rotate(0deg); }
|
|
4
|
+
to { transform: rotate(360deg); }
|
|
5
|
+
}
|
|
6
|
+
`})]});function ar(e,t){let o=[],i=e.split(/(\s+)/),r=t.split(/(\s+)/),n=0,s=0;for(;n<i.length||s<r.length;){if(n>=i.length){o.push({type:"added",text:r.slice(s).join("")});break}if(s>=r.length){o.push({type:"removed",text:i.slice(n).join("")});break}if(i[n]===r[s])o.push({type:"same",text:i[n]}),n++,s++;else {let l=r.indexOf(i[n],s),c=i.indexOf(r[s],n);l===-1&&c===-1?(o.push({type:"removed",text:i[n]}),o.push({type:"added",text:r[s]}),n++,s++):c!==-1&&(l===-1||c-n<=l-s)?(o.push({type:"added",text:r[s]}),s++):(o.push({type:"removed",text:i[n]}),n++);}}let a=[];for(let l of o)a.length>0&&a[a.length-1].type===l.type?a[a.length-1].text+=l.text:a.push(l);return a}var lr=({original:e,modified:t})=>{let o=ar(e,t);return jsx("div",{className:"docx-response-diff",style:{lineHeight:1.6,fontSize:"14px"},children:o.map((i,r)=>{let n={};switch(i.type){case "removed":n={textDecoration:"line-through",color:"#d32f2f",backgroundColor:"#ffebee"};break;case "added":n={color:"#2e7d32",backgroundColor:"#e8f5e9"};break;}return jsx("span",{style:n,children:i.text},r)})})},cr=({originalText:e,response:t,action:o,isLoading:i,error:r,onAccept:n,onReject:s,onRetry:a,allowEdit:l=true,showDiff:c$1=true,className:p="",position:g})=>{let{t:d}=c(),[m,x$1]=useState(false),[b,f]=useState(""),k=useRef(null),T=useRef(null),u=t?.newText||"";useEffect(()=>{u&&f(u);},[u]),useEffect(()=>{m&&k.current&&(k.current.focus(),k.current.select());},[m]),useEffect(()=>{let R=E=>{E.key==="Escape"?m?(x$1(false),f(u)):s():E.key==="Enter"&&(E.metaKey||E.ctrlKey)&&(E.preventDefault(),h());};return document.addEventListener("keydown",R),()=>document.removeEventListener("keydown",R)},[m,u,s]);let h=useCallback(()=>{n(m?b:u);},[m,b,u,n]),I=useCallback(()=>{x$1(true);},[]),P=useCallback(()=>{x$1(false),f(u);},[u]),_={position:g?"fixed":"relative",...g&&{left:g.x,top:g.y},width:"400px",maxWidth:"90vw",maxHeight:"80vh",background:"white",border:"1px solid var(--doc-border-light)",borderRadius:"8px",boxShadow:"0 4px 20px rgba(0, 0, 0, 0.15)",zIndex:1e4,overflow:"hidden",display:"flex",flexDirection:"column"};return i?jsx("div",{ref:T,className:`docx-response-preview docx-response-preview-loading ${p}`,style:_,children:jsxs("div",{style:{padding:"24px",display:"flex",flexDirection:"column",alignItems:"center",gap:"16px"},children:[jsx(sr,{}),jsx("div",{style:{color:"var(--doc-text-muted)",fontSize:"14px"},children:d("responsePreview.loading",{action:x(o)})})]})}):r?jsx("div",{ref:T,className:`docx-response-preview docx-response-preview-error ${p}`,style:_,children:jsxs("div",{style:{padding:"16px"},children:[jsx("div",{style:{padding:"12px",background:"var(--doc-error-bg)",borderRadius:"4px",color:"var(--doc-error)",fontSize:"13px",marginBottom:"16px"},children:r}),jsxs("div",{style:{display:"flex",gap:"8px",justifyContent:"flex-end"},children:[a&&jsxs("button",{type:"button",onClick:a,style:{display:"flex",alignItems:"center",gap:"4px",padding:"8px 16px",border:"1px solid var(--doc-border-light)",borderRadius:"4px",background:"white",cursor:"pointer",fontSize:"13px"},children:[jsx(nr,{}),d("common.retry")]}),jsx("button",{type:"button",onClick:s,style:{padding:"8px 16px",border:"none",borderRadius:"4px",background:"var(--doc-border)",cursor:"pointer",fontSize:"13px"},children:d("common.close")})]})]})}):!t||!u?null:jsxs("div",{ref:T,className:`docx-response-preview ${p}`,style:_,children:[jsxs("div",{style:{padding:"12px 16px",borderBottom:"1px solid var(--doc-border)",display:"flex",justifyContent:"space-between",alignItems:"center"},children:[jsx("div",{style:{fontWeight:500,fontSize:"14px",color:"var(--doc-text)"},children:d("responsePreview.result",{action:x(o)})}),jsx("button",{type:"button",onClick:s,style:{display:"flex",padding:"4px",border:"none",background:"transparent",cursor:"pointer",color:"var(--doc-text-muted)"},title:d("responsePreview.closeEsc"),children:jsx(Ve,{})})]}),jsxs("div",{style:{padding:"16px",overflowY:"auto",flex:1},children:[m?jsxs("div",{children:[jsx("div",{style:{marginBottom:"8px",fontSize:"12px",color:"var(--doc-text-muted)"},children:d("responsePreview.editPrompt")}),jsx("textarea",{ref:k,value:b,onChange:R=>f(R.target.value),style:{width:"100%",minHeight:"120px",padding:"12px",border:"1px solid var(--doc-primary)",borderRadius:"4px",fontSize:"14px",lineHeight:1.6,resize:"vertical",fontFamily:"inherit"}})]}):c$1?jsxs("div",{children:[jsx("div",{style:{marginBottom:"8px",fontSize:"12px",color:"var(--doc-text-muted)"},children:d("responsePreview.changes")}),jsx(lr,{original:e,modified:u})]}):jsxs("div",{children:[jsx("div",{style:{marginBottom:"8px",fontSize:"12px",color:"var(--doc-text-muted)"},children:d("responsePreview.original")}),jsx("div",{style:{padding:"8px 12px",background:"var(--doc-bg-subtle)",borderRadius:"4px",marginBottom:"16px",textDecoration:"line-through",color:"var(--doc-text-placeholder)",fontSize:"13px"},children:e}),jsx("div",{style:{marginBottom:"8px",fontSize:"12px",color:"var(--doc-text-muted)"},children:d("responsePreview.new")}),jsx("div",{style:{padding:"8px 12px",background:"#e8f5e9",borderRadius:"4px",color:"#2e7d32",fontSize:"13px"},children:u})]}),t.warnings&&t.warnings.length>0&&jsx("div",{style:{marginTop:"16px",padding:"8px 12px",background:"var(--doc-warning-bg)",borderRadius:"4px",fontSize:"12px",color:"var(--doc-warning)"},children:t.warnings.map((R,E)=>jsx("div",{children:R},E))})]}),jsxs("div",{style:{padding:"12px 16px",borderTop:"1px solid var(--doc-border)",display:"flex",justifyContent:"space-between",alignItems:"center"},children:[jsxs("div",{children:[l&&!m&&jsxs("button",{type:"button",onClick:I,style:{display:"flex",alignItems:"center",gap:"4px",padding:"6px 12px",border:"1px solid var(--doc-border-light)",borderRadius:"4px",background:"white",cursor:"pointer",fontSize:"12px",color:"var(--doc-text-muted)"},children:[jsx(ir,{}),d("common.edit")]}),m&&jsx("button",{type:"button",onClick:P,style:{padding:"6px 12px",border:"1px solid var(--doc-border-light)",borderRadius:"4px",background:"white",cursor:"pointer",fontSize:"12px",color:"var(--doc-text-muted)"},children:d("responsePreview.cancelEdit")})]}),jsxs("div",{style:{display:"flex",gap:"8px"},children:[jsxs("button",{type:"button",onClick:s,style:{display:"flex",alignItems:"center",gap:"4px",padding:"8px 16px",border:"1px solid var(--doc-border-light)",borderRadius:"4px",background:"white",cursor:"pointer",fontSize:"13px",color:"var(--doc-text-muted)"},children:[jsx(Ve,{}),d("common.reject")]}),jsxs("button",{type:"button",onClick:h,style:{display:"flex",alignItems:"center",gap:"4px",padding:"8px 16px",border:"none",borderRadius:"4px",background:"var(--doc-primary)",cursor:"pointer",fontSize:"13px",color:"white"},children:[jsx(rr,{}),d("common.accept")]})]})]})]})};function dr(){let[e,t]=useState({isVisible:false,originalText:"",response:null,action:"rewrite",isLoading:false}),o=useCallback((s,a,l)=>{t({isVisible:true,originalText:s,response:null,action:a,isLoading:true,position:l});},[]),i=useCallback(s=>{t(a=>({...a,response:s,isLoading:false}));},[]),r=useCallback(s=>{t(a=>({...a,error:s,isLoading:false}));},[]),n=useCallback(()=>{t(s=>({...s,isVisible:false}));},[]);return {state:e,showPreview:o,setResponse:i,setError:r,hidePreview:n}}function pr(e,t){return {success:true,newText:e,warnings:t}}function ur(e){return {success:false,error:e}}var gr={includeHeaders:true,includeFooters:true,includePageNumbers:true,pageRange:null,scale:1,printBackground:true,margins:"default"};function mr({onPrint:e,disabled:t=false,label:o,className:i="",style:r,showIcon:n=true,compact:s=false}){let{t:a}=c(),l=o??a("print.label"),c$1={display:"flex",alignItems:"center",gap:s?"4px":"6px",padding:s?"4px 8px":"6px 12px",fontSize:s?"13px":"14px",backgroundColor:"white",border:"1px solid var(--doc-border)",borderRadius:"4px",cursor:t?"not-allowed":"pointer",color:t?"var(--doc-text-muted)":"var(--doc-text)",opacity:t?.6:1,transition:"background-color 0.15s, border-color 0.15s",...r};return jsxs("button",{className:`docx-print-button ${i}`.trim(),style:c$1,onClick:e,disabled:t,"aria-label":l,title:l,children:[n&&jsx(xr,{size:s?14:16}),!s&&jsx("span",{children:l})]})}function br(){return jsx("style",{children:`
|
|
7
|
+
@media print {
|
|
8
|
+
/* Hide everything except print content */
|
|
9
|
+
body * {
|
|
10
|
+
visibility: hidden;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
.docx-print-pages,
|
|
14
|
+
.docx-print-pages * {
|
|
15
|
+
visibility: visible;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.docx-print-pages {
|
|
19
|
+
position: absolute;
|
|
20
|
+
left: 0;
|
|
21
|
+
top: 0;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
/* Remove shadows and margins in print */
|
|
25
|
+
.docx-print-page {
|
|
26
|
+
box-shadow: none !important;
|
|
27
|
+
margin: 0 !important;
|
|
28
|
+
page-break-after: always;
|
|
29
|
+
page-break-inside: avoid;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
/* Ensure images print */
|
|
33
|
+
img {
|
|
34
|
+
max-width: 100%;
|
|
35
|
+
page-break-inside: avoid;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
/* Ensure tables don't break badly */
|
|
39
|
+
table {
|
|
40
|
+
page-break-inside: avoid;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
tr {
|
|
44
|
+
page-break-inside: avoid;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
/* Keep headings with content */
|
|
48
|
+
h1, h2, h3, h4, h5, h6 {
|
|
49
|
+
page-break-after: avoid;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
/* Avoid orphan lines */
|
|
53
|
+
p {
|
|
54
|
+
orphans: 3;
|
|
55
|
+
widows: 3;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
@page {
|
|
60
|
+
margin: 0;
|
|
61
|
+
size: auto;
|
|
62
|
+
}
|
|
63
|
+
`})}function xr({size:e=18}){return jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[jsx("polyline",{points:"6 9 6 2 18 2 18 9"}),jsx("path",{d:"M6 18H4a2 2 0 0 1-2-2v-5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v5a2 2 0 0 1-2 2h-2"}),jsx("rect",{x:"6",y:"14",width:"12",height:"8"})]})}function fr(){window.print();}function vr(e="Document",t){let o=window.open("","_blank");return o?(o.document.write(`
|
|
64
|
+
<!DOCTYPE html>
|
|
65
|
+
<html>
|
|
66
|
+
<head>
|
|
67
|
+
<title>${e}</title>
|
|
68
|
+
<style>
|
|
69
|
+
@media print {
|
|
70
|
+
body {
|
|
71
|
+
margin: 0;
|
|
72
|
+
padding: 0;
|
|
73
|
+
}
|
|
74
|
+
@page {
|
|
75
|
+
margin: 0;
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
</style>
|
|
79
|
+
</head>
|
|
80
|
+
<body>
|
|
81
|
+
${t}
|
|
82
|
+
</body>
|
|
83
|
+
</html>
|
|
84
|
+
`),o.document.close(),o):null}function yr(){return {...gr}}function hr(e,t){if(!e||!e.trim())return null;let o=e.trim();if(/^\d+$/.test(o)){let r=parseInt(o,10);return r>=1&&r<=t?{start:r,end:r}:null}let i=o.match(/^(\d+)-(\d+)$/);if(i){let r=parseInt(i[1],10),n=parseInt(i[2],10);return r>=1&&n<=t&&r<=n?{start:r,end:n}:null}return null}function Sr(e,t){return e?e.start===e.end?`Page ${e.start}`:`Pages ${e.start}-${e.end}`:`All (${t} pages)`}function wr(){return typeof window<"u"&&typeof window.print=="function"}function Cr({onAction:e,disabled:t=false,canMerge:o=false,canSplit:i=false}){let{t:r}=c(),n=useCallback(p=>{p.preventDefault(),p.stopPropagation();},[]),s=useCallback(()=>{o&&e("mergeCells");},[e,o]),a$1=useCallback(()=>{i&&e("splitCell");},[e,i]),l=jsx(c$1,{content:r("table.mergeCells"),children:jsx(b,{variant:"ghost",size:"icon-sm",className:a("text-slate-500 hover:text-slate-900 hover:bg-slate-100/80",(t||!o)&&"opacity-30 cursor-not-allowed"),onMouseDown:n,onClick:s,disabled:t||!o,"aria-label":r("table.mergeCells"),"data-testid":"toolbar-table-merge",children:jsx(b$1,{name:"call_merge",size:20})})}),c$2=jsx(c$1,{content:r("table.splitCell"),children:jsx(b,{variant:"ghost",size:"icon-sm",className:a("text-slate-500 hover:text-slate-900 hover:bg-slate-100/80",(t||!i)&&"opacity-30 cursor-not-allowed"),onMouseDown:n,onClick:a$1,disabled:t||!i,"aria-label":r("table.splitCell"),"data-testid":"toolbar-table-split",children:jsx(b$1,{name:"call_split",size:20})})});return jsxs(Fragment,{children:[l,c$2]})}var Pr=[{action:"addRowAbove",icon:"keyboard_arrow_up",labelKey:"table.insertRowAbove",testId:"toolbar-table-add-row-above"},{action:"addRowBelow",icon:"keyboard_arrow_down",labelKey:"table.insertRowBelow",testId:"toolbar-table-add-row-below"},{action:"addColumnLeft",icon:"keyboard_arrow_left",labelKey:"table.insertColumnLeft",testId:"toolbar-table-add-col-left"},{action:"addColumnRight",icon:"keyboard_arrow_right",labelKey:"table.insertColumnRight",testId:"toolbar-table-add-col-right"}];function Lr({onAction:e,disabled:t=false}){let{t:o}=c(),i=useCallback(r=>{r.preventDefault(),r.stopPropagation();},[]);return jsx(Fragment,{children:Pr.map(({action:r,icon:n,labelKey:s,testId:a$1})=>{let l=o(s);return jsx(c$1,{content:l,children:jsx(b,{variant:"ghost",size:"icon-sm",className:a("text-slate-500 hover:text-slate-900 hover:bg-slate-100/80",t&&"opacity-30 cursor-not-allowed"),onMouseDown:i,onClick:()=>!t&&e(r),disabled:t,"aria-label":l,"data-testid":a$1,children:jsx(b$1,{name:n,size:20})})},typeof r=="string"?r:r.type)})})}var Er="var(--doc-error)",Dr="var(--doc-success)",Ar=({size:e=16})=>jsxs("svg",{width:e,height:e,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[jsx("path",{d:"M3 2h8l2 2v9a1 1 0 01-1 1H3a1 1 0 01-1-1V3a1 1 0 011-1z",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),jsx("path",{d:"M5 2v4h5V2",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),jsx("path",{d:"M5 14v-4h6v4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]}),Mr=({size:e=16})=>jsxs("svg",{width:e,height:e,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[jsx("circle",{cx:"8",cy:"8",r:"6",stroke:"currentColor",strokeWidth:"1.5"}),jsx("path",{d:"M8 5v4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"}),jsx("circle",{cx:"8",cy:"11",r:"0.5",fill:"currentColor"})]}),Or=`
|
|
85
|
+
@keyframes docx-unsaved-pulse {
|
|
86
|
+
0%, 100% { opacity: 1; }
|
|
87
|
+
50% { opacity: 0.6; }
|
|
88
|
+
}
|
|
89
|
+
`,_r=(e,t,o,i,r,n,s)=>{let a={display:"inline-flex",alignItems:"center",justifyContent:"center",transition:"all 0.2s ease",animation:o&&i?"docx-unsaved-pulse 2s ease-in-out infinite":"none"};switch(t==="absolute-top-right"?(a.position="absolute",a.top="4px",a.right="4px"):t==="absolute-top-left"&&(a.position="absolute",a.top="4px",a.left="4px"),e){case "dot":return {...a,width:`${s}px`,height:`${s}px`,borderRadius:"50%",backgroundColor:o?r:n};case "badge":return {...a,padding:"2px 8px",borderRadius:"10px",fontSize:"11px",fontWeight:500,backgroundColor:o?r:n,color:"white"};case "text":return {...a,fontSize:"12px",color:o?r:n,fontWeight:500};case "icon":return {...a,color:o?r:n};default:return a}},Br=({hasUnsavedChanges:e,variant:t="dot",position:o="inline",showPulse:i=true,label:r,savedLabel:n,showWhenSaved:s=false,unsavedColor:a=Er,savedColor:l=Dr,size:c$1=8,className:p="",style:g,onClick:d,title:m})=>{let{t:x}=c(),b=r??x("unsaved.unsaved"),f=n??x("unsaved.saved");if(useEffect(()=>{if(!i||!e)return;let I="docx-unsaved-pulse-keyframes";if(!document.getElementById(I)){let P=document.createElement("style");P.id=I,P.textContent=Or,document.head.appendChild(P);}},[i,e]),!e&&!s)return null;let T={..._r(t,o,e,i,a,l,c$1),...g,cursor:d?"pointer":void 0},u=x(e?"unsaved.unsavedTitle":"unsaved.savedTitle"),h=()=>{switch(t){case "dot":return null;case "badge":return e?b:f;case "text":return e?b:f;case "icon":return e?jsx(Mr,{size:c$1}):jsx(Ar,{size:c$1});default:return null}};return jsx("span",{className:`docx-unsaved-indicator docx-unsaved-indicator-${t} ${e?"docx-unsaved":"docx-saved"} ${p}`,style:T,onClick:d,title:m??u,role:d?"button":"status","aria-label":x(e?"unsaved.unsavedAriaLabel":"unsaved.savedAriaLabel"),children:h()})};function Nr(e={}){let{t}=c(),{document:o,warnBeforeLeave:i=true,warningMessage:r=t("errors.unsavedChanges"),enabled:n=true,onChangeStatusChange:s}=e,[a,l]=useState(false),[c$1,p]=useState(0),[g,d]=useState(null),m=useRef(null),x=useRef(false),b=useCallback(u=>{if(!u)return null;try{return JSON.stringify(u.package)}catch{return null}},[]),f=useCallback(()=>{n&&(l(false),p(0),d(o??null),m.current=b(o));},[n,o,b]),k=useCallback(()=>{n&&(a||(l(true),s?.(true)),p(u=>u+1));},[n,a,s]),T=useCallback(u=>{let h=u!==void 0?u:o;l(false),p(0),d(h??null),m.current=b(h),x.current=true;},[o,b]);return useEffect(()=>{!n||!o||x.current||T(o);},[n,o,T]),useEffect(()=>{if(!n||!o||!x.current)return;let u=b(o),h=m.current;if(u!==h){let I=b(g);u!==I?(a||(l(true),s?.(true)),p(P=>P+1)):a&&(l(false),s?.(false)),m.current=u;}},[n,o,g,a,b,s]),useEffect(()=>{if(!n||!i||!a)return;let u=h=>(h.preventDefault(),h.returnValue=r,r);return window.addEventListener("beforeunload",u),()=>window.removeEventListener("beforeunload",u)},[n,i,a,r]),{hasUnsavedChanges:a,markAsSaved:f,markAsChanged:k,resetTracking:T,lastSavedDocument:g,changeCount:c$1}}function zr(e){return {dot:"Dot",badge:"Badge",text:"Text",icon:"Icon"}[e]}function Wr(){return ["dot","badge","text","icon"]}function Yr(){return ["inline","absolute-top-right","absolute-top-left"]}function Ur(){let e=0,t=null,o=false;return {markChanged:()=>{e++,o=true;},markSaved:()=>{o=false,t=new Date;},getState:()=>({changeCount:e,lastSaveTime:t,hasUnsavedChanges:o}),reset:()=>{e=0,t=null,o=false;}}}var Fr={small:{size:16,strokeWidth:2,fontSize:11},medium:{size:32,strokeWidth:3,fontSize:13},large:{size:48,strokeWidth:4,fontSize:14}},Vr="var(--doc-primary)",$r=300,Gr=`
|
|
90
|
+
@keyframes docx-loading-spin {
|
|
91
|
+
0% { transform: rotate(0deg); }
|
|
92
|
+
100% { transform: rotate(360deg); }
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
@keyframes docx-loading-pulse {
|
|
96
|
+
0%, 100% { opacity: 1; transform: scale(1); }
|
|
97
|
+
50% { opacity: 0.5; transform: scale(0.95); }
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
@keyframes docx-loading-dots {
|
|
101
|
+
0%, 80%, 100% { transform: scale(0); opacity: 0.5; }
|
|
102
|
+
40% { transform: scale(1); opacity: 1; }
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
@keyframes docx-loading-bar {
|
|
106
|
+
0% { left: -35%; right: 100%; }
|
|
107
|
+
60% { left: 100%; right: -90%; }
|
|
108
|
+
100% { left: 100%; right: -90%; }
|
|
109
|
+
}
|
|
110
|
+
`,Hr=({size:e,strokeWidth:t,color:o})=>{let i=(e-t)/2,r=i*2*Math.PI;return jsxs("svg",{width:e,height:e,viewBox:`0 0 ${e} ${e}`,style:{animation:"docx-loading-spin 1s linear infinite"},children:[jsx("circle",{cx:e/2,cy:e/2,r:i,fill:"none",stroke:o,strokeWidth:t,strokeLinecap:"round",strokeDasharray:`${r*.75} ${r}`,opacity:.25}),jsx("circle",{cx:e/2,cy:e/2,r:i,fill:"none",stroke:o,strokeWidth:t,strokeLinecap:"round",strokeDasharray:`${r*.25} ${r}`,transform:`rotate(-90 ${e/2} ${e/2})`})]})},Kr=({size:e,color:t})=>{let o=e/4,i=o/2;return jsx("div",{style:{display:"flex",gap:`${i}px`},children:[0,1,2].map(r=>jsx("div",{style:{width:o,height:o,borderRadius:"50%",backgroundColor:t,animation:`docx-loading-dots 1.4s ease-in-out ${r*.16}s infinite both`}},r))})},jr=({size:e,color:t})=>jsx("div",{style:{width:e*3,height:e/4,backgroundColor:`${t}20`,borderRadius:e/8,overflow:"hidden",position:"relative"},children:jsx("div",{style:{position:"absolute",top:0,bottom:0,left:0,right:0,backgroundColor:t,borderRadius:e/8,animation:"docx-loading-bar 2.1s cubic-bezier(0.65, 0.815, 0.735, 0.395) infinite"}})}),Zr=({size:e,color:t})=>jsx("div",{style:{width:e,height:e,borderRadius:"50%",backgroundColor:t,animation:"docx-loading-pulse 1.5s ease-in-out infinite"}}),Xr=({size:e,color:t,progress:o,showText:i,fontSize:r})=>{let n=Math.max(0,Math.min(100,o));return jsxs("div",{style:{width:e*3,height:e/4,backgroundColor:`${t}20`,borderRadius:e/8,overflow:"hidden",position:"relative"},children:[jsx("div",{style:{position:"absolute",top:0,bottom:0,left:0,width:`${n}%`,backgroundColor:t,borderRadius:e/8,transition:"width 0.3s ease"}}),i&&jsxs("div",{style:{position:"absolute",top:0,left:0,right:0,bottom:0,display:"flex",alignItems:"center",justifyContent:"center",fontSize:r,fontWeight:500,color:n>50?"#fff":t},children:[Math.round(n),"%"]})]})},Qr=({isLoading:e,variant:t="spinner",size:o="medium",message:i,overlay:r=false,overlayOpacity:n=.5,progress:s=0,showProgressText:a=true,color:l=Vr,className:c$1="",style:p})=>{let{t:g}=c(),d=Fr[o];if(useEffect(()=>{let b="docx-loading-keyframes";if(!document.getElementById(b)){let f=document.createElement("style");f.id=b,f.textContent=Gr,document.head.appendChild(f);}},[]),!e)return null;let m=()=>{switch(t){case "spinner":return jsx(Hr,{size:d.size,strokeWidth:d.strokeWidth,color:l});case "dots":return jsx(Kr,{size:d.size,color:l});case "bar":return jsx(jr,{size:d.size,color:l});case "pulse":return jsx(Zr,{size:d.size,color:l});case "progress":return jsx(Xr,{size:d.size,color:l,progress:s,showText:a,fontSize:d.fontSize});default:return null}},x=jsxs("div",{className:`docx-loading-content ${c$1}`,style:{display:"flex",flexDirection:"column",alignItems:"center",gap:"12px",...p},children:[m(),i&&jsx("div",{style:{fontSize:d.fontSize,color:r?"white":"var(--doc-text-muted)",textAlign:"center"},children:i})]});return r?jsx("div",{className:`docx-loading-overlay ${c$1}`,style:{position:"fixed",top:0,left:0,right:0,bottom:0,display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:`rgba(0, 0, 0, ${n})`,zIndex:1e4,...p},role:"progressbar","aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":t==="progress"?s:void 0,"aria-busy":"true","aria-label":i||g("loading.label"),children:x}):jsx("div",{className:`docx-loading-inline ${c$1}`,style:{display:"inline-flex",alignItems:"center",...p},role:"progressbar","aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":t==="progress"?s:void 0,"aria-busy":"true","aria-label":i||"Loading",children:x})};function Jr(e={}){let{initialLoading:t=false,minDuration:o=$r,onStart:i,onEnd:r}=e,[n,s]=useState(t),[a,l]=useState(null),[c,p]=useState(0),g=useRef(null),d=useRef(null),m=useCallback(f=>{g.current=Date.now(),s(true),l(f||null),p(0),i?.();},[i]),x=useCallback(()=>{let f=g.current,k=Date.now(),T=f?k-f:0,u=Math.max(0,o-T);u>0?d.current=setTimeout(()=>{s(false),l(null),p(0),g.current=null,r?.();},u):(s(false),l(null),p(0),g.current=null,r?.());},[o,r]),b=useCallback(async(f,k)=>{m(k);try{let T=await f();return x(),T}catch(T){throw x(),T}},[m,x]);return useEffect(()=>()=>{d.current&&clearTimeout(d.current);},[]),{isLoading:n,message:a,progress:c,startLoading:m,stopLoading:x,setProgress:p,setMessage:l,withLoading:b}}function qr(){let[e,t]=useState(new Map),o=useCallback((a,l)=>{t(c=>{let p=new Map(c);return p.set(a,{id:a,message:l,startTime:Date.now()}),p});},[]),i=useCallback((a,l)=>{t(c=>{let p=c.get(a);if(!p)return c;let g=new Map(c);return g.set(a,{...p,...l}),g});},[]),r=useCallback(a=>{t(l=>{let c=new Map(l);return c.delete(a),c});},[]),n=e.size>0;return {operations:Array.from(e.values()),isAnyLoading:n,startOperation:o,updateOperation:i,endOperation:r,getOperation:a=>e.get(a)}}function en(e){return {spinner:"Spinner",dots:"Dots",bar:"Bar",pulse:"Pulse",progress:"Progress"}[e]}function tn(){return ["spinner","dots","bar","pulse","progress"]}function on(){return ["small","medium","large"]}function rn(e){return new Promise(t=>setTimeout(t,e))}var Xe=4,Qe=36,ln=32,cn=()=>jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[jsx("circle",{cx:"3",cy:"8",r:"1.5",fill:"currentColor"}),jsx("circle",{cx:"8",cy:"8",r:"1.5",fill:"currentColor"}),jsx("circle",{cx:"13",cy:"8",r:"1.5",fill:"currentColor"})]});function Je(e){let{containerRef:t,items:o,itemGap:i=Xe,overflowButtonWidth:r=Qe}=e,[n,s]=useState(o.length),a=useRef(new Map),l=useCallback(()=>{let g=t.current;if(!g){s(o.length);return}let d=g.offsetWidth;if(d===0)return;let m=[...o].sort((f,k)=>f.alwaysVisible&&!k.alwaysVisible?-1:!f.alwaysVisible&&k.alwaysVisible?1:(f.priority||3)-(k.priority||3)),x=0,b=0;for(let f of m){let T=(f.minWidth||a.current.get(f.id)||ln)+(b>0?i:0),u=b<o.length-1?r+i:0;if(x+T+u<=d)x+=T,b++;else if(f.alwaysVisible)x+=T,b++;else break}s(Math.max(0,b));},[t,o,i,r]);useLayoutEffect(()=>{let g=t.current;if(!g)return;l();let d=new ResizeObserver(()=>{l();});return d.observe(g),()=>{d.disconnect();}},[t,l]),useEffect(()=>{l();},[o,l]);let{visibleItems:c,overflowItems:p}=useMemo(()=>{let g=[...o].sort((d,m)=>d.alwaysVisible&&!m.alwaysVisible?-1:!d.alwaysVisible&&m.alwaysVisible?1:(d.priority||3)-(m.priority||3));return {visibleItems:g.slice(0,n),overflowItems:g.slice(n)}},[o,n]);return {visibleItems:c,overflowItems:p,hasOverflow:p.length>0,recalculate:l}}var dn=({items:e,isOpen:t,onClose:o,anchorRef:i})=>{let r=useRef(null);return useEffect(()=>{if(!t)return;let n=s=>{r.current&&!r.current.contains(s.target)&&i.current&&!i.current.contains(s.target)&&o();};return document.addEventListener("mousedown",n),()=>document.removeEventListener("mousedown",n)},[t,o,i]),useEffect(()=>{if(!t)return;let n=s=>{s.key==="Escape"&&o();};return document.addEventListener("keydown",n),()=>document.removeEventListener("keydown",n)},[t,o]),!t||e.length===0?null:jsx("div",{ref:r,className:"docx-responsive-toolbar-overflow-menu",style:{position:"absolute",top:"100%",right:0,marginTop:"4px",backgroundColor:"white",border:"1px solid var(--doc-border)",borderRadius:"8px",boxShadow:"0 4px 12px rgba(0, 0, 0, 0.15)",padding:"8px",zIndex:1e3,display:"flex",flexWrap:"wrap",gap:"4px",maxWidth:"300px"},role:"menu",children:e.map(n=>jsx("div",{className:"docx-responsive-toolbar-overflow-item",role:"menuitem",children:n.content},n.id))})},pn=({items:e,overflowItems:t=[],alwaysShowOverflow:o=false,renderOverflowButton:i,renderOverflowMenu:r,itemGap:n=Xe,padding:s="8px 12px",overflowButtonWidth:a=Qe,className:l="",style:c,height:p=44,backgroundColor:g="var(--doc-toolbar-bg)",borderBottom:d="1px solid var(--doc-border)"})=>{let m=useRef(null),x=useRef(null),[b,f]=useState(false),{visibleItems:k,overflowItems:T,hasOverflow:u}=Je({containerRef:m,items:e,itemGap:n,overflowButtonWidth:a}),h=[...T,...t],I=u||o||t.length>0,P=useCallback(()=>{f(E=>!E);},[]),_=useCallback(()=>{f(false);},[]),R=jsx("button",{ref:x,type:"button",className:"docx-responsive-toolbar-overflow-button",onClick:P,"aria-label":`Show ${h.length} more options`,"aria-expanded":b,"aria-haspopup":"menu",style:{display:"flex",alignItems:"center",justifyContent:"center",width:`${a}px`,height:"32px",border:"none",borderRadius:"4px",backgroundColor:b?"var(--doc-primary-light)":"transparent",color:"var(--doc-text-muted)",cursor:"pointer",transition:"background-color 0.15s ease"},children:jsx(cn,{})});return jsxs("div",{ref:m,className:`docx-responsive-toolbar ${l}`,style:{display:"flex",alignItems:"center",gap:`${n}px`,height:typeof p=="number"?`${p}px`:p,padding:s,backgroundColor:g,borderBottom:d,position:"relative",...c},children:[k.map(E=>jsxs(nn.Fragment,{children:[jsx("div",{className:"docx-responsive-toolbar-item","data-item-id":E.id,style:{flexShrink:0},children:E.content}),E.separatorAfter&&jsx("div",{className:"docx-responsive-toolbar-separator",style:{width:"1px",height:"24px",backgroundColor:"var(--doc-border)",margin:"0 4px"}})]},E.id)),I&&jsx("div",{style:{flex:1,minWidth:0}}),I&&jsxs("div",{style:{position:"relative",flexShrink:0},children:[i?i(h.length,b,P):R,r?b&&r(h,_):jsx(dn,{items:h,isOpen:b,onClose:_,anchorRef:x})]})]})},un=({children:e,gap:t=2,separatorAfter:o=false,className:i="",style:r})=>jsxs(Fragment,{children:[jsx("div",{className:`docx-toolbar-group ${i}`,style:{display:"flex",alignItems:"center",gap:`${t}px`,...r},children:e}),o&&jsx("div",{className:"docx-toolbar-group-separator",style:{width:"1px",height:"24px",backgroundColor:"var(--doc-border)",margin:"0 4px"}})]});function gn(e,t,o){return {id:e,content:t,priority:3,...o}}function mn(e){return e.map(t=>({...t,priority:t.priority||3}))}function bn(e){return {undo:1,redo:1,bold:1,italic:1,underline:2,fontFamily:2,fontSize:2,textColor:3,highlightColor:3,alignment:3,lists:4,indent:4,lineSpacing:5,styles:5}[e]||3}var vn={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},yn={backgroundColor:"white",borderRadius:"8px",boxShadow:"0 4px 20px rgba(0, 0, 0, 0.15)",minWidth:"320px",maxWidth:"400px",width:"100%",margin:"20px"},hn={display:"flex",justifyContent:"space-between",alignItems:"center",padding:"16px 20px",borderBottom:"1px solid var(--doc-border)"},Sn={margin:0,fontSize:"18px",fontWeight:600,color:"var(--doc-text)"},wn={background:"none",border:"none",fontSize:"20px",cursor:"pointer",color:"var(--doc-text-muted)",padding:"4px 8px",lineHeight:1},Cn={padding:"20px"},Tn={display:"flex",flexDirection:"column",alignItems:"center",marginBottom:"16px"},kn={display:"grid",gap:"2px",padding:"4px",backgroundColor:"var(--doc-bg-hover)",borderRadius:"4px",cursor:"pointer"},nt={width:"24px",height:"24px",backgroundColor:"white",border:"1px solid var(--doc-border-dark)",borderRadius:"2px",transition:"background-color 0.1s, border-color 0.1s"},In={...nt,backgroundColor:"var(--doc-primary)",borderColor:"var(--doc-primary)"},Pn={marginTop:"8px",fontSize:"14px",fontWeight:500,color:"var(--doc-text)"},Ln={display:"flex",alignItems:"center",gap:"12px",margin:"16px 0",color:"var(--doc-text-muted)",fontSize:"12px"},et={flex:1,height:"1px",backgroundColor:"var(--doc-border)"},tt={display:"flex",alignItems:"center",gap:"12px",marginBottom:"12px"},ot={fontSize:"14px",fontWeight:500,color:"var(--doc-text)",minWidth:"80px"},rt={width:"80px",padding:"8px 12px",border:"1px solid var(--doc-border-input)",borderRadius:"4px",fontSize:"14px",textAlign:"center"},Rn={display:"flex",justifyContent:"flex-end",gap:"12px",padding:"16px 20px",borderTop:"1px solid var(--doc-border)"},De={padding:"10px 20px",borderRadius:"4px",fontSize:"14px",fontWeight:500,cursor:"pointer",border:"none"},En={...De,backgroundColor:"var(--doc-primary)",color:"white"},Dn={...De,backgroundColor:"var(--doc-bg-hover)",color:"var(--doc-text)",border:"1px solid var(--doc-border-input)"},An={...De,backgroundColor:"var(--doc-border-input)",color:"var(--doc-text-muted)",cursor:"not-allowed"};function Mn(){return jsxs("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[jsx("rect",{x:"2",y:"2",width:"16",height:"16",stroke:"currentColor",strokeWidth:"1.5",fill:"none",rx:"1"}),jsx("line",{x1:"2",y1:"7",x2:"18",y2:"7",stroke:"currentColor",strokeWidth:"1.5"}),jsx("line",{x1:"2",y1:"12",x2:"18",y2:"12",stroke:"currentColor",strokeWidth:"1.5"}),jsx("line",{x1:"8",y1:"2",x2:"8",y2:"18",stroke:"currentColor",strokeWidth:"1.5"}),jsx("line",{x1:"13",y1:"2",x2:"13",y2:"18",stroke:"currentColor",strokeWidth:"1.5"})]})}function On({isOpen:e,onClose:t,onInsert:o,maxGridRows:i=8,maxGridColumns:r=10,maxRows:n=100,maxColumns:s=20,className:a,style:l}){let{t:c$1}=c(),[p,g]=useState(0),[d,m]=useState(0),[x,b]=useState(3),[f,k]=useState(3),T=useRef(null);useEffect(()=>{e&&(g(0),m(0),b(3),k(3));},[e]),useEffect(()=>{e&&T.current?.focus();},[e]);let u=useCallback((C,D)=>{g(C),m(D);},[]),h=useCallback(()=>{p>0&&d>0&&o({rows:p,columns:d});},[p,d,o]),I=useCallback(()=>{let C=Math.min(Math.max(1,x),n),D=Math.min(Math.max(1,f),s);o({rows:C,columns:D});},[x,f,n,s,o]),P=useCallback(C=>{C.key==="Escape"?t():C.key==="Enter"&&!C.shiftKey&&(C.preventDefault(),I());},[t,I]),_=useCallback(C=>{C.target===C.currentTarget&&t();},[t]),R=useCallback(C=>{let D=parseInt(C.target.value,10);isNaN(D)?C.target.value===""&&b(1):b(Math.min(Math.max(1,D),n));},[n]),E=useCallback(C=>{let D=parseInt(C.target.value,10);isNaN(D)?C.target.value===""&&k(1):k(Math.min(Math.max(1,D),s));},[s]);if(!e)return null;let $=[];for(let C=1;C<=i;C++)for(let D=1;D<=r;D++){let G=C<=p&&D<=d;$.push(jsx("div",{style:G?In:nt,onMouseEnter:()=>u(C,D),onClick:h,role:"gridcell","aria-selected":G},`${C}-${D}`));}let J=x>=1&&f>=1,v=p>0&&d>0?c$1("dialogs.insertTable.tableSize",{cols:d,rows:p}):c$1("dialogs.insertTable.hoverToSelect");return jsx("div",{className:`docx-insert-table-dialog-overlay ${a||""}`,style:{...vn,...l},onClick:_,onKeyDown:P,role:"dialog","aria-modal":"true","aria-labelledby":"insert-table-dialog-title",children:jsxs("div",{ref:T,className:"docx-insert-table-dialog",style:yn,tabIndex:-1,children:[jsxs("div",{className:"docx-insert-table-dialog-header",style:hn,children:[jsx("h2",{id:"insert-table-dialog-title",style:Sn,children:jsxs("span",{style:{display:"flex",alignItems:"center",gap:"8px"},children:[jsx(Mn,{}),c$1("dialogs.insertTable.title")]})}),jsx("button",{type:"button",className:"docx-insert-table-dialog-close",style:wn,onClick:t,"aria-label":c$1("common.closeDialog"),children:"\xD7"})]}),jsxs("div",{className:"docx-insert-table-dialog-body",style:Cn,children:[jsxs("div",{className:"docx-insert-table-grid-container",style:Tn,children:[jsx("div",{className:"docx-insert-table-grid",style:{...kn,gridTemplateColumns:`repeat(${r}, 1fr)`},onMouseLeave:()=>{g(0),m(0);},role:"grid","aria-label":"Table size selector",children:$}),jsx("div",{className:"docx-insert-table-grid-label",style:Pn,children:v})]}),jsxs("div",{className:"docx-insert-table-separator",style:Ln,children:[jsx("div",{style:et}),jsx("span",{children:c$1("dialogs.insertTable.orSpecifySize")}),jsx("div",{style:et})]}),jsxs("div",{className:"docx-insert-table-inputs",children:[jsxs("div",{style:tt,children:[jsx("label",{htmlFor:"insert-table-rows",style:ot,children:c$1("dialogs.insertTable.rowsLabel")}),jsx("input",{id:"insert-table-rows",type:"number",min:1,max:n,value:x,onChange:R,style:rt})]}),jsxs("div",{style:tt,children:[jsx("label",{htmlFor:"insert-table-cols",style:ot,children:c$1("dialogs.insertTable.columnsLabel")}),jsx("input",{id:"insert-table-cols",type:"number",min:1,max:s,value:f,onChange:E,style:rt})]})]})]}),jsxs("div",{className:"docx-insert-table-dialog-footer",style:Rn,children:[jsx("button",{type:"button",className:"docx-insert-table-dialog-cancel",style:Dn,onClick:t,children:c$1("common.cancel")}),jsx("button",{type:"button",className:"docx-insert-table-dialog-insert",style:J?En:An,onClick:I,disabled:!J,children:c$1("dialogs.insertTable.insertButton")})]})]})})}function _n(){let[e,t]=useState(false),o=useCallback(()=>t(true),[]),i=useCallback(()=>t(false),[]),r=useCallback(()=>t(n=>!n),[]);return {isOpen:e,open:o,close:i,toggle:r}}function Bn(e=3,t=3){return {rows:e,columns:t}}function Nn(e,t=100,o=20){return e.rows>=1&&e.rows<=t&&e.columns>=1&&e.columns<=o}function zn(e,t=100,o=20){return {rows:Math.min(Math.max(1,e.rows),t),columns:Math.min(Math.max(1,e.columns),o)}}function Wn(e){return `${e.columns} x ${e.rows}`}function Yn(){return [{label:"2 x 2",config:{rows:2,columns:2}},{label:"3 x 3",config:{rows:3,columns:3}},{label:"4 x 4",config:{rows:4,columns:4}},{label:"2 x 4",config:{rows:2,columns:4}},{label:"4 x 2",config:{rows:4,columns:2}},{label:"5 x 5",config:{rows:5,columns:5}}]}var Fn={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},Vn={backgroundColor:"white",borderRadius:"8px",boxShadow:"0 4px 20px rgba(0, 0, 0, 0.15)",minWidth:"450px",maxWidth:"600px",width:"100%",margin:"20px",maxHeight:"90vh",overflow:"auto"},$n={display:"flex",justifyContent:"space-between",alignItems:"center",padding:"16px 20px",borderBottom:"1px solid var(--doc-border)"},Gn={margin:0,fontSize:"18px",fontWeight:600,color:"var(--doc-text)"},Hn={background:"none",border:"none",fontSize:"20px",cursor:"pointer",color:"var(--doc-text-muted)",padding:"4px 8px",lineHeight:1},Kn={padding:"20px"},Ae={border:"2px dashed var(--doc-border-input)",borderRadius:"8px",padding:"40px 20px",textAlign:"center",cursor:"pointer",transition:"border-color 0.2s, background-color 0.2s",marginBottom:"16px"},jn={...Ae,borderColor:"var(--doc-primary)",backgroundColor:"var(--doc-primary-light)"},Zn={...Ae,padding:"20px",borderStyle:"solid",borderColor:"var(--doc-primary)"},Xn={display:"flex",justifyContent:"center",alignItems:"center",maxHeight:"250px",overflow:"hidden"},Qn={maxWidth:"100%",maxHeight:"250px",objectFit:"contain",borderRadius:"4px"},Jn={fontSize:"48px",color:"var(--doc-text-placeholder)",marginBottom:"12px"},qn={fontSize:"14px",color:"var(--doc-text-muted)",marginBottom:"8px"},ei={fontSize:"12px",color:"var(--doc-text-placeholder)"},ti={marginBottom:"16px"},oi={display:"block",marginBottom:"6px",fontSize:"14px",fontWeight:500,color:"var(--doc-text)"},ri={width:"100%",padding:"10px 12px",border:"1px solid var(--doc-border-input)",borderRadius:"4px",fontSize:"14px",boxSizing:"border-box"},ni={display:"flex",alignItems:"center",gap:"12px",marginBottom:"16px"},st={width:"100px",padding:"6px 8px",border:"1px solid var(--doc-border-input)",borderRadius:"4px",fontSize:"14px"},at={display:"inline-flex",alignItems:"center",gap:"6px",fontSize:"14px",color:"var(--doc-text)",fontWeight:500},ii={display:"inline-flex",alignItems:"center",gap:"6px",fontSize:"13px",color:"var(--doc-text-muted)",cursor:"pointer",whiteSpace:"nowrap"},si={display:"flex",justifyContent:"flex-end",gap:"12px",padding:"16px 20px",borderTop:"1px solid var(--doc-border)"},Me={padding:"10px 20px",borderRadius:"4px",fontSize:"14px",fontWeight:500,cursor:"pointer",border:"none"},ai={...Me,backgroundColor:"var(--doc-primary)",color:"white"},li={...Me,backgroundColor:"var(--doc-bg-subtle)",color:"var(--doc-text)",border:"1px solid var(--doc-border-input)"},ci={...Me,backgroundColor:"var(--doc-border-input)",color:"var(--doc-text-muted)",cursor:"not-allowed"};function di(){return jsx("span",{style:{color:"var(--doc-text-placeholder)"},children:jsx(b$1,{name:"image",size:48})})}function pi({isOpen:e,onClose:t,onInsert:o,maxWidth:i=800,maxHeight:r=600,accept:n="image/*",className:s,style:a}){let{t:l}=c(),[c$1,p]=useState(null),[g,d]=useState(false),{width:m,height:x,lockAspect:b,setLockAspect:f,handleWidthChange:k,handleHeightChange:T,seed:u}=a$1(),[h,I]=useState(""),[P,_]=useState(null),R=useRef(null),E=useRef(null);useEffect(()=>{e&&(p(null),d(false),u(null,null),I(""),_(null));},[e]);let $=useCallback(w=>{if(!w.type.startsWith("image/")){_(l("dialogs.insertImage.invalidFile"));return}if(w.size>10*1024*1024){_(l("dialogs.insertImage.fileTooLarge"));return}_(null);let H=new FileReader;H.onload=bt=>{let Be=bt.target?.result,ge=new Image;ge.onload=()=>{let q=ge.width,ee=ge.height;if(q>i||ee>r){let xt=i/q,ft=r/ee,Ne=Math.min(xt,ft);q=Math.round(q*Ne),ee=Math.round(ee*Ne);}u(q,ee),p({src:Be,width:q,height:ee,fileName:w.name,mimeType:w.type});},ge.src=Be;},H.onerror=()=>{_("Failed to read image file");},H.readAsDataURL(w);},[i,r]),J=useCallback(w=>{let H=w.target.files?.[0];H&&$(H);},[$]),v=useCallback(()=>{R.current?.click();},[]),C=useCallback(w=>{w.preventDefault(),d(true);},[]),D=useCallback(w=>{w.preventDefault(),d(false);},[]),G=useCallback(w=>{w.preventDefault(),d(false);let H=w.dataTransfer.files?.[0];H&&$(H);},[$]),Se=useCallback(()=>{c$1&&typeof m=="number"&&typeof x=="number"&&o({...c$1,width:m,height:x,alt:h||void 0});},[c$1,m,x,h,o]),pt=useCallback(w=>{w.key==="Escape"?t():w.key==="Enter"&&c$1&&!w.shiftKey&&(w.preventDefault(),Se());},[t,c$1,Se]),ut=useCallback(w=>{w.target===w.currentTarget&&t();},[t]),gt=useCallback(()=>{p(null),u(null,null),I(""),_(null),R.current&&(R.current.value="");},[u]);if(!e)return null;let _e=c$1!==null&&typeof m=="number"&&m>0&&typeof x=="number"&&x>0,mt=()=>c$1?Zn:g?jn:Ae;return jsx("div",{className:`docx-insert-image-dialog-overlay ${s||""}`,style:{...Fn,...a},onClick:ut,onKeyDown:pt,role:"dialog","aria-modal":"true","aria-labelledby":"insert-image-dialog-title",children:jsxs("div",{ref:E,className:"docx-insert-image-dialog",style:Vn,tabIndex:-1,children:[jsxs("div",{className:"docx-insert-image-dialog-header",style:$n,children:[jsx("h2",{id:"insert-image-dialog-title",style:Gn,children:l("dialogs.insertImage.title")}),jsx("button",{type:"button",className:"docx-insert-image-dialog-close",style:Hn,onClick:t,"aria-label":l("common.closeDialog"),children:"\xD7"})]}),jsxs("div",{className:"docx-insert-image-dialog-body",style:Kn,children:[jsx("input",{ref:R,type:"file",accept:n,onChange:J,style:{display:"none"}}),jsx("div",{className:"docx-insert-image-dropzone",style:mt(),onClick:v,onDragOver:C,onDragLeave:D,onDrop:G,role:"button",tabIndex:0,"aria-label":l("dialogs.insertImage.uploadAriaLabel"),children:c$1?jsx("div",{style:Xn,children:jsx("img",{src:c$1.src,alt:h||"Preview",style:Qn})}):jsxs(Fragment,{children:[jsx("div",{style:Jn,children:jsx(di,{})}),jsx("div",{style:qn,children:l("dialogs.insertImage.uploadText")}),jsx("div",{style:ei,children:l("dialogs.insertImage.uploadSubtext")})]})}),P&&jsx("div",{style:{color:"var(--doc-error)",fontSize:"14px",marginBottom:"16px",textAlign:"center"},children:P}),c$1&&jsxs(Fragment,{children:[jsxs("div",{style:ni,children:[jsxs("label",{style:at,children:[l("dialogs.insertImage.widthLabel"),jsx("input",{type:"number",value:m,onChange:w=>k(w.target.value),min:1,max:i,style:st})]}),jsxs("label",{style:at,children:[l("dialogs.insertImage.heightLabel"),jsx("input",{type:"number",value:x,onChange:w=>T(w.target.value),min:1,max:r,style:st})]}),jsxs("label",{style:ii,children:[jsx("input",{type:"checkbox",checked:b,onChange:w=>f(w.target.checked)}),l(b?"dialogs.insertImage.aspectRatioLocked":"dialogs.insertImage.aspectRatioUnlocked")]})]}),jsxs("div",{style:ti,children:[jsx("label",{htmlFor:"insert-image-alt",style:oi,children:l("dialogs.insertImage.altTextLabel")}),jsx("input",{id:"insert-image-alt",type:"text",value:h,onChange:w=>I(w.target.value),placeholder:l("dialogs.insertImage.altTextPlaceholder"),style:ri})]})]})]}),jsxs("div",{className:"docx-insert-image-dialog-footer",style:si,children:[(()=>{let w=c$1!==null;return jsx("button",{type:"button",className:"docx-insert-image-dialog-clear",style:li,onClick:w?gt:t,children:l(w?"common.clear":"common.cancel")})})(),jsx("button",{type:"button",className:"docx-insert-image-dialog-insert",style:_e?ai:ci,onClick:Se,disabled:!_e,children:l("dialogs.insertImage.insertButton")})]})]})})}function ui(){let[e,t]=useState(false),o=useCallback(()=>t(true),[]),i=useCallback(()=>t(false),[]),r=useCallback(()=>t(n=>!n),[]);return {isOpen:e,open:o,close:i,toggle:r}}function gi(e){return e.type.startsWith("image/")}function mi(){return [".png",".jpg",".jpeg",".gif",".webp",".bmp",".svg"]}function bi(){return "image/png,image/jpeg,image/gif,image/webp,image/bmp,image/svg+xml"}function xi(e,t,o,i){if(e<=o&&t<=i)return {width:e,height:t};let r=o/e,n=i/t,s=Math.min(r,n);return {width:Math.round(e*s),height:Math.round(t*s)}}function fi(e){let t=e.split(","),o=t[0].match(/:(.*?);/)?.[1]||"image/png",i=atob(t[1]),r=new Uint8Array(i.length);for(let n=0;n<i.length;n++)r[n]=i.charCodeAt(n);return new Blob([r],{type:o})}function vi(e){return new Promise((t,o)=>{let i=new Image;i.onload=()=>t({width:i.width,height:i.height}),i.onerror=()=>o(new Error("Failed to load image")),i.src=e;})}function yi(e){return e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:`${(e/(1024*1024)).toFixed(1)} MB`}var Ci={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},Ti={backgroundColor:"white",borderRadius:"8px",boxShadow:"0 4px 20px rgba(0, 0, 0, 0.15)",minWidth:"450px",maxWidth:"550px",width:"100%",margin:"20px",maxHeight:"80vh",display:"flex",flexDirection:"column"},ki={display:"flex",justifyContent:"space-between",alignItems:"center",padding:"16px 20px",borderBottom:"1px solid var(--doc-border)"},Ii={margin:0,fontSize:"18px",fontWeight:600,color:"var(--doc-text)"},Pi={background:"none",border:"none",fontSize:"20px",cursor:"pointer",color:"var(--doc-text-muted)",padding:"4px 8px",lineHeight:1},Li={padding:"20px",flex:1,overflow:"auto"},Ri={width:"100%",padding:"10px 12px",border:"1px solid var(--doc-border-input)",borderRadius:"4px",fontSize:"14px",marginBottom:"16px",boxSizing:"border-box"},Ei={display:"flex",flexWrap:"wrap",gap:"4px",marginBottom:"16px"},ct={padding:"6px 12px",border:"1px solid var(--doc-border-input)",borderRadius:"4px",backgroundColor:"white",cursor:"pointer",fontSize:"12px",transition:"all 0.15s"},Di={...ct,backgroundColor:"var(--doc-primary)",borderColor:"var(--doc-primary)",color:"white"},Ai={display:"grid",gridTemplateColumns:"repeat(10, 1fr)",gap:"4px",maxHeight:"250px",overflow:"auto"},Mi={width:"36px",height:"36px",display:"flex",alignItems:"center",justifyContent:"center",border:"1px solid var(--doc-border)",borderRadius:"4px",backgroundColor:"white",cursor:"pointer",fontSize:"18px",transition:"all 0.15s"},Oi={marginTop:"16px",padding:"12px",backgroundColor:"var(--doc-bg-subtle)",borderRadius:"4px",display:"flex",alignItems:"center",gap:"16px"},_i={fontSize:"36px",width:"60px",height:"60px",display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:"white",borderRadius:"4px",border:"1px solid var(--doc-border)"},Bi={flex:1},Ni={display:"flex",justifyContent:"flex-end",gap:"12px",padding:"16px 20px",borderTop:"1px solid var(--doc-border)"},Oe={padding:"10px 20px",borderRadius:"4px",fontSize:"14px",fontWeight:500,cursor:"pointer",border:"none"},zi={...Oe,backgroundColor:"var(--doc-primary)",color:"white"},Wi={...Oe,backgroundColor:"var(--doc-bg-subtle)",color:"var(--doc-text)",border:"1px solid var(--doc-border-input)"},Yi={...Oe,backgroundColor:"var(--doc-border-input)",color:"var(--doc-text-muted)",cursor:"not-allowed"},se=[{name:"common",label:"Common",symbols:["\xA9","\xAE","\u2122","\u2022","\u2026","\u2014","\u2013","\xB0","\xB1","\xD7","\xF7","\u2260","\u2264","\u2265","\u221E","\u221A","\u2211","\u220F","\u222B","\u03C0","\u20AC","\xA3","\xA5","\xA2","\xA7","\xB6","\u2020","\u2021","\u2030","\u2116"]},{name:"arrows",label:"Arrows",symbols:["\u2190","\u2191","\u2192","\u2193","\u2194","\u2195","\u2196","\u2197","\u2198","\u2199","\u21D0","\u21D1","\u21D2","\u21D3","\u21D4","\u21D5","\u27F5","\u27F6","\u27F7","\u2794","\u279C","\u279E","\u27A1","\u27A2","\u27A3","\u27A4","\u27A5","\u27A6","\u27A7","\u27A8"]},{name:"math",label:"Math",symbols:["+","\u2212","\xD7","\xF7","=","\u2260","<",">","\u2264","\u2265","\xB1","\u2213","\u221E","\u221A","\u221B","\u221C","\u2211","\u220F","\u222B","\u2202","\u2206","\u2207","\u2208","\u2209","\u220B","\u2205","\u2200","\u2203","\u2204","\u2282","\u2283","\u2286","\u2287","\u222A","\u2229","\u2295","\u2297","\u22A5","\u2220","\u221F"]},{name:"greek",label:"Greek",symbols:["\u03B1","\u03B2","\u03B3","\u03B4","\u03B5","\u03B6","\u03B7","\u03B8","\u03B9","\u03BA","\u03BB","\u03BC","\u03BD","\u03BE","\u03BF","\u03C0","\u03C1","\u03C3","\u03C4","\u03C5","\u03C6","\u03C7","\u03C8","\u03C9","\u0391","\u0392","\u0393","\u0394","\u0395","\u0396","\u0397","\u0398","\u0399","\u039A","\u039B","\u039C","\u039D","\u039E","\u039F","\u03A0"]},{name:"shapes",label:"Shapes",symbols:["\u25A0","\u25A1","\u25AA","\u25AB","\u25AC","\u25AD","\u25AE","\u25AF","\u25B0","\u25B1","\u25B2","\u25B3","\u25B4","\u25B5","\u25B6","\u25B7","\u25B8","\u25B9","\u25BA","\u25BB","\u25BC","\u25BD","\u25BE","\u25BF","\u25C0","\u25C1","\u25C2","\u25C3","\u25C4","\u25C5","\u25CF","\u25CB","\u25CE","\u25C9","\u25CC","\u25CD","\u25D0","\u25D1","\u25D2","\u25D3"]},{name:"punctuation",label:"Punctuation",symbols:["\u2013","\u2014","\u2018","\u2019","\u201C","\u201D","\xAB","\xBB","\u2039","\u203A","\u2026","\xB7","\u2022","\u2023","\u2043","\u2010","\u2011","\u2012","\u2015","\u2016","\u2032","\u2033","\u2034","\u2057","\u2035","\u2036","\u2037","\u203B","\u203D","\u2042"]},{name:"currency",label:"Currency",symbols:["$","\xA2","\xA3","\xA4","\xA5","\u20A0","\u20A1","\u20A2","\u20A3","\u20A4","\u20A5","\u20A6","\u20A7","\u20A8","\u20A9","\u20AA","\u20AB","\u20AC","\u20AD","\u20AE","\u20AF","\u20B0","\u20B1","\u20B2","\u20B3","\u20B4","\u20B5","\u20B6","\u20B7","\u20B8"]},{name:"music",label:"Music",symbols:["\u2669","\u266A","\u266B","\u266C","\u266D","\u266E","\u266F","\u{1D11E}","\u{1D122}","\u{1D12A}","\u{1D12B}","\u{1D157}\u{1D165}","\u{1D158}\u{1D165}","\u{1D158}\u{1D165}\u{1D16E}","\u{1D158}\u{1D165}\u{1D16F}","\u{1D158}\u{1D165}\u{1D170}","\u{1D192}","\u{1D193}","\u{1D110}","\u{1D111}"]},{name:"emoji",label:"Emoji",symbols:["\u{1F600}","\u{1F603}","\u{1F604}","\u{1F601}","\u{1F606}","\u{1F605}","\u{1F923}","\u{1F602}","\u{1F642}","\u{1F643}","\u{1F609}","\u{1F60A}","\u{1F607}","\u{1F970}","\u{1F60D}","\u{1F929}","\u{1F618}","\u{1F617}","\u263A","\u{1F61A}","\u2764","\u{1F9E1}","\u{1F49B}","\u{1F49A}","\u{1F499}","\u{1F49C}","\u{1F5A4}","\u{1F90D}","\u{1F494}","\u2763","\u{1F44D}","\u{1F44E}","\u{1F44C}","\u270C","\u{1F91E}","\u{1F91F}","\u{1F918}","\u{1F44B}","\u{1F64F}","\u2705"]}];function dt(){return se.flatMap(e=>e.symbols)}function Ui({isOpen:e,onClose:t,onInsert:o,recentSymbols:i=[],className:r,style:n}){let{t:s}=c(),[a,l]=useState("common"),[c$1,p]=useState(null),[g,d]=useState(""),[m,x]=useState(null),b=useRef(null);useEffect(()=>{e&&(p(null),d(""),x(null),setTimeout(()=>b.current?.focus(),100));},[e]);let f=useMemo(()=>{if(!g.trim())return a==="recent"?i:se.find(G=>G.name===a)?.symbols||[];let v=g.toLowerCase();return dt().filter(D=>{let G=D.codePointAt(0)?.toString(16).toUpperCase()||"";return D.includes(v)||G.includes(v.toUpperCase())||`U+${G}`.toLowerCase().includes(v)})},[g,a,i]),k=useCallback(v=>{p(v);},[]),T=useCallback(v=>{o(v);},[o]),u=useCallback(()=>{c$1&&o(c$1);},[c$1,o]),h=useCallback(v=>{v.key==="Escape"?t():v.key==="Enter"&&c$1&&(v.preventDefault(),u());},[t,c$1,u]),I=useCallback(v=>{v.target===v.currentTarget&&t();},[t]),P=v=>{if(!v)return null;let C=v.codePointAt(0);return {character:v,codePoint:C?`U+${C.toString(16).toUpperCase().padStart(4,"0")}`:"",decimal:C||0}};if(!e)return null;let R=P(m||c$1),E=c$1!==null,$={common:s("dialogs.insertSymbol.categories.common"),arrows:s("dialogs.insertSymbol.categories.arrows"),math:s("dialogs.insertSymbol.categories.math"),greek:s("dialogs.insertSymbol.categories.greek"),shapes:s("dialogs.insertSymbol.categories.shapes"),punctuation:s("dialogs.insertSymbol.categories.punctuation"),currency:s("dialogs.insertSymbol.categories.currency"),music:s("dialogs.insertSymbol.categories.music"),emoji:s("dialogs.insertSymbol.categories.emoji")},J=[...i.length>0?[{name:"recent",label:"Recent"}]:[],...se.map(v=>({name:v.name,label:$[v.name]||v.label}))];return jsx("div",{className:`docx-insert-symbol-dialog-overlay ${r||""}`,style:{...Ci,...n},onClick:I,onKeyDown:h,role:"dialog","aria-modal":"true","aria-labelledby":"insert-symbol-dialog-title",children:jsxs("div",{className:"docx-insert-symbol-dialog",style:Ti,children:[jsxs("div",{className:"docx-insert-symbol-dialog-header",style:ki,children:[jsx("h2",{id:"insert-symbol-dialog-title",style:Ii,children:s("dialogs.insertSymbol.title")}),jsx("button",{type:"button",className:"docx-insert-symbol-dialog-close",style:Pi,onClick:t,"aria-label":s("common.closeDialog"),children:"\xD7"})]}),jsxs("div",{className:"docx-insert-symbol-dialog-body",style:Li,children:[jsx("input",{ref:b,type:"text",placeholder:s("dialogs.insertSymbol.searchPlaceholder"),value:g,onChange:v=>d(v.target.value),style:Ri}),!g&&jsx("div",{className:"docx-insert-symbol-categories",style:Ei,children:J.map(v=>jsx("button",{type:"button",onClick:()=>l(v.name),style:a===v.name?Di:ct,children:v.label},v.name))}),jsx("div",{className:"docx-insert-symbol-grid",style:Ai,children:f.map((v,C)=>jsx("button",{type:"button",onClick:()=>k(v),onDoubleClick:()=>T(v),onMouseEnter:()=>x(v),onMouseLeave:()=>x(null),style:{...Mi,...c$1===v?{backgroundColor:"var(--doc-primary-light)",borderColor:"var(--doc-primary)"}:{}},title:`${v} - U+${v.codePointAt(0)?.toString(16).toUpperCase()}`,children:v},`${v}-${C}`))}),f.length===0&&jsx("div",{style:{textAlign:"center",padding:"20px",color:"var(--doc-text-muted)"},children:s("dialogs.insertSymbol.noResults",{query:g})}),R&&jsxs("div",{className:"docx-insert-symbol-preview",style:Oi,children:[jsx("div",{style:_i,children:R.character}),jsxs("div",{style:Bi,children:[jsx("div",{style:{fontSize:"14px",fontWeight:500,marginBottom:"4px"},children:R.codePoint}),jsx("div",{style:{fontSize:"12px",color:"var(--doc-text-muted)"},children:s("dialogs.insertSymbol.decimal",{value:R.decimal})})]})]})]}),jsxs("div",{className:"docx-insert-symbol-dialog-footer",style:Ni,children:[jsx("button",{type:"button",className:"docx-insert-symbol-dialog-cancel",style:Wi,onClick:t,children:s("common.cancel")}),jsx("button",{type:"button",className:"docx-insert-symbol-dialog-insert",style:E?zi:Yi,onClick:u,disabled:!E,children:s("common.insert")})]})]})})}function Fi(e=20){let[t,o]=useState(false),[i,r]=useState([]),n=useCallback(()=>o(true),[]),s=useCallback(()=>o(false),[]),a=useCallback(()=>o(c=>!c),[]),l=useCallback(c=>{r(p=>{let g=p.filter(d=>d!==c);return [c,...g].slice(0,e)});},[e]);return {isOpen:t,recentSymbols:i,open:n,close:s,toggle:a,addRecent:l}}function Vi(){return se}function $i(e){return se.find(o=>o.name===e)?.symbols||[]}function Gi(e){let t=e.codePointAt(0)||0;return {character:e,codePoint:`U+${t.toString(16).toUpperCase().padStart(4,"0")}`,decimal:t,hex:t.toString(16).toUpperCase()}}function Hi(e){if(!e.trim())return [];let t=e.toLowerCase();return dt().filter(o=>{let i=o.codePointAt(0)?.toString(16).toUpperCase()||"";return o.includes(e)||i.includes(t.toUpperCase())||`U+${i}`.toLowerCase().includes(t)})}function Ki(e){let t=e.replace(/^U\+/i,"").replace(/^0x/i,""),o=parseInt(t,16);return isNaN(o)||o<0||o>1114111?null:String.fromCodePoint(o)}
|
|
111
|
+
export{Qo as ContextMenu,pi as InsertImageDialog,Ui as InsertSymbolDialog,On as InsertTableDialog,Qr as LoadingIndicator,mr as PrintButton,br as PrintStyles,cr as ResponsePreview,pn as ResponsiveToolbar,un as ResponsiveToolbarGroup,se as SYMBOL_CATEGORIES,Lr as TableInsertButtons,Cr as TableMergeButton,Br as UnsavedIndicator,xi as calculateFitDimensions,zn as clampTableConfig,Ur as createChangeTracker,Bn as createDefaultTableConfig,ur as createErrorResponse,pr as createMockResponse,gn as createToolbarItem,mn as createToolbarItems,fi as dataUrlToBlob,rn as delay,yi as formatFileSize,Sr as formatPrintPageRange,Wn as formatTableDimensions,qo as getActionShortcut,or as getAllActions,Yr as getAllIndicatorPositions,Wr as getAllIndicatorVariants,on as getAllLoadingSizes,tn as getAllLoadingVariants,tr as getDefaultActions,yr as getDefaultPrintOptions,bi as getImageAcceptString,vi as getImageDimensions,en as getLoadingVariantLabel,bn as getRecommendedPriority,mi as getSupportedImageExtensions,Vi as getSymbolCategories,Gi as getSymbolUnicodeInfo,$i as getSymbolsByCategory,Yn as getTablePresets,zr as getVariantLabel,er as isActionAvailable,wr as isPrintSupported,gi as isValidImageFile,Nn as isValidTableConfig,vr as openPrintWindow,hr as parsePageRange,Hi as searchSymbols,Ki as symbolFromCodePoint,fr as triggerPrint,Jo as useContextMenu,ui as useInsertImageDialog,Fi as useInsertSymbolDialog,_n as useInsertTableDialog,Jr as useLoading,qr as useLoadingOperations,dr as useResponsePreview,Je as useResponsiveToolbar,Nr as useUnsavedChanges};
|
|
@@ -0,0 +1,261 @@
|
|
|
1
|
+
import React__default, { CSSProperties, ReactNode } from 'react';
|
|
2
|
+
import { f as Table, g as TableCell } from './content-REFGFfEH.js';
|
|
3
|
+
import { F as FindMatch, a as FindOptions } from './findReplace-Bue0JaXh.js';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* TableToolbar Component
|
|
7
|
+
*
|
|
8
|
+
* Provides controls for editing tables:
|
|
9
|
+
* - Add row above/below
|
|
10
|
+
* - Add column left/right
|
|
11
|
+
* - Delete row/column
|
|
12
|
+
* - Merge cells
|
|
13
|
+
* - Split cell
|
|
14
|
+
*
|
|
15
|
+
* Shows when cursor is in a table.
|
|
16
|
+
*/
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Table editing action types
|
|
20
|
+
*/
|
|
21
|
+
type TableAction = 'addRowAbove' | 'addRowBelow' | 'addColumnLeft' | 'addColumnRight' | 'deleteRow' | 'deleteColumn' | 'mergeCells' | 'splitCell' | 'deleteTable' | 'selectTable' | 'selectRow' | 'selectColumn' | 'borderAll' | 'borderOutside' | 'borderInside' | 'borderNone' | 'borderTop' | 'borderBottom' | 'borderLeft' | 'borderRight' | {
|
|
22
|
+
type: 'cellFillColor';
|
|
23
|
+
color: string | null;
|
|
24
|
+
} | {
|
|
25
|
+
type: 'borderColor';
|
|
26
|
+
color: string;
|
|
27
|
+
} | {
|
|
28
|
+
type: 'borderWidth';
|
|
29
|
+
size: number;
|
|
30
|
+
} | {
|
|
31
|
+
type: 'cellBorder';
|
|
32
|
+
side: 'top' | 'bottom' | 'left' | 'right' | 'all';
|
|
33
|
+
style: string;
|
|
34
|
+
size: number;
|
|
35
|
+
color: string;
|
|
36
|
+
} | {
|
|
37
|
+
type: 'cellVerticalAlign';
|
|
38
|
+
align: 'top' | 'center' | 'bottom';
|
|
39
|
+
} | {
|
|
40
|
+
type: 'cellMargins';
|
|
41
|
+
margins: {
|
|
42
|
+
top?: number;
|
|
43
|
+
bottom?: number;
|
|
44
|
+
left?: number;
|
|
45
|
+
right?: number;
|
|
46
|
+
};
|
|
47
|
+
} | {
|
|
48
|
+
type: 'cellTextDirection';
|
|
49
|
+
direction: string | null;
|
|
50
|
+
} | {
|
|
51
|
+
type: 'toggleNoWrap';
|
|
52
|
+
} | {
|
|
53
|
+
type: 'rowHeight';
|
|
54
|
+
height: number | null;
|
|
55
|
+
rule?: 'auto' | 'atLeast' | 'exact';
|
|
56
|
+
} | {
|
|
57
|
+
type: 'toggleHeaderRow';
|
|
58
|
+
} | {
|
|
59
|
+
type: 'distributeColumns';
|
|
60
|
+
} | {
|
|
61
|
+
type: 'autoFitContents';
|
|
62
|
+
} | {
|
|
63
|
+
type: 'tableProperties';
|
|
64
|
+
props: {
|
|
65
|
+
width?: number | null;
|
|
66
|
+
widthType?: string | null;
|
|
67
|
+
justification?: 'left' | 'center' | 'right' | null;
|
|
68
|
+
};
|
|
69
|
+
} | {
|
|
70
|
+
type: 'openTableProperties';
|
|
71
|
+
} | {
|
|
72
|
+
type: 'applyTableStyle';
|
|
73
|
+
styleId: string;
|
|
74
|
+
};
|
|
75
|
+
/**
|
|
76
|
+
* Selection within a table
|
|
77
|
+
*/
|
|
78
|
+
interface TableSelection {
|
|
79
|
+
/** Index of the table in the document */
|
|
80
|
+
tableIndex: number;
|
|
81
|
+
/** Row index (0-indexed) */
|
|
82
|
+
rowIndex: number;
|
|
83
|
+
/** Column index (0-indexed) */
|
|
84
|
+
columnIndex: number;
|
|
85
|
+
/** Selected cell range for multi-cell selection */
|
|
86
|
+
selectedCells?: {
|
|
87
|
+
startRow: number;
|
|
88
|
+
startCol: number;
|
|
89
|
+
endRow: number;
|
|
90
|
+
endCol: number;
|
|
91
|
+
};
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* Context for table operations
|
|
95
|
+
*/
|
|
96
|
+
interface TableContext {
|
|
97
|
+
/** The table being edited */
|
|
98
|
+
table: Table;
|
|
99
|
+
/** Current selection within the table */
|
|
100
|
+
selection: TableSelection;
|
|
101
|
+
/** Whether multiple cells are selected (for merge) */
|
|
102
|
+
hasMultiCellSelection: boolean;
|
|
103
|
+
/** Whether current cell can be split */
|
|
104
|
+
canSplitCell: boolean;
|
|
105
|
+
/** Total number of rows */
|
|
106
|
+
rowCount: number;
|
|
107
|
+
/** Total number of columns */
|
|
108
|
+
columnCount: number;
|
|
109
|
+
}
|
|
110
|
+
interface TableSplitConfig {
|
|
111
|
+
minRows: number;
|
|
112
|
+
minCols: number;
|
|
113
|
+
initialRows: number;
|
|
114
|
+
initialCols: number;
|
|
115
|
+
}
|
|
116
|
+
/**
|
|
117
|
+
* Props for TableToolbar component
|
|
118
|
+
*/
|
|
119
|
+
interface TableToolbarProps {
|
|
120
|
+
/** Current table context (null if cursor not in table) */
|
|
121
|
+
context: TableContext | null;
|
|
122
|
+
/** Callback when a table action is triggered */
|
|
123
|
+
onAction?: (action: TableAction, context: TableContext) => void;
|
|
124
|
+
/** Whether the toolbar is disabled */
|
|
125
|
+
disabled?: boolean;
|
|
126
|
+
/** Additional CSS class name */
|
|
127
|
+
className?: string;
|
|
128
|
+
/** Additional inline styles */
|
|
129
|
+
style?: CSSProperties;
|
|
130
|
+
/** Show labels next to icons */
|
|
131
|
+
showLabels?: boolean;
|
|
132
|
+
/** Compact mode */
|
|
133
|
+
compact?: boolean;
|
|
134
|
+
/** Position of the toolbar */
|
|
135
|
+
position?: 'top' | 'floating';
|
|
136
|
+
/** Custom render for additional buttons */
|
|
137
|
+
children?: ReactNode;
|
|
138
|
+
}
|
|
139
|
+
/**
|
|
140
|
+
* TableToolbar - Shows table manipulation controls when cursor is in a table
|
|
141
|
+
*/
|
|
142
|
+
declare function TableToolbar({ context, onAction, disabled, className, style, showLabels, compact, position, children, }: TableToolbarProps): React__default.ReactElement | null;
|
|
143
|
+
/**
|
|
144
|
+
* Create a table context from a table and selection
|
|
145
|
+
*/
|
|
146
|
+
declare function createTableContext(table: Table, selection: TableSelection): TableContext;
|
|
147
|
+
/**
|
|
148
|
+
* Get column count from a table
|
|
149
|
+
*/
|
|
150
|
+
declare function getColumnCount(table: Table): number;
|
|
151
|
+
/**
|
|
152
|
+
* Get cell at specific row and column index
|
|
153
|
+
*/
|
|
154
|
+
declare function getCellAt(table: Table, rowIndex: number, columnIndex: number): TableCell | null;
|
|
155
|
+
declare function getTableSplitCellDialogConfig(table: Table, rowIndex: number, columnIndex: number): TableSplitConfig | null;
|
|
156
|
+
declare function splitTableCell(table: Table, rowIndex: number, columnIndex: number, rows: number, cols: number): Table;
|
|
157
|
+
/**
|
|
158
|
+
* Add a row to a table at the specified index
|
|
159
|
+
*/
|
|
160
|
+
declare function addRow(table: Table, atIndex: number, position?: 'before' | 'after'): Table;
|
|
161
|
+
/**
|
|
162
|
+
* Delete a row from a table
|
|
163
|
+
*/
|
|
164
|
+
declare function deleteRow(table: Table, rowIndex: number): Table;
|
|
165
|
+
/**
|
|
166
|
+
* Add a column to a table at the specified index
|
|
167
|
+
*/
|
|
168
|
+
declare function addColumn(table: Table, atIndex: number, position?: 'before' | 'after'): Table;
|
|
169
|
+
/**
|
|
170
|
+
* Delete a column from a table
|
|
171
|
+
*/
|
|
172
|
+
declare function deleteColumn(table: Table, columnIndex: number): Table;
|
|
173
|
+
/**
|
|
174
|
+
* Merge cells in a selection
|
|
175
|
+
*/
|
|
176
|
+
declare function mergeCells(table: Table, selection: TableSelection): Table;
|
|
177
|
+
/**
|
|
178
|
+
* Backward-compatible helper for callers that still use the older merged-cell
|
|
179
|
+
* split behavior directly.
|
|
180
|
+
*
|
|
181
|
+
* User-facing Split cell is now dialog-driven. For document-model tables, use
|
|
182
|
+
* `getTableSplitCellDialogConfig()` and `splitTableCell()` instead.
|
|
183
|
+
*/
|
|
184
|
+
declare function splitCell(table: Table, rowIndex: number, columnIndex: number): Table;
|
|
185
|
+
|
|
186
|
+
/**
|
|
187
|
+
* useFindReplace Hook
|
|
188
|
+
*
|
|
189
|
+
* React hook for managing find/replace dialog state.
|
|
190
|
+
* Extracted from FindReplaceDialog.tsx.
|
|
191
|
+
*/
|
|
192
|
+
|
|
193
|
+
/**
|
|
194
|
+
* Options for the useFindReplace hook
|
|
195
|
+
*/
|
|
196
|
+
interface FindReplaceOptions {
|
|
197
|
+
/** Whether to show replace functionality initially */
|
|
198
|
+
initialReplaceMode?: boolean;
|
|
199
|
+
/** Callback when matches change */
|
|
200
|
+
onMatchesChange?: (matches: FindMatch[]) => void;
|
|
201
|
+
/** Callback when current match changes */
|
|
202
|
+
onCurrentMatchChange?: (match: FindMatch | null, index: number) => void;
|
|
203
|
+
}
|
|
204
|
+
/**
|
|
205
|
+
* State for the find/replace hook
|
|
206
|
+
*/
|
|
207
|
+
interface FindReplaceState {
|
|
208
|
+
/** Whether the dialog is open */
|
|
209
|
+
isOpen: boolean;
|
|
210
|
+
/** Current search text */
|
|
211
|
+
searchText: string;
|
|
212
|
+
/** Current replace text */
|
|
213
|
+
replaceText: string;
|
|
214
|
+
/** Find options */
|
|
215
|
+
options: FindOptions;
|
|
216
|
+
/** All matches found */
|
|
217
|
+
matches: FindMatch[];
|
|
218
|
+
/** Current match index */
|
|
219
|
+
currentIndex: number;
|
|
220
|
+
/** Whether in replace mode */
|
|
221
|
+
replaceMode: boolean;
|
|
222
|
+
}
|
|
223
|
+
/**
|
|
224
|
+
* Return type for the useFindReplace hook
|
|
225
|
+
*/
|
|
226
|
+
interface UseFindReplaceReturn {
|
|
227
|
+
/** Current state */
|
|
228
|
+
state: FindReplaceState;
|
|
229
|
+
/** Open the find dialog */
|
|
230
|
+
openFind: (selectedText?: string) => void;
|
|
231
|
+
/** Open the replace dialog */
|
|
232
|
+
openReplace: (selectedText?: string) => void;
|
|
233
|
+
/** Close the dialog */
|
|
234
|
+
close: () => void;
|
|
235
|
+
/** Toggle dialog visibility */
|
|
236
|
+
toggle: () => void;
|
|
237
|
+
/** Update search text */
|
|
238
|
+
setSearchText: (text: string) => void;
|
|
239
|
+
/** Update replace text */
|
|
240
|
+
setReplaceText: (text: string) => void;
|
|
241
|
+
/** Update find options */
|
|
242
|
+
setOptions: (options: Partial<FindOptions>) => void;
|
|
243
|
+
/** Set search results */
|
|
244
|
+
setMatches: (matches: FindMatch[], currentIndex?: number) => void;
|
|
245
|
+
/** Go to next match */
|
|
246
|
+
goToNextMatch: () => number;
|
|
247
|
+
/** Go to previous match */
|
|
248
|
+
goToPreviousMatch: () => number;
|
|
249
|
+
/** Go to a specific match by index */
|
|
250
|
+
goToMatch: (index: number) => void;
|
|
251
|
+
/** Get current match */
|
|
252
|
+
getCurrentMatch: () => FindMatch | null;
|
|
253
|
+
/** Check if has matches */
|
|
254
|
+
hasMatches: () => boolean;
|
|
255
|
+
}
|
|
256
|
+
/**
|
|
257
|
+
* Hook for managing find/replace dialog state
|
|
258
|
+
*/
|
|
259
|
+
declare function useFindReplace(hookOptions?: FindReplaceOptions): UseFindReplaceReturn;
|
|
260
|
+
|
|
261
|
+
export { type FindReplaceOptions as F, type TableAction as T, type UseFindReplaceReturn as U, type FindReplaceState as a, type TableContext as b, type TableSelection as c, type TableSplitConfig as d, TableToolbar as e, type TableToolbarProps as f, addColumn as g, addRow as h, createTableContext as i, deleteColumn as j, deleteRow as k, getCellAt as l, getColumnCount as m, getTableSplitCellDialogConfig as n, mergeCells as o, splitTableCell as p, splitCell as s, useFindReplace as u };
|