@harbour-enterprises/superdoc 2.0.0-next.3 → 2.0.0-next.5
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-C6tuSJXA.cjs → PdfViewer-C4wZizyW.cjs} +1 -1
- package/dist/chunks/{PdfViewer-4xn9rggA.es.js → PdfViewer-CO_oGFDw.es.js} +1 -1
- package/dist/chunks/{index-k0xTe_8v.cjs → index-B4QOihiF.cjs} +3 -3
- package/dist/chunks/{index-lLnrqNSJ-DoACeFqL.es.js → index-CBSyVaOM-B5I90g0S.es.js} +1 -1
- package/dist/chunks/{index-lLnrqNSJ-CMJxa5vJ.cjs → index-CBSyVaOM-BMpzJRoR.cjs} +1 -1
- package/dist/chunks/{index-CSZ7bAL7.es.js → index-XOJnODHJ.es.js} +3 -3
- package/dist/chunks/{super-editor.es-BY4paJvP.cjs → super-editor.es-DzolekK0.cjs} +141 -26
- package/dist/chunks/{super-editor.es-B1DZfUz0.es.js → super-editor.es-qnE7-VRy.es.js} +141 -26
- package/dist/packages/superdoc/src/core/SuperDoc.d.ts.map +1 -1
- package/dist/style.css +6 -6
- package/dist/super-editor/ai-writer.es.js +2 -2
- package/dist/super-editor/chunks/{converter-Bd6dIe0l.js → converter-CH2eG52x.js} +1 -1
- package/dist/super-editor/chunks/{docx-zipper-Dzdi5pfi.js → docx-zipper-JJRnWzI6.js} +1 -1
- package/dist/super-editor/chunks/{editor-C3sjGwAb.js → editor-Du7p05wU.js} +129 -24
- package/dist/super-editor/chunks/{index-lLnrqNSJ.js → index-CBSyVaOM.js} +1 -1
- package/dist/super-editor/chunks/{toolbar-Bn20lflQ.js → toolbar-unNlfpEL.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/style.css +6 -6
- package/dist/super-editor/super-editor.es.js +19 -9
- 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 +143 -28
- package/dist/superdoc.umd.js.map +1 -1
- package/package.json +1 -1
|
@@ -42410,7 +42410,7 @@ const _SuperConverter = class _SuperConverter2 {
|
|
|
42410
42410
|
static getStoredSuperdocVersion(docx) {
|
|
42411
42411
|
return _SuperConverter2.getStoredCustomProperty(docx, "SuperdocVersion");
|
|
42412
42412
|
}
|
|
42413
|
-
static setStoredSuperdocVersion(docx = this.convertedXml, version2 = "2.0.0-next.
|
|
42413
|
+
static setStoredSuperdocVersion(docx = this.convertedXml, version2 = "2.0.0-next.5") {
|
|
42414
42414
|
return _SuperConverter2.setStoredCustomProperty(docx, "SuperdocVersion", version2, false);
|
|
42415
42415
|
}
|
|
42416
42416
|
/**
|
|
@@ -60491,7 +60491,7 @@ const isHeadless = (editor) => {
|
|
|
60491
60491
|
const shouldSkipNodeView = (editor) => {
|
|
60492
60492
|
return isHeadless(editor);
|
|
60493
60493
|
};
|
|
60494
|
-
const summaryVersion = "2.0.0-next.
|
|
60494
|
+
const summaryVersion = "2.0.0-next.5";
|
|
60495
60495
|
const nodeKeys = ["group", "content", "marks", "inline", "atom", "defining", "code", "tableRole", "summary"];
|
|
60496
60496
|
const markKeys = ["group", "inclusive", "excludes", "spanning", "code"];
|
|
60497
60497
|
function mapAttributes(attrs) {
|
|
@@ -61280,7 +61280,7 @@ const _Editor = class _Editor2 extends EventEmitter$1 {
|
|
|
61280
61280
|
{ default: remarkStringify },
|
|
61281
61281
|
{ default: remarkGfm }
|
|
61282
61282
|
] = await Promise.all([
|
|
61283
|
-
import("./index-
|
|
61283
|
+
import("./index-CBSyVaOM-B5I90g0S.es.js"),
|
|
61284
61284
|
import("./index-DRCvimau-Cw339678.es.js"),
|
|
61285
61285
|
import("./index-C_x_N6Uh-DJn8hIEt.es.js"),
|
|
61286
61286
|
import("./index-D_sWOSiG-DE96TaT5.es.js"),
|
|
@@ -61485,7 +61485,7 @@ const _Editor = class _Editor2 extends EventEmitter$1 {
|
|
|
61485
61485
|
* Process collaboration migrations
|
|
61486
61486
|
*/
|
|
61487
61487
|
processCollaborationMigrations() {
|
|
61488
|
-
console.debug("[checkVersionMigrations] Current editor version", "2.0.0-next.
|
|
61488
|
+
console.debug("[checkVersionMigrations] Current editor version", "2.0.0-next.5");
|
|
61489
61489
|
if (!this.options.ydoc) return;
|
|
61490
61490
|
const metaMap = this.options.ydoc.getMap("meta");
|
|
61491
61491
|
let docVersion = metaMap.get("version");
|
|
@@ -73851,7 +73851,8 @@ function measureCharacterX(block, line, charOffset, availableWidthOverride, alig
|
|
|
73851
73851
|
}
|
|
73852
73852
|
const text = "src" in run2 || run2.kind === "lineBreak" || run2.kind === "break" || run2.kind === "fieldAnnotation" ? "" : run2.text ?? "";
|
|
73853
73853
|
const runLength = text.length;
|
|
73854
|
-
const
|
|
73854
|
+
const transform = isTabRun$1(run2) || "src" in run2 || run2.kind === "lineBreak" || run2.kind === "break" || run2.kind === "fieldAnnotation" ? void 0 : run2.textTransform;
|
|
73855
|
+
const displayText = applyTextTransform$2(text, transform);
|
|
73855
73856
|
if (currentCharOffset + runLength >= charOffset) {
|
|
73856
73857
|
const offsetInRun = charOffset - currentCharOffset;
|
|
73857
73858
|
ctx2.font = getRunFontString(run2);
|
|
@@ -73901,7 +73902,8 @@ function measureCharacterXSegmentBased(block, line, charOffset, ctx2) {
|
|
|
73901
73902
|
return segmentBaseX + (offsetInSegment >= segmentChars ? segment.width ?? 0 : 0);
|
|
73902
73903
|
}
|
|
73903
73904
|
const text = run2.text ?? "";
|
|
73904
|
-
const
|
|
73905
|
+
const transform = "textTransform" in run2 ? run2.textTransform : void 0;
|
|
73906
|
+
const displayText = applyTextTransform$2(text, transform);
|
|
73905
73907
|
const displaySegmentText = displayText.slice(segment.fromChar, segment.toChar);
|
|
73906
73908
|
const textUpToTarget = displaySegmentText.slice(0, offsetInSegment);
|
|
73907
73909
|
ctx2.font = getRunFontString(run2);
|
|
@@ -73999,7 +74001,8 @@ function findCharacterAtX(block, line, x2, pmStart, availableWidthOverride, alig
|
|
|
73999
74001
|
}
|
|
74000
74002
|
const text = "src" in run2 || run2.kind === "lineBreak" || run2.kind === "break" || run2.kind === "fieldAnnotation" ? "" : run2.text ?? "";
|
|
74001
74003
|
const runLength = text.length;
|
|
74002
|
-
const
|
|
74004
|
+
const transform = isTabRun$1(run2) || "src" in run2 || run2.kind === "lineBreak" || run2.kind === "break" || run2.kind === "fieldAnnotation" ? void 0 : run2.textTransform;
|
|
74005
|
+
const displayText = applyTextTransform$2(text, transform);
|
|
74003
74006
|
if (runLength === 0) continue;
|
|
74004
74007
|
ctx2.font = getRunFontString(run2);
|
|
74005
74008
|
for (let i = 0; i <= runLength; i++) {
|
|
@@ -74477,12 +74480,12 @@ function resolveListTextStartPx(wordLayout, indentLeft, firstLine, hanging, meas
|
|
|
74477
74480
|
if (markerTextWidth == null && marker.markerText) {
|
|
74478
74481
|
markerTextWidth = measureMarkerText(marker.markerText, marker);
|
|
74479
74482
|
}
|
|
74480
|
-
if (!Number.isFinite(markerTextWidth) || markerTextWidth < 0) {
|
|
74483
|
+
if (!Number.isFinite(markerTextWidth) || markerTextWidth !== void 0 && markerTextWidth < 0) {
|
|
74481
74484
|
markerTextWidth = markerBoxWidth;
|
|
74482
74485
|
}
|
|
74483
|
-
|
|
74486
|
+
const finalMarkerTextWidth = Math.max(0, markerTextWidth ?? 0);
|
|
74484
74487
|
let markerStartPos;
|
|
74485
|
-
if (wordLayout?.firstLineIndentMode === true && Number.isFinite(marker.markerX)) {
|
|
74488
|
+
if (wordLayout?.firstLineIndentMode === true && typeof marker.markerX === "number" && Number.isFinite(marker.markerX)) {
|
|
74486
74489
|
markerStartPos = marker.markerX;
|
|
74487
74490
|
} else {
|
|
74488
74491
|
markerStartPos = indentLeft - hanging + firstLine;
|
|
@@ -74490,18 +74493,18 @@ function resolveListTextStartPx(wordLayout, indentLeft, firstLine, hanging, meas
|
|
|
74490
74493
|
if (!Number.isFinite(markerStartPos)) {
|
|
74491
74494
|
markerStartPos = 0;
|
|
74492
74495
|
}
|
|
74493
|
-
const currentPos = markerStartPos +
|
|
74496
|
+
const currentPos = markerStartPos + finalMarkerTextWidth;
|
|
74494
74497
|
const suffix2 = marker.suffix ?? "tab";
|
|
74495
74498
|
if (suffix2 === "space") {
|
|
74496
|
-
return markerStartPos +
|
|
74499
|
+
return markerStartPos + finalMarkerTextWidth + SPACE_SUFFIX_GAP_PX;
|
|
74497
74500
|
}
|
|
74498
74501
|
if (suffix2 === "nothing") {
|
|
74499
|
-
return markerStartPos +
|
|
74502
|
+
return markerStartPos + finalMarkerTextWidth;
|
|
74500
74503
|
}
|
|
74501
74504
|
const markerJustification = marker.justification ?? "left";
|
|
74502
74505
|
if (markerJustification !== "left") {
|
|
74503
74506
|
const gutterWidth = typeof marker.gutterWidthPx === "number" && Number.isFinite(marker.gutterWidthPx) && marker.gutterWidthPx > 0 ? marker.gutterWidthPx : LIST_MARKER_GAP$1;
|
|
74504
|
-
return markerStartPos +
|
|
74507
|
+
return markerStartPos + finalMarkerTextWidth + Math.max(gutterWidth, LIST_MARKER_GAP$1);
|
|
74505
74508
|
}
|
|
74506
74509
|
if (wordLayout?.firstLineIndentMode === true) {
|
|
74507
74510
|
let targetTabStop;
|
|
@@ -74525,7 +74528,7 @@ function resolveListTextStartPx(wordLayout, indentLeft, firstLine, hanging, meas
|
|
|
74525
74528
|
if (tabWidth2 < LIST_MARKER_GAP$1) {
|
|
74526
74529
|
tabWidth2 = LIST_MARKER_GAP$1;
|
|
74527
74530
|
}
|
|
74528
|
-
return markerStartPos +
|
|
74531
|
+
return markerStartPos + finalMarkerTextWidth + tabWidth2;
|
|
74529
74532
|
}
|
|
74530
74533
|
const textStart = indentLeft + firstLine;
|
|
74531
74534
|
let tabWidth = textStart - currentPos;
|
|
@@ -74534,7 +74537,7 @@ function resolveListTextStartPx(wordLayout, indentLeft, firstLine, hanging, meas
|
|
|
74534
74537
|
} else if (tabWidth < LIST_MARKER_GAP$1) {
|
|
74535
74538
|
tabWidth = LIST_MARKER_GAP$1;
|
|
74536
74539
|
}
|
|
74537
|
-
return markerStartPos +
|
|
74540
|
+
return markerStartPos + finalMarkerTextWidth + tabWidth;
|
|
74538
74541
|
}
|
|
74539
74542
|
function getWordLayoutConfig(block) {
|
|
74540
74543
|
if (!block || block.kind !== "paragraph") {
|
|
@@ -75854,6 +75857,94 @@ function getCellPadding(cellIdx, blockRow) {
|
|
|
75854
75857
|
function getCellTotalLines(cell) {
|
|
75855
75858
|
return getCellLines(cell).length;
|
|
75856
75859
|
}
|
|
75860
|
+
function mergePmRange(target, range2) {
|
|
75861
|
+
if (typeof range2.pmStart === "number") {
|
|
75862
|
+
target.pmStart = target.pmStart == null ? range2.pmStart : Math.min(target.pmStart, range2.pmStart);
|
|
75863
|
+
}
|
|
75864
|
+
if (typeof range2.pmEnd === "number") {
|
|
75865
|
+
target.pmEnd = target.pmEnd == null ? range2.pmEnd : Math.max(target.pmEnd, range2.pmEnd);
|
|
75866
|
+
}
|
|
75867
|
+
}
|
|
75868
|
+
function computeCellPmRange(cell, cellMeasure, fromLine, toLine) {
|
|
75869
|
+
const range2 = {};
|
|
75870
|
+
if (!cell || !cellMeasure) return range2;
|
|
75871
|
+
const cellBlocks = cell.blocks ?? (cell.paragraph ? [cell.paragraph] : []);
|
|
75872
|
+
const blockMeasures = cellMeasure.blocks ?? (cellMeasure.paragraph ? [cellMeasure.paragraph] : []);
|
|
75873
|
+
const maxBlocks = Math.min(cellBlocks.length, blockMeasures.length);
|
|
75874
|
+
let cumulativeLineCount = 0;
|
|
75875
|
+
for (let i = 0; i < maxBlocks; i++) {
|
|
75876
|
+
const block = cellBlocks[i];
|
|
75877
|
+
const blockMeasure = blockMeasures[i];
|
|
75878
|
+
if (blockMeasure.kind === "paragraph" && block?.kind === "paragraph") {
|
|
75879
|
+
const paraMeasure = blockMeasure;
|
|
75880
|
+
const lines = paraMeasure.lines;
|
|
75881
|
+
const blockLineCount = lines?.length ?? 0;
|
|
75882
|
+
const blockStartGlobal = cumulativeLineCount;
|
|
75883
|
+
const blockEndGlobal = cumulativeLineCount + blockLineCount;
|
|
75884
|
+
const localFrom = Math.max(fromLine, blockStartGlobal) - blockStartGlobal;
|
|
75885
|
+
const localTo = Math.min(toLine, blockEndGlobal) - blockStartGlobal;
|
|
75886
|
+
if (lines && lines.length > 0 && localFrom < localTo) {
|
|
75887
|
+
mergePmRange(range2, computeFragmentPmRange(block, lines, localFrom, localTo));
|
|
75888
|
+
} else {
|
|
75889
|
+
mergePmRange(range2, extractBlockPmRange(block));
|
|
75890
|
+
}
|
|
75891
|
+
cumulativeLineCount += blockLineCount;
|
|
75892
|
+
continue;
|
|
75893
|
+
}
|
|
75894
|
+
mergePmRange(range2, extractBlockPmRange(block));
|
|
75895
|
+
}
|
|
75896
|
+
return range2;
|
|
75897
|
+
}
|
|
75898
|
+
function computeTableFragmentPmRange(block, measure, fromRow, toRow, partialRow) {
|
|
75899
|
+
const range2 = {};
|
|
75900
|
+
for (let rowIndex = fromRow; rowIndex < toRow; rowIndex++) {
|
|
75901
|
+
const row = block.rows[rowIndex];
|
|
75902
|
+
const rowMeasure = measure.rows[rowIndex];
|
|
75903
|
+
if (!row || !rowMeasure) continue;
|
|
75904
|
+
const isPartial = partialRow?.rowIndex === rowIndex;
|
|
75905
|
+
const cellCount = Math.min(row.cells.length, rowMeasure.cells.length);
|
|
75906
|
+
for (let cellIndex = 0; cellIndex < cellCount; cellIndex++) {
|
|
75907
|
+
const cell = row.cells[cellIndex];
|
|
75908
|
+
const cellMeasure = rowMeasure.cells[cellIndex];
|
|
75909
|
+
if (!cell || !cellMeasure) continue;
|
|
75910
|
+
const totalLines = getCellTotalLines(cellMeasure);
|
|
75911
|
+
let fromLine = 0;
|
|
75912
|
+
let toLine = totalLines;
|
|
75913
|
+
if (isPartial) {
|
|
75914
|
+
const hasValidFromLineByCell = partialRow?.fromLineByCell && cellIndex < partialRow.fromLineByCell.length;
|
|
75915
|
+
const hasValidToLineByCell = partialRow?.toLineByCell && cellIndex < partialRow.toLineByCell.length;
|
|
75916
|
+
if (hasValidFromLineByCell) {
|
|
75917
|
+
const rawFrom = partialRow.fromLineByCell[cellIndex];
|
|
75918
|
+
if (typeof rawFrom === "number" && rawFrom >= 0) {
|
|
75919
|
+
fromLine = rawFrom;
|
|
75920
|
+
}
|
|
75921
|
+
}
|
|
75922
|
+
if (hasValidToLineByCell) {
|
|
75923
|
+
const rawTo = partialRow.toLineByCell[cellIndex];
|
|
75924
|
+
if (typeof rawTo === "number") {
|
|
75925
|
+
toLine = rawTo === -1 ? totalLines : rawTo;
|
|
75926
|
+
}
|
|
75927
|
+
}
|
|
75928
|
+
}
|
|
75929
|
+
fromLine = Math.max(0, Math.min(fromLine, totalLines));
|
|
75930
|
+
toLine = Math.max(0, Math.min(toLine, totalLines));
|
|
75931
|
+
if (toLine < fromLine) {
|
|
75932
|
+
toLine = fromLine;
|
|
75933
|
+
}
|
|
75934
|
+
mergePmRange(range2, computeCellPmRange(cell, cellMeasure, fromLine, toLine));
|
|
75935
|
+
}
|
|
75936
|
+
}
|
|
75937
|
+
return range2;
|
|
75938
|
+
}
|
|
75939
|
+
function applyTableFragmentPmRange(fragment, block, measure) {
|
|
75940
|
+
const range2 = computeTableFragmentPmRange(block, measure, fragment.fromRow, fragment.toRow, fragment.partialRow);
|
|
75941
|
+
if (range2.pmStart != null) {
|
|
75942
|
+
fragment.pmStart = range2.pmStart;
|
|
75943
|
+
}
|
|
75944
|
+
if (range2.pmEnd != null) {
|
|
75945
|
+
fragment.pmEnd = range2.pmEnd;
|
|
75946
|
+
}
|
|
75947
|
+
}
|
|
75857
75948
|
function computePartialRow(rowIndex, blockRow, measure, availableHeight, fromLineByCell) {
|
|
75858
75949
|
const row = measure.rows[rowIndex];
|
|
75859
75950
|
if (!row) {
|
|
@@ -75998,6 +76089,7 @@ function layoutMonolithicTable(context) {
|
|
|
75998
76089
|
height,
|
|
75999
76090
|
metadata
|
|
76000
76091
|
};
|
|
76092
|
+
applyTableFragmentPmRange(fragment, context.block, context.measure);
|
|
76001
76093
|
state2.page.fragments.push(fragment);
|
|
76002
76094
|
state2.cursorY += height;
|
|
76003
76095
|
}
|
|
@@ -76076,6 +76168,7 @@ function layoutTableBlock({
|
|
|
76076
76168
|
height,
|
|
76077
76169
|
metadata
|
|
76078
76170
|
};
|
|
76171
|
+
applyTableFragmentPmRange(fragment, block, measure);
|
|
76079
76172
|
state2.page.fragments.push(fragment);
|
|
76080
76173
|
state2.cursorY += height;
|
|
76081
76174
|
return;
|
|
@@ -76139,6 +76232,7 @@ function layoutTableBlock({
|
|
|
76139
76232
|
partialRow: continuationPartialRow,
|
|
76140
76233
|
metadata: generateFragmentMetadata(measure)
|
|
76141
76234
|
};
|
|
76235
|
+
applyTableFragmentPmRange(fragment2, block, measure);
|
|
76142
76236
|
state2.page.fragments.push(fragment2);
|
|
76143
76237
|
state2.cursorY += fragmentHeight2;
|
|
76144
76238
|
}
|
|
@@ -76183,6 +76277,7 @@ function layoutTableBlock({
|
|
|
76183
76277
|
partialRow: forcedPartialRow,
|
|
76184
76278
|
metadata: generateFragmentMetadata(measure)
|
|
76185
76279
|
};
|
|
76280
|
+
applyTableFragmentPmRange(fragment2, block, measure);
|
|
76186
76281
|
state2.page.fragments.push(fragment2);
|
|
76187
76282
|
state2.cursorY += fragmentHeight2;
|
|
76188
76283
|
pendingPartialRow = forcedPartialRow;
|
|
@@ -76218,6 +76313,7 @@ function layoutTableBlock({
|
|
|
76218
76313
|
partialRow: partialRow || void 0,
|
|
76219
76314
|
metadata: generateFragmentMetadata(measure)
|
|
76220
76315
|
};
|
|
76316
|
+
applyTableFragmentPmRange(fragment, block, measure);
|
|
76221
76317
|
state2.page.fragments.push(fragment);
|
|
76222
76318
|
state2.cursorY += fragmentHeight;
|
|
76223
76319
|
if (partialRow && !partialRow.isLastPart) {
|
|
@@ -76235,7 +76331,7 @@ function createAnchoredTableFragment(block, measure, x2, y2) {
|
|
|
76235
76331
|
columnBoundaries: generateColumnBoundaries(measure),
|
|
76236
76332
|
coordinateSystem: "fragment"
|
|
76237
76333
|
};
|
|
76238
|
-
|
|
76334
|
+
const fragment = {
|
|
76239
76335
|
kind: "table",
|
|
76240
76336
|
blockId: block.id,
|
|
76241
76337
|
fromRow: 0,
|
|
@@ -76246,6 +76342,8 @@ function createAnchoredTableFragment(block, measure, x2, y2) {
|
|
|
76246
76342
|
height: measure.totalHeight ?? 0,
|
|
76247
76343
|
metadata
|
|
76248
76344
|
};
|
|
76345
|
+
applyTableFragmentPmRange(fragment, block, measure);
|
|
76346
|
+
return fragment;
|
|
76249
76347
|
}
|
|
76250
76348
|
function isPageRelativeAnchor(block) {
|
|
76251
76349
|
const vRelativeFrom = block.anchor?.vRelativeFrom;
|
|
@@ -78705,7 +78803,8 @@ const getNextTabStopPx$1 = (currentX, tabStops, startIndex) => {
|
|
|
78705
78803
|
function measureRunSliceWidth(run2, fromChar, toChar) {
|
|
78706
78804
|
const context = getCtx();
|
|
78707
78805
|
const fullText = runText(run2);
|
|
78708
|
-
const
|
|
78806
|
+
const transform = isTextRun$2(run2) ? run2.textTransform : void 0;
|
|
78807
|
+
const text = applyTextTransform$1(fullText.slice(fromChar, toChar), transform, fullText, fromChar);
|
|
78709
78808
|
if (!context) {
|
|
78710
78809
|
const textRun = isTextRun$2(run2) ? run2 : null;
|
|
78711
78810
|
const size2 = textRun?.fontSize ?? 16;
|
|
@@ -82006,14 +82105,15 @@ function getAtomNodeTypes(schema) {
|
|
|
82006
82105
|
if (!schema) return [];
|
|
82007
82106
|
const types2 = [];
|
|
82008
82107
|
try {
|
|
82009
|
-
schema.nodes
|
|
82108
|
+
for (const name in schema.nodes) {
|
|
82010
82109
|
if (name === "text") {
|
|
82011
|
-
|
|
82110
|
+
continue;
|
|
82012
82111
|
}
|
|
82013
|
-
|
|
82112
|
+
const nodeType = schema.nodes[name];
|
|
82113
|
+
if (nodeType && (nodeType.isAtom || nodeType.isLeaf)) {
|
|
82014
82114
|
types2.push(name);
|
|
82015
82115
|
}
|
|
82016
|
-
}
|
|
82116
|
+
}
|
|
82017
82117
|
} catch {
|
|
82018
82118
|
return [];
|
|
82019
82119
|
}
|
|
@@ -92910,7 +93010,7 @@ const capitalizeText = (text, fullText, startOffset) => {
|
|
|
92910
93010
|
return result;
|
|
92911
93011
|
};
|
|
92912
93012
|
const applyTextTransform = (text, run2, startOffset) => {
|
|
92913
|
-
const transform = run2.textTransform;
|
|
93013
|
+
const transform = "textTransform" in run2 ? run2.textTransform : void 0;
|
|
92914
93014
|
if (!text || !transform || transform === "none") return text;
|
|
92915
93015
|
if (transform === "uppercase") return text.toUpperCase();
|
|
92916
93016
|
if (transform === "lowercase") return text.toLowerCase();
|
|
@@ -93233,6 +93333,9 @@ const _PresentationEditor = class _PresentationEditor2 extends EventEmitter$1 {
|
|
|
93233
93333
|
if (event.button !== 0) {
|
|
93234
93334
|
return;
|
|
93235
93335
|
}
|
|
93336
|
+
if (event.ctrlKey && navigator.platform.includes("Mac")) {
|
|
93337
|
+
return;
|
|
93338
|
+
}
|
|
93236
93339
|
__privateSet(this, _pendingMarginClick, null);
|
|
93237
93340
|
const target = event.target;
|
|
93238
93341
|
if (target?.closest?.(".superdoc-ruler-handle") != null) {
|
|
@@ -98642,6 +98745,8 @@ const SlashMenu = Extension.create({
|
|
|
98642
98745
|
const cbRect = containingBlock.getBoundingClientRect();
|
|
98643
98746
|
left2 -= cbRect.left;
|
|
98644
98747
|
top2 -= cbRect.top;
|
|
98748
|
+
left2 += containingBlock.scrollLeft || 0;
|
|
98749
|
+
top2 += containingBlock.scrollTop || 0;
|
|
98645
98750
|
} catch (error) {
|
|
98646
98751
|
console.warn("SlashMenu: Failed to adjust for containing block", error);
|
|
98647
98752
|
}
|
|
@@ -129980,7 +130085,7 @@ const _sfc_main$8 = {
|
|
|
129980
130085
|
if (open) {
|
|
129981
130086
|
nextTick(() => {
|
|
129982
130087
|
if (searchInput.value) {
|
|
129983
|
-
searchInput.value.focus();
|
|
130088
|
+
searchInput.value.focus({ preventScroll: true });
|
|
129984
130089
|
}
|
|
129985
130090
|
});
|
|
129986
130091
|
}
|
|
@@ -130085,7 +130190,11 @@ const _sfc_main$8 = {
|
|
|
130085
130190
|
};
|
|
130086
130191
|
const handleGlobalOutsideClick = (event) => {
|
|
130087
130192
|
if (isOpen.value && menuRef.value && !menuRef.value.contains(event.target)) {
|
|
130088
|
-
|
|
130193
|
+
const isCtrlClickOnMac = event.ctrlKey && isMacOS();
|
|
130194
|
+
const isLeftClick = event.button === 0 && !isCtrlClickOnMac;
|
|
130195
|
+
if (isLeftClick) {
|
|
130196
|
+
moveCursorToMouseEvent(event, props.editor);
|
|
130197
|
+
}
|
|
130089
130198
|
closeMenu({ restoreCursor: false });
|
|
130090
130199
|
}
|
|
130091
130200
|
};
|
|
@@ -132207,6 +132316,12 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
132207
132316
|
if (props.options?.suppressSkeletonLoader || !props.options?.collaborationProvider) editorReady.value = true;
|
|
132208
132317
|
});
|
|
132209
132318
|
const handleMarginClick = (event) => {
|
|
132319
|
+
if (event.button !== 0) {
|
|
132320
|
+
return;
|
|
132321
|
+
}
|
|
132322
|
+
if (event.ctrlKey && isMacOS()) {
|
|
132323
|
+
return;
|
|
132324
|
+
}
|
|
132210
132325
|
if (event.target.classList.contains("ProseMirror")) return;
|
|
132211
132326
|
onMarginClickCursorChange(event, activeEditor.value);
|
|
132212
132327
|
};
|
|
@@ -132345,7 +132460,7 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
132345
132460
|
};
|
|
132346
132461
|
}
|
|
132347
132462
|
});
|
|
132348
|
-
const SuperEditor = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["__scopeId", "data-v-
|
|
132463
|
+
const SuperEditor = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["__scopeId", "data-v-c9a3c876"]]);
|
|
132349
132464
|
const _hoisted_1 = ["innerHTML"];
|
|
132350
132465
|
const _sfc_main = {
|
|
132351
132466
|
__name: "SuperInput",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SuperDoc.d.ts","sourceRoot":"","sources":["../../../../../src/core/SuperDoc.js"],"names":[],"mappings":"AAsBA,6CAA6C;AAC7C,mEAAmE;AACnE,qDAAqD;AACrD,mDAAmD;AACnD,iDAAiD;AACjD,6DAA6D;AAC7D,iDAAiD;AACjD,6DAA6D;AAE7D;;;;;;GAMG;AACH;IACE,4BAA4B;IAC5B,qBADW,KAAK,CAAC,MAAM,CAAC,CACgB;IA+ExC;;OAEG;IACH,oBAFW,MAAM,EAKhB;IAnFD,qBAAqB;IACrB,SADW,MAAM,CACT;IAER,qBAAqB;IACrB,OADW,IAAI,EAAE,CACX;IAEN,4CAA4C;IAC5C,MADW,OAAO,KAAK,EAAE,GAAG,GAAG,SAAS,CACnC;IAEL,4EAA4E;IAC5E,UADW,OAAO,sBAAsB,EAAE,kBAAkB,GAAG,SAAS,CAC/D;IAET,qBAAqB;IACrB,QADW,MAAM,CA+Df;IAiDA,wCAA6B;IAC7B,+BAAmB;IAMnB,gBAA+C;IAC/C,6BAAgC;IAchC,yCAA4B;IAE5B,YAAkB;IAElB,WAAuC;IAEvC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBAAwB;IACxB,4BAAkB;IASlB,iCAAqB;IAErB,cAA6C;IAC7C,cAA4C;IAM9C;;;OAGG;IACH,+BAFa,MAAM,CAIlB;IAED;;;MAKC;IAED;;;OAGG;IACH,eAFa,WAAW,GAAG,IAAI,CAO9B;IAsFC,SAAc;IACd,WAAkB;IAKlB,mBAAkC;IAClC,mBAAkC;IAClC,2BAAkD;IAuClD,qCAA2B;IA8D7B;;;;OAIG;IACH,oBAHW,MAAM,GACJ,IAAI,CAKhB;IAED;;;;OAIG;IACH,iCAFa,IAAI,CAIhB;IAED;;;;;OAKG;IACH,kCAHG;QAAsB,KAAK,EAAnB,KAAK;QACU,MAAM,EAArB,MAAM;KAChB,QAKA;IAED;;;OAGG;IACH,6BAFa,IAAI,CAIhB;IAED;;;OAGG;IACH,kBAFa,IAAI,CAMhB;IAED;;;;OAIG;IACH,oCAHW,MAAM,GACJ,IAAI,CAIhB;IAED;;;;OAIG;IACH,8BAHW,MAAM,GACJ,IAAI,CAMhB;IAED;;;OAGG;IACH,0BAFa,IAAI,CAIhB;IAED;;;OAGG;IACH,iCAFW,OAAO,QAIjB;IAMD;;;;OAIG;IACH,wBAHW,MAAM,GACJ,IAAI,CAQhB;IAED;;;;OAIG;IACH,eAFa,IAAI,CAQhB;IAED;;;;;;;;;;;;OAYG;IACH,iFAPG;QAAuB,UAAU,EAAzB,MAAM;QACU,IAAI;QACH,UAAU;QACN,OAAO;QACP,aAAa;KAC1C,GAAU,OAAO,CA2BnB;IAIC,oBAAmF;IACnF;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"SuperDoc.d.ts","sourceRoot":"","sources":["../../../../../src/core/SuperDoc.js"],"names":[],"mappings":"AAsBA,6CAA6C;AAC7C,mEAAmE;AACnE,qDAAqD;AACrD,mDAAmD;AACnD,iDAAiD;AACjD,6DAA6D;AAC7D,iDAAiD;AACjD,6DAA6D;AAE7D;;;;;;GAMG;AACH;IACE,4BAA4B;IAC5B,qBADW,KAAK,CAAC,MAAM,CAAC,CACgB;IA+ExC;;OAEG;IACH,oBAFW,MAAM,EAKhB;IAnFD,qBAAqB;IACrB,SADW,MAAM,CACT;IAER,qBAAqB;IACrB,OADW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A;KAAE,GAC7C,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAkChC;IAWK,8CAAkC;IAsBxC;;;OAGG;IACH,QAFa,OAAO,CAAC,IAAI,EAAE,CAAC,CAY3B;IAED;;;OAGG;IACH,WAFa,IAAI,CAiChB;IAED;;;OAGG;IACH,SAFa,IAAI,CAahB;IAED;;;;OAIG;IACH,oCAHW,OAAO,GACL,IAAI,CAMhB;IAED;;;;;;;OAOG;IACH,oCAJG;QAAwB,IAAI,EAApB,MAAM;QACU,IAAI,EAApB,MAAM;KACd,GAAU,IAAI,CAUhB;;CACF;mBAjiCa,OAAO,SAAS,EAAE,IAAI;8BACtB,OAAO,SAAS,EAAE,eAAe;uBACjC,OAAO,SAAS,EAAE,QAAQ;sBAC1B,OAAO,SAAS,EAAE,OAAO;qBACzB,OAAO,SAAS,EAAE,MAAM;2BACxB,OAAO,SAAS,EAAE,YAAY;qBAC9B,OAAO,SAAS,EAAE,MAAM;2BACxB,OAAO,SAAS,EAAE,YAAY;6BA3Bf,eAAe;8BAMd,iEAAiE"}
|
package/dist/style.css
CHANGED
|
@@ -2332,10 +2332,10 @@ https://github.com/ProseMirror/prosemirror-tables/blob/master/demo/index.html
|
|
|
2332
2332
|
box-shadow: 0 0 4px rgba(74, 144, 226, 0.5);
|
|
2333
2333
|
}
|
|
2334
2334
|
|
|
2335
|
-
.editor-element[data-v-
|
|
2335
|
+
.editor-element[data-v-c9a3c876] {
|
|
2336
2336
|
position: relative;
|
|
2337
2337
|
}
|
|
2338
|
-
.super-editor-container[data-v-
|
|
2338
|
+
.super-editor-container[data-v-c9a3c876] {
|
|
2339
2339
|
width: auto;
|
|
2340
2340
|
height: auto;
|
|
2341
2341
|
min-width: 8in;
|
|
@@ -2344,14 +2344,14 @@ https://github.com/ProseMirror/prosemirror-tables/blob/master/demo/index.html
|
|
|
2344
2344
|
display: flex;
|
|
2345
2345
|
flex-direction: column;
|
|
2346
2346
|
}
|
|
2347
|
-
.ruler[data-v-
|
|
2347
|
+
.ruler[data-v-c9a3c876] {
|
|
2348
2348
|
margin-bottom: 2px;
|
|
2349
2349
|
}
|
|
2350
|
-
.super-editor[data-v-
|
|
2350
|
+
.super-editor[data-v-c9a3c876] {
|
|
2351
2351
|
color: initial;
|
|
2352
2352
|
overflow: hidden;
|
|
2353
2353
|
}
|
|
2354
|
-
.placeholder-editor[data-v-
|
|
2354
|
+
.placeholder-editor[data-v-c9a3c876] {
|
|
2355
2355
|
position: absolute;
|
|
2356
2356
|
top: 0;
|
|
2357
2357
|
left: 0;
|
|
@@ -2363,7 +2363,7 @@ https://github.com/ProseMirror/prosemirror-tables/blob/master/demo/index.html
|
|
|
2363
2363
|
background-color: white;
|
|
2364
2364
|
box-sizing: border-box;
|
|
2365
2365
|
}
|
|
2366
|
-
.placeholder-title[data-v-
|
|
2366
|
+
.placeholder-title[data-v-c9a3c876] {
|
|
2367
2367
|
display: flex;
|
|
2368
2368
|
justify-content: center;
|
|
2369
2369
|
margin-bottom: 40px;
|
|
@@ -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-CH2eG52x.js";
|
|
3
|
+
import { _ as _export_sfc } from "./chunks/editor-Du7p05wU.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 = {}) {
|
|
@@ -42727,7 +42727,7 @@ const _SuperConverter = class _SuperConverter {
|
|
|
42727
42727
|
static getStoredSuperdocVersion(docx) {
|
|
42728
42728
|
return _SuperConverter.getStoredCustomProperty(docx, "SuperdocVersion");
|
|
42729
42729
|
}
|
|
42730
|
-
static setStoredSuperdocVersion(docx = this.convertedXml, version = "2.0.0-next.
|
|
42730
|
+
static setStoredSuperdocVersion(docx = this.convertedXml, version = "2.0.0-next.5") {
|
|
42731
42731
|
return _SuperConverter.setStoredCustomProperty(docx, "SuperdocVersion", version, false);
|
|
42732
42732
|
}
|
|
42733
42733
|
/**
|
|
@@ -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-CH2eG52x.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
|
}
|