@stll/folio-core 0.55.0 → 0.56.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 +169 -38
- package/dist/ai-edits/headless.js +2 -2
- package/dist/ai-edits/types.d.ts +7 -1
- package/dist/compare/compare.js +1 -0
- package/dist/compare/reproducible-package.d.ts +0 -17
- package/dist/compare/reproducible-package.js +12 -18
- package/dist/controller/canonicalClipboard.d.ts +23 -0
- package/dist/controller/canonicalClipboard.js +476 -0
- package/dist/controller/canonicalClipboardResources.d.ts +21 -0
- package/dist/controller/canonicalClipboardResources.js +382 -0
- package/dist/controller/canonicalComposition.d.ts +20 -3
- package/dist/controller/canonicalComposition.js +166 -38
- package/dist/controller/canonicalInlineProjection.d.ts +113 -0
- package/dist/controller/canonicalInlineProjection.js +393 -0
- package/dist/controller/canonicalInput.d.ts +13 -4
- package/dist/controller/canonicalInput.js +52 -13
- package/dist/controller/canonicalInputTimer.d.ts +7 -0
- package/dist/controller/canonicalInputTimer.js +11 -0
- package/dist/controller/canonicalPublicOperations.d.ts +48 -0
- package/dist/controller/canonicalPublicOperations.js +556 -0
- package/dist/controller/canonicalSession.d.ts +24 -6
- package/dist/controller/canonicalSession.js +259 -111
- package/dist/controller/canonicalStoryEditor.d.ts +5 -3
- package/dist/controller/canonicalStoryEditor.js +7 -2
- package/dist/controller/canonicalStructure.js +57 -4
- package/dist/controller/canonicalTocSelection.d.ts +11 -0
- package/dist/controller/canonicalTocSelection.js +43 -0
- package/dist/controller/folioEditor.d.ts +2 -9
- package/dist/controller/folioEditor.js +5 -4
- package/dist/controller/headerFooterEditorManager.d.ts +2 -1
- package/dist/controller/headerFooterEditorManager.js +8 -7
- package/dist/controller/hiddenEditorApi.d.ts +12 -2
- package/dist/controller/hiddenEditorApi.js +4 -0
- package/dist/controller/hiddenEditorManager.d.ts +3 -1
- package/dist/controller/hiddenEditorManager.js +216 -34
- package/dist/controller/noteEditorManager.d.ts +2 -1
- package/dist/controller/noteEditorManager.js +8 -7
- package/dist/document-operations.d.ts +8 -1
- package/dist/document-operations.js +6 -4
- package/dist/docx/blockPlainText.d.ts +1 -1
- package/dist/docx/blockPlainText.js +11 -3
- package/dist/docx/canonicalResourceSave.d.ts +16 -0
- package/dist/docx/canonicalResourceSave.js +27 -0
- package/dist/docx/canonicalSave.d.ts +29 -0
- package/dist/docx/canonicalSave.js +101 -0
- package/dist/docx/canonicalStoryRepack.d.ts +1 -1
- package/dist/docx/canonicalStoryRepack.js +38 -5
- package/dist/docx/documentParser.d.ts +1 -13
- package/dist/docx/documentParser.js +1 -47
- package/dist/docx/ensureParaIds.js +10 -4
- package/dist/docx/footnoteParser.d.ts +1 -11
- package/dist/docx/footnoteParser.js +1 -16
- package/dist/docx/headerFooterParser.d.ts +1 -9
- package/dist/docx/headerFooterParser.js +1 -12
- package/dist/docx/headerFooterVerbatim.d.ts +26 -1
- package/dist/docx/headerFooterVerbatim.js +81 -3
- package/dist/docx/imageParser.d.ts +13 -1
- package/dist/docx/imageParser.js +20 -11
- package/dist/docx/metadataPrivacy.js +6 -1
- package/dist/docx/packageParts.js +9 -3
- package/dist/docx/paragraphPropertySource.js +2 -1
- package/dist/docx/parser.js +2 -1
- package/dist/docx/removeHeaderFooterParts.js +17 -6
- package/dist/docx/rezip.d.ts +49 -5
- package/dist/docx/rezip.js +745 -229
- package/dist/docx/saveDiagnostics.d.ts +11 -0
- package/dist/docx/selectiveSave.d.ts +2 -1
- package/dist/docx/selectiveSave.js +32 -3
- package/dist/docx/selectiveXmlPatch.js +7 -5
- package/dist/docx/serializer/documentSerializer.d.ts +9 -2
- package/dist/docx/serializer/documentSerializer.js +29 -10
- package/dist/docx/server/applyDocxXmlPatchProposal.js +14 -9
- package/dist/docx/storyBlockReplay.d.ts +21 -1
- package/dist/docx/storyBlockReplay.js +113 -9
- package/dist/docx/storyPlainText.d.ts +20 -0
- package/dist/docx/storyPlainText.js +23 -0
- package/dist/docx/structuralXmlPatch.js +10 -22
- package/dist/docx/styleParser.d.ts +5 -1
- package/dist/docx/styleParser.js +1 -1
- package/dist/docx/tableParser.d.ts +1 -8
- package/dist/docx/tableParser.js +1 -28
- package/dist/docx/textBoxParser.d.ts +1 -5
- package/dist/docx/textBoxParser.js +1 -20
- package/dist/docx/unzip.js +6 -1
- package/dist/internal/acceptedBlockProjection.d.ts +12 -0
- package/dist/internal/acceptedBlockProjection.js +45 -0
- package/dist/managers/DocumentLoaderManager.js +2 -1
- package/dist/markdown/escape.d.ts +3 -1
- package/dist/markdown/escape.js +9 -2
- package/dist/markdown/renderBlock.js +5 -120
- package/dist/markdown/renderParagraph.js +4 -2
- package/dist/markdown/renderRuns.d.ts +7 -1
- package/dist/markdown/renderRuns.js +32 -13
- package/dist/prosemirror/canonicalCommands.d.ts +28 -4
- package/dist/prosemirror/canonicalCommands.js +11 -4
- package/dist/prosemirror/canonicalSelectionRange.d.ts +9 -0
- package/dist/prosemirror/canonicalSelectionRange.js +15 -0
- package/dist/prosemirror/clipboardIntent.d.ts +7 -0
- package/dist/prosemirror/clipboardIntent.js +9 -0
- package/dist/prosemirror/commands/pageBreak.js +2 -2
- package/dist/prosemirror/commands/pastePlainText.js +2 -1
- package/dist/prosemirror/conversion/hyphenTextCarriers.d.ts +8 -0
- package/dist/prosemirror/conversion/hyphenTextCarriers.js +8 -0
- package/dist/prosemirror/conversion/toProseDoc.d.ts +7 -1
- package/dist/prosemirror/conversion/toProseDoc.js +5 -4
- package/dist/prosemirror/extensions/core/ParagraphExtension.js +39 -30
- package/dist/prosemirror/extensions/marks/HyperlinkExtension.js +56 -28
- package/dist/prosemirror/extensions/marks/markUtils.js +3 -1
- package/dist/prosemirror/insertOperations.js +2 -1
- package/dist/prosemirror/paragraphPropertyCarry.d.ts +7 -1
- package/dist/prosemirror/paragraphPropertyCarry.js +8 -3
- package/dist/prosemirror/plugins/suggestionMode.js +7 -5
- package/dist/types/canonicalCapabilities.d.ts +215 -0
- package/dist/types/canonicalCapabilities.js +212 -0
- package/dist/types/canonicalSave.d.ts +11 -0
- package/dist/types/canonicalSave.js +0 -0
- package/dist/types/docxSerialization.d.ts +14 -0
- package/dist/types/docxSerialization.js +7 -0
- package/package.json +4 -4
|
@@ -0,0 +1,215 @@
|
|
|
1
|
+
//#region src/types/canonicalCapabilities.d.ts
|
|
2
|
+
/** Remaining seams to retire before the canonical session becomes the only authority. */
|
|
3
|
+
declare const CANONICAL_GAP: {
|
|
4
|
+
readonly authorityRouting: "authority-routing";
|
|
5
|
+
readonly commands: "command-descriptors";
|
|
6
|
+
readonly suggesting: "adapter-suggesting";
|
|
7
|
+
readonly trackedHyperlinkResolution: "tracked-hyperlink-resolution";
|
|
8
|
+
readonly comments: "comment-model-edits";
|
|
9
|
+
readonly modelEdits: "direct-model-edits";
|
|
10
|
+
readonly sectionProperties: "section-properties";
|
|
11
|
+
readonly watermark: "watermark-model-edits";
|
|
12
|
+
readonly secondaryStories: "secondary-story-routing";
|
|
13
|
+
readonly collaboration: "collaboration-session";
|
|
14
|
+
readonly dispatch: "unclassified-transactions";
|
|
15
|
+
readonly save: "pm-save-projection";
|
|
16
|
+
readonly resourceReplacement: "canonical-resource-replacement";
|
|
17
|
+
readonly history: "pm-history";
|
|
18
|
+
readonly suggestionPlugin: "pm-suggestion-plugin";
|
|
19
|
+
readonly paragraphTracker: "pm-paragraph-tracker";
|
|
20
|
+
readonly tableGeometry: "pm-table-geometry";
|
|
21
|
+
readonly paragraphIdentity: "pm-paragraph-identity";
|
|
22
|
+
readonly documentOperations: "pm-document-operations";
|
|
23
|
+
readonly aiSnapshots: "pm-ai-snapshots";
|
|
24
|
+
readonly publicComments: "publicOps.comments";
|
|
25
|
+
readonly publicSuggestedMode: "publicOps.suggestedMode";
|
|
26
|
+
readonly publicTableProjection: "publicOps.tableProjection";
|
|
27
|
+
readonly publicUnsupportedInline: "publicOps.unsupportedInline";
|
|
28
|
+
readonly publicPendingParagraphMarkProperties: "publicOps.pendingParagraphMarkProperties";
|
|
29
|
+
readonly publicHeadlessSession: "publicOps.headlessSession";
|
|
30
|
+
readonly publicSecondaryStories: "publicOps.secondaryStories";
|
|
31
|
+
};
|
|
32
|
+
type CanonicalGap = (typeof CANONICAL_GAP)[keyof typeof CANONICAL_GAP];
|
|
33
|
+
declare const CANONICAL_CAPABILITIES: {
|
|
34
|
+
readonly "authority-routing": {
|
|
35
|
+
readonly owner: "controller";
|
|
36
|
+
readonly kind: "routing";
|
|
37
|
+
readonly adapters: readonly ["react", "vue"];
|
|
38
|
+
readonly summary: "Explicit session selection and legacy authority routing.";
|
|
39
|
+
};
|
|
40
|
+
readonly "command-descriptors": {
|
|
41
|
+
readonly remainingCommands: {
|
|
42
|
+
readonly registry: "extension-commands";
|
|
43
|
+
};
|
|
44
|
+
readonly owner: "controller";
|
|
45
|
+
readonly kind: "refusal";
|
|
46
|
+
readonly adapters: readonly ["react", "vue"];
|
|
47
|
+
readonly summary: "Commands without canonical descriptors retain PM probing and hit the dispatch boundary.";
|
|
48
|
+
};
|
|
49
|
+
readonly "tracked-hyperlink-resolution": {
|
|
50
|
+
readonly owner: "controller";
|
|
51
|
+
readonly kind: "refusal";
|
|
52
|
+
readonly adapters: readonly ["react", "vue"];
|
|
53
|
+
readonly summary: "Hyperlink and TOC suggestions require serializable wrapper review provenance.";
|
|
54
|
+
};
|
|
55
|
+
readonly "adapter-suggesting": {
|
|
56
|
+
readonly owner: "adapters";
|
|
57
|
+
readonly kind: "refusal";
|
|
58
|
+
readonly adapters: readonly ["react", "vue"];
|
|
59
|
+
readonly summary: "Adapter suggesting controls and tracked secondary-story edits remain gated.";
|
|
60
|
+
};
|
|
61
|
+
readonly "comment-model-edits": {
|
|
62
|
+
readonly owner: "adapters";
|
|
63
|
+
readonly kind: "refusal";
|
|
64
|
+
readonly adapters: readonly ["react", "vue"];
|
|
65
|
+
readonly summary: "Comment mutations still use direct model changes.";
|
|
66
|
+
};
|
|
67
|
+
readonly "direct-model-edits": {
|
|
68
|
+
readonly owner: "adapters";
|
|
69
|
+
readonly kind: "refusal";
|
|
70
|
+
readonly adapters: readonly ["react", "vue"];
|
|
71
|
+
readonly summary: "Direct model and pending-suggestion snapshots bypass the canonical journal.";
|
|
72
|
+
};
|
|
73
|
+
readonly "section-properties": {
|
|
74
|
+
readonly owner: "adapters";
|
|
75
|
+
readonly kind: "routing";
|
|
76
|
+
readonly adapters: readonly ["react", "vue"];
|
|
77
|
+
readonly summary: "Section properties select canonical operations or legacy model changes.";
|
|
78
|
+
};
|
|
79
|
+
readonly "watermark-model-edits": {
|
|
80
|
+
readonly owner: "adapters";
|
|
81
|
+
readonly kind: "refusal";
|
|
82
|
+
readonly adapters: readonly ["vue"];
|
|
83
|
+
readonly summary: "Vue watermark mutations still change the model directly.";
|
|
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
|
+
readonly "collaboration-session": {
|
|
92
|
+
readonly owner: "controller";
|
|
93
|
+
readonly kind: "refusal";
|
|
94
|
+
readonly adapters: readonly ["react", "vue"];
|
|
95
|
+
readonly summary: "Collaboration cannot activate a canonical session.";
|
|
96
|
+
};
|
|
97
|
+
readonly "unclassified-transactions": {
|
|
98
|
+
readonly owner: "controller";
|
|
99
|
+
readonly kind: "refusal";
|
|
100
|
+
readonly adapters: readonly ["react", "vue"];
|
|
101
|
+
readonly summary: "Unclassified native and plugin mutations are refused at the projection boundary.";
|
|
102
|
+
};
|
|
103
|
+
readonly "pm-save-projection": {
|
|
104
|
+
readonly owner: "controller";
|
|
105
|
+
readonly kind: "routing";
|
|
106
|
+
readonly adapters: readonly ["react", "vue"];
|
|
107
|
+
readonly summary: "Legacy save and read paths reconstruct documents from PM.";
|
|
108
|
+
};
|
|
109
|
+
readonly "canonical-resource-replacement": {
|
|
110
|
+
readonly owner: "controller";
|
|
111
|
+
readonly kind: "refusal";
|
|
112
|
+
readonly adapters: readonly ["react", "vue"];
|
|
113
|
+
readonly summary: "Canonical save refuses existing style, style-default, and media replacements the package writers cannot express.";
|
|
114
|
+
};
|
|
115
|
+
readonly "pm-history": {
|
|
116
|
+
readonly owner: "prosemirror";
|
|
117
|
+
readonly kind: "mutation-source";
|
|
118
|
+
readonly adapters: readonly ["react", "vue"];
|
|
119
|
+
readonly summary: "PM history remains installed for legacy sessions.";
|
|
120
|
+
};
|
|
121
|
+
readonly "pm-suggestion-plugin": {
|
|
122
|
+
readonly owner: "prosemirror";
|
|
123
|
+
readonly kind: "mutation-source";
|
|
124
|
+
readonly adapters: readonly ["react", "vue"];
|
|
125
|
+
readonly summary: "The legacy suggestion plugin produces PM transactions.";
|
|
126
|
+
};
|
|
127
|
+
readonly "pm-paragraph-tracker": {
|
|
128
|
+
readonly owner: "prosemirror";
|
|
129
|
+
readonly kind: "mutation-source";
|
|
130
|
+
readonly adapters: readonly ["react", "vue"];
|
|
131
|
+
readonly summary: "Dirty tracking and section bookkeeping still observe PM transactions.";
|
|
132
|
+
};
|
|
133
|
+
readonly "pm-table-geometry": {
|
|
134
|
+
readonly owner: "prosemirror";
|
|
135
|
+
readonly kind: "mutation-source";
|
|
136
|
+
readonly adapters: readonly ["react", "vue"];
|
|
137
|
+
readonly summary: "Table geometry, resize and repair still produce PM transactions.";
|
|
138
|
+
};
|
|
139
|
+
readonly "pm-paragraph-identity": {
|
|
140
|
+
readonly owner: "prosemirror";
|
|
141
|
+
readonly kind: "mutation-source";
|
|
142
|
+
readonly adapters: readonly ["react", "vue"];
|
|
143
|
+
readonly summary: "Legacy paragraph identity repair remains a PM append transaction.";
|
|
144
|
+
};
|
|
145
|
+
readonly "pm-document-operations": {
|
|
146
|
+
readonly owner: "document-operations";
|
|
147
|
+
readonly defaultSessionMutation: "pm-public-operations";
|
|
148
|
+
readonly kind: "mutation-source";
|
|
149
|
+
readonly adapters: readonly ["react", "vue"];
|
|
150
|
+
readonly summary: "Public document operations still execute against a held PM view.";
|
|
151
|
+
};
|
|
152
|
+
readonly "publicOps.comments": {
|
|
153
|
+
readonly owner: "document-operations";
|
|
154
|
+
readonly defaultSessionMutation: "pm-public-operations";
|
|
155
|
+
readonly kind: "refusal";
|
|
156
|
+
readonly adapters: readonly ["react", "vue"];
|
|
157
|
+
readonly summary: "Public comment operations refuse in canonical sessions; legacy sessions retain PM comments.";
|
|
158
|
+
};
|
|
159
|
+
readonly "publicOps.suggestedMode": {
|
|
160
|
+
readonly owner: "document-operations";
|
|
161
|
+
readonly defaultSessionMutation: "pm-public-operations";
|
|
162
|
+
readonly kind: "refusal";
|
|
163
|
+
readonly adapters: readonly ["react", "vue"];
|
|
164
|
+
readonly summary: "Public suggested mode refuses in canonical sessions until pending suggestions use the journal.";
|
|
165
|
+
};
|
|
166
|
+
readonly "publicOps.tableProjection": {
|
|
167
|
+
readonly owner: "document-operations";
|
|
168
|
+
readonly defaultSessionMutation: "pm-public-operations";
|
|
169
|
+
readonly kind: "refusal";
|
|
170
|
+
readonly adapters: readonly ["react", "vue"];
|
|
171
|
+
readonly summary: "Public table operations refuse while canonical projections require paragraph stories.";
|
|
172
|
+
};
|
|
173
|
+
readonly "publicOps.unsupportedInline": {
|
|
174
|
+
readonly owner: "document-operations";
|
|
175
|
+
readonly defaultSessionMutation: "pm-public-operations";
|
|
176
|
+
readonly kind: "refusal";
|
|
177
|
+
readonly adapters: readonly ["react", "vue"];
|
|
178
|
+
readonly summary: "Unsupported public payloads refuse with a typed compiler capability gap.";
|
|
179
|
+
};
|
|
180
|
+
readonly "publicOps.pendingParagraphMarkProperties": {
|
|
181
|
+
readonly owner: "document-operations";
|
|
182
|
+
readonly defaultSessionMutation: "pm-public-operations";
|
|
183
|
+
readonly kind: "refusal";
|
|
184
|
+
readonly adapters: readonly ["react", "vue"];
|
|
185
|
+
readonly summary: "Separate paragraph property edits refuse while the paragraph mark is pending deletion; atomic merge properties remain supported.";
|
|
186
|
+
};
|
|
187
|
+
readonly "publicOps.secondaryStories": {
|
|
188
|
+
readonly owner: "document-operations";
|
|
189
|
+
readonly defaultSessionMutation: "pm-public-operations";
|
|
190
|
+
readonly kind: "refusal";
|
|
191
|
+
readonly adapters: readonly ["react", "vue"];
|
|
192
|
+
readonly summary: "Public secondary-story batches refuse until canonical story routing is available.";
|
|
193
|
+
};
|
|
194
|
+
readonly "publicOps.headlessSession": {
|
|
195
|
+
readonly owner: "document-operations";
|
|
196
|
+
readonly defaultSessionMutation: "pm-headless-reviewer";
|
|
197
|
+
readonly kind: "mutation-source";
|
|
198
|
+
readonly adapters: readonly ["react", "vue"];
|
|
199
|
+
readonly summary: "The headless reviewer has no canonical session selector while its mutations remain PM-owned.";
|
|
200
|
+
};
|
|
201
|
+
readonly "pm-ai-snapshots": {
|
|
202
|
+
readonly owner: "ai-edits";
|
|
203
|
+
readonly kind: "mutation-source";
|
|
204
|
+
readonly adapters: readonly ["react", "vue"];
|
|
205
|
+
readonly summary: "Headless AI edits still use PM execution and snapshot undo.";
|
|
206
|
+
};
|
|
207
|
+
};
|
|
208
|
+
/**
|
|
209
|
+
* The gap argument is a typed tag counted by the source guard, not a runtime policy.
|
|
210
|
+
* Retire a gap by removing its sites and ledger entry.
|
|
211
|
+
*/
|
|
212
|
+
declare const usesCanonicalSession: (session: "canonical" | undefined, _gap: CanonicalGap) => boolean;
|
|
213
|
+
declare const canonicalRefusalMessage: (gap: CanonicalGap, message: string) => string;
|
|
214
|
+
//#endregion
|
|
215
|
+
export { CANONICAL_CAPABILITIES, CANONICAL_GAP, CanonicalGap, canonicalRefusalMessage, usesCanonicalSession };
|
|
@@ -0,0 +1,212 @@
|
|
|
1
|
+
//#region src/types/canonicalCapabilities.ts
|
|
2
|
+
/** Remaining seams to retire before the canonical session becomes the only authority. */
|
|
3
|
+
const CANONICAL_GAP = {
|
|
4
|
+
authorityRouting: "authority-routing",
|
|
5
|
+
commands: "command-descriptors",
|
|
6
|
+
suggesting: "adapter-suggesting",
|
|
7
|
+
trackedHyperlinkResolution: "tracked-hyperlink-resolution",
|
|
8
|
+
comments: "comment-model-edits",
|
|
9
|
+
modelEdits: "direct-model-edits",
|
|
10
|
+
sectionProperties: "section-properties",
|
|
11
|
+
watermark: "watermark-model-edits",
|
|
12
|
+
secondaryStories: "secondary-story-routing",
|
|
13
|
+
collaboration: "collaboration-session",
|
|
14
|
+
dispatch: "unclassified-transactions",
|
|
15
|
+
save: "pm-save-projection",
|
|
16
|
+
resourceReplacement: "canonical-resource-replacement",
|
|
17
|
+
history: "pm-history",
|
|
18
|
+
suggestionPlugin: "pm-suggestion-plugin",
|
|
19
|
+
paragraphTracker: "pm-paragraph-tracker",
|
|
20
|
+
tableGeometry: "pm-table-geometry",
|
|
21
|
+
paragraphIdentity: "pm-paragraph-identity",
|
|
22
|
+
documentOperations: "pm-document-operations",
|
|
23
|
+
aiSnapshots: "pm-ai-snapshots",
|
|
24
|
+
publicComments: "publicOps.comments",
|
|
25
|
+
publicSuggestedMode: "publicOps.suggestedMode",
|
|
26
|
+
publicTableProjection: "publicOps.tableProjection",
|
|
27
|
+
publicUnsupportedInline: "publicOps.unsupportedInline",
|
|
28
|
+
publicPendingParagraphMarkProperties: "publicOps.pendingParagraphMarkProperties",
|
|
29
|
+
publicHeadlessSession: "publicOps.headlessSession",
|
|
30
|
+
publicSecondaryStories: "publicOps.secondaryStories"
|
|
31
|
+
};
|
|
32
|
+
const CANONICAL_CAPABILITIES = {
|
|
33
|
+
[CANONICAL_GAP.authorityRouting]: {
|
|
34
|
+
owner: "controller",
|
|
35
|
+
kind: "routing",
|
|
36
|
+
adapters: ["react", "vue"],
|
|
37
|
+
summary: "Explicit session selection and legacy authority routing."
|
|
38
|
+
},
|
|
39
|
+
[CANONICAL_GAP.commands]: {
|
|
40
|
+
remainingCommands: { registry: "extension-commands" },
|
|
41
|
+
owner: "controller",
|
|
42
|
+
kind: "refusal",
|
|
43
|
+
adapters: ["react", "vue"],
|
|
44
|
+
summary: "Commands without canonical descriptors retain PM probing and hit the dispatch boundary."
|
|
45
|
+
},
|
|
46
|
+
[CANONICAL_GAP.trackedHyperlinkResolution]: {
|
|
47
|
+
owner: "controller",
|
|
48
|
+
kind: "refusal",
|
|
49
|
+
adapters: ["react", "vue"],
|
|
50
|
+
summary: "Hyperlink and TOC suggestions require serializable wrapper review provenance."
|
|
51
|
+
},
|
|
52
|
+
[CANONICAL_GAP.suggesting]: {
|
|
53
|
+
owner: "adapters",
|
|
54
|
+
kind: "refusal",
|
|
55
|
+
adapters: ["react", "vue"],
|
|
56
|
+
summary: "Adapter suggesting controls and tracked secondary-story edits remain gated."
|
|
57
|
+
},
|
|
58
|
+
[CANONICAL_GAP.comments]: {
|
|
59
|
+
owner: "adapters",
|
|
60
|
+
kind: "refusal",
|
|
61
|
+
adapters: ["react", "vue"],
|
|
62
|
+
summary: "Comment mutations still use direct model changes."
|
|
63
|
+
},
|
|
64
|
+
[CANONICAL_GAP.modelEdits]: {
|
|
65
|
+
owner: "adapters",
|
|
66
|
+
kind: "refusal",
|
|
67
|
+
adapters: ["react", "vue"],
|
|
68
|
+
summary: "Direct model and pending-suggestion snapshots bypass the canonical journal."
|
|
69
|
+
},
|
|
70
|
+
[CANONICAL_GAP.sectionProperties]: {
|
|
71
|
+
owner: "adapters",
|
|
72
|
+
kind: "routing",
|
|
73
|
+
adapters: ["react", "vue"],
|
|
74
|
+
summary: "Section properties select canonical operations or legacy model changes."
|
|
75
|
+
},
|
|
76
|
+
[CANONICAL_GAP.watermark]: {
|
|
77
|
+
owner: "adapters",
|
|
78
|
+
kind: "refusal",
|
|
79
|
+
adapters: ["vue"],
|
|
80
|
+
summary: "Vue watermark mutations still change the model directly."
|
|
81
|
+
},
|
|
82
|
+
[CANONICAL_GAP.secondaryStories]: {
|
|
83
|
+
owner: "controller",
|
|
84
|
+
kind: "routing",
|
|
85
|
+
adapters: ["react", "vue"],
|
|
86
|
+
summary: "Secondary-story creation, views and history still select their session authority."
|
|
87
|
+
},
|
|
88
|
+
[CANONICAL_GAP.collaboration]: {
|
|
89
|
+
owner: "controller",
|
|
90
|
+
kind: "refusal",
|
|
91
|
+
adapters: ["react", "vue"],
|
|
92
|
+
summary: "Collaboration cannot activate a canonical session."
|
|
93
|
+
},
|
|
94
|
+
[CANONICAL_GAP.dispatch]: {
|
|
95
|
+
owner: "controller",
|
|
96
|
+
kind: "refusal",
|
|
97
|
+
adapters: ["react", "vue"],
|
|
98
|
+
summary: "Unclassified native and plugin mutations are refused at the projection boundary."
|
|
99
|
+
},
|
|
100
|
+
[CANONICAL_GAP.save]: {
|
|
101
|
+
owner: "controller",
|
|
102
|
+
kind: "routing",
|
|
103
|
+
adapters: ["react", "vue"],
|
|
104
|
+
summary: "Legacy save and read paths reconstruct documents from PM."
|
|
105
|
+
},
|
|
106
|
+
[CANONICAL_GAP.resourceReplacement]: {
|
|
107
|
+
owner: "controller",
|
|
108
|
+
kind: "refusal",
|
|
109
|
+
adapters: ["react", "vue"],
|
|
110
|
+
summary: "Canonical save refuses existing style, style-default, and media replacements the package writers cannot express."
|
|
111
|
+
},
|
|
112
|
+
[CANONICAL_GAP.history]: {
|
|
113
|
+
owner: "prosemirror",
|
|
114
|
+
kind: "mutation-source",
|
|
115
|
+
adapters: ["react", "vue"],
|
|
116
|
+
summary: "PM history remains installed for legacy sessions."
|
|
117
|
+
},
|
|
118
|
+
[CANONICAL_GAP.suggestionPlugin]: {
|
|
119
|
+
owner: "prosemirror",
|
|
120
|
+
kind: "mutation-source",
|
|
121
|
+
adapters: ["react", "vue"],
|
|
122
|
+
summary: "The legacy suggestion plugin produces PM transactions."
|
|
123
|
+
},
|
|
124
|
+
[CANONICAL_GAP.paragraphTracker]: {
|
|
125
|
+
owner: "prosemirror",
|
|
126
|
+
kind: "mutation-source",
|
|
127
|
+
adapters: ["react", "vue"],
|
|
128
|
+
summary: "Dirty tracking and section bookkeeping still observe PM transactions."
|
|
129
|
+
},
|
|
130
|
+
[CANONICAL_GAP.tableGeometry]: {
|
|
131
|
+
owner: "prosemirror",
|
|
132
|
+
kind: "mutation-source",
|
|
133
|
+
adapters: ["react", "vue"],
|
|
134
|
+
summary: "Table geometry, resize and repair still produce PM transactions."
|
|
135
|
+
},
|
|
136
|
+
[CANONICAL_GAP.paragraphIdentity]: {
|
|
137
|
+
owner: "prosemirror",
|
|
138
|
+
kind: "mutation-source",
|
|
139
|
+
adapters: ["react", "vue"],
|
|
140
|
+
summary: "Legacy paragraph identity repair remains a PM append transaction."
|
|
141
|
+
},
|
|
142
|
+
[CANONICAL_GAP.documentOperations]: {
|
|
143
|
+
owner: "document-operations",
|
|
144
|
+
defaultSessionMutation: "pm-public-operations",
|
|
145
|
+
kind: "mutation-source",
|
|
146
|
+
adapters: ["react", "vue"],
|
|
147
|
+
summary: "Public document operations still execute against a held PM view."
|
|
148
|
+
},
|
|
149
|
+
[CANONICAL_GAP.publicComments]: {
|
|
150
|
+
owner: "document-operations",
|
|
151
|
+
defaultSessionMutation: "pm-public-operations",
|
|
152
|
+
kind: "refusal",
|
|
153
|
+
adapters: ["react", "vue"],
|
|
154
|
+
summary: "Public comment operations refuse in canonical sessions; legacy sessions retain PM comments."
|
|
155
|
+
},
|
|
156
|
+
[CANONICAL_GAP.publicSuggestedMode]: {
|
|
157
|
+
owner: "document-operations",
|
|
158
|
+
defaultSessionMutation: "pm-public-operations",
|
|
159
|
+
kind: "refusal",
|
|
160
|
+
adapters: ["react", "vue"],
|
|
161
|
+
summary: "Public suggested mode refuses in canonical sessions until pending suggestions use the journal."
|
|
162
|
+
},
|
|
163
|
+
[CANONICAL_GAP.publicTableProjection]: {
|
|
164
|
+
owner: "document-operations",
|
|
165
|
+
defaultSessionMutation: "pm-public-operations",
|
|
166
|
+
kind: "refusal",
|
|
167
|
+
adapters: ["react", "vue"],
|
|
168
|
+
summary: "Public table operations refuse while canonical projections require paragraph stories."
|
|
169
|
+
},
|
|
170
|
+
[CANONICAL_GAP.publicUnsupportedInline]: {
|
|
171
|
+
owner: "document-operations",
|
|
172
|
+
defaultSessionMutation: "pm-public-operations",
|
|
173
|
+
kind: "refusal",
|
|
174
|
+
adapters: ["react", "vue"],
|
|
175
|
+
summary: "Unsupported public payloads refuse with a typed compiler capability gap."
|
|
176
|
+
},
|
|
177
|
+
[CANONICAL_GAP.publicPendingParagraphMarkProperties]: {
|
|
178
|
+
owner: "document-operations",
|
|
179
|
+
defaultSessionMutation: "pm-public-operations",
|
|
180
|
+
kind: "refusal",
|
|
181
|
+
adapters: ["react", "vue"],
|
|
182
|
+
summary: "Separate paragraph property edits refuse while the paragraph mark is pending deletion; atomic merge properties remain supported."
|
|
183
|
+
},
|
|
184
|
+
[CANONICAL_GAP.publicSecondaryStories]: {
|
|
185
|
+
owner: "document-operations",
|
|
186
|
+
defaultSessionMutation: "pm-public-operations",
|
|
187
|
+
kind: "refusal",
|
|
188
|
+
adapters: ["react", "vue"],
|
|
189
|
+
summary: "Public secondary-story batches refuse until canonical story routing is available."
|
|
190
|
+
},
|
|
191
|
+
[CANONICAL_GAP.publicHeadlessSession]: {
|
|
192
|
+
owner: "document-operations",
|
|
193
|
+
defaultSessionMutation: "pm-headless-reviewer",
|
|
194
|
+
kind: "mutation-source",
|
|
195
|
+
adapters: ["react", "vue"],
|
|
196
|
+
summary: "The headless reviewer has no canonical session selector while its mutations remain PM-owned."
|
|
197
|
+
},
|
|
198
|
+
[CANONICAL_GAP.aiSnapshots]: {
|
|
199
|
+
owner: "ai-edits",
|
|
200
|
+
kind: "mutation-source",
|
|
201
|
+
adapters: ["react", "vue"],
|
|
202
|
+
summary: "Headless AI edits still use PM execution and snapshot undo."
|
|
203
|
+
}
|
|
204
|
+
};
|
|
205
|
+
/**
|
|
206
|
+
* The gap argument is a typed tag counted by the source guard, not a runtime policy.
|
|
207
|
+
* Retire a gap by removing its sites and ledger entry.
|
|
208
|
+
*/
|
|
209
|
+
const usesCanonicalSession = (session, _gap) => session === "canonical";
|
|
210
|
+
const canonicalRefusalMessage = (gap, message) => `[${gap}] ${message}`;
|
|
211
|
+
//#endregion
|
|
212
|
+
export { CANONICAL_CAPABILITIES, CANONICAL_GAP, canonicalRefusalMessage, usesCanonicalSession };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { document_d_exports } from "./document.js";
|
|
2
|
+
//#region src/types/canonicalSave.d.ts
|
|
3
|
+
/** Committed model and conservative changes relative to its parsed source package. */
|
|
4
|
+
type CanonicalSaveSnapshot = {
|
|
5
|
+
document: document_d_exports.Document;
|
|
6
|
+
version: number;
|
|
7
|
+
changedBlockIds: readonly string[];
|
|
8
|
+
structure: "stable" | "changed";
|
|
9
|
+
};
|
|
10
|
+
//#endregion
|
|
11
|
+
export { CanonicalSaveSnapshot };
|
|
File without changes
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { SaveDiagnosticOptions } from "../docx/saveDiagnostics.js";
|
|
2
|
+
//#region src/types/docxSerialization.d.ts
|
|
3
|
+
declare const FOLIO_DOCX_SERIALIZATION_MODE: Readonly<{
|
|
4
|
+
readonly full: "full";
|
|
5
|
+
readonly preferSelective: "prefer-selective";
|
|
6
|
+
}>;
|
|
7
|
+
type FolioDocxSerializationMode = (typeof FOLIO_DOCX_SERIALIZATION_MODE)[keyof typeof FOLIO_DOCX_SERIALIZATION_MODE];
|
|
8
|
+
type FolioGetDocxOptions = {
|
|
9
|
+
/** Fidelity diagnostics for the exact snapshot being serialized. */
|
|
10
|
+
onDiagnostic?: SaveDiagnosticOptions["onDiagnostic"];
|
|
11
|
+
mode?: FolioDocxSerializationMode;
|
|
12
|
+
};
|
|
13
|
+
//#endregion
|
|
14
|
+
export { FOLIO_DOCX_SERIALIZATION_MODE, FolioDocxSerializationMode, FolioGetDocxOptions };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stll/folio-core",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.56.0",
|
|
4
4
|
"description": "Headless, framework-neutral core of folio: the OOXML (.docx) parser, document model, ProseMirror integration, and page-layout engine. No React.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"document-model",
|
|
@@ -146,12 +146,12 @@
|
|
|
146
146
|
"perf": "bun scripts/profile-editor.ts"
|
|
147
147
|
},
|
|
148
148
|
"dependencies": {
|
|
149
|
-
"@stll/docx-core": "^0.
|
|
149
|
+
"@stll/docx-core": "^0.32.0",
|
|
150
150
|
"@stll/docx-utils": "^0.1.0",
|
|
151
151
|
"@stll/template-conditions": "^0.6.2",
|
|
152
152
|
"better-result": "3.0.1",
|
|
153
153
|
"csstype": "^3.1.3",
|
|
154
|
-
"dompurify": "^3.4.
|
|
154
|
+
"dompurify": "^3.4.16",
|
|
155
155
|
"fast-xml-parser": "^5.10.1",
|
|
156
156
|
"hyphen": "1.14.1",
|
|
157
157
|
"jszip": "3.10.2",
|
|
@@ -165,7 +165,7 @@
|
|
|
165
165
|
"prosemirror-state": "^1.4.4",
|
|
166
166
|
"prosemirror-tables": "^1.8.5",
|
|
167
167
|
"prosemirror-transform": "^1.12.0",
|
|
168
|
-
"prosemirror-view": "^1.
|
|
168
|
+
"prosemirror-view": "^1.42.6",
|
|
169
169
|
"utif2": "^4.1.0",
|
|
170
170
|
"valibot": "1.5.0",
|
|
171
171
|
"y-prosemirror": "^1.3.7",
|