@harbour-enterprises/superdoc 1.0.0-beta.72 → 1.0.0-beta.73
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-Dg-qiC1A.es.js → PdfViewer-A6N1Ilp8.es.js} +1 -1
- package/dist/chunks/{PdfViewer-BxCLl7Q6.cjs → PdfViewer-DBqcgXRQ.cjs} +1 -1
- package/dist/chunks/{index-qXb-Hmel-BPsIpdLY.cjs → index-DZuRXtuO-BP5GzZkJ.cjs} +1 -1
- package/dist/chunks/{index-qXb-Hmel-DwJhkxdW.es.js → index-DZuRXtuO-BpEV348M.es.js} +1 -1
- package/dist/chunks/{index-CAQDtLex.cjs → index-Dc6FhKsA.cjs} +3 -3
- package/dist/chunks/{index-B1AqHbuy.es.js → index-YCkhH3qs.es.js} +3 -3
- package/dist/chunks/{super-editor.es-DxG6ckVG.cjs → super-editor.es-CrRRbz3_.cjs} +40 -30
- package/dist/chunks/{super-editor.es-DPl3-zTR.es.js → super-editor.es-rYLAMF97.es.js} +40 -30
- package/dist/super-editor/ai-writer.es.js +2 -2
- package/dist/super-editor/chunks/{converter-JlOFMM88.js → converter-Czwp6T-t.js} +1 -1
- package/dist/super-editor/chunks/{docx-zipper-BVmpz1K_.js → docx-zipper-BT3IILnA.js} +1 -1
- package/dist/super-editor/chunks/{editor-CNzx36Ms.js → editor-DaiVtTXo.js} +41 -31
- package/dist/super-editor/chunks/{index-qXb-Hmel.js → index-DZuRXtuO.js} +1 -1
- package/dist/super-editor/chunks/{toolbar-DAhwzyFV.js → toolbar-DuPPWgDF.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 +42 -32
- 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-YCkhH3qs.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-Dc6FhKsA.cjs");
|
|
5
5
|
function self(vars) {
|
|
6
6
|
const {
|
|
7
7
|
opacityDisabled,
|
|
@@ -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-CrRRbz3_.cjs");
|
|
4
4
|
const indexCvBqQJbG = require("./index-CvBqQJbG-Dwm0THD7.cjs");
|
|
5
5
|
function bail(error) {
|
|
6
6
|
if (error) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
const superEditor_es = require("./super-editor.es-
|
|
2
|
+
const superEditor_es = require("./super-editor.es-CrRRbz3_.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-DBqcgXRQ.cjs")));
|
|
17272
17272
|
const superdocStore = useSuperdocStore();
|
|
17273
17273
|
const commentsStore = useCommentsStore();
|
|
17274
17274
|
const {
|
|
@@ -18157,7 +18157,7 @@ class SuperDoc extends eventemitter3.EventEmitter {
|
|
|
18157
18157
|
this.config.colors = shuffleArray(this.config.colors);
|
|
18158
18158
|
this.userColorMap = /* @__PURE__ */ new Map();
|
|
18159
18159
|
this.colorIndex = 0;
|
|
18160
|
-
this.version = "1.0.0-beta.
|
|
18160
|
+
this.version = "1.0.0-beta.73";
|
|
18161
18161
|
this.#log("🦋 [superdoc] Using SuperDoc version:", this.version);
|
|
18162
18162
|
this.superdocId = config.superdocId || uuid.v4();
|
|
18163
18163
|
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-rYLAMF97.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-A6N1Ilp8.es.js"));
|
|
17255
17255
|
const superdocStore = useSuperdocStore();
|
|
17256
17256
|
const commentsStore = useCommentsStore();
|
|
17257
17257
|
const {
|
|
@@ -18140,7 +18140,7 @@ class SuperDoc extends EventEmitter {
|
|
|
18140
18140
|
this.config.colors = shuffleArray(this.config.colors);
|
|
18141
18141
|
this.userColorMap = /* @__PURE__ */ new Map();
|
|
18142
18142
|
this.colorIndex = 0;
|
|
18143
|
-
this.version = "1.0.0-beta.
|
|
18143
|
+
this.version = "1.0.0-beta.73";
|
|
18144
18144
|
this.#log("🦋 [superdoc] Using SuperDoc version:", this.version);
|
|
18145
18145
|
this.superdocId = config.superdocId || v4();
|
|
18146
18146
|
this.colors = this.config.colors;
|
|
@@ -42326,7 +42326,7 @@ const _SuperConverter = class _SuperConverter2 {
|
|
|
42326
42326
|
static getStoredSuperdocVersion(docx) {
|
|
42327
42327
|
return _SuperConverter2.getStoredCustomProperty(docx, "SuperdocVersion");
|
|
42328
42328
|
}
|
|
42329
|
-
static setStoredSuperdocVersion(docx = this.convertedXml, version2 = "1.0.0-beta.
|
|
42329
|
+
static setStoredSuperdocVersion(docx = this.convertedXml, version2 = "1.0.0-beta.73") {
|
|
42330
42330
|
return _SuperConverter2.setStoredCustomProperty(docx, "SuperdocVersion", version2, false);
|
|
42331
42331
|
}
|
|
42332
42332
|
/**
|
|
@@ -59515,7 +59515,7 @@ const isHeadless = (editor) => {
|
|
|
59515
59515
|
const shouldSkipNodeView = (editor) => {
|
|
59516
59516
|
return isHeadless(editor);
|
|
59517
59517
|
};
|
|
59518
|
-
const summaryVersion = "1.0.0-beta.
|
|
59518
|
+
const summaryVersion = "1.0.0-beta.73";
|
|
59519
59519
|
const nodeKeys = ["group", "content", "marks", "inline", "atom", "defining", "code", "tableRole", "summary"];
|
|
59520
59520
|
const markKeys = ["group", "inclusive", "excludes", "spanning", "code"];
|
|
59521
59521
|
function mapAttributes(attrs) {
|
|
@@ -60304,7 +60304,7 @@ const _Editor = class _Editor2 extends EventEmitter$1 {
|
|
|
60304
60304
|
{ default: remarkStringify },
|
|
60305
60305
|
{ default: remarkGfm }
|
|
60306
60306
|
] = await Promise.all([
|
|
60307
|
-
Promise.resolve().then(() => require("./index-
|
|
60307
|
+
Promise.resolve().then(() => require("./index-DZuRXtuO-BP5GzZkJ.cjs")),
|
|
60308
60308
|
Promise.resolve().then(() => require("./index-DRCvimau-H4Ck3S9a.cjs")),
|
|
60309
60309
|
Promise.resolve().then(() => require("./index-C_x_N6Uh-Db3CUJMX.cjs")),
|
|
60310
60310
|
Promise.resolve().then(() => require("./index-D_sWOSiG-BtDZzJ6I.cjs")),
|
|
@@ -60509,7 +60509,7 @@ const _Editor = class _Editor2 extends EventEmitter$1 {
|
|
|
60509
60509
|
* Process collaboration migrations
|
|
60510
60510
|
*/
|
|
60511
60511
|
processCollaborationMigrations() {
|
|
60512
|
-
console.debug("[checkVersionMigrations] Current editor version", "1.0.0-beta.
|
|
60512
|
+
console.debug("[checkVersionMigrations] Current editor version", "1.0.0-beta.73");
|
|
60513
60513
|
if (!this.options.ydoc) return;
|
|
60514
60514
|
const metaMap = this.options.ydoc.getMap("meta");
|
|
60515
60515
|
let docVersion = metaMap.get("version");
|
|
@@ -68040,11 +68040,11 @@ const countSpaces = (text) => {
|
|
|
68040
68040
|
}
|
|
68041
68041
|
return spaces;
|
|
68042
68042
|
};
|
|
68043
|
-
const getJustifyAdjustment = (block, line, availableWidthOverride) => {
|
|
68043
|
+
const getJustifyAdjustment = (block, line, availableWidthOverride, alignmentOverride) => {
|
|
68044
68044
|
if (block.kind !== "paragraph") {
|
|
68045
68045
|
return { extraPerSpace: 0, totalSpaces: 0 };
|
|
68046
68046
|
}
|
|
68047
|
-
const alignment2 = block.attrs?.alignment;
|
|
68047
|
+
const alignment2 = alignmentOverride ?? block.attrs?.alignment;
|
|
68048
68048
|
const hasExplicitPositioning = line.segments?.some((seg) => seg.x !== void 0);
|
|
68049
68049
|
const availableWidth = availableWidthOverride ?? line.maxWidth ?? line.width;
|
|
68050
68050
|
const slack = Math.max(0, availableWidth - line.width);
|
|
@@ -68123,13 +68123,13 @@ function sliceRunsForLine$1(block, line) {
|
|
|
68123
68123
|
}
|
|
68124
68124
|
return result;
|
|
68125
68125
|
}
|
|
68126
|
-
function measureCharacterX(block, line, charOffset, availableWidthOverride) {
|
|
68126
|
+
function measureCharacterX(block, line, charOffset, availableWidthOverride, alignmentOverride) {
|
|
68127
68127
|
const ctx2 = getMeasurementContext();
|
|
68128
68128
|
const availableWidth = availableWidthOverride ?? line.maxWidth ?? // Fallback: if no maxWidth, approximate available width as line width (no slack)
|
|
68129
68129
|
line.width;
|
|
68130
|
-
const justify = getJustifyAdjustment(block, line, availableWidth);
|
|
68131
|
-
const
|
|
68132
|
-
const
|
|
68130
|
+
const justify = getJustifyAdjustment(block, line, availableWidth, alignmentOverride);
|
|
68131
|
+
const alignment2 = alignmentOverride ?? (block.kind === "paragraph" ? block.attrs?.alignment : void 0);
|
|
68132
|
+
const renderedLineWidth = alignment2 === "justify" ? line.width + Math.max(0, availableWidth - line.width) : line.width;
|
|
68133
68133
|
const hasExplicitPositioning = line.segments?.some((seg) => seg.x !== void 0);
|
|
68134
68134
|
const alignmentOffset = !hasExplicitPositioning && alignment2 === "center" ? Math.max(0, (availableWidth - renderedLineWidth) / 2) : !hasExplicitPositioning && alignment2 === "right" ? Math.max(0, availableWidth - renderedLineWidth) : 0;
|
|
68135
68135
|
if (hasExplicitPositioning && line.segments && ctx2) {
|
|
@@ -68258,13 +68258,13 @@ function charOffsetToPm(block, line, charOffset, fallbackPmStart) {
|
|
|
68258
68258
|
}
|
|
68259
68259
|
return lastPm;
|
|
68260
68260
|
}
|
|
68261
|
-
function findCharacterAtX(block, line, x2, pmStart, availableWidthOverride) {
|
|
68261
|
+
function findCharacterAtX(block, line, x2, pmStart, availableWidthOverride, alignmentOverride) {
|
|
68262
68262
|
const ctx2 = getMeasurementContext();
|
|
68263
68263
|
const availableWidth = availableWidthOverride ?? line.maxWidth ?? // Fallback: approximate with line width when no maxWidth is present
|
|
68264
68264
|
line.width;
|
|
68265
|
-
const justify = getJustifyAdjustment(block, line, availableWidth);
|
|
68266
|
-
const
|
|
68267
|
-
const
|
|
68265
|
+
const justify = getJustifyAdjustment(block, line, availableWidth, alignmentOverride);
|
|
68266
|
+
const alignment2 = alignmentOverride ?? (block.kind === "paragraph" ? block.attrs?.alignment : void 0);
|
|
68267
|
+
const renderedLineWidth = alignment2 === "justify" ? line.width + Math.max(0, availableWidth - line.width) : line.width;
|
|
68268
68268
|
const hasExplicitPositioning = line.segments?.some((seg) => seg.x !== void 0);
|
|
68269
68269
|
const alignmentOffset = !hasExplicitPositioning && alignment2 === "center" ? Math.max(0, (availableWidth - renderedLineWidth) / 2) : !hasExplicitPositioning && alignment2 === "right" ? Math.max(0, availableWidth - renderedLineWidth) : 0;
|
|
68270
68270
|
if (!ctx2) {
|
|
@@ -80972,7 +80972,10 @@ function clickToPosition(layout, blocks, measures, containerPoint, domContainer,
|
|
|
80972
80972
|
`[clickToPosition] Paragraph indents (${totalIndent}px) exceed fragment width (${fragment.width}px) for block ${fragment.blockId}. This may indicate a layout miscalculation. Available width clamped to 0.`
|
|
80973
80973
|
);
|
|
80974
80974
|
}
|
|
80975
|
-
const
|
|
80975
|
+
const markerWidth = fragment.markerWidth ?? measure.marker?.markerWidth ?? 0;
|
|
80976
|
+
const isListItem = markerWidth > 0;
|
|
80977
|
+
const alignmentOverride = isListItem ? "left" : void 0;
|
|
80978
|
+
const pos = mapPointToPm(block, line, pageRelativePoint.x - fragment.x, isRTL, availableWidth, alignmentOverride);
|
|
80976
80979
|
if (pos == null) {
|
|
80977
80980
|
logClickStage("warn", "no-position", {
|
|
80978
80981
|
blockId: fragment.blockId
|
|
@@ -81014,7 +81017,10 @@ function clickToPosition(layout, blocks, measures, containerPoint, domContainer,
|
|
|
81014
81017
|
`[clickToPosition:table] Paragraph indents (${totalIndent}px) exceed fragment width (${tableHit.fragment.width}px) for block ${tableHit.fragment.blockId}. This may indicate a layout miscalculation. Available width clamped to 0.`
|
|
81015
81018
|
);
|
|
81016
81019
|
}
|
|
81017
|
-
const
|
|
81020
|
+
const cellMarkerWidth = cellMeasure.marker?.markerWidth ?? 0;
|
|
81021
|
+
const isListItem = cellMarkerWidth > 0;
|
|
81022
|
+
const alignmentOverride = isListItem ? "left" : void 0;
|
|
81023
|
+
const pos = mapPointToPm(cellBlock, line, localX, isRTL, availableWidth, alignmentOverride);
|
|
81018
81024
|
if (pos != null) {
|
|
81019
81025
|
logClickStage("log", "success", {
|
|
81020
81026
|
blockId: tableHit.fragment.blockId,
|
|
@@ -81170,18 +81176,19 @@ function selectionToRects(layout, blocks, measures, from2, to) {
|
|
|
81170
81176
|
if (sliceFrom >= sliceTo) return;
|
|
81171
81177
|
const charOffsetFrom = pmPosToCharOffset(block, line, sliceFrom);
|
|
81172
81178
|
const charOffsetTo = pmPosToCharOffset(block, line, sliceTo);
|
|
81173
|
-
const startX = mapPmToX(block, line, charOffsetFrom, fragment.width);
|
|
81174
|
-
const endX = mapPmToX(block, line, charOffsetTo, fragment.width);
|
|
81175
81179
|
const markerWidth = fragment.markerWidth ?? measure.marker?.markerWidth ?? 0;
|
|
81180
|
+
const isListItem = markerWidth > 0;
|
|
81181
|
+
const alignmentOverride = isListItem ? "left" : void 0;
|
|
81182
|
+
const startX = mapPmToX(block, line, charOffsetFrom, fragment.width, alignmentOverride);
|
|
81183
|
+
const endX = mapPmToX(block, line, charOffsetTo, fragment.width, alignmentOverride);
|
|
81176
81184
|
const paraIndentLeft = block.attrs?.indent?.left ?? 0;
|
|
81177
81185
|
const firstLineOffset = (block.attrs?.indent?.firstLine ?? 0) - (block.attrs?.indent?.hanging ?? 0);
|
|
81178
81186
|
const isFirstLine = index2 === fragment.fromLine;
|
|
81179
|
-
|
|
81180
|
-
|
|
81181
|
-
|
|
81182
|
-
indentAdjust = paraIndentLeft + (isFirstLine ? firstLineOffset : 0);
|
|
81187
|
+
let indentAdjust = paraIndentLeft;
|
|
81188
|
+
if (isFirstLine && !isListItem) {
|
|
81189
|
+
indentAdjust += firstLineOffset;
|
|
81183
81190
|
}
|
|
81184
|
-
const rectX = fragment.x +
|
|
81191
|
+
const rectX = fragment.x + indentAdjust + Math.min(startX, endX);
|
|
81185
81192
|
const rectWidth = Math.max(1, Math.abs(endX - startX));
|
|
81186
81193
|
const lineOffset = lineHeightBeforeIndex(measure, index2) - lineHeightBeforeIndex(measure, fragment.fromLine);
|
|
81187
81194
|
const rectY = fragment.y + lineOffset;
|
|
@@ -81283,6 +81290,9 @@ function selectionToRects(layout, blocks, measures, from2, to) {
|
|
|
81283
81290
|
let blockTopCursor = padding.top + verticalOffset;
|
|
81284
81291
|
renderedBlocks.forEach((info) => {
|
|
81285
81292
|
const paragraphMarkerWidth = info.measure.marker?.markerWidth ?? 0;
|
|
81293
|
+
const isListItem = paragraphMarkerWidth > 0;
|
|
81294
|
+
const alignmentOverride = isListItem ? "left" : void 0;
|
|
81295
|
+
const paraIndentLeft = info.block.kind === "paragraph" ? info.block.attrs?.indent?.left ?? 0 : 0;
|
|
81286
81296
|
const intersectingLines = findLinesIntersectingRange(info.block, info.measure, from2, to);
|
|
81287
81297
|
intersectingLines.forEach(({ line, index: index2 }) => {
|
|
81288
81298
|
if (index2 < info.startLine || index2 >= info.endLine) {
|
|
@@ -81296,9 +81306,9 @@ function selectionToRects(layout, blocks, measures, from2, to) {
|
|
|
81296
81306
|
const charOffsetFrom = pmPosToCharOffset(info.block, line, sliceFrom);
|
|
81297
81307
|
const charOffsetTo = pmPosToCharOffset(info.block, line, sliceTo);
|
|
81298
81308
|
const availableWidth = Math.max(1, cellMeasure.width - padding.left - padding.right);
|
|
81299
|
-
const startX = mapPmToX(info.block, line, charOffsetFrom, availableWidth);
|
|
81300
|
-
const endX = mapPmToX(info.block, line, charOffsetTo, availableWidth);
|
|
81301
|
-
const rectX = fragment.x + cellX + padding.left +
|
|
81309
|
+
const startX = mapPmToX(info.block, line, charOffsetFrom, availableWidth, alignmentOverride);
|
|
81310
|
+
const endX = mapPmToX(info.block, line, charOffsetTo, availableWidth, alignmentOverride);
|
|
81311
|
+
const rectX = fragment.x + cellX + padding.left + paraIndentLeft + Math.min(startX, endX);
|
|
81302
81312
|
const rectWidth = Math.max(1, Math.abs(endX - startX));
|
|
81303
81313
|
const lineOffset = lineHeightBeforeIndex(info.measure, index2) - lineHeightBeforeIndex(info.measure, info.startLine);
|
|
81304
81314
|
const rectY = fragment.y + rowOffset + blockTopCursor + lineOffset;
|
|
@@ -81557,11 +81567,11 @@ const lineHeightBeforeIndex = (measure, absoluteLineIndex) => {
|
|
|
81557
81567
|
}
|
|
81558
81568
|
return height;
|
|
81559
81569
|
};
|
|
81560
|
-
const mapPointToPm = (block, line, x2, isRTL, availableWidthOverride) => {
|
|
81570
|
+
const mapPointToPm = (block, line, x2, isRTL, availableWidthOverride, alignmentOverride) => {
|
|
81561
81571
|
if (block.kind !== "paragraph") return null;
|
|
81562
81572
|
const range2 = computeLinePmRange(block, line);
|
|
81563
81573
|
if (range2.pmStart == null || range2.pmEnd == null) return null;
|
|
81564
|
-
const result = findCharacterAtX(block, line, x2, range2.pmStart, availableWidthOverride);
|
|
81574
|
+
const result = findCharacterAtX(block, line, x2, range2.pmStart, availableWidthOverride, alignmentOverride);
|
|
81565
81575
|
if (isRTL) {
|
|
81566
81576
|
const charOffset = result.charOffset;
|
|
81567
81577
|
const charsInLine = Math.max(1, line.toChar - line.fromChar);
|
|
@@ -81570,7 +81580,7 @@ const mapPointToPm = (block, line, x2, isRTL, availableWidthOverride) => {
|
|
|
81570
81580
|
}
|
|
81571
81581
|
return result.pmPosition;
|
|
81572
81582
|
};
|
|
81573
|
-
const mapPmToX = (block, line, offset2, fragmentWidth) => {
|
|
81583
|
+
const mapPmToX = (block, line, offset2, fragmentWidth, alignmentOverride) => {
|
|
81574
81584
|
if (fragmentWidth <= 0 || line.width <= 0) return 0;
|
|
81575
81585
|
let paraIndentLeft = 0;
|
|
81576
81586
|
let paraIndentRight = 0;
|
|
@@ -81587,7 +81597,7 @@ const mapPmToX = (block, line, offset2, fragmentWidth) => {
|
|
|
81587
81597
|
`[mapPmToX] Paragraph indents (${totalIndent}px) exceed fragment width (${fragmentWidth}px) for block ${block.id}. This may indicate a layout miscalculation. Available width clamped to 0.`
|
|
81588
81598
|
);
|
|
81589
81599
|
}
|
|
81590
|
-
return measureCharacterX(block, line, offset2, availableWidth);
|
|
81600
|
+
return measureCharacterX(block, line, offset2, availableWidth, alignmentOverride);
|
|
81591
81601
|
};
|
|
81592
81602
|
const isRtlBlock = (block) => {
|
|
81593
81603
|
if (block.kind !== "paragraph") return false;
|
|
@@ -42309,7 +42309,7 @@ const _SuperConverter = class _SuperConverter2 {
|
|
|
42309
42309
|
static getStoredSuperdocVersion(docx) {
|
|
42310
42310
|
return _SuperConverter2.getStoredCustomProperty(docx, "SuperdocVersion");
|
|
42311
42311
|
}
|
|
42312
|
-
static setStoredSuperdocVersion(docx = this.convertedXml, version2 = "1.0.0-beta.
|
|
42312
|
+
static setStoredSuperdocVersion(docx = this.convertedXml, version2 = "1.0.0-beta.73") {
|
|
42313
42313
|
return _SuperConverter2.setStoredCustomProperty(docx, "SuperdocVersion", version2, false);
|
|
42314
42314
|
}
|
|
42315
42315
|
/**
|
|
@@ -59498,7 +59498,7 @@ const isHeadless = (editor) => {
|
|
|
59498
59498
|
const shouldSkipNodeView = (editor) => {
|
|
59499
59499
|
return isHeadless(editor);
|
|
59500
59500
|
};
|
|
59501
|
-
const summaryVersion = "1.0.0-beta.
|
|
59501
|
+
const summaryVersion = "1.0.0-beta.73";
|
|
59502
59502
|
const nodeKeys = ["group", "content", "marks", "inline", "atom", "defining", "code", "tableRole", "summary"];
|
|
59503
59503
|
const markKeys = ["group", "inclusive", "excludes", "spanning", "code"];
|
|
59504
59504
|
function mapAttributes(attrs) {
|
|
@@ -60287,7 +60287,7 @@ const _Editor = class _Editor2 extends EventEmitter$1 {
|
|
|
60287
60287
|
{ default: remarkStringify },
|
|
60288
60288
|
{ default: remarkGfm }
|
|
60289
60289
|
] = await Promise.all([
|
|
60290
|
-
import("./index-
|
|
60290
|
+
import("./index-DZuRXtuO-BpEV348M.es.js"),
|
|
60291
60291
|
import("./index-DRCvimau-Cw339678.es.js"),
|
|
60292
60292
|
import("./index-C_x_N6Uh-DJn8hIEt.es.js"),
|
|
60293
60293
|
import("./index-D_sWOSiG-DE96TaT5.es.js"),
|
|
@@ -60492,7 +60492,7 @@ const _Editor = class _Editor2 extends EventEmitter$1 {
|
|
|
60492
60492
|
* Process collaboration migrations
|
|
60493
60493
|
*/
|
|
60494
60494
|
processCollaborationMigrations() {
|
|
60495
|
-
console.debug("[checkVersionMigrations] Current editor version", "1.0.0-beta.
|
|
60495
|
+
console.debug("[checkVersionMigrations] Current editor version", "1.0.0-beta.73");
|
|
60496
60496
|
if (!this.options.ydoc) return;
|
|
60497
60497
|
const metaMap = this.options.ydoc.getMap("meta");
|
|
60498
60498
|
let docVersion = metaMap.get("version");
|
|
@@ -68023,11 +68023,11 @@ const countSpaces = (text) => {
|
|
|
68023
68023
|
}
|
|
68024
68024
|
return spaces;
|
|
68025
68025
|
};
|
|
68026
|
-
const getJustifyAdjustment = (block, line, availableWidthOverride) => {
|
|
68026
|
+
const getJustifyAdjustment = (block, line, availableWidthOverride, alignmentOverride) => {
|
|
68027
68027
|
if (block.kind !== "paragraph") {
|
|
68028
68028
|
return { extraPerSpace: 0, totalSpaces: 0 };
|
|
68029
68029
|
}
|
|
68030
|
-
const alignment2 = block.attrs?.alignment;
|
|
68030
|
+
const alignment2 = alignmentOverride ?? block.attrs?.alignment;
|
|
68031
68031
|
const hasExplicitPositioning = line.segments?.some((seg) => seg.x !== void 0);
|
|
68032
68032
|
const availableWidth = availableWidthOverride ?? line.maxWidth ?? line.width;
|
|
68033
68033
|
const slack = Math.max(0, availableWidth - line.width);
|
|
@@ -68106,13 +68106,13 @@ function sliceRunsForLine$1(block, line) {
|
|
|
68106
68106
|
}
|
|
68107
68107
|
return result;
|
|
68108
68108
|
}
|
|
68109
|
-
function measureCharacterX(block, line, charOffset, availableWidthOverride) {
|
|
68109
|
+
function measureCharacterX(block, line, charOffset, availableWidthOverride, alignmentOverride) {
|
|
68110
68110
|
const ctx2 = getMeasurementContext();
|
|
68111
68111
|
const availableWidth = availableWidthOverride ?? line.maxWidth ?? // Fallback: if no maxWidth, approximate available width as line width (no slack)
|
|
68112
68112
|
line.width;
|
|
68113
|
-
const justify = getJustifyAdjustment(block, line, availableWidth);
|
|
68114
|
-
const
|
|
68115
|
-
const
|
|
68113
|
+
const justify = getJustifyAdjustment(block, line, availableWidth, alignmentOverride);
|
|
68114
|
+
const alignment2 = alignmentOverride ?? (block.kind === "paragraph" ? block.attrs?.alignment : void 0);
|
|
68115
|
+
const renderedLineWidth = alignment2 === "justify" ? line.width + Math.max(0, availableWidth - line.width) : line.width;
|
|
68116
68116
|
const hasExplicitPositioning = line.segments?.some((seg) => seg.x !== void 0);
|
|
68117
68117
|
const alignmentOffset = !hasExplicitPositioning && alignment2 === "center" ? Math.max(0, (availableWidth - renderedLineWidth) / 2) : !hasExplicitPositioning && alignment2 === "right" ? Math.max(0, availableWidth - renderedLineWidth) : 0;
|
|
68118
68118
|
if (hasExplicitPositioning && line.segments && ctx2) {
|
|
@@ -68241,13 +68241,13 @@ function charOffsetToPm(block, line, charOffset, fallbackPmStart) {
|
|
|
68241
68241
|
}
|
|
68242
68242
|
return lastPm;
|
|
68243
68243
|
}
|
|
68244
|
-
function findCharacterAtX(block, line, x2, pmStart, availableWidthOverride) {
|
|
68244
|
+
function findCharacterAtX(block, line, x2, pmStart, availableWidthOverride, alignmentOverride) {
|
|
68245
68245
|
const ctx2 = getMeasurementContext();
|
|
68246
68246
|
const availableWidth = availableWidthOverride ?? line.maxWidth ?? // Fallback: approximate with line width when no maxWidth is present
|
|
68247
68247
|
line.width;
|
|
68248
|
-
const justify = getJustifyAdjustment(block, line, availableWidth);
|
|
68249
|
-
const
|
|
68250
|
-
const
|
|
68248
|
+
const justify = getJustifyAdjustment(block, line, availableWidth, alignmentOverride);
|
|
68249
|
+
const alignment2 = alignmentOverride ?? (block.kind === "paragraph" ? block.attrs?.alignment : void 0);
|
|
68250
|
+
const renderedLineWidth = alignment2 === "justify" ? line.width + Math.max(0, availableWidth - line.width) : line.width;
|
|
68251
68251
|
const hasExplicitPositioning = line.segments?.some((seg) => seg.x !== void 0);
|
|
68252
68252
|
const alignmentOffset = !hasExplicitPositioning && alignment2 === "center" ? Math.max(0, (availableWidth - renderedLineWidth) / 2) : !hasExplicitPositioning && alignment2 === "right" ? Math.max(0, availableWidth - renderedLineWidth) : 0;
|
|
68253
68253
|
if (!ctx2) {
|
|
@@ -80955,7 +80955,10 @@ function clickToPosition(layout, blocks, measures, containerPoint, domContainer,
|
|
|
80955
80955
|
`[clickToPosition] Paragraph indents (${totalIndent}px) exceed fragment width (${fragment.width}px) for block ${fragment.blockId}. This may indicate a layout miscalculation. Available width clamped to 0.`
|
|
80956
80956
|
);
|
|
80957
80957
|
}
|
|
80958
|
-
const
|
|
80958
|
+
const markerWidth = fragment.markerWidth ?? measure.marker?.markerWidth ?? 0;
|
|
80959
|
+
const isListItem = markerWidth > 0;
|
|
80960
|
+
const alignmentOverride = isListItem ? "left" : void 0;
|
|
80961
|
+
const pos = mapPointToPm(block, line, pageRelativePoint.x - fragment.x, isRTL, availableWidth, alignmentOverride);
|
|
80959
80962
|
if (pos == null) {
|
|
80960
80963
|
logClickStage("warn", "no-position", {
|
|
80961
80964
|
blockId: fragment.blockId
|
|
@@ -80997,7 +81000,10 @@ function clickToPosition(layout, blocks, measures, containerPoint, domContainer,
|
|
|
80997
81000
|
`[clickToPosition:table] Paragraph indents (${totalIndent}px) exceed fragment width (${tableHit.fragment.width}px) for block ${tableHit.fragment.blockId}. This may indicate a layout miscalculation. Available width clamped to 0.`
|
|
80998
81001
|
);
|
|
80999
81002
|
}
|
|
81000
|
-
const
|
|
81003
|
+
const cellMarkerWidth = cellMeasure.marker?.markerWidth ?? 0;
|
|
81004
|
+
const isListItem = cellMarkerWidth > 0;
|
|
81005
|
+
const alignmentOverride = isListItem ? "left" : void 0;
|
|
81006
|
+
const pos = mapPointToPm(cellBlock, line, localX, isRTL, availableWidth, alignmentOverride);
|
|
81001
81007
|
if (pos != null) {
|
|
81002
81008
|
logClickStage("log", "success", {
|
|
81003
81009
|
blockId: tableHit.fragment.blockId,
|
|
@@ -81153,18 +81159,19 @@ function selectionToRects(layout, blocks, measures, from2, to) {
|
|
|
81153
81159
|
if (sliceFrom >= sliceTo) return;
|
|
81154
81160
|
const charOffsetFrom = pmPosToCharOffset(block, line, sliceFrom);
|
|
81155
81161
|
const charOffsetTo = pmPosToCharOffset(block, line, sliceTo);
|
|
81156
|
-
const startX = mapPmToX(block, line, charOffsetFrom, fragment.width);
|
|
81157
|
-
const endX = mapPmToX(block, line, charOffsetTo, fragment.width);
|
|
81158
81162
|
const markerWidth = fragment.markerWidth ?? measure.marker?.markerWidth ?? 0;
|
|
81163
|
+
const isListItem = markerWidth > 0;
|
|
81164
|
+
const alignmentOverride = isListItem ? "left" : void 0;
|
|
81165
|
+
const startX = mapPmToX(block, line, charOffsetFrom, fragment.width, alignmentOverride);
|
|
81166
|
+
const endX = mapPmToX(block, line, charOffsetTo, fragment.width, alignmentOverride);
|
|
81159
81167
|
const paraIndentLeft = block.attrs?.indent?.left ?? 0;
|
|
81160
81168
|
const firstLineOffset = (block.attrs?.indent?.firstLine ?? 0) - (block.attrs?.indent?.hanging ?? 0);
|
|
81161
81169
|
const isFirstLine = index2 === fragment.fromLine;
|
|
81162
|
-
|
|
81163
|
-
|
|
81164
|
-
|
|
81165
|
-
indentAdjust = paraIndentLeft + (isFirstLine ? firstLineOffset : 0);
|
|
81170
|
+
let indentAdjust = paraIndentLeft;
|
|
81171
|
+
if (isFirstLine && !isListItem) {
|
|
81172
|
+
indentAdjust += firstLineOffset;
|
|
81166
81173
|
}
|
|
81167
|
-
const rectX = fragment.x +
|
|
81174
|
+
const rectX = fragment.x + indentAdjust + Math.min(startX, endX);
|
|
81168
81175
|
const rectWidth = Math.max(1, Math.abs(endX - startX));
|
|
81169
81176
|
const lineOffset = lineHeightBeforeIndex(measure, index2) - lineHeightBeforeIndex(measure, fragment.fromLine);
|
|
81170
81177
|
const rectY = fragment.y + lineOffset;
|
|
@@ -81266,6 +81273,9 @@ function selectionToRects(layout, blocks, measures, from2, to) {
|
|
|
81266
81273
|
let blockTopCursor = padding.top + verticalOffset;
|
|
81267
81274
|
renderedBlocks.forEach((info) => {
|
|
81268
81275
|
const paragraphMarkerWidth = info.measure.marker?.markerWidth ?? 0;
|
|
81276
|
+
const isListItem = paragraphMarkerWidth > 0;
|
|
81277
|
+
const alignmentOverride = isListItem ? "left" : void 0;
|
|
81278
|
+
const paraIndentLeft = info.block.kind === "paragraph" ? info.block.attrs?.indent?.left ?? 0 : 0;
|
|
81269
81279
|
const intersectingLines = findLinesIntersectingRange(info.block, info.measure, from2, to);
|
|
81270
81280
|
intersectingLines.forEach(({ line, index: index2 }) => {
|
|
81271
81281
|
if (index2 < info.startLine || index2 >= info.endLine) {
|
|
@@ -81279,9 +81289,9 @@ function selectionToRects(layout, blocks, measures, from2, to) {
|
|
|
81279
81289
|
const charOffsetFrom = pmPosToCharOffset(info.block, line, sliceFrom);
|
|
81280
81290
|
const charOffsetTo = pmPosToCharOffset(info.block, line, sliceTo);
|
|
81281
81291
|
const availableWidth = Math.max(1, cellMeasure.width - padding.left - padding.right);
|
|
81282
|
-
const startX = mapPmToX(info.block, line, charOffsetFrom, availableWidth);
|
|
81283
|
-
const endX = mapPmToX(info.block, line, charOffsetTo, availableWidth);
|
|
81284
|
-
const rectX = fragment.x + cellX + padding.left +
|
|
81292
|
+
const startX = mapPmToX(info.block, line, charOffsetFrom, availableWidth, alignmentOverride);
|
|
81293
|
+
const endX = mapPmToX(info.block, line, charOffsetTo, availableWidth, alignmentOverride);
|
|
81294
|
+
const rectX = fragment.x + cellX + padding.left + paraIndentLeft + Math.min(startX, endX);
|
|
81285
81295
|
const rectWidth = Math.max(1, Math.abs(endX - startX));
|
|
81286
81296
|
const lineOffset = lineHeightBeforeIndex(info.measure, index2) - lineHeightBeforeIndex(info.measure, info.startLine);
|
|
81287
81297
|
const rectY = fragment.y + rowOffset + blockTopCursor + lineOffset;
|
|
@@ -81540,11 +81550,11 @@ const lineHeightBeforeIndex = (measure, absoluteLineIndex) => {
|
|
|
81540
81550
|
}
|
|
81541
81551
|
return height;
|
|
81542
81552
|
};
|
|
81543
|
-
const mapPointToPm = (block, line, x2, isRTL, availableWidthOverride) => {
|
|
81553
|
+
const mapPointToPm = (block, line, x2, isRTL, availableWidthOverride, alignmentOverride) => {
|
|
81544
81554
|
if (block.kind !== "paragraph") return null;
|
|
81545
81555
|
const range2 = computeLinePmRange(block, line);
|
|
81546
81556
|
if (range2.pmStart == null || range2.pmEnd == null) return null;
|
|
81547
|
-
const result = findCharacterAtX(block, line, x2, range2.pmStart, availableWidthOverride);
|
|
81557
|
+
const result = findCharacterAtX(block, line, x2, range2.pmStart, availableWidthOverride, alignmentOverride);
|
|
81548
81558
|
if (isRTL) {
|
|
81549
81559
|
const charOffset = result.charOffset;
|
|
81550
81560
|
const charsInLine = Math.max(1, line.toChar - line.fromChar);
|
|
@@ -81553,7 +81563,7 @@ const mapPointToPm = (block, line, x2, isRTL, availableWidthOverride) => {
|
|
|
81553
81563
|
}
|
|
81554
81564
|
return result.pmPosition;
|
|
81555
81565
|
};
|
|
81556
|
-
const mapPmToX = (block, line, offset2, fragmentWidth) => {
|
|
81566
|
+
const mapPmToX = (block, line, offset2, fragmentWidth, alignmentOverride) => {
|
|
81557
81567
|
if (fragmentWidth <= 0 || line.width <= 0) return 0;
|
|
81558
81568
|
let paraIndentLeft = 0;
|
|
81559
81569
|
let paraIndentRight = 0;
|
|
@@ -81570,7 +81580,7 @@ const mapPmToX = (block, line, offset2, fragmentWidth) => {
|
|
|
81570
81580
|
`[mapPmToX] Paragraph indents (${totalIndent}px) exceed fragment width (${fragmentWidth}px) for block ${block.id}. This may indicate a layout miscalculation. Available width clamped to 0.`
|
|
81571
81581
|
);
|
|
81572
81582
|
}
|
|
81573
|
-
return measureCharacterX(block, line, offset2, availableWidth);
|
|
81583
|
+
return measureCharacterX(block, line, offset2, availableWidth, alignmentOverride);
|
|
81574
81584
|
};
|
|
81575
81585
|
const isRtlBlock = (block) => {
|
|
81576
81586
|
if (block.kind !== "paragraph") return 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-Czwp6T-t.js";
|
|
3
|
+
import { _ as _export_sfc } from "./chunks/editor-DaiVtTXo.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 = {}) {
|
|
@@ -42626,7 +42626,7 @@ const _SuperConverter = class _SuperConverter {
|
|
|
42626
42626
|
static getStoredSuperdocVersion(docx) {
|
|
42627
42627
|
return _SuperConverter.getStoredCustomProperty(docx, "SuperdocVersion");
|
|
42628
42628
|
}
|
|
42629
|
-
static setStoredSuperdocVersion(docx = this.convertedXml, version = "1.0.0-beta.
|
|
42629
|
+
static setStoredSuperdocVersion(docx = this.convertedXml, version = "1.0.0-beta.73") {
|
|
42630
42630
|
return _SuperConverter.setStoredCustomProperty(docx, "SuperdocVersion", version, false);
|
|
42631
42631
|
}
|
|
42632
42632
|
/**
|
|
@@ -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-Czwp6T-t.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
|
}
|