@stll/folio-core 0.8.0 → 0.10.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/README.md +39 -0
- package/dist/ai-edits/apply.js +18 -4
- package/dist/ai-edits/headless.d.ts +73 -6
- package/dist/ai-edits/headless.js +299 -60
- package/dist/ai-edits/index.d.ts +3 -3
- package/dist/ai-edits/index.js +2 -1
- package/dist/ai-edits/snapshot.js +40 -3
- package/dist/ai-edits/types.d.ts +2 -1
- package/dist/compat/eigenpal.d.ts +6 -4
- package/dist/compat/eigenpal.js +5 -3
- package/dist/controller/latestRequestGate.d.ts +13 -0
- package/dist/controller/latestRequestGate.js +16 -0
- package/dist/controller/layoutPipeline.js +13 -1
- package/dist/document-operations.d.ts +20 -4
- package/dist/document-operations.js +36 -15
- package/dist/document-stories.d.ts +10 -0
- package/dist/document-stories.js +27 -0
- package/dist/docx/blockContentParser.js +2 -2
- package/dist/docx/commentParser.js +1 -1
- package/dist/docx/compatibility.d.ts +3 -7
- package/dist/docx/compatibility.js +0 -11
- package/dist/docx/corePropertiesParser.d.ts +8 -0
- package/dist/docx/corePropertiesParser.js +53 -0
- package/dist/docx/encryption/agileDecryption.js +1 -1
- package/dist/docx/encryption/encryptionInfo.js +1 -1
- package/dist/docx/encryption/openEncryptedDocx.js +1 -1
- package/dist/docx/fontTableParser.d.ts +6 -0
- package/dist/docx/fontTableParser.js +72 -0
- package/dist/docx/groupDrawingParser.js +7 -2
- package/dist/docx/headerFooterParser.js +1 -1
- package/dist/docx/index.d.ts +2 -1
- package/dist/docx/index.js +2 -1
- package/dist/docx/metadataPrivacy.d.ts +40 -0
- package/dist/docx/metadataPrivacy.js +131 -0
- package/dist/docx/normalizeBaseDirection.js +1 -1
- package/dist/docx/numberingParser.js +1 -0
- package/dist/docx/paragraphParser.js +12 -1
- package/dist/docx/parser.d.ts +1 -1
- package/dist/docx/parser.js +16 -10
- package/dist/docx/rezip.d.ts +5 -4
- package/dist/docx/rezip.js +76 -13
- package/dist/docx/runConsolidator.js +4 -0
- package/dist/docx/runParser.js +19 -1
- package/dist/docx/selectiveSave.js +3 -3
- package/dist/docx/serializer/fontTableSerializer.d.ts +6 -0
- package/dist/docx/serializer/fontTableSerializer.js +26 -0
- package/dist/docx/serializer/headerFooterSerializer.js +1 -1
- package/dist/docx/serializer/paragraphSerializer.js +4 -0
- package/dist/docx/serializer/runSerializer.js +7 -0
- package/dist/docx/serializer/settingsSerializer.d.ts +6 -0
- package/dist/docx/serializer/settingsSerializer.js +16 -0
- package/dist/docx/serializer/stylesSerializer.d.ts +6 -0
- package/dist/docx/serializer/stylesSerializer.js +56 -0
- package/dist/docx/serializer/tableSerializer.js +25 -26
- package/dist/docx/serializer/themeSerializer.d.ts +6 -0
- package/dist/docx/serializer/themeSerializer.js +36 -0
- package/dist/docx/settingsParser.js +46 -0
- package/dist/docx/styleParser.js +26 -1
- package/dist/docx/tableParser.js +11 -1
- package/dist/docx/vmlImageParser.js +1 -0
- package/dist/i18n/messages/catalogs.gen.d.ts +5916 -5916
- package/dist/i18n/messages/catalogs.gen.js +5910 -5910
- package/dist/index.d.ts +6 -4
- package/dist/index.js +5 -3
- package/dist/layout-bridge/convert/footnoteLayout.d.ts +3 -0
- package/dist/layout-bridge/convert/footnoteLayout.js +3 -1
- package/dist/layout-bridge/convert/headerFooterLayout.d.ts +3 -0
- package/dist/layout-bridge/convert/headerFooterLayout.js +6 -1
- package/dist/layout-bridge/convert/toFlowBlocks.d.ts +14 -2
- package/dist/layout-bridge/convert/toFlowBlocks.js +52 -14
- package/dist/layout-bridge/engine/measuring/index.d.ts +2 -1
- package/dist/layout-bridge/engine/measuring/index.js +2 -1
- package/dist/layout-engine/index.js +36 -28
- package/dist/layout-engine/measure/cache.js +6 -3
- package/dist/layout-engine/measure/effectiveLineBreakPolicy.d.ts +29 -0
- package/dist/layout-engine/measure/effectiveLineBreakPolicy.js +60 -0
- package/dist/layout-engine/measure/font-metrics.worker.js +1 -0
- package/dist/layout-engine/measure/index.d.ts +2 -1
- package/dist/layout-engine/measure/index.js +2 -1
- package/dist/layout-engine/measure/lineBreakProvider.d.ts +33 -0
- package/dist/layout-engine/measure/lineBreakProvider.js +252 -0
- package/dist/layout-engine/measure/lineBreaks.d.ts +7 -2
- package/dist/layout-engine/measure/lineBreaks.js +11 -18
- package/dist/layout-engine/measure/listMarkerWidth.d.ts +1 -0
- package/dist/layout-engine/measure/listMarkerWidth.js +12 -6
- package/dist/layout-engine/measure/measureBlocks.d.ts +1 -2
- package/dist/layout-engine/measure/measureBlocks.js +6 -36
- package/dist/layout-engine/measure/measureContainer.js +32 -9
- package/dist/layout-engine/measure/measureHelpers.js +5 -2
- package/dist/layout-engine/measure/measureParagraph.js +332 -73
- package/dist/layout-engine/measure/measureTypes.d.ts +2 -1
- package/dist/layout-engine/measure/measureWorker.d.ts +2 -2
- package/dist/layout-engine/measure/measureWorker.js +8 -19
- package/dist/layout-engine/measure/measureWorkerProtocol.d.ts +3 -14
- package/dist/layout-engine/measure/tableCellFloating.d.ts +10 -3
- package/dist/layout-engine/measure/tableCellFloating.js +51 -37
- package/dist/layout-engine/measure/tableCellFlow.d.ts +27 -0
- package/dist/layout-engine/measure/tableCellFlow.js +73 -0
- package/dist/layout-engine/measure/tableCellGrid.js +1 -1
- package/dist/layout-engine/measure/textMeasurementPolicy.d.ts +18 -0
- package/dist/layout-engine/measure/textMeasurementPolicy.js +24 -0
- package/dist/layout-engine/renderedBreakReconciliation.d.ts +6 -1
- package/dist/layout-engine/renderedBreakReconciliation.js +34 -11
- package/dist/layout-engine/tableRowBreak.d.ts +5 -2
- package/dist/layout-engine/tableRowBreak.js +62 -29
- package/dist/layout-engine/types.d.ts +43 -8
- package/dist/layout-painter/anchoredImagePosition.d.ts +23 -0
- package/dist/layout-painter/anchoredImagePosition.js +95 -0
- package/dist/layout-painter/borderStroke.d.ts +23 -0
- package/dist/layout-painter/borderStroke.js +39 -0
- package/dist/layout-painter/renderImage.d.ts +5 -4
- package/dist/layout-painter/renderImage.js +18 -4
- package/dist/layout-painter/renderPage.d.ts +2 -27
- package/dist/layout-painter/renderPage.js +13 -99
- package/dist/layout-painter/renderParagraph.js +41 -23
- package/dist/layout-painter/renderTable.d.ts +2 -0
- package/dist/layout-painter/renderTable.js +223 -43
- package/dist/managers/DocumentLoaderManager.d.ts +1 -1
- package/dist/managers/DocumentLoaderManager.js +2 -2
- package/dist/prosemirror/attrs/index.d.ts +4 -2
- package/dist/prosemirror/attrs/index.js +22 -2
- package/dist/prosemirror/commands/propertyChangeScope.js +1 -1
- package/dist/prosemirror/conversion/effectiveTableCellFormatting.d.ts +62 -0
- package/dist/prosemirror/conversion/effectiveTableCellFormatting.js +131 -0
- package/dist/prosemirror/conversion/fromProseDoc.js +34 -18
- package/dist/prosemirror/conversion/toProseDoc.js +81 -77
- package/dist/prosemirror/extensions/StarterKit.js +2 -0
- package/dist/prosemirror/extensions/core/ParagraphExtension.js +7 -2
- package/dist/prosemirror/extensions/features/AutoBidiDetectionExtension.js +1 -1
- package/dist/prosemirror/extensions/features/ListExtension.js +1 -0
- package/dist/prosemirror/extensions/marks/FootnoteRefExtension.js +1 -0
- package/dist/prosemirror/extensions/marks/HighlightExtension.js +1 -1
- package/dist/prosemirror/extensions/marks/LanguageExtension.d.ts +7 -0
- package/dist/prosemirror/extensions/marks/LanguageExtension.js +30 -0
- package/dist/prosemirror/extensions/marks/RunShadingExtension.js +1 -1
- package/dist/prosemirror/extensions/marks/TextColorExtension.js +1 -1
- package/dist/prosemirror/extensions/marks/TrackedChangeExtensions.js +1 -1
- package/dist/prosemirror/extensions/marks/markUtils.js +12 -0
- package/dist/prosemirror/extensions/nodes/ImageExtension.js +3 -1
- package/dist/prosemirror/extensions/nodes/TableExtension.js +4 -2
- package/dist/prosemirror/schema/index.d.ts +2 -2
- package/dist/prosemirror/schema/marks.d.ts +6 -1
- package/dist/prosemirror/schema/nodes.d.ts +15 -12
- package/dist/prosemirror/styles/resolvedStyleAttrs.js +1 -0
- package/dist/prosemirror/utils/tabCalculator.d.ts +3 -1
- package/dist/prosemirror/utils/tabCalculator.js +12 -10
- package/dist/prosemirror/validation.js +4 -1
- package/dist/redline.d.ts +26 -11
- package/dist/redline.js +107 -64
- package/dist/server.d.ts +9 -5
- package/dist/server.js +8 -4
- package/dist/style-sets/extract.d.ts +35 -0
- package/dist/style-sets/extract.js +123 -0
- package/dist/style-sets/stellaStyle.d.ts +13 -0
- package/dist/style-sets/stellaStyle.js +516 -0
- package/dist/style-sets/types.d.ts +31 -0
- package/dist/style-sets/types.js +5 -0
- package/dist/utils/createDocument.d.ts +12 -2
- package/dist/utils/createDocument.js +42 -31
- package/dist/utils/fontResolver.js +6 -6
- package/dist/utils/formatToStyle.js +1 -1
- package/dist/utils/paragraphFormattingMerge.d.ts +14 -3
- package/dist/utils/paragraphFormattingMerge.js +14 -4
- package/dist/version-comparison.d.ts +65 -11
- package/dist/version-comparison.js +187 -29
- package/package.json +5 -1
- package/dist/docx/capabilities.d.ts +0 -41
- package/dist/docx/capabilities.js +0 -322
|
@@ -1,322 +0,0 @@
|
|
|
1
|
-
import { TaggedError } from "better-result";
|
|
2
|
-
//#region src/docx/capabilities.ts
|
|
3
|
-
const FOLIO_DOCX_CAPABILITY_MANIFEST_VERSION = 1;
|
|
4
|
-
const FOLIO_DOCX_CAPABILITY_HOSTS = Object.freeze(["browser", "server"]);
|
|
5
|
-
const FOLIO_DOCX_COMPATIBILITY_HOSTS = Object.freeze([...FOLIO_DOCX_CAPABILITY_HOSTS, "unknown"]);
|
|
6
|
-
const FOLIO_DOCX_PROFILES = Object.freeze(["strict", "transitional"]);
|
|
7
|
-
const FOLIO_DOCX_COMPATIBILITY_PROFILES = Object.freeze([...FOLIO_DOCX_PROFILES, "unknown"]);
|
|
8
|
-
const FOLIO_DOCX_CAPABILITY_OPERATIONS = Object.freeze([
|
|
9
|
-
"create",
|
|
10
|
-
"edit",
|
|
11
|
-
"preserve",
|
|
12
|
-
"read",
|
|
13
|
-
"render"
|
|
14
|
-
]);
|
|
15
|
-
const FOLIO_DOCX_SUPPORT_STATES = Object.freeze([
|
|
16
|
-
"supported",
|
|
17
|
-
"partial",
|
|
18
|
-
"unsupported"
|
|
19
|
-
]);
|
|
20
|
-
const FOLIO_DOCX_CAPABILITY_IDS = Object.freeze([
|
|
21
|
-
"comments",
|
|
22
|
-
"contentControls",
|
|
23
|
-
"fields",
|
|
24
|
-
"headersFooters",
|
|
25
|
-
"hyperlinks",
|
|
26
|
-
"images",
|
|
27
|
-
"math",
|
|
28
|
-
"notes",
|
|
29
|
-
"numbering",
|
|
30
|
-
"opaqueDrawing",
|
|
31
|
-
"paragraphs",
|
|
32
|
-
"sections",
|
|
33
|
-
"styles",
|
|
34
|
-
"tables",
|
|
35
|
-
"trackedChanges"
|
|
36
|
-
]);
|
|
37
|
-
const TRANSITIONAL_PROFILE_COVERAGE = Object.freeze(["transitional"]);
|
|
38
|
-
const STRUCTURED_FEATURE_SUPPORT = Object.freeze({
|
|
39
|
-
create: "supported",
|
|
40
|
-
edit: "supported",
|
|
41
|
-
preserve: "supported",
|
|
42
|
-
read: "supported",
|
|
43
|
-
render: "partial"
|
|
44
|
-
});
|
|
45
|
-
const PARTIAL_AUTHORING_FEATURE_SUPPORT = Object.freeze({
|
|
46
|
-
create: "partial",
|
|
47
|
-
edit: "partial",
|
|
48
|
-
preserve: "supported",
|
|
49
|
-
read: "supported",
|
|
50
|
-
render: "partial"
|
|
51
|
-
});
|
|
52
|
-
const COMMENTS_CAPABILITY = Object.freeze({
|
|
53
|
-
id: "comments",
|
|
54
|
-
feature: "comments",
|
|
55
|
-
hosts: FOLIO_DOCX_CAPABILITY_HOSTS,
|
|
56
|
-
profiles: TRANSITIONAL_PROFILE_COVERAGE,
|
|
57
|
-
support: STRUCTURED_FEATURE_SUPPORT,
|
|
58
|
-
evidence: Object.freeze([{
|
|
59
|
-
type: "test",
|
|
60
|
-
path: "packages/core/src/docx/commentReplyThreads.test.ts"
|
|
61
|
-
}, {
|
|
62
|
-
type: "test",
|
|
63
|
-
path: "packages/core/src/prosemirror/commands/comments.test.ts"
|
|
64
|
-
}])
|
|
65
|
-
});
|
|
66
|
-
const CONTENT_CONTROLS_CAPABILITY = Object.freeze({
|
|
67
|
-
id: "contentControls",
|
|
68
|
-
feature: "contentControls",
|
|
69
|
-
hosts: FOLIO_DOCX_CAPABILITY_HOSTS,
|
|
70
|
-
profiles: TRANSITIONAL_PROFILE_COVERAGE,
|
|
71
|
-
support: Object.freeze({
|
|
72
|
-
...PARTIAL_AUTHORING_FEATURE_SUPPORT,
|
|
73
|
-
edit: "supported"
|
|
74
|
-
}),
|
|
75
|
-
evidence: Object.freeze([{
|
|
76
|
-
type: "test",
|
|
77
|
-
path: "packages/core/src/content-controls/contentControls.test.ts"
|
|
78
|
-
}, {
|
|
79
|
-
type: "test",
|
|
80
|
-
path: "packages/core/src/docx/sdtRoundtrip.property.test.ts"
|
|
81
|
-
}])
|
|
82
|
-
});
|
|
83
|
-
const FIELDS_CAPABILITY = Object.freeze({
|
|
84
|
-
id: "fields",
|
|
85
|
-
feature: "fields",
|
|
86
|
-
hosts: FOLIO_DOCX_CAPABILITY_HOSTS,
|
|
87
|
-
profiles: TRANSITIONAL_PROFILE_COVERAGE,
|
|
88
|
-
support: PARTIAL_AUTHORING_FEATURE_SUPPORT,
|
|
89
|
-
evidence: Object.freeze([{
|
|
90
|
-
type: "test",
|
|
91
|
-
path: "packages/core/src/fields/evaluateField.test.ts"
|
|
92
|
-
}, {
|
|
93
|
-
type: "test",
|
|
94
|
-
path: "packages/core/src/prosemirror/extensions/nodes/FieldExtension.test.ts"
|
|
95
|
-
}])
|
|
96
|
-
});
|
|
97
|
-
const HEADERS_FOOTERS_CAPABILITY = Object.freeze({
|
|
98
|
-
id: "headersFooters",
|
|
99
|
-
feature: "headersFooters",
|
|
100
|
-
hosts: FOLIO_DOCX_CAPABILITY_HOSTS,
|
|
101
|
-
profiles: TRANSITIONAL_PROFILE_COVERAGE,
|
|
102
|
-
support: STRUCTURED_FEATURE_SUPPORT,
|
|
103
|
-
evidence: Object.freeze([{
|
|
104
|
-
type: "test",
|
|
105
|
-
path: "packages/core/src/docx/headerFooterParser.test.ts"
|
|
106
|
-
}, {
|
|
107
|
-
type: "test",
|
|
108
|
-
path: "packages/core/src/docx/headerFooterMaterialize.test.ts"
|
|
109
|
-
}])
|
|
110
|
-
});
|
|
111
|
-
const HYPERLINKS_CAPABILITY = Object.freeze({
|
|
112
|
-
id: "hyperlinks",
|
|
113
|
-
feature: "hyperlinks",
|
|
114
|
-
hosts: FOLIO_DOCX_CAPABILITY_HOSTS,
|
|
115
|
-
profiles: TRANSITIONAL_PROFILE_COVERAGE,
|
|
116
|
-
support: PARTIAL_AUTHORING_FEATURE_SUPPORT,
|
|
117
|
-
evidence: Object.freeze([{
|
|
118
|
-
type: "test",
|
|
119
|
-
path: "packages/core/src/docx/hyperlinkParser.test.ts"
|
|
120
|
-
}, {
|
|
121
|
-
type: "test",
|
|
122
|
-
path: "packages/core/src/prosemirror/conversion/toProseDoc-hyperlink-content.test.ts"
|
|
123
|
-
}])
|
|
124
|
-
});
|
|
125
|
-
const IMAGES_CAPABILITY = Object.freeze({
|
|
126
|
-
id: "images",
|
|
127
|
-
feature: "images",
|
|
128
|
-
hosts: FOLIO_DOCX_CAPABILITY_HOSTS,
|
|
129
|
-
profiles: TRANSITIONAL_PROFILE_COVERAGE,
|
|
130
|
-
support: Object.freeze({
|
|
131
|
-
...PARTIAL_AUTHORING_FEATURE_SUPPORT,
|
|
132
|
-
edit: "supported"
|
|
133
|
-
}),
|
|
134
|
-
evidence: Object.freeze([{
|
|
135
|
-
type: "test",
|
|
136
|
-
path: "packages/core/src/docx/__tests__/image-crop-roundtrip.test.ts"
|
|
137
|
-
}, {
|
|
138
|
-
type: "test",
|
|
139
|
-
path: "packages/core/src/prosemirror/commands/image.test.ts"
|
|
140
|
-
}])
|
|
141
|
-
});
|
|
142
|
-
const MATH_CAPABILITY = Object.freeze({
|
|
143
|
-
id: "math",
|
|
144
|
-
feature: "math",
|
|
145
|
-
hosts: FOLIO_DOCX_CAPABILITY_HOSTS,
|
|
146
|
-
profiles: TRANSITIONAL_PROFILE_COVERAGE,
|
|
147
|
-
support: PARTIAL_AUTHORING_FEATURE_SUPPORT,
|
|
148
|
-
evidence: Object.freeze([{
|
|
149
|
-
type: "test",
|
|
150
|
-
path: "packages/core/src/docx/mathToMathml.test.ts"
|
|
151
|
-
}, {
|
|
152
|
-
type: "test",
|
|
153
|
-
path: "packages/core/src/docx/serializer/math-roundtrip.test.ts"
|
|
154
|
-
}])
|
|
155
|
-
});
|
|
156
|
-
const NOTES_CAPABILITY = Object.freeze({
|
|
157
|
-
id: "notes",
|
|
158
|
-
feature: "notes",
|
|
159
|
-
hosts: FOLIO_DOCX_CAPABILITY_HOSTS,
|
|
160
|
-
profiles: TRANSITIONAL_PROFILE_COVERAGE,
|
|
161
|
-
support: Object.freeze({
|
|
162
|
-
create: "partial",
|
|
163
|
-
edit: "supported",
|
|
164
|
-
preserve: "supported",
|
|
165
|
-
read: "supported",
|
|
166
|
-
render: "partial"
|
|
167
|
-
}),
|
|
168
|
-
evidence: Object.freeze([{
|
|
169
|
-
type: "test",
|
|
170
|
-
path: "packages/core/src/docx/noteSave.test.ts"
|
|
171
|
-
}, {
|
|
172
|
-
type: "test",
|
|
173
|
-
path: "packages/core/src/layout-bridge/convert/footnoteLayout-collect.test.ts"
|
|
174
|
-
}])
|
|
175
|
-
});
|
|
176
|
-
const NUMBERING_CAPABILITY = Object.freeze({
|
|
177
|
-
id: "numbering",
|
|
178
|
-
feature: "numbering",
|
|
179
|
-
hosts: FOLIO_DOCX_CAPABILITY_HOSTS,
|
|
180
|
-
profiles: TRANSITIONAL_PROFILE_COVERAGE,
|
|
181
|
-
support: Object.freeze({
|
|
182
|
-
create: "partial",
|
|
183
|
-
edit: "supported",
|
|
184
|
-
preserve: "supported",
|
|
185
|
-
read: "supported",
|
|
186
|
-
render: "partial"
|
|
187
|
-
}),
|
|
188
|
-
evidence: Object.freeze([{
|
|
189
|
-
type: "test",
|
|
190
|
-
path: "packages/core/src/docx/numberingParser-custom-format.test.ts"
|
|
191
|
-
}, {
|
|
192
|
-
type: "test",
|
|
193
|
-
path: "packages/core/src/docx/numberingSave.test.ts"
|
|
194
|
-
}])
|
|
195
|
-
});
|
|
196
|
-
const OPAQUE_DRAWING_CAPABILITY = Object.freeze({
|
|
197
|
-
id: "opaqueDrawing",
|
|
198
|
-
feature: "drawings",
|
|
199
|
-
hosts: FOLIO_DOCX_CAPABILITY_HOSTS,
|
|
200
|
-
profiles: TRANSITIONAL_PROFILE_COVERAGE,
|
|
201
|
-
support: Object.freeze({
|
|
202
|
-
create: "unsupported",
|
|
203
|
-
edit: "unsupported",
|
|
204
|
-
preserve: "supported",
|
|
205
|
-
read: "supported",
|
|
206
|
-
render: "partial"
|
|
207
|
-
}),
|
|
208
|
-
evidence: Object.freeze([{
|
|
209
|
-
type: "test",
|
|
210
|
-
path: "packages/core/src/docx/compatibility.test.ts"
|
|
211
|
-
}, {
|
|
212
|
-
type: "test",
|
|
213
|
-
path: "packages/core/src/docx/rezip.test.ts"
|
|
214
|
-
}])
|
|
215
|
-
});
|
|
216
|
-
const PARAGRAPHS_CAPABILITY = Object.freeze({
|
|
217
|
-
id: "paragraphs",
|
|
218
|
-
feature: "paragraphs",
|
|
219
|
-
hosts: FOLIO_DOCX_CAPABILITY_HOSTS,
|
|
220
|
-
profiles: TRANSITIONAL_PROFILE_COVERAGE,
|
|
221
|
-
support: STRUCTURED_FEATURE_SUPPORT,
|
|
222
|
-
evidence: Object.freeze([{
|
|
223
|
-
type: "test",
|
|
224
|
-
path: "packages/core/src/docx/paragraphParser.test.ts"
|
|
225
|
-
}, {
|
|
226
|
-
type: "test",
|
|
227
|
-
path: "packages/core/src/docx/serializer/paragraphSerializer.test.ts"
|
|
228
|
-
}])
|
|
229
|
-
});
|
|
230
|
-
const SECTIONS_CAPABILITY = Object.freeze({
|
|
231
|
-
id: "sections",
|
|
232
|
-
feature: "sections",
|
|
233
|
-
hosts: FOLIO_DOCX_CAPABILITY_HOSTS,
|
|
234
|
-
profiles: TRANSITIONAL_PROFILE_COVERAGE,
|
|
235
|
-
support: STRUCTURED_FEATURE_SUPPORT,
|
|
236
|
-
evidence: Object.freeze([{
|
|
237
|
-
type: "test",
|
|
238
|
-
path: "packages/core/src/docx/serializer/sectionPropertiesSerializer.test.ts"
|
|
239
|
-
}, {
|
|
240
|
-
type: "test",
|
|
241
|
-
path: "packages/core/src/prosemirror/commands/sectionBreak.test.ts"
|
|
242
|
-
}])
|
|
243
|
-
});
|
|
244
|
-
const STYLES_CAPABILITY = Object.freeze({
|
|
245
|
-
id: "styles",
|
|
246
|
-
feature: "styles",
|
|
247
|
-
hosts: FOLIO_DOCX_CAPABILITY_HOSTS,
|
|
248
|
-
profiles: TRANSITIONAL_PROFILE_COVERAGE,
|
|
249
|
-
support: Object.freeze({
|
|
250
|
-
create: "partial",
|
|
251
|
-
edit: "partial",
|
|
252
|
-
preserve: "supported",
|
|
253
|
-
read: "supported",
|
|
254
|
-
render: "partial"
|
|
255
|
-
}),
|
|
256
|
-
evidence: Object.freeze([{
|
|
257
|
-
type: "test",
|
|
258
|
-
path: "packages/core/src/docx/styleParser.test.ts"
|
|
259
|
-
}, {
|
|
260
|
-
type: "test",
|
|
261
|
-
path: "packages/core/src/prosemirror/conversion/characterStyleRoundtrip.test.ts"
|
|
262
|
-
}])
|
|
263
|
-
});
|
|
264
|
-
const TABLES_CAPABILITY = Object.freeze({
|
|
265
|
-
id: "tables",
|
|
266
|
-
feature: "tables",
|
|
267
|
-
hosts: FOLIO_DOCX_CAPABILITY_HOSTS,
|
|
268
|
-
profiles: TRANSITIONAL_PROFILE_COVERAGE,
|
|
269
|
-
support: STRUCTURED_FEATURE_SUPPORT,
|
|
270
|
-
evidence: Object.freeze([{
|
|
271
|
-
type: "test",
|
|
272
|
-
path: "packages/core/src/docx/tableParser.test.ts"
|
|
273
|
-
}, {
|
|
274
|
-
type: "test",
|
|
275
|
-
path: "packages/core/src/prosemirror/conversion/tableBordersRoundtrip.test.ts"
|
|
276
|
-
}])
|
|
277
|
-
});
|
|
278
|
-
const TRACKED_CHANGES_CAPABILITY = Object.freeze({
|
|
279
|
-
id: "trackedChanges",
|
|
280
|
-
feature: "revisions",
|
|
281
|
-
hosts: FOLIO_DOCX_CAPABILITY_HOSTS,
|
|
282
|
-
profiles: TRANSITIONAL_PROFILE_COVERAGE,
|
|
283
|
-
support: STRUCTURED_FEATURE_SUPPORT,
|
|
284
|
-
evidence: Object.freeze([{
|
|
285
|
-
type: "test",
|
|
286
|
-
path: "packages/core/src/redline.test.ts"
|
|
287
|
-
}, {
|
|
288
|
-
type: "test",
|
|
289
|
-
path: "packages/core/src/prosemirror/plugins/suggestionMode.test.ts"
|
|
290
|
-
}])
|
|
291
|
-
});
|
|
292
|
-
const FOLIO_DOCX_CAPABILITY_MANIFEST = Object.freeze({
|
|
293
|
-
version: 1,
|
|
294
|
-
capabilities: Object.freeze({
|
|
295
|
-
comments: COMMENTS_CAPABILITY,
|
|
296
|
-
contentControls: CONTENT_CONTROLS_CAPABILITY,
|
|
297
|
-
fields: FIELDS_CAPABILITY,
|
|
298
|
-
headersFooters: HEADERS_FOOTERS_CAPABILITY,
|
|
299
|
-
hyperlinks: HYPERLINKS_CAPABILITY,
|
|
300
|
-
images: IMAGES_CAPABILITY,
|
|
301
|
-
math: MATH_CAPABILITY,
|
|
302
|
-
notes: NOTES_CAPABILITY,
|
|
303
|
-
numbering: NUMBERING_CAPABILITY,
|
|
304
|
-
opaqueDrawing: OPAQUE_DRAWING_CAPABILITY,
|
|
305
|
-
paragraphs: PARAGRAPHS_CAPABILITY,
|
|
306
|
-
sections: SECTIONS_CAPABILITY,
|
|
307
|
-
styles: STYLES_CAPABILITY,
|
|
308
|
-
tables: TABLES_CAPABILITY,
|
|
309
|
-
trackedChanges: TRACKED_CHANGES_CAPABILITY
|
|
310
|
-
})
|
|
311
|
-
});
|
|
312
|
-
var InvalidFolioDocxCapabilityIdError = class extends TaggedError("InvalidFolioDocxCapabilityIdError")() {};
|
|
313
|
-
const isFolioDocxCapabilityId = (value) => FOLIO_DOCX_CAPABILITY_IDS.some((id) => id === value);
|
|
314
|
-
const getFolioDocxCapability = (id) => {
|
|
315
|
-
if (!isFolioDocxCapabilityId(id)) throw new InvalidFolioDocxCapabilityIdError({
|
|
316
|
-
message: "Invalid DOCX capability id.",
|
|
317
|
-
receivedId: id
|
|
318
|
-
});
|
|
319
|
-
return FOLIO_DOCX_CAPABILITY_MANIFEST.capabilities[id];
|
|
320
|
-
};
|
|
321
|
-
//#endregion
|
|
322
|
-
export { FOLIO_DOCX_CAPABILITY_HOSTS, FOLIO_DOCX_CAPABILITY_IDS, FOLIO_DOCX_CAPABILITY_MANIFEST, FOLIO_DOCX_CAPABILITY_MANIFEST_VERSION, FOLIO_DOCX_CAPABILITY_OPERATIONS, FOLIO_DOCX_COMPATIBILITY_HOSTS, FOLIO_DOCX_COMPATIBILITY_PROFILES, FOLIO_DOCX_PROFILES, FOLIO_DOCX_SUPPORT_STATES, InvalidFolioDocxCapabilityIdError, getFolioDocxCapability, isFolioDocxCapabilityId };
|