@eigenpal/docx-js-editor 0.0.19 → 0.0.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +83 -0
- package/dist/{ClipboardManager-EZ0C6Onq.d.cts → ClipboardManager-B1jZrC6h.d.cts} +1 -1
- package/dist/{ClipboardManager-D6dkOFg6.d.ts → ClipboardManager-jqJVxB6g.d.ts} +1 -1
- package/dist/{DocumentAgent-BcCDg7i2.d.ts → DocumentAgent-CnJ9AEl_.d.cts} +31 -3
- package/dist/{DocumentAgent-B0EC8lPC.d.cts → DocumentAgent-CrbsDniO.d.ts} +31 -3
- package/dist/{FindReplaceDialog-AWQXKEUQ.js → FindReplaceDialog-AQFR4OCT.js} +1 -2
- package/dist/FindReplaceDialog-J3DI3U5I.cjs +1 -0
- package/dist/{FootnotePropertiesDialog-73VT2ZVZ.cjs → FootnotePropertiesDialog-DO5DCAW6.cjs} +1 -2
- package/dist/{FootnotePropertiesDialog-ZM3EF3EF.js → FootnotePropertiesDialog-YYIZU5U6.js} +1 -2
- package/dist/{HyperlinkDialog-BA25XUT5.js → HyperlinkDialog-HGZ2S37Z.js} +1 -2
- package/dist/HyperlinkDialog-PEPS3C2G.cjs +1 -0
- package/dist/{ImagePositionDialog-AIAMKPFK.js → ImagePositionDialog-DQ4JWS4F.js} +1 -2
- package/dist/{ImagePositionDialog-KMK7ROV2.cjs → ImagePositionDialog-UYXYHSP4.cjs} +1 -2
- package/dist/{ImagePropertiesDialog-ERFCUVCW.js → ImagePropertiesDialog-GJMGLM6G.js} +1 -2
- package/dist/{ImagePropertiesDialog-USMMRK6X.cjs → ImagePropertiesDialog-V6SVKINO.cjs} +1 -2
- package/dist/{TablePropertiesDialog-72CIUAZT.cjs → TablePropertiesDialog-A36OXG3A.cjs} +1 -2
- package/dist/{TablePropertiesDialog-EMUEVYB3.js → TablePropertiesDialog-STZOGHJB.js} +1 -2
- package/dist/{agentApi-BFVyKagE.d.cts → agentApi-DfsWRyrP.d.cts} +1 -1
- package/dist/{agentApi-BFVyKagE.d.ts → agentApi-DfsWRyrP.d.ts} +1 -1
- package/dist/{chunk-FDANI5P4.cjs → chunk-2VHQ7YOQ.cjs} +1 -2
- package/dist/chunk-2Y6FLZ5Q.js +3 -0
- package/dist/chunk-32HMU2UV.js +111 -0
- package/dist/chunk-4CUGBNL2.cjs +1 -0
- package/dist/chunk-5GFXHUMP.js +1 -0
- package/dist/chunk-6NDMKJIE.js +9 -0
- package/dist/chunk-6NYA53QC.cjs +258 -0
- package/dist/chunk-7KJ3YVDQ.js +10 -0
- package/dist/{chunk-JOYPFQW2.js → chunk-AARNCPWR.js} +1 -2
- package/dist/{chunk-4QT5LPBA.cjs → chunk-B7TICMXD.cjs} +16 -17
- package/dist/{chunk-2QOEHCBX.js → chunk-BUEMG4NW.js} +1 -2
- package/dist/{chunk-CV5WFE7K.js → chunk-CLDB6TL7.js} +2 -3
- package/dist/{chunk-M2T6XKT5.js → chunk-CTYOM6BE.js} +1 -2
- package/dist/chunk-EH3NY2DQ.cjs +26 -0
- package/dist/{chunk-FGVGZLBL.js → chunk-FVUGBRDD.js} +1 -2
- package/dist/chunk-FXJAIFPR.js +59 -0
- package/dist/chunk-GICVJSFJ.cjs +9 -0
- package/dist/{chunk-Y6VCTLCJ.js → chunk-H5NTJZO4.js} +1 -2
- package/dist/chunk-HT2Z33YM.cjs +111 -0
- package/dist/chunk-JRRTZZ72.cjs +1 -0
- package/dist/{chunk-T2HQYRA7.cjs → chunk-NVAQQYBJ.cjs} +1 -2
- package/dist/chunk-P3AEZKQO.cjs +3 -0
- package/dist/{chunk-GWBTKVFD.cjs → chunk-P7ZF45KZ.cjs} +1 -2
- package/dist/{chunk-QEBO3EQP.cjs → chunk-PCJ5ACUV.cjs} +1 -2
- package/dist/{chunk-Q6HUGWO6.js → chunk-PJVI53AH.js} +1 -2
- package/dist/chunk-Q7YYC75E.js +258 -0
- package/dist/{chunk-7JSPKVOW.js → chunk-QVPR2W5S.js} +1 -2
- package/dist/{chunk-XZNOV52K.cjs → chunk-TAF6KYDM.cjs} +4 -5
- package/dist/chunk-USRMBYI6.js +3 -0
- package/dist/chunk-UTWPV2I4.js +26 -0
- package/dist/{chunk-DJAEBZ33.cjs → chunk-VTAS7VZ6.cjs} +1 -2
- package/dist/chunk-XQNCLN4T.cjs +3 -0
- package/dist/{chunk-S26DZVRQ.cjs → chunk-XS2AQFMF.cjs} +1 -2
- package/dist/chunk-Y6QBJGMO.cjs +59 -0
- package/dist/{chunk-WD2HTKRR.cjs → chunk-YS7FDEZ4.cjs} +1 -2
- package/dist/chunk-ZTVQA46Q.js +1 -0
- package/dist/{clipboard-beGtyabO.d.ts → clipboard-BE8E-szx.d.ts} +1 -1
- package/dist/{clipboard-CqE-UZ2d.d.cts → clipboard-DkfAv07F.d.cts} +1 -1
- package/dist/{colorResolver-B5YbO_a4.d.ts → colorResolver-CYttioMe.d.ts} +46 -3
- package/dist/{colorResolver-Cu46bSKr.d.cts → colorResolver-Dr8kQZAQ.d.cts} +46 -3
- package/dist/core-plugins-reexport.cjs +1 -2
- package/dist/core-plugins-reexport.d.cts +4 -4
- package/dist/core-plugins-reexport.d.ts +4 -4
- package/dist/core-plugins-reexport.js +1 -2
- package/dist/core-reexport.cjs +1 -2
- package/dist/core-reexport.d.cts +10 -10
- package/dist/core-reexport.d.ts +10 -10
- package/dist/core-reexport.js +1 -2
- package/dist/executor-JGWZ7S6Z.cjs +1 -0
- package/dist/executor-L2MVKMXO.js +1 -0
- package/dist/{fontLoader-CFKpg0Ri.d.ts → fontLoader-BsqQnB4v.d.ts} +1 -1
- package/dist/{fontLoader-HZYfILUm.d.cts → fontLoader-DECXIoMr.d.cts} +1 -1
- package/dist/headless-reexport.cjs +4 -5
- package/dist/headless-reexport.d.cts +7 -7
- package/dist/headless-reexport.d.ts +7 -7
- package/dist/headless-reexport.js +4 -5
- package/dist/index.cjs +6 -7
- package/dist/index.css +0 -1
- package/dist/index.d.cts +12 -12
- package/dist/index.d.ts +12 -12
- package/dist/index.js +6 -7
- package/dist/lib-GD2QD2JK.js +1 -0
- package/dist/lib-HOLGQI5K.cjs +1 -0
- package/dist/mcp-reexport.cjs +9 -10
- package/dist/mcp-reexport.d.cts +2 -2
- package/dist/mcp-reexport.d.ts +2 -2
- package/dist/mcp-reexport.js +4 -5
- package/dist/{processTemplate-G37IM66O.js → processTemplate-3HN7Q3KT.js} +1 -2
- package/dist/processTemplate-BXZKWRQD.cjs +1 -0
- package/dist/{react-BjOCdeTs.d.ts → react-C6bgHDFl.d.ts} +8 -6
- package/dist/{react-UzAn4o7l.d.cts → react-CAlVCYa4.d.cts} +8 -6
- package/dist/react.cjs +1 -2
- package/dist/react.css +0 -1
- package/dist/react.d.cts +5 -5
- package/dist/react.d.ts +5 -5
- package/dist/react.js +1 -2
- package/dist/{registry-DjacfR6Q.d.cts → registry-BU-FbHh-.d.cts} +1 -1
- package/dist/{registry-CV6nYWqP.d.ts → registry-gRbkCooh.d.ts} +1 -1
- package/dist/selectionRects-7QU337P5.cjs +1 -0
- package/dist/selectionRects-V5RC2BYX.js +1 -0
- package/dist/styles.css +1 -1
- package/dist/{types-DwZ3xysp.d.ts → types-7wjInVMW.d.ts} +1 -1
- package/dist/{types-Bnp8rvJn.d.cts → types-DEEpBL9H.d.cts} +1 -1
- package/dist/ui.cjs +1 -2
- package/dist/ui.d.cts +32 -85
- package/dist/ui.d.ts +32 -85
- package/dist/ui.js +1 -2
- package/dist/{variableDetector-CMhJtM96.d.cts → variableDetector-B4oQJa2e.d.cts} +33 -2
- package/dist/{variableDetector-BaDeXz7D.d.ts → variableDetector-BXJaTkiB.d.ts} +33 -2
- package/package.json +2 -1
- package/dist/FindReplaceDialog-AWQXKEUQ.js.map +0 -1
- package/dist/FindReplaceDialog-I4SZDSVP.cjs +0 -2
- package/dist/FindReplaceDialog-I4SZDSVP.cjs.map +0 -1
- package/dist/FootnotePropertiesDialog-73VT2ZVZ.cjs.map +0 -1
- package/dist/FootnotePropertiesDialog-ZM3EF3EF.js.map +0 -1
- package/dist/HyperlinkDialog-BA25XUT5.js.map +0 -1
- package/dist/HyperlinkDialog-V63LPOT2.cjs +0 -2
- package/dist/HyperlinkDialog-V63LPOT2.cjs.map +0 -1
- package/dist/ImagePositionDialog-AIAMKPFK.js.map +0 -1
- package/dist/ImagePositionDialog-KMK7ROV2.cjs.map +0 -1
- package/dist/ImagePropertiesDialog-ERFCUVCW.js.map +0 -1
- package/dist/ImagePropertiesDialog-USMMRK6X.cjs.map +0 -1
- package/dist/TablePropertiesDialog-72CIUAZT.cjs.map +0 -1
- package/dist/TablePropertiesDialog-EMUEVYB3.js.map +0 -1
- package/dist/chunk-2CHPKB5A.cjs +0 -112
- package/dist/chunk-2CHPKB5A.cjs.map +0 -1
- package/dist/chunk-2QOEHCBX.js.map +0 -1
- package/dist/chunk-4QT5LPBA.cjs.map +0 -1
- package/dist/chunk-5DYSI4O4.cjs +0 -60
- package/dist/chunk-5DYSI4O4.cjs.map +0 -1
- package/dist/chunk-5FJXHXFV.cjs +0 -2
- package/dist/chunk-5FJXHXFV.cjs.map +0 -1
- package/dist/chunk-6FEWNF6B.js +0 -4
- package/dist/chunk-6FEWNF6B.js.map +0 -1
- package/dist/chunk-6LF5HZCV.js +0 -10
- package/dist/chunk-6LF5HZCV.js.map +0 -1
- package/dist/chunk-7JSPKVOW.js.map +0 -1
- package/dist/chunk-C33XDRDJ.cjs +0 -28
- package/dist/chunk-C33XDRDJ.cjs.map +0 -1
- package/dist/chunk-CV5WFE7K.js.map +0 -1
- package/dist/chunk-CXJRNISO.js +0 -2
- package/dist/chunk-CXJRNISO.js.map +0 -1
- package/dist/chunk-DJAEBZ33.cjs.map +0 -1
- package/dist/chunk-DP6Q75ZD.js +0 -28
- package/dist/chunk-DP6Q75ZD.js.map +0 -1
- package/dist/chunk-FDANI5P4.cjs.map +0 -1
- package/dist/chunk-FGVGZLBL.js.map +0 -1
- package/dist/chunk-GJ4GKSDU.cjs +0 -2
- package/dist/chunk-GJ4GKSDU.cjs.map +0 -1
- package/dist/chunk-GWBTKVFD.cjs.map +0 -1
- package/dist/chunk-JOYPFQW2.js.map +0 -1
- package/dist/chunk-L54YNLSE.js +0 -2
- package/dist/chunk-L54YNLSE.js.map +0 -1
- package/dist/chunk-LPGMLJMO.js +0 -259
- package/dist/chunk-LPGMLJMO.js.map +0 -1
- package/dist/chunk-M2T6XKT5.js.map +0 -1
- package/dist/chunk-OHG7ROFC.js +0 -11
- package/dist/chunk-OHG7ROFC.js.map +0 -1
- package/dist/chunk-PANKMCFX.cjs +0 -4
- package/dist/chunk-PANKMCFX.cjs.map +0 -1
- package/dist/chunk-Q6HUGWO6.js.map +0 -1
- package/dist/chunk-QDV75OJ4.js +0 -112
- package/dist/chunk-QDV75OJ4.js.map +0 -1
- package/dist/chunk-QEBO3EQP.cjs.map +0 -1
- package/dist/chunk-QVIZ775M.cjs +0 -259
- package/dist/chunk-QVIZ775M.cjs.map +0 -1
- package/dist/chunk-RMUMR42R.cjs +0 -10
- package/dist/chunk-RMUMR42R.cjs.map +0 -1
- package/dist/chunk-S26DZVRQ.cjs.map +0 -1
- package/dist/chunk-T2HQYRA7.cjs.map +0 -1
- package/dist/chunk-ULXNEG66.js +0 -60
- package/dist/chunk-ULXNEG66.js.map +0 -1
- package/dist/chunk-WD2HTKRR.cjs.map +0 -1
- package/dist/chunk-XZNOV52K.cjs.map +0 -1
- package/dist/chunk-Y6VCTLCJ.js.map +0 -1
- package/dist/core-plugins-reexport.cjs.map +0 -1
- package/dist/core-plugins-reexport.js.map +0 -1
- package/dist/core-reexport.cjs.map +0 -1
- package/dist/core-reexport.js.map +0 -1
- package/dist/executor-K5RXUTTR.js +0 -2
- package/dist/executor-K5RXUTTR.js.map +0 -1
- package/dist/executor-XIPIU3H4.cjs +0 -2
- package/dist/executor-XIPIU3H4.cjs.map +0 -1
- package/dist/headless-reexport.cjs.map +0 -1
- package/dist/headless-reexport.js.map +0 -1
- package/dist/index.cjs.map +0 -1
- package/dist/index.css.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/mcp-reexport.cjs.map +0 -1
- package/dist/mcp-reexport.js.map +0 -1
- package/dist/processTemplate-G37IM66O.js.map +0 -1
- package/dist/processTemplate-RFBGVH7T.cjs +0 -2
- package/dist/processTemplate-RFBGVH7T.cjs.map +0 -1
- package/dist/react.cjs.map +0 -1
- package/dist/react.css.map +0 -1
- package/dist/react.js.map +0 -1
- package/dist/selectionRects-6DU7HN7E.js +0 -2
- package/dist/selectionRects-6DU7HN7E.js.map +0 -1
- package/dist/selectionRects-YZSC24ZP.cjs +0 -2
- package/dist/selectionRects-YZSC24ZP.cjs.map +0 -1
- package/dist/ui.cjs.map +0 -1
- package/dist/ui.js.map +0 -1
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export{v as DEFAULT_SELECTION_STYLE,i as DocxEditor,c as ErrorBoundary,b as ErrorProvider,w as HIGH_CONTRAST_SELECTION_STYLE,T as PLUGIN_HOST_STYLES,d as ParseErrorDisplay,U as PluginHost,x as SELECTION_CSS_VARS,e as UnsupportedFeatureWarning,l as ZOOM_PRESETS,O as areSelectionStylesInjected,u as clampZoom,J as clearSelection,P as createSelectionChangeHandler,o as findNearestZoomPreset,r as formatZoom,R as generateOverlayElements,C as generateSelectionCSS,B as getHighlightRectStyle,A as getMergedSelectionRects,p as getNextZoomPreset,q as getPreviousZoomPreset,E as getSelectedText,G as getSelectionBoundingRect,y as getSelectionRects,g as getUserFriendlyMessage,n as getZoomPresets,D as hasActiveSelection,H as highlightTextRange,M as injectSelectionStyles,f as isParseError,K as isSelectionBackwards,F as isSelectionWithin,t as isZoomPreset,z as mergeAdjacentRects,L as normalizeSelectionDirection,s as parseZoom,N as removeSelectionStyles,j as renderAsync,I as selectRange,k as useAutoSave,S as useClipboard,a as useErrorNotifications,Q as useSelectionHighlight,h as useTableSelection,m as useWheelZoom}from'./chunk-LPGMLJMO.js';import'./chunk-CXJRNISO.js';export{B as CellBackgroundPicker,a as ContextMenu,A as DEFAULT_CELL_COLORS,ha as InsertImageDialog,ra as InsertSymbolDialog,aa as InsertTableDialog,Ea as KeyboardShortcutsDialog,P as LoadingIndicator,ya as PasteSpecialDialog,q as PrintButton,r as PrintStyles,g as ResponsePreview,X as ResponsiveToolbar,Y as ResponsiveToolbarGroup,qa as SYMBOL_CATEGORIES,z as TableInsertButtons,y as TableMergeButton,k as TextContextMenu,J as UnsavedIndicator,ma as calculateFitDimensions,ea as clampTableConfig,D as createCellColorOption,O as createChangeTracker,ca as createDefaultTableConfig,j as createErrorResponse,i as createMockResponse,G as createShadingFromColor,Z as createToolbarItem,_ as createToolbarItems,na as dataUrlToBlob,V as delay,pa as formatFileSize,w as formatPrintPageRange,La as formatShortcutKeys,fa as formatTableDimensions,c as getActionShortcut,f as getAllActions,Ka as getAllCategories,N as getAllIndicatorPositions,M as getAllIndicatorVariants,U as getAllLoadingSizes,T as getAllLoadingVariants,Ba as getAllPasteOptions,Ja as getCategoryLabel,F as getCellColorName,H as getColorFromShading,Ia as getCommonShortcuts,I as getContrastingTextColor,e as getDefaultActions,C as getDefaultCellColors,Ca as getDefaultPasteOption,u as getDefaultPrintOptions,Ga as getDefaultShortcuts,o as getDefaultTextContextMenuItems,la as getImageAcceptString,oa as getImageDimensions,S as getLoadingVariantLabel,Aa as getPasteOption,$ as getRecommendedPriority,Ha as getShortcutsByCategory,ka as getSupportedImageExtensions,ta as getSymbolCategories,va as getSymbolUnicodeInfo,ua as getSymbolsByCategory,ga as getTablePresets,m as getTextActionLabel,n as getTextActionShortcut,L as getVariantLabel,d as isActionAvailable,E as isDefaultCellColor,Da as isPasteSpecialShortcut,x as isPrintSupported,p as isTextActionAvailable,ja as isValidImageFile,da as isValidTableConfig,t as openPrintWindow,v as parsePageRange,wa as searchSymbols,xa as symbolFromCodePoint,s as triggerPrint,b as useContextMenu,ia as useInsertImageDialog,sa as useInsertSymbolDialog,ba as useInsertTableDialog,Fa as useKeyboardShortcutsDialog,Q as useLoading,R as useLoadingOperations,za as usePasteSpecial,h as useResponsePreview,W as useResponsiveToolbar,l as useTextContextMenu,K as useUnsavedChanges}from'./chunk-QDV75OJ4.js';export{i as AlignmentButtons,ba as CLIPBOARD_TYPES,g as ColorPicker,b as FontPicker,f as FontSizePicker,N as HorizontalRuler,aa as INTERNAL_CLIPBOARD_TYPE,l as LineSpacingPicker,j as ListButtons,G as PageNavigator,y as PageNumberIndicator,m as StylePicker,p as TableBorderColorPicker,o as TableBorderPicker,q as TableBorderWidthPicker,r as TableCellFillPicker,s as TableMoreDropdown,S as TableToolbar,x as Toolbar,u as ToolbarButton,v as ToolbarGroup,w as ToolbarSeparator,n as ZoomControl,Y as addColumn,W as addRow,M as calculateProgress,F as calculateScrollToPage,E as calculateVisiblePage,J as clampPageNumber,ma as cleanWordHtml,da as copyParagraphs,ca as copyRuns,oa as createClipboardHandlers,k as createDefaultListState,A as createPageFormat,T as createTableContext,Z as deleteColumn,X as deleteRow,z as formatPageOrdinal,L as formatPageRange,V as getCellAt,U as getColumnCount,Q as getMarginInUnits,K as getNavigationShortcuts,B as getPageProgress,P as getRulerDimensions,ia as handlePasteEvent,na as htmlToRuns,la as isEditorHtml,C as isFirstPage,D as isLastPage,I as isValidPageNumber,ka as isWordHtml,_ as mergeCells,fa as paragraphsToClipboardContent,ja as parseClipboardHtml,R as parseMarginFromUnits,H as parsePageInput,O as positionToMargin,ha as readFromClipboard,ea as runsToClipboardContent,$ as splitCell,ga as writeToClipboard}from'./chunk-6FEWNF6B.js';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-M2T6XKT5.js';export{d as HyperlinkDialog,m as useHyperlinkDialog}from'./chunk-Q6HUGWO6.js';export{x as TABLE_DATA_ATTRIBUTES,n as countPageBreaks,b as createColumnBreak,g as createHorizontalRule,c as createLineBreak,a as createPageBreak,e as createPageBreakParagraph,d as createPageBreakRun,F as createSelectionFromDOM,o as findPageBreaks,s as formatLastSaveTime,v as formatStorageSize,t as getAutoSaveStatusLabel,u as getAutoSaveStorageSize,E as getSelectionRuns,m as hasPageBreakBefore,h as insertHorizontalRule,f as insertPageBreak,w as isAutoSaveSupported,l as isBreakContent,j as isColumnBreak,k as isLineBreak,i as isPageBreak,p as removePageBreak}from'./chunk-FGVGZLBL.js';import'./chunk-7JSPKVOW.js';export{c as DocumentAgent,j as buildExtendedSelectionContext,i as buildSelectionContext,b as createDocumentWithText,a as createEmptyDocument,f as getAgentContext,h as getDocumentSummary}from'./chunk-6LF5HZCV.js';export{l as blendColors,m as colorsEqual,i as createRgbColor,h as createThemeColor,j as darkenColor,p as emuToPixels,r as emuToTwips,x as formatPx,f as getContrastingColor,u as halfPointsToPixels,d as isBlack,e as isWhite,k as lightenColor,g as parseColorString,q as pixelsToEmu,o as pixelsToTwips,t as pointsToPixels,a as resolveColor,b as resolveHighlightColor,c as resolveShadingColor,s as twipsToEmu,n as twipsToPixels}from'./chunk-L54YNLSE.js';export{o as docxtemplaterPlugin}from'./chunk-OHG7ROFC.js';export{b as serializeDocumentBody,c as serializeDocx,a as serializeSectionProperties}from'./chunk-ULXNEG66.js';export{a as executeCommand,b as executeCommands}from'./chunk-JOYPFQW2.js';export{l as canRenderFont,j as getLoadedFonts,h as isFontLoaded,i as isFontsLoading,f as loadFont,m as loadFontFromBuffer,g as loadFonts,k as onFontsLoaded,q as parseDocx,n as preloadCommonFonts,p as toArrayBuffer}from'./chunk-DP6Q75ZD.js';export{a as PluginRegistry,b as pluginRegistry,c as registerPlugins}from'./chunk-2QOEHCBX.js';export{e as getTemplateTags,a as processTemplate,c as processTemplateAsBlob,b as processTemplateDetailed,f as validateTemplate}from'./chunk-CV5WFE7K.js';import'./chunk-Y6VCTLCJ.js';import ye,{useState,useRef,useMemo,useCallback,useEffect}from'react';import {PluginKey,TextSelection,Plugin}from'prosemirror-state';import {DecorationSet,Decoration}from'prosemirror-view';import {jsx,jsxs}from'react/jsx-runtime';var Ya=/[\p{L}\p{N}''\-]/u,Za=/\s/;function M(e){return !e||e.length===0?false:Ya.test(e)}function K(e){return !e||e.length===0?false:Za.test(e)}function R(e,t){if(!e||e.length===0)return [0,0];t=Math.max(0,Math.min(t,e.length-1));let o=e[t];if(K(o)){let n=t,r=t;for(;n>0&&K(e[n-1]);)n--;for(;r<e.length&&K(e[r]);)r++;return [n,r]}if(M(o)){let n=t,r=t;for(;n>0&&M(e[n-1]);)n--;for(;r<e.length&&M(e[r]);)r++;return [n,r]}return [t,t+1]}function Xa(e,t){let[o,n]=R(e,t);return e.slice(o,n)}function qa(e,t){let[o,n]=R(e,t);return {word:e.slice(o,n),startIndex:o,endIndex:n}}function $(){let e=window.getSelection();if(!e||e.rangeCount===0)return false;let t=e.getRangeAt(0),o=t.startContainer;if(o.nodeType===Node.TEXT_NODE){let n=o.textContent||"",r=t.startOffset,[a,i]=R(n,r);if(i>a)return t.setStart(o,a),t.setEnd(o,i),e.removeAllRanges(),e.addRange(t),true}if(o.nodeType===Node.ELEMENT_NODE){let n=o,r=q(n);if(r.length>0){let a=t.startOffset,i=null,l=a;if(a<n.childNodes.length){let p=n.childNodes[a];if(p.nodeType===Node.TEXT_NODE)i=p,l=0;else if(p instanceof Element){let d=q(p);d.length>0&&(i=d[0],l=0);}}if(!i&&r.length>0&&(i=r[0],l=0),i){let p=i.textContent||"",[d,c]=R(p,l);if(c>d){let u=document.createRange();return u.setStart(i,d),u.setEnd(i,c),e.removeAllRanges(),e.addRange(u),true}}}}return false}function ja(e,t){let o=window.getSelection();if(!o)return false;let n=e.textContent||"",[r,a]=R(n,t);if(a>r){let i=document.createRange();return i.setStart(e,r),i.setEnd(e,a),o.removeAllRanges(),o.addRange(i),true}return false}function Ja(){let e=window.getSelection();if(!e||e.rangeCount===0)return false;let t=e.getRangeAt(0);if(t.collapsed)return $();let o=t.startContainer,n=t.endContainer,r=t.startOffset,a=t.endOffset;if(o.nodeType===Node.TEXT_NODE){let i=o.textContent||"",[l]=R(i,t.startOffset);r=l;}if(n.nodeType===Node.TEXT_NODE){let i=n.textContent||"",l=Math.max(0,t.endOffset-1),[,p]=R(i,l);a=p;}try{return t.setStart(o,r),t.setEnd(n,a),e.removeAllRanges(),e.addRange(t),!0}catch(i){return console.warn("Could not expand selection to word boundaries:",i),false}}function J(){let e=window.getSelection();if(!e||e.rangeCount===0)return false;let o=e.getRangeAt(0).commonAncestorContainer,n=Qa(o);if(n){let r=document.createRange();return r.selectNodeContents(n),e.removeAllRanges(),e.addRange(r),true}return false}function Qa(e){if(!e)return null;let t=e;for(;t;){if(t instanceof Element&&t.hasAttribute("data-paragraph-index"))return t;t=t.parentNode;}return null}function q(e){let t=[],o=document.createTreeWalker(e,NodeFilter.SHOW_TEXT,null),n;for(;n=o.nextNode();)n.nodeType===Node.TEXT_NODE&&t.push(n);return t}var V=0,O=null,G=null,ei=500;function j(){V=0,G=null,O&&(clearTimeout(O),O=null);}function Q(e){return e.target!==G&&j(),V++,G=e.target,O&&clearTimeout(O),O=setTimeout(j,ei),Math.min(V,3)}function ti(){return e=>{e.ctrlKey||e.metaKey||e.altKey||$();}}function oi(){return e=>{if(Q(e)===3){if(e.ctrlKey||e.metaKey||e.altKey)return;J();}}}function P(e){return e?/[\p{L}\p{N}_]/u.test(e):false}function Y(e){return e?/\s/.test(e):false}function ni(e){return e?/[\p{P}]/u.test(e):false}function ri(e,t){if(t<=0)return 0;t>e.length&&(t=e.length);let o=t;for(;o>0&&Y(e[o-1]);)o--;if(o===0)return 0;for(;o>0&&P(e[o-1]);)o--;return o}function ai(e,t){if(t>=e.length)return e.length;t<0&&(t=0);let o=t;for(;o<e.length&&P(e[o]);)o++;for(;o<e.length&&Y(e[o]);)o++;return o}function ee(e,t){if(t>=e.length)return e.length;let o=t;for(;o<e.length&&P(e[o]);)o++;for(;o<e.length&&!P(e[o]);)o++;return o}function te(e,t){if(t<=0)return 0;let o=t;for(;o>0&&!P(e[o-1]);)o--;for(;o>0&&P(e[o-1]);)o--;return o}function oe(e,t){if(!window.getSelection())return null;let n=document.createRange();if(e.nodeType===Node.TEXT_NODE){n.setStart(e,Math.min(t,e.textContent?.length||0)),n.collapse(true);let a=n.getBoundingClientRect().top,i=0,l=t;for(;i<l;){let p=Math.floor((i+l)/2);n.setStart(e,p),n.collapse(true);let d=n.getBoundingClientRect();Math.abs(d.top-a)<2?l=p:i=p+1;}return {node:e,offset:i}}return null}function ne(e,t){if(!window.getSelection())return null;let n=e.textContent?.length||0,r=document.createRange();if(e.nodeType===Node.TEXT_NODE){r.setStart(e,Math.min(t,n)),r.collapse(true);let i=r.getBoundingClientRect().top,l=t,p=n;for(;l<p;){let d=Math.ceil((l+p)/2);r.setStart(e,d),r.collapse(true);let c=r.getBoundingClientRect();Math.abs(c.top-i)<2?l=d:p=d-1;}return {node:e,offset:l}}return null}function ii(){let e=window.getSelection();if(!e||e.rangeCount===0)return null;let t=e.getRangeAt(0);return {node:t.startContainer,offset:t.startOffset,anchorNode:e.anchorNode,anchorOffset:e.anchorOffset,focusNode:e.focusNode,focusOffset:e.focusOffset,isCollapsed:e.isCollapsed,text:e.toString()}}function H(e,t){let o=window.getSelection();if(!o)return;let n=document.createRange(),r=e.nodeType===Node.TEXT_NODE?e.textContent?.length||0:e.childNodes.length;n.setStart(e,Math.min(t,r)),n.collapse(true),o.removeAllRanges(),o.addRange(n);}function _(e,t){let o=window.getSelection();if(!(!o||!o.anchorNode))try{o.extend(e,Math.min(t,e.textContent?.length||0));}catch{let n=e.nodeType===Node.TEXT_NODE?e.textContent?.length||0:e.childNodes.length;o.setBaseAndExtent(o.anchorNode,o.anchorOffset,e,Math.min(t,n));}}function re(e,t=false){let o=window.getSelection();if(!o||o.rangeCount===0)return false;let n=o.focusNode;if(!n||n.nodeType!==Node.TEXT_NODE)return false;let r=n.textContent||"",a=o.focusOffset,i;return e==="left"?i=te(r,a):i=ee(r,a),t?_(n,i):H(n,i),true}function ae(e,t=false){let o=window.getSelection();if(!o||o.rangeCount===0)return false;let n=o.focusNode;if(!n)return false;if(n.nodeType===Node.TEXT_NODE){let i=e==="start"?oe(n,o.focusOffset):ne(n,o.focusOffset);if(i)return t?_(i.node,i.offset):H(i.node,i.offset),true}let r=n.textContent||"",a=e==="start"?0:r.length;return t?_(n,a):H(n,a),true}function ie(e){let{key:t,ctrlKey:o,metaKey:n,shiftKey:r,altKey:a}=e,i=o||n;switch(t){case "ArrowLeft":if(i)return {direction:"left",unit:"word",extend:r};break;case "ArrowRight":if(i)return {direction:"right",unit:"word",extend:r};break;case "Home":return i?{direction:"left",unit:"document",extend:r}:{direction:"left",unit:"line",extend:r};case "End":return i?{direction:"right",unit:"document",extend:r}:{direction:"right",unit:"line",extend:r}}return null}function si(e,t){let o=ie(e);if(!o)return false;switch(o.unit){case "word":if((o.direction==="left"||o.direction==="right")&&re(o.direction,o.extend))return e.preventDefault(),true;break;case "line":let n=o.direction==="left"?"start":"end";if(ae(n,o.extend))return e.preventDefault(),true;break;case "document":if(o.direction==="left"&&t?.onDocumentStart)return e.preventDefault(),t.onDocumentStart(),true;if(o.direction==="right"&&t?.onDocumentEnd)return e.preventDefault(),t.onDocumentEnd(),true;break}return false}function li(e){let{key:t,ctrlKey:o,metaKey:n}=e;return !!((o||n)&&(t==="ArrowLeft"||t==="ArrowRight")||t==="Home"||t==="End")}function ci(){let e=window.getSelection();if(!e||e.rangeCount===0)return false;let t=e.focusNode;if(!t||t.nodeType!==Node.TEXT_NODE)return false;let o=t.textContent||"",n=e.focusOffset,r=n,a=n;for(;r>0&&P(o[r-1]);)r--;for(;a<o.length&&P(o[a]);)a++;if(r===a)return false;let i=document.createRange();return i.setStart(t,r),i.setEnd(t,a),e.removeAllRanges(),e.addRange(i),true}function pi(){let e=window.getSelection();if(!e||e.rangeCount===0)return null;let t=e.focusNode;if(!t||t.nodeType!==Node.TEXT_NODE)return null;let o=t.textContent||"",n=e.focusOffset,r=n,a=n;for(;r>0&&P(o[r-1]);)r--;for(;a<o.length&&P(o[a]);)a++;return r===a?null:o.slice(r,a)}function di(e,t){let o=e.ctrlKey||e.metaKey,n=t.ctrlKey||t.metaKey;return e.key.toLowerCase()===t.key.toLowerCase()&&o===!!n&&e.shiftKey===!!t.shiftKey&&e.altKey===!!t.altKey}var T={wordLeft:{key:"ArrowLeft",ctrlKey:true},wordRight:{key:"ArrowRight",ctrlKey:true},selectWordLeft:{key:"ArrowLeft",ctrlKey:true,shiftKey:true},selectWordRight:{key:"ArrowRight",ctrlKey:true,shiftKey:true},lineStart:{key:"Home"},lineEnd:{key:"End"},selectToLineStart:{key:"Home",shiftKey:true},selectToLineEnd:{key:"End",shiftKey:true},documentStart:{key:"Home",ctrlKey:true},documentEnd:{key:"End",ctrlKey:true},selectToDocumentStart:{key:"Home",ctrlKey:true,shiftKey:true},selectToDocumentEnd:{key:"End",ctrlKey:true,shiftKey:true}};function S(e){let t=[];if(e.ctrlKey||e.metaKey){let n=typeof navigator<"u"&&/Mac/i.test(navigator.platform);t.push(n?"\u2318":"Ctrl");}e.shiftKey&&t.push("Shift"),e.altKey&&t.push("Alt");let o=e.key;return o==="ArrowLeft"?o="\u2190":o==="ArrowRight"?o="\u2192":o==="ArrowUp"?o="\u2191":o==="ArrowDown"&&(o="\u2193"),t.push(o),t.join("+")}function ui(){return [{action:"Move by word (left)",shortcut:S(T.wordLeft)},{action:"Move by word (right)",shortcut:S(T.wordRight)},{action:"Select word (left)",shortcut:S(T.selectWordLeft)},{action:"Select word (right)",shortcut:S(T.selectWordRight)},{action:"Go to line start",shortcut:S(T.lineStart)},{action:"Go to line end",shortcut:S(T.lineEnd)},{action:"Select to line start",shortcut:S(T.selectToLineStart)},{action:"Select to line end",shortcut:S(T.selectToLineEnd)},{action:"Go to document start",shortcut:S(T.documentStart)},{action:"Go to document end",shortcut:S(T.documentEnd)},{action:"Select to document start",shortcut:S(T.selectToDocumentStart)},{action:"Select to document end",shortcut:S(T.selectToDocumentEnd)}]}var se=/\{([#/^@]?)([a-zA-Z_][a-zA-Z0-9_]*(?:\.[a-zA-Z_][a-zA-Z0-9_]*)*)\}/g,m=new PluginKey("template");function hi(e,t,o){return `${e}:${t}:${o}`}function le(e){let t=[];e.descendants((p,d)=>(p.isText&&p.text&&t.push({text:p.text,pos:d}),true));let o="",n=[];for(let p of t){for(let d=0;d<p.text.length;d++)n.push(p.pos+d);o+=p.text;}let r=[],a=[],i=new Map,l;for(se.lastIndex=0;(l=se.exec(o))!==null;){let[p,d,c]=l,u=n[l.index],x=n[l.index+p.length-1]+1,g;d==="#"?g="sectionStart":d==="/"?g="sectionEnd":d==="^"?g="invertedStart":d==="@"?g="raw":g="variable";let b=`${g}:${c}`,k=i.get(b)??0;i.set(b,k+1);let N={id:hi(g,c,k),type:g,name:c,rawTag:p,from:u,to:x};if(g==="sectionStart"||g==="invertedStart")N.nestedVars=[],a.push(N);else if(g==="sectionEnd"){for(let s=a.length-1;s>=0;s--)if(a[s].name===c){a.splice(s,1);break}}else g==="variable"&&a.length>0&&(a[a.length-1].nestedVars?.push(c),N.insideSection=true);r.push(N);}return r}function yi(e){switch(e){case "sectionStart":case "sectionEnd":return "#3b82f6";case "invertedStart":return "#8b5cf6";case "raw":return "#ef4444";default:return "#f59e0b"}}function Z(e,t,o,n){let r=[];for(let a of t){let i=a.id===o,l=a.id===n,p=yi(a.type),d=["docx-template-tag"];i&&d.push("hovered"),l&&d.push("selected"),r.push(Decoration.inline(a.from,a.to,{class:d.join(" "),"data-tag-id":a.id,style:`background-color: ${p}22; border-radius: 2px;`}));}return DecorationSet.create(e,r)}function Ti(e,t){if(e.length!==t.length)return false;for(let o=0;o<e.length;o++)if(e[o].id!==t[o].id)return false;return true}function B(){return new Plugin({key:m,state:{init(e,t){let o=le(t.doc);return {tags:o,decorations:Z(t.doc,o)}},apply(e,t,o,n){if(e.docChanged){let a=le(n.doc),i=Ti(t.tags,a);return {tags:a,decorations:i?t.decorations.map(e.mapping,e.doc):Z(n.doc,a,t.hoveredId,t.selectedId),hoveredId:t.hoveredId,selectedId:t.selectedId}}let r=e.getMeta(m);if(r){let a=r.hoveredId??t.hoveredId,i=r.selectedId??t.selectedId;return {...t,hoveredId:a,selectedId:i,decorations:Z(n.doc,t.tags,a,i)}}return {...t,decorations:t.decorations.map(e.mapping,e.doc)}}},props:{decorations(e){return m.getState(e)?.decorations??DecorationSet.empty},handleClick(e,t){let n=(m.getState(e.state)?.tags??[]).find(a=>t>=a.from&&t<=a.to);return n?(e.dispatch(e.state.tr.setMeta(m,{selectedId:n.id})),true):(m.getState(e.state)?.selectedId&&e.dispatch(e.state.tr.setMeta(m,{selectedId:void 0})),false)},handleDOMEvents:{mouseover(e,t){let n=t.target.closest?.("[data-tag-id]")?.getAttribute("data-tag-id")||void 0,r=m.getState(e.state)?.hoveredId;return n!==r&&e.dispatch(e.state.tr.setMeta(m,{hoveredId:n})),false},mouseout(e,t){return t.relatedTarget?.closest?.("[data-tag-id]")||m.getState(e.state)?.hoveredId&&e.dispatch(e.state.tr.setMeta(m,{hoveredId:void 0})),false}}}})}function pe(e){return m.getState(e)?.tags??[]}function D(e,t){e.dispatch(e.state.tr.setMeta(m,{hoveredId:t}));}function L(e,t){e.dispatch(e.state.tr.setMeta(m,{selectedId:t}));}var F=`
|
|
1
|
+
export{v as DEFAULT_SELECTION_STYLE,i as DocxEditor,c as ErrorBoundary,b as ErrorProvider,w as HIGH_CONTRAST_SELECTION_STYLE,T as PLUGIN_HOST_STYLES,d as ParseErrorDisplay,U as PluginHost,x as SELECTION_CSS_VARS,e as UnsupportedFeatureWarning,l as ZOOM_PRESETS,O as areSelectionStylesInjected,u as clampZoom,J as clearSelection,P as createSelectionChangeHandler,o as findNearestZoomPreset,r as formatZoom,R as generateOverlayElements,C as generateSelectionCSS,B as getHighlightRectStyle,A as getMergedSelectionRects,p as getNextZoomPreset,q as getPreviousZoomPreset,E as getSelectedText,G as getSelectionBoundingRect,y as getSelectionRects,g as getUserFriendlyMessage,n as getZoomPresets,D as hasActiveSelection,H as highlightTextRange,M as injectSelectionStyles,f as isParseError,K as isSelectionBackwards,F as isSelectionWithin,t as isZoomPreset,z as mergeAdjacentRects,L as normalizeSelectionDirection,s as parseZoom,N as removeSelectionStyles,j as renderAsync,I as selectRange,k as useAutoSave,S as useClipboard,a as useErrorNotifications,Q as useSelectionHighlight,h as useTableSelection,m as useWheelZoom}from'./chunk-Q7YYC75E.js';import'./chunk-5GFXHUMP.js';export{q as ColorPicker,a as ContextMenu,$ as InsertImageDialog,ja as InsertSymbolDialog,U as InsertTableDialog,wa as KeyboardShortcutsDialog,H as LoadingIndicator,qa as PasteSpecialDialog,r as PrintButton,s as PrintStyles,g as ResponsePreview,P as ResponsiveToolbar,Q as ResponsiveToolbarGroup,ia as SYMBOL_CATEGORIES,A as TableInsertButtons,z as TableMergeButton,k as TextContextMenu,B as UnsavedIndicator,ea as calculateFitDimensions,Y as clampTableConfig,G as createChangeTracker,W as createDefaultTableConfig,j as createErrorResponse,i as createMockResponse,R as createToolbarItem,S as createToolbarItems,fa as dataUrlToBlob,N as delay,ha as formatFileSize,x as formatPrintPageRange,Da as formatShortcutKeys,Z as formatTableDimensions,c as getActionShortcut,f as getAllActions,Ca as getAllCategories,F as getAllIndicatorPositions,E as getAllIndicatorVariants,M as getAllLoadingSizes,L as getAllLoadingVariants,ta as getAllPasteOptions,Ba as getCategoryLabel,Aa as getCommonShortcuts,e as getDefaultActions,ua as getDefaultPasteOption,v as getDefaultPrintOptions,ya as getDefaultShortcuts,o as getDefaultTextContextMenuItems,da as getImageAcceptString,ga as getImageDimensions,K as getLoadingVariantLabel,sa as getPasteOption,T as getRecommendedPriority,za as getShortcutsByCategory,ca as getSupportedImageExtensions,la as getSymbolCategories,na as getSymbolUnicodeInfo,ma as getSymbolsByCategory,_ as getTablePresets,m as getTextActionLabel,n as getTextActionShortcut,D as getVariantLabel,d as isActionAvailable,va as isPasteSpecialShortcut,y as isPrintSupported,p as isTextActionAvailable,ba as isValidImageFile,X as isValidTableConfig,u as openPrintWindow,w as parsePageRange,oa as searchSymbols,pa as symbolFromCodePoint,t as triggerPrint,b as useContextMenu,aa as useInsertImageDialog,ka as useInsertSymbolDialog,V as useInsertTableDialog,xa as useKeyboardShortcutsDialog,I as useLoading,J as useLoadingOperations,ra as usePasteSpecial,h as useResponsePreview,O as useResponsiveToolbar,l as useTextContextMenu,C as useUnsavedChanges}from'./chunk-32HMU2UV.js';export{h as AdvancedColorPicker,j as AlignmentButtons,ca as CLIPBOARD_TYPES,b as FontPicker,g as FontSizePicker,O as HorizontalRuler,ba as INTERNAL_CLIPBOARD_TYPE,m as LineSpacingPicker,k as ListButtons,H as PageNavigator,z as PageNumberIndicator,n as StylePicker,q as TableBorderColorPicker,p as TableBorderPicker,r as TableBorderWidthPicker,s as TableCellFillPicker,t as TableMoreDropdown,T as TableToolbar,y as Toolbar,v as ToolbarButton,w as ToolbarGroup,x as ToolbarSeparator,o as ZoomControl,Z as addColumn,X as addRow,N as calculateProgress,G as calculateScrollToPage,F as calculateVisiblePage,K as clampPageNumber,na as cleanWordHtml,ea as copyParagraphs,da as copyRuns,pa as createClipboardHandlers,l as createDefaultListState,B as createPageFormat,U as createTableContext,_ as deleteColumn,Y as deleteRow,A as formatPageOrdinal,M as formatPageRange,W as getCellAt,V as getColumnCount,R as getMarginInUnits,L as getNavigationShortcuts,C as getPageProgress,Q as getRulerDimensions,ja as handlePasteEvent,oa as htmlToRuns,ma as isEditorHtml,D as isFirstPage,E as isLastPage,J as isValidPageNumber,la as isWordHtml,$ as mergeCells,ga as paragraphsToClipboardContent,ka as parseClipboardHtml,S as parseMarginFromUnits,I as parsePageInput,P as positionToMargin,ia as readFromClipboard,fa as runsToClipboardContent,aa as splitCell,ha as writeToClipboard}from'./chunk-2Y6FLZ5Q.js';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-CTYOM6BE.js';export{d as HyperlinkDialog,m as useHyperlinkDialog}from'./chunk-PJVI53AH.js';export{x as TABLE_DATA_ATTRIBUTES,n as countPageBreaks,b as createColumnBreak,g as createHorizontalRule,c as createLineBreak,a as createPageBreak,e as createPageBreakParagraph,d as createPageBreakRun,F as createSelectionFromDOM,o as findPageBreaks,s as formatLastSaveTime,v as formatStorageSize,t as getAutoSaveStatusLabel,u as getAutoSaveStorageSize,E as getSelectionRuns,m as hasPageBreakBefore,h as insertHorizontalRule,f as insertPageBreak,w as isAutoSaveSupported,l as isBreakContent,j as isColumnBreak,k as isLineBreak,i as isPageBreak,p as removePageBreak}from'./chunk-FVUGBRDD.js';import'./chunk-QVPR2W5S.js';export{f as DocumentAgent,m as buildExtendedSelectionContext,l as buildSelectionContext,e as createDocumentWithText,d as createEmptyDocument,i as getAgentContext,k as getDocumentSummary}from'./chunk-6NDMKJIE.js';export{l as blendColors,q as colorsEqual,i as createRgbColor,h as createThemeColor,j as darkenColor,t as emuToPixels,v as emuToTwips,B as formatPx,f as getContrastingColor,y as halfPointsToPixels,d as isBlack,e as isWhite,k as lightenColor,g as parseColorString,u as pixelsToEmu,s as pixelsToTwips,x as pointsToPixels,a as resolveColor,b as resolveHighlightColor,c as resolveShadingColor,w as twipsToEmu,r as twipsToPixels}from'./chunk-ZTVQA46Q.js';export{o as docxtemplaterPlugin}from'./chunk-7KJ3YVDQ.js';export{e as getTemplateTags,a as processTemplate,c as processTemplateAsBlob,b as processTemplateDetailed,f as validateTemplate}from'./chunk-CLDB6TL7.js';export{b as serializeDocumentBody,c as serializeDocx,a as serializeSectionProperties}from'./chunk-FXJAIFPR.js';export{a as executeCommand,b as executeCommands}from'./chunk-AARNCPWR.js';export{k as canRenderFont,i as getLoadedFonts,g as isFontLoaded,h as isFontsLoading,e as loadFont,l as loadFontFromBuffer,f as loadFonts,j as onFontsLoaded,p as parseDocx,m as preloadCommonFonts,o as toArrayBuffer}from'./chunk-UTWPV2I4.js';export{a as PluginRegistry,b as pluginRegistry,c as registerPlugins}from'./chunk-BUEMG4NW.js';import'./chunk-USRMBYI6.js';import'./chunk-H5NTJZO4.js';import ye,{useState,useRef,useMemo,useCallback,useEffect}from'react';import {PluginKey,TextSelection,Plugin}from'prosemirror-state';import {DecorationSet,Decoration}from'prosemirror-view';import {jsx,jsxs}from'react/jsx-runtime';var Ba=/[\p{L}\p{N}''\-]/u,Wa=/\s/;function M(e){return !e||e.length===0?false:Ba.test(e)}function K(e){return !e||e.length===0?false:Wa.test(e)}function R(e,t){if(!e||e.length===0)return [0,0];t=Math.max(0,Math.min(t,e.length-1));let o=e[t];if(K(o)){let n=t,r=t;for(;n>0&&K(e[n-1]);)n--;for(;r<e.length&&K(e[r]);)r++;return [n,r]}if(M(o)){let n=t,r=t;for(;n>0&&M(e[n-1]);)n--;for(;r<e.length&&M(e[r]);)r++;return [n,r]}return [t,t+1]}function Fa(e,t){let[o,n]=R(e,t);return e.slice(o,n)}function Ua(e,t){let[o,n]=R(e,t);return {word:e.slice(o,n),startIndex:o,endIndex:n}}function $(){let e=window.getSelection();if(!e||e.rangeCount===0)return false;let t=e.getRangeAt(0),o=t.startContainer;if(o.nodeType===Node.TEXT_NODE){let n=o.textContent||"",r=t.startOffset,[a,i]=R(n,r);if(i>a)return t.setStart(o,a),t.setEnd(o,i),e.removeAllRanges(),e.addRange(t),true}if(o.nodeType===Node.ELEMENT_NODE){let n=o,r=q(n);if(r.length>0){let a=t.startOffset,i=null,l=a;if(a<n.childNodes.length){let p=n.childNodes[a];if(p.nodeType===Node.TEXT_NODE)i=p,l=0;else if(p instanceof Element){let d=q(p);d.length>0&&(i=d[0],l=0);}}if(!i&&r.length>0&&(i=r[0],l=0),i){let p=i.textContent||"",[d,c]=R(p,l);if(c>d){let u=document.createRange();return u.setStart(i,d),u.setEnd(i,c),e.removeAllRanges(),e.addRange(u),true}}}}return false}function za(e,t){let o=window.getSelection();if(!o)return false;let n=e.textContent||"",[r,a]=R(n,t);if(a>r){let i=document.createRange();return i.setStart(e,r),i.setEnd(e,a),o.removeAllRanges(),o.addRange(i),true}return false}function Va(){let e=window.getSelection();if(!e||e.rangeCount===0)return false;let t=e.getRangeAt(0);if(t.collapsed)return $();let o=t.startContainer,n=t.endContainer,r=t.startOffset,a=t.endOffset;if(o.nodeType===Node.TEXT_NODE){let i=o.textContent||"",[l]=R(i,t.startOffset);r=l;}if(n.nodeType===Node.TEXT_NODE){let i=n.textContent||"",l=Math.max(0,t.endOffset-1),[,p]=R(i,l);a=p;}try{return t.setStart(o,r),t.setEnd(n,a),e.removeAllRanges(),e.addRange(t),!0}catch(i){return console.warn("Could not expand selection to word boundaries:",i),false}}function J(){let e=window.getSelection();if(!e||e.rangeCount===0)return false;let o=e.getRangeAt(0).commonAncestorContainer,n=Ga(o);if(n){let r=document.createRange();return r.selectNodeContents(n),e.removeAllRanges(),e.addRange(r),true}return false}function Ga(e){if(!e)return null;let t=e;for(;t;){if(t instanceof Element&&t.hasAttribute("data-paragraph-index"))return t;t=t.parentNode;}return null}function q(e){let t=[],o=document.createTreeWalker(e,NodeFilter.SHOW_TEXT,null),n;for(;n=o.nextNode();)n.nodeType===Node.TEXT_NODE&&t.push(n);return t}var V=0,O=null,G=null,$a=500;function j(){V=0,G=null,O&&(clearTimeout(O),O=null);}function Q(e){return e.target!==G&&j(),V++,G=e.target,O&&clearTimeout(O),O=setTimeout(j,$a),Math.min(V,3)}function Ya(){return e=>{e.ctrlKey||e.metaKey||e.altKey||$();}}function Za(){return e=>{if(Q(e)===3){if(e.ctrlKey||e.metaKey||e.altKey)return;J();}}}function P(e){return e?/[\p{L}\p{N}_]/u.test(e):false}function Y(e){return e?/\s/.test(e):false}function Xa(e){return e?/[\p{P}]/u.test(e):false}function qa(e,t){if(t<=0)return 0;t>e.length&&(t=e.length);let o=t;for(;o>0&&Y(e[o-1]);)o--;if(o===0)return 0;for(;o>0&&P(e[o-1]);)o--;return o}function ja(e,t){if(t>=e.length)return e.length;t<0&&(t=0);let o=t;for(;o<e.length&&P(e[o]);)o++;for(;o<e.length&&Y(e[o]);)o++;return o}function ee(e,t){if(t>=e.length)return e.length;let o=t;for(;o<e.length&&P(e[o]);)o++;for(;o<e.length&&!P(e[o]);)o++;return o}function te(e,t){if(t<=0)return 0;let o=t;for(;o>0&&!P(e[o-1]);)o--;for(;o>0&&P(e[o-1]);)o--;return o}function oe(e,t){if(!window.getSelection())return null;let n=document.createRange();if(e.nodeType===Node.TEXT_NODE){n.setStart(e,Math.min(t,e.textContent?.length||0)),n.collapse(true);let a=n.getBoundingClientRect().top,i=0,l=t;for(;i<l;){let p=Math.floor((i+l)/2);n.setStart(e,p),n.collapse(true);let d=n.getBoundingClientRect();Math.abs(d.top-a)<2?l=p:i=p+1;}return {node:e,offset:i}}return null}function ne(e,t){if(!window.getSelection())return null;let n=e.textContent?.length||0,r=document.createRange();if(e.nodeType===Node.TEXT_NODE){r.setStart(e,Math.min(t,n)),r.collapse(true);let i=r.getBoundingClientRect().top,l=t,p=n;for(;l<p;){let d=Math.ceil((l+p)/2);r.setStart(e,d),r.collapse(true);let c=r.getBoundingClientRect();Math.abs(c.top-i)<2?l=d:p=d-1;}return {node:e,offset:l}}return null}function Ja(){let e=window.getSelection();if(!e||e.rangeCount===0)return null;let t=e.getRangeAt(0);return {node:t.startContainer,offset:t.startOffset,anchorNode:e.anchorNode,anchorOffset:e.anchorOffset,focusNode:e.focusNode,focusOffset:e.focusOffset,isCollapsed:e.isCollapsed,text:e.toString()}}function H(e,t){let o=window.getSelection();if(!o)return;let n=document.createRange(),r=e.nodeType===Node.TEXT_NODE?e.textContent?.length||0:e.childNodes.length;n.setStart(e,Math.min(t,r)),n.collapse(true),o.removeAllRanges(),o.addRange(n);}function _(e,t){let o=window.getSelection();if(!(!o||!o.anchorNode))try{o.extend(e,Math.min(t,e.textContent?.length||0));}catch{let n=e.nodeType===Node.TEXT_NODE?e.textContent?.length||0:e.childNodes.length;o.setBaseAndExtent(o.anchorNode,o.anchorOffset,e,Math.min(t,n));}}function re(e,t=false){let o=window.getSelection();if(!o||o.rangeCount===0)return false;let n=o.focusNode;if(!n||n.nodeType!==Node.TEXT_NODE)return false;let r=n.textContent||"",a=o.focusOffset,i;return e==="left"?i=te(r,a):i=ee(r,a),t?_(n,i):H(n,i),true}function ae(e,t=false){let o=window.getSelection();if(!o||o.rangeCount===0)return false;let n=o.focusNode;if(!n)return false;if(n.nodeType===Node.TEXT_NODE){let i=e==="start"?oe(n,o.focusOffset):ne(n,o.focusOffset);if(i)return t?_(i.node,i.offset):H(i.node,i.offset),true}let r=n.textContent||"",a=e==="start"?0:r.length;return t?_(n,a):H(n,a),true}function ie(e){let{key:t,ctrlKey:o,metaKey:n,shiftKey:r,altKey:a}=e,i=o||n;switch(t){case "ArrowLeft":if(i)return {direction:"left",unit:"word",extend:r};break;case "ArrowRight":if(i)return {direction:"right",unit:"word",extend:r};break;case "Home":return i?{direction:"left",unit:"document",extend:r}:{direction:"left",unit:"line",extend:r};case "End":return i?{direction:"right",unit:"document",extend:r}:{direction:"right",unit:"line",extend:r}}return null}function Qa(e,t){let o=ie(e);if(!o)return false;switch(o.unit){case "word":if((o.direction==="left"||o.direction==="right")&&re(o.direction,o.extend))return e.preventDefault(),true;break;case "line":let n=o.direction==="left"?"start":"end";if(ae(n,o.extend))return e.preventDefault(),true;break;case "document":if(o.direction==="left"&&t?.onDocumentStart)return e.preventDefault(),t.onDocumentStart(),true;if(o.direction==="right"&&t?.onDocumentEnd)return e.preventDefault(),t.onDocumentEnd(),true;break}return false}function ei(e){let{key:t,ctrlKey:o,metaKey:n}=e;return !!((o||n)&&(t==="ArrowLeft"||t==="ArrowRight")||t==="Home"||t==="End")}function ti(){let e=window.getSelection();if(!e||e.rangeCount===0)return false;let t=e.focusNode;if(!t||t.nodeType!==Node.TEXT_NODE)return false;let o=t.textContent||"",n=e.focusOffset,r=n,a=n;for(;r>0&&P(o[r-1]);)r--;for(;a<o.length&&P(o[a]);)a++;if(r===a)return false;let i=document.createRange();return i.setStart(t,r),i.setEnd(t,a),e.removeAllRanges(),e.addRange(i),true}function oi(){let e=window.getSelection();if(!e||e.rangeCount===0)return null;let t=e.focusNode;if(!t||t.nodeType!==Node.TEXT_NODE)return null;let o=t.textContent||"",n=e.focusOffset,r=n,a=n;for(;r>0&&P(o[r-1]);)r--;for(;a<o.length&&P(o[a]);)a++;return r===a?null:o.slice(r,a)}function ni(e,t){let o=e.ctrlKey||e.metaKey,n=t.ctrlKey||t.metaKey;return e.key.toLowerCase()===t.key.toLowerCase()&&o===!!n&&e.shiftKey===!!t.shiftKey&&e.altKey===!!t.altKey}var T={wordLeft:{key:"ArrowLeft",ctrlKey:true},wordRight:{key:"ArrowRight",ctrlKey:true},selectWordLeft:{key:"ArrowLeft",ctrlKey:true,shiftKey:true},selectWordRight:{key:"ArrowRight",ctrlKey:true,shiftKey:true},lineStart:{key:"Home"},lineEnd:{key:"End"},selectToLineStart:{key:"Home",shiftKey:true},selectToLineEnd:{key:"End",shiftKey:true},documentStart:{key:"Home",ctrlKey:true},documentEnd:{key:"End",ctrlKey:true},selectToDocumentStart:{key:"Home",ctrlKey:true,shiftKey:true},selectToDocumentEnd:{key:"End",ctrlKey:true,shiftKey:true}};function S(e){let t=[];if(e.ctrlKey||e.metaKey){let n=typeof navigator<"u"&&/Mac/i.test(navigator.platform);t.push(n?"\u2318":"Ctrl");}e.shiftKey&&t.push("Shift"),e.altKey&&t.push("Alt");let o=e.key;return o==="ArrowLeft"?o="\u2190":o==="ArrowRight"?o="\u2192":o==="ArrowUp"?o="\u2191":o==="ArrowDown"&&(o="\u2193"),t.push(o),t.join("+")}function ri(){return [{action:"Move by word (left)",shortcut:S(T.wordLeft)},{action:"Move by word (right)",shortcut:S(T.wordRight)},{action:"Select word (left)",shortcut:S(T.selectWordLeft)},{action:"Select word (right)",shortcut:S(T.selectWordRight)},{action:"Go to line start",shortcut:S(T.lineStart)},{action:"Go to line end",shortcut:S(T.lineEnd)},{action:"Select to line start",shortcut:S(T.selectToLineStart)},{action:"Select to line end",shortcut:S(T.selectToLineEnd)},{action:"Go to document start",shortcut:S(T.documentStart)},{action:"Go to document end",shortcut:S(T.documentEnd)},{action:"Select to document start",shortcut:S(T.selectToDocumentStart)},{action:"Select to document end",shortcut:S(T.selectToDocumentEnd)}]}var se=/\{([#/^@]?)([a-zA-Z_][a-zA-Z0-9_]*(?:\.[a-zA-Z_][a-zA-Z0-9_]*)*)\}/g,m=new PluginKey("template");function li(e,t,o){return `${e}:${t}:${o}`}function le(e){let t=[];e.descendants((p,d)=>(p.isText&&p.text&&t.push({text:p.text,pos:d}),true));let o="",n=[];for(let p of t){for(let d=0;d<p.text.length;d++)n.push(p.pos+d);o+=p.text;}let r=[],a=[],i=new Map,l;for(se.lastIndex=0;(l=se.exec(o))!==null;){let[p,d,c]=l,u=n[l.index],x=n[l.index+p.length-1]+1,g;d==="#"?g="sectionStart":d==="/"?g="sectionEnd":d==="^"?g="invertedStart":d==="@"?g="raw":g="variable";let b=`${g}:${c}`,k=i.get(b)??0;i.set(b,k+1);let N={id:li(g,c,k),type:g,name:c,rawTag:p,from:u,to:x};if(g==="sectionStart"||g==="invertedStart")N.nestedVars=[],a.push(N);else if(g==="sectionEnd"){for(let s=a.length-1;s>=0;s--)if(a[s].name===c){a.splice(s,1);break}}else g==="variable"&&a.length>0&&(a[a.length-1].nestedVars?.push(c),N.insideSection=true);r.push(N);}return r}function ci(e){switch(e){case "sectionStart":case "sectionEnd":return "#3b82f6";case "invertedStart":return "#8b5cf6";case "raw":return "#ef4444";default:return "#f59e0b"}}function Z(e,t,o,n){let r=[];for(let a of t){let i=a.id===o,l=a.id===n,p=ci(a.type),d=["docx-template-tag"];i&&d.push("hovered"),l&&d.push("selected"),r.push(Decoration.inline(a.from,a.to,{class:d.join(" "),"data-tag-id":a.id,style:`background-color: ${p}22; border-radius: 2px;`}));}return DecorationSet.create(e,r)}function pi(e,t){if(e.length!==t.length)return false;for(let o=0;o<e.length;o++)if(e[o].id!==t[o].id)return false;return true}function B(){return new Plugin({key:m,state:{init(e,t){let o=le(t.doc);return {tags:o,decorations:Z(t.doc,o)}},apply(e,t,o,n){if(e.docChanged){let a=le(n.doc),i=pi(t.tags,a);return {tags:a,decorations:i?t.decorations.map(e.mapping,e.doc):Z(n.doc,a,t.hoveredId,t.selectedId),hoveredId:t.hoveredId,selectedId:t.selectedId}}let r=e.getMeta(m);if(r){let a=r.hoveredId??t.hoveredId,i=r.selectedId??t.selectedId;return {...t,hoveredId:a,selectedId:i,decorations:Z(n.doc,t.tags,a,i)}}return {...t,decorations:t.decorations.map(e.mapping,e.doc)}}},props:{decorations(e){return m.getState(e)?.decorations??DecorationSet.empty},handleClick(e,t){let n=(m.getState(e.state)?.tags??[]).find(a=>t>=a.from&&t<=a.to);return n?(e.dispatch(e.state.tr.setMeta(m,{selectedId:n.id})),true):(m.getState(e.state)?.selectedId&&e.dispatch(e.state.tr.setMeta(m,{selectedId:void 0})),false)},handleDOMEvents:{mouseover(e,t){let n=t.target.closest?.("[data-tag-id]")?.getAttribute("data-tag-id")||void 0,r=m.getState(e.state)?.hoveredId;return n!==r&&e.dispatch(e.state.tr.setMeta(m,{hoveredId:n})),false},mouseout(e,t){return t.relatedTarget?.closest?.("[data-tag-id]")||m.getState(e.state)?.hoveredId&&e.dispatch(e.state.tr.setMeta(m,{hoveredId:void 0})),false}}}})}function pe(e){return m.getState(e)?.tags??[]}function D(e,t){e.dispatch(e.state.tr.setMeta(m,{hoveredId:t}));}function L(e,t){e.dispatch(e.state.tr.setMeta(m,{selectedId:t}));}var W=`
|
|
2
2
|
.docx-template-tag {
|
|
3
3
|
cursor: pointer;
|
|
4
4
|
transition: background-color 0.1s;
|
|
@@ -12,7 +12,7 @@ export{v as DEFAULT_SELECTION_STYLE,i as DocxEditor,c as ErrorBoundary,b as Erro
|
|
|
12
12
|
.docx-template-tag.selected {
|
|
13
13
|
box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.5);
|
|
14
14
|
}
|
|
15
|
-
`;var
|
|
15
|
+
`;var fi={variable:"#f59e0b",sectionStart:"#3b82f6",sectionEnd:"#3b82f6",invertedStart:"#8b5cf6",raw:"#ef4444"};function mi(e){switch(e){case "sectionStart":return "LOOP / IF";case "invertedStart":return "IF NOT";case "raw":return "HTML";default:return ""}}function U({editorView:e,pluginState:t,renderedDomContext:o}){let n=t?.tags??[],r=t?.hoveredId,a=t?.selectedId,[i,l]=useState(0),p=useRef(null),d=useRef(new Map),c=useRef([]),u=useMemo(()=>n.filter(s=>s.type!=="sectionEnd"&&!s.insideSection),[n]),x=useCallback(()=>{if(u.length===0||!o)return c.current;let s=[],h=o.getContainerOffset(),C=new Map;for(let f of c.current)C.set(f.tag.id,f.top);for(let f of u){let y=o.getRectsForRange(f.from,f.from+1);if(y.length>0){let v=y[0].y+h.y-40;s.push({tag:f,top:v});}else {let v=C.get(f.id);v!==void 0&&s.push({tag:f,top:v});}}s.sort((f,y)=>f.top-y.top);let I=6;for(let f=1;f<s.length;f++){let y=s[f-1],v=s[f],E=d.current.get(y.tag.id),w=32;E?w=E.offsetHeight:y.tag.nestedVars&&y.tag.nestedVars.length>0&&(w=42+y.tag.nestedVars.length*26),v.top<y.top+w+I&&(v.top=y.top+w+I);}return c.current=s,s},[u,o]),g=useMemo(()=>x(),[x,i]);useEffect(()=>{if(!o)return;let s=new ResizeObserver(()=>{requestAnimationFrame(()=>l(h=>h+1));});return s.observe(o.pagesContainer),()=>s.disconnect()},[o]),useEffect(()=>{let s=()=>{requestAnimationFrame(()=>l(h=>h+1));};return window.addEventListener("resize",s),()=>window.removeEventListener("resize",s)},[]);let b=useRef("");useEffect(()=>{let s=u.map(h=>h.id).join(",");if(s&&b.current!==s){let h=setTimeout(()=>{b.current=s,l(C=>C+1);},50);return ()=>clearTimeout(h)}},[u]);let k=s=>{e&&D(e,s);},N=s=>{if(!e)return;L(e,s.id);let{state:h}=e,C=h.tr.setSelection(TextSelection.near(h.doc.resolve(s.from)));e.dispatch(C),e.focus();};return u.length===0?null:jsx("div",{className:"template-panel",ref:p,children:jsx("div",{className:"template-panel-annotations",children:g.map(({tag:s,top:h})=>{let C=mi(s.type),I=fi[s.type],f=s.type==="sectionStart"||s.type==="invertedStart",y=s.id===r,v=s.id===a;return jsxs("div",{className:"template-annotation-anchor",style:{top:`${h}px`},children:[jsx("div",{className:"template-annotation-connector"}),jsxs("div",{ref:E=>{E?d.current.set(s.id,E):d.current.delete(s.id);},className:`template-annotation-chip ${y?"hovered":""} ${v?"selected":""}`,style:{borderLeftColor:I},onMouseEnter:()=>k(s.id),onMouseLeave:()=>k(void 0),onClick:()=>N(s),title:f?`${s.rawTag}
|
|
16
16
|
Iterates over ${s.name}[]. Access nested properties via ${s.name}.property`:s.rawTag,children:[C&&jsx("span",{className:"template-chip-badge",style:{background:I},children:C}),!C&&jsx("span",{className:"template-chip-dot",style:{color:I},children:"\u25CF"}),jsx("span",{className:"template-chip-name",children:s.name}),f&&s.nestedVars&&s.nestedVars.length>0&&jsx("div",{className:"template-chip-nested",children:s.nestedVars.map((E,w)=>jsx("span",{className:"template-nested-var",title:`Access: ${s.name}.${E}`,children:E.includes(".")?E.split(".").pop():E},w))})]})]},s.id)})})})}var z=`
|
|
17
17
|
.template-panel {
|
|
18
18
|
display: flex;
|
|
@@ -124,7 +124,7 @@ Iterates over ${s.name}[]. Access nested properties via ${s.name}.property`:s.ra
|
|
|
124
124
|
background: rgba(59, 130, 246, 0.15);
|
|
125
125
|
color: #1e40af;
|
|
126
126
|
}
|
|
127
|
-
`;var
|
|
127
|
+
`;var Si={variable:"rgba(245, 158, 11, 0.3)",sectionStart:"rgba(59, 130, 246, 0.3)",sectionEnd:"rgba(59, 130, 246, 0.3)",invertedStart:"rgba(139, 92, 246, 0.3)",raw:"rgba(239, 68, 68, 0.3)"},xi={variable:"rgba(245, 158, 11, 0.5)",sectionStart:"rgba(59, 130, 246, 0.5)",sectionEnd:"rgba(59, 130, 246, 0.5)",invertedStart:"rgba(139, 92, 246, 0.5)",raw:"rgba(239, 68, 68, 0.5)"};function me({context:e,tags:t,hoveredId:o,selectedId:n,onHover:r,onSelect:a}){let[i,l]=useState(0),p=useCallback(()=>{let c=e.getContainerOffset(),u=[];for(let x of t){let g=e.getRectsForRange(x.from,x.to);for(let b of g)u.push({tagId:x.id,tagType:x.type,x:b.x+c.x,y:b.y+c.y,width:b.width,height:b.height});}return u},[e,t]),d=useMemo(()=>p(),[p,i]);return useEffect(()=>{let c=()=>{requestAnimationFrame(()=>l(u=>u+1));};return window.addEventListener("resize",c),()=>window.removeEventListener("resize",c)},[]),useEffect(()=>{let c=new ResizeObserver(()=>{requestAnimationFrame(()=>l(u=>u+1));});return c.observe(e.pagesContainer),()=>c.disconnect()},[e.pagesContainer]),d.length===0?null:jsx("div",{className:"template-highlight-overlay",children:d.map((c,u)=>{let x=c.tagId===o,g=c.tagId===n,b=x||g?xi[c.tagType]:Si[c.tagType];return jsx("div",{className:`template-highlight ${x?"hovered":""} ${g?"selected":""}`,style:{position:"absolute",left:c.x,top:c.y,width:c.width,height:c.height,backgroundColor:b,borderRadius:2,cursor:"pointer"},onMouseEnter:()=>r?.(c.tagId),onMouseLeave:()=>r?.(void 0),onClick:()=>a?.(c.tagId)},`${c.tagId}-${u}`)})})}var he=`
|
|
128
128
|
.template-highlight-overlay {
|
|
129
129
|
position: absolute;
|
|
130
130
|
top: 0;
|
|
@@ -148,9 +148,8 @@ Iterates over ${s.name}[]. Access nested properties via ${s.name}.property`:s.ra
|
|
|
148
148
|
.template-highlight.selected {
|
|
149
149
|
box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.6);
|
|
150
150
|
}
|
|
151
|
-
`;var
|
|
152
|
-
${
|
|
151
|
+
`;var Pi=ye.memo(U,(e,t)=>{let o=e.pluginState,n=t.pluginState;if(o?.hoveredId!==n?.hoveredId||o?.selectedId!==n?.selectedId)return false;let r=o?.tags??[],a=n?.tags??[];if(r.length!==a.length)return false;for(let i=0;i<r.length;i++)if(r[i].id!==a[i].id)return false;return e.renderedDomContext===t.renderedDomContext});function Te(e={}){return {id:"template",name:"Template",proseMirrorPlugins:[B()],Panel:Pi,panelConfig:{position:e.panelPosition??"right",defaultSize:e.panelWidth??280,minSize:200,maxSize:400,resizable:true,collapsible:true,defaultCollapsed:e.defaultCollapsed??false},onStateChange:o=>{let n=m.getState(o.state);if(n)return {tags:n.tags,hoveredId:n.hoveredId,selectedId:n.selectedId}},initialize:o=>({tags:[]}),renderOverlay:(o,n,r)=>!n||n.tags.length===0?null:ye.createElement(me,{context:o,tags:n.tags,hoveredId:n.hoveredId,selectedId:n.selectedId,onHover:a=>{r&&D(r,a);},onSelect:a=>{if(r){L(r,a);let i=n.tags.find(l=>l.id===a);if(i){let l=r.state.tr.setSelection(TextSelection.near(r.state.doc.resolve(i.from)));r.dispatch(l),r.focus();}}}}),styles:`
|
|
152
|
+
${W}
|
|
153
153
|
${z}
|
|
154
154
|
${he}
|
|
155
|
-
`}}var
|
|
156
|
-
//# sourceMappingURL=index.js.map
|
|
155
|
+
`}}var Ci=Te();var Gi="0.0.2";export{z as ANNOTATION_PANEL_STYLES,U as AnnotationPanel,T as NAVIGATION_SHORTCUTS,W as TEMPLATE_DECORATION_STYLES,Gi as VERSION,Ya as createDoubleClickWordSelector,Te as createTemplatePlugin,B as createTemplateProseMirrorPlugin,Za as createTripleClickParagraphSelector,S as describeShortcut,ti as expandSelectionToWord,Va as expandSelectionToWordBoundaries,_ as extendSelectionTo,ee as findNextWordStart,te as findPreviousWordStart,ne as findVisualLineEnd,oe as findVisualLineStart,Ua as findWordAt,R as findWordBoundaries,ja as findWordEnd,qa as findWordStart,ri as getNavigationShortcutDescriptions,Ja as getSelectionInfo,pe as getTemplatePluginTags,Fa as getWordAt,oi as getWordAtCursor,Q as handleClickForMultiClick,Qa as handleNavigationKey,ei as isNavigationKey,Xa as isPunctuation,K as isWhitespace,Y as isWhitespaceChar,P as isWordChar,M as isWordCharacter,ni as matchesShortcut,re as moveByWord,ae as moveToLineEdge,ie as parseNavigationAction,J as selectParagraphAtCursor,$ as selectWordAtCursor,za as selectWordInTextNode,D as setHoveredElement,L as setSelectedElement,H as setSelectionPosition,Ci as templatePlugin,m as templatePluginKey};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import {a}from'./chunk-USRMBYI6.js';import'./chunk-H5NTJZO4.js';var libGD2QD2JK = a();export{libGD2QD2JK as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
'use strict';var chunkXQNCLN4T_cjs=require('./chunk-XQNCLN4T.cjs');require('./chunk-PCJ5ACUV.cjs');var libHOLGQI5K = chunkXQNCLN4T_cjs.a();module.exports=libHOLGQI5K;
|
package/dist/mcp-reexport.cjs
CHANGED
|
@@ -1,17 +1,16 @@
|
|
|
1
|
-
'use strict';var
|
|
1
|
+
'use strict';var chunkY6QBJGMO_cjs=require('./chunk-Y6QBJGMO.cjs'),chunkP7ZF45KZ_cjs=require('./chunk-P7ZF45KZ.cjs'),chunkEH3NY2DQ_cjs=require('./chunk-EH3NY2DQ.cjs'),chunkYS7FDEZ4_cjs=require('./chunk-YS7FDEZ4.cjs');require('./chunk-XQNCLN4T.cjs'),require('./chunk-PCJ5ACUV.cjs');var u={type:"string",description:"Document ID returned from docx_load"},h={type:"object",properties:{paragraphIndex:{type:"number",description:"Index of the paragraph (0-indexed)",minimum:0},offset:{type:"number",description:"Character offset within the paragraph",minimum:0}},required:["paragraphIndex","offset"]},T={type:"object",properties:{start:h,end:h},required:["start","end"]},D={name:"docx_load",description:`Load a DOCX document from base64-encoded content.
|
|
2
2
|
Returns a document ID that can be used with other tools.
|
|
3
|
-
The document remains in session memory until closed.`,inputSchema:{type:"object",properties:{content:{type:"string",description:"Base64-encoded DOCX file content"},source:{type:"string",description:"Optional source filename or identifier for reference"}},required:["content"]},handler:async(r,s)=>{let{content:e,source:c}=r;try{let t=atob(e),n=new Uint8Array(t.length);for(let l=0;l<t.length;l++)n[l]=t.charCodeAt(l);let o=n.buffer,a=await
|
|
4
|
-
Returns the document as a base64 string that can be saved to a file.`,inputSchema:{type:"object",properties:{documentId:u},required:["documentId"]},handler:async(r,s)=>{let{documentId:e}=r,c=s.session.documents.get(e);if(!c)return {isError:true,content:[{type:"text",text:`Document not found: ${e}`}]};try{let t;c.buffer?t=await
|
|
3
|
+
The document remains in session memory until closed.`,inputSchema:{type:"object",properties:{content:{type:"string",description:"Base64-encoded DOCX file content"},source:{type:"string",description:"Optional source filename or identifier for reference"}},required:["content"]},handler:async(r,s)=>{let{content:e,source:c}=r;try{let t=atob(e),n=new Uint8Array(t.length);for(let l=0;l<t.length;l++)n[l]=t.charCodeAt(l);let o=n.buffer,a=await chunkEH3NY2DQ_cjs.p(o),d=`doc_${Date.now()}_${Math.random().toString(36).substr(2,9)}`;s.session.documents.set(d,{id:d,document:a,buffer:o,source:c,lastModified:Date.now()});let p=a.package.document.content.filter(l=>l.type==="paragraph").length;return {content:[{type:"text",text:JSON.stringify({documentId:d,source:c,paragraphCount:p,message:"Document loaded successfully"})}]}}catch(t){return {isError:true,content:[{type:"text",text:`Failed to load document: ${t.message}`}]}}},annotations:{category:"core",readOnly:false,complexity:"low"}},C={name:"docx_save",description:`Export the document to base64-encoded DOCX format.
|
|
4
|
+
Returns the document as a base64 string that can be saved to a file.`,inputSchema:{type:"object",properties:{documentId:u},required:["documentId"]},handler:async(r,s)=>{let{documentId:e}=r,c=s.session.documents.get(e);if(!c)return {isError:true,content:[{type:"text",text:`Document not found: ${e}`}]};try{let t;c.buffer?t=await chunkY6QBJGMO_cjs.d(c.document):t=await chunkY6QBJGMO_cjs.f(c.document);let n=new Uint8Array(t),o="";for(let d=0;d<n.length;d++)o+=String.fromCharCode(n[d]);let a=btoa(o);return {content:[{type:"text",text:JSON.stringify({documentId:e,base64:a,size:t.byteLength,message:"Document exported successfully"})}]}}catch(t){return {isError:true,content:[{type:"text",text:`Failed to save document: ${t.message}`}]}}},annotations:{category:"core",readOnly:true,complexity:"low"}},R={name:"docx_close",description:`Close a document and free its memory.
|
|
5
5
|
Use this when done working with a document.`,inputSchema:{type:"object",properties:{documentId:u},required:["documentId"]},handler:async(r,s)=>{let{documentId:e}=r;return s.session.documents.has(e)?(s.session.documents.delete(e),{content:[{type:"text",text:JSON.stringify({documentId:e,message:"Document closed"})}]}):{isError:true,content:[{type:"text",text:`Document not found: ${e}`}]}},annotations:{category:"core",readOnly:false,complexity:"low"}},k={name:"docx_get_info",description:`Get metadata and statistics about a document.
|
|
6
6
|
Returns paragraph count, word count, table count, and other useful info.`,inputSchema:{type:"object",properties:{documentId:u},required:["documentId"]},handler:async(r,s)=>{let{documentId:e}=r,c=s.session.documents.get(e);if(!c)return {isError:true,content:[{type:"text",text:`Document not found: ${e}`}]};let t=c.document,n=t.package.document,o=n.content.filter(p=>p.type==="paragraph"),a=n.content.filter(p=>p.type==="table"),d=0;for(let p of o)if(p.type==="paragraph"){let l=P(p);d+=l.split(/\s+/).filter(x=>x.length>0).length;}return {content:[{type:"text",text:JSON.stringify({documentId:e,paragraphCount:o.length,tableCount:a.length,wordCount:d,hasStyles:!!t.package.styles,hasTheme:!!t.package.theme,source:c.source,lastModified:c.lastModified})}]}},annotations:{category:"core",readOnly:true,complexity:"low"}},$={name:"docx_get_text",description:`Get the plain text content of the document.
|
|
7
7
|
Returns all text concatenated with paragraph breaks.
|
|
8
8
|
Useful for understanding document content before making edits.`,inputSchema:{type:"object",properties:{documentId:u,maxLength:{type:"number",description:"Maximum characters to return (default: 10000)",default:1e4}},required:["documentId"]},handler:async(r,s)=>{let{documentId:e,maxLength:c=1e4}=r,t=s.session.documents.get(e);if(!t)return {isError:true,content:[{type:"text",text:`Document not found: ${e}`}]};let n=t.document.package.document,o=[];for(let p of n.content)p.type==="paragraph"?o.push(P(p)):p.type==="table"&&o.push("[TABLE]");let a=o.join(`
|
|
9
9
|
`),d=a.length>c;return d&&(a=a.slice(0,c)+"..."),{content:[{type:"text",text:JSON.stringify({documentId:e,text:a,truncated:d,totalLength:d?o.join(`
|
|
10
10
|
`).length:a.length})}]}},annotations:{category:"core",readOnly:true,complexity:"low"}},J={name:"docx_insert_text",description:`Insert text at a specific position in the document.
|
|
11
|
-
Position is specified by paragraph index (0-indexed) and character offset.`,inputSchema:{type:"object",properties:{documentId:u,position:h,text:{type:"string",description:"Text to insert"}},required:["documentId","position","text"]},handler:async(r,s)=>{let{documentId:e,position:c,text:t}=r,n=s.session.documents.get(e);if(!n)return {isError:true,content:[{type:"text",text:`Document not found: ${e}`}]};try{let o=
|
|
12
|
-
Specify start and end positions to define the range to replace.`,inputSchema:{type:"object",properties:{documentId:u,range:T,text:{type:"string",description:"Replacement text"}},required:["documentId","range","text"]},handler:async(r,s)=>{let{documentId:e,range:c,text:t}=r,n=s.session.documents.get(e);if(!n)return {isError:true,content:[{type:"text",text:`Document not found: ${e}`}]};try{let o=
|
|
13
|
-
Specify start and end positions to define the range to delete.`,inputSchema:{type:"object",properties:{documentId:u,range:T},required:["documentId","range"]},handler:async(r,s)=>{let{documentId:e,range:c}=r,t=s.session.documents.get(e);if(!t)return {isError:true,content:[{type:"text",text:`Document not found: ${e}`}]};try{let n=
|
|
14
|
-
Supports bold, italic, underline, font size, font family, color, and highlight.`,inputSchema:{type:"object",properties:{documentId:u,range:T,formatting:{type:"object",description:"Formatting options to apply",properties:{bold:{type:"boolean"},italic:{type:"boolean"},underline:{type:"boolean"},strikethrough:{type:"boolean"},fontSize:{type:"number",description:"Font size in points"},fontFamily:{type:"string"},color:{type:"string",description:'Hex color (e.g., "#FF0000")'},highlight:{type:"string",description:"Highlight color name"}}}},required:["documentId","range","formatting"]},handler:async(r,s)=>{let{documentId:e,range:c,formatting:t}=r,n=s.session.documents.get(e);if(!n)return {isError:true,content:[{type:"text",text:`Document not found: ${e}`}]};try{let o=
|
|
15
|
-
Use document styles like "Heading1", "Heading2", "Normal", etc.`,inputSchema:{type:"object",properties:{documentId:u,paragraphIndex:{type:"number",description:"Index of the paragraph (0-indexed)",minimum:0},styleId:{type:"string",description:'Style ID (e.g., "Heading1", "Normal")'}},required:["documentId","paragraphIndex","styleId"]},handler:async(r,s)=>{let{documentId:e,paragraphIndex:c,styleId:t}=r,n=s.session.documents.get(e);if(!n)return {isError:true,content:[{type:"text",text:`Document not found: ${e}`}]};try{let o=
|
|
16
|
-
`);}catch{}}),c.on("close",()=>{r.debug&&console.error("[MCP] Server closed"),process.exit(0);});}function z(r){return typeof r=="object"&&r!==null&&("type"in r||"properties"in r)?r:{type:"object",properties:{}}}exports.applyStyleTool=O;exports.closeDocumentTool=R;exports.coreMcpTools=y;exports.createMcpServer=q;exports.deleteTextTool=j;exports.formatTextTool=E;exports.getDocumentInfoTool=k;exports.getDocumentTextTool=$;exports.handleJsonRpcRequest=F;exports.insertTextTool=J;exports.loadDocumentTool=D;exports.replaceTextTool=v;exports.saveDocumentTool=C;exports.startStdioServer=H
|
|
17
|
-
//# sourceMappingURL=mcp-reexport.cjs.map
|
|
11
|
+
Position is specified by paragraph index (0-indexed) and character offset.`,inputSchema:{type:"object",properties:{documentId:u,position:h,text:{type:"string",description:"Text to insert"}},required:["documentId","position","text"]},handler:async(r,s)=>{let{documentId:e,position:c,text:t}=r,n=s.session.documents.get(e);if(!n)return {isError:true,content:[{type:"text",text:`Document not found: ${e}`}]};try{let o=chunkP7ZF45KZ_cjs.a(n.document,{type:"insertText",position:c,text:t});return n.document=o,n.lastModified=Date.now(),{content:[{type:"text",text:JSON.stringify({success:!0,insertedLength:t.length,position:c})}]}}catch(o){return {isError:true,content:[{type:"text",text:`Failed to insert text: ${o.message}`}]}}},annotations:{category:"core",readOnly:false,complexity:"low"}},v={name:"docx_replace_text",description:`Replace text in a range with new text.
|
|
12
|
+
Specify start and end positions to define the range to replace.`,inputSchema:{type:"object",properties:{documentId:u,range:T,text:{type:"string",description:"Replacement text"}},required:["documentId","range","text"]},handler:async(r,s)=>{let{documentId:e,range:c,text:t}=r,n=s.session.documents.get(e);if(!n)return {isError:true,content:[{type:"text",text:`Document not found: ${e}`}]};try{let o=chunkP7ZF45KZ_cjs.a(n.document,{type:"replaceText",range:c,text:t});return n.document=o,n.lastModified=Date.now(),{content:[{type:"text",text:JSON.stringify({success:!0,replacedRange:c,newTextLength:t.length})}]}}catch(o){return {isError:true,content:[{type:"text",text:`Failed to replace text: ${o.message}`}]}}},annotations:{category:"core",readOnly:false,complexity:"low"}},j={name:"docx_delete_text",description:`Delete text in a range.
|
|
13
|
+
Specify start and end positions to define the range to delete.`,inputSchema:{type:"object",properties:{documentId:u,range:T},required:["documentId","range"]},handler:async(r,s)=>{let{documentId:e,range:c}=r,t=s.session.documents.get(e);if(!t)return {isError:true,content:[{type:"text",text:`Document not found: ${e}`}]};try{let n=chunkP7ZF45KZ_cjs.a(t.document,{type:"deleteText",range:c});return t.document=n,t.lastModified=Date.now(),{content:[{type:"text",text:JSON.stringify({success:!0,deletedRange:c})}]}}catch(n){return {isError:true,content:[{type:"text",text:`Failed to delete text: ${n.message}`}]}}},annotations:{category:"core",readOnly:false,complexity:"low"}},E={name:"docx_format_text",description:`Apply formatting to text in a range.
|
|
14
|
+
Supports bold, italic, underline, font size, font family, color, and highlight.`,inputSchema:{type:"object",properties:{documentId:u,range:T,formatting:{type:"object",description:"Formatting options to apply",properties:{bold:{type:"boolean"},italic:{type:"boolean"},underline:{type:"boolean"},strikethrough:{type:"boolean"},fontSize:{type:"number",description:"Font size in points"},fontFamily:{type:"string"},color:{type:"string",description:'Hex color (e.g., "#FF0000")'},highlight:{type:"string",description:"Highlight color name"}}}},required:["documentId","range","formatting"]},handler:async(r,s)=>{let{documentId:e,range:c,formatting:t}=r,n=s.session.documents.get(e);if(!n)return {isError:true,content:[{type:"text",text:`Document not found: ${e}`}]};try{let o=chunkP7ZF45KZ_cjs.a(n.document,{type:"formatText",range:c,formatting:t});return n.document=o,n.lastModified=Date.now(),{content:[{type:"text",text:JSON.stringify({success:!0,range:c,appliedFormatting:t})}]}}catch(o){return {isError:true,content:[{type:"text",text:`Failed to format text: ${o.message}`}]}}},annotations:{category:"core",readOnly:false,complexity:"medium"}},O={name:"docx_apply_style",description:`Apply a named style to a paragraph.
|
|
15
|
+
Use document styles like "Heading1", "Heading2", "Normal", etc.`,inputSchema:{type:"object",properties:{documentId:u,paragraphIndex:{type:"number",description:"Index of the paragraph (0-indexed)",minimum:0},styleId:{type:"string",description:'Style ID (e.g., "Heading1", "Normal")'}},required:["documentId","paragraphIndex","styleId"]},handler:async(r,s)=>{let{documentId:e,paragraphIndex:c,styleId:t}=r,n=s.session.documents.get(e);if(!n)return {isError:true,content:[{type:"text",text:`Document not found: ${e}`}]};try{let o=chunkP7ZF45KZ_cjs.a(n.document,{type:"applyStyle",paragraphIndex:c,styleId:t});return n.document=o,n.lastModified=Date.now(),{content:[{type:"text",text:JSON.stringify({success:!0,paragraphIndex:c,styleId:t})}]}}catch(o){return {isError:true,content:[{type:"text",text:`Failed to apply style: ${o.message}`}]}}},annotations:{category:"core",readOnly:false,complexity:"low"}};function P(r){let s=[];for(let e of r.content)e.type==="run"?s.push(_(e)):e.type==="hyperlink"&&s.push(A(e));return s.join("")}function _(r){return r.content.filter(s=>s.type==="text").map(s=>s.text).join("")}function A(r){let s=[];for(let e of r.children)e.type==="run"&&s.push(_(e));return s.join("")}var y=[D,C,R,k,$,J,v,j,E,O];function q(r={}){let{name:s="docx-editor",version:e="0.1.0",includeCoreTools:c=true,debug:t=false,additionalTools:n=[]}=r,o=new Map,a={id:`session_${Date.now()}_${Math.random().toString(36).substr(2,9)}`,documents:new Map,data:new Map};if(c)for(let i of y)o.set(i.name,i),t&&console.log(`[MCP] Registered core tool: ${i.name}`);let d=chunkYS7FDEZ4_cjs.b.getMcpTools();for(let i of d)o.has(i.name)&&console.warn(`[MCP] Tool '${i.name}' from plugin overrides existing tool`),o.set(i.name,i),t&&console.log(`[MCP] Registered plugin tool: ${i.name}`);for(let i of n)o.set(i.name,i),t&&console.log(`[MCP] Registered additional tool: ${i.name}`);let p=t?(i,f)=>{console.log(`[MCP] ${i}`,f??"");}:()=>{};async function l(i,f){let M=o.get(i);if(!M)throw new Error(`Unknown tool: ${i}`);p(`Calling tool: ${i}`,f);let N={session:a,log:p};try{let g=await M.handler(f,N);return p(`Tool ${i} completed`,g),g}catch(g){throw p(`Tool ${i} failed`,g),g}}function x(){return Array.from(o.values()).map(i=>({name:i.name,description:i.description,inputSchema:z(i.inputSchema),category:i.annotations?.category}))}function L(){return {name:s,version:e,toolCount:o.size}}return {tools:o,session:a,handleToolCall:l,listTools:x,getInfo:L}}async function F(r,s){let{id:e,method:c,params:t}=s;try{switch(c){case "initialize":return {jsonrpc:"2.0",id:e,result:{protocolVersion:"2024-11-05",capabilities:{tools:{}},serverInfo:r.getInfo()}};case "tools/list":{let n=r.listTools();return {jsonrpc:"2.0",id:e,result:{tools:n.map(o=>({name:o.name,description:o.description,inputSchema:o.inputSchema}))}}}case "tools/call":{let{name:n,arguments:o}=t,a=await r.handleToolCall(n,o);return {jsonrpc:"2.0",id:e,result:a}}default:return {jsonrpc:"2.0",id:e,error:{code:-32601,message:`Method not found: ${c}`}}}}catch(n){return {jsonrpc:"2.0",id:e,error:{code:-32e3,message:n.message}}}}async function H(r={}){let s=q(r);r.debug&&(console.error(`[MCP] Server started: ${s.getInfo().name} v${s.getInfo().version}`),console.error(`[MCP] Tools registered: ${s.tools.size}`));let c=(await import('readline')).createInterface({input:process.stdin,output:process.stdout,terminal:false}),t="";c.on("line",async n=>{t+=n;try{let o=JSON.parse(t);t="";let a=await F(s,o);process.stdout.write(JSON.stringify(a)+`
|
|
16
|
+
`);}catch{}}),c.on("close",()=>{r.debug&&console.error("[MCP] Server closed"),process.exit(0);});}function z(r){return typeof r=="object"&&r!==null&&("type"in r||"properties"in r)?r:{type:"object",properties:{}}}exports.applyStyleTool=O;exports.closeDocumentTool=R;exports.coreMcpTools=y;exports.createMcpServer=q;exports.deleteTextTool=j;exports.formatTextTool=E;exports.getDocumentInfoTool=k;exports.getDocumentTextTool=$;exports.handleJsonRpcRequest=F;exports.insertTextTool=J;exports.loadDocumentTool=D;exports.replaceTextTool=v;exports.saveDocumentTool=C;exports.startStdioServer=H;
|
package/dist/mcp-reexport.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { M as McpToolDefinition, e as McpSession, J as JsonSchema } from './types-
|
|
2
|
-
import './agentApi-
|
|
1
|
+
import { M as McpToolDefinition, e as McpSession, J as JsonSchema } from './types-DEEpBL9H.cjs';
|
|
2
|
+
import './agentApi-DfsWRyrP.cjs';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* Core MCP Tools
|
package/dist/mcp-reexport.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { M as McpToolDefinition, e as McpSession, J as JsonSchema } from './types-
|
|
2
|
-
import './agentApi-
|
|
1
|
+
import { M as McpToolDefinition, e as McpSession, J as JsonSchema } from './types-7wjInVMW.js';
|
|
2
|
+
import './agentApi-DfsWRyrP.js';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* Core MCP Tools
|
package/dist/mcp-reexport.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {d,
|
|
1
|
+
import {d,f}from'./chunk-FXJAIFPR.js';import {a}from'./chunk-AARNCPWR.js';import {p}from'./chunk-UTWPV2I4.js';import {b}from'./chunk-BUEMG4NW.js';import'./chunk-USRMBYI6.js';import'./chunk-H5NTJZO4.js';var u={type:"string",description:"Document ID returned from docx_load"},h={type:"object",properties:{paragraphIndex:{type:"number",description:"Index of the paragraph (0-indexed)",minimum:0},offset:{type:"number",description:"Character offset within the paragraph",minimum:0}},required:["paragraphIndex","offset"]},T={type:"object",properties:{start:h,end:h},required:["start","end"]},D={name:"docx_load",description:`Load a DOCX document from base64-encoded content.
|
|
2
2
|
Returns a document ID that can be used with other tools.
|
|
3
|
-
The document remains in session memory until closed.`,inputSchema:{type:"object",properties:{content:{type:"string",description:"Base64-encoded DOCX file content"},source:{type:"string",description:"Optional source filename or identifier for reference"}},required:["content"]},handler:async(r,s)=>{let{content:e,source:c}=r;try{let t=atob(e),n=new Uint8Array(t.length);for(let l=0;l<t.length;l++)n[l]=t.charCodeAt(l);let o=n.buffer,a=await
|
|
4
|
-
Returns the document as a base64 string that can be saved to a file.`,inputSchema:{type:"object",properties:{documentId:u},required:["documentId"]},handler:async(r,s)=>{let{documentId:e
|
|
3
|
+
The document remains in session memory until closed.`,inputSchema:{type:"object",properties:{content:{type:"string",description:"Base64-encoded DOCX file content"},source:{type:"string",description:"Optional source filename or identifier for reference"}},required:["content"]},handler:async(r,s)=>{let{content:e,source:c}=r;try{let t=atob(e),n=new Uint8Array(t.length);for(let l=0;l<t.length;l++)n[l]=t.charCodeAt(l);let o=n.buffer,a=await p(o),d=`doc_${Date.now()}_${Math.random().toString(36).substr(2,9)}`;s.session.documents.set(d,{id:d,document:a,buffer:o,source:c,lastModified:Date.now()});let p$1=a.package.document.content.filter(l=>l.type==="paragraph").length;return {content:[{type:"text",text:JSON.stringify({documentId:d,source:c,paragraphCount:p$1,message:"Document loaded successfully"})}]}}catch(t){return {isError:true,content:[{type:"text",text:`Failed to load document: ${t.message}`}]}}},annotations:{category:"core",readOnly:false,complexity:"low"}},C={name:"docx_save",description:`Export the document to base64-encoded DOCX format.
|
|
4
|
+
Returns the document as a base64 string that can be saved to a file.`,inputSchema:{type:"object",properties:{documentId:u},required:["documentId"]},handler:async(r,s)=>{let{documentId:e}=r,c=s.session.documents.get(e);if(!c)return {isError:true,content:[{type:"text",text:`Document not found: ${e}`}]};try{let t;c.buffer?t=await d(c.document):t=await f(c.document);let n=new Uint8Array(t),o="";for(let d=0;d<n.length;d++)o+=String.fromCharCode(n[d]);let a=btoa(o);return {content:[{type:"text",text:JSON.stringify({documentId:e,base64:a,size:t.byteLength,message:"Document exported successfully"})}]}}catch(t){return {isError:true,content:[{type:"text",text:`Failed to save document: ${t.message}`}]}}},annotations:{category:"core",readOnly:true,complexity:"low"}},R={name:"docx_close",description:`Close a document and free its memory.
|
|
5
5
|
Use this when done working with a document.`,inputSchema:{type:"object",properties:{documentId:u},required:["documentId"]},handler:async(r,s)=>{let{documentId:e}=r;return s.session.documents.has(e)?(s.session.documents.delete(e),{content:[{type:"text",text:JSON.stringify({documentId:e,message:"Document closed"})}]}):{isError:true,content:[{type:"text",text:`Document not found: ${e}`}]}},annotations:{category:"core",readOnly:false,complexity:"low"}},k={name:"docx_get_info",description:`Get metadata and statistics about a document.
|
|
6
6
|
Returns paragraph count, word count, table count, and other useful info.`,inputSchema:{type:"object",properties:{documentId:u},required:["documentId"]},handler:async(r,s)=>{let{documentId:e}=r,c=s.session.documents.get(e);if(!c)return {isError:true,content:[{type:"text",text:`Document not found: ${e}`}]};let t=c.document,n=t.package.document,o=n.content.filter(p=>p.type==="paragraph"),a=n.content.filter(p=>p.type==="table"),d=0;for(let p of o)if(p.type==="paragraph"){let l=P(p);d+=l.split(/\s+/).filter(x=>x.length>0).length;}return {content:[{type:"text",text:JSON.stringify({documentId:e,paragraphCount:o.length,tableCount:a.length,wordCount:d,hasStyles:!!t.package.styles,hasTheme:!!t.package.theme,source:c.source,lastModified:c.lastModified})}]}},annotations:{category:"core",readOnly:true,complexity:"low"}},$={name:"docx_get_text",description:`Get the plain text content of the document.
|
|
7
7
|
Returns all text concatenated with paragraph breaks.
|
|
@@ -13,5 +13,4 @@ Specify start and end positions to define the range to replace.`,inputSchema:{ty
|
|
|
13
13
|
Specify start and end positions to define the range to delete.`,inputSchema:{type:"object",properties:{documentId:u,range:T},required:["documentId","range"]},handler:async(r,s)=>{let{documentId:e,range:c}=r,t=s.session.documents.get(e);if(!t)return {isError:true,content:[{type:"text",text:`Document not found: ${e}`}]};try{let n=a(t.document,{type:"deleteText",range:c});return t.document=n,t.lastModified=Date.now(),{content:[{type:"text",text:JSON.stringify({success:!0,deletedRange:c})}]}}catch(n){return {isError:true,content:[{type:"text",text:`Failed to delete text: ${n.message}`}]}}},annotations:{category:"core",readOnly:false,complexity:"low"}},E={name:"docx_format_text",description:`Apply formatting to text in a range.
|
|
14
14
|
Supports bold, italic, underline, font size, font family, color, and highlight.`,inputSchema:{type:"object",properties:{documentId:u,range:T,formatting:{type:"object",description:"Formatting options to apply",properties:{bold:{type:"boolean"},italic:{type:"boolean"},underline:{type:"boolean"},strikethrough:{type:"boolean"},fontSize:{type:"number",description:"Font size in points"},fontFamily:{type:"string"},color:{type:"string",description:'Hex color (e.g., "#FF0000")'},highlight:{type:"string",description:"Highlight color name"}}}},required:["documentId","range","formatting"]},handler:async(r,s)=>{let{documentId:e,range:c,formatting:t}=r,n=s.session.documents.get(e);if(!n)return {isError:true,content:[{type:"text",text:`Document not found: ${e}`}]};try{let o=a(n.document,{type:"formatText",range:c,formatting:t});return n.document=o,n.lastModified=Date.now(),{content:[{type:"text",text:JSON.stringify({success:!0,range:c,appliedFormatting:t})}]}}catch(o){return {isError:true,content:[{type:"text",text:`Failed to format text: ${o.message}`}]}}},annotations:{category:"core",readOnly:false,complexity:"medium"}},O={name:"docx_apply_style",description:`Apply a named style to a paragraph.
|
|
15
15
|
Use document styles like "Heading1", "Heading2", "Normal", etc.`,inputSchema:{type:"object",properties:{documentId:u,paragraphIndex:{type:"number",description:"Index of the paragraph (0-indexed)",minimum:0},styleId:{type:"string",description:'Style ID (e.g., "Heading1", "Normal")'}},required:["documentId","paragraphIndex","styleId"]},handler:async(r,s)=>{let{documentId:e,paragraphIndex:c,styleId:t}=r,n=s.session.documents.get(e);if(!n)return {isError:true,content:[{type:"text",text:`Document not found: ${e}`}]};try{let o=a(n.document,{type:"applyStyle",paragraphIndex:c,styleId:t});return n.document=o,n.lastModified=Date.now(),{content:[{type:"text",text:JSON.stringify({success:!0,paragraphIndex:c,styleId:t})}]}}catch(o){return {isError:true,content:[{type:"text",text:`Failed to apply style: ${o.message}`}]}}},annotations:{category:"core",readOnly:false,complexity:"low"}};function P(r){let s=[];for(let e of r.content)e.type==="run"?s.push(_(e)):e.type==="hyperlink"&&s.push(A(e));return s.join("")}function _(r){return r.content.filter(s=>s.type==="text").map(s=>s.text).join("")}function A(r){let s=[];for(let e of r.children)e.type==="run"&&s.push(_(e));return s.join("")}var y=[D,C,R,k,$,J,v,j,E,O];function q(r={}){let{name:s="docx-editor",version:e="0.1.0",includeCoreTools:c=true,debug:t=false,additionalTools:n=[]}=r,o=new Map,a={id:`session_${Date.now()}_${Math.random().toString(36).substr(2,9)}`,documents:new Map,data:new Map};if(c)for(let i of y)o.set(i.name,i),t&&console.log(`[MCP] Registered core tool: ${i.name}`);let d=b.getMcpTools();for(let i of d)o.has(i.name)&&console.warn(`[MCP] Tool '${i.name}' from plugin overrides existing tool`),o.set(i.name,i),t&&console.log(`[MCP] Registered plugin tool: ${i.name}`);for(let i of n)o.set(i.name,i),t&&console.log(`[MCP] Registered additional tool: ${i.name}`);let p=t?(i,f)=>{console.log(`[MCP] ${i}`,f??"");}:()=>{};async function l(i,f){let M=o.get(i);if(!M)throw new Error(`Unknown tool: ${i}`);p(`Calling tool: ${i}`,f);let N={session:a,log:p};try{let g=await M.handler(f,N);return p(`Tool ${i} completed`,g),g}catch(g){throw p(`Tool ${i} failed`,g),g}}function x(){return Array.from(o.values()).map(i=>({name:i.name,description:i.description,inputSchema:z(i.inputSchema),category:i.annotations?.category}))}function L(){return {name:s,version:e,toolCount:o.size}}return {tools:o,session:a,handleToolCall:l,listTools:x,getInfo:L}}async function F(r,s){let{id:e,method:c,params:t}=s;try{switch(c){case "initialize":return {jsonrpc:"2.0",id:e,result:{protocolVersion:"2024-11-05",capabilities:{tools:{}},serverInfo:r.getInfo()}};case "tools/list":{let n=r.listTools();return {jsonrpc:"2.0",id:e,result:{tools:n.map(o=>({name:o.name,description:o.description,inputSchema:o.inputSchema}))}}}case "tools/call":{let{name:n,arguments:o}=t,a=await r.handleToolCall(n,o);return {jsonrpc:"2.0",id:e,result:a}}default:return {jsonrpc:"2.0",id:e,error:{code:-32601,message:`Method not found: ${c}`}}}}catch(n){return {jsonrpc:"2.0",id:e,error:{code:-32e3,message:n.message}}}}async function H(r={}){let s=q(r);r.debug&&(console.error(`[MCP] Server started: ${s.getInfo().name} v${s.getInfo().version}`),console.error(`[MCP] Tools registered: ${s.tools.size}`));let c=(await import('readline')).createInterface({input:process.stdin,output:process.stdout,terminal:false}),t="";c.on("line",async n=>{t+=n;try{let o=JSON.parse(t);t="";let a=await F(s,o);process.stdout.write(JSON.stringify(a)+`
|
|
16
|
-
`);}catch{}}),c.on("close",()=>{r.debug&&console.error("[MCP] Server closed"),process.exit(0);});}function z(r){return typeof r=="object"&&r!==null&&("type"in r||"properties"in r)?r:{type:"object",properties:{}}}export{O as applyStyleTool,R as closeDocumentTool,y as coreMcpTools,q as createMcpServer,j as deleteTextTool,E as formatTextTool,k as getDocumentInfoTool,$ as getDocumentTextTool,F as handleJsonRpcRequest,J as insertTextTool,D as loadDocumentTool,v as replaceTextTool,C as saveDocumentTool,H as startStdioServer}
|
|
17
|
-
//# sourceMappingURL=mcp-reexport.js.map
|
|
16
|
+
`);}catch{}}),c.on("close",()=>{r.debug&&console.error("[MCP] Server closed"),process.exit(0);});}function z(r){return typeof r=="object"&&r!==null&&("type"in r||"properties"in r)?r:{type:"object",properties:{}}}export{O as applyStyleTool,R as closeDocumentTool,y as coreMcpTools,q as createMcpServer,j as deleteTextTool,E as formatTextTool,k as getDocumentInfoTool,$ as getDocumentTextTool,F as handleJsonRpcRequest,J as insertTextTool,D as loadDocumentTool,v as replaceTextTool,C as saveDocumentTool,H as startStdioServer};
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
export{j as createTemplateProcessor,k as default,g as getMissingVariables,e as getTemplateTags,h as previewTemplate,a as processTemplate,i as processTemplateAdvanced,d as processTemplateAndDownload,c as processTemplateAsBlob,b as processTemplateDetailed,f as validateTemplate}from'./chunk-
|
|
2
|
-
//# sourceMappingURL=processTemplate-G37IM66O.js.map
|
|
1
|
+
export{j as createTemplateProcessor,k as default,g as getMissingVariables,e as getTemplateTags,h as previewTemplate,a as processTemplate,i as processTemplateAdvanced,d as processTemplateAndDownload,c as processTemplateAsBlob,b as processTemplateDetailed,f as validateTemplate}from'./chunk-CLDB6TL7.js';import'./chunk-H5NTJZO4.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
'use strict';Object.defineProperty(exports,'__esModule',{value:true});var chunkB7TICMXD_cjs=require('./chunk-B7TICMXD.cjs');require('./chunk-PCJ5ACUV.cjs');Object.defineProperty(exports,"createTemplateProcessor",{enumerable:true,get:function(){return chunkB7TICMXD_cjs.j}});Object.defineProperty(exports,"default",{enumerable:true,get:function(){return chunkB7TICMXD_cjs.k}});Object.defineProperty(exports,"getMissingVariables",{enumerable:true,get:function(){return chunkB7TICMXD_cjs.g}});Object.defineProperty(exports,"getTemplateTags",{enumerable:true,get:function(){return chunkB7TICMXD_cjs.e}});Object.defineProperty(exports,"previewTemplate",{enumerable:true,get:function(){return chunkB7TICMXD_cjs.h}});Object.defineProperty(exports,"processTemplate",{enumerable:true,get:function(){return chunkB7TICMXD_cjs.a}});Object.defineProperty(exports,"processTemplateAdvanced",{enumerable:true,get:function(){return chunkB7TICMXD_cjs.i}});Object.defineProperty(exports,"processTemplateAndDownload",{enumerable:true,get:function(){return chunkB7TICMXD_cjs.d}});Object.defineProperty(exports,"processTemplateAsBlob",{enumerable:true,get:function(){return chunkB7TICMXD_cjs.c}});Object.defineProperty(exports,"processTemplateDetailed",{enumerable:true,get:function(){return chunkB7TICMXD_cjs.b}});Object.defineProperty(exports,"validateTemplate",{enumerable:true,get:function(){return chunkB7TICMXD_cjs.f}});
|
|
@@ -4,10 +4,10 @@ import * as prosemirror_view from 'prosemirror-view';
|
|
|
4
4
|
import { EditorView } from 'prosemirror-view';
|
|
5
5
|
import * as prosemirror_state from 'prosemirror-state';
|
|
6
6
|
import { EditorState, Transaction } from 'prosemirror-state';
|
|
7
|
-
import { T as TextFormatting, w as ParagraphFormatting, D as Document, X as Theme, e as Table } from './agentApi-
|
|
8
|
-
import { P as PageIndicatorPosition, e as PageNavigatorPosition, c as PageIndicatorVariant, g as PageNavigatorVariant, m as PrintOptions, o as TableContext, T as TableAction, j as ParsedClipboardContent } from './clipboard-
|
|
9
|
-
import {
|
|
10
|
-
import { g as EditorPluginCore, k as PluginPanelProps, R as RenderedDomContext, f as EditorHandle, h as ErrorNotification, m as SavedDocumentData, d as AutoSaveStatus, e as ClipboardSelection } from './ClipboardManager-
|
|
7
|
+
import { T as TextFormatting, w as ParagraphFormatting, D as Document, X as Theme, e as Table } from './agentApi-DfsWRyrP.js';
|
|
8
|
+
import { P as PageIndicatorPosition, e as PageNavigatorPosition, c as PageIndicatorVariant, g as PageNavigatorVariant, m as PrintOptions, o as TableContext, T as TableAction, j as ParsedClipboardContent } from './clipboard-BE8E-szx.js';
|
|
9
|
+
import { g as DocxInput, D as DocumentAgent } from './DocumentAgent-CrbsDniO.js';
|
|
10
|
+
import { g as EditorPluginCore, k as PluginPanelProps, R as RenderedDomContext, f as EditorHandle, h as ErrorNotification, m as SavedDocumentData, d as AutoSaveStatus, e as ClipboardSelection } from './ClipboardManager-jqJVxB6g.js';
|
|
11
11
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
12
12
|
|
|
13
13
|
/**
|
|
@@ -402,8 +402,10 @@ interface DocxEditorRef {
|
|
|
402
402
|
getDocument: () => Document | null;
|
|
403
403
|
/** Get the editor ref */
|
|
404
404
|
getEditorRef: () => PagedEditorRef | null;
|
|
405
|
-
/** Save the document to buffer */
|
|
406
|
-
save: (
|
|
405
|
+
/** Save the document to buffer. Pass { selective: false } to force full repack. */
|
|
406
|
+
save: (options?: {
|
|
407
|
+
selective?: boolean;
|
|
408
|
+
}) => Promise<ArrayBuffer | null>;
|
|
407
409
|
/** Set zoom level */
|
|
408
410
|
setZoom: (zoom: number) => void;
|
|
409
411
|
/** Get current zoom level */
|
|
@@ -4,10 +4,10 @@ import * as prosemirror_view from 'prosemirror-view';
|
|
|
4
4
|
import { EditorView } from 'prosemirror-view';
|
|
5
5
|
import * as prosemirror_state from 'prosemirror-state';
|
|
6
6
|
import { EditorState, Transaction } from 'prosemirror-state';
|
|
7
|
-
import { T as TextFormatting, w as ParagraphFormatting, D as Document, X as Theme, e as Table } from './agentApi-
|
|
8
|
-
import { P as PageIndicatorPosition, e as PageNavigatorPosition, c as PageIndicatorVariant, g as PageNavigatorVariant, m as PrintOptions, o as TableContext, T as TableAction, j as ParsedClipboardContent } from './clipboard-
|
|
9
|
-
import {
|
|
10
|
-
import { g as EditorPluginCore, k as PluginPanelProps, R as RenderedDomContext, f as EditorHandle, h as ErrorNotification, m as SavedDocumentData, d as AutoSaveStatus, e as ClipboardSelection } from './ClipboardManager-
|
|
7
|
+
import { T as TextFormatting, w as ParagraphFormatting, D as Document, X as Theme, e as Table } from './agentApi-DfsWRyrP.cjs';
|
|
8
|
+
import { P as PageIndicatorPosition, e as PageNavigatorPosition, c as PageIndicatorVariant, g as PageNavigatorVariant, m as PrintOptions, o as TableContext, T as TableAction, j as ParsedClipboardContent } from './clipboard-DkfAv07F.cjs';
|
|
9
|
+
import { g as DocxInput, D as DocumentAgent } from './DocumentAgent-CnJ9AEl_.cjs';
|
|
10
|
+
import { g as EditorPluginCore, k as PluginPanelProps, R as RenderedDomContext, f as EditorHandle, h as ErrorNotification, m as SavedDocumentData, d as AutoSaveStatus, e as ClipboardSelection } from './ClipboardManager-B1jZrC6h.cjs';
|
|
11
11
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
12
12
|
|
|
13
13
|
/**
|
|
@@ -402,8 +402,10 @@ interface DocxEditorRef {
|
|
|
402
402
|
getDocument: () => Document | null;
|
|
403
403
|
/** Get the editor ref */
|
|
404
404
|
getEditorRef: () => PagedEditorRef | null;
|
|
405
|
-
/** Save the document to buffer */
|
|
406
|
-
save: (
|
|
405
|
+
/** Save the document to buffer. Pass { selective: false } to force full repack. */
|
|
406
|
+
save: (options?: {
|
|
407
|
+
selective?: boolean;
|
|
408
|
+
}) => Promise<ArrayBuffer | null>;
|
|
407
409
|
/** Set zoom level */
|
|
408
410
|
setZoom: (zoom: number) => void;
|
|
409
411
|
/** Get current zoom level */
|
package/dist/react.cjs
CHANGED
|
@@ -1,2 +1 @@
|
|
|
1
|
-
'use strict';var
|
|
2
|
-
//# sourceMappingURL=react.cjs.map
|
|
1
|
+
'use strict';var chunk6NYA53QC_cjs=require('./chunk-6NYA53QC.cjs');require('./chunk-4CUGBNL2.cjs'),require('./chunk-P3AEZKQO.cjs'),require('./chunk-VTAS7VZ6.cjs'),require('./chunk-XS2AQFMF.cjs');var chunk2VHQ7YOQ_cjs=require('./chunk-2VHQ7YOQ.cjs');require('./chunk-GICVJSFJ.cjs'),require('./chunk-JRRTZZ72.cjs'),require('./chunk-TAF6KYDM.cjs'),require('./chunk-B7TICMXD.cjs'),require('./chunk-Y6QBJGMO.cjs'),require('./chunk-P7ZF45KZ.cjs');var chunkEH3NY2DQ_cjs=require('./chunk-EH3NY2DQ.cjs');require('./chunk-YS7FDEZ4.cjs'),require('./chunk-XQNCLN4T.cjs'),require('./chunk-PCJ5ACUV.cjs');Object.defineProperty(exports,"DocxEditor",{enumerable:true,get:function(){return chunk6NYA53QC_cjs.i}});Object.defineProperty(exports,"ErrorBoundary",{enumerable:true,get:function(){return chunk6NYA53QC_cjs.c}});Object.defineProperty(exports,"ErrorProvider",{enumerable:true,get:function(){return chunk6NYA53QC_cjs.b}});Object.defineProperty(exports,"PLUGIN_HOST_STYLES",{enumerable:true,get:function(){return chunk6NYA53QC_cjs.T}});Object.defineProperty(exports,"ParseErrorDisplay",{enumerable:true,get:function(){return chunk6NYA53QC_cjs.d}});Object.defineProperty(exports,"PluginHost",{enumerable:true,get:function(){return chunk6NYA53QC_cjs.U}});Object.defineProperty(exports,"UnsupportedFeatureWarning",{enumerable:true,get:function(){return chunk6NYA53QC_cjs.e}});Object.defineProperty(exports,"ZOOM_PRESETS",{enumerable:true,get:function(){return chunk6NYA53QC_cjs.l}});Object.defineProperty(exports,"clampZoom",{enumerable:true,get:function(){return chunk6NYA53QC_cjs.u}});Object.defineProperty(exports,"findNearestZoomPreset",{enumerable:true,get:function(){return chunk6NYA53QC_cjs.o}});Object.defineProperty(exports,"formatZoom",{enumerable:true,get:function(){return chunk6NYA53QC_cjs.r}});Object.defineProperty(exports,"generateOverlayElements",{enumerable:true,get:function(){return chunk6NYA53QC_cjs.R}});Object.defineProperty(exports,"getNextZoomPreset",{enumerable:true,get:function(){return chunk6NYA53QC_cjs.p}});Object.defineProperty(exports,"getPreviousZoomPreset",{enumerable:true,get:function(){return chunk6NYA53QC_cjs.q}});Object.defineProperty(exports,"getUserFriendlyMessage",{enumerable:true,get:function(){return chunk6NYA53QC_cjs.g}});Object.defineProperty(exports,"getZoomPresets",{enumerable:true,get:function(){return chunk6NYA53QC_cjs.n}});Object.defineProperty(exports,"isParseError",{enumerable:true,get:function(){return chunk6NYA53QC_cjs.f}});Object.defineProperty(exports,"isZoomPreset",{enumerable:true,get:function(){return chunk6NYA53QC_cjs.t}});Object.defineProperty(exports,"parseZoom",{enumerable:true,get:function(){return chunk6NYA53QC_cjs.s}});Object.defineProperty(exports,"renderAsync",{enumerable:true,get:function(){return chunk6NYA53QC_cjs.j}});Object.defineProperty(exports,"useAutoSave",{enumerable:true,get:function(){return chunk6NYA53QC_cjs.k}});Object.defineProperty(exports,"useClipboard",{enumerable:true,get:function(){return chunk6NYA53QC_cjs.S}});Object.defineProperty(exports,"useErrorNotifications",{enumerable:true,get:function(){return chunk6NYA53QC_cjs.a}});Object.defineProperty(exports,"useSelectionHighlight",{enumerable:true,get:function(){return chunk6NYA53QC_cjs.Q}});Object.defineProperty(exports,"useTableSelection",{enumerable:true,get:function(){return chunk6NYA53QC_cjs.h}});Object.defineProperty(exports,"useWheelZoom",{enumerable:true,get:function(){return chunk6NYA53QC_cjs.m}});Object.defineProperty(exports,"TABLE_DATA_ATTRIBUTES",{enumerable:true,get:function(){return chunk2VHQ7YOQ_cjs.x}});Object.defineProperty(exports,"createSelectionFromDOM",{enumerable:true,get:function(){return chunk2VHQ7YOQ_cjs.F}});Object.defineProperty(exports,"formatLastSaveTime",{enumerable:true,get:function(){return chunk2VHQ7YOQ_cjs.s}});Object.defineProperty(exports,"formatStorageSize",{enumerable:true,get:function(){return chunk2VHQ7YOQ_cjs.v}});Object.defineProperty(exports,"getAutoSaveStatusLabel",{enumerable:true,get:function(){return chunk2VHQ7YOQ_cjs.t}});Object.defineProperty(exports,"getAutoSaveStorageSize",{enumerable:true,get:function(){return chunk2VHQ7YOQ_cjs.u}});Object.defineProperty(exports,"getSelectionRuns",{enumerable:true,get:function(){return chunk2VHQ7YOQ_cjs.E}});Object.defineProperty(exports,"isAutoSaveSupported",{enumerable:true,get:function(){return chunk2VHQ7YOQ_cjs.w}});Object.defineProperty(exports,"toArrayBuffer",{enumerable:true,get:function(){return chunkEH3NY2DQ_cjs.o}});
|
package/dist/react.css
CHANGED
|
@@ -1,2 +1 @@
|
|
|
1
1
|
.prosemirror-editor-wrapper{min-height:100%}.prosemirror-editor{width:var(--page-width, 8.5in)}.prosemirror-editor .ProseMirror{background:#fff;box-shadow:0 2px 8px #00000026;width:var(--page-width, 8.5in);min-height:var(--page-height, 11in);padding-top:var(--margin-top, 72px);padding-bottom:var(--margin-bottom, 72px);padding-left:var(--margin-left, 72px);padding-right:var(--margin-right, 72px);outline:none;font-family:Calibri,Arial,sans-serif;font-size:11pt;color:#000;white-space:pre-wrap;word-wrap:break-word;-o-tab-size:48;tab-size:48;-moz-tab-size:48;box-sizing:border-box;position:relative}.prosemirror-editor .ProseMirror .docx-page-break{display:block;position:relative;height:40px;margin:0 calc(-1 * var(--margin-left, 72px));margin-right:calc(-1 * var(--margin-right, 72px));background:var(--doc-bg);border:none;pointer-events:none}.prosemirror-editor .ProseMirror .docx-page-break:before{content:"";position:absolute;bottom:0;left:0;right:0;height:8px;background:linear-gradient(to bottom,transparent,rgba(0,0,0,.08))}.prosemirror-editor .ProseMirror .docx-page-break:after{content:"";position:absolute;top:0;left:0;right:0;height:8px;background:linear-gradient(to top,transparent,rgba(0,0,0,.08))}.prosemirror-editor .ProseMirror [data-page-break-before=true]{-moz-column-break-before:page;break-before:page}.prosemirror-editor .ProseMirror .docx-page-break-line{display:block;position:relative;height:1px;margin:20px calc(-1 * var(--margin-left, 72px));margin-right:calc(-1 * var(--margin-right, 72px));border-top:1px dashed var(--doc-border)}.prosemirror-editor .ProseMirror .docx-page-break-line:before{content:"Page Break";position:absolute;top:-10px;left:50%;transform:translate(-50%);background:var(--doc-bg);padding:0 8px;font-size:10px;color:var(--doc-text-muted);white-space:nowrap}.prosemirror-editor .ProseMirror:focus{outline:none}.prosemirror-editor .ProseMirror p{display:block;margin:0;padding:0;min-height:1em;white-space:pre-wrap;word-wrap:break-word;line-height:normal}.prosemirror-editor .ProseMirror p:empty:before{content:"\a0"}.prosemirror-editor .ProseMirror span{display:inline;white-space:pre-wrap}.prosemirror-editor .ProseMirror .docx-list-bullet,.prosemirror-editor .ProseMirror .docx-list-numbered{position:relative;padding-left:48px}.prosemirror-editor .ProseMirror [data-list-marker]:before{content:attr(data-list-marker);position:absolute;left:0;width:44px;text-align:right;white-space:nowrap}.prosemirror-editor .ProseMirror .docx-list-bullet:not([data-list-marker]):before{content:"\2022";position:absolute;left:0;width:44px;text-align:right}.prosemirror-editor .ProseMirror .docx-list-numbered:not([data-list-marker]){counter-increment:list-counter}.prosemirror-editor .ProseMirror .docx-list-decimal:not([data-list-marker]):before{content:counter(list-counter) ".";position:absolute;left:0;width:44px;text-align:right}.prosemirror-editor .ProseMirror .docx-list-lower-roman:not([data-list-marker]):before{content:counter(list-counter,lower-roman) ".";position:absolute;left:0;width:44px;text-align:right}.prosemirror-editor .ProseMirror .docx-list-upper-roman:not([data-list-marker]):before{content:counter(list-counter,upper-roman) ".";position:absolute;left:0;width:44px;text-align:right}.prosemirror-editor .ProseMirror .docx-list-lower-alpha:not([data-list-marker]):before{content:counter(list-counter,lower-alpha) ".";position:absolute;left:0;width:44px;text-align:right}.prosemirror-editor .ProseMirror .docx-list-upper-alpha:not([data-list-marker]):before{content:counter(list-counter,upper-alpha) ".";position:absolute;left:0;width:44px;text-align:right}.prosemirror-editor .ProseMirror .docx-list-level-0:not([data-list-marker]):first-of-type{counter-reset:list-counter}.prosemirror-editor .ProseMirror .docx-list-level-1{margin-left:.5in}.prosemirror-editor .ProseMirror .docx-list-level-2{margin-left:1in}.prosemirror-editor .ProseMirror .docx-list-level-3{margin-left:1.5in}.prosemirror-editor .ProseMirror .docx-list-level-4{margin-left:2in}.prosemirror-editor .ProseMirror .docx-list-level-5{margin-left:2.5in}.prosemirror-editor .ProseMirror .docx-list-level-6{margin-left:3in}.prosemirror-editor .ProseMirror .docx-list-level-7{margin-left:3.5in}.prosemirror-editor .ProseMirror .docx-list-level-8{margin-left:4in}.prosemirror-editor .ProseMirror ::-moz-selection{background:#4285f44d}.prosemirror-editor .ProseMirror ::selection{background:#4285f44d}.prosemirror-editor[data-placeholder]:before{content:attr(data-placeholder);color:#aaa;position:absolute;pointer-events:none}.prosemirror-editor .ProseMirror img.docx-image{display:inline;max-width:100%;-o-object-fit:contain;object-fit:contain;vertical-align:baseline;outline:none}.prosemirror-editor .ProseMirror img.docx-image-float-left{clear:left}.prosemirror-editor .ProseMirror img.docx-image-float-right{clear:right}.prosemirror-editor .ProseMirror img.docx-image-block{clear:both}.prosemirror-editor .ProseMirror p:has(>img.docx-image-block:only-child){text-indent:0!important;text-align:center}.prosemirror-editor .ProseMirror p:has(img.docx-image-float):after{content:"";display:table;clear:both}.prosemirror-editor .ProseMirror img.docx-image.ProseMirror-selectednode{outline:2px solid var(--doc-primary, #4285f4);outline-offset:2px;cursor:grab}.prosemirror-editor .ProseMirror.pm-image-dragging img.docx-image.ProseMirror-selectednode{opacity:.4;outline:2px dashed var(--doc-primary, #4285f4);cursor:grabbing}.prosemirror-editor .ProseMirror img:not(.docx-image){max-width:100%;height:auto}.prosemirror-editor .ProseMirror .docx-shape{display:inline-block;vertical-align:middle;line-height:0;cursor:pointer}.prosemirror-editor .ProseMirror .docx-shape.ProseMirror-selectednode{outline:2px solid var(--doc-primary, #4285f4);outline-offset:2px}.prosemirror-editor .ProseMirror .docx-textbox{border-radius:2px;margin:4px 0;cursor:text}.prosemirror-editor .ProseMirror .docx-textbox.ProseMirror-selectednode{outline:2px solid var(--doc-primary, #4285f4);outline-offset:2px}.prosemirror-editor .ProseMirror a{color:var(--doc-link);text-decoration:underline}.prosemirror-editor .ProseMirror a:hover{color:var(--doc-primary-hover)}.prosemirror-editor .ProseMirror .docx-footnote-ref,.prosemirror-editor .ProseMirror .docx-endnote-ref{color:var(--doc-link, #0066cc);cursor:pointer;vertical-align:super;font-size:smaller}.prosemirror-editor .ProseMirror .docx-footnote-ref:hover,.prosemirror-editor .ProseMirror .docx-endnote-ref:hover{text-decoration:underline}.prosemirror-editor .ProseMirror hr{border:none;border-top:1px solid #000;margin:12pt 0;height:0}.prosemirror-editor .ProseMirror table.docx-table{border-collapse:collapse;margin:12pt 0;max-width:100%}.prosemirror-editor .ProseMirror td.docx-table-cell,.prosemirror-editor .ProseMirror th.docx-table-header{padding:4px 8px;vertical-align:top;min-width:30px}.prosemirror-editor .ProseMirror th.docx-table-header{font-weight:700;text-align:left}.prosemirror-editor .ProseMirror td p,.prosemirror-editor .ProseMirror th p{margin:0;padding:0;min-height:auto}.prosemirror-editor .ProseMirror td p:first-child,.prosemirror-editor .ProseMirror th p:first-child{margin-top:0}.prosemirror-editor .ProseMirror td p:last-child,.prosemirror-editor .ProseMirror th p:last-child{margin-bottom:0}.prosemirror-editor .ProseMirror .activeCell{outline:2px solid rgba(66,133,244,.5);outline-offset:-2px}.prosemirror-editor .ProseMirror .selectedCell{background-color:#4285f426}.prosemirror-editor .ProseMirror .selectedCell:after{content:"";position:absolute;inset:0;background:#4285f41a;pointer-events:none}.prosemirror-editor .ProseMirror table table{margin:4px 0}.prosemirror-editor .ProseMirror .column-resize-handle{position:absolute;right:-2px;top:0;bottom:0;width:4px;background-color:#4285f480;cursor:col-resize;z-index:20}.prosemirror-editor .ProseMirror td.docx-table-cell,.prosemirror-editor .ProseMirror th.docx-table-header{position:relative}.prosemirror-editor .ProseMirror.resize-cursor{cursor:col-resize}.prosemirror-editor .ProseMirror table:not(:hover) .column-resize-handle{background-color:transparent}.prosemirror-editor .ProseMirror table:hover .column-resize-handle{background-color:#4285f44d}.prosemirror-editor .ProseMirror .column-resize-handle:hover{background-color:#4285f4b3}.prosemirror-editor .ProseMirror span.docx-tab{display:inline-block;min-width:48px;white-space:pre;background:transparent}.prosemirror-editor .ProseMirror span.docx-tab[data-leader=dot]:before{content:"...........";position:absolute;color:inherit;white-space:nowrap;overflow:hidden}.prosemirror-editor .ProseMirror span.docx-tab[data-leader=hyphen]:before{content:"-----------";position:absolute;color:inherit;white-space:nowrap;overflow:hidden}.prosemirror-editor .ProseMirror span.docx-tab[data-leader=underscore]:before{content:"___________";position:absolute;color:inherit;white-space:nowrap;overflow:hidden}.prosemirror-editor .ProseMirror .docx-run-all-caps{text-transform:uppercase}.prosemirror-editor .ProseMirror .docx-run-small-caps{font-variant:small-caps}.docx-section-break{position:relative}.docx-section-break:after{content:"Section Break (" attr(data-section-break) ")";display:block;text-align:center;font-size:9px;color:var(--doc-text-muted, #9ca3af);border-top:1px dashed var(--doc-border, #d1d5db);margin-top:4px;padding-top:2px;pointer-events:none}.prosemirror-editor .ProseMirror .pm-drop-indicator{position:absolute;width:2px;background:var(--doc-primary, #4285f4);pointer-events:none;z-index:50}.prosemirror-editor .ProseMirror .ProseMirror-dropcursor{z-index:50}.layout-page-content{cursor:text}.layout-page-header,.layout-page-footer{cursor:pointer;transition:background-color .15s ease}.layout-page-header:hover,.layout-page-footer:hover{background-color:#2563eb0f}.layout-page-header:empty:hover:after{content:"Double-click to add header";display:block;text-align:center;color:#9ca3af;font-size:11px;padding:4px 0}.layout-page-footer:empty:hover:after{content:"Double-click to add footer";display:block;text-align:center;color:#9ca3af;font-size:11px;padding:4px 0}.hf-editor-pm .ProseMirror{outline:none;min-height:40px;padding:4px}.hf-editor-pm .ProseMirror:focus{outline:none}.hf-editor-pm .ProseMirror p{display:block;margin:0;padding:0;min-height:1em;white-space:pre-wrap;word-wrap:break-word;line-height:normal}.paged-editor--hf-editing .layout-page-content{opacity:.4;pointer-events:none;transition:opacity .15s ease}.paged-editor--editing-header .layout-page-header{border-bottom:1px dotted #4285f4}.paged-editor--editing-footer .layout-page-footer{border-top:1px dotted #4285f4}.paged-editor--editing-header .layout-page-header>*{visibility:hidden}.paged-editor--editing-footer .layout-page-footer>*{visibility:hidden}.paged-editor--hf-editing .layout-page-header:hover,.paged-editor--hf-editing .layout-page-footer:hover{background-color:transparent}
|
|
2
|
-
/*# sourceMappingURL=react.css.map */
|
package/dist/react.d.cts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
export { a as DocxEditor, b as DocxEditorHandle, c as DocxEditorProps, d as DocxEditorRef, E as EditorPlugin, e as ErrorBoundary, f as ErrorBoundaryProps, g as ErrorContextValue, h as ErrorProvider, P as PLUGIN_HOST_STYLES, j as ParseErrorDisplay, k as ParseErrorDisplayProps, l as PluginContext, m as PluginHost, n as PluginHostProps, o as PluginHostRef, p as RenderAsyncOptions, r as SelectionOverlayProps, T as TableSelectionState, U as UnsupportedFeatureWarning, t as UnsupportedFeatureWarningProps, u as UseAutoSaveOptions, v as UseAutoSaveReturn, w as UseClipboardOptions, x as UseClipboardReturn, y as UseSelectionHighlightOptions, z as UseSelectionHighlightReturn, A as UseTableSelectionOptions, B as UseTableSelectionReturn, C as UseWheelZoomOptions, F as UseWheelZoomReturn, Z as ZOOM_PRESETS, I as clampZoom, L as findNearestZoomPreset, M as formatZoom, N as generateOverlayElements, W as getNextZoomPreset, X as getPreviousZoomPreset, a0 as getUserFriendlyMessage, a1 as getZoomPresets, a5 as isParseError, a8 as isZoomPreset, ab as parseZoom, ad as renderAsync, af as useAutoSave, ag as useClipboard, ah as useErrorNotifications, ai as useSelectionHighlight, aj as useTableSelection, ak as useWheelZoom } from './react-
|
|
2
|
-
export {
|
|
3
|
-
export { d as AutoSaveStatus, e as ClipboardSelection, h as ErrorNotification, i as ErrorSeverity, j as PanelConfig, k as PluginPanelProps, m as SavedDocumentData, T as TABLE_DATA_ATTRIBUTES, p as createSelectionFromDOM, t as formatLastSaveTime, u as formatStorageSize, v as getAutoSaveStatusLabel, w as getAutoSaveStorageSize, x as getSelectionRuns, z as isAutoSaveSupported } from './ClipboardManager-
|
|
1
|
+
export { a as DocxEditor, b as DocxEditorHandle, c as DocxEditorProps, d as DocxEditorRef, E as EditorPlugin, e as ErrorBoundary, f as ErrorBoundaryProps, g as ErrorContextValue, h as ErrorProvider, P as PLUGIN_HOST_STYLES, j as ParseErrorDisplay, k as ParseErrorDisplayProps, l as PluginContext, m as PluginHost, n as PluginHostProps, o as PluginHostRef, p as RenderAsyncOptions, r as SelectionOverlayProps, T as TableSelectionState, U as UnsupportedFeatureWarning, t as UnsupportedFeatureWarningProps, u as UseAutoSaveOptions, v as UseAutoSaveReturn, w as UseClipboardOptions, x as UseClipboardReturn, y as UseSelectionHighlightOptions, z as UseSelectionHighlightReturn, A as UseTableSelectionOptions, B as UseTableSelectionReturn, C as UseWheelZoomOptions, F as UseWheelZoomReturn, Z as ZOOM_PRESETS, I as clampZoom, L as findNearestZoomPreset, M as formatZoom, N as generateOverlayElements, W as getNextZoomPreset, X as getPreviousZoomPreset, a0 as getUserFriendlyMessage, a1 as getZoomPresets, a5 as isParseError, a8 as isZoomPreset, ab as parseZoom, ad as renderAsync, af as useAutoSave, ag as useClipboard, ah as useErrorNotifications, ai as useSelectionHighlight, aj as useTableSelection, ak as useWheelZoom } from './react-CAlVCYa4.cjs';
|
|
2
|
+
export { g as DocxInput, t as toArrayBuffer } from './DocumentAgent-CnJ9AEl_.cjs';
|
|
3
|
+
export { d as AutoSaveStatus, e as ClipboardSelection, h as ErrorNotification, i as ErrorSeverity, j as PanelConfig, k as PluginPanelProps, m as SavedDocumentData, T as TABLE_DATA_ATTRIBUTES, p as createSelectionFromDOM, t as formatLastSaveTime, u as formatStorageSize, v as getAutoSaveStatusLabel, w as getAutoSaveStorageSize, x as getSelectionRuns, z as isAutoSaveSupported } from './ClipboardManager-B1jZrC6h.cjs';
|
|
4
4
|
import 'react';
|
|
5
5
|
import 'prosemirror-view';
|
|
6
6
|
import 'prosemirror-state';
|
|
7
|
-
import './agentApi-
|
|
8
|
-
import './clipboard-
|
|
7
|
+
import './agentApi-DfsWRyrP.cjs';
|
|
8
|
+
import './clipboard-DkfAv07F.cjs';
|
|
9
9
|
import 'react/jsx-runtime';
|
|
10
10
|
import 'prosemirror-model';
|
package/dist/react.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
export { a as DocxEditor, b as DocxEditorHandle, c as DocxEditorProps, d as DocxEditorRef, E as EditorPlugin, e as ErrorBoundary, f as ErrorBoundaryProps, g as ErrorContextValue, h as ErrorProvider, P as PLUGIN_HOST_STYLES, j as ParseErrorDisplay, k as ParseErrorDisplayProps, l as PluginContext, m as PluginHost, n as PluginHostProps, o as PluginHostRef, p as RenderAsyncOptions, r as SelectionOverlayProps, T as TableSelectionState, U as UnsupportedFeatureWarning, t as UnsupportedFeatureWarningProps, u as UseAutoSaveOptions, v as UseAutoSaveReturn, w as UseClipboardOptions, x as UseClipboardReturn, y as UseSelectionHighlightOptions, z as UseSelectionHighlightReturn, A as UseTableSelectionOptions, B as UseTableSelectionReturn, C as UseWheelZoomOptions, F as UseWheelZoomReturn, Z as ZOOM_PRESETS, I as clampZoom, L as findNearestZoomPreset, M as formatZoom, N as generateOverlayElements, W as getNextZoomPreset, X as getPreviousZoomPreset, a0 as getUserFriendlyMessage, a1 as getZoomPresets, a5 as isParseError, a8 as isZoomPreset, ab as parseZoom, ad as renderAsync, af as useAutoSave, ag as useClipboard, ah as useErrorNotifications, ai as useSelectionHighlight, aj as useTableSelection, ak as useWheelZoom } from './react-
|
|
2
|
-
export {
|
|
3
|
-
export { d as AutoSaveStatus, e as ClipboardSelection, h as ErrorNotification, i as ErrorSeverity, j as PanelConfig, k as PluginPanelProps, m as SavedDocumentData, T as TABLE_DATA_ATTRIBUTES, p as createSelectionFromDOM, t as formatLastSaveTime, u as formatStorageSize, v as getAutoSaveStatusLabel, w as getAutoSaveStorageSize, x as getSelectionRuns, z as isAutoSaveSupported } from './ClipboardManager-
|
|
1
|
+
export { a as DocxEditor, b as DocxEditorHandle, c as DocxEditorProps, d as DocxEditorRef, E as EditorPlugin, e as ErrorBoundary, f as ErrorBoundaryProps, g as ErrorContextValue, h as ErrorProvider, P as PLUGIN_HOST_STYLES, j as ParseErrorDisplay, k as ParseErrorDisplayProps, l as PluginContext, m as PluginHost, n as PluginHostProps, o as PluginHostRef, p as RenderAsyncOptions, r as SelectionOverlayProps, T as TableSelectionState, U as UnsupportedFeatureWarning, t as UnsupportedFeatureWarningProps, u as UseAutoSaveOptions, v as UseAutoSaveReturn, w as UseClipboardOptions, x as UseClipboardReturn, y as UseSelectionHighlightOptions, z as UseSelectionHighlightReturn, A as UseTableSelectionOptions, B as UseTableSelectionReturn, C as UseWheelZoomOptions, F as UseWheelZoomReturn, Z as ZOOM_PRESETS, I as clampZoom, L as findNearestZoomPreset, M as formatZoom, N as generateOverlayElements, W as getNextZoomPreset, X as getPreviousZoomPreset, a0 as getUserFriendlyMessage, a1 as getZoomPresets, a5 as isParseError, a8 as isZoomPreset, ab as parseZoom, ad as renderAsync, af as useAutoSave, ag as useClipboard, ah as useErrorNotifications, ai as useSelectionHighlight, aj as useTableSelection, ak as useWheelZoom } from './react-C6bgHDFl.js';
|
|
2
|
+
export { g as DocxInput, t as toArrayBuffer } from './DocumentAgent-CrbsDniO.js';
|
|
3
|
+
export { d as AutoSaveStatus, e as ClipboardSelection, h as ErrorNotification, i as ErrorSeverity, j as PanelConfig, k as PluginPanelProps, m as SavedDocumentData, T as TABLE_DATA_ATTRIBUTES, p as createSelectionFromDOM, t as formatLastSaveTime, u as formatStorageSize, v as getAutoSaveStatusLabel, w as getAutoSaveStorageSize, x as getSelectionRuns, z as isAutoSaveSupported } from './ClipboardManager-jqJVxB6g.js';
|
|
4
4
|
import 'react';
|
|
5
5
|
import 'prosemirror-view';
|
|
6
6
|
import 'prosemirror-state';
|
|
7
|
-
import './agentApi-
|
|
8
|
-
import './clipboard-
|
|
7
|
+
import './agentApi-DfsWRyrP.js';
|
|
8
|
+
import './clipboard-BE8E-szx.js';
|
|
9
9
|
import 'react/jsx-runtime';
|
|
10
10
|
import 'prosemirror-model';
|
package/dist/react.js
CHANGED
|
@@ -1,2 +1 @@
|
|
|
1
|
-
export{i as DocxEditor,c as ErrorBoundary,b as ErrorProvider,T as PLUGIN_HOST_STYLES,d as ParseErrorDisplay,U as PluginHost,e as UnsupportedFeatureWarning,l as ZOOM_PRESETS,u as clampZoom,o as findNearestZoomPreset,r as formatZoom,R as generateOverlayElements,p as getNextZoomPreset,q as getPreviousZoomPreset,g as getUserFriendlyMessage,n as getZoomPresets,f as isParseError,t as isZoomPreset,s as parseZoom,j as renderAsync,k as useAutoSave,S as useClipboard,a as useErrorNotifications,Q as useSelectionHighlight,h as useTableSelection,m as useWheelZoom}from'./chunk-
|
|
2
|
-
//# sourceMappingURL=react.js.map
|
|
1
|
+
export{i as DocxEditor,c as ErrorBoundary,b as ErrorProvider,T as PLUGIN_HOST_STYLES,d as ParseErrorDisplay,U as PluginHost,e as UnsupportedFeatureWarning,l as ZOOM_PRESETS,u as clampZoom,o as findNearestZoomPreset,r as formatZoom,R as generateOverlayElements,p as getNextZoomPreset,q as getPreviousZoomPreset,g as getUserFriendlyMessage,n as getZoomPresets,f as isParseError,t as isZoomPreset,s as parseZoom,j as renderAsync,k as useAutoSave,S as useClipboard,a as useErrorNotifications,Q as useSelectionHighlight,h as useTableSelection,m as useWheelZoom}from'./chunk-Q7YYC75E.js';import'./chunk-5GFXHUMP.js';import'./chunk-2Y6FLZ5Q.js';import'./chunk-CTYOM6BE.js';import'./chunk-PJVI53AH.js';export{x as TABLE_DATA_ATTRIBUTES,F as createSelectionFromDOM,s as formatLastSaveTime,v as formatStorageSize,t as getAutoSaveStatusLabel,u as getAutoSaveStorageSize,E as getSelectionRuns,w as isAutoSaveSupported}from'./chunk-FVUGBRDD.js';import'./chunk-6NDMKJIE.js';import'./chunk-ZTVQA46Q.js';import'./chunk-7KJ3YVDQ.js';import'./chunk-CLDB6TL7.js';import'./chunk-FXJAIFPR.js';import'./chunk-AARNCPWR.js';export{o as toArrayBuffer}from'./chunk-UTWPV2I4.js';import'./chunk-BUEMG4NW.js';import'./chunk-USRMBYI6.js';import'./chunk-H5NTJZO4.js';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { C as CorePlugin, P as PluginOptions, a as PluginRegistrationResult, b as CommandHandler, M as McpToolDefinition, c as PluginEventListener } from './types-
|
|
1
|
+
import { C as CorePlugin, P as PluginOptions, a as PluginRegistrationResult, b as CommandHandler, M as McpToolDefinition, c as PluginEventListener } from './types-DEEpBL9H.cjs';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* Plugin Registry
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { C as CorePlugin, P as PluginOptions, a as PluginRegistrationResult, b as CommandHandler, M as McpToolDefinition, c as PluginEventListener } from './types-
|
|
1
|
+
import { C as CorePlugin, P as PluginOptions, a as PluginRegistrationResult, b as CommandHandler, M as McpToolDefinition, c as PluginEventListener } from './types-7wjInVMW.js';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* Plugin Registry
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
'use strict';var chunk4CUGBNL2_cjs=require('./chunk-4CUGBNL2.cjs');require('./chunk-PCJ5ACUV.cjs');Object.defineProperty(exports,"getCaretPosition",{enumerable:true,get:function(){return chunk4CUGBNL2_cjs.l}});Object.defineProperty(exports,"groupRectsByPage",{enumerable:true,get:function(){return chunk4CUGBNL2_cjs.n}});Object.defineProperty(exports,"isMultiPageSelection",{enumerable:true,get:function(){return chunk4CUGBNL2_cjs.m}});Object.defineProperty(exports,"selectionToRects",{enumerable:true,get:function(){return chunk4CUGBNL2_cjs.k}});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export{l as getCaretPosition,n as groupRectsByPage,m as isMultiPageSelection,k as selectionToRects}from'./chunk-5GFXHUMP.js';import'./chunk-H5NTJZO4.js';
|