@bendyline/squisq-editor-react 2.10.3 → 2.11.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/dist/{chunk-X3UQBUVO.js → chunk-4KE4HP3W.js} +2742 -1162
- package/dist/{chunk-TCLNRATG.js → chunk-A2W4GYPG.js} +48 -2
- package/dist/{chunk-JYPLPGYJ.js → chunk-SK3MQSHQ.js} +1 -1
- package/dist/index.d.ts +286 -12
- package/dist/index.js +39 -5
- package/dist/json-editor/index.js +2 -2
- package/dist/shell/index.d.ts +6 -2
- package/dist/shell/index.js +2 -2
- package/dist/{shell-DSHMZvnK.d.ts → shell-CJkHDwpz.d.ts} +177 -7
- package/dist/styles/index.css +547 -19
- package/package.json +7 -5
package/dist/index.js
CHANGED
|
@@ -22,8 +22,11 @@ import {
|
|
|
22
22
|
CodeSnippetWidget,
|
|
23
23
|
CustomTemplateProvider,
|
|
24
24
|
CustomThemeProvider,
|
|
25
|
+
DATA_CARD_KEY,
|
|
25
26
|
DEFAULT_DRAFT,
|
|
26
27
|
DEFAULT_MERMAID_DIAGRAM_TYPE,
|
|
28
|
+
DataCardExtension,
|
|
29
|
+
DataCardWidget,
|
|
27
30
|
DiagramCanvas,
|
|
28
31
|
DocumentSettingsDialog,
|
|
29
32
|
DropZoneOverlay,
|
|
@@ -88,6 +91,7 @@ import {
|
|
|
88
91
|
VersionHistoryPanel,
|
|
89
92
|
ViewMenuPanel,
|
|
90
93
|
WysiwygEditor,
|
|
94
|
+
XLSX_LOCKED_REASON,
|
|
91
95
|
adaptThemeToSurface,
|
|
92
96
|
addEdgeOp,
|
|
93
97
|
addItemOp,
|
|
@@ -104,12 +108,17 @@ import {
|
|
|
104
108
|
codeSnippetMarkdown,
|
|
105
109
|
compileDraft,
|
|
106
110
|
containFenceWidgetEvents,
|
|
111
|
+
createXlsxFormulaSession,
|
|
112
|
+
dataExtensionOf,
|
|
113
|
+
dataLinkHrefOf,
|
|
107
114
|
detectLanguageFromFileName,
|
|
108
115
|
draftPatchFromImportedTheme,
|
|
109
116
|
findAsciiDiagramBlockPos,
|
|
110
117
|
findCodeSnippetBlockPos,
|
|
118
|
+
findDataCardBlockPos,
|
|
111
119
|
findHostFenceBlockPos,
|
|
112
120
|
findMermaidDiagramBlockPos,
|
|
121
|
+
findOwningHeadingPosition,
|
|
113
122
|
findRepairableBlockPos,
|
|
114
123
|
findTimelineBlockPos,
|
|
115
124
|
findTransitionEntry,
|
|
@@ -119,6 +128,7 @@ import {
|
|
|
119
128
|
getTimelineForNode,
|
|
120
129
|
indentItemOp,
|
|
121
130
|
ingestForWrite,
|
|
131
|
+
ingestSidecarBytes,
|
|
122
132
|
inspectMermaidSource,
|
|
123
133
|
isAsciiSourceVisible,
|
|
124
134
|
isCodeSnippetFenceLanguage,
|
|
@@ -129,6 +139,7 @@ import {
|
|
|
129
139
|
isRepairableFence,
|
|
130
140
|
isTimelineSourceSafeForSemanticEdit,
|
|
131
141
|
lineToOffset,
|
|
142
|
+
loadDataPreview,
|
|
132
143
|
mapFenceEntries,
|
|
133
144
|
mermaidDiagramMarkdown,
|
|
134
145
|
mermaidDiagramProperties,
|
|
@@ -150,6 +161,7 @@ import {
|
|
|
150
161
|
platformShortcut,
|
|
151
162
|
preloadMonaco,
|
|
152
163
|
preloadMonacoSuggestions,
|
|
164
|
+
processDataFiles,
|
|
153
165
|
processMediaFiles,
|
|
154
166
|
processTextFile,
|
|
155
167
|
processTextFiles,
|
|
@@ -157,6 +169,7 @@ import {
|
|
|
157
169
|
readBlockAttrsTransition,
|
|
158
170
|
readBlockAttrsValue,
|
|
159
171
|
readHeadingLineTransition,
|
|
172
|
+
readHeadingViewBinding,
|
|
160
173
|
removeEdgeOp,
|
|
161
174
|
removeItemOp,
|
|
162
175
|
removeNodeOp,
|
|
@@ -173,6 +186,8 @@ import {
|
|
|
173
186
|
sanitizeAsciiLabel,
|
|
174
187
|
sanitizeTimelineText,
|
|
175
188
|
sanitizeTreeLabel,
|
|
189
|
+
saveCsvEdits,
|
|
190
|
+
saveXlsxEdits,
|
|
176
191
|
searchPickerEntries,
|
|
177
192
|
setBlockAttrsValue,
|
|
178
193
|
setBlockDurationInSource,
|
|
@@ -211,16 +226,18 @@ import {
|
|
|
211
226
|
useMonacoLoader,
|
|
212
227
|
usePreviewSettings,
|
|
213
228
|
useTimelineData,
|
|
214
|
-
useTreeViewData
|
|
215
|
-
|
|
229
|
+
useTreeViewData,
|
|
230
|
+
viewStateFromBinding,
|
|
231
|
+
writeHeadingViewState
|
|
232
|
+
} from "./chunk-4KE4HP3W.js";
|
|
216
233
|
import "./chunk-V4NBQF5C.js";
|
|
217
234
|
import {
|
|
218
235
|
JsonEditor
|
|
219
|
-
} from "./chunk-
|
|
236
|
+
} from "./chunk-SK3MQSHQ.js";
|
|
220
237
|
import {
|
|
221
238
|
markdownToTiptap,
|
|
222
239
|
tiptapToMarkdown
|
|
223
|
-
} from "./chunk-
|
|
240
|
+
} from "./chunk-A2W4GYPG.js";
|
|
224
241
|
import {
|
|
225
242
|
ImageEditor,
|
|
226
243
|
ImageViewer,
|
|
@@ -741,9 +758,12 @@ export {
|
|
|
741
758
|
CodeSnippetWidget,
|
|
742
759
|
CustomTemplateProvider,
|
|
743
760
|
CustomThemeProvider,
|
|
761
|
+
DATA_CARD_KEY,
|
|
744
762
|
DEFAULT_MERMAID_DIAGRAM_TYPE,
|
|
745
763
|
DEFAULT_RECORDER_DEVICE_SETTINGS,
|
|
746
764
|
DEFAULT_TELEPROMPTER_PREFS,
|
|
765
|
+
DataCardExtension,
|
|
766
|
+
DataCardWidget,
|
|
747
767
|
DiagramCanvas,
|
|
748
768
|
DocumentSettingsDialog,
|
|
749
769
|
DropZoneOverlay,
|
|
@@ -825,6 +845,7 @@ export {
|
|
|
825
845
|
ViewMenuPanel,
|
|
826
846
|
ViewSwitcher,
|
|
827
847
|
WysiwygEditor,
|
|
848
|
+
XLSX_LOCKED_REASON,
|
|
828
849
|
adaptThemeToSurface,
|
|
829
850
|
addEdgeOp,
|
|
830
851
|
addItemOp,
|
|
@@ -854,6 +875,9 @@ export {
|
|
|
854
875
|
containFenceWidgetEvents,
|
|
855
876
|
createFloatingWindowManager,
|
|
856
877
|
createHarperProofingProvider,
|
|
878
|
+
createXlsxFormulaSession,
|
|
879
|
+
dataExtensionOf,
|
|
880
|
+
dataLinkHrefOf,
|
|
857
881
|
detectFloatTiers,
|
|
858
882
|
detectLanguageFromFileName,
|
|
859
883
|
documentTitleFromFileName,
|
|
@@ -863,8 +887,10 @@ export {
|
|
|
863
887
|
executeNarrationSave,
|
|
864
888
|
findAsciiDiagramBlockPos,
|
|
865
889
|
findCodeSnippetBlockPos,
|
|
890
|
+
findDataCardBlockPos,
|
|
866
891
|
findHostFenceBlockPos,
|
|
867
892
|
findMermaidDiagramBlockPos,
|
|
893
|
+
findOwningHeadingPosition,
|
|
868
894
|
findRepairableBlockPos,
|
|
869
895
|
findTimelineBlockPos,
|
|
870
896
|
findTransitionEntry,
|
|
@@ -877,6 +903,7 @@ export {
|
|
|
877
903
|
imageEditorReducer,
|
|
878
904
|
indentItemOp,
|
|
879
905
|
ingestForWrite,
|
|
906
|
+
ingestSidecarBytes,
|
|
880
907
|
initialImageEditorState,
|
|
881
908
|
insertNarrationPreamble,
|
|
882
909
|
inspectMermaidSource,
|
|
@@ -890,6 +917,7 @@ export {
|
|
|
890
917
|
isRepairableFence,
|
|
891
918
|
isTimelineSourceSafeForSemanticEdit,
|
|
892
919
|
lineToOffset,
|
|
920
|
+
loadDataPreview,
|
|
893
921
|
mapFenceEntries,
|
|
894
922
|
markdownToTiptap,
|
|
895
923
|
measureTokenLines,
|
|
@@ -914,6 +942,7 @@ export {
|
|
|
914
942
|
persistFromWrite,
|
|
915
943
|
preloadMonaco,
|
|
916
944
|
preloadMonacoSuggestions,
|
|
945
|
+
processDataFiles,
|
|
917
946
|
processMediaFiles,
|
|
918
947
|
processTextFile,
|
|
919
948
|
processTextFiles,
|
|
@@ -922,6 +951,7 @@ export {
|
|
|
922
951
|
readBlockAttrsTransition,
|
|
923
952
|
readBlockAttrsValue,
|
|
924
953
|
readHeadingLineTransition,
|
|
954
|
+
readHeadingViewBinding,
|
|
925
955
|
recordedMediaKind,
|
|
926
956
|
recorderBitsPerSecond,
|
|
927
957
|
recorderDeviceGroups,
|
|
@@ -948,6 +978,8 @@ export {
|
|
|
948
978
|
sanitizeAsciiLabel,
|
|
949
979
|
sanitizeTimelineText,
|
|
950
980
|
sanitizeTreeLabel,
|
|
981
|
+
saveCsvEdits,
|
|
982
|
+
saveXlsxEdits,
|
|
951
983
|
searchPickerEntries,
|
|
952
984
|
setBlockAttrsValue,
|
|
953
985
|
setBlockDurationInSource,
|
|
@@ -1004,5 +1036,7 @@ export {
|
|
|
1004
1036
|
useTeleprompter,
|
|
1005
1037
|
useTimelineData,
|
|
1006
1038
|
useTreeViewData,
|
|
1007
|
-
vadConfigForSensitivity
|
|
1039
|
+
vadConfigForSensitivity,
|
|
1040
|
+
viewStateFromBinding,
|
|
1041
|
+
writeHeadingViewState
|
|
1008
1042
|
};
|
package/dist/shell/index.d.ts
CHANGED
|
@@ -1,8 +1,13 @@
|
|
|
1
|
-
export { B as BlockTagVisibility,
|
|
1
|
+
export { B as BlockTagVisibility, e as DocumentLinkCandidate, f as DocumentLinkProvider, g as EditorActions, h as EditorColorScheme, i as EditorContextMenuContext, j as EditorContextMenuItem, k as EditorContextMenuItemVisibility, l as EditorContextMenuProvider, m as EditorContextMenuProviderProps, n as EditorContextValue, E as EditorHostMode, o as EditorMode, p as EditorProvider, q as EditorProviderProps, r as EditorShell, s as EditorShellProps, t as EditorState, u as EditorView, I as ImageDisplayMode, L as LayoutMode, M as MentionCandidate, x as MentionProvider, P as PreviewPanel, y as PreviewPanelProps, R as RawEditor, z as RawEditorProps, T as ThemeInheritance, V as ViewPreferences, A as WysiwygEditor, G as WysiwygEditorProps, O as useEditorContext, Q as useEditorContextMenuItems } from '../shell-CJkHDwpz.js';
|
|
2
2
|
import 'react/jsx-runtime';
|
|
3
|
+
import '@bendyline/squisq/table';
|
|
4
|
+
import '@bendyline/squisq-calc';
|
|
5
|
+
import '@bendyline/squisq-grid-react';
|
|
6
|
+
import '@bendyline/squisq-formats/xlsx';
|
|
3
7
|
import 'react';
|
|
4
8
|
import '@bendyline/squisq/schemas';
|
|
5
9
|
import '@bendyline/squisq/fence';
|
|
10
|
+
import '@bendyline/squisq-react';
|
|
6
11
|
import '@bendyline/squisq/markdown';
|
|
7
12
|
import '@bendyline/squisq/storage';
|
|
8
13
|
import '../types-B_aHRuSc.js';
|
|
@@ -10,4 +15,3 @@ import '@bendyline/squisq/proof';
|
|
|
10
15
|
import '@bendyline/squisq/versions';
|
|
11
16
|
import '@tiptap/core';
|
|
12
17
|
import 'monaco-editor';
|
|
13
|
-
import '@bendyline/squisq-react';
|
package/dist/shell/index.js
CHANGED
|
@@ -7,9 +7,9 @@ import {
|
|
|
7
7
|
WysiwygEditor,
|
|
8
8
|
useEditorContext,
|
|
9
9
|
useEditorContextMenuItems
|
|
10
|
-
} from "../chunk-
|
|
10
|
+
} from "../chunk-4KE4HP3W.js";
|
|
11
11
|
import "../chunk-V4NBQF5C.js";
|
|
12
|
-
import "../chunk-
|
|
12
|
+
import "../chunk-A2W4GYPG.js";
|
|
13
13
|
import "../chunk-V44VP242.js";
|
|
14
14
|
import "../chunk-7RRYZULY.js";
|
|
15
15
|
import "../chunk-GS7QWYFT.js";
|
|
@@ -1,14 +1,153 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
-
import {
|
|
2
|
+
import { TableCellEdit, TableCellValue } from '@bendyline/squisq/table';
|
|
3
|
+
import { CalcEngineConfig, CalcEngine } from '@bendyline/squisq-calc';
|
|
4
|
+
import { IngestTable } from '@bendyline/squisq-grid-react';
|
|
5
|
+
import { XlsxWorkbookGrids } from '@bendyline/squisq-formats/xlsx';
|
|
6
|
+
import { ReactNode, RefObject, ReactElement } from 'react';
|
|
3
7
|
import { Doc, MediaProvider, ViewportPreset, Theme } from '@bendyline/squisq/schemas';
|
|
4
8
|
import { FenceRendererMap } from '@bendyline/squisq/fence';
|
|
9
|
+
import { CodeBlockCopyHandler } from '@bendyline/squisq-react';
|
|
5
10
|
import { MarkdownDocument } from '@bendyline/squisq/markdown';
|
|
6
11
|
import { ContentContainer } from '@bendyline/squisq/storage';
|
|
7
12
|
import { P as ProofingCapability, b as ProofingIgnoreStore } from './types-B_aHRuSc.js';
|
|
8
13
|
import { DocumentVersionManager, SaveVersionOptions, SaveVersionResult, PrunePolicy } from '@bendyline/squisq/versions';
|
|
9
14
|
import { Editor } from '@tiptap/core';
|
|
10
15
|
import { editor } from 'monaco-editor';
|
|
11
|
-
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Sidecar bytes → the grid's neutral `IngestTable`, via lazy formats
|
|
19
|
+
* imports (the `processTextFile`-docx precedent — formats stays out of the
|
|
20
|
+
* static graph).
|
|
21
|
+
*
|
|
22
|
+
* CSV/TSV additionally sniff and RETAIN the source conventions the save
|
|
23
|
+
* path must reproduce (delimiter, newline flavor, trailing newline, BOM)
|
|
24
|
+
* plus the original parsed `string[][]` — unedited cells re-serialize from
|
|
25
|
+
* the parse product, never from typed columns, so untouched values have no
|
|
26
|
+
* float-rendering drift. XLSX resolves the heading's `sheet`/`anchor`
|
|
27
|
+
* region (the summary card used to ignore those), keeps typed cell values,
|
|
28
|
+
* and carries the address map + per-cell formula/date locks the in-place
|
|
29
|
+
* patch save needs; parquet stays read-only.
|
|
30
|
+
*/
|
|
31
|
+
|
|
32
|
+
interface CsvSourceMeta {
|
|
33
|
+
delimiter: string;
|
|
34
|
+
newline: '\r\n' | '\n';
|
|
35
|
+
trailingNewline: boolean;
|
|
36
|
+
bom: boolean;
|
|
37
|
+
/** The parsed source rows INCLUDING the header row — the save baseline. */
|
|
38
|
+
rows: string[][];
|
|
39
|
+
hasHeader: boolean;
|
|
40
|
+
}
|
|
41
|
+
interface XlsxSourceMeta {
|
|
42
|
+
/** Worksheet the region lives on. */
|
|
43
|
+
sheet: string;
|
|
44
|
+
/** 0-based grid row/col of the region's top-left cell (the header row, when there is one). */
|
|
45
|
+
anchorRow: number;
|
|
46
|
+
anchorCol: number;
|
|
47
|
+
hasHeader: boolean;
|
|
48
|
+
/**
|
|
49
|
+
* Body cells (`"row:col"`, body coordinates) locked WITHOUT a calculation
|
|
50
|
+
* engine: formula cells + date-styled cells. With an engine session,
|
|
51
|
+
* formula cells unlock and only `dateLocked` + `masterLocked` remain.
|
|
52
|
+
*/
|
|
53
|
+
locked: ReadonlySet<string>;
|
|
54
|
+
/** Date-styled body cells — locked in every mode this milestone. */
|
|
55
|
+
dateLocked: ReadonlySet<string>;
|
|
56
|
+
/**
|
|
57
|
+
* Shared-formula MASTERS — locked even with an engine, because the
|
|
58
|
+
* in-place patcher refuses to replace them (their followers' `si` would
|
|
59
|
+
* dangle). Followers edit freely (they simply leave the group).
|
|
60
|
+
*/
|
|
61
|
+
masterLocked: ReadonlySet<string>;
|
|
62
|
+
/** Body-cell formulas (no leading `=`), for display + engine seeding. */
|
|
63
|
+
formulas: ReadonlyMap<string, string>;
|
|
64
|
+
/** The full raw workbook — the calc engine seeds from ALL sheets, since
|
|
65
|
+
* region formulas routinely reference cells outside the region. */
|
|
66
|
+
grids: XlsxWorkbookGrids;
|
|
67
|
+
}
|
|
68
|
+
interface IngestedSidecar {
|
|
69
|
+
ingest: IngestTable;
|
|
70
|
+
/** Present only for CSV/TSV. */
|
|
71
|
+
csv?: CsvSourceMeta;
|
|
72
|
+
/** Present only for XLSX — the address map + per-cell locks the save needs. */
|
|
73
|
+
xlsx?: XlsxSourceMeta;
|
|
74
|
+
/** Present when editing is unavailable, with the user-facing reason. */
|
|
75
|
+
readOnlyReason?: string;
|
|
76
|
+
}
|
|
77
|
+
/** Tooltip shown on locked XLSX cells. */
|
|
78
|
+
declare const XLSX_LOCKED_REASON = "Formula and date cells become editable with the calculation engine (Phase 3)";
|
|
79
|
+
declare function ingestSidecarBytes(bytes: ArrayBuffer, ext: string, params: {
|
|
80
|
+
sheet?: string;
|
|
81
|
+
anchor?: string;
|
|
82
|
+
headerRow?: boolean;
|
|
83
|
+
}): Promise<IngestedSidecar>;
|
|
84
|
+
|
|
85
|
+
/**
|
|
86
|
+
* XLSX formula editing in the data card: an in-house calc-engine session
|
|
87
|
+
* behind the grid's `FormulaSupport` seam.
|
|
88
|
+
*
|
|
89
|
+
* The engine seeds from the ENTIRE workbook (`XlsxWorkbookGrids`) — region
|
|
90
|
+
* formulas routinely reference cells outside the region — with formula
|
|
91
|
+
* cells seeded as formulas and value cells as values (date cells converted
|
|
92
|
+
* back to serials, since the importer normalized them to ISO strings).
|
|
93
|
+
*
|
|
94
|
+
* Display discipline: the store keeps showing the file's CACHED values
|
|
95
|
+
* until an edit actually changes something. After each committed edit the
|
|
96
|
+
* session diffs the region's formula cells against its own previous engine
|
|
97
|
+
* values and returns only the CHANGES as `TableCellEdit`s — and a cell
|
|
98
|
+
* whose engine value is `#NAME?` (a function this tier doesn't implement)
|
|
99
|
+
* never overwrites its cached display.
|
|
100
|
+
*
|
|
101
|
+
* `@bendyline/squisq-calc` is a regular dependency reached only via
|
|
102
|
+
* dynamic `import()` (the grid-react pattern) — code-split, and a load
|
|
103
|
+
* failure just means formula cells stay locked.
|
|
104
|
+
*/
|
|
105
|
+
|
|
106
|
+
/**
|
|
107
|
+
* Builds the engine a formula session runs on. The default is the in-house
|
|
108
|
+
* tier; a host may inject any `CalcEngine` backend (e.g. IronCalc via
|
|
109
|
+
* `@bendyline/squisq-calc/ironcalc`) — the session only speaks the
|
|
110
|
+
* contract. A factory failure falls back to the in-house tier.
|
|
111
|
+
*/
|
|
112
|
+
type CalcEngineFactory = (config: CalcEngineConfig) => Promise<CalcEngine>;
|
|
113
|
+
interface FormulaSessionOptions {
|
|
114
|
+
engineFactory?: CalcEngineFactory;
|
|
115
|
+
}
|
|
116
|
+
interface FormulaEditRecord {
|
|
117
|
+
formula: string;
|
|
118
|
+
/** Engine result, when scalar — persisted as the cached `<v>`. */
|
|
119
|
+
cachedValue?: number | boolean | string;
|
|
120
|
+
}
|
|
121
|
+
interface XlsxFormulaSession {
|
|
122
|
+
getFormula(bodyRow: number, col: number): string | undefined;
|
|
123
|
+
/** Date cells + shared-formula masters stay locked; formulas edit. */
|
|
124
|
+
isCellLocked(bodyRow: number, col: number): boolean;
|
|
125
|
+
commitFormula(bodyRow: number, col: number, formula: string): Promise<{
|
|
126
|
+
ok: boolean;
|
|
127
|
+
error?: string;
|
|
128
|
+
updates?: TableCellEdit[];
|
|
129
|
+
}>;
|
|
130
|
+
/**
|
|
131
|
+
* Mirror a plain value edit into the engine and return the recalculated
|
|
132
|
+
* dependent updates (region formula cells whose values changed) — the
|
|
133
|
+
* live-recalc half of "edit Units, watch Revenue follow".
|
|
134
|
+
*/
|
|
135
|
+
noteValueEdit(bodyRow: number, col: number, value: TableCellValue): Promise<TableCellEdit[]>;
|
|
136
|
+
readonly dirtyCount: number;
|
|
137
|
+
/** Unsaved formula edits, keyed `"row:col"` (body coordinates). */
|
|
138
|
+
formulaEdits(): ReadonlyMap<string, FormulaEditRecord>;
|
|
139
|
+
/** Revert to the loaded workbook; returns the display updates to re-apply. */
|
|
140
|
+
discard(): Promise<TableCellEdit[]>;
|
|
141
|
+
/** Forget the edits after a successful save (values stay current). */
|
|
142
|
+
markSaved(): void;
|
|
143
|
+
dispose(): void;
|
|
144
|
+
}
|
|
145
|
+
/**
|
|
146
|
+
* Create the engine session, or null when formula editing can't be offered
|
|
147
|
+
* (calc module unavailable, or the workbook blows the interactive budget —
|
|
148
|
+
* the standing NHS-stress-workbook rule: degrade, never hang).
|
|
149
|
+
*/
|
|
150
|
+
declare function createXlsxFormulaSession(meta: XlsxSourceMeta, options?: FormulaSessionOptions): Promise<XlsxFormulaSession | null>;
|
|
12
151
|
|
|
13
152
|
/**
|
|
14
153
|
* Configuration a Scene host (diagram / drawing / layout widget) supplies
|
|
@@ -411,6 +550,13 @@ interface EditorContextValue extends EditorState, EditorActions {
|
|
|
411
550
|
* flow into the preview panel's read path. Null disables.
|
|
412
551
|
*/
|
|
413
552
|
fenceRenderers: FenceRendererMap | null;
|
|
553
|
+
/**
|
|
554
|
+
* Host clipboard adapter for code copy affordances. When omitted, the
|
|
555
|
+
* copy button on a Write-view code snippet falls back to
|
|
556
|
+
* `navigator.clipboard.writeText`. Supply this for Electron, native
|
|
557
|
+
* shells, or hosts with their own clipboard permission handling.
|
|
558
|
+
*/
|
|
559
|
+
onCopyCode: CodeBlockCopyHandler | undefined;
|
|
414
560
|
/**
|
|
415
561
|
* File name the host opened this document as (e.g. `Longview Plan.md`), if
|
|
416
562
|
* any. Used as a display-title fallback — for example, the header of a
|
|
@@ -504,6 +650,11 @@ interface EditorProviderProps {
|
|
|
504
650
|
* leave every explicit-language fence to the built-in families.
|
|
505
651
|
*/
|
|
506
652
|
fenceRenderers?: FenceRendererMap | null;
|
|
653
|
+
/**
|
|
654
|
+
* Host clipboard adapter shared by every code copy affordance. Omit to
|
|
655
|
+
* use `navigator.clipboard`.
|
|
656
|
+
*/
|
|
657
|
+
onCopyCode?: CodeBlockCopyHandler;
|
|
507
658
|
/**
|
|
508
659
|
* Extra link schemes this host resolves itself. Threaded into the link
|
|
509
660
|
* dialog's `sanitizeUrl` check so a host-custom protocol is accepted;
|
|
@@ -626,7 +777,7 @@ interface ViewPreferences {
|
|
|
626
777
|
/** Document vs. block-at-a-time layout. */
|
|
627
778
|
layoutMode?: LayoutMode;
|
|
628
779
|
}
|
|
629
|
-
declare function EditorProvider({ initialMarkdown, initialView, articleId, colorScheme: initialColorScheme, workspaceContainer, allowVersioning, versionBasename, versioningPrunePolicy, versioningAutoSaveIdleMs, onSaveVersion, mediaProvider, imageDisplayMode, mentionProvider, proofing, proofingDefaultEnabled, proofingSpellingEnabled, proofingGrammarEnabled, proofingIgnoreStore, documentLinkProvider, fenceRenderers, linkSchemes, allowRecording, allowNarrate, preserveSourceWrapping, fileName, saveCoverImageOutput, saveDashboardImageOutput, language, findMode: controlledFindMode, onFindModeChange, inlinePreview, showStatusBar, outline, blockTags, blockTagVisibility: initialBlockTagVisibility, themeInheritance, layoutMode, viewPreferences, onViewPreferencesChange, children, }: EditorProviderProps): react_jsx_runtime.JSX.Element;
|
|
780
|
+
declare function EditorProvider({ initialMarkdown, initialView, articleId, colorScheme: initialColorScheme, workspaceContainer, allowVersioning, versionBasename, versioningPrunePolicy, versioningAutoSaveIdleMs, onSaveVersion, mediaProvider, imageDisplayMode, mentionProvider, proofing, proofingDefaultEnabled, proofingSpellingEnabled, proofingGrammarEnabled, proofingIgnoreStore, documentLinkProvider, fenceRenderers, onCopyCode, linkSchemes, allowRecording, allowNarrate, preserveSourceWrapping, fileName, saveCoverImageOutput, saveDashboardImageOutput, language, findMode: controlledFindMode, onFindModeChange, inlinePreview, showStatusBar, outline, blockTags, blockTagVisibility: initialBlockTagVisibility, themeInheritance, layoutMode, viewPreferences, onViewPreferencesChange, children, }: EditorProviderProps): react_jsx_runtime.JSX.Element;
|
|
630
781
|
|
|
631
782
|
/**
|
|
632
783
|
* Host-supplied context sections rendered INSIDE the Monaco (raw/code)
|
|
@@ -904,6 +1055,13 @@ interface EditorShellProps {
|
|
|
904
1055
|
* (Slack, Discord). When omitted, the editor behaves normally.
|
|
905
1056
|
*/
|
|
906
1057
|
submitOnEnter?: () => void;
|
|
1058
|
+
/**
|
|
1059
|
+
* Calc backend for the data card's XLSX formula sessions (default: the
|
|
1060
|
+
* in-house tier from `@bendyline/squisq-calc`). Hosts inject e.g.
|
|
1061
|
+
* IronCalc: `(config) => import('@bendyline/squisq-calc/ironcalc')
|
|
1062
|
+
* .then((m) => m.createIronCalcEngine({ ...config, wasmSource }))`.
|
|
1063
|
+
*/
|
|
1064
|
+
calcEngineFactory?: CalcEngineFactory;
|
|
907
1065
|
/**
|
|
908
1066
|
* Host-supplied context dictionary rendered inside the Monaco (raw / code)
|
|
909
1067
|
* surface: collapsible markdown sections injected above anchor lines, plus
|
|
@@ -1219,7 +1377,7 @@ interface EditorShellProps {
|
|
|
1219
1377
|
* Complete markdown editor shell with toolbar, view switcher, and three
|
|
1220
1378
|
* editing modes: Raw (Monaco), WYSIWYG (Tiptap), and Preview.
|
|
1221
1379
|
*/
|
|
1222
|
-
declare function EditorShell({ initialMarkdown, initialView, hostMode, defaultViewportPreset, articleId, basePath, onChange, onLinkClick, showCodeCopyButton, onCopyCode, colorScheme, className, height, minHeight, maxHeight, mediaProvider, workspaceContainer, allowVersioning, versionBasename, versioningPrunePolicy, versioningAutoSaveIdleMs, onSaveVersion, showFilesToggle, showFilesWhenNotEmpty, showFormattingControls, showInsertControls, allowBinaryDownloads, toolbarSlotLeft, toolbarSlotAfterActions, toolbarSlotRight, statusBarSlotRight, showPlayTab, allowPresentationWindow, allowPresentationFullscreen, allowPrint, submitOnEnter, codeContext, fullWidth, uxFont, thinMargins, writeCanvasSettings, showStatusBar, imageDisplayMode, fileName, saveCoverImageOutput, saveDashboardImageOutput, language, findMode, onFindModeChange, mentionProvider, proofing, proofingDefaultEnabled, proofingSpellingEnabled, proofingGrammarEnabled, proofingIgnoreStore, documentLinkProvider, fenceRenderers, linkSchemes, allowRecording, allowNarrate, preserveSourceWrapping, placeholder, readOnly, imageSrc, imageAlt, imageMode, imageEditorContainer, onImageExport, inlinePreview, inlinePreviewWidth, outline, outlineWidth, blockTags, blockTagVisibility, themeInheritance, viewPreferences, onViewPreferencesChange, themeOverride, }: EditorShellProps): react_jsx_runtime.JSX.Element;
|
|
1380
|
+
declare function EditorShell({ initialMarkdown, initialView, hostMode, defaultViewportPreset, articleId, basePath, onChange, onLinkClick, showCodeCopyButton, onCopyCode, colorScheme, className, height, minHeight, maxHeight, mediaProvider, workspaceContainer, allowVersioning, versionBasename, versioningPrunePolicy, versioningAutoSaveIdleMs, onSaveVersion, showFilesToggle, showFilesWhenNotEmpty, showFormattingControls, showInsertControls, allowBinaryDownloads, toolbarSlotLeft, toolbarSlotAfterActions, toolbarSlotRight, statusBarSlotRight, showPlayTab, allowPresentationWindow, allowPresentationFullscreen, allowPrint, submitOnEnter, calcEngineFactory, codeContext, fullWidth, uxFont, thinMargins, writeCanvasSettings, showStatusBar, imageDisplayMode, fileName, saveCoverImageOutput, saveDashboardImageOutput, language, findMode, onFindModeChange, mentionProvider, proofing, proofingDefaultEnabled, proofingSpellingEnabled, proofingGrammarEnabled, proofingIgnoreStore, documentLinkProvider, fenceRenderers, linkSchemes, allowRecording, allowNarrate, preserveSourceWrapping, placeholder, readOnly, imageSrc, imageAlt, imageMode, imageEditorContainer, onImageExport, inlinePreview, inlinePreviewWidth, outline, outlineWidth, blockTags, blockTagVisibility, themeInheritance, viewPreferences, onViewPreferencesChange, themeOverride, }: EditorShellProps): react_jsx_runtime.JSX.Element;
|
|
1223
1381
|
|
|
1224
1382
|
/**
|
|
1225
1383
|
* Shared editor context menu.
|
|
@@ -1267,7 +1425,7 @@ interface EditorContextMenuProviderProps {
|
|
|
1267
1425
|
* Context-menu owner used by EditorShell. Exported for hosts that compose the
|
|
1268
1426
|
* lower-level RawEditor/WysiwygEditor primitives into their own shell.
|
|
1269
1427
|
*/
|
|
1270
|
-
declare function EditorContextMenuProvider({ rootRef, readOnly, children, }: EditorContextMenuProviderProps):
|
|
1428
|
+
declare function EditorContextMenuProvider({ rootRef, readOnly, children, }: EditorContextMenuProviderProps): ReactElement;
|
|
1271
1429
|
|
|
1272
1430
|
/**
|
|
1273
1431
|
* RawEditor
|
|
@@ -1325,12 +1483,24 @@ interface WysiwygEditorProps {
|
|
|
1325
1483
|
readOnly?: boolean;
|
|
1326
1484
|
/** Host-controlled base text size and line spacing for the Write canvas. */
|
|
1327
1485
|
writeCanvasSettings?: WriteCanvasSettings;
|
|
1486
|
+
/**
|
|
1487
|
+
* Open the shell's Files panel — the data card's "Show in Files" button.
|
|
1488
|
+
* Receives the sidecar path so hosts with a focusable file list can jump
|
|
1489
|
+
* to it. Omitted (e.g. no media provider host) hides the affordance.
|
|
1490
|
+
*/
|
|
1491
|
+
onOpenFilesPanel?: (relativePath?: string) => void;
|
|
1492
|
+
/**
|
|
1493
|
+
* Calc backend for the data card's formula sessions. Default: the
|
|
1494
|
+
* in-house tier. A host may inject another `CalcEngine` implementation
|
|
1495
|
+
* (e.g. IronCalc via `@bendyline/squisq-calc/ironcalc`).
|
|
1496
|
+
*/
|
|
1497
|
+
calcEngineFactory?: CalcEngineFactory;
|
|
1328
1498
|
}
|
|
1329
1499
|
/**
|
|
1330
1500
|
* Rich WYSIWYG markdown editor built on Tiptap (ProseMirror).
|
|
1331
1501
|
* Binds to the shared EditorContext for source synchronization.
|
|
1332
1502
|
*/
|
|
1333
|
-
declare function WysiwygEditor({ placeholder, className, submitOnEnter, readOnly, writeCanvasSettings, }: WysiwygEditorProps): react_jsx_runtime.JSX.Element;
|
|
1503
|
+
declare function WysiwygEditor({ placeholder, className, submitOnEnter, readOnly, writeCanvasSettings, onOpenFilesPanel, calcEngineFactory, }: WysiwygEditorProps): react_jsx_runtime.JSX.Element;
|
|
1334
1504
|
|
|
1335
1505
|
interface PreviewPanelProps {
|
|
1336
1506
|
/** Base path for resolving media URLs in DocPlayer */
|
|
@@ -1357,4 +1527,4 @@ interface PreviewPanelProps {
|
|
|
1357
1527
|
*/
|
|
1358
1528
|
declare function PreviewPanel({ basePath, className, workspaceContainer, onLinkClick, showCodeCopyButton, onCopyCode, }: PreviewPanelProps): react_jsx_runtime.JSX.Element;
|
|
1359
1529
|
|
|
1360
|
-
export { type BlockTagVisibility as B, type CodeContext as C, type DashboardImageSaveOutput as D, type EditorHostMode as E, type ImageDisplayMode as I, type LayoutMode as L, type MentionCandidate as M, PreviewPanel as P, RawEditor as R, type SceneTextChannel as S, type ThemeInheritance as T, type ViewPreferences as V, type WriteCanvasSettings as W, type
|
|
1530
|
+
export { WysiwygEditor as A, type BlockTagVisibility as B, type CodeContext as C, type DashboardImageSaveOutput as D, type EditorHostMode as E, type FormulaEditRecord as F, type WysiwygEditorProps as G, XLSX_LOCKED_REASON as H, type ImageDisplayMode as I, type XlsxFormulaSession as J, createXlsxFormulaSession as K, type LayoutMode as L, type MentionCandidate as M, ingestSidecarBytes as N, useEditorContext as O, PreviewPanel as P, useEditorContextMenuItems as Q, RawEditor as R, type SceneTextChannel as S, type ThemeInheritance as T, type ViewPreferences as V, type WriteCanvasSettings as W, type XlsxSourceMeta as X, type CalcEngineFactory as a, type CsvSourceMeta as b, type CodeContextSection as c, type CoverImageSaveOutput as d, type DocumentLinkCandidate as e, type DocumentLinkProvider as f, type EditorActions as g, type EditorColorScheme as h, type EditorContextMenuContext as i, type EditorContextMenuItem as j, type EditorContextMenuItemVisibility as k, EditorContextMenuProvider as l, type EditorContextMenuProviderProps as m, type EditorContextValue as n, type EditorMode as o, EditorProvider as p, type EditorProviderProps as q, EditorShell as r, type EditorShellProps as s, type EditorState as t, type EditorView as u, type FormulaSessionOptions as v, type IngestedSidecar as w, type MentionProvider as x, type PreviewPanelProps as y, type RawEditorProps as z };
|