superdoc 1.7.0-next.1 → 1.7.0-next.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/chunks/{PdfViewer-DbJKy-lH.es.js → PdfViewer-C6ajJ19Y.es.js} +2 -2
- package/dist/chunks/{PdfViewer-Dedi7HU4.cjs → PdfViewer-DIeShTrt.cjs} +2 -2
- package/dist/chunks/{SuperConverter-B6oyahEM.es.js → SuperConverter-C8ixYsv3.es.js} +1 -1
- package/dist/chunks/{SuperConverter-Cbs9RvhK.cjs → SuperConverter-Drw4h160.cjs} +1 -1
- package/dist/chunks/{index-a9MOSI2k.es.js → index-BDIUQfBQ.es.js} +71 -39
- package/dist/chunks/{index-B8H4ESFA.es.js → index-BwebFuPq.es.js} +4 -4
- package/dist/chunks/{index-DmmIwt3m.cjs → index-CHmtRY3d.cjs} +71 -39
- package/dist/chunks/{index-BVYbse3Y.cjs → index-Cnte-e9W.cjs} +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 +72 -40
- package/dist/superdoc.umd.js.map +1 -1
- package/package.json +1 -1
package/dist/superdoc.umd.js
CHANGED
|
@@ -38197,7 +38197,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
|
|
|
38197
38197
|
static getStoredSuperdocVersion(docx) {
|
|
38198
38198
|
return SuperConverter.getStoredCustomProperty(docx, "SuperdocVersion");
|
|
38199
38199
|
}
|
|
38200
|
-
static setStoredSuperdocVersion(docx = this.convertedXml, version2 = "1.7.0-next.
|
|
38200
|
+
static setStoredSuperdocVersion(docx = this.convertedXml, version2 = "1.7.0-next.3") {
|
|
38201
38201
|
return SuperConverter.setStoredCustomProperty(docx, "SuperdocVersion", version2, false);
|
|
38202
38202
|
}
|
|
38203
38203
|
/**
|
|
@@ -64367,7 +64367,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
|
|
|
64367
64367
|
return false;
|
|
64368
64368
|
}
|
|
64369
64369
|
};
|
|
64370
|
-
const summaryVersion = "1.7.0-next.
|
|
64370
|
+
const summaryVersion = "1.7.0-next.3";
|
|
64371
64371
|
const nodeKeys = ["group", "content", "marks", "inline", "atom", "defining", "code", "tableRole", "summary"];
|
|
64372
64372
|
const markKeys = ["group", "inclusive", "excludes", "spanning", "code"];
|
|
64373
64373
|
function mapAttributes(attrs) {
|
|
@@ -67035,7 +67035,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
|
|
|
67035
67035
|
* Process collaboration migrations
|
|
67036
67036
|
*/
|
|
67037
67037
|
processCollaborationMigrations() {
|
|
67038
|
-
console.debug("[checkVersionMigrations] Current editor version", "1.7.0-next.
|
|
67038
|
+
console.debug("[checkVersionMigrations] Current editor version", "1.7.0-next.3");
|
|
67039
67039
|
if (!this.options.ydoc) return;
|
|
67040
67040
|
const metaMap = this.options.ydoc.getMap("meta");
|
|
67041
67041
|
let docVersion = metaMap.get("version");
|
|
@@ -69127,18 +69127,22 @@ Please report this to https://github.com/markedjs/marked.`, e) {
|
|
|
69127
69127
|
function computeTabStops$1(context) {
|
|
69128
69128
|
const { explicitStops, defaultTabInterval, paragraphIndent } = context;
|
|
69129
69129
|
const leftIndent = paragraphIndent.left ?? 0;
|
|
69130
|
+
const hanging = paragraphIndent.hanging ?? 0;
|
|
69131
|
+
const effectiveMinIndent = Math.max(0, leftIndent - hanging);
|
|
69130
69132
|
const clearPositions = explicitStops.filter((stop) => stop.val === "clear").map((stop) => stop.pos);
|
|
69131
|
-
const
|
|
69132
|
-
const maxExplicit =
|
|
69133
|
-
const hasExplicit =
|
|
69134
|
-
const
|
|
69135
|
-
|
|
69136
|
-
|
|
69133
|
+
const filteredExplicitStops = explicitStops.filter((stop) => stop.val !== "clear").filter((stop) => stop.pos >= effectiveMinIndent);
|
|
69134
|
+
const maxExplicit = filteredExplicitStops.reduce((max2, stop) => Math.max(max2, stop.pos), 0);
|
|
69135
|
+
const hasExplicit = filteredExplicitStops.length > 0;
|
|
69136
|
+
const stops = [...filteredExplicitStops];
|
|
69137
|
+
const defaultStart = hasExplicit ? Math.max(maxExplicit, leftIndent) : 0;
|
|
69138
|
+
let pos = defaultStart;
|
|
69139
|
+
const targetLimit = Math.max(defaultStart, leftIndent) + 14400;
|
|
69137
69140
|
while (pos < targetLimit) {
|
|
69138
69141
|
pos += defaultTabInterval;
|
|
69139
|
-
const hasExplicitStop =
|
|
69142
|
+
const hasExplicitStop = filteredExplicitStops.some((s2) => Math.abs(s2.pos - pos) < 20);
|
|
69140
69143
|
const hasClearStop = clearPositions.some((clearPos) => Math.abs(clearPos - pos) < 20);
|
|
69141
|
-
|
|
69144
|
+
const isValidDefault = pos >= leftIndent;
|
|
69145
|
+
if (!hasExplicitStop && !hasClearStop && isValidDefault) {
|
|
69142
69146
|
stops.push({
|
|
69143
69147
|
val: "start",
|
|
69144
69148
|
pos,
|
|
@@ -69146,7 +69150,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
|
|
|
69146
69150
|
});
|
|
69147
69151
|
}
|
|
69148
69152
|
}
|
|
69149
|
-
return stops.
|
|
69153
|
+
return stops.sort((a2, b2) => a2.pos - b2.pos);
|
|
69150
69154
|
}
|
|
69151
69155
|
function layoutWithTabs(runs2, stops, lineWidth, options = {}) {
|
|
69152
69156
|
const result = [];
|
|
@@ -73202,6 +73206,50 @@ ${o}
|
|
|
73202
73206
|
lineContainer.appendChild(lineEl);
|
|
73203
73207
|
return lineContainer;
|
|
73204
73208
|
}
|
|
73209
|
+
function applyTableCellLineIndentation(params2) {
|
|
73210
|
+
const {
|
|
73211
|
+
lineEl,
|
|
73212
|
+
line,
|
|
73213
|
+
indent: indent2,
|
|
73214
|
+
indentLeftPx,
|
|
73215
|
+
hasListMarkerLayout,
|
|
73216
|
+
lineIndex,
|
|
73217
|
+
localStartLine,
|
|
73218
|
+
suppressFirstLineIndent
|
|
73219
|
+
} = params2;
|
|
73220
|
+
const paraIndentLeft = indent2?.left ?? 0;
|
|
73221
|
+
const paraIndentRight = indent2?.right ?? 0;
|
|
73222
|
+
const firstLineOffset = suppressFirstLineIndent ? 0 : (indent2?.firstLine ?? 0) - (indent2?.hanging ?? 0);
|
|
73223
|
+
const isFirstLine = lineIndex === 0 && localStartLine === 0;
|
|
73224
|
+
const hasExplicitSegmentPositioning = line.segments?.some((seg) => seg.x !== void 0) ?? false;
|
|
73225
|
+
if (hasListMarkerLayout && indentLeftPx) {
|
|
73226
|
+
if (!hasExplicitSegmentPositioning) {
|
|
73227
|
+
lineEl.style.paddingLeft = `${indentLeftPx}px`;
|
|
73228
|
+
}
|
|
73229
|
+
} else {
|
|
73230
|
+
if (hasExplicitSegmentPositioning) {
|
|
73231
|
+
if (isFirstLine && firstLineOffset !== 0) {
|
|
73232
|
+
const effectiveLeftIndent = paraIndentLeft < 0 ? 0 : paraIndentLeft;
|
|
73233
|
+
const adjustedPadding = effectiveLeftIndent + firstLineOffset;
|
|
73234
|
+
if (adjustedPadding > 0) {
|
|
73235
|
+
lineEl.style.paddingLeft = `${adjustedPadding}px`;
|
|
73236
|
+
}
|
|
73237
|
+
}
|
|
73238
|
+
} else if (paraIndentLeft && paraIndentLeft > 0) {
|
|
73239
|
+
lineEl.style.paddingLeft = `${paraIndentLeft}px`;
|
|
73240
|
+
} else if (!isFirstLine && indent2?.hanging && indent2.hanging > 0 && (paraIndentLeft == null || paraIndentLeft >= 0)) {
|
|
73241
|
+
lineEl.style.paddingLeft = `${indent2.hanging}px`;
|
|
73242
|
+
}
|
|
73243
|
+
}
|
|
73244
|
+
if (paraIndentRight && paraIndentRight > 0) {
|
|
73245
|
+
lineEl.style.paddingRight = `${paraIndentRight}px`;
|
|
73246
|
+
}
|
|
73247
|
+
if (isFirstLine && firstLineOffset && !hasExplicitSegmentPositioning) {
|
|
73248
|
+
lineEl.style.textIndent = `${firstLineOffset}px`;
|
|
73249
|
+
} else if (firstLineOffset && hasExplicitSegmentPositioning) {
|
|
73250
|
+
lineEl.style.textIndent = "0px";
|
|
73251
|
+
}
|
|
73252
|
+
}
|
|
73205
73253
|
const applyInlineStyles = (el, styles) => {
|
|
73206
73254
|
Object.entries(styles).forEach(([key2, value]) => {
|
|
73207
73255
|
if (value != null && value !== "" && key2 in el.style) {
|
|
@@ -73488,6 +73536,7 @@ ${o}
|
|
|
73488
73536
|
const markerLayout = wordLayout?.marker;
|
|
73489
73537
|
const markerMeasure = paragraphMeasure.marker;
|
|
73490
73538
|
const indentLeftPx = markerMeasure?.indentLeft ?? wordLayout?.indentLeftPx ?? (block.attrs?.indent && typeof block.attrs.indent.left === "number" ? block.attrs.indent.left : 0);
|
|
73539
|
+
const suppressFirstLineIndent = block.attrs?.suppressFirstLineIndent === true;
|
|
73491
73540
|
const blockStartGlobal = cumulativeLineCount;
|
|
73492
73541
|
const blockEndGlobal = cumulativeLineCount + blockLineCount;
|
|
73493
73542
|
if (blockEndGlobal <= globalFromLine) {
|
|
@@ -73538,33 +73587,16 @@ ${o}
|
|
|
73538
73587
|
});
|
|
73539
73588
|
paraWrapper.appendChild(lineContainer);
|
|
73540
73589
|
} else {
|
|
73541
|
-
|
|
73542
|
-
lineEl
|
|
73543
|
-
|
|
73544
|
-
|
|
73545
|
-
|
|
73546
|
-
|
|
73547
|
-
|
|
73548
|
-
|
|
73549
|
-
|
|
73550
|
-
|
|
73551
|
-
if (isFirstLine) {
|
|
73552
|
-
if (leftIndent > 0) {
|
|
73553
|
-
lineEl.style.paddingLeft = `${leftIndent}px`;
|
|
73554
|
-
}
|
|
73555
|
-
if (firstLineOffset !== 0) {
|
|
73556
|
-
lineEl.style.textIndent = `${firstLineOffset}px`;
|
|
73557
|
-
}
|
|
73558
|
-
} else {
|
|
73559
|
-
if (leftIndent > 0) {
|
|
73560
|
-
lineEl.style.paddingLeft = `${leftIndent}px`;
|
|
73561
|
-
}
|
|
73562
|
-
}
|
|
73563
|
-
if (typeof indent2.right === "number" && indent2.right > 0) {
|
|
73564
|
-
lineEl.style.paddingRight = `${indent2.right}px`;
|
|
73565
|
-
}
|
|
73566
|
-
}
|
|
73567
|
-
}
|
|
73590
|
+
applyTableCellLineIndentation({
|
|
73591
|
+
lineEl,
|
|
73592
|
+
line,
|
|
73593
|
+
indent: block.attrs?.indent,
|
|
73594
|
+
indentLeftPx,
|
|
73595
|
+
hasListMarkerLayout: Boolean(markerLayout),
|
|
73596
|
+
lineIndex: lineIdx,
|
|
73597
|
+
localStartLine,
|
|
73598
|
+
suppressFirstLineIndent
|
|
73599
|
+
});
|
|
73568
73600
|
paraWrapper.appendChild(lineEl);
|
|
73569
73601
|
}
|
|
73570
73602
|
renderedHeight += line.lineHeight;
|
|
@@ -150686,7 +150718,7 @@ ${reason}`);
|
|
|
150686
150718
|
this.config.colors = shuffleArray(this.config.colors);
|
|
150687
150719
|
this.userColorMap = /* @__PURE__ */ new Map();
|
|
150688
150720
|
this.colorIndex = 0;
|
|
150689
|
-
this.version = "1.7.0-next.
|
|
150721
|
+
this.version = "1.7.0-next.3";
|
|
150690
150722
|
this.#log("🦋 [superdoc] Using SuperDoc version:", this.version);
|
|
150691
150723
|
this.superdocId = config2.superdocId || v4();
|
|
150692
150724
|
this.colors = this.config.colors;
|