@stll/folio-core 0.15.1 → 0.15.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ai-edits/apply.js +2 -2
- package/dist/ai-edits/blockRange.js +1 -1
- package/dist/ai-edits/headless.js +9 -9
- package/dist/ai-edits/index.js +5 -5
- package/dist/ai-edits/read.js +1 -1
- package/dist/ai-edits/table-cell-mutations.js +2 -2
- package/dist/compat/eigenpal.js +19 -19
- package/dist/content-controls/mutateContentControls.js +1 -1
- package/dist/controller/contentControlWidgetController.js +1 -1
- package/dist/controller/headerFooterEditorManager.js +5 -5
- package/dist/controller/hiddenEditorManager.js +5 -5
- package/dist/controller/layoutPipeline.js +10 -10
- package/dist/controller/noteEditorManager.js +5 -5
- package/dist/docx/blockContentParser.js +4 -4
- package/dist/docx/commentParser.js +30 -2
- package/dist/docx/documentParser.js +27 -3
- package/dist/docx/drawingIdNormalization.d.ts +5 -0
- package/dist/docx/drawingIdNormalization.js +35 -0
- package/dist/docx/drawingUtils.d.ts +1 -1
- package/dist/docx/drawingUtils.js +111 -27
- package/dist/docx/encryption/agileDecryption.js +1 -1
- package/dist/docx/encryption/encryptionInfo.js +1 -1
- package/dist/docx/encryption/index.js +1 -1
- package/dist/docx/encryption/openEncryptedDocx.js +3 -3
- package/dist/docx/fieldParser.js +1 -1
- package/dist/docx/footnoteParser.js +2 -2
- package/dist/docx/groupDrawingParser.js +1 -1
- package/dist/docx/headerFooterParser.js +3 -3
- package/dist/docx/headerFooterVerbatim.d.ts +2 -1
- package/dist/docx/headerFooterVerbatim.js +6 -1
- package/dist/docx/hyperlinkParser.js +1 -1
- package/dist/docx/imageParser.js +3 -3
- package/dist/docx/index.js +1 -1
- package/dist/docx/paragraphParser.js +8 -5
- package/dist/docx/paragraphTextBoxEnrichment.js +4 -4
- package/dist/docx/paragraphTraversal.d.ts +5 -3
- package/dist/docx/paragraphTraversal.js +20 -13
- package/dist/docx/parser.js +17 -7
- package/dist/docx/parserEnums.d.ts +4 -1
- package/dist/docx/parserEnums.js +5 -2
- package/dist/docx/rezip.js +9 -9
- package/dist/docx/runConsolidator.js +0 -1
- package/dist/docx/runParser.js +22 -6
- package/dist/docx/sectionParser.js +2 -2
- package/dist/docx/selectiveSave.js +7 -7
- package/dist/docx/serializer/commentSerializer.js +13 -8
- package/dist/docx/serializer/documentSerializer.js +7 -3
- package/dist/docx/serializer/headerFooterSerializer.js +3 -3
- package/dist/docx/serializer/noteSerializer.js +2 -2
- package/dist/docx/serializer/numberingSerializer.js +1 -1
- package/dist/docx/serializer/paragraphSerializer.js +2 -2
- package/dist/docx/serializer/runSerializer.js +19 -13
- package/dist/docx/serializer/sectionPropertiesSerializer.js +4 -3
- package/dist/docx/serializer/stylesSerializer.js +3 -3
- package/dist/docx/serializer/tableSerializer.js +1 -1
- package/dist/docx/server/docxToMarkdown.js +1 -1
- package/dist/docx/server/evaluateDocxXmlPatchProposal.js +1 -1
- package/dist/docx/server/extractDocxText.js +1 -1
- package/dist/docx/server/validateDocxConformance.js +3 -3
- package/dist/docx/shapeParser.js +5 -113
- package/dist/docx/styleParser.js +3 -3
- package/dist/docx/tableParser.js +11 -9
- package/dist/docx/textBoxParser.js +2 -2
- package/dist/docx/vmlImageParser.js +2 -2
- package/dist/fonts/embeddedFonts.js +2 -2
- package/dist/index.js +18 -18
- package/dist/layout-bridge/convert/footnoteLayout.js +2 -2
- package/dist/layout-bridge/convert/headerFooterLayout.js +2 -2
- package/dist/layout-bridge/convert/paragraphFrames.js +2 -2
- package/dist/layout-bridge/convert/toFlowBlocks.js +10 -10
- package/dist/layout-bridge/engine/clickToPosition.js +2 -2
- package/dist/layout-bridge/engine/hitTest.js +1 -1
- package/dist/layout-bridge/engine/measuring/index.js +6 -6
- package/dist/layout-bridge/engine/selectionRects.js +5 -5
- package/dist/layout-engine/index.js +6 -6
- package/dist/layout-engine/measure/cache.js +2 -2
- package/dist/layout-engine/measure/index.js +6 -6
- package/dist/layout-engine/measure/lineBreaks.js +1 -1
- package/dist/layout-engine/measure/listMarkerWidth.js +1 -1
- package/dist/layout-engine/measure/measureBlocks.js +7 -7
- package/dist/layout-engine/measure/measureContainer.js +3 -3
- package/dist/layout-engine/measure/measureHelpers.js +1 -1
- package/dist/layout-engine/measure/measureParagraph.js +7 -7
- package/dist/layout-engine/measure/tableCellFlow.js +1 -1
- package/dist/layout-engine/paginator.js +1 -1
- package/dist/layout-engine/tableRowBreak.js +2 -2
- package/dist/layout-painter/index.js +5 -5
- package/dist/layout-painter/registry/modules/textBox.js +1 -1
- package/dist/layout-painter/renderImage.js +1 -1
- package/dist/layout-painter/renderPage.js +7 -7
- package/dist/layout-painter/renderParagraph.js +13 -13
- package/dist/layout-painter/renderTable.js +6 -6
- package/dist/layout-painter/renderTextBox.js +1 -1
- package/dist/managers/DocumentLoaderManager.js +3 -3
- package/dist/managers/TableSelectionManager.js +1 -1
- package/dist/managers/editorShortcuts.js +1 -1
- package/dist/markdown/fromMarkdown.js +1 -1
- package/dist/markdown/index.js +1 -1
- package/dist/markdown/renderRuns.js +1 -1
- package/dist/markdown/renderTable.js +1 -1
- package/dist/model.d.ts +3 -3
- package/dist/model.js +3 -3
- package/dist/prosemirror/attrs/index.d.ts +4 -2
- package/dist/prosemirror/attrs/index.js +17 -2
- package/dist/prosemirror/commands/comments.js +3 -3
- package/dist/prosemirror/commands/contentControls.js +1 -1
- package/dist/prosemirror/commands/contentControlsBlockFill.js +1 -1
- package/dist/prosemirror/commands/formatting.js +1 -1
- package/dist/prosemirror/commands/hyperlink.js +1 -1
- package/dist/prosemirror/commands/image.js +2 -2
- package/dist/prosemirror/commands/index.js +6 -6
- package/dist/prosemirror/commands/propertyChangeScope.js +1 -1
- package/dist/prosemirror/commands/tableCellMergeResolution.js +1 -1
- package/dist/prosemirror/commentOps.js +1 -1
- package/dist/prosemirror/conversion/fromProseDoc.js +13 -9
- package/dist/prosemirror/conversion/index.js +1 -1
- package/dist/prosemirror/conversion/toProseDoc.js +9 -9
- package/dist/prosemirror/extensions/StarterKit.js +4 -4
- package/dist/prosemirror/extensions/core/ParagraphExtension.js +4 -4
- package/dist/prosemirror/extensions/features/AutoBidiDetectionExtension.js +2 -2
- package/dist/prosemirror/extensions/features/BaseKeymapExtension.js +3 -3
- package/dist/prosemirror/extensions/features/BidiShortcutExtension.js +2 -2
- package/dist/prosemirror/extensions/features/ContentControlWidgetsExtension.js +1 -1
- package/dist/prosemirror/extensions/features/ImagePasteExtension.js +2 -2
- package/dist/prosemirror/extensions/features/ListExtension.js +3 -3
- package/dist/prosemirror/extensions/features/ParaIdAllocatorExtension.js +1 -1
- package/dist/prosemirror/extensions/features/PasteCleanupExtension.js +2 -2
- package/dist/prosemirror/extensions/features/PasteStyleInlinerExtension.js +1 -1
- package/dist/prosemirror/extensions/features/SelectionTrackerExtension.js +1 -1
- package/dist/prosemirror/extensions/marks/CharacterSpacingExtension.js +1 -1
- package/dist/prosemirror/extensions/marks/HighlightExtension.js +1 -1
- package/dist/prosemirror/extensions/marks/HyperlinkExtension.js +1 -1
- package/dist/prosemirror/extensions/marks/RunShadingExtension.js +1 -1
- package/dist/prosemirror/extensions/marks/TextColorExtension.js +1 -1
- package/dist/prosemirror/extensions/marks/TrackedChangeExtensions.js +1 -1
- package/dist/prosemirror/extensions/nodes/FieldExtension.js +1 -1
- package/dist/prosemirror/extensions/nodes/TabExtension.js +32 -9
- package/dist/prosemirror/extensions/nodes/TableExtension.js +1 -1
- package/dist/prosemirror/index.js +15 -15
- package/dist/prosemirror/insertOperations.js +3 -3
- package/dist/prosemirror/plugins/templateDirectives.js +1 -1
- package/dist/prosemirror/schema/index.d.ts +2 -2
- package/dist/prosemirror/schema/nodes.d.ts +4 -1
- package/dist/prosemirror/styles/styleResolver.js +1 -1
- package/dist/prosemirror/validation.js +5 -3
- package/dist/redline.js +1 -1
- package/dist/render-dom/BodySelectionOverlay.js +2 -2
- package/dist/server.js +15 -15
- package/dist/style-sets/extract.js +1 -1
- package/dist/types/content.d.ts +2 -2
- package/dist/types/documentEnumValues.d.ts +4 -1
- package/dist/types/documentEnumValues.js +14 -1
- package/dist/types/index.d.ts +2 -1
- package/dist/utils/formatToStyle.js +1 -1
- package/dist/version-comparison.js +2 -2
- package/package.json +2 -2
package/dist/model.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { document_d_exports } from "./types/document.js";
|
|
2
2
|
import { DeriveBlockIdInput, FolioBlockId, deriveBlockId, getFolioParaIdFromBlockId, getSequentialFolioBlockIdIndex, isFolioBlockId, isSequentialFolioBlockId } from "./types/block-id.js";
|
|
3
|
-
import { BORDER_STYLE_VALUES, CONDITIONAL_STYLE_TYPE_VALUES, EMPHASIS_MARK_VALUES, FIELD_TYPE_VALUES, FLOATING_TABLE_X_SPEC_VALUES, FLOATING_TABLE_Y_SPEC_VALUES, FONT_HINT_VALUES, FONT_THEME_VALUES, FRAME_WRAP_VALUES, FRAME_X_ALIGN_VALUES, FRAME_Y_ALIGN_VALUES, HIGHLIGHT_COLOR_VALUES, IMAGE_HORIZONTAL_ALIGNMENT_VALUES, IMAGE_HORIZONTAL_RELATIVE_TO_VALUES, IMAGE_VERTICAL_ALIGNMENT_VALUES, IMAGE_VERTICAL_RELATIVE_TO_VALUES, IMAGE_WRAP_TEXT_VALUES, IMAGE_WRAP_TYPE_VALUES, LEVEL_SUFFIX_VALUES, LINE_SPACING_RULE_VALUES, NUMBER_FORMAT_VALUES, OUTLINE_STYLE_ATTR_VALUES, OUTLINE_STYLE_CSS_ALIASES, OUTLINE_STYLE_CSS_ALIAS_VALUES, OutlineStyleAttr, OutlineStyleCssAlias, PARAGRAPH_ALIGNMENT_VALUES, SDT_LOCK_VALUES, SDT_TYPE_VALUES, SHADING_PATTERN_VALUES, SHAPE_OUTLINE_STYLE_VALUES, SHAPE_TYPE_VALUES, STYLE_TYPE_VALUES, TABLE_CELL_TEXT_DIRECTION_VALUES, TABLE_CELL_VERTICAL_ALIGNMENT_VALUES, TABLE_JUSTIFICATION_VALUES, TABLE_ROW_HEIGHT_RULE_VALUES, TABLE_WIDTH_TYPE_VALUES, TAB_LEADER_VALUES, TAB_STOP_ALIGNMENT_VALUES, TEXT_EFFECT_VALUES, THEME_COLOR_SLOT_VALUES, UNDERLINE_STYLE_VALUES } from "./types/documentEnumValues.js";
|
|
3
|
+
import { BORDER_STYLE_VALUES, CONDITIONAL_STYLE_TYPE_VALUES, EMPHASIS_MARK_VALUES, FIELD_TYPE_VALUES, FLOATING_TABLE_X_SPEC_VALUES, FLOATING_TABLE_Y_SPEC_VALUES, FONT_HINT_VALUES, FONT_THEME_VALUES, FRAME_WRAP_VALUES, FRAME_X_ALIGN_VALUES, FRAME_Y_ALIGN_VALUES, HIGHLIGHT_COLOR_VALUES, IMAGE_HORIZONTAL_ALIGNMENT_VALUES, IMAGE_HORIZONTAL_RELATIVE_TO_VALUES, IMAGE_VERTICAL_ALIGNMENT_VALUES, IMAGE_VERTICAL_RELATIVE_TO_VALUES, IMAGE_WRAP_TEXT_VALUES, IMAGE_WRAP_TYPE_VALUES, LEVEL_SUFFIX_VALUES, LINE_SPACING_RULE_VALUES, NUMBER_FORMAT_VALUES, OUTLINE_STYLE_ATTR_VALUES, OUTLINE_STYLE_CSS_ALIASES, OUTLINE_STYLE_CSS_ALIAS_VALUES, OutlineStyleAttr, OutlineStyleCssAlias, PARAGRAPH_ALIGNMENT_VALUES, POSITIONAL_TAB_ALIGNMENT_VALUES, POSITIONAL_TAB_LEADER_VALUES, POSITIONAL_TAB_RELATIVE_TO_VALUES, SDT_LOCK_VALUES, SDT_TYPE_VALUES, SHADING_PATTERN_VALUES, SHAPE_OUTLINE_STYLE_VALUES, SHAPE_TYPE_VALUES, STYLE_TYPE_VALUES, TABLE_CELL_TEXT_DIRECTION_VALUES, TABLE_CELL_VERTICAL_ALIGNMENT_VALUES, TABLE_JUSTIFICATION_VALUES, TABLE_ROW_HEIGHT_RULE_VALUES, TABLE_WIDTH_TYPE_VALUES, TAB_LEADER_VALUES, TAB_STOP_ALIGNMENT_VALUES, TEXT_EFFECT_VALUES, THEME_COLOR_SLOT_VALUES, UNDERLINE_STYLE_VALUES } from "./types/documentEnumValues.js";
|
|
4
4
|
import { types_d_exports } from "./layout-engine/types.js";
|
|
5
5
|
import { measureTypes_d_exports } from "./layout-engine/measure/measureTypes.js";
|
|
6
6
|
export * from "@stll/docx-core/model";
|
|
7
7
|
declare namespace model_d_exports {
|
|
8
|
-
export { BORDER_STYLE_VALUES, CONDITIONAL_STYLE_TYPE_VALUES, DeriveBlockIdInput, EMPHASIS_MARK_VALUES, FIELD_TYPE_VALUES, FLOATING_TABLE_X_SPEC_VALUES, FLOATING_TABLE_Y_SPEC_VALUES, FONT_HINT_VALUES, FONT_THEME_VALUES, FRAME_WRAP_VALUES, FRAME_X_ALIGN_VALUES, FRAME_Y_ALIGN_VALUES, FolioBlockId, HIGHLIGHT_COLOR_VALUES, IMAGE_HORIZONTAL_ALIGNMENT_VALUES, IMAGE_HORIZONTAL_RELATIVE_TO_VALUES, IMAGE_VERTICAL_ALIGNMENT_VALUES, IMAGE_VERTICAL_RELATIVE_TO_VALUES, IMAGE_WRAP_TEXT_VALUES, IMAGE_WRAP_TYPE_VALUES, LEVEL_SUFFIX_VALUES, LINE_SPACING_RULE_VALUES, types_d_exports as Layout, measureTypes_d_exports as Measure, NUMBER_FORMAT_VALUES, OUTLINE_STYLE_ATTR_VALUES, OUTLINE_STYLE_CSS_ALIASES, OUTLINE_STYLE_CSS_ALIAS_VALUES, OutlineStyleAttr, OutlineStyleCssAlias, PARAGRAPH_ALIGNMENT_VALUES, SDT_LOCK_VALUES, SDT_TYPE_VALUES, SHADING_PATTERN_VALUES, SHAPE_OUTLINE_STYLE_VALUES, SHAPE_TYPE_VALUES, STYLE_TYPE_VALUES, TABLE_CELL_TEXT_DIRECTION_VALUES, TABLE_CELL_VERTICAL_ALIGNMENT_VALUES, TABLE_JUSTIFICATION_VALUES, TABLE_ROW_HEIGHT_RULE_VALUES, TABLE_WIDTH_TYPE_VALUES, TAB_LEADER_VALUES, TAB_STOP_ALIGNMENT_VALUES, TEXT_EFFECT_VALUES, THEME_COLOR_SLOT_VALUES, UNDERLINE_STYLE_VALUES, deriveBlockId, getFolioParaIdFromBlockId, getSequentialFolioBlockIdIndex, isFolioBlockId, isSequentialFolioBlockId };
|
|
8
|
+
export { BORDER_STYLE_VALUES, CONDITIONAL_STYLE_TYPE_VALUES, DeriveBlockIdInput, EMPHASIS_MARK_VALUES, FIELD_TYPE_VALUES, FLOATING_TABLE_X_SPEC_VALUES, FLOATING_TABLE_Y_SPEC_VALUES, FONT_HINT_VALUES, FONT_THEME_VALUES, FRAME_WRAP_VALUES, FRAME_X_ALIGN_VALUES, FRAME_Y_ALIGN_VALUES, FolioBlockId, HIGHLIGHT_COLOR_VALUES, IMAGE_HORIZONTAL_ALIGNMENT_VALUES, IMAGE_HORIZONTAL_RELATIVE_TO_VALUES, IMAGE_VERTICAL_ALIGNMENT_VALUES, IMAGE_VERTICAL_RELATIVE_TO_VALUES, IMAGE_WRAP_TEXT_VALUES, IMAGE_WRAP_TYPE_VALUES, LEVEL_SUFFIX_VALUES, LINE_SPACING_RULE_VALUES, types_d_exports as Layout, measureTypes_d_exports as Measure, NUMBER_FORMAT_VALUES, OUTLINE_STYLE_ATTR_VALUES, OUTLINE_STYLE_CSS_ALIASES, OUTLINE_STYLE_CSS_ALIAS_VALUES, OutlineStyleAttr, OutlineStyleCssAlias, PARAGRAPH_ALIGNMENT_VALUES, POSITIONAL_TAB_ALIGNMENT_VALUES, POSITIONAL_TAB_LEADER_VALUES, POSITIONAL_TAB_RELATIVE_TO_VALUES, SDT_LOCK_VALUES, SDT_TYPE_VALUES, SHADING_PATTERN_VALUES, SHAPE_OUTLINE_STYLE_VALUES, SHAPE_TYPE_VALUES, STYLE_TYPE_VALUES, TABLE_CELL_TEXT_DIRECTION_VALUES, TABLE_CELL_VERTICAL_ALIGNMENT_VALUES, TABLE_JUSTIFICATION_VALUES, TABLE_ROW_HEIGHT_RULE_VALUES, TABLE_WIDTH_TYPE_VALUES, TAB_LEADER_VALUES, TAB_STOP_ALIGNMENT_VALUES, TEXT_EFFECT_VALUES, THEME_COLOR_SLOT_VALUES, UNDERLINE_STYLE_VALUES, deriveBlockId, getFolioParaIdFromBlockId, getSequentialFolioBlockIdIndex, isFolioBlockId, isSequentialFolioBlockId };
|
|
9
9
|
}
|
|
10
10
|
//#endregion
|
|
11
|
-
export { BORDER_STYLE_VALUES, CONDITIONAL_STYLE_TYPE_VALUES, DeriveBlockIdInput, EMPHASIS_MARK_VALUES, FIELD_TYPE_VALUES, FLOATING_TABLE_X_SPEC_VALUES, FLOATING_TABLE_Y_SPEC_VALUES, FONT_HINT_VALUES, FONT_THEME_VALUES, FRAME_WRAP_VALUES, FRAME_X_ALIGN_VALUES, FRAME_Y_ALIGN_VALUES, FolioBlockId, HIGHLIGHT_COLOR_VALUES, IMAGE_HORIZONTAL_ALIGNMENT_VALUES, IMAGE_HORIZONTAL_RELATIVE_TO_VALUES, IMAGE_VERTICAL_ALIGNMENT_VALUES, IMAGE_VERTICAL_RELATIVE_TO_VALUES, IMAGE_WRAP_TEXT_VALUES, IMAGE_WRAP_TYPE_VALUES, LEVEL_SUFFIX_VALUES, LINE_SPACING_RULE_VALUES, types_d_exports as Layout, type measureTypes_d_exports as Measure, NUMBER_FORMAT_VALUES, OUTLINE_STYLE_ATTR_VALUES, OUTLINE_STYLE_CSS_ALIASES, OUTLINE_STYLE_CSS_ALIAS_VALUES, OutlineStyleAttr, OutlineStyleCssAlias, PARAGRAPH_ALIGNMENT_VALUES, SDT_LOCK_VALUES, SDT_TYPE_VALUES, SHADING_PATTERN_VALUES, SHAPE_OUTLINE_STYLE_VALUES, SHAPE_TYPE_VALUES, STYLE_TYPE_VALUES, TABLE_CELL_TEXT_DIRECTION_VALUES, TABLE_CELL_VERTICAL_ALIGNMENT_VALUES, TABLE_JUSTIFICATION_VALUES, TABLE_ROW_HEIGHT_RULE_VALUES, TABLE_WIDTH_TYPE_VALUES, TAB_LEADER_VALUES, TAB_STOP_ALIGNMENT_VALUES, TEXT_EFFECT_VALUES, THEME_COLOR_SLOT_VALUES, UNDERLINE_STYLE_VALUES, deriveBlockId, getFolioParaIdFromBlockId, getSequentialFolioBlockIdIndex, isFolioBlockId, isSequentialFolioBlockId };
|
|
11
|
+
export { BORDER_STYLE_VALUES, CONDITIONAL_STYLE_TYPE_VALUES, DeriveBlockIdInput, EMPHASIS_MARK_VALUES, FIELD_TYPE_VALUES, FLOATING_TABLE_X_SPEC_VALUES, FLOATING_TABLE_Y_SPEC_VALUES, FONT_HINT_VALUES, FONT_THEME_VALUES, FRAME_WRAP_VALUES, FRAME_X_ALIGN_VALUES, FRAME_Y_ALIGN_VALUES, FolioBlockId, HIGHLIGHT_COLOR_VALUES, IMAGE_HORIZONTAL_ALIGNMENT_VALUES, IMAGE_HORIZONTAL_RELATIVE_TO_VALUES, IMAGE_VERTICAL_ALIGNMENT_VALUES, IMAGE_VERTICAL_RELATIVE_TO_VALUES, IMAGE_WRAP_TEXT_VALUES, IMAGE_WRAP_TYPE_VALUES, LEVEL_SUFFIX_VALUES, LINE_SPACING_RULE_VALUES, types_d_exports as Layout, type measureTypes_d_exports as Measure, NUMBER_FORMAT_VALUES, OUTLINE_STYLE_ATTR_VALUES, OUTLINE_STYLE_CSS_ALIASES, OUTLINE_STYLE_CSS_ALIAS_VALUES, OutlineStyleAttr, OutlineStyleCssAlias, PARAGRAPH_ALIGNMENT_VALUES, POSITIONAL_TAB_ALIGNMENT_VALUES, POSITIONAL_TAB_LEADER_VALUES, POSITIONAL_TAB_RELATIVE_TO_VALUES, SDT_LOCK_VALUES, SDT_TYPE_VALUES, SHADING_PATTERN_VALUES, SHAPE_OUTLINE_STYLE_VALUES, SHAPE_TYPE_VALUES, STYLE_TYPE_VALUES, TABLE_CELL_TEXT_DIRECTION_VALUES, TABLE_CELL_VERTICAL_ALIGNMENT_VALUES, TABLE_JUSTIFICATION_VALUES, TABLE_ROW_HEIGHT_RULE_VALUES, TABLE_WIDTH_TYPE_VALUES, TAB_LEADER_VALUES, TAB_STOP_ALIGNMENT_VALUES, TEXT_EFFECT_VALUES, THEME_COLOR_SLOT_VALUES, UNDERLINE_STYLE_VALUES, deriveBlockId, getFolioParaIdFromBlockId, getSequentialFolioBlockIdIndex, isFolioBlockId, isSequentialFolioBlockId };
|
package/dist/model.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { BORDER_STYLE_VALUES, CONDITIONAL_STYLE_TYPE_VALUES, EMPHASIS_MARK_VALUES, FIELD_TYPE_VALUES, FLOATING_TABLE_X_SPEC_VALUES, FLOATING_TABLE_Y_SPEC_VALUES, FONT_HINT_VALUES, FONT_THEME_VALUES, FRAME_WRAP_VALUES, FRAME_X_ALIGN_VALUES, FRAME_Y_ALIGN_VALUES, HIGHLIGHT_COLOR_VALUES, IMAGE_HORIZONTAL_ALIGNMENT_VALUES, IMAGE_HORIZONTAL_RELATIVE_TO_VALUES, IMAGE_VERTICAL_ALIGNMENT_VALUES, IMAGE_VERTICAL_RELATIVE_TO_VALUES, IMAGE_WRAP_TEXT_VALUES, IMAGE_WRAP_TYPE_VALUES, LEVEL_SUFFIX_VALUES, LINE_SPACING_RULE_VALUES, NUMBER_FORMAT_VALUES, OUTLINE_STYLE_ATTR_VALUES, OUTLINE_STYLE_CSS_ALIASES, OUTLINE_STYLE_CSS_ALIAS_VALUES, PARAGRAPH_ALIGNMENT_VALUES, SDT_LOCK_VALUES, SDT_TYPE_VALUES, SHADING_PATTERN_VALUES, SHAPE_OUTLINE_STYLE_VALUES, SHAPE_TYPE_VALUES, STYLE_TYPE_VALUES, TABLE_CELL_TEXT_DIRECTION_VALUES, TABLE_CELL_VERTICAL_ALIGNMENT_VALUES, TABLE_JUSTIFICATION_VALUES, TABLE_ROW_HEIGHT_RULE_VALUES, TABLE_WIDTH_TYPE_VALUES, TAB_LEADER_VALUES, TAB_STOP_ALIGNMENT_VALUES, TEXT_EFFECT_VALUES, THEME_COLOR_SLOT_VALUES, UNDERLINE_STYLE_VALUES } from "./types/documentEnumValues.js";
|
|
2
|
-
import { deriveBlockId, getFolioParaIdFromBlockId, getSequentialFolioBlockIdIndex, isFolioBlockId, isSequentialFolioBlockId } from "./types/block-id.js";
|
|
3
1
|
import { types_exports } from "./layout-engine/types.js";
|
|
4
|
-
|
|
2
|
+
import { deriveBlockId, getFolioParaIdFromBlockId, getSequentialFolioBlockIdIndex, isFolioBlockId, isSequentialFolioBlockId } from "./types/block-id.js";
|
|
3
|
+
import { BORDER_STYLE_VALUES, CONDITIONAL_STYLE_TYPE_VALUES, EMPHASIS_MARK_VALUES, FIELD_TYPE_VALUES, FLOATING_TABLE_X_SPEC_VALUES, FLOATING_TABLE_Y_SPEC_VALUES, FONT_HINT_VALUES, FONT_THEME_VALUES, FRAME_WRAP_VALUES, FRAME_X_ALIGN_VALUES, FRAME_Y_ALIGN_VALUES, HIGHLIGHT_COLOR_VALUES, IMAGE_HORIZONTAL_ALIGNMENT_VALUES, IMAGE_HORIZONTAL_RELATIVE_TO_VALUES, IMAGE_VERTICAL_ALIGNMENT_VALUES, IMAGE_VERTICAL_RELATIVE_TO_VALUES, IMAGE_WRAP_TEXT_VALUES, IMAGE_WRAP_TYPE_VALUES, LEVEL_SUFFIX_VALUES, LINE_SPACING_RULE_VALUES, NUMBER_FORMAT_VALUES, OUTLINE_STYLE_ATTR_VALUES, OUTLINE_STYLE_CSS_ALIASES, OUTLINE_STYLE_CSS_ALIAS_VALUES, PARAGRAPH_ALIGNMENT_VALUES, POSITIONAL_TAB_ALIGNMENT_VALUES, POSITIONAL_TAB_LEADER_VALUES, POSITIONAL_TAB_RELATIVE_TO_VALUES, SDT_LOCK_VALUES, SDT_TYPE_VALUES, SHADING_PATTERN_VALUES, SHAPE_OUTLINE_STYLE_VALUES, SHAPE_TYPE_VALUES, STYLE_TYPE_VALUES, TABLE_CELL_TEXT_DIRECTION_VALUES, TABLE_CELL_VERTICAL_ALIGNMENT_VALUES, TABLE_JUSTIFICATION_VALUES, TABLE_ROW_HEIGHT_RULE_VALUES, TABLE_WIDTH_TYPE_VALUES, TAB_LEADER_VALUES, TAB_STOP_ALIGNMENT_VALUES, TEXT_EFFECT_VALUES, THEME_COLOR_SLOT_VALUES, UNDERLINE_STYLE_VALUES } from "./types/documentEnumValues.js";
|
|
4
|
+
export { BORDER_STYLE_VALUES, CONDITIONAL_STYLE_TYPE_VALUES, EMPHASIS_MARK_VALUES, FIELD_TYPE_VALUES, FLOATING_TABLE_X_SPEC_VALUES, FLOATING_TABLE_Y_SPEC_VALUES, FONT_HINT_VALUES, FONT_THEME_VALUES, FRAME_WRAP_VALUES, FRAME_X_ALIGN_VALUES, FRAME_Y_ALIGN_VALUES, HIGHLIGHT_COLOR_VALUES, IMAGE_HORIZONTAL_ALIGNMENT_VALUES, IMAGE_HORIZONTAL_RELATIVE_TO_VALUES, IMAGE_VERTICAL_ALIGNMENT_VALUES, IMAGE_VERTICAL_RELATIVE_TO_VALUES, IMAGE_WRAP_TEXT_VALUES, IMAGE_WRAP_TYPE_VALUES, LEVEL_SUFFIX_VALUES, LINE_SPACING_RULE_VALUES, types_exports as Layout, NUMBER_FORMAT_VALUES, OUTLINE_STYLE_ATTR_VALUES, OUTLINE_STYLE_CSS_ALIASES, OUTLINE_STYLE_CSS_ALIAS_VALUES, PARAGRAPH_ALIGNMENT_VALUES, POSITIONAL_TAB_ALIGNMENT_VALUES, POSITIONAL_TAB_LEADER_VALUES, POSITIONAL_TAB_RELATIVE_TO_VALUES, SDT_LOCK_VALUES, SDT_TYPE_VALUES, SHADING_PATTERN_VALUES, SHAPE_OUTLINE_STYLE_VALUES, SHAPE_TYPE_VALUES, STYLE_TYPE_VALUES, TABLE_CELL_TEXT_DIRECTION_VALUES, TABLE_CELL_VERTICAL_ALIGNMENT_VALUES, TABLE_JUSTIFICATION_VALUES, TABLE_ROW_HEIGHT_RULE_VALUES, TABLE_WIDTH_TYPE_VALUES, TAB_LEADER_VALUES, TAB_STOP_ALIGNMENT_VALUES, TEXT_EFFECT_VALUES, THEME_COLOR_SLOT_VALUES, UNDERLINE_STYLE_VALUES, deriveBlockId, getFolioParaIdFromBlockId, getSequentialFolioBlockIdIndex, isFolioBlockId, isSequentialFolioBlockId };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { CharacterSpacingAttrs, CharacterStyleAttrs, CommentAttrs, EmphasisMarkAttrs, FontFamilyAttrs, FontSizeAttrs, FootnoteRefAttrs, HighlightAttrs, HyperlinkAttrs, LanguageAttrs, RunFormattingOverrideAttrs, RunPropertyChangeMarkAttrs, RunShadingAttrs, StrikeAttrs, TextColorAttrs, TextEffectAttrs, TrackedChangeMarkAttrs, UnderlineAttrs } from "../schema/marks.js";
|
|
2
|
-
import { BlockSdtAttrs, FieldAttrs, HardBreakAttrs, ImageAttrs, MathAttrs, ParagraphAttrs, SdtAttrs, ShapeAttrs, TableAttrs, TableCellAttrs, TableRowAttrs, TextBoxAttrs } from "../schema/nodes.js";
|
|
2
|
+
import { BlockSdtAttrs, FieldAttrs, HardBreakAttrs, ImageAttrs, MathAttrs, ParagraphAttrs, SdtAttrs, ShapeAttrs, TabAttrs, TableAttrs, TableCellAttrs, TableRowAttrs, TextBoxAttrs } from "../schema/nodes.js";
|
|
3
3
|
import "../schema/index.js";
|
|
4
4
|
import { Mark, Node } from "prosemirror-model";
|
|
5
5
|
//#region src/prosemirror/attrs/index.d.ts
|
|
@@ -18,6 +18,8 @@ declare const readParagraphAttrs: (node: Node) => ReadProseMirrorAttrsResult<Par
|
|
|
18
18
|
declare const expectParagraphAttrs: (node: Node) => ParagraphAttrs;
|
|
19
19
|
declare const readHardBreakAttrs: (node: Node) => ReadProseMirrorAttrsResult<HardBreakAttrs>;
|
|
20
20
|
declare const expectHardBreakAttrs: (node: Node) => HardBreakAttrs;
|
|
21
|
+
declare const readTabAttrs: (node: Node) => ReadProseMirrorAttrsResult<TabAttrs>;
|
|
22
|
+
declare const expectTabAttrs: (node: Node) => TabAttrs;
|
|
21
23
|
declare const readTableAttrs: (node: Node) => ReadProseMirrorAttrsResult<TableAttrs>;
|
|
22
24
|
declare const expectTableAttrs: (node: Node) => TableAttrs;
|
|
23
25
|
declare const readTableRowAttrs: (node: Node) => ReadProseMirrorAttrsResult<TableRowAttrs>;
|
|
@@ -81,4 +83,4 @@ declare const mergeTableAttrs: (node: Node, patch: NodeAttrPatch<TableAttrs>) =>
|
|
|
81
83
|
declare const mergeTableRowAttrs: (node: Node, patch: NodeAttrPatch<TableRowAttrs>) => TableRowAttrs;
|
|
82
84
|
declare const mergeTableCellAttrs: (node: Node, patch: NodeAttrPatch<TableCellAttrs>) => TableCellAttrs;
|
|
83
85
|
//#endregion
|
|
84
|
-
export { ProseMirrorAttrIssue, ReadProseMirrorAttrsResult, expectBlockSdtAttrs, expectCharacterSpacingMarkAttrs, expectCharacterStyleMarkAttrs, expectCommentMarkAttrs, expectEmphasisMarkAttrs, expectFieldAttrs, expectFontFamilyMarkAttrs, expectFontSizeMarkAttrs, expectFootnoteRefMarkAttrs, expectHardBreakAttrs, expectHighlightMarkAttrs, expectHyperlinkMarkAttrs, expectImageAttrs, expectLanguageMarkAttrs, expectMathAttrs, expectParagraphAttrs, expectRunFormattingOverrideMarkAttrs, expectRunPropertyChangeMarkAttrs, expectRunShadingMarkAttrs, expectSdtAttrs, expectShapeAttrs, expectStrikeMarkAttrs, expectTableAttrs, expectTableCellAttrs, expectTableRowAttrs, expectTextBoxAttrs, expectTextColorMarkAttrs, expectTextEffectMarkAttrs, expectTrackedChangeMarkAttrs, expectUnderlineMarkAttrs, mergeImageAttrs, mergeParagraphAttrs, mergeTableAttrs, mergeTableCellAttrs, mergeTableRowAttrs, readBlockSdtAttrs, readCharacterSpacingMarkAttrs, readCharacterStyleMarkAttrs, readCommentMarkAttrs, readEmphasisMarkAttrs, readFieldAttrs, readFontFamilyMarkAttrs, readFontSizeMarkAttrs, readFootnoteRefMarkAttrs, readHardBreakAttrs, readHighlightMarkAttrs, readHyperlinkMarkAttrs, readImageAttrs, readLanguageMarkAttrs, readMathAttrs, readParagraphAttrs, readRunFormattingOverrideMarkAttrs, readRunPropertyChangeMarkAttrs, readRunShadingMarkAttrs, readSdtAttrs, readShapeAttrs, readStrikeMarkAttrs, readTableAttrs, readTableCellAttrs, readTableRowAttrs, readTextBoxAttrs, readTextColorMarkAttrs, readTextEffectMarkAttrs, readTrackedChangeMarkAttrs, readUnderlineMarkAttrs };
|
|
86
|
+
export { ProseMirrorAttrIssue, ReadProseMirrorAttrsResult, expectBlockSdtAttrs, expectCharacterSpacingMarkAttrs, expectCharacterStyleMarkAttrs, expectCommentMarkAttrs, expectEmphasisMarkAttrs, expectFieldAttrs, expectFontFamilyMarkAttrs, expectFontSizeMarkAttrs, expectFootnoteRefMarkAttrs, expectHardBreakAttrs, expectHighlightMarkAttrs, expectHyperlinkMarkAttrs, expectImageAttrs, expectLanguageMarkAttrs, expectMathAttrs, expectParagraphAttrs, expectRunFormattingOverrideMarkAttrs, expectRunPropertyChangeMarkAttrs, expectRunShadingMarkAttrs, expectSdtAttrs, expectShapeAttrs, expectStrikeMarkAttrs, expectTabAttrs, expectTableAttrs, expectTableCellAttrs, expectTableRowAttrs, expectTextBoxAttrs, expectTextColorMarkAttrs, expectTextEffectMarkAttrs, expectTrackedChangeMarkAttrs, expectUnderlineMarkAttrs, mergeImageAttrs, mergeParagraphAttrs, mergeTableAttrs, mergeTableCellAttrs, mergeTableRowAttrs, readBlockSdtAttrs, readCharacterSpacingMarkAttrs, readCharacterStyleMarkAttrs, readCommentMarkAttrs, readEmphasisMarkAttrs, readFieldAttrs, readFontFamilyMarkAttrs, readFontSizeMarkAttrs, readFootnoteRefMarkAttrs, readHardBreakAttrs, readHighlightMarkAttrs, readHyperlinkMarkAttrs, readImageAttrs, readLanguageMarkAttrs, readMathAttrs, readParagraphAttrs, readRunFormattingOverrideMarkAttrs, readRunPropertyChangeMarkAttrs, readRunShadingMarkAttrs, readSdtAttrs, readShapeAttrs, readStrikeMarkAttrs, readTabAttrs, readTableAttrs, readTableCellAttrs, readTableRowAttrs, readTextBoxAttrs, readTextColorMarkAttrs, readTextEffectMarkAttrs, readTrackedChangeMarkAttrs, readUnderlineMarkAttrs };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { FIELD_TYPE_VALUES, HIGHLIGHT_COLOR_VALUES, IMAGE_HORIZONTAL_ALIGNMENT_VALUES, IMAGE_HORIZONTAL_RELATIVE_TO_VALUES, IMAGE_VERTICAL_ALIGNMENT_VALUES, IMAGE_VERTICAL_RELATIVE_TO_VALUES, IMAGE_WRAP_TEXT_VALUES, IMAGE_WRAP_TYPE_VALUES, LINE_SPACING_RULE_VALUES, OUTLINE_STYLE_ATTR_VALUES, PARAGRAPH_ALIGNMENT_VALUES, SDT_LOCK_VALUES, SDT_TYPE_VALUES, SHADING_PATTERN_VALUES, TABLE_CELL_TEXT_DIRECTION_VALUES, TABLE_CELL_VERTICAL_ALIGNMENT_VALUES, TABLE_JUSTIFICATION_VALUES, TABLE_ROW_HEIGHT_RULE_VALUES, TABLE_WIDTH_TYPE_VALUES, TAB_LEADER_VALUES, TAB_STOP_ALIGNMENT_VALUES, TEXT_EFFECT_VALUES, THEME_COLOR_SLOT_VALUES, UNDERLINE_STYLE_VALUES } from "../../types/documentEnumValues.js";
|
|
1
|
+
import { FIELD_TYPE_VALUES, HIGHLIGHT_COLOR_VALUES, IMAGE_HORIZONTAL_ALIGNMENT_VALUES, IMAGE_HORIZONTAL_RELATIVE_TO_VALUES, IMAGE_VERTICAL_ALIGNMENT_VALUES, IMAGE_VERTICAL_RELATIVE_TO_VALUES, IMAGE_WRAP_TEXT_VALUES, IMAGE_WRAP_TYPE_VALUES, LINE_SPACING_RULE_VALUES, OUTLINE_STYLE_ATTR_VALUES, PARAGRAPH_ALIGNMENT_VALUES, POSITIONAL_TAB_ALIGNMENT_VALUES, POSITIONAL_TAB_LEADER_VALUES, POSITIONAL_TAB_RELATIVE_TO_VALUES, SDT_LOCK_VALUES, SDT_TYPE_VALUES, SHADING_PATTERN_VALUES, TABLE_CELL_TEXT_DIRECTION_VALUES, TABLE_CELL_VERTICAL_ALIGNMENT_VALUES, TABLE_JUSTIFICATION_VALUES, TABLE_ROW_HEIGHT_RULE_VALUES, TABLE_WIDTH_TYPE_VALUES, TAB_LEADER_VALUES, TAB_STOP_ALIGNMENT_VALUES, TEXT_EFFECT_VALUES, THEME_COLOR_SLOT_VALUES, UNDERLINE_STYLE_VALUES } from "../../types/documentEnumValues.js";
|
|
2
2
|
import { isParagraphDirection } from "../paragraphDirection.js";
|
|
3
3
|
import { TRACKED_CHANGE_PROVENANCE_VALUES } from "../schema/marks.js";
|
|
4
4
|
import { panic } from "better-result";
|
|
@@ -119,6 +119,7 @@ const SECTION_VERTICAL_ALIGNMENTS = [
|
|
|
119
119
|
];
|
|
120
120
|
const paragraphAttrsCache = /* @__PURE__ */ new WeakMap();
|
|
121
121
|
const hardBreakAttrsCache = /* @__PURE__ */ new WeakMap();
|
|
122
|
+
const tabAttrsCache = /* @__PURE__ */ new WeakMap();
|
|
122
123
|
const tableAttrsCache = /* @__PURE__ */ new WeakMap();
|
|
123
124
|
const tableRowAttrsCache = /* @__PURE__ */ new WeakMap();
|
|
124
125
|
const tableCellAttrsCache = /* @__PURE__ */ new WeakMap();
|
|
@@ -233,6 +234,20 @@ const readHardBreakAttrs = (node) => {
|
|
|
233
234
|
return attrsResult(attrs, issues);
|
|
234
235
|
};
|
|
235
236
|
const expectHardBreakAttrs = (node) => expectCachedNodeAttrs(node, hardBreakAttrsCache, readHardBreakAttrs, "hard break attrs");
|
|
237
|
+
const readTabAttrs = (node) => {
|
|
238
|
+
const attrs = attrsRecord(node.attrs);
|
|
239
|
+
const issues = [];
|
|
240
|
+
expectNodeType(node, "tab", issues);
|
|
241
|
+
optionalRecord(attrs, "positional", "tab.attrs.positional", issues);
|
|
242
|
+
const positional = attrs["positional"];
|
|
243
|
+
if (isRecord(positional)) {
|
|
244
|
+
optionalOneOf(positional, "relativeTo", "tab.attrs.positional.relativeTo", issues, POSITIONAL_TAB_RELATIVE_TO_VALUES);
|
|
245
|
+
optionalOneOf(positional, "alignment", "tab.attrs.positional.alignment", issues, POSITIONAL_TAB_ALIGNMENT_VALUES);
|
|
246
|
+
optionalOneOf(positional, "leader", "tab.attrs.positional.leader", issues, POSITIONAL_TAB_LEADER_VALUES);
|
|
247
|
+
}
|
|
248
|
+
return attrsResult(attrs, issues);
|
|
249
|
+
};
|
|
250
|
+
const expectTabAttrs = (node) => expectCachedNodeAttrs(node, tabAttrsCache, readTabAttrs, "tab attrs");
|
|
236
251
|
const readTableAttrs = (node) => {
|
|
237
252
|
const attrs = attrsRecord(node.attrs);
|
|
238
253
|
const issues = [];
|
|
@@ -1411,4 +1426,4 @@ const optionalEmptyHyperlinkArray = (value, issues) => {
|
|
|
1411
1426
|
}
|
|
1412
1427
|
};
|
|
1413
1428
|
//#endregion
|
|
1414
|
-
export { expectBlockSdtAttrs, expectCharacterSpacingMarkAttrs, expectCharacterStyleMarkAttrs, expectCommentMarkAttrs, expectEmphasisMarkAttrs, expectFieldAttrs, expectFontFamilyMarkAttrs, expectFontSizeMarkAttrs, expectFootnoteRefMarkAttrs, expectHardBreakAttrs, expectHighlightMarkAttrs, expectHyperlinkMarkAttrs, expectImageAttrs, expectLanguageMarkAttrs, expectMathAttrs, expectParagraphAttrs, expectRunFormattingOverrideMarkAttrs, expectRunPropertyChangeMarkAttrs, expectRunShadingMarkAttrs, expectSdtAttrs, expectShapeAttrs, expectStrikeMarkAttrs, expectTableAttrs, expectTableCellAttrs, expectTableRowAttrs, expectTextBoxAttrs, expectTextColorMarkAttrs, expectTextEffectMarkAttrs, expectTrackedChangeMarkAttrs, expectUnderlineMarkAttrs, mergeImageAttrs, mergeParagraphAttrs, mergeTableAttrs, mergeTableCellAttrs, mergeTableRowAttrs, readBlockSdtAttrs, readCharacterSpacingMarkAttrs, readCharacterStyleMarkAttrs, readCommentMarkAttrs, readEmphasisMarkAttrs, readFieldAttrs, readFontFamilyMarkAttrs, readFontSizeMarkAttrs, readFootnoteRefMarkAttrs, readHardBreakAttrs, readHighlightMarkAttrs, readHyperlinkMarkAttrs, readImageAttrs, readLanguageMarkAttrs, readMathAttrs, readParagraphAttrs, readRunFormattingOverrideMarkAttrs, readRunPropertyChangeMarkAttrs, readRunShadingMarkAttrs, readSdtAttrs, readShapeAttrs, readStrikeMarkAttrs, readTableAttrs, readTableCellAttrs, readTableRowAttrs, readTextBoxAttrs, readTextColorMarkAttrs, readTextEffectMarkAttrs, readTrackedChangeMarkAttrs, readUnderlineMarkAttrs };
|
|
1429
|
+
export { expectBlockSdtAttrs, expectCharacterSpacingMarkAttrs, expectCharacterStyleMarkAttrs, expectCommentMarkAttrs, expectEmphasisMarkAttrs, expectFieldAttrs, expectFontFamilyMarkAttrs, expectFontSizeMarkAttrs, expectFootnoteRefMarkAttrs, expectHardBreakAttrs, expectHighlightMarkAttrs, expectHyperlinkMarkAttrs, expectImageAttrs, expectLanguageMarkAttrs, expectMathAttrs, expectParagraphAttrs, expectRunFormattingOverrideMarkAttrs, expectRunPropertyChangeMarkAttrs, expectRunShadingMarkAttrs, expectSdtAttrs, expectShapeAttrs, expectStrikeMarkAttrs, expectTabAttrs, expectTableAttrs, expectTableCellAttrs, expectTableRowAttrs, expectTextBoxAttrs, expectTextColorMarkAttrs, expectTextEffectMarkAttrs, expectTrackedChangeMarkAttrs, expectUnderlineMarkAttrs, mergeImageAttrs, mergeParagraphAttrs, mergeTableAttrs, mergeTableCellAttrs, mergeTableRowAttrs, readBlockSdtAttrs, readCharacterSpacingMarkAttrs, readCharacterStyleMarkAttrs, readCommentMarkAttrs, readEmphasisMarkAttrs, readFieldAttrs, readFontFamilyMarkAttrs, readFontSizeMarkAttrs, readFootnoteRefMarkAttrs, readHardBreakAttrs, readHighlightMarkAttrs, readHyperlinkMarkAttrs, readImageAttrs, readLanguageMarkAttrs, readMathAttrs, readParagraphAttrs, readRunFormattingOverrideMarkAttrs, readRunPropertyChangeMarkAttrs, readRunShadingMarkAttrs, readSdtAttrs, readShapeAttrs, readStrikeMarkAttrs, readTabAttrs, readTableAttrs, readTableCellAttrs, readTableRowAttrs, readTextBoxAttrs, readTextColorMarkAttrs, readTextEffectMarkAttrs, readTrackedChangeMarkAttrs, readUnderlineMarkAttrs };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { expectRunPropertyChangeMarkAttrs } from "../attrs/index.js";
|
|
2
|
-
import { RUN_FORMATTING_MARK_NAMES } from "../runFormattingMarkNames.js";
|
|
3
|
-
import { markStructuralChange } from "../extensions/features/ParagraphChangeTrackerExtension.js";
|
|
4
|
-
import { paragraphRejectAttrPatch, paragraphRejectOriginalFormatting, sectionRejectProperties, tableCellRejectAttrPatch, tableRejectAttrPatch, tableRowRejectAttrPatch } from "./propertyChangeScope.js";
|
|
5
2
|
import { textFormattingToMarks } from "../conversion/toProseDoc.js";
|
|
3
|
+
import { markStructuralChange } from "../extensions/features/ParagraphChangeTrackerExtension.js";
|
|
4
|
+
import { RUN_FORMATTING_MARK_NAMES } from "../runFormattingMarkNames.js";
|
|
6
5
|
import { getTableCellMergeChange } from "../tableCellMergeRevision.js";
|
|
6
|
+
import { paragraphRejectAttrPatch, paragraphRejectOriginalFormatting, sectionRejectProperties, tableCellRejectAttrPatch, tableRejectAttrPatch, tableRowRejectAttrPatch } from "./propertyChangeScope.js";
|
|
7
7
|
import { hasMatchingCollapsedTableCellMerge, resolveCollapsedTableCellMerge, resolveVisibleTableCellMerge } from "./tableCellMergeResolution.js";
|
|
8
8
|
import { TableMap, removeRow } from "prosemirror-tables";
|
|
9
9
|
//#region src/prosemirror/commands/comments.ts
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { expectBlockSdtAttrs } from "../attrs/index.js";
|
|
2
1
|
import { ContentControlBoundError, ContentControlLockedError, ContentControlTypeError } from "../../content-controls/errors.js";
|
|
3
2
|
import { formatDate } from "../../docx/fieldParser.js";
|
|
3
|
+
import { expectBlockSdtAttrs } from "../attrs/index.js";
|
|
4
4
|
import { SUGGESTION_BYPASS_META } from "../plugins/suggestionMode.js";
|
|
5
5
|
//#region src/prosemirror/commands/contentControls.ts
|
|
6
6
|
function nodeMatchesFilter(node, pos, filter) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { replaceBlockSdtChildrenForFill } from "./contentControls.js";
|
|
2
1
|
import { headerFooterToProseDoc } from "../conversion/toProseDoc.js";
|
|
2
|
+
import { replaceBlockSdtChildrenForFill } from "./contentControls.js";
|
|
3
3
|
//#region src/prosemirror/commands/contentControlsBlockFill.ts
|
|
4
4
|
function blockContentToPMChildren(blocks) {
|
|
5
5
|
const pmDoc = headerFooterToProseDoc(blocks);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { clearFormatting, createRemoveMarkCommand, createSetMarkCommand, getMarkAttr, isMarkActive, textFormattingToMarks as textFormattingToMarks$1 } from "../extensions/marks/markUtils.js";
|
|
2
1
|
import { getHyperlinkAttrs, getSelectedText, isHyperlinkActive } from "../extensions/marks/HyperlinkExtension.js";
|
|
2
|
+
import { clearFormatting, createRemoveMarkCommand, createSetMarkCommand, getMarkAttr, isMarkActive, textFormattingToMarks as textFormattingToMarks$1 } from "../extensions/marks/markUtils.js";
|
|
3
3
|
import { schema, singletonManager } from "../schema/index.js";
|
|
4
4
|
//#region src/prosemirror/commands/formatting.ts
|
|
5
5
|
/**
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { expectHyperlinkMarkAttrs } from "../attrs/index.js";
|
|
2
1
|
import { normalizeUserUrl } from "../../utils/urlSecurity.js";
|
|
2
|
+
import { expectHyperlinkMarkAttrs } from "../attrs/index.js";
|
|
3
3
|
//#region src/prosemirror/commands/hyperlink.ts
|
|
4
4
|
const hyperlinkHref = (mark) => expectHyperlinkMarkAttrs(mark).href;
|
|
5
5
|
/**
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { IMAGE_HORIZONTAL_ALIGNMENT_VALUES, IMAGE_HORIZONTAL_RELATIVE_TO_VALUES, IMAGE_VERTICAL_ALIGNMENT_VALUES, IMAGE_VERTICAL_RELATIVE_TO_VALUES } from "../../types/documentEnumValues.js";
|
|
2
|
-
import { expectImageAttrs, mergeImageAttrs } from "../attrs/index.js";
|
|
3
|
-
import { sanitizeImageSrc } from "../../utils/sanitizeImageSrc.js";
|
|
4
2
|
import { isSafeImageFile } from "../../utils/imageValidation.js";
|
|
3
|
+
import { sanitizeImageSrc } from "../../utils/sanitizeImageSrc.js";
|
|
4
|
+
import { expectImageAttrs, mergeImageAttrs } from "../attrs/index.js";
|
|
5
5
|
//#region src/prosemirror/commands/image.ts
|
|
6
6
|
/** Map a toolbar wrap selection to the image's wrapType/displayMode/cssFloat, or null when unknown. */
|
|
7
7
|
const resolveImageWrap = (wrapType) => {
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { getParagraphAlignment, getParagraphBidi, getStyleId } from "../extensions/core/ParagraphExtension.js";
|
|
2
|
-
import { clearFormatting, createRemoveMarkCommand, createSetMarkCommand, getMarkAttr, isMarkActive } from "../extensions/marks/markUtils.js";
|
|
3
|
-
import { getTableContext, isInTable as isInTableCell } from "../extensions/nodes/TableExtension.js";
|
|
4
2
|
import { getListInfo, isInList } from "../extensions/features/ListExtension.js";
|
|
5
|
-
import { CLIPBOARD_READ_ERROR_EVENT, buildPlainTextSlice, pasteWithoutFormatting } from "./pastePlainText.js";
|
|
6
3
|
import { getHyperlinkAttrs, getSelectedText, isHyperlinkActive } from "../extensions/marks/HyperlinkExtension.js";
|
|
4
|
+
import { clearFormatting, createRemoveMarkCommand, createSetMarkCommand, getMarkAttr, isMarkActive } from "../extensions/marks/markUtils.js";
|
|
5
|
+
import { getTableContext, isInTable as isInTableCell } from "../extensions/nodes/TableExtension.js";
|
|
7
6
|
import { acceptAIEditRevision, acceptAllChanges, acceptAllSuggestions, acceptChange, acceptSuggestion, addCommentMark, findAIEditRevisionRange, findNextChange, findPreviousChange, findSuggestionRange, getSuggestions, rejectAIEditRevision, rejectAllChanges, rejectAllSuggestions, rejectChange, rejectSuggestion, removeCommentMark } from "./comments.js";
|
|
8
|
-
import { addColumnLeft, addColumnRight, addRowAbove, addRowBelow, applyTableStyle, autoFitContents, deleteColumn, deleteRow, deleteTable, distributeColumns, insertTable, mergeCells, removeTableBorders, selectColumn, selectRow, selectTable, setAllTableBorders, setCellBorder, setCellFillColor, setCellMargins, setCellTextDirection, setCellVerticalAlign, setInsideTableBorders, setOutsideTableBorders, setRowHeight, setTableBorderColor, setTableBorderPreset, setTableBorderWidth, setTableBorders, setTableProperties, splitCell, toggleHeaderRow, toggleNoWrap } from "./table.js";
|
|
9
|
-
import { clearFontFamily, clearFontSize, clearHighlight, clearTextColor, insertHyperlink, removeHyperlink, setFontFamily, setFontSize, setHighlight, setHyperlink, setTextColor, setUnderlineStyle, toggleBold, toggleItalic, toggleStrike, toggleSubscript, toggleSuperscript, toggleUnderline } from "./formatting.js";
|
|
10
|
-
import { addTabStop, alignCenter, alignJustify, alignLeft, alignRight, applyStyle, clearStyle, decreaseIndent, decreaseListLevel, doubleSpacing, generateTOC, increaseIndent, increaseListLevel, oneAndHalfSpacing, removeList, removeTabStop, setAlignment, setIndentFirstLine, setIndentLeft, setIndentRight, setLineSpacing, setLtr, setRtl, setSpaceAfter, setSpaceBefore, singleSpacing, toggleBidi, toggleBulletList, toggleNumberedList } from "./paragraph.js";
|
|
11
7
|
import { PAINTABLE_MARK_NAMES, applyFormatMarks, captureFormatMarks } from "./formatPainter.js";
|
|
8
|
+
import { clearFontFamily, clearFontSize, clearHighlight, clearTextColor, insertHyperlink, removeHyperlink, setFontFamily, setFontSize, setHighlight, setHyperlink, setTextColor, setUnderlineStyle, toggleBold, toggleItalic, toggleStrike, toggleSubscript, toggleSuperscript, toggleUnderline } from "./formatting.js";
|
|
12
9
|
import { insertPageBreak } from "./pageBreak.js";
|
|
10
|
+
import { addTabStop, alignCenter, alignJustify, alignLeft, alignRight, applyStyle, clearStyle, decreaseIndent, decreaseListLevel, doubleSpacing, generateTOC, increaseIndent, increaseListLevel, oneAndHalfSpacing, removeList, removeTabStop, setAlignment, setIndentFirstLine, setIndentLeft, setIndentRight, setLineSpacing, setLtr, setRtl, setSpaceAfter, setSpaceBefore, singleSpacing, toggleBidi, toggleBulletList, toggleNumberedList } from "./paragraph.js";
|
|
11
|
+
import { CLIPBOARD_READ_ERROR_EVENT, buildPlainTextSlice, pasteWithoutFormatting } from "./pastePlainText.js";
|
|
12
|
+
import { addColumnLeft, addColumnRight, addRowAbove, addRowBelow, applyTableStyle, autoFitContents, deleteColumn, deleteRow, deleteTable, distributeColumns, insertTable, mergeCells, removeTableBorders, selectColumn, selectRow, selectTable, setAllTableBorders, setCellBorder, setCellFillColor, setCellMargins, setCellTextDirection, setCellVerticalAlign, setInsideTableBorders, setOutsideTableBorders, setRowHeight, setTableBorderColor, setTableBorderPreset, setTableBorderWidth, setTableBorders, setTableProperties, splitCell, toggleHeaderRow, toggleNoWrap } from "./table.js";
|
|
13
13
|
export { CLIPBOARD_READ_ERROR_EVENT, PAINTABLE_MARK_NAMES, acceptAIEditRevision, acceptAllChanges, acceptAllSuggestions, acceptChange, acceptSuggestion, addColumnLeft, addColumnRight, addCommentMark, addRowAbove, addRowBelow, addTabStop, alignCenter, alignJustify, alignLeft, alignRight, applyFormatMarks, applyStyle, applyTableStyle, autoFitContents, buildPlainTextSlice, captureFormatMarks, clearFontFamily, clearFontSize, clearFormatting, clearHighlight, clearStyle, clearTextColor, createRemoveMarkCommand, createSetMarkCommand, decreaseIndent, decreaseListLevel, deleteColumn, deleteRow, deleteTable, distributeColumns, doubleSpacing, findAIEditRevisionRange, findNextChange, findPreviousChange, findSuggestionRange, generateTOC, getHyperlinkAttrs, getListInfo, getMarkAttr, getParagraphAlignment, getParagraphBidi, getSelectedText, getStyleId, getSuggestions, getTableContext, increaseIndent, increaseListLevel, insertHyperlink, insertPageBreak, insertTable, isHyperlinkActive, isInList, isInTableCell as isInTable, isMarkActive, mergeCells, oneAndHalfSpacing, pasteWithoutFormatting, rejectAIEditRevision, rejectAllChanges, rejectAllSuggestions, rejectChange, rejectSuggestion, removeCommentMark, removeHyperlink, removeList, removeTabStop, removeTableBorders, selectColumn, selectRow, selectTable, setAlignment, setAllTableBorders, setCellBorder, setCellFillColor, setCellMargins, setCellTextDirection, setCellVerticalAlign, setFontFamily, setFontSize, setHighlight, setHyperlink, setIndentFirstLine, setIndentLeft, setIndentRight, setInsideTableBorders, setLineSpacing, setLtr, setOutsideTableBorders, setRowHeight, setRtl, setSpaceAfter, setSpaceBefore, setTableBorderColor, setTableBorderPreset, setTableBorderWidth, setTableBorders, setTableProperties, setTextColor, setUnderlineStyle, singleSpacing, splitCell, toggleBidi, toggleBold, toggleBulletList, toggleHeaderRow, toggleItalic, toggleNoWrap, toggleNumberedList, toggleStrike, toggleSubscript, toggleSuperscript, toggleUnderline };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { directionFromBidi } from "../paragraphDirection.js";
|
|
2
1
|
import { setAutospacingBaseValue } from "../autospacingBase.js";
|
|
2
|
+
import { directionFromBidi } from "../paragraphDirection.js";
|
|
3
3
|
//#region src/prosemirror/commands/propertyChangeScope.ts
|
|
4
4
|
/**
|
|
5
5
|
* Paragraph attrs governed by a `w:pPrChange` — the attrs
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { standaloneTableCellToProseMirror } from "../conversion/toProseDoc.js";
|
|
2
1
|
import { standaloneTableCellFromProseMirror } from "../conversion/fromProseDoc.js";
|
|
2
|
+
import { standaloneTableCellToProseMirror } from "../conversion/toProseDoc.js";
|
|
3
3
|
import { getTableCellMergeChange } from "../tableCellMergeRevision.js";
|
|
4
4
|
import { Result } from "better-result";
|
|
5
5
|
import { TableMap } from "prosemirror-tables";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { findParagraphByParaId } from "./utils/findParagraphByParaId.js";
|
|
2
1
|
import { findTextInPmParagraph } from "./paraText.js";
|
|
2
|
+
import { findParagraphByParaId } from "./utils/findParagraphByParaId.js";
|
|
3
3
|
//#region src/prosemirror/commentOps.ts
|
|
4
4
|
/** Build a Comment object with a freshly-allocated ID. */
|
|
5
5
|
function createComment(allocator, text, authorName, parentId) {
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { OUTLINE_STYLE_CSS_ALIASES } from "../../types/documentEnumValues.js";
|
|
2
|
-
import { directionToBidi } from "../paragraphDirection.js";
|
|
3
|
-
import { expectBlockSdtAttrs, expectCharacterSpacingMarkAttrs, expectCharacterStyleMarkAttrs, expectCommentMarkAttrs, expectEmphasisMarkAttrs, expectFieldAttrs, expectFontFamilyMarkAttrs, expectFontSizeMarkAttrs, expectFootnoteRefMarkAttrs, expectHardBreakAttrs, expectHighlightMarkAttrs, expectHyperlinkMarkAttrs, expectImageAttrs, expectLanguageMarkAttrs, expectMathAttrs, expectParagraphAttrs, expectRunFormattingOverrideMarkAttrs, expectRunPropertyChangeMarkAttrs, expectRunShadingMarkAttrs, expectSdtAttrs, expectShapeAttrs, expectStrikeMarkAttrs, expectTableAttrs, expectTableCellAttrs, expectTableRowAttrs, expectTextBoxAttrs, expectTextColorMarkAttrs, expectTextEffectMarkAttrs, expectTrackedChangeMarkAttrs, expectUnderlineMarkAttrs } from "../attrs/index.js";
|
|
4
|
-
import { ShapeOutlineStyleSchema, narrowEnum } from "../../docx/parserEnums.js";
|
|
5
1
|
import { numPrEqual } from "../../docx/numberingParser.js";
|
|
2
|
+
import { ShapeOutlineStyleSchema, narrowEnum } from "../../docx/parserEnums.js";
|
|
3
|
+
import { OUTLINE_STYLE_CSS_ALIASES } from "../../types/documentEnumValues.js";
|
|
6
4
|
import { pixelsToEmu } from "../../utils/units.js";
|
|
5
|
+
import { expectBlockSdtAttrs, expectCharacterSpacingMarkAttrs, expectCharacterStyleMarkAttrs, expectCommentMarkAttrs, expectEmphasisMarkAttrs, expectFieldAttrs, expectFontFamilyMarkAttrs, expectFontSizeMarkAttrs, expectFootnoteRefMarkAttrs, expectHardBreakAttrs, expectHighlightMarkAttrs, expectHyperlinkMarkAttrs, expectImageAttrs, expectLanguageMarkAttrs, expectMathAttrs, expectParagraphAttrs, expectRunFormattingOverrideMarkAttrs, expectRunPropertyChangeMarkAttrs, expectRunShadingMarkAttrs, expectSdtAttrs, expectShapeAttrs, expectStrikeMarkAttrs, expectTabAttrs, expectTableAttrs, expectTableCellAttrs, expectTableRowAttrs, expectTextBoxAttrs, expectTextColorMarkAttrs, expectTextEffectMarkAttrs, expectTrackedChangeMarkAttrs, expectUnderlineMarkAttrs } from "../attrs/index.js";
|
|
7
6
|
import { autospacingMatchesBase, hasAutospacingBaseSide } from "../autospacingBase.js";
|
|
7
|
+
import { directionToBidi } from "../paragraphDirection.js";
|
|
8
8
|
import { RUN_FORMATTING_MARK_NAMES } from "../runFormattingMarkNames.js";
|
|
9
9
|
import { expectTextBoxAnchorAttrs } from "../textBoxAnchorAttrs.js";
|
|
10
10
|
import { assertValidProseMirrorDocument } from "../validation.js";
|
|
@@ -806,7 +806,7 @@ function extractParagraphContent(paragraph, _documentCounts, emptyHyperlinks, te
|
|
|
806
806
|
content.push(createShapeRun(node));
|
|
807
807
|
} else if (node.type.name === "tab") {
|
|
808
808
|
flushCurrentInline();
|
|
809
|
-
content.push(createTabRun());
|
|
809
|
+
content.push(createTabRun(node));
|
|
810
810
|
} else if (node.type.name === "renderedPageBreak") {
|
|
811
811
|
flushCurrentInline();
|
|
812
812
|
content.push(createRenderedPageBreakRun());
|
|
@@ -870,7 +870,7 @@ function createTrackedChangeRun(node, marks) {
|
|
|
870
870
|
if (node.type.name === "hardBreak") return createBreakRun(readHardBreakType(node));
|
|
871
871
|
if (node.type.name === "image") return createImageRun(node);
|
|
872
872
|
if (node.type.name === "shape") return createShapeRun(node);
|
|
873
|
-
if (node.type.name === "tab") return createTabRun();
|
|
873
|
+
if (node.type.name === "tab") return createTabRun(node);
|
|
874
874
|
if (node.type.name === "renderedPageBreak") return createRenderedPageBreakRun();
|
|
875
875
|
return null;
|
|
876
876
|
}
|
|
@@ -979,7 +979,7 @@ function addNodeToHyperlink(hyperlink, node) {
|
|
|
979
979
|
return;
|
|
980
980
|
}
|
|
981
981
|
if (node.type.name === "tab") {
|
|
982
|
-
hyperlink.children.push(createTabRun(nonLinkMarks));
|
|
982
|
+
hyperlink.children.push(createTabRun(node, nonLinkMarks));
|
|
983
983
|
return;
|
|
984
984
|
}
|
|
985
985
|
if (node.type.name === "renderedPageBreak") {
|
|
@@ -1076,10 +1076,14 @@ function readHardBreakType(node) {
|
|
|
1076
1076
|
/**
|
|
1077
1077
|
* Create a Run containing a tab
|
|
1078
1078
|
*/
|
|
1079
|
-
function createTabRun(marks) {
|
|
1079
|
+
function createTabRun(node, marks) {
|
|
1080
|
+
const { positional } = expectTabAttrs(node);
|
|
1080
1081
|
const run = {
|
|
1081
1082
|
type: "run",
|
|
1082
|
-
content: [{
|
|
1083
|
+
content: [{
|
|
1084
|
+
type: "tab",
|
|
1085
|
+
...positional ? { positional } : {}
|
|
1086
|
+
}]
|
|
1083
1087
|
};
|
|
1084
1088
|
const formatting = getRunFormattingFromMarks(marks);
|
|
1085
1089
|
if (formatting) run.formatting = formatting;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { assertValidProseMirrorDocument, formatProseMirrorDocumentIssues, validateProseMirrorDocument } from "../validation.js";
|
|
2
|
-
import { createEmptyDoc, headerFooterToProseDoc, toProseDoc } from "./toProseDoc.js";
|
|
3
2
|
import { fromProseDoc, proseDocToBlocks, updateDocumentContent } from "./fromProseDoc.js";
|
|
3
|
+
import { createEmptyDoc, headerFooterToProseDoc, toProseDoc } from "./toProseDoc.js";
|
|
4
4
|
export { assertValidProseMirrorDocument, createEmptyDoc, formatProseMirrorDocumentIssues, fromProseDoc, headerFooterToProseDoc, proseDocToBlocks, toProseDoc, updateDocumentContent, validateProseMirrorDocument };
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { resolveColorValueToHex } from "../../docx/drawingUtils.js";
|
|
2
|
+
import { createStyleEngine } from "../../style-engine/styleEngine.js";
|
|
3
|
+
import { mergeParagraphFormatting, mergeParagraphTabStops } from "../../utils/paragraphFormattingMerge.js";
|
|
4
|
+
import { mergeTextFormatting } from "../../utils/textFormattingMerge.js";
|
|
2
5
|
import { emuToPixels } from "../../utils/units.js";
|
|
3
6
|
import { setAutospacingBaseValue } from "../autospacingBase.js";
|
|
4
|
-
import { assertValidProseMirrorDocument } from "../validation.js";
|
|
5
|
-
import { shadingToRunShadingAttrs } from "./runShadingMark.js";
|
|
6
|
-
import { sdtAttrsFromProperties } from "./sdtAttrs.js";
|
|
7
|
-
import { mergeTextFormatting } from "../../utils/textFormattingMerge.js";
|
|
8
|
-
import { mergeParagraphFormatting, mergeParagraphTabStops } from "../../utils/paragraphFormattingMerge.js";
|
|
9
|
-
import { createStyleEngine } from "../../style-engine/styleEngine.js";
|
|
10
|
-
import { resolveColorValueToHex } from "../../docx/drawingUtils.js";
|
|
11
7
|
import { buildRunFormattingOverrideAttrs } from "../extensions/marks/RunFormattingOverrideExtension.js";
|
|
8
|
+
import { directionFromBidi } from "../paragraphDirection.js";
|
|
12
9
|
import { schema } from "../schema/index.js";
|
|
10
|
+
import { assertValidProseMirrorDocument } from "../validation.js";
|
|
13
11
|
import { resolveEffectiveTableCellFormatting } from "./effectiveTableCellFormatting.js";
|
|
14
12
|
import { marksToTextFormatting } from "./fromProseDoc.js";
|
|
13
|
+
import { shadingToRunShadingAttrs } from "./runShadingMark.js";
|
|
14
|
+
import { sdtAttrsFromProperties } from "./sdtAttrs.js";
|
|
15
15
|
//#region src/prosemirror/conversion/toProseDoc.ts
|
|
16
16
|
const TOC_STYLE_ID = /^TOC\d*$/iu;
|
|
17
17
|
const isTocStyleId = (styleId) => styleId !== void 0 && TOC_STYLE_ID.test(styleId);
|
|
@@ -1048,7 +1048,7 @@ function convertRunContent(content, marks, formatting, textBoxAnchors) {
|
|
|
1048
1048
|
if (content.breakType === "column") return [withHyperlinkBoundaryMarks(schema.node("hardBreak", { breakType: "column" }), marks)];
|
|
1049
1049
|
return [];
|
|
1050
1050
|
case "renderedPageBreak": return [schema.node("renderedPageBreak").mark(marks)];
|
|
1051
|
-
case "tab": return [schema.node("tab").mark(marks)];
|
|
1051
|
+
case "tab": return [schema.node("tab", content.positional ? { positional: content.positional } : void 0).mark(marks)];
|
|
1052
1052
|
case "drawing": return [withHyperlinkBoundaryMarks(convertImage(content.image, content.rawXml), marks)];
|
|
1053
1053
|
case "shape": {
|
|
1054
1054
|
const shp = content.shape;
|
|
@@ -1,9 +1,7 @@
|
|
|
1
|
-
import { RunFormattingOverrideExtension } from "./marks/RunFormattingOverrideExtension.js";
|
|
2
1
|
import { DocExtension } from "./core/DocExtension.js";
|
|
3
2
|
import { HistoryExtension } from "./core/HistoryExtension.js";
|
|
4
3
|
import { ParagraphExtension } from "./core/ParagraphExtension.js";
|
|
5
4
|
import { TextExtension } from "./core/TextExtension.js";
|
|
6
|
-
import { ParagraphChangeTrackerExtension } from "./features/ParagraphChangeTrackerExtension.js";
|
|
7
5
|
import { AutoBidiDetectionExtension } from "./features/AutoBidiDetectionExtension.js";
|
|
8
6
|
import { BaseKeymapExtension } from "./features/BaseKeymapExtension.js";
|
|
9
7
|
import { BidiShortcutExtension } from "./features/BidiShortcutExtension.js";
|
|
@@ -13,9 +11,9 @@ import { EmptyParagraphFormatExtension } from "./features/EmptyParagraphFormatEx
|
|
|
13
11
|
import { GapCursorExtension } from "./features/GapCursorExtension.js";
|
|
14
12
|
import { ImageDragExtension } from "./features/ImageDragExtension.js";
|
|
15
13
|
import { ImagePasteExtension } from "./features/ImagePasteExtension.js";
|
|
16
|
-
import { createTableExtensions } from "./nodes/TableExtension.js";
|
|
17
14
|
import { ListExtension } from "./features/ListExtension.js";
|
|
18
15
|
import { ParaIdAllocatorExtension } from "./features/ParaIdAllocatorExtension.js";
|
|
16
|
+
import { ParagraphChangeTrackerExtension } from "./features/ParagraphChangeTrackerExtension.js";
|
|
19
17
|
import { PasteCleanupExtension } from "./features/PasteCleanupExtension.js";
|
|
20
18
|
import { PasteStyleInlinerExtension } from "./features/PasteStyleInlinerExtension.js";
|
|
21
19
|
import { SelectionTrackerExtension } from "./features/SelectionTrackerExtension.js";
|
|
@@ -33,6 +31,7 @@ import { HyperlinkExtension } from "./marks/HyperlinkExtension.js";
|
|
|
33
31
|
import { ItalicExtension } from "./marks/ItalicExtension.js";
|
|
34
32
|
import { LanguageExtension } from "./marks/LanguageExtension.js";
|
|
35
33
|
import { RtlExtension } from "./marks/RtlExtension.js";
|
|
34
|
+
import { RunFormattingOverrideExtension } from "./marks/RunFormattingOverrideExtension.js";
|
|
36
35
|
import { RunShadingExtension } from "./marks/RunShadingExtension.js";
|
|
37
36
|
import { SmallCapsExtension } from "./marks/SmallCapsExtension.js";
|
|
38
37
|
import { StrikeExtension } from "./marks/StrikeExtension.js";
|
|
@@ -54,8 +53,9 @@ import { RenderedPageBreakExtension } from "./nodes/RenderedPageBreakExtension.j
|
|
|
54
53
|
import { SdtExtension } from "./nodes/SdtExtension.js";
|
|
55
54
|
import { ShapeExtension } from "./nodes/ShapeExtension.js";
|
|
56
55
|
import { TabExtension } from "./nodes/TabExtension.js";
|
|
57
|
-
import {
|
|
56
|
+
import { createTableExtensions } from "./nodes/TableExtension.js";
|
|
58
57
|
import { TextBoxAnchorExtension } from "./nodes/TextBoxAnchorExtension.js";
|
|
58
|
+
import { TextBoxExtension } from "./nodes/TextBoxExtension.js";
|
|
59
59
|
//#region src/prosemirror/extensions/StarterKit.ts
|
|
60
60
|
/**
|
|
61
61
|
* Create the full set of extensions for the DOCX editor
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { directionIsRtl } from "../../paragraphDirection.js";
|
|
2
|
-
import { expectParagraphAttrs } from "../../attrs/index.js";
|
|
3
|
-
import { autospacingMatchesBase } from "../../autospacingBase.js";
|
|
4
|
-
import { createNodeExtension } from "../create.js";
|
|
5
1
|
import { paragraphToStyle } from "../../../utils/formatToStyle.js";
|
|
6
2
|
import { collectHeadings } from "../../../utils/headingCollector.js";
|
|
3
|
+
import { expectParagraphAttrs } from "../../attrs/index.js";
|
|
4
|
+
import { autospacingMatchesBase } from "../../autospacingBase.js";
|
|
5
|
+
import { directionIsRtl } from "../../paragraphDirection.js";
|
|
7
6
|
import { listAttrsFromResolvedStyle, paragraphAttrsFromResolvedStyle } from "../../styles/resolvedStyleAttrs.js";
|
|
7
|
+
import { createNodeExtension } from "../create.js";
|
|
8
8
|
import { Fragment } from "prosemirror-model";
|
|
9
9
|
//#region src/prosemirror/extensions/core/ParagraphExtension.ts
|
|
10
10
|
/**
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { directionIsAutoManaged } from "../../paragraphDirection.js";
|
|
2
|
-
import { createExtension } from "../create.js";
|
|
3
1
|
import { getTransactionDirtyRange } from "../../../paged-layout/transactionDirtyRange.js";
|
|
4
2
|
import { detectBaseDirection } from "../../../utils/baseDirection.js";
|
|
3
|
+
import { directionIsAutoManaged } from "../../paragraphDirection.js";
|
|
4
|
+
import { createExtension } from "../create.js";
|
|
5
5
|
import { ignoreTrackedChanges } from "./ParagraphChangeTrackerExtension.js";
|
|
6
6
|
import { Plugin, PluginKey } from "prosemirror-state";
|
|
7
7
|
//#region src/prosemirror/extensions/features/AutoBidiDetectionExtension.ts
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { mergeFontFamily } from "../../../utils/fontFamilyMerge.js";
|
|
2
|
-
import { Priority } from "../types.js";
|
|
3
|
-
import { createExtension } from "../create.js";
|
|
4
|
-
import { paragraphAttrsFromResolvedStyle } from "../../styles/resolvedStyleAttrs.js";
|
|
5
2
|
import { getDocumentStyleResolver } from "../../plugins/documentStyles.js";
|
|
3
|
+
import { paragraphAttrsFromResolvedStyle } from "../../styles/resolvedStyleAttrs.js";
|
|
4
|
+
import { createExtension } from "../create.js";
|
|
6
5
|
import { textFormattingToMarks } from "../marks/markUtils.js";
|
|
6
|
+
import { Priority } from "../types.js";
|
|
7
7
|
import { baseKeymap, deleteSelection, joinBackward, joinForward, selectAll, selectParentNode, splitBlock } from "prosemirror-commands";
|
|
8
8
|
//#region src/prosemirror/extensions/features/BaseKeymapExtension.ts
|
|
9
9
|
/**
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { singletonManager } from "../../schema/index.js";
|
|
2
2
|
import { createExtension } from "../create.js";
|
|
3
|
+
import { Priority } from "../types.js";
|
|
3
4
|
import { createBidiShortcutController } from "./bidiShortcutController.js";
|
|
4
|
-
import { singletonManager } from "../../schema/index.js";
|
|
5
5
|
import { Plugin } from "prosemirror-state";
|
|
6
6
|
//#region src/prosemirror/extensions/features/BidiShortcutExtension.ts
|
|
7
7
|
/**
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { createExtension } from "../create.js";
|
|
2
1
|
import { createContentControlWidgetsPlugin } from "../../plugins/contentControlWidgets.js";
|
|
2
|
+
import { createExtension } from "../create.js";
|
|
3
3
|
//#region src/prosemirror/extensions/features/ContentControlWidgetsExtension.ts
|
|
4
4
|
/**
|
|
5
5
|
* Content-Control Widgets Extension — wires the interactive widget plugin
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { createExtension } from "../create.js";
|
|
2
|
-
import { sanitizeImageSrc } from "../../../utils/sanitizeImageSrc.js";
|
|
3
1
|
import { getClipboardImageFiles } from "../../../utils/clipboard.js";
|
|
4
2
|
import { isSafeImageFile } from "../../../utils/imageValidation.js";
|
|
3
|
+
import { sanitizeImageSrc } from "../../../utils/sanitizeImageSrc.js";
|
|
4
|
+
import { createExtension } from "../create.js";
|
|
5
5
|
import { Plugin, TextSelection } from "prosemirror-state";
|
|
6
6
|
//#region src/prosemirror/extensions/features/ImagePasteExtension.ts
|
|
7
7
|
/**
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { Priority } from "../types.js";
|
|
2
|
-
import { createExtension } from "../create.js";
|
|
3
|
-
import { SUGGESTION_META, makeRevisionInfo } from "../../plugins/suggestionMode.js";
|
|
4
1
|
import { PPR_CHANGE_SCOPED_ATTR_KEYS } from "../../commands/propertyChangeScope.js";
|
|
2
|
+
import { SUGGESTION_META, makeRevisionInfo } from "../../plugins/suggestionMode.js";
|
|
3
|
+
import { createExtension } from "../create.js";
|
|
5
4
|
import { goToNextCell, goToPrevCell } from "../nodes/TableExtension.js";
|
|
5
|
+
import { Priority } from "../types.js";
|
|
6
6
|
//#region src/prosemirror/extensions/features/ListExtension.ts
|
|
7
7
|
function chainCommands(...commands) {
|
|
8
8
|
return (state, dispatch, view) => {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import { generateHexId } from "../../../utils/hexId.js";
|
|
1
2
|
import { createExtension } from "../create.js";
|
|
2
3
|
import { ignoreTrackedChanges } from "./ParagraphChangeTrackerExtension.js";
|
|
3
|
-
import { generateHexId } from "../../../utils/hexId.js";
|
|
4
4
|
import { Fragment } from "prosemirror-model";
|
|
5
5
|
import { Plugin, PluginKey } from "prosemirror-state";
|
|
6
6
|
//#region src/prosemirror/extensions/features/ParaIdAllocatorExtension.ts
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Priority } from "../types.js";
|
|
2
|
-
import { createExtension } from "../create.js";
|
|
3
1
|
import { pasteWithoutFormatting } from "../../commands/pastePlainText.js";
|
|
2
|
+
import { createExtension } from "../create.js";
|
|
3
|
+
import { Priority } from "../types.js";
|
|
4
4
|
import { cleanPastedHtml } from "./pasteCleanup.js";
|
|
5
5
|
import { Plugin } from "prosemirror-state";
|
|
6
6
|
//#region src/prosemirror/extensions/features/PasteCleanupExtension.ts
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { createExtension } from "../create.js";
|
|
2
1
|
import { createSelectionTrackerPlugin, extractSelectionContext } from "../../plugins/selectionTracker.js";
|
|
2
|
+
import { createExtension } from "../create.js";
|
|
3
3
|
const SelectionTrackerExtension = createExtension({
|
|
4
4
|
name: "selectionTracker",
|
|
5
5
|
defaultOptions: {},
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { expectCharacterSpacingMarkAttrs } from "../../attrs/index.js";
|
|
2
1
|
import { formatPx, twipsToPixels } from "../../../utils/units.js";
|
|
2
|
+
import { expectCharacterSpacingMarkAttrs } from "../../attrs/index.js";
|
|
3
3
|
import { createMarkExtension } from "../create.js";
|
|
4
4
|
//#region src/prosemirror/extensions/marks/CharacterSpacingExtension.ts
|
|
5
5
|
/**
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { HIGHLIGHT_COLOR_VALUES } from "../../../types/documentEnumValues.js";
|
|
2
|
+
import { resolveHighlightToCss } from "../../../utils/colorResolver.js";
|
|
2
3
|
import { expectHighlightMarkAttrs } from "../../attrs/index.js";
|
|
3
4
|
import { createMarkExtension } from "../create.js";
|
|
4
|
-
import { resolveHighlightToCss } from "../../../utils/colorResolver.js";
|
|
5
5
|
import { removeMark, setMark } from "./markUtils.js";
|
|
6
6
|
import { panic } from "better-result";
|
|
7
7
|
//#region src/prosemirror/extensions/marks/HighlightExtension.ts
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
+
import { normalizeUserUrl, sanitizeExternalUrl } from "../../../utils/urlSecurity.js";
|
|
1
2
|
import { expectHyperlinkMarkAttrs } from "../../attrs/index.js";
|
|
2
3
|
import { createMarkExtension } from "../create.js";
|
|
3
4
|
import { isMarkActive } from "./markUtils.js";
|
|
4
|
-
import { normalizeUserUrl, sanitizeExternalUrl } from "../../../utils/urlSecurity.js";
|
|
5
5
|
import { panic } from "better-result";
|
|
6
6
|
//#region src/prosemirror/extensions/marks/HyperlinkExtension.ts
|
|
7
7
|
/**
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import { ensureHexPrefix } from "../../../utils/colorResolver.js";
|
|
1
2
|
import { expectRunShadingMarkAttrs } from "../../attrs/index.js";
|
|
2
3
|
import { createMarkExtension } from "../create.js";
|
|
3
|
-
import { ensureHexPrefix } from "../../../utils/colorResolver.js";
|
|
4
4
|
import { normalizeCssColorKey, parseDOMHighlightColor } from "./HighlightExtension.js";
|
|
5
5
|
//#region src/prosemirror/extensions/marks/RunShadingExtension.ts
|
|
6
6
|
const RunShadingExtension = createMarkExtension({
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import { textToStyle } from "../../../utils/formatToStyle.js";
|
|
1
2
|
import { expectTextColorMarkAttrs } from "../../attrs/index.js";
|
|
2
3
|
import { createMarkExtension } from "../create.js";
|
|
3
|
-
import { textToStyle } from "../../../utils/formatToStyle.js";
|
|
4
4
|
import { removeMark, setMark } from "./markUtils.js";
|
|
5
5
|
import { panic } from "better-result";
|
|
6
6
|
//#region src/prosemirror/extensions/marks/TextColorExtension.ts
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import { AUTHOR_COLORS, getAuthorColorIdx } from "../../../utils/authorColors.js";
|
|
1
2
|
import { expectTrackedChangeMarkAttrs } from "../../attrs/index.js";
|
|
2
3
|
import { createMarkExtension } from "../create.js";
|
|
3
|
-
import { AUTHOR_COLORS, getAuthorColorIdx } from "../../../utils/authorColors.js";
|
|
4
4
|
//#region src/prosemirror/extensions/marks/TrackedChangeExtensions.ts
|
|
5
5
|
/**
|
|
6
6
|
* Tracked Change Mark Extensions — insertion and deletion marks
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import { parseFieldInstruction } from "../../../docx/fieldParser.js";
|
|
1
2
|
import { expectFieldAttrs } from "../../attrs/index.js";
|
|
2
3
|
import { createNodeExtension } from "../create.js";
|
|
3
|
-
import { parseFieldInstruction } from "../../../docx/fieldParser.js";
|
|
4
4
|
//#region src/prosemirror/extensions/nodes/FieldExtension.ts
|
|
5
5
|
/**
|
|
6
6
|
* Field Extension — inline field node (PAGE, NUMPAGES, DATE, MERGEFIELD, etc.)
|