@bigbinary/neeto-editor-frontend 2.0.10 → 2.1.0-beta1
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/.ready +1 -1
- package/dist/Editor.js +7 -6
- package/dist/Editor.js.map +1 -1
- package/dist/EditorContent.js +4 -3
- package/dist/EditorContent.js.map +1 -1
- package/dist/FormikEditor.js +7 -6
- package/dist/FormikEditor.js.map +1 -1
- package/dist/Menu.js +5 -4
- package/dist/Menu.js.map +1 -1
- package/dist/{chunk-DxmX0drN.js → chunk-7ioLE0kx.js} +2 -2
- package/dist/{chunk-DxmX0drN.js.map → chunk-7ioLE0kx.js.map} +1 -1
- package/dist/{chunk-MLCxAQf7.js → chunk-BNyLNMnb.js} +3 -3
- package/dist/{chunk-MLCxAQf7.js.map → chunk-BNyLNMnb.js.map} +1 -1
- package/dist/{cjs/chunk-Crp27WMe.cjs.js → chunk-BpMZjml2.js} +147 -3234
- package/dist/chunk-BpMZjml2.js.map +1 -0
- package/dist/{chunk-C_P2M3zF.js → chunk-Br5h7rjn.js} +7 -3
- package/dist/chunk-Br5h7rjn.js.map +1 -0
- package/dist/{chunk-Di3ipdfT.js → chunk-CRUXOawK.js} +3 -2
- package/dist/{chunk-Di3ipdfT.js.map → chunk-CRUXOawK.js.map} +1 -1
- package/dist/chunk-DN9pYQV5.js +3210 -0
- package/dist/chunk-DN9pYQV5.js.map +1 -0
- package/dist/{chunk-DbtYYDYF.js → chunk-DYRpf9PJ.js} +3 -3
- package/dist/{chunk-DbtYYDYF.js.map → chunk-DYRpf9PJ.js.map} +1 -1
- package/dist/{chunk-CTLN7kYv.js → chunk-DfH1lF5p.js} +3 -17
- package/dist/chunk-DfH1lF5p.js.map +1 -0
- package/dist/{chunk-Byc0nnPW.js → chunk-YhV82e9I.js} +8 -4
- package/dist/chunk-YhV82e9I.js.map +1 -0
- package/dist/{chunk-BAjN56q8.js → chunk-lEnpEBRB.js} +5 -4
- package/dist/{chunk-BAjN56q8.js.map → chunk-lEnpEBRB.js.map} +1 -1
- package/dist/{chunk-CrQm8ki8.js → chunk-sn8HEeT6.js} +4 -3
- package/dist/{chunk-CrQm8ki8.js.map → chunk-sn8HEeT6.js.map} +1 -1
- package/dist/cjs/Editor.cjs.js +8 -7
- package/dist/cjs/Editor.cjs.js.map +1 -1
- package/dist/cjs/EditorContent.cjs.js +4 -3
- package/dist/cjs/EditorContent.cjs.js.map +1 -1
- package/dist/cjs/FormikEditor.cjs.js +7 -6
- package/dist/cjs/FormikEditor.cjs.js.map +1 -1
- package/dist/cjs/Menu.cjs.js +5 -4
- package/dist/cjs/Menu.cjs.js.map +1 -1
- package/dist/cjs/{chunk-CwtiYxqr.cjs.js → chunk-78VpxO0R.cjs.js} +4 -3
- package/dist/cjs/{chunk-CwtiYxqr.cjs.js.map → chunk-78VpxO0R.cjs.js.map} +1 -1
- package/dist/{chunk-DgZGzqPs.js → cjs/chunk-BPJBeVDI.cjs.js} +166 -3206
- package/dist/cjs/chunk-BPJBeVDI.cjs.js.map +1 -0
- package/dist/cjs/{chunk-Ty2BpOZ5.cjs.js → chunk-CBswWnmM.cjs.js} +10 -6
- package/dist/cjs/chunk-CBswWnmM.cjs.js.map +1 -0
- package/dist/cjs/{chunk-Bsk_FDUA.cjs.js → chunk-CQLQEN5P.cjs.js} +5 -22
- package/dist/cjs/chunk-CQLQEN5P.cjs.js.map +1 -0
- package/dist/cjs/{chunk-CohcWDmm.cjs.js → chunk-CwY6UgZq.cjs.js} +78 -77
- package/dist/cjs/{chunk-CohcWDmm.cjs.js.map → chunk-CwY6UgZq.cjs.js.map} +1 -1
- package/dist/cjs/chunk-DRnP2LQe.cjs.js +3231 -0
- package/dist/cjs/chunk-DRnP2LQe.cjs.js.map +1 -0
- package/dist/cjs/{chunk-D9InNR1-.cjs.js → chunk-QnVNXaqt.cjs.js} +11 -7
- package/dist/cjs/chunk-QnVNXaqt.cjs.js.map +1 -0
- package/dist/cjs/{chunk-D53HfRZd.cjs.js → chunk-V1V-Gqfy.cjs.js} +3 -3
- package/dist/cjs/{chunk-D53HfRZd.cjs.js.map → chunk-V1V-Gqfy.cjs.js.map} +1 -1
- package/dist/cjs/{chunk-CkdAygKd.cjs.js → chunk-bfmPXyQJ.cjs.js} +3 -3
- package/dist/cjs/{chunk-CkdAygKd.cjs.js.map → chunk-bfmPXyQJ.cjs.js.map} +1 -1
- package/dist/cjs/{chunk-BwE6pvh2.cjs.js → chunk-bxP1kilM.cjs.js} +2 -2
- package/dist/cjs/{chunk-BwE6pvh2.cjs.js.map → chunk-bxP1kilM.cjs.js.map} +1 -1
- package/dist/cjs/{chunk-BAEoAF1o.cjs.js → chunk-j4T5BDua.cjs.js} +23 -22
- package/dist/cjs/{chunk-BAEoAF1o.cjs.js.map → chunk-j4T5BDua.cjs.js.map} +1 -1
- package/dist/cjs/index.cjs.js +9 -8
- package/dist/cjs/index.cjs.js.map +1 -1
- package/dist/cjs/utils.cjs.js +7 -6
- package/dist/cjs/utils.cjs.js.map +1 -1
- package/dist/cjs/v2/Editor.cjs.js +7 -6
- package/dist/cjs/v2/Editor.cjs.js.map +1 -1
- package/dist/cjs/v2/EditorContent.cjs.js +4 -3
- package/dist/cjs/v2/EditorContent.cjs.js.map +1 -1
- package/dist/cjs/v2/FormikEditor.cjs.js +6 -5
- package/dist/cjs/v2/FormikEditor.cjs.js.map +1 -1
- package/dist/cjs/v2/Menu.cjs.js +4 -3
- package/dist/cjs/v2/Menu.cjs.js.map +1 -1
- package/dist/cjs/v2/index.cjs.js +8 -7
- package/dist/cjs/v2/index.cjs.js.map +1 -1
- package/dist/cjs/v2/utils.cjs.js +7 -6
- package/dist/cjs/v2/utils.cjs.js.map +1 -1
- package/dist/editor-stats.html +2 -2
- package/dist/index.js +9 -8
- package/dist/index.js.map +1 -1
- package/dist/utils.js +7 -6
- package/dist/utils.js.map +1 -1
- package/dist/v2/Editor.js +6 -5
- package/dist/v2/Editor.js.map +1 -1
- package/dist/v2/EditorContent.js +4 -3
- package/dist/v2/EditorContent.js.map +1 -1
- package/dist/v2/FormikEditor.js +6 -5
- package/dist/v2/FormikEditor.js.map +1 -1
- package/dist/v2/Menu.js +4 -3
- package/dist/v2/Menu.js.map +1 -1
- package/dist/v2/index.js +8 -7
- package/dist/v2/index.js.map +1 -1
- package/dist/v2/utils.js +7 -6
- package/dist/v2/utils.js.map +1 -1
- package/package.json +7 -5
- package/dist/chunk-Byc0nnPW.js.map +0 -1
- package/dist/chunk-CTLN7kYv.js.map +0 -1
- package/dist/chunk-C_P2M3zF.js.map +0 -1
- package/dist/chunk-DgZGzqPs.js.map +0 -1
- package/dist/cjs/chunk-Bsk_FDUA.cjs.js.map +0 -1
- package/dist/cjs/chunk-Crp27WMe.cjs.js.map +0 -1
- package/dist/cjs/chunk-D9InNR1-.cjs.js.map +0 -1
- package/dist/cjs/chunk-Ty2BpOZ5.cjs.js.map +0 -1
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var axios = require('axios');
|
|
4
|
-
var index = require('./chunk-
|
|
4
|
+
var index = require('./chunk-DRnP2LQe.cjs.js');
|
|
5
|
+
var markdown = require('./chunk-BPJBeVDI.cjs.js');
|
|
5
6
|
var React$2 = require('react');
|
|
6
7
|
var ReactDOM = require('react-dom');
|
|
7
8
|
var jsxRuntime = require('react/jsx-runtime');
|
|
@@ -1243,7 +1244,7 @@ class MarkViewDesc extends ViewDesc {
|
|
|
1243
1244
|
let custom = view.nodeViews[mark.type.name];
|
|
1244
1245
|
let spec = custom && custom(mark, view, inline);
|
|
1245
1246
|
if (!spec || !spec.dom)
|
|
1246
|
-
spec =
|
|
1247
|
+
spec = markdown.DOMSerializer.renderSpec(document, mark.type.spec.toDOM(mark, inline), null, mark.attrs);
|
|
1247
1248
|
return new MarkViewDesc(parent, mark, spec.dom, spec.contentDOM || spec.dom, spec);
|
|
1248
1249
|
}
|
|
1249
1250
|
parseRule() {
|
|
@@ -1323,7 +1324,7 @@ class NodeViewDesc extends ViewDesc {
|
|
|
1323
1324
|
throw new RangeError("Text must be rendered as a DOM text node");
|
|
1324
1325
|
}
|
|
1325
1326
|
else if (!dom) {
|
|
1326
|
-
let spec =
|
|
1327
|
+
let spec = markdown.DOMSerializer.renderSpec(document, node.type.spec.toDOM(node), null, node.attrs);
|
|
1327
1328
|
({ dom, contentDOM } = spec);
|
|
1328
1329
|
}
|
|
1329
1330
|
if (!contentDOM && !node.isText && dom.nodeName != "BR") { // Chrome gets confused by <br contenteditable=false>
|
|
@@ -1375,7 +1376,7 @@ class NodeViewDesc extends ViewDesc {
|
|
|
1375
1376
|
if (found)
|
|
1376
1377
|
rule.contentElement = found;
|
|
1377
1378
|
else
|
|
1378
|
-
rule.getContent = () =>
|
|
1379
|
+
rule.getContent = () => markdown.Fragment.empty;
|
|
1379
1380
|
}
|
|
1380
1381
|
}
|
|
1381
1382
|
return rule;
|
|
@@ -1400,7 +1401,7 @@ class NodeViewDesc extends ViewDesc {
|
|
|
1400
1401
|
if (widget.spec.marks)
|
|
1401
1402
|
updater.syncToMarks(widget.spec.marks, inline, view, i);
|
|
1402
1403
|
else if (widget.type.side >= 0 && !insideNode)
|
|
1403
|
-
updater.syncToMarks(i == this.node.childCount ?
|
|
1404
|
+
updater.syncToMarks(i == this.node.childCount ? markdown.Mark.none : this.node.child(i).marks, inline, view, i);
|
|
1404
1405
|
// If the next node is a desc matching this widget, reuse it,
|
|
1405
1406
|
// otherwise insert the widget as a new view desc.
|
|
1406
1407
|
updater.placeWidget(widget, view, off);
|
|
@@ -2831,7 +2832,7 @@ function serializeForClipboard(view, slice) {
|
|
|
2831
2832
|
context.push(node.type.name, node.attrs != node.type.defaultAttrs ? node.attrs : null);
|
|
2832
2833
|
content = node.content;
|
|
2833
2834
|
}
|
|
2834
|
-
let serializer = view.someProp("clipboardSerializer") ||
|
|
2835
|
+
let serializer = view.someProp("clipboardSerializer") || markdown.DOMSerializer.fromSchema(view.state.schema);
|
|
2835
2836
|
let doc = detachedDoc(), wrap = doc.createElement("div");
|
|
2836
2837
|
wrap.appendChild(serializer.serializeFragment(content, { document: doc }));
|
|
2837
2838
|
let firstChild = wrap.firstChild, needsWrap, wrappers = 0;
|
|
@@ -2861,7 +2862,7 @@ function parseFromClipboard(view, text, html, plainText, $context) {
|
|
|
2861
2862
|
if (asText) {
|
|
2862
2863
|
view.someProp("transformPastedText", f => { text = f(text, inCode || plainText, view); });
|
|
2863
2864
|
if (inCode) {
|
|
2864
|
-
slice = new
|
|
2865
|
+
slice = new markdown.Slice(markdown.Fragment.from(view.state.schema.text(text.replace(/\r\n?/g, "\n"))), 0, 0);
|
|
2865
2866
|
view.someProp("transformPasted", f => { slice = f(slice, view, true); });
|
|
2866
2867
|
return slice;
|
|
2867
2868
|
}
|
|
@@ -2871,7 +2872,7 @@ function parseFromClipboard(view, text, html, plainText, $context) {
|
|
|
2871
2872
|
}
|
|
2872
2873
|
else {
|
|
2873
2874
|
let marks = $context.marks();
|
|
2874
|
-
let { schema } = view.state, serializer =
|
|
2875
|
+
let { schema } = view.state, serializer = markdown.DOMSerializer.fromSchema(schema);
|
|
2875
2876
|
dom = document.createElement("div");
|
|
2876
2877
|
text.split(/(?:\r\n?|\n)+/).forEach(block => {
|
|
2877
2878
|
let p = dom.appendChild(document.createElement("p"));
|
|
@@ -2898,7 +2899,7 @@ function parseFromClipboard(view, text, html, plainText, $context) {
|
|
|
2898
2899
|
dom = child;
|
|
2899
2900
|
}
|
|
2900
2901
|
if (!slice) {
|
|
2901
|
-
let parser = view.someProp("clipboardParser") || view.someProp("domParser") ||
|
|
2902
|
+
let parser = view.someProp("clipboardParser") || view.someProp("domParser") || markdown.DOMParser.fromSchema(view.state.schema);
|
|
2902
2903
|
slice = parser.parseSlice(dom, {
|
|
2903
2904
|
preserveWhitespace: !!(asText || sliceData),
|
|
2904
2905
|
context: $context,
|
|
@@ -2914,7 +2915,7 @@ function parseFromClipboard(view, text, html, plainText, $context) {
|
|
|
2914
2915
|
slice = addContext(closeSlice(slice, +sliceData[1], +sliceData[2]), sliceData[4]);
|
|
2915
2916
|
}
|
|
2916
2917
|
else { // HTML wasn't created by ProseMirror. Make sure top-level siblings are coherent
|
|
2917
|
-
slice =
|
|
2918
|
+
slice = markdown.Slice.maxOpen(normalizeSiblings(slice.content, $context), true);
|
|
2918
2919
|
if (slice.openStart || slice.openEnd) {
|
|
2919
2920
|
let openStart = 0, openEnd = 0;
|
|
2920
2921
|
for (let node = slice.content.firstChild; openStart < slice.openStart && !node.type.spec.isolating; openStart++, node = node.firstChild) { }
|
|
@@ -2960,13 +2961,13 @@ function normalizeSiblings(fragment, $context) {
|
|
|
2960
2961
|
}
|
|
2961
2962
|
});
|
|
2962
2963
|
if (result)
|
|
2963
|
-
return
|
|
2964
|
+
return markdown.Fragment.from(result);
|
|
2964
2965
|
}
|
|
2965
2966
|
return fragment;
|
|
2966
2967
|
}
|
|
2967
2968
|
function withWrappers(node, wrap, from = 0) {
|
|
2968
2969
|
for (let i = wrap.length - 1; i >= from; i--)
|
|
2969
|
-
node = wrap[i].create(null,
|
|
2970
|
+
node = wrap[i].create(null, markdown.Fragment.from(node));
|
|
2970
2971
|
return node;
|
|
2971
2972
|
}
|
|
2972
2973
|
// Used to group adjacent nodes wrapped in similar parents by
|
|
@@ -2978,14 +2979,14 @@ function addToSibling(wrap, lastWrap, node, sibling, depth) {
|
|
|
2978
2979
|
return sibling.copy(sibling.content.replaceChild(sibling.childCount - 1, inner));
|
|
2979
2980
|
let match = sibling.contentMatchAt(sibling.childCount);
|
|
2980
2981
|
if (match.matchType(depth == wrap.length - 1 ? node.type : wrap[depth + 1]))
|
|
2981
|
-
return sibling.copy(sibling.content.append(
|
|
2982
|
+
return sibling.copy(sibling.content.append(markdown.Fragment.from(withWrappers(node, wrap, depth + 1))));
|
|
2982
2983
|
}
|
|
2983
2984
|
}
|
|
2984
2985
|
function closeRight(node, depth) {
|
|
2985
2986
|
if (depth == 0)
|
|
2986
2987
|
return node;
|
|
2987
2988
|
let fragment = node.content.replaceChild(node.childCount - 1, closeRight(node.lastChild, depth - 1));
|
|
2988
|
-
let fill = node.contentMatchAt(node.childCount).fillBefore(
|
|
2989
|
+
let fill = node.contentMatchAt(node.childCount).fillBefore(markdown.Fragment.empty, true);
|
|
2989
2990
|
return node.copy(fragment.append(fill));
|
|
2990
2991
|
}
|
|
2991
2992
|
function closeRange(fragment, side, from, to, depth, openEnd) {
|
|
@@ -2996,14 +2997,14 @@ function closeRange(fragment, side, from, to, depth, openEnd) {
|
|
|
2996
2997
|
inner = closeRange(inner, side, from, to, depth + 1, openEnd);
|
|
2997
2998
|
if (depth >= from)
|
|
2998
2999
|
inner = side < 0 ? node.contentMatchAt(0).fillBefore(inner, openEnd <= depth).append(inner)
|
|
2999
|
-
: inner.append(node.contentMatchAt(node.childCount).fillBefore(
|
|
3000
|
+
: inner.append(node.contentMatchAt(node.childCount).fillBefore(markdown.Fragment.empty, true));
|
|
3000
3001
|
return fragment.replaceChild(side < 0 ? 0 : fragment.childCount - 1, node.copy(inner));
|
|
3001
3002
|
}
|
|
3002
3003
|
function closeSlice(slice, openStart, openEnd) {
|
|
3003
3004
|
if (openStart < slice.openStart)
|
|
3004
|
-
slice = new
|
|
3005
|
+
slice = new markdown.Slice(closeRange(slice.content, -1, openStart, slice.openStart, 0, slice.openEnd), openStart, slice.openEnd);
|
|
3005
3006
|
if (openEnd < slice.openEnd)
|
|
3006
|
-
slice = new
|
|
3007
|
+
slice = new markdown.Slice(closeRange(slice.content, 1, openEnd, slice.openEnd, 0, 0), slice.openStart, openEnd);
|
|
3007
3008
|
return slice;
|
|
3008
3009
|
}
|
|
3009
3010
|
// Trick from jQuery -- some elements must be wrapped in other
|
|
@@ -3096,7 +3097,7 @@ function addContext(slice, context) {
|
|
|
3096
3097
|
if (!type || type.hasRequiredAttrs())
|
|
3097
3098
|
break;
|
|
3098
3099
|
try {
|
|
3099
|
-
content =
|
|
3100
|
+
content = markdown.Fragment.from(type.create(array[i + 1], content));
|
|
3100
3101
|
}
|
|
3101
3102
|
catch (e) {
|
|
3102
3103
|
break;
|
|
@@ -3104,7 +3105,7 @@ function addContext(slice, context) {
|
|
|
3104
3105
|
openStart++;
|
|
3105
3106
|
openEnd++;
|
|
3106
3107
|
}
|
|
3107
|
-
return new
|
|
3108
|
+
return new markdown.Slice(content, openStart, openEnd);
|
|
3108
3109
|
}
|
|
3109
3110
|
|
|
3110
3111
|
// A collection of DOM events that occur within the editor, and callback functions
|
|
@@ -3764,7 +3765,7 @@ function capturePaste(view, event) {
|
|
|
3764
3765
|
}
|
|
3765
3766
|
function doPaste(view, text, html, preferPlain, event) {
|
|
3766
3767
|
let slice = parseFromClipboard(view, text, html, preferPlain, view.state.selection.$from);
|
|
3767
|
-
if (view.someProp("handlePaste", f => f(view, event, slice ||
|
|
3768
|
+
if (view.someProp("handlePaste", f => f(view, event, slice || markdown.Slice.empty)))
|
|
3768
3769
|
return true;
|
|
3769
3770
|
if (!slice)
|
|
3770
3771
|
return false;
|
|
@@ -3872,7 +3873,7 @@ function handleDrop(view, event, dragging) {
|
|
|
3872
3873
|
slice = parseFromClipboard(view, getText$1(event.dataTransfer), brokenClipboardAPI ? null : event.dataTransfer.getData("text/html"), false, $mouse);
|
|
3873
3874
|
}
|
|
3874
3875
|
let move = !!(dragging && dragMoves(view, event));
|
|
3875
|
-
if (view.someProp("handleDrop", f => f(view, event, slice ||
|
|
3876
|
+
if (view.someProp("handleDrop", f => f(view, event, slice || markdown.Slice.empty, move))) {
|
|
3876
3877
|
event.preventDefault();
|
|
3877
3878
|
return;
|
|
3878
3879
|
}
|
|
@@ -5070,7 +5071,7 @@ function parseBetween(view, from_, to_, addedNodes) {
|
|
|
5070
5071
|
}
|
|
5071
5072
|
}
|
|
5072
5073
|
let startDoc = view.state.doc;
|
|
5073
|
-
let parser = view.someProp("domParser") ||
|
|
5074
|
+
let parser = view.someProp("domParser") || markdown.DOMParser.fromSchema(view.state.schema);
|
|
5074
5075
|
let $from = startDoc.resolve(from);
|
|
5075
5076
|
let sel = null, doc = parser.parse(parent, {
|
|
5076
5077
|
topNode: $from.parent,
|
|
@@ -5342,7 +5343,7 @@ function isMarkChange(cur, prev) {
|
|
|
5342
5343
|
let updated = [];
|
|
5343
5344
|
for (let i = 0; i < prev.childCount; i++)
|
|
5344
5345
|
updated.push(update(prev.child(i)));
|
|
5345
|
-
if (
|
|
5346
|
+
if (markdown.Fragment.from(updated).eq(cur))
|
|
5346
5347
|
return { mark, type };
|
|
5347
5348
|
}
|
|
5348
5349
|
function looksLikeBackspace(old, start, end, $newStart, $newEnd) {
|
|
@@ -6130,7 +6131,7 @@ const joinBackward = (state, dispatch, view) => {
|
|
|
6130
6131
|
if ($cursor.parent.content.size == 0 &&
|
|
6131
6132
|
(textblockAt(before, "end") || index.NodeSelection.isSelectable(before))) {
|
|
6132
6133
|
for (let depth = $cursor.depth;; depth--) {
|
|
6133
|
-
let delStep = index.replaceStep(state.doc, $cursor.before(depth), $cursor.after(depth),
|
|
6134
|
+
let delStep = index.replaceStep(state.doc, $cursor.before(depth), $cursor.after(depth), markdown.Slice.empty);
|
|
6134
6135
|
if (delStep && delStep.slice.size < delStep.to - delStep.from) {
|
|
6135
6136
|
if (dispatch) {
|
|
6136
6137
|
let tr = state.tr.step(delStep);
|
|
@@ -6196,7 +6197,7 @@ function joinTextblocksAround(state, $cut, dispatch) {
|
|
|
6196
6197
|
return false;
|
|
6197
6198
|
afterText = child;
|
|
6198
6199
|
}
|
|
6199
|
-
let step = index.replaceStep(state.doc, beforePos, afterPos,
|
|
6200
|
+
let step = index.replaceStep(state.doc, beforePos, afterPos, markdown.Slice.empty);
|
|
6200
6201
|
if (!step || step.from != beforePos ||
|
|
6201
6202
|
step instanceof index.ReplaceStep && step.slice.size >= afterPos - beforePos)
|
|
6202
6203
|
return false;
|
|
@@ -6280,7 +6281,7 @@ const joinForward = (state, dispatch, view) => {
|
|
|
6280
6281
|
// selectable, delete the node above and select the one below.
|
|
6281
6282
|
if ($cursor.parent.content.size == 0 &&
|
|
6282
6283
|
(textblockAt(after, "start") || index.NodeSelection.isSelectable(after))) {
|
|
6283
|
-
let delStep = index.replaceStep(state.doc, $cursor.before(), $cursor.after(),
|
|
6284
|
+
let delStep = index.replaceStep(state.doc, $cursor.before(), $cursor.after(), markdown.Slice.empty);
|
|
6284
6285
|
if (delStep && delStep.slice.size < delStep.to - delStep.from) {
|
|
6285
6286
|
if (dispatch) {
|
|
6286
6287
|
let tr = state.tr.step(delStep);
|
|
@@ -6576,11 +6577,11 @@ function deleteBarrier(state, $cut, dispatch, dir) {
|
|
|
6576
6577
|
(conn = (match = before.contentMatchAt(before.childCount)).findWrapping(after.type)) &&
|
|
6577
6578
|
match.matchType(conn[0] || after.type).validEnd) {
|
|
6578
6579
|
if (dispatch) {
|
|
6579
|
-
let end = $cut.pos + after.nodeSize, wrap =
|
|
6580
|
+
let end = $cut.pos + after.nodeSize, wrap = markdown.Fragment.empty;
|
|
6580
6581
|
for (let i = conn.length - 1; i >= 0; i--)
|
|
6581
|
-
wrap =
|
|
6582
|
-
wrap =
|
|
6583
|
-
let tr = state.tr.step(new index.ReplaceAroundStep($cut.pos - 1, end, $cut.pos, end, new
|
|
6582
|
+
wrap = markdown.Fragment.from(conn[i].create(null, wrap));
|
|
6583
|
+
wrap = markdown.Fragment.from(before.copy(wrap));
|
|
6584
|
+
let tr = state.tr.step(new index.ReplaceAroundStep($cut.pos - 1, end, $cut.pos, end, new markdown.Slice(wrap, 1, 0), conn.length, true));
|
|
6584
6585
|
let $joinAt = tr.doc.resolve(end + 2 * conn.length);
|
|
6585
6586
|
if ($joinAt.nodeAfter && $joinAt.nodeAfter.type == before.type &&
|
|
6586
6587
|
index.canJoin(tr.doc, $joinAt.pos))
|
|
@@ -6609,10 +6610,10 @@ function deleteBarrier(state, $cut, dispatch, dir) {
|
|
|
6609
6610
|
afterDepth++;
|
|
6610
6611
|
if (at.canReplace(at.childCount, at.childCount, afterText.content)) {
|
|
6611
6612
|
if (dispatch) {
|
|
6612
|
-
let end =
|
|
6613
|
+
let end = markdown.Fragment.empty;
|
|
6613
6614
|
for (let i = wrap.length - 1; i >= 0; i--)
|
|
6614
|
-
end =
|
|
6615
|
-
let tr = state.tr.step(new index.ReplaceAroundStep($cut.pos - wrap.length, $cut.pos + after.nodeSize, $cut.pos + afterDepth, $cut.pos + after.nodeSize - afterDepth, new
|
|
6615
|
+
end = markdown.Fragment.from(wrap[i].copy(end));
|
|
6616
|
+
let tr = state.tr.step(new index.ReplaceAroundStep($cut.pos - wrap.length, $cut.pos + after.nodeSize, $cut.pos + afterDepth, $cut.pos + after.nodeSize - afterDepth, new markdown.Slice(end, wrap.length, 0), 0, true));
|
|
6616
6617
|
dispatch(tr.scrollIntoView());
|
|
6617
6618
|
}
|
|
6618
6619
|
return true;
|
|
@@ -6763,9 +6764,9 @@ function wrapRangeInList(tr, range, listType, attrs = null) {
|
|
|
6763
6764
|
if (range.$from.index(range.depth - 1) == 0)
|
|
6764
6765
|
return false;
|
|
6765
6766
|
let $insert = doc.resolve(range.start - 2);
|
|
6766
|
-
outerRange = new
|
|
6767
|
+
outerRange = new markdown.NodeRange($insert, $insert, range.depth);
|
|
6767
6768
|
if (range.endIndex < range.parent.childCount)
|
|
6768
|
-
range = new
|
|
6769
|
+
range = new markdown.NodeRange(range.$from, doc.resolve(range.$to.end(range.depth)), range.depth);
|
|
6769
6770
|
doJoin = true;
|
|
6770
6771
|
}
|
|
6771
6772
|
let wrap = index.findWrapping(outerRange, listType, attrs, range);
|
|
@@ -6776,10 +6777,10 @@ function wrapRangeInList(tr, range, listType, attrs = null) {
|
|
|
6776
6777
|
return true;
|
|
6777
6778
|
}
|
|
6778
6779
|
function doWrapInList(tr, range, wrappers, joinBefore, listType) {
|
|
6779
|
-
let content =
|
|
6780
|
+
let content = markdown.Fragment.empty;
|
|
6780
6781
|
for (let i = wrappers.length - 1; i >= 0; i--)
|
|
6781
|
-
content =
|
|
6782
|
-
tr.step(new index.ReplaceAroundStep(range.start - (joinBefore ? 2 : 0), range.end, range.start, range.end, new
|
|
6782
|
+
content = markdown.Fragment.from(wrappers[i].type.create(wrappers[i].attrs, content));
|
|
6783
|
+
tr.step(new index.ReplaceAroundStep(range.start - (joinBefore ? 2 : 0), range.end, range.start, range.end, new markdown.Slice(content, 0, 0), wrappers.length, true));
|
|
6783
6784
|
let found = 0;
|
|
6784
6785
|
for (let i = 0; i < wrappers.length; i++)
|
|
6785
6786
|
if (wrappers[i].type == listType)
|
|
@@ -6818,8 +6819,8 @@ function liftToOuterList(state, dispatch, itemType, range) {
|
|
|
6818
6819
|
if (end < endOfList) {
|
|
6819
6820
|
// There are siblings after the lifted items, which must become
|
|
6820
6821
|
// children of the last item
|
|
6821
|
-
tr.step(new index.ReplaceAroundStep(end - 1, endOfList, end, endOfList, new
|
|
6822
|
-
range = new
|
|
6822
|
+
tr.step(new index.ReplaceAroundStep(end - 1, endOfList, end, endOfList, new markdown.Slice(markdown.Fragment.from(itemType.create(null, range.parent.copy())), 1, 0), 1, true));
|
|
6823
|
+
range = new markdown.NodeRange(tr.doc.resolve(range.$from.pos), tr.doc.resolve(endOfList), range.depth);
|
|
6823
6824
|
}
|
|
6824
6825
|
const target = index.liftTarget(range);
|
|
6825
6826
|
if (target == null)
|
|
@@ -6843,14 +6844,14 @@ function liftOutOfList(state, dispatch, range) {
|
|
|
6843
6844
|
return false;
|
|
6844
6845
|
let atStart = range.startIndex == 0, atEnd = range.endIndex == list.childCount;
|
|
6845
6846
|
let parent = $start.node(-1), indexBefore = $start.index(-1);
|
|
6846
|
-
if (!parent.canReplace(indexBefore + (atStart ? 0 : 1), indexBefore + 1, item.content.append(atEnd ?
|
|
6847
|
+
if (!parent.canReplace(indexBefore + (atStart ? 0 : 1), indexBefore + 1, item.content.append(atEnd ? markdown.Fragment.empty : markdown.Fragment.from(list))))
|
|
6847
6848
|
return false;
|
|
6848
6849
|
let start = $start.pos, end = start + item.nodeSize;
|
|
6849
6850
|
// Strip off the surrounding list. At the sides where we're not at
|
|
6850
6851
|
// the end of the list, the existing list is closed. At sides where
|
|
6851
6852
|
// this is the end, it is overwritten to its end.
|
|
6852
|
-
tr.step(new index.ReplaceAroundStep(start - (atStart ? 1 : 0), end + (atEnd ? 1 : 0), start + 1, end - 1, new
|
|
6853
|
-
.append(atEnd ?
|
|
6853
|
+
tr.step(new index.ReplaceAroundStep(start - (atStart ? 1 : 0), end + (atEnd ? 1 : 0), start + 1, end - 1, new markdown.Slice((atStart ? markdown.Fragment.empty : markdown.Fragment.from(list.copy(markdown.Fragment.empty)))
|
|
6854
|
+
.append(atEnd ? markdown.Fragment.empty : markdown.Fragment.from(list.copy(markdown.Fragment.empty))), atStart ? 0 : 1, atEnd ? 0 : 1), atStart ? 0 : 1));
|
|
6854
6855
|
dispatch(tr.scrollIntoView());
|
|
6855
6856
|
return true;
|
|
6856
6857
|
}
|
|
@@ -6872,8 +6873,8 @@ function sinkListItem(itemType) {
|
|
|
6872
6873
|
return false;
|
|
6873
6874
|
if (dispatch) {
|
|
6874
6875
|
let nestedBefore = nodeBefore.lastChild && nodeBefore.lastChild.type == parent.type;
|
|
6875
|
-
let inner =
|
|
6876
|
-
let slice = new
|
|
6876
|
+
let inner = markdown.Fragment.from(nestedBefore ? itemType.create() : null);
|
|
6877
|
+
let slice = new markdown.Slice(markdown.Fragment.from(itemType.create(null, markdown.Fragment.from(parent.type.create(null, inner)))), nestedBefore ? 3 : 1, 0);
|
|
6877
6878
|
let before = range.start, after = range.end;
|
|
6878
6879
|
dispatch(state.tr.step(new index.ReplaceAroundStep(before - (nestedBefore ? 3 : 1), after, before, after, slice, 1, true))
|
|
6879
6880
|
.scrollIntoView());
|
|
@@ -7711,7 +7712,7 @@ function createNodeFromContent(content, schema, options) {
|
|
|
7711
7712
|
};
|
|
7712
7713
|
const isTextContent = typeof content === "string";
|
|
7713
7714
|
if (isJSONContent) try {
|
|
7714
|
-
if (Array.isArray(content) && content.length > 0) return
|
|
7715
|
+
if (Array.isArray(content) && content.length > 0) return markdown.Fragment.fromArray(content.map((item) => schema.nodeFromJSON(item)));
|
|
7715
7716
|
const node = schema.nodeFromJSON(content);
|
|
7716
7717
|
if (options.errorOnInvalidContent) node.check();
|
|
7717
7718
|
return node;
|
|
@@ -7724,7 +7725,7 @@ function createNodeFromContent(content, schema, options) {
|
|
|
7724
7725
|
if (options.errorOnInvalidContent) {
|
|
7725
7726
|
let hasInvalidContent = false;
|
|
7726
7727
|
let invalidContent = "";
|
|
7727
|
-
const contentCheckSchema = new
|
|
7728
|
+
const contentCheckSchema = new markdown.Schema({
|
|
7728
7729
|
topNode: schema.spec.topNode,
|
|
7729
7730
|
marks: schema.spec.marks,
|
|
7730
7731
|
nodes: schema.spec.nodes.append({ __tiptap__private__unknown__catch__all__node: {
|
|
@@ -7740,11 +7741,11 @@ function createNodeFromContent(content, schema, options) {
|
|
|
7740
7741
|
}]
|
|
7741
7742
|
} })
|
|
7742
7743
|
});
|
|
7743
|
-
if (options.slice)
|
|
7744
|
-
else
|
|
7744
|
+
if (options.slice) markdown.DOMParser.fromSchema(contentCheckSchema).parseSlice(elementFromString(content), options.parseOptions);
|
|
7745
|
+
else markdown.DOMParser.fromSchema(contentCheckSchema).parse(elementFromString(content), options.parseOptions);
|
|
7745
7746
|
if (options.errorOnInvalidContent && hasInvalidContent) throw new Error("[tiptap error]: Invalid HTML content", { cause: /* @__PURE__ */ new Error(`Invalid element found: ${invalidContent}`) });
|
|
7746
7747
|
}
|
|
7747
|
-
const parser =
|
|
7748
|
+
const parser = markdown.DOMParser.fromSchema(schema);
|
|
7748
7749
|
if (options.slice) return parser.parseSlice(elementFromString(content), options.parseOptions).content;
|
|
7749
7750
|
return parser.parse(elementFromString(content), options.parseOptions);
|
|
7750
7751
|
}
|
|
@@ -7854,7 +7855,7 @@ const insertContentAt = (position, value, options) => ({ tr, dispatch, editor })
|
|
|
7854
7855
|
else newContent = value;
|
|
7855
7856
|
tr.insertText(newContent, from, to);
|
|
7856
7857
|
} else {
|
|
7857
|
-
newContent =
|
|
7858
|
+
newContent = markdown.Fragment.from(nodes);
|
|
7858
7859
|
const $from = tr.doc.resolve(from);
|
|
7859
7860
|
const $fromNode = $from.node();
|
|
7860
7861
|
const fromSelectionAtStart = $from.parentOffset === 0;
|
|
@@ -8340,7 +8341,7 @@ function flattenExtensions(extensions) {
|
|
|
8340
8341
|
//#endregion
|
|
8341
8342
|
//#region src/helpers/getHTMLFromFragment.ts
|
|
8342
8343
|
function getHTMLFromFragment(fragment, schema) {
|
|
8343
|
-
const documentFragment =
|
|
8344
|
+
const documentFragment = markdown.DOMSerializer.fromSchema(schema).serializeFragment(fragment);
|
|
8344
8345
|
const container = document.implementation.createHTMLDocument().createElement("div");
|
|
8345
8346
|
container.appendChild(documentFragment);
|
|
8346
8347
|
return container.innerHTML;
|
|
@@ -8695,7 +8696,7 @@ function getSchemaByResolvedExtensions(extensions, editor) {
|
|
|
8695
8696
|
});
|
|
8696
8697
|
return [extension.name, schema];
|
|
8697
8698
|
}));
|
|
8698
|
-
return new
|
|
8699
|
+
return new markdown.Schema({
|
|
8699
8700
|
topNode,
|
|
8700
8701
|
nodes,
|
|
8701
8702
|
marks
|
|
@@ -9435,18 +9436,18 @@ const splitListItem = (typeOrName, overrideAttrs = {}) => ({ tr, state, dispatch
|
|
|
9435
9436
|
if ($from.depth === 2 || $from.node(-3).type !== type || $from.index(-2) !== $from.node(-2).childCount - 1) return false;
|
|
9436
9437
|
if (dispatch) {
|
|
9437
9438
|
var _type$contentMatch$de;
|
|
9438
|
-
let wrap =
|
|
9439
|
+
let wrap = markdown.Fragment.empty;
|
|
9439
9440
|
const depthBefore = $from.index(-1) ? 1 : $from.index(-2) ? 2 : 3;
|
|
9440
|
-
for (let d = $from.depth - depthBefore; d >= $from.depth - 3; d -= 1) wrap =
|
|
9441
|
+
for (let d = $from.depth - depthBefore; d >= $from.depth - 3; d -= 1) wrap = markdown.Fragment.from($from.node(d).copy(wrap));
|
|
9441
9442
|
const depthAfter = $from.indexAfter(-1) < $from.node(-2).childCount ? 1 : $from.indexAfter(-2) < $from.node(-3).childCount ? 2 : 3;
|
|
9442
9443
|
const newNextTypeAttributes = {
|
|
9443
9444
|
...getSplittedAttributes(extensionAttributes, $from.node().type.name, $from.node().attrs),
|
|
9444
9445
|
...overrideAttrs
|
|
9445
9446
|
};
|
|
9446
9447
|
const nextType = ((_type$contentMatch$de = type.contentMatch.defaultType) === null || _type$contentMatch$de === void 0 ? void 0 : _type$contentMatch$de.createAndFill(newNextTypeAttributes)) || void 0;
|
|
9447
|
-
wrap = wrap.append(
|
|
9448
|
+
wrap = wrap.append(markdown.Fragment.from(type.createAndFill(null, nextType) || void 0));
|
|
9448
9449
|
const start = $from.before($from.depth - (depthBefore - 1));
|
|
9449
|
-
tr.replace(start, $from.after(-depthAfter), new
|
|
9450
|
+
tr.replace(start, $from.after(-depthAfter), new markdown.Slice(wrap, 4 - depthBefore, 0));
|
|
9450
9451
|
let sel = -1;
|
|
9451
9452
|
tr.doc.nodesBetween(start, tr.doc.content.size, (n, pos) => {
|
|
9452
9453
|
if (sel > -1) return false;
|
|
@@ -11077,7 +11078,7 @@ function inputRulesPlugin(props) {
|
|
|
11077
11078
|
if (!!simulatedInputMeta) setTimeout(() => {
|
|
11078
11079
|
let { text } = simulatedInputMeta;
|
|
11079
11080
|
if (typeof text === "string") text = text;
|
|
11080
|
-
else text = getHTMLFromFragment(
|
|
11081
|
+
else text = getHTMLFromFragment(markdown.Fragment.from(text), state.schema);
|
|
11081
11082
|
const { from } = simulatedInputMeta;
|
|
11082
11083
|
const to = from + text.length;
|
|
11083
11084
|
run$1({
|
|
@@ -11388,7 +11389,7 @@ function pasteRulesPlugin(props) {
|
|
|
11388
11389
|
if (isSimulatedPaste) {
|
|
11389
11390
|
let { text } = simulatedPasteMeta;
|
|
11390
11391
|
if (typeof text === "string") text = text;
|
|
11391
|
-
else text = getHTMLFromFragment(
|
|
11392
|
+
else text = getHTMLFromFragment(markdown.Fragment.from(text), state.schema);
|
|
11392
11393
|
const { from } = simulatedPasteMeta;
|
|
11393
11394
|
const to = from + text.length;
|
|
11394
11395
|
const pasteEvt = createClipboardPasteEvent(text);
|
|
@@ -12133,7 +12134,7 @@ function warnOnDuplicatedProseMirrorModel(schema) {
|
|
|
12133
12134
|
} catch {
|
|
12134
12135
|
return;
|
|
12135
12136
|
}
|
|
12136
|
-
if (content instanceof
|
|
12137
|
+
if (content instanceof markdown.Fragment) return;
|
|
12137
12138
|
console.warn("[tiptap warn]: prosemirror-model is loaded more than once. Wrapping and splitting nodes will fail. Deduplicate it in your lock file, or alias it to a single copy in your bundler.");
|
|
12138
12139
|
}
|
|
12139
12140
|
//#endregion
|
|
@@ -15550,22 +15551,22 @@ var CellSelection = class CellSelection extends index.Selection {
|
|
|
15550
15551
|
}
|
|
15551
15552
|
rowContent.push(cell);
|
|
15552
15553
|
}
|
|
15553
|
-
rows.push(table.child(row).copy(
|
|
15554
|
+
rows.push(table.child(row).copy(markdown.Fragment.from(rowContent)));
|
|
15554
15555
|
}
|
|
15555
15556
|
const fragment = this.isColSelection() && this.isRowSelection() ? table : rows;
|
|
15556
|
-
return new
|
|
15557
|
+
return new markdown.Slice(markdown.Fragment.from(fragment), 1, 1);
|
|
15557
15558
|
}
|
|
15558
|
-
replace(tr, content =
|
|
15559
|
+
replace(tr, content = markdown.Slice.empty) {
|
|
15559
15560
|
const mapFrom = tr.steps.length, ranges = this.ranges;
|
|
15560
15561
|
for (let i = 0; i < ranges.length; i++) {
|
|
15561
15562
|
const { $from, $to } = ranges[i], mapping = tr.mapping.slice(mapFrom);
|
|
15562
|
-
tr.replace(mapping.map($from.pos), mapping.map($to.pos), i ?
|
|
15563
|
+
tr.replace(mapping.map($from.pos), mapping.map($to.pos), i ? markdown.Slice.empty : content);
|
|
15563
15564
|
}
|
|
15564
15565
|
const sel = index.Selection.findFrom(tr.doc.resolve(tr.mapping.slice(mapFrom).map(this.to)), -1);
|
|
15565
15566
|
if (sel) tr.setSelection(sel);
|
|
15566
15567
|
}
|
|
15567
15568
|
replaceWith(tr, node) {
|
|
15568
|
-
this.replace(tr, new
|
|
15569
|
+
this.replace(tr, new markdown.Slice(markdown.Fragment.from(node), 0, 0));
|
|
15569
15570
|
}
|
|
15570
15571
|
forEachCell(f) {
|
|
15571
15572
|
const table = this.$anchorCell.node(-1);
|
|
@@ -16114,7 +16115,7 @@ function mergeCells(state, dispatch) {
|
|
|
16114
16115
|
if (dispatch) {
|
|
16115
16116
|
const tr = state.tr;
|
|
16116
16117
|
const seen = {};
|
|
16117
|
-
let content =
|
|
16118
|
+
let content = markdown.Fragment.empty;
|
|
16118
16119
|
let mergedPos;
|
|
16119
16120
|
let mergedCell;
|
|
16120
16121
|
for (let row = rect.top; row < rect.bottom; row++) for (let col = rect.left; col < rect.right; col++) {
|
|
@@ -16410,7 +16411,7 @@ function deleteCellSelection(state, dispatch) {
|
|
|
16410
16411
|
const tr = state.tr;
|
|
16411
16412
|
const baseContent = tableNodeTypes(state.schema).cell.createAndFill().content;
|
|
16412
16413
|
sel.forEachCell((cell, pos) => {
|
|
16413
|
-
if (!cell.content.eq(baseContent)) tr.replace(tr.mapping.map(pos + 1), tr.mapping.map(pos + cell.nodeSize - 1), new
|
|
16414
|
+
if (!cell.content.eq(baseContent)) tr.replace(tr.mapping.map(pos + 1), tr.mapping.map(pos + cell.nodeSize - 1), new markdown.Slice(baseContent, 0, 0));
|
|
16414
16415
|
});
|
|
16415
16416
|
if (tr.docChanged) dispatch(tr);
|
|
16416
16417
|
}
|
|
@@ -16440,10 +16441,10 @@ function pastedCells(slice) {
|
|
|
16440
16441
|
let cells = content.child(i).content;
|
|
16441
16442
|
const left = i ? 0 : Math.max(0, openStart - 1);
|
|
16442
16443
|
const right = i < content.childCount - 1 ? 0 : Math.max(0, openEnd - 1);
|
|
16443
|
-
if (left || right) cells = fitSlice(tableNodeTypes(schema).row, new
|
|
16444
|
+
if (left || right) cells = fitSlice(tableNodeTypes(schema).row, new markdown.Slice(cells, left, right)).content;
|
|
16444
16445
|
rows.push(cells);
|
|
16445
16446
|
}
|
|
16446
|
-
else if (role == "cell" || role == "header_cell") rows.push(openStart || openEnd ? fitSlice(tableNodeTypes(schema).row, new
|
|
16447
|
+
else if (role == "cell" || role == "header_cell") rows.push(openStart || openEnd ? fitSlice(tableNodeTypes(schema).row, new markdown.Slice(content, openStart, openEnd)).content : content);
|
|
16447
16448
|
else return null;
|
|
16448
16449
|
return ensureRectangular(schema, rows);
|
|
16449
16450
|
}
|
|
@@ -16459,12 +16460,12 @@ function ensureRectangular(schema, rows) {
|
|
|
16459
16460
|
let width = 0;
|
|
16460
16461
|
for (let r = 0; r < widths.length; r++) width = Math.max(width, widths[r]);
|
|
16461
16462
|
for (let r = 0; r < widths.length; r++) {
|
|
16462
|
-
if (r >= rows.length) rows.push(
|
|
16463
|
+
if (r >= rows.length) rows.push(markdown.Fragment.empty);
|
|
16463
16464
|
if (widths[r] < width) {
|
|
16464
16465
|
const empty = tableNodeTypes(schema).cell.createAndFill();
|
|
16465
16466
|
const cells = [];
|
|
16466
16467
|
for (let i = widths[r]; i < width; i++) cells.push(empty);
|
|
16467
|
-
rows[r] = rows[r].append(
|
|
16468
|
+
rows[r] = rows[r].append(markdown.Fragment.from(cells));
|
|
16468
16469
|
}
|
|
16469
16470
|
}
|
|
16470
16471
|
return {
|
|
@@ -16497,7 +16498,7 @@ function clipCells({ width, height, rows }, newWidth, newHeight) {
|
|
|
16497
16498
|
col += cell.attrs.colspan;
|
|
16498
16499
|
for (let j = 1; j < cell.attrs.rowspan; j++) added[row + j] = (added[row + j] || 0) + cell.attrs.colspan;
|
|
16499
16500
|
}
|
|
16500
|
-
newRows.push(
|
|
16501
|
+
newRows.push(markdown.Fragment.from(cells));
|
|
16501
16502
|
}
|
|
16502
16503
|
rows = newRows;
|
|
16503
16504
|
width = newWidth;
|
|
@@ -16514,7 +16515,7 @@ function clipCells({ width, height, rows }, newWidth, newHeight) {
|
|
|
16514
16515
|
}, cell.content);
|
|
16515
16516
|
cells.push(cell);
|
|
16516
16517
|
}
|
|
16517
|
-
newRows.push(
|
|
16518
|
+
newRows.push(markdown.Fragment.from(cells));
|
|
16518
16519
|
}
|
|
16519
16520
|
rows = newRows;
|
|
16520
16521
|
height = newHeight;
|
|
@@ -16546,7 +16547,7 @@ function growTable(tr, map, table, start, width, height, mapFrom) {
|
|
|
16546
16547
|
const header = i >= map.width ? false : table.nodeAt(map.map[start$1 + i]).type == types.header_cell;
|
|
16547
16548
|
cells.push(header ? emptyHead || (emptyHead = types.header_cell.createAndFill()) : empty || (empty = types.cell.createAndFill()));
|
|
16548
16549
|
}
|
|
16549
|
-
const emptyRow = types.row.create(null,
|
|
16550
|
+
const emptyRow = types.row.create(null, markdown.Fragment.from(cells)), rows = [];
|
|
16550
16551
|
for (let i = map.height; i < height; i++) rows.push(emptyRow);
|
|
16551
16552
|
tr.insert(tr.mapping.slice(mapFrom).map(start + table.nodeSize - 2), rows);
|
|
16552
16553
|
}
|
|
@@ -16618,7 +16619,7 @@ function insertCells(state, dispatch, tableStart, rect, cells) {
|
|
|
16618
16619
|
if (isolateVertical(tr, map, table, tableStart, top, bottom, right, mapFrom)) recomp();
|
|
16619
16620
|
for (let row = top; row < bottom; row++) {
|
|
16620
16621
|
const from = map.positionAt(row, left, table), to = map.positionAt(row, right, table);
|
|
16621
|
-
tr.replace(tr.mapping.slice(mapFrom).map(from + tableStart), tr.mapping.slice(mapFrom).map(to + tableStart), new
|
|
16622
|
+
tr.replace(tr.mapping.slice(mapFrom).map(from + tableStart), tr.mapping.slice(mapFrom).map(to + tableStart), new markdown.Slice(cells.rows[row - top], 0, 0));
|
|
16622
16623
|
}
|
|
16623
16624
|
recomp();
|
|
16624
16625
|
tr.setSelection(new CellSelection(tr.doc.resolve(tableStart + map.positionAt(top, left, table)), tr.doc.resolve(tableStart + map.positionAt(bottom - 1, right - 1, table))));
|
|
@@ -16702,7 +16703,7 @@ function handlePaste(view, _, slice) {
|
|
|
16702
16703
|
if (!cells) cells = {
|
|
16703
16704
|
width: 1,
|
|
16704
16705
|
height: 1,
|
|
16705
|
-
rows: [
|
|
16706
|
+
rows: [markdown.Fragment.from(fitSlice(tableNodeTypes(view.state.schema).cell, slice))]
|
|
16706
16707
|
};
|
|
16707
16708
|
const table = sel.$anchorCell.node(-1);
|
|
16708
16709
|
const start = sel.$anchorCell.start(-1);
|
|
@@ -20315,4 +20316,4 @@ exports.useEditor = useEditor;
|
|
|
20315
20316
|
exports.useEditorState = useEditorState;
|
|
20316
20317
|
exports.useEditorStore = useEditorStore;
|
|
20317
20318
|
exports.wrappingInputRule = wrappingInputRule;
|
|
20318
|
-
//# sourceMappingURL=chunk-
|
|
20319
|
+
//# sourceMappingURL=chunk-CwY6UgZq.cjs.js.map
|