@harbour-enterprises/superdoc 1.0.0-beta.102 → 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-BFqkSyYx.es.js → PdfViewer-Dbqwkn0G.es.js} +1 -1
- package/dist/chunks/{PdfViewer-X1sOA7hm.cjs → PdfViewer-S_8SIFPi.cjs} +1 -1
- package/dist/chunks/{index-BP1yyX4N.es.js → index-C5Rf8gqE.es.js} +3 -3
- package/dist/chunks/{index-f4ON3m7j.cjs → index-D4NTCKO5.cjs} +3 -3
- package/dist/chunks/{index-nVrA3URL-BssoM7VE.cjs → index-DQVMKA35-DwhGWytr.cjs} +1 -1
- package/dist/chunks/{index-nVrA3URL-vs_NmI3L.es.js → index-DQVMKA35-xsiaflRZ.es.js} +1 -1
- package/dist/chunks/{super-editor.es-B7Xuihea.cjs → super-editor.es-CCmmUDjt.cjs} +202 -29
- package/dist/chunks/{super-editor.es-BM69n_BR.es.js → super-editor.es-D6ttXPUE.es.js} +202 -29
- package/dist/super-editor/ai-writer.es.js +2 -2
- package/dist/super-editor/chunks/{converter-NrpPx2Xr.js → converter-CE9B4HYb.js} +1 -1
- package/dist/super-editor/chunks/{docx-zipper-oyKPvmaC.js → docx-zipper-Bt1IoMBF.js} +1 -1
- package/dist/super-editor/chunks/{editor-Dnw031hl.js → editor-DLjQOZqB.js} +203 -30
- package/dist/super-editor/chunks/{index-nVrA3URL.js → index-DQVMKA35.js} +1 -1
- package/dist/super-editor/chunks/{toolbar-OrlYExrD.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 +6 -6
- 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 +204 -31
- package/dist/superdoc.umd.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { y as defineComponent, z as h, O as Transition, a0 as process$1, J as watchEffect, a as computed, r as ref, j as onMounted, W as onUnmounted, b as createElementBlock, o as openBlock, f as createBaseVNode, e as createCommentVNode, u as createVNode, v as unref } from "./vue-Dysv_7z5.es.js";
|
|
2
|
-
import { d as derived, c, a as cB, f as fadeInTransition, b as cM, N as NBaseLoading, w as warnOnce, u as useConfig, e as useTheme, p as pxfy, g as createKey, h as useThemeClass, i as useCompitable, _ as _export_sfc, j as useSuperdocStore, s as storeToRefs, k as useSelection } from "./index-
|
|
2
|
+
import { d as derived, c, a as cB, f as fadeInTransition, b as cM, N as NBaseLoading, w as warnOnce, u as useConfig, e as useTheme, p as pxfy, g as createKey, h as useThemeClass, i as useCompitable, _ as _export_sfc, j as useSuperdocStore, s as storeToRefs, k as useSelection } from "./index-C5Rf8gqE.es.js";
|
|
3
3
|
function self(vars) {
|
|
4
4
|
const {
|
|
5
5
|
opacityDisabled,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
3
|
const vue = require("./vue-jWLMl8Ts.cjs");
|
|
4
|
-
const superdoc = require("./index-
|
|
4
|
+
const superdoc = require("./index-D4NTCKO5.cjs");
|
|
5
5
|
function self(vars) {
|
|
6
6
|
const {
|
|
7
7
|
opacityDisabled,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { q as index, C as CommentsPluginKey, h as TrackChangesBasePluginKey, E as Editor, n as getRichTextExtensions, f as SuperInput, P as PresentationEditor, e as SuperEditor, A as AIWriter, g as SuperToolbar, i as createZip } from "./super-editor.es-
|
|
1
|
+
import { q as index, C as CommentsPluginKey, h as TrackChangesBasePluginKey, E as Editor, n as getRichTextExtensions, f as SuperInput, P as PresentationEditor, e as SuperEditor, A as AIWriter, g as SuperToolbar, i as createZip } from "./super-editor.es-D6ttXPUE.es.js";
|
|
2
2
|
import { B as BlankDOCX } from "./blank-docx-ABm6XYAA.es.js";
|
|
3
3
|
import { E as EventEmitter } from "./eventemitter3-CcXAdeql.es.js";
|
|
4
4
|
import { HocuspocusProvider, HocuspocusProviderWebsocket } from "@hocuspocus/provider";
|
|
@@ -17242,7 +17242,7 @@ const _sfc_main = {
|
|
|
17242
17242
|
__name: "SuperDoc",
|
|
17243
17243
|
emits: ["selection-update"],
|
|
17244
17244
|
setup(__props, { emit: __emit }) {
|
|
17245
|
-
const PdfViewer = defineAsyncComponent(() => import("./PdfViewer-
|
|
17245
|
+
const PdfViewer = defineAsyncComponent(() => import("./PdfViewer-Dbqwkn0G.es.js"));
|
|
17246
17246
|
const superdocStore = useSuperdocStore();
|
|
17247
17247
|
const commentsStore = useCommentsStore();
|
|
17248
17248
|
const {
|
|
@@ -18131,7 +18131,7 @@ class SuperDoc extends EventEmitter {
|
|
|
18131
18131
|
this.config.colors = shuffleArray(this.config.colors);
|
|
18132
18132
|
this.userColorMap = /* @__PURE__ */ new Map();
|
|
18133
18133
|
this.colorIndex = 0;
|
|
18134
|
-
this.version = "1.0.0-beta.
|
|
18134
|
+
this.version = "1.0.0-beta.103";
|
|
18135
18135
|
this.#log("🦋 [superdoc] Using SuperDoc version:", this.version);
|
|
18136
18136
|
this.superdocId = config.superdocId || v4();
|
|
18137
18137
|
this.colors = this.config.colors;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
const superEditor_es = require("./super-editor.es-
|
|
2
|
+
const superEditor_es = require("./super-editor.es-CCmmUDjt.cjs");
|
|
3
3
|
const blankDocx = require("./blank-docx-DfW3Eeh2.cjs");
|
|
4
4
|
const eventemitter3 = require("./eventemitter3-DQmQUge-.cjs");
|
|
5
5
|
const provider = require("@hocuspocus/provider");
|
|
@@ -17259,7 +17259,7 @@ const _sfc_main = {
|
|
|
17259
17259
|
__name: "SuperDoc",
|
|
17260
17260
|
emits: ["selection-update"],
|
|
17261
17261
|
setup(__props, { emit: __emit }) {
|
|
17262
|
-
const PdfViewer = vue.defineAsyncComponent(() => Promise.resolve().then(() => require("./PdfViewer-
|
|
17262
|
+
const PdfViewer = vue.defineAsyncComponent(() => Promise.resolve().then(() => require("./PdfViewer-S_8SIFPi.cjs")));
|
|
17263
17263
|
const superdocStore = useSuperdocStore();
|
|
17264
17264
|
const commentsStore = useCommentsStore();
|
|
17265
17265
|
const {
|
|
@@ -18148,7 +18148,7 @@ class SuperDoc extends eventemitter3.EventEmitter {
|
|
|
18148
18148
|
this.config.colors = shuffleArray(this.config.colors);
|
|
18149
18149
|
this.userColorMap = /* @__PURE__ */ new Map();
|
|
18150
18150
|
this.colorIndex = 0;
|
|
18151
|
-
this.version = "1.0.0-beta.
|
|
18151
|
+
this.version = "1.0.0-beta.103";
|
|
18152
18152
|
this.#log("🦋 [superdoc] Using SuperDoc version:", this.version);
|
|
18153
18153
|
this.superdocId = config.superdocId || uuid.v4();
|
|
18154
18154
|
this.colors = this.config.colors;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const superEditor_es = require("./super-editor.es-
|
|
3
|
+
const superEditor_es = require("./super-editor.es-CCmmUDjt.cjs");
|
|
4
4
|
const indexCvBqQJbG = require("./index-CvBqQJbG-Dwm0THD7.cjs");
|
|
5
5
|
function bail(error) {
|
|
6
6
|
if (error) {
|
|
@@ -42427,7 +42427,7 @@ const _SuperConverter = class _SuperConverter2 {
|
|
|
42427
42427
|
static getStoredSuperdocVersion(docx) {
|
|
42428
42428
|
return _SuperConverter2.getStoredCustomProperty(docx, "SuperdocVersion");
|
|
42429
42429
|
}
|
|
42430
|
-
static setStoredSuperdocVersion(docx = this.convertedXml, version2 = "1.0.0-beta.
|
|
42430
|
+
static setStoredSuperdocVersion(docx = this.convertedXml, version2 = "1.0.0-beta.103") {
|
|
42431
42431
|
return _SuperConverter2.setStoredCustomProperty(docx, "SuperdocVersion", version2, false);
|
|
42432
42432
|
}
|
|
42433
42433
|
/**
|
|
@@ -59655,7 +59655,7 @@ const isHeadless = (editor) => {
|
|
|
59655
59655
|
const shouldSkipNodeView = (editor) => {
|
|
59656
59656
|
return isHeadless(editor);
|
|
59657
59657
|
};
|
|
59658
|
-
const summaryVersion = "1.0.0-beta.
|
|
59658
|
+
const summaryVersion = "1.0.0-beta.103";
|
|
59659
59659
|
const nodeKeys = ["group", "content", "marks", "inline", "atom", "defining", "code", "tableRole", "summary"];
|
|
59660
59660
|
const markKeys = ["group", "inclusive", "excludes", "spanning", "code"];
|
|
59661
59661
|
function mapAttributes(attrs) {
|
|
@@ -60015,11 +60015,11 @@ const _Editor = class _Editor2 extends EventEmitter$1 {
|
|
|
60015
60015
|
if (!this.options.isNewFile || !this.options.collaborationProvider) return;
|
|
60016
60016
|
const provider = this.options.collaborationProvider;
|
|
60017
60017
|
const postSyncInit = () => {
|
|
60018
|
-
provider.off("synced", postSyncInit);
|
|
60018
|
+
provider.off?.("synced", postSyncInit);
|
|
60019
60019
|
__privateMethod$1(this, _Editor_instances, insertNewFileData_fn).call(this);
|
|
60020
60020
|
};
|
|
60021
60021
|
if (provider.synced) __privateMethod$1(this, _Editor_instances, insertNewFileData_fn).call(this);
|
|
60022
|
-
else provider.on("synced", postSyncInit);
|
|
60022
|
+
else provider.on?.("synced", postSyncInit);
|
|
60023
60023
|
}
|
|
60024
60024
|
/**
|
|
60025
60025
|
* Replace content of editor that was created with loadFromSchema option
|
|
@@ -60444,7 +60444,7 @@ const _Editor = class _Editor2 extends EventEmitter$1 {
|
|
|
60444
60444
|
{ default: remarkStringify },
|
|
60445
60445
|
{ default: remarkGfm }
|
|
60446
60446
|
] = await Promise.all([
|
|
60447
|
-
Promise.resolve().then(() => require("./index-
|
|
60447
|
+
Promise.resolve().then(() => require("./index-DQVMKA35-DwhGWytr.cjs")),
|
|
60448
60448
|
Promise.resolve().then(() => require("./index-DRCvimau-H4Ck3S9a.cjs")),
|
|
60449
60449
|
Promise.resolve().then(() => require("./index-C_x_N6Uh-Db3CUJMX.cjs")),
|
|
60450
60450
|
Promise.resolve().then(() => require("./index-D_sWOSiG-BtDZzJ6I.cjs")),
|
|
@@ -60649,7 +60649,7 @@ const _Editor = class _Editor2 extends EventEmitter$1 {
|
|
|
60649
60649
|
* Process collaboration migrations
|
|
60650
60650
|
*/
|
|
60651
60651
|
processCollaborationMigrations() {
|
|
60652
|
-
console.debug("[checkVersionMigrations] Current editor version", "1.0.0-beta.
|
|
60652
|
+
console.debug("[checkVersionMigrations] Current editor version", "1.0.0-beta.103");
|
|
60653
60653
|
if (!this.options.ydoc) return;
|
|
60654
60654
|
const metaMap = this.options.ydoc.getMap("meta");
|
|
60655
60655
|
let docVersion = metaMap.get("version");
|
|
@@ -63764,6 +63764,7 @@ function hydrateImageBlocks(blocks, mediaFiles) {
|
|
|
63764
63764
|
if (cellChanged) {
|
|
63765
63765
|
return {
|
|
63766
63766
|
...cell,
|
|
63767
|
+
// Cast to expected type - hydrateBlock preserves block kinds, just hydrates image sources
|
|
63767
63768
|
blocks: hydratedBlocks.length > 0 ? hydratedBlocks : cell.blocks,
|
|
63768
63769
|
paragraph: hydratedParagraph
|
|
63769
63770
|
};
|
|
@@ -67384,7 +67385,7 @@ const computeParagraphAttrs = (para, styleContext, listCounterContext, converter
|
|
|
67384
67385
|
};
|
|
67385
67386
|
}
|
|
67386
67387
|
const hasValidNumbering = rawNumberingProps && isValidNumberingId(rawNumberingProps.numId);
|
|
67387
|
-
if (hasValidNumbering) {
|
|
67388
|
+
if (hasValidNumbering && rawNumberingProps) {
|
|
67388
67389
|
const numberingProps = rawNumberingProps;
|
|
67389
67390
|
const numId = numberingProps.numId;
|
|
67390
67391
|
const ilvl = Number.isFinite(numberingProps.ilvl) ? Math.max(0, Math.floor(Number(numberingProps.ilvl))) : 0;
|
|
@@ -67424,6 +67425,8 @@ const computeParagraphAttrs = (para, styleContext, listCounterContext, converter
|
|
|
67424
67425
|
const resolvedCounterValue = path[path.length - 1] ?? counterValue;
|
|
67425
67426
|
const enrichedNumberingProps = {
|
|
67426
67427
|
...numberingProps,
|
|
67428
|
+
numId: numberingProps.numId,
|
|
67429
|
+
ilvl: numberingProps.ilvl,
|
|
67427
67430
|
path,
|
|
67428
67431
|
counterValue: resolvedCounterValue
|
|
67429
67432
|
};
|
|
@@ -69520,7 +69523,7 @@ const parseTableCell = (args) => {
|
|
|
69520
69523
|
context.nextBlockId,
|
|
69521
69524
|
context.positions
|
|
69522
69525
|
);
|
|
69523
|
-
if (drawingBlock) {
|
|
69526
|
+
if (drawingBlock && drawingBlock.kind === "drawing") {
|
|
69524
69527
|
blocks.push(drawingBlock);
|
|
69525
69528
|
}
|
|
69526
69529
|
continue;
|
|
@@ -69531,7 +69534,7 @@ const parseTableCell = (args) => {
|
|
|
69531
69534
|
context.nextBlockId,
|
|
69532
69535
|
context.positions
|
|
69533
69536
|
);
|
|
69534
|
-
if (drawingBlock) {
|
|
69537
|
+
if (drawingBlock && drawingBlock.kind === "drawing") {
|
|
69535
69538
|
blocks.push(drawingBlock);
|
|
69536
69539
|
}
|
|
69537
69540
|
continue;
|
|
@@ -69542,7 +69545,7 @@ const parseTableCell = (args) => {
|
|
|
69542
69545
|
context.nextBlockId,
|
|
69543
69546
|
context.positions
|
|
69544
69547
|
);
|
|
69545
|
-
if (drawingBlock) {
|
|
69548
|
+
if (drawingBlock && drawingBlock.kind === "drawing") {
|
|
69546
69549
|
blocks.push(drawingBlock);
|
|
69547
69550
|
}
|
|
69548
69551
|
continue;
|
|
@@ -69553,7 +69556,7 @@ const parseTableCell = (args) => {
|
|
|
69553
69556
|
context.nextBlockId,
|
|
69554
69557
|
context.positions
|
|
69555
69558
|
);
|
|
69556
|
-
if (drawingBlock) {
|
|
69559
|
+
if (drawingBlock && drawingBlock.kind === "drawing") {
|
|
69557
69560
|
blocks.push(drawingBlock);
|
|
69558
69561
|
}
|
|
69559
69562
|
}
|
|
@@ -70008,7 +70011,19 @@ function toFlowBlocks(pmDoc, options) {
|
|
|
70008
70011
|
bookmarks2,
|
|
70009
70012
|
hyperlinkConfig2,
|
|
70010
70013
|
themeColorsParam ?? themeColors,
|
|
70011
|
-
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
|
+
}
|
|
70012
70027
|
);
|
|
70013
70028
|
const handlerContext = {
|
|
70014
70029
|
blocks,
|
|
@@ -70029,6 +70044,7 @@ function toFlowBlocks(pmDoc, options) {
|
|
|
70029
70044
|
currentParagraphIndex: 0
|
|
70030
70045
|
},
|
|
70031
70046
|
converters: {
|
|
70047
|
+
// Type assertion needed due to signature mismatch between actual function and type definition
|
|
70032
70048
|
paragraphToFlowBlocks: paragraphConverter,
|
|
70033
70049
|
tableNodeToBlock: tableConverter,
|
|
70034
70050
|
imageNodeToBlock,
|
|
@@ -70124,6 +70140,7 @@ function paragraphToFlowBlocks(para, nextBlockId, positions, defaultFont, defaul
|
|
|
70124
70140
|
{
|
|
70125
70141
|
listCounterContext,
|
|
70126
70142
|
converters: {
|
|
70143
|
+
// Type assertion needed due to signature mismatch between actual function and type definition
|
|
70127
70144
|
paragraphToFlowBlocks: paragraphToFlowBlocks$1,
|
|
70128
70145
|
imageNodeToBlock,
|
|
70129
70146
|
vectorShapeNodeToDrawingBlock,
|
|
@@ -70137,7 +70154,7 @@ function paragraphToFlowBlocks(para, nextBlockId, positions, defaultFont, defaul
|
|
|
70137
70154
|
converterContext
|
|
70138
70155
|
);
|
|
70139
70156
|
}
|
|
70140
|
-
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) {
|
|
70141
70158
|
return tableNodeToBlock$1(
|
|
70142
70159
|
node,
|
|
70143
70160
|
nextBlockId,
|
|
@@ -70151,8 +70168,9 @@ function tableNodeToBlock(node, nextBlockId, positions, defaultFont, defaultSize
|
|
|
70151
70168
|
themeColors,
|
|
70152
70169
|
paragraphToFlowBlocks,
|
|
70153
70170
|
converterContext,
|
|
70154
|
-
{
|
|
70171
|
+
options ?? {
|
|
70155
70172
|
converters: {
|
|
70173
|
+
// Type assertion needed due to signature mismatch between actual function and type definition
|
|
70156
70174
|
paragraphToFlowBlocks: paragraphToFlowBlocks$1,
|
|
70157
70175
|
imageNodeToBlock,
|
|
70158
70176
|
vectorShapeNodeToDrawingBlock,
|
|
@@ -74456,6 +74474,49 @@ const hashParagraphBorders$1 = (borders) => {
|
|
|
74456
74474
|
if (borders.left) parts.push(`l:[${hashParagraphBorder$1(borders.left)}]`);
|
|
74457
74475
|
return parts.join(";");
|
|
74458
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
|
+
};
|
|
74459
74520
|
const hasStringProp = (run2, prop) => {
|
|
74460
74521
|
return prop in run2 && typeof run2[prop] === "string";
|
|
74461
74522
|
};
|
|
@@ -77671,6 +77732,25 @@ const deriveBlockVersion = (block) => {
|
|
|
77671
77732
|
hash2 = hashNumber(hash2, cellBlocks.length);
|
|
77672
77733
|
hash2 = hashNumber(hash2, cell.rowSpan ?? 1);
|
|
77673
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
|
+
}
|
|
77674
77754
|
for (const cellBlock of cellBlocks) {
|
|
77675
77755
|
hash2 = hashString(hash2, cellBlock?.kind ?? "unknown");
|
|
77676
77756
|
if (cellBlock?.kind === "paragraph") {
|
|
@@ -77716,6 +77796,18 @@ const deriveBlockVersion = (block) => {
|
|
|
77716
77796
|
}
|
|
77717
77797
|
}
|
|
77718
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
|
+
}
|
|
77719
77811
|
return [block.id, tableBlock.rows.length, hash2.toString(16)].join("|");
|
|
77720
77812
|
}
|
|
77721
77813
|
return block.id;
|
|
@@ -78468,7 +78560,7 @@ function isListItem(markerWidth, block) {
|
|
|
78468
78560
|
return false;
|
|
78469
78561
|
}
|
|
78470
78562
|
const wordLayout = getWordLayoutConfig(block);
|
|
78471
|
-
const hasListAttrs = block.attrs?.listItem != null || wordLayout?.marker != null;
|
|
78563
|
+
const hasListAttrs = block.attrs?.listItem != null || block.attrs?.numberingProperties != null || wordLayout?.marker != null;
|
|
78472
78564
|
if (hasListAttrs) {
|
|
78473
78565
|
return true;
|
|
78474
78566
|
}
|
|
@@ -81454,6 +81546,49 @@ const hashParagraphBorders = (borders) => {
|
|
|
81454
81546
|
if (borders.left) parts.push(`l:[${hashParagraphBorder(borders.left)}]`);
|
|
81455
81547
|
return parts.join(";");
|
|
81456
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
|
+
};
|
|
81457
81592
|
const MAX_CACHE_SIZE$1 = 1e4;
|
|
81458
81593
|
const BYTES_PER_ENTRY_ESTIMATE = 5e3;
|
|
81459
81594
|
const NORMALIZED_WHITESPACE = /\s+/g;
|
|
@@ -81481,6 +81616,26 @@ const hashRuns = (block) => {
|
|
|
81481
81616
|
continue;
|
|
81482
81617
|
}
|
|
81483
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
|
+
}
|
|
81484
81639
|
const cellBlocks = cell.blocks ?? (cell.paragraph ? [cell.paragraph] : []);
|
|
81485
81640
|
for (const cellBlock of cellBlocks) {
|
|
81486
81641
|
const paragraphBlock = cellBlock;
|
|
@@ -81547,8 +81702,25 @@ const hashRuns = (block) => {
|
|
|
81547
81702
|
}
|
|
81548
81703
|
}
|
|
81549
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
|
+
}
|
|
81550
81722
|
const contentHash = cellHashes.join("|");
|
|
81551
|
-
return `${block.id}:table:${contentHash}`;
|
|
81723
|
+
return `${block.id}:table:${contentHash}${tableAttrsKey}`;
|
|
81552
81724
|
}
|
|
81553
81725
|
if (block.kind !== "paragraph") return block.id;
|
|
81554
81726
|
const trackedMode = block.attrs && "trackedChangesMode" in block.attrs && block.attrs.trackedChangesMode || "review";
|
|
@@ -85780,7 +85952,7 @@ async function measureParagraphBlock(block, maxWidth) {
|
|
|
85780
85952
|
const wordEndWithSpace = charPosInRun + (isLastWord ? word.length : word.length + 1);
|
|
85781
85953
|
const effectiveMaxWidth = currentLine ? currentLine.maxWidth : getEffectiveWidth(lines.length === 0 ? initialAvailableWidth : contentWidth);
|
|
85782
85954
|
if (wordOnlyWidth > effectiveMaxWidth && word.length > 1) {
|
|
85783
|
-
if (currentLine && currentLine.width > 0 && currentLine.segments.length > 0) {
|
|
85955
|
+
if (currentLine && currentLine.width > 0 && currentLine.segments && currentLine.segments.length > 0) {
|
|
85784
85956
|
const metrics = calculateTypographyMetrics(currentLine.maxFontSize, spacing, currentLine.maxFontInfo);
|
|
85785
85957
|
const { spaceCount: _sc, ...lineBase } = currentLine;
|
|
85786
85958
|
const completedLine = { ...lineBase, ...metrics };
|
|
@@ -85791,7 +85963,7 @@ async function measureParagraphBlock(block, maxWidth) {
|
|
|
85791
85963
|
currentLine = null;
|
|
85792
85964
|
}
|
|
85793
85965
|
const lineMaxWidth = getEffectiveWidth(lines.length === 0 ? initialAvailableWidth : contentWidth);
|
|
85794
|
-
const hasTabOnlyLine = currentLine && currentLine.segments.length === 0 && currentLine.width > 0;
|
|
85966
|
+
const hasTabOnlyLine = currentLine && currentLine.segments && currentLine.segments.length === 0 && currentLine.width > 0;
|
|
85795
85967
|
const remainingWidthAfterTab = hasTabOnlyLine ? currentLine.maxWidth - currentLine.width : lineMaxWidth;
|
|
85796
85968
|
const chunkWidth = hasTabOnlyLine ? Math.max(remainingWidthAfterTab, lineMaxWidth * 0.25) : lineMaxWidth;
|
|
85797
85969
|
const chunks = breakWordIntoChunks(word, chunkWidth - WIDTH_FUDGE_PX2, font, ctx2, run2);
|
|
@@ -85802,7 +85974,7 @@ async function measureParagraphBlock(block, maxWidth) {
|
|
|
85802
85974
|
const chunkEndChar = chunkCharOffset + chunk.text.length;
|
|
85803
85975
|
const isLastChunk = chunkIndex === chunks.length - 1;
|
|
85804
85976
|
const isFirstChunk = chunkIndex === 0;
|
|
85805
|
-
if (isFirstChunk && hasTabOnlyLine && currentLine) {
|
|
85977
|
+
if (isFirstChunk && hasTabOnlyLine && currentLine && currentLine.segments) {
|
|
85806
85978
|
currentLine.toRun = runIndex;
|
|
85807
85979
|
currentLine.toChar = chunkEndChar;
|
|
85808
85980
|
currentLine.width = roundValue(currentLine.width + chunk.width);
|
|
@@ -90039,18 +90211,19 @@ normalizeAwarenessStates_fn = function() {
|
|
|
90039
90211
|
const normalized = /* @__PURE__ */ new Map();
|
|
90040
90212
|
states?.forEach((aw, clientId) => {
|
|
90041
90213
|
if (clientId === provider.awareness?.clientID) return;
|
|
90042
|
-
|
|
90214
|
+
const awState = aw;
|
|
90215
|
+
if (!awState.cursor) return;
|
|
90043
90216
|
try {
|
|
90044
90217
|
const anchor = relativePositionToAbsolutePosition(
|
|
90045
90218
|
ystate.doc,
|
|
90046
90219
|
ystate.type,
|
|
90047
|
-
Y__namespace.createRelativePositionFromJSON(
|
|
90220
|
+
Y__namespace.createRelativePositionFromJSON(awState.cursor.anchor),
|
|
90048
90221
|
ystate.binding.mapping
|
|
90049
90222
|
);
|
|
90050
90223
|
const head = relativePositionToAbsolutePosition(
|
|
90051
90224
|
ystate.doc,
|
|
90052
90225
|
ystate.type,
|
|
90053
|
-
Y__namespace.createRelativePositionFromJSON(
|
|
90226
|
+
Y__namespace.createRelativePositionFromJSON(awState.cursor.head),
|
|
90054
90227
|
ystate.binding.mapping
|
|
90055
90228
|
);
|
|
90056
90229
|
if (anchor === null || head === null) return;
|
|
@@ -90062,9 +90235,9 @@ normalizeAwarenessStates_fn = function() {
|
|
|
90062
90235
|
normalized.set(clientId, {
|
|
90063
90236
|
clientId,
|
|
90064
90237
|
user: {
|
|
90065
|
-
name:
|
|
90066
|
-
email:
|
|
90067
|
-
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)
|
|
90068
90241
|
},
|
|
90069
90242
|
anchor: clampedAnchor,
|
|
90070
90243
|
head: clampedHead,
|
|
@@ -92538,8 +92711,8 @@ computeCaretLayoutRectGeometry_fn = function(pos, includeDomFallback = true) {
|
|
|
92538
92711
|
const zoom2 = __privateGet$1(this, _layoutOptions).zoom ?? 1;
|
|
92539
92712
|
let domCaretX2 = null;
|
|
92540
92713
|
let domCaretY2 = null;
|
|
92541
|
-
const spanEls2 = pageEl2?.querySelectorAll("span[data-pm-start][data-pm-end]")
|
|
92542
|
-
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 ?? [])) {
|
|
92543
92716
|
const pmStart = Number(spanEl.dataset.pmStart);
|
|
92544
92717
|
const pmEnd = Number(spanEl.dataset.pmEnd);
|
|
92545
92718
|
if (pos >= pmStart && pos <= pmEnd && spanEl.firstChild?.nodeType === Node.TEXT_NODE) {
|
|
@@ -92591,8 +92764,8 @@ computeCaretLayoutRectGeometry_fn = function(pos, includeDomFallback = true) {
|
|
|
92591
92764
|
const zoom = __privateGet$1(this, _layoutOptions).zoom ?? 1;
|
|
92592
92765
|
let domCaretX = null;
|
|
92593
92766
|
let domCaretY = null;
|
|
92594
|
-
const spanEls = pageEl?.querySelectorAll("span[data-pm-start][data-pm-end]")
|
|
92595
|
-
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 ?? [])) {
|
|
92596
92769
|
const pmStart = Number(spanEl.dataset.pmStart);
|
|
92597
92770
|
const pmEnd = Number(spanEl.dataset.pmEnd);
|
|
92598
92771
|
if (pos >= pmStart && pos <= pmEnd && spanEl.firstChild?.nodeType === Node.TEXT_NODE) {
|