@pixerate/editor-react 0.12.0 → 0.13.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 +4 -1
- package/dist/chunk-MHTAR3RS.js +1103 -0
- package/dist/chunk-MHTAR3RS.js.map +1 -0
- package/dist/index.cjs +28 -28
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +5 -159
- package/dist/index.d.ts +5 -159
- package/dist/index.js +68 -1152
- package/dist/index.js.map +1 -1
- package/dist/spreadsheet/index.cjs +1134 -0
- package/dist/spreadsheet/index.cjs.map +1 -0
- package/dist/spreadsheet/index.d.cts +160 -0
- package/dist/spreadsheet/index.d.ts +160 -0
- package/dist/spreadsheet/index.js +19 -0
- package/dist/spreadsheet/index.js.map +1 -0
- package/package.json +15 -2
package/dist/index.d.cts
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import * as _tiptap_core from '@tiptap/core';
|
|
2
2
|
import { Editor } from '@tiptap/core';
|
|
3
|
-
import
|
|
4
|
-
import { Template, ColorGradient, FileImportOptions, RichTextPresetOptions, RichClipboardOptions, HistoryState, HistoryManager, Command, HistoryManagerOptions, FileImportState, FileImportController, FileImportControllerOptions, PromptValues, OutlineSnapshot, OutlineHeading, SpreadsheetControllerOptions, CellRange, SpreadsheetDocument, CellCoordinate, SpreadsheetController, SpreadsheetColumn, SpreadsheetRow, SpreadsheetDataSource, CellData, SpreadsheetMenuItem, SpreadsheetRowGroup, SpreadsheetViewColumn, EditorSlotsMap, CommentStoreSnapshot, CommentStore, TrackChangesSnapshot, TrackedChange, ReviewAuthor } from '@pixerate/editor';
|
|
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';
|
|
5
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';
|
|
6
5
|
import { UseEditorOptions, EditorContentProps as EditorContentProps$1 } from '@tiptap/react';
|
|
7
6
|
import { ToolRegistry, AgentToolProvider } from '@pixerate/editor/agent';
|
|
8
|
-
import
|
|
9
|
-
import React__default, { RefObject } from 'react';
|
|
7
|
+
import React__default from 'react';
|
|
10
8
|
import { BubbleMenuPluginProps } from '@tiptap/extension-bubble-menu';
|
|
9
|
+
export { FormulaHints, FormulaHintsProps, SpreadsheetContextMenu, SpreadsheetContextMenuProps, SpreadsheetEditor, SpreadsheetEditorProps, SpreadsheetGroupRow, SpreadsheetGroupRowProps, useFillHandle, useSpreadsheetClipboard, useSpreadsheetEditor } from './spreadsheet/index.cjs';
|
|
11
10
|
export { ImageEditor, ImageEditorProps, UseImageEditorReturn, useImageEditor } from './image-editor/index.cjs';
|
|
11
|
+
import '@pixerate/editor/spreadsheet';
|
|
12
12
|
import '@pixerate/editor/image-editor';
|
|
13
13
|
|
|
14
14
|
interface UsePromptEditorProps {
|
|
@@ -310,160 +310,6 @@ interface OutlinePanelProps {
|
|
|
310
310
|
*/
|
|
311
311
|
declare const OutlinePanel: React__default.FC<OutlinePanelProps>;
|
|
312
312
|
|
|
313
|
-
declare function useSpreadsheetEditor(options?: SpreadsheetControllerOptions): {
|
|
314
|
-
viewModel: _pixerate_editor.SpreadsheetViewModel;
|
|
315
|
-
undo: () => void;
|
|
316
|
-
redo: () => void;
|
|
317
|
-
sortRows: (keys: _pixerate_editor.SortKey[], options?: {
|
|
318
|
-
range?: CellRange | null;
|
|
319
|
-
}) => boolean;
|
|
320
|
-
getFilterState: () => _pixerate_editor.SpreadsheetFilterState;
|
|
321
|
-
setFilterRules: (rules: _pixerate_editor.NewFilterRule[]) => void;
|
|
322
|
-
addFilterRule: (rule: _pixerate_editor.NewFilterRule) => string;
|
|
323
|
-
updateFilterRule: (ruleId: string, changes: Partial<Omit<_pixerate_editor.FilterRule, "id">>) => void;
|
|
324
|
-
removeFilterRule: (ruleId: string) => void;
|
|
325
|
-
clearFilters: () => void;
|
|
326
|
-
setFiltersEnabled: (enabled: boolean) => void;
|
|
327
|
-
toggleFilters: () => void;
|
|
328
|
-
setHeaderRowCount: (count: number) => void;
|
|
329
|
-
setFooterRowCount: (count: number) => void;
|
|
330
|
-
setHeaderColumnCount: (count: number) => void;
|
|
331
|
-
setFrozenRowCount: (count: number) => void;
|
|
332
|
-
setFrozenColumnCount: (count: number) => void;
|
|
333
|
-
hideRows: (indices: number[]) => void;
|
|
334
|
-
unhideRows: (indices: number[]) => void;
|
|
335
|
-
hideColumns: (indices: number[]) => void;
|
|
336
|
-
unhideColumns: (indices: number[]) => void;
|
|
337
|
-
unhideAll: () => void;
|
|
338
|
-
getMerges: () => CellRange[];
|
|
339
|
-
getMergeAt: (row: number, col: number) => CellRange | null;
|
|
340
|
-
mergeCells: (range?: CellRange | null) => boolean;
|
|
341
|
-
unmergeCells: (range?: CellRange | null) => boolean;
|
|
342
|
-
autofill: (source: CellRange, target: CellRange) => boolean;
|
|
343
|
-
groupRowsBy: (colId: string, summaries?: _pixerate_editor.GroupSummary[]) => void;
|
|
344
|
-
ungroupRows: () => void;
|
|
345
|
-
setGroupSummary: (colId: string, aggregate: _pixerate_editor.GroupAggregate | null) => void;
|
|
346
|
-
setGroupCollapsed: (key: string, collapsed: boolean) => void;
|
|
347
|
-
toggleGroupCollapsed: (key: string) => void;
|
|
348
|
-
getGroups: () => _pixerate_editor.SpreadsheetRowGroup[];
|
|
349
|
-
transposeRange: (range?: CellRange | null) => boolean;
|
|
350
|
-
exportToCsv: (options?: _pixerate_editor.CsvExportOptions) => string;
|
|
351
|
-
importFromCsv: (csv: string, options?: _pixerate_editor.CsvImportOptions) => void;
|
|
352
|
-
copyToClipboardData: (range?: CellRange | null) => _pixerate_editor.SpreadsheetClipboardData;
|
|
353
|
-
pasteClipboardData: (source: _pixerate_editor.SpreadsheetClipboardSource, target?: _pixerate_editor.CellPosition) => boolean;
|
|
354
|
-
document: SpreadsheetDocument;
|
|
355
|
-
activeCell: CellCoordinate | null;
|
|
356
|
-
selectedRange: CellRange | null;
|
|
357
|
-
editingCell: CellCoordinate | null;
|
|
358
|
-
draftValue: string;
|
|
359
|
-
setDraftValue: React$1.Dispatch<React$1.SetStateAction<string>>;
|
|
360
|
-
controller: SpreadsheetController;
|
|
361
|
-
getCell: (rowId: string, colId: string) => _pixerate_editor.CellData;
|
|
362
|
-
setCellValue: (rowId: string, colId: string, raw: string) => void;
|
|
363
|
-
selectCell: (row: number, col: number, extendSelection?: boolean) => void;
|
|
364
|
-
selectRange: (range: CellRange) => void;
|
|
365
|
-
startEditing: (row?: number, col?: number, initialVal?: string) => void;
|
|
366
|
-
commitEditing: (val?: string) => void;
|
|
367
|
-
cancelEditing: () => void;
|
|
368
|
-
moveCursor: (dir: "up" | "down" | "left" | "right", extend?: boolean) => void;
|
|
369
|
-
insertColumn: (index: number, config?: Partial<SpreadsheetColumn>) => void;
|
|
370
|
-
deleteColumn: (colId: string) => void;
|
|
371
|
-
insertRow: (index: number, config?: Partial<SpreadsheetRow>) => void;
|
|
372
|
-
deleteRow: (rowId: string) => void;
|
|
373
|
-
setColumnWidth: (colId: string, width: number) => void;
|
|
374
|
-
autoFitColumnWidth: (colId: string, customWidth?: number) => void;
|
|
375
|
-
loadDocument: (document: SpreadsheetDocument) => void;
|
|
376
|
-
syncWithDataSource: () => void;
|
|
377
|
-
registerDataSource: (ds: SpreadsheetDataSource) => void;
|
|
378
|
-
setPrimaryDataSource: (id: string | undefined) => void;
|
|
379
|
-
recalculateAll: () => void;
|
|
380
|
-
exportToTsv: (range?: CellRange | null) => string;
|
|
381
|
-
importFromTsv: (data: string) => void;
|
|
382
|
-
};
|
|
383
|
-
|
|
384
|
-
interface SpreadsheetEditorProps {
|
|
385
|
-
state?: ReturnType<typeof useSpreadsheetEditor>;
|
|
386
|
-
readOnly?: boolean;
|
|
387
|
-
customCellRenderer?: (props: {
|
|
388
|
-
row: SpreadsheetRow;
|
|
389
|
-
col: SpreadsheetColumn;
|
|
390
|
-
cell: CellData;
|
|
391
|
-
}) => React__default.ReactNode;
|
|
392
|
-
onAddColumnClick?: () => void;
|
|
393
|
-
onColumnHeaderClick?: (col: SpreadsheetColumn) => void;
|
|
394
|
-
onColumnResize?: (colId: string, width: number) => void;
|
|
395
|
-
}
|
|
396
|
-
declare const SpreadsheetEditor: React__default.FC<SpreadsheetEditorProps>;
|
|
397
|
-
|
|
398
|
-
interface SpreadsheetContextMenuProps {
|
|
399
|
-
items: SpreadsheetMenuItem[];
|
|
400
|
-
x: number;
|
|
401
|
-
y: number;
|
|
402
|
-
onClose: () => void;
|
|
403
|
-
}
|
|
404
|
-
/** The table context menu (sort, filter, freeze, hide, merge, categories, transpose). */
|
|
405
|
-
declare const SpreadsheetContextMenu: React__default.FC<SpreadsheetContextMenuProps>;
|
|
406
|
-
|
|
407
|
-
interface SpreadsheetGroupRowProps {
|
|
408
|
-
group: SpreadsheetRowGroup;
|
|
409
|
-
columns: SpreadsheetViewColumn[];
|
|
410
|
-
/** Column the rows are grouped by: shows the group label and toggle. */
|
|
411
|
-
groupColId: string;
|
|
412
|
-
onToggle: (key: string) => void;
|
|
413
|
-
/** Render a trailing cell for the "add column" column. */
|
|
414
|
-
trailingCell?: boolean;
|
|
415
|
-
}
|
|
416
|
-
/** A category header row: collapse toggle, label, row count and per-column summaries. */
|
|
417
|
-
declare const SpreadsheetGroupRow: React__default.FC<SpreadsheetGroupRowProps>;
|
|
418
|
-
|
|
419
|
-
type SpreadsheetState = ReturnType<typeof useSpreadsheetEditor>;
|
|
420
|
-
/**
|
|
421
|
-
* Copy and paste for the grid. Copy writes TSV, an HTML table and the
|
|
422
|
-
* lossless `application/x.pixerate.spreadsheet+json` format; paste prefers
|
|
423
|
-
* that format, then HTML, then TSV.
|
|
424
|
-
*
|
|
425
|
-
* The listeners are on `document`: with no text selection the browser fires
|
|
426
|
-
* `copy`/`paste` at `<body>`, not at the focused grid. Text inputs inside the
|
|
427
|
-
* grid keep native copy/paste.
|
|
428
|
-
*/
|
|
429
|
-
declare function useSpreadsheetClipboard(gridRef: RefObject<HTMLElement | null>, state: SpreadsheetState, readOnly: boolean): {
|
|
430
|
-
copyShortcutFallback: () => void;
|
|
431
|
-
};
|
|
432
|
-
/**
|
|
433
|
-
* Fill handle dragging: press on the handle, move over cells, release to
|
|
434
|
-
* autofill from the selection into the dragged range (one undo step).
|
|
435
|
-
*/
|
|
436
|
-
declare function useFillHandle(state: SpreadsheetState): {
|
|
437
|
-
fillTarget: CellRange | null;
|
|
438
|
-
isFilling: boolean;
|
|
439
|
-
startFill: (e: {
|
|
440
|
-
preventDefault(): void;
|
|
441
|
-
stopPropagation(): void;
|
|
442
|
-
}) => void;
|
|
443
|
-
extendFill: (row: number, col: number) => void;
|
|
444
|
-
};
|
|
445
|
-
|
|
446
|
-
interface FormulaHintsProps {
|
|
447
|
-
/** The input being edited (a cell editor or the formula bar). */
|
|
448
|
-
inputRef: React__default.RefObject<HTMLInputElement | null>;
|
|
449
|
-
/** The input's current value. */
|
|
450
|
-
value: string;
|
|
451
|
-
/** Called with the new value when a suggestion is accepted. */
|
|
452
|
-
onAccept: (value: string) => void;
|
|
453
|
-
/** Maximum number of function suggestions (default 8). */
|
|
454
|
-
limit?: number;
|
|
455
|
-
}
|
|
456
|
-
/**
|
|
457
|
-
* Formula autocomplete for an input: while the value starts with `=`, lists
|
|
458
|
-
* functions matching the name at the caret (name, signature, description) and,
|
|
459
|
-
* inside a call, shows the signature with the current argument highlighted.
|
|
460
|
-
*
|
|
461
|
-
* Keys are handled on the input itself, before the grid sees them: ArrowUp /
|
|
462
|
-
* ArrowDown move the selection, Tab accepts it, Escape closes the list.
|
|
463
|
-
* Enter is left alone so it still commits the cell.
|
|
464
|
-
*/
|
|
465
|
-
declare const FormulaHints: React__default.FC<FormulaHintsProps>;
|
|
466
|
-
|
|
467
313
|
interface EditorSlotsProviderProps {
|
|
468
314
|
slots?: Partial<EditorSlotsMap>;
|
|
469
315
|
children: React__default.ReactNode;
|
|
@@ -542,4 +388,4 @@ interface CommentButtonProps {
|
|
|
542
388
|
*/
|
|
543
389
|
declare const CommentButton: React__default.FC<CommentButtonProps>;
|
|
544
390
|
|
|
545
|
-
export { BubbleMenu, type BubbleMenuProps, CommentButton, type CommentButtonProps, CommentsPanel, type CommentsPanelProps, EditorContent, type EditorContentProps, EditorSlotsProvider, type EditorSlotsProviderProps,
|
|
391
|
+
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 };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import * as _tiptap_core from '@tiptap/core';
|
|
2
2
|
import { Editor } from '@tiptap/core';
|
|
3
|
-
import
|
|
4
|
-
import { Template, ColorGradient, FileImportOptions, RichTextPresetOptions, RichClipboardOptions, HistoryState, HistoryManager, Command, HistoryManagerOptions, FileImportState, FileImportController, FileImportControllerOptions, PromptValues, OutlineSnapshot, OutlineHeading, SpreadsheetControllerOptions, CellRange, SpreadsheetDocument, CellCoordinate, SpreadsheetController, SpreadsheetColumn, SpreadsheetRow, SpreadsheetDataSource, CellData, SpreadsheetMenuItem, SpreadsheetRowGroup, SpreadsheetViewColumn, EditorSlotsMap, CommentStoreSnapshot, CommentStore, TrackChangesSnapshot, TrackedChange, ReviewAuthor } from '@pixerate/editor';
|
|
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';
|
|
5
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';
|
|
6
5
|
import { UseEditorOptions, EditorContentProps as EditorContentProps$1 } from '@tiptap/react';
|
|
7
6
|
import { ToolRegistry, AgentToolProvider } from '@pixerate/editor/agent';
|
|
8
|
-
import
|
|
9
|
-
import React__default, { RefObject } from 'react';
|
|
7
|
+
import React__default from 'react';
|
|
10
8
|
import { BubbleMenuPluginProps } from '@tiptap/extension-bubble-menu';
|
|
9
|
+
export { FormulaHints, FormulaHintsProps, SpreadsheetContextMenu, SpreadsheetContextMenuProps, SpreadsheetEditor, SpreadsheetEditorProps, SpreadsheetGroupRow, SpreadsheetGroupRowProps, useFillHandle, useSpreadsheetClipboard, useSpreadsheetEditor } from './spreadsheet/index.js';
|
|
11
10
|
export { ImageEditor, ImageEditorProps, UseImageEditorReturn, useImageEditor } from './image-editor/index.js';
|
|
11
|
+
import '@pixerate/editor/spreadsheet';
|
|
12
12
|
import '@pixerate/editor/image-editor';
|
|
13
13
|
|
|
14
14
|
interface UsePromptEditorProps {
|
|
@@ -310,160 +310,6 @@ interface OutlinePanelProps {
|
|
|
310
310
|
*/
|
|
311
311
|
declare const OutlinePanel: React__default.FC<OutlinePanelProps>;
|
|
312
312
|
|
|
313
|
-
declare function useSpreadsheetEditor(options?: SpreadsheetControllerOptions): {
|
|
314
|
-
viewModel: _pixerate_editor.SpreadsheetViewModel;
|
|
315
|
-
undo: () => void;
|
|
316
|
-
redo: () => void;
|
|
317
|
-
sortRows: (keys: _pixerate_editor.SortKey[], options?: {
|
|
318
|
-
range?: CellRange | null;
|
|
319
|
-
}) => boolean;
|
|
320
|
-
getFilterState: () => _pixerate_editor.SpreadsheetFilterState;
|
|
321
|
-
setFilterRules: (rules: _pixerate_editor.NewFilterRule[]) => void;
|
|
322
|
-
addFilterRule: (rule: _pixerate_editor.NewFilterRule) => string;
|
|
323
|
-
updateFilterRule: (ruleId: string, changes: Partial<Omit<_pixerate_editor.FilterRule, "id">>) => void;
|
|
324
|
-
removeFilterRule: (ruleId: string) => void;
|
|
325
|
-
clearFilters: () => void;
|
|
326
|
-
setFiltersEnabled: (enabled: boolean) => void;
|
|
327
|
-
toggleFilters: () => void;
|
|
328
|
-
setHeaderRowCount: (count: number) => void;
|
|
329
|
-
setFooterRowCount: (count: number) => void;
|
|
330
|
-
setHeaderColumnCount: (count: number) => void;
|
|
331
|
-
setFrozenRowCount: (count: number) => void;
|
|
332
|
-
setFrozenColumnCount: (count: number) => void;
|
|
333
|
-
hideRows: (indices: number[]) => void;
|
|
334
|
-
unhideRows: (indices: number[]) => void;
|
|
335
|
-
hideColumns: (indices: number[]) => void;
|
|
336
|
-
unhideColumns: (indices: number[]) => void;
|
|
337
|
-
unhideAll: () => void;
|
|
338
|
-
getMerges: () => CellRange[];
|
|
339
|
-
getMergeAt: (row: number, col: number) => CellRange | null;
|
|
340
|
-
mergeCells: (range?: CellRange | null) => boolean;
|
|
341
|
-
unmergeCells: (range?: CellRange | null) => boolean;
|
|
342
|
-
autofill: (source: CellRange, target: CellRange) => boolean;
|
|
343
|
-
groupRowsBy: (colId: string, summaries?: _pixerate_editor.GroupSummary[]) => void;
|
|
344
|
-
ungroupRows: () => void;
|
|
345
|
-
setGroupSummary: (colId: string, aggregate: _pixerate_editor.GroupAggregate | null) => void;
|
|
346
|
-
setGroupCollapsed: (key: string, collapsed: boolean) => void;
|
|
347
|
-
toggleGroupCollapsed: (key: string) => void;
|
|
348
|
-
getGroups: () => _pixerate_editor.SpreadsheetRowGroup[];
|
|
349
|
-
transposeRange: (range?: CellRange | null) => boolean;
|
|
350
|
-
exportToCsv: (options?: _pixerate_editor.CsvExportOptions) => string;
|
|
351
|
-
importFromCsv: (csv: string, options?: _pixerate_editor.CsvImportOptions) => void;
|
|
352
|
-
copyToClipboardData: (range?: CellRange | null) => _pixerate_editor.SpreadsheetClipboardData;
|
|
353
|
-
pasteClipboardData: (source: _pixerate_editor.SpreadsheetClipboardSource, target?: _pixerate_editor.CellPosition) => boolean;
|
|
354
|
-
document: SpreadsheetDocument;
|
|
355
|
-
activeCell: CellCoordinate | null;
|
|
356
|
-
selectedRange: CellRange | null;
|
|
357
|
-
editingCell: CellCoordinate | null;
|
|
358
|
-
draftValue: string;
|
|
359
|
-
setDraftValue: React$1.Dispatch<React$1.SetStateAction<string>>;
|
|
360
|
-
controller: SpreadsheetController;
|
|
361
|
-
getCell: (rowId: string, colId: string) => _pixerate_editor.CellData;
|
|
362
|
-
setCellValue: (rowId: string, colId: string, raw: string) => void;
|
|
363
|
-
selectCell: (row: number, col: number, extendSelection?: boolean) => void;
|
|
364
|
-
selectRange: (range: CellRange) => void;
|
|
365
|
-
startEditing: (row?: number, col?: number, initialVal?: string) => void;
|
|
366
|
-
commitEditing: (val?: string) => void;
|
|
367
|
-
cancelEditing: () => void;
|
|
368
|
-
moveCursor: (dir: "up" | "down" | "left" | "right", extend?: boolean) => void;
|
|
369
|
-
insertColumn: (index: number, config?: Partial<SpreadsheetColumn>) => void;
|
|
370
|
-
deleteColumn: (colId: string) => void;
|
|
371
|
-
insertRow: (index: number, config?: Partial<SpreadsheetRow>) => void;
|
|
372
|
-
deleteRow: (rowId: string) => void;
|
|
373
|
-
setColumnWidth: (colId: string, width: number) => void;
|
|
374
|
-
autoFitColumnWidth: (colId: string, customWidth?: number) => void;
|
|
375
|
-
loadDocument: (document: SpreadsheetDocument) => void;
|
|
376
|
-
syncWithDataSource: () => void;
|
|
377
|
-
registerDataSource: (ds: SpreadsheetDataSource) => void;
|
|
378
|
-
setPrimaryDataSource: (id: string | undefined) => void;
|
|
379
|
-
recalculateAll: () => void;
|
|
380
|
-
exportToTsv: (range?: CellRange | null) => string;
|
|
381
|
-
importFromTsv: (data: string) => void;
|
|
382
|
-
};
|
|
383
|
-
|
|
384
|
-
interface SpreadsheetEditorProps {
|
|
385
|
-
state?: ReturnType<typeof useSpreadsheetEditor>;
|
|
386
|
-
readOnly?: boolean;
|
|
387
|
-
customCellRenderer?: (props: {
|
|
388
|
-
row: SpreadsheetRow;
|
|
389
|
-
col: SpreadsheetColumn;
|
|
390
|
-
cell: CellData;
|
|
391
|
-
}) => React__default.ReactNode;
|
|
392
|
-
onAddColumnClick?: () => void;
|
|
393
|
-
onColumnHeaderClick?: (col: SpreadsheetColumn) => void;
|
|
394
|
-
onColumnResize?: (colId: string, width: number) => void;
|
|
395
|
-
}
|
|
396
|
-
declare const SpreadsheetEditor: React__default.FC<SpreadsheetEditorProps>;
|
|
397
|
-
|
|
398
|
-
interface SpreadsheetContextMenuProps {
|
|
399
|
-
items: SpreadsheetMenuItem[];
|
|
400
|
-
x: number;
|
|
401
|
-
y: number;
|
|
402
|
-
onClose: () => void;
|
|
403
|
-
}
|
|
404
|
-
/** The table context menu (sort, filter, freeze, hide, merge, categories, transpose). */
|
|
405
|
-
declare const SpreadsheetContextMenu: React__default.FC<SpreadsheetContextMenuProps>;
|
|
406
|
-
|
|
407
|
-
interface SpreadsheetGroupRowProps {
|
|
408
|
-
group: SpreadsheetRowGroup;
|
|
409
|
-
columns: SpreadsheetViewColumn[];
|
|
410
|
-
/** Column the rows are grouped by: shows the group label and toggle. */
|
|
411
|
-
groupColId: string;
|
|
412
|
-
onToggle: (key: string) => void;
|
|
413
|
-
/** Render a trailing cell for the "add column" column. */
|
|
414
|
-
trailingCell?: boolean;
|
|
415
|
-
}
|
|
416
|
-
/** A category header row: collapse toggle, label, row count and per-column summaries. */
|
|
417
|
-
declare const SpreadsheetGroupRow: React__default.FC<SpreadsheetGroupRowProps>;
|
|
418
|
-
|
|
419
|
-
type SpreadsheetState = ReturnType<typeof useSpreadsheetEditor>;
|
|
420
|
-
/**
|
|
421
|
-
* Copy and paste for the grid. Copy writes TSV, an HTML table and the
|
|
422
|
-
* lossless `application/x.pixerate.spreadsheet+json` format; paste prefers
|
|
423
|
-
* that format, then HTML, then TSV.
|
|
424
|
-
*
|
|
425
|
-
* The listeners are on `document`: with no text selection the browser fires
|
|
426
|
-
* `copy`/`paste` at `<body>`, not at the focused grid. Text inputs inside the
|
|
427
|
-
* grid keep native copy/paste.
|
|
428
|
-
*/
|
|
429
|
-
declare function useSpreadsheetClipboard(gridRef: RefObject<HTMLElement | null>, state: SpreadsheetState, readOnly: boolean): {
|
|
430
|
-
copyShortcutFallback: () => void;
|
|
431
|
-
};
|
|
432
|
-
/**
|
|
433
|
-
* Fill handle dragging: press on the handle, move over cells, release to
|
|
434
|
-
* autofill from the selection into the dragged range (one undo step).
|
|
435
|
-
*/
|
|
436
|
-
declare function useFillHandle(state: SpreadsheetState): {
|
|
437
|
-
fillTarget: CellRange | null;
|
|
438
|
-
isFilling: boolean;
|
|
439
|
-
startFill: (e: {
|
|
440
|
-
preventDefault(): void;
|
|
441
|
-
stopPropagation(): void;
|
|
442
|
-
}) => void;
|
|
443
|
-
extendFill: (row: number, col: number) => void;
|
|
444
|
-
};
|
|
445
|
-
|
|
446
|
-
interface FormulaHintsProps {
|
|
447
|
-
/** The input being edited (a cell editor or the formula bar). */
|
|
448
|
-
inputRef: React__default.RefObject<HTMLInputElement | null>;
|
|
449
|
-
/** The input's current value. */
|
|
450
|
-
value: string;
|
|
451
|
-
/** Called with the new value when a suggestion is accepted. */
|
|
452
|
-
onAccept: (value: string) => void;
|
|
453
|
-
/** Maximum number of function suggestions (default 8). */
|
|
454
|
-
limit?: number;
|
|
455
|
-
}
|
|
456
|
-
/**
|
|
457
|
-
* Formula autocomplete for an input: while the value starts with `=`, lists
|
|
458
|
-
* functions matching the name at the caret (name, signature, description) and,
|
|
459
|
-
* inside a call, shows the signature with the current argument highlighted.
|
|
460
|
-
*
|
|
461
|
-
* Keys are handled on the input itself, before the grid sees them: ArrowUp /
|
|
462
|
-
* ArrowDown move the selection, Tab accepts it, Escape closes the list.
|
|
463
|
-
* Enter is left alone so it still commits the cell.
|
|
464
|
-
*/
|
|
465
|
-
declare const FormulaHints: React__default.FC<FormulaHintsProps>;
|
|
466
|
-
|
|
467
313
|
interface EditorSlotsProviderProps {
|
|
468
314
|
slots?: Partial<EditorSlotsMap>;
|
|
469
315
|
children: React__default.ReactNode;
|
|
@@ -542,4 +388,4 @@ interface CommentButtonProps {
|
|
|
542
388
|
*/
|
|
543
389
|
declare const CommentButton: React__default.FC<CommentButtonProps>;
|
|
544
390
|
|
|
545
|
-
export { BubbleMenu, type BubbleMenuProps, CommentButton, type CommentButtonProps, CommentsPanel, type CommentsPanelProps, EditorContent, type EditorContentProps, EditorSlotsProvider, type EditorSlotsProviderProps,
|
|
391
|
+
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 };
|