@pixerate/editor-react 0.14.0 → 0.16.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.
- package/README.md +6 -1
- package/dist/canvas/index.cjs +352 -118
- package/dist/canvas/index.cjs.map +1 -1
- package/dist/canvas/index.d.cts +112 -8
- package/dist/canvas/index.d.ts +112 -8
- package/dist/canvas/index.js +258 -19
- package/dist/canvas/index.js.map +1 -1
- package/dist/chunk-4ZC2WCUO.js +196 -0
- package/dist/chunk-4ZC2WCUO.js.map +1 -0
- package/dist/chunk-7SPRQZ6H.js +216 -0
- package/dist/chunk-7SPRQZ6H.js.map +1 -0
- package/dist/{chunk-25S5EHH4.js → chunk-FYIPXHAE.js} +22 -13
- package/dist/chunk-FYIPXHAE.js.map +1 -0
- package/dist/{chunk-TL27COKM.js → chunk-XTFR3IMK.js} +683 -286
- package/dist/chunk-XTFR3IMK.js.map +1 -0
- package/dist/chunk-XWFU2CSG.js +167 -0
- package/dist/chunk-XWFU2CSG.js.map +1 -0
- package/dist/commands/index.cjs +232 -0
- package/dist/commands/index.cjs.map +1 -0
- package/dist/commands/index.d.cts +69 -0
- package/dist/commands/index.d.ts +69 -0
- package/dist/commands/index.js +13 -0
- package/dist/commands/index.js.map +1 -0
- package/dist/generation/index.cjs +235 -0
- package/dist/generation/index.cjs.map +1 -0
- package/dist/generation/index.d.cts +60 -0
- package/dist/generation/index.d.ts +60 -0
- package/dist/generation/index.js +13 -0
- package/dist/generation/index.js.map +1 -0
- package/dist/image-editor/index.cjs +688 -299
- package/dist/image-editor/index.cjs.map +1 -1
- package/dist/image-editor/index.d.cts +65 -5
- package/dist/image-editor/index.d.ts +65 -5
- package/dist/image-editor/index.js +13 -3
- package/dist/index.cjs +2200 -683
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +201 -23
- package/dist/index.d.ts +201 -23
- package/dist/index.js +743 -129
- package/dist/index.js.map +1 -1
- package/dist/persistence/index.cjs +191 -0
- package/dist/persistence/index.cjs.map +1 -0
- package/dist/persistence/index.d.cts +77 -0
- package/dist/persistence/index.d.ts +77 -0
- package/dist/persistence/index.js +9 -0
- package/dist/persistence/index.js.map +1 -0
- package/dist/spreadsheet/index.cjs +17 -10
- package/dist/spreadsheet/index.cjs.map +1 -1
- package/dist/spreadsheet/index.d.cts +9 -7
- package/dist/spreadsheet/index.d.ts +9 -7
- package/dist/spreadsheet/index.js +1 -1
- package/package.json +26 -2
- package/dist/chunk-25S5EHH4.js.map +0 -1
- package/dist/chunk-TL27COKM.js.map +0 -1
package/dist/index.d.cts
CHANGED
|
@@ -1,15 +1,22 @@
|
|
|
1
1
|
import * as _tiptap_core from '@tiptap/core';
|
|
2
2
|
import { Editor } from '@tiptap/core';
|
|
3
|
-
import { Template, ColorGradient, FileImportOptions, RichTextPresetOptions, RichClipboardOptions, HistoryState, HistoryManager, Command, HistoryManagerOptions, FileImportState, FileImportController, FileImportControllerOptions, PromptValues, OutlineSnapshot, OutlineHeading, EditorSlotsMap, CommentStoreSnapshot, CommentStore, TrackChangesSnapshot, TrackedChange, ReviewAuthor } from '@pixerate/editor';
|
|
4
|
-
export { ColorGradient, Command, DirtyTracker, DirtyTrackerOptions, HistoryManager, HistoryManagerOptions, HistoryState, OutlineHeading, OutlineSnapshot, OutlineTreeItem, PromptDiagnostic, PromptValues, RichTextPresetOptions, Template, TemplateVersion, Token, TokenType, VariableFormField, createDirtyTracker, createHistoryManager, defaultIsEqual } from '@pixerate/editor';
|
|
3
|
+
import { Template, ColorGradient, FileImportOptions, RichTextPresetOptions, RichClipboardOptions, HistoryState, HistoryManager, HistoryEntry, Command, MergedExecutionOptions, HistoryMark, HistoryManagerOptions, DirtyTrackerOptions, DirtyTracker, FileImportState, FileImportController, FileImportControllerOptions, PromptValues, ParseDataSourceOptions, MergeRecordsOptions, MergeRecordsResult, MergeDataSource, MergeRecord, OutlineSnapshot, OutlineHeading, EditorSlotsMap, CommentStoreSnapshot, CommentStore, TrackChangesSnapshot, TrackedChange, ReviewAuthor, CompareSummary, CompareSource, EditorCompareOptions, FindReplaceSnapshot, FindReplaceMode, FindOptions } from '@pixerate/editor';
|
|
4
|
+
export { BindDirtyToHistoryOptions, ColorGradient, Command, CompareSource, CompareSummary, DirtyTracker, DirtyTrackerOptions, EditorCompareOptions, HistoryDirtyBinding, HistoryEntry, HistoryManager, HistoryManagerOptions, HistoryMark, HistoryState, MergeDataSource, MergeOutput, MergeRecord, MergeRecordsResult, MergedExecutionOptions, OutlineHeading, OutlineSnapshot, OutlineTreeItem, PromptDiagnostic, PromptValues, RichTextPresetOptions, Template, TemplateVersion, Token, TokenType, VariableFormField, bindDirtyToHistory, createDirtyTracker, createHistoryManager, defaultIsEqual, withoutDirty } from '@pixerate/editor';
|
|
5
5
|
import { UseEditorOptions, EditorContentProps as EditorContentProps$1 } from '@tiptap/react';
|
|
6
|
+
import { HistoryManager as HistoryManager$1 } from '@pixerate/editor/history';
|
|
6
7
|
import { ToolRegistry, AgentToolProvider } from '@pixerate/editor/agent';
|
|
7
|
-
import
|
|
8
|
+
import React__default from 'react';
|
|
8
9
|
import { BubbleMenuPluginProps } from '@tiptap/extension-bubble-menu';
|
|
9
10
|
export { FormulaHints, FormulaHintsProps, SpreadsheetContextMenu, SpreadsheetContextMenuProps, SpreadsheetEditor, SpreadsheetEditorProps, SpreadsheetGroupRow, SpreadsheetGroupRowProps, useFillHandle, useSpreadsheetClipboard, useSpreadsheetEditor } from './spreadsheet/index.cjs';
|
|
10
|
-
export { ImageEditor, ImageEditorProps, UseImageEditorReturn, useImageEditor } from './image-editor/index.cjs';
|
|
11
|
+
export { AdjustmentLayersPanel, AdjustmentLayersPanelProps, ControlSlider, ControlSliderProps, CurvesEditor, CurvesEditorProps, Histogram, HistogramProps, ImageEditor, ImageEditorProps, UseImageEditorReturn, useImageEditor, useImageHistogram } from './image-editor/index.cjs';
|
|
12
|
+
export { CommandPalette, CommandPaletteProps, UseCommandPaletteOptions, UseCommandPaletteResult, UseCommandShortcutsOptions, useCommandPalette, useCommandShortcuts, useRegisterCommands } from './commands/index.cjs';
|
|
13
|
+
export { RecoveryPrompt, RecoveryPromptProps, UseAutosaveOptions, UseAutosaveResult, useAutosave } from './persistence/index.cjs';
|
|
14
|
+
export { GenerationSettings, GenerationSettingsProps, JobProgress, JobProgressProps, UseJobProgressOptions, useGenerationPlan, useJobProgress } from './generation/index.cjs';
|
|
11
15
|
import '@pixerate/editor/spreadsheet';
|
|
12
16
|
import '@pixerate/editor/image-editor';
|
|
17
|
+
import '@pixerate/editor/commands';
|
|
18
|
+
import '@pixerate/editor/persistence';
|
|
19
|
+
import '@pixerate/editor/generation';
|
|
13
20
|
|
|
14
21
|
interface UsePromptEditorProps {
|
|
15
22
|
/**
|
|
@@ -144,14 +151,23 @@ declare function useDismissGuard({ isDirty, enabled, onDismiss, }: UseDismissGua
|
|
|
144
151
|
|
|
145
152
|
interface UseHistoryResult extends HistoryState {
|
|
146
153
|
manager: HistoryManager;
|
|
154
|
+
/** History panel rows (undo steps, then redo steps). */
|
|
155
|
+
entries: HistoryEntry[];
|
|
147
156
|
undo: () => boolean;
|
|
148
157
|
redo: () => boolean;
|
|
149
158
|
clear: () => void;
|
|
150
159
|
execute: (command: Command) => void;
|
|
151
|
-
executeMerged: (command: Command, options?:
|
|
152
|
-
windowMs?: number;
|
|
153
|
-
}) => void;
|
|
160
|
+
executeMerged: (command: Command, options?: MergedExecutionOptions) => void;
|
|
154
161
|
batch: (name: string, fn: () => void) => void;
|
|
162
|
+
/** Undoes / redoes until the entry at `index` is current (`-1` = before all). */
|
|
163
|
+
goTo: (index: number) => number;
|
|
164
|
+
/** Captures the current point, e.g. when a drag starts. */
|
|
165
|
+
mark: () => HistoryMark;
|
|
166
|
+
/** Takes back every step since `mark` without leaving redo (Escape-cancel). */
|
|
167
|
+
revertTo: (mark: HistoryMark) => number;
|
|
168
|
+
/** Joins every merged execute into one step until `endGesture`. */
|
|
169
|
+
beginGesture: (key: string) => void;
|
|
170
|
+
endGesture: () => void;
|
|
155
171
|
}
|
|
156
172
|
/**
|
|
157
173
|
* React hook that subscribes to a HistoryManager instance.
|
|
@@ -160,6 +176,33 @@ interface UseHistoryResult extends HistoryState {
|
|
|
160
176
|
*/
|
|
161
177
|
declare function useHistory(managerOrOptions?: HistoryManager | HistoryManagerOptions): UseHistoryResult;
|
|
162
178
|
|
|
179
|
+
interface UseHistoryDirtyOptions<T> extends DirtyTrackerOptions<T> {
|
|
180
|
+
/** The history whose changes re-check the document. */
|
|
181
|
+
history: HistoryManager;
|
|
182
|
+
/** Reads the current document value (the latest function is always used). */
|
|
183
|
+
getValue: () => T;
|
|
184
|
+
/** Existing tracker to drive (read on first render only). */
|
|
185
|
+
tracker?: DirtyTracker<T>;
|
|
186
|
+
}
|
|
187
|
+
interface UseHistoryDirtyResult<T> {
|
|
188
|
+
/** Whether the document differs from the saved state. Feed it to `useNavigationGuard`. */
|
|
189
|
+
isDirty: boolean;
|
|
190
|
+
/** Marks the current document as saved. */
|
|
191
|
+
markClean: () => void;
|
|
192
|
+
/** Runs a load / restore without marking the document dirty (re-entrant). */
|
|
193
|
+
suppress: <R>(fn: () => R) => R;
|
|
194
|
+
/** Re-checks after a change made outside the history. */
|
|
195
|
+
refresh: () => boolean;
|
|
196
|
+
tracker: DirtyTracker<T>;
|
|
197
|
+
}
|
|
198
|
+
/**
|
|
199
|
+
* Dirty-vs-saved tracking bound to a HistoryManager: undoing back to the saved
|
|
200
|
+
* state makes the document clean again, selection/viewport changes can be
|
|
201
|
+
* ignored with `normalize`, and programmatic loads can be wrapped in `suppress`.
|
|
202
|
+
* Options other than `getValue` and `history` are read on first render only.
|
|
203
|
+
*/
|
|
204
|
+
declare function useHistoryDirty<T>(options: UseHistoryDirtyOptions<T>): UseHistoryDirtyResult<T>;
|
|
205
|
+
|
|
163
206
|
interface HistoryShortcutsOptions {
|
|
164
207
|
/**
|
|
165
208
|
* Whether the keyboard shortcuts are enabled. Defaults to true.
|
|
@@ -179,7 +222,7 @@ interface HistoryShortcutsOptions {
|
|
|
179
222
|
* Attaches keyboard listeners for Undo (Mod+Z) and Redo (Mod+Shift+Z / Mod+Y).
|
|
180
223
|
* Automatically guards against active text inputs and contenteditable editors.
|
|
181
224
|
*/
|
|
182
|
-
declare function useHistoryShortcuts(manager: HistoryManager, options?: HistoryShortcutsOptions): void;
|
|
225
|
+
declare function useHistoryShortcuts(manager: HistoryManager$1, options?: HistoryShortcutsOptions): void;
|
|
183
226
|
|
|
184
227
|
interface UseFileImportResult extends FileImportState {
|
|
185
228
|
/** Value for `<input type="file" accept={…}>`. */
|
|
@@ -210,18 +253,18 @@ declare function useAgentToolProvider(registry: ToolRegistry | null | undefined,
|
|
|
210
253
|
interface EditorContentProps extends EditorContentProps$1 {
|
|
211
254
|
className?: string;
|
|
212
255
|
}
|
|
213
|
-
declare const EditorContent:
|
|
256
|
+
declare const EditorContent: React__default.FC<EditorContentProps>;
|
|
214
257
|
|
|
215
258
|
interface BubbleMenuProps {
|
|
216
259
|
editor: Editor | null;
|
|
217
260
|
className?: string;
|
|
218
|
-
children:
|
|
261
|
+
children: React__default.ReactNode;
|
|
219
262
|
tippyOptions?: BubbleMenuPluginProps["tippyOptions"];
|
|
220
263
|
shouldShow?: BubbleMenuPluginProps["shouldShow"];
|
|
221
264
|
pluginKey?: BubbleMenuPluginProps["pluginKey"];
|
|
222
265
|
updateDelay?: BubbleMenuPluginProps["updateDelay"];
|
|
223
266
|
}
|
|
224
|
-
declare const BubbleMenu:
|
|
267
|
+
declare const BubbleMenu: React__default.FC<BubbleMenuProps>;
|
|
225
268
|
|
|
226
269
|
interface TemplateRendererProps {
|
|
227
270
|
/** Raw prompt or text string to render */
|
|
@@ -246,7 +289,7 @@ interface TemplateRendererProps {
|
|
|
246
289
|
/** Click callback for variable badges */
|
|
247
290
|
onVariableClick?: (variableName: string) => void;
|
|
248
291
|
}
|
|
249
|
-
declare const TemplateRenderer:
|
|
292
|
+
declare const TemplateRenderer: React__default.FC<TemplateRendererProps>;
|
|
250
293
|
|
|
251
294
|
interface VariableFormProps {
|
|
252
295
|
/** Prompt whose variables become form fields */
|
|
@@ -272,7 +315,83 @@ interface VariableFormProps {
|
|
|
272
315
|
* using its default as the placeholder. Variables only used by `{?name}`
|
|
273
316
|
* conditions render as checkboxes.
|
|
274
317
|
*/
|
|
275
|
-
declare const VariableForm:
|
|
318
|
+
declare const VariableForm: React__default.FC<VariableFormProps>;
|
|
319
|
+
|
|
320
|
+
interface MergePreviewProps {
|
|
321
|
+
/** The prompt merged with each record. */
|
|
322
|
+
content: string;
|
|
323
|
+
templates?: Template[];
|
|
324
|
+
bindings?: Record<string, string>;
|
|
325
|
+
templateColorMap?: Map<string, ColorGradient>;
|
|
326
|
+
/** Initial CSV / TSV / JSON data source text. */
|
|
327
|
+
defaultSource?: string;
|
|
328
|
+
parseOptions?: ParseDataSourceOptions;
|
|
329
|
+
/** Drop records matching this condition (e.g. `"status=void"`) when merging. */
|
|
330
|
+
skipIf?: MergeRecordsOptions["skipIf"];
|
|
331
|
+
/** Separator between merged outputs (default a blank line; `"none"` for nothing). */
|
|
332
|
+
separator?: string;
|
|
333
|
+
maxOutputs?: number;
|
|
334
|
+
/** Called after "Merge all". */
|
|
335
|
+
onMerge?: (result: MergeRecordsResult) => void;
|
|
336
|
+
/** Base file name for downloads (default `merged`). */
|
|
337
|
+
downloadName?: string;
|
|
338
|
+
className?: string;
|
|
339
|
+
}
|
|
340
|
+
/**
|
|
341
|
+
* Mail-merge preview: paste or pick a CSV / JSON data source, check the
|
|
342
|
+
* automatic field mapping, step through records with the resolved prompt
|
|
343
|
+
* shown by `TemplateRenderer`, and merge every record into text or JSON.
|
|
344
|
+
*/
|
|
345
|
+
declare const MergePreview: React__default.FC<MergePreviewProps>;
|
|
346
|
+
|
|
347
|
+
interface UseMergePreviewOptions {
|
|
348
|
+
/** The prompt merged with each record. */
|
|
349
|
+
template: string;
|
|
350
|
+
templates?: Template[];
|
|
351
|
+
bindings?: Record<string, string>;
|
|
352
|
+
/** Initial CSV / TSV / JSON text. */
|
|
353
|
+
initialSource?: string;
|
|
354
|
+
/** How to read the data source text. */
|
|
355
|
+
parseOptions?: ParseDataSourceOptions;
|
|
356
|
+
/** Passed to `mergeRecords` by `merge()`. */
|
|
357
|
+
skipIf?: MergeRecordsOptions["skipIf"];
|
|
358
|
+
separator?: string;
|
|
359
|
+
maxOutputs?: number;
|
|
360
|
+
}
|
|
361
|
+
interface MergePreviewState {
|
|
362
|
+
sourceText: string;
|
|
363
|
+
setSourceText: (text: string) => void;
|
|
364
|
+
/** Reads a picked file (CSV, TSV or JSON) into `sourceText`. */
|
|
365
|
+
loadFile: (file: Blob) => Promise<void>;
|
|
366
|
+
source: MergeDataSource;
|
|
367
|
+
/** Variable names the template uses, in order. */
|
|
368
|
+
variables: string[];
|
|
369
|
+
/** Variable → field: automatic matches with the user's overrides applied. */
|
|
370
|
+
mapping: Record<string, string | null>;
|
|
371
|
+
setFieldMapping: (variable: string, field: string | null) => void;
|
|
372
|
+
resetMapping: () => void;
|
|
373
|
+
/** 0-based index of the previewed record. */
|
|
374
|
+
index: number;
|
|
375
|
+
count: number;
|
|
376
|
+
setIndex: (index: number) => void;
|
|
377
|
+
next: () => void;
|
|
378
|
+
prev: () => void;
|
|
379
|
+
record: MergeRecord | undefined;
|
|
380
|
+
/** Prompt values for the previewed record. */
|
|
381
|
+
values: PromptValues;
|
|
382
|
+
/** Merges every record with the current mapping and stores the result. */
|
|
383
|
+
merge: () => MergeRecordsResult;
|
|
384
|
+
result: MergeRecordsResult | null;
|
|
385
|
+
/** The last merge's outputs as text or JSON. */
|
|
386
|
+
serialize: (format: "text" | "json") => string;
|
|
387
|
+
}
|
|
388
|
+
/**
|
|
389
|
+
* Headless state for a mail-merge preview (the counterpart of Svelte's
|
|
390
|
+
* `createMergePreview`): parses a pasted or loaded data source, matches its
|
|
391
|
+
* fields to the template's variables (editable), steps through records and
|
|
392
|
+
* merges them all with `mergeRecords`.
|
|
393
|
+
*/
|
|
394
|
+
declare function useMergePreview(options: UseMergePreviewOptions): MergePreviewState;
|
|
276
395
|
|
|
277
396
|
/**
|
|
278
397
|
* Subscribes to an editor's heading outline. Returns the headings (flat and
|
|
@@ -287,9 +406,9 @@ declare function useOutline(editor: Editor | null | undefined): OutlineSnapshot;
|
|
|
287
406
|
interface OutlinePanelProps {
|
|
288
407
|
editor: Editor | null;
|
|
289
408
|
/** Heading shown above the list. Pass `null` to hide it. */
|
|
290
|
-
title?:
|
|
409
|
+
title?: React__default.ReactNode;
|
|
291
410
|
/** Content shown when the document has no headings. */
|
|
292
|
-
emptyState?:
|
|
411
|
+
emptyState?: React__default.ReactNode;
|
|
293
412
|
/** Deepest heading level listed. Defaults to 6. */
|
|
294
413
|
maxLevel?: number;
|
|
295
414
|
/** Whether clicking an entry focuses the editor. Defaults to `true`. */
|
|
@@ -308,16 +427,16 @@ interface OutlinePanelProps {
|
|
|
308
427
|
* Clicking an entry moves the caret to that heading; the entry for the
|
|
309
428
|
* section containing the selection is highlighted.
|
|
310
429
|
*/
|
|
311
|
-
declare const OutlinePanel:
|
|
430
|
+
declare const OutlinePanel: React__default.FC<OutlinePanelProps>;
|
|
312
431
|
|
|
313
432
|
interface EditorSlotsProviderProps {
|
|
314
433
|
slots?: Partial<EditorSlotsMap>;
|
|
315
|
-
children:
|
|
434
|
+
children: React__default.ReactNode;
|
|
316
435
|
}
|
|
317
436
|
/**
|
|
318
437
|
* Context provider allowing consumers to inject custom design system components into the editor.
|
|
319
438
|
*/
|
|
320
|
-
declare function EditorSlotsProvider({ slots, children }: EditorSlotsProviderProps):
|
|
439
|
+
declare function EditorSlotsProvider({ slots, children }: EditorSlotsProviderProps): React__default.JSX.Element;
|
|
321
440
|
/**
|
|
322
441
|
* Hook to access injected design system slots.
|
|
323
442
|
*/
|
|
@@ -365,7 +484,7 @@ interface CommentsPanelProps {
|
|
|
365
484
|
* thread selects its text in the editor. Threads with an empty body are
|
|
366
485
|
* drafts (e.g. created by `CommentButton`) and show a compose box.
|
|
367
486
|
*/
|
|
368
|
-
declare const CommentsPanel:
|
|
487
|
+
declare const CommentsPanel: React__default.FC<CommentsPanelProps>;
|
|
369
488
|
|
|
370
489
|
interface ReviewToolbarProps {
|
|
371
490
|
editor: Editor | null;
|
|
@@ -384,17 +503,76 @@ interface ReviewToolbarProps {
|
|
|
384
503
|
* of the current one), and accept or reject the current change or all
|
|
385
504
|
* changes.
|
|
386
505
|
*/
|
|
387
|
-
declare const ReviewToolbar:
|
|
506
|
+
declare const ReviewToolbar: React__default.FC<ReviewToolbarProps>;
|
|
388
507
|
|
|
389
508
|
interface CommentButtonProps {
|
|
390
509
|
editor: Editor | null;
|
|
391
510
|
className?: string;
|
|
392
|
-
children?:
|
|
511
|
+
children?: React__default.ReactNode;
|
|
393
512
|
}
|
|
394
513
|
/**
|
|
395
514
|
* Adds a draft comment on the selection; drop it into a `BubbleMenu`. The
|
|
396
515
|
* draft is completed in `CommentsPanel`.
|
|
397
516
|
*/
|
|
398
|
-
declare const CommentButton:
|
|
517
|
+
declare const CommentButton: React__default.FC<CommentButtonProps>;
|
|
518
|
+
|
|
519
|
+
interface UseDocumentCompareResult {
|
|
520
|
+
/** Summary of the last comparison, or `null`. */
|
|
521
|
+
summary: CompareSummary | null;
|
|
522
|
+
/**
|
|
523
|
+
* Replaces the editor content with the comparison of two versions (nodes,
|
|
524
|
+
* JSON or HTML) as tracked changes, ready to review with `ReviewToolbar`.
|
|
525
|
+
* Returns the summary, or `null` without an editor.
|
|
526
|
+
*/
|
|
527
|
+
compare: (original: CompareSource, revised: CompareSource, options?: EditorCompareOptions) => CompareSummary | null;
|
|
528
|
+
/** Forgets the last summary. */
|
|
529
|
+
clear: () => void;
|
|
530
|
+
}
|
|
531
|
+
/**
|
|
532
|
+
* Compare two document versions into an editor using `TrackChanges`.
|
|
533
|
+
* `options` are defaults for every comparison.
|
|
534
|
+
*/
|
|
535
|
+
declare function useDocumentCompare(editor: Editor | null | undefined, options?: EditorCompareOptions): UseDocumentCompareResult;
|
|
536
|
+
|
|
537
|
+
interface UseFindReplaceResult extends FindReplaceSnapshot {
|
|
538
|
+
/** Whether the editor has the `FindReplace` extension. */
|
|
539
|
+
available: boolean;
|
|
540
|
+
matchCount: number;
|
|
541
|
+
open: boolean;
|
|
542
|
+
show: (mode?: FindReplaceMode) => void;
|
|
543
|
+
close: () => void;
|
|
544
|
+
setQuery: (query: string) => void;
|
|
545
|
+
setReplacement: (replacement: string) => void;
|
|
546
|
+
setOptions: (options: Partial<FindOptions>) => void;
|
|
547
|
+
toggleOption: (option: keyof FindOptions) => void;
|
|
548
|
+
next: () => void;
|
|
549
|
+
previous: () => void;
|
|
550
|
+
replace: () => void;
|
|
551
|
+
replaceAll: () => void;
|
|
552
|
+
clear: () => void;
|
|
553
|
+
}
|
|
554
|
+
/**
|
|
555
|
+
* Subscribes to an editor's Find and Replace state (`FindReplace` extension)
|
|
556
|
+
* and exposes its commands.
|
|
557
|
+
*/
|
|
558
|
+
declare function useFindReplace(editor: Editor | null | undefined): UseFindReplaceResult;
|
|
559
|
+
|
|
560
|
+
interface FindReplaceBarProps {
|
|
561
|
+
editor: Editor | null;
|
|
562
|
+
className?: string;
|
|
563
|
+
/** Render even while the find state is closed (default: only after Mod+F / Mod+H / `openFindReplace`). */
|
|
564
|
+
alwaysOpen?: boolean;
|
|
565
|
+
/** Show the "More options" toggle (prefix, suffix, ignore punctuation/white space, literal). Default `true`. */
|
|
566
|
+
showMoreOptions?: boolean;
|
|
567
|
+
/** Called after the bar closes (Escape or the close button). */
|
|
568
|
+
onClose?: () => void;
|
|
569
|
+
}
|
|
570
|
+
/**
|
|
571
|
+
* Word-style find bar for an editor using the `FindReplace` extension: find
|
|
572
|
+
* and replace fields, option toggles, "3 of 12" counter, previous/next,
|
|
573
|
+
* Replace and Replace All. Enter / Shift+Enter step through matches, Enter in
|
|
574
|
+
* the replace field replaces, Mod+Enter replaces all, Escape closes.
|
|
575
|
+
*/
|
|
576
|
+
declare const FindReplaceBar: React__default.FC<FindReplaceBarProps>;
|
|
399
577
|
|
|
400
|
-
export { BubbleMenu, type BubbleMenuProps, CommentButton, type CommentButtonProps, CommentsPanel, type CommentsPanelProps, EditorContent, type EditorContentProps, EditorSlotsProvider, type EditorSlotsProviderProps, type HistoryShortcutsOptions, OutlinePanel, type OutlinePanelProps, ReviewToolbar, type ReviewToolbarProps, TemplateRenderer, type TemplateRendererProps, type UseCommentsResult, type UseDismissGuardOptions, type UseDismissGuardReturn, type UseFileImportResult, type UseHistoryResult, type UseNavigationGuardOptions, type UseNavigationGuardReturn, type UsePromptEditorProps, type UseRichEditorProps, type UseTrackChangesResult, VariableForm, type VariableFormProps, useAgentToolProvider, useComments, useDismissGuard, useEditor, useEditorSlots, useFileImport, useHistory, useHistoryShortcuts, useNavigationGuard, useOutline, usePromptEditor, useTrackChanges };
|
|
578
|
+
export { BubbleMenu, type BubbleMenuProps, CommentButton, type CommentButtonProps, CommentsPanel, type CommentsPanelProps, EditorContent, type EditorContentProps, EditorSlotsProvider, type EditorSlotsProviderProps, FindReplaceBar, type FindReplaceBarProps, type HistoryShortcutsOptions, MergePreview, type MergePreviewProps, type MergePreviewState, OutlinePanel, type OutlinePanelProps, ReviewToolbar, type ReviewToolbarProps, TemplateRenderer, type TemplateRendererProps, type UseCommentsResult, type UseDismissGuardOptions, type UseDismissGuardReturn, type UseDocumentCompareResult, type UseFileImportResult, type UseFindReplaceResult, type UseHistoryDirtyOptions, type UseHistoryDirtyResult, type UseHistoryResult, type UseMergePreviewOptions, type UseNavigationGuardOptions, type UseNavigationGuardReturn, type UsePromptEditorProps, type UseRichEditorProps, type UseTrackChangesResult, VariableForm, type VariableFormProps, useAgentToolProvider, useComments, useDismissGuard, useDocumentCompare, useEditor, useEditorSlots, useFileImport, useFindReplace, useHistory, useHistoryDirty, useHistoryShortcuts, useMergePreview, useNavigationGuard, useOutline, usePromptEditor, useTrackChanges };
|