@stll/folio-core 0.66.2 → 0.68.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.d.ts +9 -1
- package/dist/ai-edits/apply.js +138 -17
- package/dist/ai-edits/batch-claims.js +5 -3
- package/dist/ai-edits/clean-text.js +4 -1
- package/dist/ai-edits/headless.d.ts +36 -21
- package/dist/ai-edits/headless.js +104 -34
- package/dist/ai-edits/index.d.ts +2 -2
- package/dist/ai-edits/note-references.d.ts +6 -0
- package/dist/ai-edits/note-references.js +7 -1
- package/dist/ai-edits/read.d.ts +19 -0
- package/dist/ai-edits/read.js +6 -4
- package/dist/ai-edits/snapshot.d.ts +6 -0
- package/dist/ai-edits/snapshot.js +32 -17
- package/dist/ai-edits/table-cell-mutations.js +3 -2
- package/dist/ai-edits/table-row-column-mutations.js +20 -6
- package/dist/ai-edits/types.d.ts +9 -1
- package/dist/ai-suggestions/apply.js +13 -4
- package/dist/compare/compare.js +2 -1
- package/dist/compare/inserted-resource-snapshot.d.ts +4 -1
- package/dist/compare/inserted-resource-snapshot.js +7 -3
- package/dist/controller/canonicalClipboard.js +29 -12
- package/dist/controller/canonicalComposition.d.ts +1 -1
- package/dist/controller/canonicalComposition.js +77 -19
- package/dist/controller/canonicalInlineProjection.d.ts +35 -10
- package/dist/controller/canonicalInlineProjection.js +192 -28
- package/dist/controller/canonicalInput.d.ts +2 -2
- package/dist/controller/canonicalInput.js +47 -2
- package/dist/controller/canonicalListRendering.d.ts +2 -1
- package/dist/controller/canonicalListRendering.js +1 -1
- package/dist/controller/canonicalLockGuard.d.ts +8 -0
- package/dist/controller/canonicalLockGuard.js +88 -0
- package/dist/controller/canonicalPublicOperations.d.ts +12 -4
- package/dist/controller/canonicalPublicOperations.js +274 -20
- package/dist/controller/canonicalSession.d.ts +87 -7
- package/dist/controller/canonicalSession.js +328 -75
- package/dist/controller/canonicalStoryEditor.d.ts +3 -2
- package/dist/controller/canonicalStoryEditor.js +4 -3
- package/dist/controller/canonicalStructure.d.ts +2 -1
- package/dist/controller/canonicalStructure.js +129 -7
- package/dist/controller/contentControlWidgetController.d.ts +5 -0
- package/dist/controller/contentControlWidgetController.js +13 -1
- package/dist/controller/folioEditor.js +1 -0
- package/dist/controller/headerFooterEditorManager.d.ts +2 -2
- package/dist/controller/headerFooterEditorManager.js +5 -5
- package/dist/controller/hiddenEditorApi.d.ts +6 -0
- package/dist/controller/hiddenEditorApi.js +1 -0
- package/dist/controller/hiddenEditorManager.d.ts +10 -3
- package/dist/controller/hiddenEditorManager.js +94 -38
- package/dist/controller/layoutPipeline.d.ts +2 -0
- package/dist/controller/layoutPipeline.js +55 -18
- package/dist/controller/layoutSession.d.ts +1 -0
- package/dist/controller/noteEditorManager.d.ts +2 -2
- package/dist/controller/noteEditorManager.js +5 -5
- package/dist/display-list/build/pageFurniture.js +41 -19
- package/dist/display-list/build/tablePrimitives.d.ts +3 -1
- package/dist/display-list/build/tablePrimitives.js +49 -14
- package/dist/display-list/dom/renderDisplayListToDom.js +4 -4
- package/dist/document-operations.d.ts +8 -0
- package/dist/document-operations.js +4 -3
- package/dist/docx/blockContentParser.d.ts +7 -3
- package/dist/docx/blockContentParser.js +2 -3
- package/dist/docx/blockPlainText.js +2 -0
- package/dist/docx/bookmarkRangeJoin.d.ts +6 -0
- package/dist/docx/bookmarkRangeJoin.js +43 -0
- package/dist/docx/canonicalSave.js +5 -1
- package/dist/docx/canonicalSessionInput.d.ts +5 -1
- package/dist/docx/canonicalSessionInput.js +7 -2
- package/dist/docx/chartPreview.d.ts +4 -1
- package/dist/docx/chartPreview.js +26 -15
- package/dist/docx/commentAnchorIndex.d.ts +21 -5
- package/dist/docx/commentAnchorIndex.js +39 -11
- package/dist/docx/commentRangeIntegrity.js +30 -24
- package/dist/docx/commentRangeJoin.d.ts +4 -0
- package/dist/docx/commentRangeJoin.js +26 -12
- package/dist/docx/commentReferenceCompletion.js +5 -4
- package/dist/docx/commentReferenceNormalization.js +40 -18
- package/dist/docx/compatibility.js +9 -2
- package/dist/docx/containerChildren.js +22 -1
- package/dist/docx/encryption/compoundFile.js +9 -1
- package/dist/docx/encryption/encryptionInfo.js +16 -2
- package/dist/docx/ensureParaIds.js +46 -7
- package/dist/docx/ensureUniqueControlIds.d.ts +25 -0
- package/dist/docx/ensureUniqueControlIds.js +110 -0
- package/dist/docx/headerFooterVerbatim.d.ts +7 -0
- package/dist/docx/headerFooterVerbatim.js +13 -2
- package/dist/docx/hostCommentThreads.d.ts +17 -0
- package/dist/docx/hostCommentThreads.js +49 -0
- package/dist/docx/hyperlinkParser.js +9 -2
- package/dist/docx/inlineWrapperContent.d.ts +8 -1
- package/dist/docx/inlineWrapperContent.js +9 -2
- package/dist/docx/listMarkerComputation.d.ts +35 -1
- package/dist/docx/listMarkerComputation.js +39 -1
- package/dist/docx/listModelNormalization.d.ts +44 -1
- package/dist/docx/listModelNormalization.js +227 -96
- package/dist/docx/mainDocumentPart.d.ts +6 -0
- package/dist/docx/mainDocumentPart.js +65 -0
- package/dist/docx/markupRangeMarker.d.ts +14 -0
- package/dist/docx/markupRangeMarker.js +15 -1
- package/dist/docx/metadataPrivacy.js +43 -22
- package/dist/docx/normalizeBaseDirection.js +3 -1
- package/dist/docx/packageParts.d.ts +1 -1
- package/dist/docx/packageParts.js +10 -4
- package/dist/docx/paragraphParser.js +159 -48
- package/dist/docx/paragraphPropertySource.d.ts +7 -0
- package/dist/docx/paragraphPropertySource.js +22 -1
- package/dist/docx/paragraphTextBoxEnrichment.js +2 -1
- package/dist/docx/paragraphTraversal.js +2 -0
- package/dist/docx/parseWarningMessage.js +2 -1
- package/dist/docx/parser.js +6 -0
- package/dist/docx/previewBudget.d.ts +6 -0
- package/dist/docx/previewBudget.js +7 -1
- package/dist/docx/renderedPageBreakNormalization.js +1 -1
- package/dist/docx/reviewProvenanceDiagnostics.d.ts +7 -0
- package/dist/docx/reviewProvenanceDiagnostics.js +39 -0
- package/dist/docx/reviewResolutionProvenance.d.ts +29 -3
- package/dist/docx/reviewResolutionProvenance.js +110 -25
- package/dist/docx/rezip.d.ts +6 -0
- package/dist/docx/rezip.js +42 -25
- package/dist/docx/selectiveSave.js +6 -10
- package/dist/docx/selectiveXmlPatch.d.ts +5 -4
- package/dist/docx/selectiveXmlPatch.js +11 -7
- package/dist/docx/serializer/documentSerializer.js +3 -1
- package/dist/docx/serializer/headerFooterSerializer.js +3 -1
- package/dist/docx/serializer/markupRangeAttributes.d.ts +6 -1
- package/dist/docx/serializer/markupRangeAttributes.js +6 -1
- package/dist/docx/serializer/noteSerializer.d.ts +17 -4
- package/dist/docx/serializer/noteSerializer.js +23 -16
- package/dist/docx/serializer/paragraphSerializer.js +56 -12
- package/dist/docx/serializer/runSerializer.d.ts +1 -3
- package/dist/docx/serializer/runSerializer.js +2 -2
- package/dist/docx/serializer/tableSerializer.d.ts +4 -0
- package/dist/docx/serializer/tableSerializer.js +4 -2
- package/dist/docx/server/applyDocxXmlPatchProposal.js +8 -4
- package/dist/docx/server/createBilingualDocument.js +27 -5
- package/dist/docx/server/migrateYjsAttrSchema.js +4 -0
- package/dist/docx/sessionListPruning.d.ts +2 -0
- package/dist/docx/sessionListPruning.js +50 -0
- package/dist/docx/shapeAlternateContent.js +19 -0
- package/dist/docx/splitRevisionPieces.d.ts +10 -0
- package/dist/docx/splitRevisionPieces.js +14 -0
- package/dist/docx/storyBlockReplay.js +4 -0
- package/dist/docx/structuralXmlPatch.js +19 -7
- package/dist/docx/tableParser.d.ts +6 -2
- package/dist/docx/tableParser.js +2 -3
- package/dist/docx/textBoxContentParser.d.ts +11 -0
- package/dist/docx/textBoxContentParser.js +51 -0
- package/dist/docx/textBoxParser.d.ts +0 -5
- package/dist/docx/textBoxParser.js +1 -23
- package/dist/docx/unzip.js +2 -0
- package/dist/docx/verticalMergeProjection.js +1 -1
- package/dist/fonts/fontsourceFaces.d.ts +2 -8
- package/dist/fonts/fontsourceFaces.js +1 -7
- package/dist/i18n/messages/ar.gen.js +3 -0
- package/dist/i18n/messages/catalogs.gen.d.ts +51 -0
- package/dist/i18n/messages/catalogs.gen.js +51 -0
- package/dist/i18n/messages/cs.gen.js +3 -0
- package/dist/i18n/messages/de.gen.js +3 -0
- package/dist/i18n/messages/en.gen.js +3 -0
- package/dist/i18n/messages/es.gen.js +3 -0
- package/dist/i18n/messages/et.gen.js +3 -0
- package/dist/i18n/messages/fr.gen.js +3 -0
- package/dist/i18n/messages/he.gen.js +3 -0
- package/dist/i18n/messages/hi.gen.js +3 -0
- package/dist/i18n/messages/hu.gen.js +3 -0
- package/dist/i18n/messages/lt.gen.js +3 -0
- package/dist/i18n/messages/lv.gen.js +3 -0
- package/dist/i18n/messages/messages.gen.d.ts +3 -0
- package/dist/i18n/messages/pl.gen.js +3 -0
- package/dist/i18n/messages/pt-BR.gen.js +3 -0
- package/dist/i18n/messages/sk.gen.js +3 -0
- package/dist/i18n/messages/tr.gen.js +3 -0
- package/dist/i18n/messages/zh-CN.gen.js +3 -0
- package/dist/internal/acceptedBlockProjection.js +2 -0
- package/dist/internal/pageBreakRunSourceDescendantIndex.d.ts +5 -0
- package/dist/internal/pageBreakRunSourceDescendantIndex.js +5 -0
- package/dist/internal/revisionResolutionInline.js +1 -2
- package/dist/internal/wholeStoryRevisionResolution.js +57 -12
- package/dist/layout-bridge/convert/altChunkPlaceholder.d.ts +10 -0
- package/dist/layout-bridge/convert/altChunkPlaceholder.js +70 -0
- package/dist/layout-bridge/convert/fixedTableColumnWidths.js +2 -1
- package/dist/layout-bridge/convert/flowConversionShared.d.ts +10 -0
- package/dist/layout-bridge/convert/flowConversionShared.js +11 -1
- package/dist/layout-bridge/convert/footnoteLayout.d.ts +1 -0
- package/dist/layout-bridge/convert/footnoteLayout.js +4 -1
- package/dist/layout-bridge/convert/headerFooterLayout.d.ts +1 -0
- package/dist/layout-bridge/convert/headerFooterLayout.js +6 -1
- package/dist/layout-bridge/convert/tableConversion.js +25 -10
- package/dist/layout-bridge/convert/toFlowBlocks.js +4 -0
- package/dist/layout-bridge/engine/blockIndex.d.ts +7 -0
- package/dist/layout-bridge/engine/blockIndex.js +12 -0
- package/dist/layout-bridge/engine/clickToPosition.js +5 -1
- package/dist/layout-bridge/engine/hitTest.js +9 -10
- package/dist/layout-bridge/engine/selectionRects.js +6 -6
- package/dist/layout-engine/footnoteContinuation.d.ts +36 -0
- package/dist/layout-engine/footnoteContinuation.js +210 -0
- package/dist/layout-engine/index.d.ts +2 -2
- package/dist/layout-engine/index.js +7 -2
- package/dist/layout-engine/measure/cache.js +10 -5
- package/dist/layout-engine/measure/measureParagraph.js +1 -1
- package/dist/layout-engine/measure/tableCellFloating.d.ts +2 -0
- package/dist/layout-engine/measure/tableCellFloating.js +1 -0
- package/dist/layout-engine/measure/tableVisibleBand.d.ts +16 -0
- package/dist/layout-engine/measure/tableVisibleBand.js +28 -0
- package/dist/layout-engine/tableLayout.js +34 -7
- package/dist/layout-engine/tableRowBreak.d.ts +46 -0
- package/dist/layout-engine/tableRowBreak.js +193 -36
- package/dist/layout-engine/types.d.ts +43 -3
- package/dist/layout-painter/previewSvg.d.ts +8 -0
- package/dist/layout-painter/previewSvg.js +47 -0
- package/dist/layout-painter/renderImage.js +2 -1
- package/dist/layout-painter/renderPage.d.ts +5 -4
- package/dist/layout-painter/renderPage.js +52 -20
- package/dist/layout-painter/renderParagraph.js +3 -2
- package/dist/layout-painter/renderTable.d.ts +5 -2
- package/dist/layout-painter/renderTable.js +39 -22
- package/dist/managers/AutoSaveManager.d.ts +5 -1
- package/dist/managers/FindReplaceManager.js +3 -10
- package/dist/markdown/escape.d.ts +20 -1
- package/dist/markdown/escape.js +43 -1
- package/dist/markdown/renderBlock.js +4 -1
- package/dist/markdown/renderParagraph.js +13 -27
- package/dist/markdown/renderTable.js +6 -2
- package/dist/markdown/trailers.js +1 -0
- package/dist/pdf/images.d.ts +17 -1
- package/dist/pdf/images.js +22 -4
- package/dist/pdf/writePdf.js +4 -2
- package/dist/prosemirror/anchoredTextBoxes.d.ts +2 -1
- package/dist/prosemirror/attrs/index.js +1 -0
- package/dist/prosemirror/canonicalCommands.d.ts +39 -1
- package/dist/prosemirror/canonicalTableCommands.d.ts +28 -0
- package/dist/prosemirror/canonicalTableCommands.js +362 -0
- package/dist/prosemirror/commands/comments.d.ts +25 -0
- package/dist/prosemirror/commands/comments.js +122 -18
- package/dist/prosemirror/commands/deleteBesideInlineAnchor.d.ts +9 -0
- package/dist/prosemirror/commands/deleteBesideInlineAnchor.js +36 -0
- package/dist/prosemirror/commands/formatting.d.ts +1 -1
- package/dist/prosemirror/commands/index.d.ts +1 -1
- package/dist/prosemirror/commands/pastePlainText.d.ts +6 -0
- package/dist/prosemirror/commands/pastePlainText.js +13 -3
- package/dist/prosemirror/commands/resolveAllTableChanges.js +30 -2
- package/dist/prosemirror/commentIdAllocator.js +2 -2
- package/dist/prosemirror/commentRangeBoundaryAttrs.d.ts +6 -0
- package/dist/prosemirror/commentRangeBoundaryAttrs.js +9 -3
- package/dist/prosemirror/commentReferenceIntegrity.d.ts +8 -2
- package/dist/prosemirror/commentReferenceIntegrity.js +22 -8
- package/dist/prosemirror/conversion/fromProseDoc.d.ts +2 -0
- package/dist/prosemirror/conversion/fromProseDoc.js +115 -35
- package/dist/prosemirror/conversion/index.d.ts +1 -1
- package/dist/prosemirror/conversion/toProseDoc.d.ts +128 -1
- package/dist/prosemirror/conversion/toProseDoc.js +325 -55
- package/dist/prosemirror/extensions/StarterKit.js +2 -0
- package/dist/prosemirror/extensions/core/DocExtension.js +1 -1
- package/dist/prosemirror/extensions/core/ParagraphExtension.d.ts +3 -1
- package/dist/prosemirror/extensions/core/ParagraphExtension.js +8 -9
- package/dist/prosemirror/extensions/features/AutoBidiDetectionExtension.d.ts +1 -1
- package/dist/prosemirror/extensions/features/AutoBidiDetectionExtension.js +46 -11
- package/dist/prosemirror/extensions/features/BaseKeymapExtension.js +3 -2
- package/dist/prosemirror/extensions/features/BidiShortcutExtension.js +2 -3
- package/dist/prosemirror/extensions/features/JoinedRunStyleExtension.d.ts +1 -1
- package/dist/prosemirror/extensions/features/ListExtension.js +22 -1
- package/dist/prosemirror/extensions/features/ParaIdAllocatorExtension.d.ts +1 -1
- package/dist/prosemirror/extensions/features/ParagraphChangeTrackerExtension.d.ts +1 -1
- package/dist/prosemirror/extensions/features/pastedHtmlLists.js +5 -4
- package/dist/prosemirror/extensions/marks/CommentExtension.js +6 -3
- package/dist/prosemirror/extensions/marks/HyperlinkExtension.js +5 -0
- package/dist/prosemirror/extensions/marks/TextColorExtension.js +1 -1
- package/dist/prosemirror/extensions/marks/TrackedChangeExtensions.js +8 -4
- package/dist/prosemirror/extensions/nodes/BlockCommentRangeBoundaryExtension.d.ts +4 -0
- package/dist/prosemirror/extensions/nodes/BlockCommentRangeBoundaryExtension.js +49 -0
- package/dist/prosemirror/extensions/nodes/BookmarkBoundaryExtension.js +5 -1
- package/dist/prosemirror/extensions/nodes/CommentRangeBoundaryExtension.js +2 -1
- package/dist/prosemirror/extensions/nodes/CommentReferenceExtension.js +4 -3
- package/dist/prosemirror/extensions/nodes/ImageExtension.js +12 -3
- package/dist/prosemirror/extensions/nodes/MoveRangeBoundaryExtension.js +2 -1
- package/dist/prosemirror/extensions/nodes/NoteMarkerExtension.js +2 -1
- package/dist/prosemirror/extensions/nodes/RangeAnchorExtension.js +2 -1
- package/dist/prosemirror/extensions/nodes/RenderedPageBreakExtension.js +2 -1
- package/dist/prosemirror/extensions/nodes/TableExtension.js +119 -38
- package/dist/prosemirror/extensions/nodes/TextBoxExtension.js +1 -1
- package/dist/prosemirror/extensions/nodes/inlineAnchorDom.d.ts +11 -0
- package/dist/prosemirror/extensions/nodes/inlineAnchorDom.js +21 -0
- package/dist/prosemirror/index.d.ts +2 -2
- package/dist/prosemirror/listLabels.js +3 -2
- package/dist/prosemirror/listNumbering.d.ts +6 -0
- package/dist/prosemirror/listNumbering.js +12 -9
- package/dist/prosemirror/lockedControls.d.ts +13 -0
- package/dist/prosemirror/lockedControls.js +106 -0
- package/dist/prosemirror/markupViewProjection.js +1 -1
- package/dist/prosemirror/noteReferenceReview.js +2 -2
- package/dist/prosemirror/plugins/documentNumbering.js +4 -1
- package/dist/prosemirror/plugins/suggestionMode.d.ts +0 -8
- package/dist/prosemirror/plugins/suggestionMode.js +195 -30
- package/dist/prosemirror/plugins/templatePreviewValues.js +16 -1
- package/dist/prosemirror/rebaseParagraphRuns.js +1 -1
- package/dist/prosemirror/replacedAnnotations.js +1 -0
- package/dist/prosemirror/rowGridOmissions.d.ts +11 -0
- package/dist/prosemirror/rowGridOmissions.js +21 -0
- package/dist/prosemirror/runFormattingFromMarks.d.ts +0 -1
- package/dist/prosemirror/runFormattingFromMarks.js +2 -4
- package/dist/prosemirror/runFormattingReconciliation.js +2 -2
- package/dist/prosemirror/runPropertyChangeResolution.js +1 -2
- package/dist/prosemirror/runStyleFormatting.d.ts +14 -4
- package/dist/prosemirror/runStyleFormatting.js +16 -13
- package/dist/prosemirror/schema/marks.d.ts +6 -0
- package/dist/prosemirror/styles/paragraphStyleCascade.js +2 -2
- package/dist/prosemirror/tableGridMutation.d.ts +19 -2
- package/dist/prosemirror/tableGridMutation.js +118 -15
- package/dist/prosemirror/tablePositionedBookmarks.d.ts +2 -0
- package/dist/prosemirror/tablePositionedBookmarks.js +80 -0
- package/dist/prosemirror/validation.js +2 -1
- package/dist/redline.js +23 -9
- package/dist/server.d.ts +2 -2
- package/dist/style-sets/extract.js +2 -2
- package/dist/types/canonicalCapabilities.d.ts +29 -8
- package/dist/types/canonicalCapabilities.js +13 -9
- package/dist/utils/cssString.d.ts +7 -0
- package/dist/utils/cssString.js +9 -0
- package/dist/utils/fontResolver.js +4 -1
- package/dist/utils/replaceText.d.ts +11 -0
- package/dist/utils/replaceText.js +39 -7
- package/dist/version-comparison.d.ts +9 -1
- package/dist/version-comparison.js +11 -5
- package/package.json +2 -2
|
@@ -65,6 +65,7 @@ const messages = { "folio": {
|
|
|
65
65
|
"contentControlDateAriaLabel": "Izvēlieties datumu",
|
|
66
66
|
"contentControlDropdownAriaLabel": "Nolaižamā saraksta opcijas",
|
|
67
67
|
"contentControlDropdownNoOptions": "Nav opciju",
|
|
68
|
+
"contentNotDisplayed": "Saturs netiek rādīts",
|
|
68
69
|
"contextMenu": {
|
|
69
70
|
"continueNumbering": "Turpināt numerāciju",
|
|
70
71
|
"copy": "Kopēt",
|
|
@@ -336,6 +337,7 @@ const messages = { "folio": {
|
|
|
336
337
|
"editSessionTakenOver": "Šo rediģēšanas sesiju pārņēma citur.",
|
|
337
338
|
"editor": {
|
|
338
339
|
"accessibleName": "Dokumentu redaktors",
|
|
340
|
+
"contentLocked": "Šī dokumenta daļa ir bloķēta.",
|
|
339
341
|
"editing": "Rediģēšana",
|
|
340
342
|
"editingDescription": "Rediģējiet dokumentu tieši",
|
|
341
343
|
"outlineDepthAll": "Visi līmeņi",
|
|
@@ -631,6 +633,7 @@ const messages = { "folio": {
|
|
|
631
633
|
"watermark": "Ūdenszīme"
|
|
632
634
|
},
|
|
633
635
|
"trackedChanges": {
|
|
636
|
+
"heldByLock": "Bloķēta satura vadīkla neļauj pieņemt vai noraidīt šīs izmaiņas.",
|
|
634
637
|
"replaced": "Aizstāts",
|
|
635
638
|
"unknown": "Nezināms",
|
|
636
639
|
"with": "ar"
|
|
@@ -65,6 +65,7 @@ type Messages = {
|
|
|
65
65
|
"contentControlDateAriaLabel": "Pick a date";
|
|
66
66
|
"contentControlDropdownAriaLabel": "Dropdown options";
|
|
67
67
|
"contentControlDropdownNoOptions": "No options";
|
|
68
|
+
"contentNotDisplayed": "Content not displayed";
|
|
68
69
|
"contextMenu": {
|
|
69
70
|
"continueNumbering": "Continue Numbering";
|
|
70
71
|
"copy": "Copy";
|
|
@@ -336,6 +337,7 @@ type Messages = {
|
|
|
336
337
|
"editSessionTakenOver": "Another tab, window, or device opened this document for editing, so this session was released. Unsaved local changes are preserved — reopen the doc to continue.";
|
|
337
338
|
"editor": {
|
|
338
339
|
"accessibleName": "Document editor";
|
|
340
|
+
"contentLocked": "This part of the document is locked.";
|
|
339
341
|
"editing": "Editing";
|
|
340
342
|
"editingDescription": "Edit the document directly";
|
|
341
343
|
"outlineDepthAll": "All levels";
|
|
@@ -631,6 +633,7 @@ type Messages = {
|
|
|
631
633
|
"watermark": "Watermark";
|
|
632
634
|
};
|
|
633
635
|
"trackedChanges": {
|
|
636
|
+
"heldByLock": "A locked content control prevents accepting or rejecting this change.";
|
|
634
637
|
"replaced": "Replaced";
|
|
635
638
|
"unknown": "Unknown";
|
|
636
639
|
"with": "with";
|
|
@@ -65,6 +65,7 @@ const messages = { "folio": {
|
|
|
65
65
|
"contentControlDateAriaLabel": "Wybierz datę",
|
|
66
66
|
"contentControlDropdownAriaLabel": "Opcje listy rozwijanej",
|
|
67
67
|
"contentControlDropdownNoOptions": "Brak opcji",
|
|
68
|
+
"contentNotDisplayed": "Treść nie jest wyświetlana",
|
|
68
69
|
"contextMenu": {
|
|
69
70
|
"continueNumbering": "Kontynuuj numerowanie",
|
|
70
71
|
"copy": "Kopiuj",
|
|
@@ -336,6 +337,7 @@ const messages = { "folio": {
|
|
|
336
337
|
"editSessionTakenOver": "Ta sesja edycji została przejęta gdzie indziej.",
|
|
337
338
|
"editor": {
|
|
338
339
|
"accessibleName": "Edytor dokumentów",
|
|
340
|
+
"contentLocked": "Ta część dokumentu jest zablokowana.",
|
|
339
341
|
"editing": "Edytowanie",
|
|
340
342
|
"editingDescription": "Edytuj dokument bezpośrednio",
|
|
341
343
|
"outlineDepthAll": "Wszystkie poziomy",
|
|
@@ -631,6 +633,7 @@ const messages = { "folio": {
|
|
|
631
633
|
"watermark": "Znak wodny"
|
|
632
634
|
},
|
|
633
635
|
"trackedChanges": {
|
|
636
|
+
"heldByLock": "Zablokowana kontrolka zawartości uniemożliwia zaakceptowanie lub odrzucenie tej zmiany.",
|
|
634
637
|
"replaced": "Zamieniono",
|
|
635
638
|
"unknown": "Nieznane",
|
|
636
639
|
"with": "na"
|
|
@@ -65,6 +65,7 @@ const messages = { "folio": {
|
|
|
65
65
|
"contentControlDateAriaLabel": "Escolher uma data",
|
|
66
66
|
"contentControlDropdownAriaLabel": "Opções da lista suspensa",
|
|
67
67
|
"contentControlDropdownNoOptions": "Nenhuma opção",
|
|
68
|
+
"contentNotDisplayed": "Conteúdo não exibido",
|
|
68
69
|
"contextMenu": {
|
|
69
70
|
"continueNumbering": "Continuar numeração",
|
|
70
71
|
"copy": "Copiar",
|
|
@@ -336,6 +337,7 @@ const messages = { "folio": {
|
|
|
336
337
|
"editSessionTakenOver": "Esta sessão de edição foi assumida em outro lugar.",
|
|
337
338
|
"editor": {
|
|
338
339
|
"accessibleName": "Editor de documentos",
|
|
340
|
+
"contentLocked": "Esta parte do documento está bloqueada.",
|
|
339
341
|
"editing": "Editando",
|
|
340
342
|
"editingDescription": "Edite o documento diretamente",
|
|
341
343
|
"outlineDepthAll": "Todos os níveis",
|
|
@@ -631,6 +633,7 @@ const messages = { "folio": {
|
|
|
631
633
|
"watermark": "Marca-d'água"
|
|
632
634
|
},
|
|
633
635
|
"trackedChanges": {
|
|
636
|
+
"heldByLock": "Um controle de conteúdo bloqueado impede que esta alteração seja aceita ou rejeitada.",
|
|
634
637
|
"replaced": "Substituído",
|
|
635
638
|
"unknown": "Desconhecido",
|
|
636
639
|
"with": "por"
|
|
@@ -65,6 +65,7 @@ const messages = { "folio": {
|
|
|
65
65
|
"contentControlDateAriaLabel": "Vyberte dátum",
|
|
66
66
|
"contentControlDropdownAriaLabel": "Možnosti rozbaľovacieho zoznamu",
|
|
67
67
|
"contentControlDropdownNoOptions": "Žiadne možnosti",
|
|
68
|
+
"contentNotDisplayed": "Obsah sa nezobrazuje",
|
|
68
69
|
"contextMenu": {
|
|
69
70
|
"continueNumbering": "Pokračovať v číslovaní",
|
|
70
71
|
"copy": "Kopírovať",
|
|
@@ -336,6 +337,7 @@ const messages = { "folio": {
|
|
|
336
337
|
"editSessionTakenOver": "Túto reláciu úprav prevzalo iné okno.",
|
|
337
338
|
"editor": {
|
|
338
339
|
"accessibleName": "Editor dokumentov",
|
|
340
|
+
"contentLocked": "Táto časť dokumentu je uzamknutá.",
|
|
339
341
|
"editing": "Úpravy",
|
|
340
342
|
"editingDescription": "Upravujte dokument priamo",
|
|
341
343
|
"outlineDepthAll": "Všetky úrovne",
|
|
@@ -631,6 +633,7 @@ const messages = { "folio": {
|
|
|
631
633
|
"watermark": "Vodotlač"
|
|
632
634
|
},
|
|
633
635
|
"trackedChanges": {
|
|
636
|
+
"heldByLock": "Uzamknutý ovládací prvok obsahu bráni prijatiu alebo odmietnutiu tejto zmeny.",
|
|
634
637
|
"replaced": "Nahradené",
|
|
635
638
|
"unknown": "Neznáme",
|
|
636
639
|
"with": "za"
|
|
@@ -65,6 +65,7 @@ const messages = { "folio": {
|
|
|
65
65
|
"contentControlDateAriaLabel": "Tarih seçin",
|
|
66
66
|
"contentControlDropdownAriaLabel": "Açılan liste seçenekleri",
|
|
67
67
|
"contentControlDropdownNoOptions": "Seçenek yok",
|
|
68
|
+
"contentNotDisplayed": "İçerik görüntülenmiyor",
|
|
68
69
|
"contextMenu": {
|
|
69
70
|
"continueNumbering": "Numaralandırmaya Devam Et",
|
|
70
71
|
"copy": "Kopyala",
|
|
@@ -336,6 +337,7 @@ const messages = { "folio": {
|
|
|
336
337
|
"editSessionTakenOver": "Başka bir sekme, pencere veya cihaz bu belgeyi düzenlemek için açtığından bu oturum sonlandırıldı. Kaydedilmemiş yerel değişiklikler korunur; devam etmek için belgeyi yeniden açın.",
|
|
337
338
|
"editor": {
|
|
338
339
|
"accessibleName": "Belge düzenleyici",
|
|
340
|
+
"contentLocked": "Belgenin bu bölümü kilitli.",
|
|
339
341
|
"editing": "Düzenleme",
|
|
340
342
|
"editingDescription": "Belgeyi doğrudan düzenleyin",
|
|
341
343
|
"outlineDepthAll": "Tüm düzeyler",
|
|
@@ -631,6 +633,7 @@ const messages = { "folio": {
|
|
|
631
633
|
"watermark": "Filigran"
|
|
632
634
|
},
|
|
633
635
|
"trackedChanges": {
|
|
636
|
+
"heldByLock": "Kilitli bir içerik denetimi bu değişikliğin kabul edilmesini veya reddedilmesini engelliyor.",
|
|
634
637
|
"replaced": "Değiştirildi",
|
|
635
638
|
"unknown": "Bilinmiyor",
|
|
636
639
|
"with": "yerine"
|
|
@@ -65,6 +65,7 @@ const messages = { "folio": {
|
|
|
65
65
|
"contentControlDateAriaLabel": "选择日期",
|
|
66
66
|
"contentControlDropdownAriaLabel": "下拉选项",
|
|
67
67
|
"contentControlDropdownNoOptions": "没有选项",
|
|
68
|
+
"contentNotDisplayed": "内容未显示",
|
|
68
69
|
"contextMenu": {
|
|
69
70
|
"continueNumbering": "继续编号",
|
|
70
71
|
"copy": "复制",
|
|
@@ -336,6 +337,7 @@ const messages = { "folio": {
|
|
|
336
337
|
"editSessionTakenOver": "另一个标签页、窗口或设备已打开此文档进行编辑,因此本会话已释放。未保存的本地更改会保留,请重新打开文档以继续。",
|
|
337
338
|
"editor": {
|
|
338
339
|
"accessibleName": "文档编辑器",
|
|
340
|
+
"contentLocked": "文档的这一部分已锁定。",
|
|
339
341
|
"editing": "编辑",
|
|
340
342
|
"editingDescription": "直接编辑文档",
|
|
341
343
|
"outlineDepthAll": "所有级别",
|
|
@@ -631,6 +633,7 @@ const messages = { "folio": {
|
|
|
631
633
|
"watermark": "水印"
|
|
632
634
|
},
|
|
633
635
|
"trackedChanges": {
|
|
636
|
+
"heldByLock": "已锁定的内容控件阻止接受或拒绝此修订。",
|
|
634
637
|
"replaced": "已替换",
|
|
635
638
|
"unknown": "未知",
|
|
636
639
|
"with": "替换为"
|
|
@@ -15,6 +15,8 @@ const hasBlockRevision = (blocks) => blocks.some((block) => {
|
|
|
15
15
|
case "preservedBlock":
|
|
16
16
|
case "bookmarkStart":
|
|
17
17
|
case "bookmarkEnd":
|
|
18
|
+
case "commentRangeStart":
|
|
19
|
+
case "commentRangeEnd":
|
|
18
20
|
case "moveFromRangeStart":
|
|
19
21
|
case "moveFromRangeEnd":
|
|
20
22
|
case "moveToRangeStart":
|
|
@@ -4,6 +4,11 @@ export type PageBreakRunSourceDescendantIndex = {
|
|
|
4
4
|
/** The same question about one block, so a caller can ask it per sibling. */
|
|
5
5
|
blockContainsPageBreakRun: (block: document_d_exports.BlockContent) => boolean;
|
|
6
6
|
paragraphFeatures: (paragraph: document_d_exports.Paragraph) => PageBreakRunSourceParagraphFeatures;
|
|
7
|
+
/**
|
|
8
|
+
* Index more content: a later version of the story, whose unchanged
|
|
9
|
+
* records the index already holds. Each record is inspected once.
|
|
10
|
+
*/
|
|
11
|
+
include: (content: readonly document_d_exports.BlockContent[]) => void;
|
|
7
12
|
};
|
|
8
13
|
export type PageBreakRunSourceParagraphFeatures = {
|
|
9
14
|
hasPageBreakRun: boolean;
|
|
@@ -101,6 +101,8 @@ const buildPageBreakRunSourceDescendantIndex = (rootContent) => {
|
|
|
101
101
|
case "preservedBlock":
|
|
102
102
|
case "bookmarkStart":
|
|
103
103
|
case "bookmarkEnd":
|
|
104
|
+
case "commentRangeStart":
|
|
105
|
+
case "commentRangeEnd":
|
|
104
106
|
case "moveFromRangeStart":
|
|
105
107
|
case "moveFromRangeEnd":
|
|
106
108
|
case "moveToRangeStart":
|
|
@@ -123,6 +125,9 @@ const buildPageBreakRunSourceDescendantIndex = (rootContent) => {
|
|
|
123
125
|
return flags;
|
|
124
126
|
};
|
|
125
127
|
return {
|
|
128
|
+
include: (content) => {
|
|
129
|
+
inspectBlocks(content);
|
|
130
|
+
},
|
|
126
131
|
containsPageBreakRun: (content) => hasFlag(indexedFlags(content), SOURCE_FLAGS.containsPageBreak),
|
|
127
132
|
blockContainsPageBreakRun: (block) => hasFlag(indexedFlags(block), SOURCE_FLAGS.containsPageBreak),
|
|
128
133
|
paragraphFeatures: (paragraph) => {
|
|
@@ -20,8 +20,7 @@ import { ReplaceStep, StepMap } from "prosemirror-transform";
|
|
|
20
20
|
const EMPTY_PARAGRAPH_RUN_STYLE_CONTEXT = {
|
|
21
21
|
baseParagraphFormatting: void 0,
|
|
22
22
|
paragraphFormatting: void 0,
|
|
23
|
-
paragraphMarkFormatting: void 0
|
|
24
|
-
paragraphMarkPrecedesStyle: false
|
|
23
|
+
paragraphMarkFormatting: void 0
|
|
25
24
|
};
|
|
26
25
|
const resolveParagraphRunStyleScope = (scope, styleResolver) => {
|
|
27
26
|
if (!scope) return EMPTY_PARAGRAPH_RUN_STYLE_CONTEXT;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { getProseParagraphPropertySourceToken, recreateProseNodeWithParagraphPropertySource } from "../docx/paragraphPropertySource.js";
|
|
2
|
-
import { anchoredTextBoxId, droppedTextBoxAnchorIds } from "../prosemirror/anchoredTextBoxes.js";
|
|
2
|
+
import { anchoredTextBoxId, droppedTextBoxAnchorIds, moveTextBoxesPastNextParagraph } from "../prosemirror/anchoredTextBoxes.js";
|
|
3
3
|
import { expectParagraphAttrs } from "../prosemirror/attrs/index.js";
|
|
4
4
|
import { inlineBookmarksOf } from "../prosemirror/commands/paragraphBookmarkJoin.js";
|
|
5
5
|
import { resolveAllTableChanges } from "../prosemirror/commands/resolveAllTableChanges.js";
|
|
@@ -291,10 +291,11 @@ const resolveStructure = ({ node, position, context }) => {
|
|
|
291
291
|
let pendingBookmarks = [];
|
|
292
292
|
let followingContainerChild = false;
|
|
293
293
|
const precedingParagraphs = [];
|
|
294
|
-
|
|
294
|
+
const endsWithAnyBlock = node.type.name === "blockSdt";
|
|
295
|
+
let endsWell = false;
|
|
295
296
|
for (const { node: child } of entries) {
|
|
296
|
-
precedingParagraphs.push(
|
|
297
|
-
if (child !== null && !isBlockBoundaryNode(child))
|
|
297
|
+
precedingParagraphs.push(endsWell);
|
|
298
|
+
if (child !== null && !isBlockBoundaryNode(child)) endsWell = endsWithAnyBlock || child.type.name === "paragraph";
|
|
298
299
|
}
|
|
299
300
|
const flush = () => {
|
|
300
301
|
if (!chain) return;
|
|
@@ -393,6 +394,7 @@ const resolveStructure = ({ node, position, context }) => {
|
|
|
393
394
|
const marker = expectParagraphAttrs(paragraph).pPrMark;
|
|
394
395
|
const markWasAdded = marker?.kind === "ins" || marker?.kind === "moveTo";
|
|
395
396
|
const joins = marker && markWasAdded !== (context.mode === "accept");
|
|
397
|
+
if (joins && entries[index + 1]?.node?.type.name === "textBox") context.textBoxesStandInJoins = true;
|
|
396
398
|
if (joins && chain) {
|
|
397
399
|
const properties = expectParagraphAttrs(paragraph)._sectionProperties;
|
|
398
400
|
const preceding = entries[index - 1]?.node;
|
|
@@ -524,7 +526,8 @@ const resolveStructure = ({ node, position, context }) => {
|
|
|
524
526
|
flushBookmarks();
|
|
525
527
|
reversed.reverse();
|
|
526
528
|
if (node.type.name === "doc") {
|
|
527
|
-
const
|
|
529
|
+
const carrierIndex = reversed.findLastIndex((child) => child.type.name !== "textBox");
|
|
530
|
+
const carrier = reversed[carrierIndex];
|
|
528
531
|
if (carrier?.type.name === "paragraph" && carrier.attrs["reviewCarrier"] === REVIEW_CARRIERS.TERMINAL_TABLE) {
|
|
529
532
|
const table = reversed.findLast((child) => child.type.name === "table");
|
|
530
533
|
let pending = false;
|
|
@@ -532,9 +535,9 @@ const resolveStructure = ({ node, position, context }) => {
|
|
|
532
535
|
pending ||= child.type.name === "tableRow" && child.attrs["trDel"] !== null && typeof child.attrs["trDel"] === "object" || child.type.name !== "tableRow" && child.marks.some((mark) => mark.type.name === "deletion");
|
|
533
536
|
return !pending;
|
|
534
537
|
});
|
|
535
|
-
const entry = entries.
|
|
538
|
+
const entry = entries.findLast((candidate) => candidate.node?.type.name !== "textBox");
|
|
536
539
|
if (!pending && entry) {
|
|
537
|
-
if (context.mode === "accept") {
|
|
540
|
+
if (context.mode === "accept" || carrier.content.size > 0) {
|
|
538
541
|
const cleared = recreateProseNodeWithParagraphPropertySource(carrier, { attrs: {
|
|
539
542
|
...carrier.attrs,
|
|
540
543
|
reviewCarrier: void 0
|
|
@@ -549,9 +552,9 @@ const resolveStructure = ({ node, position, context }) => {
|
|
|
549
552
|
from: entry.position,
|
|
550
553
|
to: entry.position + carrier.nodeSize
|
|
551
554
|
});
|
|
552
|
-
reversed[
|
|
555
|
+
reversed[carrierIndex] = cleared;
|
|
553
556
|
} else if (reversed.length > 1) {
|
|
554
|
-
reversed.
|
|
557
|
+
reversed.splice(carrierIndex, 1);
|
|
555
558
|
context.deleted.push({
|
|
556
559
|
from: entry.position,
|
|
557
560
|
to: entry.position + carrier.nodeSize
|
|
@@ -614,16 +617,56 @@ const resolveStructure = ({ node, position, context }) => {
|
|
|
614
617
|
});
|
|
615
618
|
return final;
|
|
616
619
|
};
|
|
620
|
+
/**
|
|
621
|
+
* The text boxes drawn in a paragraph stand between it and the next one. When
|
|
622
|
+
* the paragraph's mark goes, the two join, and the boxes follow the result.
|
|
623
|
+
*/
|
|
624
|
+
const moveTextBoxesOutOfJoins = (tr, mode) => {
|
|
625
|
+
const joining = [];
|
|
626
|
+
tr.doc.descendants((node, position) => {
|
|
627
|
+
if (node.type.name !== "paragraph") return true;
|
|
628
|
+
const mark = expectParagraphAttrs(node).pPrMark;
|
|
629
|
+
const wasAdded = mark?.kind === "ins" || mark?.kind === "moveTo";
|
|
630
|
+
if (mark && wasAdded !== (mode === "accept")) joining.push(position);
|
|
631
|
+
return false;
|
|
632
|
+
});
|
|
633
|
+
for (const position of joining.toReversed()) moveTextBoxesPastNextParagraph(tr, position);
|
|
634
|
+
};
|
|
617
635
|
const resolveWholeStory = ({ doc: storyDoc, mode, styleResolver, numbering }) => {
|
|
618
636
|
const withoutCopies = new Transform(storyDoc);
|
|
619
637
|
for (const position of sectionRecordCopyPositions(storyDoc)) withoutCopies.setNodeAttribute(position, "_sectionProperties", null);
|
|
620
638
|
const doc = withoutCopies.doc;
|
|
621
|
-
const { runsIntoTable, ...direct } = resolveStoryRevisions({
|
|
639
|
+
const { runsIntoTable, textBoxesStandInJoins, ...direct } = resolveStoryRevisions({
|
|
622
640
|
doc,
|
|
623
641
|
mode,
|
|
624
642
|
styleResolver,
|
|
625
643
|
numbering
|
|
626
644
|
});
|
|
645
|
+
if (textBoxesStandInJoins) {
|
|
646
|
+
const prepared = new Transform(doc);
|
|
647
|
+
moveTextBoxesOutOfJoins(prepared, mode);
|
|
648
|
+
if (prepared.docChanged) {
|
|
649
|
+
const result = resolveWholeStory({
|
|
650
|
+
doc: prepared.doc,
|
|
651
|
+
mode,
|
|
652
|
+
styleResolver,
|
|
653
|
+
numbering
|
|
654
|
+
});
|
|
655
|
+
let preparedMap = StepMap.empty;
|
|
656
|
+
for (const map of prepared.mapping.maps) preparedMap = composeRevisionResolutionMaps(preparedMap, map);
|
|
657
|
+
const positionMap = composeRevisionResolutionMaps(preparedMap, result.positionMap);
|
|
658
|
+
return {
|
|
659
|
+
...result,
|
|
660
|
+
steps: [
|
|
661
|
+
...withoutCopies.steps,
|
|
662
|
+
...prepared.steps,
|
|
663
|
+
...result.steps
|
|
664
|
+
],
|
|
665
|
+
positionMap,
|
|
666
|
+
mapping: new Mapping([positionMap])
|
|
667
|
+
};
|
|
668
|
+
}
|
|
669
|
+
}
|
|
627
670
|
if (!runsIntoTable) return {
|
|
628
671
|
...direct,
|
|
629
672
|
steps: [...withoutCopies.steps, ...direct.steps]
|
|
@@ -634,7 +677,7 @@ const resolveWholeStory = ({ doc: storyDoc, mode, styleResolver, numbering }) =>
|
|
|
634
677
|
...direct,
|
|
635
678
|
steps: [...withoutCopies.steps, ...direct.steps]
|
|
636
679
|
};
|
|
637
|
-
const { runsIntoTable: _rerun, ...result } = resolveStoryRevisions({
|
|
680
|
+
const { runsIntoTable: _rerun, textBoxesStandInJoins: _standing, ...result } = resolveStoryRevisions({
|
|
638
681
|
doc: runIn.doc,
|
|
639
682
|
mode,
|
|
640
683
|
styleResolver,
|
|
@@ -684,7 +727,7 @@ const resolveStoryRevisions = ({ doc, mode, styleResolver, numbering }) => {
|
|
|
684
727
|
removeType: doc.type.schema.marks[mode === "accept" ? "deletion" : "insertion"]
|
|
685
728
|
});
|
|
686
729
|
const inlineResolved = inline?.resolved ?? properties;
|
|
687
|
-
const comments = inline ? resolveCommentReferences(inlineResolved) : null;
|
|
730
|
+
const comments = inline ? resolveCommentReferences(inlineResolved, doc) : null;
|
|
688
731
|
const context = {
|
|
689
732
|
mode,
|
|
690
733
|
styleResolver,
|
|
@@ -697,6 +740,7 @@ const resolveStoryRevisions = ({ doc, mode, styleResolver, numbering }) => {
|
|
|
697
740
|
bookmarkJoins: [],
|
|
698
741
|
structural: propertyResult.structural,
|
|
699
742
|
failed: false,
|
|
743
|
+
textBoxesStandInJoins: false,
|
|
700
744
|
removedEndpointCount: propertyResult.removedEndpointCount,
|
|
701
745
|
removedReferences: [...propertyResult.removedReferences],
|
|
702
746
|
droppedTextBoxAnchors: inline ? droppedTextBoxAnchorIds(properties, inlineResolved) : /* @__PURE__ */ new Set()
|
|
@@ -737,6 +781,7 @@ const resolveStoryRevisions = ({ doc, mode, styleResolver, numbering }) => {
|
|
|
737
781
|
structuralMap,
|
|
738
782
|
structural: context.structural,
|
|
739
783
|
failed: context.failed,
|
|
784
|
+
textBoxesStandInJoins: context.textBoxesStandInJoins,
|
|
740
785
|
removedEndpointCount: context.removedEndpointCount,
|
|
741
786
|
removedReferences: context.removedReferences,
|
|
742
787
|
runsIntoTable: propertyResult.runsIntoTable,
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ParagraphBlock } from "../../layout-engine/types.js";
|
|
2
|
+
import { FlowConversionOptions } from "./flowConversionShared.js";
|
|
3
|
+
import { Node } from "prosemirror-model";
|
|
4
|
+
/** The marker where no editor supplies a localised one. */
|
|
5
|
+
export declare const ALT_CHUNK_DEFAULT_MARKER_TEXT = "Content not displayed";
|
|
6
|
+
/**
|
|
7
|
+
* The placeholder for a preserved block at `pos`, or nothing when the block is
|
|
8
|
+
* not an altChunk. Only the first paragraph addresses the node.
|
|
9
|
+
*/
|
|
10
|
+
export declare const convertAltChunkPlaceholder: (node: Node, pos: number, options: FlowConversionOptions) => ParagraphBlock[];
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { isAltChunkMarkup } from "../../docx/altChunk.js";
|
|
2
|
+
import { expectPreservedBlockAttrs } from "../../prosemirror/attrs/index.js";
|
|
3
|
+
import { detectBaseDirection } from "../../utils/baseDirection.js";
|
|
4
|
+
import { ALT_CHUNK_CONTENT } from "./flowConversionShared.js";
|
|
5
|
+
import { convertParagraph } from "./paragraphConversion.js";
|
|
6
|
+
// src/layout-bridge/convert/altChunkPlaceholder.ts
|
|
7
|
+
/** The marker where no editor supplies a localised one. */
|
|
8
|
+
const ALT_CHUNK_DEFAULT_MARKER_TEXT = "Content not displayed";
|
|
9
|
+
/** Tints the block, so it does not read as part of the editable text. */
|
|
10
|
+
const PLACEHOLDER_SHADING = "#F2F2F2";
|
|
11
|
+
const MARKER_COLOR = "#595959";
|
|
12
|
+
/** Past this, further lines of a chunk's text run together in the last block. */
|
|
13
|
+
const MAX_PLACEHOLDER_PARAGRAPHS = 2e3;
|
|
14
|
+
const altChunkNodes = /* @__PURE__ */ new WeakMap();
|
|
15
|
+
const isAltChunkNode = (node) => {
|
|
16
|
+
const known = altChunkNodes.get(node);
|
|
17
|
+
if (known !== void 0) return known;
|
|
18
|
+
const isAltChunk = isAltChunkMarkup(expectPreservedBlockAttrs(node).xml);
|
|
19
|
+
altChunkNodes.set(node, isAltChunk);
|
|
20
|
+
return isAltChunk;
|
|
21
|
+
};
|
|
22
|
+
const placeholderLines = (text) => {
|
|
23
|
+
const lines = text.split(/\r\n|\r|\n/u);
|
|
24
|
+
if (lines.length <= MAX_PLACEHOLDER_PARAGRAPHS) return lines;
|
|
25
|
+
const kept = lines.slice(0, 1999);
|
|
26
|
+
kept.push(lines.slice(1999).join(" "));
|
|
27
|
+
return kept;
|
|
28
|
+
};
|
|
29
|
+
/**
|
|
30
|
+
* The placeholder for a preserved block at `pos`, or nothing when the block is
|
|
31
|
+
* not an altChunk. Only the first paragraph addresses the node.
|
|
32
|
+
*/
|
|
33
|
+
const convertAltChunkPlaceholder = (node, pos, options) => {
|
|
34
|
+
if (node.type.name !== "preservedBlock" || !isAltChunkNode(node)) return [];
|
|
35
|
+
const { readerText } = expectPreservedBlockAttrs(node);
|
|
36
|
+
const hasText = options.altChunkContent !== ALT_CHUNK_CONTENT.markerOnly && typeof readerText === "string" && readerText.trim() !== "";
|
|
37
|
+
const isMarker = !hasText;
|
|
38
|
+
const text = hasText ? readerText : options.altChunkMarkerText ?? "Content not displayed";
|
|
39
|
+
const { schema } = node.type;
|
|
40
|
+
const paragraphType = schema.nodes["paragraph"];
|
|
41
|
+
if (!paragraphType) return [];
|
|
42
|
+
const after = pos + node.nodeSize;
|
|
43
|
+
const blocks = [];
|
|
44
|
+
for (const [index, line] of placeholderLines(text).entries()) {
|
|
45
|
+
const block = convertParagraph(paragraphType.create(detectBaseDirection(line) === "rtl" ? { direction: { source: "auto" } } : null, line.length > 0 ? schema.text(line) : null), pos, options);
|
|
46
|
+
delete block.pmStart;
|
|
47
|
+
delete block.pmEnd;
|
|
48
|
+
if (index === 0) {
|
|
49
|
+
block.pmStart = pos;
|
|
50
|
+
block.pmEnd = after;
|
|
51
|
+
}
|
|
52
|
+
block.fixedPosition = after;
|
|
53
|
+
block.attrs = {
|
|
54
|
+
...block.attrs,
|
|
55
|
+
shading: PLACEHOLDER_SHADING
|
|
56
|
+
};
|
|
57
|
+
for (const run of block.runs) {
|
|
58
|
+
if (run.kind !== "text") continue;
|
|
59
|
+
run.pmStart = after;
|
|
60
|
+
run.pmEnd = after;
|
|
61
|
+
if (isMarker) {
|
|
62
|
+
run.italic = true;
|
|
63
|
+
run.color = MARKER_COLOR;
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
blocks.push(block);
|
|
67
|
+
}
|
|
68
|
+
return blocks;
|
|
69
|
+
};
|
|
70
|
+
export { ALT_CHUNK_DEFAULT_MARKER_TEXT, convertAltChunkPlaceholder };
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { expectTableCellAttrs, expectTableRowAttrs } from "../../prosemirror/attrs/index.js";
|
|
2
|
+
import { rowGridOmissions } from "../../prosemirror/rowGridOmissions.js";
|
|
2
3
|
// src/layout-bridge/convert/fixedTableColumnWidths.ts
|
|
3
4
|
/** Resolve absolute cell preferences for an unbounded fixed-layout grid (§17.4.53). */
|
|
4
5
|
const fixedTableColumnWidths = (table, grid) => {
|
|
@@ -7,7 +8,7 @@ const fixedTableColumnWidths = (table, grid) => {
|
|
|
7
8
|
const row = table.child(rowIndex);
|
|
8
9
|
const rowAttrs = expectTableRowAttrs(row);
|
|
9
10
|
if (rowAttrs.trIns || rowAttrs.trDel || rowAttrs.hidden) return grid;
|
|
10
|
-
let column =
|
|
11
|
+
let column = rowGridOmissions(row, 0).gridBefore;
|
|
11
12
|
for (let cellIndex = 0; cellIndex < row.childCount; cellIndex++) {
|
|
12
13
|
const attrs = expectTableCellAttrs(row.child(cellIndex));
|
|
13
14
|
if (attrs._omittedGridSlot) continue;
|
|
@@ -8,7 +8,17 @@ import { Node } from "prosemirror-model";
|
|
|
8
8
|
/**
|
|
9
9
|
* Options for the conversion.
|
|
10
10
|
*/
|
|
11
|
+
/** How much of a `w:altChunk` a story has room to show. */
|
|
12
|
+
export declare const ALT_CHUNK_CONTENT: {
|
|
13
|
+
readonly text: "text";
|
|
14
|
+
readonly markerOnly: "markerOnly";
|
|
15
|
+
};
|
|
16
|
+
export type AltChunkContent = (typeof ALT_CHUNK_CONTENT)[keyof typeof ALT_CHUNK_CONTENT];
|
|
11
17
|
export type ToFlowBlocksOptions = {
|
|
18
|
+
/** Localised text for a `w:altChunk` that has no text of its own to show. */
|
|
19
|
+
altChunkMarkerText?: string;
|
|
20
|
+
/** Defaults to the chunk's own text. */
|
|
21
|
+
altChunkContent?: AltChunkContent;
|
|
12
22
|
/** Paint comment anchors and highlights; false leaves authored marks intact. */
|
|
13
23
|
showCommentHighlights?: boolean;
|
|
14
24
|
/** Embedded families owned by this editor, never ambient process state. */
|
|
@@ -1,5 +1,15 @@
|
|
|
1
1
|
// src/layout-bridge/convert/flowConversionShared.ts
|
|
2
2
|
/**
|
|
3
|
+
* Options for the conversion.
|
|
4
|
+
*/
|
|
5
|
+
/** How much of a `w:altChunk` a story has room to show. */
|
|
6
|
+
const ALT_CHUNK_CONTENT = {
|
|
7
|
+
/** Its own text when it has any, otherwise the marker. */
|
|
8
|
+
text: "text",
|
|
9
|
+
/** Only the marker: the story's height cannot follow the chunk's length. */
|
|
10
|
+
markerOnly: "markerOnly"
|
|
11
|
+
};
|
|
12
|
+
/**
|
|
3
13
|
* Convert twips to pixels (1 twip = 1/1440 inch, 1 inch = 96 CSS px).
|
|
4
14
|
* No rounding — precision prevents cumulative layout drift across paragraphs.
|
|
5
15
|
*/
|
|
@@ -19,4 +29,4 @@ function nextBlockId() {
|
|
|
19
29
|
function resetBlockIdCounter() {
|
|
20
30
|
blockIdCounter = 0;
|
|
21
31
|
}
|
|
22
|
-
export { nextBlockId, resetBlockIdCounter, twipsToPixels };
|
|
32
|
+
export { ALT_CHUNK_CONTENT, nextBlockId, resetBlockIdCounter, twipsToPixels };
|
|
@@ -7,6 +7,7 @@ export type MeasureBlocksFn = (blocks: FlowBlock[], contentWidth: number) => Mea
|
|
|
7
7
|
export type ConvertFootnoteOptions = Pick<ToFlowBlocksOptions, "embeddedFontFamilyMap" | "documentFontFacts"> & {
|
|
8
8
|
/** Whether comment highlights are painted. Defaults to true. */
|
|
9
9
|
showCommentHighlights?: boolean;
|
|
10
|
+
altChunkMarkerText?: string;
|
|
10
11
|
markupView?: DisplayMode;
|
|
11
12
|
styles?: document_d_exports.StyleDefinitions | null;
|
|
12
13
|
numbering?: document_d_exports.NumberingDefinitions;
|
|
@@ -213,7 +213,10 @@ function convertNoteStoryToFlowBlocks(content, options, referenceMarkText) {
|
|
|
213
213
|
if (options.theme !== void 0) proseOptions.theme = options.theme;
|
|
214
214
|
if (options.numbering !== void 0) proseOptions.numbering = options.numbering;
|
|
215
215
|
const pmDoc = footnoteToProseDoc(content, proseOptions);
|
|
216
|
-
const flowOptions = {
|
|
216
|
+
const flowOptions = {
|
|
217
|
+
showCommentHighlights: options.showCommentHighlights !== false && options.markupView !== "no-markup" && options.markupView !== "original",
|
|
218
|
+
...options.altChunkMarkerText === void 0 ? {} : { altChunkMarkerText: options.altChunkMarkerText }
|
|
219
|
+
};
|
|
217
220
|
if (options.defaultSize !== void 0) flowOptions.defaultSize = options.defaultSize;
|
|
218
221
|
if (options.styles) flowOptions.styles = options.styles;
|
|
219
222
|
if (options.theme !== void 0) flowOptions.theme = options.theme;
|
|
@@ -44,6 +44,7 @@ export type ConvertHeaderFooterOptions = {
|
|
|
44
44
|
markupView?: DisplayMode;
|
|
45
45
|
/** Whether comment highlights are painted. Defaults to true. */
|
|
46
46
|
showCommentHighlights?: boolean;
|
|
47
|
+
altChunkMarkerText?: string;
|
|
47
48
|
styles?: document_d_exports.StyleDefinitions | null;
|
|
48
49
|
numbering?: document_d_exports.NumberingDefinitions;
|
|
49
50
|
theme?: document_d_exports.Theme | null;
|
|
@@ -3,6 +3,7 @@ import { isFloatingImageRun, isFloatingTextBoxBlock, isTextWrappingFloatingImage
|
|
|
3
3
|
import { headerFooterToProseDoc } from "../../prosemirror/conversion/toProseDoc.js";
|
|
4
4
|
import { projectStoryMarkupView } from "../../prosemirror/markupViewProjection.js";
|
|
5
5
|
import { emuToPixels } from "../../utils/units.js";
|
|
6
|
+
import { ALT_CHUNK_CONTENT } from "./flowConversionShared.js";
|
|
6
7
|
import { remapMarkupViewBlocks } from "./markupViewFlow.js";
|
|
7
8
|
import { toFlowBlocks } from "./toFlowBlocks.js";
|
|
8
9
|
// src/layout-bridge/convert/headerFooterLayout.ts
|
|
@@ -359,7 +360,11 @@ function convertHeaderFooterToContent(headerFooter, contentWidth, metrics, optio
|
|
|
359
360
|
*/
|
|
360
361
|
function convertHeaderFooterPmDocToContent(pmDoc, contentWidth, metrics, options) {
|
|
361
362
|
if (!pmDoc || pmDoc.content.size === 0) return;
|
|
362
|
-
const flowOptions = {
|
|
363
|
+
const flowOptions = {
|
|
364
|
+
altChunkContent: ALT_CHUNK_CONTENT.markerOnly,
|
|
365
|
+
showCommentHighlights: options.showCommentHighlights !== false && options.markupView !== "no-markup" && options.markupView !== "original",
|
|
366
|
+
...options.altChunkMarkerText === void 0 ? {} : { altChunkMarkerText: options.altChunkMarkerText }
|
|
367
|
+
};
|
|
363
368
|
if (options.defaultSize !== void 0) flowOptions.defaultSize = options.defaultSize;
|
|
364
369
|
if (options.styles) flowOptions.styles = options.styles;
|
|
365
370
|
if (options.theme !== void 0) flowOptions.theme = options.theme;
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import { setTextBoxGroupId } from "../../layout-engine/textBoxGroup.js";
|
|
2
2
|
import { DEFAULT_TEXTBOX_MARGINS } from "../../layout-engine/types.js";
|
|
3
3
|
import { expectParagraphAttrs, expectTableAttrs, expectTableCellAttrs, expectTableRowAttrs, expectTextBoxAttrs } from "../../prosemirror/attrs/index.js";
|
|
4
|
+
import { rowGridOmissions } from "../../prosemirror/rowGridOmissions.js";
|
|
4
5
|
import { textBoxHostParagraph } from "../../prosemirror/textBoxHostParagraph.js";
|
|
5
6
|
import { normalizeShapeTextAnchor } from "../../types/documentEnumValues.js";
|
|
7
|
+
import { convertAltChunkPlaceholder } from "./altChunkPlaceholder.js";
|
|
6
8
|
import { fixedTableColumnWidths } from "./fixedTableColumnWidths.js";
|
|
7
9
|
import { convertBorderSpecToLayout } from "./flowBorders.js";
|
|
8
10
|
import { nextBlockId, twipsToPixels } from "./flowConversionShared.js";
|
|
@@ -66,6 +68,7 @@ function convertTableCell(node, startPos, options, tableCellMargins) {
|
|
|
66
68
|
blocks.push(block);
|
|
67
69
|
} else if (child.type.name === "table") blocks.push(convertTable(child, childStart, options));
|
|
68
70
|
else if (child.type.name === "textBox") blocks.push(convertTextBoxNode(child, childStart, options));
|
|
71
|
+
else if (child.type.name === "preservedBlock") blocks.push(...convertAltChunkPlaceholder(child, childStart, options));
|
|
69
72
|
else if (child.type.name === "blockSdt" || child.type.name === "blockCustomXml") {
|
|
70
73
|
let sdtChildStart = childStart + 1;
|
|
71
74
|
child.forEach((sdtChild) => {
|
|
@@ -159,8 +162,9 @@ function convertTableRow(node, startPos, options, { cellMargins }) {
|
|
|
159
162
|
id: nextBlockId(),
|
|
160
163
|
cells
|
|
161
164
|
};
|
|
162
|
-
|
|
163
|
-
if (
|
|
165
|
+
const { gridBefore, gridAfter } = rowGridOmissions(node, attrs._originalFormatting?.gridAfter ?? 0);
|
|
166
|
+
if (gridBefore > 0) row.gridBefore = gridBefore;
|
|
167
|
+
if (gridAfter > 0) row.gridAfter = gridAfter;
|
|
164
168
|
if (attrs.height) row.height = twipsToPixels(attrs.height);
|
|
165
169
|
if (attrs.heightRule) row.heightRule = attrs.heightRule;
|
|
166
170
|
if (attrs.isHeader) row.isHeader = attrs.isHeader;
|
|
@@ -239,14 +243,25 @@ function convertTable(node, startPos, options) {
|
|
|
239
243
|
function convertTextBoxNode(node, startPos, opts) {
|
|
240
244
|
const attrs = expectTextBoxAttrs(node);
|
|
241
245
|
const contentBlocks = [];
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
246
|
+
const convertBoxChildren = (container, containerStart) => {
|
|
247
|
+
container.forEach((child, offset) => {
|
|
248
|
+
const childPos = containerStart + offset;
|
|
249
|
+
switch (child.type.name) {
|
|
250
|
+
case "paragraph":
|
|
251
|
+
contentBlocks.push(convertParagraph(child, childPos, opts));
|
|
252
|
+
break;
|
|
253
|
+
case "table":
|
|
254
|
+
contentBlocks.push(convertTable(child, childPos, opts));
|
|
255
|
+
break;
|
|
256
|
+
case "preservedBlock":
|
|
257
|
+
contentBlocks.push(...convertAltChunkPlaceholder(child, childPos, opts));
|
|
258
|
+
break;
|
|
259
|
+
case "blockSdt":
|
|
260
|
+
case "blockCustomXml": convertBoxChildren(child, childPos + 1);
|
|
261
|
+
}
|
|
262
|
+
});
|
|
263
|
+
};
|
|
264
|
+
convertBoxChildren(node, startPos + 1);
|
|
250
265
|
const textBox = {
|
|
251
266
|
kind: "textBox",
|
|
252
267
|
id: nextBlockId(),
|