@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
|
@@ -124,8 +124,20 @@ function waitForInitialLayoutFonts(model, pmDoc, fontSet = getDocumentFontSet())
|
|
|
124
124
|
*/
|
|
125
125
|
function collectLayoutText(documentModel, pmDoc) {
|
|
126
126
|
const characters = /* @__PURE__ */ new Set([" "]);
|
|
127
|
+
const seenUnits = /* @__PURE__ */ new Uint8Array(65536);
|
|
128
|
+
seenUnits[32] = 1;
|
|
127
129
|
const addText = (text) => {
|
|
128
|
-
for (
|
|
130
|
+
for (let index = 0; index < text.length; index += 1) {
|
|
131
|
+
const unit = text.charCodeAt(index);
|
|
132
|
+
if (isHighSurrogate(unit) && isLowSurrogate(text.charCodeAt(index + 1))) {
|
|
133
|
+
characters.add(text.slice(index, index + 2));
|
|
134
|
+
index += 1;
|
|
135
|
+
continue;
|
|
136
|
+
}
|
|
137
|
+
if (unit < 32 || seenUnits[unit] === 1) continue;
|
|
138
|
+
seenUnits[unit] = 1;
|
|
139
|
+
characters.add(String.fromCharCode(unit));
|
|
140
|
+
}
|
|
129
141
|
};
|
|
130
142
|
pmDoc.descendants((node) => {
|
|
131
143
|
if (node.isText) addText(node.text ?? "");
|
|
@@ -148,7 +160,9 @@ function collectInitialLayoutFontFaces(documentModel, pmDoc) {
|
|
|
148
160
|
const faces = /* @__PURE__ */ new Map();
|
|
149
161
|
const resolution = {
|
|
150
162
|
fontAlternates: buildFontAlternates(documentModel?.package.fontTable),
|
|
151
|
-
documentFontFacts: buildDocumentFontFacts(documentModel?.package.fontTable)
|
|
163
|
+
documentFontFacts: buildDocumentFontFacts(documentModel?.package.fontTable),
|
|
164
|
+
resolvedFamilies: /* @__PURE__ */ new Map(),
|
|
165
|
+
requested: /* @__PURE__ */ new Set()
|
|
152
166
|
};
|
|
153
167
|
addLayoutFontFamilyFace({
|
|
154
168
|
faces,
|
|
@@ -261,14 +275,13 @@ function layoutDescriptorFromFormattingAndMarks(formatting, marks) {
|
|
|
261
275
|
weight: bold ? 700 : 400
|
|
262
276
|
};
|
|
263
277
|
}
|
|
264
|
-
function addLayoutFontFamilyFace({ faces, value, descriptor,
|
|
278
|
+
function addLayoutFontFamilyFace({ faces, value, descriptor, complexScriptDescriptor = descriptor, ...resolution }) {
|
|
265
279
|
if (typeof value === "string") {
|
|
266
280
|
addLayoutFontFamilyNameFace({
|
|
267
281
|
faces,
|
|
268
282
|
family: value,
|
|
269
283
|
descriptor,
|
|
270
|
-
|
|
271
|
-
documentFontFacts
|
|
284
|
+
...resolution
|
|
272
285
|
});
|
|
273
286
|
return;
|
|
274
287
|
}
|
|
@@ -278,42 +291,54 @@ function addLayoutFontFamilyFace({ faces, value, descriptor, fontAlternates, doc
|
|
|
278
291
|
faces,
|
|
279
292
|
value: fontFamily.ascii,
|
|
280
293
|
descriptor,
|
|
281
|
-
|
|
282
|
-
documentFontFacts
|
|
294
|
+
...resolution
|
|
283
295
|
});
|
|
284
296
|
addLayoutFontFamilyFace({
|
|
285
297
|
faces,
|
|
286
298
|
value: fontFamily.hAnsi,
|
|
287
299
|
descriptor,
|
|
288
|
-
|
|
289
|
-
documentFontFacts
|
|
300
|
+
...resolution
|
|
290
301
|
});
|
|
291
302
|
addLayoutFontFamilyFace({
|
|
292
303
|
faces,
|
|
293
304
|
value: fontFamily.cs,
|
|
294
305
|
descriptor: complexScriptDescriptor,
|
|
295
|
-
|
|
296
|
-
documentFontFacts
|
|
306
|
+
...resolution
|
|
297
307
|
});
|
|
298
308
|
addLayoutFontFamilyFace({
|
|
299
309
|
faces,
|
|
300
310
|
value: fontFamily.eastAsia,
|
|
301
311
|
descriptor,
|
|
302
|
-
|
|
303
|
-
documentFontFacts
|
|
312
|
+
...resolution
|
|
304
313
|
});
|
|
305
314
|
}
|
|
306
|
-
function addLayoutFontFamilyNameFace({ faces, family, descriptor,
|
|
315
|
+
function addLayoutFontFamilyNameFace({ faces, family, descriptor, ...resolution }) {
|
|
316
|
+
const request = `${family}|${descriptor.style}|${descriptor.weight}`;
|
|
317
|
+
if (resolution.requested.has(request)) return;
|
|
318
|
+
resolution.requested.add(request);
|
|
319
|
+
for (const resolved of resolveLayoutFamilies(family, resolution)) addLayoutFontFace(faces, resolved, descriptor);
|
|
320
|
+
}
|
|
321
|
+
/**
|
|
322
|
+
* The families an authored name loads: the name, its alternate and the stack
|
|
323
|
+
* the renderer resolves it to, or none for a blank or generic name.
|
|
324
|
+
*/
|
|
325
|
+
function resolveLayoutFamilies(family, resolution) {
|
|
326
|
+
const known = resolution.resolvedFamilies.get(family);
|
|
327
|
+
if (known !== void 0) return known;
|
|
307
328
|
const normalized = family.trim();
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
329
|
+
const resolved = [];
|
|
330
|
+
if (normalized && !CSS_GENERIC_FONT_FAMILIES.has(normalized)) {
|
|
331
|
+
resolved.push(normalized);
|
|
332
|
+
const alternate = getFontAlternate(normalized, resolution.fontAlternates);
|
|
333
|
+
if (alternate) resolved.push(alternate);
|
|
334
|
+
resolved.push(...resolvedStackFamilies({
|
|
335
|
+
family: normalized,
|
|
336
|
+
alternate,
|
|
337
|
+
documentFontFacts: resolution.documentFontFacts
|
|
338
|
+
}));
|
|
339
|
+
}
|
|
340
|
+
resolution.resolvedFamilies.set(family, resolved);
|
|
341
|
+
return resolved;
|
|
317
342
|
}
|
|
318
343
|
function resolvedStackFamilies({ family, alternate, documentFontFacts }) {
|
|
319
344
|
const { cssFallback } = resolveFontFamily(family, {
|
|
@@ -328,6 +353,8 @@ function addLayoutFontFace(faces, family, descriptor) {
|
|
|
328
353
|
...descriptor
|
|
329
354
|
});
|
|
330
355
|
}
|
|
356
|
+
const isHighSurrogate = (unit) => unit >= 55296 && unit <= 56319;
|
|
357
|
+
const isLowSurrogate = (unit) => unit >= 56320 && unit <= 57343;
|
|
331
358
|
function escapeCssFontFamily(family) {
|
|
332
359
|
return family.replace(/\\/gu, "\\\\").replace(/"/gu, "\\\"");
|
|
333
360
|
}
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import { CanonicalSessionError } from "../canonical/canonicalSession.js";
|
|
2
2
|
import { createNativeNavigationPlugin, createNativeSelectionRefreshPlugin } from "../prosemirror/nativeSelection.js";
|
|
3
|
-
import { noteReferenceTransactionIssue } from "../prosemirror/noteReferenceOccurrences.js";
|
|
4
3
|
import { createDocumentNumberingPlugin } from "../prosemirror/plugins/documentNumbering.js";
|
|
5
4
|
import { createDocumentStyleContextPlugin } from "../prosemirror/plugins/documentStyles.js";
|
|
6
|
-
import {
|
|
5
|
+
import { CANONICAL_CONDITION } from "../types/canonicalCapabilities.js";
|
|
7
6
|
import { readModel } from "../types/documentModel.js";
|
|
8
7
|
import { createCanonicalStoryEditor, refreshCanonicalStoryView } from "./canonicalStoryEditor.js";
|
|
9
8
|
import { OP_STORIES } from "@stll/docx-core/ops";
|
|
@@ -98,7 +97,6 @@ const createHeaderFooterEditorManager = (deps) => {
|
|
|
98
97
|
},
|
|
99
98
|
getView: () => view,
|
|
100
99
|
getApi: () => deps.getCanonicalApi?.() ?? null,
|
|
101
|
-
enabled: () => true,
|
|
102
100
|
onRefusal: deps.onSessionRefusal,
|
|
103
101
|
onSelectionChange: () => deps.onTransaction?.({
|
|
104
102
|
kind: part.kind,
|
|
@@ -131,19 +129,7 @@ const createHeaderFooterEditorManager = (deps) => {
|
|
|
131
129
|
}),
|
|
132
130
|
dispatchTransaction(transaction) {
|
|
133
131
|
if ((deps.getReadOnly?.() ?? false) && transaction.docChanged) return;
|
|
134
|
-
|
|
135
|
-
const nextState = view.state.apply(transaction);
|
|
136
|
-
const docChanged = !nextState.doc.eq(view.state.doc);
|
|
137
|
-
const noteIssue = noteReferenceTransactionIssue(transaction);
|
|
138
|
-
if (noteIssue) deps.onSessionRefusal?.(noteIssue.message, { gap: CANONICAL_GAP.dispatch }, noteIssue);
|
|
139
|
-
view.updateState(nextState);
|
|
140
|
-
deps.onTransaction?.({
|
|
141
|
-
docChanged,
|
|
142
|
-
kind: part.kind,
|
|
143
|
-
rId: part.rId,
|
|
144
|
-
selectionChanged: transaction.selectionSet,
|
|
145
|
-
view
|
|
146
|
-
});
|
|
132
|
+
canonical.dispatch(transaction);
|
|
147
133
|
}
|
|
148
134
|
});
|
|
149
135
|
mounted.set(part.rId, {
|
|
@@ -165,7 +151,7 @@ const createHeaderFooterEditorManager = (deps) => {
|
|
|
165
151
|
const canonical = deps.getCanonicalApi?.()?.getCanonicalDocument();
|
|
166
152
|
if (canonical) return canonical;
|
|
167
153
|
throw new CanonicalSessionError({
|
|
168
|
-
ground: {
|
|
154
|
+
ground: { condition: CANONICAL_CONDITION.notReady },
|
|
169
155
|
reason: "refused",
|
|
170
156
|
message: "Canonical story snapshot is unavailable."
|
|
171
157
|
});
|
|
@@ -19,7 +19,7 @@ import { ReadonlyDocument } from "../types/documentModel.js";
|
|
|
19
19
|
import { FolioDocxSerializationPath } from "../types/docxSerialization.js";
|
|
20
20
|
import { FolioFieldInsertion } from "../types/fields.js";
|
|
21
21
|
import { AnonymizationHighlightsView } from "./anonymizationHighlights.js";
|
|
22
|
-
import { createCanonicalInputBoundary } from "./canonicalInput.js";
|
|
22
|
+
import { CanonicalStructureInput, createCanonicalInputBoundary } from "./canonicalInput.js";
|
|
23
23
|
import { Command, EditorState, Transaction } from "prosemirror-state";
|
|
24
24
|
import { Node } from "prosemirror-model";
|
|
25
25
|
import { DocumentOp, FormattingPatch, OpStory, TextPosition } from "@stll/docx-core/ops";
|
|
@@ -47,6 +47,16 @@ type CanonicalStoryTextOptions = {
|
|
|
47
47
|
story: OpStory;
|
|
48
48
|
intent: Parameters<Parameters<typeof createCanonicalInputBoundary>[0]["replace"]>[0];
|
|
49
49
|
};
|
|
50
|
+
type CanonicalStoryStructureOptions = {
|
|
51
|
+
view: EditorView;
|
|
52
|
+
story: OpStory;
|
|
53
|
+
type: CanonicalStructureInput;
|
|
54
|
+
};
|
|
55
|
+
type CanonicalStoryCutOptions = {
|
|
56
|
+
view: EditorView;
|
|
57
|
+
story: OpStory;
|
|
58
|
+
event: ClipboardEvent;
|
|
59
|
+
};
|
|
50
60
|
/** The package a canonical save wrote, and whether it patched its baseline. */
|
|
51
61
|
export type CanonicalSavedPackage = {
|
|
52
62
|
buffer: ArrayBuffer;
|
|
@@ -99,7 +109,7 @@ export type HiddenEditorApi = {
|
|
|
99
109
|
applyCanonicalStoryHistory: (options: CanonicalStoryHistoryOptions) => boolean;
|
|
100
110
|
applyCanonicalOperations: (ops: readonly DocumentOp[]) => boolean;
|
|
101
111
|
applyCanonicalComment: (request: CanonicalCommentRequest) => CanonicalCommentResult | null;
|
|
102
|
-
/** Apply a final-section patch
|
|
112
|
+
/** Apply a final-section patch to the canonical session. */
|
|
103
113
|
applyCanonicalSectionProperties: (patch: FormattingPatch<document_d_exports.SectionProperties>) => CanonicalSectionPropertiesResult | null;
|
|
104
114
|
/**
|
|
105
115
|
* Where the editor of a header, footer or note shows its text selection in
|
|
@@ -113,6 +123,17 @@ export type HiddenEditorApi = {
|
|
|
113
123
|
} | null;
|
|
114
124
|
getCanonicalStoryProjection: (story: OpStory) => Node | null;
|
|
115
125
|
replaceCanonicalStoryText: (options: CanonicalStoryTextOptions) => boolean;
|
|
126
|
+
/**
|
|
127
|
+
* Make the structure edit a key asks for in the editor of a header, footer
|
|
128
|
+
* or note, as the body's editor makes it: one journalled change.
|
|
129
|
+
*/
|
|
130
|
+
applyCanonicalStoryStructure: (options: CanonicalStoryStructureOptions) => boolean;
|
|
131
|
+
/**
|
|
132
|
+
* Cut the selection of a header, footer or note editor: the clipboard takes
|
|
133
|
+
* it and the story loses it, as one journalled change. True when the editor
|
|
134
|
+
* handled the event.
|
|
135
|
+
*/
|
|
136
|
+
cutCanonicalStory: (options: CanonicalStoryCutOptions) => boolean;
|
|
116
137
|
/**
|
|
117
138
|
* The editor a person is working in for `story`: public operations on that
|
|
118
139
|
* story read its state, so its selection maps through them, and publish to
|
|
@@ -193,7 +214,7 @@ export type HiddenEditorApiDeps = {
|
|
|
193
214
|
resolveCanonicalSuggestion?: HiddenEditorApi["resolveCanonicalSuggestion"];
|
|
194
215
|
executeCanonicalCommand?: (command: Command) => boolean | undefined;
|
|
195
216
|
getCanonicalHistory?: () => Pick<HiddenEditorApi, "undo" | "redo" | "canUndo" | "canRedo"> | null;
|
|
196
|
-
canonicalOperations?: Pick<HiddenEditorApi, "updateCanonicalInputLifecycle" | "applyCanonicalOperations" | "applyCanonicalComment" | "applyCanonicalSectionProperties" | "getCanonicalStoryProjection" | "replaceCanonicalStoryText" | "noteCanonicalStoryView" | "applyCanonicalStoryHistory" | "getCanonicalStorySelection" | "applyCanonicalDocumentOperations" | "undoCanonicalDocumentOperations">;
|
|
217
|
+
canonicalOperations?: Pick<HiddenEditorApi, "updateCanonicalInputLifecycle" | "applyCanonicalOperations" | "applyCanonicalComment" | "applyCanonicalSectionProperties" | "getCanonicalStoryProjection" | "replaceCanonicalStoryText" | "applyCanonicalStoryStructure" | "cutCanonicalStory" | "noteCanonicalStoryView" | "applyCanonicalStoryHistory" | "getCanonicalStorySelection" | "applyCanonicalDocumentOperations" | "undoCanonicalDocumentOperations">;
|
|
197
218
|
isDestroying: () => boolean;
|
|
198
219
|
ensureView: () => void;
|
|
199
220
|
isViewRequested: () => boolean;
|
|
@@ -82,6 +82,8 @@ const createHiddenEditorApi = (deps) => {
|
|
|
82
82
|
getCanonicalStorySelection: (story) => deps.canonicalOperations?.getCanonicalStorySelection(story) ?? null,
|
|
83
83
|
getCanonicalStoryProjection: (story) => deps.canonicalOperations?.getCanonicalStoryProjection(story) ?? null,
|
|
84
84
|
replaceCanonicalStoryText: (options) => deps.canonicalOperations?.replaceCanonicalStoryText(options) ?? false,
|
|
85
|
+
applyCanonicalStoryStructure: (options) => deps.canonicalOperations?.applyCanonicalStoryStructure(options) ?? false,
|
|
86
|
+
cutCanonicalStory: (options) => deps.canonicalOperations?.cutCanonicalStory(options) ?? false,
|
|
85
87
|
noteCanonicalStoryView: (options) => {
|
|
86
88
|
deps.canonicalOperations?.noteCanonicalStoryView(options);
|
|
87
89
|
},
|