@stll/folio-core 0.74.0 → 0.76.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/dist/ai-edits/clean-text.d.ts +4 -1
- package/dist/ai-edits/clean-text.js +21 -7
- package/dist/ai-edits/headless.d.ts +7 -3
- package/dist/ai-edits/headless.js +36 -21
- package/dist/ai-edits/note-references.d.ts +1 -1
- package/dist/ai-edits/note-references.js +1 -1
- package/dist/ai-edits/pending-suggestions.d.ts +9 -7
- package/dist/ai-edits/pending-suggestions.js +135 -90
- package/dist/ai-edits/pendingJoin.d.ts +5 -1
- package/dist/ai-edits/pendingJoin.js +6 -2
- package/dist/ai-edits/read.js +9 -3
- package/dist/ai-edits/retired-comment-receipts.d.ts +2 -2
- package/dist/ai-edits/retired-comment-receipts.js +3 -18
- package/dist/ai-edits/tracked-batch-fidelity.d.ts +6 -10
- package/dist/ai-edits/tracked-batch-fidelity.js +3 -182
- package/dist/ai-edits/types.d.ts +9 -4
- package/dist/canonical/batchCommentReferences.js +2 -1
- package/dist/canonical/canonicalBatchReview.d.ts +4 -1
- package/dist/canonical/canonicalBatchReview.js +37 -22
- package/dist/canonical/canonicalComments.d.ts +6 -2
- package/dist/canonical/canonicalComments.js +16 -6
- package/dist/canonical/canonicalCompilerRefusal.d.ts +2 -4
- package/dist/canonical/canonicalCompilerRefusal.js +20 -14
- package/dist/canonical/canonicalPublicOperations.js +231 -79
- package/dist/canonical/canonicalRefusalGrounds.d.ts +4 -0
- package/dist/canonical/canonicalRefusalGrounds.js +56 -0
- package/dist/canonical/canonicalSession.d.ts +12 -6
- package/dist/canonical/canonicalSession.js +119 -122
- package/dist/canonical/canonicalTrackedBatchFidelity.js +3 -3
- package/dist/compare/inline-atoms.d.ts +35 -41
- package/dist/compare/inline-atoms.js +2 -465
- package/dist/compare/section-boundary-properties.d.ts +3 -30
- package/dist/compare/section-boundary-properties.js +4 -72
- package/dist/controller/canonicalClipboard.d.ts +1 -1
- package/dist/controller/canonicalClipboard.js +110 -55
- package/dist/controller/canonicalComposition.d.ts +1 -1
- package/dist/controller/canonicalComposition.js +5 -5
- package/dist/controller/canonicalContentControlValue.js +7 -7
- package/dist/controller/canonicalInput.d.ts +4 -2
- package/dist/controller/canonicalInput.js +33 -16
- package/dist/controller/canonicalReview.d.ts +21 -0
- package/dist/controller/canonicalReview.js +44 -9
- package/dist/controller/canonicalStoryEditor.d.ts +2 -3
- package/dist/controller/canonicalStoryEditor.js +43 -25
- package/dist/controller/canonicalStructure.d.ts +19 -3
- package/dist/controller/canonicalStructure.js +182 -58
- package/dist/controller/deferredDisplayListPainter.d.ts +8 -0
- package/dist/controller/deferredDisplayListPainter.js +34 -0
- package/dist/controller/folioEditor.js +4 -2
- package/dist/controller/fontReadiness.js +50 -23
- package/dist/controller/headerFooterEditorManager.js +3 -17
- package/dist/controller/hiddenEditorApi.d.ts +24 -3
- package/dist/controller/hiddenEditorApi.js +2 -0
- package/dist/controller/hiddenEditorManager.js +135 -207
- package/dist/controller/layoutPipeline.d.ts +4 -86
- package/dist/controller/layoutPipeline.js +8 -727
- package/dist/controller/layoutPipelineExecution.d.ts +94 -0
- package/dist/controller/layoutPipelineExecution.js +730 -0
- package/dist/controller/noteEditorManager.js +3 -16
- package/dist/docx/blockContentParser.d.ts +1 -3
- package/dist/docx/blockContentParser.js +3 -10
- package/dist/docx/bulletMarkers.d.ts +8 -0
- package/dist/docx/bulletMarkers.js +9 -1
- package/dist/docx/canonicalSave.d.ts +4 -3
- package/dist/docx/canonicalSave.js +4 -3
- package/dist/docx/canonicalSessionInput.js +25 -11
- package/dist/docx/ensureParaIds.d.ts +31 -0
- package/dist/docx/ensureParaIds.js +57 -32
- package/dist/docx/ensureUniqueControlIds.d.ts +13 -0
- package/dist/docx/ensureUniqueControlIds.js +47 -29
- package/dist/docx/ensureUniqueRevisionIds.d.ts +13 -0
- package/dist/docx/ensureUniqueRevisionIds.js +52 -29
- package/dist/docx/listMarkerComputation.d.ts +24 -17
- package/dist/docx/listMarkerComputation.js +31 -60
- package/dist/docx/listModelNormalization.js +8 -15
- package/dist/docx/rezip.d.ts +16 -3
- package/dist/docx/rezip.js +35 -9
- package/dist/docx/selectiveSave.js +13 -5
- package/dist/docx/server/templatePlan/apply.js +96 -7
- package/dist/docx/server/templatePlan/blocks.d.ts +70 -3
- package/dist/docx/server/templatePlan/blocks.js +272 -10
- package/dist/docx/server/templatePlan/builders.d.ts +52 -2
- package/dist/docx/server/templatePlan/builders.js +224 -5
- package/dist/docx/server/templatePlan/effects.d.ts +27 -0
- package/dist/docx/server/templatePlan/effects.js +188 -0
- package/dist/docx/server/templatePlan/emit.d.ts +4 -1
- package/dist/docx/server/templatePlan/emit.js +46 -2
- package/dist/docx/server/templatePlan/inspect.js +39 -52
- package/dist/docx/server/templatePlan/labels.d.ts +7 -2
- package/dist/docx/server/templatePlan/labels.js +120 -23
- package/dist/docx/server/templatePlan/plan.d.ts +24 -3
- package/dist/docx/server/templatePlan/plan.js +54 -15
- package/dist/docx/server/templatePlan/planShape.js +76 -22
- package/dist/docx/server/templatePlan/revisions.d.ts +46 -0
- package/dist/docx/server/templatePlan/revisions.js +407 -0
- package/dist/docx/server/templatePlan/story.d.ts +23 -1
- package/dist/docx/server/templatePlan/story.js +60 -2
- package/dist/docx/server/templatePlan/types.d.ts +354 -16
- package/dist/docx/server/templatePlan/verify.js +164 -14
- package/dist/docx/server/templatePlan/xml.d.ts +3 -0
- package/dist/docx/server/templatePlan/xml.js +4 -1
- package/dist/i18n/messages/ar.gen.js +1 -0
- package/dist/i18n/messages/catalogs.gen.d.ts +17 -0
- package/dist/i18n/messages/catalogs.gen.js +17 -0
- package/dist/i18n/messages/cs.gen.js +1 -0
- package/dist/i18n/messages/de.gen.js +1 -0
- package/dist/i18n/messages/en.gen.js +1 -0
- package/dist/i18n/messages/es.gen.js +1 -0
- package/dist/i18n/messages/et.gen.js +1 -0
- package/dist/i18n/messages/fr.gen.js +1 -0
- package/dist/i18n/messages/he.gen.js +1 -0
- package/dist/i18n/messages/hi.gen.js +1 -0
- package/dist/i18n/messages/hu.gen.js +1 -0
- package/dist/i18n/messages/lt.gen.js +1 -0
- package/dist/i18n/messages/lv.gen.js +1 -0
- package/dist/i18n/messages/messages.gen.d.ts +1 -0
- package/dist/i18n/messages/pl.gen.js +1 -0
- package/dist/i18n/messages/pt-BR.gen.js +1 -0
- package/dist/i18n/messages/sk.gen.js +1 -0
- package/dist/i18n/messages/tr.gen.js +1 -0
- package/dist/i18n/messages/zh-CN.gen.js +1 -0
- package/dist/internal/revisionResolutionStep.d.ts +2 -31
- package/dist/internal/revisionResolutionStep.js +2 -171
- package/dist/layout-bridge/convert/toFlowBlocks.js +0 -12
- package/dist/layout-bridge/convert/topLevelConversion.js +1 -10
- package/dist/prosemirror/commands/comments.d.ts +6 -234
- package/dist/prosemirror/commands/comments.js +5 -2464
- package/dist/prosemirror/commands/index.d.ts +4 -2
- package/dist/prosemirror/commands/index.js +4 -2
- package/dist/prosemirror/commands/tableCellMergeResolution.d.ts +1 -11
- package/dist/prosemirror/commands/tableCellMergeResolution.js +3 -154
- package/dist/prosemirror/extensions/features/ImagePasteExtension.js +1 -1
- package/dist/prosemirror/extensions/marks/HyperlinkExtension.js +6 -8
- package/dist/prosemirror/hyperlinkRemoval.d.ts +11 -8
- package/dist/prosemirror/hyperlinkRemoval.js +24 -15
- package/dist/prosemirror/listMarker.d.ts +1 -6
- package/dist/prosemirror/listMarker.js +4 -56
- package/dist/prosemirror/paraIds.d.ts +1 -14
- package/dist/prosemirror/paraIds.js +1 -14
- package/dist/prosemirror/paragraphMarkJoin.d.ts +0 -16
- package/dist/prosemirror/paragraphMarkJoin.js +3 -46
- package/dist/prosemirror/projectionReview.d.ts +49 -0
- package/dist/prosemirror/projectionReview.js +292 -0
- package/dist/prosemirror/rebaseParagraphRunFormatting.d.ts +1 -13
- package/dist/prosemirror/rebaseParagraphRunFormatting.js +1 -16
- package/dist/prosemirror/replacedAnnotations.d.ts +2 -5
- package/dist/prosemirror/replacedAnnotations.js +1 -10
- package/dist/prosemirror/revisionCarriers.d.ts +9 -1
- package/dist/prosemirror/revisionCarriers.js +15 -1
- package/dist/prosemirror/revisionRangeQueries.d.ts +32 -0
- package/dist/prosemirror/revisionRangeQueries.js +76 -0
- package/dist/prosemirror/runFormattingMarkNames.d.ts +1 -1
- package/dist/prosemirror/runFormattingMarkNames.js +1 -1
- package/dist/prosemirror/suggestionQueries.d.ts +114 -0
- package/dist/prosemirror/suggestionQueries.js +320 -0
- package/dist/prosemirror/tableGridMutation.d.ts +1 -16
- package/dist/prosemirror/tableGridMutation.js +1 -78
- package/dist/prosemirror/tableRowRevisionOwnership.d.ts +18 -0
- package/dist/prosemirror/tableRowRevisionOwnership.js +7 -0
- package/dist/prosemirror/utils/extractTrackedChanges.js +14 -4
- package/dist/server.d.ts +2 -2
- package/dist/types/canonicalCapabilities.d.ts +40 -69
- package/dist/types/canonicalCapabilities.js +51 -65
- package/dist/types/canonicalComments.d.ts +2 -2
- package/dist/types/canonicalSections.d.ts +2 -2
- package/dist/utils/clipboard.d.ts +2 -28
- package/dist/utils/clipboard.js +1 -96
- package/dist/utils/clipboardFiles.d.ts +27 -0
- package/dist/utils/clipboardFiles.js +98 -0
- package/dist/utils/rulerControl.d.ts +1 -0
- package/dist/utils/rulerControl.js +2 -1
- package/package.json +2 -2
- package/dist/internal/headlessRevisionResolutionGuard.d.ts +0 -3
- package/dist/internal/headlessRevisionResolutionGuard.js +0 -18
|
@@ -4,11 +4,12 @@ import { createNote } from "../docx/noteReferenceMark.js";
|
|
|
4
4
|
import { getCachedNumberingMap, numberingLevelUsesBulletMarker } from "../docx/numberingParser.js";
|
|
5
5
|
import { cloneParagraphWithoutPropertySource } from "../docx/paragraphPropertySource.js";
|
|
6
6
|
import { visitDocxParagraphs } from "../docx/paragraphTraversal.js";
|
|
7
|
+
import { canonicalCellSelectionRanges } from "../prosemirror/canonicalSelectionRange.js";
|
|
7
8
|
import { listRequestsForMarker } from "../prosemirror/listAutoformatMarkers.js";
|
|
8
9
|
import { unusedListInstanceFor } from "../prosemirror/listNumbering.js";
|
|
9
10
|
import { effectiveParagraphNumbering, paragraphNumberingSourcesFromBoundary } from "../prosemirror/numberingAttr.js";
|
|
10
11
|
import { createStyleResolver } from "../prosemirror/styles/styleResolver.js";
|
|
11
|
-
import {
|
|
12
|
+
import { CANONICAL_CONDITION } from "../types/canonicalCapabilities.js";
|
|
12
13
|
import { readModel } from "../types/documentModel.js";
|
|
13
14
|
import { maxOf } from "../utils/extremes.js";
|
|
14
15
|
import { collectHeadings } from "../utils/headingCollector.js";
|
|
@@ -31,18 +32,18 @@ const currentSectionEndpoint = (paragraph) => {
|
|
|
31
32
|
if (Object.hasOwn(paragraph, "sectionProperties")) return { type: "undefined" };
|
|
32
33
|
return { type: "omitted" };
|
|
33
34
|
};
|
|
34
|
-
const
|
|
35
|
-
|
|
36
|
-
ground: { gap: CANONICAL_GAP.commands },
|
|
35
|
+
const refuse = (message, condition) => Result.err(new CanonicalSessionError({
|
|
36
|
+
ground: { condition },
|
|
37
37
|
message,
|
|
38
38
|
reason: "refused"
|
|
39
39
|
}));
|
|
40
|
+
/** The request asks for nothing to change; hosts report no refusal for it. */
|
|
40
41
|
const noChange = (message) => Result.err(new CanonicalSessionError({
|
|
41
|
-
ground: {
|
|
42
|
+
ground: { condition: CANONICAL_CONDITION.invalidRequest },
|
|
42
43
|
message,
|
|
43
44
|
reason: "noChange"
|
|
44
45
|
}));
|
|
45
|
-
const selectedParagraphs = (
|
|
46
|
+
const selectedParagraphs = (projection, state, topLevelOnly = false) => {
|
|
46
47
|
const ids = /* @__PURE__ */ new Set();
|
|
47
48
|
const paragraphs = [];
|
|
48
49
|
state.doc.nodesBetween(state.selection.from, state.selection.to, (node, position) => {
|
|
@@ -51,7 +52,7 @@ const selectedParagraphs = (session, state, topLevelOnly = false) => {
|
|
|
51
52
|
const id = node.attrs["paraId"];
|
|
52
53
|
if (ids.has(id)) return;
|
|
53
54
|
ids.add(id);
|
|
54
|
-
const paragraph =
|
|
55
|
+
const paragraph = projection.paragraph(id)?.source;
|
|
55
56
|
if (paragraph !== void 0) paragraphs.push(paragraph);
|
|
56
57
|
});
|
|
57
58
|
return paragraphs;
|
|
@@ -73,14 +74,14 @@ const numberingRemoval = (session) => {
|
|
|
73
74
|
/** Whether a paragraph is in a list, by numbering of its own or its style's. */
|
|
74
75
|
const isCanonicalListParagraph = (paragraph) => effectiveNumbering(paragraph).kind === "reference";
|
|
75
76
|
/** Each selected paragraph with the block container that owns it. A list may run through several containers, such as table cells, as the editor applies it. */
|
|
76
|
-
const paragraphPositions = (
|
|
77
|
+
const paragraphPositions = (projection, paragraphs) => {
|
|
77
78
|
if (paragraphs.length === 0) return noChange("List changes require a paragraph selection.");
|
|
78
79
|
const positions = [];
|
|
79
80
|
for (const paragraph of paragraphs) {
|
|
80
|
-
const address =
|
|
81
|
-
if (address === void 0) return refuse("A selected paragraph has no canonical address.");
|
|
81
|
+
const address = projection.paragraph(paragraph.paraId ?? "");
|
|
82
|
+
if (address === void 0) return refuse("A selected paragraph has no canonical address.", CANONICAL_CONDITION.stale);
|
|
82
83
|
const index = address.container.findIndex((item) => item === paragraph);
|
|
83
|
-
if (index < 0) return refuse("A selected paragraph is missing from its block container.");
|
|
84
|
+
if (index < 0) return refuse("A selected paragraph is missing from its block container.", CANONICAL_CONDITION.stale);
|
|
84
85
|
positions.push({
|
|
85
86
|
container: address.container,
|
|
86
87
|
index,
|
|
@@ -119,7 +120,7 @@ const referencedNumIds = (document) => {
|
|
|
119
120
|
});
|
|
120
121
|
return referenced;
|
|
121
122
|
};
|
|
122
|
-
const numberingIntent = (session, positions, request) => {
|
|
123
|
+
const numberingIntent = (session, positions, request, story = OP_STORIES.MAIN) => {
|
|
123
124
|
const definitions = readModel(session.document).package.numbering;
|
|
124
125
|
const map = definitions === void 0 ? void 0 : getCachedNumberingMap(definitions);
|
|
125
126
|
const container = positions.at(0)?.container ?? [];
|
|
@@ -181,7 +182,7 @@ const numberingIntent = (session, positions, request) => {
|
|
|
181
182
|
target,
|
|
182
183
|
items: positions.map(({ paragraph }) => ({
|
|
183
184
|
at: {
|
|
184
|
-
story
|
|
185
|
+
story,
|
|
185
186
|
blockId: paragraph.paraId ?? "",
|
|
186
187
|
offset: 0
|
|
187
188
|
},
|
|
@@ -189,23 +190,62 @@ const numberingIntent = (session, positions, request) => {
|
|
|
189
190
|
}))
|
|
190
191
|
};
|
|
191
192
|
};
|
|
192
|
-
/**
|
|
193
|
-
|
|
193
|
+
/**
|
|
194
|
+
* Note and contents commands over selected cells, placed as over the text
|
|
195
|
+
* they hold: a note reference follows the selected text, at the end of the
|
|
196
|
+
* last selected cell's text; a table of contents goes where the selection
|
|
197
|
+
* starts, at the start of the first selected cell's text. A note reference is
|
|
198
|
+
* deleted only from a selected cell, not from a cell the range passes over.
|
|
199
|
+
*/
|
|
200
|
+
const placeInSelectedCells = (state, commands) => {
|
|
201
|
+
const { selection } = state;
|
|
202
|
+
if (!(selection instanceof CellSelection)) return commands;
|
|
203
|
+
const ranges = canonicalCellSelectionRanges(selection);
|
|
204
|
+
const first = ranges.at(0);
|
|
205
|
+
const last = ranges.at(-1);
|
|
206
|
+
if ((first === void 0 || last === void 0) && commands.some(({ type }) => type === "insertNote" || type === "generateTOC")) return null;
|
|
207
|
+
return commands.flatMap((command) => {
|
|
208
|
+
switch (command.type) {
|
|
209
|
+
case "insertNote": return last === void 0 ? [] : [{
|
|
210
|
+
...command,
|
|
211
|
+
at: last.to
|
|
212
|
+
}];
|
|
213
|
+
case "generateTOC": return first === void 0 ? [] : [{
|
|
214
|
+
...command,
|
|
215
|
+
at: first.from
|
|
216
|
+
}];
|
|
217
|
+
case "deleteNote": return ranges.some(({ from, to }) => from <= command.from && command.from <= to) ? [command] : [];
|
|
218
|
+
default: return [command];
|
|
219
|
+
}
|
|
220
|
+
});
|
|
221
|
+
};
|
|
222
|
+
/**
|
|
223
|
+
* Toolbar meanings enter the same operation journal as native input, in the
|
|
224
|
+
* story whose editor holds `state`: the body, or a header, footer or note.
|
|
225
|
+
*/
|
|
226
|
+
const prepareCanonicalCommands = (session, state, requested, story = OP_STORIES.MAIN) => {
|
|
227
|
+
if (story !== OP_STORIES.MAIN && requested.some(({ type }) => type === "setSectionBreak" || type === "removeSectionBreak" || type === "insertNote" || type === "deleteNote" || type === "generateTOC")) return refuse("Section breaks, notes and tables of contents go in the main story.", CANONICAL_CONDITION.invalidRequest);
|
|
228
|
+
const projected = session.projectStory(story);
|
|
229
|
+
if (projected.isErr()) return projected;
|
|
230
|
+
const projection = projected.value;
|
|
231
|
+
const commands = placeInSelectedCells(state, requested);
|
|
232
|
+
if (commands === null) return refuse("The selected cells hold no text for a note or a table of contents.", CANONICAL_CONDITION.invalidRequest);
|
|
194
233
|
const replacements = commands.filter((command) => command.type === "replaceText");
|
|
195
234
|
if (replacements.length > 0) {
|
|
196
|
-
if (replacements.length !== commands.length) return refuse("A text replacement must be prepared on its own.");
|
|
235
|
+
if (replacements.length !== commands.length) return refuse("A text replacement must be prepared on its own.", CANONICAL_CONDITION.invalidRequest);
|
|
197
236
|
const [only] = replacements;
|
|
198
237
|
if (only !== void 0 && replacements.length === 1) return session.prepareReplace(state, {
|
|
199
238
|
from: only.from,
|
|
200
239
|
to: only.to,
|
|
201
|
-
text: only.text
|
|
240
|
+
text: only.text,
|
|
241
|
+
story
|
|
202
242
|
});
|
|
203
243
|
const intents = [];
|
|
204
244
|
for (const replacement of replacements) {
|
|
205
|
-
const edges =
|
|
206
|
-
const from =
|
|
245
|
+
const edges = projection.rangeEdgesAt(replacement.from, replacement.to);
|
|
246
|
+
const from = projection.inputAddressAt(replacement.from, edges.start);
|
|
207
247
|
if (from.isErr()) return from;
|
|
208
|
-
const to =
|
|
248
|
+
const to = projection.inputAddressAt(replacement.to, edges.end);
|
|
209
249
|
if (to.isErr()) return to;
|
|
210
250
|
intents.push({
|
|
211
251
|
type: "replaceText",
|
|
@@ -216,19 +256,18 @@ const prepareCanonicalCommands = (session, state, commands) => {
|
|
|
216
256
|
}
|
|
217
257
|
return session.prepareIntents(state, { intents });
|
|
218
258
|
}
|
|
219
|
-
if (state.selection instanceof CellSelection && commands.some(({ type }) => type === "generateTOC" || type === "insertNote" || type === "deleteNote")) return refuse(CELL_SELECTION_PLACEMENT_REFUSAL);
|
|
220
259
|
const intents = [];
|
|
221
260
|
const valueCommands = commands.filter((command) => command.type === "setContentControlValue");
|
|
222
261
|
if (valueCommands.length > 0) {
|
|
223
262
|
const [valueCommand] = valueCommands;
|
|
224
|
-
if (valueCommand === void 0 || commands.length !== 1) return refuse("A content control's value must be set on its own.");
|
|
263
|
+
if (valueCommand === void 0 || commands.length !== 1) return refuse("A content control's value must be set on its own.", CANONICAL_CONDITION.invalidRequest);
|
|
225
264
|
return prepareContentControlValue(session, state, valueCommand);
|
|
226
265
|
}
|
|
227
266
|
const sectionCommands = commands.filter((command) => command.type === "setSectionBreak" || command.type === "removeSectionBreak");
|
|
228
267
|
if (sectionCommands.length > 0) {
|
|
229
|
-
if (sectionCommands.length !== commands.length || sectionCommands.length !== 1) return refuse("A section change must be prepared on its own.");
|
|
230
|
-
const paragraphs = selectedParagraphs(
|
|
231
|
-
if (paragraphs.length === 0) return refuse("Section breaks require a top-level document paragraph.");
|
|
268
|
+
if (sectionCommands.length !== commands.length || sectionCommands.length !== 1) return refuse("A section change must be prepared on its own.", CANONICAL_CONDITION.invalidRequest);
|
|
269
|
+
const paragraphs = selectedParagraphs(projection, state, true);
|
|
270
|
+
if (paragraphs.length === 0) return refuse("Section breaks require a top-level document paragraph.", CANONICAL_CONDITION.invalidRequest);
|
|
232
271
|
const command = sectionCommands.at(0) ?? panic("A section command was counted.");
|
|
233
272
|
return session.prepareOperations(state, paragraphs.map((paragraph) => {
|
|
234
273
|
const current = paragraph.sectionProperties;
|
|
@@ -250,17 +289,17 @@ const prepareCanonicalCommands = (session, state, commands) => {
|
|
|
250
289
|
};
|
|
251
290
|
}));
|
|
252
291
|
}
|
|
253
|
-
const paragraphs = selectedParagraphs(
|
|
292
|
+
const paragraphs = selectedParagraphs(projection, state);
|
|
254
293
|
const noteCommands = commands.filter((command) => command.type === "insertNote" || command.type === "deleteNote");
|
|
255
294
|
if (noteCommands.length > 0) {
|
|
256
|
-
if (noteCommands.length !== commands.length) return refuse("Note changes must be prepared on their own.");
|
|
295
|
+
if (noteCommands.length !== commands.length) return refuse("Note changes must be prepared on their own.", CANONICAL_CONDITION.invalidRequest);
|
|
257
296
|
const ops = [];
|
|
258
297
|
const ordered = noteCommands.toReversed();
|
|
259
298
|
const blockIdGroups = session.freshBlockIds(ordered.map((command) => command.type === "insertNote" ? command.content.length : 0));
|
|
260
299
|
if (blockIdGroups.isErr()) return blockIdGroups;
|
|
261
300
|
for (const [commandIndex, command] of ordered.entries()) {
|
|
262
301
|
if (command.type === "deleteNote") {
|
|
263
|
-
const at =
|
|
302
|
+
const at = projection.addressAt(command.from);
|
|
264
303
|
if (at.isErr()) return at;
|
|
265
304
|
ops.push({
|
|
266
305
|
type: DOCUMENT_OP_TYPES.REMOVE_NOTE,
|
|
@@ -272,9 +311,9 @@ const prepareCanonicalCommands = (session, state, commands) => {
|
|
|
272
311
|
});
|
|
273
312
|
continue;
|
|
274
313
|
}
|
|
275
|
-
const at =
|
|
314
|
+
const at = projection.addressAt(command.at);
|
|
276
315
|
if (at.isErr()) return at;
|
|
277
|
-
if (command.content.some((block) => block.type !== "paragraph")) return refuse("Canonical note insertion requires paragraph content.");
|
|
316
|
+
if (command.content.some((block) => block.type !== "paragraph")) return refuse("Canonical note insertion requires paragraph content.", CANONICAL_CONDITION.invalidRequest);
|
|
278
317
|
const blockIds = blockIdGroups.value[commandIndex] ?? panic("A fresh identity group was reserved per note.");
|
|
279
318
|
const content = command.content.map((block, index) => {
|
|
280
319
|
if (block.type !== "paragraph") panic("Canonical note content was already validated.");
|
|
@@ -290,16 +329,16 @@ const prepareCanonicalCommands = (session, state, commands) => {
|
|
|
290
329
|
}
|
|
291
330
|
for (const command of commands) switch (command.type) {
|
|
292
331
|
case "generateTOC": {
|
|
293
|
-
const at =
|
|
332
|
+
const at = projection.addressAt(command.at);
|
|
294
333
|
if (at.isErr()) return at;
|
|
295
334
|
const definitions = readModel(session.document).package.styles;
|
|
296
335
|
const styles = createBuiltInStyleIndex(definitions?.styles ?? [], definitions?.docDefaults);
|
|
297
336
|
const headings = [];
|
|
298
|
-
for (const heading of collectHeadings(
|
|
299
|
-
const address =
|
|
337
|
+
for (const heading of collectHeadings(projection.doc, styles)) {
|
|
338
|
+
const address = projection.addressAt(heading.pmPos + 1);
|
|
300
339
|
if (address.isErr()) return address;
|
|
301
340
|
const outline = headingOutlineLevel(heading.level);
|
|
302
|
-
if (outline?.kind !== "heading") return refuse("A TOC heading has an invalid outline level.");
|
|
341
|
+
if (outline?.kind !== "heading") return refuse("A TOC heading has an invalid outline level.", CANONICAL_CONDITION.invalidRequest);
|
|
303
342
|
const styleId = styles.styleIdForTableOfContentsLevel(outline.level + 1);
|
|
304
343
|
headings.push({
|
|
305
344
|
blockId: address.value.blockId,
|
|
@@ -325,9 +364,9 @@ const prepareCanonicalCommands = (session, state, commands) => {
|
|
|
325
364
|
case "setHyperlink":
|
|
326
365
|
case "removeHyperlink":
|
|
327
366
|
case "insertHyperlink": {
|
|
328
|
-
const from =
|
|
367
|
+
const from = projection.addressAt(command.from);
|
|
329
368
|
if (from.isErr()) return from;
|
|
330
|
-
const to =
|
|
369
|
+
const to = projection.addressAt(command.to);
|
|
331
370
|
if (to.isErr()) return to;
|
|
332
371
|
intents.push({
|
|
333
372
|
...command,
|
|
@@ -338,7 +377,7 @@ const prepareCanonicalCommands = (session, state, commands) => {
|
|
|
338
377
|
}
|
|
339
378
|
case "formatTable":
|
|
340
379
|
for (const target of command.targets) {
|
|
341
|
-
const at =
|
|
380
|
+
const at = projection.addressAt(target.at);
|
|
342
381
|
if (at.isErr()) return at;
|
|
343
382
|
const address = {
|
|
344
383
|
story: at.value.story,
|
|
@@ -380,7 +419,7 @@ const prepareCanonicalCommands = (session, state, commands) => {
|
|
|
380
419
|
}
|
|
381
420
|
break;
|
|
382
421
|
case "editTableBlock": {
|
|
383
|
-
const at =
|
|
422
|
+
const at = projection.addressAt(command.at);
|
|
384
423
|
if (at.isErr()) return at;
|
|
385
424
|
intents.push({
|
|
386
425
|
type: "tableBlock",
|
|
@@ -393,7 +432,7 @@ const prepareCanonicalCommands = (session, state, commands) => {
|
|
|
393
432
|
break;
|
|
394
433
|
}
|
|
395
434
|
case "editTableRow": {
|
|
396
|
-
const at =
|
|
435
|
+
const at = projection.addressAt(command.at);
|
|
397
436
|
if (at.isErr()) return at;
|
|
398
437
|
intents.push({
|
|
399
438
|
type: "tableRow",
|
|
@@ -406,7 +445,7 @@ const prepareCanonicalCommands = (session, state, commands) => {
|
|
|
406
445
|
break;
|
|
407
446
|
}
|
|
408
447
|
case "editTable": {
|
|
409
|
-
const at =
|
|
448
|
+
const at = projection.addressAt(command.at);
|
|
410
449
|
if (at.isErr()) return at;
|
|
411
450
|
intents.push({
|
|
412
451
|
type: "table",
|
|
@@ -420,9 +459,9 @@ const prepareCanonicalCommands = (session, state, commands) => {
|
|
|
420
459
|
}
|
|
421
460
|
case "selection": break;
|
|
422
461
|
case "insertBreak": {
|
|
423
|
-
const from =
|
|
462
|
+
const from = projection.addressAt(command.from);
|
|
424
463
|
if (from.isErr()) return from;
|
|
425
|
-
const to =
|
|
464
|
+
const to = projection.addressAt(command.to);
|
|
426
465
|
if (to.isErr()) return to;
|
|
427
466
|
intents.push({
|
|
428
467
|
type: "insertAtom",
|
|
@@ -442,9 +481,9 @@ const prepareCanonicalCommands = (session, state, commands) => {
|
|
|
442
481
|
case "setContentControlValue": return panic("Control values are prepared before editor intents.");
|
|
443
482
|
case "replaceText": return panic("Text replacements are prepared before editor intents.");
|
|
444
483
|
case "formatRun": {
|
|
445
|
-
const from =
|
|
484
|
+
const from = projection.addressAt(command.from);
|
|
446
485
|
if (from.isErr()) return from;
|
|
447
|
-
const to =
|
|
486
|
+
const to = projection.addressAt(command.to);
|
|
448
487
|
if (to.isErr()) return to;
|
|
449
488
|
intents.push({
|
|
450
489
|
type: "formatRun",
|
|
@@ -455,7 +494,7 @@ const prepareCanonicalCommands = (session, state, commands) => {
|
|
|
455
494
|
break;
|
|
456
495
|
}
|
|
457
496
|
case "formatParagraph": {
|
|
458
|
-
const at =
|
|
497
|
+
const at = projection.addressAt(command.at);
|
|
459
498
|
if (at.isErr()) return at;
|
|
460
499
|
intents.push({
|
|
461
500
|
type: "formatParagraph",
|
|
@@ -465,7 +504,7 @@ const prepareCanonicalCommands = (session, state, commands) => {
|
|
|
465
504
|
break;
|
|
466
505
|
}
|
|
467
506
|
case "toggleList": {
|
|
468
|
-
const positions = paragraphPositions(
|
|
507
|
+
const positions = paragraphPositions(projection, paragraphs);
|
|
469
508
|
if (positions.isErr()) return positions;
|
|
470
509
|
const definitions = readModel(session.document).package.numbering;
|
|
471
510
|
const map = definitions === void 0 ? void 0 : getCachedNumberingMap(definitions);
|
|
@@ -473,14 +512,14 @@ const prepareCanonicalCommands = (session, state, commands) => {
|
|
|
473
512
|
const numPr = effectiveNumbering(paragraph);
|
|
474
513
|
return numPr?.kind === "reference" && numberingLevelUsesBulletMarker(map?.getLevel(numPr.numId, numPr.ilvl ?? 0)) === (command.kind === "bullet");
|
|
475
514
|
}))) {
|
|
476
|
-
intents.push(numberingIntent(session, positions.value, { kind: command.kind === "bullet" ? "bullet" : "numbered" }));
|
|
515
|
+
intents.push(numberingIntent(session, positions.value, { kind: command.kind === "bullet" ? "bullet" : "numbered" }, story));
|
|
477
516
|
break;
|
|
478
517
|
}
|
|
479
518
|
const removed = numberingRemoval(session);
|
|
480
519
|
for (const paragraph of paragraphs) intents.push({
|
|
481
520
|
type: "formatParagraph",
|
|
482
521
|
at: {
|
|
483
|
-
story
|
|
522
|
+
story,
|
|
484
523
|
blockId: paragraph.paraId ?? "",
|
|
485
524
|
offset: 0
|
|
486
525
|
},
|
|
@@ -489,13 +528,13 @@ const prepareCanonicalCommands = (session, state, commands) => {
|
|
|
489
528
|
break;
|
|
490
529
|
}
|
|
491
530
|
case "removeList": {
|
|
492
|
-
const positions = paragraphPositions(
|
|
531
|
+
const positions = paragraphPositions(projection, paragraphs);
|
|
493
532
|
if (positions.isErr()) return positions;
|
|
494
533
|
const removed = numberingRemoval(session);
|
|
495
534
|
for (const paragraph of paragraphs) intents.push({
|
|
496
535
|
type: "formatParagraph",
|
|
497
536
|
at: {
|
|
498
|
-
story
|
|
537
|
+
story,
|
|
499
538
|
blockId: paragraph.paraId ?? "",
|
|
500
539
|
offset: 0
|
|
501
540
|
},
|
|
@@ -504,14 +543,14 @@ const prepareCanonicalCommands = (session, state, commands) => {
|
|
|
504
543
|
break;
|
|
505
544
|
}
|
|
506
545
|
case "changeListLevel": {
|
|
507
|
-
const positions = paragraphPositions(
|
|
546
|
+
const positions = paragraphPositions(projection, paragraphs);
|
|
508
547
|
if (positions.isErr()) return positions;
|
|
509
548
|
const removed = numberingRemoval(session);
|
|
510
549
|
for (const paragraph of paragraphs) {
|
|
511
550
|
const numPr = effectiveNumbering(paragraph);
|
|
512
551
|
if (numPr?.kind !== "reference") continue;
|
|
513
552
|
const at = {
|
|
514
|
-
story
|
|
553
|
+
story,
|
|
515
554
|
blockId: paragraph.paraId ?? "",
|
|
516
555
|
offset: 0
|
|
517
556
|
};
|
|
@@ -537,7 +576,7 @@ const prepareCanonicalCommands = (session, state, commands) => {
|
|
|
537
576
|
}
|
|
538
577
|
case "restartNumbering":
|
|
539
578
|
case "continueNumbering": {
|
|
540
|
-
const positions = paragraphPositions(
|
|
579
|
+
const positions = paragraphPositions(projection, paragraphs);
|
|
541
580
|
if (positions.isErr()) return positions;
|
|
542
581
|
const source = paragraphs.at(0);
|
|
543
582
|
const numPr = effectiveNumbering(source);
|
|
@@ -568,9 +607,9 @@ const prepareCanonicalCommands = (session, state, commands) => {
|
|
|
568
607
|
};
|
|
569
608
|
} else {
|
|
570
609
|
const start = command.start ?? 1;
|
|
571
|
-
if (!Number.isSafeInteger(start) || start < 0) return refuse("The numbering start must be a non-negative integer.");
|
|
610
|
+
if (!Number.isSafeInteger(start) || start < 0) return refuse("The numbering start must be a non-negative integer.", CANONICAL_CONDITION.invalidRequest);
|
|
572
611
|
const original = definitions.nums.find((num) => num.numId === numPr.numId);
|
|
573
|
-
if (original === void 0) return refuse("The numbering instance does not exist.");
|
|
612
|
+
if (original === void 0) return refuse("The numbering instance does not exist.", CANONICAL_CONDITION.invalidRequest);
|
|
574
613
|
targetId = maxOf(definitions.nums.map((num) => num.numId), 0) + 1;
|
|
575
614
|
const level = numPr.ilvl ?? 0;
|
|
576
615
|
target = {
|
|
@@ -593,7 +632,7 @@ const prepareCanonicalCommands = (session, state, commands) => {
|
|
|
593
632
|
const effective = effectiveNumbering(paragraph);
|
|
594
633
|
return {
|
|
595
634
|
at: {
|
|
596
|
-
story
|
|
635
|
+
story,
|
|
597
636
|
blockId: paragraph.paraId ?? "",
|
|
598
637
|
offset: 0
|
|
599
638
|
},
|
|
@@ -608,6 +647,91 @@ const prepareCanonicalCommands = (session, state, commands) => {
|
|
|
608
647
|
return session.prepareIntents(state, { intents });
|
|
609
648
|
};
|
|
610
649
|
/**
|
|
650
|
+
* The structure edit a key asks for at the selection of the editor showing
|
|
651
|
+
* `story`, the body or a header, footer or note, as one commit: Enter splits
|
|
652
|
+
* the paragraph (or takes an empty list paragraph out of its list),
|
|
653
|
+
* Backspace and Delete at a paragraph's edge join it with its neighbour
|
|
654
|
+
* (Backspace first takes the paragraph out of its list or clears its
|
|
655
|
+
* indent), Tab and Shift+Tab change a list paragraph's level, and Tab, a line
|
|
656
|
+
* break and a page break go in as atoms. Over selected cells, each is
|
|
657
|
+
* cleared and the edit happens in the first. A table's deletion is the
|
|
658
|
+
* caller's: it runs the table command.
|
|
659
|
+
*/
|
|
660
|
+
const prepareCanonicalStructure = (session, state, story, type) => {
|
|
661
|
+
if (type === "pageBreak" && story !== OP_STORIES.MAIN) return Result.err(new CanonicalSessionError({
|
|
662
|
+
ground: { condition: CANONICAL_CONDITION.invalidRequest },
|
|
663
|
+
message: "A page break goes in the main story.",
|
|
664
|
+
reason: "refused"
|
|
665
|
+
}));
|
|
666
|
+
if (state.selection instanceof CellSelection && (type === "split" || type === "tab" || type === "lineBreak" || type === "pageBreak")) return session.prepareCellSelectionStructure(state, (at) => type === "split" ? {
|
|
667
|
+
type: "replaceFragment",
|
|
668
|
+
from: at,
|
|
669
|
+
to: at,
|
|
670
|
+
paragraphs: [{
|
|
671
|
+
type: "paragraph",
|
|
672
|
+
content: []
|
|
673
|
+
}, {
|
|
674
|
+
type: "paragraph",
|
|
675
|
+
content: []
|
|
676
|
+
}],
|
|
677
|
+
openStart: 1,
|
|
678
|
+
openEnd: 1
|
|
679
|
+
} : {
|
|
680
|
+
type: "insertAtom",
|
|
681
|
+
from: at,
|
|
682
|
+
to: at,
|
|
683
|
+
atom: type === "tab" ? { type: "tab" } : {
|
|
684
|
+
type: "break",
|
|
685
|
+
breakType: type === "pageBreak" ? "page" : "textWrapping"
|
|
686
|
+
}
|
|
687
|
+
}, { story });
|
|
688
|
+
const projected = session.projectStory(story);
|
|
689
|
+
if (projected.isErr()) return projected;
|
|
690
|
+
const projection = projected.value;
|
|
691
|
+
const selection = projection.selectionAt(state);
|
|
692
|
+
if (selection.isErr()) return selection;
|
|
693
|
+
const paragraph = projection.paragraph(selection.value.head.blockId)?.source;
|
|
694
|
+
switch (type) {
|
|
695
|
+
case "split": return isCanonicalListParagraph(paragraph) && state.selection.$from.parent.content.size === 0 ? prepareCanonicalCommands(session, state, [{ type: "removeList" }], story) : session.prepareSplit(state, story);
|
|
696
|
+
case "joinBackward":
|
|
697
|
+
if (isCanonicalListParagraph(paragraph)) return prepareCanonicalCommands(session, state, [{ type: "removeList" }], story);
|
|
698
|
+
if ((paragraph?.formatting?.indentLeft ?? 0) > 0 || (paragraph?.formatting?.indentFirstLine ?? 0) > 0) return session.prepareIntent(state, {
|
|
699
|
+
type: "formatParagraph",
|
|
700
|
+
at: selection.value.head,
|
|
701
|
+
patch: {
|
|
702
|
+
indentLeft: null,
|
|
703
|
+
indentFirstLine: null,
|
|
704
|
+
hangingIndent: null
|
|
705
|
+
}
|
|
706
|
+
});
|
|
707
|
+
return session.prepareJoin(state, "backward", story);
|
|
708
|
+
case "joinForward": return session.prepareJoin(state, "forward", story);
|
|
709
|
+
case "indent":
|
|
710
|
+
case "outdent": return prepareCanonicalCommands(session, state, [{
|
|
711
|
+
type: "changeListLevel",
|
|
712
|
+
direction: type === "indent" ? "increase" : "decrease"
|
|
713
|
+
}], story);
|
|
714
|
+
case "tab":
|
|
715
|
+
case "lineBreak":
|
|
716
|
+
case "pageBreak": {
|
|
717
|
+
const from = projection.addressAt(state.selection.from);
|
|
718
|
+
if (from.isErr()) return from;
|
|
719
|
+
const to = projection.addressAt(state.selection.to);
|
|
720
|
+
if (to.isErr()) return to;
|
|
721
|
+
return session.prepareIntent(state, {
|
|
722
|
+
type: "insertAtom",
|
|
723
|
+
from: from.value,
|
|
724
|
+
to: to.value,
|
|
725
|
+
atom: type === "tab" ? { type: "tab" } : {
|
|
726
|
+
type: "break",
|
|
727
|
+
breakType: type === "pageBreak" ? "page" : "textWrapping"
|
|
728
|
+
}
|
|
729
|
+
});
|
|
730
|
+
}
|
|
731
|
+
default: return type;
|
|
732
|
+
}
|
|
733
|
+
};
|
|
734
|
+
/**
|
|
611
735
|
* The rule that `typed`, already committed as typed, completes at the caret of
|
|
612
736
|
* `state`: the marker's removal and the paragraph change as one atomic edit.
|
|
613
737
|
*
|
|
@@ -645,7 +769,7 @@ const prepareCanonicalAutoformat = (session, state, typed) => {
|
|
|
645
769
|
patch: { styleId }
|
|
646
770
|
};
|
|
647
771
|
else {
|
|
648
|
-
const positions = paragraphPositions(session, [source]);
|
|
772
|
+
const positions = paragraphPositions(session.projection, [source]);
|
|
649
773
|
if (positions.isErr()) return void 0;
|
|
650
774
|
paragraphIntent = numberingIntent(session, positions.value, request);
|
|
651
775
|
}
|
|
@@ -656,4 +780,4 @@ const prepareCanonicalAutoformat = (session, state, typed) => {
|
|
|
656
780
|
text: ""
|
|
657
781
|
}, paragraphIntent] });
|
|
658
782
|
};
|
|
659
|
-
export {
|
|
783
|
+
export { isCanonicalListParagraph, prepareCanonicalAutoformat, prepareCanonicalCommands, prepareCanonicalStructure };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { DisplayListPagePainterFactory } from "./layoutPipelineExecution.js";
|
|
2
|
+
type DisplayListPainterLoaderOptions = {
|
|
3
|
+
onReady: () => void;
|
|
4
|
+
onError: (error: Error) => void;
|
|
5
|
+
};
|
|
6
|
+
/** Notify an editor once per in-flight load, regardless of how many layouts requested it. */
|
|
7
|
+
export declare const createDisplayListPainterLoader: ({ onReady, onError }: DisplayListPainterLoaderOptions) => () => DisplayListPagePainterFactory | undefined;
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { Result } from "better-result";
|
|
2
|
+
// src/controller/deferredDisplayListPainter.ts
|
|
3
|
+
let painter;
|
|
4
|
+
let pending;
|
|
5
|
+
const loadPainter = () => {
|
|
6
|
+
pending ??= Result.tryPromise({
|
|
7
|
+
try: async () => {
|
|
8
|
+
const { createDisplayListPagePainter } = await import("../display-list/editor/displayListPagePainter.js");
|
|
9
|
+
painter = createDisplayListPagePainter;
|
|
10
|
+
return painter;
|
|
11
|
+
},
|
|
12
|
+
catch: (cause) => new Error("Could not load the display-list painter.", { cause })
|
|
13
|
+
}).then((result) => {
|
|
14
|
+
if (result.isErr()) pending = void 0;
|
|
15
|
+
return result;
|
|
16
|
+
});
|
|
17
|
+
return pending;
|
|
18
|
+
};
|
|
19
|
+
/** Notify an editor once per in-flight load, regardless of how many layouts requested it. */
|
|
20
|
+
const createDisplayListPainterLoader = ({ onReady, onError }) => {
|
|
21
|
+
let waiting = false;
|
|
22
|
+
return () => {
|
|
23
|
+
if (painter) return painter;
|
|
24
|
+
if (!waiting) {
|
|
25
|
+
waiting = true;
|
|
26
|
+
loadPainter().then((result) => {
|
|
27
|
+
waiting = false;
|
|
28
|
+
if (result.isOk()) onReady();
|
|
29
|
+
else onError(result.error);
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
};
|
|
34
|
+
export { createDisplayListPainterLoader };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { findPageNumberAtEditorPosition } from "../layout-engine/pmPageIndex.js";
|
|
2
|
-
import {
|
|
2
|
+
import { CANONICAL_CONDITION } from "../types/canonicalCapabilities.js";
|
|
3
3
|
import { FOLIO_DOCX_SERIALIZATION_MODE } from "../types/docxSerialization.js";
|
|
4
4
|
import { NO_ANONYMIZATION_HIGHLIGHTS } from "./anonymizationHighlights.js";
|
|
5
5
|
import { NO_AUTOCOMPLETE, delegateAutocomplete } from "./hiddenEditorApi.js";
|
|
@@ -24,7 +24,7 @@ const createFolioEditor = (deps) => {
|
|
|
24
24
|
const api = deps.getEditorApi();
|
|
25
25
|
if (!api) return {
|
|
26
26
|
status: "refused",
|
|
27
|
-
|
|
27
|
+
ground: { condition: CANONICAL_CONDITION.notReady },
|
|
28
28
|
message: "The editor is not ready for section changes."
|
|
29
29
|
};
|
|
30
30
|
return api.applyCanonicalSectionProperties(patch);
|
|
@@ -33,6 +33,8 @@ const createFolioEditor = (deps) => {
|
|
|
33
33
|
getCanonicalStorySelection: (story) => deps.getEditorApi()?.getCanonicalStorySelection(story) ?? null,
|
|
34
34
|
getCanonicalStoryProjection: (story) => deps.getEditorApi()?.getCanonicalStoryProjection(story) ?? null,
|
|
35
35
|
replaceCanonicalStoryText: (options) => deps.getEditorApi()?.replaceCanonicalStoryText(options) ?? false,
|
|
36
|
+
applyCanonicalStoryStructure: (options) => deps.getEditorApi()?.applyCanonicalStoryStructure(options) ?? false,
|
|
37
|
+
cutCanonicalStory: (options) => deps.getEditorApi()?.cutCanonicalStory(options) ?? false,
|
|
36
38
|
noteCanonicalStoryView: (options) => {
|
|
37
39
|
deps.getEditorApi()?.noteCanonicalStoryView(options);
|
|
38
40
|
},
|