@zeke-02/docx-editor 0.5.2 → 0.5.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +204 -0
- package/dist/FindReplaceDialog-7SQOVQWH.js +1 -0
- package/dist/FindReplaceDialog-RK3A7MSK.mjs +1 -0
- package/dist/{FootnotePropertiesDialog-XQ7NIFIU.js → FootnotePropertiesDialog-2Q2SHVMR.js} +1 -1
- package/dist/{FootnotePropertiesDialog-TNVJJCY6.mjs → FootnotePropertiesDialog-ZKQXW3YO.mjs} +1 -1
- package/dist/{HyperlinkDialog-FR4IZZ7E.mjs → HyperlinkDialog-QV3CVFQU.mjs} +1 -1
- package/dist/HyperlinkDialog-XVAF7FVN.js +1 -0
- package/dist/{ImagePositionDialog-JSZSIKF5.mjs → ImagePositionDialog-EGRH3HPP.mjs} +1 -1
- package/dist/{ImagePositionDialog-2YXRAGZS.js → ImagePositionDialog-HIVHUTBT.js} +1 -1
- package/dist/ImagePropertiesDialog-67WLFIIZ.mjs +1 -0
- package/dist/ImagePropertiesDialog-HSM3JJ22.js +1 -0
- package/dist/KeyboardShortcutsDialog-B0UFuR4w.d.ts +395 -0
- package/dist/KeyboardShortcutsDialog-t6JKL4Aj.d.mts +395 -0
- package/dist/PageSetupDialog-642IAVG2.js +1 -0
- package/dist/PageSetupDialog-ERUQDHAY.mjs +1 -0
- package/dist/PluginHost-HS31VIuo.d.mts +16 -0
- package/dist/PluginHost-zILZO7zX.d.ts +16 -0
- package/dist/{SplitCellDialog-NP3JJYHD.mjs → SplitCellDialog-GFWCFCTD.mjs} +1 -1
- package/dist/{SplitCellDialog-JIAC3RYV.js → SplitCellDialog-M7WF7ANE.js} +1 -1
- package/dist/{TablePropertiesDialog-TIK4AA5M.mjs → TablePropertiesDialog-TZ7VCL6V.mjs} +1 -1
- package/dist/{TablePropertiesDialog-T7D4HSVP.js → TablePropertiesDialog-ZKU2FTUX.js} +1 -1
- package/dist/agentApi-B2Y7kexW.d.ts +486 -0
- package/dist/agentApi-BzUJ_kao.d.mts +486 -0
- package/dist/chunk-2XXILKEQ.js +1 -0
- package/dist/chunk-35DG3R42.js +2 -0
- package/dist/chunk-5UX5CD4C.js +1 -0
- package/dist/chunk-7QQSDIWK.mjs +2 -0
- package/dist/chunk-AW5TISUL.js +3 -0
- package/dist/chunk-B45ECEGY.js +18 -0
- package/dist/chunk-B7CCL7SL.mjs +2 -0
- package/dist/chunk-BRMTZRLJ.js +2 -0
- package/dist/chunk-D47GTKGU.js +2 -0
- package/dist/chunk-F5SERL7X.mjs +2 -0
- package/dist/chunk-FWPVBFKQ.mjs +1 -0
- package/dist/chunk-GGQK26JO.js +2 -0
- package/dist/chunk-GM2S2WMT.mjs +1 -0
- package/dist/chunk-HXDMASAR.js +1 -0
- package/dist/chunk-ILYKDR3C.js +1 -0
- package/dist/chunk-JFRDFK7V.mjs +260 -0
- package/dist/chunk-JPF5R2ZM.mjs +1 -0
- package/dist/chunk-KOXCF3CL.mjs +1 -0
- package/dist/chunk-KRLNX56Y.mjs +2 -0
- package/dist/chunk-LWOHVYKW.mjs +1 -0
- package/dist/chunk-MDTA25AN.mjs +60 -0
- package/dist/chunk-MKNSJOCN.js +70 -0
- package/dist/chunk-NIBCC7WQ.js +1 -0
- package/dist/chunk-NLFXR2VH.js +2 -0
- package/dist/chunk-NOLMVQNN.mjs +40 -0
- package/dist/chunk-ONIYA2FU.mjs +2 -0
- package/dist/chunk-RCIZ7OM3.mjs +70 -0
- package/dist/chunk-SGTUE33R.js +260 -0
- package/dist/{chunk-EHFEG3TX.js → chunk-SNZ57XBI.js} +1 -1
- package/dist/chunk-SOTWG3KJ.mjs +1 -0
- package/dist/chunk-TYPGB4KF.js +1 -0
- package/dist/chunk-U7ZW2DOO.mjs +2 -0
- package/dist/chunk-WO3FIV4B.js +40 -0
- package/dist/{chunk-PKEOQIQO.mjs → chunk-WPI3YRFO.mjs} +1 -1
- package/dist/chunk-XGJ2EORY.mjs +1 -0
- package/dist/chunk-XQZTWWRF.mjs +18 -0
- package/dist/chunk-Y3SEHWZ2.js +1 -0
- package/dist/chunk-YBEVHQCT.js +60 -0
- package/dist/chunk-ZVAFVHWR.mjs +3 -0
- package/dist/chunk-ZXPCJWVY.js +2 -0
- package/dist/{agentApi-DLt94vXk.d.mts → content-REFGFfEH.d.mts} +8 -755
- package/dist/{agentApi-DLt94vXk.d.ts → content-REFGFfEH.d.ts} +8 -755
- package/dist/dialogs.d.mts +25 -0
- package/dist/dialogs.d.ts +25 -0
- package/dist/dialogs.js +1 -0
- package/dist/dialogs.mjs +1 -0
- package/dist/document-Cu2vq_wS.d.mts +294 -0
- package/dist/document-CxOagoLQ.d.ts +294 -0
- package/dist/executor-WBHID2RK.mjs +1 -0
- package/dist/executor-Y5VUOAHY.js +1 -0
- package/dist/findReplace-Bue0JaXh.d.ts +138 -0
- package/dist/findReplace-shXbOjFQ.d.mts +138 -0
- package/dist/fork.d.mts +535 -0
- package/dist/fork.d.ts +535 -0
- package/dist/fork.js +1 -0
- package/dist/fork.mjs +1 -0
- package/dist/hooks.d.mts +598 -0
- package/dist/hooks.d.ts +598 -0
- package/dist/hooks.js +1 -0
- package/dist/hooks.mjs +1 -0
- package/dist/index-B5A-J9GC.d.ts +1119 -0
- package/dist/index-bw-PaozF.d.mts +1119 -0
- package/dist/index.d.mts +12 -591
- package/dist/index.d.ts +12 -591
- package/dist/index.js +1 -120
- package/dist/index.mjs +1 -120
- package/dist/layout-bridge-5GYGYKM5.mjs +1 -0
- package/dist/layout-bridge-QQDA7ELH.js +1 -0
- package/dist/plugin-api.d.mts +165 -0
- package/dist/plugin-api.d.ts +165 -0
- package/dist/plugin-api.js +1 -0
- package/dist/plugin-api.mjs +1 -0
- package/dist/processTemplate-BTBTR7AM.js +1 -0
- package/dist/{processTemplate-W2C5PXZB.mjs → processTemplate-MBX2KDLE.mjs} +1 -1
- package/dist/styles.css +1 -1
- package/dist/styles.d.mts +18 -0
- package/dist/styles.d.ts +18 -0
- package/dist/styles.js +1 -0
- package/dist/styles.mjs +1 -0
- package/dist/types-BF48VxkC.d.mts +18 -0
- package/dist/types-BF48VxkC.d.ts +18 -0
- package/dist/types-BnIs4sE7.d.mts +281 -0
- package/dist/types-BnIs4sE7.d.ts +281 -0
- package/dist/types-CW6HFAX6.d.ts +39 -0
- package/dist/types-DIsDCwTG.d.mts +39 -0
- package/dist/ui.d.mts +111 -552
- package/dist/ui.d.ts +111 -552
- package/dist/ui.js +111 -1
- package/dist/ui.mjs +111 -1
- package/dist/useFindReplace-DKy-s3gS.d.ts +261 -0
- package/dist/useFindReplace-vuoKpDKE.d.mts +261 -0
- package/package.json +47 -49
- package/dist/ClipboardManager-CVKX0v9q.d.ts +0 -464
- package/dist/ClipboardManager-V3aaMnWE.d.mts +0 -464
- package/dist/DocumentAgent-BWflKHpH.d.mts +0 -442
- package/dist/DocumentAgent-DsdXtetF.d.ts +0 -442
- package/dist/FindReplaceDialog-L3YF5HIS.mjs +0 -1
- package/dist/FindReplaceDialog-SEBWC5P7.js +0 -1
- package/dist/HyperlinkDialog-WEK6JSAC.js +0 -1
- package/dist/ImagePropertiesDialog-527MFLQO.mjs +0 -1
- package/dist/ImagePropertiesDialog-HG4K3IE7.js +0 -1
- package/dist/PageSetupDialog-GALVJMUB.js +0 -1
- package/dist/PageSetupDialog-TGQIAMI7.mjs +0 -1
- package/dist/TableToolbar-DUgmob2I.d.ts +0 -1273
- package/dist/TableToolbar-YL74HNS1.d.mts +0 -1273
- package/dist/chunk-23SXXIZS.js +0 -111
- package/dist/chunk-3F52AP2Q.js +0 -1
- package/dist/chunk-42O5GXM5.mjs +0 -82
- package/dist/chunk-54ULJEHM.mjs +0 -1
- package/dist/chunk-5XK326FI.mjs +0 -1
- package/dist/chunk-6WPRCJ5A.mjs +0 -1
- package/dist/chunk-76IYR7C7.mjs +0 -1
- package/dist/chunk-AGRIVA4G.js +0 -1
- package/dist/chunk-BTCQ2QI3.mjs +0 -3
- package/dist/chunk-BUEMG4NW.js +0 -1
- package/dist/chunk-BXRC4U3X.mjs +0 -2
- package/dist/chunk-CPAYKE6X.mjs +0 -1
- package/dist/chunk-DACWLFKI.mjs +0 -1
- package/dist/chunk-EPBFWE36.js +0 -2
- package/dist/chunk-FXES3YDB.js +0 -82
- package/dist/chunk-HI66BSGS.mjs +0 -9
- package/dist/chunk-INTPVEO6.mjs +0 -9
- package/dist/chunk-IOAGVW6Q.mjs +0 -2
- package/dist/chunk-JCEWC5QL.mjs +0 -4
- package/dist/chunk-JTIUFACT.js +0 -1
- package/dist/chunk-LUF7PWIC.js +0 -10
- package/dist/chunk-MGEN6GOE.mjs +0 -2
- package/dist/chunk-MOE2ZGUE.js +0 -18
- package/dist/chunk-MWLHJWB6.js +0 -9
- package/dist/chunk-OFYVDN3U.mjs +0 -2
- package/dist/chunk-P4VSHBGZ.js +0 -2
- package/dist/chunk-P5FQHIES.mjs +0 -1
- package/dist/chunk-PBC7XAYZ.js +0 -3
- package/dist/chunk-PEMB6SZT.js +0 -2
- package/dist/chunk-PQMSZTBB.js +0 -9
- package/dist/chunk-Q7UDQXAF.js +0 -1
- package/dist/chunk-QGTAIC5E.js +0 -1
- package/dist/chunk-QVPR2W5S.js +0 -1
- package/dist/chunk-R3QMYPL5.mjs +0 -59
- package/dist/chunk-RBUTXXQJ.mjs +0 -18
- package/dist/chunk-RRWYZ2TS.mjs +0 -111
- package/dist/chunk-S3STEPVO.js +0 -182
- package/dist/chunk-SFUM35DH.js +0 -2
- package/dist/chunk-SNLC6EK2.js +0 -1
- package/dist/chunk-TMTLIGLZ.js +0 -59
- package/dist/chunk-TSE2PWFX.mjs +0 -10
- package/dist/chunk-UKESXQS5.mjs +0 -182
- package/dist/chunk-UWYD42WV.js +0 -4
- package/dist/chunk-UXVACQCY.mjs +0 -1
- package/dist/chunk-W4EIKDM6.mjs +0 -2
- package/dist/chunk-W53SI3XW.mjs +0 -1
- package/dist/chunk-WNS2RBQD.js +0 -2
- package/dist/chunk-Z3KMSHUP.js +0 -1
- package/dist/core-plugins-reexport.d.mts +0 -31
- package/dist/core-plugins-reexport.d.ts +0 -31
- package/dist/core-plugins-reexport.js +0 -1
- package/dist/core-plugins-reexport.mjs +0 -1
- package/dist/core-reexport.d.mts +0 -340
- package/dist/core-reexport.d.ts +0 -340
- package/dist/core-reexport.js +0 -1
- package/dist/core-reexport.mjs +0 -1
- package/dist/documentSerializer-DtS_-oGA.d.mts +0 -664
- package/dist/documentSerializer-Wj1p2ASa.d.ts +0 -664
- package/dist/executor-C3VXF7QA.mjs +0 -1
- package/dist/executor-GDBV3AGV.js +0 -1
- package/dist/headless-reexport.d.mts +0 -197
- package/dist/headless-reexport.d.ts +0 -197
- package/dist/headless-reexport.js +0 -1
- package/dist/headless-reexport.mjs +0 -1
- package/dist/insertOperations-BTH1Asas.d.mts +0 -176
- package/dist/insertOperations-CbUnXAXH.d.ts +0 -176
- package/dist/layout-bridge-EA4DJ227.js +0 -1
- package/dist/layout-bridge-XDPSO6GO.mjs +0 -1
- package/dist/mcp-reexport.d.mts +0 -156
- package/dist/mcp-reexport.d.ts +0 -156
- package/dist/mcp-reexport.js +0 -16
- package/dist/mcp-reexport.mjs +0 -16
- package/dist/processTemplate-MJ2PCSO5.js +0 -1
- package/dist/react-B0W16SV6.d.ts +0 -1330
- package/dist/react-D0Pn1nww.d.mts +0 -1330
- package/dist/react.d.mts +0 -10
- package/dist/react.d.ts +0 -10
- package/dist/react.js +0 -1
- package/dist/react.mjs +0 -1
- package/dist/registry-CH9V-IX0.d.ts +0 -165
- package/dist/registry-CWBKYlNW.d.mts +0 -165
- package/dist/types-UDsUq8D3.d.mts +0 -310
- package/dist/types-jbivc9Lj.d.ts +0 -310
- package/dist/variableDetector-CdQ7ZTzA.d.mts +0 -204
- package/dist/variableDetector-DsRV3A9z.d.ts +0 -204
- package/i18n/de.json +0 -792
- package/i18n/en.json +0 -792
- package/i18n/he.json +0 -792
- package/i18n/pl.json +0 -792
- package/i18n/pt-BR.json +0 -792
- package/i18n/tr.json +0 -792
- package/i18n/zh-CN.json +0 -792
- /package/dist/{chunk-YC5KZSYD.js → chunk-ESZ6JRTW.js} +0 -0
- /package/dist/{chunk-LVGJKS7Y.mjs → chunk-TZMMD6RR.mjs} +0 -0
- /package/dist/{react.css → fork.css} +0 -0
package/dist/index.d.mts
CHANGED
|
@@ -1,592 +1,13 @@
|
|
|
1
|
-
|
|
2
|
-
export {
|
|
3
|
-
|
|
4
|
-
import
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
import
|
|
10
|
-
import { ReactNode, CSSProperties } from 'react';
|
|
11
|
-
import { ToolbarProps } from './ui.mjs';
|
|
12
|
-
export { AlignmentButtons, AlignmentButtonsProps, ColorPicker, ColorPickerMode, ColorPickerProps, ContextMenu, ContextMenuProps, DialogKeyboardShortcut, FindMatch, FindOptions, FindReplaceDialog, FindReplaceDialogProps, FindReplaceOptions, FindReplaceState, FindResult, FontSizePicker, FontSizePickerProps, HighlightOptions, HorizontalRuler, HorizontalRulerProps, HyperlinkData, HyperlinkDialog, HyperlinkDialogProps, ImageData, IndicatorPosition, IndicatorVariant, InsertImageDialog, InsertImageDialogProps, InsertSymbolDialog, InsertSymbolDialogProps, InsertTableDialog, InsertTableDialogProps, KeyboardShortcutsDialog, KeyboardShortcutsDialogProps, LineSpacingOption, LineSpacingPicker, LineSpacingPickerProps, ListButtons, ListButtonsProps, ListState, LoadingIndicator, LoadingIndicatorProps, LoadingOperation, LoadingSize, LoadingVariant, PasteOption, PasteSpecialDialog, PasteSpecialDialogProps, ResponsePreview, ResponsePreviewProps, ResponsePreviewState, ResponsiveToolbar, ResponsiveToolbarGroup, ResponsiveToolbarGroupProps, ResponsiveToolbarProps, SYMBOL_CATEGORIES, ShortcutCategory, StyleOption, StylePicker, StylePickerProps, SymbolCategory, TableBorderColorPicker, TableBorderColorPickerProps, TableBorderPicker, TableBorderPickerProps, TableBorderWidthPicker, TableBorderWidthPickerProps, TableCellFillPicker, TableCellFillPickerProps, TableConfig, TableInsertButtons, TableInsertButtonsProps, TableMergeButton, TableMergeButtonProps, TableMoreDropdown, TableMoreDropdownProps, TextContextAction, TextContextMenu, TextContextMenuItem, TextContextMenuProps, Toolbar, ToolbarButton, ToolbarGroup, ToolbarItem, ToolbarItemPriority, ToolbarSeparator, UnsavedIndicator, UnsavedIndicatorProps, UseFindReplaceReturn, UseKeyboardShortcutsDialogOptions, UseKeyboardShortcutsDialogReturn, UseLoadingOptions, UseLoadingReturn, UsePasteSpecialOptions, UsePasteSpecialReturn, UseResponsiveToolbarOptions, UseResponsiveToolbarReturn, UseTextContextMenuOptions, UseTextContextMenuReturn, UseUnsavedChangesOptions, UseUnsavedChangesReturn, ZoomControl, ZoomControlProps, calculateFitDimensions, clampTableConfig, createChangeTracker, createDefaultFindOptions, createDefaultListState, createDefaultTableConfig, createErrorResponse, createMockResponse, createSearchPattern, createToolbarItem, createToolbarItems, dataUrlToBlob, delay, escapeRegexString, findAllMatches, findInDocument, findInParagraph, formatFileSize, formatShortcutKeys, formatTableDimensions, getActionShortcut, getAllActions, getAllCategories, getAllIndicatorPositions, getAllIndicatorVariants, getAllLoadingSizes, getAllLoadingVariants, getAllPasteOptions, getCategoryLabel, getCommonShortcuts, getDefaultActions, getDefaultHighlightOptions, getDefaultPasteOption, getDefaultShortcuts, getDefaultTextContextMenuItems, getImageAcceptString, getImageDimensions, getLoadingVariantLabel, getMarginInUnits, getMatchCountText, getPasteOption, getRecommendedPriority, getRulerDimensions, getShortcutsByCategory, getSupportedImageExtensions, getSymbolCategories, getSymbolUnicodeInfo, getSymbolsByCategory, getTablePresets, getTextActionLabel, getTextActionShortcut, getVariantLabel, isActionAvailable, isEmptySearch, isPasteSpecialShortcut, isTextActionAvailable, isValidImageFile, isValidTableConfig, parseMarginFromUnits, positionToMargin, replaceAllInContent, replaceFirstInContent, scrollToMatch, searchSymbols, symbolFromCodePoint, useContextMenu, useFindReplace, useHyperlinkDialog, useInsertImageDialog, useInsertSymbolDialog, useInsertTableDialog, useKeyboardShortcutsDialog, useLoading, useLoadingOperations, usePasteSpecial, useResponsePreview, useResponsiveToolbar, useTextContextMenu, useUnsavedChanges } from './ui.mjs';
|
|
13
|
-
import * as prosemirror_state from 'prosemirror-state';
|
|
14
|
-
import { Plugin, PluginKey } from 'prosemirror-state';
|
|
15
|
-
import { DecorationSet, EditorView } from 'prosemirror-view';
|
|
16
|
-
export { b as CommandHandler, d as CommandResult, C as CorePlugin, e as McpSession, M as McpToolDefinition, i as McpToolHandler, j as McpToolResult, k as PluginCommand, b as PluginCommandHandler } from './types-UDsUq8D3.mjs';
|
|
17
|
-
export { P as PluginRegistry, p as pluginRegistry, r as registerPlugins } from './registry-CWBKYlNW.mjs';
|
|
18
|
-
export { docxtemplaterPlugin } from './core-plugins-reexport.mjs';
|
|
19
|
-
export { d as AutoSaveStatus, e as ClipboardSelection, h as ErrorNotification, i as ErrorSeverity, j as PanelConfig, k as PluginPanelProps, l as PositionCoordinates, R as RenderedDomContext, m as SavedDocumentData, F as SidebarItem, G as SidebarItemContext, 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-V3aaMnWE.mjs';
|
|
1
|
+
export { b as DocxEditor, c as DocxEditorHandle, d as DocxEditorProps, e as DocxEditorRef, E as EditorMode, L as LocaleProvider, f as LocaleProviderProps, R as RenderAsyncOptions, V as VERSION, r as renderAsync, u as useTranslation } from './index-bw-PaozF.mjs';
|
|
2
|
+
export { L as LocaleStrings, P as PartialLocaleStrings, T as TranslationKey, a as Translations } from './types-BF48VxkC.mjs';
|
|
3
|
+
import 'react';
|
|
4
|
+
import 'prosemirror-view';
|
|
5
|
+
import 'prosemirror-state';
|
|
6
|
+
import './document-Cu2vq_wS.mjs';
|
|
7
|
+
import './content-REFGFfEH.mjs';
|
|
8
|
+
import './agentApi-BzUJ_kao.mjs';
|
|
9
|
+
import './types-BnIs4sE7.mjs';
|
|
20
10
|
import 'prosemirror-model';
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
children: ReactNode;
|
|
25
|
-
}
|
|
26
|
-
declare function LocaleProvider({ i18n, children }: LocaleProviderProps): react_jsx_runtime.JSX.Element;
|
|
27
|
-
declare function useTranslation(): {
|
|
28
|
-
t: (key: TranslationKey, vars?: Record<string, string | number>) => string;
|
|
29
|
-
};
|
|
30
|
-
|
|
31
|
-
/**
|
|
32
|
-
* Keyboard Navigation Utilities
|
|
33
|
-
*
|
|
34
|
-
* Provides enhanced keyboard navigation for the editor:
|
|
35
|
-
* - Ctrl+Left/Right: Move by word
|
|
36
|
-
* - Home/End: Move to start/end of line
|
|
37
|
-
* - Ctrl+Home/End: Move to start/end of document
|
|
38
|
-
* - Ctrl+Shift+Left/Right: Select by word
|
|
39
|
-
* - Shift+Home/End: Select to start/end of line
|
|
40
|
-
*/
|
|
41
|
-
/**
|
|
42
|
-
* Navigation direction
|
|
43
|
-
*/
|
|
44
|
-
type NavigationDirection = 'left' | 'right' | 'up' | 'down';
|
|
45
|
-
/**
|
|
46
|
-
* Navigation unit
|
|
47
|
-
*/
|
|
48
|
-
type NavigationUnit = 'character' | 'word' | 'line' | 'paragraph' | 'document';
|
|
49
|
-
/**
|
|
50
|
-
* Keyboard navigation action
|
|
51
|
-
*/
|
|
52
|
-
interface NavigationAction {
|
|
53
|
-
/** Direction to navigate */
|
|
54
|
-
direction: NavigationDirection;
|
|
55
|
-
/** Unit of movement */
|
|
56
|
-
unit: NavigationUnit;
|
|
57
|
-
/** Whether to extend selection */
|
|
58
|
-
extend: boolean;
|
|
59
|
-
}
|
|
60
|
-
/**
|
|
61
|
-
* Keyboard shortcut definition
|
|
62
|
-
*/
|
|
63
|
-
interface KeyboardShortcut {
|
|
64
|
-
key: string;
|
|
65
|
-
ctrlKey?: boolean;
|
|
66
|
-
metaKey?: boolean;
|
|
67
|
-
shiftKey?: boolean;
|
|
68
|
-
altKey?: boolean;
|
|
69
|
-
}
|
|
70
|
-
/**
|
|
71
|
-
* Check if a character is a word character (letter, digit, or underscore)
|
|
72
|
-
*/
|
|
73
|
-
declare function isWordCharacter(char: string): boolean;
|
|
74
|
-
/**
|
|
75
|
-
* Check if a character is whitespace
|
|
76
|
-
*/
|
|
77
|
-
declare function isWhitespace(char: string): boolean;
|
|
78
|
-
/**
|
|
79
|
-
* Check if a character is a punctuation character
|
|
80
|
-
*/
|
|
81
|
-
declare function isPunctuation(char: string): boolean;
|
|
82
|
-
/**
|
|
83
|
-
* Find the start of the current or previous word
|
|
84
|
-
*/
|
|
85
|
-
declare function findWordStart(text: string, position: number): number;
|
|
86
|
-
/**
|
|
87
|
-
* Find the end of the current or next word
|
|
88
|
-
*/
|
|
89
|
-
declare function findWordEnd(text: string, position: number): number;
|
|
90
|
-
/**
|
|
91
|
-
* Find the next word start (for Ctrl+Right navigation)
|
|
92
|
-
*/
|
|
93
|
-
declare function findNextWordStart(text: string, position: number): number;
|
|
94
|
-
/**
|
|
95
|
-
* Find the previous word start (for Ctrl+Left navigation)
|
|
96
|
-
*/
|
|
97
|
-
declare function findPreviousWordStart(text: string, position: number): number;
|
|
98
|
-
/**
|
|
99
|
-
* Find the start of the current line in a text node
|
|
100
|
-
* Uses visual line detection based on bounding rectangles
|
|
101
|
-
*/
|
|
102
|
-
declare function findVisualLineStart(container: Node, offset: number): {
|
|
103
|
-
node: Node;
|
|
104
|
-
offset: number;
|
|
105
|
-
} | null;
|
|
106
|
-
/**
|
|
107
|
-
* Find the end of the current line in a text node
|
|
108
|
-
* Uses visual line detection based on bounding rectangles
|
|
109
|
-
*/
|
|
110
|
-
declare function findVisualLineEnd(container: Node, offset: number): {
|
|
111
|
-
node: Node;
|
|
112
|
-
offset: number;
|
|
113
|
-
} | null;
|
|
114
|
-
/**
|
|
115
|
-
* Get the current selection info
|
|
116
|
-
*/
|
|
117
|
-
declare function getSelectionInfo(): {
|
|
118
|
-
node: Node;
|
|
119
|
-
offset: number;
|
|
120
|
-
anchorNode: Node | null;
|
|
121
|
-
anchorOffset: number;
|
|
122
|
-
focusNode: Node | null;
|
|
123
|
-
focusOffset: number;
|
|
124
|
-
isCollapsed: boolean;
|
|
125
|
-
text: string;
|
|
126
|
-
} | null;
|
|
127
|
-
/**
|
|
128
|
-
* Set the selection to a specific position
|
|
129
|
-
*/
|
|
130
|
-
declare function setSelectionPosition(node: Node, offset: number): void;
|
|
131
|
-
/**
|
|
132
|
-
* Extend selection to a specific position
|
|
133
|
-
*/
|
|
134
|
-
declare function extendSelectionTo(node: Node, offset: number): void;
|
|
135
|
-
/**
|
|
136
|
-
* Move selection by word in a text node
|
|
137
|
-
*/
|
|
138
|
-
declare function moveByWord(direction: 'left' | 'right', extend?: boolean): boolean;
|
|
139
|
-
/**
|
|
140
|
-
* Move to start/end of line
|
|
141
|
-
*/
|
|
142
|
-
declare function moveToLineEdge(edge: 'start' | 'end', extend?: boolean): boolean;
|
|
143
|
-
/**
|
|
144
|
-
* Parse a keyboard event into a navigation action
|
|
145
|
-
*/
|
|
146
|
-
declare function parseNavigationAction(event: KeyboardEvent): NavigationAction | null;
|
|
147
|
-
/**
|
|
148
|
-
* Handle a keyboard navigation event
|
|
149
|
-
* Returns true if the event was handled
|
|
150
|
-
*/
|
|
151
|
-
declare function handleNavigationKey(event: KeyboardEvent, options?: {
|
|
152
|
-
onDocumentStart?: () => void;
|
|
153
|
-
onDocumentEnd?: () => void;
|
|
154
|
-
}): boolean;
|
|
155
|
-
/**
|
|
156
|
-
* Check if an event is a navigation key event
|
|
157
|
-
*/
|
|
158
|
-
declare function isNavigationKey(event: KeyboardEvent): boolean;
|
|
159
|
-
/**
|
|
160
|
-
* Expand selection to word boundaries
|
|
161
|
-
* Used for double-click word selection
|
|
162
|
-
*/
|
|
163
|
-
declare function expandSelectionToWord(): boolean;
|
|
164
|
-
/**
|
|
165
|
-
* Get the word at the current cursor position
|
|
166
|
-
*/
|
|
167
|
-
declare function getWordAtCursor(): string | null;
|
|
168
|
-
/**
|
|
169
|
-
* Check if a keyboard event matches a shortcut definition
|
|
170
|
-
*/
|
|
171
|
-
declare function matchesShortcut(event: KeyboardEvent, shortcut: KeyboardShortcut): boolean;
|
|
172
|
-
/**
|
|
173
|
-
* Common navigation shortcuts
|
|
174
|
-
*/
|
|
175
|
-
declare const NAVIGATION_SHORTCUTS: {
|
|
176
|
-
readonly wordLeft: KeyboardShortcut;
|
|
177
|
-
readonly wordRight: KeyboardShortcut;
|
|
178
|
-
readonly selectWordLeft: KeyboardShortcut;
|
|
179
|
-
readonly selectWordRight: KeyboardShortcut;
|
|
180
|
-
readonly lineStart: KeyboardShortcut;
|
|
181
|
-
readonly lineEnd: KeyboardShortcut;
|
|
182
|
-
readonly selectToLineStart: KeyboardShortcut;
|
|
183
|
-
readonly selectToLineEnd: KeyboardShortcut;
|
|
184
|
-
readonly documentStart: KeyboardShortcut;
|
|
185
|
-
readonly documentEnd: KeyboardShortcut;
|
|
186
|
-
readonly selectToDocumentStart: KeyboardShortcut;
|
|
187
|
-
readonly selectToDocumentEnd: KeyboardShortcut;
|
|
188
|
-
};
|
|
189
|
-
/**
|
|
190
|
-
* Get a human-readable description of a shortcut
|
|
191
|
-
*/
|
|
192
|
-
declare function describeShortcut(shortcut: KeyboardShortcut): string;
|
|
193
|
-
/**
|
|
194
|
-
* Get all navigation shortcuts with descriptions
|
|
195
|
-
*/
|
|
196
|
-
declare function getNavigationShortcutDescriptions(): Array<{
|
|
197
|
-
action: string;
|
|
198
|
-
shortcut: string;
|
|
199
|
-
}>;
|
|
200
|
-
|
|
201
|
-
/**
|
|
202
|
-
* Find word boundaries around a position in text
|
|
203
|
-
* Returns [startIndex, endIndex] inclusive start, exclusive end
|
|
204
|
-
*/
|
|
205
|
-
declare function findWordBoundaries(text: string, position: number): [number, number];
|
|
206
|
-
/**
|
|
207
|
-
* Get the word at a position in text
|
|
208
|
-
*/
|
|
209
|
-
declare function getWordAt(text: string, position: number): string;
|
|
210
|
-
/**
|
|
211
|
-
* Word selection result
|
|
212
|
-
*/
|
|
213
|
-
interface WordSelectionResult {
|
|
214
|
-
/** The selected word */
|
|
215
|
-
word: string;
|
|
216
|
-
/** Start index in the text (inclusive) */
|
|
217
|
-
startIndex: number;
|
|
218
|
-
/** End index in the text (exclusive) */
|
|
219
|
-
endIndex: number;
|
|
220
|
-
}
|
|
221
|
-
/**
|
|
222
|
-
* Find the word at a position and return detailed info
|
|
223
|
-
*/
|
|
224
|
-
declare function findWordAt(text: string, position: number): WordSelectionResult;
|
|
225
|
-
/**
|
|
226
|
-
* Select a word at the current cursor position using the browser's native APIs.
|
|
227
|
-
* This works reliably across different browsers and handles contentEditable well.
|
|
228
|
-
*/
|
|
229
|
-
declare function selectWordAtCursor(): boolean;
|
|
230
|
-
/**
|
|
231
|
-
* Select a word in a specific text node at the given offset
|
|
232
|
-
*/
|
|
233
|
-
declare function selectWordInTextNode(textNode: Text, offset: number): boolean;
|
|
234
|
-
/**
|
|
235
|
-
* Expand the current selection to word boundaries.
|
|
236
|
-
* If there's a collapsed selection (cursor), selects the word at cursor.
|
|
237
|
-
* If there's an existing selection, expands to include complete words.
|
|
238
|
-
*/
|
|
239
|
-
declare function expandSelectionToWordBoundaries(): boolean;
|
|
240
|
-
/**
|
|
241
|
-
* Select the entire paragraph containing the current selection.
|
|
242
|
-
* Looks for the nearest element with [data-paragraph-index] attribute.
|
|
243
|
-
*/
|
|
244
|
-
declare function selectParagraphAtCursor(): boolean;
|
|
245
|
-
/**
|
|
246
|
-
* Handle click event for multi-click detection.
|
|
247
|
-
* Call this in your click handler.
|
|
248
|
-
* Returns the click count (1 = single, 2 = double, 3 = triple).
|
|
249
|
-
*/
|
|
250
|
-
declare function handleClickForMultiClick(event: MouseEvent): number;
|
|
251
|
-
/**
|
|
252
|
-
* Create a double-click handler that selects words.
|
|
253
|
-
* Returns a function that should be called on dblclick events.
|
|
254
|
-
*/
|
|
255
|
-
declare function createDoubleClickWordSelector(): (event: MouseEvent) => void;
|
|
256
|
-
/**
|
|
257
|
-
* Create a triple-click handler that selects paragraphs.
|
|
258
|
-
* This uses our custom click counting since browsers have inconsistent triple-click.
|
|
259
|
-
*/
|
|
260
|
-
declare function createTripleClickParagraphSelector(): (event: MouseEvent) => void;
|
|
261
|
-
|
|
262
|
-
interface AgentPanelProps {
|
|
263
|
-
/** Header title. Defaults to `t('agentPanel.defaultTitle')`. */
|
|
264
|
-
title?: string;
|
|
265
|
-
/** Header icon node. Defaults to a sparkle SVG. */
|
|
266
|
-
icon?: ReactNode;
|
|
267
|
-
/** Controlled width in pixels. Omit for uncontrolled (internal state + localStorage). */
|
|
268
|
-
width?: number;
|
|
269
|
-
/** Default width when uncontrolled. */
|
|
270
|
-
defaultWidth?: number;
|
|
271
|
-
/** Min drag width. */
|
|
272
|
-
minWidth?: number;
|
|
273
|
-
/** Max drag width. */
|
|
274
|
-
maxWidth?: number;
|
|
275
|
-
/** Width change callback (drag end and intermediate). */
|
|
276
|
-
onWidthChange?: (w: number) => void;
|
|
277
|
-
/** Header close button click. Omit to hide the close button. */
|
|
278
|
-
onClose?: () => void;
|
|
279
|
-
/** Panel content. Render whatever you want — a chat, tabs, settings, anything. */
|
|
280
|
-
children: ReactNode;
|
|
281
|
-
/** Optional class on the outer wrapper. */
|
|
282
|
-
className?: string;
|
|
283
|
-
/**
|
|
284
|
-
* When `true`, the panel collapses to zero width with an ease-out
|
|
285
|
-
* transition (the children are still mounted so chat state survives
|
|
286
|
-
* close/reopen). The DocxEditor wrapper passes this when the user
|
|
287
|
-
* toggles the panel — kept off by default for standalone usage.
|
|
288
|
-
*/
|
|
289
|
-
closed?: boolean;
|
|
290
|
-
}
|
|
291
|
-
declare function AgentPanel({ title, icon, width: controlledWidth, defaultWidth, minWidth, maxWidth, onWidthChange, onClose, children, className, closed, }: AgentPanelProps): react_jsx_runtime.JSX.Element;
|
|
292
|
-
|
|
293
|
-
/** A single tool call the agent made — shown in the collapsible timeline. */
|
|
294
|
-
interface AgentToolCall {
|
|
295
|
-
/** Stable id for keying. */
|
|
296
|
-
id: string;
|
|
297
|
-
/** Tool name (e.g. `read_document`, `add_comment`). */
|
|
298
|
-
name: string;
|
|
299
|
-
/** JSON-able input the agent passed. Rendered in the expanded view. */
|
|
300
|
-
input?: unknown;
|
|
301
|
-
/** Result text or summary. Set after the call completes. */
|
|
302
|
-
result?: string;
|
|
303
|
-
/** Set when the call errored — surfaces in the timeline as failed. */
|
|
304
|
-
error?: string;
|
|
305
|
-
/** `running` while in flight, `done` on success, `error` on failure. */
|
|
306
|
-
status: 'running' | 'done' | 'error';
|
|
307
|
-
}
|
|
308
|
-
interface AgentMessage {
|
|
309
|
-
id: string;
|
|
310
|
-
role: 'user' | 'assistant';
|
|
311
|
-
text: string;
|
|
312
|
-
/**
|
|
313
|
-
* Tool calls the assistant made for this turn, in order. The timeline
|
|
314
|
-
* stays expanded while `status === 'streaming'` and auto-collapses to
|
|
315
|
-
* an "N steps" summary when the message hits `status === 'done'`.
|
|
316
|
-
*/
|
|
317
|
-
toolCalls?: AgentToolCall[];
|
|
318
|
-
/** `streaming` while the model is still calling tools / writing text; `done` once the turn is final. */
|
|
319
|
-
status?: 'streaming' | 'done';
|
|
320
|
-
}
|
|
321
|
-
interface AgentChatLogProps {
|
|
322
|
-
messages: AgentMessage[];
|
|
323
|
-
/** Render thinking dots at the bottom of the list. */
|
|
324
|
-
loading?: boolean;
|
|
325
|
-
/** Render an error bubble after the last message. */
|
|
326
|
-
error?: string | null;
|
|
327
|
-
/** Shown when there are no messages and not loading. */
|
|
328
|
-
emptyState?: ReactNode;
|
|
329
|
-
/** Auto-scroll to bottom on new messages / loading toggles. Default: true. */
|
|
330
|
-
autoScroll?: boolean;
|
|
331
|
-
/**
|
|
332
|
-
* Map a tool name to a friendly label for the per-message timeline.
|
|
333
|
-
* Pass `getToolDisplayName` from `@eigenpal/docx-editor-agents/react` to
|
|
334
|
-
* use the toolkit's registry-aware labels (e.g. "Adding comment").
|
|
335
|
-
*/
|
|
336
|
-
humanizeToolName?: (name: string) => string;
|
|
337
|
-
/** Cap the tool-call timeline to this many recent rows. Default 3. */
|
|
338
|
-
maxVisibleCalls?: number;
|
|
339
|
-
className?: string;
|
|
340
|
-
style?: CSSProperties;
|
|
341
|
-
}
|
|
342
|
-
interface AgentTimelineProps {
|
|
343
|
-
/** Tool calls in chronological order. */
|
|
344
|
-
toolCalls: AgentToolCall[];
|
|
345
|
-
/**
|
|
346
|
-
* Whether the parent assistant turn is still streaming. While true, the
|
|
347
|
-
* timeline is forced expanded and shows a spinner; on false it
|
|
348
|
-
* auto-collapses to an "N steps" summary unless the user expanded it.
|
|
349
|
-
*/
|
|
350
|
-
streaming?: boolean;
|
|
351
|
-
/**
|
|
352
|
-
* Cap the number of rendered call rows — older entries collapse into a
|
|
353
|
-
* "+N earlier steps" header. Default 3.
|
|
354
|
-
*/
|
|
355
|
-
maxVisibleCalls?: number;
|
|
356
|
-
/**
|
|
357
|
-
* Map a tool name to a friendly label. Defaults to a sentence-case
|
|
358
|
-
* conversion of the snake_case name. Pass `getToolDisplayName` from
|
|
359
|
-
* `@eigenpal/docx-editor-agents/react` to use the toolkit's registry.
|
|
360
|
-
*/
|
|
361
|
-
humanizeName?: (name: string) => string;
|
|
362
|
-
}
|
|
363
|
-
/**
|
|
364
|
-
* Collapsible timeline of an assistant turn's tool calls. Lives above the
|
|
365
|
-
* assistant text bubble. Auto-collapses when the turn finishes; click the
|
|
366
|
-
* summary row to re-expand.
|
|
367
|
-
*/
|
|
368
|
-
declare function AgentTimeline({ toolCalls, streaming, maxVisibleCalls, humanizeName, }: AgentTimelineProps): react_jsx_runtime.JSX.Element | null;
|
|
369
|
-
declare function AgentChatLog({ messages, loading, error, emptyState, autoScroll, humanizeToolName, maxVisibleCalls, className, style, }: AgentChatLogProps): react_jsx_runtime.JSX.Element;
|
|
370
|
-
interface AgentComposerProps {
|
|
371
|
-
value: string;
|
|
372
|
-
onChange: (next: string) => void;
|
|
373
|
-
onSubmit: () => void;
|
|
374
|
-
disabled?: boolean;
|
|
375
|
-
placeholder?: string;
|
|
376
|
-
/** Small text under the input — typically a scope reminder. */
|
|
377
|
-
footnote?: ReactNode;
|
|
378
|
-
className?: string;
|
|
379
|
-
}
|
|
380
|
-
declare function AgentComposer({ value, onChange, onSubmit, disabled, placeholder, footnote, className, }: AgentComposerProps): react_jsx_runtime.JSX.Element;
|
|
381
|
-
interface AgentSuggestionChipProps {
|
|
382
|
-
label: string;
|
|
383
|
-
onClick: () => void;
|
|
384
|
-
disabled?: boolean;
|
|
385
|
-
}
|
|
386
|
-
declare function AgentSuggestionChip({ label, onClick, disabled }: AgentSuggestionChipProps): react_jsx_runtime.JSX.Element;
|
|
387
|
-
|
|
388
|
-
/**
|
|
389
|
-
* Props for the EditorToolbar compound component.
|
|
390
|
-
* Extends ToolbarProps with title bar-specific fields.
|
|
391
|
-
*/
|
|
392
|
-
interface EditorToolbarProps extends ToolbarProps {
|
|
393
|
-
}
|
|
394
|
-
|
|
395
|
-
interface LogoProps {
|
|
396
|
-
children: ReactNode;
|
|
397
|
-
}
|
|
398
|
-
declare function Logo({ children }: LogoProps): react_jsx_runtime.JSX.Element;
|
|
399
|
-
interface DocumentNameProps {
|
|
400
|
-
value: string;
|
|
401
|
-
onChange?: (value: string) => void;
|
|
402
|
-
placeholder?: string;
|
|
403
|
-
editable?: boolean;
|
|
404
|
-
}
|
|
405
|
-
declare function DocumentName({ value, onChange, placeholder, editable }: DocumentNameProps): react_jsx_runtime.JSX.Element;
|
|
406
|
-
interface TitleBarRightProps {
|
|
407
|
-
children: ReactNode;
|
|
408
|
-
}
|
|
409
|
-
declare function TitleBarRight({ children }: TitleBarRightProps): react_jsx_runtime.JSX.Element;
|
|
410
|
-
declare function MenuBar(): react_jsx_runtime.JSX.Element;
|
|
411
|
-
interface TitleBarProps {
|
|
412
|
-
children: ReactNode;
|
|
413
|
-
}
|
|
414
|
-
/**
|
|
415
|
-
* TitleBar layout (Google Docs style):
|
|
416
|
-
*
|
|
417
|
-
* ┌──────────┬────────────────────────────┬──────────────────┐
|
|
418
|
-
* │ │ Document Name │ │
|
|
419
|
-
* │ Logo │ │ Right Actions │
|
|
420
|
-
* │ │ File Format Insert │ │
|
|
421
|
-
* └──────────┴────────────────────────────┴──────────────────┘
|
|
422
|
-
*
|
|
423
|
-
* Logo and TitleBarRight span full height. DocumentName + MenuBar
|
|
424
|
-
* stack vertically in the center column.
|
|
425
|
-
*/
|
|
426
|
-
declare function TitleBar({ children }: TitleBarProps): react_jsx_runtime.JSX.Element;
|
|
427
|
-
|
|
428
|
-
interface FormattingBarProps extends ToolbarProps {
|
|
429
|
-
/** Custom toolbar items to render at the end */
|
|
430
|
-
children?: ReactNode;
|
|
431
|
-
/** When true, renders with display:contents so children flow in parent flex container */
|
|
432
|
-
inline?: boolean;
|
|
433
|
-
}
|
|
434
|
-
/**
|
|
435
|
-
* Icon-based formatting toolbar — undo/redo, zoom, styles, fonts,
|
|
436
|
-
* bold/italic/underline, colors, alignment, lists, table/image context, clear formatting.
|
|
437
|
-
*/
|
|
438
|
-
declare function FormattingBar(explicitProps: FormattingBarProps): react_jsx_runtime.JSX.Element;
|
|
439
|
-
|
|
440
|
-
/**
|
|
441
|
-
* EditorToolbar — Google Docs-style 2-level compound component.
|
|
442
|
-
*
|
|
443
|
-
* Usage:
|
|
444
|
-
* <EditorToolbar {...toolbarProps}>
|
|
445
|
-
* <EditorToolbar.TitleBar>
|
|
446
|
-
* <EditorToolbar.Logo><MyIcon /></EditorToolbar.Logo>
|
|
447
|
-
* <EditorToolbar.DocumentName value={name} onChange={setName} />
|
|
448
|
-
* <EditorToolbar.MenuBar />
|
|
449
|
-
* <EditorToolbar.TitleBarRight>
|
|
450
|
-
* <button>Save</button>
|
|
451
|
-
* </EditorToolbar.TitleBarRight>
|
|
452
|
-
* </EditorToolbar.TitleBar>
|
|
453
|
-
* <EditorToolbar.FormattingBar />
|
|
454
|
-
* </EditorToolbar>
|
|
455
|
-
*/
|
|
456
|
-
|
|
457
|
-
interface EditorToolbarComponent {
|
|
458
|
-
(props: EditorToolbarProps & {
|
|
459
|
-
children: ReactNode;
|
|
460
|
-
}): React.JSX.Element;
|
|
461
|
-
TitleBar: typeof TitleBar;
|
|
462
|
-
Logo: typeof Logo;
|
|
463
|
-
DocumentName: typeof DocumentName;
|
|
464
|
-
MenuBar: typeof MenuBar;
|
|
465
|
-
TitleBarRight: typeof TitleBarRight;
|
|
466
|
-
FormattingBar: typeof FormattingBar;
|
|
467
|
-
}
|
|
468
|
-
declare const EditorToolbar: EditorToolbarComponent;
|
|
469
|
-
|
|
470
|
-
/**
|
|
471
|
-
* Template tag types
|
|
472
|
-
*/
|
|
473
|
-
type TagType = 'variable' | 'sectionStart' | 'sectionEnd' | 'invertedStart' | 'raw';
|
|
474
|
-
/**
|
|
475
|
-
* A found template tag
|
|
476
|
-
*/
|
|
477
|
-
interface TemplateTag {
|
|
478
|
-
id: string;
|
|
479
|
-
type: TagType;
|
|
480
|
-
name: string;
|
|
481
|
-
rawTag: string;
|
|
482
|
-
from: number;
|
|
483
|
-
to: number;
|
|
484
|
-
/** For sections: nested variable names */
|
|
485
|
-
nestedVars?: string[];
|
|
486
|
-
/** True if this variable is inside a section (shown in section's nested vars) */
|
|
487
|
-
insideSection?: boolean;
|
|
488
|
-
}
|
|
489
|
-
/**
|
|
490
|
-
* Plugin state
|
|
491
|
-
*/
|
|
492
|
-
interface TemplatePluginState$1 {
|
|
493
|
-
tags: TemplateTag[];
|
|
494
|
-
decorations: DecorationSet;
|
|
495
|
-
hoveredId?: string;
|
|
496
|
-
selectedId?: string;
|
|
497
|
-
}
|
|
498
|
-
/**
|
|
499
|
-
* Plugin key
|
|
500
|
-
*/
|
|
501
|
-
declare const templatePluginKey: PluginKey<TemplatePluginState$1>;
|
|
502
|
-
/**
|
|
503
|
-
* Create the template plugin
|
|
504
|
-
*/
|
|
505
|
-
declare function createTemplatePlugin(): Plugin<TemplatePluginState$1>;
|
|
506
|
-
/**
|
|
507
|
-
* Get tags from editor state
|
|
508
|
-
*/
|
|
509
|
-
declare function getTemplateTags(state: prosemirror_state.EditorState): TemplateTag[];
|
|
510
|
-
/**
|
|
511
|
-
* Set hovered tag
|
|
512
|
-
*/
|
|
513
|
-
declare function setHoveredElement(view: EditorView, id: string | undefined): void;
|
|
514
|
-
/**
|
|
515
|
-
* Set selected tag
|
|
516
|
-
*/
|
|
517
|
-
declare function setSelectedElement(view: EditorView, id: string | undefined): void;
|
|
518
|
-
/**
|
|
519
|
-
* CSS styles for template decorations
|
|
520
|
-
*/
|
|
521
|
-
declare const TEMPLATE_DECORATION_STYLES = "\n.docx-template-tag {\n cursor: pointer;\n transition: background-color 0.1s;\n}\n\n.docx-template-tag:hover,\n.docx-template-tag.hovered {\n filter: brightness(0.95);\n}\n\n.docx-template-tag.selected {\n box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.5);\n}\n";
|
|
522
|
-
|
|
523
|
-
/**
|
|
524
|
-
* Template Plugin
|
|
525
|
-
*
|
|
526
|
-
* Docxtemplater template support as a plugin for the DOCX Editor.
|
|
527
|
-
*
|
|
528
|
-
* Features:
|
|
529
|
-
* - Full docxtemplater syntax detection (variables, loops, conditionals)
|
|
530
|
-
* - Sidebar annotation chips showing template structure (via getSidebarItems)
|
|
531
|
-
* - Differentiated visual highlighting by element type
|
|
532
|
-
*
|
|
533
|
-
* @example
|
|
534
|
-
* ```tsx
|
|
535
|
-
* import { PluginHost } from '@docx-editor/plugin-api';
|
|
536
|
-
* import { templatePlugin } from '@docx-editor/plugins/template';
|
|
537
|
-
*
|
|
538
|
-
* function MyEditor() {
|
|
539
|
-
* return (
|
|
540
|
-
* <PluginHost plugins={[templatePlugin]}>
|
|
541
|
-
* <DocxEditor document={doc} onChange={handleChange} />
|
|
542
|
-
* </PluginHost>
|
|
543
|
-
* );
|
|
544
|
-
* }
|
|
545
|
-
* ```
|
|
546
|
-
*/
|
|
547
|
-
|
|
548
|
-
interface TemplatePluginState {
|
|
549
|
-
tags: TemplateTag[];
|
|
550
|
-
hoveredId?: string;
|
|
551
|
-
selectedId?: string;
|
|
552
|
-
}
|
|
553
|
-
/**
|
|
554
|
-
* Create the template plugin instance.
|
|
555
|
-
*/
|
|
556
|
-
declare function createPlugin(_options?: {
|
|
557
|
-
/** @deprecated — panel is no longer used; template chips render in the unified sidebar */
|
|
558
|
-
defaultCollapsed?: boolean;
|
|
559
|
-
/** @deprecated */
|
|
560
|
-
panelPosition?: 'left' | 'right';
|
|
561
|
-
/** @deprecated */
|
|
562
|
-
panelWidth?: number;
|
|
563
|
-
}): ReactEditorPlugin<TemplatePluginState>;
|
|
564
|
-
/**
|
|
565
|
-
* Default template plugin instance.
|
|
566
|
-
*/
|
|
567
|
-
declare const templatePlugin: ReactEditorPlugin<TemplatePluginState>;
|
|
568
|
-
|
|
569
|
-
/**
|
|
570
|
-
* @eigenpal/docx-js-editor
|
|
571
|
-
*
|
|
572
|
-
* A complete WYSIWYG DOCX editor with full Microsoft Word fidelity.
|
|
573
|
-
*
|
|
574
|
-
* Features:
|
|
575
|
-
* - Full text and paragraph formatting
|
|
576
|
-
* - Tables, images, shapes, text boxes
|
|
577
|
-
* - Hyperlinks, bookmarks, fields
|
|
578
|
-
* - Footnotes, lists, headers/footers
|
|
579
|
-
* - Page layout with margins and columns
|
|
580
|
-
* - DocumentAgent API for programmatic editing
|
|
581
|
-
* - Template variable substitution
|
|
582
|
-
* - AI-powered context menu
|
|
583
|
-
*
|
|
584
|
-
* CSS Styles:
|
|
585
|
-
* For optimal cursor visibility and selection highlighting, import the editor styles:
|
|
586
|
-
* ```
|
|
587
|
-
* import '@eigenpal/docx-js-editor/styles/editor.css';
|
|
588
|
-
* ```
|
|
589
|
-
*/
|
|
590
|
-
declare const VERSION = "0.0.2";
|
|
591
|
-
|
|
592
|
-
export { AgentChatLog, type AgentChatLogProps, AgentComposer, type AgentComposerProps, type AgentMessage, AgentPanel, type AgentPanelProps, AgentSuggestionChip, type AgentSuggestionChipProps, AgentTimeline, type AgentTimelineProps, type AgentToolCall, type DocumentNameProps, EditorToolbar, type EditorToolbarProps, FormattingBar, type FormattingBarProps, type KeyboardShortcut, LocaleProvider, type LocaleProviderProps, type LogoProps, NAVIGATION_SHORTCUTS, type NavigationAction, type NavigationDirection, type NavigationUnit, TEMPLATE_DECORATION_STYLES, type TagType, type TemplateTag, type TitleBarProps, type TitleBarRightProps, ToolbarProps, TranslationKey, Translations, VERSION, type WordSelectionResult, createDoubleClickWordSelector, createPlugin as createTemplatePlugin, createTemplatePlugin as createTemplateProseMirrorPlugin, createTripleClickParagraphSelector, describeShortcut, expandSelectionToWord, expandSelectionToWordBoundaries, extendSelectionTo, findNextWordStart, findPreviousWordStart, findVisualLineEnd, findVisualLineStart, findWordAt, findWordBoundaries, findWordEnd, findWordStart, getNavigationShortcutDescriptions, getSelectionInfo, getTemplateTags as getTemplatePluginTags, getWordAt, getWordAtCursor, handleClickForMultiClick, handleNavigationKey, isNavigationKey, isPunctuation, isWhitespace, isWhitespace as isWhitespaceChar, isWordCharacter as isWordChar, isWordCharacter, matchesShortcut, moveByWord, moveToLineEdge, parseNavigationAction, selectParagraphAtCursor, selectWordAtCursor, selectWordInTextNode, setHoveredElement, setSelectedElement, setSelectionPosition, templatePlugin, templatePluginKey, useTranslation };
|
|
11
|
+
import './types-DIsDCwTG.mjs';
|
|
12
|
+
import 'react/jsx-runtime';
|
|
13
|
+
import '@eigenpal/docx-editor-i18n/en.json';
|