@zeke-02/docx-editor 0.5.1 → 0.5.3

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.
Files changed (211) hide show
  1. package/LICENSE +204 -0
  2. package/dist/FindReplaceDialog-7SQOVQWH.js +1 -0
  3. package/dist/FindReplaceDialog-RK3A7MSK.mjs +1 -0
  4. package/dist/{FootnotePropertiesDialog-XQ7NIFIU.js → FootnotePropertiesDialog-2Q2SHVMR.js} +1 -1
  5. package/dist/{FootnotePropertiesDialog-TNVJJCY6.mjs → FootnotePropertiesDialog-ZKQXW3YO.mjs} +1 -1
  6. package/dist/{HyperlinkDialog-FR4IZZ7E.mjs → HyperlinkDialog-QV3CVFQU.mjs} +1 -1
  7. package/dist/HyperlinkDialog-XVAF7FVN.js +1 -0
  8. package/dist/{ImagePositionDialog-JSZSIKF5.mjs → ImagePositionDialog-EGRH3HPP.mjs} +1 -1
  9. package/dist/{ImagePositionDialog-2YXRAGZS.js → ImagePositionDialog-HIVHUTBT.js} +1 -1
  10. package/dist/ImagePropertiesDialog-67WLFIIZ.mjs +1 -0
  11. package/dist/ImagePropertiesDialog-HSM3JJ22.js +1 -0
  12. package/dist/KeyboardShortcutsDialog-5D_FoAp6.d.ts +395 -0
  13. package/dist/KeyboardShortcutsDialog-D7ihAj18.d.mts +395 -0
  14. package/dist/PageSetupDialog-642IAVG2.js +1 -0
  15. package/dist/PageSetupDialog-ERUQDHAY.mjs +1 -0
  16. package/dist/{SplitCellDialog-NP3JJYHD.mjs → SplitCellDialog-GFWCFCTD.mjs} +1 -1
  17. package/dist/{SplitCellDialog-JIAC3RYV.js → SplitCellDialog-M7WF7ANE.js} +1 -1
  18. package/dist/{TablePropertiesDialog-TIK4AA5M.mjs → TablePropertiesDialog-TZ7VCL6V.mjs} +1 -1
  19. package/dist/{TablePropertiesDialog-T7D4HSVP.js → TablePropertiesDialog-ZKU2FTUX.js} +1 -1
  20. package/dist/agentApi-C41hiW-n.d.mts +486 -0
  21. package/dist/agentApi-D4AZmNfB.d.ts +486 -0
  22. package/dist/chunk-2XXILKEQ.js +1 -0
  23. package/dist/chunk-35DG3R42.js +2 -0
  24. package/dist/chunk-47VJOBJD.mjs +60 -0
  25. package/dist/chunk-5UX5CD4C.js +1 -0
  26. package/dist/chunk-7QQSDIWK.mjs +2 -0
  27. package/dist/chunk-AW5TISUL.js +3 -0
  28. package/dist/chunk-AYMGSTNG.js +1 -0
  29. package/dist/chunk-B45ECEGY.js +18 -0
  30. package/dist/chunk-B7CCL7SL.mjs +2 -0
  31. package/dist/chunk-BRMTZRLJ.js +2 -0
  32. package/dist/chunk-D47GTKGU.js +2 -0
  33. package/dist/chunk-E6MQXELR.js +1 -0
  34. package/dist/chunk-F5SERL7X.mjs +2 -0
  35. package/dist/chunk-FWPVBFKQ.mjs +1 -0
  36. package/dist/chunk-GGQK26JO.js +2 -0
  37. package/dist/chunk-GM2S2WMT.mjs +1 -0
  38. package/dist/chunk-ILYKDR3C.js +1 -0
  39. package/dist/chunk-IP5NAYHL.js +60 -0
  40. package/dist/chunk-JPF5R2ZM.mjs +1 -0
  41. package/dist/chunk-KOXCF3CL.mjs +1 -0
  42. package/dist/chunk-KRLNX56Y.mjs +2 -0
  43. package/dist/chunk-LUJ6HCMH.mjs +1 -0
  44. package/dist/chunk-MKNSJOCN.js +70 -0
  45. package/dist/chunk-NIBCC7WQ.js +1 -0
  46. package/dist/chunk-NLFXR2VH.js +2 -0
  47. package/dist/chunk-ONIYA2FU.mjs +2 -0
  48. package/dist/chunk-ONNHQWAX.mjs +1 -0
  49. package/dist/chunk-RCIZ7OM3.mjs +70 -0
  50. package/dist/{chunk-EHFEG3TX.js → chunk-SNZ57XBI.js} +1 -1
  51. package/dist/chunk-SOTWG3KJ.mjs +1 -0
  52. package/dist/chunk-TYPGB4KF.js +1 -0
  53. package/dist/chunk-U7ZW2DOO.mjs +2 -0
  54. package/dist/{chunk-PKEOQIQO.mjs → chunk-WPI3YRFO.mjs} +1 -1
  55. package/dist/chunk-XQZTWWRF.mjs +18 -0
  56. package/dist/chunk-ZVAFVHWR.mjs +3 -0
  57. package/dist/chunk-ZXPCJWVY.js +2 -0
  58. package/dist/{agentApi-DLt94vXk.d.mts → content-B2MzIMwA.d.mts} +8 -755
  59. package/dist/{agentApi-DLt94vXk.d.ts → content-B2MzIMwA.d.ts} +8 -755
  60. package/dist/dialogs.d.mts +25 -0
  61. package/dist/dialogs.d.ts +25 -0
  62. package/dist/dialogs.js +1 -0
  63. package/dist/dialogs.mjs +1 -0
  64. package/dist/document-DZ_ZeZEH.d.ts +294 -0
  65. package/dist/document-Di1qGqLS.d.mts +294 -0
  66. package/dist/executor-EPEB53SJ.js +1 -0
  67. package/dist/executor-TVJ6K6MW.mjs +1 -0
  68. package/dist/findReplace-CpIoILbP.d.mts +138 -0
  69. package/dist/findReplace-pkMskVJU.d.ts +138 -0
  70. package/dist/hooks.d.mts +598 -0
  71. package/dist/hooks.d.ts +598 -0
  72. package/dist/hooks.js +1 -0
  73. package/dist/hooks.mjs +1 -0
  74. package/dist/index.d.mts +1013 -483
  75. package/dist/index.d.ts +1013 -483
  76. package/dist/index.js +40 -120
  77. package/dist/index.mjs +40 -120
  78. package/dist/layout-bridge-5GYGYKM5.mjs +1 -0
  79. package/dist/layout-bridge-QQDA7ELH.js +1 -0
  80. package/dist/plugin-api.d.mts +176 -0
  81. package/dist/plugin-api.d.ts +176 -0
  82. package/dist/plugin-api.js +260 -0
  83. package/dist/plugin-api.mjs +260 -0
  84. package/dist/processTemplate-BTBTR7AM.js +1 -0
  85. package/dist/{processTemplate-W2C5PXZB.mjs → processTemplate-MBX2KDLE.mjs} +1 -1
  86. package/dist/styles.css +1 -1
  87. package/dist/styles.d.mts +18 -0
  88. package/dist/styles.d.ts +18 -0
  89. package/dist/styles.js +1 -0
  90. package/dist/styles.mjs +1 -0
  91. package/dist/types-Bd_YzkhG.d.mts +281 -0
  92. package/dist/types-Bd_YzkhG.d.ts +281 -0
  93. package/dist/types-CkfDgB0O.d.mts +39 -0
  94. package/dist/types-DZUhB7Ao.d.mts +18 -0
  95. package/dist/types-DZUhB7Ao.d.ts +18 -0
  96. package/dist/types-DcxHFUSc.d.ts +39 -0
  97. package/dist/ui.d.mts +111 -552
  98. package/dist/ui.d.ts +111 -552
  99. package/dist/ui.js +111 -1
  100. package/dist/ui.mjs +111 -1
  101. package/dist/useFindReplace-DDs533b-.d.mts +261 -0
  102. package/dist/useFindReplace-eyhMSZZf.d.ts +261 -0
  103. package/package.json +41 -43
  104. package/dist/ClipboardManager-CVKX0v9q.d.ts +0 -464
  105. package/dist/ClipboardManager-V3aaMnWE.d.mts +0 -464
  106. package/dist/DocumentAgent-BWflKHpH.d.mts +0 -442
  107. package/dist/DocumentAgent-DsdXtetF.d.ts +0 -442
  108. package/dist/FindReplaceDialog-L3YF5HIS.mjs +0 -1
  109. package/dist/FindReplaceDialog-SEBWC5P7.js +0 -1
  110. package/dist/HyperlinkDialog-WEK6JSAC.js +0 -1
  111. package/dist/ImagePropertiesDialog-527MFLQO.mjs +0 -1
  112. package/dist/ImagePropertiesDialog-HG4K3IE7.js +0 -1
  113. package/dist/PageSetupDialog-GALVJMUB.js +0 -1
  114. package/dist/PageSetupDialog-TGQIAMI7.mjs +0 -1
  115. package/dist/TableToolbar-DUgmob2I.d.ts +0 -1273
  116. package/dist/TableToolbar-YL74HNS1.d.mts +0 -1273
  117. package/dist/chunk-23SXXIZS.js +0 -111
  118. package/dist/chunk-3F52AP2Q.js +0 -1
  119. package/dist/chunk-42O5GXM5.mjs +0 -82
  120. package/dist/chunk-54ULJEHM.mjs +0 -1
  121. package/dist/chunk-5XK326FI.mjs +0 -1
  122. package/dist/chunk-6WPRCJ5A.mjs +0 -1
  123. package/dist/chunk-76IYR7C7.mjs +0 -1
  124. package/dist/chunk-7BG7QY7I.js +0 -182
  125. package/dist/chunk-AGRIVA4G.js +0 -1
  126. package/dist/chunk-BTCQ2QI3.mjs +0 -3
  127. package/dist/chunk-BUEMG4NW.js +0 -1
  128. package/dist/chunk-BXRC4U3X.mjs +0 -2
  129. package/dist/chunk-CPAYKE6X.mjs +0 -1
  130. package/dist/chunk-DACWLFKI.mjs +0 -1
  131. package/dist/chunk-EPBFWE36.js +0 -2
  132. package/dist/chunk-FXES3YDB.js +0 -82
  133. package/dist/chunk-HI66BSGS.mjs +0 -9
  134. package/dist/chunk-INTPVEO6.mjs +0 -9
  135. package/dist/chunk-IOAGVW6Q.mjs +0 -2
  136. package/dist/chunk-JCEWC5QL.mjs +0 -4
  137. package/dist/chunk-JTIUFACT.js +0 -1
  138. package/dist/chunk-KUTCCI4X.mjs +0 -182
  139. package/dist/chunk-LUF7PWIC.js +0 -10
  140. package/dist/chunk-MGEN6GOE.mjs +0 -2
  141. package/dist/chunk-MOE2ZGUE.js +0 -18
  142. package/dist/chunk-MWLHJWB6.js +0 -9
  143. package/dist/chunk-OFYVDN3U.mjs +0 -2
  144. package/dist/chunk-P4VSHBGZ.js +0 -2
  145. package/dist/chunk-P5FQHIES.mjs +0 -1
  146. package/dist/chunk-PBC7XAYZ.js +0 -3
  147. package/dist/chunk-PEMB6SZT.js +0 -2
  148. package/dist/chunk-PQMSZTBB.js +0 -9
  149. package/dist/chunk-Q7UDQXAF.js +0 -1
  150. package/dist/chunk-QGTAIC5E.js +0 -1
  151. package/dist/chunk-QVPR2W5S.js +0 -1
  152. package/dist/chunk-R3QMYPL5.mjs +0 -59
  153. package/dist/chunk-RBUTXXQJ.mjs +0 -18
  154. package/dist/chunk-RRWYZ2TS.mjs +0 -111
  155. package/dist/chunk-SFUM35DH.js +0 -2
  156. package/dist/chunk-SNLC6EK2.js +0 -1
  157. package/dist/chunk-TMTLIGLZ.js +0 -59
  158. package/dist/chunk-TSE2PWFX.mjs +0 -10
  159. package/dist/chunk-UWYD42WV.js +0 -4
  160. package/dist/chunk-UXVACQCY.mjs +0 -1
  161. package/dist/chunk-W4EIKDM6.mjs +0 -2
  162. package/dist/chunk-W53SI3XW.mjs +0 -1
  163. package/dist/chunk-WNS2RBQD.js +0 -2
  164. package/dist/chunk-Z3KMSHUP.js +0 -1
  165. package/dist/core-plugins-reexport.d.mts +0 -31
  166. package/dist/core-plugins-reexport.d.ts +0 -31
  167. package/dist/core-plugins-reexport.js +0 -1
  168. package/dist/core-plugins-reexport.mjs +0 -1
  169. package/dist/core-reexport.d.mts +0 -340
  170. package/dist/core-reexport.d.ts +0 -340
  171. package/dist/core-reexport.js +0 -1
  172. package/dist/core-reexport.mjs +0 -1
  173. package/dist/documentSerializer-DtS_-oGA.d.mts +0 -664
  174. package/dist/documentSerializer-Wj1p2ASa.d.ts +0 -664
  175. package/dist/executor-C3VXF7QA.mjs +0 -1
  176. package/dist/executor-GDBV3AGV.js +0 -1
  177. package/dist/headless-reexport.d.mts +0 -197
  178. package/dist/headless-reexport.d.ts +0 -197
  179. package/dist/headless-reexport.js +0 -1
  180. package/dist/headless-reexport.mjs +0 -1
  181. package/dist/insertOperations-BTH1Asas.d.mts +0 -176
  182. package/dist/insertOperations-CbUnXAXH.d.ts +0 -176
  183. package/dist/layout-bridge-EA4DJ227.js +0 -1
  184. package/dist/layout-bridge-XDPSO6GO.mjs +0 -1
  185. package/dist/mcp-reexport.d.mts +0 -156
  186. package/dist/mcp-reexport.d.ts +0 -156
  187. package/dist/mcp-reexport.js +0 -16
  188. package/dist/mcp-reexport.mjs +0 -16
  189. package/dist/processTemplate-MJ2PCSO5.js +0 -1
  190. package/dist/react-B0W16SV6.d.ts +0 -1330
  191. package/dist/react-D0Pn1nww.d.mts +0 -1330
  192. package/dist/react.css +0 -1
  193. package/dist/react.d.mts +0 -10
  194. package/dist/react.d.ts +0 -10
  195. package/dist/react.js +0 -1
  196. package/dist/react.mjs +0 -1
  197. package/dist/registry-CH9V-IX0.d.ts +0 -165
  198. package/dist/registry-CWBKYlNW.d.mts +0 -165
  199. package/dist/types-UDsUq8D3.d.mts +0 -310
  200. package/dist/types-jbivc9Lj.d.ts +0 -310
  201. package/dist/variableDetector-CdQ7ZTzA.d.mts +0 -204
  202. package/dist/variableDetector-DsRV3A9z.d.ts +0 -204
  203. package/i18n/de.json +0 -792
  204. package/i18n/en.json +0 -792
  205. package/i18n/he.json +0 -792
  206. package/i18n/pl.json +0 -792
  207. package/i18n/pt-BR.json +0 -792
  208. package/i18n/tr.json +0 -792
  209. package/i18n/zh-CN.json +0 -792
  210. /package/dist/{chunk-YC5KZSYD.js → chunk-ESZ6JRTW.js} +0 -0
  211. /package/dist/{chunk-LVGJKS7Y.mjs → chunk-TZMMD6RR.mjs} +0 -0
