oasis-editor 0.0.90 → 0.0.91
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/{OasisEditorApp-2b7y3aGj.js → OasisEditorApp-Cwd5XBHr.js} +89 -40
- package/dist/assets/{importDocxWorker-BN5o1geV.js → importDocxWorker-6DqfSWfq.js} +1 -1
- package/dist/core/model/index.d.ts +2 -2
- package/dist/core/model/types/document.d.ts +2 -0
- package/dist/core/model/types/nodes.d.ts +15 -43
- package/dist/core/model/types/styles.d.ts +39 -2
- package/dist/core/tableStyleResolver.d.ts +2 -1
- package/dist/export/docx/docxPackageXml.d.ts +1 -1
- package/dist/import/docx/settings.d.ts +1 -0
- package/dist/import/docx/tableConditionalFormatting.d.ts +0 -30
- package/dist/import/docx/tableProperties.d.ts +7 -0
- package/dist/import/docx/xmlHelpers.d.ts +5 -0
- package/dist/{index-DcElQi6c.js → index-C2DlzueH.js} +276 -92
- package/dist/oasis-editor.js +1 -1
- package/dist/oasis-editor.umd.cjs +4 -4
- package/package.json +1 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
var __defProp = Object.defineProperty;
|
|
2
2
|
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
3
3
|
var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
4
|
-
import { v as visitRun, a as assertNever, c as createSignal, b as createEditorStateFromDocument, d as createInitialEditorState, S as STANDARD_FONT_SIZES_PT, f as fontSizePxToPt, p as probeLocalFontFamilies, e as createEditorParagraphFromRuns, i as isInlineObjectRun, g as createEditorStyledRun, h as getParagraphLength, j as getParagraphText, k as getActiveZone, l as getDocumentSections, m as getActiveSectionIndex, n as getParagraphs, o as normalizeSelection, q as positionToParagraphOffset, r as paragraphOffsetToPosition, s as clampPosition, t as findParagraphIndex, u as createCollapsedSelection, w as isSelectionCollapsed, x as parseFontSizePtToPx, y as formatFontSizePt, z as createEditorParagraph, A as getBlockParagraphs, B as findParagraphTableLocation, C as buildTableCellLayout, P as PT_PER_PX, D as createEditorTableCell, E as createEditorTableRow, F as createEditorTable, G as underlineStyleToCssDecorationStyle, H as resolveImageSrc, I as listKindForTag, J as isParagraphTag, K as collectInlineRuns, L as parseParagraphStyle, M as getRunImage, N as InlineShell, O as BalloonShell, Q as DocumentShell, R as createMemo, T as buildCanvasLayoutSnapshot, U as getCaretRectFromSnapshot, V as getParagraphRectFromSnapshot, W as createComponent, X as CaretOverlay, Y as Show, Z as createRenderEffect, _ as style, $ as setAttribute, a0 as setStyleProperty, a1 as memo, a2 as template, a3 as useI18n, a4 as createEffect, a5 as insert, a6 as use, a7 as addEventListener, a8 as Dialog, a9 as delegateEvents, aa as className, ab as For, ac as UNDERLINE_STYLE_OPTIONS, ad as Tabs, ae as onMount, af as onCleanup, ag as PluginUiHost, ah as OasisEditorEditor, ai as OasisBrandMark, aj as setPreciseFontPreference, ak as setWelcomeSeen, al as enablePreciseFontMode, am as TWIPS_PER_POINT, an as PX_PER_INCH, ao as TWIPS_PER_INCH, ap as resolveEffectiveParagraphStyle, aq as resolveEffectiveTextStyleForParagraph, ar as EMU_PER_PX, as as EMU_PER_PT, at as getRunFootnoteReference, au as getRunEndnoteReference, av as iterateFootnoteReferenceRuns, aw as iterateEndnoteReferenceRuns, ax as imageContentTypeDefaults, ay as getRunFieldChar, az as getRunFieldInstruction, aA as createEditorRun, aB as JSZip, aC as imageExtensionFromMime, aD as pxToPt$1, aE as resolveFloatingObjectRect, aF as getTextBoxFloatingGeometry, aG as getPresetPathSegments, aH as projectBlocksLayout, aI as buildListLabels, aJ as getImageFloatingGeometry, aK as textStyleToFontSizePt, aL as PX_PER_POINT, aM as DEFAULT_FONT_SIZE_PX, aN as isDoubleUnderlineStyle, aO as isWavyUnderlineStyle, aP as underlineStyleLineWidthPx, aQ as underlineStyleDashArray, aR as resolveListLabel, aS as getListLabelInset, aT as getAlignedListLabelInset, aU as getParagraphBorderInsets, aV as buildSegmentTable, aW as buildCanvasTableLayout, aX as resolveCanvasTableWidth, aY as resolveFloatingTableRect, aZ as normalizeFamily, a_ as ROBOTO_FONT_FILES, a$ as loadFontAsset, b0 as OFFICE_COMPAT_FONT_FAMILIES, b1 as buildSfnt, b2 as defaultFontDecoderRegistry, b3 as SfntFontProgram, b4 as collectPdfFontFamilies, b5 as projectDocumentLayout, b6 as getPageContentWidth, b7 as getPageHeaderZoneTop, b8 as getPageBodyTop, b9 as getPageColumnRects, ba as findFootnoteReference, bb as FOOTNOTE_MARKER_GUTTER_PX, bc as resolveImporterForFile, bd as getDocumentSectionsCanonical, be as getDocumentParagraphsCanonical, bf as getDocumentParagraphs, bg as getDocumentPageSettings, bh as getTableCellContentWidthForParagraph, bi as on, bj as debounce, bk as unwrap, bl as perfTimer, bm as getRunTextBox, bn as createEditorDocument, bo as resolveResizedDimensions, bp as resolveTextBoxRenderHeight, bq as getToolbarStyleState, br as getCachedCanvasImage, bs as measureParagraphMinContentWidthPx, bt as getEditableBlocksForZone, bu as findParagraphLocation, bv as createSectionBoundaryParagraph, bw as normalizePageSettings, bx as DEFAULT_EDITOR_PAGE_SETTINGS, by as markStart, bz as markEnd, bA as getParagraphEntries, bB as getParagraphById, bC as createEditorFootnote, bD as createFootnoteReferenceRun, bE as renumberFootnotes, bF as getFootnoteDisplayMarker, bG as getHeadingLevel, bH as preciseFontModeVersion, bI as isPreciseFontModeEnabled, bJ as resolveNamedTextStyle, bK as togglePreciseFontMode, bL as nextFontSizePt, bM as previousFontSizePt, bN as fontSizePtToPx, bO as createDefaultToolbarPreset, bP as MenuRegistry, bQ as createToolbarRegistry, bR as Editor, bS as resolveCommandRef, bT as commandRefName, bU as createOasisEditorClient, bV as createEditorZoom, bW as startLongTaskObserver, bX as installGlobalReport, bY as applyStoredPreciseFontPreference, bZ as getWelcomeSeen, b_ as isLocalFontAccessSupported, b$ as EDITOR_SCROLL_PADDING_PX, c0 as Toolbar, c1 as OasisEditorLoading, c2 as I18nProvider, c3 as createTranslator, c4 as createEditorLogger, c5 as registerDomStatsSurface } from "./index-
|
|
4
|
+
import { v as visitRun, a as assertNever, c as createSignal, b as createEditorStateFromDocument, d as createInitialEditorState, S as STANDARD_FONT_SIZES_PT, f as fontSizePxToPt, p as probeLocalFontFamilies, e as createEditorParagraphFromRuns, i as isInlineObjectRun, g as createEditorStyledRun, h as getParagraphLength, j as getParagraphText, k as getActiveZone, l as getDocumentSections, m as getActiveSectionIndex, n as getParagraphs, o as normalizeSelection, q as positionToParagraphOffset, r as paragraphOffsetToPosition, s as clampPosition, t as findParagraphIndex, u as createCollapsedSelection, w as isSelectionCollapsed, x as parseFontSizePtToPx, y as formatFontSizePt, z as createEditorParagraph, A as getBlockParagraphs, B as findParagraphTableLocation, C as buildTableCellLayout, P as PT_PER_PX, D as createEditorTableCell, E as createEditorTableRow, F as createEditorTable, G as underlineStyleToCssDecorationStyle, H as resolveImageSrc, I as listKindForTag, J as isParagraphTag, K as collectInlineRuns, L as parseParagraphStyle, M as getRunImage, N as InlineShell, O as BalloonShell, Q as DocumentShell, R as createMemo, T as buildCanvasLayoutSnapshot, U as getCaretRectFromSnapshot, V as getParagraphRectFromSnapshot, W as createComponent, X as CaretOverlay, Y as Show, Z as createRenderEffect, _ as style, $ as setAttribute, a0 as setStyleProperty, a1 as memo, a2 as template, a3 as useI18n, a4 as createEffect, a5 as insert, a6 as use, a7 as addEventListener, a8 as Dialog, a9 as delegateEvents, aa as className, ab as For, ac as UNDERLINE_STYLE_OPTIONS, ad as Tabs, ae as onMount, af as onCleanup, ag as PluginUiHost, ah as OasisEditorEditor, ai as OasisBrandMark, aj as setPreciseFontPreference, ak as setWelcomeSeen, al as enablePreciseFontMode, am as TWIPS_PER_POINT, an as PX_PER_INCH, ao as TWIPS_PER_INCH, ap as resolveEffectiveParagraphStyle, aq as resolveEffectiveTextStyleForParagraph, ar as EMU_PER_PX, as as EMU_PER_PT, at as getRunFootnoteReference, au as getRunEndnoteReference, av as iterateFootnoteReferenceRuns, aw as iterateEndnoteReferenceRuns, ax as imageContentTypeDefaults, ay as getRunFieldChar, az as getRunFieldInstruction, aA as createEditorRun, aB as JSZip, aC as imageExtensionFromMime, aD as pxToPt$1, aE as resolveFloatingObjectRect, aF as getTextBoxFloatingGeometry, aG as getPresetPathSegments, aH as projectBlocksLayout, aI as buildListLabels, aJ as getImageFloatingGeometry, aK as textStyleToFontSizePt, aL as PX_PER_POINT, aM as DEFAULT_FONT_SIZE_PX, aN as isDoubleUnderlineStyle, aO as isWavyUnderlineStyle, aP as underlineStyleLineWidthPx, aQ as underlineStyleDashArray, aR as resolveListLabel, aS as getListLabelInset, aT as getAlignedListLabelInset, aU as getParagraphBorderInsets, aV as buildSegmentTable, aW as buildCanvasTableLayout, aX as resolveCanvasTableWidth, aY as resolveFloatingTableRect, aZ as normalizeFamily, a_ as ROBOTO_FONT_FILES, a$ as loadFontAsset, b0 as OFFICE_COMPAT_FONT_FAMILIES, b1 as buildSfnt, b2 as defaultFontDecoderRegistry, b3 as SfntFontProgram, b4 as collectPdfFontFamilies, b5 as projectDocumentLayout, b6 as getPageContentWidth, b7 as getPageHeaderZoneTop, b8 as getPageBodyTop, b9 as getPageColumnRects, ba as findFootnoteReference, bb as FOOTNOTE_MARKER_GUTTER_PX, bc as resolveImporterForFile, bd as getDocumentSectionsCanonical, be as getDocumentParagraphsCanonical, bf as getDocumentParagraphs, bg as getDocumentPageSettings, bh as getTableCellContentWidthForParagraph, bi as on, bj as debounce, bk as unwrap, bl as perfTimer, bm as getRunTextBox, bn as createEditorDocument, bo as resolveResizedDimensions, bp as resolveTextBoxRenderHeight, bq as getToolbarStyleState, br as getCachedCanvasImage, bs as measureParagraphMinContentWidthPx, bt as getEditableBlocksForZone, bu as findParagraphLocation, bv as createSectionBoundaryParagraph, bw as normalizePageSettings, bx as DEFAULT_EDITOR_PAGE_SETTINGS, by as markStart, bz as markEnd, bA as getParagraphEntries, bB as getParagraphById, bC as createEditorFootnote, bD as createFootnoteReferenceRun, bE as renumberFootnotes, bF as getFootnoteDisplayMarker, bG as getHeadingLevel, bH as preciseFontModeVersion, bI as isPreciseFontModeEnabled, bJ as resolveNamedTextStyle, bK as togglePreciseFontMode, bL as nextFontSizePt, bM as previousFontSizePt, bN as fontSizePtToPx, bO as createDefaultToolbarPreset, bP as MenuRegistry, bQ as createToolbarRegistry, bR as Editor, bS as resolveCommandRef, bT as commandRefName, bU as createOasisEditorClient, bV as createEditorZoom, bW as startLongTaskObserver, bX as installGlobalReport, bY as applyStoredPreciseFontPreference, bZ as getWelcomeSeen, b_ as isLocalFontAccessSupported, b$ as EDITOR_SCROLL_PADDING_PX, c0 as Toolbar, c1 as OasisEditorLoading, c2 as I18nProvider, c3 as createTranslator, c4 as createEditorLogger, c5 as registerDomStatsSurface } from "./index-C2DlzueH.js";
|
|
5
5
|
function cloneStyle(style2) {
|
|
6
6
|
return style2 ? { ...style2 } : void 0;
|
|
7
7
|
}
|
|
@@ -30434,7 +30434,11 @@ function createEditorTableContextMenuActions(deps) {
|
|
|
30434
30434
|
};
|
|
30435
30435
|
}
|
|
30436
30436
|
function createEditorChrome(deps) {
|
|
30437
|
-
const {
|
|
30437
|
+
const {
|
|
30438
|
+
computeFontFamilyOptions: computeFontFamilyOptions2,
|
|
30439
|
+
computeFontSizeOptions: computeFontSizeOptions2,
|
|
30440
|
+
loadLocalFontFamilyOptions
|
|
30441
|
+
} = createEditorFontOptions({
|
|
30438
30442
|
state: deps.state,
|
|
30439
30443
|
toolbarStyleState: deps.toolbarStyleState
|
|
30440
30444
|
});
|
|
@@ -33181,6 +33185,10 @@ function serializeParagraphBorders(style2) {
|
|
|
33181
33185
|
const DEFAULT_TABLE_BORDER_COLOR = "6F6F6F";
|
|
33182
33186
|
const DEFAULT_TABLE_BORDER_WIDTH_PT = 0.75;
|
|
33183
33187
|
const DEFAULT_CELL_PADDING_LEFT_RIGHT_PT = 5.4;
|
|
33188
|
+
function serializeExtAttributes(attrs) {
|
|
33189
|
+
if (!attrs) return "";
|
|
33190
|
+
return Object.entries(attrs).map(([name, value]) => ` ${name}="${escapeXml(value)}"`).join("");
|
|
33191
|
+
}
|
|
33184
33192
|
function serializeRevisionAttrs(revision) {
|
|
33185
33193
|
const numericId = /^\d+$/.test(revision.id) ? revision.id : String(
|
|
33186
33194
|
Array.from(revision.id).reduce(
|
|
@@ -33441,10 +33449,11 @@ function serializeTableRowStyleXml(style2) {
|
|
|
33441
33449
|
if (hidden) parts.push(hidden);
|
|
33442
33450
|
const header = serializeOnOffElement("tblHeader", style2.isHeader);
|
|
33443
33451
|
if (header) parts.push(header);
|
|
33452
|
+
if (style2.align) parts.push(`<w:jc w:val="${style2.align}"/>`);
|
|
33444
33453
|
return parts.length > 0 ? `<w:trPr>${parts.join("")}</w:trPr>` : "";
|
|
33445
33454
|
}
|
|
33446
33455
|
function serializeTableRowProperties(row) {
|
|
33447
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j;
|
|
33456
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k;
|
|
33448
33457
|
const parts = [];
|
|
33449
33458
|
const conditional = serializeConditionalFlags(row.conditionalStyle);
|
|
33450
33459
|
if (conditional) parts.push(conditional);
|
|
@@ -33471,13 +33480,14 @@ function serializeTableRowProperties(row) {
|
|
|
33471
33480
|
if (((_g = row.style) == null ? void 0 : _g.isHeader) ?? row.isHeader) parts.push("<w:tblHeader/>");
|
|
33472
33481
|
const hidden = serializeOnOffElement("hidden", (_h = row.style) == null ? void 0 : _h.hidden);
|
|
33473
33482
|
if (hidden) parts.push(hidden);
|
|
33474
|
-
if ((_i = row.style) == null ? void 0 : _i.
|
|
33483
|
+
if ((_i = row.style) == null ? void 0 : _i.align) parts.push(`<w:jc w:val="${row.style.align}"/>`);
|
|
33484
|
+
if ((_j = row.style) == null ? void 0 : _j.propertyRevision) {
|
|
33475
33485
|
const revision = row.style.propertyRevision;
|
|
33476
33486
|
parts.push(
|
|
33477
33487
|
`<w:trPrChange ${serializeRevisionAttrs(revision)}>${serializeTableRowStyleXml(revision.previous)}</w:trPrChange>`
|
|
33478
33488
|
);
|
|
33479
33489
|
}
|
|
33480
|
-
if (((
|
|
33490
|
+
if (((_k = row.style) == null ? void 0 : _k.revision) && row.style.revision.type !== "merge") {
|
|
33481
33491
|
const revision = row.style.revision;
|
|
33482
33492
|
const element = revision.type === "insert" ? "ins" : "del";
|
|
33483
33493
|
parts.push(`<w:${element} ${serializeRevisionAttrs(revision)}/>`);
|
|
@@ -33595,6 +33605,46 @@ function serializeTableProperties(table) {
|
|
|
33595
33605
|
}
|
|
33596
33606
|
return `<w:tblPr>${parts.join("")}</w:tblPr>`;
|
|
33597
33607
|
}
|
|
33608
|
+
function serializeTablePropertyExceptions(exceptions, tblPrExChangeXml) {
|
|
33609
|
+
if (!exceptions && !tblPrExChangeXml) {
|
|
33610
|
+
return "";
|
|
33611
|
+
}
|
|
33612
|
+
const parts = [];
|
|
33613
|
+
if ((exceptions == null ? void 0 : exceptions.width) !== void 0) {
|
|
33614
|
+
parts.push(serializeTableWidth(exceptions.width));
|
|
33615
|
+
}
|
|
33616
|
+
if (exceptions == null ? void 0 : exceptions.align) {
|
|
33617
|
+
parts.push(`<w:jc w:val="${exceptions.align}"/>`);
|
|
33618
|
+
}
|
|
33619
|
+
const cellSpacingXml = serializeDocxWidthElement(
|
|
33620
|
+
"tblCellSpacing",
|
|
33621
|
+
exceptions == null ? void 0 : exceptions.cellSpacing
|
|
33622
|
+
);
|
|
33623
|
+
if (cellSpacingXml) {
|
|
33624
|
+
parts.push(cellSpacingXml);
|
|
33625
|
+
}
|
|
33626
|
+
const indentXml = serializeDocxWidthElement("tblInd", exceptions == null ? void 0 : exceptions.indentLeft);
|
|
33627
|
+
if (indentXml) {
|
|
33628
|
+
parts.push(indentXml);
|
|
33629
|
+
}
|
|
33630
|
+
const bordersXml = exceptions ? serializeTableBorders(exceptions) : "";
|
|
33631
|
+
if (bordersXml) {
|
|
33632
|
+
parts.push(bordersXml);
|
|
33633
|
+
}
|
|
33634
|
+
if (exceptions == null ? void 0 : exceptions.layout) {
|
|
33635
|
+
parts.push(`<w:tblLayout w:type="${exceptions.layout}"/>`);
|
|
33636
|
+
}
|
|
33637
|
+
const marginsXml = serializeTableDefaultCellMargins(
|
|
33638
|
+
exceptions == null ? void 0 : exceptions.defaultCellMargins
|
|
33639
|
+
);
|
|
33640
|
+
if (marginsXml) {
|
|
33641
|
+
parts.push(marginsXml);
|
|
33642
|
+
}
|
|
33643
|
+
if (tblPrExChangeXml) {
|
|
33644
|
+
parts.push(tblPrExChangeXml);
|
|
33645
|
+
}
|
|
33646
|
+
return parts.length > 0 ? `<w:tblPrEx>${parts.join("")}</w:tblPrEx>` : "";
|
|
33647
|
+
}
|
|
33598
33648
|
function serializeTableXml(table, serializeParagraphXml2) {
|
|
33599
33649
|
const tableLayout = buildTableCellLayout(table);
|
|
33600
33650
|
const tableEntriesByKey = new Map(
|
|
@@ -33618,9 +33668,9 @@ function serializeTableXml(table, serializeParagraphXml2) {
|
|
|
33618
33668
|
];
|
|
33619
33669
|
const paragraphsXml = paragraphs.map((paragraph) => serializeParagraphXml2(paragraph, cell)).join("");
|
|
33620
33670
|
const contentXml = cell.vMerge === "continue" ? "<w:p/>" : paragraphsXml;
|
|
33621
|
-
return `<w:tc>${serializeTableCellProperties(cell, fallbackWidthPt)}${contentXml}</w:tc>`;
|
|
33671
|
+
return `<w:tc${serializeExtAttributes(cell.extAttributes)}>${serializeTableCellProperties(cell, fallbackWidthPt)}${contentXml}</w:tc>`;
|
|
33622
33672
|
}).join("");
|
|
33623
|
-
return `<w:tr>${row.
|
|
33673
|
+
return `<w:tr${serializeExtAttributes(row.extAttributes)}>${serializeTablePropertyExceptions(row.propertyExceptions, row.tblPrExChangeXml)}${serializeTableRowProperties(row)}${cellsXml}</w:tr>`;
|
|
33624
33674
|
}).join("");
|
|
33625
33675
|
const gridXml = table.gridCols ? `<w:tblGrid>${table.gridCols.map((width) => `<w:gridCol w:w="${pointsToTwips(width) ?? 0}"/>`).join("")}${table.gridRevision ? `<w:tblGridChange ${serializeRevisionAttrs(table.gridRevision)}><w:tblGrid>${table.gridRevision.previous.map((width) => `<w:gridCol w:w="${pointsToTwips(width) ?? 0}"/>`).join("")}</w:tblGrid></w:tblGridChange>` : ""}</w:tblGrid>` : "";
|
|
33626
33676
|
return `<w:tbl>${serializeTableProperties(table)}${gridXml}${rowsXml}</w:tbl>`;
|
|
@@ -34806,31 +34856,17 @@ const CONDITIONAL_TYPE_ORDER = [
|
|
|
34806
34856
|
"seCell"
|
|
34807
34857
|
];
|
|
34808
34858
|
function serializeConditionalTcPr(cond) {
|
|
34809
|
-
|
|
34810
|
-
|
|
34811
|
-
|
|
34812
|
-
|
|
34813
|
-
|
|
34814
|
-
|
|
34815
|
-
|
|
34816
|
-
|
|
34817
|
-
|
|
34818
|
-
|
|
34819
|
-
|
|
34820
|
-
];
|
|
34821
|
-
const borderXml = edges.filter(
|
|
34822
|
-
(entry) => entry[1] != null
|
|
34823
|
-
).map(([name, border]) => `<w:${name} ${serializeDocxBorderAttrs(border)}`).join("");
|
|
34824
|
-
if (borderXml) {
|
|
34825
|
-
parts.push(`<w:tcBorders>${borderXml}</w:tcBorders>`);
|
|
34826
|
-
}
|
|
34827
|
-
}
|
|
34828
|
-
if (cond.shading) {
|
|
34829
|
-
parts.push(
|
|
34830
|
-
`<w:shd w:val="clear" w:color="auto" w:fill="${normalizeDocxColor(cond.shading, "FFFFFF")}"/>`
|
|
34831
|
-
);
|
|
34832
|
-
}
|
|
34833
|
-
return parts.length > 0 ? `<w:tcPr>${parts.join("")}</w:tcPr>` : "";
|
|
34859
|
+
const cellStyle = {
|
|
34860
|
+
...cond.borders ? {
|
|
34861
|
+
...cond.borders.borderTop ? { borderTop: cond.borders.borderTop } : {},
|
|
34862
|
+
...cond.borders.borderLeft ? { borderLeft: cond.borders.borderLeft } : {},
|
|
34863
|
+
...cond.borders.borderBottom ? { borderBottom: cond.borders.borderBottom } : {},
|
|
34864
|
+
...cond.borders.borderRight ? { borderRight: cond.borders.borderRight } : {}
|
|
34865
|
+
} : {},
|
|
34866
|
+
...cond.shading ? { shading: cond.shading } : {},
|
|
34867
|
+
...cond.cellStyle
|
|
34868
|
+
};
|
|
34869
|
+
return Object.keys(cellStyle).length > 0 ? serializeTableCellStyleXml(cellStyle) : "";
|
|
34834
34870
|
}
|
|
34835
34871
|
function serializeWidthElement(name, value) {
|
|
34836
34872
|
if (typeof value === "number") {
|
|
@@ -35029,7 +35065,7 @@ function serializeNoteSettings(tagName, settings) {
|
|
|
35029
35065
|
}
|
|
35030
35066
|
return parts.length > 0 ? `<w:${tagName}>${parts.join("")}</w:${tagName}>` : null;
|
|
35031
35067
|
}
|
|
35032
|
-
function buildSettingsXml(hasEvenAndOddHeaders, defaultTabStop, footnoteSettings, endnoteSettings) {
|
|
35068
|
+
function buildSettingsXml(hasEvenAndOddHeaders, defaultTabStop, footnoteSettings, endnoteSettings, allowSpaceOfSameStyleInTable) {
|
|
35033
35069
|
const parts = [];
|
|
35034
35070
|
const defaultTabStopTwips = pointsToTwips(defaultTabStop);
|
|
35035
35071
|
if (defaultTabStopTwips !== null) {
|
|
@@ -35046,6 +35082,11 @@ function buildSettingsXml(hasEvenAndOddHeaders, defaultTabStop, footnoteSettings
|
|
|
35046
35082
|
if (hasEvenAndOddHeaders) {
|
|
35047
35083
|
parts.push("<w:evenAndOddHeaders/>");
|
|
35048
35084
|
}
|
|
35085
|
+
if (allowSpaceOfSameStyleInTable) {
|
|
35086
|
+
parts.push(
|
|
35087
|
+
`<w:compat><w:allowSpaceOfSameStyleInTable/></w:compat>`
|
|
35088
|
+
);
|
|
35089
|
+
}
|
|
35049
35090
|
return `<?xml version="1.0" encoding="UTF-8" standalone="yes"?><w:settings xmlns:w="${WORD_NS$1}">${parts.join("")}</w:settings>`;
|
|
35050
35091
|
}
|
|
35051
35092
|
function buildPartRelationshipsXml(images, hyperlinks) {
|
|
@@ -35478,7 +35519,7 @@ function buildPartContext(blocks, numberingContext, state, document2) {
|
|
|
35478
35519
|
};
|
|
35479
35520
|
}
|
|
35480
35521
|
async function exportEditorDocumentToDocx(document2) {
|
|
35481
|
-
var _a, _b, _c, _d, _e, _f;
|
|
35522
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
35482
35523
|
document2 = renumberImageCaptionsInDocument(document2);
|
|
35483
35524
|
const zip = new JSZip();
|
|
35484
35525
|
const numberingContext = buildNumberingContext(document2);
|
|
@@ -35563,7 +35604,7 @@ async function exportEditorDocumentToDocx(document2) {
|
|
|
35563
35604
|
return (((_a2 = section.evenPageHeader) == null ? void 0 : _a2.length) ?? 0) > 0 || (((_b2 = section.evenPageFooter) == null ? void 0 : _b2.length) ?? 0) > 0;
|
|
35564
35605
|
}
|
|
35565
35606
|
);
|
|
35566
|
-
const hasDocumentSettings = hasEvenAndOddHeaders || ((_a = document2.settings) == null ? void 0 : _a.defaultTabStop) !== void 0 || ((_b = document2.
|
|
35607
|
+
const hasDocumentSettings = hasEvenAndOddHeaders || ((_a = document2.settings) == null ? void 0 : _a.defaultTabStop) !== void 0 || ((_b = document2.settings) == null ? void 0 : _b.allowSpaceOfSameStyleInTable) !== void 0 || ((_c = document2.footnotes) == null ? void 0 : _c.settings) !== void 0 || ((_d = document2.endnotes) == null ? void 0 : _d.settings) !== void 0;
|
|
35567
35608
|
const allImages = [
|
|
35568
35609
|
...bodyContext.images,
|
|
35569
35610
|
...parts.flatMap((part) => part.context.images)
|
|
@@ -35645,9 +35686,10 @@ async function exportEditorDocumentToDocx(document2) {
|
|
|
35645
35686
|
"word/settings.xml",
|
|
35646
35687
|
buildSettingsXml(
|
|
35647
35688
|
hasEvenAndOddHeaders,
|
|
35648
|
-
(
|
|
35649
|
-
(
|
|
35650
|
-
(
|
|
35689
|
+
(_e = document2.settings) == null ? void 0 : _e.defaultTabStop,
|
|
35690
|
+
(_f = document2.footnotes) == null ? void 0 : _f.settings,
|
|
35691
|
+
(_g = document2.endnotes) == null ? void 0 : _g.settings,
|
|
35692
|
+
(_h = document2.settings) == null ? void 0 : _h.allowSpaceOfSameStyleInTable
|
|
35651
35693
|
)
|
|
35652
35694
|
);
|
|
35653
35695
|
}
|
|
@@ -44972,7 +45014,9 @@ function createEditorTextDrag(deps) {
|
|
|
44972
45014
|
current,
|
|
44973
45015
|
(temp) => moveOrCopySelectionToPosition(temp, destination, { copy })
|
|
44974
45016
|
),
|
|
44975
|
-
{
|
|
45017
|
+
{
|
|
45018
|
+
mergeKey: copy ? MERGE_KEYS.copyTextByDrag : MERGE_KEYS.moveTextByDrag
|
|
45019
|
+
}
|
|
44976
45020
|
);
|
|
44977
45021
|
(_b = deps.logger) == null ? void 0 : _b.info("text-drag:apply", {
|
|
44978
45022
|
mode: copy ? "copy" : "move",
|
|
@@ -47346,7 +47390,12 @@ function collectTocHeadings(state, maxLevel = DEFAULT_TOC_MAX_LEVEL) {
|
|
|
47346
47390
|
function makeRun(partial) {
|
|
47347
47391
|
const id = createEditorRun(partial.text).id;
|
|
47348
47392
|
if (partial.fieldChar) {
|
|
47349
|
-
return {
|
|
47393
|
+
return {
|
|
47394
|
+
id,
|
|
47395
|
+
text: partial.text,
|
|
47396
|
+
kind: "fieldChar",
|
|
47397
|
+
fieldChar: partial.fieldChar
|
|
47398
|
+
};
|
|
47350
47399
|
}
|
|
47351
47400
|
if (partial.fieldInstruction !== void 0) {
|
|
47352
47401
|
return {
|