superdoc 1.13.0-next.5 → 1.13.0-next.7
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-BEEUR7m9.cjs → PdfViewer-CV1clrXP.cjs} +2 -2
- package/dist/chunks/{PdfViewer-D1AS8oID.es.js → PdfViewer-D-a4sC8J.es.js} +2 -2
- package/dist/chunks/{SuperConverter-B_FOG0ep.es.js → SuperConverter-C2zqtfRH.es.js} +155 -1
- package/dist/chunks/{SuperConverter-Dej-uQAf.cjs → SuperConverter-CvaYccDY.cjs} +155 -1
- package/dist/chunks/{index--GBAgUsL.cjs → index-BJfhUSPD.cjs} +4 -4
- package/dist/chunks/{index-BaPhmspb.cjs → index-CzrQ0Wc0.cjs} +4 -4
- package/dist/chunks/{index-JNZ7ajoY.es.js → index-GEWcivnu.es.js} +4 -4
- package/dist/chunks/{index-Dluknn3H.es.js → index-nqSa_so2.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/core/super-converter/v2/importer/docxImporter.d.ts +19 -0
- package/dist/super-editor/core/super-converter/v2/importer/docxImporter.d.ts.map +1 -1
- package/dist/super-editor/src/core/super-converter/v2/importer/docxImporter.d.ts +19 -0
- package/dist/super-editor/src/core/super-converter/v2/importer/docxImporter.d.ts.map +1 -1
- package/dist/super-editor/tsconfig.types.tsbuildinfo +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 +159 -5
- package/dist/superdoc.umd.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
3
|
const vue = require("./vue-BkoOkkmT.cjs");
|
|
4
|
-
const superdoc = require("./index
|
|
5
|
-
const index = require("./index-
|
|
4
|
+
const superdoc = require("./index-BJfhUSPD.cjs");
|
|
5
|
+
const index = require("./index-CzrQ0Wc0.cjs");
|
|
6
6
|
function self(vars) {
|
|
7
7
|
const {
|
|
8
8
|
opacityDisabled,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { d as defineComponent, h, T as Transition, p as process$1, w as watchEffect, b as computed, r as ref, e as onMounted, f as onUnmounted, o as openBlock, c as createElementBlock, a as createBaseVNode, g as createVNode, u as unref, i as createCommentVNode } from "./vue-DiPLN5sT.es.js";
|
|
2
|
-
import { N as NBaseLoading, u as useSuperdocStore, s as storeToRefs, a as useSelection } from "./index-
|
|
3
|
-
import { o as derived, p as c, q as cB, r as fadeInTransition, s as cM, w as warnOnce, u as useConfig, t as useTheme, v as pxfy, x as createKey, y as useThemeClass, z as useCompitable, B as _export_sfc } from "./index-
|
|
2
|
+
import { N as NBaseLoading, u as useSuperdocStore, s as storeToRefs, a as useSelection } from "./index-nqSa_so2.es.js";
|
|
3
|
+
import { o as derived, p as c, q as cB, r as fadeInTransition, s as cM, w as warnOnce, u as useConfig, t as useTheme, v as pxfy, x as createKey, y as useThemeClass, z as useCompitable, B as _export_sfc } from "./index-GEWcivnu.es.js";
|
|
4
4
|
function self(vars) {
|
|
5
5
|
const {
|
|
6
6
|
opacityDisabled,
|
|
@@ -30887,6 +30887,7 @@ const createDocumentJson = (docx, converter, editor) => {
|
|
|
30887
30887
|
path: []
|
|
30888
30888
|
});
|
|
30889
30889
|
parsedContent = filterOutRootInlineNodes(parsedContent);
|
|
30890
|
+
parsedContent = normalizeTableBookmarksInContent(parsedContent, editor);
|
|
30890
30891
|
collapseWhitespaceNextToInlinePassthrough(parsedContent);
|
|
30891
30892
|
const result = {
|
|
30892
30893
|
type: "doc",
|
|
@@ -31404,6 +31405,159 @@ function filterOutRootInlineNodes(content = []) {
|
|
|
31404
31405
|
});
|
|
31405
31406
|
return result;
|
|
31406
31407
|
}
|
|
31408
|
+
function normalizeTableBookmarksInContent(content = [], editor) {
|
|
31409
|
+
if (!Array.isArray(content) || content.length === 0) return content;
|
|
31410
|
+
return content.map((node) => normalizeTableBookmarksInNode(node, editor));
|
|
31411
|
+
}
|
|
31412
|
+
function normalizeTableBookmarksInNode(node, editor) {
|
|
31413
|
+
if (!node || typeof node !== "object") return node;
|
|
31414
|
+
if (node.type === "table") {
|
|
31415
|
+
node = normalizeTableBookmarksInTable(node, editor);
|
|
31416
|
+
}
|
|
31417
|
+
if (Array.isArray(node.content)) {
|
|
31418
|
+
node = { ...node, content: normalizeTableBookmarksInContent(node.content, editor) };
|
|
31419
|
+
}
|
|
31420
|
+
return node;
|
|
31421
|
+
}
|
|
31422
|
+
function parseColIndex(val) {
|
|
31423
|
+
if (val == null || val === "") return null;
|
|
31424
|
+
const n = parseInt(String(val), 10);
|
|
31425
|
+
return Number.isNaN(n) ? null : Math.max(0, n);
|
|
31426
|
+
}
|
|
31427
|
+
function getCellIndexForBookmark(bookmarkNode, position, rowCellCount) {
|
|
31428
|
+
if (!rowCellCount) return 0;
|
|
31429
|
+
if (bookmarkNode?.type === "bookmarkEnd") {
|
|
31430
|
+
return position === "start" ? 0 : rowCellCount - 1;
|
|
31431
|
+
}
|
|
31432
|
+
const attrs = bookmarkNode?.attrs ?? {};
|
|
31433
|
+
const col = parseColIndex(position === "start" ? attrs.colFirst : attrs.colLast);
|
|
31434
|
+
if (col == null) return position === "start" ? 0 : rowCellCount - 1;
|
|
31435
|
+
return Math.min(col, rowCellCount - 1);
|
|
31436
|
+
}
|
|
31437
|
+
function addBookmarkToRowCellInlines(rowCellInlines, rowIndex, position, bookmarkNode, rowCellCount) {
|
|
31438
|
+
const cellIndex = getCellIndexForBookmark(bookmarkNode, position, rowCellCount);
|
|
31439
|
+
const bucket = rowCellInlines[rowIndex][position];
|
|
31440
|
+
if (!bucket[cellIndex]) bucket[cellIndex] = [];
|
|
31441
|
+
bucket[cellIndex].push(bookmarkNode);
|
|
31442
|
+
}
|
|
31443
|
+
function applyBookmarksToRow(rowNode, { start: startByCell, end: endByCell }, editor) {
|
|
31444
|
+
const cellIndices = [
|
|
31445
|
+
.../* @__PURE__ */ new Set([...Object.keys(startByCell).map(Number), ...Object.keys(endByCell).map(Number)])
|
|
31446
|
+
].sort((a, b2) => a - b2);
|
|
31447
|
+
let row = rowNode;
|
|
31448
|
+
for (const cellIndex of cellIndices) {
|
|
31449
|
+
const startNodes = startByCell[cellIndex];
|
|
31450
|
+
const endNodes = endByCell[cellIndex];
|
|
31451
|
+
if (startNodes?.length) row = insertInlineIntoRow(row, startNodes, editor, "start", cellIndex);
|
|
31452
|
+
if (endNodes?.length) row = insertInlineIntoRow(row, endNodes, editor, "end", cellIndex);
|
|
31453
|
+
}
|
|
31454
|
+
return row;
|
|
31455
|
+
}
|
|
31456
|
+
function normalizeTableBookmarksInTable(tableNode, editor) {
|
|
31457
|
+
if (!tableNode || tableNode.type !== "table" || !Array.isArray(tableNode.content)) return tableNode;
|
|
31458
|
+
const rows = tableNode.content.filter((child) => child?.type === "tableRow");
|
|
31459
|
+
if (!rows.length) return tableNode;
|
|
31460
|
+
const rowCellInlines = rows.map(() => ({
|
|
31461
|
+
start: (
|
|
31462
|
+
/** @type {Record<number, unknown[]>} */
|
|
31463
|
+
{}
|
|
31464
|
+
),
|
|
31465
|
+
end: (
|
|
31466
|
+
/** @type {Record<number, unknown[]>} */
|
|
31467
|
+
{}
|
|
31468
|
+
)
|
|
31469
|
+
}));
|
|
31470
|
+
let rowCursor = 0;
|
|
31471
|
+
for (const child of tableNode.content) {
|
|
31472
|
+
if (child?.type === "tableRow") {
|
|
31473
|
+
rowCursor += 1;
|
|
31474
|
+
continue;
|
|
31475
|
+
}
|
|
31476
|
+
if (isBookmarkNode(child)) {
|
|
31477
|
+
const prevRowIndex = rowCursor > 0 ? rowCursor - 1 : null;
|
|
31478
|
+
const nextRowIndex = rowCursor < rows.length ? rowCursor : null;
|
|
31479
|
+
const row = (nextRowIndex ?? prevRowIndex) != null ? rows[nextRowIndex ?? prevRowIndex] : null;
|
|
31480
|
+
const rowCellCount = row?.content?.length ?? 0;
|
|
31481
|
+
if (child.type === "bookmarkStart") {
|
|
31482
|
+
if (nextRowIndex != null)
|
|
31483
|
+
addBookmarkToRowCellInlines(rowCellInlines, nextRowIndex, "start", child, rowCellCount);
|
|
31484
|
+
else if (prevRowIndex != null)
|
|
31485
|
+
addBookmarkToRowCellInlines(rowCellInlines, prevRowIndex, "end", child, rowCellCount);
|
|
31486
|
+
} else {
|
|
31487
|
+
if (prevRowIndex != null) addBookmarkToRowCellInlines(rowCellInlines, prevRowIndex, "end", child, rowCellCount);
|
|
31488
|
+
else if (nextRowIndex != null)
|
|
31489
|
+
addBookmarkToRowCellInlines(rowCellInlines, nextRowIndex, "start", child, rowCellCount);
|
|
31490
|
+
}
|
|
31491
|
+
}
|
|
31492
|
+
}
|
|
31493
|
+
const updatedRows = rows.map((row, index2) => applyBookmarksToRow(row, rowCellInlines[index2], editor));
|
|
31494
|
+
rowCursor = 0;
|
|
31495
|
+
const content = [];
|
|
31496
|
+
for (const child of tableNode.content) {
|
|
31497
|
+
if (child?.type === "tableRow") {
|
|
31498
|
+
content.push(updatedRows[rowCursor] ?? child);
|
|
31499
|
+
rowCursor += 1;
|
|
31500
|
+
} else if (!isBookmarkNode(child)) {
|
|
31501
|
+
content.push(child);
|
|
31502
|
+
}
|
|
31503
|
+
}
|
|
31504
|
+
return {
|
|
31505
|
+
...tableNode,
|
|
31506
|
+
content
|
|
31507
|
+
};
|
|
31508
|
+
}
|
|
31509
|
+
function insertInlineIntoRow(rowNode, inlineNodes, editor, position, cellIndex) {
|
|
31510
|
+
if (!rowNode || !inlineNodes?.length) return rowNode;
|
|
31511
|
+
if (!Array.isArray(rowNode.content) || rowNode.content.length === 0) {
|
|
31512
|
+
const paragraph = { type: "paragraph", content: inlineNodes };
|
|
31513
|
+
const newCell = { type: "tableCell", content: [paragraph], attrs: {}, marks: [] };
|
|
31514
|
+
return { ...rowNode, content: [newCell] };
|
|
31515
|
+
}
|
|
31516
|
+
const lastCellIndex = rowNode.content.length - 1;
|
|
31517
|
+
const targetIndex = cellIndex != null ? Math.min(Math.max(0, cellIndex), lastCellIndex) : position === "end" ? lastCellIndex : 0;
|
|
31518
|
+
const targetCell = rowNode.content[targetIndex];
|
|
31519
|
+
const updatedCell = insertInlineIntoCell(targetCell, inlineNodes, editor, position);
|
|
31520
|
+
if (updatedCell === targetCell) return rowNode;
|
|
31521
|
+
const nextContent = rowNode.content.slice();
|
|
31522
|
+
nextContent[targetIndex] = updatedCell;
|
|
31523
|
+
return { ...rowNode, content: nextContent };
|
|
31524
|
+
}
|
|
31525
|
+
function findTextblockIndex(content, editor, fromEnd) {
|
|
31526
|
+
const start = fromEnd ? content.length - 1 : 0;
|
|
31527
|
+
const end = fromEnd ? -1 : content.length;
|
|
31528
|
+
const step = fromEnd ? -1 : 1;
|
|
31529
|
+
for (let i = start; fromEnd ? i > end : i < end; i += step) {
|
|
31530
|
+
if (isTextblockNode(content[i], editor)) return i;
|
|
31531
|
+
}
|
|
31532
|
+
return -1;
|
|
31533
|
+
}
|
|
31534
|
+
function insertInlineIntoCell(cellNode, inlineNodes, editor, position) {
|
|
31535
|
+
if (!cellNode || !inlineNodes?.length) return cellNode;
|
|
31536
|
+
const content = Array.isArray(cellNode.content) ? cellNode.content.slice() : [];
|
|
31537
|
+
const targetIndex = findTextblockIndex(content, editor, position === "end");
|
|
31538
|
+
if (targetIndex === -1) {
|
|
31539
|
+
const paragraph = { type: "paragraph", content: inlineNodes };
|
|
31540
|
+
if (position === "end") content.push(paragraph);
|
|
31541
|
+
else content.unshift(paragraph);
|
|
31542
|
+
return { ...cellNode, content };
|
|
31543
|
+
}
|
|
31544
|
+
const targetBlock = content[targetIndex] || { type: "paragraph", content: [] };
|
|
31545
|
+
const blockContent = Array.isArray(targetBlock.content) ? targetBlock.content.slice() : [];
|
|
31546
|
+
const nextBlockContent = position === "end" ? blockContent.concat(inlineNodes) : inlineNodes.concat(blockContent);
|
|
31547
|
+
content[targetIndex] = { ...targetBlock, content: nextBlockContent };
|
|
31548
|
+
return { ...cellNode, content };
|
|
31549
|
+
}
|
|
31550
|
+
function isBookmarkNode(node) {
|
|
31551
|
+
const typeName = node?.type;
|
|
31552
|
+
return typeName === "bookmarkStart" || typeName === "bookmarkEnd";
|
|
31553
|
+
}
|
|
31554
|
+
function isTextblockNode(node, editor) {
|
|
31555
|
+
const typeName = node?.type;
|
|
31556
|
+
if (!typeName) return false;
|
|
31557
|
+
const nodeType = editor?.schema?.nodes?.[typeName];
|
|
31558
|
+
if (nodeType && typeof nodeType.isTextblock === "boolean") return nodeType.isTextblock;
|
|
31559
|
+
return typeName === "paragraph";
|
|
31560
|
+
}
|
|
31407
31561
|
const buildOriginalXml = (type, attrs, preservableTags) => {
|
|
31408
31562
|
const attrConfigsByType = {
|
|
31409
31563
|
bookmarkStart: bookmarkStartAttrConfigs,
|
|
@@ -33817,7 +33971,7 @@ class SuperConverter {
|
|
|
33817
33971
|
static getStoredSuperdocVersion(docx) {
|
|
33818
33972
|
return SuperConverter.getStoredCustomProperty(docx, "SuperdocVersion");
|
|
33819
33973
|
}
|
|
33820
|
-
static setStoredSuperdocVersion(docx = this.convertedXml, version = "1.13.0-next.
|
|
33974
|
+
static setStoredSuperdocVersion(docx = this.convertedXml, version = "1.13.0-next.7") {
|
|
33821
33975
|
return SuperConverter.setStoredCustomProperty(docx, "SuperdocVersion", version, false);
|
|
33822
33976
|
}
|
|
33823
33977
|
/**
|
|
@@ -30888,6 +30888,7 @@ const createDocumentJson = (docx, converter, editor) => {
|
|
|
30888
30888
|
path: []
|
|
30889
30889
|
});
|
|
30890
30890
|
parsedContent = filterOutRootInlineNodes(parsedContent);
|
|
30891
|
+
parsedContent = normalizeTableBookmarksInContent(parsedContent, editor);
|
|
30891
30892
|
collapseWhitespaceNextToInlinePassthrough(parsedContent);
|
|
30892
30893
|
const result = {
|
|
30893
30894
|
type: "doc",
|
|
@@ -31405,6 +31406,159 @@ function filterOutRootInlineNodes(content = []) {
|
|
|
31405
31406
|
});
|
|
31406
31407
|
return result;
|
|
31407
31408
|
}
|
|
31409
|
+
function normalizeTableBookmarksInContent(content = [], editor) {
|
|
31410
|
+
if (!Array.isArray(content) || content.length === 0) return content;
|
|
31411
|
+
return content.map((node) => normalizeTableBookmarksInNode(node, editor));
|
|
31412
|
+
}
|
|
31413
|
+
function normalizeTableBookmarksInNode(node, editor) {
|
|
31414
|
+
if (!node || typeof node !== "object") return node;
|
|
31415
|
+
if (node.type === "table") {
|
|
31416
|
+
node = normalizeTableBookmarksInTable(node, editor);
|
|
31417
|
+
}
|
|
31418
|
+
if (Array.isArray(node.content)) {
|
|
31419
|
+
node = { ...node, content: normalizeTableBookmarksInContent(node.content, editor) };
|
|
31420
|
+
}
|
|
31421
|
+
return node;
|
|
31422
|
+
}
|
|
31423
|
+
function parseColIndex(val) {
|
|
31424
|
+
if (val == null || val === "") return null;
|
|
31425
|
+
const n = parseInt(String(val), 10);
|
|
31426
|
+
return Number.isNaN(n) ? null : Math.max(0, n);
|
|
31427
|
+
}
|
|
31428
|
+
function getCellIndexForBookmark(bookmarkNode, position, rowCellCount) {
|
|
31429
|
+
if (!rowCellCount) return 0;
|
|
31430
|
+
if (bookmarkNode?.type === "bookmarkEnd") {
|
|
31431
|
+
return position === "start" ? 0 : rowCellCount - 1;
|
|
31432
|
+
}
|
|
31433
|
+
const attrs = bookmarkNode?.attrs ?? {};
|
|
31434
|
+
const col = parseColIndex(position === "start" ? attrs.colFirst : attrs.colLast);
|
|
31435
|
+
if (col == null) return position === "start" ? 0 : rowCellCount - 1;
|
|
31436
|
+
return Math.min(col, rowCellCount - 1);
|
|
31437
|
+
}
|
|
31438
|
+
function addBookmarkToRowCellInlines(rowCellInlines, rowIndex, position, bookmarkNode, rowCellCount) {
|
|
31439
|
+
const cellIndex = getCellIndexForBookmark(bookmarkNode, position, rowCellCount);
|
|
31440
|
+
const bucket = rowCellInlines[rowIndex][position];
|
|
31441
|
+
if (!bucket[cellIndex]) bucket[cellIndex] = [];
|
|
31442
|
+
bucket[cellIndex].push(bookmarkNode);
|
|
31443
|
+
}
|
|
31444
|
+
function applyBookmarksToRow(rowNode, { start: startByCell, end: endByCell }, editor) {
|
|
31445
|
+
const cellIndices = [
|
|
31446
|
+
.../* @__PURE__ */ new Set([...Object.keys(startByCell).map(Number), ...Object.keys(endByCell).map(Number)])
|
|
31447
|
+
].sort((a, b2) => a - b2);
|
|
31448
|
+
let row = rowNode;
|
|
31449
|
+
for (const cellIndex of cellIndices) {
|
|
31450
|
+
const startNodes = startByCell[cellIndex];
|
|
31451
|
+
const endNodes = endByCell[cellIndex];
|
|
31452
|
+
if (startNodes?.length) row = insertInlineIntoRow(row, startNodes, editor, "start", cellIndex);
|
|
31453
|
+
if (endNodes?.length) row = insertInlineIntoRow(row, endNodes, editor, "end", cellIndex);
|
|
31454
|
+
}
|
|
31455
|
+
return row;
|
|
31456
|
+
}
|
|
31457
|
+
function normalizeTableBookmarksInTable(tableNode, editor) {
|
|
31458
|
+
if (!tableNode || tableNode.type !== "table" || !Array.isArray(tableNode.content)) return tableNode;
|
|
31459
|
+
const rows = tableNode.content.filter((child) => child?.type === "tableRow");
|
|
31460
|
+
if (!rows.length) return tableNode;
|
|
31461
|
+
const rowCellInlines = rows.map(() => ({
|
|
31462
|
+
start: (
|
|
31463
|
+
/** @type {Record<number, unknown[]>} */
|
|
31464
|
+
{}
|
|
31465
|
+
),
|
|
31466
|
+
end: (
|
|
31467
|
+
/** @type {Record<number, unknown[]>} */
|
|
31468
|
+
{}
|
|
31469
|
+
)
|
|
31470
|
+
}));
|
|
31471
|
+
let rowCursor = 0;
|
|
31472
|
+
for (const child of tableNode.content) {
|
|
31473
|
+
if (child?.type === "tableRow") {
|
|
31474
|
+
rowCursor += 1;
|
|
31475
|
+
continue;
|
|
31476
|
+
}
|
|
31477
|
+
if (isBookmarkNode(child)) {
|
|
31478
|
+
const prevRowIndex = rowCursor > 0 ? rowCursor - 1 : null;
|
|
31479
|
+
const nextRowIndex = rowCursor < rows.length ? rowCursor : null;
|
|
31480
|
+
const row = (nextRowIndex ?? prevRowIndex) != null ? rows[nextRowIndex ?? prevRowIndex] : null;
|
|
31481
|
+
const rowCellCount = row?.content?.length ?? 0;
|
|
31482
|
+
if (child.type === "bookmarkStart") {
|
|
31483
|
+
if (nextRowIndex != null)
|
|
31484
|
+
addBookmarkToRowCellInlines(rowCellInlines, nextRowIndex, "start", child, rowCellCount);
|
|
31485
|
+
else if (prevRowIndex != null)
|
|
31486
|
+
addBookmarkToRowCellInlines(rowCellInlines, prevRowIndex, "end", child, rowCellCount);
|
|
31487
|
+
} else {
|
|
31488
|
+
if (prevRowIndex != null) addBookmarkToRowCellInlines(rowCellInlines, prevRowIndex, "end", child, rowCellCount);
|
|
31489
|
+
else if (nextRowIndex != null)
|
|
31490
|
+
addBookmarkToRowCellInlines(rowCellInlines, nextRowIndex, "start", child, rowCellCount);
|
|
31491
|
+
}
|
|
31492
|
+
}
|
|
31493
|
+
}
|
|
31494
|
+
const updatedRows = rows.map((row, index2) => applyBookmarksToRow(row, rowCellInlines[index2], editor));
|
|
31495
|
+
rowCursor = 0;
|
|
31496
|
+
const content = [];
|
|
31497
|
+
for (const child of tableNode.content) {
|
|
31498
|
+
if (child?.type === "tableRow") {
|
|
31499
|
+
content.push(updatedRows[rowCursor] ?? child);
|
|
31500
|
+
rowCursor += 1;
|
|
31501
|
+
} else if (!isBookmarkNode(child)) {
|
|
31502
|
+
content.push(child);
|
|
31503
|
+
}
|
|
31504
|
+
}
|
|
31505
|
+
return {
|
|
31506
|
+
...tableNode,
|
|
31507
|
+
content
|
|
31508
|
+
};
|
|
31509
|
+
}
|
|
31510
|
+
function insertInlineIntoRow(rowNode, inlineNodes, editor, position, cellIndex) {
|
|
31511
|
+
if (!rowNode || !inlineNodes?.length) return rowNode;
|
|
31512
|
+
if (!Array.isArray(rowNode.content) || rowNode.content.length === 0) {
|
|
31513
|
+
const paragraph = { type: "paragraph", content: inlineNodes };
|
|
31514
|
+
const newCell = { type: "tableCell", content: [paragraph], attrs: {}, marks: [] };
|
|
31515
|
+
return { ...rowNode, content: [newCell] };
|
|
31516
|
+
}
|
|
31517
|
+
const lastCellIndex = rowNode.content.length - 1;
|
|
31518
|
+
const targetIndex = cellIndex != null ? Math.min(Math.max(0, cellIndex), lastCellIndex) : position === "end" ? lastCellIndex : 0;
|
|
31519
|
+
const targetCell = rowNode.content[targetIndex];
|
|
31520
|
+
const updatedCell = insertInlineIntoCell(targetCell, inlineNodes, editor, position);
|
|
31521
|
+
if (updatedCell === targetCell) return rowNode;
|
|
31522
|
+
const nextContent = rowNode.content.slice();
|
|
31523
|
+
nextContent[targetIndex] = updatedCell;
|
|
31524
|
+
return { ...rowNode, content: nextContent };
|
|
31525
|
+
}
|
|
31526
|
+
function findTextblockIndex(content, editor, fromEnd) {
|
|
31527
|
+
const start = fromEnd ? content.length - 1 : 0;
|
|
31528
|
+
const end = fromEnd ? -1 : content.length;
|
|
31529
|
+
const step = fromEnd ? -1 : 1;
|
|
31530
|
+
for (let i = start; fromEnd ? i > end : i < end; i += step) {
|
|
31531
|
+
if (isTextblockNode(content[i], editor)) return i;
|
|
31532
|
+
}
|
|
31533
|
+
return -1;
|
|
31534
|
+
}
|
|
31535
|
+
function insertInlineIntoCell(cellNode, inlineNodes, editor, position) {
|
|
31536
|
+
if (!cellNode || !inlineNodes?.length) return cellNode;
|
|
31537
|
+
const content = Array.isArray(cellNode.content) ? cellNode.content.slice() : [];
|
|
31538
|
+
const targetIndex = findTextblockIndex(content, editor, position === "end");
|
|
31539
|
+
if (targetIndex === -1) {
|
|
31540
|
+
const paragraph = { type: "paragraph", content: inlineNodes };
|
|
31541
|
+
if (position === "end") content.push(paragraph);
|
|
31542
|
+
else content.unshift(paragraph);
|
|
31543
|
+
return { ...cellNode, content };
|
|
31544
|
+
}
|
|
31545
|
+
const targetBlock = content[targetIndex] || { type: "paragraph", content: [] };
|
|
31546
|
+
const blockContent = Array.isArray(targetBlock.content) ? targetBlock.content.slice() : [];
|
|
31547
|
+
const nextBlockContent = position === "end" ? blockContent.concat(inlineNodes) : inlineNodes.concat(blockContent);
|
|
31548
|
+
content[targetIndex] = { ...targetBlock, content: nextBlockContent };
|
|
31549
|
+
return { ...cellNode, content };
|
|
31550
|
+
}
|
|
31551
|
+
function isBookmarkNode(node) {
|
|
31552
|
+
const typeName = node?.type;
|
|
31553
|
+
return typeName === "bookmarkStart" || typeName === "bookmarkEnd";
|
|
31554
|
+
}
|
|
31555
|
+
function isTextblockNode(node, editor) {
|
|
31556
|
+
const typeName = node?.type;
|
|
31557
|
+
if (!typeName) return false;
|
|
31558
|
+
const nodeType = editor?.schema?.nodes?.[typeName];
|
|
31559
|
+
if (nodeType && typeof nodeType.isTextblock === "boolean") return nodeType.isTextblock;
|
|
31560
|
+
return typeName === "paragraph";
|
|
31561
|
+
}
|
|
31408
31562
|
const buildOriginalXml = (type, attrs, preservableTags) => {
|
|
31409
31563
|
const attrConfigsByType = {
|
|
31410
31564
|
bookmarkStart: bookmarkStartAttrConfigs,
|
|
@@ -33818,7 +33972,7 @@ class SuperConverter {
|
|
|
33818
33972
|
static getStoredSuperdocVersion(docx) {
|
|
33819
33973
|
return SuperConverter.getStoredCustomProperty(docx, "SuperdocVersion");
|
|
33820
33974
|
}
|
|
33821
|
-
static setStoredSuperdocVersion(docx = this.convertedXml, version = "1.13.0-next.
|
|
33975
|
+
static setStoredSuperdocVersion(docx = this.convertedXml, version = "1.13.0-next.7") {
|
|
33822
33976
|
return SuperConverter.setStoredCustomProperty(docx, "SuperdocVersion", version, false);
|
|
33823
33977
|
}
|
|
33824
33978
|
/**
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
const index = require("./index-
|
|
2
|
+
const index = require("./index-CzrQ0Wc0.cjs");
|
|
3
3
|
const blankDocx = require("./blank-docx-DfW3Eeh2.cjs");
|
|
4
4
|
require("./helpers-OFep8CYR.cjs");
|
|
5
|
-
require("./SuperConverter-
|
|
5
|
+
require("./SuperConverter-CvaYccDY.cjs");
|
|
6
6
|
const eventemitter3 = require("./eventemitter3-D-UiF04J.cjs");
|
|
7
7
|
const vue = require("./vue-BkoOkkmT.cjs");
|
|
8
8
|
require("./jszip.min-oAFpNMh5.cjs");
|
|
@@ -8169,7 +8169,7 @@ const _sfc_main = {
|
|
|
8169
8169
|
__name: "SuperDoc",
|
|
8170
8170
|
emits: ["selection-update"],
|
|
8171
8171
|
setup(__props, { emit: __emit }) {
|
|
8172
|
-
const PdfViewer = vue.defineAsyncComponent(() => Promise.resolve().then(() => require("./PdfViewer-
|
|
8172
|
+
const PdfViewer = vue.defineAsyncComponent(() => Promise.resolve().then(() => require("./PdfViewer-CV1clrXP.cjs")));
|
|
8173
8173
|
const superdocStore = useSuperdocStore();
|
|
8174
8174
|
const commentsStore = useCommentsStore();
|
|
8175
8175
|
const {
|
|
@@ -21643,7 +21643,7 @@ class SuperDoc extends eventemitter3.EventEmitter {
|
|
|
21643
21643
|
this.config.colors = shuffleArray(this.config.colors);
|
|
21644
21644
|
this.userColorMap = /* @__PURE__ */ new Map();
|
|
21645
21645
|
this.colorIndex = 0;
|
|
21646
|
-
this.version = "1.13.0-next.
|
|
21646
|
+
this.version = "1.13.0-next.7";
|
|
21647
21647
|
this.#log("🦋 [superdoc] Using SuperDoc version:", this.version);
|
|
21648
21648
|
this.superdocId = config.superdocId || uuid.v4();
|
|
21649
21649
|
this.colors = this.config.colors;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
const superEditor_converter = require("./SuperConverter-
|
|
2
|
+
const superEditor_converter = require("./SuperConverter-CvaYccDY.cjs");
|
|
3
3
|
const helpers$1 = require("./helpers-OFep8CYR.cjs");
|
|
4
4
|
const vue = require("./vue-BkoOkkmT.cjs");
|
|
5
5
|
require("./jszip.min-oAFpNMh5.cjs");
|
|
@@ -993,7 +993,7 @@ const DEFAULT_ENDPOINT = "https://ingest.superdoc.dev/v1/collect";
|
|
|
993
993
|
const COMMUNITY_LICENSE_KEY = "community-and-eval-agplv3";
|
|
994
994
|
function getSuperdocVersion() {
|
|
995
995
|
try {
|
|
996
|
-
return true ? "1.13.0-next.
|
|
996
|
+
return true ? "1.13.0-next.7" : "unknown";
|
|
997
997
|
} catch {
|
|
998
998
|
return "unknown";
|
|
999
999
|
}
|
|
@@ -17101,7 +17101,7 @@ const canUseDOM = () => {
|
|
|
17101
17101
|
return false;
|
|
17102
17102
|
}
|
|
17103
17103
|
};
|
|
17104
|
-
const summaryVersion = "1.13.0-next.
|
|
17104
|
+
const summaryVersion = "1.13.0-next.7";
|
|
17105
17105
|
const nodeKeys = ["group", "content", "marks", "inline", "atom", "defining", "code", "tableRole", "summary"];
|
|
17106
17106
|
const markKeys = ["group", "inclusive", "excludes", "spanning", "code"];
|
|
17107
17107
|
function mapAttributes(attrs) {
|
|
@@ -19909,7 +19909,7 @@ class Editor extends EventEmitter {
|
|
|
19909
19909
|
* Process collaboration migrations
|
|
19910
19910
|
*/
|
|
19911
19911
|
processCollaborationMigrations() {
|
|
19912
|
-
console.debug("[checkVersionMigrations] Current editor version", "1.13.0-next.
|
|
19912
|
+
console.debug("[checkVersionMigrations] Current editor version", "1.13.0-next.7");
|
|
19913
19913
|
if (!this.options.ydoc) return;
|
|
19914
19914
|
const metaMap = this.options.ydoc.getMap("meta");
|
|
19915
19915
|
let docVersion = metaMap.get("version");
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { g as generateDocxRandomId, T as TextSelection$1, o as objectIncludes, w as wrapTextsInRuns, D as DOMParser$1, c as createDocFromMarkdown, a as createDocFromHTML, F as Fragment, b as chainableEditorState, d as convertMarkdownToHTML, f as findParentNode, e as findParentNodeClosestToPos, h as generateRandom32BitHex, i as generateRandomSigned32BitIntStrId, P as Plugin, j as PluginKey, M as Mapping, N as NodeSelection, k as Selection, l as Slice, m as DOMSerializer, n as Mark$1, p as dropPoint, A as AllSelection, q as Schema$2, s as canSplit, t as resolveRunProperties, u as encodeMarksFromRPr, v as liftTarget, x as replaceStep$1, y as canJoin, z as joinPoint, R as ReplaceAroundStep$1, B as htmlHandler, C as ReplaceStep, E as getResolvedParagraphProperties, G as changeListLevel, H as isList$1, I as updateNumberingProperties, L as ListHelpers, J as inputRulesPlugin, K as TrackDeleteMarkName, O as TrackInsertMarkName, Q as TrackFormatMarkName, U as AddMarkStep, V as RemoveMarkStep, W as CommandService, S as SuperConverter, X as EditorState, Y as unflattenListsInHtml, Z as SelectionRange, _ as Transform, $ as resolveParagraphProperties, a0 as resolveDocxFontFamily, a1 as _getReferencedTableStyles, a2 as resolveTableCellProperties, a3 as decodeRPrFromMarks, a4 as carbonCopy, a5 as calculateResolvedParagraphProperties, a6 as encodeCSSFromPPr, a7 as encodeCSSFromRPr, a8 as generateOrderedListIndex, a9 as docxNumberingHelpers, aa as InputRule, ab as insertNewRelationship, ac as kebabCase$1, ad as getUnderlineCssString, ae as handleClipboardPaste } from "./SuperConverter-
|
|
1
|
+
import { g as generateDocxRandomId, T as TextSelection$1, o as objectIncludes, w as wrapTextsInRuns, D as DOMParser$1, c as createDocFromMarkdown, a as createDocFromHTML, F as Fragment, b as chainableEditorState, d as convertMarkdownToHTML, f as findParentNode, e as findParentNodeClosestToPos, h as generateRandom32BitHex, i as generateRandomSigned32BitIntStrId, P as Plugin, j as PluginKey, M as Mapping, N as NodeSelection, k as Selection, l as Slice, m as DOMSerializer, n as Mark$1, p as dropPoint, A as AllSelection, q as Schema$2, s as canSplit, t as resolveRunProperties, u as encodeMarksFromRPr, v as liftTarget, x as replaceStep$1, y as canJoin, z as joinPoint, R as ReplaceAroundStep$1, B as htmlHandler, C as ReplaceStep, E as getResolvedParagraphProperties, G as changeListLevel, H as isList$1, I as updateNumberingProperties, L as ListHelpers, J as inputRulesPlugin, K as TrackDeleteMarkName, O as TrackInsertMarkName, Q as TrackFormatMarkName, U as AddMarkStep, V as RemoveMarkStep, W as CommandService, S as SuperConverter, X as EditorState, Y as unflattenListsInHtml, Z as SelectionRange, _ as Transform, $ as resolveParagraphProperties, a0 as resolveDocxFontFamily, a1 as _getReferencedTableStyles, a2 as resolveTableCellProperties, a3 as decodeRPrFromMarks, a4 as carbonCopy, a5 as calculateResolvedParagraphProperties, a6 as encodeCSSFromPPr, a7 as encodeCSSFromRPr, a8 as generateOrderedListIndex, a9 as docxNumberingHelpers, aa as InputRule, ab as insertNewRelationship, ac as kebabCase$1, ad as getUnderlineCssString, ae as handleClipboardPaste } from "./SuperConverter-C2zqtfRH.es.js";
|
|
2
2
|
import { j as twipsToInches, m as inchesToTwips, p as ptToTwips, d as linesToTwips, f as twipsToLines, k as pixelsToTwips, z as resolveOpcTargetPath, B as Buffer$3, D as getArrayBufferFromUrl, h as halfPointToPoints, c as twipsToPixels$2, E as convertSizeToCSS, F as inchesToPixels } from "./helpers-BqdwtJE0.es.js";
|
|
3
3
|
import { p as process$1$2, r as ref, b as computed, c as createElementBlock, F as Fragment$1, U as renderList, O as withModifiers, o as openBlock, Q as normalizeClass, M as toDisplayString, i as createCommentVNode, a as createBaseVNode, V as createApp, e as onMounted, f as onUnmounted, u as unref, S as withDirectives, Y as vModelText, D as nextTick, N as normalizeStyle, B as watch, Z as withKeys, _ as createTextVNode, g as createVNode, h as h$1, $ as readonly, E as getCurrentInstance, l as onBeforeUnmount, s as reactive, m as onBeforeMount, j as inject, a0 as onActivated, a1 as onDeactivated, a2 as Comment, d as defineComponent, k as provide, q as Teleport, t as toRef, a3 as renderSlot, a4 as isVNode, K as shallowRef, w as watchEffect, J as global$2, T as Transition, a5 as mergeProps, a6 as vShow, a7 as cloneVNode, a8 as Text$2, x as markRaw, P as createBlock, L as withCtx, a9 as useCssVars, W as resolveDynamicComponent, aa as normalizeProps, ab as guardReactiveProps } from "./vue-DiPLN5sT.es.js";
|
|
4
4
|
import "./jszip.min-BCZQ7Wq2.es.js";
|
|
@@ -976,7 +976,7 @@ const DEFAULT_ENDPOINT = "https://ingest.superdoc.dev/v1/collect";
|
|
|
976
976
|
const COMMUNITY_LICENSE_KEY = "community-and-eval-agplv3";
|
|
977
977
|
function getSuperdocVersion() {
|
|
978
978
|
try {
|
|
979
|
-
return true ? "1.13.0-next.
|
|
979
|
+
return true ? "1.13.0-next.7" : "unknown";
|
|
980
980
|
} catch {
|
|
981
981
|
return "unknown";
|
|
982
982
|
}
|
|
@@ -17084,7 +17084,7 @@ const canUseDOM = () => {
|
|
|
17084
17084
|
return false;
|
|
17085
17085
|
}
|
|
17086
17086
|
};
|
|
17087
|
-
const summaryVersion = "1.13.0-next.
|
|
17087
|
+
const summaryVersion = "1.13.0-next.7";
|
|
17088
17088
|
const nodeKeys = ["group", "content", "marks", "inline", "atom", "defining", "code", "tableRole", "summary"];
|
|
17089
17089
|
const markKeys = ["group", "inclusive", "excludes", "spanning", "code"];
|
|
17090
17090
|
function mapAttributes(attrs) {
|
|
@@ -19892,7 +19892,7 @@ class Editor extends EventEmitter {
|
|
|
19892
19892
|
* Process collaboration migrations
|
|
19893
19893
|
*/
|
|
19894
19894
|
processCollaborationMigrations() {
|
|
19895
|
-
console.debug("[checkVersionMigrations] Current editor version", "1.13.0-next.
|
|
19895
|
+
console.debug("[checkVersionMigrations] Current editor version", "1.13.0-next.7");
|
|
19896
19896
|
if (!this.options.ydoc) return;
|
|
19897
19897
|
const metaMap = this.options.ydoc.getMap("meta");
|
|
19898
19898
|
let docVersion = metaMap.get("version");
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { D as BIT8, F as MAX_SAFE_INTEGER, G as create, H as BITS7, I as utf8TextDecoder, J as create$1, K as setIfUndefined, L as create$2, O as from, Q as floor$1, R as equalityDeep, U as writeVarUint, V as writeVarString, W as toUint8Array, X as createEncoder, Y as createInjectionKey, Z as toString, $ as throwError, a0 as useSsrAdapter, a1 as configProviderInjectionKey, a2 as cssrAnchorMetaName, a3 as globalStyle, q as cB, p as c, a4 as isMounted, a5 as commonVariables$2, s as cM, a6 as cNotM, a7 as cE, o as derived, a8 as changeColor, a9 as insideModal, aa as insidePopover, ab as resolveWrappedSlot, ac as on, w as warnOnce, u as useConfig, ad as useMergedState, ae as useMemo, t as useTheme, af as useRtl, x as createKey, y as useThemeClass, ag as createId, ah as call, ai as render, aj as messageProviderInjectionKey, ak as messageApiInjectionKey, l as getStarterExtensions, k as getRichTextExtensions, E as Editor, al as fromBase64, am as onChange, an as varStorage, ao as toBase64, ap as createUint8ArrayFromArrayBuffer, aq as offChange, ar as writeVarUint8Array, as as map, at as length, au as isNode, av as min, aw as pow, ax as comments_module_events, ay as getFileObject, az as getTrackChanges, C as CommentsPluginKey, f as TrackChangesBasePluginKey, aA as ellipsisVerticalSvg, aB as xmarkIconSvg, aC as checkIconSvg, aD as caretDownIconSvg, aE as commentIconSvg, B as _export_sfc, aF as NDropdown, d as SuperInput, aG as vClickOutside, P as PresentationEditor, c as SuperEditor, A as AIWriter, aH as NConfigProvider, e as SuperToolbar } from "./index-
|
|
1
|
+
import { D as BIT8, F as MAX_SAFE_INTEGER, G as create, H as BITS7, I as utf8TextDecoder, J as create$1, K as setIfUndefined, L as create$2, O as from, Q as floor$1, R as equalityDeep, U as writeVarUint, V as writeVarString, W as toUint8Array, X as createEncoder, Y as createInjectionKey, Z as toString, $ as throwError, a0 as useSsrAdapter, a1 as configProviderInjectionKey, a2 as cssrAnchorMetaName, a3 as globalStyle, q as cB, p as c, a4 as isMounted, a5 as commonVariables$2, s as cM, a6 as cNotM, a7 as cE, o as derived, a8 as changeColor, a9 as insideModal, aa as insidePopover, ab as resolveWrappedSlot, ac as on, w as warnOnce, u as useConfig, ad as useMergedState, ae as useMemo, t as useTheme, af as useRtl, x as createKey, y as useThemeClass, ag as createId, ah as call, ai as render, aj as messageProviderInjectionKey, ak as messageApiInjectionKey, l as getStarterExtensions, k as getRichTextExtensions, E as Editor, al as fromBase64, am as onChange, an as varStorage, ao as toBase64, ap as createUint8ArrayFromArrayBuffer, aq as offChange, ar as writeVarUint8Array, as as map, at as length, au as isNode, av as min, aw as pow, ax as comments_module_events, ay as getFileObject, az as getTrackChanges, C as CommentsPluginKey, f as TrackChangesBasePluginKey, aA as ellipsisVerticalSvg, aB as xmarkIconSvg, aC as checkIconSvg, aD as caretDownIconSvg, aE as commentIconSvg, B as _export_sfc, aF as NDropdown, d as SuperInput, aG as vClickOutside, P as PresentationEditor, c as SuperEditor, A as AIWriter, aH as NConfigProvider, e as SuperToolbar } from "./index-GEWcivnu.es.js";
|
|
2
2
|
import { B as BlankDOCX } from "./blank-docx-ABm6XYAA.es.js";
|
|
3
3
|
import "./helpers-BqdwtJE0.es.js";
|
|
4
|
-
import "./SuperConverter-
|
|
4
|
+
import "./SuperConverter-C2zqtfRH.es.js";
|
|
5
5
|
import { E as EventEmitter$1 } from "./eventemitter3-DdGu2UnW.es.js";
|
|
6
6
|
import { j as inject, k as provide, b as computed, l as onBeforeUnmount, p as process$1, m as onBeforeMount, d as defineComponent, h, t as toRef, T as Transition, n as TransitionGroup, w as watchEffect, r as ref, e as onMounted, q as Teleport, F as Fragment, s as reactive, v as effectScope, x as markRaw, y as toRaw, z as isRef, A as isReactive, B as watch, u as unref, C as hasInjectionContext, D as nextTick, E as getCurrentInstance, G as getCurrentScope, H as onScopeDispose, I as toRefs, J as global, K as shallowRef, o as openBlock, c as createElementBlock, g as createVNode, L as withCtx, a as createBaseVNode, M as toDisplayString, N as normalizeStyle, i as createCommentVNode, O as withModifiers, P as createBlock, Q as normalizeClass, R as resolveDirective, S as withDirectives, U as renderList, V as createApp, W as resolveDynamicComponent, X as defineAsyncComponent } from "./vue-DiPLN5sT.es.js";
|
|
7
7
|
import "./jszip.min-BCZQ7Wq2.es.js";
|
|
@@ -8152,7 +8152,7 @@ const _sfc_main = {
|
|
|
8152
8152
|
__name: "SuperDoc",
|
|
8153
8153
|
emits: ["selection-update"],
|
|
8154
8154
|
setup(__props, { emit: __emit }) {
|
|
8155
|
-
const PdfViewer = defineAsyncComponent(() => import("./PdfViewer-
|
|
8155
|
+
const PdfViewer = defineAsyncComponent(() => import("./PdfViewer-D-a4sC8J.es.js"));
|
|
8156
8156
|
const superdocStore = useSuperdocStore();
|
|
8157
8157
|
const commentsStore = useCommentsStore();
|
|
8158
8158
|
const {
|
|
@@ -21626,7 +21626,7 @@ class SuperDoc extends EventEmitter$1 {
|
|
|
21626
21626
|
this.config.colors = shuffleArray(this.config.colors);
|
|
21627
21627
|
this.userColorMap = /* @__PURE__ */ new Map();
|
|
21628
21628
|
this.colorIndex = 0;
|
|
21629
|
-
this.version = "1.13.0-next.
|
|
21629
|
+
this.version = "1.13.0-next.7";
|
|
21630
21630
|
this.#log("🦋 [superdoc] Using SuperDoc version:", this.version);
|
|
21631
21631
|
this.superdocId = config.superdocId || v4();
|
|
21632
21632
|
this.colors = this.config.colors;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
3
|
require("../chunks/helpers-OFep8CYR.cjs");
|
|
4
|
-
const superEditor_converter = require("../chunks/SuperConverter-
|
|
4
|
+
const superEditor_converter = require("../chunks/SuperConverter-CvaYccDY.cjs");
|
|
5
5
|
require("../chunks/uuid-R7L08bOx.cjs");
|
|
6
6
|
exports.SuperConverter = superEditor_converter.SuperConverter;
|
|
@@ -24,6 +24,25 @@ export function filterOutRootInlineNodes(content?: Array<{
|
|
|
24
24
|
attrs?: any;
|
|
25
25
|
marks?: any[];
|
|
26
26
|
}>): any[];
|
|
27
|
+
/**
|
|
28
|
+
* Normalize bookmark nodes that appear as direct table children.
|
|
29
|
+
* Moves bookmarkStart/End into the first/last cell textblock of the table.
|
|
30
|
+
*
|
|
31
|
+
* Some non-conformant DOCX producers place bookmarks as direct table children.
|
|
32
|
+
* Per ECMA-376 §17.13.6.2, they should be inside cells (bookmarkStart) or
|
|
33
|
+
* as children of rows (bookmarkEnd).
|
|
34
|
+
* PM can't accept bookmarks as a direct child of table row and that is why
|
|
35
|
+
* we relocate them for compatibility.
|
|
36
|
+
*
|
|
37
|
+
* @param {Array<{type: string, content?: any[], attrs?: any}>} content
|
|
38
|
+
* @param {Editor} [editor]
|
|
39
|
+
* @returns {Array}
|
|
40
|
+
*/
|
|
41
|
+
export function normalizeTableBookmarksInContent(content?: Array<{
|
|
42
|
+
type: string;
|
|
43
|
+
content?: any[];
|
|
44
|
+
attrs?: any;
|
|
45
|
+
}>, editor?: Editor): any[];
|
|
27
46
|
/**
|
|
28
47
|
* Inline passthrough nodes render as zero-width spans. If the text before ends
|
|
29
48
|
* with a space and the text after starts with a space we will see a visible
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"docxImporter.d.ts","sourceRoot":"","sources":["../../../../../src/core/super-converter/v2/importer/docxImporter.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"docxImporter.d.ts","sourceRoot":"","sources":["../../../../../src/core/super-converter/v2/importer/docxImporter.js"],"names":[],"mappings":"AAmlBA,0DAMC;AASD;;;;;;;;GAQG;AACH,wDAFa,MAAS,IAAI,CAiBzB;AA2ID;;;;;;;;GAQG;AACH,mDAHW,KAAK,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,OAAO,CAAC,EAAE,GAAG,CAAC;IAAC,KAAK,CAAC,EAAE,GAAG,CAAC;IAAC,KAAK,CAAC,EAAE,GAAG,EAAE,CAAA;CAAC,CAAC,SAkE1E;AAED;;;;;;;;;;;;;GAaG;AACH,2DAJW,KAAK,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,OAAO,CAAC,EAAE,GAAG,EAAE,CAAC;IAAC,KAAK,CAAC,EAAE,GAAG,CAAA;CAAC,CAAC,WACnD,MAAM,SAOhB;AAgND;;;;;;;GAOG;AACH,iFAiBC;AA79BM;;;;;;;;;;;;;;;;;;;;;;EAgGN;AAEM;;;;;;;;;;;;;;;;;;EAmCN;sBAxMY,OAAO,GAAA,CAAC;yBACR;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,GAAC,CAAC;IAAC,IAAI,EAAE,GAAC,CAAC;IAAC,KAAK,EAAE,GAAC,CAAC;IAAC,KAAK,EAAE,EAAE,CAAC;CAAC;yBACzD;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,EAAE,CAAA;CAAC;gCAEzB,CAAC,KAAK,EAAE,OAAO,EAAE,EAAE,IAAI,EAAE,UAAU,EAAE,iBAAiB,EAAE,OAAO,KAAK,UAAU,EAAE;8BAChF;IAAC,OAAO,EAAE,iBAAiB,CAAC;IAAC,eAAe,EAAE,gBAAgB,EAAE,CAAA;CAAC;0BAEjE,CAAC,KAAK,EAAE,OAAO,EAAE,EAAE,IAAI,EAAE,UAAU,EAAE,eAAe,EAAE,eAAe,EAAE,iBAAiB,EAAE,OAAO,KAAK;IAAC,KAAK,EAAE,UAAU,EAAE,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAA;CAAC;+BAC7I;IAAC,WAAW,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,WAAW,CAAA;CAAC"}
|
|
@@ -24,6 +24,25 @@ export function filterOutRootInlineNodes(content?: Array<{
|
|
|
24
24
|
attrs?: any;
|
|
25
25
|
marks?: any[];
|
|
26
26
|
}>): any[];
|
|
27
|
+
/**
|
|
28
|
+
* Normalize bookmark nodes that appear as direct table children.
|
|
29
|
+
* Moves bookmarkStart/End into the first/last cell textblock of the table.
|
|
30
|
+
*
|
|
31
|
+
* Some non-conformant DOCX producers place bookmarks as direct table children.
|
|
32
|
+
* Per ECMA-376 §17.13.6.2, they should be inside cells (bookmarkStart) or
|
|
33
|
+
* as children of rows (bookmarkEnd).
|
|
34
|
+
* PM can't accept bookmarks as a direct child of table row and that is why
|
|
35
|
+
* we relocate them for compatibility.
|
|
36
|
+
*
|
|
37
|
+
* @param {Array<{type: string, content?: any[], attrs?: any}>} content
|
|
38
|
+
* @param {Editor} [editor]
|
|
39
|
+
* @returns {Array}
|
|
40
|
+
*/
|
|
41
|
+
export function normalizeTableBookmarksInContent(content?: Array<{
|
|
42
|
+
type: string;
|
|
43
|
+
content?: any[];
|
|
44
|
+
attrs?: any;
|
|
45
|
+
}>, editor?: Editor): any[];
|
|
27
46
|
/**
|
|
28
47
|
* Inline passthrough nodes render as zero-width spans. If the text before ends
|
|
29
48
|
* with a space and the text after starts with a space we will see a visible
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"docxImporter.d.ts","sourceRoot":"","sources":["../../../../../../src/core/super-converter/v2/importer/docxImporter.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"docxImporter.d.ts","sourceRoot":"","sources":["../../../../../../src/core/super-converter/v2/importer/docxImporter.js"],"names":[],"mappings":"AAmlBA,0DAMC;AASD;;;;;;;;GAQG;AACH,wDAFa,MAAS,IAAI,CAiBzB;AA2ID;;;;;;;;GAQG;AACH,mDAHW,KAAK,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,OAAO,CAAC,EAAE,GAAG,CAAC;IAAC,KAAK,CAAC,EAAE,GAAG,CAAC;IAAC,KAAK,CAAC,EAAE,GAAG,EAAE,CAAA;CAAC,CAAC,SAkE1E;AAED;;;;;;;;;;;;;GAaG;AACH,2DAJW,KAAK,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,OAAO,CAAC,EAAE,GAAG,EAAE,CAAC;IAAC,KAAK,CAAC,EAAE,GAAG,CAAA;CAAC,CAAC,WACnD,MAAM,SAOhB;AAgND;;;;;;;GAOG;AACH,iFAiBC;AA79BM;;;;;;;;;;;;;;;;;;;;;;EAgGN;AAEM;;;;;;;;;;;;;;;;;;EAmCN;sBAxMY,OAAO,GAAA,CAAC;yBACR;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,GAAC,CAAC;IAAC,IAAI,EAAE,GAAC,CAAC;IAAC,KAAK,EAAE,GAAC,CAAC;IAAC,KAAK,EAAE,EAAE,CAAC;CAAC;yBACzD;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,EAAE,CAAA;CAAC;gCAEzB,CAAC,KAAK,EAAE,OAAO,EAAE,EAAE,IAAI,EAAE,UAAU,EAAE,iBAAiB,EAAE,OAAO,KAAK,UAAU,EAAE;8BAChF;IAAC,OAAO,EAAE,iBAAiB,CAAC;IAAC,eAAe,EAAE,gBAAgB,EAAE,CAAA;CAAC;0BAEjE,CAAC,KAAK,EAAE,OAAO,EAAE,EAAE,IAAI,EAAE,UAAU,EAAE,eAAe,EAAE,eAAe,EAAE,iBAAiB,EAAE,OAAO,KAAK;IAAC,KAAK,EAAE,UAAU,EAAE,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAA;CAAC;+BAC7I;IAAC,WAAW,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,WAAW,CAAA;CAAC"}
|