@@ -1,1330 +0,0 @@
1
- import * as React$1 from 'react';
2
- import React__default, { ReactNode, CSSProperties as CSSProperties$1, Component, ErrorInfo } from 'react';
3
- import * as prosemirror_view from 'prosemirror-view';
4
- import { EditorView } from 'prosemirror-view';
5
- import * as prosemirror_state from 'prosemirror-state';
6
- import { EditorState, Transaction } from 'prosemirror-state';
7
- import { T as TextFormatting, K as ParagraphFormatting, D as Document, a3 as Theme, C as Comment, e as Table } from './agentApi-DLt94vXk.mjs';
8
- import { F as FontOption, i as PrintOptions, T as Translations, l as TableContext, k as TableAction, n as TableSplitConfig, P as ParsedClipboardContent } from './TableToolbar-YL74HNS1.mjs';
9
- import { F as SidebarItem, g as EditorPluginCore, k as PluginPanelProps, R as RenderedDomContext, G as SidebarItemContext, f as EditorHandle, h as ErrorNotification, m as SavedDocumentData, d as AutoSaveStatus, e as ClipboardSelection } from './ClipboardManager-V3aaMnWE.mjs';
10
- import { g as DocxInput, D as DocumentAgent } from './DocumentAgent-BWflKHpH.mjs';
11
- import * as react_jsx_runtime from 'react/jsx-runtime';
12
-
13
- /**
14
- * React Plugin Interface for the DOCX Editor
15
- *
16
- * Extends the framework-agnostic EditorPluginCore with React-specific
17
- * UI rendering capabilities (Panel component, renderOverlay).
18
- */
19
-
20
- /**
21
- * React-specific editor plugin interface.
22
- *
23
- * Extends EditorPluginCore with:
24
- * - Panel: React component for rendering in the annotation panel
25
- * - renderOverlay: Function returning ReactNode for overlay rendering
26
- */
27
- /**
28
- * Render props passed to each sidebar item.
29
- */
30
- interface SidebarItemRenderProps {
31
- /** Whether this item is currently expanded/active. */
32
- isExpanded: boolean;
33
- /** Toggle expand/collapse for this item. */
34
- onToggleExpand: () => void;
35
- /** Ref callback to measure the rendered card height. */
36
- measureRef: (el: HTMLDivElement | null) => void;
37
- }
38
- /**
39
- * A sidebar item with React rendering, anchored to a document position.
40
- */
41
- interface ReactSidebarItem extends SidebarItem {
42
- /** Render the card content. */
43
- render: (props: SidebarItemRenderProps) => ReactNode;
44
- /** Estimated height in pixels (for pre-layout before measurement). Default: 40. */
45
- estimatedHeight?: number;
46
- }
47
- interface ReactEditorPlugin<TState = any> extends EditorPluginCore<TState> {
48
- /**
49
- * React component to render in the annotation panel area.
50
- * Receives editor state and callbacks for interaction.
51
- */
52
- Panel?: React.ComponentType<PluginPanelProps<TState>>;
53
- /**
54
- * Render an overlay on top of the rendered pages.
55
- * Use this for highlights, annotations, or other visual elements
56
- * that need to be positioned relative to the document content.
57
- */
58
- renderOverlay?: (context: RenderedDomContext, state: TState, editorView: EditorView | null) => ReactNode;
59
- /**
60
- * Provide sidebar items anchored to document positions.
61
- * Called whenever plugin state changes.
62
- * Items from all plugins are merged and laid out together in a unified sidebar.
63
- */
64
- getSidebarItems?: (state: TState, context: SidebarItemContext) => ReactSidebarItem[];
65
- }
66
- /**
67
- * Backwards-compatible alias — EditorPlugin is now ReactEditorPlugin.
68
- */
69
- type EditorPlugin<TState = any> = ReactEditorPlugin<TState>;
70
- /**
71
- * Context value provided to plugins and panels.
72
- */
73
- interface PluginContext {
74
- /** All registered plugins */
75
- plugins: EditorPlugin[];
76
- /** Current editor view */
77
- editorView: EditorView | null;
78
- /** Set the editor view (called by editor on mount) */
79
- setEditorView: (view: EditorView | null) => void;
80
- /** Get plugin state by plugin ID */
81
- getPluginState: <T>(pluginId: string) => T | undefined;
82
- /** Update plugin state */
83
- setPluginState: <T>(pluginId: string, state: T) => void;
84
- /** Scroll to a position in the editor */
85
- scrollToPosition: (pos: number) => void;
86
- /** Select a range in the editor */
87
- selectRange: (from: number, to: number) => void;
88
- }
89
- /**
90
- * Props for the PluginHost component.
91
- */
92
- interface PluginHostProps {
93
- /** Plugins to enable */
94
- plugins: EditorPlugin[];
95
- /** The editor component (passed as child) */
96
- children: React.ReactElement;
97
- /** Class name for the host container */
98
- className?: string;
99
- }
100
- /**
101
- * Ref interface for the PluginHost component.
102
- */
103
- interface PluginHostRef {
104
- /** Get plugin state by plugin ID */
105
- getPluginState: <T>(pluginId: string) => T | undefined;
106
- /** Update plugin state for a plugin */
107
- setPluginState: <T>(pluginId: string, state: T) => void;
108
- /** Get the current editor view */
109
- getEditorView: () => EditorView | null;
110
- /** Force a refresh of all plugin states */
111
- refreshPluginStates: () => void;
112
- }
113
-
114
- /**
115
- * Selection Highlight Utilities
116
- *
117
- * Provides visual highlighting for text selection across multiple runs.
118
- * Browsers handle ::selection pseudo-element differently, especially when
119
- * selection spans multiple elements with different backgrounds or styling.
120
- *
121
- * This module provides:
122
- * - Custom selection highlight rendering
123
- * - Programmatic selection range marking
124
- * - Visual feedback for selection across runs
125
- */
126
- /** Framework-agnostic CSS properties type (compatible with React.CSSProperties) */
127
- type CSSProperties = Record<string, any>;
128
- /**
129
- * Highlight rectangle representing a selected region
130
- */
131
- interface HighlightRect {
132
- /** Left position in pixels */
133
- left: number;
134
- /** Top position in pixels */
135
- top: number;
136
- /** Width in pixels */
137
- width: number;
138
- /** Height in pixels */
139
- height: number;
140
- }
141
- /**
142
- * Selection highlight configuration
143
- */
144
- interface SelectionHighlightConfig {
145
- /** Background color for selection */
146
- backgroundColor: string;
147
- /** Optional border color for selection */
148
- borderColor?: string;
149
- /** Optional border radius */
150
- borderRadius?: number;
151
- /** Z-index for overlay */
152
- zIndex?: number;
153
- /** Opacity for highlight */
154
- opacity?: number;
155
- /** Mix blend mode */
156
- mixBlendMode?: CSSProperties['mixBlendMode'];
157
- }
158
- /**
159
- * Selection range in document coordinates
160
- */
161
- interface SelectionRange {
162
- /** Start position */
163
- start: {
164
- paragraphIndex: number;
165
- contentIndex: number;
166
- offset: number;
167
- };
168
- /** End position */
169
- end: {
170
- paragraphIndex: number;
171
- contentIndex: number;
172
- offset: number;
173
- };
174
- }
175
- /**
176
- * Default selection highlight style (matches Word/Google Docs)
177
- */
178
- declare const DEFAULT_SELECTION_STYLE: SelectionHighlightConfig;
179
- /**
180
- * High contrast selection style
181
- */
182
- declare const HIGH_CONTRAST_SELECTION_STYLE: SelectionHighlightConfig;
183
- /**
184
- * Selection highlight CSS custom properties
185
- */
186
- declare const SELECTION_CSS_VARS: {
187
- readonly backgroundColor: "--docx-selection-bg";
188
- readonly borderColor: "--docx-selection-border";
189
- readonly textColor: "--docx-selection-text";
190
- };
191
- /**
192
- * Get all selection rectangles from the current DOM selection
193
- *
194
- * Uses getClientRects() to get accurate rectangles even when
195
- * selection spans multiple inline elements.
196
- */
197
- declare function getSelectionRects(containerElement?: HTMLElement | null): HighlightRect[];
198
- /**
199
- * Merge adjacent or overlapping rectangles
200
- *
201
- * This reduces the number of highlight elements needed and creates
202
- * a cleaner visual appearance.
203
- */
204
- declare function mergeAdjacentRects(rects: HighlightRect[], tolerance?: number): HighlightRect[];
205
- /**
206
- * Get selection rectangles with merging applied
207
- */
208
- declare function getMergedSelectionRects(containerElement?: HTMLElement | null): HighlightRect[];
209
- /**
210
- * Generate CSS styles for a highlight rectangle
211
- */
212
- declare function getHighlightRectStyle(rect: HighlightRect, config?: SelectionHighlightConfig): CSSProperties;
213
- /**
214
- * Generate inline CSS for selection pseudo-elements
215
- *
216
- * This is used to inject consistent selection styling
217
- * across all editable elements.
218
- */
219
- declare function generateSelectionCSS(selector: string, config?: SelectionHighlightConfig): string;
220
- /**
221
- * Check if there is an active text selection (not collapsed)
222
- */
223
- declare function hasActiveSelection(): boolean;
224
- /**
225
- * Get the selected text
226
- */
227
- declare function getSelectedText(): string;
228
- /**
229
- * Check if selection is within a specific element
230
- */
231
- declare function isSelectionWithin(element: HTMLElement): boolean;
232
- /**
233
- * Get the bounding rect of the current selection
234
- */
235
- declare function getSelectionBoundingRect(): DOMRect | null;
236
- /**
237
- * Create a selection highlight for a specific text range
238
- *
239
- * This is useful for find/replace highlighting, AI action previews, etc.
240
- */
241
- declare function highlightTextRange(_containerElement: HTMLElement, startNode: Node, startOffset: number, endNode: Node, endOffset: number): Range | null;
242
- /**
243
- * Select a text range programmatically
244
- */
245
- declare function selectRange(range: Range): void;
246
- /**
247
- * Clear the current selection
248
- */
249
- declare function clearSelection(): void;
250
- /**
251
- * Check if selection is backwards (focus before anchor)
252
- */
253
- declare function isSelectionBackwards(): boolean;
254
- /**
255
- * Normalize selection to always be forward (start before end)
256
- */
257
- declare function normalizeSelectionDirection(): void;
258
- /**
259
- * Inject selection highlight CSS into document
260
- */
261
- declare function injectSelectionStyles(config?: SelectionHighlightConfig): void;
262
- /**
263
- * Remove injected selection styles
264
- */
265
- declare function removeSelectionStyles(): void;
266
- /**
267
- * Check if selection styles are injected
268
- */
269
- declare function areSelectionStylesInjected(): boolean;
270
- /**
271
- * Create a selection change handler that updates highlight rects
272
- */
273
- declare function createSelectionChangeHandler(containerElement: HTMLElement | null, onRectsChange: (rects: HighlightRect[]) => void, merge?: boolean): () => void;
274
-
275
- /**
276
- * Selection State Utilities
277
- *
278
- * Extracts selection state from ProseMirror for toolbar integration.
279
- */
280
-
281
- /**
282
- * Selection state for toolbar integration
283
- */
284
- interface SelectionState {
285
- /** Whether there's an active selection (not just cursor) */
286
- hasSelection: boolean;
287
- /** Whether selection spans multiple paragraphs */
288
- isMultiParagraph: boolean;
289
- /** Current text formatting at selection/cursor */
290
- textFormatting: TextFormatting;
291
- /** Current paragraph formatting */
292
- paragraphFormatting: ParagraphFormatting;
293
- /** Current paragraph style ID (e.g., 'Heading1', 'Normal') */
294
- styleId: string | null;
295
- /** Start paragraph index */
296
- startParagraphIndex: number;
297
- /** End paragraph index */
298
- endParagraphIndex: number;
299
- }
300
-
301
- /**
302
- * Layout Engine Types
303
- *
304
- * Core types for the paginated layout engine.
305
- * Converts document blocks + measurements into positioned fragments on pages.
306
- */
307
- /**
308
- * Unique identifier for a block in the document.
309
- * Format: typically `${index}-${type}` or just the block index.
310
- */
311
- type BlockId = string | number;
312
- /**
313
- * Base fragment properties common to all fragment types.
314
- */
315
- type FragmentBase = {
316
- /** Block ID this fragment belongs to. */
317
- blockId: BlockId;
318
- /** X position on page (relative to page left). */
319
- x: number;
320
- /** Y position on page (relative to page top). */
321
- y: number;
322
- /** Width of the fragment. */
323
- width: number;
324
- /** ProseMirror start position (for click mapping). */
325
- pmStart?: number;
326
- /** ProseMirror end position (for click mapping). */
327
- pmEnd?: number;
328
- };
329
- /**
330
- * A paragraph fragment positioned on a page.
331
- * May span only part of the paragraph's lines if split across pages.
332
- */
333
- type ParagraphFragment = FragmentBase & {
334
- kind: 'paragraph';
335
- /** First line index (inclusive) from the measure. */
336
- fromLine: number;
337
- /** Last line index (exclusive) from the measure. */
338
- toLine: number;
339
- /** Height of this fragment. */
340
- height: number;
341
- /** True if this continues from a previous page. */
342
- continuesFromPrev?: boolean;
343
- /** True if this continues onto the next page. */
344
- continuesOnNext?: boolean;
345
- };
346
- /**
347
- * A table fragment positioned on a page.
348
- * May span only part of the table's rows if split across pages.
349
- */
350
- type TableFragment = FragmentBase & {
351
- kind: 'table';
352
- /** First row index (inclusive). */
353
- fromRow: number;
354
- /** Last row index (exclusive). */
355
- toRow: number;
356
- /** Height of this fragment. */
357
- height: number;
358
- /** True if this is a floating table. */
359
- isFloating?: boolean;
360
- /** True if this continues from a previous page. */
361
- continuesFromPrev?: boolean;
362
- /** True if this continues onto the next page. */
363
- continuesOnNext?: boolean;
364
- /** Number of header rows prepended to this continuation fragment (0 or undefined for first fragment). */
365
- headerRowCount?: number;
366
- };
367
- /**
368
- * An image fragment positioned on a page.
369
- */
370
- type ImageFragment = FragmentBase & {
371
- kind: 'image';
372
- /** Height of the image. */
373
- height: number;
374
- /** True if this is an anchored/floating image. */
375
- isAnchored?: boolean;
376
- /** Z-index for layering. */
377
- zIndex?: number;
378
- };
379
- /**
380
- * A text box fragment positioned on a page.
381
- */
382
- type TextBoxFragment = FragmentBase & {
383
- kind: 'textBox';
384
- /** Height of the text box. */
385
- height: number;
386
- };
387
- /**
388
- * Union of all fragment types.
389
- */
390
- type Fragment = ParagraphFragment | TableFragment | ImageFragment | TextBoxFragment;
391
- /**
392
- * Page margin configuration.
393
- */
394
- type PageMargins = {
395
- top: number;
396
- right: number;
397
- bottom: number;
398
- left: number;
399
- /** Distance from page top to header content. */
400
- header?: number;
401
- /** Distance from page bottom to footer content. */
402
- footer?: number;
403
- };
404
- /**
405
- * A rendered page containing positioned fragments.
406
- */
407
- type Page = {
408
- /** Page number (1-indexed). */
409
- number: number;
410
- /** Fragments positioned on this page. */
411
- fragments: Fragment[];
412
- /** Page margins. */
413
- margins: PageMargins;
414
- /** Page size (width, height). */
415
- size: {
416
- w: number;
417
- h: number;
418
- };
419
- /** Page orientation. */
420
- orientation?: 'portrait' | 'landscape';
421
- /** Section index this page belongs to. */
422
- sectionIndex?: number;
423
- /** Header/footer references for this page. */
424
- headerFooterRefs?: {
425
- headerDefault?: string;
426
- headerFirst?: string;
427
- headerEven?: string;
428
- footerDefault?: string;
429
- footerFirst?: string;
430
- footerEven?: string;
431
- };
432
- /** Footnote IDs that appear on this page (for rendering). */
433
- footnoteIds?: number[];
434
- /** Height reserved for the footnote area at page bottom (pixels). */
435
- footnoteReservedHeight?: number;
436
- /** Column layout for this page (if multi-column). */
437
- columns?: ColumnLayout;
438
- };
439
- /**
440
- * Column layout configuration.
441
- */
442
- type ColumnLayout = {
443
- count: number;
444
- gap: number;
445
- equalWidth?: boolean;
446
- /** Draw vertical separator line between columns (w:sep). */
447
- separator?: boolean;
448
- };
449
- /**
450
- * Header/footer layout for a specific type.
451
- */
452
- type HeaderFooterLayout = {
453
- height: number;
454
- fragments: Fragment[];
455
- };
456
- /**
457
- * Final layout output ready for rendering/painting.
458
- */
459
- type Layout = {
460
- /** Default page size for the document. */
461
- pageSize: {
462
- w: number;
463
- h: number;
464
- };
465
- /** All rendered pages with positioned fragments. */
466
- pages: Page[];
467
- /** Column configuration (if multi-column). */
468
- columns?: ColumnLayout;
469
- /** Header layouts by type (default, first, even). */
470
- headers?: Record<string, HeaderFooterLayout>;
471
- /** Footer layouts by type (default, first, even). */
472
- footers?: Record<string, HeaderFooterLayout>;
473
- /** Gap between pages in pixels (for rendering). */
474
- pageGap?: number;
475
- };
476
-
477
- interface PagedEditorRef {
478
- /** Get the current document. */
479
- getDocument(): Document | null;
480
- /** Get the ProseMirror EditorState. */
481
- getState(): EditorState | null;
482
- /** Get the ProseMirror EditorView. */
483
- getView(): EditorView | null;
484
- /** Focus the editor. */
485
- focus(): void;
486
- /** Blur the editor. */
487
- blur(): void;
488
- /** Check if focused. */
489
- isFocused(): boolean;
490
- /** Dispatch a transaction. */
491
- dispatch(tr: Transaction): void;
492
- /** Undo. */
493
- undo(): boolean;
494
- /** Redo. */
495
- redo(): boolean;
496
- /** Set selection by PM position. */
497
- setSelection(anchor: number, head?: number): void;
498
- /** Get current layout. */
499
- getLayout(): Layout | null;
500
- /** Force re-layout. */
501
- relayout(): void;
502
- /** Scroll the visible pages to bring a PM position into view. */
503
- scrollToPosition(pmPos: number): void;
504
- /**
505
- * Scroll to the paragraph identified by Word `w14:paraId` / PM `paraId`.
506
- * @returns whether a matching paragraph was found
507
- */
508
- scrollToParaId(paraId: string): boolean;
509
- /**
510
- * Scroll the paginated view so `pageNumber` (1-indexed) is in view.
511
- * No-op if the layout isn't ready yet or pageNumber is out of range.
512
- */
513
- scrollToPage(pageNumber: number): void;
514
- }
515
-
516
- /**
517
- * DocxEditor props
518
- */
519
- interface DocxEditorProps {
520
- /** Document data — ArrayBuffer, Uint8Array, Blob, or File */
521
- documentBuffer?: DocxInput | null;
522
- /** Pre-parsed document (alternative to documentBuffer) */
523
- document?: Document | null;
524
- /** Callback when document is saved */
525
- onSave?: (buffer: ArrayBuffer) => void;
526
- /** Author name used for comments and track changes */
527
- author?: string;
528
- /** Callback when document changes */
529
- onChange?: (document: Document) => void;
530
- /** Callback when selection changes */
531
- onSelectionChange?: (state: SelectionState | null) => void;
532
- /** Callback on error */
533
- onError?: (error: Error) => void;
534
- /** Callback when fonts are loaded */
535
- onFontsLoaded?: () => void;
536
- /** External ProseMirror plugins (from PluginHost) */
537
- externalPlugins?: prosemirror_state.Plugin[];
538
- /**
539
- * When true, the editor treats the `document` prop as a schema seed only and
540
- * does not load it into ProseMirror on mount. Content is expected to come from
541
- * external sources — typically `externalPlugins` such as `ySyncPlugin` from
542
- * `y-prosemirror`, but also any code that dispatches transactions directly.
543
- *
544
- * You must still pass a `document` prop (e.g., `createEmptyDocument()`) so the
545
- * editor can build its schema and render the shell.
546
- */
547
- externalContent?: boolean;
548
- /** Callback when editor view is ready (for PluginHost) */
549
- onEditorViewReady?: (view: prosemirror_view.EditorView) => void;
550
- /** Theme for styling */
551
- theme?: Theme | null;
552
- /** Whether to show toolbar (default: true) */
553
- showToolbar?: boolean;
554
- /** Whether to show zoom control (default: true) */
555
- showZoomControl?: boolean;
556
- /** Whether to show page margin guides/boundaries (default: false) */
557
- showMarginGuides?: boolean;
558
- /** Color for margin guides (default: '#c0c0c0') */
559
- marginGuideColor?: string;
560
- /** Whether to show horizontal ruler (default: false) */
561
- showRuler?: boolean;
562
- /** Unit for ruler display (default: 'inch') */
563
- rulerUnit?: 'inch' | 'cm';
564
- /** Initial zoom level (default: 1.0) */
565
- initialZoom?: number;
566
- /** Whether the editor is read-only. When true, hides toolbar and rulers */
567
- readOnly?: boolean;
568
- /**
569
- * When true, the editor does not intercept Cmd/Ctrl+F or Cmd/Ctrl+H.
570
- * This lets the browser or host app handle native find/history shortcuts.
571
- */
572
- disableFindReplaceShortcuts?: boolean;
573
- /** Custom toolbar actions */
574
- toolbarExtra?: ReactNode;
575
- /** Additional CSS class name */
576
- className?: string;
577
- /** Additional inline styles */
578
- style?: CSSProperties$1;
579
- /** Placeholder when no document */
580
- placeholder?: ReactNode;
581
- /** Loading indicator */
582
- loadingIndicator?: ReactNode;
583
- /** Whether to show the document outline sidebar (default: false) */
584
- showOutline?: boolean;
585
- /** Whether to show the floating outline toggle button (default: true) */
586
- showOutlineButton?: boolean;
587
- /**
588
- * Custom list of fonts shown in the toolbar's font-family dropdown.
589
- * Strings render in the "Other" group; pass `FontOption[]` for category
590
- * grouping and CSS fallback chains. Omit to use the built-in 12-font
591
- * default. An empty array renders an empty (but enabled) dropdown.
592
- *
593
- * Pass a stable reference (memoized or module-level) — inline arrays
594
- * create a new identity per render and invalidate the picker's memo.
595
- *
596
- * @example fontFamilies={['Arial', 'Roboto']}
597
- * @example fontFamilies={[{ name: 'Roboto', fontFamily: 'Roboto, sans-serif', category: 'sans-serif' }]}
598
- */
599
- fontFamilies?: ReadonlyArray<string | FontOption>;
600
- /** Whether to show print button in toolbar (default: true) */
601
- showPrintButton?: boolean;
602
- /** Whether to show the editing mode switcher (Editing/Suggesting/Viewing) in toolbar (default: true) */
603
- showModeSwitcher?: boolean;
604
- /** Whether to show the comments sidebar toggle button in toolbar (default: true) */
605
- showCommentsSidebarToggle?: boolean;
606
- /** Print options for print preview */
607
- printOptions?: PrintOptions;
608
- /** Callback when print is triggered */
609
- onPrint?: () => void;
610
- /** Callback when content is copied */
611
- onCopy?: () => void;
612
- /** Callback when content is cut */
613
- onCut?: () => void;
614
- /** Callback when content is pasted */
615
- onPaste?: () => void;
616
- /** Editor mode: 'editing' (direct edits), 'suggesting' (track changes), or 'viewing' (read-only). Default: 'editing' */
617
- mode?: EditorMode;
618
- /** Callback when the editing mode changes */
619
- onModeChange?: (mode: EditorMode) => void;
620
- /** Callback when a comment is added via the UI */
621
- onCommentAdd?: (comment: Comment) => void;
622
- /** Callback when a comment is resolved via the UI */
623
- onCommentResolve?: (comment: Comment) => void;
624
- /** Callback when a comment is deleted via the UI */
625
- onCommentDelete?: (comment: Comment) => void;
626
- /** Callback when a reply is added to a comment via the UI */
627
- onCommentReply?: (reply: Comment, parent: Comment) => void;
628
- /**
629
- * Controlled comments array. When provided, the editor reads comment thread
630
- * metadata (text, author, replies, resolved status) from this prop instead
631
- * of internal state, and emits every change through `onCommentsChange`.
632
- *
633
- * Use this with collaboration backends (Yjs, Liveblocks, Automerge, …) so
634
- * comment threads sync across peers — the PM document only carries the
635
- * range markers; thread metadata lives outside the doc and needs its own
636
- * sync channel.
637
- *
638
- * If omitted, the editor falls back to internal state (current behavior).
639
- * The granular `onCommentAdd`/`onCommentResolve`/`onCommentDelete`/
640
- * `onCommentReply` callbacks fire in both modes.
641
- */
642
- comments?: Comment[];
643
- /** Fires whenever the comments array changes (controlled mode). */
644
- onCommentsChange?: (comments: Comment[]) => void;
645
- /**
646
- * Callback when rendered DOM context is ready (for plugin overlays).
647
- * Used by PluginHost to get access to the rendered page DOM for positioning.
648
- */
649
- onRenderedDomContextReady?: (context: RenderedDomContext) => void;
650
- /**
651
- * Plugin overlays to render inside the editor viewport.
652
- * Passed from PluginHost to render plugin-specific overlays.
653
- */
654
- pluginOverlays?: ReactNode;
655
- /** Sidebar items from plugins (passed from PluginHost). */
656
- pluginSidebarItems?: ReactSidebarItem[];
657
- /** Rendered DOM context from PluginHost (for sidebar position resolution). */
658
- pluginRenderedDomContext?: RenderedDomContext | null;
659
- /** Custom logo/icon for the title bar */
660
- renderLogo?: () => ReactNode;
661
- /** Document name shown in the title bar */
662
- documentName?: string;
663
- /** Callback when document name changes */
664
- onDocumentNameChange?: (name: string) => void;
665
- /** Whether the document name is editable (default: true) */
666
- documentNameEditable?: boolean;
667
- /** Custom right-side actions for the title bar */
668
- renderTitleBarRight?: () => ReactNode;
669
- /** Translation overrides. Import a locale JSON file and pass it directly. */
670
- i18n?: Translations;
671
- /**
672
- * Mount a controllable agent panel on the right side of the editor. The
673
- * panel is the chrome (header, close button, drag-resize); the consumer
674
- * supplies whatever content goes inside via `render` — typically a chat
675
- * UI from `@ai-sdk/react`'s `useChat`, `assistant-ui`, or any other
676
- * framework. We do not ship message bubbles, a composer, or a chat engine.
677
- *
678
- * Three control patterns:
679
- * - **Uncontrolled**: `agentPanel={{ render }}` — toolbar button + panel
680
- * close button toggle the panel. Width persists to localStorage.
681
- * - **Controlled**: `agentPanel={{ render, open, onOpenChange }}` — the
682
- * consumer owns open state (e.g. tied to a global menu).
683
- * - **Headless**: omit `agentPanel`, use the toolkit directly via
684
- * `useDocxAgentTools` — render the panel anywhere you want.
685
- */
686
- agentPanel?: {
687
- /** Render-prop returning the panel content. Called only when open. */
688
- render: (ctx: {
689
- close: () => void;
690
- }) => ReactNode;
691
- /** Controlled open state. Omit for uncontrolled. */
692
- open?: boolean;
693
- /** Fires when toolbar button or panel close button is clicked. */
694
- onOpenChange?: (open: boolean) => void;
695
- /** Show the toolbar toggle button. Default: true. */
696
- showToolbarButton?: boolean;
697
- /** Optional badge / dot on the toolbar button. */
698
- toolbarBadge?: ReactNode;
699
- /** Optional panel title. Default: t('agentPanel.defaultTitle'). */
700
- title?: string;
701
- /** Optional panel header icon. Default: sparkle. */
702
- icon?: ReactNode;
703
- /** Initial panel width in px (uncontrolled). Default: 360. */
704
- defaultWidth?: number;
705
- /** Min drag width. Default: 280. */
706
- minWidth?: number;
707
- /** Max drag width. Default: 600. */
708
- maxWidth?: number;
709
- };
710
- }
711
- /**
712
- * DocxEditor ref interface
713
- */
714
- interface DocxEditorRef {
715
- /** Get the DocumentAgent for programmatic access */
716
- getAgent: () => DocumentAgent | null;
717
- /** Get the current document */
718
- getDocument: () => Document | null;
719
- /** Get the editor ref */
720
- getEditorRef: () => PagedEditorRef | null;
721
- /** Save the document to buffer. Pass { selective: false } to force full repack. */
722
- save: (options?: {
723
- selective?: boolean;
724
- }) => Promise<ArrayBuffer | null>;
725
- /** Set zoom level */
726
- setZoom: (zoom: number) => void;
727
- /** Get current zoom level */
728
- getZoom: () => number;
729
- /** Focus the editor */
730
- focus: () => void;
731
- /** Get current page number */
732
- getCurrentPage: () => number;
733
- /** Get total page count */
734
- getTotalPages: () => number;
735
- /**
736
- * Scroll the paginated view so the given page is in view.
737
- * Page numbers are 1-indexed (matches `getCurrentPage` / `getTotalPages`).
738
- * No-op for out-of-range or non-integer values.
739
- * @example ref.current?.scrollToPage(2)
740
- */
741
- scrollToPage: (pageNumber: number) => void;
742
- /**
743
- * Scroll the paginated view to the paragraph with the given Word `w14:paraId`.
744
- * @returns whether a matching paragraph exists in the ProseMirror document
745
- * @example ref.current?.scrollToParaId('1A2B3C4D')
746
- */
747
- scrollToParaId: (paraId: string) => boolean;
748
- /**
749
- * Scroll the paginated view to a specific ProseMirror document position.
750
- * Use this when you have a raw PM offset; for Word `w14:paraId` use
751
- * `scrollToParaId` instead.
752
- * @example ref.current?.scrollToPosition(42)
753
- */
754
- scrollToPosition: (pmPos: number) => void;
755
- /** Open print preview */
756
- openPrintPreview: () => void;
757
- /** Print the document directly */
758
- print: () => void;
759
- /** Load a pre-parsed document programmatically */
760
- loadDocument: (doc: Document) => void;
761
- /** Load a DOCX buffer programmatically (ArrayBuffer, Uint8Array, Blob, or File) */
762
- loadDocumentBuffer: (buffer: DocxInput) => Promise<void>;
763
- /**
764
- * Apply document changes from a DocumentAgent while preserving undo history.
765
- * This dispatches a PM transaction that replaces the document content,
766
- * allowing undo/redo to work with agent-made changes.
767
- *
768
- * @param doc - The modified Document from an agent
769
- * @returns true if the changes were applied, false if the editor is not ready
770
- *
771
- * @example
772
- * ```ts
773
- * const agent = EnhancedDocumentAgent.fromDocument(editorRef.current.getDocument());
774
- * const updated = agent.toggleBulletList([0, 1, 2]).getDocument();
775
- * editorRef.current.applyDocumentChanges(updated);
776
- * // Ctrl+Z will undo the bullet list changes
777
- * ```
778
- */
779
- applyDocumentChanges: (doc: Document) => boolean;
780
- /** Add a comment programmatically. Anchored by Word `w14:paraId` so
781
- * it survives unrelated edits. Returns the comment ID, or null if
782
- * the paraId is unknown or the search text isn't found / is ambiguous. */
783
- addComment: (options: {
784
- paraId: string;
785
- text: string;
786
- author: string;
787
- /** Optional: anchor to a specific phrase within the paragraph (must be unique). */
788
- search?: string;
789
- }) => number | null;
790
- /** Reply to an existing comment. Returns the reply comment ID. */
791
- replyToComment: (commentId: number, text: string, author: string) => number | null;
792
- /** Resolve (mark as done) a comment. */
793
- resolveComment: (commentId: number) => void;
794
- /** Suggest a tracked change. Pass `replaceWith: ''` to delete the matched text;
795
- * pass `search: ''` to insert at paragraph end. Returns false on missing paraId,
796
- * missing/ambiguous search, or attempt to layer on an existing tracked change. */
797
- proposeChange: (options: {
798
- paraId: string;
799
- search: string;
800
- replaceWith: string;
801
- author: string;
802
- }) => boolean;
803
- /** Locate every paragraph containing `query` (case-insensitive substring).
804
- * Returns a stable handle (paraId + the matched phrase) the agent can pass
805
- * back to `addComment` / `proposeChange`. */
806
- findInDocument: (query: string, options?: {
807
- caseSensitive?: boolean;
808
- limit?: number;
809
- }) => Array<{
810
- paraId: string;
811
- match: string;
812
- before: string;
813
- after: string;
814
- }>;
815
- /**
816
- * Apply character formatting (bold / italic / color / size / font / etc.)
817
- * to a paragraph or to a unique phrase within it. This is a direct edit,
818
- * not a tracked change. Returns false on missing paraId or ambiguous search.
819
- */
820
- applyFormatting: (options: {
821
- paraId: string;
822
- search?: string;
823
- marks: {
824
- bold?: boolean;
825
- italic?: boolean;
826
- underline?: boolean | {
827
- style?: string;
828
- };
829
- strike?: boolean;
830
- color?: {
831
- rgb?: string;
832
- themeColor?: string;
833
- };
834
- highlight?: string;
835
- fontSize?: number;
836
- fontFamily?: {
837
- ascii?: string;
838
- hAnsi?: string;
839
- };
840
- };
841
- }) => boolean;
842
- /**
843
- * Apply a paragraph style by styleId (e.g. `'Heading1'`, `'Quote'`).
844
- * Direct edit, not a tracked change. Returns false if paraId is unknown.
845
- */
846
- setParagraphStyle: (options: {
847
- paraId: string;
848
- styleId: string;
849
- }) => boolean;
850
- /**
851
- * Read the contents of a single page. 1-indexed; returns null if the page
852
- * does not exist. Each paragraph is returned with its stable paraId so the
853
- * agent can comment on or modify it without an extra round-trip.
854
- */
855
- getPageContent: (pageNumber: number) => {
856
- pageNumber: number;
857
- text: string;
858
- paragraphs: Array<{
859
- paraId: string;
860
- text: string;
861
- styleId?: string;
862
- }>;
863
- } | null;
864
- /** Read the user's current cursor / selection — what's highlighted right now. */
865
- getSelectionInfo: () => {
866
- paraId: string | null;
867
- selectedText: string;
868
- paragraphText: string;
869
- before: string;
870
- after: string;
871
- } | null;
872
- /** Get all comments. */
873
- getComments: () => Comment[];
874
- /** Subscribe to document changes. Fires after every committed edit. Returns unsubscribe. */
875
- onContentChange: (listener: (document: Document) => void) => () => void;
876
- /** Subscribe to selection changes (cursor moves / selection changes). Returns unsubscribe. */
877
- onSelectionChange: (listener: (selection: SelectionState | null) => void) => () => void;
878
- }
879
- type EditorMode = 'editing' | 'suggesting' | 'viewing';
880
- /**
881
- * DocxEditor - Complete DOCX editor component
882
- */
883
- declare const DocxEditor: React$1.ForwardRefExoticComponent<DocxEditorProps & React$1.RefAttributes<DocxEditorRef>>;
884
-
885
- /**
886
- * Simple imperative API for rendering a DOCX editor into a DOM element.
887
- *
888
- * Returns an `EditorHandle` (from @eigenpal/docx-core) that works with
889
- * any framework implementation.
890
- *
891
- * Usage:
892
- * ```ts
893
- * import { renderAsync } from '@eigenpal/docx-js-editor';
894
- *
895
- * const editor = await renderAsync(docxBlob, document.getElementById('container'), {
896
- * readOnly: false,
897
- * showToolbar: true,
898
- * });
899
- *
900
- * // Save the edited document
901
- * const blob = await editor.save();
902
- *
903
- * // Clean up
904
- * editor.destroy();
905
- * ```
906
- */
907
-
908
- /**
909
- * Options for {@link renderAsync}. A subset of DocxEditorProps minus
910
- * `documentBuffer` / `document` (passed as the first argument instead).
911
- */
912
- type RenderAsyncOptions = Omit<DocxEditorProps, 'documentBuffer' | 'document'>;
913
- /**
914
- * React-specific handle that extends the framework-agnostic EditorHandle
915
- * with zoom control.
916
- */
917
- interface DocxEditorHandle extends EditorHandle {
918
- /** Set zoom level (1.0 = 100%). */
919
- setZoom: (zoom: number) => void;
920
- /** Scroll to a body paragraph by Word `w14:paraId`. */
921
- scrollToParaId: (paraId: string) => boolean;
922
- /** Scroll to a raw ProseMirror document position. */
923
- scrollToPosition: (pmPos: number) => void;
924
- }
925
- /**
926
- * Render a DOCX editor into a container element.
927
- *
928
- * @param input - DOCX data as ArrayBuffer, Uint8Array, Blob, or File
929
- * @param container - DOM element to render into
930
- * @param options - Editor configuration (toolbar, readOnly, callbacks, etc.)
931
- * @returns A handle with save / destroy / getDocument methods
932
- */
933
- declare function renderAsync(input: DocxInput, container: HTMLElement, options?: RenderAsyncOptions): Promise<DocxEditorHandle>;
934
-
935
- /**
936
- * Error context value
937
- */
938
- interface ErrorContextValue {
939
- /** Current notifications */
940
- notifications: ErrorNotification[];
941
- /** Show an error notification */
942
- showError: (message: string, details?: string) => void;
943
- /** Show a warning notification */
944
- showWarning: (message: string, details?: string) => void;
945
- /** Show an info notification */
946
- showInfo: (message: string, details?: string) => void;
947
- /** Dismiss a notification */
948
- dismissNotification: (id: string) => void;
949
- /** Clear all notifications */
950
- clearNotifications: () => void;
951
- }
952
- /**
953
- * Error boundary props
954
- */
955
- interface ErrorBoundaryProps {
956
- /** Child components to render */
957
- children: ReactNode;
958
- /** Custom fallback UI */
959
- fallback?: ReactNode | ((error: Error, reset: () => void) => ReactNode);
960
- /** Callback when error occurs */
961
- onError?: (error: Error, errorInfo: ErrorInfo) => void;
962
- /** Whether to show error details */
963
- showDetails?: boolean;
964
- }
965
- /**
966
- * Error boundary state
967
- */
968
- interface ErrorBoundaryState {
969
- hasError: boolean;
970
- error: Error | null;
971
- errorInfo: ErrorInfo | null;
972
- }
973
- /**
974
- * Hook to use error notifications
975
- */
976
- declare function useErrorNotifications(): ErrorContextValue;
977
- /**
978
- * Error notification provider
979
- *
980
- * Thin React wrapper around the framework-agnostic ErrorManager.
981
- * Uses useSyncExternalStore to subscribe to ErrorManager state.
982
- */
983
- declare function ErrorProvider({ children }: {
984
- children: ReactNode;
985
- }): react_jsx_runtime.JSX.Element;
986
- /**
987
- * Error Boundary class component
988
- *
989
- * Catches render errors in child components and displays fallback UI.
990
- */
991
- declare class ErrorBoundary extends Component<ErrorBoundaryProps, ErrorBoundaryState> {
992
- constructor(props: ErrorBoundaryProps);
993
- static getDerivedStateFromError(error: Error): Partial<ErrorBoundaryState>;
994
- componentDidCatch(error: Error, errorInfo: ErrorInfo): void;
995
- resetError: () => void;
996
- render(): ReactNode;
997
- }
998
- interface ParseErrorDisplayProps {
999
- message: string;
1000
- details?: string;
1001
- onRetry?: () => void;
1002
- className?: string;
1003
- }
1004
- /**
1005
- * Parse error display component
1006
- *
1007
- * Shows a helpful message for DOCX parsing errors.
1008
- */
1009
- declare function ParseErrorDisplay({ message, details, onRetry, className, }: ParseErrorDisplayProps): React__default.ReactElement;
1010
- interface UnsupportedFeatureWarningProps {
1011
- feature: string;
1012
- description?: string;
1013
- className?: string;
1014
- }
1015
- /**
1016
- * Unsupported feature warning component
1017
- *
1018
- * Shows a non-blocking warning for unsupported features.
1019
- */
1020
- declare function UnsupportedFeatureWarning({ feature, description, className, }: UnsupportedFeatureWarningProps): React__default.ReactElement;
1021
- /**
1022
- * Check if an error is a parse error
1023
- */
1024
- declare function isParseError(error: Error): boolean;
1025
- /**
1026
- * Get user-friendly error message
1027
- */
1028
- declare function getUserFriendlyMessage(error: Error): string;
1029
-
1030
- /**
1031
- * useTableSelection Hook
1032
- *
1033
- * Thin React wrapper around the framework-agnostic TableSelectionManager.
1034
- * Provides table selection tracking and table operation dispatch.
1035
- */
1036
-
1037
- interface TableSelectionState {
1038
- context: TableContext | null;
1039
- table: Table | null;
1040
- tableIndex: number | null;
1041
- rowIndex: number | null;
1042
- columnIndex: number | null;
1043
- }
1044
- interface UseTableSelectionReturn {
1045
- state: TableSelectionState;
1046
- handleCellClick: (tableIndex: number, rowIndex: number, columnIndex: number) => void;
1047
- handleAction: (action: TableAction) => void;
1048
- getSplitCellConfig: () => TableSplitConfig | null;
1049
- applySplitCell: (rows: number, cols: number) => void;
1050
- clearSelection: () => void;
1051
- isCellSelected: (tableIndex: number, rowIndex: number, columnIndex: number) => boolean;
1052
- tableContext: TableContext | null;
1053
- }
1054
- interface UseTableSelectionOptions {
1055
- document: Document | null;
1056
- onChange?: (document: Document) => void;
1057
- onSelectionChange?: (context: TableContext | null) => void;
1058
- }
1059
- declare function useTableSelection({ document: doc, onChange, onSelectionChange, }: UseTableSelectionOptions): UseTableSelectionReturn;
1060
-
1061
- /**
1062
- * useAutoSave Hook
1063
- *
1064
- * Thin React wrapper around the framework-agnostic AutoSaveManager.
1065
- * Bridges AutoSaveManager's subscribe/getSnapshot pattern with React state.
1066
- */
1067
-
1068
- /** Options for useAutoSave hook */
1069
- interface UseAutoSaveOptions {
1070
- /** Storage key for localStorage (default: 'docx-editor-autosave') */
1071
- storageKey?: string;
1072
- /** Save interval in milliseconds (default: 30000 - 30 seconds) */
1073
- interval?: number;
1074
- /** Whether auto-save is enabled (default: true) */
1075
- enabled?: boolean;
1076
- /** Maximum age of auto-save in milliseconds before it's considered stale (default: 24 hours) */
1077
- maxAge?: number;
1078
- /** Callback when save succeeds */
1079
- onSave?: (timestamp: Date) => void;
1080
- /** Callback when save fails */
1081
- onError?: (error: Error) => void;
1082
- /** Callback when recovery data is found */
1083
- onRecoveryAvailable?: (savedDocument: SavedDocumentData) => void;
1084
- /** Whether to save immediately when document changes (debounced) */
1085
- saveOnChange?: boolean;
1086
- /** Debounce delay for saveOnChange in milliseconds (default: 2000) */
1087
- debounceDelay?: number;
1088
- }
1089
- /** Return value of useAutoSave hook */
1090
- interface UseAutoSaveReturn {
1091
- status: AutoSaveStatus;
1092
- lastSaveTime: Date | null;
1093
- save: () => Promise<boolean>;
1094
- clearAutoSave: () => void;
1095
- hasRecoveryData: boolean;
1096
- getRecoveryData: () => SavedDocumentData | null;
1097
- acceptRecovery: () => Document | null;
1098
- dismissRecovery: () => void;
1099
- isEnabled: boolean;
1100
- enable: () => void;
1101
- disable: () => void;
1102
- }
1103
- declare function useAutoSave(document: Document | null | undefined, options?: UseAutoSaveOptions): UseAutoSaveReturn;
1104
-
1105
- /**
1106
- * useWheelZoom Hook
1107
- *
1108
- * Enables Ctrl+scroll (or Cmd+scroll on Mac) to zoom in/out.
1109
- * Features:
1110
- * - Configurable zoom range and step
1111
- * - Smooth zoom transitions
1112
- * - Pinch-to-zoom support on trackpads
1113
- * - Zoom reset (Ctrl+0)
1114
- * - Zoom in/out shortcuts (Ctrl++, Ctrl+-)
1115
- */
1116
- /**
1117
- * Options for useWheelZoom hook
1118
- */
1119
- interface UseWheelZoomOptions {
1120
- /** Initial zoom level (default: 1.0) */
1121
- initialZoom?: number;
1122
- /** Minimum zoom level (default: 0.25) */
1123
- minZoom?: number;
1124
- /** Maximum zoom level (default: 4.0) */
1125
- maxZoom?: number;
1126
- /** Zoom step for each scroll event (default: 0.1) */
1127
- zoomStep?: number;
1128
- /** Whether zoom is enabled (default: true) */
1129
- enabled?: boolean;
1130
- /** Container element ref to attach wheel listener */
1131
- containerRef?: React.RefObject<HTMLElement>;
1132
- /** Callback when zoom changes */
1133
- onZoomChange?: (zoom: number) => void;
1134
- /** Whether to enable keyboard shortcuts (Ctrl++, Ctrl+-, Ctrl+0) */
1135
- enableKeyboardShortcuts?: boolean;
1136
- /** Whether to prevent default browser zoom behavior */
1137
- preventDefault?: boolean;
1138
- }
1139
- /**
1140
- * Return value of useWheelZoom hook
1141
- */
1142
- interface UseWheelZoomReturn {
1143
- /** Current zoom level */
1144
- zoom: number;
1145
- /** Set zoom level directly */
1146
- setZoom: (zoom: number) => void;
1147
- /** Zoom in by step */
1148
- zoomIn: () => void;
1149
- /** Zoom out by step */
1150
- zoomOut: () => void;
1151
- /** Reset zoom to initial level */
1152
- resetZoom: () => void;
1153
- /** Reset zoom to 100% */
1154
- zoomTo100: () => void;
1155
- /** Zoom to fit width */
1156
- zoomToFit: (containerWidth: number, contentWidth: number) => void;
1157
- /** Whether currently at minimum zoom */
1158
- isMinZoom: boolean;
1159
- /** Whether currently at maximum zoom */
1160
- isMaxZoom: boolean;
1161
- /** Zoom percentage (e.g., 100 for zoom level 1.0) */
1162
- zoomPercent: number;
1163
- /** Wheel event handler (for manual attachment) */
1164
- handleWheel: (event: WheelEvent) => void;
1165
- /** Keyboard event handler (for manual attachment) */
1166
- handleKeyDown: (event: KeyboardEvent) => void;
1167
- }
1168
- /**
1169
- * Preset zoom levels for snapping
1170
- */
1171
- declare const ZOOM_PRESETS: number[];
1172
- /**
1173
- * React hook for Ctrl+scroll zoom functionality
1174
- */
1175
- declare function useWheelZoom(options?: UseWheelZoomOptions): UseWheelZoomReturn;
1176
- /**
1177
- * Get zoom presets
1178
- */
1179
- declare function getZoomPresets(): number[];
1180
- /**
1181
- * Find nearest zoom preset
1182
- */
1183
- declare function findNearestZoomPreset(zoom: number): number;
1184
- /**
1185
- * Get next zoom preset (for zoom in)
1186
- */
1187
- declare function getNextZoomPreset(zoom: number): number;
1188
- /**
1189
- * Get previous zoom preset (for zoom out)
1190
- */
1191
- declare function getPreviousZoomPreset(zoom: number): number;
1192
- /**
1193
- * Format zoom level for display
1194
- */
1195
- declare function formatZoom(zoom: number): string;
1196
- /**
1197
- * Parse zoom from percentage string
1198
- */
1199
- declare function parseZoom(zoomString: string): number | null;
1200
- /**
1201
- * Check if zoom level is at a preset
1202
- */
1203
- declare function isZoomPreset(zoom: number): boolean;
1204
- /**
1205
- * Clamp zoom to valid range
1206
- */
1207
- declare function clampZoom(zoom: number, minZoom?: number, maxZoom?: number): number;
1208
-
1209
- /**
1210
- * Selection Highlight Hook
1211
- *
1212
- * A React hook that manages visual selection highlighting across multiple runs.
1213
- * Uses a combination of CSS ::selection pseudo-element styling and optional
1214
- * overlay rectangles for complex scenarios.
1215
- *
1216
- * Features:
1217
- * - Consistent selection highlighting across all text runs
1218
- * - Support for text with different backgrounds (highlighted, dark bg)
1219
- * - Optional overlay rectangles for custom highlight effects
1220
- * - Debounced updates for performance
1221
- */
1222
-
1223
- /**
1224
- * Options for the useSelectionHighlight hook
1225
- */
1226
- interface UseSelectionHighlightOptions {
1227
- /** Reference to the container element */
1228
- containerRef: React__default.RefObject<HTMLElement>;
1229
- /** Whether to enable selection highlighting */
1230
- enabled?: boolean;
1231
- /** Custom highlight configuration */
1232
- config?: SelectionHighlightConfig;
1233
- /** Whether to use overlay rectangles (default: false, uses CSS) */
1234
- useOverlay?: boolean;
1235
- /** Debounce delay for rect updates in ms (default: 16) */
1236
- debounceMs?: number;
1237
- /** Callback when selection changes */
1238
- onSelectionChange?: (hasSelection: boolean, text: string) => void;
1239
- }
1240
- /**
1241
- * Return value from the useSelectionHighlight hook
1242
- */
1243
- interface UseSelectionHighlightReturn {
1244
- /** Whether there is an active selection */
1245
- hasSelection: boolean;
1246
- /** The selected text */
1247
- selectedText: string;
1248
- /** Highlight rectangles (only populated if useOverlay is true) */
1249
- highlightRects: HighlightRect[];
1250
- /** Whether selection is within the container */
1251
- isSelectionInContainer: boolean;
1252
- /** Refresh the highlight state */
1253
- refresh: () => void;
1254
- /** Get styles for a highlight rect overlay */
1255
- getOverlayStyle: (rect: HighlightRect) => CSSProperties$1;
1256
- }
1257
- /**
1258
- * Hook to manage selection highlighting in the editor
1259
- */
1260
- declare function useSelectionHighlight(options: UseSelectionHighlightOptions): UseSelectionHighlightReturn;
1261
- /**
1262
- * Props for selection overlay component
1263
- */
1264
- interface SelectionOverlayProps {
1265
- /** Highlight rectangles to render */
1266
- rects: HighlightRect[];
1267
- /** Style configuration */
1268
- config?: SelectionHighlightConfig;
1269
- /** Additional class name */
1270
- className?: string;
1271
- }
1272
- /**
1273
- * Generate selection overlay elements (for use in JSX)
1274
- *
1275
- * Usage:
1276
- * ```tsx
1277
- * const { highlightRects } = useSelectionHighlight({ ... });
1278
- * return (
1279
- * <div style={{ position: 'relative' }}>
1280
- * {generateOverlayElements(highlightRects)}
1281
- * <div>... content ...</div>
1282
- * </div>
1283
- * );
1284
- * ```
1285
- */
1286
- declare function generateOverlayElements(rects: HighlightRect[], config?: SelectionHighlightConfig): React__default.ReactNode[];
1287
-
1288
- /**
1289
- * useClipboard Hook
1290
- *
1291
- * Thin React wrapper around the framework-agnostic ClipboardManager.
1292
- * Handles clipboard operations with formatting preservation.
1293
- */
1294
-
1295
- interface UseClipboardOptions {
1296
- onCopy?: (selection: ClipboardSelection) => void;
1297
- onCut?: (selection: ClipboardSelection) => void;
1298
- onPaste?: (content: ParsedClipboardContent, asPlainText: boolean) => void;
1299
- cleanWordFormatting?: boolean;
1300
- editable?: boolean;
1301
- onError?: (error: Error) => void;
1302
- /** Document theme — used to resolve themed colors in the HTML clipboard payload. */
1303
- theme?: Theme | null;
1304
- }
1305
- interface UseClipboardReturn {
1306
- copy: (selection: ClipboardSelection) => Promise<boolean>;
1307
- cut: (selection: ClipboardSelection) => Promise<boolean>;
1308
- paste: (asPlainText?: boolean) => Promise<ParsedClipboardContent | null>;
1309
- handleCopy: (event: ClipboardEvent) => void;
1310
- handleCut: (event: ClipboardEvent) => void;
1311
- handlePaste: (event: ClipboardEvent) => void;
1312
- handleKeyDown: (event: KeyboardEvent) => void;
1313
- isProcessing: boolean;
1314
- lastPastedContent: ParsedClipboardContent | null;
1315
- }
1316
- declare function useClipboard(options?: UseClipboardOptions): UseClipboardReturn;
1317
-
1318
- declare const PLUGIN_HOST_STYLES = "\n.plugin-host {\n display: flex;\n width: 100%;\n height: 100%;\n overflow: visible;\n position: relative;\n}\n\n.plugin-host-editor {\n flex: 1;\n display: flex;\n flex-direction: column;\n min-width: 0;\n overflow: visible;\n}\n\n\n.plugin-panels-left,\n.plugin-panels-right {\n display: flex;\n flex-direction: column;\n flex-shrink: 0;\n background: #f8f9fa;\n border-color: #e9ecef;\n}\n\n.plugin-panels-left {\n border-right: 1px solid #e9ecef;\n}\n\n.plugin-panels-right {\n border-left: 1px solid #e9ecef;\n}\n\n.plugin-panels-bottom {\n border-top: 1px solid #e9ecef;\n background: #f8f9fa;\n}\n\n.plugin-panel {\n position: relative;\n display: flex;\n flex-direction: column;\n overflow: hidden;\n transition: width 0.2s ease, height 0.2s ease;\n}\n\n.plugin-panel.collapsed {\n overflow: visible;\n}\n\n.plugin-panel-toggle {\n display: flex;\n align-items: center;\n gap: 4px;\n padding: 6px 8px;\n background: transparent;\n border: none;\n cursor: pointer;\n font-size: 12px;\n color: #6c757d;\n white-space: nowrap;\n}\n\n.plugin-panel.collapsed .plugin-panel-toggle {\n writing-mode: vertical-rl;\n text-orientation: mixed;\n flex-direction: column;\n height: 100%;\n padding: 8px 6px;\n}\n\n.plugin-panel-toggle:hover {\n background: #e9ecef;\n color: #495057;\n}\n\n.plugin-panel-toggle-icon {\n font-weight: bold;\n font-size: 14px;\n}\n\n.plugin-panel.collapsed .plugin-panel-toggle-icon {\n transform: rotate(90deg);\n}\n\n.plugin-panel-toggle-label {\n font-weight: 500;\n}\n\n.plugin-panel-content {\n flex: 1;\n overflow: auto;\n}\n\n/* Right panel rendered inside viewport - scrolls with content */\n.plugin-panel-in-viewport {\n position: absolute;\n top: 0;\n /* Position is set dynamically via inline styles based on page edge */\n width: 220px;\n pointer-events: auto;\n z-index: 10;\n overflow: visible;\n}\n\n.plugin-panel-in-viewport.collapsed {\n width: 32px;\n}\n\n.plugin-panel-in-viewport .plugin-panel-toggle {\n position: sticky;\n top: 0;\n background: rgba(255, 255, 255, 0.95);\n border-radius: 4px;\n box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);\n}\n\n.plugin-panel-in-viewport-content {\n overflow: visible;\n position: relative;\n}\n\n/* Plugin overlay container for rendering highlights/decorations */\n.plugin-overlays-container {\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n pointer-events: none;\n overflow: visible;\n z-index: 5;\n}\n\n.plugin-overlay {\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n pointer-events: none;\n}\n\n/* Individual overlay children manage their own pointer-events.\n Do NOT set pointer-events: auto here \u2014 it overrides overlay containers\n that need pointer-events: none to let clicks pass through to the editor. */\n";
1319
- /**
1320
- * PluginHost Component
1321
- *
1322
- * Wraps the editor and provides:
1323
- * - Plugin state management
1324
- * - Panel rendering for each plugin
1325
- * - CSS injection for plugin styles
1326
- * - Callbacks for editor interaction
1327
- */
1328
- declare const PluginHost: React$1.ForwardRefExoticComponent<PluginHostProps & React$1.RefAttributes<PluginHostRef>>;
1329
-
1330
- export { getPreviousZoomPreset as $, type UseClipboardReturn as A, type UseSelectionHighlightOptions as B, type UseSelectionHighlightReturn as C, DEFAULT_SELECTION_STYLE as D, type EditorMode as E, type UseTableSelectionOptions as F, type UseTableSelectionReturn as G, HIGH_CONTRAST_SELECTION_STYLE as H, type UseWheelZoomOptions as I, type UseWheelZoomReturn as J, areSelectionStylesInjected as K, clampZoom as L, clearSelection as M, createSelectionChangeHandler as N, findNearestZoomPreset as O, PLUGIN_HOST_STYLES as P, formatZoom as Q, type ReactEditorPlugin as R, SELECTION_CSS_VARS as S, type TableSelectionState as T, UnsupportedFeatureWarning as U, generateOverlayElements as V, generateSelectionCSS as W, getHighlightRectStyle as X, getMergedSelectionRects as Y, ZOOM_PRESETS as Z, getNextZoomPreset as _, DocxEditor as a, getSelectedText as a0, getSelectionBoundingRect as a1, getSelectionRects as a2, getUserFriendlyMessage as a3, getZoomPresets as a4, hasActiveSelection as a5, highlightTextRange as a6, injectSelectionStyles as a7, isParseError as a8, isSelectionBackwards as a9, isSelectionWithin as aa, isZoomPreset as ab, mergeAdjacentRects as ac, normalizeSelectionDirection as ad, parseZoom as ae, removeSelectionStyles as af, renderAsync as ag, selectRange as ah, useAutoSave as ai, useClipboard as aj, useErrorNotifications as ak, useSelectionHighlight as al, useTableSelection as am, useWheelZoom as an, type DocxEditorHandle as b, type DocxEditorProps as c, type DocxEditorRef as d, type EditorPlugin as e, ErrorBoundary as f, type ErrorBoundaryProps as g, type ErrorContextValue as h, ErrorProvider as i, type HighlightRect as j, ParseErrorDisplay as k, type ParseErrorDisplayProps as l, type PluginContext as m, PluginHost as n, type PluginHostProps as o, type PluginHostRef as p, type ReactSidebarItem as q, type RenderAsyncOptions as r, type SelectionHighlightConfig as s, type SelectionOverlayProps as t, type SelectionRange as u, type SidebarItemRenderProps as v, type UnsupportedFeatureWarningProps as w, type UseAutoSaveOptions as x, type UseAutoSaveReturn as y, type UseClipboardOptions as z };