@stll/folio-core 0.56.0 → 0.58.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/apply.js +122 -22
- package/dist/ai-edits/batch-claims.d.ts +3 -1
- package/dist/ai-edits/batch-claims.js +25 -1
- package/dist/ai-edits/table-row-column-mutations.js +17 -3
- package/dist/ai-suggestions/apply.js +20 -1
- package/dist/compare/inline-atoms.js +40 -16
- package/dist/compare/inline-provenance.js +12 -5
- package/dist/compat/eigenpal.d.ts +2 -1
- package/dist/compat/eigenpal.js +2 -1
- package/dist/controller/canonicalClipboard.d.ts +3 -1
- package/dist/controller/canonicalClipboard.js +31 -13
- package/dist/controller/canonicalComments.d.ts +41 -0
- package/dist/controller/canonicalComments.js +152 -0
- package/dist/controller/canonicalComposition.d.ts +17 -4
- package/dist/controller/canonicalComposition.js +125 -20
- package/dist/controller/canonicalInlineProjection.d.ts +6 -1
- package/dist/controller/canonicalInlineProjection.js +86 -3
- package/dist/controller/canonicalInput.d.ts +1 -1
- package/dist/controller/canonicalInput.js +14 -4
- package/dist/controller/canonicalInputTimer.d.ts +10 -1
- package/dist/controller/canonicalInputTimer.js +24 -1
- package/dist/controller/canonicalPublicOperations.d.ts +2 -2
- package/dist/controller/canonicalPublicOperations.js +107 -15
- package/dist/controller/canonicalSelection.d.ts +18 -0
- package/dist/controller/canonicalSelection.js +41 -0
- package/dist/controller/canonicalSession.d.ts +4 -1
- package/dist/controller/canonicalSession.js +106 -36
- package/dist/controller/canonicalStoryEditor.d.ts +3 -1
- package/dist/controller/canonicalStoryEditor.js +21 -1
- package/dist/controller/canonicalStructure.js +8 -3
- package/dist/controller/folioEditor.js +13 -0
- package/dist/controller/headerFooterEditorManager.d.ts +1 -1
- package/dist/controller/headerFooterEditorManager.js +25 -11
- package/dist/controller/hiddenEditorApi.d.ts +13 -2
- package/dist/controller/hiddenEditorApi.js +5 -1
- package/dist/controller/hiddenEditorManager.d.ts +3 -1
- package/dist/controller/hiddenEditorManager.js +167 -14
- package/dist/controller/noteEditorManager.d.ts +1 -1
- package/dist/controller/noteEditorManager.js +28 -13
- package/dist/docx/builtInStyles.js +13 -6
- package/dist/docx/containerChildren.gen.d.ts +3 -1
- package/dist/docx/containerChildren.gen.js +33 -1
- package/dist/docx/fieldParser.js +14 -2
- package/dist/docx/hyperlinkParser.d.ts +1 -1
- package/dist/docx/hyperlinkParser.js +20 -1
- package/dist/docx/inlineWrapperContent.d.ts +4 -4
- package/dist/docx/inlineWrapperContent.js +4 -4
- package/dist/docx/linkedSdtPreservation.d.ts +10 -0
- package/dist/docx/linkedSdtPreservation.js +37 -0
- package/dist/docx/listRendering.d.ts +18 -0
- package/dist/{prosemirror/conversion/listRenderingDefinition.js → docx/listRendering.js} +17 -3
- package/dist/docx/paragraphParser.js +88 -67
- package/dist/docx/paragraphPropertySource.d.ts +22 -1
- package/dist/docx/paragraphPropertySource.js +107 -1
- package/dist/docx/preservedRunContent.js +2 -1
- package/dist/docx/relsParser.js +26 -2
- package/dist/docx/rezip.js +9 -6
- package/dist/docx/selectiveSave.js +10 -8
- package/dist/docx/serializer/commentSerializer.d.ts +4 -1
- package/dist/docx/serializer/commentSerializer.js +7 -3
- package/dist/docx/serializer/paragraphSerializer.js +207 -94
- package/dist/docx/server/materializeYjsDocx.js +15 -7
- package/dist/docx/server/migrateYjsAttrSchema.js +17 -5
- package/dist/i18n/messages/ar.gen.js +4 -0
- package/dist/i18n/messages/catalogs.gen.d.ts +68 -0
- package/dist/i18n/messages/catalogs.gen.js +68 -0
- package/dist/i18n/messages/cs.gen.js +4 -0
- package/dist/i18n/messages/de.gen.js +4 -0
- package/dist/i18n/messages/en.gen.js +4 -0
- package/dist/i18n/messages/es.gen.js +4 -0
- package/dist/i18n/messages/et.gen.js +4 -0
- package/dist/i18n/messages/fr.gen.js +4 -0
- package/dist/i18n/messages/he.gen.js +4 -0
- package/dist/i18n/messages/hi.gen.js +4 -0
- package/dist/i18n/messages/hu.gen.js +4 -0
- package/dist/i18n/messages/lt.gen.js +4 -0
- package/dist/i18n/messages/lv.gen.js +4 -0
- package/dist/i18n/messages/messages.gen.d.ts +4 -0
- package/dist/i18n/messages/pl.gen.js +4 -0
- package/dist/i18n/messages/pt-BR.gen.js +4 -0
- package/dist/i18n/messages/sk.gen.js +4 -0
- package/dist/i18n/messages/tr.gen.js +4 -0
- package/dist/i18n/messages/zh-CN.gen.js +4 -0
- package/dist/index.d.ts +2 -1
- package/dist/index.js +2 -1
- package/dist/internal/revisionResolutionInline.js +25 -3
- package/dist/markdown/internals.js +7 -0
- package/dist/markdown/renderParagraph.js +11 -12
- package/dist/markdown/renderRuns.js +3 -13
- package/dist/markdown/types.d.ts +3 -0
- package/dist/panel-layout.d.ts +11 -9
- package/dist/panel-layout.js +13 -9
- package/dist/prosemirror/addTrackedDeletionMark.d.ts +18 -0
- package/dist/prosemirror/addTrackedDeletionMark.js +87 -0
- package/dist/prosemirror/attrs/index.js +9 -0
- package/dist/prosemirror/commands/comments.js +60 -35
- package/dist/prosemirror/commands/propertyChangeScope.js +3 -6
- package/dist/prosemirror/commands/resolveParagraphProperties.js +22 -13
- package/dist/prosemirror/commentOps.js +15 -1
- package/dist/prosemirror/conversion/fromProseDoc.d.ts +8 -1
- package/dist/prosemirror/conversion/fromProseDoc.js +150 -30
- package/dist/prosemirror/conversion/toProseDoc.js +128 -40
- package/dist/prosemirror/extensions/core/ParagraphExtension.js +22 -5
- package/dist/prosemirror/extensions/features/BaseKeymapExtension.js +74 -25
- package/dist/prosemirror/extensions/marks/FootnoteRefExtension.js +11 -0
- package/dist/prosemirror/extensions/marks/HyperlinkExtension.js +22 -14
- package/dist/prosemirror/extensions/marks/markUtils.js +8 -7
- package/dist/prosemirror/extensions/marks/noteReferenceDeletion.js +5 -2
- package/dist/prosemirror/extensions/nodes/ImageExtension.js +8 -1
- package/dist/prosemirror/fieldRepresentation.d.ts +8 -0
- package/dist/prosemirror/fieldRepresentation.js +18 -0
- package/dist/prosemirror/hyperlinkRemoval.d.ts +13 -1
- package/dist/prosemirror/hyperlinkRemoval.js +28 -9
- package/dist/prosemirror/imagePictureNames.d.ts +12 -0
- package/dist/prosemirror/imagePictureNames.js +20 -0
- package/dist/prosemirror/listNumbering.js +11 -5
- package/dist/prosemirror/noteReferenceOccurrenceId.d.ts +5 -0
- package/dist/prosemirror/noteReferenceOccurrenceId.js +5 -0
- package/dist/prosemirror/noteReferenceOccurrences.d.ts +21 -0
- package/dist/prosemirror/noteReferenceOccurrences.js +185 -0
- package/dist/prosemirror/noteReferenceReview.js +14 -1
- package/dist/prosemirror/paragraphFormattingProvenance.js +1 -0
- package/dist/prosemirror/plugins/documentStyles.d.ts +4 -1
- package/dist/prosemirror/plugins/documentStyles.js +17 -10
- package/dist/prosemirror/plugins/suggestionMode.js +47 -49
- package/dist/prosemirror/preservedXmlReview.d.ts +6 -0
- package/dist/prosemirror/preservedXmlReview.js +35 -0
- package/dist/prosemirror/runFormattingFromMarks.js +2 -2
- package/dist/prosemirror/runFormattingReconciliation.js +5 -4
- package/dist/prosemirror/runPropertyChangeResolution.d.ts +8 -1
- package/dist/prosemirror/runPropertyChangeResolution.js +24 -2
- package/dist/prosemirror/runStyleFormatting.d.ts +74 -2
- package/dist/prosemirror/runStyleFormatting.js +20 -1
- package/dist/prosemirror/schema/marks.d.ts +1 -0
- package/dist/prosemirror/schema/nodes.d.ts +3 -0
- package/dist/prosemirror/styles/paragraphStyleCascade.js +4 -1
- package/dist/prosemirror/styles/resolvedStyleAttrs.d.ts +15 -15
- package/dist/prosemirror/styles/resolvedStyleAttrs.js +69 -28
- package/dist/prosemirror/styles/styleResolver.d.ts +4 -1
- package/dist/prosemirror/styles/styleResolver.js +32 -11
- package/dist/prosemirror/textInput.d.ts +5 -1
- package/dist/prosemirror/textInput.js +3 -3
- package/dist/prosemirror/trackedRevisionPath.d.ts +5 -1
- package/dist/prosemirror/trackedRevisionPath.js +39 -1
- package/dist/prosemirror/validation.js +3 -5
- package/dist/prosemirror/yjsDocumentMetadata.d.ts +9 -3
- package/dist/prosemirror/yjsDocumentMetadata.js +37 -8
- package/dist/types/canonicalCapabilities.d.ts +18 -18
- package/dist/types/canonicalCapabilities.js +18 -18
- package/dist/types/canonicalComments.d.ts +51 -0
- package/dist/types/canonicalComments.js +0 -0
- package/dist/types/canonicalSections.d.ts +12 -0
- package/dist/types/canonicalSections.js +0 -0
- package/dist/utils/headingCollector.js +45 -4
- package/dist/utils/outlineDepth.d.ts +9 -0
- package/dist/utils/outlineDepth.js +9 -0
- package/package.json +2 -2
- package/dist/prosemirror/conversion/listRenderingDefinition.d.ts +0 -6
|
@@ -6,6 +6,7 @@ import { CLEARED_LIST_RENDERING_ATTRS } from "../listMarker.js";
|
|
|
6
6
|
import { listRenderingAttrPatch } from "../listRenderingAttrs.js";
|
|
7
7
|
import { paragraphNumberingAttr } from "../numberingAttr.js";
|
|
8
8
|
import { styleResolvedParagraphFormatting } from "../paragraphFormattingProvenance.js";
|
|
9
|
+
import { directParagraphIndentation, paragraphIndentationAttrPatch, paragraphIndentationFromFormatting, withDirectParagraphIndentation } from "../paragraphIndentation.js";
|
|
9
10
|
//#region src/prosemirror/styles/resolvedStyleAttrs.ts
|
|
10
11
|
/**
|
|
11
12
|
* Shared helper for projecting a resolved paragraph style onto ProseMirror
|
|
@@ -48,6 +49,7 @@ function paragraphAttrsFromResolvedStyle(resolved, identity) {
|
|
|
48
49
|
borders: ppr?.borders ?? null,
|
|
49
50
|
defaultTextFormatting: hasRunFormatting ? runFormatting : null,
|
|
50
51
|
_resolvedFormatting: styleResolvedParagraphFormatting(ppr),
|
|
52
|
+
_styleResolvedFormatting: styleResolvedParagraphFormatting(ppr),
|
|
51
53
|
_autospacingBase: autospacingBaseFromResolvedParagraphFormatting(ppr),
|
|
52
54
|
_tableOfContentsLevel: tableOfContentsStyleLevel(identity) ?? null
|
|
53
55
|
};
|
|
@@ -84,19 +86,26 @@ function listAttrsFromResolvedStyle(resolved, numbering) {
|
|
|
84
86
|
numId,
|
|
85
87
|
ilvl
|
|
86
88
|
}, numbering);
|
|
87
|
-
const level = numbering?.getLevel(numId, ilvl);
|
|
88
89
|
attrs.numPrFromStyle = paragraphNumberingAttr(paragraphNumberingReference({
|
|
89
90
|
numId,
|
|
90
91
|
ilvl
|
|
91
92
|
}));
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
93
|
+
Object.assign(attrs, listIndentationProvenancePatch({
|
|
94
|
+
direct: void 0,
|
|
95
|
+
styleFormatting: resolved.paragraphFormatting,
|
|
96
|
+
numberingSource: "style",
|
|
97
|
+
numPr: {
|
|
98
|
+
numId,
|
|
99
|
+
ilvl
|
|
100
|
+
},
|
|
101
|
+
numbering
|
|
102
|
+
}));
|
|
103
|
+
for (const key of [
|
|
104
|
+
"indentLeft",
|
|
105
|
+
"indentRight",
|
|
106
|
+
"indentFirstLine"
|
|
107
|
+
]) if (attrs[key] == null) Reflect.deleteProperty(attrs, key);
|
|
108
|
+
if (attrs.indentFirstLine === void 0 && resolved.paragraphFormatting?.hangingIndent === void 0) Reflect.deleteProperty(attrs, "hangingIndent");
|
|
100
109
|
return attrs;
|
|
101
110
|
}
|
|
102
111
|
/** Project one resolved numbering level into the complete editor attr group. */
|
|
@@ -115,9 +124,9 @@ function listAttrsFromNumbering(numPr, numbering) {
|
|
|
115
124
|
/**
|
|
116
125
|
* The numbering level's indentation a directly numbered paragraph reads as its
|
|
117
126
|
* own where it states none: the load path folds the level's `w:ind` into the
|
|
118
|
-
* paragraph (a direct `w:ind` wins per group, left vs first line/hanging)
|
|
119
|
-
*
|
|
120
|
-
*
|
|
127
|
+
* paragraph (a direct `w:ind` wins per group, left vs first line/hanging).
|
|
128
|
+
* Keep this projection private: callers use the paired provenance helper so
|
|
129
|
+
* effective level values cannot be mistaken for authored indentation.
|
|
121
130
|
*/
|
|
122
131
|
function listLevelIndentAttrPatch(stated, numPr, numbering) {
|
|
123
132
|
const level = numbering?.getLevel(numPr.numId, numPr.ilvl);
|
|
@@ -130,6 +139,33 @@ function listLevelIndentAttrPatch(stated, numPr, numbering) {
|
|
|
130
139
|
}
|
|
131
140
|
return patch;
|
|
132
141
|
}
|
|
142
|
+
/** Project effective indentation and both inheritance layers together. */
|
|
143
|
+
function listIndentationProvenancePatch({ direct, styleFormatting, numberingSource, numPr, numbering }) {
|
|
144
|
+
const style = {
|
|
145
|
+
...styleResolvedParagraphFormatting(styleFormatting),
|
|
146
|
+
...styleFormatting?.hangingIndent === void 0 ? {} : { hangingIndent: styleFormatting.hangingIndent }
|
|
147
|
+
};
|
|
148
|
+
const level = numPr === void 0 ? {} : listLevelIndentAttrPatch(numberingSource === "style" ? paragraphIndentationFromFormatting(style) : void 0, numPr, numbering);
|
|
149
|
+
if (level.indentLeft === 0 && style.indentLeft === void 0) Reflect.deleteProperty(level, "indentLeft");
|
|
150
|
+
if (level.indentFirstLine === 0 && style.indentFirstLine === void 0 && style.hangingIndent === void 0) {
|
|
151
|
+
Reflect.deleteProperty(level, "indentFirstLine");
|
|
152
|
+
Reflect.deleteProperty(level, "hangingIndent");
|
|
153
|
+
}
|
|
154
|
+
const resolved = {
|
|
155
|
+
...style,
|
|
156
|
+
...typeof level.indentLeft === "number" ? { indentLeft: level.indentLeft } : {},
|
|
157
|
+
...typeof level.indentFirstLine === "number" ? { indentFirstLine: level.indentFirstLine } : {},
|
|
158
|
+
...typeof level.hangingIndent === "boolean" ? { hangingIndent: level.hangingIndent } : {}
|
|
159
|
+
};
|
|
160
|
+
return {
|
|
161
|
+
...paragraphIndentationAttrPatch({
|
|
162
|
+
direct,
|
|
163
|
+
inherited: paragraphIndentationFromFormatting(resolved)
|
|
164
|
+
}),
|
|
165
|
+
_resolvedFormatting: Object.keys(resolved).length === 0 ? null : resolved,
|
|
166
|
+
_styleResolvedFormatting: Object.keys(style).length === 0 ? null : style
|
|
167
|
+
};
|
|
168
|
+
}
|
|
133
169
|
/**
|
|
134
170
|
* The indentation a paragraph leaving its list keeps: the level's indentation
|
|
135
171
|
* it only read from its numbering goes with the numbering, back to what its
|
|
@@ -138,28 +174,33 @@ function listLevelIndentAttrPatch(stated, numPr, numbering) {
|
|
|
138
174
|
*/
|
|
139
175
|
function listLevelIndentRemovalPatch(attrs, numbering) {
|
|
140
176
|
if (attrs.numPr?.kind !== "reference") return {};
|
|
141
|
-
const
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
177
|
+
const direct = directParagraphIndentation(attrs);
|
|
178
|
+
return {
|
|
179
|
+
...listIndentationProvenancePatch({
|
|
180
|
+
direct,
|
|
181
|
+
styleFormatting: attrs._styleResolvedFormatting,
|
|
182
|
+
numberingSource: "paragraph",
|
|
183
|
+
numPr: void 0,
|
|
184
|
+
numbering
|
|
185
|
+
}),
|
|
186
|
+
_originalFormatting: withDirectParagraphIndentation(attrs._originalFormatting, direct) ?? null
|
|
187
|
+
};
|
|
151
188
|
}
|
|
152
189
|
/** Recompute every level-dependent attr when a paragraph changes list level. */
|
|
153
190
|
function listLevelAttrPatch(attrs, numPr, numbering) {
|
|
154
|
-
const
|
|
155
|
-
const hasMarkerSlot = level ? numberingLevelHasMarkerSlot(level) : false;
|
|
191
|
+
const direct = directParagraphIndentation(attrs);
|
|
156
192
|
return {
|
|
157
193
|
...listAttrsFromNumbering(numPr, numbering),
|
|
158
194
|
listImplicitChildLevelAdvances: attrs.listImplicitChildLevelAdvances ?? null,
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
195
|
+
...listIndentationProvenancePatch({
|
|
196
|
+
direct,
|
|
197
|
+
styleFormatting: attrs._styleResolvedFormatting,
|
|
198
|
+
numberingSource: attrs.numPrFromStyle == null ? "paragraph" : "style",
|
|
199
|
+
numPr,
|
|
200
|
+
numbering
|
|
201
|
+
}),
|
|
202
|
+
_originalFormatting: withDirectParagraphIndentation(attrs._originalFormatting, direct) ?? null
|
|
162
203
|
};
|
|
163
204
|
}
|
|
164
205
|
//#endregion
|
|
165
|
-
export { listAttrsFromNumbering, listAttrsFromResolvedStyle,
|
|
206
|
+
export { listAttrsFromNumbering, listAttrsFromResolvedStyle, listIndentationProvenancePatch, listLevelAttrPatch, listLevelIndentRemovalPatch, paragraphAttrsFromResolvedStyle };
|
|
@@ -81,6 +81,7 @@ declare class StyleResolver {
|
|
|
81
81
|
* @returns Resolved paragraph and run formatting
|
|
82
82
|
*/
|
|
83
83
|
resolveParagraphStyleInTable(styleId: string | undefined | null, tableParagraphOverlay: TableCellParagraphSpacingOverlay | undefined): ResolvedParagraphStyle;
|
|
84
|
+
private resolveParagraphFormatting;
|
|
84
85
|
private resolveParagraphStyleCascade;
|
|
85
86
|
/**
|
|
86
87
|
* Resolve the style applied to the paragraph that follows one styled with
|
|
@@ -138,5 +139,7 @@ declare class StyleResolver {
|
|
|
138
139
|
* Create a style resolver from document's style definitions
|
|
139
140
|
*/
|
|
140
141
|
declare function createStyleResolver(styleDefinitions: document_d_exports.StyleDefinitions | undefined): StyleResolver;
|
|
142
|
+
/** The same ordered paragraph tiers, without unrelated run or paragraph fields. */
|
|
143
|
+
declare const resolveStyleParagraphNumbering: (resolver: StyleResolver, styleId: string | undefined | null) => import("@stll/docx-core/model").ParagraphNumberingOverride | undefined;
|
|
141
144
|
//#endregion
|
|
142
|
-
export { ResolvedParagraphStyle, StyleResolver, TableCellParagraphSpacingOverlay, createStyleResolver };
|
|
145
|
+
export { ResolvedParagraphStyle, StyleResolver, TableCellParagraphSpacingOverlay, createStyleResolver, resolveStyleParagraphNumbering };
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { createBuiltInStyleIndex } from "../../docx/builtInStyles.js";
|
|
2
2
|
import { BUILT_IN_DEFAULT_PARAGRAPH_FORMATTING, resolveDefaultParagraphStyle } from "../../docx/defaultParagraphStyle.js";
|
|
3
|
+
import { mergeParagraphNumbering } from "../../docx/numberingReference.js";
|
|
3
4
|
import { mergeParagraphFormatting } from "../../utils/paragraphFormattingMerge.js";
|
|
4
5
|
import { cascadeStyleTextFormatting } from "./styleToggleCascade.js";
|
|
5
6
|
//#region src/prosemirror/styles/styleResolver.ts
|
|
@@ -108,18 +109,21 @@ var StyleResolver = class {
|
|
|
108
109
|
resolveParagraphStyleInTable(styleId, tableParagraphOverlay) {
|
|
109
110
|
return this.resolveParagraphStyleCascade(styleId, tableParagraphOverlay);
|
|
110
111
|
}
|
|
112
|
+
resolveParagraphFormatting(styleId, tableParagraphOverlay) {
|
|
113
|
+
const [defaults, overlay, style] = paragraphFormattingLayers({
|
|
114
|
+
resolver: this,
|
|
115
|
+
styleId,
|
|
116
|
+
tableParagraphOverlay
|
|
117
|
+
});
|
|
118
|
+
let formatting = defaults ? { ...defaults } : void 0;
|
|
119
|
+
for (const layer of [overlay, style]) formatting = mergeParagraphFormatting(formatting, layer) ?? formatting;
|
|
120
|
+
return formatting;
|
|
121
|
+
}
|
|
111
122
|
resolveParagraphStyleCascade(styleId, tableParagraphOverlay) {
|
|
112
123
|
const result = {};
|
|
113
|
-
|
|
114
|
-
if (
|
|
115
|
-
|
|
116
|
-
if (merged !== void 0) result.paragraphFormatting = merged;
|
|
117
|
-
}
|
|
118
|
-
const style = styleId ? this.stylesById.get(styleId) ?? this.defaultParagraphStyle : this.defaultParagraphStyle;
|
|
119
|
-
if (style?.pPr) {
|
|
120
|
-
const merged = mergeParagraphFormatting(result.paragraphFormatting, style.pPr);
|
|
121
|
-
if (merged) result.paragraphFormatting = merged;
|
|
122
|
-
}
|
|
124
|
+
const paragraphFormatting = this.resolveParagraphFormatting(styleId, tableParagraphOverlay);
|
|
125
|
+
if (paragraphFormatting) result.paragraphFormatting = paragraphFormatting;
|
|
126
|
+
const style = paragraphStyleFor(this, styleId);
|
|
123
127
|
const runFormatting = cascadeStyleTextFormatting([{
|
|
124
128
|
formatting: this.docDefaults?.rPr,
|
|
125
129
|
type: "defaults"
|
|
@@ -232,5 +236,22 @@ var StyleResolver = class {
|
|
|
232
236
|
function createStyleResolver(styleDefinitions) {
|
|
233
237
|
return new StyleResolver(styleDefinitions);
|
|
234
238
|
}
|
|
239
|
+
const paragraphStyleFor = (resolver, styleId) => (styleId ? resolver.getStyle(styleId) : void 0) ?? resolver.getDefaultParagraphStyle();
|
|
240
|
+
/** Paragraph tiers that can contribute numbering; the table overlay is spacing-only. */
|
|
241
|
+
const paragraphNumberingLayers = (resolver, styleId) => [resolver.getDocDefaults()?.pPr, paragraphStyleFor(resolver, styleId)?.pPr];
|
|
242
|
+
const paragraphFormattingLayers = ({ resolver, styleId, tableParagraphOverlay }) => {
|
|
243
|
+
const [defaults, style] = paragraphNumberingLayers(resolver, styleId);
|
|
244
|
+
return [
|
|
245
|
+
defaults,
|
|
246
|
+
tableParagraphOverlay,
|
|
247
|
+
style
|
|
248
|
+
];
|
|
249
|
+
};
|
|
250
|
+
/** The same ordered paragraph tiers, without unrelated run or paragraph fields. */
|
|
251
|
+
const resolveStyleParagraphNumbering = (resolver, styleId) => {
|
|
252
|
+
let numbering;
|
|
253
|
+
for (const layer of paragraphNumberingLayers(resolver, styleId)) numbering = mergeParagraphNumbering(numbering, layer?.numPr);
|
|
254
|
+
return numbering;
|
|
255
|
+
};
|
|
235
256
|
//#endregion
|
|
236
|
-
export { StyleResolver, createStyleResolver };
|
|
257
|
+
export { StyleResolver, createStyleResolver, resolveStyleParagraphNumbering };
|
|
@@ -13,6 +13,10 @@ type TextInput = {
|
|
|
13
13
|
to: number;
|
|
14
14
|
};
|
|
15
15
|
declare const dispatchEditorTextInput: <TView extends TextInputDispatchTarget<TView>>(view: TView, input: string | TextInput) => void;
|
|
16
|
+
declare const getEditorInputTargetRange: (view: EditorView, event: InputEvent) => {
|
|
17
|
+
from: number;
|
|
18
|
+
to: number;
|
|
19
|
+
} | null;
|
|
16
20
|
/** Shared DOM boundary for editor runtimes and standalone suggestion views. */
|
|
17
21
|
declare const handleEditorBeforeInput: (view: EditorView, event: InputEvent) => boolean;
|
|
18
22
|
/**
|
|
@@ -23,4 +27,4 @@ declare const afterNativeCompositionFlush: (callback: () => void) => void;
|
|
|
23
27
|
/** Route committed text through the model before the browser mutates mark spans. */
|
|
24
28
|
declare const createTextInputPlugin: () => Plugin<any>;
|
|
25
29
|
//#endregion
|
|
26
|
-
export { afterNativeCompositionFlush, createTextInputPlugin, dispatchEditorTextInput, handleEditorBeforeInput };
|
|
30
|
+
export { afterNativeCompositionFlush, createTextInputPlugin, dispatchEditorTextInput, getEditorInputTargetRange, handleEditorBeforeInput };
|
|
@@ -19,7 +19,7 @@ const dispatchEditorTextInput = (view, input) => {
|
|
|
19
19
|
};
|
|
20
20
|
if (!view.someProp("handleTextInput", (handler) => handler(view, from, to, text, defaultTransaction))) view.dispatch(defaultTransaction());
|
|
21
21
|
};
|
|
22
|
-
const
|
|
22
|
+
const getEditorInputTargetRange = (view, event) => {
|
|
23
23
|
if (typeof event.getTargetRanges !== "function") return null;
|
|
24
24
|
const ranges = event.getTargetRanges();
|
|
25
25
|
if (ranges.length !== 1) return null;
|
|
@@ -39,7 +39,7 @@ const handleEditorBeforeInput = (view, event) => {
|
|
|
39
39
|
if (event.inputType !== "insertText" && event.inputType !== "insertReplacementText") return false;
|
|
40
40
|
const text = event.data ?? (event.dataTransfer?.types.includes("text/plain") ? event.dataTransfer.getData("text/plain") : null);
|
|
41
41
|
if (text === null) return false;
|
|
42
|
-
const selection = event.inputType === "insertReplacementText" ?
|
|
42
|
+
const selection = event.inputType === "insertReplacementText" ? getEditorInputTargetRange(view, event) : view.state.selection;
|
|
43
43
|
if (!selection) return false;
|
|
44
44
|
event.preventDefault();
|
|
45
45
|
dispatchEditorTextInput(view, {
|
|
@@ -78,4 +78,4 @@ const createTextInputPlugin = () => {
|
|
|
78
78
|
} } });
|
|
79
79
|
};
|
|
80
80
|
//#endregion
|
|
81
|
-
export { afterNativeCompositionFlush, createTextInputPlugin, dispatchEditorTextInput, handleEditorBeforeInput };
|
|
81
|
+
export { afterNativeCompositionFlush, createTextInputPlugin, dispatchEditorTextInput, getEditorInputTargetRange, handleEditorBeforeInput };
|
|
@@ -13,5 +13,9 @@ type EnclosingInsertionAncestorsOptions = {
|
|
|
13
13
|
};
|
|
14
14
|
/** The deletion's ancestor path, with the insertion it sits in as the outermost layer. */
|
|
15
15
|
declare const enclosingInsertionAncestors: ({ insertionMark, ancestors, node }: EnclosingInsertionAncestorsOptions) => readonly TrackedRevisionAncestor[];
|
|
16
|
+
/** The authored revision layers already owned by a mark, outermost first. */
|
|
17
|
+
declare const trackedRevisionPathOf: (mark: Mark) => readonly TrackedRevisionAncestor[];
|
|
18
|
+
/** Promote a surviving existing layer; callers cannot supply a fresh identity. */
|
|
19
|
+
declare const retainedTrackedRevisionMark: (mark: Mark, keepLayer: (layer: TrackedRevisionAncestor) => boolean) => Mark | null;
|
|
16
20
|
//#endregion
|
|
17
|
-
export { enclosingInsertionAncestors, inlineWrapperStackOf, trackedRevisionLayerOf };
|
|
21
|
+
export { enclosingInsertionAncestors, inlineWrapperStackOf, retainedTrackedRevisionMark, trackedRevisionLayerOf, trackedRevisionPathOf };
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { expectInlineWrapperMarkAttrs, expectTrackedChangeMarkAttrs } from "./attrs/index.js";
|
|
2
2
|
import { INLINE_WRAPPER_MARK_NAME } from "./extensions/marks/InlineWrapperExtension.js";
|
|
3
|
+
import { panic } from "better-result";
|
|
3
4
|
//#region src/prosemirror/trackedRevisionPath.ts
|
|
4
5
|
/** The wrappers `node` sits inside, outermost first; empty when it sits in none. */
|
|
5
6
|
const inlineWrapperStackOf = (node) => {
|
|
@@ -29,5 +30,42 @@ const enclosingInsertionAncestors = ({ insertionMark, ancestors, node }) => {
|
|
|
29
30
|
if (ancestors.some(({ revisionId }) => revisionId === attrs.revisionId)) return ancestors;
|
|
30
31
|
return [trackedRevisionLayerOf(insertionMark, node), ...ancestors];
|
|
31
32
|
};
|
|
33
|
+
const revisionLayerOf = (mark) => {
|
|
34
|
+
const attrs = expectTrackedChangeMarkAttrs(mark);
|
|
35
|
+
let type;
|
|
36
|
+
if (mark.type.name === "insertion") type = attrs.moveKind === "moveTo" ? "moveTo" : "insertion";
|
|
37
|
+
else type = attrs.moveKind === "moveFrom" ? "moveFrom" : "deletion";
|
|
38
|
+
return {
|
|
39
|
+
type,
|
|
40
|
+
revisionId: attrs.revisionId,
|
|
41
|
+
author: attrs.author,
|
|
42
|
+
...attrs.date ? { date: attrs.date } : {},
|
|
43
|
+
...attrs.utcDate ? { utcDate: attrs.utcDate } : {},
|
|
44
|
+
...attrs.initials ? { initials: attrs.initials } : {},
|
|
45
|
+
outerWrapperCount: attrs._docxOuterWrapperCount ?? 0
|
|
46
|
+
};
|
|
47
|
+
};
|
|
48
|
+
/** The authored revision layers already owned by a mark, outermost first. */
|
|
49
|
+
const trackedRevisionPathOf = (mark) => [...expectTrackedChangeMarkAttrs(mark)._docxRevisionAncestors ?? [], revisionLayerOf(mark)];
|
|
50
|
+
/** Promote a surviving existing layer; callers cannot supply a fresh identity. */
|
|
51
|
+
const retainedTrackedRevisionMark = (mark, keepLayer) => {
|
|
52
|
+
const remaining = trackedRevisionPathOf(mark).filter(keepLayer);
|
|
53
|
+
const active = remaining.at(-1);
|
|
54
|
+
if (!active) return null;
|
|
55
|
+
const name = active.type === "insertion" || active.type === "moveTo" ? "insertion" : "deletion";
|
|
56
|
+
const type = mark.type.schema.marks[name];
|
|
57
|
+
if (!type) panic("A nested tracked revision has no editor mark type");
|
|
58
|
+
return type.create({
|
|
59
|
+
revisionId: active.revisionId,
|
|
60
|
+
author: active.author,
|
|
61
|
+
date: active.date ?? null,
|
|
62
|
+
utcDate: active.utcDate ?? null,
|
|
63
|
+
initials: active.initials ?? null,
|
|
64
|
+
moveKind: active.type === "moveTo" || active.type === "moveFrom" ? active.type : null,
|
|
65
|
+
_historicalFormatting: active.type === "deletion" || active.type === "moveFrom" ? true : null,
|
|
66
|
+
_docxOuterWrapperCount: active.outerWrapperCount,
|
|
67
|
+
_docxRevisionAncestors: remaining.length > 1 ? remaining.slice(0, -1) : null
|
|
68
|
+
});
|
|
69
|
+
};
|
|
32
70
|
//#endregion
|
|
33
|
-
export { enclosingInsertionAncestors, inlineWrapperStackOf, trackedRevisionLayerOf };
|
|
71
|
+
export { enclosingInsertionAncestors, inlineWrapperStackOf, retainedTrackedRevisionMark, trackedRevisionLayerOf, trackedRevisionPathOf };
|
|
@@ -2,7 +2,7 @@ import { readNoteMarkerAttrs } from "../internal/noteMarkerAttrs.js";
|
|
|
2
2
|
import { readBlockCustomXmlAttrs, readBlockSdtAttrs, readCharacterSpacingMarkAttrs, readCharacterStyleMarkAttrs, readCommentMarkAttrs, readEmphasisMarkAttrs, readFieldAttrs, readFontFamilyMarkAttrs, readFontSizeMarkAttrs, readFootnoteRefMarkAttrs, readHardBreakAttrs, readHighlightMarkAttrs, readHyperlinkMarkAttrs, readImageAttrs, readInlineWrapperMarkAttrs, readLanguageMarkAttrs, readMathAttrs, readPageBreakRunAttrs, readParagraphAttrs, readPreservedBlockAttrs, readPreservedXmlAttrs, readRunFormattingOverrideMarkAttrs, readRunIdentityMarkAttrs, readRunPropertyChangeMarkAttrs, readRunShadingMarkAttrs, readSdtAttrs, readShapeAttrs, readStrikeMarkAttrs, readSymbolAttrs, readTabAttrs, readTableAttrs, readTableCellAttrs, readTableRowAttrs, readTextBoxAttrs, readTextColorMarkAttrs, readTextEffectMarkAttrs, readTrackedChangeMarkAttrs, readUnderlineMarkAttrs } from "./attrs/index.js";
|
|
3
3
|
import { readBookmarkBoundaryAttrs } from "./bookmarkBoundaryAttrs.js";
|
|
4
4
|
import { readCommentReferenceAttrs } from "./commentReferenceAttrs.js";
|
|
5
|
-
import {
|
|
5
|
+
import { fieldRequiresStructuredContent } from "./fieldRepresentation.js";
|
|
6
6
|
import { readMoveRangeBoundaryAttrs } from "./moveRangeBoundaryAttrs.js";
|
|
7
7
|
import { readRangeAnchorAttrs } from "./rangeAnchorAttrs.js";
|
|
8
8
|
import { readTextBoxAnchorAttrs } from "./textBoxAnchorAttrs.js";
|
|
@@ -249,8 +249,6 @@ const validateNodeAttrs = (node, path, issues) => {
|
|
|
249
249
|
if (fieldAttrs.ok) {
|
|
250
250
|
const hasStructuredHyperlink = node.content.content.some((child) => child.marks.some((mark) => mark.type.name === "hyperlink"));
|
|
251
251
|
const hasPageBreakCarrier = node.content.content.some((child) => child.type.name === "pageBreakRun");
|
|
252
|
-
const hasPreservedCapture = node.content.content.some((child) => child.type.name === "preservedXml");
|
|
253
|
-
const hasInlineWrapper = node.content.content.some((child) => child.marks.some((mark) => mark.type.name === INLINE_WRAPPER_MARK_NAME));
|
|
254
252
|
if (fieldAttrs.value.fieldKind === "complex" && !hasPageBreakCarrier) issues.push({
|
|
255
253
|
path: `${path}.content`,
|
|
256
254
|
message: "Complex fields cannot contain structured result children."
|
|
@@ -259,9 +257,9 @@ const validateNodeAttrs = (node, path, issues) => {
|
|
|
259
257
|
path: `${path}.content`,
|
|
260
258
|
message: "Complex field results cannot contain hyperlink content."
|
|
261
259
|
});
|
|
262
|
-
else if (!
|
|
260
|
+
else if (!fieldRequiresStructuredContent(node.content.content)) issues.push({
|
|
263
261
|
path: `${path}.content`,
|
|
264
|
-
message: "Structured simple fields require
|
|
262
|
+
message: "Structured simple fields require non-text, hyperlink, wrapper or tracked content."
|
|
265
263
|
});
|
|
266
264
|
node.forEach((child, _offset, index) => {
|
|
267
265
|
const childPath = `${path}.content[${index}]`;
|
|
@@ -8,14 +8,20 @@ import * as Y from "yjs";
|
|
|
8
8
|
*/
|
|
9
9
|
type AttrSchemaMigrationStep = (fragment: Y.XmlFragment) => number;
|
|
10
10
|
/** Every attr-schema version this build reads, oldest first, with no gaps. */
|
|
11
|
-
declare const FOLIO_YJS_ATTR_SCHEMA_VERSIONS: readonly [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11];
|
|
11
|
+
declare const FOLIO_YJS_ATTR_SCHEMA_VERSIONS: readonly [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12];
|
|
12
12
|
/** An attr-schema version this build can read. */
|
|
13
13
|
type FolioYjsAttrSchemaVersion = (typeof FOLIO_YJS_ATTR_SCHEMA_VERSIONS)[number];
|
|
14
14
|
/**
|
|
15
15
|
* The attr-schema version this build writes. Derived against the migration map
|
|
16
16
|
* so the constant and the map cannot disagree.
|
|
17
17
|
*/
|
|
18
|
-
declare const FOLIO_YJS_ATTR_SCHEMA_VERSION =
|
|
18
|
+
declare const FOLIO_YJS_ATTR_SCHEMA_VERSION = 12;
|
|
19
|
+
declare const FolioYjsNoteReferenceSchemaError_base: import("better-result").TaggedErrorClass<"FolioYjsNoteReferenceSchemaError">;
|
|
20
|
+
declare class FolioYjsNoteReferenceSchemaError extends FolioYjsNoteReferenceSchemaError_base<{
|
|
21
|
+
message: string;
|
|
22
|
+
schemaVersion: FolioYjsAttrSchemaVersion;
|
|
23
|
+
requiredSchemaVersion: FolioYjsAttrSchemaVersion;
|
|
24
|
+
}> {}
|
|
19
25
|
/**
|
|
20
26
|
* The steps that carry a snapshot written under `fromVersion` up to
|
|
21
27
|
* {@link FOLIO_YJS_ATTR_SCHEMA_VERSION}, in order. Empty when the snapshot is
|
|
@@ -70,4 +76,4 @@ declare const writeYjsDocumentMetadata: (ydoc: Y.Doc, document: Node) => void;
|
|
|
70
76
|
declare const readYjsParagraphSourceContract: (ydoc: Y.Doc) => string | null;
|
|
71
77
|
declare const withParagraphSourceContract: (document: Node, contract: string) => Node;
|
|
72
78
|
//#endregion
|
|
73
|
-
export { FOLIO_YJS_ATTR_SCHEMA_VERSION, FolioYjsAttrSchemaVersion, FolioYjsAttrSchemaVersionError, applyAttrSchemaMigrations, attrSchemaMigrationSteps, proseDocumentParagraphSourceContract, readYjsAttrSchemaVersion, readYjsParagraphSourceContract, withParagraphSourceContract, writeYjsAttrSchemaVersion, writeYjsDocumentMetadata };
|
|
79
|
+
export { FOLIO_YJS_ATTR_SCHEMA_VERSION, FolioYjsAttrSchemaVersion, FolioYjsAttrSchemaVersionError, FolioYjsNoteReferenceSchemaError, applyAttrSchemaMigrations, attrSchemaMigrationSteps, proseDocumentParagraphSourceContract, readYjsAttrSchemaVersion, readYjsParagraphSourceContract, withParagraphSourceContract, writeYjsAttrSchemaVersion, writeYjsDocumentMetadata };
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { PROSE_PARAGRAPH_SOURCE_CONTRACT_ATTR, getProseDocumentParagraphPropertySourceContract } from "../docx/paragraphPropertySource.js";
|
|
2
|
+
import { isNoteReferenceOccurrenceId } from "./noteReferenceOccurrenceId.js";
|
|
2
3
|
import { mintSectionProperties, parseSectionBreakType } from "./sectionCarrier.js";
|
|
3
4
|
import { Result, TaggedError, panic } from "better-result";
|
|
4
5
|
import { DRAWING_RAW_XML_MODES, outlineLevelFromStatedValue, paragraphNumberingFromSlots } from "@stll/docx-core/model";
|
|
@@ -473,7 +474,8 @@ const FOLIO_YJS_ATTR_SCHEMA_VERSIONS = [
|
|
|
473
474
|
8,
|
|
474
475
|
9,
|
|
475
476
|
10,
|
|
476
|
-
11
|
|
477
|
+
11,
|
|
478
|
+
12
|
|
477
479
|
];
|
|
478
480
|
/**
|
|
479
481
|
* The one place a persisted attr-shape change is decided.
|
|
@@ -497,13 +499,39 @@ const ATTR_SCHEMA_MIGRATIONS = {
|
|
|
497
499
|
8: mintSectionPropertiesFromBreakType,
|
|
498
500
|
9: dropUnstatedPlaceholderFlags,
|
|
499
501
|
10: renamePageBreakRunOwnerMarkAttr,
|
|
500
|
-
11:
|
|
502
|
+
11: stampMarkerOnly,
|
|
503
|
+
12: "current"
|
|
501
504
|
};
|
|
502
505
|
/**
|
|
503
506
|
* The attr-schema version this build writes. Derived against the migration map
|
|
504
507
|
* so the constant and the map cannot disagree.
|
|
505
508
|
*/
|
|
506
|
-
const FOLIO_YJS_ATTR_SCHEMA_VERSION =
|
|
509
|
+
const FOLIO_YJS_ATTR_SCHEMA_VERSION = 12;
|
|
510
|
+
var FolioYjsNoteReferenceSchemaError = class extends TaggedError("FolioYjsNoteReferenceSchemaError") {};
|
|
511
|
+
/** Check before any migration mutates the snapshot or any PM builder can drop text. */
|
|
512
|
+
const requireNoteOccurrenceAttribution = (fragment, schemaVersion) => {
|
|
513
|
+
const visit = (node) => {
|
|
514
|
+
for (const child of node.toArray()) {
|
|
515
|
+
if (typeof child === "string") continue;
|
|
516
|
+
if (!isXmlText(child)) {
|
|
517
|
+
if ("toArray" in child) visit(child);
|
|
518
|
+
continue;
|
|
519
|
+
}
|
|
520
|
+
for (const op of child.toDelta()) {
|
|
521
|
+
const attributes = op.attributes;
|
|
522
|
+
if (!isRecord(attributes) || attributes["footnoteRef"] == null) continue;
|
|
523
|
+
const reference = attributes["footnoteRef"];
|
|
524
|
+
if (isRecord(reference) && isNoteReferenceOccurrenceId(reference["occurrenceId"])) continue;
|
|
525
|
+
throw new FolioYjsNoteReferenceSchemaError({
|
|
526
|
+
schemaVersion,
|
|
527
|
+
requiredSchemaVersion: 12,
|
|
528
|
+
message: `Yjs schema ${schemaVersion} has unattributed note references; schema 12 requires occurrence identities. Rebuild the collaboration state from the saved DOCX.`
|
|
529
|
+
});
|
|
530
|
+
}
|
|
531
|
+
}
|
|
532
|
+
};
|
|
533
|
+
visit(fragment);
|
|
534
|
+
};
|
|
507
535
|
/**
|
|
508
536
|
* The steps that carry a snapshot written under `fromVersion` up to
|
|
509
537
|
* {@link FOLIO_YJS_ATTR_SCHEMA_VERSION}, in order. Empty when the snapshot is
|
|
@@ -528,7 +556,8 @@ const attrSchemaMigrationSteps = (fromVersion) => FOLIO_YJS_ATTR_SCHEMA_VERSIONS
|
|
|
528
556
|
* Returns how many elements the steps rewrote.
|
|
529
557
|
*/
|
|
530
558
|
const applyAttrSchemaMigrations = (ydoc, fragment, fromVersion) => {
|
|
531
|
-
|
|
559
|
+
requireNoteOccurrenceAttribution(fragment, fromVersion);
|
|
560
|
+
if (fromVersion === 12) return 0;
|
|
532
561
|
let rewritten = 0;
|
|
533
562
|
ydoc.transact(() => {
|
|
534
563
|
for (const step of attrSchemaMigrationSteps(fromVersion)) rewritten += step(fragment);
|
|
@@ -538,7 +567,7 @@ const applyAttrSchemaMigrations = (ydoc, fragment, fromVersion) => {
|
|
|
538
567
|
};
|
|
539
568
|
/** Raised when a snapshot's attr-schema marker is ahead of the running code. */
|
|
540
569
|
var FolioYjsAttrSchemaVersionError = class extends TaggedError("FolioYjsAttrSchemaVersionError") {};
|
|
541
|
-
const isReadableVersion = (marker) => typeof marker === "number" && Number.isInteger(marker) && marker >= 0 && marker <=
|
|
570
|
+
const isReadableVersion = (marker) => typeof marker === "number" && Number.isInteger(marker) && marker >= 0 && marker <= 12;
|
|
542
571
|
/**
|
|
543
572
|
* The attr-schema version a collaboration document was written under.
|
|
544
573
|
*
|
|
@@ -556,7 +585,7 @@ const readYjsAttrSchemaVersion = (ydoc) => {
|
|
|
556
585
|
return Result.err(new FolioYjsAttrSchemaVersionError({
|
|
557
586
|
marker,
|
|
558
587
|
message: "The collaboration snapshot was written by a newer Folio attr schema than this build reads.",
|
|
559
|
-
supportedVersion:
|
|
588
|
+
supportedVersion: 12
|
|
560
589
|
}));
|
|
561
590
|
};
|
|
562
591
|
const proseDocumentParagraphSourceContract = (document) => {
|
|
@@ -564,7 +593,7 @@ const proseDocumentParagraphSourceContract = (document) => {
|
|
|
564
593
|
};
|
|
565
594
|
/** Stamp the attr-schema version of the build that wrote the current fragment. */
|
|
566
595
|
const writeYjsAttrSchemaVersion = (ydoc) => {
|
|
567
|
-
ydoc.getMap(FOLIO_YJS_METADATA_MAP_NAME).set(ATTR_SCHEMA_VERSION_KEY,
|
|
596
|
+
ydoc.getMap(FOLIO_YJS_METADATA_MAP_NAME).set(ATTR_SCHEMA_VERSION_KEY, 12);
|
|
568
597
|
};
|
|
569
598
|
/**
|
|
570
599
|
* Write both metadata bindings for a freshly seeded collaboration document.
|
|
@@ -589,4 +618,4 @@ const withParagraphSourceContract = (document, contract) => {
|
|
|
589
618
|
}, document.content, document.marks);
|
|
590
619
|
};
|
|
591
620
|
//#endregion
|
|
592
|
-
export { FOLIO_YJS_ATTR_SCHEMA_VERSION, FolioYjsAttrSchemaVersionError, applyAttrSchemaMigrations, attrSchemaMigrationSteps, proseDocumentParagraphSourceContract, readYjsAttrSchemaVersion, readYjsParagraphSourceContract, withParagraphSourceContract, writeYjsAttrSchemaVersion, writeYjsDocumentMetadata };
|
|
621
|
+
export { FOLIO_YJS_ATTR_SCHEMA_VERSION, FolioYjsAttrSchemaVersionError, FolioYjsNoteReferenceSchemaError, applyAttrSchemaMigrations, attrSchemaMigrationSteps, proseDocumentParagraphSourceContract, readYjsAttrSchemaVersion, readYjsParagraphSourceContract, withParagraphSourceContract, writeYjsAttrSchemaVersion, writeYjsDocumentMetadata };
|
|
@@ -3,15 +3,15 @@
|
|
|
3
3
|
declare const CANONICAL_GAP: {
|
|
4
4
|
readonly authorityRouting: "authority-routing";
|
|
5
5
|
readonly commands: "command-descriptors";
|
|
6
|
-
readonly suggesting: "adapter-suggesting";
|
|
7
6
|
readonly trackedHyperlinkResolution: "tracked-hyperlink-resolution";
|
|
7
|
+
readonly storyContentProjection: "story-content-projection";
|
|
8
8
|
readonly comments: "comment-model-edits";
|
|
9
9
|
readonly modelEdits: "direct-model-edits";
|
|
10
10
|
readonly sectionProperties: "section-properties";
|
|
11
11
|
readonly watermark: "watermark-model-edits";
|
|
12
|
-
readonly secondaryStories: "secondary-story-routing";
|
|
13
12
|
readonly collaboration: "collaboration-session";
|
|
14
13
|
readonly dispatch: "unclassified-transactions";
|
|
14
|
+
readonly tableActivation: "table-session-activation";
|
|
15
15
|
readonly save: "pm-save-projection";
|
|
16
16
|
readonly resourceReplacement: "canonical-resource-replacement";
|
|
17
17
|
readonly history: "pm-history";
|
|
@@ -50,19 +50,19 @@ declare const CANONICAL_CAPABILITIES: {
|
|
|
50
50
|
readonly owner: "controller";
|
|
51
51
|
readonly kind: "refusal";
|
|
52
52
|
readonly adapters: readonly ["react", "vue"];
|
|
53
|
-
readonly summary: "Hyperlink and TOC suggestions require serializable wrapper review provenance.";
|
|
53
|
+
readonly summary: "Hyperlink and TOC suggestions and edits intersecting review identities require serializable wrapper review provenance.";
|
|
54
54
|
};
|
|
55
|
-
readonly "
|
|
56
|
-
readonly owner: "
|
|
55
|
+
readonly "story-content-projection": {
|
|
56
|
+
readonly owner: "controller";
|
|
57
57
|
readonly kind: "refusal";
|
|
58
58
|
readonly adapters: readonly ["react", "vue"];
|
|
59
|
-
readonly summary: "
|
|
59
|
+
readonly summary: "Unsupported inline, field and review content cannot be projected after canonical edits.";
|
|
60
60
|
};
|
|
61
61
|
readonly "comment-model-edits": {
|
|
62
62
|
readonly owner: "adapters";
|
|
63
|
-
readonly kind: "
|
|
63
|
+
readonly kind: "routing";
|
|
64
64
|
readonly adapters: readonly ["react", "vue"];
|
|
65
|
-
readonly summary: "
|
|
65
|
+
readonly summary: "Default sessions retain comment model edits; canonical comments use semantic operations.";
|
|
66
66
|
};
|
|
67
67
|
readonly "direct-model-edits": {
|
|
68
68
|
readonly owner: "adapters";
|
|
@@ -71,10 +71,10 @@ declare const CANONICAL_CAPABILITIES: {
|
|
|
71
71
|
readonly summary: "Direct model and pending-suggestion snapshots bypass the canonical journal.";
|
|
72
72
|
};
|
|
73
73
|
readonly "section-properties": {
|
|
74
|
-
readonly owner: "
|
|
74
|
+
readonly owner: "controller";
|
|
75
75
|
readonly kind: "routing";
|
|
76
76
|
readonly adapters: readonly ["react", "vue"];
|
|
77
|
-
readonly summary: "
|
|
77
|
+
readonly summary: "The shared controller journals section properties; default sessions keep model changes.";
|
|
78
78
|
};
|
|
79
79
|
readonly "watermark-model-edits": {
|
|
80
80
|
readonly owner: "adapters";
|
|
@@ -82,12 +82,6 @@ declare const CANONICAL_CAPABILITIES: {
|
|
|
82
82
|
readonly adapters: readonly ["vue"];
|
|
83
83
|
readonly summary: "Vue watermark mutations still change the model directly.";
|
|
84
84
|
};
|
|
85
|
-
readonly "secondary-story-routing": {
|
|
86
|
-
readonly owner: "controller";
|
|
87
|
-
readonly kind: "routing";
|
|
88
|
-
readonly adapters: readonly ["react", "vue"];
|
|
89
|
-
readonly summary: "Secondary-story creation, views and history still select their session authority.";
|
|
90
|
-
};
|
|
91
85
|
readonly "collaboration-session": {
|
|
92
86
|
readonly owner: "controller";
|
|
93
87
|
readonly kind: "refusal";
|
|
@@ -100,6 +94,12 @@ declare const CANONICAL_CAPABILITIES: {
|
|
|
100
94
|
readonly adapters: readonly ["react", "vue"];
|
|
101
95
|
readonly summary: "Unclassified native and plugin mutations are refused at the projection boundary.";
|
|
102
96
|
};
|
|
97
|
+
readonly "table-session-activation": {
|
|
98
|
+
readonly owner: "controller";
|
|
99
|
+
readonly kind: "refusal";
|
|
100
|
+
readonly adapters: readonly ["react", "vue"];
|
|
101
|
+
readonly summary: "Canonical session activation requires table projection and cell addressing.";
|
|
102
|
+
};
|
|
103
103
|
readonly "pm-save-projection": {
|
|
104
104
|
readonly owner: "controller";
|
|
105
105
|
readonly kind: "routing";
|
|
@@ -152,9 +152,9 @@ declare const CANONICAL_CAPABILITIES: {
|
|
|
152
152
|
readonly "publicOps.comments": {
|
|
153
153
|
readonly owner: "document-operations";
|
|
154
154
|
readonly defaultSessionMutation: "pm-public-operations";
|
|
155
|
-
readonly kind: "
|
|
155
|
+
readonly kind: "routing";
|
|
156
156
|
readonly adapters: readonly ["react", "vue"];
|
|
157
|
-
readonly summary: "
|
|
157
|
+
readonly summary: "Canonical public comments compile to semantic operations; default sessions retain PM comments.";
|
|
158
158
|
};
|
|
159
159
|
readonly "publicOps.suggestedMode": {
|
|
160
160
|
readonly owner: "document-operations";
|