@stll/folio-core 0.15.2 → 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 +2 -2
- package/dist/docx/documentParser.js +27 -3
- 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/hyperlinkParser.js +1 -1
- package/dist/docx/imageParser.js +3 -3
- package/dist/docx/index.js +1 -1
- package/dist/docx/paragraphParser.js +4 -4
- package/dist/docx/paragraphTextBoxEnrichment.js +4 -4
- package/dist/docx/parser.js +7 -7
- package/dist/docx/rezip.js +9 -9
- package/dist/docx/runParser.js +6 -6
- package/dist/docx/sectionParser.js +2 -2
- package/dist/docx/selectiveSave.js +7 -7
- package/dist/docx/serializer/commentSerializer.js +2 -2
- 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 +3 -3
- package/dist/docx/serializer/sectionPropertiesSerializer.js +1 -1
- 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 +1 -1
- package/dist/docx/styleParser.js +3 -3
- package/dist/docx/tableParser.js +3 -3
- package/dist/docx/textBoxParser.js +1 -1
- 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.js +2 -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 +4 -4
- package/dist/prosemirror/conversion/index.js +1 -1
- package/dist/prosemirror/conversion/toProseDoc.js +8 -8
- 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/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/styles/styleResolver.js +1 -1
- 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/utils/formatToStyle.js +1 -1
- package/dist/version-comparison.js +2 -2
- package/package.json +2 -2
|
@@ -1,14 +1,14 @@
|
|
|
1
|
+
import { recordMeasureBlock, recordMeasureBlockError } from "../layoutInstrumentation.js";
|
|
2
|
+
import { isParagraphFrameTextBox } from "../paragraphFrame.js";
|
|
3
|
+
import { bandFragmentX, bandTopContentY, isPageFrameRelativeAnchor } from "../textBoxFlow.js";
|
|
4
|
+
import { getTextBoxGroupId } from "../textBoxGroup.js";
|
|
1
5
|
import { DEFAULT_TEXTBOX_MARGINS, floatingTextBoxReservesBand, floatingTextBoxWrapsText, tableColumnsArePinned } from "../types.js";
|
|
2
|
-
import { findClearLineY, measureParagraph } from "./measureParagraph.js";
|
|
3
|
-
import { resolveFloatingTableX } from "./floatingTablePosition.js";
|
|
4
6
|
import { getCachedParagraphMeasure, setCachedParagraphMeasure } from "./cache.js";
|
|
7
|
+
import { resolveFloatingTableX } from "./floatingTablePosition.js";
|
|
8
|
+
import { findClearLineY, measureParagraph } from "./measureParagraph.js";
|
|
5
9
|
import { createTableCellFlowState, finishTableCellFlow, placeTableCellBlock } from "./tableCellFlow.js";
|
|
6
|
-
import { layoutTextBoxContent } from "./textBoxParagraphLayout.js";
|
|
7
|
-
import { getTextBoxGroupId } from "../textBoxGroup.js";
|
|
8
|
-
import { isParagraphFrameTextBox } from "../paragraphFrame.js";
|
|
9
|
-
import { recordMeasureBlock, recordMeasureBlockError } from "../layoutInstrumentation.js";
|
|
10
|
-
import { bandFragmentX, bandTopContentY, isPageFrameRelativeAnchor } from "../textBoxFlow.js";
|
|
11
10
|
import { buildTableCellGrid, getFirstAvailableColumn, getTableCellVerticalBorderHeight } from "./tableCellGrid.js";
|
|
11
|
+
import { layoutTextBoxContent } from "./textBoxParagraphLayout.js";
|
|
12
12
|
//#region src/layout-engine/measure/measureBlocks.ts
|
|
13
13
|
/**
|
|
14
14
|
* Pseudo-infinite measurement width (px) used for `w:noWrap` table cells so
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { getFontKerningMode } from "./textMeasurementPolicy.js";
|
|
2
|
-
import { setMeasureProvider } from "./measureProvider.js";
|
|
3
|
-
import { buildFontString, getResolvedData, ptToPx } from "./measureHelpers.js";
|
|
4
1
|
import { hasCjk, isCjkCodePoint, segmentByScript } from "../../utils/scriptSegments.js";
|
|
5
2
|
import { getCachedFontMetrics, getCachedTextWidth, getTextWidthCacheGeneration, setCachedFontMetrics, setCachedTextWidth } from "./cache.js";
|
|
3
|
+
import { buildFontString, getResolvedData, ptToPx } from "./measureHelpers.js";
|
|
4
|
+
import { setMeasureProvider } from "./measureProvider.js";
|
|
6
5
|
import { canPrefetchMeasurement, prefetchMeasurement } from "./measureWorker.js";
|
|
7
6
|
import { WORKER_FONT_FINGERPRINT_TEXT, countCodePoints } from "./measureWorkerProtocol.js";
|
|
7
|
+
import { getFontKerningMode } from "./textMeasurementPolicy.js";
|
|
8
8
|
import { panic } from "better-result";
|
|
9
9
|
//#region src/layout-engine/measure/measureContainer.ts
|
|
10
10
|
/**
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { resolveFontFamily } from "../../utils/fontResolver.js";
|
|
2
|
-
import { FONT_KERNING_MODE, getRunFontKerningMode } from "./textMeasurementPolicy.js";
|
|
3
2
|
import "../../utils/fontWeights.js";
|
|
3
|
+
import { FONT_KERNING_MODE, getRunFontKerningMode } from "./textMeasurementPolicy.js";
|
|
4
4
|
//#region src/layout-engine/measure/measureHelpers.ts
|
|
5
5
|
/**
|
|
6
6
|
* Pure measurement helpers — no canvas, no DOM, no worker.
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import { CJK_FALLBACK_FONT_FAMILY, isCjkFont } from "../../utils/fontResolver.js";
|
|
2
|
-
import { countCompressibleSpaces } from "./textMeasurementPolicy.js";
|
|
3
|
-
import { getFontMetrics, measureRun, measureTextWidth } from "./measureProvider.js";
|
|
4
|
-
import { buildRunFontStyle, ptToPx, twipsToPx } from "./measureHelpers.js";
|
|
5
|
-
import { defaultLineBreakProvider, getLineBreakProvider } from "./lineBreakProvider.js";
|
|
6
1
|
import { calculateTabWidth, pixelsToTwips } from "../../prosemirror/utils/tabCalculator.js";
|
|
2
|
+
import { CJK_FALLBACK_FONT_FAMILY, isCjkFont } from "../../utils/fontResolver.js";
|
|
7
3
|
import { inlineImageBoundingBox } from "../../utils/rotationBoundingBox.js";
|
|
8
4
|
import { hasCjk } from "../../utils/scriptSegments.js";
|
|
9
5
|
import { measuredLineAdvance } from "../lineFlow.js";
|
|
10
6
|
import { isFloatingImageRun } from "../types.js";
|
|
11
|
-
import { resolveEffectiveLineBreakPolicy } from "./effectiveLineBreakPolicy.js";
|
|
12
7
|
import { clampFloatingWrapMargins } from "./clampFloatingWrapMargins.js";
|
|
8
|
+
import { resolveEffectiveLineBreakPolicy } from "./effectiveLineBreakPolicy.js";
|
|
13
9
|
import { getFloatingAvailableWidth, getFloatingMargins } from "./floatingZones.js";
|
|
14
|
-
import {
|
|
10
|
+
import { defaultLineBreakProvider, getLineBreakProvider } from "./lineBreakProvider.js";
|
|
15
11
|
import { findGraphemeBreaks, findHyphenationBreaks, findWordBreaks, isBreakChar, isHangingPunctuation } from "./lineBreaks.js";
|
|
12
|
+
import { getListMarkerInlineWidth } from "./listMarkerWidth.js";
|
|
13
|
+
import { buildRunFontStyle, ptToPx, twipsToPx } from "./measureHelpers.js";
|
|
14
|
+
import { getFontMetrics, measureRun, measureTextWidth } from "./measureProvider.js";
|
|
15
|
+
import { countCompressibleSpaces } from "./textMeasurementPolicy.js";
|
|
16
16
|
//#region src/layout-engine/measure/measureParagraph.ts
|
|
17
17
|
/**
|
|
18
18
|
* Paragraph measurement module
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { measuredLineRangeHeight } from "../lineFlow.js";
|
|
2
|
-
import { isFloatingTextBoxBlock } from "../types.js";
|
|
3
2
|
import { collapseParagraphSpacing, getParagraphSpacingAfter, getParagraphSpacingBefore, isEmptyParagraph } from "../paragraphSpacing.js";
|
|
3
|
+
import { isFloatingTextBoxBlock } from "../types.js";
|
|
4
4
|
//#region src/layout-engine/measure/tableCellFlow.ts
|
|
5
5
|
const createTableCellFlowState = () => ({
|
|
6
6
|
height: 0,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { FOOTNOTE_SEPARATOR_HEIGHT } from "./types.js";
|
|
2
1
|
import { collapseParagraphSpacing } from "./paragraphSpacing.js";
|
|
2
|
+
import { FOOTNOTE_SEPARATOR_HEIGHT } from "./types.js";
|
|
3
3
|
import { panic } from "better-result";
|
|
4
4
|
//#region src/layout-engine/paginator.ts
|
|
5
5
|
/**
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { measureParagraph } from "./measure/measureParagraph.js";
|
|
2
|
-
import { isEmptyParagraph } from "./paragraphSpacing.js";
|
|
3
|
-
import { createTableCellFlowState, placeTableCellBlock } from "./measure/tableCellFlow.js";
|
|
4
2
|
import { buildTableCellFloatingZones, getTableCellContentWidth, getTableCellFloatingImages } from "./measure/tableCellFloating.js";
|
|
3
|
+
import { createTableCellFlowState, placeTableCellBlock } from "./measure/tableCellFlow.js";
|
|
4
|
+
import { isEmptyParagraph } from "./paragraphSpacing.js";
|
|
5
5
|
//#region src/layout-engine/tableRowBreak.ts
|
|
6
6
|
/**
|
|
7
7
|
* Table row-break geometry. Ported from eigenpal/docx-editor#698 (folio subset).
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
+
import { prefersReducedMotionBehavior } from "../paged-layout/scrollNavigation.js";
|
|
2
|
+
import { createDefaultRegistry } from "./registry/modules.js";
|
|
3
|
+
import { createFeatureRegistry } from "./registry/registry.js";
|
|
1
4
|
import { FRAGMENT_CLASS_NAMES, renderFragment } from "./renderFragment.js";
|
|
2
5
|
import { IMAGE_CLASS_NAMES, renderImageFragment } from "./renderImage.js";
|
|
6
|
+
import { renderPage, renderPages } from "./renderPage.js";
|
|
3
7
|
import { renderLine, renderParagraphFragment, sliceRunsForLine } from "./renderParagraph.js";
|
|
4
|
-
import { TEXTBOX_CLASS_NAMES, renderTextBoxFragment } from "./renderTextBox.js";
|
|
5
8
|
import { TABLE_CLASS_NAMES, renderTableFragment } from "./renderTable.js";
|
|
6
|
-
import {
|
|
7
|
-
import { prefersReducedMotionBehavior } from "../paged-layout/scrollNavigation.js";
|
|
8
|
-
import { createFeatureRegistry } from "./registry/registry.js";
|
|
9
|
-
import { createDefaultRegistry } from "./registry/modules.js";
|
|
9
|
+
import { TEXTBOX_CLASS_NAMES, renderTextBoxFragment } from "./renderTextBox.js";
|
|
10
10
|
import { panic } from "better-result";
|
|
11
11
|
//#region src/layout-painter/index.ts
|
|
12
12
|
/**
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { renderTextBoxFragment } from "../../renderTextBox.js";
|
|
2
1
|
import { renderNestedTable } from "../../renderTable.js";
|
|
2
|
+
import { renderTextBoxFragment } from "../../renderTextBox.js";
|
|
3
3
|
//#region src/layout-painter/registry/modules/textBox.ts
|
|
4
4
|
/**
|
|
5
5
|
* Text-box feature module — renders `TextBoxFragment`.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { sanitizeExternalUrl } from "../utils/urlSecurity.js";
|
|
2
1
|
import { applySanitizedImageSrc } from "../utils/sanitizeImageSrc.js";
|
|
2
|
+
import { sanitizeExternalUrl } from "../utils/urlSecurity.js";
|
|
3
3
|
//#region src/layout-painter/renderImage.ts
|
|
4
4
|
/**
|
|
5
5
|
* CSS class names for image elements
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { resolveFloatingTableX } from "../layout-engine/measure/floatingTablePosition.js";
|
|
2
|
+
import { rectsToFloatingZones } from "../layout-engine/measure/floatingZones.js";
|
|
3
|
+
import { measureParagraph } from "../layout-engine/measure/measureParagraph.js";
|
|
4
|
+
import { floatingTextBoxReservesBand, floatingTextBoxWrapsText, isFloatingImageRun, isFloatingTextBoxBlock, isTextWrappingFloatingImageRun } from "../layout-engine/types.js";
|
|
2
5
|
import { resolveFontFamily } from "../utils/fontResolver.js";
|
|
3
6
|
import { borderToStyle } from "../utils/formatToStyle.js";
|
|
4
7
|
import { applySanitizedImageSrc } from "../utils/sanitizeImageSrc.js";
|
|
5
|
-
import {
|
|
6
|
-
import { rectsToFloatingZones } from "../layout-engine/measure/floatingZones.js";
|
|
7
|
-
import { measureParagraph } from "../layout-engine/measure/measureParagraph.js";
|
|
8
|
-
import { resolveFloatingTableX } from "../layout-engine/measure/floatingTablePosition.js";
|
|
9
|
-
import { emuToPixels } from "./renderUtils.js";
|
|
8
|
+
import { eighthsToPixels, pointsToPixels } from "../utils/units.js";
|
|
10
9
|
import { resolveAnchoredImagePosition as resolveAnchoredImagePosition$1 } from "./anchoredImagePosition.js";
|
|
11
10
|
import { renderFragment } from "./renderFragment.js";
|
|
12
11
|
import { applyImageVisualAttrs, hasImageVisualAttrs, renderImageFragment } from "./renderImage.js";
|
|
13
12
|
import { renderParagraphFragment } from "./renderParagraph.js";
|
|
14
|
-
import { renderTextBoxFragment } from "./renderTextBox.js";
|
|
15
13
|
import { renderNestedTable, renderTableFragment } from "./renderTable.js";
|
|
14
|
+
import { renderTextBoxFragment } from "./renderTextBox.js";
|
|
15
|
+
import { emuToPixels } from "./renderUtils.js";
|
|
16
16
|
import { renderWatermarkLayer } from "./renderWatermark.js";
|
|
17
17
|
import { panic } from "better-result";
|
|
18
18
|
//#region src/layout-painter/renderPage.ts
|
|
@@ -1,23 +1,23 @@
|
|
|
1
|
+
import { ommlToMathml } from "../docx/mathToMathml.js";
|
|
1
2
|
import { parseXmlDocument } from "../docx/xmlParser.js";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { applySanitizedImageSrc } from "../utils/sanitizeImageSrc.js";
|
|
5
|
-
import { AUTHOR_COLORS, getAuthorColorIdx } from "../utils/authorColors.js";
|
|
6
|
-
import { FONT_KERNING_MODE, countCompressibleSpaces, getFontKerningMode, getRunFontKerningMode, toPaintedText } from "../layout-engine/measure/textMeasurementPolicy.js";
|
|
7
|
-
import "../utils/fontWeights.js";
|
|
3
|
+
import { evaluateFieldInstruction } from "../fields/evaluateField.js";
|
|
4
|
+
import { getListMarkerInlineWidth, getListMarkerVisualOffset } from "../layout-engine/measure/listMarkerWidth.js";
|
|
8
5
|
import "../layout-engine/measure/measureHelpers.js";
|
|
6
|
+
import { FONT_KERNING_MODE, countCompressibleSpaces, getFontKerningMode, getRunFontKerningMode, toPaintedText } from "../layout-engine/measure/textMeasurementPolicy.js";
|
|
7
|
+
import { isFloatingImageRun } from "../layout-engine/types.js";
|
|
9
8
|
import { calculateTabWidth } from "../prosemirror/utils/tabCalculator.js";
|
|
9
|
+
import { AUTHOR_COLORS, getAuthorColorIdx } from "../utils/authorColors.js";
|
|
10
|
+
import { detectBaseDirection } from "../utils/baseDirection.js";
|
|
11
|
+
import { resolveFontFamily } from "../utils/fontResolver.js";
|
|
12
|
+
import "../utils/fontWeights.js";
|
|
10
13
|
import { inlineImageBoundingBox, parseRotationDegrees, rotatedBoundingBox } from "../utils/rotationBoundingBox.js";
|
|
14
|
+
import { applySanitizedImageSrc } from "../utils/sanitizeImageSrc.js";
|
|
11
15
|
import { hasCjk, segmentByScript } from "../utils/scriptSegments.js";
|
|
12
|
-
import { isFloatingImageRun } from "../layout-engine/types.js";
|
|
13
|
-
import { getListMarkerInlineWidth, getListMarkerVisualOffset } from "../layout-engine/measure/listMarkerWidth.js";
|
|
14
|
-
import { resolveImageLineAlign } from "./renderUtils.js";
|
|
15
|
-
import { applySdtDataAttrs } from "./sdtBoundary.js";
|
|
16
|
-
import { applyImageBorder, applyImageVisualAttrs, hasImageCrop, hasImageVisualAttrs, wrapImageWithCrop } from "./renderImage.js";
|
|
17
|
-
import { ommlToMathml } from "../docx/mathToMathml.js";
|
|
18
|
-
import { evaluateFieldInstruction } from "../fields/evaluateField.js";
|
|
19
16
|
import { borderStrokeToCss, resolveParagraphBorderHorizontalOutsets } from "./borderStroke.js";
|
|
20
17
|
import { getAutomaticTextColorForBackground } from "./documentColors.js";
|
|
18
|
+
import { applyImageBorder, applyImageVisualAttrs, hasImageCrop, hasImageVisualAttrs, wrapImageWithCrop } from "./renderImage.js";
|
|
19
|
+
import { resolveImageLineAlign } from "./renderUtils.js";
|
|
20
|
+
import { applySdtDataAttrs } from "./sdtBoundary.js";
|
|
21
21
|
//#region src/layout-painter/renderParagraph.ts
|
|
22
22
|
/**
|
|
23
23
|
* Paragraph Fragment Renderer
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { emuToPixels } from "../utils/units.js";
|
|
2
|
-
import { applySanitizedImageSrc } from "../utils/sanitizeImageSrc.js";
|
|
3
|
-
import { getTableRowLeadingWidth, isFloatingImageRun, isFloatingTextBoxBlock, tableColumnsArePinned } from "../layout-engine/types.js";
|
|
4
1
|
import { measureParagraph } from "../layout-engine/measure/measureParagraph.js";
|
|
2
|
+
import { buildTableCellFloatingZones, getTableCellContentWidth, getTableCellFloatingImages } from "../layout-engine/measure/tableCellFloating.js";
|
|
3
|
+
import { createTableCellFlowState, finishTableCellFlow, placeTableCellBlock } from "../layout-engine/measure/tableCellFlow.js";
|
|
4
|
+
import { getTableRowLeadingWidth, isFloatingImageRun, isFloatingTextBoxBlock, tableColumnsArePinned } from "../layout-engine/types.js";
|
|
5
|
+
import { applySanitizedImageSrc } from "../utils/sanitizeImageSrc.js";
|
|
6
|
+
import { emuToPixels } from "../utils/units.js";
|
|
5
7
|
import { resolveAnchoredImagePosition } from "./anchoredImagePosition.js";
|
|
6
|
-
import { applyImageVisualAttrs, hasImageCrop, hasImageVisualAttrs } from "./renderImage.js";
|
|
7
8
|
import { borderStrokeToCss, resolveCssBorderStroke } from "./borderStroke.js";
|
|
8
9
|
import { getAutomaticTextColorForBackground } from "./documentColors.js";
|
|
10
|
+
import { applyImageVisualAttrs, hasImageCrop, hasImageVisualAttrs } from "./renderImage.js";
|
|
9
11
|
import { renderParagraphFragment } from "./renderParagraph.js";
|
|
10
|
-
import { createTableCellFlowState, finishTableCellFlow, placeTableCellBlock } from "../layout-engine/measure/tableCellFlow.js";
|
|
11
|
-
import { buildTableCellFloatingZones, getTableCellContentWidth, getTableCellFloatingImages } from "../layout-engine/measure/tableCellFloating.js";
|
|
12
12
|
import { renderTextBoxFragment } from "./renderTextBox.js";
|
|
13
13
|
//#region src/layout-painter/renderTable.ts
|
|
14
14
|
/**
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import { layoutTextBoxContent } from "../layout-engine/measure/textBoxParagraphLayout.js";
|
|
1
2
|
import { DEFAULT_TEXTBOX_MARGINS } from "../layout-engine/types.js";
|
|
2
3
|
import { renderParagraphFragment } from "./renderParagraph.js";
|
|
3
|
-
import { layoutTextBoxContent } from "../layout-engine/measure/textBoxParagraphLayout.js";
|
|
4
4
|
import { panic } from "better-result";
|
|
5
5
|
//#region src/layout-painter/renderTextBox.ts
|
|
6
6
|
/**
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { resetAuthorColors } from "../utils/authorColors.js";
|
|
2
|
-
import { loadFontsWithMapping } from "../utils/fontLoader.js";
|
|
3
|
-
import { parseDocx } from "../docx/parser.js";
|
|
4
1
|
import { inspectDocxCompatibility } from "../docx/compatibility.js";
|
|
2
|
+
import { parseDocx } from "../docx/parser.js";
|
|
5
3
|
import { recordDocumentLoadPhase } from "../layout-engine/layoutInstrumentation.js";
|
|
4
|
+
import { resetAuthorColors } from "../utils/authorColors.js";
|
|
5
|
+
import { loadFontsWithMapping } from "../utils/fontLoader.js";
|
|
6
6
|
//#region src/managers/DocumentLoaderManager.ts
|
|
7
7
|
/**
|
|
8
8
|
* DocumentLoaderManager
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Subscribable } from "./Subscribable.js";
|
|
2
1
|
import { addColumn, addRow, createTableContext, deleteColumn, deleteRow, getColumnCount, mergeCells, splitCell } from "../utils/tableOperations.js";
|
|
2
|
+
import { Subscribable } from "./Subscribable.js";
|
|
3
3
|
//#region src/managers/TableSelectionManager.ts
|
|
4
4
|
/** Data attributes for table elements in the rendered DOM */
|
|
5
5
|
const TABLE_DATA_ATTRIBUTES = {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { getTableContext } from "../prosemirror/extensions/nodes/TableExtension.js";
|
|
2
1
|
import { deleteTable } from "../prosemirror/commands/table.js";
|
|
2
|
+
import { getTableContext } from "../prosemirror/extensions/nodes/TableExtension.js";
|
|
3
3
|
//#region src/managers/editorShortcuts.ts
|
|
4
4
|
function isMacPlatform() {
|
|
5
5
|
if (typeof navigator === "undefined") return false;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { sanitizeExternalUrl } from "../utils/urlSecurity.js";
|
|
2
1
|
import { createEmptyDocument } from "../utils/createDocument.js";
|
|
2
|
+
import { sanitizeExternalUrl } from "../utils/urlSecurity.js";
|
|
3
3
|
import { marked } from "marked";
|
|
4
4
|
//#region src/markdown/fromMarkdown.ts
|
|
5
5
|
/**
|
package/dist/markdown/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
+
import { fromMarkdown } from "./fromMarkdown.js";
|
|
1
2
|
import { newContext } from "./internals.js";
|
|
2
3
|
import { renderBlocks } from "./renderBlock.js";
|
|
3
4
|
import { appendTrailers } from "./trailers.js";
|
|
4
|
-
import { fromMarkdown } from "./fromMarkdown.js";
|
|
5
5
|
//#region src/markdown/index.ts
|
|
6
6
|
/**
|
|
7
7
|
* Convert a parsed `Document` to a markdown string. Synchronous; pre-parse the
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { pushWarning } from "./internals.js";
|
|
2
1
|
import { wrapComment, wrapDeletion, wrapInsertion, wrapMoveFrom, wrapMoveTo } from "./annotations.js";
|
|
3
2
|
import { escapeAltText, escapeInline, escapeLinkUrl } from "./escape.js";
|
|
4
3
|
import { registerImage } from "./images.js";
|
|
4
|
+
import { pushWarning } from "./internals.js";
|
|
5
5
|
//#region src/markdown/renderRuns.ts
|
|
6
6
|
const MARK_DELIMS = {
|
|
7
7
|
bold: "**",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { pushWarning } from "./internals.js";
|
|
2
1
|
import { escapeTableCell } from "./escape.js";
|
|
3
2
|
import { registerImage } from "./images.js";
|
|
3
|
+
import { pushWarning } from "./internals.js";
|
|
4
4
|
import { renderParagraph } from "./renderParagraph.js";
|
|
5
5
|
//#region src/markdown/renderTable.ts
|
|
6
6
|
/** Render a `Table` as markdown. Picks GFM vs HTML based on cell features. */
|
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, 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";
|
|
2
|
-
import { deriveBlockId, getFolioParaIdFromBlockId, getSequentialFolioBlockIdIndex, isFolioBlockId, isSequentialFolioBlockId } from "./types/block-id.js";
|
|
3
1
|
import { types_exports } from "./layout-engine/types.js";
|
|
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
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,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, expectTabAttrs, 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";
|
|
@@ -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);
|
|
@@ -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
|
/**
|