@zeke-02/docx-editor 0.5.2 → 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-AGRIVA4G.js +0 -1
- package/dist/chunk-BTCQ2QI3.mjs +0 -3
- package/dist/chunk-BUEMG4NW.js +0 -1
- package/dist/chunk-BXRC4U3X.mjs +0 -2
- package/dist/chunk-CPAYKE6X.mjs +0 -1
- package/dist/chunk-DACWLFKI.mjs +0 -1
- package/dist/chunk-EPBFWE36.js +0 -2
- package/dist/chunk-FXES3YDB.js +0 -82
- package/dist/chunk-HI66BSGS.mjs +0 -9
- package/dist/chunk-INTPVEO6.mjs +0 -9
- package/dist/chunk-IOAGVW6Q.mjs +0 -2
- package/dist/chunk-JCEWC5QL.mjs +0 -4
- package/dist/chunk-JTIUFACT.js +0 -1
- package/dist/chunk-LUF7PWIC.js +0 -10
- package/dist/chunk-MGEN6GOE.mjs +0 -2
- package/dist/chunk-MOE2ZGUE.js +0 -18
- package/dist/chunk-MWLHJWB6.js +0 -9
- package/dist/chunk-OFYVDN3U.mjs +0 -2
- package/dist/chunk-P4VSHBGZ.js +0 -2
- package/dist/chunk-P5FQHIES.mjs +0 -1
- package/dist/chunk-PBC7XAYZ.js +0 -3
- package/dist/chunk-PEMB6SZT.js +0 -2
- package/dist/chunk-PQMSZTBB.js +0 -9
- package/dist/chunk-Q7UDQXAF.js +0 -1
- package/dist/chunk-QGTAIC5E.js +0 -1
- package/dist/chunk-QVPR2W5S.js +0 -1
- package/dist/chunk-R3QMYPL5.mjs +0 -59
- package/dist/chunk-RBUTXXQJ.mjs +0 -18
- package/dist/chunk-RRWYZ2TS.mjs +0 -111
- package/dist/chunk-S3STEPVO.js +0 -182
- package/dist/chunk-SFUM35DH.js +0 -2
- package/dist/chunk-SNLC6EK2.js +0 -1
- package/dist/chunk-TMTLIGLZ.js +0 -59
- package/dist/chunk-TSE2PWFX.mjs +0 -10
- package/dist/chunk-UKESXQS5.mjs +0 -182
- package/dist/chunk-UWYD42WV.js +0 -4
- package/dist/chunk-UXVACQCY.mjs +0 -1
- package/dist/chunk-W4EIKDM6.mjs +0 -2
- package/dist/chunk-W53SI3XW.mjs +0 -1
- package/dist/chunk-WNS2RBQD.js +0 -2
- package/dist/chunk-Z3KMSHUP.js +0 -1
- package/dist/core-plugins-reexport.d.mts +0 -31
- package/dist/core-plugins-reexport.d.ts +0 -31
- package/dist/core-plugins-reexport.js +0 -1
- package/dist/core-plugins-reexport.mjs +0 -1
- package/dist/core-reexport.d.mts +0 -340
- package/dist/core-reexport.d.ts +0 -340
- package/dist/core-reexport.js +0 -1
- package/dist/core-reexport.mjs +0 -1
- package/dist/documentSerializer-DtS_-oGA.d.mts +0 -664
- package/dist/documentSerializer-Wj1p2ASa.d.ts +0 -664
- package/dist/executor-C3VXF7QA.mjs +0 -1
- package/dist/executor-GDBV3AGV.js +0 -1
- package/dist/headless-reexport.d.mts +0 -197
- package/dist/headless-reexport.d.ts +0 -197
- package/dist/headless-reexport.js +0 -1
- package/dist/headless-reexport.mjs +0 -1
- package/dist/insertOperations-BTH1Asas.d.mts +0 -176
- package/dist/insertOperations-CbUnXAXH.d.ts +0 -176
- package/dist/layout-bridge-EA4DJ227.js +0 -1
- package/dist/layout-bridge-XDPSO6GO.mjs +0 -1
- package/dist/mcp-reexport.d.mts +0 -156
- package/dist/mcp-reexport.d.ts +0 -156
- package/dist/mcp-reexport.js +0 -16
- package/dist/mcp-reexport.mjs +0 -16
- package/dist/processTemplate-MJ2PCSO5.js +0 -1
- package/dist/react-B0W16SV6.d.ts +0 -1330
- package/dist/react-D0Pn1nww.d.mts +0 -1330
- package/dist/react.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,138 @@
|
|
|
1
|
+
import { R as Run } from './content-B2MzIMwA.mjs';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Clipboard utilities for copy/paste with formatting
|
|
5
|
+
*
|
|
6
|
+
* Handles:
|
|
7
|
+
* - Copy: puts formatted HTML and plain text on clipboard
|
|
8
|
+
* - Paste: reads HTML clipboard, converts to runs with formatting
|
|
9
|
+
* - Handles paste from Word (cleans up Word HTML)
|
|
10
|
+
* - Ctrl+C, Ctrl+V, Ctrl+X keyboard shortcuts
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Parsed clipboard content
|
|
15
|
+
*/
|
|
16
|
+
interface ParsedClipboardContent {
|
|
17
|
+
/** Runs parsed from clipboard */
|
|
18
|
+
runs: Run[];
|
|
19
|
+
/** Whether content came from Word */
|
|
20
|
+
fromWord: boolean;
|
|
21
|
+
/** Whether content came from our editor */
|
|
22
|
+
fromEditor: boolean;
|
|
23
|
+
/** Original plain text */
|
|
24
|
+
plainText: string;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Find & Replace Utility Functions
|
|
29
|
+
*
|
|
30
|
+
* Pure utility functions for text search, pattern matching, and
|
|
31
|
+
* document search. Lifted from packages/react/src/components/dialogs/
|
|
32
|
+
* findReplaceUtils.ts so the React adapter and the Vue adapter share
|
|
33
|
+
* one implementation.
|
|
34
|
+
*/
|
|
35
|
+
/**
|
|
36
|
+
* A single match result in the document
|
|
37
|
+
*/
|
|
38
|
+
interface FindMatch {
|
|
39
|
+
/** Index of the paragraph containing the match */
|
|
40
|
+
paragraphIndex: number;
|
|
41
|
+
/** Index of the run/content within the paragraph */
|
|
42
|
+
contentIndex: number;
|
|
43
|
+
/** Character offset within the content */
|
|
44
|
+
startOffset: number;
|
|
45
|
+
/** Character offset for end of match */
|
|
46
|
+
endOffset: number;
|
|
47
|
+
/** The matched text */
|
|
48
|
+
text: string;
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Find options for controlling search behavior
|
|
52
|
+
*/
|
|
53
|
+
interface FindOptions {
|
|
54
|
+
/** Whether to match case */
|
|
55
|
+
matchCase: boolean;
|
|
56
|
+
/** Whether to match whole words only */
|
|
57
|
+
matchWholeWord: boolean;
|
|
58
|
+
/** Whether to use regular expressions (future) */
|
|
59
|
+
useRegex?: boolean;
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* Find result with all matches
|
|
63
|
+
*/
|
|
64
|
+
interface FindResult {
|
|
65
|
+
/** All matches found */
|
|
66
|
+
matches: FindMatch[];
|
|
67
|
+
/** Total match count */
|
|
68
|
+
totalCount: number;
|
|
69
|
+
/** Current match index (0-based) */
|
|
70
|
+
currentIndex: number;
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* Highlight options for document rendering
|
|
74
|
+
*/
|
|
75
|
+
interface HighlightOptions {
|
|
76
|
+
/** Background color for current match */
|
|
77
|
+
currentMatchColor: string;
|
|
78
|
+
/** Background color for other matches */
|
|
79
|
+
otherMatchColor: string;
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* Create default find options
|
|
83
|
+
*/
|
|
84
|
+
declare function createDefaultFindOptions(): FindOptions;
|
|
85
|
+
/**
|
|
86
|
+
* Escape string for use in regex pattern
|
|
87
|
+
*/
|
|
88
|
+
declare function escapeRegexString(str: string): string;
|
|
89
|
+
/**
|
|
90
|
+
* Create a regex pattern from search text and options
|
|
91
|
+
*/
|
|
92
|
+
declare function createSearchPattern(searchText: string, options: FindOptions): RegExp | null;
|
|
93
|
+
/**
|
|
94
|
+
* Find all matches of search text in content
|
|
95
|
+
*/
|
|
96
|
+
declare function findAllMatches(content: string, searchText: string, options: FindOptions): Array<{
|
|
97
|
+
start: number;
|
|
98
|
+
end: number;
|
|
99
|
+
}>;
|
|
100
|
+
/**
|
|
101
|
+
* Replace text in content
|
|
102
|
+
*/
|
|
103
|
+
declare function replaceAllInContent(content: string, searchText: string, replaceText: string, options: FindOptions): string;
|
|
104
|
+
/**
|
|
105
|
+
* Replace first match in content
|
|
106
|
+
*/
|
|
107
|
+
declare function replaceFirstInContent(content: string, searchText: string, replaceText: string, options: FindOptions, startIndex?: number): {
|
|
108
|
+
content: string;
|
|
109
|
+
replaced: boolean;
|
|
110
|
+
matchStart: number;
|
|
111
|
+
matchEnd: number;
|
|
112
|
+
};
|
|
113
|
+
/**
|
|
114
|
+
* Get match count for status display
|
|
115
|
+
*/
|
|
116
|
+
declare function getMatchCountText(result: FindResult | null): string;
|
|
117
|
+
/**
|
|
118
|
+
* Check if search text is empty or whitespace-only
|
|
119
|
+
*/
|
|
120
|
+
declare function isEmptySearch(searchText: string): boolean;
|
|
121
|
+
/**
|
|
122
|
+
* Get default highlight options
|
|
123
|
+
*/
|
|
124
|
+
declare function getDefaultHighlightOptions(): HighlightOptions;
|
|
125
|
+
/**
|
|
126
|
+
* Find all matches in a document
|
|
127
|
+
*/
|
|
128
|
+
declare function findInDocument(document: any, searchText: string, options: FindOptions): FindMatch[];
|
|
129
|
+
/**
|
|
130
|
+
* Find matches in a single paragraph
|
|
131
|
+
*/
|
|
132
|
+
declare function findInParagraph(paragraph: any, searchText: string, options: FindOptions, paragraphIndex: number): FindMatch[];
|
|
133
|
+
/**
|
|
134
|
+
* Scroll to a match in the document
|
|
135
|
+
*/
|
|
136
|
+
declare function scrollToMatch(containerElement: HTMLElement | null, match: FindMatch): void;
|
|
137
|
+
|
|
138
|
+
export { type FindMatch as F, type HighlightOptions as H, type ParsedClipboardContent as P, type FindOptions as a, type FindResult as b, createDefaultFindOptions as c, createSearchPattern as d, escapeRegexString as e, findAllMatches as f, findInDocument as g, findInParagraph as h, getDefaultHighlightOptions as i, getMatchCountText as j, isEmptySearch as k, replaceFirstInContent as l, replaceAllInContent as r, scrollToMatch as s };
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
import { R as Run } from './content-B2MzIMwA.js';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Clipboard utilities for copy/paste with formatting
|
|
5
|
+
*
|
|
6
|
+
* Handles:
|
|
7
|
+
* - Copy: puts formatted HTML and plain text on clipboard
|
|
8
|
+
* - Paste: reads HTML clipboard, converts to runs with formatting
|
|
9
|
+
* - Handles paste from Word (cleans up Word HTML)
|
|
10
|
+
* - Ctrl+C, Ctrl+V, Ctrl+X keyboard shortcuts
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Parsed clipboard content
|
|
15
|
+
*/
|
|
16
|
+
interface ParsedClipboardContent {
|
|
17
|
+
/** Runs parsed from clipboard */
|
|
18
|
+
runs: Run[];
|
|
19
|
+
/** Whether content came from Word */
|
|
20
|
+
fromWord: boolean;
|
|
21
|
+
/** Whether content came from our editor */
|
|
22
|
+
fromEditor: boolean;
|
|
23
|
+
/** Original plain text */
|
|
24
|
+
plainText: string;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Find & Replace Utility Functions
|
|
29
|
+
*
|
|
30
|
+
* Pure utility functions for text search, pattern matching, and
|
|
31
|
+
* document search. Lifted from packages/react/src/components/dialogs/
|
|
32
|
+
* findReplaceUtils.ts so the React adapter and the Vue adapter share
|
|
33
|
+
* one implementation.
|
|
34
|
+
*/
|
|
35
|
+
/**
|
|
36
|
+
* A single match result in the document
|
|
37
|
+
*/
|
|
38
|
+
interface FindMatch {
|
|
39
|
+
/** Index of the paragraph containing the match */
|
|
40
|
+
paragraphIndex: number;
|
|
41
|
+
/** Index of the run/content within the paragraph */
|
|
42
|
+
contentIndex: number;
|
|
43
|
+
/** Character offset within the content */
|
|
44
|
+
startOffset: number;
|
|
45
|
+
/** Character offset for end of match */
|
|
46
|
+
endOffset: number;
|
|
47
|
+
/** The matched text */
|
|
48
|
+
text: string;
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Find options for controlling search behavior
|
|
52
|
+
*/
|
|
53
|
+
interface FindOptions {
|
|
54
|
+
/** Whether to match case */
|
|
55
|
+
matchCase: boolean;
|
|
56
|
+
/** Whether to match whole words only */
|
|
57
|
+
matchWholeWord: boolean;
|
|
58
|
+
/** Whether to use regular expressions (future) */
|
|
59
|
+
useRegex?: boolean;
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* Find result with all matches
|
|
63
|
+
*/
|
|
64
|
+
interface FindResult {
|
|
65
|
+
/** All matches found */
|
|
66
|
+
matches: FindMatch[];
|
|
67
|
+
/** Total match count */
|
|
68
|
+
totalCount: number;
|
|
69
|
+
/** Current match index (0-based) */
|
|
70
|
+
currentIndex: number;
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* Highlight options for document rendering
|
|
74
|
+
*/
|
|
75
|
+
interface HighlightOptions {
|
|
76
|
+
/** Background color for current match */
|
|
77
|
+
currentMatchColor: string;
|
|
78
|
+
/** Background color for other matches */
|
|
79
|
+
otherMatchColor: string;
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* Create default find options
|
|
83
|
+
*/
|
|
84
|
+
declare function createDefaultFindOptions(): FindOptions;
|
|
85
|
+
/**
|
|
86
|
+
* Escape string for use in regex pattern
|
|
87
|
+
*/
|
|
88
|
+
declare function escapeRegexString(str: string): string;
|
|
89
|
+
/**
|
|
90
|
+
* Create a regex pattern from search text and options
|
|
91
|
+
*/
|
|
92
|
+
declare function createSearchPattern(searchText: string, options: FindOptions): RegExp | null;
|
|
93
|
+
/**
|
|
94
|
+
* Find all matches of search text in content
|
|
95
|
+
*/
|
|
96
|
+
declare function findAllMatches(content: string, searchText: string, options: FindOptions): Array<{
|
|
97
|
+
start: number;
|
|
98
|
+
end: number;
|
|
99
|
+
}>;
|
|
100
|
+
/**
|
|
101
|
+
* Replace text in content
|
|
102
|
+
*/
|
|
103
|
+
declare function replaceAllInContent(content: string, searchText: string, replaceText: string, options: FindOptions): string;
|
|
104
|
+
/**
|
|
105
|
+
* Replace first match in content
|
|
106
|
+
*/
|
|
107
|
+
declare function replaceFirstInContent(content: string, searchText: string, replaceText: string, options: FindOptions, startIndex?: number): {
|
|
108
|
+
content: string;
|
|
109
|
+
replaced: boolean;
|
|
110
|
+
matchStart: number;
|
|
111
|
+
matchEnd: number;
|
|
112
|
+
};
|
|
113
|
+
/**
|
|
114
|
+
* Get match count for status display
|
|
115
|
+
*/
|
|
116
|
+
declare function getMatchCountText(result: FindResult | null): string;
|
|
117
|
+
/**
|
|
118
|
+
* Check if search text is empty or whitespace-only
|
|
119
|
+
*/
|
|
120
|
+
declare function isEmptySearch(searchText: string): boolean;
|
|
121
|
+
/**
|
|
122
|
+
* Get default highlight options
|
|
123
|
+
*/
|
|
124
|
+
declare function getDefaultHighlightOptions(): HighlightOptions;
|
|
125
|
+
/**
|
|
126
|
+
* Find all matches in a document
|
|
127
|
+
*/
|
|
128
|
+
declare function findInDocument(document: any, searchText: string, options: FindOptions): FindMatch[];
|
|
129
|
+
/**
|
|
130
|
+
* Find matches in a single paragraph
|
|
131
|
+
*/
|
|
132
|
+
declare function findInParagraph(paragraph: any, searchText: string, options: FindOptions, paragraphIndex: number): FindMatch[];
|
|
133
|
+
/**
|
|
134
|
+
* Scroll to a match in the document
|
|
135
|
+
*/
|
|
136
|
+
declare function scrollToMatch(containerElement: HTMLElement | null, match: FindMatch): void;
|
|
137
|
+
|
|
138
|
+
export { type FindMatch as F, type HighlightOptions as H, type ParsedClipboardContent as P, type FindOptions as a, type FindResult as b, createDefaultFindOptions as c, createSearchPattern as d, escapeRegexString as e, findAllMatches as f, findInDocument as g, findInParagraph as h, getDefaultHighlightOptions as i, getMatchCountText as j, isEmptySearch as k, replaceFirstInContent as l, replaceAllInContent as r, scrollToMatch as s };
|