@stll/folio-react 0.4.0 → 0.6.0

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.
@@ -0,0 +1,318 @@
1
+ import React, { CSSProperties } from "react";
2
+ import { Document, EndnoteProperties, FootnoteProperties, SectionProperties } from "@stll/folio-core/types/document";
3
+ import { Watermark } from "@stll/folio-core/watermark";
4
+
5
+ //#region src/components/dialogs/findReplaceUtils.d.ts
6
+ /**
7
+ * A single match result in the document
8
+ */
9
+ type FindMatch = {
10
+ /** Index of the paragraph containing the match */paragraphIndex: number; /** Index of the run/content within the paragraph */
11
+ contentIndex: number; /** Character offset within the content */
12
+ startOffset: number; /** Character offset for end of match */
13
+ endOffset: number; /** The matched text */
14
+ text: string;
15
+ };
16
+ /**
17
+ * Find options for controlling search behavior
18
+ */
19
+ type FindOptions = {
20
+ /** Whether to match case */matchCase: boolean; /** Whether to match whole words only */
21
+ matchWholeWord: boolean; /** Whether to use regular expressions (future) */
22
+ useRegex?: boolean;
23
+ };
24
+ /**
25
+ * Find result with all matches
26
+ */
27
+ type FindResult = {
28
+ /** All matches found */matches: FindMatch[]; /** Total match count */
29
+ totalCount: number; /** Current match index (0-based) */
30
+ currentIndex: number;
31
+ };
32
+ //#endregion
33
+ //#region src/components/dialogs/FindReplaceDialog.d.ts
34
+ /**
35
+ * Props for the FindReplaceDialog component
36
+ */
37
+ type FindReplaceDialogProps = {
38
+ /** Whether the dialog is open */isOpen: boolean; /** Callback when dialog is closed */
39
+ onClose: () => void; /** Callback when searching for text */
40
+ onFind: (searchText: string, options: FindOptions) => FindResult | null; /** Callback when navigating to next match */
41
+ onFindNext: () => FindMatch | null; /** Callback when navigating to previous match */
42
+ onFindPrevious: () => FindMatch | null; /** Callback when replacing current match */
43
+ onReplace: (replaceText: string) => boolean; /** Callback when replacing all matches */
44
+ onReplaceAll: (searchText: string, replaceText: string, options: FindOptions) => number; /** Callback to highlight matches in document */
45
+ onHighlightMatches?: (matches: FindMatch[]) => void; /** Callback to clear highlights */
46
+ onClearHighlights?: () => void; /** Initial search text (e.g., from selected text) */
47
+ initialSearchText?: string; /** Whether to start in replace mode */
48
+ replaceMode?: boolean; /** Current match result (from external state) */
49
+ currentResult?: FindResult | null; /** Additional CSS class */
50
+ className?: string; /** Additional inline styles */
51
+ style?: CSSProperties;
52
+ };
53
+ /**
54
+ * FindReplaceDialog component - Modal for finding and replacing text
55
+ */
56
+ declare function FindReplaceDialog({
57
+ isOpen,
58
+ onClose,
59
+ onFind,
60
+ onFindNext,
61
+ onFindPrevious,
62
+ onHighlightMatches,
63
+ onClearHighlights,
64
+ initialSearchText,
65
+ currentResult,
66
+ className,
67
+ style
68
+ }: FindReplaceDialogProps): React.ReactElement | null;
69
+ //#endregion
70
+ //#region src/components/dialogs/FootnotePropertiesDialog.d.ts
71
+ type FootnotePropertiesDialogProps = {
72
+ isOpen: boolean;
73
+ onClose: () => void;
74
+ onApply: (footnoteProps: FootnoteProperties, endnoteProps: EndnoteProperties) => void;
75
+ footnotePr?: FootnoteProperties;
76
+ endnotePr?: EndnoteProperties;
77
+ };
78
+ declare function FootnotePropertiesDialog({
79
+ isOpen,
80
+ onClose,
81
+ onApply,
82
+ footnotePr,
83
+ endnotePr
84
+ }: FootnotePropertiesDialogProps): import("react").JSX.Element;
85
+ //#endregion
86
+ //#region src/components/dialogs/HyperlinkDialog.d.ts
87
+ type HyperlinkBookmarkOption = {
88
+ name: string;
89
+ label?: string;
90
+ };
91
+ type HyperlinkDialogData = {
92
+ href: string;
93
+ displayText: string;
94
+ tooltip?: string;
95
+ };
96
+ type HyperlinkDialogProps = {
97
+ isOpen: boolean;
98
+ onClose: () => void;
99
+ onSubmit: (data: HyperlinkDialogData) => void;
100
+ onRemove?: () => void;
101
+ currentData?: Partial<HyperlinkDialogData>;
102
+ selectedText?: string;
103
+ bookmarks?: readonly HyperlinkBookmarkOption[];
104
+ };
105
+ declare function HyperlinkDialog({
106
+ isOpen,
107
+ onClose,
108
+ onSubmit,
109
+ onRemove,
110
+ currentData,
111
+ selectedText,
112
+ bookmarks
113
+ }: HyperlinkDialogProps): import("react").JSX.Element;
114
+ //#endregion
115
+ //#region src/components/dialogs/ImagePositionDialog.d.ts
116
+ /**
117
+ * Image Position Dialog
118
+ *
119
+ * Modal for editing image positioning settings:
120
+ * - Horizontal: alignment or offset, relative to page/column/margin/paragraph
121
+ * - Vertical: alignment or offset, relative to page/margin/paragraph/line
122
+ * - Distance from text (top/bottom/left/right)
123
+ */
124
+ type ImagePositionData = {
125
+ horizontal?: {
126
+ relativeTo?: string;
127
+ posOffset?: number;
128
+ align?: string;
129
+ };
130
+ vertical?: {
131
+ relativeTo?: string;
132
+ posOffset?: number;
133
+ align?: string;
134
+ };
135
+ distTop?: number;
136
+ distBottom?: number;
137
+ distLeft?: number;
138
+ distRight?: number;
139
+ };
140
+ type ImagePositionDialogProps = {
141
+ isOpen: boolean;
142
+ onClose: () => void;
143
+ onApply: (data: ImagePositionData) => void;
144
+ currentData?: ImagePositionData;
145
+ };
146
+ declare function ImagePositionDialog({
147
+ isOpen,
148
+ onClose,
149
+ onApply,
150
+ currentData
151
+ }: ImagePositionDialogProps): import("react").JSX.Element;
152
+ //#endregion
153
+ //#region src/components/dialogs/ImagePropertiesDialog.d.ts
154
+ /**
155
+ * Image Properties Dialog
156
+ *
157
+ * Modal for editing image properties:
158
+ * - Alt text for accessibility
159
+ * - Border/outline style, color, and width
160
+ */
161
+ type ImagePropertiesData = {
162
+ alt?: string;
163
+ borderWidth?: number;
164
+ borderColor?: string;
165
+ borderStyle?: string;
166
+ };
167
+ type ImagePropertiesDialogProps = {
168
+ isOpen: boolean;
169
+ onClose: () => void;
170
+ onApply: (data: ImagePropertiesData) => void;
171
+ currentData?: ImagePropertiesData;
172
+ };
173
+ declare function ImagePropertiesDialog({
174
+ isOpen,
175
+ onClose,
176
+ onApply,
177
+ currentData
178
+ }: ImagePropertiesDialogProps): import("react").JSX.Element;
179
+ //#endregion
180
+ //#region src/components/dialogs/InsertImageDialog.d.ts
181
+ type InsertImageDialogData = {
182
+ file: File;
183
+ alt?: string;
184
+ width?: number;
185
+ height?: number;
186
+ };
187
+ type InsertImageDialogProps = {
188
+ isOpen: boolean;
189
+ onClose: () => void;
190
+ onInsert: (data: InsertImageDialogData) => void;
191
+ accept?: string;
192
+ };
193
+ declare function InsertImageDialog({
194
+ isOpen,
195
+ onClose,
196
+ onInsert,
197
+ accept
198
+ }: InsertImageDialogProps): import("react").JSX.Element;
199
+ //#endregion
200
+ //#region src/components/dialogs/InsertTableDialog.d.ts
201
+ type InsertTableDialogData = {
202
+ rows: number;
203
+ columns: number;
204
+ autofit: boolean;
205
+ styleId?: string;
206
+ };
207
+ type InsertTableStyleOption = {
208
+ id: string;
209
+ name: string;
210
+ };
211
+ type InsertTableDialogProps = {
212
+ isOpen: boolean;
213
+ onClose: () => void;
214
+ onInsert: (data: InsertTableDialogData) => void;
215
+ defaultRows?: number;
216
+ defaultColumns?: number;
217
+ styleOptions?: readonly InsertTableStyleOption[];
218
+ };
219
+ declare function InsertTableDialog({
220
+ isOpen,
221
+ onClose,
222
+ onInsert,
223
+ defaultRows,
224
+ defaultColumns,
225
+ styleOptions
226
+ }: InsertTableDialogProps): import("react").JSX.Element;
227
+ //#endregion
228
+ //#region src/components/dialogs/PageSetupDialog.d.ts
229
+ type PageSetupDialogProps = {
230
+ isOpen: boolean;
231
+ onClose: () => void;
232
+ onApply: (props: Partial<SectionProperties>) => void;
233
+ currentProps?: SectionProperties;
234
+ };
235
+ declare function PageSetupDialog({
236
+ isOpen,
237
+ onClose,
238
+ onApply,
239
+ currentProps
240
+ }: PageSetupDialogProps): import("react").JSX.Element;
241
+ //#endregion
242
+ //#region src/components/dialogs/PasteSpecialDialog.d.ts
243
+ type PasteSpecialMode = "keepFormatting" | "mergeFormatting" | "plainText";
244
+ type PasteSpecialDialogProps = {
245
+ isOpen: boolean;
246
+ onClose: () => void;
247
+ onPaste: (mode: PasteSpecialMode) => void;
248
+ defaultMode?: PasteSpecialMode;
249
+ };
250
+ declare function PasteSpecialDialog({
251
+ isOpen,
252
+ onClose,
253
+ onPaste,
254
+ defaultMode
255
+ }: PasteSpecialDialogProps): import("react").JSX.Element;
256
+ //#endregion
257
+ //#region src/components/dialogs/SplitCellDialog.d.ts
258
+ type SplitCellDialogData = {
259
+ rows: number;
260
+ columns: number;
261
+ mergeBeforeSplit: boolean;
262
+ };
263
+ type SplitCellDialogProps = {
264
+ isOpen: boolean;
265
+ onClose: () => void;
266
+ onSplit: (data: SplitCellDialogData) => void;
267
+ defaultRows?: number;
268
+ defaultColumns?: number;
269
+ };
270
+ declare function SplitCellDialog({
271
+ isOpen,
272
+ onClose,
273
+ onSplit,
274
+ defaultRows,
275
+ defaultColumns
276
+ }: SplitCellDialogProps): import("react").JSX.Element;
277
+ //#endregion
278
+ //#region src/components/dialogs/TablePropertiesDialog.d.ts
279
+ /**
280
+ * Table Properties Dialog — width type, width value, alignment.
281
+ */
282
+ type TableProperties = {
283
+ width?: number | null;
284
+ widthType?: string | null;
285
+ justification?: "left" | "center" | "right" | null;
286
+ };
287
+ type TablePropertiesDialogProps = {
288
+ isOpen: boolean;
289
+ onClose: () => void;
290
+ onApply: (props: TableProperties) => void;
291
+ currentProps?: {
292
+ width?: number;
293
+ widthType?: string;
294
+ justification?: string;
295
+ };
296
+ };
297
+ declare function TablePropertiesDialog({
298
+ isOpen,
299
+ onClose,
300
+ onApply,
301
+ currentProps
302
+ }: TablePropertiesDialogProps): import("react").JSX.Element;
303
+ //#endregion
304
+ //#region src/components/dialogs/WatermarkDialog.d.ts
305
+ type WatermarkDialogProps = {
306
+ isOpen: boolean;
307
+ onClose: () => void;
308
+ onApply: (watermark: Watermark | undefined) => void;
309
+ currentWatermark?: Watermark;
310
+ };
311
+ declare function WatermarkDialog({
312
+ isOpen,
313
+ onClose,
314
+ onApply,
315
+ currentWatermark
316
+ }: WatermarkDialogProps): import("react").JSX.Element;
317
+ //#endregion
318
+ export { HyperlinkDialogProps as A, ImagePropertiesDialogProps as C, HyperlinkBookmarkOption as D, ImagePositionDialogProps as E, FootnotePropertiesDialogProps as M, FindReplaceDialog as N, HyperlinkDialog as O, FindReplaceDialogProps as P, ImagePropertiesDialog as S, ImagePositionDialog as T, InsertTableStyleOption as _, TablePropertiesDialogProps as a, InsertImageDialogProps as b, SplitCellDialogProps as c, PasteSpecialMode as d, PageSetupDialog as f, InsertTableDialogProps as g, InsertTableDialogData as h, TablePropertiesDialog as i, FootnotePropertiesDialog as j, HyperlinkDialogData as k, PasteSpecialDialog as l, InsertTableDialog as m, WatermarkDialogProps as n, SplitCellDialog as o, PageSetupDialogProps as p, TableProperties as r, SplitCellDialogData as s, WatermarkDialog as t, PasteSpecialDialogProps as u, InsertImageDialog as v, ImagePositionData as w, ImagePropertiesData as x, InsertImageDialogData as y };
@@ -0,0 +1,2 @@
1
+ import { A as HyperlinkDialogProps, C as ImagePropertiesDialogProps, D as HyperlinkBookmarkOption, E as ImagePositionDialogProps, M as FootnotePropertiesDialogProps, N as FindReplaceDialog, O as HyperlinkDialog, P as FindReplaceDialogProps, S as ImagePropertiesDialog, T as ImagePositionDialog, _ as InsertTableStyleOption, a as TablePropertiesDialogProps, b as InsertImageDialogProps, c as SplitCellDialogProps, d as PasteSpecialMode, f as PageSetupDialog, g as InsertTableDialogProps, h as InsertTableDialogData, i as TablePropertiesDialog, j as FootnotePropertiesDialog, k as HyperlinkDialogData, l as PasteSpecialDialog, m as InsertTableDialog, n as WatermarkDialogProps, o as SplitCellDialog, p as PageSetupDialogProps, r as TableProperties, s as SplitCellDialogData, t as WatermarkDialog, u as PasteSpecialDialogProps, v as InsertImageDialog, w as ImagePositionData, x as ImagePropertiesData, y as InsertImageDialogData } from "./dialogs-j7qyw17x.js";
2
+ export { FindReplaceDialog, type FindReplaceDialogProps, FootnotePropertiesDialog, type FootnotePropertiesDialogProps, type HyperlinkBookmarkOption, HyperlinkDialog, type HyperlinkDialogData, type HyperlinkDialogProps, type ImagePositionData, ImagePositionDialog, type ImagePositionDialogProps, type ImagePropertiesData, ImagePropertiesDialog, type ImagePropertiesDialogProps, InsertImageDialog, type InsertImageDialogData, type InsertImageDialogProps, InsertTableDialog, type InsertTableDialogData, type InsertTableDialogProps, type InsertTableStyleOption, PageSetupDialog, type PageSetupDialogProps, PasteSpecialDialog, type PasteSpecialDialogProps, type PasteSpecialMode, SplitCellDialog, type SplitCellDialogData, type SplitCellDialogProps, type TableProperties, TablePropertiesDialog, type TablePropertiesDialogProps, WatermarkDialog, type WatermarkDialogProps };
@@ -0,0 +1,8 @@
1
+ import { t as FindReplaceDialog } from "./FindReplaceDialog-DLdBekSR.js";
2
+ import { t as FootnotePropertiesDialog } from "./FootnotePropertiesDialog-CUjq9c6H.js";
3
+ import { a as InsertImageDialog, i as InsertTableDialog, n as SplitCellDialog, o as HyperlinkDialog, r as PasteSpecialDialog, t as WatermarkDialog } from "./dialogs-CzvXYJyG.js";
4
+ import { t as ImagePositionDialog } from "./ImagePositionDialog-BMuO9rLT.js";
5
+ import { t as ImagePropertiesDialog } from "./ImagePropertiesDialog-C8iEgdmN.js";
6
+ import { t as PageSetupDialog } from "./PageSetupDialog-BKsSMCGb.js";
7
+ import { t as TablePropertiesDialog } from "./TablePropertiesDialog-Dw8gvL78.js";
8
+ export { FindReplaceDialog, FootnotePropertiesDialog, HyperlinkDialog, ImagePositionDialog, ImagePropertiesDialog, InsertImageDialog, InsertTableDialog, PageSetupDialog, PasteSpecialDialog, SplitCellDialog, TablePropertiesDialog, WatermarkDialog };