@pixerate/editor-react 0.17.0 → 0.18.1
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 +3 -1
- package/dist/canvas/index.cjs +880 -193
- package/dist/canvas/index.cjs.map +1 -1
- package/dist/canvas/index.d.cts +214 -3
- package/dist/canvas/index.d.ts +214 -3
- package/dist/canvas/index.js +699 -0
- package/dist/canvas/index.js.map +1 -1
- package/dist/{chunk-JR5ZBDR7.js → chunk-34HEZX7J.js} +206 -74
- package/dist/chunk-34HEZX7J.js.map +1 -0
- package/dist/index.cjs +1437 -1109
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +104 -5
- package/dist/index.d.ts +104 -5
- package/dist/index.js +350 -146
- package/dist/index.js.map +1 -1
- package/dist/spreadsheet/index.cjs +261 -135
- package/dist/spreadsheet/index.cjs.map +1 -1
- package/dist/spreadsheet/index.d.cts +39 -3
- package/dist/spreadsheet/index.d.ts +39 -3
- package/dist/spreadsheet/index.js +5 -3
- package/package.json +2 -2
- package/dist/chunk-JR5ZBDR7.js.map +0 -1
package/dist/index.d.cts
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
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, HistoryEntry, Command, MergedExecutionOptions, HistoryMark, HistoryManagerOptions, DirtyTrackerOptions, DirtyTracker, FileImportState, ImportStructureSummary, FileImportController, FileImportControllerOptions, PromptValues, ParseDataSourceOptions, MergeRecordsOptions, MergeRecordsResult, MergeDataSource, MergeRecord, OutlineSnapshot, OutlineHeading, ParagraphStylesSnapshot, StyleRegistry, StyleDefinition, CreateStyleFromSelectionOptions, 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, ParagraphStylesSnapshot, PromptDiagnostic, PromptValues, RichTextPresetOptions, StyleDefinition, Template, TemplateVersion, Token, TokenType, VariableFormField, bindDirtyToHistory, createDirtyTracker, createHistoryManager, defaultIsEqual, withoutDirty } from '@pixerate/editor';
|
|
3
|
+
import { Template, ColorGradient, FileImportOptions, RichTextPresetOptions, RichClipboardOptions, HistoryState, HistoryManager, HistoryEntry, Command, MergedExecutionOptions, HistoryMark, HistoryManagerOptions, DirtyTrackerOptions, DirtyTracker, FileImportState, ImportStructureSummary, FileImportController, FileImportControllerOptions, PromptValues, ParseDataSourceOptions, MergeRecordsOptions, MergeRecordsResult, MergeDataSource, MergeRecord, OutlineSnapshot, OutlineHeading, ParagraphStylesSnapshot, StyleRegistry, StyleDefinition, CreateStyleFromSelectionOptions, EditorSlotsMap, CommentStoreSnapshot, CommentStore, TrackChangesSnapshot, TrackedChange, ReviewAuthor, CompareSummary, CompareSource, EditorCompareOptions, FindReplaceSnapshot, FindReplaceMode, FindOptions, TableState, TableAction, TableActionParams, TableToolbarItem } 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, ParagraphStylesSnapshot, PromptDiagnostic, PromptValues, RichTextPresetOptions, StyleDefinition, TableAction, TableActionParams, TableState, 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
6
|
import { HistoryManager as HistoryManager$1 } from '@pixerate/editor/history';
|
|
7
|
-
import {
|
|
7
|
+
import { DocxExportState, DocxExportReport, DocxExportController, DocxExportControllerOptions } from '@pixerate/editor/export';
|
|
8
8
|
import React__default from 'react';
|
|
9
|
+
import { ToolRegistry, AgentToolProvider } from '@pixerate/editor/agent';
|
|
9
10
|
import { BubbleMenuPluginProps } from '@tiptap/extension-bubble-menu';
|
|
10
|
-
export { FormulaHints, FormulaHintsProps, NameManager, NameManagerProps, SheetTabs, SheetTabsProps, SpreadsheetConditionalFormatPanel, SpreadsheetContextMenu, SpreadsheetContextMenuProps, SpreadsheetDataValidationPanel, SpreadsheetEditor, SpreadsheetEditorProps, SpreadsheetGroupRow, SpreadsheetGroupRowProps, SpreadsheetRulePanelProps, SpreadsheetValidationDialog, SpreadsheetValidationDialogProps, useFillHandle, useSpreadsheetClipboard, useSpreadsheetEditor } from './spreadsheet/index.cjs';
|
|
11
|
+
export { FormulaHints, FormulaHintsProps, NameManager, NameManagerProps, SheetTabs, SheetTabsProps, SpreadsheetConditionalFormatPanel, SpreadsheetContextMenu, SpreadsheetContextMenuProps, SpreadsheetDataValidationPanel, SpreadsheetEditor, SpreadsheetEditorProps, SpreadsheetGroupRow, SpreadsheetGroupRowProps, SpreadsheetRulePanelProps, SpreadsheetValidationDialog, SpreadsheetValidationDialogProps, SpreadsheetViewportOptions, SpreadsheetViewportState, useFillHandle, useSpreadsheetClipboard, useSpreadsheetEditor, useSpreadsheetViewport } from './spreadsheet/index.cjs';
|
|
11
12
|
export { AdjustmentLayersPanel, AdjustmentLayersPanelProps, ControlSlider, ControlSliderProps, CurvesEditor, CurvesEditorProps, Histogram, HistogramProps, ImageEditor, ImageEditorProps, RefineEdgePanel, RefineEdgePanelProps, SelectionOptionsBar, SelectionOptionsBarProps, UseImageEditorReturn, useImageEditor, useImageHistogram } from './image-editor/index.cjs';
|
|
12
13
|
export { CommandPalette, CommandPaletteProps, UseCommandPaletteOptions, UseCommandPaletteResult, UseCommandShortcutsOptions, useCommandPalette, useCommandShortcuts, useRegisterCommands } from './commands/index.cjs';
|
|
13
14
|
export { RecoveryPrompt, RecoveryPromptProps, UseAutosaveOptions, UseAutosaveResult, useAutosave } from './persistence/index.cjs';
|
|
@@ -246,6 +247,29 @@ interface UseFileImportResult extends FileImportState {
|
|
|
246
247
|
*/
|
|
247
248
|
declare function useFileImport(editor: Editor | null | undefined, options?: FileImportControllerOptions): UseFileImportResult;
|
|
248
249
|
|
|
250
|
+
interface UseDocxExportResult extends DocxExportState {
|
|
251
|
+
/** Exports the editor (with its comments, tracked changes and styles) and downloads the `.docx`. */
|
|
252
|
+
download: (fileName?: string) => Promise<DocxExportReport | null>;
|
|
253
|
+
/** Builds the `.docx` without downloading it. */
|
|
254
|
+
exportBlob: DocxExportController["exportBlob"];
|
|
255
|
+
}
|
|
256
|
+
/**
|
|
257
|
+
* "Export to Word": downloads the editor's document as a `.docx` with its
|
|
258
|
+
* comments (from the `Comments` store), tracked changes and paragraph styles.
|
|
259
|
+
* `lastReport` lists anything the export had to leave out.
|
|
260
|
+
*/
|
|
261
|
+
declare function useDocxExport(editor: Editor | null | undefined, options?: DocxExportControllerOptions): UseDocxExportResult;
|
|
262
|
+
|
|
263
|
+
interface ExportDocxButtonProps extends DocxExportControllerOptions {
|
|
264
|
+
editor: Editor | null;
|
|
265
|
+
className?: string;
|
|
266
|
+
children?: React__default.ReactNode;
|
|
267
|
+
/** Called after the download with the export report. */
|
|
268
|
+
onExported?: (report: DocxExportReport) => void;
|
|
269
|
+
}
|
|
270
|
+
/** A button that downloads the editor's document as a Word file (`.docx`). */
|
|
271
|
+
declare const ExportDocxButton: React__default.FC<ExportDocxButtonProps>;
|
|
272
|
+
|
|
249
273
|
/**
|
|
250
274
|
* Registers a tool provider with a `ToolRegistry` while the component is
|
|
251
275
|
* mounted and unregisters it on unmount (the registry then announces the
|
|
@@ -657,4 +681,79 @@ interface FindReplaceBarProps {
|
|
|
657
681
|
*/
|
|
658
682
|
declare const FindReplaceBar: React__default.FC<FindReplaceBarProps>;
|
|
659
683
|
|
|
660
|
-
|
|
684
|
+
interface UseTableMenuResult extends TableState {
|
|
685
|
+
/** Runs a table action (focusing the editor); `false` when it cannot run. */
|
|
686
|
+
run: (action: TableAction, params?: TableActionParams) => boolean;
|
|
687
|
+
/** `true`, or why the action cannot run with these params. */
|
|
688
|
+
check: (action: TableAction, params?: TableActionParams) => true | string;
|
|
689
|
+
}
|
|
690
|
+
/**
|
|
691
|
+
* Subscribes to the table at the editor's selection: whether the selection
|
|
692
|
+
* is in a table, its size, header state, the cell's alignment and
|
|
693
|
+
* background, and the enablement (with reasons) of every table action.
|
|
694
|
+
* Re-renders only when that state changes. The Svelte counterpart is
|
|
695
|
+
* `createTableMenu`.
|
|
696
|
+
*/
|
|
697
|
+
declare function useTableMenu(editor: Editor | null | undefined): UseTableMenuResult;
|
|
698
|
+
|
|
699
|
+
interface TableToolbarProps {
|
|
700
|
+
editor: Editor | null;
|
|
701
|
+
/** Buttons to show (default `DEFAULT_TABLE_TOOLBAR`). */
|
|
702
|
+
items?: readonly TableToolbarItem[];
|
|
703
|
+
/** Render (with disabled buttons) when the selection is not in a table. Default `false`. */
|
|
704
|
+
showWhenOutside?: boolean;
|
|
705
|
+
className?: string;
|
|
706
|
+
buttonClassName?: string;
|
|
707
|
+
activeButtonClassName?: string;
|
|
708
|
+
separatorClassName?: string;
|
|
709
|
+
/** Called after a button ran its action. */
|
|
710
|
+
onAction?: (item: TableToolbarItem) => void;
|
|
711
|
+
}
|
|
712
|
+
/**
|
|
713
|
+
* Table toolbar: insert/delete rows and columns, merge/split cells, header
|
|
714
|
+
* toggles, cell alignment and delete table. Rendered only while the
|
|
715
|
+
* selection is in a table (unless `showWhenOutside`); disabled buttons say
|
|
716
|
+
* why in their tooltip. Use it inline, or inside `TableBubbleMenu`.
|
|
717
|
+
*/
|
|
718
|
+
declare const TableToolbar: React__default.FC<TableToolbarProps>;
|
|
719
|
+
|
|
720
|
+
interface InsertTableGridProps {
|
|
721
|
+
editor: Editor | null;
|
|
722
|
+
/** Grid size offered (default 8 × 8). */
|
|
723
|
+
rows?: number;
|
|
724
|
+
cols?: number;
|
|
725
|
+
/** Insert with a header row (default `true`). */
|
|
726
|
+
withHeaderRow?: boolean;
|
|
727
|
+
className?: string;
|
|
728
|
+
cellClassName?: string;
|
|
729
|
+
activeCellClassName?: string;
|
|
730
|
+
/** Called after a table was inserted. */
|
|
731
|
+
onInsert?: (size: {
|
|
732
|
+
rows: number;
|
|
733
|
+
cols: number;
|
|
734
|
+
}) => void;
|
|
735
|
+
}
|
|
736
|
+
/**
|
|
737
|
+
* Word-style insert-table picker: hover (or focus) a cell of the grid to
|
|
738
|
+
* choose the size, click to insert a table of that size at the cursor. The
|
|
739
|
+
* grid is disabled (with the reason as its title) where a table cannot be
|
|
740
|
+
* inserted, e.g. inside another table.
|
|
741
|
+
*/
|
|
742
|
+
declare const InsertTableGrid: React__default.FC<InsertTableGridProps>;
|
|
743
|
+
|
|
744
|
+
interface TableBubbleMenuProps extends Omit<BubbleMenuProps, "editor" | "children" | "shouldShow"> {
|
|
745
|
+
editor: Editor | null;
|
|
746
|
+
/** Custom content (default: a `TableToolbar`). */
|
|
747
|
+
children?: React__default.ReactNode;
|
|
748
|
+
/** Props for the default `TableToolbar`. */
|
|
749
|
+
toolbarProps?: Omit<TableToolbarProps, "editor">;
|
|
750
|
+
}
|
|
751
|
+
/**
|
|
752
|
+
* A bubble menu that follows the selection while it is in a table (even a
|
|
753
|
+
* collapsed cursor), with the table toolbar or your own `children`. It uses
|
|
754
|
+
* its own plugin key (`tableBubbleMenu`), so it can be combined with the
|
|
755
|
+
* formatting `BubbleMenu`.
|
|
756
|
+
*/
|
|
757
|
+
declare const TableBubbleMenu: React__default.FC<TableBubbleMenuProps>;
|
|
758
|
+
|
|
759
|
+
export { BubbleMenu, type BubbleMenuProps, CommentButton, type CommentButtonProps, CommentsPanel, type CommentsPanelProps, EditorContent, type EditorContentProps, EditorSlotsProvider, type EditorSlotsProviderProps, ExportDocxButton, type ExportDocxButtonProps, FindReplaceBar, type FindReplaceBarProps, type HistoryShortcutsOptions, InsertTableGrid, type InsertTableGridProps, MergePreview, type MergePreviewProps, type MergePreviewState, OutlinePanel, type OutlinePanelProps, ReviewToolbar, type ReviewToolbarProps, StylesGallery, type StylesGalleryProps, TableBubbleMenu, type TableBubbleMenuProps, TableToolbar, type TableToolbarProps, TemplateRenderer, type TemplateRendererProps, TrackedChangesList, type TrackedChangesListProps, type UseCommentsResult, type UseDismissGuardOptions, type UseDismissGuardReturn, type UseDocumentCompareResult, type UseDocxExportResult, type UseFileImportResult, type UseFindReplaceResult, type UseHistoryDirtyOptions, type UseHistoryDirtyResult, type UseHistoryResult, type UseMergePreviewOptions, type UseNavigationGuardOptions, type UseNavigationGuardReturn, type UseParagraphStylesResult, type UsePromptEditorProps, type UseRichEditorProps, type UseTableMenuResult, type UseTrackChangesResult, VariableForm, type VariableFormProps, useAgentToolProvider, useComments, useDismissGuard, useDocumentCompare, useDocxExport, useEditor, useEditorSlots, useFileImport, useFindReplace, useHistory, useHistoryDirty, useHistoryShortcuts, useMergePreview, useNavigationGuard, useOutline, useParagraphStyles, usePromptEditor, useTableMenu, useTrackChanges };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
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, HistoryEntry, Command, MergedExecutionOptions, HistoryMark, HistoryManagerOptions, DirtyTrackerOptions, DirtyTracker, FileImportState, ImportStructureSummary, FileImportController, FileImportControllerOptions, PromptValues, ParseDataSourceOptions, MergeRecordsOptions, MergeRecordsResult, MergeDataSource, MergeRecord, OutlineSnapshot, OutlineHeading, ParagraphStylesSnapshot, StyleRegistry, StyleDefinition, CreateStyleFromSelectionOptions, 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, ParagraphStylesSnapshot, PromptDiagnostic, PromptValues, RichTextPresetOptions, StyleDefinition, Template, TemplateVersion, Token, TokenType, VariableFormField, bindDirtyToHistory, createDirtyTracker, createHistoryManager, defaultIsEqual, withoutDirty } from '@pixerate/editor';
|
|
3
|
+
import { Template, ColorGradient, FileImportOptions, RichTextPresetOptions, RichClipboardOptions, HistoryState, HistoryManager, HistoryEntry, Command, MergedExecutionOptions, HistoryMark, HistoryManagerOptions, DirtyTrackerOptions, DirtyTracker, FileImportState, ImportStructureSummary, FileImportController, FileImportControllerOptions, PromptValues, ParseDataSourceOptions, MergeRecordsOptions, MergeRecordsResult, MergeDataSource, MergeRecord, OutlineSnapshot, OutlineHeading, ParagraphStylesSnapshot, StyleRegistry, StyleDefinition, CreateStyleFromSelectionOptions, EditorSlotsMap, CommentStoreSnapshot, CommentStore, TrackChangesSnapshot, TrackedChange, ReviewAuthor, CompareSummary, CompareSource, EditorCompareOptions, FindReplaceSnapshot, FindReplaceMode, FindOptions, TableState, TableAction, TableActionParams, TableToolbarItem } 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, ParagraphStylesSnapshot, PromptDiagnostic, PromptValues, RichTextPresetOptions, StyleDefinition, TableAction, TableActionParams, TableState, 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
6
|
import { HistoryManager as HistoryManager$1 } from '@pixerate/editor/history';
|
|
7
|
-
import {
|
|
7
|
+
import { DocxExportState, DocxExportReport, DocxExportController, DocxExportControllerOptions } from '@pixerate/editor/export';
|
|
8
8
|
import React__default from 'react';
|
|
9
|
+
import { ToolRegistry, AgentToolProvider } from '@pixerate/editor/agent';
|
|
9
10
|
import { BubbleMenuPluginProps } from '@tiptap/extension-bubble-menu';
|
|
10
|
-
export { FormulaHints, FormulaHintsProps, NameManager, NameManagerProps, SheetTabs, SheetTabsProps, SpreadsheetConditionalFormatPanel, SpreadsheetContextMenu, SpreadsheetContextMenuProps, SpreadsheetDataValidationPanel, SpreadsheetEditor, SpreadsheetEditorProps, SpreadsheetGroupRow, SpreadsheetGroupRowProps, SpreadsheetRulePanelProps, SpreadsheetValidationDialog, SpreadsheetValidationDialogProps, useFillHandle, useSpreadsheetClipboard, useSpreadsheetEditor } from './spreadsheet/index.js';
|
|
11
|
+
export { FormulaHints, FormulaHintsProps, NameManager, NameManagerProps, SheetTabs, SheetTabsProps, SpreadsheetConditionalFormatPanel, SpreadsheetContextMenu, SpreadsheetContextMenuProps, SpreadsheetDataValidationPanel, SpreadsheetEditor, SpreadsheetEditorProps, SpreadsheetGroupRow, SpreadsheetGroupRowProps, SpreadsheetRulePanelProps, SpreadsheetValidationDialog, SpreadsheetValidationDialogProps, SpreadsheetViewportOptions, SpreadsheetViewportState, useFillHandle, useSpreadsheetClipboard, useSpreadsheetEditor, useSpreadsheetViewport } from './spreadsheet/index.js';
|
|
11
12
|
export { AdjustmentLayersPanel, AdjustmentLayersPanelProps, ControlSlider, ControlSliderProps, CurvesEditor, CurvesEditorProps, Histogram, HistogramProps, ImageEditor, ImageEditorProps, RefineEdgePanel, RefineEdgePanelProps, SelectionOptionsBar, SelectionOptionsBarProps, UseImageEditorReturn, useImageEditor, useImageHistogram } from './image-editor/index.js';
|
|
12
13
|
export { CommandPalette, CommandPaletteProps, UseCommandPaletteOptions, UseCommandPaletteResult, UseCommandShortcutsOptions, useCommandPalette, useCommandShortcuts, useRegisterCommands } from './commands/index.js';
|
|
13
14
|
export { RecoveryPrompt, RecoveryPromptProps, UseAutosaveOptions, UseAutosaveResult, useAutosave } from './persistence/index.js';
|
|
@@ -246,6 +247,29 @@ interface UseFileImportResult extends FileImportState {
|
|
|
246
247
|
*/
|
|
247
248
|
declare function useFileImport(editor: Editor | null | undefined, options?: FileImportControllerOptions): UseFileImportResult;
|
|
248
249
|
|
|
250
|
+
interface UseDocxExportResult extends DocxExportState {
|
|
251
|
+
/** Exports the editor (with its comments, tracked changes and styles) and downloads the `.docx`. */
|
|
252
|
+
download: (fileName?: string) => Promise<DocxExportReport | null>;
|
|
253
|
+
/** Builds the `.docx` without downloading it. */
|
|
254
|
+
exportBlob: DocxExportController["exportBlob"];
|
|
255
|
+
}
|
|
256
|
+
/**
|
|
257
|
+
* "Export to Word": downloads the editor's document as a `.docx` with its
|
|
258
|
+
* comments (from the `Comments` store), tracked changes and paragraph styles.
|
|
259
|
+
* `lastReport` lists anything the export had to leave out.
|
|
260
|
+
*/
|
|
261
|
+
declare function useDocxExport(editor: Editor | null | undefined, options?: DocxExportControllerOptions): UseDocxExportResult;
|
|
262
|
+
|
|
263
|
+
interface ExportDocxButtonProps extends DocxExportControllerOptions {
|
|
264
|
+
editor: Editor | null;
|
|
265
|
+
className?: string;
|
|
266
|
+
children?: React__default.ReactNode;
|
|
267
|
+
/** Called after the download with the export report. */
|
|
268
|
+
onExported?: (report: DocxExportReport) => void;
|
|
269
|
+
}
|
|
270
|
+
/** A button that downloads the editor's document as a Word file (`.docx`). */
|
|
271
|
+
declare const ExportDocxButton: React__default.FC<ExportDocxButtonProps>;
|
|
272
|
+
|
|
249
273
|
/**
|
|
250
274
|
* Registers a tool provider with a `ToolRegistry` while the component is
|
|
251
275
|
* mounted and unregisters it on unmount (the registry then announces the
|
|
@@ -657,4 +681,79 @@ interface FindReplaceBarProps {
|
|
|
657
681
|
*/
|
|
658
682
|
declare const FindReplaceBar: React__default.FC<FindReplaceBarProps>;
|
|
659
683
|
|
|
660
|
-
|
|
684
|
+
interface UseTableMenuResult extends TableState {
|
|
685
|
+
/** Runs a table action (focusing the editor); `false` when it cannot run. */
|
|
686
|
+
run: (action: TableAction, params?: TableActionParams) => boolean;
|
|
687
|
+
/** `true`, or why the action cannot run with these params. */
|
|
688
|
+
check: (action: TableAction, params?: TableActionParams) => true | string;
|
|
689
|
+
}
|
|
690
|
+
/**
|
|
691
|
+
* Subscribes to the table at the editor's selection: whether the selection
|
|
692
|
+
* is in a table, its size, header state, the cell's alignment and
|
|
693
|
+
* background, and the enablement (with reasons) of every table action.
|
|
694
|
+
* Re-renders only when that state changes. The Svelte counterpart is
|
|
695
|
+
* `createTableMenu`.
|
|
696
|
+
*/
|
|
697
|
+
declare function useTableMenu(editor: Editor | null | undefined): UseTableMenuResult;
|
|
698
|
+
|
|
699
|
+
interface TableToolbarProps {
|
|
700
|
+
editor: Editor | null;
|
|
701
|
+
/** Buttons to show (default `DEFAULT_TABLE_TOOLBAR`). */
|
|
702
|
+
items?: readonly TableToolbarItem[];
|
|
703
|
+
/** Render (with disabled buttons) when the selection is not in a table. Default `false`. */
|
|
704
|
+
showWhenOutside?: boolean;
|
|
705
|
+
className?: string;
|
|
706
|
+
buttonClassName?: string;
|
|
707
|
+
activeButtonClassName?: string;
|
|
708
|
+
separatorClassName?: string;
|
|
709
|
+
/** Called after a button ran its action. */
|
|
710
|
+
onAction?: (item: TableToolbarItem) => void;
|
|
711
|
+
}
|
|
712
|
+
/**
|
|
713
|
+
* Table toolbar: insert/delete rows and columns, merge/split cells, header
|
|
714
|
+
* toggles, cell alignment and delete table. Rendered only while the
|
|
715
|
+
* selection is in a table (unless `showWhenOutside`); disabled buttons say
|
|
716
|
+
* why in their tooltip. Use it inline, or inside `TableBubbleMenu`.
|
|
717
|
+
*/
|
|
718
|
+
declare const TableToolbar: React__default.FC<TableToolbarProps>;
|
|
719
|
+
|
|
720
|
+
interface InsertTableGridProps {
|
|
721
|
+
editor: Editor | null;
|
|
722
|
+
/** Grid size offered (default 8 × 8). */
|
|
723
|
+
rows?: number;
|
|
724
|
+
cols?: number;
|
|
725
|
+
/** Insert with a header row (default `true`). */
|
|
726
|
+
withHeaderRow?: boolean;
|
|
727
|
+
className?: string;
|
|
728
|
+
cellClassName?: string;
|
|
729
|
+
activeCellClassName?: string;
|
|
730
|
+
/** Called after a table was inserted. */
|
|
731
|
+
onInsert?: (size: {
|
|
732
|
+
rows: number;
|
|
733
|
+
cols: number;
|
|
734
|
+
}) => void;
|
|
735
|
+
}
|
|
736
|
+
/**
|
|
737
|
+
* Word-style insert-table picker: hover (or focus) a cell of the grid to
|
|
738
|
+
* choose the size, click to insert a table of that size at the cursor. The
|
|
739
|
+
* grid is disabled (with the reason as its title) where a table cannot be
|
|
740
|
+
* inserted, e.g. inside another table.
|
|
741
|
+
*/
|
|
742
|
+
declare const InsertTableGrid: React__default.FC<InsertTableGridProps>;
|
|
743
|
+
|
|
744
|
+
interface TableBubbleMenuProps extends Omit<BubbleMenuProps, "editor" | "children" | "shouldShow"> {
|
|
745
|
+
editor: Editor | null;
|
|
746
|
+
/** Custom content (default: a `TableToolbar`). */
|
|
747
|
+
children?: React__default.ReactNode;
|
|
748
|
+
/** Props for the default `TableToolbar`. */
|
|
749
|
+
toolbarProps?: Omit<TableToolbarProps, "editor">;
|
|
750
|
+
}
|
|
751
|
+
/**
|
|
752
|
+
* A bubble menu that follows the selection while it is in a table (even a
|
|
753
|
+
* collapsed cursor), with the table toolbar or your own `children`. It uses
|
|
754
|
+
* its own plugin key (`tableBubbleMenu`), so it can be combined with the
|
|
755
|
+
* formatting `BubbleMenu`.
|
|
756
|
+
*/
|
|
757
|
+
declare const TableBubbleMenu: React__default.FC<TableBubbleMenuProps>;
|
|
758
|
+
|
|
759
|
+
export { BubbleMenu, type BubbleMenuProps, CommentButton, type CommentButtonProps, CommentsPanel, type CommentsPanelProps, EditorContent, type EditorContentProps, EditorSlotsProvider, type EditorSlotsProviderProps, ExportDocxButton, type ExportDocxButtonProps, FindReplaceBar, type FindReplaceBarProps, type HistoryShortcutsOptions, InsertTableGrid, type InsertTableGridProps, MergePreview, type MergePreviewProps, type MergePreviewState, OutlinePanel, type OutlinePanelProps, ReviewToolbar, type ReviewToolbarProps, StylesGallery, type StylesGalleryProps, TableBubbleMenu, type TableBubbleMenuProps, TableToolbar, type TableToolbarProps, TemplateRenderer, type TemplateRendererProps, TrackedChangesList, type TrackedChangesListProps, type UseCommentsResult, type UseDismissGuardOptions, type UseDismissGuardReturn, type UseDocumentCompareResult, type UseDocxExportResult, type UseFileImportResult, type UseFindReplaceResult, type UseHistoryDirtyOptions, type UseHistoryDirtyResult, type UseHistoryResult, type UseMergePreviewOptions, type UseNavigationGuardOptions, type UseNavigationGuardReturn, type UseParagraphStylesResult, type UsePromptEditorProps, type UseRichEditorProps, type UseTableMenuResult, type UseTrackChangesResult, VariableForm, type VariableFormProps, useAgentToolProvider, useComments, useDismissGuard, useDocumentCompare, useDocxExport, useEditor, useEditorSlots, useFileImport, useFindReplace, useHistory, useHistoryDirty, useHistoryShortcuts, useMergePreview, useNavigationGuard, useOutline, useParagraphStyles, usePromptEditor, useTableMenu, useTrackChanges };
|