@stll/folio-core 0.45.0 → 0.47.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 +85 -43
- package/dist/ai-edits/headless.js +2 -2
- package/dist/ai-edits/read.d.ts +1 -0
- package/dist/ai-edits/read.js +1 -0
- package/dist/ai-edits/snapshot.js +32 -27
- package/dist/ai-edits/table-cell-mutations.js +15 -7
- package/dist/ai-edits/table-geometry.js +21 -18
- package/dist/ai-edits/table-template.js +2 -2
- package/dist/compare/compare.js +2 -5
- package/dist/compare/content-alignment.js +108 -12
- package/dist/compare/content-types.d.ts +8 -2
- package/dist/compare/content.js +2 -11
- package/dist/compare/plan.js +7 -4
- package/dist/compare/scenario.js +2 -5
- package/dist/compare/section-boundary-properties.js +1 -2
- package/dist/compare/types.d.ts +9 -1
- package/dist/compare/types.js +12 -1
- package/dist/compat/eigenpal.d.ts +2 -1
- package/dist/compat/eigenpal.js +2 -1
- package/dist/content-controls/checkboxDisplay.d.ts +17 -0
- package/dist/content-controls/checkboxDisplay.js +46 -0
- package/dist/content-controls/findContentControls.js +3 -1
- package/dist/content-controls/mutateContentControls.js +57 -43
- package/dist/controller/contentControlWidgetController.d.ts +1 -0
- package/dist/controller/contentControlWidgetController.js +3 -0
- package/dist/controller/hiddenEditorApi.js +3 -1
- package/dist/controller/hiddenEditorManager.d.ts +1 -1
- package/dist/controller/hiddenEditorManager.js +6 -3
- package/dist/controller/layoutPipeline.js +8 -3
- package/dist/display-list/build/buildDisplayList.js +20 -1
- package/dist/display-list/build/imagePrimitives.d.ts +4 -4
- package/dist/display-list/build/imagePrimitives.js +38 -18
- package/dist/display-list/build/pageBorderPrimitives.js +2 -1
- package/dist/display-list/build/paragraphPrimitives.js +113 -14
- package/dist/display-list/build/previewPrimitives.d.ts +10 -0
- package/dist/display-list/build/previewPrimitives.js +89 -0
- package/dist/display-list/build/strokes.d.ts +177 -8
- package/dist/display-list/build/strokes.js +167 -47
- package/dist/display-list/build/tablePrimitives.js +4 -2
- package/dist/display-list/build/textBoxPrimitives.js +6 -4
- package/dist/display-list/build/textDecorations.d.ts +15 -1
- package/dist/display-list/build/textDecorations.js +15 -1
- package/dist/display-list/dom/renderDisplayListToDom.js +11 -21
- package/dist/display-list/primitives.d.ts +13 -2
- package/dist/display-list/primitives.js +36 -1
- package/dist/display-list/types.d.ts +17 -0
- package/dist/document-operations.js +2 -1
- package/dist/docx/attributeRemainder.d.ts +76 -0
- package/dist/docx/attributeRemainder.js +111 -0
- package/dist/docx/blockContentParser.d.ts +3 -1
- package/dist/docx/blockContentParser.js +102 -106
- package/dist/docx/blockPlainText.d.ts +3 -4
- package/dist/docx/blockPlainText.js +3 -0
- package/dist/docx/borderParser.js +26 -11
- package/dist/docx/builtInStyles.d.ts +8 -16
- package/dist/docx/builtInStyles.js +54 -17
- package/dist/docx/commentAnchorIndex.d.ts +30 -0
- package/dist/docx/commentAnchorIndex.js +50 -0
- package/dist/docx/commentParser.d.ts +1 -1
- package/dist/docx/commentParser.js +56 -39
- package/dist/docx/commentRangeIntegrity.d.ts +16 -1
- package/dist/docx/commentRangeIntegrity.js +42 -1
- package/dist/docx/commentRangeJoin.d.ts +9 -0
- package/dist/docx/commentRangeJoin.js +33 -0
- package/dist/docx/commentReferenceCompletion.d.ts +9 -0
- package/dist/docx/commentReferenceCompletion.js +47 -0
- package/dist/docx/commentReferenceNormalization.js +3 -1
- package/dist/docx/commentReplyMarkers.js +11 -19
- package/dist/docx/compatibility.js +56 -41
- package/dist/docx/containerChildren.d.ts +208 -0
- package/dist/docx/containerChildren.gen.d.ts +43 -0
- package/dist/docx/containerChildren.gen.js +263 -0
- package/dist/docx/containerChildren.js +153 -0
- package/dist/docx/diagramPreview.d.ts +14 -2
- package/dist/docx/diagramPreview.js +81 -169
- package/dist/docx/documentParser.d.ts +1 -1
- package/dist/docx/documentParser.js +7 -4
- package/dist/docx/drawingAnchor.d.ts +87 -0
- package/dist/docx/drawingAnchor.js +201 -0
- package/dist/docx/drawingUtils.d.ts +43 -38
- package/dist/docx/drawingUtils.js +205 -118
- package/dist/docx/ensureParaIds.js +17 -7
- package/dist/docx/fieldParser.d.ts +1 -1
- package/dist/docx/fieldParser.js +4 -4
- package/dist/docx/fieldState.d.ts +26 -0
- package/dist/docx/fieldState.js +53 -0
- package/dist/docx/fontTableParser.js +102 -41
- package/dist/docx/footnoteParser.d.ts +1 -1
- package/dist/docx/footnoteParser.js +10 -6
- package/dist/docx/graphicFrameLocks.d.ts +16 -4
- package/dist/docx/graphicFrameLocks.js +19 -6
- package/dist/docx/groupDrawingParser.js +4 -3
- package/dist/docx/headerFooterParser.js +1 -1
- package/dist/docx/headerFooterReferenceNormalization.js +1 -0
- package/dist/docx/hyperlinkParser.d.ts +66 -9
- package/dist/docx/hyperlinkParser.js +153 -26
- package/dist/docx/imageParser.js +160 -115
- package/dist/docx/index.d.ts +2 -1
- package/dist/docx/index.js +2 -1
- package/dist/docx/inlineContentRemovals.d.ts +28 -0
- package/dist/docx/inlineContentRemovals.js +46 -0
- package/dist/docx/inlineWrapperContent.d.ts +166 -0
- package/dist/docx/inlineWrapperContent.js +165 -0
- package/dist/docx/inlineWrapperParser.d.ts +11 -0
- package/dist/docx/inlineWrapperParser.js +60 -0
- package/dist/docx/nonVisualDrawingProps.d.ts +5 -13
- package/dist/docx/normalizeBaseDirection.js +12 -1
- package/dist/docx/numberingParser.d.ts +25 -2
- package/dist/docx/numberingParser.js +264 -361
- package/dist/docx/numberingReference.d.ts +9 -16
- package/dist/docx/numberingReference.js +17 -16
- package/dist/docx/numberingReferenceNormalization.js +7 -7
- package/dist/docx/ooxmlCounterFormatter.d.ts +1 -1
- package/dist/docx/ooxmlCounterFormatter.js +4 -1
- package/dist/docx/paraIdAttribute.d.ts +111 -0
- package/dist/docx/paraIdAttribute.js +142 -0
- package/dist/docx/paragraphParser.d.ts +10 -25
- package/dist/docx/paragraphParser.js +421 -496
- package/dist/docx/paragraphProperties.d.ts +23 -0
- package/dist/docx/paragraphProperties.js +279 -0
- package/dist/docx/paragraphPropertySource.js +7 -1
- package/dist/docx/paragraphTextBoxEnrichment.d.ts +3 -2
- package/dist/docx/paragraphTextBoxEnrichment.js +20 -59
- package/dist/docx/paragraphTraversal.d.ts +14 -10
- package/dist/docx/paragraphTraversal.js +53 -52
- package/dist/docx/parseWarningMessage.js +5 -1
- package/dist/docx/parserEnums.d.ts +6 -8
- package/dist/docx/parserEnums.js +4 -6
- package/dist/docx/preservedRunContent.d.ts +32 -0
- package/dist/docx/preservedRunContent.js +96 -0
- package/dist/docx/previewBudget.d.ts +44 -23
- package/dist/docx/previewBudget.js +61 -30
- package/dist/docx/propertyElementAttributes.d.ts +178 -0
- package/dist/docx/propertyElementAttributes.js +114 -0
- package/dist/docx/renderedPageBreakNormalization.js +4 -6
- package/dist/docx/rezip.d.ts +28 -2
- package/dist/docx/rezip.js +152 -27
- package/dist/docx/runConsolidator.d.ts +42 -2
- package/dist/docx/runConsolidator.js +60 -6
- package/dist/docx/runParser.d.ts +55 -19
- package/dist/docx/runParser.js +394 -306
- package/dist/docx/runPayload.d.ts +5 -0
- package/dist/docx/runPayload.js +4 -0
- package/dist/docx/sdtProperties.d.ts +39 -5
- package/dist/docx/sdtProperties.js +205 -84
- package/dist/docx/sdtPropertiesPatch.d.ts +5 -9
- package/dist/docx/sdtPropertiesPatch.js +68 -112
- package/dist/docx/sectionParser.d.ts +1 -2
- package/dist/docx/sectionParser.js +241 -238
- package/dist/docx/selectiveSave.js +3 -2
- package/dist/docx/selectiveXmlPatch.d.ts +66 -3
- package/dist/docx/selectiveXmlPatch.js +276 -133
- package/dist/docx/serializer/blockSdtSerializer.js +2 -96
- package/dist/docx/serializer/borderSerializer.d.ts +5 -5
- package/dist/docx/serializer/borderSerializer.js +12 -10
- package/dist/docx/serializer/commentSerializer.js +5 -7
- package/dist/docx/serializer/documentSerializer.js +11 -11
- package/dist/docx/serializer/fontTableSerializer.js +31 -3
- package/dist/docx/serializer/headerFooterSerializer.js +10 -9
- package/dist/docx/serializer/markupRangeAttributes.d.ts +9 -1
- package/dist/docx/serializer/markupRangeAttributes.js +9 -1
- package/dist/docx/serializer/noteSerializer.js +11 -8
- package/dist/docx/serializer/numberingSerializer.d.ts +1 -6
- package/dist/docx/serializer/numberingSerializer.js +81 -79
- package/dist/docx/serializer/paragraphSerializer.d.ts +1 -9
- package/dist/docx/serializer/paragraphSerializer.js +156 -236
- package/dist/docx/serializer/runSerializer.d.ts +1 -5
- package/dist/docx/serializer/runSerializer.js +134 -75
- package/dist/docx/serializer/sdtPropertiesSerializer.d.ts +26 -0
- package/dist/docx/serializer/sdtPropertiesSerializer.js +111 -0
- package/dist/docx/serializer/sectionPropertiesSerializer.js +42 -49
- package/dist/docx/serializer/settingsSerializer.js +6 -4
- package/dist/docx/serializer/stylesSerializer.js +8 -11
- package/dist/docx/serializer/tableSerializer.js +283 -105
- package/dist/docx/serializer/textFormattingSerializer.d.ts +28 -4
- package/dist/docx/serializer/textFormattingSerializer.js +111 -101
- package/dist/docx/serializer/xmlUtils.d.ts +1 -1
- package/dist/docx/serializer/xmlUtils.js +1 -1
- package/dist/docx/server/createBilingualDocument.js +20 -16
- package/dist/docx/server/materializeYjsDocx.d.ts +1 -1
- package/dist/docx/server/materializeYjsDocx.js +9 -1
- package/dist/docx/server/migrateYjsAttrSchema.d.ts +55 -0
- package/dist/docx/server/migrateYjsAttrSchema.js +95 -0
- package/dist/docx/settingsParser.js +7 -4
- package/dist/docx/shadingParser.d.ts +2 -1
- package/dist/docx/shadingParser.js +43 -7
- package/dist/docx/shapeParser.js +13 -8
- package/dist/docx/strictNames.d.ts +11 -0
- package/dist/docx/strictNames.gen.d.ts +45 -0
- package/dist/docx/strictNames.gen.js +50 -0
- package/dist/docx/strictNames.js +43 -0
- package/dist/docx/strictValueEncodings.gen.js +133 -131
- package/dist/docx/styleParser.js +17 -349
- package/dist/docx/tableParser.d.ts +11 -2
- package/dist/docx/tableParser.js +665 -220
- package/dist/docx/textBoxParser.d.ts +28 -3
- package/dist/docx/textBoxParser.js +69 -9
- package/dist/docx/themeColorAttribute.d.ts +13 -0
- package/dist/docx/themeColorAttribute.js +24 -0
- package/dist/docx/trackedMoveRangeNormalization.js +2 -1
- package/dist/docx/unzip.js +5 -4
- package/dist/docx/vmlImageParser.d.ts +30 -5
- package/dist/docx/vmlImageParser.js +91 -32
- package/dist/docx/vmlPreview.js +2 -2
- package/dist/docx/wrapPolygon.d.ts +30 -0
- package/dist/docx/wrapPolygon.js +70 -0
- package/dist/docx/xmlEncoding.d.ts +5 -0
- package/dist/docx/xmlEncoding.js +12 -0
- package/dist/docx/xmlParser.d.ts +23 -1
- package/dist/docx/xmlParser.js +31 -2
- package/dist/fonts/embeddedFonts.js +3 -3
- package/dist/headless-layout.js +12 -1
- package/dist/i18n/messages/catalogs.gen.d.ts +68 -0
- package/dist/i18n/messages/catalogs.gen.js +102 -34
- package/dist/i18n/messages/messages.gen.d.ts +4 -0
- package/dist/index.d.ts +2 -1
- package/dist/index.js +2 -1
- package/dist/internal/headlessRevisionResolution.js +9 -0
- package/dist/internal/pageBreakRunSourceDescendantIndex.js +7 -2
- package/dist/internal/paragraphFormattingSerialization.d.ts +20 -9
- package/dist/internal/paragraphFormattingSerialization.js +118 -83
- package/dist/layout-bridge/convert/footnoteLayout.d.ts +1 -0
- package/dist/layout-bridge/convert/footnoteLayout.js +1 -0
- package/dist/layout-bridge/convert/headerFooterLayout.d.ts +1 -0
- package/dist/layout-bridge/convert/headerFooterLayout.js +2 -0
- package/dist/layout-bridge/convert/toFlowBlocks.d.ts +17 -12
- package/dist/layout-bridge/convert/toFlowBlocks.js +267 -101
- package/dist/layout-engine/index.d.ts +2 -2
- package/dist/layout-engine/index.js +53 -17
- package/dist/layout-engine/measure/measureBlocks.d.ts +3 -0
- package/dist/layout-engine/measure/measureBlocks.js +6 -10
- package/dist/layout-engine/measure/tableCellFloating.d.ts +2 -0
- package/dist/layout-engine/measure/tableCellFloating.js +2 -0
- package/dist/layout-engine/measure/tableCellGrid.js +2 -1
- package/dist/layout-engine/measure/tableFragmentBorderGeometry.js +2 -1
- package/dist/layout-engine/measure/tableInlinePlacement.js +2 -5
- package/dist/layout-engine/paragraphSequence.js +3 -2
- package/dist/layout-engine/renderedBreakReconciliation.js +2 -1
- package/dist/layout-engine/section-breaks.d.ts +49 -2
- package/dist/layout-engine/section-breaks.js +55 -4
- package/dist/layout-engine/types.d.ts +69 -17
- package/dist/layout-engine/types.js +16 -1
- package/dist/layout-painter/borderStroke.d.ts +18 -4
- package/dist/layout-painter/renderImage.d.ts +5 -1
- package/dist/layout-painter/renderImage.js +10 -3
- package/dist/layout-painter/renderPage.d.ts +2 -0
- package/dist/layout-painter/renderPage.js +10 -4
- package/dist/layout-painter/renderParagraph.d.ts +14 -1
- package/dist/layout-painter/renderParagraph.js +34 -28
- package/dist/layout-painter/renderTable.d.ts +4 -1
- package/dist/layout-painter/renderTable.js +22 -22
- package/dist/layout-painter/renderTextBox.js +5 -3
- package/dist/managers/autoSaveCodec.d.ts +9 -1
- package/dist/managers/autoSaveCodec.js +12 -4
- package/dist/markdown/renderBlock.js +3 -0
- package/dist/markdown/renderRuns.d.ts +1 -1
- package/dist/markdown/renderRuns.js +34 -6
- package/dist/markdown/renderTable.js +24 -6
- package/dist/markdown/trailers.js +4 -1
- package/dist/model.d.ts +3 -3
- package/dist/model.js +2 -2
- package/dist/paged-layout/sectionBlockWidths.d.ts +3 -0
- package/dist/paged-layout/sectionBlockWidths.js +26 -4
- package/dist/pdf/images.js +142 -6
- package/dist/prosemirror/attrs/index.d.ts +34 -5
- package/dist/prosemirror/attrs/index.js +639 -48
- package/dist/prosemirror/authoredTransformAttrs.d.ts +28 -0
- package/dist/prosemirror/authoredTransformAttrs.js +64 -0
- package/dist/prosemirror/bookmarkBoundaryAttrs.d.ts +9 -1
- package/dist/prosemirror/bookmarkBoundaryAttrs.js +22 -3
- package/dist/prosemirror/commands/comments.js +68 -53
- package/dist/prosemirror/commands/contentControls.js +33 -20
- package/dist/prosemirror/commands/image.d.ts +10 -3
- package/dist/prosemirror/commands/image.js +46 -29
- package/dist/prosemirror/commands/pageBreak.js +1 -1
- package/dist/prosemirror/commands/paragraph.d.ts +2 -1
- package/dist/prosemirror/commands/propertyChangeScope.d.ts +12 -4
- package/dist/prosemirror/commands/propertyChangeScope.js +22 -4
- package/dist/prosemirror/commands/sectionBreak.d.ts +33 -1
- package/dist/prosemirror/commands/sectionBreak.js +187 -11
- package/dist/prosemirror/commentReferenceAttrs.d.ts +8 -0
- package/dist/prosemirror/commentReferenceAttrs.js +33 -0
- package/dist/prosemirror/commentReferenceIntegrity.d.ts +47 -0
- package/dist/prosemirror/commentReferenceIntegrity.js +43 -0
- package/dist/prosemirror/conversion/fromProseDoc.d.ts +17 -12
- package/dist/prosemirror/conversion/fromProseDoc.js +553 -207
- package/dist/prosemirror/conversion/index.d.ts +2 -2
- package/dist/prosemirror/conversion/preservedSinkCarriers.d.ts +39 -0
- package/dist/prosemirror/conversion/preservedSinkCarriers.js +19 -0
- package/dist/prosemirror/conversion/runShadingMark.js +14 -1
- package/dist/prosemirror/conversion/sdtAttrs.d.ts +10 -1
- package/dist/prosemirror/conversion/sdtAttrs.js +19 -5
- package/dist/prosemirror/conversion/toProseDoc.d.ts +7 -9
- package/dist/prosemirror/conversion/toProseDoc.js +801 -411
- package/dist/prosemirror/emptyRangeAnchor.d.ts +53 -0
- package/dist/prosemirror/emptyRangeAnchor.js +158 -0
- package/dist/prosemirror/extensions/StarterKit.js +14 -58
- package/dist/prosemirror/extensions/core/DocExtension.js +1 -1
- package/dist/prosemirror/extensions/core/ParagraphExtension.js +21 -16
- package/dist/prosemirror/extensions/features/BaseKeymapExtension.js +48 -29
- package/dist/prosemirror/extensions/features/EmptyParagraphFormatExtension.js +3 -1
- package/dist/prosemirror/extensions/features/ImagePasteExtension.js +5 -3
- package/dist/prosemirror/extensions/features/ListExtension.js +43 -24
- package/dist/prosemirror/extensions/features/ParaIdAllocatorExtension.js +1 -0
- package/dist/prosemirror/extensions/features/ParagraphChangeTrackerExtension.js +4 -3
- package/dist/prosemirror/extensions/features/PasteCleanupExtension.d.ts +3 -3
- package/dist/prosemirror/extensions/features/PasteCleanupExtension.js +5 -5
- package/dist/prosemirror/extensions/features/pasteCleanup.d.ts +3 -1
- package/dist/prosemirror/extensions/features/pasteCleanup.js +56 -2
- package/dist/prosemirror/extensions/features/pastedHeadingStyles.js +5 -4
- package/dist/prosemirror/extensions/markRegistry.d.ts +65 -0
- package/dist/prosemirror/extensions/markRegistry.js +138 -0
- package/dist/prosemirror/extensions/marks/InlineWrapperExtension.d.ts +18 -0
- package/dist/prosemirror/extensions/marks/InlineWrapperExtension.js +77 -0
- package/dist/prosemirror/extensions/marks/RunIdentityExtension.d.ts +26 -0
- package/dist/prosemirror/extensions/marks/RunIdentityExtension.js +134 -0
- package/dist/prosemirror/extensions/marks/TrackedChangeExtensions.js +2 -1
- package/dist/prosemirror/extensions/marks/UnderlineExtension.js +12 -18
- package/dist/prosemirror/extensions/marks/markUtils.d.ts +2 -1
- package/dist/prosemirror/extensions/marks/markUtils.js +49 -5
- package/dist/prosemirror/extensions/nodes/BlockBookmarkBoundaryExtension.d.ts +29 -0
- package/dist/prosemirror/extensions/nodes/BlockBookmarkBoundaryExtension.js +46 -0
- package/dist/prosemirror/extensions/nodes/BlockSdtExtension.d.ts +4 -3
- package/dist/prosemirror/extensions/nodes/BlockSdtExtension.js +18 -13
- package/dist/prosemirror/extensions/nodes/BookmarkBoundaryExtension.js +28 -53
- package/dist/prosemirror/extensions/nodes/CommentReferenceExtension.d.ts +11 -0
- package/dist/prosemirror/extensions/nodes/CommentReferenceExtension.js +97 -0
- package/dist/prosemirror/extensions/nodes/FieldExtension.js +9 -7
- package/dist/prosemirror/extensions/nodes/ImageExtension.js +24 -1
- package/dist/prosemirror/extensions/nodes/MoveRangeBoundaryExtension.d.ts +11 -0
- package/dist/prosemirror/extensions/nodes/MoveRangeBoundaryExtension.js +43 -0
- package/dist/prosemirror/extensions/nodes/PreservedBlockExtension.d.ts +32 -0
- package/dist/prosemirror/extensions/nodes/PreservedBlockExtension.js +67 -0
- package/dist/prosemirror/extensions/nodes/PreservedXmlExtension.d.ts +16 -0
- package/dist/prosemirror/extensions/nodes/PreservedXmlExtension.js +60 -0
- package/dist/prosemirror/extensions/nodes/RangeAnchorExtension.d.ts +13 -0
- package/dist/prosemirror/extensions/nodes/RangeAnchorExtension.js +65 -0
- package/dist/prosemirror/extensions/nodes/SdtExtension.d.ts +3 -1
- package/dist/prosemirror/extensions/nodes/SdtExtension.js +22 -16
- package/dist/prosemirror/extensions/nodes/ShapeExtension.js +7 -0
- package/dist/prosemirror/extensions/nodes/TableExtension.js +142 -123
- package/dist/prosemirror/extensions/nodes/TextBoxExtension.js +9 -1
- package/dist/prosemirror/extensions/nodes/bookmarkBoundaryDom.d.ts +23 -0
- package/dist/prosemirror/extensions/nodes/bookmarkBoundaryDom.js +57 -0
- package/dist/prosemirror/extensions/types.d.ts +12 -3
- package/dist/prosemirror/index.d.ts +4 -2
- package/dist/prosemirror/index.js +2 -1
- package/dist/prosemirror/inlineWrapperStack.d.ts +39 -0
- package/dist/prosemirror/inlineWrapperStack.js +92 -0
- package/dist/prosemirror/listMarker.d.ts +2 -2
- package/dist/prosemirror/listMarker.js +7 -8
- package/dist/prosemirror/listRenderingAttrs.js +11 -1
- package/dist/prosemirror/listState.d.ts +62 -0
- package/dist/prosemirror/listState.js +49 -0
- package/dist/prosemirror/moveRangeBoundaryAttrs.d.ts +13 -0
- package/dist/prosemirror/moveRangeBoundaryAttrs.js +114 -0
- package/dist/prosemirror/numberedRefFields.js +4 -4
- package/dist/prosemirror/numberingAttr.d.ts +55 -0
- package/dist/prosemirror/numberingAttr.js +74 -0
- package/dist/prosemirror/outlineLevelAttr.d.ts +29 -0
- package/dist/prosemirror/outlineLevelAttr.js +42 -0
- package/dist/prosemirror/pageBreakRunProjection.d.ts +17 -7
- package/dist/prosemirror/pageBreakRunProjection.js +19 -9
- package/dist/prosemirror/paragraphFormattingProvenance.d.ts +9 -0
- package/dist/prosemirror/paragraphFormattingProvenance.js +4 -1
- package/dist/prosemirror/plugins/selectionTracker.d.ts +3 -6
- package/dist/prosemirror/plugins/selectionTracker.js +3 -10
- package/dist/prosemirror/rangeAnchorAttrs.d.ts +14 -0
- package/dist/prosemirror/rangeAnchorAttrs.js +101 -0
- package/dist/prosemirror/replacedAnnotations.d.ts +59 -0
- package/dist/prosemirror/replacedAnnotations.js +183 -0
- package/dist/prosemirror/revisionCarriers.d.ts +86 -2
- package/dist/prosemirror/revisionCarriers.js +86 -60
- package/dist/prosemirror/runFormattingInlineCarriers.d.ts +5 -1
- package/dist/prosemirror/runFormattingInlineCarriers.js +7 -1
- package/dist/prosemirror/runIdentity.d.ts +28 -0
- package/dist/prosemirror/runIdentity.js +36 -0
- package/dist/prosemirror/runStyleFormatting.js +1 -1
- package/dist/prosemirror/schema/index.d.ts +3 -3
- package/dist/prosemirror/schema/marks.d.ts +47 -4
- package/dist/prosemirror/schema/nodes.d.ts +309 -26
- package/dist/prosemirror/schema/nodes.js +16 -1
- package/dist/prosemirror/sectionCarrier.d.ts +37 -0
- package/dist/prosemirror/sectionCarrier.js +40 -0
- package/dist/prosemirror/selectionState.d.ts +3 -0
- package/dist/prosemirror/selectionState.js +4 -1
- package/dist/prosemirror/styles/resolvedStyleAttrs.d.ts +5 -4
- package/dist/prosemirror/styles/resolvedStyleAttrs.js +15 -13
- package/dist/prosemirror/tableResize.js +5 -6
- package/dist/prosemirror/trackedRunInlineAtoms.d.ts +4 -0
- package/dist/prosemirror/trackedRunInlineAtoms.js +4 -0
- package/dist/prosemirror/utils/extractTrackedChanges.d.ts +10 -11
- package/dist/prosemirror/utils/extractTrackedChanges.js +109 -92
- package/dist/prosemirror/validation.js +31 -6
- package/dist/prosemirror/yjsDocumentMetadata.d.ts +73 -0
- package/dist/prosemirror/yjsDocumentMetadata.js +592 -0
- package/dist/prosemirror/zeroWidthAnchors.js +6 -0
- package/dist/render-dom/commentAnchorAttributes.d.ts +37 -0
- package/dist/render-dom/commentAnchorAttributes.js +54 -0
- package/dist/server.d.ts +3 -1
- package/dist/server.js +3 -1
- package/dist/style-sets/extract.js +4 -4
- package/dist/style-sets/stellaStyle.js +36 -23
- package/dist/types/colors.d.ts +2 -2
- package/dist/types/content.d.ts +2 -2
- package/dist/types/documentEnumValues.d.ts +53 -26
- package/dist/types/documentEnumValues.js +72 -174
- package/dist/types/formatting.d.ts +2 -2
- package/dist/types/index.d.ts +9 -2
- package/dist/utils/borderCss.d.ts +246 -0
- package/dist/utils/borderCss.js +325 -0
- package/dist/utils/clipboard.d.ts +9 -1
- package/dist/utils/clipboard.js +27 -1
- package/dist/utils/colorResolver.d.ts +4 -3
- package/dist/utils/colorResolver.js +45 -76
- package/dist/utils/createDocument.js +24 -6
- package/dist/utils/findReplace.js +52 -10
- package/dist/utils/formatToStyle.d.ts +84 -2
- package/dist/utils/formatToStyle.js +133 -52
- package/dist/utils/headingCollector.js +3 -2
- package/dist/utils/imageLuminance.d.ts +15 -0
- package/dist/utils/imageLuminance.js +32 -0
- package/dist/utils/mergeDocumentContent.js +12 -20
- package/dist/utils/paragraphFormattingMerge.js +27 -6
- package/dist/utils/replaceText.js +1 -0
- package/dist/utils/tableOperations.d.ts +5 -3
- package/dist/utils/tableOperations.js +14 -1
- package/dist/utils/tablePlacement.d.ts +7 -0
- package/dist/utils/tablePlacement.js +14 -0
- package/dist/utils/textDirectionFlow.d.ts +15 -0
- package/dist/utils/textDirectionFlow.js +38 -0
- package/dist/utils/textFormattingMerge.js +16 -4
- package/package.json +10 -10
- package/dist/ai-edits/__fixtures__/paragraphs.d.ts +0 -17
- package/dist/ai-edits/__fixtures__/paragraphs.js +0 -33
- package/dist/compare/__fixtures__/body-sequence.d.ts +0 -119
- package/dist/compare/__fixtures__/body-sequence.js +0 -225
- package/dist/compare/__fixtures__/nested-table.d.ts +0 -16
- package/dist/compare/__fixtures__/nested-table.js +0 -50
- package/dist/compare/__fixtures__/numbered-list.d.ts +0 -34
- package/dist/compare/__fixtures__/numbered-list.js +0 -85
- package/dist/docx/blockRangeMarkers.d.ts +0 -36
- package/dist/docx/blockRangeMarkers.js +0 -59
- package/dist/docx/bookmarkPlacement.d.ts +0 -9
- package/dist/docx/bookmarkPlacement.js +0 -50
- package/dist/fonts/embeddedFontTable.d.ts +0 -45
- package/dist/fonts/embeddedFontTable.js +0 -80
- package/dist/prosemirror/extensions/marks/PageBreakRunOwnerExtension.d.ts +0 -13
- package/dist/prosemirror/extensions/marks/PageBreakRunOwnerExtension.js +0 -39
- package/dist/prosemirror/yjsParagraphSourceContract.d.ts +0 -9
- package/dist/prosemirror/yjsParagraphSourceContract.js +0 -26
|
@@ -0,0 +1,208 @@
|
|
|
1
|
+
import { XmlElement } from "./xmlParser.js";
|
|
2
|
+
import { DeclaredChild, DispatchedContainer } from "./containerChildren.gen.js";
|
|
3
|
+
import { PreservedChild, PreservedMarkup } from "@stll/docx-core/model";
|
|
4
|
+
import { SequenceContainer } from "@stll/docx-core/schema";
|
|
5
|
+
//#region src/docx/containerChildren.d.ts
|
|
6
|
+
/** Keep this child's markup verbatim, in place. */
|
|
7
|
+
declare const CAPTURE = "capture";
|
|
8
|
+
/**
|
|
9
|
+
* What a handler answers with: nothing when it took a typed value, and
|
|
10
|
+
* {@link CAPTURE} when it took none, so the child's bytes are kept instead.
|
|
11
|
+
*
|
|
12
|
+
* `<w:tblLayout/>` states no layout and `<w:jc w:val="end"/>` states a value a
|
|
13
|
+
* reader's enumeration does not admit. Both used to fall off the end of the
|
|
14
|
+
* walk, and neither can be decided by name: a map keyed by name cannot list
|
|
15
|
+
* the values a reader will refuse, only the names it has never heard of.
|
|
16
|
+
*/
|
|
17
|
+
declare const keptUnless: (taken: boolean) => typeof CAPTURE | undefined;
|
|
18
|
+
declare const OWNED_ELSEWHERE = "owned-elsewhere";
|
|
19
|
+
/**
|
|
20
|
+
* Who reads a child this walk skips: `<module>#<export>`.
|
|
21
|
+
*
|
|
22
|
+
* The module is a file under `packages/core/src/docx/` without its extension,
|
|
23
|
+
* and the export is the function that reads the child off the container
|
|
24
|
+
* element. Both halves are resolved by `scripts/container-ownership.test.ts`,
|
|
25
|
+
* which imports every one of them.
|
|
26
|
+
*/
|
|
27
|
+
type ChildOwnerRef = `${string}#${string}`;
|
|
28
|
+
/**
|
|
29
|
+
* Another reader owns this child, and re-emits it.
|
|
30
|
+
*
|
|
31
|
+
* `w:rPr` under a run, read by `parseRunProperties`; `w:commentReference`
|
|
32
|
+
* under a run, lifted out by the paragraph parser. Capturing one of these as
|
|
33
|
+
* well would write it twice, so the disposition has to be stated rather than
|
|
34
|
+
* left to a bare `break`.
|
|
35
|
+
*
|
|
36
|
+
* A capture and a handler are verified by running them: the survival law
|
|
37
|
+
* exercises the pair and reports what came back. This one is a claim about a
|
|
38
|
+
* *different module*, and nothing ran it. `w:tr/w:tblPrEx` carried it while
|
|
39
|
+
* the container contract recorded the same pair as never parsed, and the two
|
|
40
|
+
* statements sat side by side without contradicting each other. So the claim
|
|
41
|
+
* names its owner, `ownedElsewhere` registers it where a check can read it,
|
|
42
|
+
* and `scripts/lib/container-survival/ownership.ts` refuses a contract that
|
|
43
|
+
* records an owned pair as never parsed or lost with its container.
|
|
44
|
+
*
|
|
45
|
+
* The container and the child are on the value rather than inferred from the
|
|
46
|
+
* key, and {@link ChildHandlers} binds them to it: an entry that names a child
|
|
47
|
+
* other than the one it is filed under does not compile.
|
|
48
|
+
*/
|
|
49
|
+
type OwnedElsewhere<Container extends DispatchedContainer = DispatchedContainer, Child extends string = string> = {
|
|
50
|
+
readonly disposition: typeof OWNED_ELSEWHERE;
|
|
51
|
+
readonly container: Container;
|
|
52
|
+
readonly child: Child;
|
|
53
|
+
readonly reader: ChildOwnerRef;
|
|
54
|
+
};
|
|
55
|
+
/** One handler map's claim that another reader owns one of its children. */
|
|
56
|
+
type ChildOwnerClaim = {
|
|
57
|
+
readonly container: DispatchedContainer;
|
|
58
|
+
readonly child: string;
|
|
59
|
+
readonly reader: ChildOwnerRef;
|
|
60
|
+
};
|
|
61
|
+
/**
|
|
62
|
+
* Every owner a handler map has claimed so far.
|
|
63
|
+
*
|
|
64
|
+
* A claim is registered when `ownedElsewhere` is called, so a module that is
|
|
65
|
+
* never imported contributes none. The checks that read this therefore load
|
|
66
|
+
* the claiming modules first, by scanning the sources for the call rather than
|
|
67
|
+
* by keeping a list beside them.
|
|
68
|
+
*/
|
|
69
|
+
declare const ownedElsewhereClaims: () => readonly ChildOwnerClaim[];
|
|
70
|
+
/** State that another reader takes this child, and who. */
|
|
71
|
+
declare const ownedElsewhere: <Container extends DispatchedContainer, Child extends DeclaredChild<Container>>(claim: ChildOwnerClaim & {
|
|
72
|
+
container: Container;
|
|
73
|
+
child: Child;
|
|
74
|
+
}) => OwnedElsewhere<Container, Child>;
|
|
75
|
+
/**
|
|
76
|
+
* This child goes with the wrapper folio does not keep.
|
|
77
|
+
*
|
|
78
|
+
* `w:smartTagPr` is the case: folio unwraps `w:smartTag` and splices its
|
|
79
|
+
* content into the paragraph, so the properties describing the wrapper have
|
|
80
|
+
* nothing left to describe and capturing them would put a `w:smartTagPr`
|
|
81
|
+
* where the schema does not admit one. The drop is stated here and recorded
|
|
82
|
+
* in `specifications/container-contract/contract.json`, which is the whole
|
|
83
|
+
* difference between this and a `default` that says nothing.
|
|
84
|
+
*/
|
|
85
|
+
declare const DROPPED_WITH_ITS_WRAPPER = "dropped-with-its-wrapper";
|
|
86
|
+
/**
|
|
87
|
+
* What a container does with one declared child.
|
|
88
|
+
*
|
|
89
|
+
* A handler that reads the child may hand it back by returning {@link CAPTURE}
|
|
90
|
+
* — "I looked and took nothing from this, so keep the bytes". A property set
|
|
91
|
+
* needs it: `<w:cols/>` states no column count, `<w:jc w:val="end"/>` states a
|
|
92
|
+
* value the reader's enumeration does not admit, and a handler that turns
|
|
93
|
+
* neither into a typed value leaves the element with nowhere to go. Deciding
|
|
94
|
+
* it by the outcome rather than by the name is what makes the decision total:
|
|
95
|
+
* the map cannot list the values a reader will refuse.
|
|
96
|
+
*/
|
|
97
|
+
type ChildDisposition<Container extends DispatchedContainer = DispatchedContainer, Child extends string = string> = ((child: XmlElement) => typeof CAPTURE | void) | typeof CAPTURE | typeof DROPPED_WITH_ITS_WRAPPER | OwnedElsewhere<Container, Child>;
|
|
98
|
+
/**
|
|
99
|
+
* A total decision per declared child.
|
|
100
|
+
*
|
|
101
|
+
* Total, never `Partial`: a partial map lets a new declared child land without
|
|
102
|
+
* a decision, which is the drop this module exists to prevent. The value's
|
|
103
|
+
* type is keyed by the child it is filed under, so an {@link ownedElsewhere}
|
|
104
|
+
* entry cannot name a different child than the one it decides.
|
|
105
|
+
*/
|
|
106
|
+
type ChildHandlers<Container extends DispatchedContainer> = Readonly<{ [Child in DeclaredChild<Container>]: ChildDisposition<Container, Child>; }>;
|
|
107
|
+
type DispatchChildrenOptions<Container extends DispatchedContainer> = {
|
|
108
|
+
/** The container element, as the source wrote it. */
|
|
109
|
+
element: XmlElement;
|
|
110
|
+
/** Which container's declared-child set the handler map must be total over. */
|
|
111
|
+
container: Container;
|
|
112
|
+
handlers: ChildHandlers<Container>;
|
|
113
|
+
/**
|
|
114
|
+
* Where a capture belongs among the caller's children, called once per
|
|
115
|
+
* captured child.
|
|
116
|
+
*
|
|
117
|
+
* A container that models one kind of child answers with how many it holds
|
|
118
|
+
* right now, so the capture lands after the siblings already read. A
|
|
119
|
+
* container whose content model is a fixed sequence answers with the child's
|
|
120
|
+
* own ordinal in that sequence, because there the position is decided by the
|
|
121
|
+
* name rather than by what happened to be read first; see
|
|
122
|
+
* {@link sequencePositions}.
|
|
123
|
+
*/
|
|
124
|
+
capturePosition: (child: XmlElement) => number;
|
|
125
|
+
/**
|
|
126
|
+
* Dispositions for names the container's content model does not declare.
|
|
127
|
+
*
|
|
128
|
+
* The schema declares a container's children in one namespace, so anything
|
|
129
|
+
* else is undeclared by construction — which is why the sink is the default
|
|
130
|
+
* and why this map is not part of the totality check: there is no finite set
|
|
131
|
+
* to be total over. `mc:AlternateContent` is the case that needs it. It is
|
|
132
|
+
* markup compatibility, legal wherever its fallback is, and folio models it
|
|
133
|
+
* by selecting a branch and reading that; capturing the wrapper whole would
|
|
134
|
+
* keep the bytes and lose every paragraph inside it to the editor.
|
|
135
|
+
*
|
|
136
|
+
* Each entry is a claim that folio reads this name in this container.
|
|
137
|
+
*/
|
|
138
|
+
undeclared?: Readonly<Record<string, ChildDisposition>>;
|
|
139
|
+
/**
|
|
140
|
+
* Dispositions for whole namespaces the declared set does not cover, by
|
|
141
|
+
* namespace URI, consulted after {@link undeclared} and before the sink.
|
|
142
|
+
*
|
|
143
|
+
* OOXML maths is the case. `m:EG_OMathMathElements` is admitted wherever
|
|
144
|
+
* `m:oMath` is, so `<w:ins><m:f/></w:ins>` is a tracked insertion of a
|
|
145
|
+
* fraction with no `m:oMath` around it; there are two dozen such names and
|
|
146
|
+
* folio treats every one of them the same way, as markup it carries rather
|
|
147
|
+
* than a structure it models. Naming the namespace states that once. It is
|
|
148
|
+
* not a `default` in disguise: a child from any *other* namespace still goes
|
|
149
|
+
* to the sink, which is the branch a hand-written `default` gets wrong.
|
|
150
|
+
*/
|
|
151
|
+
undeclaredNamespaces?: Readonly<Record<string, ChildDisposition>>;
|
|
152
|
+
};
|
|
153
|
+
/**
|
|
154
|
+
* The Transitional spelling of a namespace, so one disposition covers both.
|
|
155
|
+
*
|
|
156
|
+
* ISO Strict writes the same content model under its own URIs: maths is
|
|
157
|
+
* `purl.oclc.org/ooxml/officeDocument/math` rather than
|
|
158
|
+
* `schemas.openxmlformats.org/officeDocument/2006/math`. A namespace-keyed
|
|
159
|
+
* disposition written in Transitional would otherwise send a Strict
|
|
160
|
+
* document's maths to the sink, which models it as bytes instead of an
|
|
161
|
+
* equation. The pairs come from the generated table rather than a second list
|
|
162
|
+
* here, so a namespace cannot be paired in one place and forgotten in the
|
|
163
|
+
* other.
|
|
164
|
+
*/
|
|
165
|
+
declare const transitionalNamespaceOf: (namespace: string) => string;
|
|
166
|
+
/**
|
|
167
|
+
* Walk a container's children, handing each to its handler and the rest to the
|
|
168
|
+
* sink.
|
|
169
|
+
*
|
|
170
|
+
* @returns the container's unmodelled markup, or `undefined` when it held
|
|
171
|
+
* none — an empty record is never written, so a fully modelled container
|
|
172
|
+
* stays byte-identical in the model.
|
|
173
|
+
*/
|
|
174
|
+
declare const dispatchChildren: <Container extends DispatchedContainer>({ element, handlers, capturePosition, undeclared, undeclaredNamespaces }: DispatchChildrenOptions<Container>) => PreservedMarkup | undefined;
|
|
175
|
+
/**
|
|
176
|
+
* Put a container's modelled children back with its preserved ones between
|
|
177
|
+
* them, in source position.
|
|
178
|
+
*
|
|
179
|
+
* Where the content model demands schema order the caller has already put its
|
|
180
|
+
* modelled children in that order; the sink's `index` then places each capture
|
|
181
|
+
* between the same two siblings it sat between when it was read.
|
|
182
|
+
*
|
|
183
|
+
* @param wrap turns one capture's markup into whatever the caller's list holds
|
|
184
|
+
*/
|
|
185
|
+
declare const withPreservedChildren: <Item, Child extends PreservedChild = PreservedChild>(modelled: readonly Item[], preserved: {
|
|
186
|
+
children?: Child[];
|
|
187
|
+
} | undefined, wrap: (xml: string, child: Child) => Item) => Item[];
|
|
188
|
+
/** {@link withPreservedChildren} for a caller that already holds markup. */
|
|
189
|
+
declare const serializeWithPreservedChildren: (modelled: readonly string[], preserved: PreservedMarkup | undefined) => string;
|
|
190
|
+
/**
|
|
191
|
+
* Where each child sits in a container whose content model is one flat sequence.
|
|
192
|
+
*
|
|
193
|
+
* A property set is that container: `CT_TblPr` and `CT_SectPr` are sequences
|
|
194
|
+
* of optional singletons, so a child's position is a property of its name and
|
|
195
|
+
* the generated list is the order. That is what the sink records for them,
|
|
196
|
+
* rather than a count of modelled siblings: the count is a mirror of whichever
|
|
197
|
+
* properties folio models today, and it moves under the capture the moment one
|
|
198
|
+
* more of them is modelled.
|
|
199
|
+
*
|
|
200
|
+
* An undeclared child — a foreign namespace, an `mc:` construct, a name a
|
|
201
|
+
* later revision of the format adds — has no place in the sequence, so it
|
|
202
|
+
* takes the place of the last declared child before it and comes back beside
|
|
203
|
+
* the same neighbour. One before every declared child takes position `-1`,
|
|
204
|
+
* ahead of the sequence's first slot.
|
|
205
|
+
*/
|
|
206
|
+
declare const sequencePositions: <Container extends SequenceContainer>(container: Container, element: XmlElement) => ((child: XmlElement) => number);
|
|
207
|
+
//#endregion
|
|
208
|
+
export { CAPTURE, ChildDisposition, ChildHandlers, ChildOwnerClaim, ChildOwnerRef, DROPPED_WITH_ITS_WRAPPER, OwnedElsewhere, dispatchChildren, keptUnless, ownedElsewhere, ownedElsewhereClaims, sequencePositions, serializeWithPreservedChildren, transitionalNamespaceOf, withPreservedChildren };
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
//#region src/docx/containerChildren.gen.d.ts
|
|
2
|
+
/**
|
|
3
|
+
* GENERATED FILE — do not edit.
|
|
4
|
+
*
|
|
5
|
+
* Every child the Transitional content model declares for a container folio
|
|
6
|
+
* dispatches, derived from the committed schema graph by
|
|
7
|
+
* `scripts/generate-container-children.ts`. The shared child dispatcher makes
|
|
8
|
+
* a handler map total over these names, so a container cannot gain a declared
|
|
9
|
+
* child without somebody deciding whether it is modelled or captured.
|
|
10
|
+
* Regenerate with:
|
|
11
|
+
*
|
|
12
|
+
* bun run generate:container-children
|
|
13
|
+
*/
|
|
14
|
+
declare const CONTAINER_CHILDREN: {
|
|
15
|
+
readonly "w:numbering": readonly ["numPicBullet", "abstractNum", "num", "numIdMacAtCleanup"];
|
|
16
|
+
readonly "w:abstractNum": readonly ["nsid", "multiLevelType", "tmpl", "name", "styleLink", "numStyleLink", "lvl"];
|
|
17
|
+
readonly "w:lvl": readonly ["start", "numFmt", "lvlRestart", "pStyle", "isLgl", "suff", "lvlText", "lvlPicBulletId", "legacy", "lvlJc", "pPr", "rPr"];
|
|
18
|
+
readonly "w:num": readonly ["abstractNumId", "lvlOverride"];
|
|
19
|
+
readonly "w:lvlOverride": readonly ["startOverride", "lvl"];
|
|
20
|
+
readonly "paragraph-properties": readonly ["pStyle", "keepNext", "keepLines", "pageBreakBefore", "framePr", "widowControl", "numPr", "suppressLineNumbers", "pBdr", "shd", "tabs", "suppressAutoHyphens", "kinsoku", "wordWrap", "overflowPunct", "topLinePunct", "autoSpaceDE", "autoSpaceDN", "bidi", "adjustRightInd", "snapToGrid", "spacing", "ind", "contextualSpacing", "mirrorIndents", "suppressOverlap", "jc", "textDirection", "textAlignment", "textboxTightWrap", "outlineLvl", "divId", "cnfStyle", "rPr", "sectPr", "pPrChange"];
|
|
21
|
+
readonly "table-properties": readonly ["tblStyle", "tblpPr", "tblOverlap", "bidiVisual", "tblStyleRowBandSize", "tblStyleColBandSize", "tblW", "jc", "tblCellSpacing", "tblInd", "tblBorders", "shd", "tblLayout", "tblCellMar", "tblLook", "tblCaption", "tblDescription", "tblPrChange"];
|
|
22
|
+
readonly "table-property-exceptions": readonly ["tblW", "jc", "tblCellSpacing", "tblInd", "tblBorders", "shd", "tblLayout", "tblCellMar", "tblLook", "tblPrExChange"];
|
|
23
|
+
readonly "row-properties": readonly ["cnfStyle", "divId", "gridBefore", "gridAfter", "wBefore", "wAfter", "cantSplit", "trHeight", "tblHeader", "tblCellSpacing", "jc", "hidden", "ins", "del", "trPrChange"];
|
|
24
|
+
readonly "cell-properties": readonly ["cnfStyle", "tcW", "gridSpan", "hMerge", "vMerge", "tcBorders", "shd", "noWrap", "tcMar", "textDirection", "tcFitText", "vAlign", "hideMark", "headers", "cellIns", "cellDel", "cellMerge", "tcPrChange"];
|
|
25
|
+
readonly "run-properties": readonly ["ins", "del", "moveFrom", "moveTo", "rStyle", "rFonts", "b", "bCs", "i", "iCs", "caps", "smallCaps", "strike", "dstrike", "outline", "shadow", "emboss", "imprint", "noProof", "snapToGrid", "vanish", "webHidden", "color", "spacing", "w", "kern", "position", "sz", "szCs", "highlight", "u", "effect", "bdr", "shd", "fitText", "vertAlign", "rtl", "cs", "em", "lang", "eastAsianLayout", "specVanish", "oMath", "rPrChange"];
|
|
26
|
+
readonly "content-control-properties": readonly ["rPr", "alias", "tag", "id", "lock", "placeholder", "temporary", "showingPlcHdr", "dataBinding", "label", "tabIndex", "equation", "comboBox", "date", "docPartObj", "docPartList", "dropDownList", "picture", "richText", "text", "citation", "group", "bibliography"];
|
|
27
|
+
readonly "section-properties": readonly ["headerReference", "footerReference", "footnotePr", "endnotePr", "type", "pgSz", "pgMar", "paperSrc", "pgBorders", "lnNumType", "pgNumType", "cols", "formProt", "vAlign", "noEndnote", "titlePg", "textDirection", "bidi", "rtlGutter", "docGrid", "printerSettings", "sectPrChange"];
|
|
28
|
+
readonly "w:comment": readonly ["altChunk", "bookmarkEnd", "bookmarkStart", "commentRangeEnd", "commentRangeStart", "customXml", "customXmlDelRangeEnd", "customXmlDelRangeStart", "customXmlInsRangeEnd", "customXmlInsRangeStart", "customXmlMoveFromRangeEnd", "customXmlMoveFromRangeStart", "customXmlMoveToRangeEnd", "customXmlMoveToRangeStart", "del", "ins", "moveFrom", "moveFromRangeEnd", "moveFromRangeStart", "moveTo", "moveToRangeEnd", "moveToRangeStart", "p", "permEnd", "permStart", "proofErr", "sdt", "tbl"];
|
|
29
|
+
readonly "run-level-content": readonly ["bdo", "bookmarkEnd", "bookmarkStart", "commentRangeEnd", "commentRangeStart", "customXml", "customXmlDelRangeEnd", "customXmlDelRangeStart", "customXmlInsRangeEnd", "customXmlInsRangeStart", "customXmlMoveFromRangeEnd", "customXmlMoveFromRangeStart", "customXmlMoveToRangeEnd", "customXmlMoveToRangeStart", "customXmlPr", "del", "dir", "fldSimple", "hyperlink", "ins", "moveFrom", "moveFromRangeEnd", "moveFromRangeStart", "moveTo", "moveToRangeEnd", "moveToRangeStart", "pPr", "permEnd", "permStart", "proofErr", "r", "sdt", "smartTag", "smartTagPr", "subDoc"];
|
|
30
|
+
readonly "table-content": readonly ["bookmarkEnd", "bookmarkStart", "commentRangeEnd", "commentRangeStart", "customXml", "customXmlDelRangeEnd", "customXmlDelRangeStart", "customXmlInsRangeEnd", "customXmlInsRangeStart", "customXmlMoveFromRangeEnd", "customXmlMoveFromRangeStart", "customXmlMoveToRangeEnd", "customXmlMoveToRangeStart", "customXmlPr", "del", "ins", "moveFrom", "moveFromRangeEnd", "moveFromRangeStart", "moveTo", "moveToRangeEnd", "moveToRangeStart", "permEnd", "permStart", "proofErr", "sdt", "tblGrid", "tblPr", "tr"];
|
|
31
|
+
readonly "row-content": readonly ["bookmarkEnd", "bookmarkStart", "commentRangeEnd", "commentRangeStart", "customXml", "customXmlDelRangeEnd", "customXmlDelRangeStart", "customXmlInsRangeEnd", "customXmlInsRangeStart", "customXmlMoveFromRangeEnd", "customXmlMoveFromRangeStart", "customXmlMoveToRangeEnd", "customXmlMoveToRangeStart", "del", "ins", "moveFrom", "moveFromRangeEnd", "moveFromRangeStart", "moveTo", "moveToRangeEnd", "moveToRangeStart", "permEnd", "permStart", "proofErr", "sdt", "tblPrEx", "tc", "tr", "trPr"];
|
|
32
|
+
readonly "w:fonts": readonly ["font"];
|
|
33
|
+
readonly "w:font": readonly ["altName", "charset", "embedBold", "embedBoldItalic", "embedItalic", "embedRegular", "family", "notTrueType", "panose1", "pitch", "sig"];
|
|
34
|
+
readonly "w:hyperlink": readonly ["bdo", "bookmarkEnd", "bookmarkStart", "commentRangeEnd", "commentRangeStart", "customXml", "customXmlDelRangeEnd", "customXmlDelRangeStart", "customXmlInsRangeEnd", "customXmlInsRangeStart", "customXmlMoveFromRangeEnd", "customXmlMoveFromRangeStart", "customXmlMoveToRangeEnd", "customXmlMoveToRangeStart", "del", "dir", "fldSimple", "hyperlink", "ins", "moveFrom", "moveFromRangeEnd", "moveFromRangeStart", "moveTo", "moveToRangeEnd", "moveToRangeStart", "permEnd", "permStart", "proofErr", "r", "sdt", "smartTag", "subDoc"];
|
|
35
|
+
readonly "w:fldSimple": readonly ["bdo", "bookmarkEnd", "bookmarkStart", "commentRangeEnd", "commentRangeStart", "customXml", "customXmlDelRangeEnd", "customXmlDelRangeStart", "customXmlInsRangeEnd", "customXmlInsRangeStart", "customXmlMoveFromRangeEnd", "customXmlMoveFromRangeStart", "customXmlMoveToRangeEnd", "customXmlMoveToRangeStart", "del", "dir", "fldData", "fldSimple", "hyperlink", "ins", "moveFrom", "moveFromRangeEnd", "moveFromRangeStart", "moveTo", "moveToRangeEnd", "moveToRangeStart", "permEnd", "permStart", "proofErr", "r", "sdt", "smartTag", "subDoc"];
|
|
36
|
+
readonly "block-content": readonly ["altChunk", "bookmarkEnd", "bookmarkStart", "commentRangeEnd", "commentRangeStart", "customXml", "customXmlDelRangeEnd", "customXmlDelRangeStart", "customXmlInsRangeEnd", "customXmlInsRangeStart", "customXmlMoveFromRangeEnd", "customXmlMoveFromRangeStart", "customXmlMoveToRangeEnd", "customXmlMoveToRangeStart", "del", "ins", "moveFrom", "moveFromRangeEnd", "moveFromRangeStart", "moveTo", "moveToRangeEnd", "moveToRangeStart", "p", "permEnd", "permStart", "proofErr", "sdt", "sectPr", "tbl", "tcPr"];
|
|
37
|
+
};
|
|
38
|
+
/** A container the shared child dispatcher covers. */
|
|
39
|
+
type DispatchedContainer = keyof typeof CONTAINER_CHILDREN;
|
|
40
|
+
/** Every child name the schema declares for `Container`. */
|
|
41
|
+
type DeclaredChild<Container extends DispatchedContainer> = (typeof CONTAINER_CHILDREN)[Container][number];
|
|
42
|
+
//#endregion
|
|
43
|
+
export { CONTAINER_CHILDREN, DeclaredChild, DispatchedContainer };
|
|
@@ -0,0 +1,263 @@
|
|
|
1
|
+
import { SEQUENCE_CHILDREN } from "@stll/docx-core/schema";
|
|
2
|
+
//#region src/docx/containerChildren.gen.ts
|
|
3
|
+
/**
|
|
4
|
+
* GENERATED FILE — do not edit.
|
|
5
|
+
*
|
|
6
|
+
* Every child the Transitional content model declares for a container folio
|
|
7
|
+
* dispatches, derived from the committed schema graph by
|
|
8
|
+
* `scripts/generate-container-children.ts`. The shared child dispatcher makes
|
|
9
|
+
* a handler map total over these names, so a container cannot gain a declared
|
|
10
|
+
* child without somebody deciding whether it is modelled or captured.
|
|
11
|
+
* Regenerate with:
|
|
12
|
+
*
|
|
13
|
+
* bun run generate:container-children
|
|
14
|
+
*/
|
|
15
|
+
const CONTAINER_CHILDREN = {
|
|
16
|
+
"w:comment": [
|
|
17
|
+
"altChunk",
|
|
18
|
+
"bookmarkEnd",
|
|
19
|
+
"bookmarkStart",
|
|
20
|
+
"commentRangeEnd",
|
|
21
|
+
"commentRangeStart",
|
|
22
|
+
"customXml",
|
|
23
|
+
"customXmlDelRangeEnd",
|
|
24
|
+
"customXmlDelRangeStart",
|
|
25
|
+
"customXmlInsRangeEnd",
|
|
26
|
+
"customXmlInsRangeStart",
|
|
27
|
+
"customXmlMoveFromRangeEnd",
|
|
28
|
+
"customXmlMoveFromRangeStart",
|
|
29
|
+
"customXmlMoveToRangeEnd",
|
|
30
|
+
"customXmlMoveToRangeStart",
|
|
31
|
+
"del",
|
|
32
|
+
"ins",
|
|
33
|
+
"moveFrom",
|
|
34
|
+
"moveFromRangeEnd",
|
|
35
|
+
"moveFromRangeStart",
|
|
36
|
+
"moveTo",
|
|
37
|
+
"moveToRangeEnd",
|
|
38
|
+
"moveToRangeStart",
|
|
39
|
+
"p",
|
|
40
|
+
"permEnd",
|
|
41
|
+
"permStart",
|
|
42
|
+
"proofErr",
|
|
43
|
+
"sdt",
|
|
44
|
+
"tbl"
|
|
45
|
+
],
|
|
46
|
+
"run-level-content": [
|
|
47
|
+
"bdo",
|
|
48
|
+
"bookmarkEnd",
|
|
49
|
+
"bookmarkStart",
|
|
50
|
+
"commentRangeEnd",
|
|
51
|
+
"commentRangeStart",
|
|
52
|
+
"customXml",
|
|
53
|
+
"customXmlDelRangeEnd",
|
|
54
|
+
"customXmlDelRangeStart",
|
|
55
|
+
"customXmlInsRangeEnd",
|
|
56
|
+
"customXmlInsRangeStart",
|
|
57
|
+
"customXmlMoveFromRangeEnd",
|
|
58
|
+
"customXmlMoveFromRangeStart",
|
|
59
|
+
"customXmlMoveToRangeEnd",
|
|
60
|
+
"customXmlMoveToRangeStart",
|
|
61
|
+
"customXmlPr",
|
|
62
|
+
"del",
|
|
63
|
+
"dir",
|
|
64
|
+
"fldSimple",
|
|
65
|
+
"hyperlink",
|
|
66
|
+
"ins",
|
|
67
|
+
"moveFrom",
|
|
68
|
+
"moveFromRangeEnd",
|
|
69
|
+
"moveFromRangeStart",
|
|
70
|
+
"moveTo",
|
|
71
|
+
"moveToRangeEnd",
|
|
72
|
+
"moveToRangeStart",
|
|
73
|
+
"pPr",
|
|
74
|
+
"permEnd",
|
|
75
|
+
"permStart",
|
|
76
|
+
"proofErr",
|
|
77
|
+
"r",
|
|
78
|
+
"sdt",
|
|
79
|
+
"smartTag",
|
|
80
|
+
"smartTagPr",
|
|
81
|
+
"subDoc"
|
|
82
|
+
],
|
|
83
|
+
"table-content": [
|
|
84
|
+
"bookmarkEnd",
|
|
85
|
+
"bookmarkStart",
|
|
86
|
+
"commentRangeEnd",
|
|
87
|
+
"commentRangeStart",
|
|
88
|
+
"customXml",
|
|
89
|
+
"customXmlDelRangeEnd",
|
|
90
|
+
"customXmlDelRangeStart",
|
|
91
|
+
"customXmlInsRangeEnd",
|
|
92
|
+
"customXmlInsRangeStart",
|
|
93
|
+
"customXmlMoveFromRangeEnd",
|
|
94
|
+
"customXmlMoveFromRangeStart",
|
|
95
|
+
"customXmlMoveToRangeEnd",
|
|
96
|
+
"customXmlMoveToRangeStart",
|
|
97
|
+
"customXmlPr",
|
|
98
|
+
"del",
|
|
99
|
+
"ins",
|
|
100
|
+
"moveFrom",
|
|
101
|
+
"moveFromRangeEnd",
|
|
102
|
+
"moveFromRangeStart",
|
|
103
|
+
"moveTo",
|
|
104
|
+
"moveToRangeEnd",
|
|
105
|
+
"moveToRangeStart",
|
|
106
|
+
"permEnd",
|
|
107
|
+
"permStart",
|
|
108
|
+
"proofErr",
|
|
109
|
+
"sdt",
|
|
110
|
+
"tblGrid",
|
|
111
|
+
"tblPr",
|
|
112
|
+
"tr"
|
|
113
|
+
],
|
|
114
|
+
"row-content": [
|
|
115
|
+
"bookmarkEnd",
|
|
116
|
+
"bookmarkStart",
|
|
117
|
+
"commentRangeEnd",
|
|
118
|
+
"commentRangeStart",
|
|
119
|
+
"customXml",
|
|
120
|
+
"customXmlDelRangeEnd",
|
|
121
|
+
"customXmlDelRangeStart",
|
|
122
|
+
"customXmlInsRangeEnd",
|
|
123
|
+
"customXmlInsRangeStart",
|
|
124
|
+
"customXmlMoveFromRangeEnd",
|
|
125
|
+
"customXmlMoveFromRangeStart",
|
|
126
|
+
"customXmlMoveToRangeEnd",
|
|
127
|
+
"customXmlMoveToRangeStart",
|
|
128
|
+
"del",
|
|
129
|
+
"ins",
|
|
130
|
+
"moveFrom",
|
|
131
|
+
"moveFromRangeEnd",
|
|
132
|
+
"moveFromRangeStart",
|
|
133
|
+
"moveTo",
|
|
134
|
+
"moveToRangeEnd",
|
|
135
|
+
"moveToRangeStart",
|
|
136
|
+
"permEnd",
|
|
137
|
+
"permStart",
|
|
138
|
+
"proofErr",
|
|
139
|
+
"sdt",
|
|
140
|
+
"tblPrEx",
|
|
141
|
+
"tc",
|
|
142
|
+
"tr",
|
|
143
|
+
"trPr"
|
|
144
|
+
],
|
|
145
|
+
"w:fonts": ["font"],
|
|
146
|
+
"w:font": [
|
|
147
|
+
"altName",
|
|
148
|
+
"charset",
|
|
149
|
+
"embedBold",
|
|
150
|
+
"embedBoldItalic",
|
|
151
|
+
"embedItalic",
|
|
152
|
+
"embedRegular",
|
|
153
|
+
"family",
|
|
154
|
+
"notTrueType",
|
|
155
|
+
"panose1",
|
|
156
|
+
"pitch",
|
|
157
|
+
"sig"
|
|
158
|
+
],
|
|
159
|
+
"w:hyperlink": [
|
|
160
|
+
"bdo",
|
|
161
|
+
"bookmarkEnd",
|
|
162
|
+
"bookmarkStart",
|
|
163
|
+
"commentRangeEnd",
|
|
164
|
+
"commentRangeStart",
|
|
165
|
+
"customXml",
|
|
166
|
+
"customXmlDelRangeEnd",
|
|
167
|
+
"customXmlDelRangeStart",
|
|
168
|
+
"customXmlInsRangeEnd",
|
|
169
|
+
"customXmlInsRangeStart",
|
|
170
|
+
"customXmlMoveFromRangeEnd",
|
|
171
|
+
"customXmlMoveFromRangeStart",
|
|
172
|
+
"customXmlMoveToRangeEnd",
|
|
173
|
+
"customXmlMoveToRangeStart",
|
|
174
|
+
"del",
|
|
175
|
+
"dir",
|
|
176
|
+
"fldSimple",
|
|
177
|
+
"hyperlink",
|
|
178
|
+
"ins",
|
|
179
|
+
"moveFrom",
|
|
180
|
+
"moveFromRangeEnd",
|
|
181
|
+
"moveFromRangeStart",
|
|
182
|
+
"moveTo",
|
|
183
|
+
"moveToRangeEnd",
|
|
184
|
+
"moveToRangeStart",
|
|
185
|
+
"permEnd",
|
|
186
|
+
"permStart",
|
|
187
|
+
"proofErr",
|
|
188
|
+
"r",
|
|
189
|
+
"sdt",
|
|
190
|
+
"smartTag",
|
|
191
|
+
"subDoc"
|
|
192
|
+
],
|
|
193
|
+
"w:fldSimple": [
|
|
194
|
+
"bdo",
|
|
195
|
+
"bookmarkEnd",
|
|
196
|
+
"bookmarkStart",
|
|
197
|
+
"commentRangeEnd",
|
|
198
|
+
"commentRangeStart",
|
|
199
|
+
"customXml",
|
|
200
|
+
"customXmlDelRangeEnd",
|
|
201
|
+
"customXmlDelRangeStart",
|
|
202
|
+
"customXmlInsRangeEnd",
|
|
203
|
+
"customXmlInsRangeStart",
|
|
204
|
+
"customXmlMoveFromRangeEnd",
|
|
205
|
+
"customXmlMoveFromRangeStart",
|
|
206
|
+
"customXmlMoveToRangeEnd",
|
|
207
|
+
"customXmlMoveToRangeStart",
|
|
208
|
+
"del",
|
|
209
|
+
"dir",
|
|
210
|
+
"fldData",
|
|
211
|
+
"fldSimple",
|
|
212
|
+
"hyperlink",
|
|
213
|
+
"ins",
|
|
214
|
+
"moveFrom",
|
|
215
|
+
"moveFromRangeEnd",
|
|
216
|
+
"moveFromRangeStart",
|
|
217
|
+
"moveTo",
|
|
218
|
+
"moveToRangeEnd",
|
|
219
|
+
"moveToRangeStart",
|
|
220
|
+
"permEnd",
|
|
221
|
+
"permStart",
|
|
222
|
+
"proofErr",
|
|
223
|
+
"r",
|
|
224
|
+
"sdt",
|
|
225
|
+
"smartTag",
|
|
226
|
+
"subDoc"
|
|
227
|
+
],
|
|
228
|
+
"block-content": [
|
|
229
|
+
"altChunk",
|
|
230
|
+
"bookmarkEnd",
|
|
231
|
+
"bookmarkStart",
|
|
232
|
+
"commentRangeEnd",
|
|
233
|
+
"commentRangeStart",
|
|
234
|
+
"customXml",
|
|
235
|
+
"customXmlDelRangeEnd",
|
|
236
|
+
"customXmlDelRangeStart",
|
|
237
|
+
"customXmlInsRangeEnd",
|
|
238
|
+
"customXmlInsRangeStart",
|
|
239
|
+
"customXmlMoveFromRangeEnd",
|
|
240
|
+
"customXmlMoveFromRangeStart",
|
|
241
|
+
"customXmlMoveToRangeEnd",
|
|
242
|
+
"customXmlMoveToRangeStart",
|
|
243
|
+
"del",
|
|
244
|
+
"ins",
|
|
245
|
+
"moveFrom",
|
|
246
|
+
"moveFromRangeEnd",
|
|
247
|
+
"moveFromRangeStart",
|
|
248
|
+
"moveTo",
|
|
249
|
+
"moveToRangeEnd",
|
|
250
|
+
"moveToRangeStart",
|
|
251
|
+
"p",
|
|
252
|
+
"permEnd",
|
|
253
|
+
"permStart",
|
|
254
|
+
"proofErr",
|
|
255
|
+
"sdt",
|
|
256
|
+
"sectPr",
|
|
257
|
+
"tbl",
|
|
258
|
+
"tcPr"
|
|
259
|
+
],
|
|
260
|
+
...SEQUENCE_CHILDREN
|
|
261
|
+
};
|
|
262
|
+
//#endregion
|
|
263
|
+
export { CONTAINER_CHILDREN };
|