@harbour-enterprises/superdoc 0.14.4-next.1 → 0.14.4
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/{index-BvK-G6B1.es.js → index-BMwK7kM5.es.js} +2 -2
- package/dist/chunks/{index-CCRVYhTn.cjs → index-CZuIe8A3.cjs} +1 -1
- package/dist/chunks/{index-oHslWah4.es.js → index-MJ-5Yknb.es.js} +1 -1
- package/dist/chunks/{index-CgJ5KVh6.cjs → index-Oz4X1zyg.cjs} +2 -2
- package/dist/chunks/{super-editor.es-AskbUH1O.cjs → super-editor.es-BOGWXrpc.cjs} +204 -95
- package/dist/chunks/{super-editor.es-BFK0pgtL.es.js → super-editor.es-COF7S1m0.es.js} +204 -95
- package/dist/chunks/{url-BG1Z_Z2_.cjs → url-CRVat8D5.cjs} +1 -1
- package/dist/chunks/{url-Dvx6wrNT.es.js → url-Cqg2Hljl.es.js} +1 -1
- package/dist/chunks/{xml-js-DNISVjNF.es.js → xml-js-D78KIQHL.es.js} +4 -11
- package/dist/chunks/{xml-js-BHJlXtfU.cjs → xml-js-t28wMlyv.cjs} +4 -11
- package/dist/style.css +9 -15
- package/dist/super-editor/ai-writer.es.js +2 -2
- package/dist/super-editor/chunks/{converter-CUXU6ES7.js → converter-DcG3OPh9.js} +2 -4
- package/dist/super-editor/chunks/{docx-zipper-CQaskYOM.js → docx-zipper-Cz9xh4dK.js} +1 -1
- package/dist/super-editor/chunks/{editor-DhBWeNtJ.js → editor-BndKcGqQ.js} +204 -93
- package/dist/super-editor/chunks/{toolbar-CWQZpMFW.js → toolbar-BfGFnFms.js} +2 -2
- package/dist/super-editor/converter.es.js +1 -1
- package/dist/super-editor/core/commands/decreaseListIndent.d.ts.map +1 -1
- package/dist/super-editor/core/commands/deleteListItem.d.ts.map +1 -1
- package/dist/super-editor/core/commands/increaseListIndent.d.ts.map +1 -1
- package/dist/super-editor/core/commands/splitListItem.d.ts.map +1 -1
- package/dist/super-editor/core/commands/toggleList.d.ts.map +1 -1
- package/dist/super-editor/core/super-converter/v2/importer/annotationImporter.d.ts.map +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/extensions/bullet-list/bullet-list.d.ts.map +1 -1
- package/dist/super-editor/extensions/ordered-list/ordered-list.d.ts.map +1 -1
- package/dist/super-editor/extensions/pagination/pagination-helpers.d.ts.map +1 -1
- package/dist/super-editor/file-zipper.es.js +1 -1
- package/dist/super-editor/style.css +9 -15
- 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 +5 -5
- package/dist/superdoc.es.js +6 -6
- package/dist/superdoc.umd.js +205 -96
- package/dist/superdoc.umd.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { c as commonjsGlobal, B as Buffer, a as getAugmentedNamespace, g as getDefaultExportFromCjs } from "./jszip-CYDYUNnI.es.js";
|
|
2
2
|
import { p as process$1 } from "./vue-lU0o_RlU.es.js";
|
|
3
|
-
import { e as eventsExports, r as require$$2, u as util, i as inherits_browserExports, b as browser$1, a as requireString_decoder } from "./xml-js-
|
|
4
|
-
import { u as url } from "./url-
|
|
3
|
+
import { e as eventsExports, r as require$$2, u as util, i as inherits_browserExports, b as browser$1, a as requireString_decoder } from "./xml-js-D78KIQHL.es.js";
|
|
4
|
+
import { u as url } from "./url-Cqg2Hljl.es.js";
|
|
5
5
|
function _mergeNamespaces(n, m) {
|
|
6
6
|
for (var i = 0; i < m.length; i++) {
|
|
7
7
|
const e = m[i];
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { g as getDefaultExportFromCjs } from "./jszip-CYDYUNnI.es.js";
|
|
2
|
-
import { s as streamHttp, r as require$$1 } from "./index-
|
|
2
|
+
import { s as streamHttp, r as require$$1 } from "./index-BMwK7kM5.es.js";
|
|
3
3
|
function _mergeNamespaces(n, m) {
|
|
4
4
|
for (var i = 0; i < m.length; i++) {
|
|
5
5
|
const e = m[i];
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
const jszip = require("./jszip-D5XoMX4C.cjs");
|
|
3
3
|
const vue = require("./vue-tQYF719J.cjs");
|
|
4
|
-
const xmlJs = require("./xml-js-
|
|
5
|
-
const url = require("./url-
|
|
4
|
+
const xmlJs = require("./xml-js-t28wMlyv.cjs");
|
|
5
|
+
const url = require("./url-CRVat8D5.cjs");
|
|
6
6
|
function _mergeNamespaces(n, m) {
|
|
7
7
|
for (var i = 0; i < m.length; i++) {
|
|
8
8
|
const e = m[i];
|
|
@@ -22465,11 +22465,9 @@ const handleAnnotationNode = (params2) => {
|
|
|
22465
22465
|
textHighlight: parsedAttrs.fieldTextHighlight
|
|
22466
22466
|
};
|
|
22467
22467
|
attrs = attrsFromJSON;
|
|
22468
|
-
console.debug("Import annotation attrs", { asJSON: processAsJSON, attrs });
|
|
22469
22468
|
} else {
|
|
22470
22469
|
const attrsFromElements = getAttrsFromElements({ sdtPr, tag, alias });
|
|
22471
22470
|
attrs = attrsFromElements;
|
|
22472
|
-
console.debug("Import annotation attrs", { asJSON: processAsJSON, attrs });
|
|
22473
22471
|
}
|
|
22474
22472
|
const { attrs: marksAsAttrs, marks } = parseAnnotationMarks(sdtContent);
|
|
22475
22473
|
const allAttrs = { ...attrs, ...marksAsAttrs };
|
|
@@ -24345,7 +24343,7 @@ const _SuperConverter = class _SuperConverter2 {
|
|
|
24345
24343
|
return;
|
|
24346
24344
|
}
|
|
24347
24345
|
}
|
|
24348
|
-
static updateDocumentVersion(docx = this.convertedXml, version2 = "0.14.4
|
|
24346
|
+
static updateDocumentVersion(docx = this.convertedXml, version2 = "0.14.4") {
|
|
24349
24347
|
const customLocation = "docProps/custom.xml";
|
|
24350
24348
|
if (!docx[customLocation]) {
|
|
24351
24349
|
docx[customLocation] = generateCustomXml();
|
|
@@ -24821,7 +24819,7 @@ function storeSuperdocVersion(docx) {
|
|
|
24821
24819
|
function generateCustomXml() {
|
|
24822
24820
|
return DEFAULT_CUSTOM_XML;
|
|
24823
24821
|
}
|
|
24824
|
-
function generateSuperdocVersion(pid = 2, version2 = "0.14.4
|
|
24822
|
+
function generateSuperdocVersion(pid = 2, version2 = "0.14.4") {
|
|
24825
24823
|
return {
|
|
24826
24824
|
type: "element",
|
|
24827
24825
|
name: "property",
|
|
@@ -31485,50 +31483,71 @@ const ListHelpers = {
|
|
|
31485
31483
|
baseBulletList
|
|
31486
31484
|
};
|
|
31487
31485
|
const toggleList = (listType) => ({ editor, state: state2, tr }) => {
|
|
31486
|
+
const { selection } = state2;
|
|
31487
|
+
const { from: from2, to } = selection;
|
|
31488
31488
|
const isList2 = findParentNode((node2) => node2.type === listType)(tr.selection);
|
|
31489
31489
|
if (!isList2) {
|
|
31490
|
+
if (!selection.empty && from2 !== to) {
|
|
31491
|
+
const paragraphsToConvert = [];
|
|
31492
|
+
state2.doc.nodesBetween(from2, to, (node2, pos) => {
|
|
31493
|
+
if (node2.type.name === "paragraph") {
|
|
31494
|
+
const nodeFrom = pos;
|
|
31495
|
+
const nodeTo = pos + node2.nodeSize;
|
|
31496
|
+
if (nodeFrom < to && nodeTo > from2) {
|
|
31497
|
+
paragraphsToConvert.push({
|
|
31498
|
+
node: node2,
|
|
31499
|
+
pos,
|
|
31500
|
+
from: Math.max(nodeFrom, from2),
|
|
31501
|
+
to: Math.min(nodeTo, to)
|
|
31502
|
+
});
|
|
31503
|
+
}
|
|
31504
|
+
}
|
|
31505
|
+
return false;
|
|
31506
|
+
});
|
|
31507
|
+
if (paragraphsToConvert.length > 1) {
|
|
31508
|
+
const numId = ListHelpers.getNewListId(editor);
|
|
31509
|
+
if (typeof listType === "string") listType = editor.schema.nodes[listType];
|
|
31510
|
+
ListHelpers.generateNewListDefinition({ numId, listType, editor });
|
|
31511
|
+
paragraphsToConvert.reverse().forEach(({ node: node2, pos }) => {
|
|
31512
|
+
const level = 0;
|
|
31513
|
+
const listLevel = [1];
|
|
31514
|
+
const listNode = ListHelpers.createSchemaOrderedListNode({
|
|
31515
|
+
level,
|
|
31516
|
+
numId,
|
|
31517
|
+
listType,
|
|
31518
|
+
editor,
|
|
31519
|
+
listLevel,
|
|
31520
|
+
contentNode: node2.toJSON()
|
|
31521
|
+
});
|
|
31522
|
+
const replaceFrom = pos;
|
|
31523
|
+
const replaceTo = pos + node2.nodeSize;
|
|
31524
|
+
ListHelpers.insertNewList(tr, replaceFrom, replaceTo, listNode);
|
|
31525
|
+
});
|
|
31526
|
+
return true;
|
|
31527
|
+
}
|
|
31528
|
+
}
|
|
31490
31529
|
return ListHelpers.createNewList({ listType, tr, editor });
|
|
31491
31530
|
}
|
|
31492
31531
|
return false;
|
|
31493
31532
|
};
|
|
31494
31533
|
const decreaseListIndent = () => ({ editor, tr }) => {
|
|
31495
31534
|
const { state: state2 } = editor;
|
|
31496
|
-
const $from = state2.selection.$from;
|
|
31497
|
-
const content = $from.parent;
|
|
31498
31535
|
const currentNode = ListHelpers.getCurrentListItem(state2);
|
|
31499
31536
|
if (!currentNode) return false;
|
|
31500
31537
|
const parentList = ListHelpers.getParentOrderedList(state2);
|
|
31501
31538
|
if (!parentList) return false;
|
|
31502
31539
|
const currentLevel = currentNode.node.attrs.level;
|
|
31503
31540
|
const newLevel = currentLevel - 1;
|
|
31504
|
-
const numId = currentNode.node.attrs.numId;
|
|
31505
|
-
const replaceFrom = parentList.pos;
|
|
31506
|
-
const replaceTo = parentList.pos + parentList.node.nodeSize;
|
|
31507
|
-
if (replaceFrom < 0 || replaceTo > state2.doc.content.size || replaceFrom >= replaceTo) {
|
|
31508
|
-
console.warn("Invalid replace positions");
|
|
31509
|
-
return false;
|
|
31510
|
-
}
|
|
31511
31541
|
if (newLevel < 0) {
|
|
31512
31542
|
return false;
|
|
31513
31543
|
}
|
|
31514
|
-
|
|
31515
|
-
|
|
31516
|
-
|
|
31517
|
-
|
|
31518
|
-
|
|
31519
|
-
|
|
31520
|
-
|
|
31521
|
-
contentNode: content?.toJSON()
|
|
31522
|
-
});
|
|
31523
|
-
const newMarks = ListHelpers.addInlineTextMarks(currentNode.node, []);
|
|
31524
|
-
ListHelpers.replaceListWithNode({ tr, from: replaceFrom, to: replaceTo, newNode: listNode });
|
|
31525
|
-
tr.ensureMarks(newMarks);
|
|
31526
|
-
ListHelpers.setSelectionInsideNewList(tr, replaceFrom);
|
|
31527
|
-
return true;
|
|
31528
|
-
} catch (error) {
|
|
31529
|
-
console.error("Error decreasing indent:", error);
|
|
31530
|
-
return false;
|
|
31531
|
-
}
|
|
31544
|
+
const numId = currentNode.node.attrs.numId;
|
|
31545
|
+
tr.setNodeMarkup(currentNode.pos, null, {
|
|
31546
|
+
...currentNode.node.attrs,
|
|
31547
|
+
level: newLevel,
|
|
31548
|
+
numId
|
|
31549
|
+
});
|
|
31550
|
+
return true;
|
|
31532
31551
|
};
|
|
31533
31552
|
const splitListItem = () => (props) => {
|
|
31534
31553
|
const { tr, state: state2, editor } = props;
|
|
@@ -31541,7 +31560,7 @@ const splitListItem = () => (props) => {
|
|
|
31541
31560
|
return false;
|
|
31542
31561
|
}
|
|
31543
31562
|
if ($from.parent.content.size === 0 && $from.node(-1).childCount === $from.indexAfter(-1)) {
|
|
31544
|
-
return handleSplitInEmptyBlock(props);
|
|
31563
|
+
return handleSplitInEmptyBlock(props, currentListItem);
|
|
31545
31564
|
}
|
|
31546
31565
|
const matchedListItem = findParentNode((node2) => node2.type === type2)(state2.selection);
|
|
31547
31566
|
const { node: listItemNode } = matchedListItem || {};
|
|
@@ -31554,12 +31573,51 @@ const splitListItem = () => (props) => {
|
|
|
31554
31573
|
const paraOffset = $from.parentOffset;
|
|
31555
31574
|
const beforeCursor = paragraphNode.content.cut(0, paraOffset);
|
|
31556
31575
|
const afterCursor = paragraphNode.content.cut(paraOffset);
|
|
31557
|
-
const
|
|
31558
|
-
|
|
31559
|
-
|
|
31560
|
-
|
|
31561
|
-
|
|
31562
|
-
|
|
31576
|
+
const listItemHasMultipleParagraphs = listItemNode.childCount > 1;
|
|
31577
|
+
if (listItemHasMultipleParagraphs) {
|
|
31578
|
+
const paragraphIndex = $from.index(-1);
|
|
31579
|
+
let contentBeforeCurrentPara = [];
|
|
31580
|
+
for (let i = 0; i < paragraphIndex; i++) {
|
|
31581
|
+
contentBeforeCurrentPara.push(listItemNode.child(i));
|
|
31582
|
+
}
|
|
31583
|
+
let contentAfterCurrentPara = [];
|
|
31584
|
+
for (let i = paragraphIndex + 1; i < listItemNode.childCount; i++) {
|
|
31585
|
+
contentAfterCurrentPara.push(listItemNode.child(i));
|
|
31586
|
+
}
|
|
31587
|
+
let firstListContent = [...contentBeforeCurrentPara];
|
|
31588
|
+
if (beforeCursor.size > 0) {
|
|
31589
|
+
const modifiedFirstParagraph = editor.schema.nodes.paragraph.create(paragraphNode.attrs, beforeCursor);
|
|
31590
|
+
firstListContent.push(modifiedFirstParagraph);
|
|
31591
|
+
}
|
|
31592
|
+
let secondListContent = [];
|
|
31593
|
+
if (afterCursor && afterCursor.size > 0) {
|
|
31594
|
+
const modifiedSecondParagraph = editor.schema.nodes.paragraph.create(paragraphNode.attrs, afterCursor);
|
|
31595
|
+
secondListContent.push(modifiedSecondParagraph);
|
|
31596
|
+
} else {
|
|
31597
|
+
const emptyParagraph = editor.schema.nodes.paragraph.create(paragraphNode.attrs);
|
|
31598
|
+
secondListContent.push(emptyParagraph);
|
|
31599
|
+
}
|
|
31600
|
+
secondListContent = secondListContent.concat(contentAfterCurrentPara);
|
|
31601
|
+
if (firstListContent.length === 0) {
|
|
31602
|
+
const emptyParagraph = editor.schema.nodes.paragraph.create();
|
|
31603
|
+
firstListContent = [emptyParagraph];
|
|
31604
|
+
}
|
|
31605
|
+
if (secondListContent.length === 0) {
|
|
31606
|
+
const emptyParagraph = editor.schema.nodes.paragraph.create();
|
|
31607
|
+
secondListContent = [emptyParagraph];
|
|
31608
|
+
}
|
|
31609
|
+
const firstListItem = editor.schema.nodes.listItem.create({ ...listItemNode.attrs }, Fragment.from(firstListContent));
|
|
31610
|
+
var firstList = editor.schema.nodes.orderedList.createAndFill(parentListNode.attrs, Fragment.from(firstListItem));
|
|
31611
|
+
const secondListItem = editor.schema.nodes.listItem.create({ ...listItemNode.attrs }, Fragment.from(secondListContent));
|
|
31612
|
+
var secondList = editor.schema.nodes.orderedList.createAndFill(parentListNode.attrs, Fragment.from(secondListItem));
|
|
31613
|
+
} else {
|
|
31614
|
+
const firstParagraph = editor.schema.nodes.paragraph.create(paragraphNode.attrs, beforeCursor);
|
|
31615
|
+
const firstListItem = editor.schema.nodes.listItem.create({ ...listItemNode.attrs }, firstParagraph);
|
|
31616
|
+
var firstList = editor.schema.nodes.orderedList.createAndFill(parentListNode.attrs, Fragment.from(firstListItem));
|
|
31617
|
+
const secondParagraph = editor.schema.nodes.paragraph.create(paragraphNode.attrs, afterCursor);
|
|
31618
|
+
const secondListItem = editor.schema.nodes.listItem.create({ ...listItemNode.attrs }, secondParagraph);
|
|
31619
|
+
var secondList = editor.schema.nodes.orderedList.createAndFill(parentListNode.attrs, Fragment.from(secondListItem));
|
|
31620
|
+
}
|
|
31563
31621
|
if (!firstList || !secondList) return false;
|
|
31564
31622
|
const listStart = matchedParentList.pos;
|
|
31565
31623
|
const listEnd = matchedParentList.pos + parentListNode.nodeSize;
|
|
@@ -31576,43 +31634,90 @@ const splitListItem = () => (props) => {
|
|
|
31576
31634
|
tr.setMeta("splitListItem", true);
|
|
31577
31635
|
return true;
|
|
31578
31636
|
};
|
|
31579
|
-
const handleSplitInEmptyBlock = (props) => {
|
|
31637
|
+
const handleSplitInEmptyBlock = (props, currentListItem) => {
|
|
31580
31638
|
const { state: state2, editor, tr } = props;
|
|
31581
31639
|
const { schema } = state2;
|
|
31640
|
+
const { $from } = state2.selection;
|
|
31582
31641
|
const extensionAttrs = editor.extensionService.attributes;
|
|
31583
|
-
const listItemNode =
|
|
31584
|
-
|
|
31585
|
-
|
|
31586
|
-
const
|
|
31587
|
-
if (
|
|
31588
|
-
|
|
31589
|
-
|
|
31590
|
-
|
|
31591
|
-
|
|
31592
|
-
|
|
31642
|
+
const listItemNode = currentListItem.node;
|
|
31643
|
+
const isEmptyParagraph = $from.parent.content.size === 0;
|
|
31644
|
+
const listItemHasOtherContent = listItemNode.content.size > $from.parent.nodeSize;
|
|
31645
|
+
const isAtEndOfListItem = $from.indexAfter(-1) === $from.node(-1).childCount;
|
|
31646
|
+
if (isEmptyParagraph && listItemHasOtherContent && isAtEndOfListItem) {
|
|
31647
|
+
try {
|
|
31648
|
+
const listTypes = ["orderedList", "bulletList"];
|
|
31649
|
+
const parentList = findParentNode((node2) => listTypes.includes(node2.type.name))(state2.selection);
|
|
31650
|
+
if (!parentList) return false;
|
|
31651
|
+
const newParagraphAttrs = Attribute2.getSplittedAttributes(
|
|
31652
|
+
extensionAttrs,
|
|
31653
|
+
"paragraph",
|
|
31654
|
+
{}
|
|
31655
|
+
);
|
|
31656
|
+
const newParagraph = schema.nodes.paragraph.create(newParagraphAttrs);
|
|
31657
|
+
const newListItem = schema.nodes.listItem.create({ ...listItemNode.attrs }, newParagraph);
|
|
31658
|
+
const newList = schema.nodes.orderedList.createAndFill(parentList.node.attrs, Fragment.from(newListItem));
|
|
31659
|
+
if (!newList) return false;
|
|
31660
|
+
const insertPos = parentList.pos + parentList.node.nodeSize;
|
|
31661
|
+
tr.insert(insertPos, newList);
|
|
31662
|
+
const newPos = insertPos + 2;
|
|
31663
|
+
tr.setSelection(TextSelection.near(tr.doc.resolve(newPos)));
|
|
31664
|
+
tr.scrollIntoView();
|
|
31665
|
+
return true;
|
|
31666
|
+
} catch (error) {
|
|
31667
|
+
console.error("Error creating new list item:", error);
|
|
31593
31668
|
return false;
|
|
31594
31669
|
}
|
|
31595
|
-
|
|
31596
|
-
|
|
31597
|
-
"paragraph",
|
|
31598
|
-
{}
|
|
31599
|
-
);
|
|
31600
|
-
const paragraphType = schema.nodes.paragraph;
|
|
31601
|
-
let newParagraph = paragraphType.createAndFill(newParagraphAttrs);
|
|
31602
|
-
if (!newParagraph) {
|
|
31603
|
-
newParagraph = paragraphType.create();
|
|
31604
|
-
}
|
|
31605
|
-
const listStart = parentList.pos;
|
|
31606
|
-
const listEnd = parentList.pos + parentList.node.nodeSize;
|
|
31607
|
-
tr.replaceWith(listStart, listEnd, newParagraph);
|
|
31608
|
-
const newPos = listStart + 1;
|
|
31609
|
-
tr.setSelection(TextSelection.near(tr.doc.resolve(newPos)));
|
|
31610
|
-
tr.scrollIntoView();
|
|
31611
|
-
return true;
|
|
31612
|
-
} catch (error) {
|
|
31613
|
-
console.error("Error destroying list:", error);
|
|
31670
|
+
}
|
|
31671
|
+
if (isEmptyParagraph && listItemHasOtherContent && !isAtEndOfListItem) {
|
|
31614
31672
|
return false;
|
|
31615
31673
|
}
|
|
31674
|
+
const isListItemEmpty = () => {
|
|
31675
|
+
if (listItemNode.childCount === 0) return true;
|
|
31676
|
+
for (let i = 0; i < listItemNode.childCount; i++) {
|
|
31677
|
+
const child = listItemNode.child(i);
|
|
31678
|
+
if (child.type.name === "paragraph" && child.content.size === 0) {
|
|
31679
|
+
continue;
|
|
31680
|
+
} else if (child.type.name === "paragraph" && child.content.size > 0) {
|
|
31681
|
+
return false;
|
|
31682
|
+
} else {
|
|
31683
|
+
return false;
|
|
31684
|
+
}
|
|
31685
|
+
}
|
|
31686
|
+
return true;
|
|
31687
|
+
};
|
|
31688
|
+
if (isListItemEmpty()) {
|
|
31689
|
+
const didOutdent = decreaseListIndent()({ editor, tr });
|
|
31690
|
+
if (didOutdent) return true;
|
|
31691
|
+
try {
|
|
31692
|
+
const listTypes = ["orderedList", "bulletList"];
|
|
31693
|
+
const parentList = findParentNode((node2) => listTypes.includes(node2.type.name))(state2.selection);
|
|
31694
|
+
if (!parentList) {
|
|
31695
|
+
console.error("No parent list found");
|
|
31696
|
+
return false;
|
|
31697
|
+
}
|
|
31698
|
+
const newParagraphAttrs = Attribute2.getSplittedAttributes(
|
|
31699
|
+
extensionAttrs,
|
|
31700
|
+
"paragraph",
|
|
31701
|
+
{}
|
|
31702
|
+
);
|
|
31703
|
+
const paragraphType = schema.nodes.paragraph;
|
|
31704
|
+
let newParagraph = paragraphType.createAndFill(newParagraphAttrs);
|
|
31705
|
+
if (!newParagraph) {
|
|
31706
|
+
newParagraph = paragraphType.create();
|
|
31707
|
+
}
|
|
31708
|
+
const listStart = parentList.pos;
|
|
31709
|
+
const listEnd = parentList.pos + parentList.node.nodeSize;
|
|
31710
|
+
tr.replaceWith(listStart, listEnd, newParagraph);
|
|
31711
|
+
const newPos = listStart + 1;
|
|
31712
|
+
tr.setSelection(TextSelection.near(tr.doc.resolve(newPos)));
|
|
31713
|
+
tr.scrollIntoView();
|
|
31714
|
+
return true;
|
|
31715
|
+
} catch (error) {
|
|
31716
|
+
console.error("Error destroying list:", error);
|
|
31717
|
+
return false;
|
|
31718
|
+
}
|
|
31719
|
+
}
|
|
31720
|
+
return false;
|
|
31616
31721
|
};
|
|
31617
31722
|
const sinkListItem = (typeOrName) => ({ state: state2, dispatch }) => {
|
|
31618
31723
|
const type2 = getNodeType(typeOrName, state2.schema);
|
|
@@ -31656,47 +31761,34 @@ const deleteListItem = () => (props) => {
|
|
|
31656
31761
|
if (paragraphNode !== currentParagraphNode.node) return false;
|
|
31657
31762
|
const listFrom = parentList.pos;
|
|
31658
31763
|
const listTo = listFrom + parentList.node.nodeSize;
|
|
31659
|
-
if (
|
|
31764
|
+
if (currentListItem.node.content.size === 0) {
|
|
31660
31765
|
tr.delete(listFrom, listTo);
|
|
31661
31766
|
return true;
|
|
31662
31767
|
}
|
|
31663
|
-
const
|
|
31664
|
-
|
|
31665
|
-
|
|
31666
|
-
|
|
31667
|
-
);
|
|
31668
|
-
tr.replaceWith(listFrom, listTo,
|
|
31768
|
+
const listItemContent = currentListItem.node.content;
|
|
31769
|
+
const nodes = [];
|
|
31770
|
+
listItemContent.forEach((child) => {
|
|
31771
|
+
nodes.push(child);
|
|
31772
|
+
});
|
|
31773
|
+
tr.replaceWith(listFrom, listTo, nodes);
|
|
31669
31774
|
const $pos = tr.doc.resolve(listFrom + 1);
|
|
31670
31775
|
tr.setSelection(TextSelection.near($pos));
|
|
31671
31776
|
return true;
|
|
31672
31777
|
};
|
|
31673
31778
|
const increaseListIndent = () => ({ editor, tr }) => {
|
|
31674
31779
|
const { state: state2 } = editor;
|
|
31675
|
-
|
|
31676
|
-
const content = $from.parent;
|
|
31780
|
+
state2.selection.$from;
|
|
31677
31781
|
const currentNode = ListHelpers.getCurrentListItem(state2);
|
|
31678
31782
|
if (!currentNode) return false;
|
|
31679
31783
|
const parentList = ListHelpers.getParentOrderedList(state2);
|
|
31680
31784
|
if (!parentList) return false;
|
|
31681
|
-
const
|
|
31785
|
+
const newLevel = currentNode.node.attrs.level + 1;
|
|
31682
31786
|
const numId = currentNode.node.attrs.numId;
|
|
31683
|
-
|
|
31684
|
-
|
|
31685
|
-
level,
|
|
31686
|
-
numId
|
|
31687
|
-
listType,
|
|
31688
|
-
editor,
|
|
31689
|
-
contentNode: content?.toJSON()
|
|
31787
|
+
tr.setNodeMarkup(currentNode.pos, null, {
|
|
31788
|
+
...currentNode.node.attrs,
|
|
31789
|
+
level: newLevel,
|
|
31790
|
+
numId
|
|
31690
31791
|
});
|
|
31691
|
-
const newMarks = ListHelpers.addInlineTextMarks(currentNode.node, []);
|
|
31692
|
-
ListHelpers.replaceListWithNode({
|
|
31693
|
-
tr,
|
|
31694
|
-
from: parentList.pos,
|
|
31695
|
-
to: parentList.pos + parentList.node.nodeSize,
|
|
31696
|
-
newNode: listNode
|
|
31697
|
-
});
|
|
31698
|
-
tr.ensureMarks(newMarks);
|
|
31699
|
-
ListHelpers.setSelectionInsideNewList(tr, parentList.pos);
|
|
31700
31792
|
return true;
|
|
31701
31793
|
};
|
|
31702
31794
|
const commands = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
@@ -40044,9 +40136,12 @@ const createHeaderFooterEditor = ({
|
|
|
40044
40136
|
annotations: true,
|
|
40045
40137
|
currentPageNumber,
|
|
40046
40138
|
parentEditor: editor,
|
|
40139
|
+
editable: false,
|
|
40140
|
+
documentMode: "viewing",
|
|
40047
40141
|
onCreate: (evt) => setEditorToolbar(evt, editor),
|
|
40048
40142
|
onBlur: (evt) => onHeaderFooterDataUpdate(evt, editor, sectionId, type2)
|
|
40049
40143
|
});
|
|
40144
|
+
headerFooterEditor.setEditable(false, false);
|
|
40050
40145
|
const pm = editorContainer.querySelector(".ProseMirror");
|
|
40051
40146
|
if (pm) {
|
|
40052
40147
|
pm.style.maxHeight = "100%";
|
|
@@ -42318,7 +42413,7 @@ const _Editor = class _Editor2 extends EventEmitter$1 {
|
|
|
42318
42413
|
* @returns {Object | void} Migration results
|
|
42319
42414
|
*/
|
|
42320
42415
|
processCollaborationMigrations() {
|
|
42321
|
-
console.debug("[checkVersionMigrations] Current editor version", "0.14.4
|
|
42416
|
+
console.debug("[checkVersionMigrations] Current editor version", "0.14.4");
|
|
42322
42417
|
if (!this.options.ydoc) return;
|
|
42323
42418
|
const metaMap = this.options.ydoc.getMap("meta");
|
|
42324
42419
|
let docVersion = metaMap.get("version");
|
|
@@ -44126,6 +44221,13 @@ const BulletList = Node$1.create({
|
|
|
44126
44221
|
new InputRule({
|
|
44127
44222
|
match: inputRegex$1,
|
|
44128
44223
|
handler: ({ state: state2, range: range2 }) => {
|
|
44224
|
+
const $pos = state2.selection.$from;
|
|
44225
|
+
const listItemType = state2.schema.nodes.listItem;
|
|
44226
|
+
for (let depth = $pos.depth; depth >= 0; depth--) {
|
|
44227
|
+
if ($pos.node(depth).type === listItemType) {
|
|
44228
|
+
return null;
|
|
44229
|
+
}
|
|
44230
|
+
}
|
|
44129
44231
|
const { tr } = state2;
|
|
44130
44232
|
tr.delete(range2.from, range2.to);
|
|
44131
44233
|
ListHelpers.createNewList({
|
|
@@ -44279,6 +44381,13 @@ const OrderedList = Node$1.create({
|
|
|
44279
44381
|
new InputRule({
|
|
44280
44382
|
match: inputRegex,
|
|
44281
44383
|
handler: ({ state: state2, range: range2 }) => {
|
|
44384
|
+
const $pos = state2.selection.$from;
|
|
44385
|
+
const listItemType = state2.schema.nodes.listItem;
|
|
44386
|
+
for (let depth = $pos.depth; depth >= 0; depth--) {
|
|
44387
|
+
if ($pos.node(depth).type === listItemType) {
|
|
44388
|
+
return null;
|
|
44389
|
+
}
|
|
44390
|
+
}
|
|
44282
44391
|
const { tr } = state2;
|
|
44283
44392
|
tr.delete(range2.from, range2.to);
|
|
44284
44393
|
ListHelpers.createNewList({
|