@stll/folio-core 0.67.0 → 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 +94 -8
- 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/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 +29 -12
- package/dist/controller/canonicalComposition.js +1 -1
- 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 +28 -1
- 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 +327 -73
- 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 +4 -3
- package/dist/controller/hiddenEditorManager.js +91 -37
- package/dist/controller/layoutPipeline.js +48 -15
- 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.js +23 -4
- 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/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/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/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/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 +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 +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/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/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 +2 -0
- package/dist/i18n/messages/catalogs.gen.d.ts +34 -0
- package/dist/i18n/messages/catalogs.gen.js +34 -0
- package/dist/i18n/messages/cs.gen.js +2 -0
- package/dist/i18n/messages/de.gen.js +2 -0
- package/dist/i18n/messages/en.gen.js +2 -0
- package/dist/i18n/messages/es.gen.js +2 -0
- package/dist/i18n/messages/et.gen.js +2 -0
- package/dist/i18n/messages/fr.gen.js +2 -0
- package/dist/i18n/messages/he.gen.js +2 -0
- package/dist/i18n/messages/hi.gen.js +2 -0
- package/dist/i18n/messages/hu.gen.js +2 -0
- package/dist/i18n/messages/lt.gen.js +2 -0
- package/dist/i18n/messages/lv.gen.js +2 -0
- package/dist/i18n/messages/messages.gen.d.ts +2 -0
- package/dist/i18n/messages/pl.gen.js +2 -0
- package/dist/i18n/messages/pt-BR.gen.js +2 -0
- package/dist/i18n/messages/sk.gen.js +2 -0
- package/dist/i18n/messages/tr.gen.js +2 -0
- package/dist/i18n/messages/zh-CN.gen.js +2 -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/layout-bridge/convert/tableConversion.js +19 -8
- 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-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/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 +36 -1
- package/dist/layout-painter/renderPage.d.ts +4 -4
- package/dist/layout-painter/renderPage.js +46 -17
- package/dist/layout-painter/renderTable.js +7 -4
- 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/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 +102 -11
- 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/commentReferenceIntegrity.js +3 -4
- package/dist/prosemirror/conversion/fromProseDoc.d.ts +2 -0
- package/dist/prosemirror/conversion/fromProseDoc.js +76 -31
- package/dist/prosemirror/conversion/index.d.ts +1 -1
- package/dist/prosemirror/conversion/toProseDoc.d.ts +128 -1
- package/dist/prosemirror/conversion/toProseDoc.js +319 -51
- 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 +1 -1
- package/dist/prosemirror/extensions/features/pastedHtmlLists.js +5 -4
- package/dist/prosemirror/extensions/marks/CommentExtension.js +6 -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/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 +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.js +20 -9
- 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/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/validation.js +1 -0
- 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
|
@@ -337,6 +337,7 @@ const messages = { "folio": {
|
|
|
337
337
|
"editSessionTakenOver": "Diese Bearbeitungssitzung wurde an anderer Stelle übernommen.",
|
|
338
338
|
"editor": {
|
|
339
339
|
"accessibleName": "Dokumenteditor",
|
|
340
|
+
"contentLocked": "Dieser Teil des Dokuments ist gesperrt.",
|
|
340
341
|
"editing": "Bearbeiten",
|
|
341
342
|
"editingDescription": "Dokument direkt bearbeiten",
|
|
342
343
|
"outlineDepthAll": "Alle Ebenen",
|
|
@@ -632,6 +633,7 @@ const messages = { "folio": {
|
|
|
632
633
|
"watermark": "Wasserzeichen"
|
|
633
634
|
},
|
|
634
635
|
"trackedChanges": {
|
|
636
|
+
"heldByLock": "Ein gesperrtes Inhaltssteuerelement verhindert, dass diese Änderung angenommen oder abgelehnt wird.",
|
|
635
637
|
"replaced": "Ersetzt",
|
|
636
638
|
"unknown": "Unbekannt",
|
|
637
639
|
"with": "durch"
|
|
@@ -337,6 +337,7 @@ const messages = { "folio": {
|
|
|
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
|
+
"contentLocked": "This part of the document is locked.",
|
|
340
341
|
"editing": "Editing",
|
|
341
342
|
"editingDescription": "Edit the document directly",
|
|
342
343
|
"outlineDepthAll": "All levels",
|
|
@@ -632,6 +633,7 @@ const messages = { "folio": {
|
|
|
632
633
|
"watermark": "Watermark"
|
|
633
634
|
},
|
|
634
635
|
"trackedChanges": {
|
|
636
|
+
"heldByLock": "A locked content control prevents accepting or rejecting this change.",
|
|
635
637
|
"replaced": "Replaced",
|
|
636
638
|
"unknown": "Unknown",
|
|
637
639
|
"with": "with"
|
|
@@ -337,6 +337,7 @@ const messages = { "folio": {
|
|
|
337
337
|
"editSessionTakenOver": "Esta sesión de edición se tomó en otro lugar.",
|
|
338
338
|
"editor": {
|
|
339
339
|
"accessibleName": "Editor de documentos",
|
|
340
|
+
"contentLocked": "Esta parte del documento está bloqueada.",
|
|
340
341
|
"editing": "Edición",
|
|
341
342
|
"editingDescription": "Editar el documento directamente",
|
|
342
343
|
"outlineDepthAll": "Todos los niveles",
|
|
@@ -632,6 +633,7 @@ const messages = { "folio": {
|
|
|
632
633
|
"watermark": "Marca de agua"
|
|
633
634
|
},
|
|
634
635
|
"trackedChanges": {
|
|
636
|
+
"heldByLock": "Un control de contenido bloqueado impide aceptar o rechazar este cambio.",
|
|
635
637
|
"replaced": "Reemplazado",
|
|
636
638
|
"unknown": "Desconocido",
|
|
637
639
|
"with": "por"
|
|
@@ -337,6 +337,7 @@ const messages = { "folio": {
|
|
|
337
337
|
"editSessionTakenOver": "See muutmisseanss võeti mujal üle.",
|
|
338
338
|
"editor": {
|
|
339
339
|
"accessibleName": "Dokumendiredaktor",
|
|
340
|
+
"contentLocked": "See dokumendi osa on lukustatud.",
|
|
340
341
|
"editing": "Redigeerimine",
|
|
341
342
|
"editingDescription": "Redigeerige dokumenti otse",
|
|
342
343
|
"outlineDepthAll": "Kõik tasemed",
|
|
@@ -632,6 +633,7 @@ const messages = { "folio": {
|
|
|
632
633
|
"watermark": "Vesimärk"
|
|
633
634
|
},
|
|
634
635
|
"trackedChanges": {
|
|
636
|
+
"heldByLock": "Lukustatud sisujuhtelement ei luba seda muudatust vastu võtta ega tagasi lükata.",
|
|
635
637
|
"replaced": "Asendatud",
|
|
636
638
|
"unknown": "Tundmatu",
|
|
637
639
|
"with": "väärtusega"
|
|
@@ -337,6 +337,7 @@ const messages = { "folio": {
|
|
|
337
337
|
"editSessionTakenOver": "Cette session de modification a été reprise ailleurs.",
|
|
338
338
|
"editor": {
|
|
339
339
|
"accessibleName": "Éditeur de documents",
|
|
340
|
+
"contentLocked": "Cette partie du document est verrouillée.",
|
|
340
341
|
"editing": "Modification",
|
|
341
342
|
"editingDescription": "Modifier directement le document",
|
|
342
343
|
"outlineDepthAll": "Tous les niveaux",
|
|
@@ -632,6 +633,7 @@ const messages = { "folio": {
|
|
|
632
633
|
"watermark": "Filigrane"
|
|
633
634
|
},
|
|
634
635
|
"trackedChanges": {
|
|
636
|
+
"heldByLock": "Un contrôle de contenu verrouillé empêche d’accepter ou de refuser cette modification.",
|
|
635
637
|
"replaced": "Remplacé",
|
|
636
638
|
"unknown": "Inconnu",
|
|
637
639
|
"with": "par"
|
|
@@ -337,6 +337,7 @@ const messages = { "folio": {
|
|
|
337
337
|
"editSessionTakenOver": "כרטיסייה, חלון או מכשיר אחר פתחו מסמך זה לעריכה, ולכן הפעלה זו שוחררה. שינויים מקומיים שלא נשמרו נשמרו — פתח מחדש את המסמך כדי להמשיך.",
|
|
338
338
|
"editor": {
|
|
339
339
|
"accessibleName": "עורך מסמכים",
|
|
340
|
+
"contentLocked": "חלק זה של המסמך נעול.",
|
|
340
341
|
"editing": "עריכה",
|
|
341
342
|
"editingDescription": "ערוך את המסמך ישירות",
|
|
342
343
|
"outlineDepthAll": "כל הרמות",
|
|
@@ -632,6 +633,7 @@ const messages = { "folio": {
|
|
|
632
633
|
"watermark": "סימן מים"
|
|
633
634
|
},
|
|
634
635
|
"trackedChanges": {
|
|
636
|
+
"heldByLock": "פקד תוכן נעול מונע קבלה או דחייה של שינוי זה.",
|
|
635
637
|
"replaced": "הוחלף",
|
|
636
638
|
"unknown": "לא ידוע",
|
|
637
639
|
"with": "ב-"
|
|
@@ -337,6 +337,7 @@ const messages = { "folio": {
|
|
|
337
337
|
"editSessionTakenOver": "किसी अन्य टैब, विंडो या डिवाइस ने इस दस्तावेज़ को संपादन के लिए खोला, इसलिए यह सत्र बंद कर दिया गया। सहेजे नहीं गए स्थानीय परिवर्तन सुरक्षित हैं — जारी रखने के लिए दस्तावेज़ फिर से खोलें।",
|
|
338
338
|
"editor": {
|
|
339
339
|
"accessibleName": "दस्तावेज़ संपादक",
|
|
340
|
+
"contentLocked": "दस्तावेज़ का यह हिस्सा लॉक है।",
|
|
340
341
|
"editing": "संपादन",
|
|
341
342
|
"editingDescription": "दस्तावेज़ को सीधे संपादित करें",
|
|
342
343
|
"outlineDepthAll": "सभी स्तर",
|
|
@@ -632,6 +633,7 @@ const messages = { "folio": {
|
|
|
632
633
|
"watermark": "वॉटरमार्क"
|
|
633
634
|
},
|
|
634
635
|
"trackedChanges": {
|
|
636
|
+
"heldByLock": "एक लॉक किया गया सामग्री नियंत्रण इस परिवर्तन को स्वीकार या अस्वीकार करने से रोकता है।",
|
|
635
637
|
"replaced": "बदला गया",
|
|
636
638
|
"unknown": "अज्ञात",
|
|
637
639
|
"with": "से"
|
|
@@ -337,6 +337,7 @@ const messages = { "folio": {
|
|
|
337
337
|
"editSessionTakenOver": "Ezt a szerkesztési munkamenetet máshol vették át.",
|
|
338
338
|
"editor": {
|
|
339
339
|
"accessibleName": "Dokumentumszerkesztő",
|
|
340
|
+
"contentLocked": "A dokumentum ezen része zárolva van.",
|
|
340
341
|
"editing": "Szerkesztés",
|
|
341
342
|
"editingDescription": "A dokumentum közvetlen szerkesztése",
|
|
342
343
|
"outlineDepthAll": "Minden szint",
|
|
@@ -632,6 +633,7 @@ const messages = { "folio": {
|
|
|
632
633
|
"watermark": "Vízjel"
|
|
633
634
|
},
|
|
634
635
|
"trackedChanges": {
|
|
636
|
+
"heldByLock": "Egy zárolt tartalomvezérlő megakadályozza a módosítás elfogadását vagy elutasítását.",
|
|
635
637
|
"replaced": "Lecserélve",
|
|
636
638
|
"unknown": "Ismeretlen",
|
|
637
639
|
"with": "erre:"
|
|
@@ -337,6 +337,7 @@ const messages = { "folio": {
|
|
|
337
337
|
"editSessionTakenOver": "Ši redagavimo sesija buvo perimta kitur.",
|
|
338
338
|
"editor": {
|
|
339
339
|
"accessibleName": "Dokumentų redaktorius",
|
|
340
|
+
"contentLocked": "Ši dokumento dalis užrakinta.",
|
|
340
341
|
"editing": "Redagavimas",
|
|
341
342
|
"editingDescription": "Redaguokite dokumentą tiesiogiai",
|
|
342
343
|
"outlineDepthAll": "Visi lygiai",
|
|
@@ -632,6 +633,7 @@ const messages = { "folio": {
|
|
|
632
633
|
"watermark": "Vandens ženklas"
|
|
633
634
|
},
|
|
634
635
|
"trackedChanges": {
|
|
636
|
+
"heldByLock": "Užrakintas turinio valdiklis neleidžia priimti ar atmesti šio pakeitimo.",
|
|
635
637
|
"replaced": "Pakeista",
|
|
636
638
|
"unknown": "Nežinoma",
|
|
637
639
|
"with": "į"
|
|
@@ -337,6 +337,7 @@ const messages = { "folio": {
|
|
|
337
337
|
"editSessionTakenOver": "Šo rediģēšanas sesiju pārņēma citur.",
|
|
338
338
|
"editor": {
|
|
339
339
|
"accessibleName": "Dokumentu redaktors",
|
|
340
|
+
"contentLocked": "Šī dokumenta daļa ir bloķēta.",
|
|
340
341
|
"editing": "Rediģēšana",
|
|
341
342
|
"editingDescription": "Rediģējiet dokumentu tieši",
|
|
342
343
|
"outlineDepthAll": "Visi līmeņi",
|
|
@@ -632,6 +633,7 @@ const messages = { "folio": {
|
|
|
632
633
|
"watermark": "Ūdenszīme"
|
|
633
634
|
},
|
|
634
635
|
"trackedChanges": {
|
|
636
|
+
"heldByLock": "Bloķēta satura vadīkla neļauj pieņemt vai noraidīt šīs izmaiņas.",
|
|
635
637
|
"replaced": "Aizstāts",
|
|
636
638
|
"unknown": "Nezināms",
|
|
637
639
|
"with": "ar"
|
|
@@ -337,6 +337,7 @@ 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
|
+
"contentLocked": "This part of the document is locked.";
|
|
340
341
|
"editing": "Editing";
|
|
341
342
|
"editingDescription": "Edit the document directly";
|
|
342
343
|
"outlineDepthAll": "All levels";
|
|
@@ -632,6 +633,7 @@ type Messages = {
|
|
|
632
633
|
"watermark": "Watermark";
|
|
633
634
|
};
|
|
634
635
|
"trackedChanges": {
|
|
636
|
+
"heldByLock": "A locked content control prevents accepting or rejecting this change.";
|
|
635
637
|
"replaced": "Replaced";
|
|
636
638
|
"unknown": "Unknown";
|
|
637
639
|
"with": "with";
|
|
@@ -337,6 +337,7 @@ 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
|
+
"contentLocked": "Ta część dokumentu jest zablokowana.",
|
|
340
341
|
"editing": "Edytowanie",
|
|
341
342
|
"editingDescription": "Edytuj dokument bezpośrednio",
|
|
342
343
|
"outlineDepthAll": "Wszystkie poziomy",
|
|
@@ -632,6 +633,7 @@ const messages = { "folio": {
|
|
|
632
633
|
"watermark": "Znak wodny"
|
|
633
634
|
},
|
|
634
635
|
"trackedChanges": {
|
|
636
|
+
"heldByLock": "Zablokowana kontrolka zawartości uniemożliwia zaakceptowanie lub odrzucenie tej zmiany.",
|
|
635
637
|
"replaced": "Zamieniono",
|
|
636
638
|
"unknown": "Nieznane",
|
|
637
639
|
"with": "na"
|
|
@@ -337,6 +337,7 @@ 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
|
+
"contentLocked": "Esta parte do documento está bloqueada.",
|
|
340
341
|
"editing": "Editando",
|
|
341
342
|
"editingDescription": "Edite o documento diretamente",
|
|
342
343
|
"outlineDepthAll": "Todos os níveis",
|
|
@@ -632,6 +633,7 @@ const messages = { "folio": {
|
|
|
632
633
|
"watermark": "Marca-d'água"
|
|
633
634
|
},
|
|
634
635
|
"trackedChanges": {
|
|
636
|
+
"heldByLock": "Um controle de conteúdo bloqueado impede que esta alteração seja aceita ou rejeitada.",
|
|
635
637
|
"replaced": "Substituído",
|
|
636
638
|
"unknown": "Desconhecido",
|
|
637
639
|
"with": "por"
|
|
@@ -337,6 +337,7 @@ const messages = { "folio": {
|
|
|
337
337
|
"editSessionTakenOver": "Túto reláciu úprav prevzalo iné okno.",
|
|
338
338
|
"editor": {
|
|
339
339
|
"accessibleName": "Editor dokumentov",
|
|
340
|
+
"contentLocked": "Táto časť dokumentu je uzamknutá.",
|
|
340
341
|
"editing": "Úpravy",
|
|
341
342
|
"editingDescription": "Upravujte dokument priamo",
|
|
342
343
|
"outlineDepthAll": "Všetky úrovne",
|
|
@@ -632,6 +633,7 @@ const messages = { "folio": {
|
|
|
632
633
|
"watermark": "Vodotlač"
|
|
633
634
|
},
|
|
634
635
|
"trackedChanges": {
|
|
636
|
+
"heldByLock": "Uzamknutý ovládací prvok obsahu bráni prijatiu alebo odmietnutiu tejto zmeny.",
|
|
635
637
|
"replaced": "Nahradené",
|
|
636
638
|
"unknown": "Neznáme",
|
|
637
639
|
"with": "za"
|
|
@@ -337,6 +337,7 @@ 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
|
+
"contentLocked": "Belgenin bu bölümü kilitli.",
|
|
340
341
|
"editing": "Düzenleme",
|
|
341
342
|
"editingDescription": "Belgeyi doğrudan düzenleyin",
|
|
342
343
|
"outlineDepthAll": "Tüm düzeyler",
|
|
@@ -632,6 +633,7 @@ const messages = { "folio": {
|
|
|
632
633
|
"watermark": "Filigran"
|
|
633
634
|
},
|
|
634
635
|
"trackedChanges": {
|
|
636
|
+
"heldByLock": "Kilitli bir içerik denetimi bu değişikliğin kabul edilmesini veya reddedilmesini engelliyor.",
|
|
635
637
|
"replaced": "Değiştirildi",
|
|
636
638
|
"unknown": "Bilinmiyor",
|
|
637
639
|
"with": "yerine"
|
|
@@ -337,6 +337,7 @@ const messages = { "folio": {
|
|
|
337
337
|
"editSessionTakenOver": "另一个标签页、窗口或设备已打开此文档进行编辑,因此本会话已释放。未保存的本地更改会保留,请重新打开文档以继续。",
|
|
338
338
|
"editor": {
|
|
339
339
|
"accessibleName": "文档编辑器",
|
|
340
|
+
"contentLocked": "文档的这一部分已锁定。",
|
|
340
341
|
"editing": "编辑",
|
|
341
342
|
"editingDescription": "直接编辑文档",
|
|
342
343
|
"outlineDepthAll": "所有级别",
|
|
@@ -632,6 +633,7 @@ const messages = { "folio": {
|
|
|
632
633
|
"watermark": "水印"
|
|
633
634
|
},
|
|
634
635
|
"trackedChanges": {
|
|
636
|
+
"heldByLock": "已锁定的内容控件阻止接受或拒绝此修订。",
|
|
635
637
|
"replaced": "已替换",
|
|
636
638
|
"unknown": "未知",
|
|
637
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;
|
|
@@ -243,14 +243,25 @@ function convertTable(node, startPos, options) {
|
|
|
243
243
|
function convertTextBoxNode(node, startPos, opts) {
|
|
244
244
|
const attrs = expectTextBoxAttrs(node);
|
|
245
245
|
const contentBlocks = [];
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
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);
|
|
254
265
|
const textBox = {
|
|
255
266
|
kind: "textBox",
|
|
256
267
|
id: nextBlockId(),
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { BlockId, FlowBlock } from "../../layout-engine/types.js";
|
|
2
|
+
/**
|
|
3
|
+
* Each block's index by id, the first block's where ids repeat. A pass that
|
|
4
|
+
* looks up the block of every fragment builds it once instead of searching
|
|
5
|
+
* the blocks for each fragment.
|
|
6
|
+
*/
|
|
7
|
+
export declare const indexBlocksById: (blocks: readonly FlowBlock[]) => ReadonlyMap<BlockId, number>;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
// src/layout-bridge/engine/blockIndex.ts
|
|
2
|
+
/**
|
|
3
|
+
* Each block's index by id, the first block's where ids repeat. A pass that
|
|
4
|
+
* looks up the block of every fragment builds it once instead of searching
|
|
5
|
+
* the blocks for each fragment.
|
|
6
|
+
*/
|
|
7
|
+
const indexBlocksById = (blocks) => {
|
|
8
|
+
const indices = /* @__PURE__ */ new Map();
|
|
9
|
+
for (const [index, block] of blocks.entries()) if (!indices.has(block.id)) indices.set(block.id, index);
|
|
10
|
+
return indices;
|
|
11
|
+
};
|
|
12
|
+
export { indexBlocksById };
|
|
@@ -3,6 +3,7 @@ import { getTableCellContentWidth } from "../../layout-engine/measure/tableCellF
|
|
|
3
3
|
import { buildTableCellGrid, buildTableCellPlacements, getTableCellSpacingInsetsY } from "../../layout-engine/measure/tableCellGrid.js";
|
|
4
4
|
import { getHeaderRowsHeight } from "../../layout-engine/tableLayout.js";
|
|
5
5
|
import { resolveTableCellPadding } from "../../layout-engine/types.js";
|
|
6
|
+
import { indexBlocksById } from "./blockIndex.js";
|
|
6
7
|
// src/layout-bridge/engine/hitTest.ts
|
|
7
8
|
/**
|
|
8
9
|
* Hit Testing Utilities
|
|
@@ -78,12 +79,6 @@ function getPageIndexAtY(layout, y) {
|
|
|
78
79
|
})?.pageIndex ?? null;
|
|
79
80
|
}
|
|
80
81
|
/**
|
|
81
|
-
* Find a block by its ID in the blocks array.
|
|
82
|
-
*/
|
|
83
|
-
function findBlockIndexById(blocks, blockId) {
|
|
84
|
-
return blocks.findIndex((block) => block.id === blockId);
|
|
85
|
-
}
|
|
86
|
-
/**
|
|
87
82
|
* Calculate the actual height of a paragraph fragment from its lines.
|
|
88
83
|
*/
|
|
89
84
|
function calculateParagraphFragmentHeight(fragment, measure) {
|
|
@@ -107,8 +102,9 @@ function hitTestFragment(pageHit, blocks, measures, pagePoint) {
|
|
|
107
102
|
if (Math.abs(dy) > .5) return dy;
|
|
108
103
|
return a.x - b.x;
|
|
109
104
|
});
|
|
105
|
+
const blockIndices = indexBlocksById(blocks);
|
|
110
106
|
for (const fragment of sortedFragments) {
|
|
111
|
-
const blockIndex =
|
|
107
|
+
const blockIndex = blockIndices.get(fragment.blockId) ?? -1;
|
|
112
108
|
if (blockIndex === -1) continue;
|
|
113
109
|
const block = blocks[blockIndex];
|
|
114
110
|
const measure = measures[blockIndex];
|
|
@@ -137,9 +133,10 @@ function hitTestFragment(pageHit, blocks, measures, pagePoint) {
|
|
|
137
133
|
* Hit-test to find image fragments (they may overlap other content).
|
|
138
134
|
*/
|
|
139
135
|
function hitTestImageFragment(pageHit, blocks, measures, pagePoint) {
|
|
136
|
+
const blockIndices = indexBlocksById(blocks);
|
|
140
137
|
for (const fragment of pageHit.page.fragments) {
|
|
141
138
|
if (fragment.kind !== "image") continue;
|
|
142
|
-
const blockIndex =
|
|
139
|
+
const blockIndex = blockIndices.get(fragment.blockId) ?? -1;
|
|
143
140
|
if (blockIndex === -1) continue;
|
|
144
141
|
const block = blocks[blockIndex];
|
|
145
142
|
const measure = measures[blockIndex];
|
|
@@ -167,13 +164,14 @@ function hitTestImageFragment(pageHit, blocks, measures, pagePoint) {
|
|
|
167
164
|
* @returns TableCellHit if a table cell was found, null otherwise.
|
|
168
165
|
*/
|
|
169
166
|
function hitTestTableCell(pageHit, blocks, measures, pagePoint) {
|
|
167
|
+
const blockIndices = indexBlocksById(blocks);
|
|
170
168
|
for (const fragment of pageHit.page.fragments) {
|
|
171
169
|
if (fragment.kind !== "table") continue;
|
|
172
170
|
const tableFragment = fragment;
|
|
173
171
|
const withinX = pagePoint.x >= tableFragment.x && pagePoint.x <= tableFragment.x + tableFragment.width;
|
|
174
172
|
const withinY = pagePoint.y >= tableFragment.y && pagePoint.y <= tableFragment.y + tableFragment.height;
|
|
175
173
|
if (!withinX || !withinY) continue;
|
|
176
|
-
const blockIndex =
|
|
174
|
+
const blockIndex = blockIndices.get(tableFragment.blockId) ?? -1;
|
|
177
175
|
if (blockIndex === -1) continue;
|
|
178
176
|
const block = blocks[blockIndex];
|
|
179
177
|
const measure = measures[blockIndex];
|
|
@@ -363,8 +361,9 @@ function isPointInContentArea(_layout, pageHit, pagePoint) {
|
|
|
363
361
|
function findNearestFragment(pageHit, blocks, measures, pagePoint) {
|
|
364
362
|
let nearestHit = null;
|
|
365
363
|
let nearestDistance = Infinity;
|
|
364
|
+
const blockIndices = indexBlocksById(blocks);
|
|
366
365
|
for (const fragment of pageHit.page.fragments) {
|
|
367
|
-
const blockIndex =
|
|
366
|
+
const blockIndex = blockIndices.get(fragment.blockId) ?? -1;
|
|
368
367
|
if (blockIndex === -1) continue;
|
|
369
368
|
const block = blocks[blockIndex];
|
|
370
369
|
const measure = measures[blockIndex];
|
|
@@ -10,6 +10,7 @@ import { resolveTableCellPadding } from "../../layout-engine/types.js";
|
|
|
10
10
|
import { normalizeHorizontalScalePercent } from "../../utils/horizontalScale.js";
|
|
11
11
|
import { resolveParagraphLineGeometryForBlock, resolvePhysicalParagraphInlineLayout } from "../../utils/paragraphInlineLayout.js";
|
|
12
12
|
import { inlineImageBoundingBox } from "../../utils/rotationBoundingBox.js";
|
|
13
|
+
import { indexBlocksById } from "./blockIndex.js";
|
|
13
14
|
import { getPageTop } from "./hitTest.js";
|
|
14
15
|
import { computeLinePmRange } from "./linePmRange.js";
|
|
15
16
|
// src/layout-bridge/engine/selectionRects.ts
|
|
@@ -49,9 +50,6 @@ function mathRunToFontStyle(run) {
|
|
|
49
50
|
/**
|
|
50
51
|
* Find a block by its ID.
|
|
51
52
|
*/
|
|
52
|
-
function findBlockById(blocks, blockId) {
|
|
53
|
-
return blocks.findIndex((block) => block.id === blockId);
|
|
54
|
-
}
|
|
55
53
|
function getCellContentOffsetY(cell, cellMeasure, rowHeight) {
|
|
56
54
|
const { top: padTop } = resolveTableCellPadding(cell);
|
|
57
55
|
const spareHeight = Math.max(0, rowHeight - cellMeasure.height);
|
|
@@ -211,12 +209,13 @@ function selectionToRects(layout, blocks, measures, from, to) {
|
|
|
211
209
|
const selTo = Math.max(from, to);
|
|
212
210
|
const rects = [];
|
|
213
211
|
const tableCellPlacements = /* @__PURE__ */ new WeakMap();
|
|
212
|
+
const blockIndices = indexBlocksById(blocks);
|
|
214
213
|
for (let pageIndex = 0; pageIndex < layout.pages.length; pageIndex++) {
|
|
215
214
|
const page = layout.pages[pageIndex];
|
|
216
215
|
const pageTopY = getPageTop(layout, pageIndex);
|
|
217
216
|
for (const fragment of page.fragments) {
|
|
218
217
|
if (fragment.kind === "paragraph") {
|
|
219
|
-
const blockIndex =
|
|
218
|
+
const blockIndex = blockIndices.get(fragment.blockId) ?? -1;
|
|
220
219
|
if (blockIndex === -1) continue;
|
|
221
220
|
const block = blocks[blockIndex];
|
|
222
221
|
const measure = measures[blockIndex];
|
|
@@ -261,7 +260,7 @@ function selectionToRects(layout, blocks, measures, from, to) {
|
|
|
261
260
|
}
|
|
262
261
|
}
|
|
263
262
|
if (fragment.kind === "table") {
|
|
264
|
-
const blockIndex =
|
|
263
|
+
const blockIndex = blockIndices.get(fragment.blockId) ?? -1;
|
|
265
264
|
if (blockIndex === -1) continue;
|
|
266
265
|
const block = blocks[blockIndex];
|
|
267
266
|
const measure = measures[blockIndex];
|
|
@@ -385,12 +384,13 @@ function selectionToRects(layout, blocks, measures, from, to) {
|
|
|
385
384
|
* @returns Caret position, or null if not found.
|
|
386
385
|
*/
|
|
387
386
|
function getCaretPosition(layout, blocks, measures, pmPosition) {
|
|
387
|
+
const blockIndices = indexBlocksById(blocks);
|
|
388
388
|
for (let pageIndex = 0; pageIndex < layout.pages.length; pageIndex++) {
|
|
389
389
|
const page = layout.pages[pageIndex];
|
|
390
390
|
const pageTopY = getPageTop(layout, pageIndex);
|
|
391
391
|
for (const fragment of page.fragments) {
|
|
392
392
|
if (fragment.kind === "paragraph") {
|
|
393
|
-
const blockIndex =
|
|
393
|
+
const blockIndex = blockIndices.get(fragment.blockId) ?? -1;
|
|
394
394
|
if (blockIndex === -1) continue;
|
|
395
395
|
const block = blocks[blockIndex];
|
|
396
396
|
const measure = measures[blockIndex];
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { FootnoteContent, FootnoteWindow, Page } from "./types.js";
|
|
2
|
+
/** What each note's reference reserves on a page of this content height. */
|
|
3
|
+
export declare const footnoteReservationHeights: (heights: ReadonlyMap<number, number>, contentHeight: number) => Map<number, number>;
|
|
4
|
+
/** Every height a window of the note may end at, ascending, the note's end last. */
|
|
5
|
+
export declare const footnoteBreakOffsets: (content: Pick<FootnoteContent, "measures" | "height">) => number[];
|
|
6
|
+
type NoteContent = Pick<FootnoteContent, "measures" | "height">;
|
|
7
|
+
type PlanOptions = {
|
|
8
|
+
pages: readonly Page[];
|
|
9
|
+
contentById: ReadonlyMap<number, NoteContent>;
|
|
10
|
+
/** Pages already added past the last body page for a note's rest. */
|
|
11
|
+
trailingPages?: number;
|
|
12
|
+
};
|
|
13
|
+
export type FootnoteContinuationPlan = {
|
|
14
|
+
/** A page number's notes and their height, for each page the plan changes. */
|
|
15
|
+
pages: Map<number, {
|
|
16
|
+
ids: number[];
|
|
17
|
+
windows: FootnoteWindow[];
|
|
18
|
+
height: number;
|
|
19
|
+
}>;
|
|
20
|
+
/** The height a carried note reserves on a page before the body is placed. */
|
|
21
|
+
reservedHeights: Map<number, number>;
|
|
22
|
+
/** Pages the rest of a note still needs beyond the ones laid out. */
|
|
23
|
+
extraPages: number;
|
|
24
|
+
/** How many pages past the last body page the layout should add. */
|
|
25
|
+
trailingPages: number;
|
|
26
|
+
};
|
|
27
|
+
/** Where each note's windows fall, given how the body laid out. */
|
|
28
|
+
export declare const planFootnoteContinuation: ({ pages, contentById, trailingPages }: PlanOptions) => FootnoteContinuationPlan;
|
|
29
|
+
/** Whether a layout was made with what this plan asks for. */
|
|
30
|
+
export declare const footnoteContinuationSettled: (used: {
|
|
31
|
+
reservedHeights: ReadonlyMap<number, number> | undefined;
|
|
32
|
+
trailingPages: number;
|
|
33
|
+
}, plan: FootnoteContinuationPlan) => boolean;
|
|
34
|
+
/** The pages with a plan's note windows. */
|
|
35
|
+
export declare const applyFootnoteContinuation: (pages: readonly Page[], plan: FootnoteContinuationPlan) => Page[];
|
|
36
|
+
export {};
|