superdoc 1.0.0-beta.101 → 1.0.0-beta.103
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-Cd9VR_tI.es.js → PdfViewer-Dbqwkn0G.es.js} +1 -1
- package/dist/chunks/{PdfViewer-DZWkMtTG.cjs → PdfViewer-S_8SIFPi.cjs} +1 -1
- package/dist/chunks/{index-BzQ_CQ_p.es.js → index-C5Rf8gqE.es.js} +3 -3
- package/dist/chunks/{index-BavMv0sW.cjs → index-D4NTCKO5.cjs} +3 -3
- package/dist/chunks/{index-N8gZUeSO-BneVBXkH.cjs → index-DQVMKA35-DwhGWytr.cjs} +1 -1
- package/dist/chunks/{index-N8gZUeSO-Dxit0pPr.es.js → index-DQVMKA35-xsiaflRZ.es.js} +1 -1
- package/dist/chunks/{super-editor.es-BGncr3MA.cjs → super-editor.es-CCmmUDjt.cjs} +264 -58
- package/dist/chunks/{super-editor.es-0IwuILla.es.js → super-editor.es-D6ttXPUE.es.js} +264 -58
- package/dist/packages/superdoc/src/core/SuperDoc.d.ts.map +1 -1
- package/dist/super-editor/ai-writer.es.js +2 -2
- package/dist/super-editor/chunks/{converter---tUwTA4.js → converter-CE9B4HYb.js} +12 -6
- package/dist/super-editor/chunks/{docx-zipper-B8zS8jbu.js → docx-zipper-Bt1IoMBF.js} +1 -1
- package/dist/super-editor/chunks/{editor-3H6s48L7.js → editor-DLjQOZqB.js} +250 -50
- package/dist/super-editor/chunks/{index-N8gZUeSO.js → index-DQVMKA35.js} +1 -1
- package/dist/super-editor/chunks/{toolbar-FxiK-_cI.js → toolbar-CqeJTLhO.js} +2 -2
- package/dist/super-editor/converter.es.js +1 -1
- package/dist/super-editor/docx-zipper.es.js +2 -2
- package/dist/super-editor/editor.es.js +3 -3
- package/dist/super-editor/file-zipper.es.js +1 -1
- package/dist/super-editor/super-editor.es.js +10 -10
- package/dist/super-editor/toolbar.es.js +2 -2
- package/dist/super-editor.cjs +1 -1
- package/dist/super-editor.es.js +1 -1
- package/dist/superdoc.cjs +2 -2
- package/dist/superdoc.es.js +2 -2
- package/dist/superdoc.umd.js +266 -60
- package/dist/superdoc.umd.js.map +1 -1
- package/package.json +1 -1
|
@@ -39792,7 +39792,7 @@ function importCommentData({ docx, editor, converter }) {
|
|
|
39792
39792
|
const trackedDeletedText = attributes["custom:trackedDeletedText"] !== "null" ? attributes["custom:trackedDeletedText"] : null;
|
|
39793
39793
|
const date = new Date(createdDate);
|
|
39794
39794
|
const unixTimestampMs = date.getTime();
|
|
39795
|
-
const
|
|
39795
|
+
const parsedElements = nodeListHandler.handler({
|
|
39796
39796
|
nodes: el.elements,
|
|
39797
39797
|
nodeListHandler,
|
|
39798
39798
|
docx,
|
|
@@ -39800,7 +39800,7 @@ function importCommentData({ docx, editor, converter }) {
|
|
|
39800
39800
|
converter,
|
|
39801
39801
|
path: [el]
|
|
39802
39802
|
});
|
|
39803
|
-
const { attrs } =
|
|
39803
|
+
const { attrs } = parsedElements[0];
|
|
39804
39804
|
const paraId = attrs["w14:paraId"];
|
|
39805
39805
|
return {
|
|
39806
39806
|
commentId: internalId || v4(),
|
|
@@ -39808,7 +39808,8 @@ function importCommentData({ docx, editor, converter }) {
|
|
|
39808
39808
|
creatorName: authorName,
|
|
39809
39809
|
creatorEmail: authorEmail,
|
|
39810
39810
|
createdTime: unixTimestampMs,
|
|
39811
|
-
textJson:
|
|
39811
|
+
textJson: parsedElements[0],
|
|
39812
|
+
elements: parsedElements,
|
|
39812
39813
|
initials,
|
|
39813
39814
|
paraId,
|
|
39814
39815
|
trackedChange,
|
|
@@ -39834,7 +39835,12 @@ const generateCommentsWithExtendedData = ({ docx, comments }) => {
|
|
|
39834
39835
|
const { elements = [] } = initialElements[0] ?? {};
|
|
39835
39836
|
const commentEx = elements.filter((el) => el.name === "w15:commentEx");
|
|
39836
39837
|
return comments.map((comment) => {
|
|
39837
|
-
const extendedDef = commentEx.find((ce2) =>
|
|
39838
|
+
const extendedDef = commentEx.find((ce2) => {
|
|
39839
|
+
const isIncludedInCommentElements = comment.elements?.some(
|
|
39840
|
+
(el) => el.attrs?.["w14:paraId"] === ce2.attributes["w15:paraId"]
|
|
39841
|
+
);
|
|
39842
|
+
return isIncludedInCommentElements;
|
|
39843
|
+
});
|
|
39838
39844
|
if (!extendedDef) return { ...comment, isDone: comment.isDone ?? false };
|
|
39839
39845
|
const { isDone, paraIdParent } = getExtendedDetails(extendedDef);
|
|
39840
39846
|
let parentComment;
|
|
@@ -41955,7 +41961,7 @@ const updateCommentsIdsAndExtensible = (comments = [], commentsIds, extensible)
|
|
|
41955
41961
|
name: "w16cex:commentExtensible",
|
|
41956
41962
|
attributes: {
|
|
41957
41963
|
"w16cex:durableId": newDurableId,
|
|
41958
|
-
"w16cex:dateUtc": toIsoNoFractional()
|
|
41964
|
+
"w16cex:dateUtc": toIsoNoFractional(comment.createdTime)
|
|
41959
41965
|
}
|
|
41960
41966
|
};
|
|
41961
41967
|
extensibleUpdated.elements[0].elements.push(newExtensible);
|
|
@@ -42421,7 +42427,7 @@ const _SuperConverter = class _SuperConverter2 {
|
|
|
42421
42427
|
static getStoredSuperdocVersion(docx) {
|
|
42422
42428
|
return _SuperConverter2.getStoredCustomProperty(docx, "SuperdocVersion");
|
|
42423
42429
|
}
|
|
42424
|
-
static setStoredSuperdocVersion(docx = this.convertedXml, version2 = "1.0.0-beta.
|
|
42430
|
+
static setStoredSuperdocVersion(docx = this.convertedXml, version2 = "1.0.0-beta.103") {
|
|
42425
42431
|
return _SuperConverter2.setStoredCustomProperty(docx, "SuperdocVersion", version2, false);
|
|
42426
42432
|
}
|
|
42427
42433
|
/**
|
|
@@ -54817,6 +54823,14 @@ const toggleNode = (typeOrName, toggleTypeOrName, attrs = {}) => ({ state: state
|
|
|
54817
54823
|
const selectAll = () => ({ state: state2, dispatch }) => selectAll$1(state2, dispatch);
|
|
54818
54824
|
const deleteSelection = () => ({ state: state2, tr, dispatch }) => {
|
|
54819
54825
|
const { from: from2, to, empty: empty2 } = state2.selection;
|
|
54826
|
+
if (typeof document !== "undefined" && document.getSelection) {
|
|
54827
|
+
const currentDomSelection = document.getSelection();
|
|
54828
|
+
const selectedLength = currentDomSelection?.toString?.().length;
|
|
54829
|
+
const isCollapsed = currentDomSelection?.isCollapsed;
|
|
54830
|
+
if (!isCollapsed && selectedLength === 1) {
|
|
54831
|
+
return false;
|
|
54832
|
+
}
|
|
54833
|
+
}
|
|
54820
54834
|
if (empty2) {
|
|
54821
54835
|
return deleteSelection$1(state2, dispatch);
|
|
54822
54836
|
}
|
|
@@ -57116,12 +57130,14 @@ const prepareCommentsForImport = (doc2, tr, schema, converter) => {
|
|
|
57116
57130
|
importedId: node.attrs["w:id"]
|
|
57117
57131
|
});
|
|
57118
57132
|
if (type2.name === "commentRangeStart") {
|
|
57119
|
-
|
|
57120
|
-
|
|
57121
|
-
|
|
57122
|
-
|
|
57123
|
-
|
|
57124
|
-
|
|
57133
|
+
if (!matchingImportedComment?.isDone) {
|
|
57134
|
+
toMark.push({
|
|
57135
|
+
commentId: resolvedCommentId,
|
|
57136
|
+
importedId,
|
|
57137
|
+
internal,
|
|
57138
|
+
start: pos
|
|
57139
|
+
});
|
|
57140
|
+
}
|
|
57125
57141
|
ensureFallbackComment({
|
|
57126
57142
|
converter,
|
|
57127
57143
|
matchingImportedComment,
|
|
@@ -59639,7 +59655,7 @@ const isHeadless = (editor) => {
|
|
|
59639
59655
|
const shouldSkipNodeView = (editor) => {
|
|
59640
59656
|
return isHeadless(editor);
|
|
59641
59657
|
};
|
|
59642
|
-
const summaryVersion = "1.0.0-beta.
|
|
59658
|
+
const summaryVersion = "1.0.0-beta.103";
|
|
59643
59659
|
const nodeKeys = ["group", "content", "marks", "inline", "atom", "defining", "code", "tableRole", "summary"];
|
|
59644
59660
|
const markKeys = ["group", "inclusive", "excludes", "spanning", "code"];
|
|
59645
59661
|
function mapAttributes(attrs) {
|
|
@@ -59999,11 +60015,11 @@ const _Editor = class _Editor2 extends EventEmitter$1 {
|
|
|
59999
60015
|
if (!this.options.isNewFile || !this.options.collaborationProvider) return;
|
|
60000
60016
|
const provider = this.options.collaborationProvider;
|
|
60001
60017
|
const postSyncInit = () => {
|
|
60002
|
-
provider.off("synced", postSyncInit);
|
|
60018
|
+
provider.off?.("synced", postSyncInit);
|
|
60003
60019
|
__privateMethod$1(this, _Editor_instances, insertNewFileData_fn).call(this);
|
|
60004
60020
|
};
|
|
60005
60021
|
if (provider.synced) __privateMethod$1(this, _Editor_instances, insertNewFileData_fn).call(this);
|
|
60006
|
-
else provider.on("synced", postSyncInit);
|
|
60022
|
+
else provider.on?.("synced", postSyncInit);
|
|
60007
60023
|
}
|
|
60008
60024
|
/**
|
|
60009
60025
|
* Replace content of editor that was created with loadFromSchema option
|
|
@@ -60428,7 +60444,7 @@ const _Editor = class _Editor2 extends EventEmitter$1 {
|
|
|
60428
60444
|
{ default: remarkStringify },
|
|
60429
60445
|
{ default: remarkGfm }
|
|
60430
60446
|
] = await Promise.all([
|
|
60431
|
-
Promise.resolve().then(() => require("./index-
|
|
60447
|
+
Promise.resolve().then(() => require("./index-DQVMKA35-DwhGWytr.cjs")),
|
|
60432
60448
|
Promise.resolve().then(() => require("./index-DRCvimau-H4Ck3S9a.cjs")),
|
|
60433
60449
|
Promise.resolve().then(() => require("./index-C_x_N6Uh-Db3CUJMX.cjs")),
|
|
60434
60450
|
Promise.resolve().then(() => require("./index-D_sWOSiG-BtDZzJ6I.cjs")),
|
|
@@ -60633,7 +60649,7 @@ const _Editor = class _Editor2 extends EventEmitter$1 {
|
|
|
60633
60649
|
* Process collaboration migrations
|
|
60634
60650
|
*/
|
|
60635
60651
|
processCollaborationMigrations() {
|
|
60636
|
-
console.debug("[checkVersionMigrations] Current editor version", "1.0.0-beta.
|
|
60652
|
+
console.debug("[checkVersionMigrations] Current editor version", "1.0.0-beta.103");
|
|
60637
60653
|
if (!this.options.ydoc) return;
|
|
60638
60654
|
const metaMap = this.options.ydoc.getMap("meta");
|
|
60639
60655
|
let docVersion = metaMap.get("version");
|
|
@@ -63748,6 +63764,7 @@ function hydrateImageBlocks(blocks, mediaFiles) {
|
|
|
63748
63764
|
if (cellChanged) {
|
|
63749
63765
|
return {
|
|
63750
63766
|
...cell,
|
|
63767
|
+
// Cast to expected type - hydrateBlock preserves block kinds, just hydrates image sources
|
|
63751
63768
|
blocks: hydratedBlocks.length > 0 ? hydratedBlocks : cell.blocks,
|
|
63752
63769
|
paragraph: hydratedParagraph
|
|
63753
63770
|
};
|
|
@@ -67368,7 +67385,7 @@ const computeParagraphAttrs = (para, styleContext, listCounterContext, converter
|
|
|
67368
67385
|
};
|
|
67369
67386
|
}
|
|
67370
67387
|
const hasValidNumbering = rawNumberingProps && isValidNumberingId(rawNumberingProps.numId);
|
|
67371
|
-
if (hasValidNumbering) {
|
|
67388
|
+
if (hasValidNumbering && rawNumberingProps) {
|
|
67372
67389
|
const numberingProps = rawNumberingProps;
|
|
67373
67390
|
const numId = numberingProps.numId;
|
|
67374
67391
|
const ilvl = Number.isFinite(numberingProps.ilvl) ? Math.max(0, Math.floor(Number(numberingProps.ilvl))) : 0;
|
|
@@ -67408,6 +67425,8 @@ const computeParagraphAttrs = (para, styleContext, listCounterContext, converter
|
|
|
67408
67425
|
const resolvedCounterValue = path[path.length - 1] ?? counterValue;
|
|
67409
67426
|
const enrichedNumberingProps = {
|
|
67410
67427
|
...numberingProps,
|
|
67428
|
+
numId: numberingProps.numId,
|
|
67429
|
+
ilvl: numberingProps.ilvl,
|
|
67411
67430
|
path,
|
|
67412
67431
|
counterValue: resolvedCounterValue
|
|
67413
67432
|
};
|
|
@@ -69504,7 +69523,7 @@ const parseTableCell = (args) => {
|
|
|
69504
69523
|
context.nextBlockId,
|
|
69505
69524
|
context.positions
|
|
69506
69525
|
);
|
|
69507
|
-
if (drawingBlock) {
|
|
69526
|
+
if (drawingBlock && drawingBlock.kind === "drawing") {
|
|
69508
69527
|
blocks.push(drawingBlock);
|
|
69509
69528
|
}
|
|
69510
69529
|
continue;
|
|
@@ -69515,7 +69534,7 @@ const parseTableCell = (args) => {
|
|
|
69515
69534
|
context.nextBlockId,
|
|
69516
69535
|
context.positions
|
|
69517
69536
|
);
|
|
69518
|
-
if (drawingBlock) {
|
|
69537
|
+
if (drawingBlock && drawingBlock.kind === "drawing") {
|
|
69519
69538
|
blocks.push(drawingBlock);
|
|
69520
69539
|
}
|
|
69521
69540
|
continue;
|
|
@@ -69526,7 +69545,7 @@ const parseTableCell = (args) => {
|
|
|
69526
69545
|
context.nextBlockId,
|
|
69527
69546
|
context.positions
|
|
69528
69547
|
);
|
|
69529
|
-
if (drawingBlock) {
|
|
69548
|
+
if (drawingBlock && drawingBlock.kind === "drawing") {
|
|
69530
69549
|
blocks.push(drawingBlock);
|
|
69531
69550
|
}
|
|
69532
69551
|
continue;
|
|
@@ -69537,7 +69556,7 @@ const parseTableCell = (args) => {
|
|
|
69537
69556
|
context.nextBlockId,
|
|
69538
69557
|
context.positions
|
|
69539
69558
|
);
|
|
69540
|
-
if (drawingBlock) {
|
|
69559
|
+
if (drawingBlock && drawingBlock.kind === "drawing") {
|
|
69541
69560
|
blocks.push(drawingBlock);
|
|
69542
69561
|
}
|
|
69543
69562
|
}
|
|
@@ -69992,7 +70011,19 @@ function toFlowBlocks(pmDoc, options) {
|
|
|
69992
70011
|
bookmarks2,
|
|
69993
70012
|
hyperlinkConfig2,
|
|
69994
70013
|
themeColorsParam ?? themeColors,
|
|
69995
|
-
paragraphConverter
|
|
70014
|
+
paragraphConverter,
|
|
70015
|
+
converterCtx ?? converterContext,
|
|
70016
|
+
{
|
|
70017
|
+
listCounterContext: { getListCounter, incrementListCounter, resetListCounter },
|
|
70018
|
+
converters: {
|
|
70019
|
+
paragraphToFlowBlocks: paragraphConverter,
|
|
70020
|
+
imageNodeToBlock,
|
|
70021
|
+
vectorShapeNodeToDrawingBlock,
|
|
70022
|
+
shapeGroupNodeToDrawingBlock,
|
|
70023
|
+
shapeContainerNodeToDrawingBlock,
|
|
70024
|
+
shapeTextboxNodeToDrawingBlock
|
|
70025
|
+
}
|
|
70026
|
+
}
|
|
69996
70027
|
);
|
|
69997
70028
|
const handlerContext = {
|
|
69998
70029
|
blocks,
|
|
@@ -70013,6 +70044,7 @@ function toFlowBlocks(pmDoc, options) {
|
|
|
70013
70044
|
currentParagraphIndex: 0
|
|
70014
70045
|
},
|
|
70015
70046
|
converters: {
|
|
70047
|
+
// Type assertion needed due to signature mismatch between actual function and type definition
|
|
70016
70048
|
paragraphToFlowBlocks: paragraphConverter,
|
|
70017
70049
|
tableNodeToBlock: tableConverter,
|
|
70018
70050
|
imageNodeToBlock,
|
|
@@ -70108,6 +70140,7 @@ function paragraphToFlowBlocks(para, nextBlockId, positions, defaultFont, defaul
|
|
|
70108
70140
|
{
|
|
70109
70141
|
listCounterContext,
|
|
70110
70142
|
converters: {
|
|
70143
|
+
// Type assertion needed due to signature mismatch between actual function and type definition
|
|
70111
70144
|
paragraphToFlowBlocks: paragraphToFlowBlocks$1,
|
|
70112
70145
|
imageNodeToBlock,
|
|
70113
70146
|
vectorShapeNodeToDrawingBlock,
|
|
@@ -70121,7 +70154,7 @@ function paragraphToFlowBlocks(para, nextBlockId, positions, defaultFont, defaul
|
|
|
70121
70154
|
converterContext
|
|
70122
70155
|
);
|
|
70123
70156
|
}
|
|
70124
|
-
function tableNodeToBlock(node, nextBlockId, positions, defaultFont, defaultSize, styleContext, trackedChanges, bookmarks, hyperlinkConfig, themeColors, converterContext) {
|
|
70157
|
+
function tableNodeToBlock(node, nextBlockId, positions, defaultFont, defaultSize, styleContext, trackedChanges, bookmarks, hyperlinkConfig, themeColors, _paragraphToFlowBlocksParam, converterContext, options) {
|
|
70125
70158
|
return tableNodeToBlock$1(
|
|
70126
70159
|
node,
|
|
70127
70160
|
nextBlockId,
|
|
@@ -70135,8 +70168,9 @@ function tableNodeToBlock(node, nextBlockId, positions, defaultFont, defaultSize
|
|
|
70135
70168
|
themeColors,
|
|
70136
70169
|
paragraphToFlowBlocks,
|
|
70137
70170
|
converterContext,
|
|
70138
|
-
{
|
|
70171
|
+
options ?? {
|
|
70139
70172
|
converters: {
|
|
70173
|
+
// Type assertion needed due to signature mismatch between actual function and type definition
|
|
70140
70174
|
paragraphToFlowBlocks: paragraphToFlowBlocks$1,
|
|
70141
70175
|
imageNodeToBlock,
|
|
70142
70176
|
vectorShapeNodeToDrawingBlock,
|
|
@@ -74440,6 +74474,49 @@ const hashParagraphBorders$1 = (borders) => {
|
|
|
74440
74474
|
if (borders.left) parts.push(`l:[${hashParagraphBorder$1(borders.left)}]`);
|
|
74441
74475
|
return parts.join(";");
|
|
74442
74476
|
};
|
|
74477
|
+
const isNoneBorder$1 = (value) => {
|
|
74478
|
+
return typeof value === "object" && value !== null && "none" in value && value.none === true;
|
|
74479
|
+
};
|
|
74480
|
+
const isBorderSpec$1 = (value) => {
|
|
74481
|
+
return typeof value === "object" && value !== null && !("none" in value);
|
|
74482
|
+
};
|
|
74483
|
+
const hashBorderSpec$1 = (border) => {
|
|
74484
|
+
const parts = [];
|
|
74485
|
+
if (border.style !== void 0) parts.push(`s:${border.style}`);
|
|
74486
|
+
if (border.width !== void 0) parts.push(`w:${border.width}`);
|
|
74487
|
+
if (border.color !== void 0) parts.push(`c:${border.color}`);
|
|
74488
|
+
if (border.space !== void 0) parts.push(`sp:${border.space}`);
|
|
74489
|
+
return parts.join(",");
|
|
74490
|
+
};
|
|
74491
|
+
const hashTableBorderValue$1 = (borderValue) => {
|
|
74492
|
+
if (borderValue === void 0) return "";
|
|
74493
|
+
if (borderValue === null) return "null";
|
|
74494
|
+
if (isNoneBorder$1(borderValue)) return "none";
|
|
74495
|
+
if (isBorderSpec$1(borderValue)) {
|
|
74496
|
+
return hashBorderSpec$1(borderValue);
|
|
74497
|
+
}
|
|
74498
|
+
return "";
|
|
74499
|
+
};
|
|
74500
|
+
const hashTableBorders$1 = (borders) => {
|
|
74501
|
+
if (!borders) return "";
|
|
74502
|
+
const parts = [];
|
|
74503
|
+
if (borders.top !== void 0) parts.push(`t:[${hashTableBorderValue$1(borders.top)}]`);
|
|
74504
|
+
if (borders.right !== void 0) parts.push(`r:[${hashTableBorderValue$1(borders.right)}]`);
|
|
74505
|
+
if (borders.bottom !== void 0) parts.push(`b:[${hashTableBorderValue$1(borders.bottom)}]`);
|
|
74506
|
+
if (borders.left !== void 0) parts.push(`l:[${hashTableBorderValue$1(borders.left)}]`);
|
|
74507
|
+
if (borders.insideH !== void 0) parts.push(`ih:[${hashTableBorderValue$1(borders.insideH)}]`);
|
|
74508
|
+
if (borders.insideV !== void 0) parts.push(`iv:[${hashTableBorderValue$1(borders.insideV)}]`);
|
|
74509
|
+
return parts.join(";");
|
|
74510
|
+
};
|
|
74511
|
+
const hashCellBorders$1 = (borders) => {
|
|
74512
|
+
if (!borders) return "";
|
|
74513
|
+
const parts = [];
|
|
74514
|
+
if (borders.top) parts.push(`t:[${hashBorderSpec$1(borders.top)}]`);
|
|
74515
|
+
if (borders.right) parts.push(`r:[${hashBorderSpec$1(borders.right)}]`);
|
|
74516
|
+
if (borders.bottom) parts.push(`b:[${hashBorderSpec$1(borders.bottom)}]`);
|
|
74517
|
+
if (borders.left) parts.push(`l:[${hashBorderSpec$1(borders.left)}]`);
|
|
74518
|
+
return parts.join(";");
|
|
74519
|
+
};
|
|
74443
74520
|
const hasStringProp = (run2, prop) => {
|
|
74444
74521
|
return prop in run2 && typeof run2[prop] === "string";
|
|
74445
74522
|
};
|
|
@@ -77655,6 +77732,25 @@ const deriveBlockVersion = (block) => {
|
|
|
77655
77732
|
hash2 = hashNumber(hash2, cellBlocks.length);
|
|
77656
77733
|
hash2 = hashNumber(hash2, cell.rowSpan ?? 1);
|
|
77657
77734
|
hash2 = hashNumber(hash2, cell.colSpan ?? 1);
|
|
77735
|
+
if (cell.attrs) {
|
|
77736
|
+
const cellAttrs = cell.attrs;
|
|
77737
|
+
if (cellAttrs.borders) {
|
|
77738
|
+
hash2 = hashString(hash2, hashCellBorders$1(cellAttrs.borders));
|
|
77739
|
+
}
|
|
77740
|
+
if (cellAttrs.padding) {
|
|
77741
|
+
const p = cellAttrs.padding;
|
|
77742
|
+
hash2 = hashNumber(hash2, p.top ?? 0);
|
|
77743
|
+
hash2 = hashNumber(hash2, p.right ?? 0);
|
|
77744
|
+
hash2 = hashNumber(hash2, p.bottom ?? 0);
|
|
77745
|
+
hash2 = hashNumber(hash2, p.left ?? 0);
|
|
77746
|
+
}
|
|
77747
|
+
if (cellAttrs.verticalAlign) {
|
|
77748
|
+
hash2 = hashString(hash2, cellAttrs.verticalAlign);
|
|
77749
|
+
}
|
|
77750
|
+
if (cellAttrs.background) {
|
|
77751
|
+
hash2 = hashString(hash2, cellAttrs.background);
|
|
77752
|
+
}
|
|
77753
|
+
}
|
|
77658
77754
|
for (const cellBlock of cellBlocks) {
|
|
77659
77755
|
hash2 = hashString(hash2, cellBlock?.kind ?? "unknown");
|
|
77660
77756
|
if (cellBlock?.kind === "paragraph") {
|
|
@@ -77700,6 +77796,18 @@ const deriveBlockVersion = (block) => {
|
|
|
77700
77796
|
}
|
|
77701
77797
|
}
|
|
77702
77798
|
}
|
|
77799
|
+
if (tableBlock.attrs) {
|
|
77800
|
+
const tblAttrs = tableBlock.attrs;
|
|
77801
|
+
if (tblAttrs.borders) {
|
|
77802
|
+
hash2 = hashString(hash2, hashTableBorders$1(tblAttrs.borders));
|
|
77803
|
+
}
|
|
77804
|
+
if (tblAttrs.borderCollapse) {
|
|
77805
|
+
hash2 = hashString(hash2, tblAttrs.borderCollapse);
|
|
77806
|
+
}
|
|
77807
|
+
if (tblAttrs.cellSpacing !== void 0) {
|
|
77808
|
+
hash2 = hashNumber(hash2, tblAttrs.cellSpacing);
|
|
77809
|
+
}
|
|
77810
|
+
}
|
|
77703
77811
|
return [block.id, tableBlock.rows.length, hash2.toString(16)].join("|");
|
|
77704
77812
|
}
|
|
77705
77813
|
return block.id;
|
|
@@ -78452,7 +78560,7 @@ function isListItem(markerWidth, block) {
|
|
|
78452
78560
|
return false;
|
|
78453
78561
|
}
|
|
78454
78562
|
const wordLayout = getWordLayoutConfig(block);
|
|
78455
|
-
const hasListAttrs = block.attrs?.listItem != null || wordLayout?.marker != null;
|
|
78563
|
+
const hasListAttrs = block.attrs?.listItem != null || block.attrs?.numberingProperties != null || wordLayout?.marker != null;
|
|
78456
78564
|
if (hasListAttrs) {
|
|
78457
78565
|
return true;
|
|
78458
78566
|
}
|
|
@@ -81438,6 +81546,49 @@ const hashParagraphBorders = (borders) => {
|
|
|
81438
81546
|
if (borders.left) parts.push(`l:[${hashParagraphBorder(borders.left)}]`);
|
|
81439
81547
|
return parts.join(";");
|
|
81440
81548
|
};
|
|
81549
|
+
function isNoneBorder(value) {
|
|
81550
|
+
return typeof value === "object" && value !== null && "none" in value && value.none === true;
|
|
81551
|
+
}
|
|
81552
|
+
function isBorderSpec(value) {
|
|
81553
|
+
return typeof value === "object" && value !== null && !("none" in value);
|
|
81554
|
+
}
|
|
81555
|
+
const hashBorderSpec = (border) => {
|
|
81556
|
+
const parts = [];
|
|
81557
|
+
if (border.style !== void 0) parts.push(`s:${border.style}`);
|
|
81558
|
+
if (border.width !== void 0) parts.push(`w:${border.width}`);
|
|
81559
|
+
if (border.color !== void 0) parts.push(`c:${border.color}`);
|
|
81560
|
+
if (border.space !== void 0) parts.push(`sp:${border.space}`);
|
|
81561
|
+
return parts.join(",");
|
|
81562
|
+
};
|
|
81563
|
+
const hashTableBorderValue = (borderValue) => {
|
|
81564
|
+
if (borderValue === void 0) return "";
|
|
81565
|
+
if (borderValue === null) return "null";
|
|
81566
|
+
if (isNoneBorder(borderValue)) return "none";
|
|
81567
|
+
if (isBorderSpec(borderValue)) {
|
|
81568
|
+
return hashBorderSpec(borderValue);
|
|
81569
|
+
}
|
|
81570
|
+
return "";
|
|
81571
|
+
};
|
|
81572
|
+
const hashTableBorders = (borders) => {
|
|
81573
|
+
if (!borders) return "";
|
|
81574
|
+
const parts = [];
|
|
81575
|
+
if (borders.top !== void 0) parts.push(`t:[${hashTableBorderValue(borders.top)}]`);
|
|
81576
|
+
if (borders.right !== void 0) parts.push(`r:[${hashTableBorderValue(borders.right)}]`);
|
|
81577
|
+
if (borders.bottom !== void 0) parts.push(`b:[${hashTableBorderValue(borders.bottom)}]`);
|
|
81578
|
+
if (borders.left !== void 0) parts.push(`l:[${hashTableBorderValue(borders.left)}]`);
|
|
81579
|
+
if (borders.insideH !== void 0) parts.push(`ih:[${hashTableBorderValue(borders.insideH)}]`);
|
|
81580
|
+
if (borders.insideV !== void 0) parts.push(`iv:[${hashTableBorderValue(borders.insideV)}]`);
|
|
81581
|
+
return parts.join(";");
|
|
81582
|
+
};
|
|
81583
|
+
const hashCellBorders = (borders) => {
|
|
81584
|
+
if (!borders) return "";
|
|
81585
|
+
const parts = [];
|
|
81586
|
+
if (borders.top) parts.push(`t:[${hashBorderSpec(borders.top)}]`);
|
|
81587
|
+
if (borders.right) parts.push(`r:[${hashBorderSpec(borders.right)}]`);
|
|
81588
|
+
if (borders.bottom) parts.push(`b:[${hashBorderSpec(borders.bottom)}]`);
|
|
81589
|
+
if (borders.left) parts.push(`l:[${hashBorderSpec(borders.left)}]`);
|
|
81590
|
+
return parts.join(";");
|
|
81591
|
+
};
|
|
81441
81592
|
const MAX_CACHE_SIZE$1 = 1e4;
|
|
81442
81593
|
const BYTES_PER_ENTRY_ESTIMATE = 5e3;
|
|
81443
81594
|
const NORMALIZED_WHITESPACE = /\s+/g;
|
|
@@ -81465,6 +81616,26 @@ const hashRuns = (block) => {
|
|
|
81465
81616
|
continue;
|
|
81466
81617
|
}
|
|
81467
81618
|
for (const cell of row.cells) {
|
|
81619
|
+
if (cell.attrs) {
|
|
81620
|
+
const cellAttrs = cell.attrs;
|
|
81621
|
+
const cellAttrParts = [];
|
|
81622
|
+
if (cellAttrs.borders) {
|
|
81623
|
+
cellAttrParts.push(`cb:${hashCellBorders(cellAttrs.borders)}`);
|
|
81624
|
+
}
|
|
81625
|
+
if (cellAttrs.padding) {
|
|
81626
|
+
const p = cellAttrs.padding;
|
|
81627
|
+
cellAttrParts.push(`cp:${p.top ?? 0}:${p.right ?? 0}:${p.bottom ?? 0}:${p.left ?? 0}`);
|
|
81628
|
+
}
|
|
81629
|
+
if (cellAttrs.verticalAlign) {
|
|
81630
|
+
cellAttrParts.push(`va:${cellAttrs.verticalAlign}`);
|
|
81631
|
+
}
|
|
81632
|
+
if (cellAttrs.background) {
|
|
81633
|
+
cellAttrParts.push(`bg:${cellAttrs.background}`);
|
|
81634
|
+
}
|
|
81635
|
+
if (cellAttrParts.length > 0) {
|
|
81636
|
+
cellHashes.push(`ca:${cellAttrParts.join(":")}`);
|
|
81637
|
+
}
|
|
81638
|
+
}
|
|
81468
81639
|
const cellBlocks = cell.blocks ?? (cell.paragraph ? [cell.paragraph] : []);
|
|
81469
81640
|
for (const cellBlock of cellBlocks) {
|
|
81470
81641
|
const paragraphBlock = cellBlock;
|
|
@@ -81531,8 +81702,25 @@ const hashRuns = (block) => {
|
|
|
81531
81702
|
}
|
|
81532
81703
|
}
|
|
81533
81704
|
}
|
|
81705
|
+
let tableAttrsKey = "";
|
|
81706
|
+
if (tableBlock.attrs) {
|
|
81707
|
+
const tblAttrs = tableBlock.attrs;
|
|
81708
|
+
const tableAttrParts = [];
|
|
81709
|
+
if (tblAttrs.borders) {
|
|
81710
|
+
tableAttrParts.push(`tb:${hashTableBorders(tblAttrs.borders)}`);
|
|
81711
|
+
}
|
|
81712
|
+
if (tblAttrs.borderCollapse) {
|
|
81713
|
+
tableAttrParts.push(`bc:${tblAttrs.borderCollapse}`);
|
|
81714
|
+
}
|
|
81715
|
+
if (tblAttrs.cellSpacing !== void 0) {
|
|
81716
|
+
tableAttrParts.push(`cs:${tblAttrs.cellSpacing}`);
|
|
81717
|
+
}
|
|
81718
|
+
if (tableAttrParts.length > 0) {
|
|
81719
|
+
tableAttrsKey = `|ta:${tableAttrParts.join(":")}`;
|
|
81720
|
+
}
|
|
81721
|
+
}
|
|
81534
81722
|
const contentHash = cellHashes.join("|");
|
|
81535
|
-
return `${block.id}:table:${contentHash}`;
|
|
81723
|
+
return `${block.id}:table:${contentHash}${tableAttrsKey}`;
|
|
81536
81724
|
}
|
|
81537
81725
|
if (block.kind !== "paragraph") return block.id;
|
|
81538
81726
|
const trackedMode = block.attrs && "trackedChangesMode" in block.attrs && block.attrs.trackedChangesMode || "review";
|
|
@@ -85764,7 +85952,7 @@ async function measureParagraphBlock(block, maxWidth) {
|
|
|
85764
85952
|
const wordEndWithSpace = charPosInRun + (isLastWord ? word.length : word.length + 1);
|
|
85765
85953
|
const effectiveMaxWidth = currentLine ? currentLine.maxWidth : getEffectiveWidth(lines.length === 0 ? initialAvailableWidth : contentWidth);
|
|
85766
85954
|
if (wordOnlyWidth > effectiveMaxWidth && word.length > 1) {
|
|
85767
|
-
if (currentLine && currentLine.width > 0 && currentLine.segments.length > 0) {
|
|
85955
|
+
if (currentLine && currentLine.width > 0 && currentLine.segments && currentLine.segments.length > 0) {
|
|
85768
85956
|
const metrics = calculateTypographyMetrics(currentLine.maxFontSize, spacing, currentLine.maxFontInfo);
|
|
85769
85957
|
const { spaceCount: _sc, ...lineBase } = currentLine;
|
|
85770
85958
|
const completedLine = { ...lineBase, ...metrics };
|
|
@@ -85775,7 +85963,7 @@ async function measureParagraphBlock(block, maxWidth) {
|
|
|
85775
85963
|
currentLine = null;
|
|
85776
85964
|
}
|
|
85777
85965
|
const lineMaxWidth = getEffectiveWidth(lines.length === 0 ? initialAvailableWidth : contentWidth);
|
|
85778
|
-
const hasTabOnlyLine = currentLine && currentLine.segments.length === 0 && currentLine.width > 0;
|
|
85966
|
+
const hasTabOnlyLine = currentLine && currentLine.segments && currentLine.segments.length === 0 && currentLine.width > 0;
|
|
85779
85967
|
const remainingWidthAfterTab = hasTabOnlyLine ? currentLine.maxWidth - currentLine.width : lineMaxWidth;
|
|
85780
85968
|
const chunkWidth = hasTabOnlyLine ? Math.max(remainingWidthAfterTab, lineMaxWidth * 0.25) : lineMaxWidth;
|
|
85781
85969
|
const chunks = breakWordIntoChunks(word, chunkWidth - WIDTH_FUDGE_PX2, font, ctx2, run2);
|
|
@@ -85786,7 +85974,7 @@ async function measureParagraphBlock(block, maxWidth) {
|
|
|
85786
85974
|
const chunkEndChar = chunkCharOffset + chunk.text.length;
|
|
85787
85975
|
const isLastChunk = chunkIndex === chunks.length - 1;
|
|
85788
85976
|
const isFirstChunk = chunkIndex === 0;
|
|
85789
|
-
if (isFirstChunk && hasTabOnlyLine && currentLine) {
|
|
85977
|
+
if (isFirstChunk && hasTabOnlyLine && currentLine && currentLine.segments) {
|
|
85790
85978
|
currentLine.toRun = runIndex;
|
|
85791
85979
|
currentLine.toChar = chunkEndChar;
|
|
85792
85980
|
currentLine.width = roundValue(currentLine.width + chunk.width);
|
|
@@ -90023,18 +90211,19 @@ normalizeAwarenessStates_fn = function() {
|
|
|
90023
90211
|
const normalized = /* @__PURE__ */ new Map();
|
|
90024
90212
|
states?.forEach((aw, clientId) => {
|
|
90025
90213
|
if (clientId === provider.awareness?.clientID) return;
|
|
90026
|
-
|
|
90214
|
+
const awState = aw;
|
|
90215
|
+
if (!awState.cursor) return;
|
|
90027
90216
|
try {
|
|
90028
90217
|
const anchor = relativePositionToAbsolutePosition(
|
|
90029
90218
|
ystate.doc,
|
|
90030
90219
|
ystate.type,
|
|
90031
|
-
Y__namespace.createRelativePositionFromJSON(
|
|
90220
|
+
Y__namespace.createRelativePositionFromJSON(awState.cursor.anchor),
|
|
90032
90221
|
ystate.binding.mapping
|
|
90033
90222
|
);
|
|
90034
90223
|
const head = relativePositionToAbsolutePosition(
|
|
90035
90224
|
ystate.doc,
|
|
90036
90225
|
ystate.type,
|
|
90037
|
-
Y__namespace.createRelativePositionFromJSON(
|
|
90226
|
+
Y__namespace.createRelativePositionFromJSON(awState.cursor.head),
|
|
90038
90227
|
ystate.binding.mapping
|
|
90039
90228
|
);
|
|
90040
90229
|
if (anchor === null || head === null) return;
|
|
@@ -90046,9 +90235,9 @@ normalizeAwarenessStates_fn = function() {
|
|
|
90046
90235
|
normalized.set(clientId, {
|
|
90047
90236
|
clientId,
|
|
90048
90237
|
user: {
|
|
90049
|
-
name:
|
|
90050
|
-
email:
|
|
90051
|
-
color:
|
|
90238
|
+
name: awState.user?.name,
|
|
90239
|
+
email: awState.user?.email,
|
|
90240
|
+
color: awState.user?.color || __privateMethod$1(this, _PresentationEditor_instances, getFallbackColor_fn).call(this, clientId)
|
|
90052
90241
|
},
|
|
90053
90242
|
anchor: clampedAnchor,
|
|
90054
90243
|
head: clampedHead,
|
|
@@ -92522,8 +92711,8 @@ computeCaretLayoutRectGeometry_fn = function(pos, includeDomFallback = true) {
|
|
|
92522
92711
|
const zoom2 = __privateGet$1(this, _layoutOptions).zoom ?? 1;
|
|
92523
92712
|
let domCaretX2 = null;
|
|
92524
92713
|
let domCaretY2 = null;
|
|
92525
|
-
const spanEls2 = pageEl2?.querySelectorAll("span[data-pm-start][data-pm-end]")
|
|
92526
|
-
for (const spanEl of spanEls2) {
|
|
92714
|
+
const spanEls2 = pageEl2?.querySelectorAll("span[data-pm-start][data-pm-end]");
|
|
92715
|
+
for (const spanEl of Array.from(spanEls2 ?? [])) {
|
|
92527
92716
|
const pmStart = Number(spanEl.dataset.pmStart);
|
|
92528
92717
|
const pmEnd = Number(spanEl.dataset.pmEnd);
|
|
92529
92718
|
if (pos >= pmStart && pos <= pmEnd && spanEl.firstChild?.nodeType === Node.TEXT_NODE) {
|
|
@@ -92575,8 +92764,8 @@ computeCaretLayoutRectGeometry_fn = function(pos, includeDomFallback = true) {
|
|
|
92575
92764
|
const zoom = __privateGet$1(this, _layoutOptions).zoom ?? 1;
|
|
92576
92765
|
let domCaretX = null;
|
|
92577
92766
|
let domCaretY = null;
|
|
92578
|
-
const spanEls = pageEl?.querySelectorAll("span[data-pm-start][data-pm-end]")
|
|
92579
|
-
for (const spanEl of spanEls) {
|
|
92767
|
+
const spanEls = pageEl?.querySelectorAll("span[data-pm-start][data-pm-end]");
|
|
92768
|
+
for (const spanEl of Array.from(spanEls ?? [])) {
|
|
92580
92769
|
const pmStart = Number(spanEl.dataset.pmStart);
|
|
92581
92770
|
const pmEnd = Number(spanEl.dataset.pmEnd);
|
|
92582
92771
|
if (pos >= pmStart && pos <= pmEnd && spanEl.firstChild?.nodeType === Node.TEXT_NODE) {
|
|
@@ -98145,14 +98334,19 @@ const createCell = (cellType, cellContent = null) => {
|
|
|
98145
98334
|
}
|
|
98146
98335
|
return cellType.createAndFill();
|
|
98147
98336
|
};
|
|
98148
|
-
const createTableBorders = (
|
|
98337
|
+
const createTableBorders = (borderSpec = {}) => {
|
|
98338
|
+
borderSpec = {
|
|
98339
|
+
size: 0.66665,
|
|
98340
|
+
color: "#000000",
|
|
98341
|
+
...borderSpec
|
|
98342
|
+
};
|
|
98149
98343
|
return {
|
|
98150
|
-
top:
|
|
98151
|
-
left:
|
|
98152
|
-
bottom:
|
|
98153
|
-
right:
|
|
98154
|
-
insideH:
|
|
98155
|
-
insideV:
|
|
98344
|
+
top: borderSpec,
|
|
98345
|
+
left: borderSpec,
|
|
98346
|
+
bottom: borderSpec,
|
|
98347
|
+
right: borderSpec,
|
|
98348
|
+
insideH: borderSpec,
|
|
98349
|
+
insideV: borderSpec
|
|
98156
98350
|
};
|
|
98157
98351
|
};
|
|
98158
98352
|
const createTable = (schema, rowsCount, colsCount, withHeaderRow, cellContent = null) => {
|
|
@@ -98280,12 +98474,17 @@ const deleteTableWhenSelected = ({ editor }) => {
|
|
|
98280
98474
|
editor.commands.deleteTable();
|
|
98281
98475
|
return true;
|
|
98282
98476
|
};
|
|
98283
|
-
const createCellBorders = (
|
|
98477
|
+
const createCellBorders = (borderSpec = {}) => {
|
|
98478
|
+
borderSpec = {
|
|
98479
|
+
size: 0.66665,
|
|
98480
|
+
color: "#000000",
|
|
98481
|
+
...borderSpec
|
|
98482
|
+
};
|
|
98284
98483
|
return {
|
|
98285
|
-
top:
|
|
98286
|
-
left:
|
|
98287
|
-
bottom:
|
|
98288
|
-
right:
|
|
98484
|
+
top: borderSpec,
|
|
98485
|
+
left: borderSpec,
|
|
98486
|
+
bottom: borderSpec,
|
|
98487
|
+
right: borderSpec
|
|
98289
98488
|
};
|
|
98290
98489
|
};
|
|
98291
98490
|
function cellAround($pos) {
|
|
@@ -99052,13 +99251,20 @@ const Table = Node$1.create({
|
|
|
99052
99251
|
if (["tableCell", "tableHeader"].includes(node.type.name)) {
|
|
99053
99252
|
tr.setNodeMarkup(pos, void 0, {
|
|
99054
99253
|
...node.attrs,
|
|
99055
|
-
borders: createCellBorders({ size: 0 })
|
|
99254
|
+
borders: createCellBorders({ size: 0, space: 0, val: "none", color: "auto" })
|
|
99056
99255
|
});
|
|
99057
99256
|
}
|
|
99058
99257
|
});
|
|
99059
99258
|
tr.setNodeMarkup(table.pos, void 0, {
|
|
99060
99259
|
...table.node.attrs,
|
|
99061
|
-
borders: createTableBorders({ size: 0 })
|
|
99260
|
+
borders: createTableBorders({ size: 0 }),
|
|
99261
|
+
// TODO: This works around the issue that table borders are duplicated between
|
|
99262
|
+
// the attributes of the table and the tableProperties attribute.
|
|
99263
|
+
// This can be removed when the redundancy is eliminated.
|
|
99264
|
+
tableProperties: {
|
|
99265
|
+
...table.node.attrs.tableProperties,
|
|
99266
|
+
borders: createTableBorders({ size: 0, space: 0, val: "none", color: "auto" })
|
|
99267
|
+
}
|
|
99062
99268
|
});
|
|
99063
99269
|
return true;
|
|
99064
99270
|
}
|
|
@@ -123060,7 +123266,7 @@ const makeDefaultItems = ({
|
|
|
123060
123266
|
}
|
|
123061
123267
|
},
|
|
123062
123268
|
{
|
|
123063
|
-
label: toolbarTexts2.
|
|
123269
|
+
label: toolbarTexts2.removeBorders,
|
|
123064
123270
|
command: "deleteCellAndTableBorders",
|
|
123065
123271
|
icon: toolbarIcons2.deleteBorders,
|
|
123066
123272
|
bottomBorder: true,
|
|
@@ -123641,7 +123847,7 @@ const toolbarTexts = {
|
|
|
123641
123847
|
deleteRow: "Delete row",
|
|
123642
123848
|
deleteColumn: "Delete column",
|
|
123643
123849
|
deleteTable: "Delete table",
|
|
123644
|
-
|
|
123850
|
+
removeBorders: "Remove borders",
|
|
123645
123851
|
mergeCells: "Merge cells",
|
|
123646
123852
|
splitCell: "Split cell",
|
|
123647
123853
|
fixTables: "Fix tables",
|
|
@@ -124679,7 +124885,7 @@ const TEXTS = {
|
|
|
124679
124885
|
deleteRow: "Delete row",
|
|
124680
124886
|
deleteColumn: "Delete column",
|
|
124681
124887
|
deleteTable: "Delete table",
|
|
124682
|
-
|
|
124888
|
+
removeBorders: "Remove borders",
|
|
124683
124889
|
mergeCells: "Merge cells",
|
|
124684
124890
|
splitCell: "Split cell",
|
|
124685
124891
|
fixTables: "Fix tables",
|
|
@@ -124762,7 +124968,7 @@ const tableActionsOptions = [
|
|
|
124762
124968
|
}
|
|
124763
124969
|
},
|
|
124764
124970
|
{
|
|
124765
|
-
label: TEXTS.
|
|
124971
|
+
label: TEXTS.removeBorders,
|
|
124766
124972
|
command: "deleteCellAndTableBorders",
|
|
124767
124973
|
icon: ICONS.deleteBorders,
|
|
124768
124974
|
bottomBorder: true,
|