superdoc 1.0.0-beta.55 → 1.0.0-beta.56
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-ObG30G-u.cjs → PdfViewer-CnvD--7P.cjs} +1 -1
- package/dist/chunks/{PdfViewer-ARRkZgYS.es.js → PdfViewer-DsYaXp0H.es.js} +1 -1
- package/dist/chunks/{index-DFHwDXHd.cjs → index-BpBdSm3V.cjs} +3 -3
- package/dist/chunks/{index-Bwqb03qi.es.js → index-DF1aQt8V.es.js} +3 -3
- package/dist/chunks/{index-bqjMjne1-DBB94Dlj.es.js → index-DYnUncjo-Br0s3gQs.es.js} +1 -1
- package/dist/chunks/{index-bqjMjne1-CJi4d9NS.cjs → index-DYnUncjo-Uv8YzgRb.cjs} +1 -1
- package/dist/chunks/{super-editor.es-7Twgz-8H.es.js → super-editor.es-BxMwj135.es.js} +43 -17
- package/dist/chunks/{super-editor.es-C2Ob7BbN.cjs → super-editor.es-DkFw0sfq.cjs} +43 -17
- package/dist/super-editor/ai-writer.es.js +2 -2
- package/dist/super-editor/chunks/{converter-D33MGATy.js → converter-DwC5XPQX.js} +1 -1
- package/dist/super-editor/chunks/{docx-zipper-C7Fp89_I.js → docx-zipper-BkCzC50U.js} +1 -1
- package/dist/super-editor/chunks/{editor-BiFHsy25.js → editor-CoKNeouN.js} +44 -18
- package/dist/super-editor/chunks/{index-bqjMjne1.js → index-DYnUncjo.js} +1 -1
- package/dist/super-editor/chunks/{toolbar-BNta2qOv.js → toolbar-DUWk-Bwi.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 +45 -19
- package/dist/superdoc.umd.js.map +1 -1
- package/package.json +1 -1
|
@@ -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-BpBdSm3V.cjs");
|
|
5
5
|
function self(vars) {
|
|
6
6
|
const {
|
|
7
7
|
opacityDisabled,
|
|
@@ -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-DF1aQt8V.es.js";
|
|
3
3
|
function self(vars) {
|
|
4
4
|
const {
|
|
5
5
|
opacityDisabled,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
const superEditor_es = require("./super-editor.es-
|
|
2
|
+
const superEditor_es = require("./super-editor.es-DkFw0sfq.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");
|
|
@@ -17268,7 +17268,7 @@ const _sfc_main = {
|
|
|
17268
17268
|
__name: "SuperDoc",
|
|
17269
17269
|
emits: ["selection-update"],
|
|
17270
17270
|
setup(__props, { emit: __emit }) {
|
|
17271
|
-
const PdfViewer = vue.defineAsyncComponent(() => Promise.resolve().then(() => require("./PdfViewer-
|
|
17271
|
+
const PdfViewer = vue.defineAsyncComponent(() => Promise.resolve().then(() => require("./PdfViewer-CnvD--7P.cjs")));
|
|
17272
17272
|
const superdocStore = useSuperdocStore();
|
|
17273
17273
|
const commentsStore = useCommentsStore();
|
|
17274
17274
|
const {
|
|
@@ -18128,7 +18128,7 @@ class SuperDoc extends eventemitter3.EventEmitter {
|
|
|
18128
18128
|
this.config.colors = shuffleArray(this.config.colors);
|
|
18129
18129
|
this.userColorMap = /* @__PURE__ */ new Map();
|
|
18130
18130
|
this.colorIndex = 0;
|
|
18131
|
-
this.version = "1.0.0-beta.
|
|
18131
|
+
this.version = "1.0.0-beta.56";
|
|
18132
18132
|
this.#log("🦋 [superdoc] Using SuperDoc version:", this.version);
|
|
18133
18133
|
this.superdocId = config.superdocId || uuid.v4();
|
|
18134
18134
|
this.colors = this.config.colors;
|
|
@@ -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-BxMwj135.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";
|
|
@@ -17251,7 +17251,7 @@ const _sfc_main = {
|
|
|
17251
17251
|
__name: "SuperDoc",
|
|
17252
17252
|
emits: ["selection-update"],
|
|
17253
17253
|
setup(__props, { emit: __emit }) {
|
|
17254
|
-
const PdfViewer = defineAsyncComponent(() => import("./PdfViewer-
|
|
17254
|
+
const PdfViewer = defineAsyncComponent(() => import("./PdfViewer-DsYaXp0H.es.js"));
|
|
17255
17255
|
const superdocStore = useSuperdocStore();
|
|
17256
17256
|
const commentsStore = useCommentsStore();
|
|
17257
17257
|
const {
|
|
@@ -18111,7 +18111,7 @@ class SuperDoc extends EventEmitter {
|
|
|
18111
18111
|
this.config.colors = shuffleArray(this.config.colors);
|
|
18112
18112
|
this.userColorMap = /* @__PURE__ */ new Map();
|
|
18113
18113
|
this.colorIndex = 0;
|
|
18114
|
-
this.version = "1.0.0-beta.
|
|
18114
|
+
this.version = "1.0.0-beta.56";
|
|
18115
18115
|
this.#log("🦋 [superdoc] Using SuperDoc version:", this.version);
|
|
18116
18116
|
this.superdocId = config.superdocId || v4();
|
|
18117
18117
|
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-DkFw0sfq.cjs");
|
|
4
4
|
const indexCvBqQJbG = require("./index-CvBqQJbG-Dwm0THD7.cjs");
|
|
5
5
|
function bail(error) {
|
|
6
6
|
if (error) {
|
|
@@ -42168,7 +42168,7 @@ const _SuperConverter = class _SuperConverter2 {
|
|
|
42168
42168
|
static getStoredSuperdocVersion(docx) {
|
|
42169
42169
|
return _SuperConverter2.getStoredCustomProperty(docx, "SuperdocVersion");
|
|
42170
42170
|
}
|
|
42171
|
-
static setStoredSuperdocVersion(docx = this.convertedXml, version2 = "1.0.0-beta.
|
|
42171
|
+
static setStoredSuperdocVersion(docx = this.convertedXml, version2 = "1.0.0-beta.56") {
|
|
42172
42172
|
return _SuperConverter2.setStoredCustomProperty(docx, "SuperdocVersion", version2, false);
|
|
42173
42173
|
}
|
|
42174
42174
|
/**
|
|
@@ -59350,7 +59350,7 @@ const isHeadless = (editor) => {
|
|
|
59350
59350
|
const shouldSkipNodeView = (editor) => {
|
|
59351
59351
|
return isHeadless(editor);
|
|
59352
59352
|
};
|
|
59353
|
-
const summaryVersion = "1.0.0-beta.
|
|
59353
|
+
const summaryVersion = "1.0.0-beta.56";
|
|
59354
59354
|
const nodeKeys = ["group", "content", "marks", "inline", "atom", "defining", "code", "tableRole", "summary"];
|
|
59355
59355
|
const markKeys = ["group", "inclusive", "excludes", "spanning", "code"];
|
|
59356
59356
|
function mapAttributes(attrs) {
|
|
@@ -60139,7 +60139,7 @@ const _Editor = class _Editor2 extends EventEmitter$1 {
|
|
|
60139
60139
|
{ default: remarkStringify },
|
|
60140
60140
|
{ default: remarkGfm }
|
|
60141
60141
|
] = await Promise.all([
|
|
60142
|
-
import("./index-
|
|
60142
|
+
import("./index-DYnUncjo-Br0s3gQs.es.js"),
|
|
60143
60143
|
import("./index-DRCvimau-Cw339678.es.js"),
|
|
60144
60144
|
import("./index-C_x_N6Uh-DJn8hIEt.es.js"),
|
|
60145
60145
|
import("./index-D_sWOSiG-DE96TaT5.es.js"),
|
|
@@ -60344,7 +60344,7 @@ const _Editor = class _Editor2 extends EventEmitter$1 {
|
|
|
60344
60344
|
* Process collaboration migrations
|
|
60345
60345
|
*/
|
|
60346
60346
|
processCollaborationMigrations() {
|
|
60347
|
-
console.debug("[checkVersionMigrations] Current editor version", "1.0.0-beta.
|
|
60347
|
+
console.debug("[checkVersionMigrations] Current editor version", "1.0.0-beta.56");
|
|
60348
60348
|
if (!this.options.ydoc) return;
|
|
60349
60349
|
const metaMap = this.options.ydoc.getMap("meta");
|
|
60350
60350
|
let docVersion = metaMap.get("version");
|
|
@@ -61291,7 +61291,15 @@ const VALID_TRACKED_MODES = ["review", "original", "final", "off"];
|
|
|
61291
61291
|
const DEFAULT_HYPERLINK_CONFIG$1 = {
|
|
61292
61292
|
enableRichHyperlinks: false
|
|
61293
61293
|
};
|
|
61294
|
-
const ATOMIC_INLINE_TYPES = /* @__PURE__ */ new Set([
|
|
61294
|
+
const ATOMIC_INLINE_TYPES = /* @__PURE__ */ new Set([
|
|
61295
|
+
"image",
|
|
61296
|
+
"hardBreak",
|
|
61297
|
+
"lineBreak",
|
|
61298
|
+
"page-number",
|
|
61299
|
+
"total-page-number",
|
|
61300
|
+
"passthroughInline",
|
|
61301
|
+
"bookmarkEnd"
|
|
61302
|
+
]);
|
|
61295
61303
|
const TOKEN_INLINE_TYPES = /* @__PURE__ */ new Map([
|
|
61296
61304
|
["page-number", "pageNumber"],
|
|
61297
61305
|
["total-page-number", "totalPageCount"]
|
|
@@ -79915,6 +79923,7 @@ const rangesOverlap = (startA, endA, startB, endB) => {
|
|
|
79915
79923
|
return effectiveEndA > startB && startA < endB;
|
|
79916
79924
|
};
|
|
79917
79925
|
function hitTestPage(layout, point) {
|
|
79926
|
+
const pageGap = layout.pageGap ?? 0;
|
|
79918
79927
|
let cursorY = 0;
|
|
79919
79928
|
for (let pageIndex = 0; pageIndex < layout.pages.length; pageIndex += 1) {
|
|
79920
79929
|
const page = layout.pages[pageIndex];
|
|
@@ -79923,7 +79932,7 @@ function hitTestPage(layout, point) {
|
|
|
79923
79932
|
if (point.y >= top2 && point.y < bottom2) {
|
|
79924
79933
|
return { pageIndex, page };
|
|
79925
79934
|
}
|
|
79926
|
-
cursorY = bottom2;
|
|
79935
|
+
cursorY = bottom2 + pageGap;
|
|
79927
79936
|
}
|
|
79928
79937
|
return null;
|
|
79929
79938
|
}
|
|
@@ -80132,9 +80141,10 @@ function clickToPosition(layout, blocks, measures, containerPoint, domContainer,
|
|
|
80132
80141
|
if (!pageHit) {
|
|
80133
80142
|
return null;
|
|
80134
80143
|
}
|
|
80144
|
+
const pageGap = layout.pageGap ?? 0;
|
|
80135
80145
|
const pageRelativePoint = {
|
|
80136
80146
|
x: containerPoint.x,
|
|
80137
|
-
y: containerPoint.y - pageHit.pageIndex * layout.pageSize.h
|
|
80147
|
+
y: containerPoint.y - pageHit.pageIndex * (layout.pageSize.h + pageGap)
|
|
80138
80148
|
};
|
|
80139
80149
|
logClickStage("log", "page-hit", {
|
|
80140
80150
|
pageIndex: pageHit.pageIndex
|
|
@@ -80355,7 +80365,7 @@ function selectionToRects(layout, blocks, measures, from2, to) {
|
|
|
80355
80365
|
const rectY = fragment.y + lineOffset;
|
|
80356
80366
|
rects.push({
|
|
80357
80367
|
x: rectX,
|
|
80358
|
-
y: rectY + pageIndex * layout.pageSize.h,
|
|
80368
|
+
y: rectY + pageIndex * (layout.pageSize.h + (layout.pageGap ?? 0)),
|
|
80359
80369
|
width: rectWidth,
|
|
80360
80370
|
height: line.lineHeight,
|
|
80361
80371
|
pageIndex
|
|
@@ -80472,7 +80482,7 @@ function selectionToRects(layout, blocks, measures, from2, to) {
|
|
|
80472
80482
|
const rectY = fragment.y + rowOffset + blockTopCursor + lineOffset;
|
|
80473
80483
|
rects.push({
|
|
80474
80484
|
x: rectX,
|
|
80475
|
-
y: rectY + pageIndex * layout.pageSize.h,
|
|
80485
|
+
y: rectY + pageIndex * (layout.pageSize.h + (layout.pageGap ?? 0)),
|
|
80476
80486
|
width: rectWidth,
|
|
80477
80487
|
height: line.lineHeight,
|
|
80478
80488
|
pageIndex
|
|
@@ -80501,7 +80511,7 @@ function selectionToRects(layout, blocks, measures, from2, to) {
|
|
|
80501
80511
|
if (!rangesOverlap(pmRange.pmStart, pmRange.pmEnd, from2, to)) return;
|
|
80502
80512
|
rects.push({
|
|
80503
80513
|
x: fragment.x,
|
|
80504
|
-
y: fragment.y + pageIndex * layout.pageSize.h,
|
|
80514
|
+
y: fragment.y + pageIndex * (layout.pageSize.h + (layout.pageGap ?? 0)),
|
|
80505
80515
|
width: fragment.width,
|
|
80506
80516
|
height: fragment.height,
|
|
80507
80517
|
pageIndex
|
|
@@ -83415,6 +83425,8 @@ function isValidFieldAnnotationAttributes(attrs) {
|
|
|
83415
83425
|
const FIELD_ANNOTATION_DATA_TYPE = "fieldAnnotation";
|
|
83416
83426
|
const DEFAULT_PAGE_SIZE = { w: 612, h: 792 };
|
|
83417
83427
|
const DEFAULT_MARGINS = { top: 72, right: 72, bottom: 72, left: 72 };
|
|
83428
|
+
const DEFAULT_VIRTUALIZED_PAGE_GAP = 72;
|
|
83429
|
+
const DEFAULT_PAGE_GAP = 24;
|
|
83418
83430
|
const WORD_CHARACTER_REGEX = /[\p{L}\p{N}''_~-]/u;
|
|
83419
83431
|
const MULTI_CLICK_TIME_THRESHOLD_MS = 400;
|
|
83420
83432
|
const MULTI_CLICK_DISTANCE_THRESHOLD_PX = 5;
|
|
@@ -84489,8 +84501,9 @@ const _PresentationEditor = class _PresentationEditor2 extends EventEmitter$1 {
|
|
|
84489
84501
|
const rawRects = layoutRectSource();
|
|
84490
84502
|
if (!rawRects.length) return [];
|
|
84491
84503
|
const pageHeight = __privateGet$1(this, _session).mode === "body" ? __privateMethod$1(this, _PresentationEditor_instances, getBodyPageHeight_fn).call(this) : __privateMethod$1(this, _PresentationEditor_instances, getHeaderFooterPageHeight_fn).call(this);
|
|
84504
|
+
const pageGap = __privateGet$1(this, _layoutState).layout?.pageGap ?? 0;
|
|
84492
84505
|
return rawRects.map((rect) => {
|
|
84493
|
-
const pageLocalY = rect.y - rect.pageIndex * pageHeight;
|
|
84506
|
+
const pageLocalY = rect.y - rect.pageIndex * (pageHeight + pageGap);
|
|
84494
84507
|
const coords = __privateMethod$1(this, _PresentationEditor_instances, convertPageLocalToOverlayCoords_fn).call(this, rect.pageIndex, rect.x, pageLocalY);
|
|
84495
84508
|
if (!coords) return null;
|
|
84496
84509
|
const absLeft = coords.x * zoom + overlayRect.left;
|
|
@@ -84742,7 +84755,8 @@ const _PresentationEditor = class _PresentationEditor2 extends EventEmitter$1 {
|
|
|
84742
84755
|
return null;
|
|
84743
84756
|
}
|
|
84744
84757
|
const pageHeight = __privateMethod$1(this, _PresentationEditor_instances, getBodyPageHeight_fn).call(this);
|
|
84745
|
-
const
|
|
84758
|
+
const pageGap = __privateGet$1(this, _layoutState).layout?.pageGap ?? 0;
|
|
84759
|
+
const pageLocalY = rect2.y - rect2.pageIndex * (pageHeight + pageGap);
|
|
84746
84760
|
const coords = __privateMethod$1(this, _PresentationEditor_instances, convertPageLocalToOverlayCoords_fn).call(this, rect2.pageIndex, rect2.x, pageLocalY);
|
|
84747
84761
|
if (!coords) {
|
|
84748
84762
|
return null;
|
|
@@ -85486,10 +85500,11 @@ renderRemoteSelection_fn = function(cursor) {
|
|
|
85486
85500
|
const color = __privateMethod$1(this, _PresentationEditor_instances, getValidatedColor_fn).call(this, cursor);
|
|
85487
85501
|
const opacity = __privateGet$1(this, _layoutOptions).presence?.highlightOpacity ?? 0.35;
|
|
85488
85502
|
const pageHeight = layout.pageSize?.h ?? __privateGet$1(this, _layoutOptions).pageSize?.h ?? DEFAULT_PAGE_SIZE.h;
|
|
85503
|
+
const pageGap = layout.pageGap ?? 0;
|
|
85489
85504
|
const doc2 = __privateGet$1(this, _visibleHost).ownerDocument ?? document;
|
|
85490
85505
|
const limitedRects = rects.slice(0, MAX_SELECTION_RECTS_PER_USER);
|
|
85491
85506
|
limitedRects.forEach((rect) => {
|
|
85492
|
-
const pageLocalY = rect.y - rect.pageIndex * pageHeight;
|
|
85507
|
+
const pageLocalY = rect.y - rect.pageIndex * (pageHeight + pageGap);
|
|
85493
85508
|
const coords = __privateMethod$1(this, _PresentationEditor_instances, convertPageLocalToOverlayCoords_fn).call(this, rect.pageIndex, rect.x, pageLocalY);
|
|
85494
85509
|
if (!coords) return;
|
|
85495
85510
|
const selectionEl = doc2.createElement("div");
|
|
@@ -85952,6 +85967,12 @@ rerender_fn = async function() {
|
|
|
85952
85967
|
return;
|
|
85953
85968
|
}
|
|
85954
85969
|
({ layout, measures } = result);
|
|
85970
|
+
if (__privateGet$1(this, _layoutOptions).virtualization?.enabled) {
|
|
85971
|
+
const gap = __privateGet$1(this, _layoutOptions).virtualization.gap ?? DEFAULT_VIRTUALIZED_PAGE_GAP;
|
|
85972
|
+
layout.pageGap = Math.max(0, gap);
|
|
85973
|
+
} else {
|
|
85974
|
+
layout.pageGap = DEFAULT_PAGE_GAP;
|
|
85975
|
+
}
|
|
85955
85976
|
headerLayouts = result.headers;
|
|
85956
85977
|
footerLayouts = result.footers;
|
|
85957
85978
|
} catch (error) {
|
|
@@ -86439,9 +86460,10 @@ hitTestHeaderFooterRegion_fn = function(x2, y2) {
|
|
|
86439
86460
|
const layout = __privateGet$1(this, _layoutState).layout;
|
|
86440
86461
|
if (!layout) return null;
|
|
86441
86462
|
const pageHeight = layout.pageSize?.h ?? __privateGet$1(this, _layoutOptions).pageSize?.h ?? DEFAULT_PAGE_SIZE.h;
|
|
86463
|
+
const pageGap = layout.pageGap ?? 0;
|
|
86442
86464
|
if (pageHeight <= 0) return null;
|
|
86443
|
-
const pageIndex = Math.max(0, Math.floor(y2 / pageHeight));
|
|
86444
|
-
const pageLocalY = y2 - pageIndex * pageHeight;
|
|
86465
|
+
const pageIndex = Math.max(0, Math.floor(y2 / (pageHeight + pageGap)));
|
|
86466
|
+
const pageLocalY = y2 - pageIndex * (pageHeight + pageGap);
|
|
86445
86467
|
const headerRegion = __privateGet$1(this, _headerRegions).get(pageIndex);
|
|
86446
86468
|
if (headerRegion && __privateMethod$1(this, _PresentationEditor_instances, pointInRegion_fn).call(this, headerRegion, x2, pageLocalY)) {
|
|
86447
86469
|
return headerRegion;
|
|
@@ -86866,8 +86888,9 @@ renderSelectionRects_fn = function(rects) {
|
|
|
86866
86888
|
return;
|
|
86867
86889
|
}
|
|
86868
86890
|
const pageHeight = __privateMethod$1(this, _PresentationEditor_instances, getBodyPageHeight_fn).call(this);
|
|
86891
|
+
const pageGap = __privateGet$1(this, _layoutState).layout?.pageGap ?? 0;
|
|
86869
86892
|
rects.forEach((rect, _index) => {
|
|
86870
|
-
const pageLocalY = rect.y - rect.pageIndex * pageHeight;
|
|
86893
|
+
const pageLocalY = rect.y - rect.pageIndex * (pageHeight + pageGap);
|
|
86871
86894
|
const coords = __privateMethod$1(this, _PresentationEditor_instances, convertPageLocalToOverlayCoords_fn).call(this, rect.pageIndex, rect.x, pageLocalY);
|
|
86872
86895
|
if (!coords) {
|
|
86873
86896
|
return;
|
|
@@ -87125,9 +87148,10 @@ convertPageLocalToOverlayCoords_fn = function(pageIndex, pageLocalX, pageLocalY)
|
|
|
87125
87148
|
return null;
|
|
87126
87149
|
}
|
|
87127
87150
|
const pageHeight = __privateGet$1(this, _layoutOptions).pageSize?.h ?? DEFAULT_PAGE_SIZE.h;
|
|
87151
|
+
const pageGap = __privateGet$1(this, _layoutState).layout?.pageGap ?? 0;
|
|
87128
87152
|
return {
|
|
87129
87153
|
x: pageLocalX,
|
|
87130
|
-
y: pageIndex * pageHeight + pageLocalY
|
|
87154
|
+
y: pageIndex * (pageHeight + pageGap) + pageLocalY
|
|
87131
87155
|
};
|
|
87132
87156
|
};
|
|
87133
87157
|
normalizeClientPoint_fn = function(clientX, clientY) {
|
|
@@ -100778,6 +100802,8 @@ const PassthroughInline = Node$1.create({
|
|
|
100778
100802
|
name: "passthroughInline",
|
|
100779
100803
|
group: "inline",
|
|
100780
100804
|
inline: true,
|
|
100805
|
+
// IMPORTANT: This node is registered in pm-adapter/src/constants.ts ATOMIC_INLINE_TYPES
|
|
100806
|
+
// If you change atom to false, you MUST remove it from that set to avoid positioning bugs
|
|
100781
100807
|
atom: true,
|
|
100782
100808
|
draggable: false,
|
|
100783
100809
|
selectable: false,
|
|
@@ -42185,7 +42185,7 @@ const _SuperConverter = class _SuperConverter2 {
|
|
|
42185
42185
|
static getStoredSuperdocVersion(docx) {
|
|
42186
42186
|
return _SuperConverter2.getStoredCustomProperty(docx, "SuperdocVersion");
|
|
42187
42187
|
}
|
|
42188
|
-
static setStoredSuperdocVersion(docx = this.convertedXml, version2 = "1.0.0-beta.
|
|
42188
|
+
static setStoredSuperdocVersion(docx = this.convertedXml, version2 = "1.0.0-beta.56") {
|
|
42189
42189
|
return _SuperConverter2.setStoredCustomProperty(docx, "SuperdocVersion", version2, false);
|
|
42190
42190
|
}
|
|
42191
42191
|
/**
|
|
@@ -59367,7 +59367,7 @@ const isHeadless = (editor) => {
|
|
|
59367
59367
|
const shouldSkipNodeView = (editor) => {
|
|
59368
59368
|
return isHeadless(editor);
|
|
59369
59369
|
};
|
|
59370
|
-
const summaryVersion = "1.0.0-beta.
|
|
59370
|
+
const summaryVersion = "1.0.0-beta.56";
|
|
59371
59371
|
const nodeKeys = ["group", "content", "marks", "inline", "atom", "defining", "code", "tableRole", "summary"];
|
|
59372
59372
|
const markKeys = ["group", "inclusive", "excludes", "spanning", "code"];
|
|
59373
59373
|
function mapAttributes(attrs) {
|
|
@@ -60156,7 +60156,7 @@ const _Editor = class _Editor2 extends EventEmitter$1 {
|
|
|
60156
60156
|
{ default: remarkStringify },
|
|
60157
60157
|
{ default: remarkGfm }
|
|
60158
60158
|
] = await Promise.all([
|
|
60159
|
-
Promise.resolve().then(() => require("./index-
|
|
60159
|
+
Promise.resolve().then(() => require("./index-DYnUncjo-Uv8YzgRb.cjs")),
|
|
60160
60160
|
Promise.resolve().then(() => require("./index-DRCvimau-H4Ck3S9a.cjs")),
|
|
60161
60161
|
Promise.resolve().then(() => require("./index-C_x_N6Uh-Db3CUJMX.cjs")),
|
|
60162
60162
|
Promise.resolve().then(() => require("./index-D_sWOSiG-BtDZzJ6I.cjs")),
|
|
@@ -60361,7 +60361,7 @@ const _Editor = class _Editor2 extends EventEmitter$1 {
|
|
|
60361
60361
|
* Process collaboration migrations
|
|
60362
60362
|
*/
|
|
60363
60363
|
processCollaborationMigrations() {
|
|
60364
|
-
console.debug("[checkVersionMigrations] Current editor version", "1.0.0-beta.
|
|
60364
|
+
console.debug("[checkVersionMigrations] Current editor version", "1.0.0-beta.56");
|
|
60365
60365
|
if (!this.options.ydoc) return;
|
|
60366
60366
|
const metaMap = this.options.ydoc.getMap("meta");
|
|
60367
60367
|
let docVersion = metaMap.get("version");
|
|
@@ -61308,7 +61308,15 @@ const VALID_TRACKED_MODES = ["review", "original", "final", "off"];
|
|
|
61308
61308
|
const DEFAULT_HYPERLINK_CONFIG$1 = {
|
|
61309
61309
|
enableRichHyperlinks: false
|
|
61310
61310
|
};
|
|
61311
|
-
const ATOMIC_INLINE_TYPES = /* @__PURE__ */ new Set([
|
|
61311
|
+
const ATOMIC_INLINE_TYPES = /* @__PURE__ */ new Set([
|
|
61312
|
+
"image",
|
|
61313
|
+
"hardBreak",
|
|
61314
|
+
"lineBreak",
|
|
61315
|
+
"page-number",
|
|
61316
|
+
"total-page-number",
|
|
61317
|
+
"passthroughInline",
|
|
61318
|
+
"bookmarkEnd"
|
|
61319
|
+
]);
|
|
61312
61320
|
const TOKEN_INLINE_TYPES = /* @__PURE__ */ new Map([
|
|
61313
61321
|
["page-number", "pageNumber"],
|
|
61314
61322
|
["total-page-number", "totalPageCount"]
|
|
@@ -79932,6 +79940,7 @@ const rangesOverlap = (startA, endA, startB, endB) => {
|
|
|
79932
79940
|
return effectiveEndA > startB && startA < endB;
|
|
79933
79941
|
};
|
|
79934
79942
|
function hitTestPage(layout, point) {
|
|
79943
|
+
const pageGap = layout.pageGap ?? 0;
|
|
79935
79944
|
let cursorY = 0;
|
|
79936
79945
|
for (let pageIndex = 0; pageIndex < layout.pages.length; pageIndex += 1) {
|
|
79937
79946
|
const page = layout.pages[pageIndex];
|
|
@@ -79940,7 +79949,7 @@ function hitTestPage(layout, point) {
|
|
|
79940
79949
|
if (point.y >= top2 && point.y < bottom2) {
|
|
79941
79950
|
return { pageIndex, page };
|
|
79942
79951
|
}
|
|
79943
|
-
cursorY = bottom2;
|
|
79952
|
+
cursorY = bottom2 + pageGap;
|
|
79944
79953
|
}
|
|
79945
79954
|
return null;
|
|
79946
79955
|
}
|
|
@@ -80149,9 +80158,10 @@ function clickToPosition(layout, blocks, measures, containerPoint, domContainer,
|
|
|
80149
80158
|
if (!pageHit) {
|
|
80150
80159
|
return null;
|
|
80151
80160
|
}
|
|
80161
|
+
const pageGap = layout.pageGap ?? 0;
|
|
80152
80162
|
const pageRelativePoint = {
|
|
80153
80163
|
x: containerPoint.x,
|
|
80154
|
-
y: containerPoint.y - pageHit.pageIndex * layout.pageSize.h
|
|
80164
|
+
y: containerPoint.y - pageHit.pageIndex * (layout.pageSize.h + pageGap)
|
|
80155
80165
|
};
|
|
80156
80166
|
logClickStage("log", "page-hit", {
|
|
80157
80167
|
pageIndex: pageHit.pageIndex
|
|
@@ -80372,7 +80382,7 @@ function selectionToRects(layout, blocks, measures, from2, to) {
|
|
|
80372
80382
|
const rectY = fragment.y + lineOffset;
|
|
80373
80383
|
rects.push({
|
|
80374
80384
|
x: rectX,
|
|
80375
|
-
y: rectY + pageIndex * layout.pageSize.h,
|
|
80385
|
+
y: rectY + pageIndex * (layout.pageSize.h + (layout.pageGap ?? 0)),
|
|
80376
80386
|
width: rectWidth,
|
|
80377
80387
|
height: line.lineHeight,
|
|
80378
80388
|
pageIndex
|
|
@@ -80489,7 +80499,7 @@ function selectionToRects(layout, blocks, measures, from2, to) {
|
|
|
80489
80499
|
const rectY = fragment.y + rowOffset + blockTopCursor + lineOffset;
|
|
80490
80500
|
rects.push({
|
|
80491
80501
|
x: rectX,
|
|
80492
|
-
y: rectY + pageIndex * layout.pageSize.h,
|
|
80502
|
+
y: rectY + pageIndex * (layout.pageSize.h + (layout.pageGap ?? 0)),
|
|
80493
80503
|
width: rectWidth,
|
|
80494
80504
|
height: line.lineHeight,
|
|
80495
80505
|
pageIndex
|
|
@@ -80518,7 +80528,7 @@ function selectionToRects(layout, blocks, measures, from2, to) {
|
|
|
80518
80528
|
if (!rangesOverlap(pmRange.pmStart, pmRange.pmEnd, from2, to)) return;
|
|
80519
80529
|
rects.push({
|
|
80520
80530
|
x: fragment.x,
|
|
80521
|
-
y: fragment.y + pageIndex * layout.pageSize.h,
|
|
80531
|
+
y: fragment.y + pageIndex * (layout.pageSize.h + (layout.pageGap ?? 0)),
|
|
80522
80532
|
width: fragment.width,
|
|
80523
80533
|
height: fragment.height,
|
|
80524
80534
|
pageIndex
|
|
@@ -83432,6 +83442,8 @@ function isValidFieldAnnotationAttributes(attrs) {
|
|
|
83432
83442
|
const FIELD_ANNOTATION_DATA_TYPE = "fieldAnnotation";
|
|
83433
83443
|
const DEFAULT_PAGE_SIZE = { w: 612, h: 792 };
|
|
83434
83444
|
const DEFAULT_MARGINS = { top: 72, right: 72, bottom: 72, left: 72 };
|
|
83445
|
+
const DEFAULT_VIRTUALIZED_PAGE_GAP = 72;
|
|
83446
|
+
const DEFAULT_PAGE_GAP = 24;
|
|
83435
83447
|
const WORD_CHARACTER_REGEX = /[\p{L}\p{N}''_~-]/u;
|
|
83436
83448
|
const MULTI_CLICK_TIME_THRESHOLD_MS = 400;
|
|
83437
83449
|
const MULTI_CLICK_DISTANCE_THRESHOLD_PX = 5;
|
|
@@ -84506,8 +84518,9 @@ const _PresentationEditor = class _PresentationEditor2 extends EventEmitter$1 {
|
|
|
84506
84518
|
const rawRects = layoutRectSource();
|
|
84507
84519
|
if (!rawRects.length) return [];
|
|
84508
84520
|
const pageHeight = __privateGet$1(this, _session).mode === "body" ? __privateMethod$1(this, _PresentationEditor_instances, getBodyPageHeight_fn).call(this) : __privateMethod$1(this, _PresentationEditor_instances, getHeaderFooterPageHeight_fn).call(this);
|
|
84521
|
+
const pageGap = __privateGet$1(this, _layoutState).layout?.pageGap ?? 0;
|
|
84509
84522
|
return rawRects.map((rect) => {
|
|
84510
|
-
const pageLocalY = rect.y - rect.pageIndex * pageHeight;
|
|
84523
|
+
const pageLocalY = rect.y - rect.pageIndex * (pageHeight + pageGap);
|
|
84511
84524
|
const coords = __privateMethod$1(this, _PresentationEditor_instances, convertPageLocalToOverlayCoords_fn).call(this, rect.pageIndex, rect.x, pageLocalY);
|
|
84512
84525
|
if (!coords) return null;
|
|
84513
84526
|
const absLeft = coords.x * zoom + overlayRect.left;
|
|
@@ -84759,7 +84772,8 @@ const _PresentationEditor = class _PresentationEditor2 extends EventEmitter$1 {
|
|
|
84759
84772
|
return null;
|
|
84760
84773
|
}
|
|
84761
84774
|
const pageHeight = __privateMethod$1(this, _PresentationEditor_instances, getBodyPageHeight_fn).call(this);
|
|
84762
|
-
const
|
|
84775
|
+
const pageGap = __privateGet$1(this, _layoutState).layout?.pageGap ?? 0;
|
|
84776
|
+
const pageLocalY = rect2.y - rect2.pageIndex * (pageHeight + pageGap);
|
|
84763
84777
|
const coords = __privateMethod$1(this, _PresentationEditor_instances, convertPageLocalToOverlayCoords_fn).call(this, rect2.pageIndex, rect2.x, pageLocalY);
|
|
84764
84778
|
if (!coords) {
|
|
84765
84779
|
return null;
|
|
@@ -85503,10 +85517,11 @@ renderRemoteSelection_fn = function(cursor) {
|
|
|
85503
85517
|
const color = __privateMethod$1(this, _PresentationEditor_instances, getValidatedColor_fn).call(this, cursor);
|
|
85504
85518
|
const opacity = __privateGet$1(this, _layoutOptions).presence?.highlightOpacity ?? 0.35;
|
|
85505
85519
|
const pageHeight = layout.pageSize?.h ?? __privateGet$1(this, _layoutOptions).pageSize?.h ?? DEFAULT_PAGE_SIZE.h;
|
|
85520
|
+
const pageGap = layout.pageGap ?? 0;
|
|
85506
85521
|
const doc2 = __privateGet$1(this, _visibleHost).ownerDocument ?? document;
|
|
85507
85522
|
const limitedRects = rects.slice(0, MAX_SELECTION_RECTS_PER_USER);
|
|
85508
85523
|
limitedRects.forEach((rect) => {
|
|
85509
|
-
const pageLocalY = rect.y - rect.pageIndex * pageHeight;
|
|
85524
|
+
const pageLocalY = rect.y - rect.pageIndex * (pageHeight + pageGap);
|
|
85510
85525
|
const coords = __privateMethod$1(this, _PresentationEditor_instances, convertPageLocalToOverlayCoords_fn).call(this, rect.pageIndex, rect.x, pageLocalY);
|
|
85511
85526
|
if (!coords) return;
|
|
85512
85527
|
const selectionEl = doc2.createElement("div");
|
|
@@ -85969,6 +85984,12 @@ rerender_fn = async function() {
|
|
|
85969
85984
|
return;
|
|
85970
85985
|
}
|
|
85971
85986
|
({ layout, measures } = result);
|
|
85987
|
+
if (__privateGet$1(this, _layoutOptions).virtualization?.enabled) {
|
|
85988
|
+
const gap = __privateGet$1(this, _layoutOptions).virtualization.gap ?? DEFAULT_VIRTUALIZED_PAGE_GAP;
|
|
85989
|
+
layout.pageGap = Math.max(0, gap);
|
|
85990
|
+
} else {
|
|
85991
|
+
layout.pageGap = DEFAULT_PAGE_GAP;
|
|
85992
|
+
}
|
|
85972
85993
|
headerLayouts = result.headers;
|
|
85973
85994
|
footerLayouts = result.footers;
|
|
85974
85995
|
} catch (error) {
|
|
@@ -86456,9 +86477,10 @@ hitTestHeaderFooterRegion_fn = function(x2, y2) {
|
|
|
86456
86477
|
const layout = __privateGet$1(this, _layoutState).layout;
|
|
86457
86478
|
if (!layout) return null;
|
|
86458
86479
|
const pageHeight = layout.pageSize?.h ?? __privateGet$1(this, _layoutOptions).pageSize?.h ?? DEFAULT_PAGE_SIZE.h;
|
|
86480
|
+
const pageGap = layout.pageGap ?? 0;
|
|
86459
86481
|
if (pageHeight <= 0) return null;
|
|
86460
|
-
const pageIndex = Math.max(0, Math.floor(y2 / pageHeight));
|
|
86461
|
-
const pageLocalY = y2 - pageIndex * pageHeight;
|
|
86482
|
+
const pageIndex = Math.max(0, Math.floor(y2 / (pageHeight + pageGap)));
|
|
86483
|
+
const pageLocalY = y2 - pageIndex * (pageHeight + pageGap);
|
|
86462
86484
|
const headerRegion = __privateGet$1(this, _headerRegions).get(pageIndex);
|
|
86463
86485
|
if (headerRegion && __privateMethod$1(this, _PresentationEditor_instances, pointInRegion_fn).call(this, headerRegion, x2, pageLocalY)) {
|
|
86464
86486
|
return headerRegion;
|
|
@@ -86883,8 +86905,9 @@ renderSelectionRects_fn = function(rects) {
|
|
|
86883
86905
|
return;
|
|
86884
86906
|
}
|
|
86885
86907
|
const pageHeight = __privateMethod$1(this, _PresentationEditor_instances, getBodyPageHeight_fn).call(this);
|
|
86908
|
+
const pageGap = __privateGet$1(this, _layoutState).layout?.pageGap ?? 0;
|
|
86886
86909
|
rects.forEach((rect, _index) => {
|
|
86887
|
-
const pageLocalY = rect.y - rect.pageIndex * pageHeight;
|
|
86910
|
+
const pageLocalY = rect.y - rect.pageIndex * (pageHeight + pageGap);
|
|
86888
86911
|
const coords = __privateMethod$1(this, _PresentationEditor_instances, convertPageLocalToOverlayCoords_fn).call(this, rect.pageIndex, rect.x, pageLocalY);
|
|
86889
86912
|
if (!coords) {
|
|
86890
86913
|
return;
|
|
@@ -87142,9 +87165,10 @@ convertPageLocalToOverlayCoords_fn = function(pageIndex, pageLocalX, pageLocalY)
|
|
|
87142
87165
|
return null;
|
|
87143
87166
|
}
|
|
87144
87167
|
const pageHeight = __privateGet$1(this, _layoutOptions).pageSize?.h ?? DEFAULT_PAGE_SIZE.h;
|
|
87168
|
+
const pageGap = __privateGet$1(this, _layoutState).layout?.pageGap ?? 0;
|
|
87145
87169
|
return {
|
|
87146
87170
|
x: pageLocalX,
|
|
87147
|
-
y: pageIndex * pageHeight + pageLocalY
|
|
87171
|
+
y: pageIndex * (pageHeight + pageGap) + pageLocalY
|
|
87148
87172
|
};
|
|
87149
87173
|
};
|
|
87150
87174
|
normalizeClientPoint_fn = function(clientX, clientY) {
|
|
@@ -100795,6 +100819,8 @@ const PassthroughInline = Node$1.create({
|
|
|
100795
100819
|
name: "passthroughInline",
|
|
100796
100820
|
group: "inline",
|
|
100797
100821
|
inline: true,
|
|
100822
|
+
// IMPORTANT: This node is registered in pm-adapter/src/constants.ts ATOMIC_INLINE_TYPES
|
|
100823
|
+
// If you change atom to false, you MUST remove it from that set to avoid positioning bugs
|
|
100798
100824
|
atom: true,
|
|
100799
100825
|
draggable: false,
|
|
100800
100826
|
selectable: false,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ref, onMounted, onUnmounted, computed, createElementBlock, openBlock, withModifiers, createElementVNode, withDirectives, unref, vModelText, createCommentVNode, nextTick } from "vue";
|
|
2
|
-
import { T as TextSelection } from "./chunks/converter-
|
|
3
|
-
import { _ as _export_sfc } from "./chunks/editor-
|
|
2
|
+
import { T as TextSelection } from "./chunks/converter-DwC5XPQX.js";
|
|
3
|
+
import { _ as _export_sfc } from "./chunks/editor-CoKNeouN.js";
|
|
4
4
|
const DEFAULT_API_ENDPOINT = "https://sd-dev-express-gateway-i6xtm.ondigitalocean.app/insights";
|
|
5
5
|
const SYSTEM_PROMPT = "You are an expert copywriter and you are immersed in a document editor. You are to provide document related text responses based on the user prompts. Only write what is asked for. Do not provide explanations. Try to keep placeholders as short as possible. Do not output your prompt. Your instructions are: ";
|
|
6
6
|
async function baseInsightsFetch(payload, options = {}) {
|
|
@@ -42449,7 +42449,7 @@ const _SuperConverter = class _SuperConverter {
|
|
|
42449
42449
|
static getStoredSuperdocVersion(docx) {
|
|
42450
42450
|
return _SuperConverter.getStoredCustomProperty(docx, "SuperdocVersion");
|
|
42451
42451
|
}
|
|
42452
|
-
static setStoredSuperdocVersion(docx = this.convertedXml, version = "1.0.0-beta.
|
|
42452
|
+
static setStoredSuperdocVersion(docx = this.convertedXml, version = "1.0.0-beta.56") {
|
|
42453
42453
|
return _SuperConverter.setStoredCustomProperty(docx, "SuperdocVersion", version, false);
|
|
42454
42454
|
}
|
|
42455
42455
|
/**
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { p as process$1, aJ as commonjsGlobal, B as Buffer, aK as getDefaultExportFromCjs, aL as getContentTypesFromXml, aM as xmljs } from "./converter-
|
|
1
|
+
import { p as process$1, aJ as commonjsGlobal, B as Buffer, aK as getDefaultExportFromCjs, aL as getContentTypesFromXml, aM as xmljs } from "./converter-DwC5XPQX.js";
|
|
2
2
|
function commonjsRequire(path) {
|
|
3
3
|
throw new Error('Could not dynamically require "' + path + '". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.');
|
|
4
4
|
}
|