@stll/folio-core 0.55.0 → 0.57.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 +214 -52
- package/dist/ai-edits/batch-claims.d.ts +3 -1
- package/dist/ai-edits/batch-claims.js +25 -1
- package/dist/ai-edits/headless.js +2 -2
- package/dist/ai-edits/table-row-column-mutations.js +17 -3
- package/dist/ai-edits/types.d.ts +7 -1
- package/dist/ai-suggestions/apply.js +20 -1
- package/dist/compare/compare.js +1 -0
- package/dist/compare/inline-atoms.js +40 -16
- package/dist/compare/inline-provenance.js +12 -5
- package/dist/compare/reproducible-package.d.ts +0 -17
- package/dist/compare/reproducible-package.js +12 -18
- package/dist/compat/eigenpal.d.ts +2 -1
- package/dist/compat/eigenpal.js +2 -1
- package/dist/controller/canonicalClipboard.d.ts +23 -0
- package/dist/controller/canonicalClipboard.js +482 -0
- package/dist/controller/canonicalClipboardResources.d.ts +21 -0
- package/dist/controller/canonicalClipboardResources.js +382 -0
- package/dist/controller/canonicalComments.d.ts +41 -0
- package/dist/controller/canonicalComments.js +152 -0
- package/dist/controller/canonicalComposition.d.ts +24 -3
- package/dist/controller/canonicalComposition.js +208 -48
- package/dist/controller/canonicalInlineProjection.d.ts +118 -0
- package/dist/controller/canonicalInlineProjection.js +476 -0
- package/dist/controller/canonicalInput.d.ts +13 -4
- package/dist/controller/canonicalInput.js +62 -14
- package/dist/controller/canonicalInputTimer.d.ts +16 -0
- package/dist/controller/canonicalInputTimer.js +34 -0
- package/dist/controller/canonicalPublicOperations.d.ts +48 -0
- package/dist/controller/canonicalPublicOperations.js +648 -0
- package/dist/controller/canonicalSelection.d.ts +18 -0
- package/dist/controller/canonicalSelection.js +32 -0
- package/dist/controller/canonicalSession.d.ts +27 -6
- package/dist/controller/canonicalSession.js +298 -116
- package/dist/controller/canonicalStoryEditor.d.ts +7 -3
- package/dist/controller/canonicalStoryEditor.js +27 -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 +18 -4
- package/dist/controller/headerFooterEditorManager.d.ts +2 -1
- package/dist/controller/headerFooterEditorManager.js +26 -11
- package/dist/controller/hiddenEditorApi.d.ts +24 -3
- package/dist/controller/hiddenEditorApi.js +8 -0
- package/dist/controller/hiddenEditorManager.d.ts +5 -1
- package/dist/controller/hiddenEditorManager.js +378 -43
- package/dist/controller/noteEditorManager.d.ts +2 -1
- package/dist/controller/noteEditorManager.js +29 -13
- 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/builtInStyles.js +13 -6
- 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/containerChildren.gen.d.ts +3 -1
- package/dist/docx/containerChildren.gen.js +33 -1
- 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/fieldParser.js +14 -2
- 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/hyperlinkParser.d.ts +1 -1
- package/dist/docx/hyperlinkParser.js +20 -1
- package/dist/docx/imageParser.d.ts +13 -1
- package/dist/docx/imageParser.js +20 -11
- 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/metadataPrivacy.js +6 -1
- package/dist/docx/packageParts.js +9 -3
- package/dist/docx/paragraphParser.js +88 -67
- package/dist/docx/paragraphPropertySource.d.ts +22 -1
- package/dist/docx/paragraphPropertySource.js +109 -2
- package/dist/docx/parser.js +2 -1
- package/dist/docx/preservedRunContent.js +2 -1
- package/dist/docx/relsParser.js +26 -2
- package/dist/docx/removeHeaderFooterParts.js +17 -6
- package/dist/docx/rezip.d.ts +49 -5
- package/dist/docx/rezip.js +754 -235
- package/dist/docx/saveDiagnostics.d.ts +11 -0
- package/dist/docx/selectiveSave.d.ts +2 -1
- package/dist/docx/selectiveSave.js +42 -11
- package/dist/docx/selectiveXmlPatch.js +7 -5
- package/dist/docx/serializer/commentSerializer.d.ts +4 -1
- package/dist/docx/serializer/commentSerializer.js +7 -3
- package/dist/docx/serializer/documentSerializer.d.ts +9 -2
- package/dist/docx/serializer/documentSerializer.js +29 -10
- package/dist/docx/serializer/paragraphSerializer.js +207 -94
- package/dist/docx/server/applyDocxXmlPatchProposal.js +14 -9
- package/dist/docx/server/materializeYjsDocx.js +14 -6
- package/dist/docx/server/migrateYjsAttrSchema.js +17 -5
- 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/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/acceptedBlockProjection.d.ts +12 -0
- package/dist/internal/acceptedBlockProjection.js +45 -0
- package/dist/internal/revisionResolutionInline.js +25 -3
- 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 +33 -24
- 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 +5 -0
- 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/comments.js +60 -35
- package/dist/prosemirror/commands/pageBreak.js +2 -2
- package/dist/prosemirror/commands/pastePlainText.js +2 -1
- 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.js +22 -3
- 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 +124 -22
- package/dist/prosemirror/extensions/core/ParagraphExtension.js +61 -35
- 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 +65 -29
- package/dist/prosemirror/extensions/marks/markUtils.js +11 -8
- package/dist/prosemirror/extensions/marks/noteReferenceDeletion.js +5 -2
- 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/insertOperations.js +2 -1
- 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/paragraphPropertyCarry.d.ts +7 -1
- package/dist/prosemirror/paragraphPropertyCarry.js +8 -3
- package/dist/prosemirror/plugins/documentStyles.d.ts +4 -1
- package/dist/prosemirror/plugins/documentStyles.js +17 -10
- package/dist/prosemirror/plugins/suggestionMode.js +48 -48
- 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 +3 -1
- package/dist/prosemirror/runStyleFormatting.js +3 -1
- package/dist/prosemirror/schema/marks.d.ts +1 -0
- package/dist/prosemirror/schema/nodes.d.ts +2 -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/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 +201 -0
- package/dist/types/canonicalCapabilities.js +198 -0
- package/dist/types/canonicalComments.d.ts +51 -0
- package/dist/types/canonicalComments.js +0 -0
- package/dist/types/canonicalSave.d.ts +11 -0
- package/dist/types/canonicalSave.js +0 -0
- package/dist/types/canonicalSections.d.ts +12 -0
- package/dist/types/canonicalSections.js +0 -0
- package/dist/types/docxSerialization.d.ts +14 -0
- package/dist/types/docxSerialization.js +7 -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 +4 -4
|
@@ -0,0 +1,201 @@
|
|
|
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 trackedHyperlinkResolution: "tracked-hyperlink-resolution";
|
|
7
|
+
readonly comments: "comment-model-edits";
|
|
8
|
+
readonly modelEdits: "direct-model-edits";
|
|
9
|
+
readonly sectionProperties: "section-properties";
|
|
10
|
+
readonly watermark: "watermark-model-edits";
|
|
11
|
+
readonly collaboration: "collaboration-session";
|
|
12
|
+
readonly dispatch: "unclassified-transactions";
|
|
13
|
+
readonly save: "pm-save-projection";
|
|
14
|
+
readonly resourceReplacement: "canonical-resource-replacement";
|
|
15
|
+
readonly history: "pm-history";
|
|
16
|
+
readonly suggestionPlugin: "pm-suggestion-plugin";
|
|
17
|
+
readonly paragraphTracker: "pm-paragraph-tracker";
|
|
18
|
+
readonly tableGeometry: "pm-table-geometry";
|
|
19
|
+
readonly paragraphIdentity: "pm-paragraph-identity";
|
|
20
|
+
readonly documentOperations: "pm-document-operations";
|
|
21
|
+
readonly aiSnapshots: "pm-ai-snapshots";
|
|
22
|
+
readonly publicComments: "publicOps.comments";
|
|
23
|
+
readonly publicSuggestedMode: "publicOps.suggestedMode";
|
|
24
|
+
readonly publicTableProjection: "publicOps.tableProjection";
|
|
25
|
+
readonly publicUnsupportedInline: "publicOps.unsupportedInline";
|
|
26
|
+
readonly publicPendingParagraphMarkProperties: "publicOps.pendingParagraphMarkProperties";
|
|
27
|
+
readonly publicHeadlessSession: "publicOps.headlessSession";
|
|
28
|
+
readonly publicSecondaryStories: "publicOps.secondaryStories";
|
|
29
|
+
};
|
|
30
|
+
type CanonicalGap = (typeof CANONICAL_GAP)[keyof typeof CANONICAL_GAP];
|
|
31
|
+
declare const CANONICAL_CAPABILITIES: {
|
|
32
|
+
readonly "authority-routing": {
|
|
33
|
+
readonly owner: "controller";
|
|
34
|
+
readonly kind: "routing";
|
|
35
|
+
readonly adapters: readonly ["react", "vue"];
|
|
36
|
+
readonly summary: "Explicit session selection and legacy authority routing.";
|
|
37
|
+
};
|
|
38
|
+
readonly "command-descriptors": {
|
|
39
|
+
readonly remainingCommands: {
|
|
40
|
+
readonly registry: "extension-commands";
|
|
41
|
+
};
|
|
42
|
+
readonly owner: "controller";
|
|
43
|
+
readonly kind: "refusal";
|
|
44
|
+
readonly adapters: readonly ["react", "vue"];
|
|
45
|
+
readonly summary: "Commands without canonical descriptors retain PM probing and hit the dispatch boundary.";
|
|
46
|
+
};
|
|
47
|
+
readonly "tracked-hyperlink-resolution": {
|
|
48
|
+
readonly owner: "controller";
|
|
49
|
+
readonly kind: "refusal";
|
|
50
|
+
readonly adapters: readonly ["react", "vue"];
|
|
51
|
+
readonly summary: "Hyperlink and TOC suggestions require serializable wrapper review provenance.";
|
|
52
|
+
};
|
|
53
|
+
readonly "comment-model-edits": {
|
|
54
|
+
readonly owner: "adapters";
|
|
55
|
+
readonly kind: "routing";
|
|
56
|
+
readonly adapters: readonly ["react", "vue"];
|
|
57
|
+
readonly summary: "Default sessions retain comment model edits; canonical comments use semantic operations.";
|
|
58
|
+
};
|
|
59
|
+
readonly "direct-model-edits": {
|
|
60
|
+
readonly owner: "adapters";
|
|
61
|
+
readonly kind: "refusal";
|
|
62
|
+
readonly adapters: readonly ["react", "vue"];
|
|
63
|
+
readonly summary: "Direct model and pending-suggestion snapshots bypass the canonical journal.";
|
|
64
|
+
};
|
|
65
|
+
readonly "section-properties": {
|
|
66
|
+
readonly owner: "controller";
|
|
67
|
+
readonly kind: "routing";
|
|
68
|
+
readonly adapters: readonly ["react", "vue"];
|
|
69
|
+
readonly summary: "The shared controller journals section properties; default sessions keep model changes.";
|
|
70
|
+
};
|
|
71
|
+
readonly "watermark-model-edits": {
|
|
72
|
+
readonly owner: "adapters";
|
|
73
|
+
readonly kind: "refusal";
|
|
74
|
+
readonly adapters: readonly ["vue"];
|
|
75
|
+
readonly summary: "Vue watermark mutations still change the model directly.";
|
|
76
|
+
};
|
|
77
|
+
readonly "collaboration-session": {
|
|
78
|
+
readonly owner: "controller";
|
|
79
|
+
readonly kind: "refusal";
|
|
80
|
+
readonly adapters: readonly ["react", "vue"];
|
|
81
|
+
readonly summary: "Collaboration cannot activate a canonical session.";
|
|
82
|
+
};
|
|
83
|
+
readonly "unclassified-transactions": {
|
|
84
|
+
readonly owner: "controller";
|
|
85
|
+
readonly kind: "refusal";
|
|
86
|
+
readonly adapters: readonly ["react", "vue"];
|
|
87
|
+
readonly summary: "Unclassified native and plugin mutations are refused at the projection boundary.";
|
|
88
|
+
};
|
|
89
|
+
readonly "pm-save-projection": {
|
|
90
|
+
readonly owner: "controller";
|
|
91
|
+
readonly kind: "routing";
|
|
92
|
+
readonly adapters: readonly ["react", "vue"];
|
|
93
|
+
readonly summary: "Legacy save and read paths reconstruct documents from PM.";
|
|
94
|
+
};
|
|
95
|
+
readonly "canonical-resource-replacement": {
|
|
96
|
+
readonly owner: "controller";
|
|
97
|
+
readonly kind: "refusal";
|
|
98
|
+
readonly adapters: readonly ["react", "vue"];
|
|
99
|
+
readonly summary: "Canonical save refuses existing style, style-default, and media replacements the package writers cannot express.";
|
|
100
|
+
};
|
|
101
|
+
readonly "pm-history": {
|
|
102
|
+
readonly owner: "prosemirror";
|
|
103
|
+
readonly kind: "mutation-source";
|
|
104
|
+
readonly adapters: readonly ["react", "vue"];
|
|
105
|
+
readonly summary: "PM history remains installed for legacy sessions.";
|
|
106
|
+
};
|
|
107
|
+
readonly "pm-suggestion-plugin": {
|
|
108
|
+
readonly owner: "prosemirror";
|
|
109
|
+
readonly kind: "mutation-source";
|
|
110
|
+
readonly adapters: readonly ["react", "vue"];
|
|
111
|
+
readonly summary: "The legacy suggestion plugin produces PM transactions.";
|
|
112
|
+
};
|
|
113
|
+
readonly "pm-paragraph-tracker": {
|
|
114
|
+
readonly owner: "prosemirror";
|
|
115
|
+
readonly kind: "mutation-source";
|
|
116
|
+
readonly adapters: readonly ["react", "vue"];
|
|
117
|
+
readonly summary: "Dirty tracking and section bookkeeping still observe PM transactions.";
|
|
118
|
+
};
|
|
119
|
+
readonly "pm-table-geometry": {
|
|
120
|
+
readonly owner: "prosemirror";
|
|
121
|
+
readonly kind: "mutation-source";
|
|
122
|
+
readonly adapters: readonly ["react", "vue"];
|
|
123
|
+
readonly summary: "Table geometry, resize and repair still produce PM transactions.";
|
|
124
|
+
};
|
|
125
|
+
readonly "pm-paragraph-identity": {
|
|
126
|
+
readonly owner: "prosemirror";
|
|
127
|
+
readonly kind: "mutation-source";
|
|
128
|
+
readonly adapters: readonly ["react", "vue"];
|
|
129
|
+
readonly summary: "Legacy paragraph identity repair remains a PM append transaction.";
|
|
130
|
+
};
|
|
131
|
+
readonly "pm-document-operations": {
|
|
132
|
+
readonly owner: "document-operations";
|
|
133
|
+
readonly defaultSessionMutation: "pm-public-operations";
|
|
134
|
+
readonly kind: "mutation-source";
|
|
135
|
+
readonly adapters: readonly ["react", "vue"];
|
|
136
|
+
readonly summary: "Public document operations still execute against a held PM view.";
|
|
137
|
+
};
|
|
138
|
+
readonly "publicOps.comments": {
|
|
139
|
+
readonly owner: "document-operations";
|
|
140
|
+
readonly defaultSessionMutation: "pm-public-operations";
|
|
141
|
+
readonly kind: "routing";
|
|
142
|
+
readonly adapters: readonly ["react", "vue"];
|
|
143
|
+
readonly summary: "Canonical public comments compile to semantic operations; default sessions retain PM comments.";
|
|
144
|
+
};
|
|
145
|
+
readonly "publicOps.suggestedMode": {
|
|
146
|
+
readonly owner: "document-operations";
|
|
147
|
+
readonly defaultSessionMutation: "pm-public-operations";
|
|
148
|
+
readonly kind: "refusal";
|
|
149
|
+
readonly adapters: readonly ["react", "vue"];
|
|
150
|
+
readonly summary: "Public suggested mode refuses in canonical sessions until pending suggestions use the journal.";
|
|
151
|
+
};
|
|
152
|
+
readonly "publicOps.tableProjection": {
|
|
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 table operations refuse while canonical projections require paragraph stories.";
|
|
158
|
+
};
|
|
159
|
+
readonly "publicOps.unsupportedInline": {
|
|
160
|
+
readonly owner: "document-operations";
|
|
161
|
+
readonly defaultSessionMutation: "pm-public-operations";
|
|
162
|
+
readonly kind: "refusal";
|
|
163
|
+
readonly adapters: readonly ["react", "vue"];
|
|
164
|
+
readonly summary: "Unsupported public payloads refuse with a typed compiler capability gap.";
|
|
165
|
+
};
|
|
166
|
+
readonly "publicOps.pendingParagraphMarkProperties": {
|
|
167
|
+
readonly owner: "document-operations";
|
|
168
|
+
readonly defaultSessionMutation: "pm-public-operations";
|
|
169
|
+
readonly kind: "refusal";
|
|
170
|
+
readonly adapters: readonly ["react", "vue"];
|
|
171
|
+
readonly summary: "Separate paragraph property edits refuse while the paragraph mark is pending deletion; atomic merge properties remain supported.";
|
|
172
|
+
};
|
|
173
|
+
readonly "publicOps.secondaryStories": {
|
|
174
|
+
readonly owner: "document-operations";
|
|
175
|
+
readonly defaultSessionMutation: "pm-public-operations";
|
|
176
|
+
readonly kind: "refusal";
|
|
177
|
+
readonly adapters: readonly ["react", "vue"];
|
|
178
|
+
readonly summary: "Public secondary-story batches refuse until canonical story routing is available.";
|
|
179
|
+
};
|
|
180
|
+
readonly "publicOps.headlessSession": {
|
|
181
|
+
readonly owner: "document-operations";
|
|
182
|
+
readonly defaultSessionMutation: "pm-headless-reviewer";
|
|
183
|
+
readonly kind: "mutation-source";
|
|
184
|
+
readonly adapters: readonly ["react", "vue"];
|
|
185
|
+
readonly summary: "The headless reviewer has no canonical session selector while its mutations remain PM-owned.";
|
|
186
|
+
};
|
|
187
|
+
readonly "pm-ai-snapshots": {
|
|
188
|
+
readonly owner: "ai-edits";
|
|
189
|
+
readonly kind: "mutation-source";
|
|
190
|
+
readonly adapters: readonly ["react", "vue"];
|
|
191
|
+
readonly summary: "Headless AI edits still use PM execution and snapshot undo.";
|
|
192
|
+
};
|
|
193
|
+
};
|
|
194
|
+
/**
|
|
195
|
+
* The gap argument is a typed tag counted by the source guard, not a runtime policy.
|
|
196
|
+
* Retire a gap by removing its sites and ledger entry.
|
|
197
|
+
*/
|
|
198
|
+
declare const usesCanonicalSession: (session: "canonical" | undefined, _gap: CanonicalGap) => boolean;
|
|
199
|
+
declare const canonicalRefusalMessage: (gap: CanonicalGap, message: string) => string;
|
|
200
|
+
//#endregion
|
|
201
|
+
export { CANONICAL_CAPABILITIES, CANONICAL_GAP, CanonicalGap, canonicalRefusalMessage, usesCanonicalSession };
|
|
@@ -0,0 +1,198 @@
|
|
|
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
|
+
trackedHyperlinkResolution: "tracked-hyperlink-resolution",
|
|
7
|
+
comments: "comment-model-edits",
|
|
8
|
+
modelEdits: "direct-model-edits",
|
|
9
|
+
sectionProperties: "section-properties",
|
|
10
|
+
watermark: "watermark-model-edits",
|
|
11
|
+
collaboration: "collaboration-session",
|
|
12
|
+
dispatch: "unclassified-transactions",
|
|
13
|
+
save: "pm-save-projection",
|
|
14
|
+
resourceReplacement: "canonical-resource-replacement",
|
|
15
|
+
history: "pm-history",
|
|
16
|
+
suggestionPlugin: "pm-suggestion-plugin",
|
|
17
|
+
paragraphTracker: "pm-paragraph-tracker",
|
|
18
|
+
tableGeometry: "pm-table-geometry",
|
|
19
|
+
paragraphIdentity: "pm-paragraph-identity",
|
|
20
|
+
documentOperations: "pm-document-operations",
|
|
21
|
+
aiSnapshots: "pm-ai-snapshots",
|
|
22
|
+
publicComments: "publicOps.comments",
|
|
23
|
+
publicSuggestedMode: "publicOps.suggestedMode",
|
|
24
|
+
publicTableProjection: "publicOps.tableProjection",
|
|
25
|
+
publicUnsupportedInline: "publicOps.unsupportedInline",
|
|
26
|
+
publicPendingParagraphMarkProperties: "publicOps.pendingParagraphMarkProperties",
|
|
27
|
+
publicHeadlessSession: "publicOps.headlessSession",
|
|
28
|
+
publicSecondaryStories: "publicOps.secondaryStories"
|
|
29
|
+
};
|
|
30
|
+
const CANONICAL_CAPABILITIES = {
|
|
31
|
+
[CANONICAL_GAP.authorityRouting]: {
|
|
32
|
+
owner: "controller",
|
|
33
|
+
kind: "routing",
|
|
34
|
+
adapters: ["react", "vue"],
|
|
35
|
+
summary: "Explicit session selection and legacy authority routing."
|
|
36
|
+
},
|
|
37
|
+
[CANONICAL_GAP.commands]: {
|
|
38
|
+
remainingCommands: { registry: "extension-commands" },
|
|
39
|
+
owner: "controller",
|
|
40
|
+
kind: "refusal",
|
|
41
|
+
adapters: ["react", "vue"],
|
|
42
|
+
summary: "Commands without canonical descriptors retain PM probing and hit the dispatch boundary."
|
|
43
|
+
},
|
|
44
|
+
[CANONICAL_GAP.trackedHyperlinkResolution]: {
|
|
45
|
+
owner: "controller",
|
|
46
|
+
kind: "refusal",
|
|
47
|
+
adapters: ["react", "vue"],
|
|
48
|
+
summary: "Hyperlink and TOC suggestions require serializable wrapper review provenance."
|
|
49
|
+
},
|
|
50
|
+
[CANONICAL_GAP.comments]: {
|
|
51
|
+
owner: "adapters",
|
|
52
|
+
kind: "routing",
|
|
53
|
+
adapters: ["react", "vue"],
|
|
54
|
+
summary: "Default sessions retain comment model edits; canonical comments use semantic operations."
|
|
55
|
+
},
|
|
56
|
+
[CANONICAL_GAP.modelEdits]: {
|
|
57
|
+
owner: "adapters",
|
|
58
|
+
kind: "refusal",
|
|
59
|
+
adapters: ["react", "vue"],
|
|
60
|
+
summary: "Direct model and pending-suggestion snapshots bypass the canonical journal."
|
|
61
|
+
},
|
|
62
|
+
[CANONICAL_GAP.sectionProperties]: {
|
|
63
|
+
owner: "controller",
|
|
64
|
+
kind: "routing",
|
|
65
|
+
adapters: ["react", "vue"],
|
|
66
|
+
summary: "The shared controller journals section properties; default sessions keep model changes."
|
|
67
|
+
},
|
|
68
|
+
[CANONICAL_GAP.watermark]: {
|
|
69
|
+
owner: "adapters",
|
|
70
|
+
kind: "refusal",
|
|
71
|
+
adapters: ["vue"],
|
|
72
|
+
summary: "Vue watermark mutations still change the model directly."
|
|
73
|
+
},
|
|
74
|
+
[CANONICAL_GAP.collaboration]: {
|
|
75
|
+
owner: "controller",
|
|
76
|
+
kind: "refusal",
|
|
77
|
+
adapters: ["react", "vue"],
|
|
78
|
+
summary: "Collaboration cannot activate a canonical session."
|
|
79
|
+
},
|
|
80
|
+
[CANONICAL_GAP.dispatch]: {
|
|
81
|
+
owner: "controller",
|
|
82
|
+
kind: "refusal",
|
|
83
|
+
adapters: ["react", "vue"],
|
|
84
|
+
summary: "Unclassified native and plugin mutations are refused at the projection boundary."
|
|
85
|
+
},
|
|
86
|
+
[CANONICAL_GAP.save]: {
|
|
87
|
+
owner: "controller",
|
|
88
|
+
kind: "routing",
|
|
89
|
+
adapters: ["react", "vue"],
|
|
90
|
+
summary: "Legacy save and read paths reconstruct documents from PM."
|
|
91
|
+
},
|
|
92
|
+
[CANONICAL_GAP.resourceReplacement]: {
|
|
93
|
+
owner: "controller",
|
|
94
|
+
kind: "refusal",
|
|
95
|
+
adapters: ["react", "vue"],
|
|
96
|
+
summary: "Canonical save refuses existing style, style-default, and media replacements the package writers cannot express."
|
|
97
|
+
},
|
|
98
|
+
[CANONICAL_GAP.history]: {
|
|
99
|
+
owner: "prosemirror",
|
|
100
|
+
kind: "mutation-source",
|
|
101
|
+
adapters: ["react", "vue"],
|
|
102
|
+
summary: "PM history remains installed for legacy sessions."
|
|
103
|
+
},
|
|
104
|
+
[CANONICAL_GAP.suggestionPlugin]: {
|
|
105
|
+
owner: "prosemirror",
|
|
106
|
+
kind: "mutation-source",
|
|
107
|
+
adapters: ["react", "vue"],
|
|
108
|
+
summary: "The legacy suggestion plugin produces PM transactions."
|
|
109
|
+
},
|
|
110
|
+
[CANONICAL_GAP.paragraphTracker]: {
|
|
111
|
+
owner: "prosemirror",
|
|
112
|
+
kind: "mutation-source",
|
|
113
|
+
adapters: ["react", "vue"],
|
|
114
|
+
summary: "Dirty tracking and section bookkeeping still observe PM transactions."
|
|
115
|
+
},
|
|
116
|
+
[CANONICAL_GAP.tableGeometry]: {
|
|
117
|
+
owner: "prosemirror",
|
|
118
|
+
kind: "mutation-source",
|
|
119
|
+
adapters: ["react", "vue"],
|
|
120
|
+
summary: "Table geometry, resize and repair still produce PM transactions."
|
|
121
|
+
},
|
|
122
|
+
[CANONICAL_GAP.paragraphIdentity]: {
|
|
123
|
+
owner: "prosemirror",
|
|
124
|
+
kind: "mutation-source",
|
|
125
|
+
adapters: ["react", "vue"],
|
|
126
|
+
summary: "Legacy paragraph identity repair remains a PM append transaction."
|
|
127
|
+
},
|
|
128
|
+
[CANONICAL_GAP.documentOperations]: {
|
|
129
|
+
owner: "document-operations",
|
|
130
|
+
defaultSessionMutation: "pm-public-operations",
|
|
131
|
+
kind: "mutation-source",
|
|
132
|
+
adapters: ["react", "vue"],
|
|
133
|
+
summary: "Public document operations still execute against a held PM view."
|
|
134
|
+
},
|
|
135
|
+
[CANONICAL_GAP.publicComments]: {
|
|
136
|
+
owner: "document-operations",
|
|
137
|
+
defaultSessionMutation: "pm-public-operations",
|
|
138
|
+
kind: "routing",
|
|
139
|
+
adapters: ["react", "vue"],
|
|
140
|
+
summary: "Canonical public comments compile to semantic operations; default sessions retain PM comments."
|
|
141
|
+
},
|
|
142
|
+
[CANONICAL_GAP.publicSuggestedMode]: {
|
|
143
|
+
owner: "document-operations",
|
|
144
|
+
defaultSessionMutation: "pm-public-operations",
|
|
145
|
+
kind: "refusal",
|
|
146
|
+
adapters: ["react", "vue"],
|
|
147
|
+
summary: "Public suggested mode refuses in canonical sessions until pending suggestions use the journal."
|
|
148
|
+
},
|
|
149
|
+
[CANONICAL_GAP.publicTableProjection]: {
|
|
150
|
+
owner: "document-operations",
|
|
151
|
+
defaultSessionMutation: "pm-public-operations",
|
|
152
|
+
kind: "refusal",
|
|
153
|
+
adapters: ["react", "vue"],
|
|
154
|
+
summary: "Public table operations refuse while canonical projections require paragraph stories."
|
|
155
|
+
},
|
|
156
|
+
[CANONICAL_GAP.publicUnsupportedInline]: {
|
|
157
|
+
owner: "document-operations",
|
|
158
|
+
defaultSessionMutation: "pm-public-operations",
|
|
159
|
+
kind: "refusal",
|
|
160
|
+
adapters: ["react", "vue"],
|
|
161
|
+
summary: "Unsupported public payloads refuse with a typed compiler capability gap."
|
|
162
|
+
},
|
|
163
|
+
[CANONICAL_GAP.publicPendingParagraphMarkProperties]: {
|
|
164
|
+
owner: "document-operations",
|
|
165
|
+
defaultSessionMutation: "pm-public-operations",
|
|
166
|
+
kind: "refusal",
|
|
167
|
+
adapters: ["react", "vue"],
|
|
168
|
+
summary: "Separate paragraph property edits refuse while the paragraph mark is pending deletion; atomic merge properties remain supported."
|
|
169
|
+
},
|
|
170
|
+
[CANONICAL_GAP.publicSecondaryStories]: {
|
|
171
|
+
owner: "document-operations",
|
|
172
|
+
defaultSessionMutation: "pm-public-operations",
|
|
173
|
+
kind: "refusal",
|
|
174
|
+
adapters: ["react", "vue"],
|
|
175
|
+
summary: "Public secondary-story batches refuse until canonical story routing is available."
|
|
176
|
+
},
|
|
177
|
+
[CANONICAL_GAP.publicHeadlessSession]: {
|
|
178
|
+
owner: "document-operations",
|
|
179
|
+
defaultSessionMutation: "pm-headless-reviewer",
|
|
180
|
+
kind: "mutation-source",
|
|
181
|
+
adapters: ["react", "vue"],
|
|
182
|
+
summary: "The headless reviewer has no canonical session selector while its mutations remain PM-owned."
|
|
183
|
+
},
|
|
184
|
+
[CANONICAL_GAP.aiSnapshots]: {
|
|
185
|
+
owner: "ai-edits",
|
|
186
|
+
kind: "mutation-source",
|
|
187
|
+
adapters: ["react", "vue"],
|
|
188
|
+
summary: "Headless AI edits still use PM execution and snapshot undo."
|
|
189
|
+
}
|
|
190
|
+
};
|
|
191
|
+
/**
|
|
192
|
+
* The gap argument is a typed tag counted by the source guard, not a runtime policy.
|
|
193
|
+
* Retire a gap by removing its sites and ledger entry.
|
|
194
|
+
*/
|
|
195
|
+
const usesCanonicalSession = (session, _gap) => session === "canonical";
|
|
196
|
+
const canonicalRefusalMessage = (gap, message) => `[${gap}] ${message}`;
|
|
197
|
+
//#endregion
|
|
198
|
+
export { CANONICAL_CAPABILITIES, CANONICAL_GAP, canonicalRefusalMessage, usesCanonicalSession };
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { CanonicalGap } from "./canonicalCapabilities.js";
|
|
2
|
+
import { Comment } from "./content.js";
|
|
3
|
+
import { OpStory } from "@stll/docx-core/ops";
|
|
4
|
+
//#region src/types/canonicalComments.d.ts
|
|
5
|
+
/** Requests name their anchor; comment metadata never creates an unanchored root. */
|
|
6
|
+
type CanonicalCommentRequest = {
|
|
7
|
+
type: "create";
|
|
8
|
+
text: string;
|
|
9
|
+
author: string;
|
|
10
|
+
date?: string;
|
|
11
|
+
anchor: {
|
|
12
|
+
kind: "selection";
|
|
13
|
+
from: number;
|
|
14
|
+
to: number;
|
|
15
|
+
story: OpStory;
|
|
16
|
+
} | {
|
|
17
|
+
kind: "reply";
|
|
18
|
+
parentId: number;
|
|
19
|
+
} | {
|
|
20
|
+
kind: "revision";
|
|
21
|
+
story: OpStory;
|
|
22
|
+
revisionId: number;
|
|
23
|
+
};
|
|
24
|
+
} | {
|
|
25
|
+
type: "update";
|
|
26
|
+
id: number;
|
|
27
|
+
content: Comment["content"];
|
|
28
|
+
} | {
|
|
29
|
+
type: "resolve";
|
|
30
|
+
id: number;
|
|
31
|
+
status: "open" | "resolved";
|
|
32
|
+
} | {
|
|
33
|
+
type: "delete";
|
|
34
|
+
id: number;
|
|
35
|
+
} | {
|
|
36
|
+
type: "replace";
|
|
37
|
+
comments: readonly Comment[];
|
|
38
|
+
};
|
|
39
|
+
type CanonicalCommentResult = {
|
|
40
|
+
status: "applied";
|
|
41
|
+
comments: Comment[];
|
|
42
|
+
commentId?: number;
|
|
43
|
+
} | {
|
|
44
|
+
status: "refused";
|
|
45
|
+
gap: CanonicalGap;
|
|
46
|
+
message: string;
|
|
47
|
+
/** Whether the same request can succeed once a pending composition settles. */
|
|
48
|
+
retry: "afterComposition" | "never";
|
|
49
|
+
};
|
|
50
|
+
//#endregion
|
|
51
|
+
export { CanonicalCommentRequest, CanonicalCommentResult };
|
|
File without changes
|
|
@@ -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,12 @@
|
|
|
1
|
+
import { CANONICAL_GAP } from "./canonicalCapabilities.js";
|
|
2
|
+
//#region src/types/canonicalSections.d.ts
|
|
3
|
+
type CanonicalSectionPropertiesResult = {
|
|
4
|
+
status: "applied";
|
|
5
|
+
version: number;
|
|
6
|
+
} | {
|
|
7
|
+
status: "refused";
|
|
8
|
+
gap: typeof CANONICAL_GAP.sectionProperties;
|
|
9
|
+
message: string;
|
|
10
|
+
};
|
|
11
|
+
//#endregion
|
|
12
|
+
export { CanonicalSectionPropertiesResult };
|
|
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 };
|
|
@@ -1,6 +1,50 @@
|
|
|
1
1
|
import { resolveHeadingLevel } from "../docx/builtInStyles.js";
|
|
2
2
|
import { readOutlineLevelAttr } from "../prosemirror/outlineLevelAttr.js";
|
|
3
3
|
//#region src/utils/headingCollector.ts
|
|
4
|
+
const RUN_IN_TITLE_MARKS = /* @__PURE__ */ new Set([
|
|
5
|
+
"bold",
|
|
6
|
+
"italic",
|
|
7
|
+
"underline"
|
|
8
|
+
]);
|
|
9
|
+
const runInTitleFormat = (child) => {
|
|
10
|
+
const marks = child.marks.map(({ type }) => type.name).filter((name) => RUN_IN_TITLE_MARKS.has(name)).sort();
|
|
11
|
+
return marks.length > 0 ? marks.join("+") : void 0;
|
|
12
|
+
};
|
|
13
|
+
const headingText = (paragraph) => {
|
|
14
|
+
let text = "";
|
|
15
|
+
let capture = { status: "searching" };
|
|
16
|
+
for (let childIndex = 0; childIndex < paragraph.childCount; childIndex += 1) {
|
|
17
|
+
const child = paragraph.child(childIndex);
|
|
18
|
+
if (!child.isText) {
|
|
19
|
+
if (capture.status === "collecting") capture = {
|
|
20
|
+
status: "complete",
|
|
21
|
+
text: capture.text
|
|
22
|
+
};
|
|
23
|
+
continue;
|
|
24
|
+
}
|
|
25
|
+
const childText = child.text || "";
|
|
26
|
+
text += childText;
|
|
27
|
+
const format = runInTitleFormat(child);
|
|
28
|
+
if (capture.status === "searching" && format !== void 0) {
|
|
29
|
+
capture = {
|
|
30
|
+
status: "collecting",
|
|
31
|
+
format,
|
|
32
|
+
text: childText
|
|
33
|
+
};
|
|
34
|
+
continue;
|
|
35
|
+
}
|
|
36
|
+
if (capture.status !== "collecting") continue;
|
|
37
|
+
capture = format === capture.format ? {
|
|
38
|
+
status: "collecting",
|
|
39
|
+
format: capture.format,
|
|
40
|
+
text: capture.text + childText
|
|
41
|
+
} : {
|
|
42
|
+
status: "complete",
|
|
43
|
+
text: capture.text
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
return ((capture.status === "searching" ? "" : capture.text.trim()) || text).trim();
|
|
47
|
+
};
|
|
4
48
|
/**
|
|
5
49
|
* Collect all headings from a ProseMirror document, in document order.
|
|
6
50
|
*
|
|
@@ -19,10 +63,7 @@ function collectHeadings(doc, styles) {
|
|
|
19
63
|
styleId: typeof node.attrs["styleId"] === "string" ? node.attrs["styleId"] : null
|
|
20
64
|
}, styles);
|
|
21
65
|
if (level === void 0) return;
|
|
22
|
-
|
|
23
|
-
node.forEach((child) => {
|
|
24
|
-
if (child.isText) text += child.text || "";
|
|
25
|
-
});
|
|
66
|
+
const text = headingText(node);
|
|
26
67
|
if (text.trim()) headings.push({
|
|
27
68
|
text: text.trim(),
|
|
28
69
|
level,
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { HeadingInfo } from "./headingCollector.js";
|
|
2
|
+
//#region src/utils/outlineDepth.d.ts
|
|
3
|
+
/** Maximum heading depth displayed in the document outline. */
|
|
4
|
+
type OutlineDepth = 2 | 3 | "all";
|
|
5
|
+
declare const DEFAULT_OUTLINE_DEPTH = 2;
|
|
6
|
+
/** Filter headings for the outline without changing their document order. */
|
|
7
|
+
declare const filterHeadingsByDepth: (headings: readonly HeadingInfo[], depth: OutlineDepth) => HeadingInfo[];
|
|
8
|
+
//#endregion
|
|
9
|
+
export { DEFAULT_OUTLINE_DEPTH, OutlineDepth, filterHeadingsByDepth };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
//#region src/utils/outlineDepth.ts
|
|
2
|
+
const DEFAULT_OUTLINE_DEPTH = 2;
|
|
3
|
+
/** Filter headings for the outline without changing their document order. */
|
|
4
|
+
const filterHeadingsByDepth = (headings, depth) => {
|
|
5
|
+
if (depth === "all") return [...headings];
|
|
6
|
+
return headings.filter((heading) => heading.level < depth);
|
|
7
|
+
};
|
|
8
|
+
//#endregion
|
|
9
|
+
export { DEFAULT_OUTLINE_DEPTH, filterHeadingsByDepth };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stll/folio-core",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.57.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.33.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",
|