@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.
- 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-5D_FoAp6.d.ts +395 -0
- package/dist/KeyboardShortcutsDialog-D7ihAj18.d.mts +395 -0
- package/dist/PageSetupDialog-642IAVG2.js +1 -0
- package/dist/PageSetupDialog-ERUQDHAY.mjs +1 -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-C41hiW-n.d.mts +486 -0
- package/dist/agentApi-D4AZmNfB.d.ts +486 -0
- package/dist/chunk-2XXILKEQ.js +1 -0
- package/dist/chunk-35DG3R42.js +2 -0
- package/dist/chunk-47VJOBJD.mjs +60 -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-AYMGSTNG.js +1 -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-E6MQXELR.js +1 -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-ILYKDR3C.js +1 -0
- package/dist/chunk-IP5NAYHL.js +60 -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-LUJ6HCMH.mjs +1 -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-ONIYA2FU.mjs +2 -0
- package/dist/chunk-ONNHQWAX.mjs +1 -0
- package/dist/chunk-RCIZ7OM3.mjs +70 -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-PKEOQIQO.mjs → chunk-WPI3YRFO.mjs} +1 -1
- package/dist/chunk-XQZTWWRF.mjs +18 -0
- package/dist/chunk-ZVAFVHWR.mjs +3 -0
- package/dist/chunk-ZXPCJWVY.js +2 -0
- package/dist/{agentApi-DLt94vXk.d.mts → content-B2MzIMwA.d.mts} +8 -755
- package/dist/{agentApi-DLt94vXk.d.ts → content-B2MzIMwA.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-DZ_ZeZEH.d.ts +294 -0
- package/dist/document-Di1qGqLS.d.mts +294 -0
- package/dist/executor-EPEB53SJ.js +1 -0
- package/dist/executor-TVJ6K6MW.mjs +1 -0
- package/dist/findReplace-CpIoILbP.d.mts +138 -0
- package/dist/findReplace-pkMskVJU.d.ts +138 -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.d.mts +1013 -483
- package/dist/index.d.ts +1013 -483
- package/dist/index.js +40 -120
- package/dist/index.mjs +40 -120
- package/dist/layout-bridge-5GYGYKM5.mjs +1 -0
- package/dist/layout-bridge-QQDA7ELH.js +1 -0
- package/dist/plugin-api.d.mts +176 -0
- package/dist/plugin-api.d.ts +176 -0
- package/dist/plugin-api.js +260 -0
- package/dist/plugin-api.mjs +260 -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-Bd_YzkhG.d.mts +281 -0
- package/dist/types-Bd_YzkhG.d.ts +281 -0
- package/dist/types-CkfDgB0O.d.mts +39 -0
- package/dist/types-DZUhB7Ao.d.mts +18 -0
- package/dist/types-DZUhB7Ao.d.ts +18 -0
- package/dist/types-DcxHFUSc.d.ts +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-DDs533b-.d.mts +261 -0
- package/dist/useFindReplace-eyhMSZZf.d.ts +261 -0
- package/package.json +41 -43
- 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-7BG7QY7I.js +0 -182
- 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-KUTCCI4X.mjs +0 -182
- 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-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-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.css +0 -1
- 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
|
@@ -0,0 +1,261 @@
|
|
|
1
|
+
import React__default, { CSSProperties, ReactNode } from 'react';
|
|
2
|
+
import { d as Table, e as TableCell } from './content-B2MzIMwA.js';
|
|
3
|
+
import { F as FindMatch, a as FindOptions } from './findReplace-pkMskVJU.js';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* TableToolbar Component
|
|
7
|
+
*
|
|
8
|
+
* Provides controls for editing tables:
|
|
9
|
+
* - Add row above/below
|
|
10
|
+
* - Add column left/right
|
|
11
|
+
* - Delete row/column
|
|
12
|
+
* - Merge cells
|
|
13
|
+
* - Split cell
|
|
14
|
+
*
|
|
15
|
+
* Shows when cursor is in a table.
|
|
16
|
+
*/
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Table editing action types
|
|
20
|
+
*/
|
|
21
|
+
type TableAction = 'addRowAbove' | 'addRowBelow' | 'addColumnLeft' | 'addColumnRight' | 'deleteRow' | 'deleteColumn' | 'mergeCells' | 'splitCell' | 'deleteTable' | 'selectTable' | 'selectRow' | 'selectColumn' | 'borderAll' | 'borderOutside' | 'borderInside' | 'borderNone' | 'borderTop' | 'borderBottom' | 'borderLeft' | 'borderRight' | {
|
|
22
|
+
type: 'cellFillColor';
|
|
23
|
+
color: string | null;
|
|
24
|
+
} | {
|
|
25
|
+
type: 'borderColor';
|
|
26
|
+
color: string;
|
|
27
|
+
} | {
|
|
28
|
+
type: 'borderWidth';
|
|
29
|
+
size: number;
|
|
30
|
+
} | {
|
|
31
|
+
type: 'cellBorder';
|
|
32
|
+
side: 'top' | 'bottom' | 'left' | 'right' | 'all';
|
|
33
|
+
style: string;
|
|
34
|
+
size: number;
|
|
35
|
+
color: string;
|
|
36
|
+
} | {
|
|
37
|
+
type: 'cellVerticalAlign';
|
|
38
|
+
align: 'top' | 'center' | 'bottom';
|
|
39
|
+
} | {
|
|
40
|
+
type: 'cellMargins';
|
|
41
|
+
margins: {
|
|
42
|
+
top?: number;
|
|
43
|
+
bottom?: number;
|
|
44
|
+
left?: number;
|
|
45
|
+
right?: number;
|
|
46
|
+
};
|
|
47
|
+
} | {
|
|
48
|
+
type: 'cellTextDirection';
|
|
49
|
+
direction: string | null;
|
|
50
|
+
} | {
|
|
51
|
+
type: 'toggleNoWrap';
|
|
52
|
+
} | {
|
|
53
|
+
type: 'rowHeight';
|
|
54
|
+
height: number | null;
|
|
55
|
+
rule?: 'auto' | 'atLeast' | 'exact';
|
|
56
|
+
} | {
|
|
57
|
+
type: 'toggleHeaderRow';
|
|
58
|
+
} | {
|
|
59
|
+
type: 'distributeColumns';
|
|
60
|
+
} | {
|
|
61
|
+
type: 'autoFitContents';
|
|
62
|
+
} | {
|
|
63
|
+
type: 'tableProperties';
|
|
64
|
+
props: {
|
|
65
|
+
width?: number | null;
|
|
66
|
+
widthType?: string | null;
|
|
67
|
+
justification?: 'left' | 'center' | 'right' | null;
|
|
68
|
+
};
|
|
69
|
+
} | {
|
|
70
|
+
type: 'openTableProperties';
|
|
71
|
+
} | {
|
|
72
|
+
type: 'applyTableStyle';
|
|
73
|
+
styleId: string;
|
|
74
|
+
};
|
|
75
|
+
/**
|
|
76
|
+
* Selection within a table
|
|
77
|
+
*/
|
|
78
|
+
interface TableSelection {
|
|
79
|
+
/** Index of the table in the document */
|
|
80
|
+
tableIndex: number;
|
|
81
|
+
/** Row index (0-indexed) */
|
|
82
|
+
rowIndex: number;
|
|
83
|
+
/** Column index (0-indexed) */
|
|
84
|
+
columnIndex: number;
|
|
85
|
+
/** Selected cell range for multi-cell selection */
|
|
86
|
+
selectedCells?: {
|
|
87
|
+
startRow: number;
|
|
88
|
+
startCol: number;
|
|
89
|
+
endRow: number;
|
|
90
|
+
endCol: number;
|
|
91
|
+
};
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* Context for table operations
|
|
95
|
+
*/
|
|
96
|
+
interface TableContext {
|
|
97
|
+
/** The table being edited */
|
|
98
|
+
table: Table;
|
|
99
|
+
/** Current selection within the table */
|
|
100
|
+
selection: TableSelection;
|
|
101
|
+
/** Whether multiple cells are selected (for merge) */
|
|
102
|
+
hasMultiCellSelection: boolean;
|
|
103
|
+
/** Whether current cell can be split */
|
|
104
|
+
canSplitCell: boolean;
|
|
105
|
+
/** Total number of rows */
|
|
106
|
+
rowCount: number;
|
|
107
|
+
/** Total number of columns */
|
|
108
|
+
columnCount: number;
|
|
109
|
+
}
|
|
110
|
+
interface TableSplitConfig {
|
|
111
|
+
minRows: number;
|
|
112
|
+
minCols: number;
|
|
113
|
+
initialRows: number;
|
|
114
|
+
initialCols: number;
|
|
115
|
+
}
|
|
116
|
+
/**
|
|
117
|
+
* Props for TableToolbar component
|
|
118
|
+
*/
|
|
119
|
+
interface TableToolbarProps {
|
|
120
|
+
/** Current table context (null if cursor not in table) */
|
|
121
|
+
context: TableContext | null;
|
|
122
|
+
/** Callback when a table action is triggered */
|
|
123
|
+
onAction?: (action: TableAction, context: TableContext) => void;
|
|
124
|
+
/** Whether the toolbar is disabled */
|
|
125
|
+
disabled?: boolean;
|
|
126
|
+
/** Additional CSS class name */
|
|
127
|
+
className?: string;
|
|
128
|
+
/** Additional inline styles */
|
|
129
|
+
style?: CSSProperties;
|
|
130
|
+
/** Show labels next to icons */
|
|
131
|
+
showLabels?: boolean;
|
|
132
|
+
/** Compact mode */
|
|
133
|
+
compact?: boolean;
|
|
134
|
+
/** Position of the toolbar */
|
|
135
|
+
position?: 'top' | 'floating';
|
|
136
|
+
/** Custom render for additional buttons */
|
|
137
|
+
children?: ReactNode;
|
|
138
|
+
}
|
|
139
|
+
/**
|
|
140
|
+
* TableToolbar - Shows table manipulation controls when cursor is in a table
|
|
141
|
+
*/
|
|
142
|
+
declare function TableToolbar({ context, onAction, disabled, className, style, showLabels, compact, position, children, }: TableToolbarProps): React__default.ReactElement | null;
|
|
143
|
+
/**
|
|
144
|
+
* Create a table context from a table and selection
|
|
145
|
+
*/
|
|
146
|
+
declare function createTableContext(table: Table, selection: TableSelection): TableContext;
|
|
147
|
+
/**
|
|
148
|
+
* Get column count from a table
|
|
149
|
+
*/
|
|
150
|
+
declare function getColumnCount(table: Table): number;
|
|
151
|
+
/**
|
|
152
|
+
* Get cell at specific row and column index
|
|
153
|
+
*/
|
|
154
|
+
declare function getCellAt(table: Table, rowIndex: number, columnIndex: number): TableCell | null;
|
|
155
|
+
declare function getTableSplitCellDialogConfig(table: Table, rowIndex: number, columnIndex: number): TableSplitConfig | null;
|
|
156
|
+
declare function splitTableCell(table: Table, rowIndex: number, columnIndex: number, rows: number, cols: number): Table;
|
|
157
|
+
/**
|
|
158
|
+
* Add a row to a table at the specified index
|
|
159
|
+
*/
|
|
160
|
+
declare function addRow(table: Table, atIndex: number, position?: 'before' | 'after'): Table;
|
|
161
|
+
/**
|
|
162
|
+
* Delete a row from a table
|
|
163
|
+
*/
|
|
164
|
+
declare function deleteRow(table: Table, rowIndex: number): Table;
|
|
165
|
+
/**
|
|
166
|
+
* Add a column to a table at the specified index
|
|
167
|
+
*/
|
|
168
|
+
declare function addColumn(table: Table, atIndex: number, position?: 'before' | 'after'): Table;
|
|
169
|
+
/**
|
|
170
|
+
* Delete a column from a table
|
|
171
|
+
*/
|
|
172
|
+
declare function deleteColumn(table: Table, columnIndex: number): Table;
|
|
173
|
+
/**
|
|
174
|
+
* Merge cells in a selection
|
|
175
|
+
*/
|
|
176
|
+
declare function mergeCells(table: Table, selection: TableSelection): Table;
|
|
177
|
+
/**
|
|
178
|
+
* Backward-compatible helper for callers that still use the older merged-cell
|
|
179
|
+
* split behavior directly.
|
|
180
|
+
*
|
|
181
|
+
* User-facing Split cell is now dialog-driven. For document-model tables, use
|
|
182
|
+
* `getTableSplitCellDialogConfig()` and `splitTableCell()` instead.
|
|
183
|
+
*/
|
|
184
|
+
declare function splitCell(table: Table, rowIndex: number, columnIndex: number): Table;
|
|
185
|
+
|
|
186
|
+
/**
|
|
187
|
+
* useFindReplace Hook
|
|
188
|
+
*
|
|
189
|
+
* React hook for managing find/replace dialog state.
|
|
190
|
+
* Extracted from FindReplaceDialog.tsx.
|
|
191
|
+
*/
|
|
192
|
+
|
|
193
|
+
/**
|
|
194
|
+
* Options for the useFindReplace hook
|
|
195
|
+
*/
|
|
196
|
+
interface FindReplaceOptions {
|
|
197
|
+
/** Whether to show replace functionality initially */
|
|
198
|
+
initialReplaceMode?: boolean;
|
|
199
|
+
/** Callback when matches change */
|
|
200
|
+
onMatchesChange?: (matches: FindMatch[]) => void;
|
|
201
|
+
/** Callback when current match changes */
|
|
202
|
+
onCurrentMatchChange?: (match: FindMatch | null, index: number) => void;
|
|
203
|
+
}
|
|
204
|
+
/**
|
|
205
|
+
* State for the find/replace hook
|
|
206
|
+
*/
|
|
207
|
+
interface FindReplaceState {
|
|
208
|
+
/** Whether the dialog is open */
|
|
209
|
+
isOpen: boolean;
|
|
210
|
+
/** Current search text */
|
|
211
|
+
searchText: string;
|
|
212
|
+
/** Current replace text */
|
|
213
|
+
replaceText: string;
|
|
214
|
+
/** Find options */
|
|
215
|
+
options: FindOptions;
|
|
216
|
+
/** All matches found */
|
|
217
|
+
matches: FindMatch[];
|
|
218
|
+
/** Current match index */
|
|
219
|
+
currentIndex: number;
|
|
220
|
+
/** Whether in replace mode */
|
|
221
|
+
replaceMode: boolean;
|
|
222
|
+
}
|
|
223
|
+
/**
|
|
224
|
+
* Return type for the useFindReplace hook
|
|
225
|
+
*/
|
|
226
|
+
interface UseFindReplaceReturn {
|
|
227
|
+
/** Current state */
|
|
228
|
+
state: FindReplaceState;
|
|
229
|
+
/** Open the find dialog */
|
|
230
|
+
openFind: (selectedText?: string) => void;
|
|
231
|
+
/** Open the replace dialog */
|
|
232
|
+
openReplace: (selectedText?: string) => void;
|
|
233
|
+
/** Close the dialog */
|
|
234
|
+
close: () => void;
|
|
235
|
+
/** Toggle dialog visibility */
|
|
236
|
+
toggle: () => void;
|
|
237
|
+
/** Update search text */
|
|
238
|
+
setSearchText: (text: string) => void;
|
|
239
|
+
/** Update replace text */
|
|
240
|
+
setReplaceText: (text: string) => void;
|
|
241
|
+
/** Update find options */
|
|
242
|
+
setOptions: (options: Partial<FindOptions>) => void;
|
|
243
|
+
/** Set search results */
|
|
244
|
+
setMatches: (matches: FindMatch[], currentIndex?: number) => void;
|
|
245
|
+
/** Go to next match */
|
|
246
|
+
goToNextMatch: () => number;
|
|
247
|
+
/** Go to previous match */
|
|
248
|
+
goToPreviousMatch: () => number;
|
|
249
|
+
/** Go to a specific match by index */
|
|
250
|
+
goToMatch: (index: number) => void;
|
|
251
|
+
/** Get current match */
|
|
252
|
+
getCurrentMatch: () => FindMatch | null;
|
|
253
|
+
/** Check if has matches */
|
|
254
|
+
hasMatches: () => boolean;
|
|
255
|
+
}
|
|
256
|
+
/**
|
|
257
|
+
* Hook for managing find/replace dialog state
|
|
258
|
+
*/
|
|
259
|
+
declare function useFindReplace(hookOptions?: FindReplaceOptions): UseFindReplaceReturn;
|
|
260
|
+
|
|
261
|
+
export { type FindReplaceOptions as F, type TableAction as T, type UseFindReplaceReturn as U, type FindReplaceState as a, type TableContext as b, type TableSelection as c, type TableSplitConfig as d, TableToolbar as e, type TableToolbarProps as f, addColumn as g, addRow as h, createTableContext as i, deleteColumn as j, deleteRow as k, getCellAt as l, getColumnCount as m, getTableSplitCellDialogConfig as n, mergeCells as o, splitTableCell as p, splitCell as s, useFindReplace as u };
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zeke-02/docx-editor",
|
|
3
|
-
"version": "0.5.
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "0.5.3",
|
|
4
|
+
"description": "React DOCX editor adapter for @eigenpal/docx-editor-core.",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"module": "./dist/index.mjs",
|
|
7
7
|
"types": "./dist/index.d.ts",
|
|
@@ -11,58 +11,49 @@
|
|
|
11
11
|
"import": "./dist/index.mjs",
|
|
12
12
|
"require": "./dist/index.js"
|
|
13
13
|
},
|
|
14
|
-
"./react": {
|
|
15
|
-
"types": "./dist/react.d.ts",
|
|
16
|
-
"import": "./dist/react.mjs",
|
|
17
|
-
"require": "./dist/react.js"
|
|
18
|
-
},
|
|
19
14
|
"./ui": {
|
|
20
15
|
"types": "./dist/ui.d.ts",
|
|
21
16
|
"import": "./dist/ui.mjs",
|
|
22
17
|
"require": "./dist/ui.js"
|
|
23
18
|
},
|
|
24
|
-
"./
|
|
25
|
-
"types": "./dist/
|
|
26
|
-
"import": "./dist/
|
|
27
|
-
"require": "./dist/
|
|
19
|
+
"./dialogs": {
|
|
20
|
+
"types": "./dist/dialogs.d.ts",
|
|
21
|
+
"import": "./dist/dialogs.mjs",
|
|
22
|
+
"require": "./dist/dialogs.js"
|
|
28
23
|
},
|
|
29
|
-
"./
|
|
30
|
-
"types": "./dist/
|
|
31
|
-
"import": "./dist/
|
|
32
|
-
"require": "./dist/
|
|
24
|
+
"./hooks": {
|
|
25
|
+
"types": "./dist/hooks.d.ts",
|
|
26
|
+
"import": "./dist/hooks.mjs",
|
|
27
|
+
"require": "./dist/hooks.js"
|
|
33
28
|
},
|
|
34
|
-
"./
|
|
35
|
-
"types": "./dist/
|
|
36
|
-
"import": "./dist/
|
|
37
|
-
"require": "./dist/
|
|
29
|
+
"./plugin-api": {
|
|
30
|
+
"types": "./dist/plugin-api.d.ts",
|
|
31
|
+
"import": "./dist/plugin-api.mjs",
|
|
32
|
+
"require": "./dist/plugin-api.js"
|
|
38
33
|
},
|
|
39
|
-
"./
|
|
40
|
-
"types": "./dist/
|
|
41
|
-
"import": "./dist/
|
|
42
|
-
"require": "./dist/
|
|
34
|
+
"./styles": {
|
|
35
|
+
"types": "./dist/styles.d.ts",
|
|
36
|
+
"import": "./dist/styles.mjs",
|
|
37
|
+
"require": "./dist/styles.js"
|
|
43
38
|
},
|
|
44
|
-
"./styles.css": "./dist/styles.css"
|
|
45
|
-
"./i18n/*.json": "./i18n/*.json"
|
|
39
|
+
"./styles.css": "./dist/styles.css"
|
|
46
40
|
},
|
|
47
41
|
"typesVersions": {
|
|
48
42
|
"*": {
|
|
49
|
-
"react": [
|
|
50
|
-
"./dist/react.d.ts"
|
|
51
|
-
],
|
|
52
43
|
"ui": [
|
|
53
44
|
"./dist/ui.d.ts"
|
|
54
45
|
],
|
|
55
|
-
"
|
|
56
|
-
"./dist/
|
|
46
|
+
"dialogs": [
|
|
47
|
+
"./dist/dialogs.d.ts"
|
|
57
48
|
],
|
|
58
|
-
"
|
|
59
|
-
"./dist/
|
|
49
|
+
"hooks": [
|
|
50
|
+
"./dist/hooks.d.ts"
|
|
60
51
|
],
|
|
61
|
-
"
|
|
62
|
-
"./dist/
|
|
52
|
+
"plugin-api": [
|
|
53
|
+
"./dist/plugin-api.d.ts"
|
|
63
54
|
],
|
|
64
|
-
"
|
|
65
|
-
"./dist/
|
|
55
|
+
"styles": [
|
|
56
|
+
"./dist/styles.d.ts"
|
|
66
57
|
]
|
|
67
58
|
}
|
|
68
59
|
},
|
|
@@ -70,14 +61,14 @@
|
|
|
70
61
|
"*.css"
|
|
71
62
|
],
|
|
72
63
|
"files": [
|
|
73
|
-
"dist"
|
|
74
|
-
"i18n"
|
|
64
|
+
"dist"
|
|
75
65
|
],
|
|
76
66
|
"scripts": {
|
|
77
67
|
"build": "tsup && bun run build:css",
|
|
78
68
|
"build:css": "tailwindcss -c ../../tailwind.config.lib.js -i ./src/styles/editor.css -o ./dist/styles.css --minify",
|
|
79
69
|
"prepublishOnly": "bun run build && sed -e 's|\\./assets/|https://raw.githubusercontent.com/eigenpal/docx-editor/main/assets/|g' -e 's|(packages/|(https://github.com/eigenpal/docx-editor/tree/main/packages/|g' -e 's|(docs/|(https://github.com/eigenpal/docx-editor/blob/main/docs/|g' -e 's|(examples/|(https://github.com/eigenpal/docx-editor/tree/main/examples/|g' ../../README.md > README.md",
|
|
80
|
-
"typecheck": "tsc --noEmit"
|
|
70
|
+
"typecheck": "tsc --noEmit",
|
|
71
|
+
"publish:fork": "node ../../scripts/publish-fork.mjs"
|
|
81
72
|
},
|
|
82
73
|
"peerDependencies": {
|
|
83
74
|
"prosemirror-commands": "^1.5.2",
|
|
@@ -87,7 +78,7 @@
|
|
|
87
78
|
"prosemirror-model": "^1.19.4",
|
|
88
79
|
"prosemirror-state": "^1.4.3",
|
|
89
80
|
"prosemirror-tables": "^1.8.5",
|
|
90
|
-
"prosemirror-transform": "^1.
|
|
81
|
+
"prosemirror-transform": "^1.12.0",
|
|
91
82
|
"prosemirror-view": "^1.41.6",
|
|
92
83
|
"react": "^18.0.0 || ^19.0.0",
|
|
93
84
|
"react-dom": "^18.0.0 || ^19.0.0"
|
|
@@ -106,6 +97,9 @@
|
|
|
106
97
|
"sonner": "^2.0.7"
|
|
107
98
|
},
|
|
108
99
|
"devDependencies": {
|
|
100
|
+
"@eigenpal/docx-editor-agents": "^0.5.1",
|
|
101
|
+
"@eigenpal/docx-editor-core": "^0.0.28",
|
|
102
|
+
"@eigenpal/docx-editor-i18n": "^0.0.1",
|
|
109
103
|
"prosemirror-commands": "^1.5.2",
|
|
110
104
|
"prosemirror-dropcursor": "^1.8.2",
|
|
111
105
|
"prosemirror-history": "^1.4.0",
|
|
@@ -113,7 +107,7 @@
|
|
|
113
107
|
"prosemirror-model": "^1.19.4",
|
|
114
108
|
"prosemirror-state": "^1.4.3",
|
|
115
109
|
"prosemirror-tables": "^1.8.5",
|
|
116
|
-
"prosemirror-transform": "^1.
|
|
110
|
+
"prosemirror-transform": "^1.12.0",
|
|
117
111
|
"prosemirror-view": "^1.41.6"
|
|
118
112
|
},
|
|
119
113
|
"keywords": [
|
|
@@ -125,8 +119,12 @@
|
|
|
125
119
|
"react",
|
|
126
120
|
"prosemirror"
|
|
127
121
|
],
|
|
128
|
-
"author":
|
|
129
|
-
|
|
122
|
+
"author": {
|
|
123
|
+
"name": "Jedr Blaszyk",
|
|
124
|
+
"email": "jedr@eigenpal.com",
|
|
125
|
+
"url": "https://github.com/jedrazb"
|
|
126
|
+
},
|
|
127
|
+
"license": "Apache-2.0",
|
|
130
128
|
"homepage": "https://docx-editor.dev/",
|
|
131
129
|
"repository": {
|
|
132
130
|
"type": "git",
|