@stll/folio-core 0.67.0 → 0.69.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 +94 -8
- package/dist/ai-edits/headless.d.ts +36 -21
- package/dist/ai-edits/headless.js +106 -36
- package/dist/ai-edits/index.d.ts +2 -2
- package/dist/ai-edits/newListNumbering.d.ts +14 -1
- package/dist/ai-edits/newListNumbering.js +24 -1
- package/dist/ai-edits/note-references.d.ts +6 -0
- package/dist/ai-edits/note-references.js +7 -1
- package/dist/ai-edits/pending-suggestions.js +2 -2
- package/dist/ai-edits/read.d.ts +19 -0
- package/dist/ai-edits/snapshot.d.ts +6 -0
- package/dist/ai-edits/snapshot.js +8 -3
- 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 +31 -14
- package/dist/controller/canonicalComposition.js +35 -6
- package/dist/controller/canonicalInlineProjection.d.ts +35 -10
- package/dist/controller/canonicalInlineProjection.js +192 -28
- package/dist/controller/canonicalInput.d.ts +2 -1
- package/dist/controller/canonicalInput.js +32 -7
- package/dist/controller/canonicalListRendering.d.ts +2 -1
- package/dist/controller/canonicalListRendering.js +1 -1
- package/dist/controller/canonicalLockGuard.d.ts +23 -0
- package/dist/controller/canonicalLockGuard.js +133 -0
- package/dist/controller/canonicalProjectionBlocks.d.ts +79 -0
- package/dist/controller/canonicalProjectionBlocks.js +75 -0
- package/dist/controller/canonicalPublicOperations.d.ts +12 -4
- package/dist/controller/canonicalPublicOperations.js +676 -46
- package/dist/controller/canonicalSeedContent.d.ts +12 -0
- package/dist/controller/canonicalSeedContent.js +131 -0
- package/dist/controller/canonicalSession.d.ts +133 -21
- package/dist/controller/canonicalSession.js +738 -205
- package/dist/controller/canonicalSourceNormalization.d.ts +21 -0
- package/dist/controller/canonicalSourceNormalization.js +148 -0
- package/dist/controller/canonicalStoryEditor.d.ts +4 -3
- package/dist/controller/canonicalStoryEditor.js +20 -15
- 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 +4 -0
- package/dist/controller/headerFooterEditorManager.d.ts +7 -2
- package/dist/controller/headerFooterEditorManager.js +11 -6
- package/dist/controller/hiddenEditorApi.d.ts +17 -2
- package/dist/controller/hiddenEditorApi.js +4 -0
- package/dist/controller/hiddenEditorManager.d.ts +11 -3
- package/dist/controller/hiddenEditorManager.js +157 -48
- package/dist/controller/layoutPipeline.js +50 -16
- package/dist/controller/layoutSession.d.ts +3 -0
- package/dist/controller/layoutSession.js +3 -1
- package/dist/controller/noteEditorManager.d.ts +7 -2
- package/dist/controller/noteEditorManager.js +11 -6
- package/dist/display-list/build/pageFurniture.js +41 -19
- package/dist/display-list/build/tablePrimitives.js +23 -4
- package/dist/display-list/dom/renderDisplayListToDom.js +13 -11
- package/dist/document-operations.d.ts +9 -1
- 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 +11 -2
- package/dist/docx/canonicalSessionInput.d.ts +5 -1
- package/dist/docx/canonicalSessionInput.js +7 -2
- package/dist/docx/commentAnchorIndex.d.ts +40 -5
- package/dist/docx/commentAnchorIndex.js +94 -12
- 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/contentTypeRegistry.js +1 -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 +27 -0
- package/dist/docx/hostCommentThreads.js +72 -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 +226 -96
- package/dist/docx/listNumberingInstances.d.ts +1 -1
- package/dist/docx/listNumberingInstances.js +2 -2
- 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/numberingIds.d.ts +6 -0
- package/dist/docx/numberingIds.js +6 -1
- package/dist/docx/numberingReferenceNormalization.d.ts +4 -0
- package/dist/docx/numberingReferenceNormalization.js +12 -2
- package/dist/docx/paragraphParser.js +159 -48
- package/dist/docx/paragraphPropertySource.d.ts +29 -0
- package/dist/docx/paragraphPropertySource.js +106 -16
- 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 +8 -0
- package/dist/docx/removeHeaderFooterParts.js +1 -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 +171 -33
- package/dist/docx/rezip.d.ts +6 -0
- package/dist/docx/rezip.js +38 -21
- 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 +5 -2
- 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/partNamespaces.d.ts +1 -1
- package/dist/docx/serializer/partNamespaces.js +1 -1
- 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/build.d.ts +1 -1
- 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/splitRevisionPieces.d.ts +10 -0
- package/dist/docx/splitRevisionPieces.js +14 -0
- package/dist/docx/storyBlockReplay.js +19 -2
- package/dist/docx/structuralXmlPatch.js +44 -11
- 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/verticalMergeProjection.js +1 -1
- package/dist/docx/xmlParser.d.ts +1 -1
- package/dist/docx/xmlParser.js +2 -3
- 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/pageBreakRunDescendantIndex.d.ts +7 -2
- package/dist/internal/pageBreakRunDescendantIndex.js +12 -3
- 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/subtreeHolds.d.ts +12 -0
- package/dist/internal/subtreeHolds.js +25 -0
- package/dist/internal/wholeStoryRevisionResolution.js +1 -1
- package/dist/layout-bridge/cellSelectionHighlight.js +3 -3
- package/dist/layout-bridge/convert/flowBlockPostprocessing.js +20 -12
- package/dist/layout-bridge/convert/flowConversionShared.d.ts +15 -1
- package/dist/layout-bridge/convert/flowConversionShared.js +9 -1
- package/dist/layout-bridge/convert/paragraphAttrs.d.ts +15 -4
- package/dist/layout-bridge/convert/paragraphAttrs.js +11 -4
- package/dist/layout-bridge/convert/paragraphBlockCache.d.ts +26 -0
- package/dist/layout-bridge/convert/paragraphBlockCache.js +137 -0
- package/dist/layout-bridge/convert/paragraphConversion.d.ts +12 -2
- package/dist/layout-bridge/convert/paragraphConversion.js +37 -5
- package/dist/layout-bridge/convert/paragraphRuns.d.ts +2 -2
- package/dist/layout-bridge/convert/sectionBoundaries.js +16 -0
- package/dist/layout-bridge/convert/tableConversion.js +19 -8
- package/dist/layout-bridge/convert/toFlowBlocks.js +144 -15
- package/dist/layout-bridge/convert/topLevelConversion.d.ts +74 -0
- package/dist/layout-bridge/convert/topLevelConversion.js +109 -0
- package/dist/layout-bridge/dom/clickToPositionDom.js +41 -40
- package/dist/layout-bridge/dom/findBodyPmSpans.js +4 -3
- package/dist/layout-bridge/dom/findHfPmSpans.js +10 -15
- package/dist/layout-bridge/dom/imeCaretAnchor.d.ts +8 -0
- package/dist/layout-bridge/dom/imeCaretAnchor.js +71 -7
- package/dist/layout-bridge/dom/textStreamDom.js +3 -2
- package/dist/layout-bridge/engine/blockIndex.d.ts +7 -0
- package/dist/layout-bridge/engine/blockIndex.js +12 -0
- package/dist/layout-bridge/engine/hitTest.js +9 -10
- package/dist/layout-bridge/engine/selectionRects.js +6 -6
- package/dist/layout-bridge/headerFooterLayout.js +12 -11
- package/dist/layout-bridge/tableInsertHover.js +2 -1
- 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.d.ts +2 -0
- package/dist/layout-engine/measure/cache.js +16 -6
- package/dist/layout-engine/measure/measureParagraph.js +1 -1
- package/dist/layout-engine/measure/paragraphKeyMemo.d.ts +8 -0
- package/dist/layout-engine/measure/paragraphKeyMemo.js +92 -0
- package/dist/layout-engine/tableLayout.js +29 -5
- package/dist/layout-engine/tableRowBreak.d.ts +36 -0
- package/dist/layout-engine/tableRowBreak.js +43 -1
- package/dist/layout-engine/types.d.ts +42 -1
- package/dist/layout-painter/imageLayout.js +2 -1
- package/dist/layout-painter/pageShellStyles.d.ts +10 -0
- package/dist/layout-painter/pageShellStyles.js +32 -0
- package/dist/layout-painter/reconcileRenderedContent.d.ts +19 -0
- package/dist/layout-painter/reconcileRenderedContent.js +117 -0
- package/dist/layout-painter/renderFragment.js +4 -6
- package/dist/layout-painter/renderImage.js +2 -2
- package/dist/layout-painter/renderPage.d.ts +4 -4
- package/dist/layout-painter/renderPage.js +54 -46
- package/dist/layout-painter/renderParagraph.js +3 -3
- package/dist/layout-painter/renderTable.js +16 -16
- package/dist/layout-painter/renderTextBox.js +2 -2
- package/dist/layout-painter/sdtBoundary.js +3 -2
- 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/paged-layout/blockGeometry.js +3 -2
- package/dist/paged-layout/editorScrollRoot.d.ts +9 -0
- package/dist/paged-layout/editorScrollRoot.js +10 -1
- package/dist/paged-layout/rangeProjection.js +5 -4
- package/dist/paged-layout/scrollToPmPosition.js +3 -3
- package/dist/paged-layout/selectionViewportRect.d.ts +6 -0
- package/dist/paged-layout/selectionViewportRect.js +8 -2
- 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/attrs/index.js +2 -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 +30 -2
- package/dist/prosemirror/commands/comments.js +189 -18
- package/dist/prosemirror/commands/formatting.d.ts +1 -1
- package/dist/prosemirror/commands/index.d.ts +1 -1
- 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/commentRecords.d.ts +137 -0
- package/dist/prosemirror/commentRecords.js +400 -0
- package/dist/prosemirror/commentReferenceIntegrity.js +3 -4
- package/dist/prosemirror/conversion/fromProseDoc.d.ts +2 -0
- package/dist/prosemirror/conversion/fromProseDoc.js +85 -34
- package/dist/prosemirror/conversion/index.d.ts +2 -2
- package/dist/prosemirror/conversion/toProseDoc.d.ts +140 -4
- package/dist/prosemirror/conversion/toProseDoc.js +432 -76
- package/dist/prosemirror/extensions/StarterKit.js +2 -0
- package/dist/prosemirror/extensions/core/DocExtension.js +1 -1
- package/dist/prosemirror/extensions/features/AutoBidiDetectionExtension.d.ts +1 -1
- package/dist/prosemirror/extensions/features/JoinedRunStyleExtension.d.ts +1 -1
- package/dist/prosemirror/extensions/features/ParaIdAllocatorExtension.d.ts +1 -1
- package/dist/prosemirror/extensions/features/ParagraphChangeTrackerExtension.d.ts +23 -1
- package/dist/prosemirror/extensions/features/ParagraphChangeTrackerExtension.js +61 -32
- package/dist/prosemirror/extensions/features/pastedHtmlLists.js +5 -4
- package/dist/prosemirror/extensions/marks/CommentExtension.js +8 -3
- package/dist/prosemirror/extensions/nodes/BlockCommentRangeBoundaryExtension.d.ts +4 -0
- package/dist/prosemirror/extensions/nodes/BlockCommentRangeBoundaryExtension.js +49 -0
- package/dist/prosemirror/extensions/nodes/CommentReferenceExtension.js +3 -1
- package/dist/prosemirror/extensions/nodes/ImageExtension.js +12 -3
- package/dist/prosemirror/extensions/nodes/TableExtension.js +32 -31
- package/dist/prosemirror/extensions/nodes/TextBoxExtension.js +1 -1
- package/dist/prosemirror/index.d.ts +3 -3
- 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/nativeSelection.d.ts +33 -0
- package/dist/prosemirror/nativeSelection.js +74 -0
- package/dist/prosemirror/noteReferenceReview.js +2 -2
- package/dist/prosemirror/numberedRefFields.d.ts +2 -0
- package/dist/prosemirror/numberedRefFields.js +16 -5
- package/dist/prosemirror/paragraphMarkJoin.d.ts +6 -8
- package/dist/prosemirror/paragraphMarkJoin.js +155 -16
- package/dist/prosemirror/plugins/contentControlWidgets.js +2 -2
- package/dist/prosemirror/plugins/documentNumbering.js +37 -15
- package/dist/prosemirror/plugins/suggestionMode.js +33 -10
- 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/runFormattingFromMarks.d.ts +0 -1
- package/dist/prosemirror/runFormattingFromMarks.js +2 -4
- package/dist/prosemirror/runFormattingReconciliation.js +2 -2
- package/dist/prosemirror/runIdentityAcrossRevisions.d.ts +23 -1
- package/dist/prosemirror/runIdentityAcrossRevisions.js +57 -8
- 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 +13 -1
- package/dist/prosemirror/storyListNumbering.js +7 -2
- package/dist/prosemirror/styles/paragraphStyleCascade.js +2 -2
- package/dist/prosemirror/tableResize.d.ts +10 -9
- package/dist/prosemirror/tableResize.js +60 -49
- package/dist/prosemirror/textInput.d.ts +30 -1
- package/dist/prosemirror/textInput.js +144 -17
- package/dist/prosemirror/utils/visualLineNavigation.js +20 -18
- package/dist/prosemirror/validation.d.ts +19 -0
- package/dist/prosemirror/validation.js +79 -5
- package/dist/redline.js +23 -9
- package/dist/render-dom/HeaderFooterSelectionOverlay.js +5 -4
- package/dist/render-dom/RenderedDomContext.js +7 -6
- package/dist/server.d.ts +2 -2
- package/dist/style-sets/extract.js +2 -2
- package/dist/types/canonicalCapabilities.d.ts +38 -16
- package/dist/types/canonicalCapabilities.js +21 -18
- package/dist/utils/cssString.d.ts +7 -0
- package/dist/utils/cssString.js +9 -0
- package/dist/utils/findMatchView.js +4 -3
- package/dist/utils/fontResolver.js +4 -1
- package/dist/utils/formatToStyle.d.ts +1 -1
- package/dist/utils/mergeDocumentContent.js +2 -2
- package/dist/utils/paintedPositions.d.ts +60 -0
- package/dist/utils/paintedPositions.js +101 -0
- 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 -3
|
@@ -337,6 +337,8 @@ const messages = { "folio": {
|
|
|
337
337
|
"editSessionTakenOver": "Cette session de modification a été reprise ailleurs.",
|
|
338
338
|
"editor": {
|
|
339
339
|
"accessibleName": "Éditeur de documents",
|
|
340
|
+
"changeUnavailable": "Cette modification n'est pas encore possible ici.",
|
|
341
|
+
"contentLocked": "Cette partie du document est verrouillée.",
|
|
340
342
|
"editing": "Modification",
|
|
341
343
|
"editingDescription": "Modifier directement le document",
|
|
342
344
|
"outlineDepthAll": "Tous les niveaux",
|
|
@@ -632,6 +634,7 @@ const messages = { "folio": {
|
|
|
632
634
|
"watermark": "Filigrane"
|
|
633
635
|
},
|
|
634
636
|
"trackedChanges": {
|
|
637
|
+
"heldByLock": "Un contrôle de contenu verrouillé empêche d’accepter ou de refuser cette modification.",
|
|
635
638
|
"replaced": "Remplacé",
|
|
636
639
|
"unknown": "Inconnu",
|
|
637
640
|
"with": "par"
|
|
@@ -337,6 +337,8 @@ const messages = { "folio": {
|
|
|
337
337
|
"editSessionTakenOver": "כרטיסייה, חלון או מכשיר אחר פתחו מסמך זה לעריכה, ולכן הפעלה זו שוחררה. שינויים מקומיים שלא נשמרו נשמרו — פתח מחדש את המסמך כדי להמשיך.",
|
|
338
338
|
"editor": {
|
|
339
339
|
"accessibleName": "עורך מסמכים",
|
|
340
|
+
"changeUnavailable": "עדיין לא ניתן לבצע את השינוי הזה כאן.",
|
|
341
|
+
"contentLocked": "חלק זה של המסמך נעול.",
|
|
340
342
|
"editing": "עריכה",
|
|
341
343
|
"editingDescription": "ערוך את המסמך ישירות",
|
|
342
344
|
"outlineDepthAll": "כל הרמות",
|
|
@@ -632,6 +634,7 @@ const messages = { "folio": {
|
|
|
632
634
|
"watermark": "סימן מים"
|
|
633
635
|
},
|
|
634
636
|
"trackedChanges": {
|
|
637
|
+
"heldByLock": "פקד תוכן נעול מונע קבלה או דחייה של שינוי זה.",
|
|
635
638
|
"replaced": "הוחלף",
|
|
636
639
|
"unknown": "לא ידוע",
|
|
637
640
|
"with": "ב-"
|
|
@@ -337,6 +337,8 @@ const messages = { "folio": {
|
|
|
337
337
|
"editSessionTakenOver": "किसी अन्य टैब, विंडो या डिवाइस ने इस दस्तावेज़ को संपादन के लिए खोला, इसलिए यह सत्र बंद कर दिया गया। सहेजे नहीं गए स्थानीय परिवर्तन सुरक्षित हैं — जारी रखने के लिए दस्तावेज़ फिर से खोलें।",
|
|
338
338
|
"editor": {
|
|
339
339
|
"accessibleName": "दस्तावेज़ संपादक",
|
|
340
|
+
"changeUnavailable": "यह बदलाव अभी यहाँ नहीं किया जा सकता।",
|
|
341
|
+
"contentLocked": "दस्तावेज़ का यह हिस्सा लॉक है।",
|
|
340
342
|
"editing": "संपादन",
|
|
341
343
|
"editingDescription": "दस्तावेज़ को सीधे संपादित करें",
|
|
342
344
|
"outlineDepthAll": "सभी स्तर",
|
|
@@ -632,6 +634,7 @@ const messages = { "folio": {
|
|
|
632
634
|
"watermark": "वॉटरमार्क"
|
|
633
635
|
},
|
|
634
636
|
"trackedChanges": {
|
|
637
|
+
"heldByLock": "एक लॉक किया गया सामग्री नियंत्रण इस परिवर्तन को स्वीकार या अस्वीकार करने से रोकता है।",
|
|
635
638
|
"replaced": "बदला गया",
|
|
636
639
|
"unknown": "अज्ञात",
|
|
637
640
|
"with": "से"
|
|
@@ -337,6 +337,8 @@ const messages = { "folio": {
|
|
|
337
337
|
"editSessionTakenOver": "Ezt a szerkesztési munkamenetet máshol vették át.",
|
|
338
338
|
"editor": {
|
|
339
339
|
"accessibleName": "Dokumentumszerkesztő",
|
|
340
|
+
"changeUnavailable": "Ez a módosítás itt még nem hajtható végre.",
|
|
341
|
+
"contentLocked": "A dokumentum ezen része zárolva van.",
|
|
340
342
|
"editing": "Szerkesztés",
|
|
341
343
|
"editingDescription": "A dokumentum közvetlen szerkesztése",
|
|
342
344
|
"outlineDepthAll": "Minden szint",
|
|
@@ -632,6 +634,7 @@ const messages = { "folio": {
|
|
|
632
634
|
"watermark": "Vízjel"
|
|
633
635
|
},
|
|
634
636
|
"trackedChanges": {
|
|
637
|
+
"heldByLock": "Egy zárolt tartalomvezérlő megakadályozza a módosítás elfogadását vagy elutasítását.",
|
|
635
638
|
"replaced": "Lecserélve",
|
|
636
639
|
"unknown": "Ismeretlen",
|
|
637
640
|
"with": "erre:"
|
|
@@ -337,6 +337,8 @@ const messages = { "folio": {
|
|
|
337
337
|
"editSessionTakenOver": "Ši redagavimo sesija buvo perimta kitur.",
|
|
338
338
|
"editor": {
|
|
339
339
|
"accessibleName": "Dokumentų redaktorius",
|
|
340
|
+
"changeUnavailable": "Šio pakeitimo čia dar negalima atlikti.",
|
|
341
|
+
"contentLocked": "Ši dokumento dalis užrakinta.",
|
|
340
342
|
"editing": "Redagavimas",
|
|
341
343
|
"editingDescription": "Redaguokite dokumentą tiesiogiai",
|
|
342
344
|
"outlineDepthAll": "Visi lygiai",
|
|
@@ -632,6 +634,7 @@ const messages = { "folio": {
|
|
|
632
634
|
"watermark": "Vandens ženklas"
|
|
633
635
|
},
|
|
634
636
|
"trackedChanges": {
|
|
637
|
+
"heldByLock": "Užrakintas turinio valdiklis neleidžia priimti ar atmesti šio pakeitimo.",
|
|
635
638
|
"replaced": "Pakeista",
|
|
636
639
|
"unknown": "Nežinoma",
|
|
637
640
|
"with": "į"
|
|
@@ -337,6 +337,8 @@ const messages = { "folio": {
|
|
|
337
337
|
"editSessionTakenOver": "Šo rediģēšanas sesiju pārņēma citur.",
|
|
338
338
|
"editor": {
|
|
339
339
|
"accessibleName": "Dokumentu redaktors",
|
|
340
|
+
"changeUnavailable": "Šīs izmaiņas šeit vēl nevar veikt.",
|
|
341
|
+
"contentLocked": "Šī dokumenta daļa ir bloķēta.",
|
|
340
342
|
"editing": "Rediģēšana",
|
|
341
343
|
"editingDescription": "Rediģējiet dokumentu tieši",
|
|
342
344
|
"outlineDepthAll": "Visi līmeņi",
|
|
@@ -632,6 +634,7 @@ const messages = { "folio": {
|
|
|
632
634
|
"watermark": "Ūdenszīme"
|
|
633
635
|
},
|
|
634
636
|
"trackedChanges": {
|
|
637
|
+
"heldByLock": "Bloķēta satura vadīkla neļauj pieņemt vai noraidīt šīs izmaiņas.",
|
|
635
638
|
"replaced": "Aizstāts",
|
|
636
639
|
"unknown": "Nezināms",
|
|
637
640
|
"with": "ar"
|
|
@@ -337,6 +337,8 @@ type Messages = {
|
|
|
337
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.";
|
|
338
338
|
"editor": {
|
|
339
339
|
"accessibleName": "Document editor";
|
|
340
|
+
"changeUnavailable": "This change can't be made here yet.";
|
|
341
|
+
"contentLocked": "This part of the document is locked.";
|
|
340
342
|
"editing": "Editing";
|
|
341
343
|
"editingDescription": "Edit the document directly";
|
|
342
344
|
"outlineDepthAll": "All levels";
|
|
@@ -632,6 +634,7 @@ type Messages = {
|
|
|
632
634
|
"watermark": "Watermark";
|
|
633
635
|
};
|
|
634
636
|
"trackedChanges": {
|
|
637
|
+
"heldByLock": "A locked content control prevents accepting or rejecting this change.";
|
|
635
638
|
"replaced": "Replaced";
|
|
636
639
|
"unknown": "Unknown";
|
|
637
640
|
"with": "with";
|
|
@@ -337,6 +337,8 @@ const messages = { "folio": {
|
|
|
337
337
|
"editSessionTakenOver": "Ta sesja edycji została przejęta gdzie indziej.",
|
|
338
338
|
"editor": {
|
|
339
339
|
"accessibleName": "Edytor dokumentów",
|
|
340
|
+
"changeUnavailable": "Tej zmiany nie można jeszcze tu wprowadzić.",
|
|
341
|
+
"contentLocked": "Ta część dokumentu jest zablokowana.",
|
|
340
342
|
"editing": "Edytowanie",
|
|
341
343
|
"editingDescription": "Edytuj dokument bezpośrednio",
|
|
342
344
|
"outlineDepthAll": "Wszystkie poziomy",
|
|
@@ -632,6 +634,7 @@ const messages = { "folio": {
|
|
|
632
634
|
"watermark": "Znak wodny"
|
|
633
635
|
},
|
|
634
636
|
"trackedChanges": {
|
|
637
|
+
"heldByLock": "Zablokowana kontrolka zawartości uniemożliwia zaakceptowanie lub odrzucenie tej zmiany.",
|
|
635
638
|
"replaced": "Zamieniono",
|
|
636
639
|
"unknown": "Nieznane",
|
|
637
640
|
"with": "na"
|
|
@@ -337,6 +337,8 @@ const messages = { "folio": {
|
|
|
337
337
|
"editSessionTakenOver": "Esta sessão de edição foi assumida em outro lugar.",
|
|
338
338
|
"editor": {
|
|
339
339
|
"accessibleName": "Editor de documentos",
|
|
340
|
+
"changeUnavailable": "Ainda não é possível fazer esta alteração aqui.",
|
|
341
|
+
"contentLocked": "Esta parte do documento está bloqueada.",
|
|
340
342
|
"editing": "Editando",
|
|
341
343
|
"editingDescription": "Edite o documento diretamente",
|
|
342
344
|
"outlineDepthAll": "Todos os níveis",
|
|
@@ -632,6 +634,7 @@ const messages = { "folio": {
|
|
|
632
634
|
"watermark": "Marca-d'água"
|
|
633
635
|
},
|
|
634
636
|
"trackedChanges": {
|
|
637
|
+
"heldByLock": "Um controle de conteúdo bloqueado impede que esta alteração seja aceita ou rejeitada.",
|
|
635
638
|
"replaced": "Substituído",
|
|
636
639
|
"unknown": "Desconhecido",
|
|
637
640
|
"with": "por"
|
|
@@ -337,6 +337,8 @@ const messages = { "folio": {
|
|
|
337
337
|
"editSessionTakenOver": "Túto reláciu úprav prevzalo iné okno.",
|
|
338
338
|
"editor": {
|
|
339
339
|
"accessibleName": "Editor dokumentov",
|
|
340
|
+
"changeUnavailable": "Túto zmenu tu zatiaľ nemožno vykonať.",
|
|
341
|
+
"contentLocked": "Táto časť dokumentu je uzamknutá.",
|
|
340
342
|
"editing": "Úpravy",
|
|
341
343
|
"editingDescription": "Upravujte dokument priamo",
|
|
342
344
|
"outlineDepthAll": "Všetky úrovne",
|
|
@@ -632,6 +634,7 @@ const messages = { "folio": {
|
|
|
632
634
|
"watermark": "Vodotlač"
|
|
633
635
|
},
|
|
634
636
|
"trackedChanges": {
|
|
637
|
+
"heldByLock": "Uzamknutý ovládací prvok obsahu bráni prijatiu alebo odmietnutiu tejto zmeny.",
|
|
635
638
|
"replaced": "Nahradené",
|
|
636
639
|
"unknown": "Neznáme",
|
|
637
640
|
"with": "za"
|
|
@@ -337,6 +337,8 @@ const messages = { "folio": {
|
|
|
337
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.",
|
|
338
338
|
"editor": {
|
|
339
339
|
"accessibleName": "Belge düzenleyici",
|
|
340
|
+
"changeUnavailable": "Bu değişiklik henüz burada yapılamıyor.",
|
|
341
|
+
"contentLocked": "Belgenin bu bölümü kilitli.",
|
|
340
342
|
"editing": "Düzenleme",
|
|
341
343
|
"editingDescription": "Belgeyi doğrudan düzenleyin",
|
|
342
344
|
"outlineDepthAll": "Tüm düzeyler",
|
|
@@ -632,6 +634,7 @@ const messages = { "folio": {
|
|
|
632
634
|
"watermark": "Filigran"
|
|
633
635
|
},
|
|
634
636
|
"trackedChanges": {
|
|
637
|
+
"heldByLock": "Kilitli bir içerik denetimi bu değişikliğin kabul edilmesini veya reddedilmesini engelliyor.",
|
|
635
638
|
"replaced": "Değiştirildi",
|
|
636
639
|
"unknown": "Bilinmiyor",
|
|
637
640
|
"with": "yerine"
|
|
@@ -337,6 +337,8 @@ const messages = { "folio": {
|
|
|
337
337
|
"editSessionTakenOver": "另一个标签页、窗口或设备已打开此文档进行编辑,因此本会话已释放。未保存的本地更改会保留,请重新打开文档以继续。",
|
|
338
338
|
"editor": {
|
|
339
339
|
"accessibleName": "文档编辑器",
|
|
340
|
+
"changeUnavailable": "暂时无法在此处进行此更改。",
|
|
341
|
+
"contentLocked": "文档的这一部分已锁定。",
|
|
340
342
|
"editing": "编辑",
|
|
341
343
|
"editingDescription": "直接编辑文档",
|
|
342
344
|
"outlineDepthAll": "所有级别",
|
|
@@ -632,6 +634,7 @@ const messages = { "folio": {
|
|
|
632
634
|
"watermark": "水印"
|
|
633
635
|
},
|
|
634
636
|
"trackedChanges": {
|
|
637
|
+
"heldByLock": "已锁定的内容控件阻止接受或拒绝此修订。",
|
|
635
638
|
"replaced": "已替换",
|
|
636
639
|
"unknown": "未知",
|
|
637
640
|
"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":
|
|
@@ -2,5 +2,10 @@ import { Node } from "prosemirror-model";
|
|
|
2
2
|
export type PageBreakRunDescendantIndex = {
|
|
3
3
|
firstPageBreakRunPosition: (node: Node) => number | undefined;
|
|
4
4
|
};
|
|
5
|
-
/**
|
|
6
|
-
|
|
5
|
+
/**
|
|
6
|
+
* Build one identity-scoped index for a single layout conversion. Subtrees
|
|
7
|
+
* without a page break run hold no answer, so the walk skips them.
|
|
8
|
+
*/
|
|
9
|
+
export declare const buildPageBreakRunDescendantIndex: (doc: Node) => PageBreakRunDescendantIndex;
|
|
10
|
+
/** The index built visiting every node, skipping none: the reference for the skip. */
|
|
11
|
+
export declare const buildPageBreakRunDescendantIndexVisitingEveryNode: (doc: Node) => PageBreakRunDescendantIndex;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { subtreeHolds } from "./subtreeHolds.js";
|
|
1
2
|
// src/internal/pageBreakRunDescendantIndex.ts
|
|
2
3
|
const indexesPageBreakDescendants = (node) => {
|
|
3
4
|
switch (node.type.name) {
|
|
@@ -8,12 +9,13 @@ const indexesPageBreakDescendants = (node) => {
|
|
|
8
9
|
default: return false;
|
|
9
10
|
}
|
|
10
11
|
};
|
|
11
|
-
|
|
12
|
-
const
|
|
12
|
+
const holdsPageBreakRun = subtreeHolds((node) => node.type.name === "pageBreakRun");
|
|
13
|
+
const buildIndex = (doc, skip) => {
|
|
13
14
|
const positions = /* @__PURE__ */ new WeakMap();
|
|
14
15
|
const visitNode = (node, startPos) => {
|
|
15
16
|
let firstPosition = node.type.name === "pageBreakRun" ? startPos : void 0;
|
|
16
17
|
node.forEach((child, offset) => {
|
|
18
|
+
if (skip(child)) return;
|
|
17
19
|
const descendantPosition = visitNode(child, startPos + 1 + offset);
|
|
18
20
|
firstPosition ??= descendantPosition;
|
|
19
21
|
});
|
|
@@ -23,4 +25,11 @@ const buildPageBreakRunDescendantIndex = (doc) => {
|
|
|
23
25
|
visitNode(doc, -1);
|
|
24
26
|
return { firstPageBreakRunPosition: (node) => positions.get(node) };
|
|
25
27
|
};
|
|
26
|
-
|
|
28
|
+
/**
|
|
29
|
+
* Build one identity-scoped index for a single layout conversion. Subtrees
|
|
30
|
+
* without a page break run hold no answer, so the walk skips them.
|
|
31
|
+
*/
|
|
32
|
+
const buildPageBreakRunDescendantIndex = (doc) => buildIndex(doc, (node) => !holdsPageBreakRun(node));
|
|
33
|
+
/** The index built visiting every node, skipping none: the reference for the skip. */
|
|
34
|
+
const buildPageBreakRunDescendantIndexVisitingEveryNode = (doc) => buildIndex(doc, () => false);
|
|
35
|
+
export { buildPageBreakRunDescendantIndex, buildPageBreakRunDescendantIndexVisitingEveryNode };
|
|
@@ -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;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Node } from "prosemirror-model";
|
|
2
|
+
/**
|
|
3
|
+
* Whether a node, or any node under it, is one `carries` names, decided once
|
|
4
|
+
* per node.
|
|
5
|
+
*
|
|
6
|
+
* ProseMirror nodes are immutable and an edit shares every subtree it does
|
|
7
|
+
* not touch, so a walk that only needs the nodes `carries` names can skip
|
|
8
|
+
* every child this answers `false` for: an edit then costs the path it
|
|
9
|
+
* changed, not every node of the document. Leaves are answered directly
|
|
10
|
+
* rather than kept.
|
|
11
|
+
*/
|
|
12
|
+
export declare const subtreeHolds: (carries: (node: Node) => boolean) => ((node: Node) => boolean);
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
// src/internal/subtreeHolds.ts
|
|
2
|
+
/**
|
|
3
|
+
* Whether a node, or any node under it, is one `carries` names, decided once
|
|
4
|
+
* per node.
|
|
5
|
+
*
|
|
6
|
+
* ProseMirror nodes are immutable and an edit shares every subtree it does
|
|
7
|
+
* not touch, so a walk that only needs the nodes `carries` names can skip
|
|
8
|
+
* every child this answers `false` for: an edit then costs the path it
|
|
9
|
+
* changed, not every node of the document. Leaves are answered directly
|
|
10
|
+
* rather than kept.
|
|
11
|
+
*/
|
|
12
|
+
const subtreeHolds = (carries) => {
|
|
13
|
+
const known = /* @__PURE__ */ new WeakMap();
|
|
14
|
+
const holds = (node) => {
|
|
15
|
+
if (node.childCount === 0) return carries(node);
|
|
16
|
+
const kept = known.get(node);
|
|
17
|
+
if (kept !== void 0) return kept;
|
|
18
|
+
let held = carries(node);
|
|
19
|
+
for (let index = 0; !held && index < node.childCount; index += 1) held = holds(node.child(index));
|
|
20
|
+
known.set(node, held);
|
|
21
|
+
return held;
|
|
22
|
+
};
|
|
23
|
+
return holds;
|
|
24
|
+
};
|
|
25
|
+
export { subtreeHolds };
|
|
@@ -431,7 +431,7 @@ const resolveStructure = ({ node, position, context }) => {
|
|
|
431
431
|
});
|
|
432
432
|
pendingBookmarks = [];
|
|
433
433
|
}
|
|
434
|
-
const joinedAttrs = joinedParagraphAttrs(paragraph, chain.node);
|
|
434
|
+
const joinedAttrs = joinedParagraphAttrs(paragraph, chain.node, bookmarks.size);
|
|
435
435
|
if (joinedAttrs !== chain.node.attrs) chain.node = recreateProseNodeWithParagraphPropertySource(chain.node, { attrs: joinedAttrs });
|
|
436
436
|
const displacedToken = getProseParagraphPropertySourceToken(paragraph);
|
|
437
437
|
const selectedToken = getProseParagraphPropertySourceToken(chain.node);
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { readPaintedStart } from "../utils/paintedPositions.js";
|
|
1
2
|
// src/layout-bridge/cellSelectionHighlight.ts
|
|
2
3
|
/**
|
|
3
4
|
* Apply the `.layout-table-cell-selected` class to painted layout cells
|
|
@@ -23,9 +24,8 @@ function applyCellSelectionHighlight(pagesContainer, state, options = {}) {
|
|
|
23
24
|
});
|
|
24
25
|
const allCells = pagesContainer.querySelectorAll(scopeSelector);
|
|
25
26
|
for (const cellEl of Array.from(allCells)) {
|
|
26
|
-
const
|
|
27
|
-
if (
|
|
28
|
-
const pmPos = Number(pmStartAttr);
|
|
27
|
+
const pmPos = readPaintedStart(cellEl);
|
|
28
|
+
if (pmPos === void 0) continue;
|
|
29
29
|
for (const [start, end] of selectedRanges) if (pmPos >= start && pmPos < end) {
|
|
30
30
|
cellEl.classList.add("layout-table-cell-selected");
|
|
31
31
|
break;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { getParagraphFrame, setParagraphFrame } from "../../utils/paragraphFrame.js";
|
|
1
2
|
import { headingLevelOf } from "@stll/docx-core/model";
|
|
2
3
|
// src/layout-bridge/convert/flowBlockPostprocessing.ts
|
|
3
4
|
/**
|
|
@@ -6,6 +7,22 @@ import { headingLevelOf } from "@stll/docx-core/model";
|
|
|
6
7
|
* merging.
|
|
7
8
|
*/
|
|
8
9
|
/**
|
|
10
|
+
* `block` with `attrs` added, as a new block in its place: the list's blocks
|
|
11
|
+
* may be kept from an earlier conversion, so they are never written.
|
|
12
|
+
*/
|
|
13
|
+
function replaceParagraphAttrs(blocks, index, block, attrs) {
|
|
14
|
+
const replaced = {
|
|
15
|
+
...block,
|
|
16
|
+
attrs: {
|
|
17
|
+
...block.attrs,
|
|
18
|
+
...attrs
|
|
19
|
+
}
|
|
20
|
+
};
|
|
21
|
+
const frame = getParagraphFrame(block);
|
|
22
|
+
if (frame !== void 0) setParagraphFrame(replaced, frame);
|
|
23
|
+
blocks[index] = replaced;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
9
26
|
* Word keeps a final empty body paragraph after a table as an editable anchor,
|
|
10
27
|
* but that final anchor does not create a page of its own. Earlier authored
|
|
11
28
|
* empty paragraphs retain their height and may carry the document onto a blank
|
|
@@ -22,28 +39,19 @@ function suppressFinalEmptyParagraphAfterTable(blocks) {
|
|
|
22
39
|
while (suffixStart > 0 && isPaintlessTerminalParagraph(blocks[suffixStart - 1])) suffixStart -= 1;
|
|
23
40
|
if (suffixStart === blocks.length || suffixStart === 0 || blocks[suffixStart - 1]?.kind !== "table") return;
|
|
24
41
|
const finalBlock = blocks.at(-1);
|
|
25
|
-
if (isPaintlessTerminalParagraph(finalBlock))
|
|
26
|
-
...finalBlock.attrs,
|
|
27
|
-
suppressEmptyParagraphHeight: true
|
|
28
|
-
};
|
|
42
|
+
if (isPaintlessTerminalParagraph(finalBlock)) replaceParagraphAttrs(blocks, blocks.length - 1, finalBlock, { suppressEmptyParagraphHeight: true });
|
|
29
43
|
}
|
|
30
44
|
function suppressFinalParagraphInRepeatedEmptySuffix(blocks) {
|
|
31
45
|
let suffixStart = blocks.length;
|
|
32
46
|
while (suffixStart > 0 && isPaintlessTerminalParagraph(blocks[suffixStart - 1])) suffixStart -= 1;
|
|
33
47
|
if (suffixStart === 0 || blocks.length - suffixStart < 2 || blocks[suffixStart - 1]?.kind === "table") return;
|
|
34
48
|
const finalBlock = blocks.at(-1);
|
|
35
|
-
if (isPaintlessTerminalParagraph(finalBlock))
|
|
36
|
-
...finalBlock.attrs,
|
|
37
|
-
suppressEmptyParagraphHeight: true
|
|
38
|
-
};
|
|
49
|
+
if (isPaintlessTerminalParagraph(finalBlock)) replaceParagraphAttrs(blocks, blocks.length - 1, finalBlock, { suppressEmptyParagraphHeight: true });
|
|
39
50
|
}
|
|
40
51
|
function reserveLeadingEmptyOutlineHeight(blocks) {
|
|
41
52
|
const firstBlock = blocks.at(0);
|
|
42
53
|
if (firstBlock?.kind !== "paragraph" || firstBlock.runs.length !== 0 || headingLevelOf(firstBlock.attrs?.outlineLevel) !== 0) return;
|
|
43
|
-
firstBlock
|
|
44
|
-
...firstBlock.attrs,
|
|
45
|
-
reserveEmptyOutlineHeight: true
|
|
46
|
-
};
|
|
54
|
+
replaceParagraphAttrs(blocks, 0, firstBlock, { reserveEmptyOutlineHeight: true });
|
|
47
55
|
}
|
|
48
56
|
/**
|
|
49
57
|
* Merge consecutive paragraph blocks where the first carries
|
|
@@ -4,6 +4,7 @@ import { ListCounterStreams } from "../../prosemirror/listMarker.js";
|
|
|
4
4
|
import { DocumentFontFacts } from "../../fonts/documentFontFacts.js";
|
|
5
5
|
import { ParagraphAttrs, ParagraphBlock, TableBlock } from "../../layout-engine/types.js";
|
|
6
6
|
import { FontAlternates } from "../../fonts/fontAlternates.js";
|
|
7
|
+
import { ParagraphBlockCache } from "./paragraphBlockCache.js";
|
|
7
8
|
import { Node } from "prosemirror-model";
|
|
8
9
|
/**
|
|
9
10
|
* Options for the conversion.
|
|
@@ -103,6 +104,11 @@ export type ToFlowBlocksOptions = {
|
|
|
103
104
|
* longer the document's last and keeps its height.
|
|
104
105
|
*/
|
|
105
106
|
trailingEndnoteIds?: ReadonlySet<number>;
|
|
107
|
+
/**
|
|
108
|
+
* Paragraph blocks kept from earlier conversions of the same editor's
|
|
109
|
+
* document. Conversion gives the same blocks with or without it.
|
|
110
|
+
*/
|
|
111
|
+
paragraphBlocks?: ParagraphBlockCache;
|
|
106
112
|
};
|
|
107
113
|
export type FlowConversionOptions = ToFlowBlocksOptions & {
|
|
108
114
|
firstPageBreakRunPosition: (node: Node) => number | undefined;
|
|
@@ -113,6 +119,10 @@ export type FlowConversionOptions = ToFlowBlocksOptions & {
|
|
|
113
119
|
textBoxAnchorBlockIds: Map<string, ParagraphBlock["id"]>;
|
|
114
120
|
styleResolver: RunStyleResolver;
|
|
115
121
|
};
|
|
122
|
+
/** The options holding list counter state, which each paragraph advances in story order. */
|
|
123
|
+
export type ListCounterOptionKey = "listCounters" | "listAbstractCounters" | "listSeenNumIds" | "originalListCounters" | "originalListAbstractCounters" | "originalListSeenNumIds" | "listCounterStreams";
|
|
124
|
+
/** The conversion options without list counter state: what converting one paragraph at a known list marker reads. */
|
|
125
|
+
export type CounterFreeFlowConversionOptions = Omit<FlowConversionOptions, ListCounterOptionKey>;
|
|
116
126
|
/**
|
|
117
127
|
* Convert twips to pixels (1 twip = 1/1440 inch, 1 inch = 96 CSS px).
|
|
118
128
|
* No rounding — precision prevents cumulative layout drift across paragraphs.
|
|
@@ -122,4 +132,8 @@ export declare function nextBlockId(): string;
|
|
|
122
132
|
/**
|
|
123
133
|
* Reset the block ID counter (useful for testing).
|
|
124
134
|
*/
|
|
125
|
-
export declare function resetBlockIdCounter(): void;
|
|
135
|
+
export declare function resetBlockIdCounter(): void;
|
|
136
|
+
/** How many block ids the current conversion has handed out. */
|
|
137
|
+
export declare function blockIdsHandedOut(): number;
|
|
138
|
+
/** Hand out `count` ids without making blocks: blocks kept from before hold them. */
|
|
139
|
+
export declare function skipBlockIds(count: number): void;
|
|
@@ -29,4 +29,12 @@ function nextBlockId() {
|
|
|
29
29
|
function resetBlockIdCounter() {
|
|
30
30
|
blockIdCounter = 0;
|
|
31
31
|
}
|
|
32
|
-
|
|
32
|
+
/** How many block ids the current conversion has handed out. */
|
|
33
|
+
function blockIdsHandedOut() {
|
|
34
|
+
return blockIdCounter;
|
|
35
|
+
}
|
|
36
|
+
/** Hand out `count` ids without making blocks: blocks kept from before hold them. */
|
|
37
|
+
function skipBlockIds(count) {
|
|
38
|
+
blockIdCounter += count;
|
|
39
|
+
}
|
|
40
|
+
export { ALT_CHUNK_CONTENT, blockIdsHandedOut, nextBlockId, resetBlockIdCounter, skipBlockIds, twipsToPixels };
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
import { document_d_exports } from "../../types/document.js";
|
|
2
2
|
import { ParagraphAttrs } from "../../prosemirror/schema/nodes.js";
|
|
3
|
-
import { ListCounterStreams } from "../../prosemirror/listMarker.js";
|
|
3
|
+
import { ListCounterStreams, VisibleListMarker } from "../../prosemirror/listMarker.js";
|
|
4
4
|
import { ParagraphAttrs as ParagraphAttrs$1 } from "../../layout-engine/types.js";
|
|
5
5
|
import { FontAlternates } from "../../fonts/fontAlternates.js";
|
|
6
|
-
|
|
6
|
+
/** The marker the list counters give a paragraph where it sits in its story. */
|
|
7
|
+
export type ParagraphListMarker = VisibleListMarker["marker"];
|
|
8
|
+
/** What a paragraph's layout attributes read besides its own attributes and list marker. */
|
|
9
|
+
type ParagraphAttrsInputs = {
|
|
7
10
|
theme: document_d_exports.Theme | null | undefined;
|
|
8
11
|
fontAlternates: FontAlternates | undefined;
|
|
9
|
-
listCounterStreams: ListCounterStreams;
|
|
10
12
|
defaultTabStopTwips: number | undefined;
|
|
11
13
|
/**
|
|
12
14
|
* Resolved paragraph-mark run properties, the base of the list marker's
|
|
@@ -14,5 +16,14 @@ type ConvertParagraphAttrsOptions = {
|
|
|
14
16
|
*/
|
|
15
17
|
paragraphMarkFormatting: () => document_d_exports.TextFormatting | undefined;
|
|
16
18
|
};
|
|
17
|
-
|
|
19
|
+
type ConvertParagraphAttrsOptions = ParagraphAttrsInputs & {
|
|
20
|
+
listCounterStreams: ListCounterStreams;
|
|
21
|
+
};
|
|
22
|
+
/** A paragraph's layout attributes, advancing the list counters past it. */
|
|
23
|
+
export declare function convertParagraphAttrs(pmAttrs: ParagraphAttrs, { listCounterStreams, ...inputs }: ConvertParagraphAttrsOptions): ParagraphAttrs$1;
|
|
24
|
+
/**
|
|
25
|
+
* A paragraph's layout attributes given the marker the list counters give it.
|
|
26
|
+
* The marker is the only input that depends on the paragraphs before it.
|
|
27
|
+
*/
|
|
28
|
+
export declare function paragraphAttrsWithListMarker(pmAttrs: ParagraphAttrs, listMarker: ParagraphListMarker, { theme, fontAlternates, defaultTabStopTwips, paragraphMarkFormatting }: ParagraphAttrsInputs): ParagraphAttrs$1;
|
|
18
29
|
export {};
|
|
@@ -48,7 +48,15 @@ const resolveFlowAlignment = (alignment, rightToLeft) => {
|
|
|
48
48
|
default: return flow;
|
|
49
49
|
}
|
|
50
50
|
};
|
|
51
|
-
|
|
51
|
+
/** A paragraph's layout attributes, advancing the list counters past it. */
|
|
52
|
+
function convertParagraphAttrs(pmAttrs, { listCounterStreams, ...inputs }) {
|
|
53
|
+
return paragraphAttrsWithListMarker(pmAttrs, advanceVisibleListMarker(pmAttrs, listCounterStreams).marker, inputs);
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* A paragraph's layout attributes given the marker the list counters give it.
|
|
57
|
+
* The marker is the only input that depends on the paragraphs before it.
|
|
58
|
+
*/
|
|
59
|
+
function paragraphAttrsWithListMarker(pmAttrs, listMarker, { theme, fontAlternates, defaultTabStopTwips, paragraphMarkFormatting }) {
|
|
52
60
|
const attrs = {};
|
|
53
61
|
if (pmAttrs.alignment) attrs.alignment = resolveFlowAlignment(pmAttrs.alignment, directionIsRtl(pmAttrs.direction));
|
|
54
62
|
if (pmAttrs.outlineLevel !== void 0) attrs.outlineLevel = pmAttrs.outlineLevel;
|
|
@@ -172,8 +180,7 @@ function convertParagraphAttrs(pmAttrs, { theme, fontAlternates, listCounterStre
|
|
|
172
180
|
if (numberingInsertionChange) attrs.listMarkerRevision = toListMarkerRevision("ins", numberingInsertionChange.info);
|
|
173
181
|
}
|
|
174
182
|
}
|
|
175
|
-
const
|
|
176
|
-
const resolvedMarker = applyMarkerAllCaps(visibleMarker.marker, pmAttrs.listMarkerAllCaps);
|
|
183
|
+
const resolvedMarker = applyMarkerAllCaps(listMarker, pmAttrs.listMarkerAllCaps);
|
|
177
184
|
if (resolvedMarker !== null) attrs.listMarker = resolvedMarker;
|
|
178
185
|
else if (pmAttrs.listMarker) attrs.listMarker = pmAttrs.listIsBullet ? convertBulletToUnicode(pmAttrs.listMarker, bulletMarkerFontName(pmAttrs.listMarkerFormatting)) : pmAttrs.listMarker;
|
|
179
186
|
if (pmAttrs.listIsBullet !== void 0) attrs.listIsBullet = pmAttrs.listIsBullet;
|
|
@@ -241,4 +248,4 @@ const resolveTabAlignment = (alignment, rightToLeft) => {
|
|
|
241
248
|
default: return mapped;
|
|
242
249
|
}
|
|
243
250
|
};
|
|
244
|
-
export { convertParagraphAttrs };
|
|
251
|
+
export { convertParagraphAttrs, paragraphAttrsWithListMarker };
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { ParagraphBlock } from "../../layout-engine/types.js";
|
|
2
|
+
import { FlowConversionOptions } from "./flowConversionShared.js";
|
|
3
|
+
import { ParagraphListMarker } from "./paragraphAttrs.js";
|
|
4
|
+
import { RecordedConversion } from "./topLevelConversion.js";
|
|
5
|
+
import { Node } from "prosemirror-model";
|
|
6
|
+
export declare class ParagraphBlockCache {
|
|
7
|
+
private constants;
|
|
8
|
+
private paragraphs;
|
|
9
|
+
private conversion;
|
|
10
|
+
/** Start over unless every conversion constant converts as the one the kept blocks were converted with. */
|
|
11
|
+
use(options: FlowConversionOptions): void;
|
|
12
|
+
/**
|
|
13
|
+
* The last conversion, when it converted a document with the same document
|
|
14
|
+
* attributes under the constants `use` was last given.
|
|
15
|
+
*/
|
|
16
|
+
lastConversion(doc: Node): RecordedConversion | undefined;
|
|
17
|
+
/** Keep what converting each top-level node gave, for the next conversion. */
|
|
18
|
+
recordConversion(conversion: RecordedConversion | undefined): void;
|
|
19
|
+
/** The block converting `node` at `pmStart` with `listMarker` gives, under `id`. */
|
|
20
|
+
take(node: Node, pmStart: number, listMarker: ParagraphListMarker, id: () => ParagraphBlock["id"]): ParagraphBlock | undefined;
|
|
21
|
+
/**
|
|
22
|
+
* Keep the block converting `node` at `pmStart` gave, unless converting it
|
|
23
|
+
* read other blocks. Call before anything else writes to `block`.
|
|
24
|
+
*/
|
|
25
|
+
keep(node: Node, pmStart: number, listMarker: ParagraphListMarker, block: ParagraphBlock): void;
|
|
26
|
+
}
|