@harbour-enterprises/superdoc 1.7.0-next.5 → 1.7.0-next.6
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/chunks/{PdfViewer-CMz0vPEp.es.js → PdfViewer-CVwE4WYW.es.js} +2 -2
- package/dist/chunks/{PdfViewer-DbdY4nxk.cjs → PdfViewer-CWbiDeiU.cjs} +2 -2
- package/dist/chunks/{SuperConverter-DU1Tqi67.es.js → SuperConverter-DpNWJAJU.es.js} +1 -1
- package/dist/chunks/{SuperConverter-CGlcEWcs.cjs → SuperConverter-iUnNfL5l.cjs} +1 -1
- package/dist/chunks/{index-i_RngoBn.cjs → index-ChXg2ff-.cjs} +247 -53
- package/dist/chunks/{index-Clk0gT7d.cjs → index-DfBvgXLe.cjs} +4 -4
- package/dist/chunks/{index-DYUIpqx9.es.js → index-DnpYZRby.es.js} +247 -53
- package/dist/chunks/{index-BQo9zrNo.es.js → index-HKM0YiEI.es.js} +4 -4
- package/dist/super-editor/converter.cjs +1 -1
- package/dist/super-editor/converter.es.js +1 -1
- package/dist/super-editor.cjs +2 -2
- package/dist/super-editor.es.js +3 -3
- package/dist/superdoc.cjs +3 -3
- package/dist/superdoc.es.js +3 -3
- package/dist/superdoc.umd.js +252 -58
- package/dist/superdoc.umd.js.map +1 -1
- package/package.json +2 -2
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { d as defineComponent, h, T as Transition, p as process$1, w as watchEffect, c as computed, r as ref, f as onMounted, X as onUnmounted, E as createElementBlock, G as openBlock, K as createBaseVNode, M as createCommentVNode, I as createVNode, v as unref } from "./vue-BnBKJwCW.es.js";
|
|
2
|
-
import { N as NBaseLoading, u as useSuperdocStore, s as storeToRefs, a as useSelection } from "./index-
|
|
3
|
-
import { C as derived, r as c, q as cB, aF as fadeInTransition, y as cM, I as warnOnce, J as useConfig, N as useTheme, aG as pxfy, P as createKey, Q as useThemeClass, aH as useCompitable, ai as _export_sfc } from "./index-
|
|
2
|
+
import { N as NBaseLoading, u as useSuperdocStore, s as storeToRefs, a as useSelection } from "./index-HKM0YiEI.es.js";
|
|
3
|
+
import { C as derived, r as c, q as cB, aF as fadeInTransition, y as cM, I as warnOnce, J as useConfig, N as useTheme, aG as pxfy, P as createKey, Q as useThemeClass, aH as useCompitable, ai as _export_sfc } from "./index-DnpYZRby.es.js";
|
|
4
4
|
function self(vars) {
|
|
5
5
|
const {
|
|
6
6
|
opacityDisabled,
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
3
|
const vue = require("./vue-De9wkgLl.cjs");
|
|
4
|
-
const superdoc = require("./index-
|
|
5
|
-
const index = require("./index-
|
|
4
|
+
const superdoc = require("./index-DfBvgXLe.cjs");
|
|
5
|
+
const index = require("./index-ChXg2ff-.cjs");
|
|
6
6
|
function self(vars) {
|
|
7
7
|
const {
|
|
8
8
|
opacityDisabled,
|
|
@@ -32769,7 +32769,7 @@ class SuperConverter {
|
|
|
32769
32769
|
static getStoredSuperdocVersion(docx) {
|
|
32770
32770
|
return SuperConverter.getStoredCustomProperty(docx, "SuperdocVersion");
|
|
32771
32771
|
}
|
|
32772
|
-
static setStoredSuperdocVersion(docx = this.convertedXml, version = "1.7.0-next.
|
|
32772
|
+
static setStoredSuperdocVersion(docx = this.convertedXml, version = "1.7.0-next.6") {
|
|
32773
32773
|
return SuperConverter.setStoredCustomProperty(docx, "SuperdocVersion", version, false);
|
|
32774
32774
|
}
|
|
32775
32775
|
/**
|
|
@@ -32770,7 +32770,7 @@ class SuperConverter {
|
|
|
32770
32770
|
static getStoredSuperdocVersion(docx) {
|
|
32771
32771
|
return SuperConverter.getStoredCustomProperty(docx, "SuperdocVersion");
|
|
32772
32772
|
}
|
|
32773
|
-
static setStoredSuperdocVersion(docx = this.convertedXml, version = "1.7.0-next.
|
|
32773
|
+
static setStoredSuperdocVersion(docx = this.convertedXml, version = "1.7.0-next.6") {
|
|
32774
32774
|
return SuperConverter.setStoredCustomProperty(docx, "SuperdocVersion", version, false);
|
|
32775
32775
|
}
|
|
32776
32776
|
/**
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
const jszip = require("./jszip-C8_CqJxM.cjs");
|
|
3
3
|
const helpers$1 = require("./helpers-nOdwpmwb.cjs");
|
|
4
|
-
const superEditor_converter = require("./SuperConverter-
|
|
4
|
+
const superEditor_converter = require("./SuperConverter-iUnNfL5l.cjs");
|
|
5
5
|
const vue = require("./vue-De9wkgLl.cjs");
|
|
6
6
|
require("./jszip.min-BPh2MMAa.cjs");
|
|
7
7
|
const eventemitter3 = require("./eventemitter3-BQuRcMPI.cjs");
|
|
@@ -15788,7 +15788,7 @@ const canUseDOM = () => {
|
|
|
15788
15788
|
return false;
|
|
15789
15789
|
}
|
|
15790
15790
|
};
|
|
15791
|
-
const summaryVersion = "1.7.0-next.
|
|
15791
|
+
const summaryVersion = "1.7.0-next.6";
|
|
15792
15792
|
const nodeKeys = ["group", "content", "marks", "inline", "atom", "defining", "code", "tableRole", "summary"];
|
|
15793
15793
|
const markKeys = ["group", "inclusive", "excludes", "spanning", "code"];
|
|
15794
15794
|
function mapAttributes(attrs) {
|
|
@@ -18455,7 +18455,7 @@ class Editor extends EventEmitter {
|
|
|
18455
18455
|
* Process collaboration migrations
|
|
18456
18456
|
*/
|
|
18457
18457
|
processCollaborationMigrations() {
|
|
18458
|
-
console.debug("[checkVersionMigrations] Current editor version", "1.7.0-next.
|
|
18458
|
+
console.debug("[checkVersionMigrations] Current editor version", "1.7.0-next.6");
|
|
18459
18459
|
if (!this.options.ydoc) return;
|
|
18460
18460
|
const metaMap = this.options.ydoc.getMap("meta");
|
|
18461
18461
|
let docVersion = metaMap.get("version");
|
|
@@ -33057,6 +33057,28 @@ function applyPendingToActive(state) {
|
|
|
33057
33057
|
next.pendingOrientation = null;
|
|
33058
33058
|
return next;
|
|
33059
33059
|
}
|
|
33060
|
+
const isTextRun$3 = (run) => {
|
|
33061
|
+
const runWithKind = run;
|
|
33062
|
+
return !runWithKind.kind || runWithKind.kind === "text";
|
|
33063
|
+
};
|
|
33064
|
+
const isEmptyTextParagraph = (block) => {
|
|
33065
|
+
const runs = block.runs;
|
|
33066
|
+
if (!runs || runs.length === 0) return true;
|
|
33067
|
+
if (runs.length !== 1) return false;
|
|
33068
|
+
const run = runs[0];
|
|
33069
|
+
if (!isTextRun$3(run)) return false;
|
|
33070
|
+
return typeof run.text === "string" && run.text.length === 0;
|
|
33071
|
+
};
|
|
33072
|
+
const shouldSuppressSpacingForEmpty = (block, side) => {
|
|
33073
|
+
if (!isEmptyTextParagraph(block)) return false;
|
|
33074
|
+
const attrs = block.attrs;
|
|
33075
|
+
const spacingExplicit = attrs?.spacingExplicit;
|
|
33076
|
+
if (!spacingExplicit) return false;
|
|
33077
|
+
if (side === "before") {
|
|
33078
|
+
return !spacingExplicit.before;
|
|
33079
|
+
}
|
|
33080
|
+
return !spacingExplicit.after;
|
|
33081
|
+
};
|
|
33060
33082
|
function normalizeLines(measure) {
|
|
33061
33083
|
if (measure.lines.length > 0) {
|
|
33062
33084
|
return measure.lines;
|
|
@@ -33296,11 +33318,17 @@ function layoutParagraphBlock(ctx2, anchors) {
|
|
|
33296
33318
|
let fromLine = 0;
|
|
33297
33319
|
const attrs = getParagraphAttrs(block);
|
|
33298
33320
|
const spacing = attrs?.spacing ?? {};
|
|
33321
|
+
const spacingExplicit = attrs?.spacingExplicit;
|
|
33299
33322
|
const styleId = asString(attrs?.styleId);
|
|
33300
33323
|
const contextualSpacing = asBoolean$1(attrs?.contextualSpacing);
|
|
33301
33324
|
let spacingBefore = Math.max(0, Number(spacing.before ?? spacing.lineSpaceBefore ?? 0));
|
|
33325
|
+
let spacingAfter = Math.max(0, Number(spacing.after ?? spacing.lineSpaceAfter ?? 0));
|
|
33326
|
+
const emptyTextParagraph = isEmptyTextParagraph(block);
|
|
33327
|
+
if (emptyTextParagraph && spacingExplicit) {
|
|
33328
|
+
if (!spacingExplicit.before) spacingBefore = 0;
|
|
33329
|
+
if (!spacingExplicit.after) spacingAfter = 0;
|
|
33330
|
+
}
|
|
33302
33331
|
const baseSpacingBefore = spacingBefore;
|
|
33303
|
-
const spacingAfter = Math.max(0, Number(spacing.after ?? spacing.lineSpaceAfter ?? 0));
|
|
33304
33332
|
let appliedSpacingBefore = spacingBefore === 0;
|
|
33305
33333
|
let lastState = null;
|
|
33306
33334
|
const isPositionedFrame = frame?.wrap === "none";
|
|
@@ -34622,11 +34650,13 @@ function hasHeight(fragment) {
|
|
|
34622
34650
|
function getParagraphSpacingBefore(block) {
|
|
34623
34651
|
const spacing = block.attrs?.spacing;
|
|
34624
34652
|
const value = spacing?.before ?? spacing?.lineSpaceBefore;
|
|
34653
|
+
if (shouldSuppressSpacingForEmpty(block, "before")) return 0;
|
|
34625
34654
|
return typeof value === "number" && Number.isFinite(value) && value > 0 ? value : 0;
|
|
34626
34655
|
}
|
|
34627
34656
|
function getParagraphSpacingAfter$1(block) {
|
|
34628
34657
|
const spacing = block.attrs?.spacing;
|
|
34629
34658
|
const value = spacing?.after ?? spacing?.lineSpaceAfter;
|
|
34659
|
+
if (shouldSuppressSpacingForEmpty(block, "after")) return 0;
|
|
34630
34660
|
return typeof value === "number" && Number.isFinite(value) && value > 0 ? value : 0;
|
|
34631
34661
|
}
|
|
34632
34662
|
function getMeasureHeight(block, measure) {
|
|
@@ -43484,6 +43514,26 @@ function normalizeTextInsets(value) {
|
|
|
43484
43514
|
return { top: top2, right: right2, bottom: bottom2, left: left2 };
|
|
43485
43515
|
}
|
|
43486
43516
|
const OOXML_Z_INDEX_BASE = 251658240;
|
|
43517
|
+
const asOoxmlElement = (value) => {
|
|
43518
|
+
if (!value || typeof value !== "object") return void 0;
|
|
43519
|
+
const element = value;
|
|
43520
|
+
if (element.name == null && element.attributes == null && element.elements == null) return void 0;
|
|
43521
|
+
return element;
|
|
43522
|
+
};
|
|
43523
|
+
const findOoxmlChild = (parent, name) => {
|
|
43524
|
+
return parent?.elements?.find((child) => child?.name === name);
|
|
43525
|
+
};
|
|
43526
|
+
const getOoxmlAttribute = (element, key2) => {
|
|
43527
|
+
if (!element?.attributes) return void 0;
|
|
43528
|
+
const attrs = element.attributes;
|
|
43529
|
+
return attrs[key2] ?? attrs[key2.startsWith("w:") ? key2.slice(2) : `w:${key2}`];
|
|
43530
|
+
};
|
|
43531
|
+
const parseOoxmlNumber = (value) => {
|
|
43532
|
+
if (value == null) return void 0;
|
|
43533
|
+
const num = typeof value === "number" ? value : Number.parseInt(String(value), 10);
|
|
43534
|
+
return Number.isFinite(num) ? num : void 0;
|
|
43535
|
+
};
|
|
43536
|
+
const hasOwnProperty$d = (obj, key2) => Object.prototype.hasOwnProperty.call(obj, key2);
|
|
43487
43537
|
function normalizeZIndex(originalAttributes) {
|
|
43488
43538
|
if (!isPlainObject$2(originalAttributes)) return void 0;
|
|
43489
43539
|
const relativeHeight = originalAttributes.relativeHeight;
|
|
@@ -45484,24 +45534,47 @@ const DEFAULT_DECIMAL_SEPARATOR$2 = ".";
|
|
|
45484
45534
|
const isValidNumberingId = (numId) => {
|
|
45485
45535
|
return numId != null && numId !== 0 && numId !== "0";
|
|
45486
45536
|
};
|
|
45487
|
-
const
|
|
45488
|
-
if (!value || typeof value !== "object") return
|
|
45489
|
-
const
|
|
45490
|
-
|
|
45491
|
-
|
|
45492
|
-
|
|
45493
|
-
|
|
45494
|
-
|
|
45537
|
+
const extractSpacingExplicitFromObject = (value) => {
|
|
45538
|
+
if (!value || typeof value !== "object" || Array.isArray(value)) return {};
|
|
45539
|
+
const obj = value;
|
|
45540
|
+
const explicit = {};
|
|
45541
|
+
if (hasOwnProperty$d(obj, "before") || hasOwnProperty$d(obj, "lineSpaceBefore") || hasOwnProperty$d(obj, "beforeAutospacing") || hasOwnProperty$d(obj, "beforeAutoSpacing")) {
|
|
45542
|
+
explicit.before = true;
|
|
45543
|
+
}
|
|
45544
|
+
if (hasOwnProperty$d(obj, "after") || hasOwnProperty$d(obj, "lineSpaceAfter") || hasOwnProperty$d(obj, "afterAutospacing") || hasOwnProperty$d(obj, "afterAutoSpacing")) {
|
|
45545
|
+
explicit.after = true;
|
|
45546
|
+
}
|
|
45547
|
+
if (hasOwnProperty$d(obj, "line") || hasOwnProperty$d(obj, "lineRule")) {
|
|
45548
|
+
explicit.line = true;
|
|
45549
|
+
}
|
|
45550
|
+
return explicit;
|
|
45495
45551
|
};
|
|
45496
|
-
const
|
|
45497
|
-
|
|
45498
|
-
|
|
45499
|
-
|
|
45552
|
+
const extractSpacingExplicitFromOoxml = (value) => {
|
|
45553
|
+
const element = asOoxmlElement(value);
|
|
45554
|
+
if (!element) return {};
|
|
45555
|
+
const pPr = element.name === "w:pPr" ? element : findOoxmlChild(element, "w:pPr");
|
|
45556
|
+
const spacingEl = findOoxmlChild(pPr, "w:spacing");
|
|
45557
|
+
if (!spacingEl) return {};
|
|
45558
|
+
const explicit = {};
|
|
45559
|
+
if (getOoxmlAttribute(spacingEl, "w:before") != null || getOoxmlAttribute(spacingEl, "w:beforeAutospacing") != null || getOoxmlAttribute(spacingEl, "w:beforeAutoSpacing") != null) {
|
|
45560
|
+
explicit.before = true;
|
|
45561
|
+
}
|
|
45562
|
+
if (getOoxmlAttribute(spacingEl, "w:after") != null || getOoxmlAttribute(spacingEl, "w:afterAutospacing") != null || getOoxmlAttribute(spacingEl, "w:afterAutoSpacing") != null) {
|
|
45563
|
+
explicit.after = true;
|
|
45564
|
+
}
|
|
45565
|
+
if (getOoxmlAttribute(spacingEl, "w:line") != null || getOoxmlAttribute(spacingEl, "w:lineRule") != null) {
|
|
45566
|
+
explicit.line = true;
|
|
45567
|
+
}
|
|
45568
|
+
return explicit;
|
|
45500
45569
|
};
|
|
45501
|
-
const
|
|
45502
|
-
|
|
45503
|
-
const
|
|
45504
|
-
|
|
45570
|
+
const mergeSpacingExplicit = (...sources) => {
|
|
45571
|
+
const merged = {};
|
|
45572
|
+
for (const source of sources) {
|
|
45573
|
+
if (source.before) merged.before = true;
|
|
45574
|
+
if (source.after) merged.after = true;
|
|
45575
|
+
if (source.line) merged.line = true;
|
|
45576
|
+
}
|
|
45577
|
+
return merged;
|
|
45505
45578
|
};
|
|
45506
45579
|
const mergeSpacingSources = (base2, paragraphProps, attrs) => {
|
|
45507
45580
|
const isObject2 = (v) => v !== null && typeof v === "object";
|
|
@@ -45547,13 +45620,13 @@ const normalizeJustification = (value) => {
|
|
|
45547
45620
|
return void 0;
|
|
45548
45621
|
};
|
|
45549
45622
|
const extractIndentFromLevel = (lvl) => {
|
|
45550
|
-
const pPr =
|
|
45551
|
-
const ind =
|
|
45623
|
+
const pPr = findOoxmlChild(lvl, "w:pPr");
|
|
45624
|
+
const ind = findOoxmlChild(pPr, "w:ind");
|
|
45552
45625
|
if (!ind) return void 0;
|
|
45553
|
-
const left2 =
|
|
45554
|
-
const right2 =
|
|
45555
|
-
const firstLine =
|
|
45556
|
-
const hanging =
|
|
45626
|
+
const left2 = parseOoxmlNumber(getOoxmlAttribute(ind, "w:left"));
|
|
45627
|
+
const right2 = parseOoxmlNumber(getOoxmlAttribute(ind, "w:right"));
|
|
45628
|
+
const firstLine = parseOoxmlNumber(getOoxmlAttribute(ind, "w:firstLine"));
|
|
45629
|
+
const hanging = parseOoxmlNumber(getOoxmlAttribute(ind, "w:hanging"));
|
|
45557
45630
|
const indent = {};
|
|
45558
45631
|
if (left2 != null) indent.left = left2;
|
|
45559
45632
|
if (right2 != null) indent.right = right2;
|
|
@@ -45569,31 +45642,31 @@ const normalizeColor = (value) => {
|
|
|
45569
45642
|
return `#${upper.toUpperCase()}`;
|
|
45570
45643
|
};
|
|
45571
45644
|
const extractMarkerRun = (lvl) => {
|
|
45572
|
-
const rPr =
|
|
45645
|
+
const rPr = findOoxmlChild(lvl, "w:rPr");
|
|
45573
45646
|
if (!rPr) return void 0;
|
|
45574
45647
|
const run = {};
|
|
45575
|
-
const rFonts =
|
|
45576
|
-
const font =
|
|
45648
|
+
const rFonts = findOoxmlChild(rPr, "w:rFonts");
|
|
45649
|
+
const font = getOoxmlAttribute(rFonts, "w:ascii") ?? getOoxmlAttribute(rFonts, "w:hAnsi") ?? getOoxmlAttribute(rFonts, "w:eastAsia");
|
|
45577
45650
|
if (typeof font === "string" && font.trim()) {
|
|
45578
45651
|
run.fontFamily = font;
|
|
45579
45652
|
}
|
|
45580
|
-
const sz =
|
|
45653
|
+
const sz = parseOoxmlNumber(getOoxmlAttribute(findOoxmlChild(rPr, "w:sz"), "w:val")) ?? parseOoxmlNumber(getOoxmlAttribute(findOoxmlChild(rPr, "w:szCs"), "w:val"));
|
|
45581
45654
|
if (sz != null) {
|
|
45582
45655
|
run.fontSize = sz / 2;
|
|
45583
45656
|
}
|
|
45584
|
-
const color = normalizeColor(
|
|
45657
|
+
const color = normalizeColor(getOoxmlAttribute(findOoxmlChild(rPr, "w:color"), "w:val"));
|
|
45585
45658
|
if (color) run.color = color;
|
|
45586
|
-
const boldEl =
|
|
45659
|
+
const boldEl = findOoxmlChild(rPr, "w:b");
|
|
45587
45660
|
if (boldEl) {
|
|
45588
|
-
const boldVal =
|
|
45661
|
+
const boldVal = getOoxmlAttribute(boldEl, "w:val");
|
|
45589
45662
|
if (boldVal == null || isTruthy(boldVal)) run.bold = true;
|
|
45590
45663
|
}
|
|
45591
|
-
const italicEl =
|
|
45664
|
+
const italicEl = findOoxmlChild(rPr, "w:i");
|
|
45592
45665
|
if (italicEl) {
|
|
45593
|
-
const italicVal =
|
|
45666
|
+
const italicVal = getOoxmlAttribute(italicEl, "w:val");
|
|
45594
45667
|
if (italicVal == null || isTruthy(italicVal)) run.italic = true;
|
|
45595
45668
|
}
|
|
45596
|
-
const spacingTwips =
|
|
45669
|
+
const spacingTwips = parseOoxmlNumber(getOoxmlAttribute(findOoxmlChild(rPr, "w:spacing"), "w:val"));
|
|
45597
45670
|
if (spacingTwips != null && Number.isFinite(spacingTwips)) {
|
|
45598
45671
|
run.letterSpacing = twipsToPx$1(spacingTwips);
|
|
45599
45672
|
}
|
|
@@ -45601,12 +45674,12 @@ const extractMarkerRun = (lvl) => {
|
|
|
45601
45674
|
};
|
|
45602
45675
|
const findNumFmtElement = (lvl) => {
|
|
45603
45676
|
if (!lvl) return void 0;
|
|
45604
|
-
const direct =
|
|
45677
|
+
const direct = findOoxmlChild(lvl, "w:numFmt");
|
|
45605
45678
|
if (direct) return direct;
|
|
45606
|
-
const alternate =
|
|
45607
|
-
const choice =
|
|
45679
|
+
const alternate = findOoxmlChild(lvl, "mc:AlternateContent");
|
|
45680
|
+
const choice = findOoxmlChild(alternate, "mc:Choice");
|
|
45608
45681
|
if (choice) {
|
|
45609
|
-
return
|
|
45682
|
+
return findOoxmlChild(choice, "w:numFmt");
|
|
45610
45683
|
}
|
|
45611
45684
|
return void 0;
|
|
45612
45685
|
};
|
|
@@ -45620,7 +45693,7 @@ const resolveNumberingFromContext = (numId, ilvl, numbering) => {
|
|
|
45620
45693
|
if (!numDef) {
|
|
45621
45694
|
return void 0;
|
|
45622
45695
|
}
|
|
45623
|
-
const abstractId =
|
|
45696
|
+
const abstractId = getOoxmlAttribute(findOoxmlChild(numDef, "w:abstractNumId"), "w:val");
|
|
45624
45697
|
if (abstractId == null) {
|
|
45625
45698
|
return void 0;
|
|
45626
45699
|
}
|
|
@@ -45629,27 +45702,27 @@ const resolveNumberingFromContext = (numId, ilvl, numbering) => {
|
|
|
45629
45702
|
return void 0;
|
|
45630
45703
|
}
|
|
45631
45704
|
let levelDef = abstract.elements?.find(
|
|
45632
|
-
(el) => el?.name === "w:lvl" &&
|
|
45705
|
+
(el) => el?.name === "w:lvl" && parseOoxmlNumber(el.attributes?.["w:ilvl"]) === ilvl
|
|
45633
45706
|
);
|
|
45634
45707
|
const override = numDef.elements?.find(
|
|
45635
|
-
(el) => el?.name === "w:lvlOverride" &&
|
|
45708
|
+
(el) => el?.name === "w:lvlOverride" && parseOoxmlNumber(el.attributes?.["w:ilvl"]) === ilvl
|
|
45636
45709
|
);
|
|
45637
|
-
const overrideLvl =
|
|
45710
|
+
const overrideLvl = findOoxmlChild(override, "w:lvl");
|
|
45638
45711
|
if (overrideLvl) {
|
|
45639
45712
|
levelDef = overrideLvl;
|
|
45640
45713
|
}
|
|
45641
|
-
const startOverride =
|
|
45714
|
+
const startOverride = parseOoxmlNumber(getOoxmlAttribute(findOoxmlChild(override, "w:startOverride"), "w:val"));
|
|
45642
45715
|
if (!levelDef) {
|
|
45643
45716
|
return void 0;
|
|
45644
45717
|
}
|
|
45645
45718
|
const numFmtEl = findNumFmtElement(levelDef);
|
|
45646
|
-
const lvlText =
|
|
45647
|
-
const start2 = startOverride ??
|
|
45648
|
-
const suffix2 = normalizeSuffix(
|
|
45649
|
-
const lvlJc = normalizeJustification(
|
|
45719
|
+
const lvlText = getOoxmlAttribute(findOoxmlChild(levelDef, "w:lvlText"), "w:val");
|
|
45720
|
+
const start2 = startOverride ?? parseOoxmlNumber(getOoxmlAttribute(findOoxmlChild(levelDef, "w:start"), "w:val"));
|
|
45721
|
+
const suffix2 = normalizeSuffix(getOoxmlAttribute(findOoxmlChild(levelDef, "w:suff"), "w:val"));
|
|
45722
|
+
const lvlJc = normalizeJustification(getOoxmlAttribute(findOoxmlChild(levelDef, "w:lvlJc"), "w:val"));
|
|
45650
45723
|
const indent = extractIndentFromLevel(levelDef);
|
|
45651
45724
|
const markerRun = extractMarkerRun(levelDef);
|
|
45652
|
-
const numFmt = normalizeNumFmt(
|
|
45725
|
+
const numFmt = normalizeNumFmt(getOoxmlAttribute(numFmtEl, "w:val"));
|
|
45653
45726
|
return {
|
|
45654
45727
|
format: numFmt,
|
|
45655
45728
|
lvlText,
|
|
@@ -45742,6 +45815,7 @@ const cloneParagraphAttrs = (attrs) => {
|
|
|
45742
45815
|
if (!attrs) return void 0;
|
|
45743
45816
|
const clone = { ...attrs };
|
|
45744
45817
|
if (attrs.spacing) clone.spacing = { ...attrs.spacing };
|
|
45818
|
+
if (attrs.spacingExplicit) clone.spacingExplicit = { ...attrs.spacingExplicit };
|
|
45745
45819
|
if (attrs.indent) clone.indent = { ...attrs.indent };
|
|
45746
45820
|
if (attrs.borders) {
|
|
45747
45821
|
const borderClone = {};
|
|
@@ -46117,6 +46191,11 @@ const computeParagraphAttrs = (para, styleContext, listCounterContext, converter
|
|
|
46117
46191
|
const hydrated = hydrationOverride ?? hydrateParagraphStyleAttrs(para, converterContext);
|
|
46118
46192
|
const mergedSpacing = mergeSpacingSources(hydrated?.spacing, paragraphProps.spacing, attrs.spacing);
|
|
46119
46193
|
const normalizedSpacing = normalizeParagraphSpacing(mergedSpacing);
|
|
46194
|
+
const spacingExplicit = mergeSpacingExplicit(
|
|
46195
|
+
extractSpacingExplicitFromObject(paragraphProps.spacing),
|
|
46196
|
+
extractSpacingExplicitFromObject(attrs.spacing),
|
|
46197
|
+
extractSpacingExplicitFromOoxml(paragraphProps)
|
|
46198
|
+
);
|
|
46120
46199
|
const normalizeIndentObject = (value) => {
|
|
46121
46200
|
if (!value || typeof value !== "object") return;
|
|
46122
46201
|
return normalizePxIndent(value) ?? convertIndentTwipsToPx(value);
|
|
@@ -46251,6 +46330,7 @@ const computeParagraphAttrs = (para, styleContext, listCounterContext, converter
|
|
|
46251
46330
|
paragraphAttrs.spacing.afterAutospacing = normalizedSpacing.afterAutospacing;
|
|
46252
46331
|
}
|
|
46253
46332
|
}
|
|
46333
|
+
paragraphAttrs.spacingExplicit = spacingExplicit;
|
|
46254
46334
|
const contextualSpacingValue = normalizedSpacing?.contextualSpacing ?? safeGetProperty(paragraphProps, "contextualSpacing") ?? safeGetProperty(attrs, "contextualSpacing") ?? hydrated?.contextualSpacing;
|
|
46255
46335
|
if (contextualSpacingValue != null) {
|
|
46256
46336
|
paragraphAttrs.contextualSpacing = isTruthy(contextualSpacingValue);
|
|
@@ -47729,6 +47809,75 @@ const extractFirstTextRunFont = (para) => {
|
|
|
47729
47809
|
const font = findFirstTextFont(para.content);
|
|
47730
47810
|
return font;
|
|
47731
47811
|
};
|
|
47812
|
+
const resolveRunFontFamily = (fontFamily2, docx) => {
|
|
47813
|
+
if (typeof fontFamily2 === "string" && fontFamily2.trim().length > 0) {
|
|
47814
|
+
return fontFamily2;
|
|
47815
|
+
}
|
|
47816
|
+
if (!fontFamily2 || typeof fontFamily2 !== "object") return void 0;
|
|
47817
|
+
const toCssFontFamily2 = superEditor_converter.SuperConverter.toCssFontFamily;
|
|
47818
|
+
const resolved = superEditor_converter.resolveDocxFontFamily(fontFamily2, docx ?? null, toCssFontFamily2);
|
|
47819
|
+
return resolved ?? void 0;
|
|
47820
|
+
};
|
|
47821
|
+
const parseRunFontSizePx = (fontSize2) => {
|
|
47822
|
+
if (typeof fontSize2 === "number" && Number.isFinite(fontSize2)) {
|
|
47823
|
+
return ptToPx(fontSize2 / HALF_POINTS_PER_POINT) ?? void 0;
|
|
47824
|
+
}
|
|
47825
|
+
if (typeof fontSize2 === "string") {
|
|
47826
|
+
const numeric = Number.parseFloat(fontSize2);
|
|
47827
|
+
if (!Number.isFinite(numeric)) return void 0;
|
|
47828
|
+
if (fontSize2.endsWith("pt")) {
|
|
47829
|
+
return ptToPx(numeric);
|
|
47830
|
+
}
|
|
47831
|
+
if (fontSize2.endsWith("px")) {
|
|
47832
|
+
return numeric;
|
|
47833
|
+
}
|
|
47834
|
+
return ptToPx(numeric / HALF_POINTS_PER_POINT) ?? void 0;
|
|
47835
|
+
}
|
|
47836
|
+
return void 0;
|
|
47837
|
+
};
|
|
47838
|
+
const extractParagraphMarkRunProps = (paragraphProps) => {
|
|
47839
|
+
const directRunProps = paragraphProps.runProperties;
|
|
47840
|
+
const directRunPropsElement = asOoxmlElement(directRunProps);
|
|
47841
|
+
if (directRunProps && isPlainObject$2(directRunProps) && !directRunPropsElement) {
|
|
47842
|
+
return directRunProps;
|
|
47843
|
+
}
|
|
47844
|
+
const element = asOoxmlElement(paragraphProps);
|
|
47845
|
+
const pPr = element ? element.name === "w:pPr" ? element : findOoxmlChild(element, "w:pPr") : void 0;
|
|
47846
|
+
const rPr = directRunPropsElement?.name === "w:rPr" ? directRunPropsElement : findOoxmlChild(pPr, "w:rPr");
|
|
47847
|
+
if (!rPr) return void 0;
|
|
47848
|
+
const runProps = {};
|
|
47849
|
+
const sz = parseOoxmlNumber(getOoxmlAttribute(findOoxmlChild(rPr, "w:sz"), "w:val")) ?? parseOoxmlNumber(getOoxmlAttribute(findOoxmlChild(rPr, "w:szCs"), "w:val"));
|
|
47850
|
+
if (sz != null) {
|
|
47851
|
+
runProps.fontSize = sz;
|
|
47852
|
+
}
|
|
47853
|
+
const rFonts = findOoxmlChild(rPr, "w:rFonts");
|
|
47854
|
+
if (rFonts) {
|
|
47855
|
+
const fontFamily2 = {};
|
|
47856
|
+
const keys2 = ["ascii", "hAnsi", "eastAsia", "cs", "val", "asciiTheme", "hAnsiTheme", "eastAsiaTheme", "cstheme"];
|
|
47857
|
+
for (const key2 of keys2) {
|
|
47858
|
+
const value = getOoxmlAttribute(rFonts, `w:${key2}`);
|
|
47859
|
+
if (value != null) {
|
|
47860
|
+
fontFamily2[key2] = value;
|
|
47861
|
+
}
|
|
47862
|
+
}
|
|
47863
|
+
if (Object.keys(fontFamily2).length > 0) {
|
|
47864
|
+
runProps.fontFamily = fontFamily2;
|
|
47865
|
+
}
|
|
47866
|
+
}
|
|
47867
|
+
return Object.keys(runProps).length > 0 ? runProps : void 0;
|
|
47868
|
+
};
|
|
47869
|
+
const applyParagraphMarkRunProps = (run, paragraphProps, converterContext) => {
|
|
47870
|
+
const runProps = extractParagraphMarkRunProps(paragraphProps);
|
|
47871
|
+
if (!runProps) return;
|
|
47872
|
+
const fontSizePx = parseRunFontSizePx(runProps.fontSize);
|
|
47873
|
+
if (fontSizePx != null) {
|
|
47874
|
+
run.fontSize = fontSizePx;
|
|
47875
|
+
}
|
|
47876
|
+
const fontFamily2 = resolveRunFontFamily(runProps.fontFamily, converterContext?.docx);
|
|
47877
|
+
if (fontFamily2) {
|
|
47878
|
+
run.fontFamily = fontFamily2;
|
|
47879
|
+
}
|
|
47880
|
+
};
|
|
47732
47881
|
const applyBaseRunDefaults = (run, defaults, uiDisplayFallbackFont, fallbackSize) => {
|
|
47733
47882
|
if (!run) return;
|
|
47734
47883
|
if (defaults.fontFamily && run.fontFamily === uiDisplayFallbackFont) {
|
|
@@ -47878,6 +48027,8 @@ function paragraphToFlowBlocks$1(para, nextBlockId, positions, defaultFont, defa
|
|
|
47878
48027
|
emptyRun.pmStart = paraPos.start + 1;
|
|
47879
48028
|
emptyRun.pmEnd = paraPos.start + 1;
|
|
47880
48029
|
}
|
|
48030
|
+
applyBaseRunDefaults(emptyRun, baseRunDefaults, defaultFont, defaultSize);
|
|
48031
|
+
applyParagraphMarkRunProps(emptyRun, paragraphProps, converterContext);
|
|
47881
48032
|
let emptyParagraphAttrs = cloneParagraphAttrs(paragraphAttrs);
|
|
47882
48033
|
if (isSectPrMarker) {
|
|
47883
48034
|
if (emptyParagraphAttrs) {
|
|
@@ -51265,7 +51416,6 @@ function measureText(text, font, ctx2, _fontFamily, _letterSpacing) {
|
|
|
51265
51416
|
const paintedWidth = (metrics.actualBoundingBoxLeft || 0) + (metrics.actualBoundingBoxRight || 0);
|
|
51266
51417
|
return Math.max(advanceWidth, paintedWidth);
|
|
51267
51418
|
}
|
|
51268
|
-
const MIN_SINGLE_LINE_PX = 12 * 96 / 72;
|
|
51269
51419
|
const WORD_SINGLE_LINE_SPACING_MULTIPLIER = 1.15;
|
|
51270
51420
|
function calculateTypographyMetrics(fontSize2, spacing, fontInfo) {
|
|
51271
51421
|
let ascent;
|
|
@@ -51279,7 +51429,27 @@ function calculateTypographyMetrics(fontSize2, spacing, fontInfo) {
|
|
|
51279
51429
|
ascent = roundValue(fontSize2 * 0.8);
|
|
51280
51430
|
descent = roundValue(fontSize2 * 0.2);
|
|
51281
51431
|
}
|
|
51282
|
-
const baseLineHeight = Math.max(fontSize2 * WORD_SINGLE_LINE_SPACING_MULTIPLIER, ascent + descent
|
|
51432
|
+
const baseLineHeight = Math.max(fontSize2 * WORD_SINGLE_LINE_SPACING_MULTIPLIER, ascent + descent);
|
|
51433
|
+
const lineHeight2 = roundValue(resolveLineHeight(spacing, baseLineHeight));
|
|
51434
|
+
return {
|
|
51435
|
+
ascent,
|
|
51436
|
+
descent,
|
|
51437
|
+
lineHeight: lineHeight2
|
|
51438
|
+
};
|
|
51439
|
+
}
|
|
51440
|
+
function calculateEmptyParagraphMetrics(fontSize2, spacing, fontInfo) {
|
|
51441
|
+
let ascent;
|
|
51442
|
+
let descent;
|
|
51443
|
+
if (fontInfo) {
|
|
51444
|
+
const ctx2 = getCanvasContext();
|
|
51445
|
+
const metrics = getFontMetrics(ctx2, fontInfo);
|
|
51446
|
+
ascent = roundValue(metrics.ascent);
|
|
51447
|
+
descent = roundValue(metrics.descent);
|
|
51448
|
+
} else {
|
|
51449
|
+
ascent = roundValue(fontSize2 * 0.8);
|
|
51450
|
+
descent = roundValue(fontSize2 * 0.2);
|
|
51451
|
+
}
|
|
51452
|
+
const baseLineHeight = Math.max(fontSize2, ascent + descent);
|
|
51283
51453
|
const lineHeight2 = roundValue(resolveLineHeight(spacing, baseLineHeight));
|
|
51284
51454
|
return {
|
|
51285
51455
|
ascent,
|
|
@@ -51310,6 +51480,10 @@ function isImageRun(run) {
|
|
|
51310
51480
|
function isLineBreakRun(run) {
|
|
51311
51481
|
return run.kind === "lineBreak";
|
|
51312
51482
|
}
|
|
51483
|
+
const isEmptyTextRun = (run) => {
|
|
51484
|
+
if (run.kind && run.kind !== "text") return false;
|
|
51485
|
+
return typeof run.text === "string" && run.text.length === 0;
|
|
51486
|
+
};
|
|
51313
51487
|
function isFieldAnnotationRun(run) {
|
|
51314
51488
|
return run.kind === "fieldAnnotation";
|
|
51315
51489
|
}
|
|
@@ -51479,8 +51653,28 @@ async function measureParagraphBlock(block, maxWidth) {
|
|
|
51479
51653
|
dropCapDescriptor.measuredHeight = dropCapMeasured.height;
|
|
51480
51654
|
}
|
|
51481
51655
|
}
|
|
51656
|
+
const emptyParagraphRun = block.runs.length === 1 && isEmptyTextRun(block.runs[0]) ? block.runs[0] : null;
|
|
51657
|
+
if (emptyParagraphRun) {
|
|
51658
|
+
const fontSize2 = emptyParagraphRun.fontSize ?? 12;
|
|
51659
|
+
const metrics = calculateEmptyParagraphMetrics(fontSize2, spacing, getFontInfoFromRun(emptyParagraphRun));
|
|
51660
|
+
const emptyLine = {
|
|
51661
|
+
fromRun: 0,
|
|
51662
|
+
fromChar: 0,
|
|
51663
|
+
toRun: 0,
|
|
51664
|
+
toChar: 0,
|
|
51665
|
+
width: 0,
|
|
51666
|
+
...metrics
|
|
51667
|
+
};
|
|
51668
|
+
addBarTabsToLine(emptyLine);
|
|
51669
|
+
lines.push(emptyLine);
|
|
51670
|
+
return {
|
|
51671
|
+
kind: "paragraph",
|
|
51672
|
+
lines,
|
|
51673
|
+
totalHeight: metrics.lineHeight
|
|
51674
|
+
};
|
|
51675
|
+
}
|
|
51482
51676
|
if (block.runs.length === 0) {
|
|
51483
|
-
const metrics =
|
|
51677
|
+
const metrics = calculateEmptyParagraphMetrics(12, spacing);
|
|
51484
51678
|
const emptyLine = {
|
|
51485
51679
|
fromRun: 0,
|
|
51486
51680
|
fromChar: 0,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
const index = require("./index-
|
|
3
|
-
require("./SuperConverter-
|
|
2
|
+
const index = require("./index-ChXg2ff-.cjs");
|
|
3
|
+
require("./SuperConverter-iUnNfL5l.cjs");
|
|
4
4
|
const blankDocx = require("./blank-docx-DfW3Eeh2.cjs");
|
|
5
5
|
const eventemitter3 = require("./eventemitter3-BQuRcMPI.cjs");
|
|
6
6
|
const provider = require("@hocuspocus/provider");
|
|
@@ -7530,7 +7530,7 @@ const _sfc_main = {
|
|
|
7530
7530
|
__name: "SuperDoc",
|
|
7531
7531
|
emits: ["selection-update"],
|
|
7532
7532
|
setup(__props, { emit: __emit }) {
|
|
7533
|
-
const PdfViewer = vue.defineAsyncComponent(() => Promise.resolve().then(() => require("./PdfViewer-
|
|
7533
|
+
const PdfViewer = vue.defineAsyncComponent(() => Promise.resolve().then(() => require("./PdfViewer-CWbiDeiU.cjs")));
|
|
7534
7534
|
const superdocStore = useSuperdocStore();
|
|
7535
7535
|
const commentsStore = useCommentsStore();
|
|
7536
7536
|
const {
|
|
@@ -8484,7 +8484,7 @@ class SuperDoc extends eventemitter3.EventEmitter {
|
|
|
8484
8484
|
this.config.colors = shuffleArray(this.config.colors);
|
|
8485
8485
|
this.userColorMap = /* @__PURE__ */ new Map();
|
|
8486
8486
|
this.colorIndex = 0;
|
|
8487
|
-
this.version = "1.7.0-next.
|
|
8487
|
+
this.version = "1.7.0-next.6";
|
|
8488
8488
|
this.#log("🦋 [superdoc] Using SuperDoc version:", this.version);
|
|
8489
8489
|
this.superdocId = config.superdocId || uuid.v4();
|
|
8490
8490
|
this.colors = this.config.colors;
|