@moontra/moonui-pro 3.4.12 → 3.4.14
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/cdn/index.global.js +117 -117
- package/dist/cdn/index.global.js.map +1 -1
- package/dist/index.mjs +189 -190
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -17375,35 +17375,6 @@ var FloatingDockInternal = React71__default.forwardRef(
|
|
|
17375
17375
|
}
|
|
17376
17376
|
};
|
|
17377
17377
|
}, [isMobileOpen, autoHideDelay, mobileMode, isMobile]);
|
|
17378
|
-
const getDockVisibility = () => {
|
|
17379
|
-
if (!isMobile)
|
|
17380
|
-
return true;
|
|
17381
|
-
if (mobileMode === "always")
|
|
17382
|
-
return true;
|
|
17383
|
-
if (mobileMode === "hidden")
|
|
17384
|
-
return false;
|
|
17385
|
-
if (mobileMode === "toggle")
|
|
17386
|
-
return isMobileOpen;
|
|
17387
|
-
return true;
|
|
17388
|
-
};
|
|
17389
|
-
const slideVariants = {
|
|
17390
|
-
right: {
|
|
17391
|
-
hidden: { x: "calc(100% + 24px)", opacity: 0 },
|
|
17392
|
-
visible: { x: 0, opacity: 1 }
|
|
17393
|
-
},
|
|
17394
|
-
left: {
|
|
17395
|
-
hidden: { x: "calc(-100% - 24px)", opacity: 0 },
|
|
17396
|
-
visible: { x: 0, opacity: 1 }
|
|
17397
|
-
},
|
|
17398
|
-
bottom: {
|
|
17399
|
-
hidden: { y: "calc(100% + 24px)", opacity: 0 },
|
|
17400
|
-
visible: { y: 0, opacity: 1 }
|
|
17401
|
-
},
|
|
17402
|
-
top: {
|
|
17403
|
-
hidden: { y: "calc(-100% - 24px)", opacity: 0 },
|
|
17404
|
-
visible: { y: 0, opacity: 1 }
|
|
17405
|
-
}
|
|
17406
|
-
};
|
|
17407
17378
|
const getPositionClass = () => {
|
|
17408
17379
|
if (containerMode) {
|
|
17409
17380
|
switch (position) {
|
|
@@ -17433,35 +17404,6 @@ var FloatingDockInternal = React71__default.forwardRef(
|
|
|
17433
17404
|
}
|
|
17434
17405
|
}
|
|
17435
17406
|
};
|
|
17436
|
-
const getToggleButtonClass = () => {
|
|
17437
|
-
if (containerMode) {
|
|
17438
|
-
switch (position) {
|
|
17439
|
-
case "right":
|
|
17440
|
-
return "absolute right-2 top-1/2 -translate-y-1/2";
|
|
17441
|
-
case "left":
|
|
17442
|
-
return "absolute left-2 top-1/2 -translate-y-1/2";
|
|
17443
|
-
case "bottom":
|
|
17444
|
-
return "absolute bottom-2 left-1/2 -translate-x-1/2";
|
|
17445
|
-
case "top":
|
|
17446
|
-
return "absolute top-2 left-1/2 -translate-x-1/2";
|
|
17447
|
-
default:
|
|
17448
|
-
return "absolute right-2 top-1/2 -translate-y-1/2";
|
|
17449
|
-
}
|
|
17450
|
-
} else {
|
|
17451
|
-
switch (position) {
|
|
17452
|
-
case "right":
|
|
17453
|
-
return "fixed right-2 top-1/2 -translate-y-1/2";
|
|
17454
|
-
case "left":
|
|
17455
|
-
return "fixed left-2 top-1/2 -translate-y-1/2";
|
|
17456
|
-
case "bottom":
|
|
17457
|
-
return "fixed bottom-2 left-1/2 -translate-x-1/2";
|
|
17458
|
-
case "top":
|
|
17459
|
-
return "fixed top-2 left-1/2 -translate-x-1/2";
|
|
17460
|
-
default:
|
|
17461
|
-
return "fixed right-2 top-1/2 -translate-y-1/2";
|
|
17462
|
-
}
|
|
17463
|
-
}
|
|
17464
|
-
};
|
|
17465
17407
|
const getToggleIconRotation = () => {
|
|
17466
17408
|
if (!isMobileOpen) {
|
|
17467
17409
|
switch (position) {
|
|
@@ -17491,43 +17433,35 @@ var FloatingDockInternal = React71__default.forwardRef(
|
|
|
17491
17433
|
}
|
|
17492
17434
|
}
|
|
17493
17435
|
};
|
|
17494
|
-
|
|
17495
|
-
|
|
17496
|
-
|
|
17497
|
-
|
|
17498
|
-
|
|
17499
|
-
|
|
17500
|
-
|
|
17501
|
-
|
|
17502
|
-
|
|
17503
|
-
|
|
17504
|
-
|
|
17505
|
-
|
|
17506
|
-
|
|
17507
|
-
|
|
17508
|
-
|
|
17509
|
-
|
|
17510
|
-
|
|
17511
|
-
transition: { duration: 0.3, ease: "easeOut" },
|
|
17512
|
-
children: toggleIcon || /* @__PURE__ */ jsx(ChevronRight, { className: "w-4 h-4" })
|
|
17513
|
-
}
|
|
17514
|
-
)
|
|
17515
|
-
}
|
|
17516
|
-
),
|
|
17517
|
-
/* @__PURE__ */ jsx(AnimatePresence, { children: getDockVisibility() && /* @__PURE__ */ jsx(
|
|
17436
|
+
const getSlideOffset = () => {
|
|
17437
|
+
const offset4 = "calc(100% + 56px)";
|
|
17438
|
+
switch (position) {
|
|
17439
|
+
case "right":
|
|
17440
|
+
return { x: offset4, y: 0 };
|
|
17441
|
+
case "left":
|
|
17442
|
+
return { x: `-${offset4}`, y: 0 };
|
|
17443
|
+
case "bottom":
|
|
17444
|
+
return { x: 0, y: offset4 };
|
|
17445
|
+
case "top":
|
|
17446
|
+
return { x: 0, y: `-${offset4}` };
|
|
17447
|
+
default:
|
|
17448
|
+
return { x: offset4, y: 0 };
|
|
17449
|
+
}
|
|
17450
|
+
};
|
|
17451
|
+
if (!isMobile || mobileMode === "always") {
|
|
17452
|
+
return /* @__PURE__ */ jsx(
|
|
17518
17453
|
motion.div,
|
|
17519
17454
|
{
|
|
17520
17455
|
ref,
|
|
17521
17456
|
className: cn(
|
|
17522
17457
|
floatingDockVariants({ size: size4, position }),
|
|
17523
17458
|
getPositionClass(),
|
|
17459
|
+
"z-[99999]",
|
|
17524
17460
|
className
|
|
17525
17461
|
),
|
|
17526
|
-
|
|
17527
|
-
|
|
17528
|
-
|
|
17529
|
-
exit: "hidden",
|
|
17530
|
-
transition: { duration: 0.3, ease: "easeOut" },
|
|
17462
|
+
initial: { opacity: 0, scale: 0.95 },
|
|
17463
|
+
animate: { opacity: 1, scale: 1 },
|
|
17464
|
+
transition: { duration: 0.4, ease: "easeOut" },
|
|
17531
17465
|
children: items.map((item) => /* @__PURE__ */ jsx(
|
|
17532
17466
|
DockIcon,
|
|
17533
17467
|
{
|
|
@@ -17540,8 +17474,73 @@ var FloatingDockInternal = React71__default.forwardRef(
|
|
|
17540
17474
|
item.id
|
|
17541
17475
|
))
|
|
17542
17476
|
}
|
|
17543
|
-
)
|
|
17544
|
-
|
|
17477
|
+
);
|
|
17478
|
+
}
|
|
17479
|
+
if (mobileMode === "hidden") {
|
|
17480
|
+
return null;
|
|
17481
|
+
}
|
|
17482
|
+
const slideOffset = getSlideOffset();
|
|
17483
|
+
return /* @__PURE__ */ jsx("div", { className: cn("z-[99999]", getPositionClass()), children: /* @__PURE__ */ jsxs(
|
|
17484
|
+
motion.div,
|
|
17485
|
+
{
|
|
17486
|
+
className: "relative",
|
|
17487
|
+
initial: false,
|
|
17488
|
+
animate: {
|
|
17489
|
+
x: isMobileOpen ? 0 : slideOffset.x,
|
|
17490
|
+
y: isMobileOpen ? 0 : slideOffset.y
|
|
17491
|
+
},
|
|
17492
|
+
transition: {
|
|
17493
|
+
duration: 0.35,
|
|
17494
|
+
ease: [0.4, 0, 0.2, 1]
|
|
17495
|
+
// cubic-bezier for smooth motion
|
|
17496
|
+
},
|
|
17497
|
+
children: [
|
|
17498
|
+
/* @__PURE__ */ jsx(
|
|
17499
|
+
motion.button,
|
|
17500
|
+
{
|
|
17501
|
+
className: cn(
|
|
17502
|
+
"absolute p-2.5 rounded-full bg-background/95 backdrop-blur-md border border-border shadow-lg hover:shadow-xl transition-shadow",
|
|
17503
|
+
position === "right" && "-left-14 top-1/2 -translate-y-1/2",
|
|
17504
|
+
position === "left" && "-right-14 top-1/2 -translate-y-1/2",
|
|
17505
|
+
position === "bottom" && "left-1/2 -translate-x-1/2 -top-14",
|
|
17506
|
+
position === "top" && "left-1/2 -translate-x-1/2 -bottom-14"
|
|
17507
|
+
),
|
|
17508
|
+
onClick: () => setIsMobileOpen(!isMobileOpen),
|
|
17509
|
+
whileTap: { scale: 0.95 },
|
|
17510
|
+
children: /* @__PURE__ */ jsx(
|
|
17511
|
+
motion.div,
|
|
17512
|
+
{
|
|
17513
|
+
animate: { rotate: getToggleIconRotation() },
|
|
17514
|
+
transition: { duration: 0.3, ease: "easeOut" },
|
|
17515
|
+
children: toggleIcon || /* @__PURE__ */ jsx(ChevronRight, { className: "w-4 h-4" })
|
|
17516
|
+
}
|
|
17517
|
+
)
|
|
17518
|
+
}
|
|
17519
|
+
),
|
|
17520
|
+
/* @__PURE__ */ jsx(
|
|
17521
|
+
"div",
|
|
17522
|
+
{
|
|
17523
|
+
ref,
|
|
17524
|
+
className: cn(
|
|
17525
|
+
floatingDockVariants({ size: size4, position }),
|
|
17526
|
+
className
|
|
17527
|
+
),
|
|
17528
|
+
children: items.map((item) => /* @__PURE__ */ jsx(
|
|
17529
|
+
DockIcon,
|
|
17530
|
+
{
|
|
17531
|
+
item,
|
|
17532
|
+
size: size4 || "md",
|
|
17533
|
+
magnification,
|
|
17534
|
+
showTooltip,
|
|
17535
|
+
position: position || "bottom"
|
|
17536
|
+
},
|
|
17537
|
+
item.id
|
|
17538
|
+
))
|
|
17539
|
+
}
|
|
17540
|
+
)
|
|
17541
|
+
]
|
|
17542
|
+
}
|
|
17543
|
+
) });
|
|
17545
17544
|
}
|
|
17546
17545
|
);
|
|
17547
17546
|
FloatingDockInternal.displayName = "FloatingDockInternal";
|
|
@@ -23102,7 +23101,7 @@ function findDiffEnd(a, b, posA, posB) {
|
|
|
23102
23101
|
posB -= size4;
|
|
23103
23102
|
}
|
|
23104
23103
|
}
|
|
23105
|
-
var
|
|
23104
|
+
var Fragment18 = class {
|
|
23106
23105
|
/**
|
|
23107
23106
|
@internal
|
|
23108
23107
|
*/
|
|
@@ -23170,7 +23169,7 @@ var Fragment19 = class {
|
|
|
23170
23169
|
}
|
|
23171
23170
|
for (; i < other.content.length; i++)
|
|
23172
23171
|
content.push(other.content[i]);
|
|
23173
|
-
return new
|
|
23172
|
+
return new Fragment18(content, this.size + other.size);
|
|
23174
23173
|
}
|
|
23175
23174
|
/**
|
|
23176
23175
|
Cut out the sub-fragment between the two given positions.
|
|
@@ -23194,17 +23193,17 @@ var Fragment19 = class {
|
|
|
23194
23193
|
}
|
|
23195
23194
|
pos = end;
|
|
23196
23195
|
}
|
|
23197
|
-
return new
|
|
23196
|
+
return new Fragment18(result, size4);
|
|
23198
23197
|
}
|
|
23199
23198
|
/**
|
|
23200
23199
|
@internal
|
|
23201
23200
|
*/
|
|
23202
23201
|
cutByIndex(from2, to) {
|
|
23203
23202
|
if (from2 == to)
|
|
23204
|
-
return
|
|
23203
|
+
return Fragment18.empty;
|
|
23205
23204
|
if (from2 == 0 && to == this.content.length)
|
|
23206
23205
|
return this;
|
|
23207
|
-
return new
|
|
23206
|
+
return new Fragment18(this.content.slice(from2, to));
|
|
23208
23207
|
}
|
|
23209
23208
|
/**
|
|
23210
23209
|
Create a new fragment in which the node at the given index is
|
|
@@ -23217,21 +23216,21 @@ var Fragment19 = class {
|
|
|
23217
23216
|
let copy2 = this.content.slice();
|
|
23218
23217
|
let size4 = this.size + node.nodeSize - current.nodeSize;
|
|
23219
23218
|
copy2[index2] = node;
|
|
23220
|
-
return new
|
|
23219
|
+
return new Fragment18(copy2, size4);
|
|
23221
23220
|
}
|
|
23222
23221
|
/**
|
|
23223
23222
|
Create a new fragment by prepending the given node to this
|
|
23224
23223
|
fragment.
|
|
23225
23224
|
*/
|
|
23226
23225
|
addToStart(node) {
|
|
23227
|
-
return new
|
|
23226
|
+
return new Fragment18([node].concat(this.content), this.size + node.nodeSize);
|
|
23228
23227
|
}
|
|
23229
23228
|
/**
|
|
23230
23229
|
Create a new fragment by appending the given node to this
|
|
23231
23230
|
fragment.
|
|
23232
23231
|
*/
|
|
23233
23232
|
addToEnd(node) {
|
|
23234
|
-
return new
|
|
23233
|
+
return new Fragment18(this.content.concat(node), this.size + node.nodeSize);
|
|
23235
23234
|
}
|
|
23236
23235
|
/**
|
|
23237
23236
|
Compare this fragment to another one.
|
|
@@ -23350,10 +23349,10 @@ var Fragment19 = class {
|
|
|
23350
23349
|
*/
|
|
23351
23350
|
static fromJSON(schema, value) {
|
|
23352
23351
|
if (!value)
|
|
23353
|
-
return
|
|
23352
|
+
return Fragment18.empty;
|
|
23354
23353
|
if (!Array.isArray(value))
|
|
23355
23354
|
throw new RangeError("Invalid input for Fragment.fromJSON");
|
|
23356
|
-
return new
|
|
23355
|
+
return new Fragment18(value.map(schema.nodeFromJSON));
|
|
23357
23356
|
}
|
|
23358
23357
|
/**
|
|
23359
23358
|
Build a fragment from an array of nodes. Ensures that adjacent
|
|
@@ -23361,7 +23360,7 @@ var Fragment19 = class {
|
|
|
23361
23360
|
*/
|
|
23362
23361
|
static fromArray(array) {
|
|
23363
23362
|
if (!array.length)
|
|
23364
|
-
return
|
|
23363
|
+
return Fragment18.empty;
|
|
23365
23364
|
let joined, size4 = 0;
|
|
23366
23365
|
for (let i = 0; i < array.length; i++) {
|
|
23367
23366
|
let node = array[i];
|
|
@@ -23374,7 +23373,7 @@ var Fragment19 = class {
|
|
|
23374
23373
|
joined.push(node);
|
|
23375
23374
|
}
|
|
23376
23375
|
}
|
|
23377
|
-
return new
|
|
23376
|
+
return new Fragment18(joined || array, size4);
|
|
23378
23377
|
}
|
|
23379
23378
|
/**
|
|
23380
23379
|
Create a fragment from something that can be interpreted as a
|
|
@@ -23384,17 +23383,17 @@ var Fragment19 = class {
|
|
|
23384
23383
|
*/
|
|
23385
23384
|
static from(nodes) {
|
|
23386
23385
|
if (!nodes)
|
|
23387
|
-
return
|
|
23388
|
-
if (nodes instanceof
|
|
23386
|
+
return Fragment18.empty;
|
|
23387
|
+
if (nodes instanceof Fragment18)
|
|
23389
23388
|
return nodes;
|
|
23390
23389
|
if (Array.isArray(nodes))
|
|
23391
23390
|
return this.fromArray(nodes);
|
|
23392
23391
|
if (nodes.attrs)
|
|
23393
|
-
return new
|
|
23392
|
+
return new Fragment18([nodes], nodes.nodeSize);
|
|
23394
23393
|
throw new RangeError("Can not convert " + nodes + " to a Fragment" + (nodes.nodesBetween ? " (looks like multiple versions of prosemirror-model were loaded)" : ""));
|
|
23395
23394
|
}
|
|
23396
23395
|
};
|
|
23397
|
-
|
|
23396
|
+
Fragment18.empty = new Fragment18([], 0);
|
|
23398
23397
|
var found = { index: 0, offset: 0 };
|
|
23399
23398
|
function retIndex(index2, offset4) {
|
|
23400
23399
|
found.index = index2;
|
|
@@ -23619,7 +23618,7 @@ var Slice = class {
|
|
|
23619
23618
|
let openStart = json2.openStart || 0, openEnd = json2.openEnd || 0;
|
|
23620
23619
|
if (typeof openStart != "number" || typeof openEnd != "number")
|
|
23621
23620
|
throw new RangeError("Invalid input for Slice.fromJSON");
|
|
23622
|
-
return new Slice(
|
|
23621
|
+
return new Slice(Fragment18.fromJSON(schema, json2.content), openStart, openEnd);
|
|
23623
23622
|
}
|
|
23624
23623
|
/**
|
|
23625
23624
|
Create a slice from a fragment by taking the maximum possible
|
|
@@ -23634,7 +23633,7 @@ var Slice = class {
|
|
|
23634
23633
|
return new Slice(fragment, openStart, openEnd);
|
|
23635
23634
|
}
|
|
23636
23635
|
};
|
|
23637
|
-
Slice.empty = new Slice(
|
|
23636
|
+
Slice.empty = new Slice(Fragment18.empty, 0, 0);
|
|
23638
23637
|
function removeRange(content, from2, to) {
|
|
23639
23638
|
let { index: index2, offset: offset4 } = content.findIndex(from2), child = content.maybeChild(index2);
|
|
23640
23639
|
let { index: indexTo, offset: offsetTo } = content.findIndex(to);
|
|
@@ -23732,7 +23731,7 @@ function replaceThreeWay($from, $start, $end, $to, depth) {
|
|
|
23732
23731
|
addNode(close(openEnd, replaceTwoWay($end, $to, depth + 1)), content);
|
|
23733
23732
|
}
|
|
23734
23733
|
addRange($to, null, depth, content);
|
|
23735
|
-
return new
|
|
23734
|
+
return new Fragment18(content);
|
|
23736
23735
|
}
|
|
23737
23736
|
function replaceTwoWay($from, $to, depth) {
|
|
23738
23737
|
let content = [];
|
|
@@ -23742,13 +23741,13 @@ function replaceTwoWay($from, $to, depth) {
|
|
|
23742
23741
|
addNode(close(type, replaceTwoWay($from, $to, depth + 1)), content);
|
|
23743
23742
|
}
|
|
23744
23743
|
addRange($to, null, depth, content);
|
|
23745
|
-
return new
|
|
23744
|
+
return new Fragment18(content);
|
|
23746
23745
|
}
|
|
23747
23746
|
function prepareSliceForReplace(slice2, $along) {
|
|
23748
23747
|
let extra = $along.depth - slice2.openStart, parent = $along.node(extra);
|
|
23749
23748
|
let node = parent.copy(slice2.content);
|
|
23750
23749
|
for (let i = extra - 1; i >= 0; i--)
|
|
23751
|
-
node = $along.node(i).copy(
|
|
23750
|
+
node = $along.node(i).copy(Fragment18.from(node));
|
|
23752
23751
|
return {
|
|
23753
23752
|
start: node.resolveNoCache(slice2.openStart + extra),
|
|
23754
23753
|
end: node.resolveNoCache(node.content.size - slice2.openEnd - extra)
|
|
@@ -24087,7 +24086,7 @@ var Node2 = class {
|
|
|
24087
24086
|
this.type = type;
|
|
24088
24087
|
this.attrs = attrs;
|
|
24089
24088
|
this.marks = marks;
|
|
24090
|
-
this.content = content ||
|
|
24089
|
+
this.content = content || Fragment18.empty;
|
|
24091
24090
|
}
|
|
24092
24091
|
/**
|
|
24093
24092
|
The array of this node's child nodes.
|
|
@@ -24392,7 +24391,7 @@ var Node2 = class {
|
|
|
24392
24391
|
can optionally pass `start` and `end` indices into the
|
|
24393
24392
|
replacement fragment.
|
|
24394
24393
|
*/
|
|
24395
|
-
canReplace(from2, to, replacement =
|
|
24394
|
+
canReplace(from2, to, replacement = Fragment18.empty, start = 0, end = replacement.childCount) {
|
|
24396
24395
|
let one = this.contentMatchAt(from2).matchFragment(replacement, start, end);
|
|
24397
24396
|
let two = one && one.matchFragment(this.content, to);
|
|
24398
24397
|
if (!two || !two.validEnd)
|
|
@@ -24474,7 +24473,7 @@ var Node2 = class {
|
|
|
24474
24473
|
throw new RangeError("Invalid text node in JSON");
|
|
24475
24474
|
return schema.text(json2.text, marks);
|
|
24476
24475
|
}
|
|
24477
|
-
let content =
|
|
24476
|
+
let content = Fragment18.fromJSON(schema, json2.content);
|
|
24478
24477
|
let node = schema.nodeType(json2.type).create(json2.attrs, content, marks);
|
|
24479
24478
|
node.type.checkAttrs(node.attrs);
|
|
24480
24479
|
return node;
|
|
@@ -24616,7 +24615,7 @@ var ContentMatch = class {
|
|
|
24616
24615
|
function search(match, types) {
|
|
24617
24616
|
let finished = match.matchFragment(after, startIndex);
|
|
24618
24617
|
if (finished && (!toEnd || finished.validEnd))
|
|
24619
|
-
return
|
|
24618
|
+
return Fragment18.from(types.map((tp) => tp.createAndFill()));
|
|
24620
24619
|
for (let i = 0; i < match.next.length; i++) {
|
|
24621
24620
|
let { type, next } = match.next[i];
|
|
24622
24621
|
if (!(type.isText || type.hasRequiredAttrs()) && seen.indexOf(next) == -1) {
|
|
@@ -25068,7 +25067,7 @@ var NodeType = class {
|
|
|
25068
25067
|
create(attrs = null, content, marks) {
|
|
25069
25068
|
if (this.isText)
|
|
25070
25069
|
throw new Error("NodeType.create can't construct text nodes");
|
|
25071
|
-
return new Node2(this, this.computeAttrs(attrs),
|
|
25070
|
+
return new Node2(this, this.computeAttrs(attrs), Fragment18.from(content), Mark.setFrom(marks));
|
|
25072
25071
|
}
|
|
25073
25072
|
/**
|
|
25074
25073
|
Like [`create`](https://prosemirror.net/docs/ref/#model.NodeType.create), but check the given content
|
|
@@ -25076,7 +25075,7 @@ var NodeType = class {
|
|
|
25076
25075
|
if it doesn't match.
|
|
25077
25076
|
*/
|
|
25078
25077
|
createChecked(attrs = null, content, marks) {
|
|
25079
|
-
content =
|
|
25078
|
+
content = Fragment18.from(content);
|
|
25080
25079
|
this.checkContent(content);
|
|
25081
25080
|
return new Node2(this, this.computeAttrs(attrs), content, Mark.setFrom(marks));
|
|
25082
25081
|
}
|
|
@@ -25090,7 +25089,7 @@ var NodeType = class {
|
|
|
25090
25089
|
*/
|
|
25091
25090
|
createAndFill(attrs = null, content, marks) {
|
|
25092
25091
|
attrs = this.computeAttrs(attrs);
|
|
25093
|
-
content =
|
|
25092
|
+
content = Fragment18.from(content);
|
|
25094
25093
|
if (content.size) {
|
|
25095
25094
|
let before = this.contentMatch.fillBefore(content);
|
|
25096
25095
|
if (!before)
|
|
@@ -25098,7 +25097,7 @@ var NodeType = class {
|
|
|
25098
25097
|
content = before.append(content);
|
|
25099
25098
|
}
|
|
25100
25099
|
let matched = this.contentMatch.matchFragment(content);
|
|
25101
|
-
let after = matched && matched.fillBefore(
|
|
25100
|
+
let after = matched && matched.fillBefore(Fragment18.empty, true);
|
|
25102
25101
|
if (!after)
|
|
25103
25102
|
return null;
|
|
25104
25103
|
return new Node2(this, attrs, content.append(after), Mark.setFrom(marks));
|
|
@@ -25562,7 +25561,7 @@ var NodeContext = class {
|
|
|
25562
25561
|
if (!this.match) {
|
|
25563
25562
|
if (!this.type)
|
|
25564
25563
|
return [];
|
|
25565
|
-
let fill = this.type.contentMatch.fillBefore(
|
|
25564
|
+
let fill = this.type.contentMatch.fillBefore(Fragment18.from(node));
|
|
25566
25565
|
if (fill) {
|
|
25567
25566
|
this.match = this.type.contentMatch.matchFragment(fill);
|
|
25568
25567
|
} else {
|
|
@@ -25588,9 +25587,9 @@ var NodeContext = class {
|
|
|
25588
25587
|
this.content[this.content.length - 1] = text.withText(text.text.slice(0, text.text.length - m[0].length));
|
|
25589
25588
|
}
|
|
25590
25589
|
}
|
|
25591
|
-
let content =
|
|
25590
|
+
let content = Fragment18.from(this.content);
|
|
25592
25591
|
if (!openEnd && this.match)
|
|
25593
|
-
content = content.append(this.match.fillBefore(
|
|
25592
|
+
content = content.append(this.match.fillBefore(Fragment18.empty, true));
|
|
25594
25593
|
return this.type ? this.type.create(this.attrs, content, this.marks) : content;
|
|
25595
25594
|
}
|
|
25596
25595
|
inlineContext(node) {
|
|
@@ -26607,7 +26606,7 @@ function mapFragment(fragment, f, parent) {
|
|
|
26607
26606
|
child = f(child, parent, i);
|
|
26608
26607
|
mapped.push(child);
|
|
26609
26608
|
}
|
|
26610
|
-
return
|
|
26609
|
+
return Fragment18.fromArray(mapped);
|
|
26611
26610
|
}
|
|
26612
26611
|
var AddMarkStep = class extends Step {
|
|
26613
26612
|
/**
|
|
@@ -26724,7 +26723,7 @@ var AddNodeMarkStep = class extends Step {
|
|
|
26724
26723
|
if (!node)
|
|
26725
26724
|
return StepResult.fail("No node at mark step's position");
|
|
26726
26725
|
let updated = node.type.create(node.attrs, null, this.mark.addToSet(node.marks));
|
|
26727
|
-
return StepResult.fromReplace(doc3, this.pos, this.pos + 1, new Slice(
|
|
26726
|
+
return StepResult.fromReplace(doc3, this.pos, this.pos + 1, new Slice(Fragment18.from(updated), 0, node.isLeaf ? 0 : 1));
|
|
26728
26727
|
}
|
|
26729
26728
|
invert(doc3) {
|
|
26730
26729
|
let node = doc3.nodeAt(this.pos);
|
|
@@ -26770,7 +26769,7 @@ var RemoveNodeMarkStep = class extends Step {
|
|
|
26770
26769
|
if (!node)
|
|
26771
26770
|
return StepResult.fail("No node at mark step's position");
|
|
26772
26771
|
let updated = node.type.create(node.attrs, null, this.mark.removeFromSet(node.marks));
|
|
26773
|
-
return StepResult.fromReplace(doc3, this.pos, this.pos + 1, new Slice(
|
|
26772
|
+
return StepResult.fromReplace(doc3, this.pos, this.pos + 1, new Slice(Fragment18.from(updated), 0, node.isLeaf ? 0 : 1));
|
|
26774
26773
|
}
|
|
26775
26774
|
invert(doc3) {
|
|
26776
26775
|
let node = doc3.nodeAt(this.pos);
|
|
@@ -27035,7 +27034,7 @@ function clearIncompatible(tr2, pos, parentType, match = parentType.contentMatch
|
|
|
27035
27034
|
let m, newline = /\r?\n|\r/g, slice2;
|
|
27036
27035
|
while (m = newline.exec(child.text)) {
|
|
27037
27036
|
if (!slice2)
|
|
27038
|
-
slice2 = new Slice(
|
|
27037
|
+
slice2 = new Slice(Fragment18.from(parentType.schema.text(" ", parentType.allowedMarks(child.marks))), 0, 0);
|
|
27039
27038
|
replSteps.push(new ReplaceStep(cur + m.index, cur + m.index + m[0].length, slice2));
|
|
27040
27039
|
}
|
|
27041
27040
|
}
|
|
@@ -27043,7 +27042,7 @@ function clearIncompatible(tr2, pos, parentType, match = parentType.contentMatch
|
|
|
27043
27042
|
cur = end;
|
|
27044
27043
|
}
|
|
27045
27044
|
if (!match.validEnd) {
|
|
27046
|
-
let fill = match.fillBefore(
|
|
27045
|
+
let fill = match.fillBefore(Fragment18.empty, true);
|
|
27047
27046
|
tr2.replace(cur, cur, new Slice(fill, 0, 0));
|
|
27048
27047
|
}
|
|
27049
27048
|
for (let i = replSteps.length - 1; i >= 0; i--)
|
|
@@ -27069,20 +27068,20 @@ function lift(tr2, range, target) {
|
|
|
27069
27068
|
let { $from, $to, depth } = range;
|
|
27070
27069
|
let gapStart = $from.before(depth + 1), gapEnd = $to.after(depth + 1);
|
|
27071
27070
|
let start = gapStart, end = gapEnd;
|
|
27072
|
-
let before =
|
|
27071
|
+
let before = Fragment18.empty, openStart = 0;
|
|
27073
27072
|
for (let d = depth, splitting = false; d > target; d--)
|
|
27074
27073
|
if (splitting || $from.index(d) > 0) {
|
|
27075
27074
|
splitting = true;
|
|
27076
|
-
before =
|
|
27075
|
+
before = Fragment18.from($from.node(d).copy(before));
|
|
27077
27076
|
openStart++;
|
|
27078
27077
|
} else {
|
|
27079
27078
|
start--;
|
|
27080
27079
|
}
|
|
27081
|
-
let after =
|
|
27080
|
+
let after = Fragment18.empty, openEnd = 0;
|
|
27082
27081
|
for (let d = depth, splitting = false; d > target; d--)
|
|
27083
27082
|
if (splitting || $to.after(d + 1) < $to.end(d)) {
|
|
27084
27083
|
splitting = true;
|
|
27085
|
-
after =
|
|
27084
|
+
after = Fragment18.from($to.node(d).copy(after));
|
|
27086
27085
|
openEnd++;
|
|
27087
27086
|
} else {
|
|
27088
27087
|
end++;
|
|
@@ -27122,14 +27121,14 @@ function findWrappingInside(range, type) {
|
|
|
27122
27121
|
return inside;
|
|
27123
27122
|
}
|
|
27124
27123
|
function wrap(tr2, range, wrappers) {
|
|
27125
|
-
let content =
|
|
27124
|
+
let content = Fragment18.empty;
|
|
27126
27125
|
for (let i = wrappers.length - 1; i >= 0; i--) {
|
|
27127
27126
|
if (content.size) {
|
|
27128
27127
|
let match = wrappers[i].type.contentMatch.matchFragment(content);
|
|
27129
27128
|
if (!match || !match.validEnd)
|
|
27130
27129
|
throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper");
|
|
27131
27130
|
}
|
|
27132
|
-
content =
|
|
27131
|
+
content = Fragment18.from(wrappers[i].type.create(wrappers[i].attrs, content));
|
|
27133
27132
|
}
|
|
27134
27133
|
let start = range.start, end = range.end;
|
|
27135
27134
|
tr2.step(new ReplaceAroundStep(start, end, start, end, new Slice(content, 0, 0), wrappers.length, true));
|
|
@@ -27154,7 +27153,7 @@ function setBlockType(tr2, from2, to, type, attrs) {
|
|
|
27154
27153
|
clearIncompatible(tr2, tr2.mapping.slice(mapFrom).map(pos, 1), type, void 0, convertNewlines === null);
|
|
27155
27154
|
let mapping = tr2.mapping.slice(mapFrom);
|
|
27156
27155
|
let startM = mapping.map(pos, 1), endM = mapping.map(pos + node.nodeSize, 1);
|
|
27157
|
-
tr2.step(new ReplaceAroundStep(startM, endM, startM + 1, endM - 1, new Slice(
|
|
27156
|
+
tr2.step(new ReplaceAroundStep(startM, endM, startM + 1, endM - 1, new Slice(Fragment18.from(type.create(attrsHere, null, node.marks)), 0, 0), 1, true));
|
|
27158
27157
|
if (convertNewlines === true)
|
|
27159
27158
|
replaceNewlines(tr2, node, pos, mapFrom);
|
|
27160
27159
|
return false;
|
|
@@ -27195,7 +27194,7 @@ function setNodeMarkup(tr2, pos, type, attrs, marks) {
|
|
|
27195
27194
|
return tr2.replaceWith(pos, pos + node.nodeSize, newNode);
|
|
27196
27195
|
if (!type.validContent(node.content))
|
|
27197
27196
|
throw new RangeError("Invalid content for node type " + type.name);
|
|
27198
|
-
tr2.step(new ReplaceAroundStep(pos, pos + node.nodeSize, pos + 1, pos + node.nodeSize - 1, new Slice(
|
|
27197
|
+
tr2.step(new ReplaceAroundStep(pos, pos + node.nodeSize, pos + 1, pos + node.nodeSize - 1, new Slice(Fragment18.from(newNode), 0, 0), 1, true));
|
|
27199
27198
|
}
|
|
27200
27199
|
function canSplit(doc3, pos, depth = 1, typesAfter) {
|
|
27201
27200
|
let $pos = doc3.resolve(pos), base2 = $pos.depth - depth;
|
|
@@ -27219,11 +27218,11 @@ function canSplit(doc3, pos, depth = 1, typesAfter) {
|
|
|
27219
27218
|
return $pos.node(base2).canReplaceWith(index2, index2, baseType ? baseType.type : $pos.node(base2 + 1).type);
|
|
27220
27219
|
}
|
|
27221
27220
|
function split(tr2, pos, depth = 1, typesAfter) {
|
|
27222
|
-
let $pos = tr2.doc.resolve(pos), before =
|
|
27221
|
+
let $pos = tr2.doc.resolve(pos), before = Fragment18.empty, after = Fragment18.empty;
|
|
27223
27222
|
for (let d = $pos.depth, e = $pos.depth - depth, i = depth - 1; d > e; d--, i--) {
|
|
27224
|
-
before =
|
|
27223
|
+
before = Fragment18.from($pos.node(d).copy(before));
|
|
27225
27224
|
let typeAfter = typesAfter && typesAfter[i];
|
|
27226
|
-
after =
|
|
27225
|
+
after = Fragment18.from(typeAfter ? typeAfter.type.create(typeAfter.attrs, after) : $pos.node(d).copy(after));
|
|
27227
27226
|
}
|
|
27228
27227
|
tr2.step(new ReplaceStep(pos, pos, new Slice(before.append(after), depth, depth), true));
|
|
27229
27228
|
}
|
|
@@ -27362,7 +27361,7 @@ var Fitter = class {
|
|
|
27362
27361
|
this.$to = $to;
|
|
27363
27362
|
this.unplaced = unplaced;
|
|
27364
27363
|
this.frontier = [];
|
|
27365
|
-
this.placed =
|
|
27364
|
+
this.placed = Fragment18.empty;
|
|
27366
27365
|
for (let i = 0; i <= $from.depth; i++) {
|
|
27367
27366
|
let node = $from.node(i);
|
|
27368
27367
|
this.frontier.push({
|
|
@@ -27371,7 +27370,7 @@ var Fitter = class {
|
|
|
27371
27370
|
});
|
|
27372
27371
|
}
|
|
27373
27372
|
for (let i = $from.depth; i > 0; i--)
|
|
27374
|
-
this.placed =
|
|
27373
|
+
this.placed = Fragment18.from($from.node(i).copy(this.placed));
|
|
27375
27374
|
}
|
|
27376
27375
|
get depth() {
|
|
27377
27376
|
return this.frontier.length - 1;
|
|
@@ -27428,7 +27427,7 @@ var Fitter = class {
|
|
|
27428
27427
|
let first2 = fragment.firstChild;
|
|
27429
27428
|
for (let frontierDepth = this.depth; frontierDepth >= 0; frontierDepth--) {
|
|
27430
27429
|
let { type, match } = this.frontier[frontierDepth], wrap2, inject = null;
|
|
27431
|
-
if (pass == 1 && (first2 ? match.matchType(first2.type) || (inject = match.fillBefore(
|
|
27430
|
+
if (pass == 1 && (first2 ? match.matchType(first2.type) || (inject = match.fillBefore(Fragment18.from(first2), false)) : parent && type.compatibleContent(parent.type)))
|
|
27432
27431
|
return { sliceDepth, frontierDepth, parent, inject };
|
|
27433
27432
|
else if (pass == 2 && first2 && (wrap2 = match.findWrapping(first2.type)))
|
|
27434
27433
|
return { sliceDepth, frontierDepth, parent, wrap: wrap2 };
|
|
@@ -27488,7 +27487,7 @@ var Fitter = class {
|
|
|
27488
27487
|
let toEnd = taken == fragment.childCount;
|
|
27489
27488
|
if (!toEnd)
|
|
27490
27489
|
openEndCount = -1;
|
|
27491
|
-
this.placed = addToFragment(this.placed, frontierDepth,
|
|
27490
|
+
this.placed = addToFragment(this.placed, frontierDepth, Fragment18.from(add));
|
|
27492
27491
|
this.frontier[frontierDepth].match = match;
|
|
27493
27492
|
if (toEnd && openEndCount < 0 && parent && parent.type == this.frontier[this.depth].type && this.frontier.length > 1)
|
|
27494
27493
|
this.closeFrontierNode();
|
|
@@ -27545,12 +27544,12 @@ var Fitter = class {
|
|
|
27545
27544
|
openFrontierNode(type, attrs = null, content) {
|
|
27546
27545
|
let top = this.frontier[this.depth];
|
|
27547
27546
|
top.match = top.match.matchType(type);
|
|
27548
|
-
this.placed = addToFragment(this.placed, this.depth,
|
|
27547
|
+
this.placed = addToFragment(this.placed, this.depth, Fragment18.from(type.create(attrs, content)));
|
|
27549
27548
|
this.frontier.push({ type, match: type.contentMatch });
|
|
27550
27549
|
}
|
|
27551
27550
|
closeFrontierNode() {
|
|
27552
27551
|
let open = this.frontier.pop();
|
|
27553
|
-
let add = open.match.fillBefore(
|
|
27552
|
+
let add = open.match.fillBefore(Fragment18.empty, true);
|
|
27554
27553
|
if (add.childCount)
|
|
27555
27554
|
this.placed = addToFragment(this.placed, this.frontier.length, add);
|
|
27556
27555
|
}
|
|
@@ -27579,7 +27578,7 @@ function closeNodeStart(node, openStart, openEnd) {
|
|
|
27579
27578
|
if (openStart > 0) {
|
|
27580
27579
|
frag = node.type.contentMatch.fillBefore(frag).append(frag);
|
|
27581
27580
|
if (openEnd <= 0)
|
|
27582
|
-
frag = frag.append(node.type.contentMatch.matchFragment(frag).fillBefore(
|
|
27581
|
+
frag = frag.append(node.type.contentMatch.matchFragment(frag).fillBefore(Fragment18.empty, true));
|
|
27583
27582
|
}
|
|
27584
27583
|
return node.copy(frag);
|
|
27585
27584
|
}
|
|
@@ -27671,7 +27670,7 @@ function closeFragment(fragment, depth, oldOpen, newOpen, parent) {
|
|
|
27671
27670
|
if (depth > newOpen) {
|
|
27672
27671
|
let match = parent.contentMatchAt(0);
|
|
27673
27672
|
let start = match.fillBefore(fragment).append(fragment);
|
|
27674
|
-
fragment = start.append(match.matchFragment(start).fillBefore(
|
|
27673
|
+
fragment = start.append(match.matchFragment(start).fillBefore(Fragment18.empty, true));
|
|
27675
27674
|
}
|
|
27676
27675
|
return fragment;
|
|
27677
27676
|
}
|
|
@@ -27681,7 +27680,7 @@ function replaceRangeWith(tr2, from2, to, node) {
|
|
|
27681
27680
|
if (point != null)
|
|
27682
27681
|
from2 = to = point;
|
|
27683
27682
|
}
|
|
27684
|
-
tr2.replaceRange(from2, to, new Slice(
|
|
27683
|
+
tr2.replaceRange(from2, to, new Slice(Fragment18.from(node), 0, 0));
|
|
27685
27684
|
}
|
|
27686
27685
|
function deleteRange(tr2, from2, to) {
|
|
27687
27686
|
let $from = tr2.doc.resolve(from2), $to = tr2.doc.resolve(to);
|
|
@@ -27729,7 +27728,7 @@ var AttrStep = class extends Step {
|
|
|
27729
27728
|
attrs[name] = node.attrs[name];
|
|
27730
27729
|
attrs[this.attr] = this.value;
|
|
27731
27730
|
let updated = node.type.create(attrs, null, node.marks);
|
|
27732
|
-
return StepResult.fromReplace(doc3, this.pos, this.pos + 1, new Slice(
|
|
27731
|
+
return StepResult.fromReplace(doc3, this.pos, this.pos + 1, new Slice(Fragment18.from(updated), 0, node.isLeaf ? 0 : 1));
|
|
27733
27732
|
}
|
|
27734
27733
|
getMap() {
|
|
27735
27734
|
return StepMap.empty;
|
|
@@ -27864,7 +27863,7 @@ var Transform = class {
|
|
|
27864
27863
|
fragment, node, or array of nodes.
|
|
27865
27864
|
*/
|
|
27866
27865
|
replaceWith(from2, to, content) {
|
|
27867
|
-
return this.replace(from2, to, new Slice(
|
|
27866
|
+
return this.replace(from2, to, new Slice(Fragment18.from(content), 0, 0));
|
|
27868
27867
|
}
|
|
27869
27868
|
/**
|
|
27870
27869
|
Delete the content between the given positions.
|
|
@@ -28366,7 +28365,7 @@ var NodeSelection = class extends Selection {
|
|
|
28366
28365
|
return new NodeSelection($pos);
|
|
28367
28366
|
}
|
|
28368
28367
|
content() {
|
|
28369
|
-
return new Slice(
|
|
28368
|
+
return new Slice(Fragment18.from(this.node), 0, 0);
|
|
28370
28369
|
}
|
|
28371
28370
|
eq(other) {
|
|
28372
28371
|
return other instanceof NodeSelection && other.anchor == this.anchor;
|
|
@@ -30188,7 +30187,7 @@ var NodeViewDesc = class extends ViewDesc {
|
|
|
30188
30187
|
}
|
|
30189
30188
|
}
|
|
30190
30189
|
if (!rule.contentElement)
|
|
30191
|
-
rule.getContent = () =>
|
|
30190
|
+
rule.getContent = () => Fragment18.empty;
|
|
30192
30191
|
}
|
|
30193
30192
|
return rule;
|
|
30194
30193
|
}
|
|
@@ -31507,7 +31506,7 @@ function parseFromClipboard(view, text, html, plainText, $context) {
|
|
|
31507
31506
|
text = f(text, inCode || plainText, view);
|
|
31508
31507
|
});
|
|
31509
31508
|
if (inCode)
|
|
31510
|
-
return text ? new Slice(
|
|
31509
|
+
return text ? new Slice(Fragment18.from(view.state.schema.text(text.replace(/\r\n?/g, "\n"))), 0, 0) : Slice.empty;
|
|
31511
31510
|
let parsed = view.someProp("clipboardTextParser", (f) => f(text, $context, plainText, view));
|
|
31512
31511
|
if (parsed) {
|
|
31513
31512
|
slice2 = parsed;
|
|
@@ -31596,13 +31595,13 @@ function normalizeSiblings(fragment, $context) {
|
|
|
31596
31595
|
}
|
|
31597
31596
|
});
|
|
31598
31597
|
if (result)
|
|
31599
|
-
return
|
|
31598
|
+
return Fragment18.from(result);
|
|
31600
31599
|
}
|
|
31601
31600
|
return fragment;
|
|
31602
31601
|
}
|
|
31603
31602
|
function withWrappers(node, wrap2, from2 = 0) {
|
|
31604
31603
|
for (let i = wrap2.length - 1; i >= from2; i--)
|
|
31605
|
-
node = wrap2[i].create(null,
|
|
31604
|
+
node = wrap2[i].create(null, Fragment18.from(node));
|
|
31606
31605
|
return node;
|
|
31607
31606
|
}
|
|
31608
31607
|
function addToSibling(wrap2, lastWrap, node, sibling, depth) {
|
|
@@ -31612,14 +31611,14 @@ function addToSibling(wrap2, lastWrap, node, sibling, depth) {
|
|
|
31612
31611
|
return sibling.copy(sibling.content.replaceChild(sibling.childCount - 1, inner));
|
|
31613
31612
|
let match = sibling.contentMatchAt(sibling.childCount);
|
|
31614
31613
|
if (match.matchType(depth == wrap2.length - 1 ? node.type : wrap2[depth + 1]))
|
|
31615
|
-
return sibling.copy(sibling.content.append(
|
|
31614
|
+
return sibling.copy(sibling.content.append(Fragment18.from(withWrappers(node, wrap2, depth + 1))));
|
|
31616
31615
|
}
|
|
31617
31616
|
}
|
|
31618
31617
|
function closeRight(node, depth) {
|
|
31619
31618
|
if (depth == 0)
|
|
31620
31619
|
return node;
|
|
31621
31620
|
let fragment = node.content.replaceChild(node.childCount - 1, closeRight(node.lastChild, depth - 1));
|
|
31622
|
-
let fill = node.contentMatchAt(node.childCount).fillBefore(
|
|
31621
|
+
let fill = node.contentMatchAt(node.childCount).fillBefore(Fragment18.empty, true);
|
|
31623
31622
|
return node.copy(fragment.append(fill));
|
|
31624
31623
|
}
|
|
31625
31624
|
function closeRange(fragment, side, from2, to, depth, openEnd) {
|
|
@@ -31629,7 +31628,7 @@ function closeRange(fragment, side, from2, to, depth, openEnd) {
|
|
|
31629
31628
|
if (depth < to - 1)
|
|
31630
31629
|
inner = closeRange(inner, side, from2, to, depth + 1, openEnd);
|
|
31631
31630
|
if (depth >= from2)
|
|
31632
|
-
inner = side < 0 ? node.contentMatchAt(0).fillBefore(inner, openEnd <= depth).append(inner) : inner.append(node.contentMatchAt(node.childCount).fillBefore(
|
|
31631
|
+
inner = side < 0 ? node.contentMatchAt(0).fillBefore(inner, openEnd <= depth).append(inner) : inner.append(node.contentMatchAt(node.childCount).fillBefore(Fragment18.empty, true));
|
|
31633
31632
|
return fragment.replaceChild(side < 0 ? 0 : fragment.childCount - 1, node.copy(inner));
|
|
31634
31633
|
}
|
|
31635
31634
|
function closeSlice(slice2, openStart, openEnd) {
|
|
@@ -31699,7 +31698,7 @@ function addContext(slice2, context) {
|
|
|
31699
31698
|
let type = schema.nodes[array[i]];
|
|
31700
31699
|
if (!type || type.hasRequiredAttrs())
|
|
31701
31700
|
break;
|
|
31702
|
-
content =
|
|
31701
|
+
content = Fragment18.from(type.create(array[i + 1], content));
|
|
31703
31702
|
openStart++;
|
|
31704
31703
|
openEnd++;
|
|
31705
31704
|
}
|
|
@@ -33560,7 +33559,7 @@ function isMarkChange(cur, prev) {
|
|
|
33560
33559
|
let updated = [];
|
|
33561
33560
|
for (let i = 0; i < prev.childCount; i++)
|
|
33562
33561
|
updated.push(update(prev.child(i)));
|
|
33563
|
-
if (
|
|
33562
|
+
if (Fragment18.from(updated).eq(cur))
|
|
33564
33563
|
return { mark, type };
|
|
33565
33564
|
}
|
|
33566
33565
|
function looksLikeBackspace(old, start, end, $newStart, $newEnd) {
|
|
@@ -34670,10 +34669,10 @@ function deleteBarrier(state, $cut, dispatch2, dir) {
|
|
|
34670
34669
|
let canDelAfter = !isolated && $cut.parent.canReplace($cut.index(), $cut.index() + 1);
|
|
34671
34670
|
if (canDelAfter && (conn = (match = before.contentMatchAt(before.childCount)).findWrapping(after.type)) && match.matchType(conn[0] || after.type).validEnd) {
|
|
34672
34671
|
if (dispatch2) {
|
|
34673
|
-
let end = $cut.pos + after.nodeSize, wrap2 =
|
|
34672
|
+
let end = $cut.pos + after.nodeSize, wrap2 = Fragment18.empty;
|
|
34674
34673
|
for (let i = conn.length - 1; i >= 0; i--)
|
|
34675
|
-
wrap2 =
|
|
34676
|
-
wrap2 =
|
|
34674
|
+
wrap2 = Fragment18.from(conn[i].create(null, wrap2));
|
|
34675
|
+
wrap2 = Fragment18.from(before.copy(wrap2));
|
|
34677
34676
|
let tr2 = state.tr.step(new ReplaceAroundStep($cut.pos - 1, end, $cut.pos, end, new Slice(wrap2, 1, 0), conn.length, true));
|
|
34678
34677
|
let $joinAt = tr2.doc.resolve(end + 2 * conn.length);
|
|
34679
34678
|
if ($joinAt.nodeAfter && $joinAt.nodeAfter.type == before.type && canJoin(tr2.doc, $joinAt.pos))
|
|
@@ -34702,9 +34701,9 @@ function deleteBarrier(state, $cut, dispatch2, dir) {
|
|
|
34702
34701
|
afterDepth++;
|
|
34703
34702
|
if (at2.canReplace(at2.childCount, at2.childCount, afterText.content)) {
|
|
34704
34703
|
if (dispatch2) {
|
|
34705
|
-
let end =
|
|
34704
|
+
let end = Fragment18.empty;
|
|
34706
34705
|
for (let i = wrap2.length - 1; i >= 0; i--)
|
|
34707
|
-
end =
|
|
34706
|
+
end = Fragment18.from(wrap2[i].copy(end));
|
|
34708
34707
|
let tr2 = state.tr.step(new ReplaceAroundStep($cut.pos - wrap2.length, $cut.pos + after.nodeSize, $cut.pos + afterDepth, $cut.pos + after.nodeSize - afterDepth, new Slice(end, wrap2.length, 0), 0, true));
|
|
34709
34708
|
dispatch2(tr2.scrollIntoView());
|
|
34710
34709
|
}
|
|
@@ -34809,9 +34808,9 @@ function wrapRangeInList(tr2, range, listType, attrs = null) {
|
|
|
34809
34808
|
return true;
|
|
34810
34809
|
}
|
|
34811
34810
|
function doWrapInList(tr2, range, wrappers, joinBefore, listType) {
|
|
34812
|
-
let content =
|
|
34811
|
+
let content = Fragment18.empty;
|
|
34813
34812
|
for (let i = wrappers.length - 1; i >= 0; i--)
|
|
34814
|
-
content =
|
|
34813
|
+
content = Fragment18.from(wrappers[i].type.create(wrappers[i].attrs, content));
|
|
34815
34814
|
tr2.step(new ReplaceAroundStep(range.start - (joinBefore ? 2 : 0), range.end, range.start, range.end, new Slice(content, 0, 0), wrappers.length, true));
|
|
34816
34815
|
let found2 = 0;
|
|
34817
34816
|
for (let i = 0; i < wrappers.length; i++)
|
|
@@ -34845,7 +34844,7 @@ function liftListItem(itemType) {
|
|
|
34845
34844
|
function liftToOuterList(state, dispatch2, itemType, range) {
|
|
34846
34845
|
let tr2 = state.tr, end = range.end, endOfList = range.$to.end(range.depth);
|
|
34847
34846
|
if (end < endOfList) {
|
|
34848
|
-
tr2.step(new ReplaceAroundStep(end - 1, endOfList, end, endOfList, new Slice(
|
|
34847
|
+
tr2.step(new ReplaceAroundStep(end - 1, endOfList, end, endOfList, new Slice(Fragment18.from(itemType.create(null, range.parent.copy())), 1, 0), 1, true));
|
|
34849
34848
|
range = new NodeRange(tr2.doc.resolve(range.$from.pos), tr2.doc.resolve(endOfList), range.depth);
|
|
34850
34849
|
}
|
|
34851
34850
|
const target = liftTarget(range);
|
|
@@ -34869,10 +34868,10 @@ function liftOutOfList(state, dispatch2, range) {
|
|
|
34869
34868
|
return false;
|
|
34870
34869
|
let atStart = range.startIndex == 0, atEnd = range.endIndex == list.childCount;
|
|
34871
34870
|
let parent = $start.node(-1), indexBefore = $start.index(-1);
|
|
34872
|
-
if (!parent.canReplace(indexBefore + (atStart ? 0 : 1), indexBefore + 1, item.content.append(atEnd ?
|
|
34871
|
+
if (!parent.canReplace(indexBefore + (atStart ? 0 : 1), indexBefore + 1, item.content.append(atEnd ? Fragment18.empty : Fragment18.from(list))))
|
|
34873
34872
|
return false;
|
|
34874
34873
|
let start = $start.pos, end = start + item.nodeSize;
|
|
34875
|
-
tr2.step(new ReplaceAroundStep(start - (atStart ? 1 : 0), end + (atEnd ? 1 : 0), start + 1, end - 1, new Slice((atStart ?
|
|
34874
|
+
tr2.step(new ReplaceAroundStep(start - (atStart ? 1 : 0), end + (atEnd ? 1 : 0), start + 1, end - 1, new Slice((atStart ? Fragment18.empty : Fragment18.from(list.copy(Fragment18.empty))).append(atEnd ? Fragment18.empty : Fragment18.from(list.copy(Fragment18.empty))), atStart ? 0 : 1, atEnd ? 0 : 1), atStart ? 0 : 1));
|
|
34876
34875
|
dispatch2(tr2.scrollIntoView());
|
|
34877
34876
|
return true;
|
|
34878
34877
|
}
|
|
@@ -34890,8 +34889,8 @@ function sinkListItem(itemType) {
|
|
|
34890
34889
|
return false;
|
|
34891
34890
|
if (dispatch2) {
|
|
34892
34891
|
let nestedBefore = nodeBefore.lastChild && nodeBefore.lastChild.type == parent.type;
|
|
34893
|
-
let inner =
|
|
34894
|
-
let slice2 = new Slice(
|
|
34892
|
+
let inner = Fragment18.from(nestedBefore ? itemType.create() : null);
|
|
34893
|
+
let slice2 = new Slice(Fragment18.from(itemType.create(null, Fragment18.from(parent.type.create(null, inner)))), nestedBefore ? 3 : 1, 0);
|
|
34895
34894
|
let before = range.start, after = range.end;
|
|
34896
34895
|
dispatch2(state.tr.step(new ReplaceAroundStep(before - (nestedBefore ? 3 : 1), after, before, after, slice2, 1, true)).scrollIntoView());
|
|
34897
34896
|
}
|
|
@@ -35109,7 +35108,7 @@ function elementFromString(value) {
|
|
|
35109
35108
|
return removeWhitespaces(html);
|
|
35110
35109
|
}
|
|
35111
35110
|
function createNodeFromContent(content, schema, options) {
|
|
35112
|
-
if (content instanceof Node2 || content instanceof
|
|
35111
|
+
if (content instanceof Node2 || content instanceof Fragment18) {
|
|
35113
35112
|
return content;
|
|
35114
35113
|
}
|
|
35115
35114
|
options = {
|
|
@@ -35123,7 +35122,7 @@ function createNodeFromContent(content, schema, options) {
|
|
|
35123
35122
|
try {
|
|
35124
35123
|
const isArrayContent = Array.isArray(content) && content.length > 0;
|
|
35125
35124
|
if (isArrayContent) {
|
|
35126
|
-
return
|
|
35125
|
+
return Fragment18.fromArray(content.map((item) => schema.nodeFromJSON(item)));
|
|
35127
35126
|
}
|
|
35128
35127
|
const node = schema.nodeFromJSON(content);
|
|
35129
35128
|
if (options.errorOnInvalidContent) {
|
|
@@ -36261,7 +36260,7 @@ function inputRulesPlugin(props) {
|
|
|
36261
36260
|
if (typeof text === "string") {
|
|
36262
36261
|
text = text;
|
|
36263
36262
|
} else {
|
|
36264
|
-
text = getHTMLFromFragment(
|
|
36263
|
+
text = getHTMLFromFragment(Fragment18.from(text), state.schema);
|
|
36265
36264
|
}
|
|
36266
36265
|
const { from: from2 } = simulatedInputMeta;
|
|
36267
36266
|
const to = from2 + text.length;
|
|
@@ -36644,7 +36643,7 @@ function pasteRulesPlugin(props) {
|
|
|
36644
36643
|
if (typeof text === "string") {
|
|
36645
36644
|
text = text;
|
|
36646
36645
|
} else {
|
|
36647
|
-
text = getHTMLFromFragment(
|
|
36646
|
+
text = getHTMLFromFragment(Fragment18.from(text), state.schema);
|
|
36648
36647
|
}
|
|
36649
36648
|
const { from: from22 } = simulatedPasteMeta;
|
|
36650
36649
|
const to2 = from22 + text.length;
|
|
@@ -37301,7 +37300,7 @@ var insertContentAt = (position, value, options) => ({ tr: tr2, dispatch: dispat
|
|
|
37301
37300
|
if (isOnlyTextContent) {
|
|
37302
37301
|
if (Array.isArray(value)) {
|
|
37303
37302
|
newContent = value.map((v) => v.text || "").join("");
|
|
37304
|
-
} else if (value instanceof
|
|
37303
|
+
} else if (value instanceof Fragment18) {
|
|
37305
37304
|
let text = "";
|
|
37306
37305
|
value.forEach((node) => {
|
|
37307
37306
|
if (node.text) {
|
|
@@ -37771,10 +37770,10 @@ var splitListItem = (typeOrName, overrideAttrs = {}) => ({ tr: tr2, state, dispa
|
|
|
37771
37770
|
return false;
|
|
37772
37771
|
}
|
|
37773
37772
|
if (dispatch2) {
|
|
37774
|
-
let wrap2 =
|
|
37773
|
+
let wrap2 = Fragment18.empty;
|
|
37775
37774
|
const depthBefore = $from.index(-1) ? 1 : $from.index(-2) ? 2 : 3;
|
|
37776
37775
|
for (let d = $from.depth - depthBefore; d >= $from.depth - 3; d -= 1) {
|
|
37777
|
-
wrap2 =
|
|
37776
|
+
wrap2 = Fragment18.from($from.node(d).copy(wrap2));
|
|
37778
37777
|
}
|
|
37779
37778
|
const depthAfter = (
|
|
37780
37779
|
// eslint-disable-next-line no-nested-ternary
|
|
@@ -37785,7 +37784,7 @@ var splitListItem = (typeOrName, overrideAttrs = {}) => ({ tr: tr2, state, dispa
|
|
|
37785
37784
|
...overrideAttrs
|
|
37786
37785
|
};
|
|
37787
37786
|
const nextType2 = ((_a2 = type.contentMatch.defaultType) == null ? void 0 : _a2.createAndFill(newNextTypeAttributes2)) || void 0;
|
|
37788
|
-
wrap2 = wrap2.append(
|
|
37787
|
+
wrap2 = wrap2.append(Fragment18.from(type.createAndFill(null, nextType2) || void 0));
|
|
37789
37788
|
const start = $from.before($from.depth - (depthBefore - 1));
|
|
37790
37789
|
tr2.replace(start, $from.after(-depthAfter), new Slice(wrap2, 4 - depthBefore, 0));
|
|
37791
37790
|
let sel = -1;
|
|
@@ -43336,9 +43335,9 @@ function beforeinput(view, event) {
|
|
|
43336
43335
|
let insert = $from.parent.contentMatchAt($from.index()).findWrapping(view.state.schema.nodes.text);
|
|
43337
43336
|
if (!insert)
|
|
43338
43337
|
return false;
|
|
43339
|
-
let frag =
|
|
43338
|
+
let frag = Fragment18.empty;
|
|
43340
43339
|
for (let i = insert.length - 1; i >= 0; i--)
|
|
43341
|
-
frag =
|
|
43340
|
+
frag = Fragment18.from(insert[i].createAndFill(null, frag));
|
|
43342
43341
|
let tr2 = view.state.tr.replace($from.pos, $from.pos, new Slice(frag, 0, 0));
|
|
43343
43342
|
tr2.setSelection(TextSelection.near(tr2.doc.resolve($from.pos + 1)));
|
|
43344
43343
|
view.dispatch(tr2);
|
|
@@ -45018,10 +45017,10 @@ var CellSelection = class _CellSelection extends Selection {
|
|
|
45018
45017
|
}
|
|
45019
45018
|
rowContent.push(cell);
|
|
45020
45019
|
}
|
|
45021
|
-
rows.push(table.child(row).copy(
|
|
45020
|
+
rows.push(table.child(row).copy(Fragment18.from(rowContent)));
|
|
45022
45021
|
}
|
|
45023
45022
|
const fragment = this.isColSelection() && this.isRowSelection() ? table : rows;
|
|
45024
|
-
return new Slice(
|
|
45023
|
+
return new Slice(Fragment18.from(fragment), 1, 1);
|
|
45025
45024
|
}
|
|
45026
45025
|
replace(tr2, content = Slice.empty) {
|
|
45027
45026
|
const mapFrom = tr2.steps.length, ranges = this.ranges;
|
|
@@ -45041,7 +45040,7 @@ var CellSelection = class _CellSelection extends Selection {
|
|
|
45041
45040
|
tr2.setSelection(sel);
|
|
45042
45041
|
}
|
|
45043
45042
|
replaceWith(tr2, node) {
|
|
45044
|
-
this.replace(tr2, new Slice(
|
|
45043
|
+
this.replace(tr2, new Slice(Fragment18.from(node), 0, 0));
|
|
45045
45044
|
}
|
|
45046
45045
|
forEachCell(f) {
|
|
45047
45046
|
const table = this.$anchorCell.node(-1);
|
|
@@ -45589,7 +45588,7 @@ function mergeCells(state, dispatch2) {
|
|
|
45589
45588
|
if (dispatch2) {
|
|
45590
45589
|
const tr2 = state.tr;
|
|
45591
45590
|
const seen = {};
|
|
45592
|
-
let content =
|
|
45591
|
+
let content = Fragment18.empty;
|
|
45593
45592
|
let mergedPos;
|
|
45594
45593
|
let mergedCell;
|
|
45595
45594
|
for (let row = rect.top; row < rect.bottom; row++) {
|
|
@@ -45970,14 +45969,14 @@ function ensureRectangular(schema, rows) {
|
|
|
45970
45969
|
width = Math.max(width, widths[r2]);
|
|
45971
45970
|
for (let r2 = 0; r2 < widths.length; r2++) {
|
|
45972
45971
|
if (r2 >= rows.length)
|
|
45973
|
-
rows.push(
|
|
45972
|
+
rows.push(Fragment18.empty);
|
|
45974
45973
|
if (widths[r2] < width) {
|
|
45975
45974
|
const empty2 = tableNodeTypes(schema).cell.createAndFill();
|
|
45976
45975
|
const cells = [];
|
|
45977
45976
|
for (let i = widths[r2]; i < width; i++) {
|
|
45978
45977
|
cells.push(empty2);
|
|
45979
45978
|
}
|
|
45980
|
-
rows[r2] = rows[r2].append(
|
|
45979
|
+
rows[r2] = rows[r2].append(Fragment18.from(cells));
|
|
45981
45980
|
}
|
|
45982
45981
|
}
|
|
45983
45982
|
return { height: rows.length, width, rows };
|
|
@@ -46009,7 +46008,7 @@ function clipCells({ width, height, rows }, newWidth, newHeight) {
|
|
|
46009
46008
|
for (let j = 1; j < cell.attrs.rowspan; j++)
|
|
46010
46009
|
added[row + j] = (added[row + j] || 0) + cell.attrs.colspan;
|
|
46011
46010
|
}
|
|
46012
|
-
newRows.push(
|
|
46011
|
+
newRows.push(Fragment18.from(cells));
|
|
46013
46012
|
}
|
|
46014
46013
|
rows = newRows;
|
|
46015
46014
|
width = newWidth;
|
|
@@ -46030,7 +46029,7 @@ function clipCells({ width, height, rows }, newWidth, newHeight) {
|
|
|
46030
46029
|
);
|
|
46031
46030
|
cells.push(cell);
|
|
46032
46031
|
}
|
|
46033
|
-
newRows.push(
|
|
46032
|
+
newRows.push(Fragment18.from(cells));
|
|
46034
46033
|
}
|
|
46035
46034
|
rows = newRows;
|
|
46036
46035
|
height = newHeight;
|
|
@@ -46065,7 +46064,7 @@ function growTable(tr2, map2, table, start, width, height, mapFrom) {
|
|
|
46065
46064
|
header ? emptyHead || (emptyHead = types.header_cell.createAndFill()) : empty2 || (empty2 = types.cell.createAndFill())
|
|
46066
46065
|
);
|
|
46067
46066
|
}
|
|
46068
|
-
const emptyRow = types.row.create(null,
|
|
46067
|
+
const emptyRow = types.row.create(null, Fragment18.from(cells)), rows = [];
|
|
46069
46068
|
for (let i = map2.height; i < height; i++)
|
|
46070
46069
|
rows.push(emptyRow);
|
|
46071
46070
|
tr2.insert(tr2.mapping.slice(mapFrom).map(start + table.nodeSize - 2), rows);
|
|
@@ -46274,7 +46273,7 @@ function handlePaste(view, _2, slice2) {
|
|
|
46274
46273
|
width: 1,
|
|
46275
46274
|
height: 1,
|
|
46276
46275
|
rows: [
|
|
46277
|
-
|
|
46276
|
+
Fragment18.from(
|
|
46278
46277
|
fitSlice(tableNodeTypes(view.state.schema).cell, slice2)
|
|
46279
46278
|
)
|
|
46280
46279
|
]
|