@zeke-02/docx-editor 0.5.2 → 0.5.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +204 -0
- package/dist/FindReplaceDialog-7SQOVQWH.js +1 -0
- package/dist/FindReplaceDialog-RK3A7MSK.mjs +1 -0
- package/dist/{FootnotePropertiesDialog-XQ7NIFIU.js → FootnotePropertiesDialog-2Q2SHVMR.js} +1 -1
- package/dist/{FootnotePropertiesDialog-TNVJJCY6.mjs → FootnotePropertiesDialog-ZKQXW3YO.mjs} +1 -1
- package/dist/{HyperlinkDialog-FR4IZZ7E.mjs → HyperlinkDialog-QV3CVFQU.mjs} +1 -1
- package/dist/HyperlinkDialog-XVAF7FVN.js +1 -0
- package/dist/{ImagePositionDialog-JSZSIKF5.mjs → ImagePositionDialog-EGRH3HPP.mjs} +1 -1
- package/dist/{ImagePositionDialog-2YXRAGZS.js → ImagePositionDialog-HIVHUTBT.js} +1 -1
- package/dist/ImagePropertiesDialog-67WLFIIZ.mjs +1 -0
- package/dist/ImagePropertiesDialog-HSM3JJ22.js +1 -0
- package/dist/KeyboardShortcutsDialog-B0UFuR4w.d.ts +395 -0
- package/dist/KeyboardShortcutsDialog-t6JKL4Aj.d.mts +395 -0
- package/dist/PageSetupDialog-642IAVG2.js +1 -0
- package/dist/PageSetupDialog-ERUQDHAY.mjs +1 -0
- package/dist/PluginHost-HS31VIuo.d.mts +16 -0
- package/dist/PluginHost-zILZO7zX.d.ts +16 -0
- package/dist/{SplitCellDialog-NP3JJYHD.mjs → SplitCellDialog-GFWCFCTD.mjs} +1 -1
- package/dist/{SplitCellDialog-JIAC3RYV.js → SplitCellDialog-M7WF7ANE.js} +1 -1
- package/dist/{TablePropertiesDialog-TIK4AA5M.mjs → TablePropertiesDialog-TZ7VCL6V.mjs} +1 -1
- package/dist/{TablePropertiesDialog-T7D4HSVP.js → TablePropertiesDialog-ZKU2FTUX.js} +1 -1
- package/dist/agentApi-B2Y7kexW.d.ts +486 -0
- package/dist/agentApi-BzUJ_kao.d.mts +486 -0
- package/dist/chunk-2XXILKEQ.js +1 -0
- package/dist/chunk-35DG3R42.js +2 -0
- package/dist/chunk-5UX5CD4C.js +1 -0
- package/dist/chunk-7QQSDIWK.mjs +2 -0
- package/dist/chunk-AW5TISUL.js +3 -0
- package/dist/chunk-B45ECEGY.js +18 -0
- package/dist/chunk-B7CCL7SL.mjs +2 -0
- package/dist/chunk-BRMTZRLJ.js +2 -0
- package/dist/chunk-D47GTKGU.js +2 -0
- package/dist/chunk-F5SERL7X.mjs +2 -0
- package/dist/chunk-FWPVBFKQ.mjs +1 -0
- package/dist/chunk-GGQK26JO.js +2 -0
- package/dist/chunk-GM2S2WMT.mjs +1 -0
- package/dist/chunk-HXDMASAR.js +1 -0
- package/dist/chunk-ILYKDR3C.js +1 -0
- package/dist/chunk-JFRDFK7V.mjs +260 -0
- package/dist/chunk-JPF5R2ZM.mjs +1 -0
- package/dist/chunk-KOXCF3CL.mjs +1 -0
- package/dist/chunk-KRLNX56Y.mjs +2 -0
- package/dist/chunk-LWOHVYKW.mjs +1 -0
- package/dist/chunk-MDTA25AN.mjs +60 -0
- package/dist/chunk-MKNSJOCN.js +70 -0
- package/dist/chunk-NIBCC7WQ.js +1 -0
- package/dist/chunk-NLFXR2VH.js +2 -0
- package/dist/chunk-NOLMVQNN.mjs +40 -0
- package/dist/chunk-ONIYA2FU.mjs +2 -0
- package/dist/chunk-RCIZ7OM3.mjs +70 -0
- package/dist/chunk-SGTUE33R.js +260 -0
- package/dist/{chunk-EHFEG3TX.js → chunk-SNZ57XBI.js} +1 -1
- package/dist/chunk-SOTWG3KJ.mjs +1 -0
- package/dist/chunk-TYPGB4KF.js +1 -0
- package/dist/chunk-U7ZW2DOO.mjs +2 -0
- package/dist/chunk-WO3FIV4B.js +40 -0
- package/dist/{chunk-PKEOQIQO.mjs → chunk-WPI3YRFO.mjs} +1 -1
- package/dist/chunk-XGJ2EORY.mjs +1 -0
- package/dist/chunk-XQZTWWRF.mjs +18 -0
- package/dist/chunk-Y3SEHWZ2.js +1 -0
- package/dist/chunk-YBEVHQCT.js +60 -0
- package/dist/chunk-ZVAFVHWR.mjs +3 -0
- package/dist/chunk-ZXPCJWVY.js +2 -0
- package/dist/{agentApi-DLt94vXk.d.mts → content-REFGFfEH.d.mts} +8 -755
- package/dist/{agentApi-DLt94vXk.d.ts → content-REFGFfEH.d.ts} +8 -755
- package/dist/dialogs.d.mts +25 -0
- package/dist/dialogs.d.ts +25 -0
- package/dist/dialogs.js +1 -0
- package/dist/dialogs.mjs +1 -0
- package/dist/document-Cu2vq_wS.d.mts +294 -0
- package/dist/document-CxOagoLQ.d.ts +294 -0
- package/dist/executor-WBHID2RK.mjs +1 -0
- package/dist/executor-Y5VUOAHY.js +1 -0
- package/dist/findReplace-Bue0JaXh.d.ts +138 -0
- package/dist/findReplace-shXbOjFQ.d.mts +138 -0
- package/dist/fork.d.mts +535 -0
- package/dist/fork.d.ts +535 -0
- package/dist/fork.js +1 -0
- package/dist/fork.mjs +1 -0
- package/dist/hooks.d.mts +598 -0
- package/dist/hooks.d.ts +598 -0
- package/dist/hooks.js +1 -0
- package/dist/hooks.mjs +1 -0
- package/dist/index-B5A-J9GC.d.ts +1119 -0
- package/dist/index-bw-PaozF.d.mts +1119 -0
- package/dist/index.d.mts +12 -591
- package/dist/index.d.ts +12 -591
- package/dist/index.js +1 -120
- package/dist/index.mjs +1 -120
- package/dist/layout-bridge-5GYGYKM5.mjs +1 -0
- package/dist/layout-bridge-QQDA7ELH.js +1 -0
- package/dist/plugin-api.d.mts +165 -0
- package/dist/plugin-api.d.ts +165 -0
- package/dist/plugin-api.js +1 -0
- package/dist/plugin-api.mjs +1 -0
- package/dist/processTemplate-BTBTR7AM.js +1 -0
- package/dist/{processTemplate-W2C5PXZB.mjs → processTemplate-MBX2KDLE.mjs} +1 -1
- package/dist/styles.css +1 -1
- package/dist/styles.d.mts +18 -0
- package/dist/styles.d.ts +18 -0
- package/dist/styles.js +1 -0
- package/dist/styles.mjs +1 -0
- package/dist/types-BF48VxkC.d.mts +18 -0
- package/dist/types-BF48VxkC.d.ts +18 -0
- package/dist/types-BnIs4sE7.d.mts +281 -0
- package/dist/types-BnIs4sE7.d.ts +281 -0
- package/dist/types-CW6HFAX6.d.ts +39 -0
- package/dist/types-DIsDCwTG.d.mts +39 -0
- package/dist/ui.d.mts +111 -552
- package/dist/ui.d.ts +111 -552
- package/dist/ui.js +111 -1
- package/dist/ui.mjs +111 -1
- package/dist/useFindReplace-DKy-s3gS.d.ts +261 -0
- package/dist/useFindReplace-vuoKpDKE.d.mts +261 -0
- package/package.json +47 -49
- package/dist/ClipboardManager-CVKX0v9q.d.ts +0 -464
- package/dist/ClipboardManager-V3aaMnWE.d.mts +0 -464
- package/dist/DocumentAgent-BWflKHpH.d.mts +0 -442
- package/dist/DocumentAgent-DsdXtetF.d.ts +0 -442
- package/dist/FindReplaceDialog-L3YF5HIS.mjs +0 -1
- package/dist/FindReplaceDialog-SEBWC5P7.js +0 -1
- package/dist/HyperlinkDialog-WEK6JSAC.js +0 -1
- package/dist/ImagePropertiesDialog-527MFLQO.mjs +0 -1
- package/dist/ImagePropertiesDialog-HG4K3IE7.js +0 -1
- package/dist/PageSetupDialog-GALVJMUB.js +0 -1
- package/dist/PageSetupDialog-TGQIAMI7.mjs +0 -1
- package/dist/TableToolbar-DUgmob2I.d.ts +0 -1273
- package/dist/TableToolbar-YL74HNS1.d.mts +0 -1273
- package/dist/chunk-23SXXIZS.js +0 -111
- package/dist/chunk-3F52AP2Q.js +0 -1
- package/dist/chunk-42O5GXM5.mjs +0 -82
- package/dist/chunk-54ULJEHM.mjs +0 -1
- package/dist/chunk-5XK326FI.mjs +0 -1
- package/dist/chunk-6WPRCJ5A.mjs +0 -1
- package/dist/chunk-76IYR7C7.mjs +0 -1
- package/dist/chunk-AGRIVA4G.js +0 -1
- package/dist/chunk-BTCQ2QI3.mjs +0 -3
- package/dist/chunk-BUEMG4NW.js +0 -1
- package/dist/chunk-BXRC4U3X.mjs +0 -2
- package/dist/chunk-CPAYKE6X.mjs +0 -1
- package/dist/chunk-DACWLFKI.mjs +0 -1
- package/dist/chunk-EPBFWE36.js +0 -2
- package/dist/chunk-FXES3YDB.js +0 -82
- package/dist/chunk-HI66BSGS.mjs +0 -9
- package/dist/chunk-INTPVEO6.mjs +0 -9
- package/dist/chunk-IOAGVW6Q.mjs +0 -2
- package/dist/chunk-JCEWC5QL.mjs +0 -4
- package/dist/chunk-JTIUFACT.js +0 -1
- package/dist/chunk-LUF7PWIC.js +0 -10
- package/dist/chunk-MGEN6GOE.mjs +0 -2
- package/dist/chunk-MOE2ZGUE.js +0 -18
- package/dist/chunk-MWLHJWB6.js +0 -9
- package/dist/chunk-OFYVDN3U.mjs +0 -2
- package/dist/chunk-P4VSHBGZ.js +0 -2
- package/dist/chunk-P5FQHIES.mjs +0 -1
- package/dist/chunk-PBC7XAYZ.js +0 -3
- package/dist/chunk-PEMB6SZT.js +0 -2
- package/dist/chunk-PQMSZTBB.js +0 -9
- package/dist/chunk-Q7UDQXAF.js +0 -1
- package/dist/chunk-QGTAIC5E.js +0 -1
- package/dist/chunk-QVPR2W5S.js +0 -1
- package/dist/chunk-R3QMYPL5.mjs +0 -59
- package/dist/chunk-RBUTXXQJ.mjs +0 -18
- package/dist/chunk-RRWYZ2TS.mjs +0 -111
- package/dist/chunk-S3STEPVO.js +0 -182
- package/dist/chunk-SFUM35DH.js +0 -2
- package/dist/chunk-SNLC6EK2.js +0 -1
- package/dist/chunk-TMTLIGLZ.js +0 -59
- package/dist/chunk-TSE2PWFX.mjs +0 -10
- package/dist/chunk-UKESXQS5.mjs +0 -182
- package/dist/chunk-UWYD42WV.js +0 -4
- package/dist/chunk-UXVACQCY.mjs +0 -1
- package/dist/chunk-W4EIKDM6.mjs +0 -2
- package/dist/chunk-W53SI3XW.mjs +0 -1
- package/dist/chunk-WNS2RBQD.js +0 -2
- package/dist/chunk-Z3KMSHUP.js +0 -1
- package/dist/core-plugins-reexport.d.mts +0 -31
- package/dist/core-plugins-reexport.d.ts +0 -31
- package/dist/core-plugins-reexport.js +0 -1
- package/dist/core-plugins-reexport.mjs +0 -1
- package/dist/core-reexport.d.mts +0 -340
- package/dist/core-reexport.d.ts +0 -340
- package/dist/core-reexport.js +0 -1
- package/dist/core-reexport.mjs +0 -1
- package/dist/documentSerializer-DtS_-oGA.d.mts +0 -664
- package/dist/documentSerializer-Wj1p2ASa.d.ts +0 -664
- package/dist/executor-C3VXF7QA.mjs +0 -1
- package/dist/executor-GDBV3AGV.js +0 -1
- package/dist/headless-reexport.d.mts +0 -197
- package/dist/headless-reexport.d.ts +0 -197
- package/dist/headless-reexport.js +0 -1
- package/dist/headless-reexport.mjs +0 -1
- package/dist/insertOperations-BTH1Asas.d.mts +0 -176
- package/dist/insertOperations-CbUnXAXH.d.ts +0 -176
- package/dist/layout-bridge-EA4DJ227.js +0 -1
- package/dist/layout-bridge-XDPSO6GO.mjs +0 -1
- package/dist/mcp-reexport.d.mts +0 -156
- package/dist/mcp-reexport.d.ts +0 -156
- package/dist/mcp-reexport.js +0 -16
- package/dist/mcp-reexport.mjs +0 -16
- package/dist/processTemplate-MJ2PCSO5.js +0 -1
- package/dist/react-B0W16SV6.d.ts +0 -1330
- package/dist/react-D0Pn1nww.d.mts +0 -1330
- package/dist/react.d.mts +0 -10
- package/dist/react.d.ts +0 -10
- package/dist/react.js +0 -1
- package/dist/react.mjs +0 -1
- package/dist/registry-CH9V-IX0.d.ts +0 -165
- package/dist/registry-CWBKYlNW.d.mts +0 -165
- package/dist/types-UDsUq8D3.d.mts +0 -310
- package/dist/types-jbivc9Lj.d.ts +0 -310
- package/dist/variableDetector-CdQ7ZTzA.d.mts +0 -204
- package/dist/variableDetector-DsRV3A9z.d.ts +0 -204
- package/i18n/de.json +0 -792
- package/i18n/en.json +0 -792
- package/i18n/he.json +0 -792
- package/i18n/pl.json +0 -792
- package/i18n/pt-BR.json +0 -792
- package/i18n/tr.json +0 -792
- package/i18n/zh-CN.json +0 -792
- /package/dist/{chunk-YC5KZSYD.js → chunk-ESZ6JRTW.js} +0 -0
- /package/dist/{chunk-LVGJKS7Y.mjs → chunk-TZMMD6RR.mjs} +0 -0
- /package/dist/{react.css → fork.css} +0 -0
|
@@ -0,0 +1,395 @@
|
|
|
1
|
+
import React__default, { CSSProperties } from 'react';
|
|
2
|
+
import { a as FindOptions, b as FindResult, F as FindMatch, P as ParsedClipboardContent } from './findReplace-Bue0JaXh.js';
|
|
3
|
+
import { T as TranslationKey } from './types-BF48VxkC.js';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Find and Replace Dialog Component
|
|
7
|
+
*
|
|
8
|
+
* Modal dialog for searching and replacing text in the document.
|
|
9
|
+
* Supports find, find next/previous, replace, and replace all operations.
|
|
10
|
+
*
|
|
11
|
+
* Logic and utilities are in separate files:
|
|
12
|
+
* - findReplaceUtils.ts — Pure search/replace functions and types
|
|
13
|
+
* - useFindReplace.ts — React hook for dialog state management
|
|
14
|
+
*/
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Props for the FindReplaceDialog component
|
|
18
|
+
*/
|
|
19
|
+
interface FindReplaceDialogProps {
|
|
20
|
+
/** Whether the dialog is open */
|
|
21
|
+
isOpen: boolean;
|
|
22
|
+
/** Callback when dialog is closed */
|
|
23
|
+
onClose: () => void;
|
|
24
|
+
/** Callback when searching for text */
|
|
25
|
+
onFind: (searchText: string, options: FindOptions) => FindResult | null;
|
|
26
|
+
/** Callback when navigating to next match */
|
|
27
|
+
onFindNext: () => FindMatch | null;
|
|
28
|
+
/** Callback when navigating to previous match */
|
|
29
|
+
onFindPrevious: () => FindMatch | null;
|
|
30
|
+
/** Callback when replacing current match */
|
|
31
|
+
onReplace: (replaceText: string) => boolean;
|
|
32
|
+
/** Callback when replacing all matches */
|
|
33
|
+
onReplaceAll: (searchText: string, replaceText: string, options: FindOptions) => number;
|
|
34
|
+
/** Callback to highlight matches in document */
|
|
35
|
+
onHighlightMatches?: (matches: FindMatch[]) => void;
|
|
36
|
+
/** Callback to clear highlights */
|
|
37
|
+
onClearHighlights?: () => void;
|
|
38
|
+
/** Initial search text (e.g., from selected text) */
|
|
39
|
+
initialSearchText?: string;
|
|
40
|
+
/** Whether to start in replace mode */
|
|
41
|
+
replaceMode?: boolean;
|
|
42
|
+
/** Current match result (from external state) */
|
|
43
|
+
currentResult?: FindResult | null;
|
|
44
|
+
/** Additional CSS class */
|
|
45
|
+
className?: string;
|
|
46
|
+
/** Additional inline styles */
|
|
47
|
+
style?: CSSProperties;
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* FindReplaceDialog component - Modal for finding and replacing text
|
|
51
|
+
*/
|
|
52
|
+
declare function FindReplaceDialog({ isOpen, onClose, onFind, onFindNext, onFindPrevious, onReplace, onReplaceAll, onHighlightMatches, onClearHighlights, initialSearchText, replaceMode, currentResult, className, style, }: FindReplaceDialogProps): React__default.ReactElement | null;
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* Hyperlink Dialog Component
|
|
56
|
+
*
|
|
57
|
+
* Modal dialog for inserting and editing hyperlinks in the document.
|
|
58
|
+
* Supports both external URLs and internal bookmark links.
|
|
59
|
+
*
|
|
60
|
+
* Features:
|
|
61
|
+
* - Input for URL (http, https, mailto, tel, etc.)
|
|
62
|
+
* - Input for display text
|
|
63
|
+
* - Edit existing hyperlinks
|
|
64
|
+
* - Remove hyperlink option
|
|
65
|
+
* - Internal bookmark selection
|
|
66
|
+
* - Validation and error handling
|
|
67
|
+
*/
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* Hyperlink data structure for dialog
|
|
71
|
+
*/
|
|
72
|
+
interface HyperlinkData {
|
|
73
|
+
/** URL for external link */
|
|
74
|
+
url?: string;
|
|
75
|
+
/** Display text for the link */
|
|
76
|
+
displayText?: string;
|
|
77
|
+
/** Internal bookmark name */
|
|
78
|
+
bookmark?: string;
|
|
79
|
+
/** Tooltip text */
|
|
80
|
+
tooltip?: string;
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* Bookmark option for internal link selection
|
|
84
|
+
*/
|
|
85
|
+
interface BookmarkOption {
|
|
86
|
+
/** Bookmark name/ID */
|
|
87
|
+
name: string;
|
|
88
|
+
/** Optional display label */
|
|
89
|
+
label?: string;
|
|
90
|
+
}
|
|
91
|
+
/**
|
|
92
|
+
* Props for the HyperlinkDialog component
|
|
93
|
+
*/
|
|
94
|
+
interface HyperlinkDialogProps {
|
|
95
|
+
/** Whether the dialog is open */
|
|
96
|
+
isOpen: boolean;
|
|
97
|
+
/** Callback when dialog is closed */
|
|
98
|
+
onClose: () => void;
|
|
99
|
+
/** Callback when hyperlink is inserted/updated */
|
|
100
|
+
onSubmit: (data: HyperlinkData) => void;
|
|
101
|
+
/** Callback when hyperlink is removed */
|
|
102
|
+
onRemove?: () => void;
|
|
103
|
+
/** Initial data for editing existing hyperlink */
|
|
104
|
+
initialData?: HyperlinkData;
|
|
105
|
+
/** Currently selected text (used as default display text) */
|
|
106
|
+
selectedText?: string;
|
|
107
|
+
/** Whether we're editing an existing hyperlink */
|
|
108
|
+
isEditing?: boolean;
|
|
109
|
+
/** Available bookmarks for internal links */
|
|
110
|
+
bookmarks?: BookmarkOption[];
|
|
111
|
+
/** Additional CSS class */
|
|
112
|
+
className?: string;
|
|
113
|
+
/** Additional inline styles */
|
|
114
|
+
style?: CSSProperties;
|
|
115
|
+
}
|
|
116
|
+
/**
|
|
117
|
+
* Validate a URL string
|
|
118
|
+
* Supports http, https, mailto, tel, ftp protocols
|
|
119
|
+
*/
|
|
120
|
+
declare function isValidUrl(url: string): boolean;
|
|
121
|
+
/**
|
|
122
|
+
* Normalize a URL by adding protocol if needed
|
|
123
|
+
*/
|
|
124
|
+
declare function normalizeUrl(url: string): string;
|
|
125
|
+
/**
|
|
126
|
+
* Detect URL type from string
|
|
127
|
+
*/
|
|
128
|
+
declare function getUrlType(url: string): 'web' | 'email' | 'phone' | 'ftp' | 'unknown';
|
|
129
|
+
/**
|
|
130
|
+
* HyperlinkDialog component - Modal for inserting/editing hyperlinks
|
|
131
|
+
*/
|
|
132
|
+
declare function HyperlinkDialog({ isOpen, onClose, onSubmit, onRemove, initialData, selectedText, isEditing, bookmarks, className, style, }: HyperlinkDialogProps): React__default.ReactElement | null;
|
|
133
|
+
/**
|
|
134
|
+
* Create HyperlinkData from a URL string
|
|
135
|
+
*/
|
|
136
|
+
declare function createHyperlinkData(url: string, displayText?: string): HyperlinkData;
|
|
137
|
+
/**
|
|
138
|
+
* Create HyperlinkData for an internal bookmark
|
|
139
|
+
*/
|
|
140
|
+
declare function createBookmarkLinkData(bookmark: string, displayText?: string): HyperlinkData;
|
|
141
|
+
/**
|
|
142
|
+
* Check if HyperlinkData is for an external URL
|
|
143
|
+
*/
|
|
144
|
+
declare function isExternalHyperlinkData(data: HyperlinkData): boolean;
|
|
145
|
+
/**
|
|
146
|
+
* Check if HyperlinkData is for an internal bookmark
|
|
147
|
+
*/
|
|
148
|
+
declare function isBookmarkHyperlinkData(data: HyperlinkData): boolean;
|
|
149
|
+
/**
|
|
150
|
+
* Get display text from HyperlinkData, falling back to URL/bookmark
|
|
151
|
+
*/
|
|
152
|
+
declare function getDisplayText(data: HyperlinkData): string;
|
|
153
|
+
/**
|
|
154
|
+
* Convert email address to mailto: link
|
|
155
|
+
*/
|
|
156
|
+
declare function emailToMailto(email: string): string;
|
|
157
|
+
/**
|
|
158
|
+
* Convert phone number to tel: link
|
|
159
|
+
*/
|
|
160
|
+
declare function phoneToTel(phone: string): string;
|
|
161
|
+
/**
|
|
162
|
+
* Extract bookmarks from document for the dialog
|
|
163
|
+
*/
|
|
164
|
+
declare function extractBookmarksForDialog(bookmarks: {
|
|
165
|
+
name: string;
|
|
166
|
+
id: number;
|
|
167
|
+
}[]): BookmarkOption[];
|
|
168
|
+
/**
|
|
169
|
+
* Hook state for the Hyperlink dialog
|
|
170
|
+
*/
|
|
171
|
+
interface UseHyperlinkDialogState {
|
|
172
|
+
/** Whether the dialog is open */
|
|
173
|
+
isOpen: boolean;
|
|
174
|
+
/** Initial data for the dialog (for editing) */
|
|
175
|
+
initialData?: HyperlinkData;
|
|
176
|
+
/** Currently selected text */
|
|
177
|
+
selectedText?: string;
|
|
178
|
+
/** Whether we're editing an existing hyperlink */
|
|
179
|
+
isEditing: boolean;
|
|
180
|
+
}
|
|
181
|
+
/**
|
|
182
|
+
* Hook return type for the Hyperlink dialog
|
|
183
|
+
*/
|
|
184
|
+
interface UseHyperlinkDialogReturn {
|
|
185
|
+
/** Current state */
|
|
186
|
+
state: UseHyperlinkDialogState;
|
|
187
|
+
/** Open dialog for inserting new hyperlink */
|
|
188
|
+
openInsert: (selectedText?: string) => void;
|
|
189
|
+
/** Open dialog for editing existing hyperlink */
|
|
190
|
+
openEdit: (data: HyperlinkData) => void;
|
|
191
|
+
/** Close the dialog */
|
|
192
|
+
close: () => void;
|
|
193
|
+
/** Toggle dialog open/closed */
|
|
194
|
+
toggle: () => void;
|
|
195
|
+
}
|
|
196
|
+
/**
|
|
197
|
+
* Hook for managing Hyperlink dialog state
|
|
198
|
+
*/
|
|
199
|
+
declare function useHyperlinkDialog(): UseHyperlinkDialogReturn;
|
|
200
|
+
|
|
201
|
+
/**
|
|
202
|
+
* Paste Special Dialog Component
|
|
203
|
+
*
|
|
204
|
+
* Provides paste options for pasting content with or without formatting.
|
|
205
|
+
* Features:
|
|
206
|
+
* - Paste with formatting (default)
|
|
207
|
+
* - Paste as plain text (unformatted)
|
|
208
|
+
* - Keyboard shortcut: Ctrl+Shift+V opens dialog
|
|
209
|
+
*/
|
|
210
|
+
|
|
211
|
+
/**
|
|
212
|
+
* Paste option type
|
|
213
|
+
*/
|
|
214
|
+
type PasteOption = 'formatted' | 'plainText';
|
|
215
|
+
/**
|
|
216
|
+
* Paste special dialog props
|
|
217
|
+
*/
|
|
218
|
+
interface PasteSpecialDialogProps {
|
|
219
|
+
/** Whether the dialog is open */
|
|
220
|
+
isOpen: boolean;
|
|
221
|
+
/** Callback when dialog is closed */
|
|
222
|
+
onClose: () => void;
|
|
223
|
+
/** Callback when paste is confirmed */
|
|
224
|
+
onPaste: (content: ParsedClipboardContent, asPlainText: boolean) => void;
|
|
225
|
+
/** Optional custom position */
|
|
226
|
+
position?: {
|
|
227
|
+
x: number;
|
|
228
|
+
y: number;
|
|
229
|
+
};
|
|
230
|
+
/** Additional className */
|
|
231
|
+
className?: string;
|
|
232
|
+
}
|
|
233
|
+
/**
|
|
234
|
+
* Paste option definition with translation keys
|
|
235
|
+
*/
|
|
236
|
+
interface PasteOptionDef {
|
|
237
|
+
id: PasteOption;
|
|
238
|
+
labelKey: TranslationKey;
|
|
239
|
+
descriptionKey: TranslationKey;
|
|
240
|
+
shortcutKey: TranslationKey;
|
|
241
|
+
}
|
|
242
|
+
/**
|
|
243
|
+
* Hook return value for paste special
|
|
244
|
+
*/
|
|
245
|
+
interface UsePasteSpecialReturn {
|
|
246
|
+
/** Whether the dialog is open */
|
|
247
|
+
isOpen: boolean;
|
|
248
|
+
/** Open the paste special dialog */
|
|
249
|
+
openDialog: () => void;
|
|
250
|
+
/** Close the dialog */
|
|
251
|
+
closeDialog: () => void;
|
|
252
|
+
/** Handle keyboard shortcut (Ctrl+Shift+V) */
|
|
253
|
+
handleKeyDown: (event: KeyboardEvent) => boolean;
|
|
254
|
+
/** Paste as plain text directly */
|
|
255
|
+
pasteAsPlainText: () => Promise<void>;
|
|
256
|
+
}
|
|
257
|
+
/**
|
|
258
|
+
* Options for usePasteSpecial hook
|
|
259
|
+
*/
|
|
260
|
+
interface UsePasteSpecialOptions {
|
|
261
|
+
/** Callback when paste is confirmed */
|
|
262
|
+
onPaste?: (content: ParsedClipboardContent, asPlainText: boolean) => void;
|
|
263
|
+
/** Whether paste operations are enabled */
|
|
264
|
+
enabled?: boolean;
|
|
265
|
+
}
|
|
266
|
+
declare const PasteSpecialDialog: React__default.FC<PasteSpecialDialogProps>;
|
|
267
|
+
/**
|
|
268
|
+
* Hook to manage paste special dialog
|
|
269
|
+
*/
|
|
270
|
+
declare function usePasteSpecial(options?: UsePasteSpecialOptions): UsePasteSpecialReturn;
|
|
271
|
+
/**
|
|
272
|
+
* Get paste option definition by id
|
|
273
|
+
*/
|
|
274
|
+
declare function getPasteOption(id: PasteOption): PasteOptionDef | undefined;
|
|
275
|
+
/**
|
|
276
|
+
* Get all paste option definitions
|
|
277
|
+
*/
|
|
278
|
+
declare function getAllPasteOptions(): PasteOptionDef[];
|
|
279
|
+
/**
|
|
280
|
+
* Get default paste option
|
|
281
|
+
*/
|
|
282
|
+
declare function getDefaultPasteOption(): PasteOption;
|
|
283
|
+
/**
|
|
284
|
+
* Check if paste special shortcut
|
|
285
|
+
*/
|
|
286
|
+
declare function isPasteSpecialShortcut(event: KeyboardEvent): boolean;
|
|
287
|
+
|
|
288
|
+
/**
|
|
289
|
+
* Keyboard Shortcuts Dialog Component
|
|
290
|
+
*
|
|
291
|
+
* Displays all available keyboard shortcuts organized by category.
|
|
292
|
+
* Features:
|
|
293
|
+
* - Categorized shortcut list
|
|
294
|
+
* - Search/filter functionality
|
|
295
|
+
* - Platform-aware modifier keys (Ctrl/Cmd)
|
|
296
|
+
* - Keyboard shortcut to open (Ctrl+/)
|
|
297
|
+
*/
|
|
298
|
+
|
|
299
|
+
/**
|
|
300
|
+
* Keyboard shortcut definition
|
|
301
|
+
*/
|
|
302
|
+
interface KeyboardShortcut {
|
|
303
|
+
/** Unique identifier */
|
|
304
|
+
id: string;
|
|
305
|
+
/** Display name */
|
|
306
|
+
name: string;
|
|
307
|
+
/** Description of what the shortcut does */
|
|
308
|
+
description: string;
|
|
309
|
+
/** Primary key combination (e.g., 'Ctrl+C') */
|
|
310
|
+
keys: string;
|
|
311
|
+
/** Alternative key combination */
|
|
312
|
+
altKeys?: string;
|
|
313
|
+
/** Category for grouping */
|
|
314
|
+
category: ShortcutCategory;
|
|
315
|
+
/** Whether this is a common/frequently used shortcut */
|
|
316
|
+
common?: boolean;
|
|
317
|
+
/** Translation key for display name (used internally) */
|
|
318
|
+
nameKey?: TranslationKey;
|
|
319
|
+
/** Translation key for description (used internally) */
|
|
320
|
+
descriptionKey?: TranslationKey;
|
|
321
|
+
}
|
|
322
|
+
/**
|
|
323
|
+
* Shortcut category
|
|
324
|
+
*/
|
|
325
|
+
type ShortcutCategory = 'editing' | 'formatting' | 'navigation' | 'clipboard' | 'selection' | 'view' | 'file' | 'other';
|
|
326
|
+
/**
|
|
327
|
+
* Dialog props
|
|
328
|
+
*/
|
|
329
|
+
interface KeyboardShortcutsDialogProps {
|
|
330
|
+
/** Whether the dialog is open */
|
|
331
|
+
isOpen: boolean;
|
|
332
|
+
/** Close callback */
|
|
333
|
+
onClose: () => void;
|
|
334
|
+
/** Custom shortcuts (merged with defaults) */
|
|
335
|
+
customShortcuts?: KeyboardShortcut[];
|
|
336
|
+
/** Whether to show search */
|
|
337
|
+
showSearch?: boolean;
|
|
338
|
+
/** Additional className */
|
|
339
|
+
className?: string;
|
|
340
|
+
}
|
|
341
|
+
/**
|
|
342
|
+
* Hook options
|
|
343
|
+
*/
|
|
344
|
+
interface UseKeyboardShortcutsDialogOptions {
|
|
345
|
+
/** Whether the dialog can be opened with Ctrl+? or F1 */
|
|
346
|
+
enabled?: boolean;
|
|
347
|
+
/** Custom open shortcut (default: Ctrl+/) */
|
|
348
|
+
openShortcut?: string;
|
|
349
|
+
}
|
|
350
|
+
/**
|
|
351
|
+
* Hook return value
|
|
352
|
+
*/
|
|
353
|
+
interface UseKeyboardShortcutsDialogReturn {
|
|
354
|
+
/** Whether dialog is open */
|
|
355
|
+
isOpen: boolean;
|
|
356
|
+
/** Open the dialog */
|
|
357
|
+
open: () => void;
|
|
358
|
+
/** Close the dialog */
|
|
359
|
+
close: () => void;
|
|
360
|
+
/** Toggle the dialog */
|
|
361
|
+
toggle: () => void;
|
|
362
|
+
/** Keyboard event handler */
|
|
363
|
+
handleKeyDown: (event: KeyboardEvent) => void;
|
|
364
|
+
}
|
|
365
|
+
declare const KeyboardShortcutsDialog: React__default.FC<KeyboardShortcutsDialogProps>;
|
|
366
|
+
/**
|
|
367
|
+
* Hook to manage keyboard shortcuts dialog
|
|
368
|
+
*/
|
|
369
|
+
declare function useKeyboardShortcutsDialog(options?: UseKeyboardShortcutsDialogOptions): UseKeyboardShortcutsDialogReturn;
|
|
370
|
+
/**
|
|
371
|
+
* Get all default shortcuts
|
|
372
|
+
*/
|
|
373
|
+
declare function getDefaultShortcuts(): KeyboardShortcut[];
|
|
374
|
+
/**
|
|
375
|
+
* Get shortcuts by category
|
|
376
|
+
*/
|
|
377
|
+
declare function getShortcutsByCategory(category: ShortcutCategory): KeyboardShortcut[];
|
|
378
|
+
/**
|
|
379
|
+
* Get common/frequently used shortcuts
|
|
380
|
+
*/
|
|
381
|
+
declare function getCommonShortcuts(): KeyboardShortcut[];
|
|
382
|
+
/**
|
|
383
|
+
* Get category label translation key
|
|
384
|
+
*/
|
|
385
|
+
declare function getCategoryLabel(category: ShortcutCategory): string;
|
|
386
|
+
/**
|
|
387
|
+
* Get all categories
|
|
388
|
+
*/
|
|
389
|
+
declare function getAllCategories(): ShortcutCategory[];
|
|
390
|
+
/**
|
|
391
|
+
* Format shortcut keys for display
|
|
392
|
+
*/
|
|
393
|
+
declare function formatShortcutKeys(keys: string): string;
|
|
394
|
+
|
|
395
|
+
export { extractBookmarksForDialog as A, type BookmarkOption as B, getDisplayText as C, getUrlType as D, isBookmarkHyperlinkData as E, FindReplaceDialog as F, isExternalHyperlinkData as G, type HyperlinkData as H, isValidUrl as I, normalizeUrl as J, type KeyboardShortcut as K, phoneToTel as L, type PasteOption as P, type ShortcutCategory as S, type UseKeyboardShortcutsDialogOptions as U, type FindReplaceDialogProps as a, HyperlinkDialog as b, type HyperlinkDialogProps as c, KeyboardShortcutsDialog as d, type KeyboardShortcutsDialogProps as e, PasteSpecialDialog as f, type PasteSpecialDialogProps as g, type UseKeyboardShortcutsDialogReturn as h, type UsePasteSpecialOptions as i, type UsePasteSpecialReturn as j, formatShortcutKeys as k, getAllCategories as l, getAllPasteOptions as m, getCategoryLabel as n, getCommonShortcuts as o, getDefaultPasteOption as p, getDefaultShortcuts as q, getPasteOption as r, getShortcutsByCategory as s, isPasteSpecialShortcut as t, useHyperlinkDialog as u, useKeyboardShortcutsDialog as v, usePasteSpecial as w, createBookmarkLinkData as x, createHyperlinkData as y, emailToMailto as z };
|