rme 0.1.20 → 0.1.21
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/index.mjs +132 -141
- package/dist/index.mjs.map +4 -4
- package/package.json +1 -2
package/dist/index.mjs
CHANGED
|
@@ -9,9 +9,9 @@ var __commonJS = (cb, mod) => function __require() {
|
|
|
9
9
|
};
|
|
10
10
|
var __copyProps = (to, from, except, desc) => {
|
|
11
11
|
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
-
for (let
|
|
13
|
-
if (!__hasOwnProp.call(to,
|
|
14
|
-
__defProp(to,
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
15
|
}
|
|
16
16
|
return to;
|
|
17
17
|
};
|
|
@@ -23,12 +23,12 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
23
23
|
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
24
24
|
mod
|
|
25
25
|
));
|
|
26
|
-
var __decorateClass = (decorators, target,
|
|
27
|
-
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target,
|
|
26
|
+
var __decorateClass = (decorators, target, key, kind) => {
|
|
27
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
|
|
28
28
|
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
29
29
|
if (decorator = decorators[i])
|
|
30
|
-
result = (kind ? decorator(target,
|
|
31
|
-
if (kind && result) __defProp(target,
|
|
30
|
+
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
31
|
+
if (kind && result) __defProp(target, key, result);
|
|
32
32
|
return result;
|
|
33
33
|
};
|
|
34
34
|
|
|
@@ -1293,8 +1293,8 @@ var require_object_inspect = __commonJS({
|
|
|
1293
1293
|
if (isMap(obj)) {
|
|
1294
1294
|
var mapParts = [];
|
|
1295
1295
|
if (mapForEach) {
|
|
1296
|
-
mapForEach.call(obj, function(value,
|
|
1297
|
-
mapParts.push(inspect(
|
|
1296
|
+
mapForEach.call(obj, function(value, key) {
|
|
1297
|
+
mapParts.push(inspect(key, obj, true) + " => " + inspect(value, obj));
|
|
1298
1298
|
});
|
|
1299
1299
|
}
|
|
1300
1300
|
return collectionOf("Map", mapSize.call(obj), mapParts, indent);
|
|
@@ -1408,11 +1408,11 @@ var require_object_inspect = __commonJS({
|
|
|
1408
1408
|
}
|
|
1409
1409
|
return false;
|
|
1410
1410
|
}
|
|
1411
|
-
var hasOwn = Object.prototype.hasOwnProperty || function(
|
|
1412
|
-
return
|
|
1411
|
+
var hasOwn = Object.prototype.hasOwnProperty || function(key) {
|
|
1412
|
+
return key in this;
|
|
1413
1413
|
};
|
|
1414
|
-
function has(obj,
|
|
1415
|
-
return hasOwn.call(obj,
|
|
1414
|
+
function has(obj, key) {
|
|
1415
|
+
return hasOwn.call(obj, key);
|
|
1416
1416
|
}
|
|
1417
1417
|
function toStr(obj) {
|
|
1418
1418
|
return objectToString.call(obj);
|
|
@@ -1601,19 +1601,19 @@ var require_object_inspect = __commonJS({
|
|
|
1601
1601
|
symMap["$" + syms[k]] = syms[k];
|
|
1602
1602
|
}
|
|
1603
1603
|
}
|
|
1604
|
-
for (var
|
|
1605
|
-
if (!has(obj,
|
|
1604
|
+
for (var key in obj) {
|
|
1605
|
+
if (!has(obj, key)) {
|
|
1606
1606
|
continue;
|
|
1607
1607
|
}
|
|
1608
|
-
if (isArr && String(Number(
|
|
1608
|
+
if (isArr && String(Number(key)) === key && key < obj.length) {
|
|
1609
1609
|
continue;
|
|
1610
1610
|
}
|
|
1611
|
-
if (hasShammedSymbols && symMap["$" +
|
|
1611
|
+
if (hasShammedSymbols && symMap["$" + key] instanceof Symbol) {
|
|
1612
1612
|
continue;
|
|
1613
|
-
} else if ($test.call(/[^\w$]/,
|
|
1614
|
-
xs.push(inspect(
|
|
1613
|
+
} else if ($test.call(/[^\w$]/, key)) {
|
|
1614
|
+
xs.push(inspect(key, obj) + ": " + inspect(obj[key], obj));
|
|
1615
1615
|
} else {
|
|
1616
|
-
xs.push(
|
|
1616
|
+
xs.push(key + ": " + inspect(obj[key], obj));
|
|
1617
1617
|
}
|
|
1618
1618
|
}
|
|
1619
1619
|
if (typeof gOPS === "function") {
|
|
@@ -2431,8 +2431,8 @@ var require_property_descriptor = __commonJS({
|
|
|
2431
2431
|
if (!Desc || typeof Desc !== "object") {
|
|
2432
2432
|
return false;
|
|
2433
2433
|
}
|
|
2434
|
-
for (var
|
|
2435
|
-
if (hasOwn(Desc,
|
|
2434
|
+
for (var key in Desc) {
|
|
2435
|
+
if (hasOwn(Desc, key) && !allowed[key]) {
|
|
2436
2436
|
return false;
|
|
2437
2437
|
}
|
|
2438
2438
|
}
|
|
@@ -2711,11 +2711,11 @@ var require_DefineMethodProperty = __commonJS({
|
|
|
2711
2711
|
var IsExtensible = import_IsExtensible.default;
|
|
2712
2712
|
var IsPropertyKey = import_IsPropertyKey.default;
|
|
2713
2713
|
var Type = import_Type.default;
|
|
2714
|
-
module.exports = function DefineMethodProperty(homeObject,
|
|
2714
|
+
module.exports = function DefineMethodProperty(homeObject, key, closure, enumerable) {
|
|
2715
2715
|
if (Type(homeObject) !== "Object") {
|
|
2716
2716
|
throw new $TypeError("Assertion failed: `homeObject` is not an Object");
|
|
2717
2717
|
}
|
|
2718
|
-
if (!IsPropertyKey(
|
|
2718
|
+
if (!IsPropertyKey(key)) {
|
|
2719
2719
|
throw new $TypeError("Assertion failed: `key` is not a Property Key or a Private Name");
|
|
2720
2720
|
}
|
|
2721
2721
|
if (typeof closure !== "function") {
|
|
@@ -2734,7 +2734,7 @@ var require_DefineMethodProperty = __commonJS({
|
|
|
2734
2734
|
"[[Enumerable]]": enumerable,
|
|
2735
2735
|
"[[Configurable]]": true
|
|
2736
2736
|
};
|
|
2737
|
-
DefinePropertyOrThrow(homeObject,
|
|
2737
|
+
DefinePropertyOrThrow(homeObject, key, desc);
|
|
2738
2738
|
};
|
|
2739
2739
|
}
|
|
2740
2740
|
});
|
|
@@ -2770,11 +2770,11 @@ var require_side_channel = __commonJS({
|
|
|
2770
2770
|
var $mapGet = callBound("Map.prototype.get", true);
|
|
2771
2771
|
var $mapSet = callBound("Map.prototype.set", true);
|
|
2772
2772
|
var $mapHas = callBound("Map.prototype.has", true);
|
|
2773
|
-
var listGetNode = function(list,
|
|
2773
|
+
var listGetNode = function(list, key) {
|
|
2774
2774
|
var prev = list;
|
|
2775
2775
|
var curr;
|
|
2776
2776
|
for (; (curr = prev.next) !== null; prev = curr) {
|
|
2777
|
-
if (curr.key ===
|
|
2777
|
+
if (curr.key === key) {
|
|
2778
2778
|
prev.next = curr.next;
|
|
2779
2779
|
curr.next = /** @type {NonNullable<typeof list.next>} */
|
|
2780
2780
|
list.next;
|
|
@@ -2783,84 +2783,84 @@ var require_side_channel = __commonJS({
|
|
|
2783
2783
|
}
|
|
2784
2784
|
}
|
|
2785
2785
|
};
|
|
2786
|
-
var listGet = function(objects,
|
|
2787
|
-
var node = listGetNode(objects,
|
|
2786
|
+
var listGet = function(objects, key) {
|
|
2787
|
+
var node = listGetNode(objects, key);
|
|
2788
2788
|
return node && node.value;
|
|
2789
2789
|
};
|
|
2790
|
-
var listSet = function(objects,
|
|
2791
|
-
var node = listGetNode(objects,
|
|
2790
|
+
var listSet = function(objects, key, value) {
|
|
2791
|
+
var node = listGetNode(objects, key);
|
|
2792
2792
|
if (node) {
|
|
2793
2793
|
node.value = value;
|
|
2794
2794
|
} else {
|
|
2795
2795
|
objects.next = /** @type {import('.').ListNode<typeof value>} */
|
|
2796
2796
|
{
|
|
2797
2797
|
// eslint-disable-line no-param-reassign, no-extra-parens
|
|
2798
|
-
key
|
|
2798
|
+
key,
|
|
2799
2799
|
next: objects.next,
|
|
2800
2800
|
value
|
|
2801
2801
|
};
|
|
2802
2802
|
}
|
|
2803
2803
|
};
|
|
2804
|
-
var listHas = function(objects,
|
|
2805
|
-
return !!listGetNode(objects,
|
|
2804
|
+
var listHas = function(objects, key) {
|
|
2805
|
+
return !!listGetNode(objects, key);
|
|
2806
2806
|
};
|
|
2807
2807
|
module.exports = function getSideChannel() {
|
|
2808
2808
|
var $wm;
|
|
2809
2809
|
var $m;
|
|
2810
2810
|
var $o;
|
|
2811
2811
|
var channel = {
|
|
2812
|
-
assert: function(
|
|
2813
|
-
if (!channel.has(
|
|
2814
|
-
throw new $TypeError("Side channel does not contain " + inspect(
|
|
2812
|
+
assert: function(key) {
|
|
2813
|
+
if (!channel.has(key)) {
|
|
2814
|
+
throw new $TypeError("Side channel does not contain " + inspect(key));
|
|
2815
2815
|
}
|
|
2816
2816
|
},
|
|
2817
|
-
get: function(
|
|
2818
|
-
if ($WeakMap &&
|
|
2817
|
+
get: function(key) {
|
|
2818
|
+
if ($WeakMap && key && (typeof key === "object" || typeof key === "function")) {
|
|
2819
2819
|
if ($wm) {
|
|
2820
|
-
return $weakMapGet($wm,
|
|
2820
|
+
return $weakMapGet($wm, key);
|
|
2821
2821
|
}
|
|
2822
2822
|
} else if ($Map) {
|
|
2823
2823
|
if ($m) {
|
|
2824
|
-
return $mapGet($m,
|
|
2824
|
+
return $mapGet($m, key);
|
|
2825
2825
|
}
|
|
2826
2826
|
} else {
|
|
2827
2827
|
if ($o) {
|
|
2828
|
-
return listGet($o,
|
|
2828
|
+
return listGet($o, key);
|
|
2829
2829
|
}
|
|
2830
2830
|
}
|
|
2831
2831
|
},
|
|
2832
|
-
has: function(
|
|
2833
|
-
if ($WeakMap &&
|
|
2832
|
+
has: function(key) {
|
|
2833
|
+
if ($WeakMap && key && (typeof key === "object" || typeof key === "function")) {
|
|
2834
2834
|
if ($wm) {
|
|
2835
|
-
return $weakMapHas($wm,
|
|
2835
|
+
return $weakMapHas($wm, key);
|
|
2836
2836
|
}
|
|
2837
2837
|
} else if ($Map) {
|
|
2838
2838
|
if ($m) {
|
|
2839
|
-
return $mapHas($m,
|
|
2839
|
+
return $mapHas($m, key);
|
|
2840
2840
|
}
|
|
2841
2841
|
} else {
|
|
2842
2842
|
if ($o) {
|
|
2843
|
-
return listHas($o,
|
|
2843
|
+
return listHas($o, key);
|
|
2844
2844
|
}
|
|
2845
2845
|
}
|
|
2846
2846
|
return false;
|
|
2847
2847
|
},
|
|
2848
|
-
set: function(
|
|
2849
|
-
if ($WeakMap &&
|
|
2848
|
+
set: function(key, value) {
|
|
2849
|
+
if ($WeakMap && key && (typeof key === "object" || typeof key === "function")) {
|
|
2850
2850
|
if (!$wm) {
|
|
2851
2851
|
$wm = new $WeakMap();
|
|
2852
2852
|
}
|
|
2853
|
-
$weakMapSet($wm,
|
|
2853
|
+
$weakMapSet($wm, key, value);
|
|
2854
2854
|
} else if ($Map) {
|
|
2855
2855
|
if (!$m) {
|
|
2856
2856
|
$m = new $Map();
|
|
2857
2857
|
}
|
|
2858
|
-
$mapSet($m,
|
|
2858
|
+
$mapSet($m, key, value);
|
|
2859
2859
|
} else {
|
|
2860
2860
|
if (!$o) {
|
|
2861
2861
|
$o = { key: {}, next: null };
|
|
2862
2862
|
}
|
|
2863
|
-
listSet($o,
|
|
2863
|
+
listSet($o, key, value);
|
|
2864
2864
|
}
|
|
2865
2865
|
}
|
|
2866
2866
|
};
|
|
@@ -3964,26 +3964,26 @@ var require_querystringify = __commonJS({
|
|
|
3964
3964
|
function querystring(query) {
|
|
3965
3965
|
var parser4 = /([^=?#&]+)=?([^&]*)/g, result = {}, part;
|
|
3966
3966
|
while (part = parser4.exec(query)) {
|
|
3967
|
-
var
|
|
3968
|
-
if (
|
|
3969
|
-
result[
|
|
3967
|
+
var key = decode(part[1]), value = decode(part[2]);
|
|
3968
|
+
if (key === null || value === null || key in result) continue;
|
|
3969
|
+
result[key] = value;
|
|
3970
3970
|
}
|
|
3971
3971
|
return result;
|
|
3972
3972
|
}
|
|
3973
3973
|
function querystringify(obj, prefix) {
|
|
3974
3974
|
prefix = prefix || "";
|
|
3975
|
-
var pairs = [], value,
|
|
3975
|
+
var pairs = [], value, key;
|
|
3976
3976
|
if ("string" !== typeof prefix) prefix = "?";
|
|
3977
|
-
for (
|
|
3978
|
-
if (has.call(obj,
|
|
3979
|
-
value = obj[
|
|
3977
|
+
for (key in obj) {
|
|
3978
|
+
if (has.call(obj, key)) {
|
|
3979
|
+
value = obj[key];
|
|
3980
3980
|
if (!value && (value === null || value === undef || isNaN(value))) {
|
|
3981
3981
|
value = "";
|
|
3982
3982
|
}
|
|
3983
|
-
|
|
3983
|
+
key = encode(key);
|
|
3984
3984
|
value = encode(value);
|
|
3985
|
-
if (
|
|
3986
|
-
pairs.push(
|
|
3985
|
+
if (key === null || value === null) continue;
|
|
3986
|
+
pairs.push(key + "=" + value);
|
|
3987
3987
|
}
|
|
3988
3988
|
}
|
|
3989
3989
|
return pairs.length ? prefix + pairs.join("&") : "";
|
|
@@ -4141,11 +4141,11 @@ var require_cjs = __commonJS({
|
|
|
4141
4141
|
return cloneUnlessOtherwiseSpecified(element, options);
|
|
4142
4142
|
});
|
|
4143
4143
|
}
|
|
4144
|
-
function getMergeFunction(
|
|
4144
|
+
function getMergeFunction(key, options) {
|
|
4145
4145
|
if (!options.customMerge) {
|
|
4146
4146
|
return deepmerge2;
|
|
4147
4147
|
}
|
|
4148
|
-
var customMerge = options.customMerge(
|
|
4148
|
+
var customMerge = options.customMerge(key);
|
|
4149
4149
|
return typeof customMerge === "function" ? customMerge : deepmerge2;
|
|
4150
4150
|
}
|
|
4151
4151
|
function getEnumerableOwnPropertySymbols(target) {
|
|
@@ -4163,24 +4163,24 @@ var require_cjs = __commonJS({
|
|
|
4163
4163
|
return false;
|
|
4164
4164
|
}
|
|
4165
4165
|
}
|
|
4166
|
-
function propertyIsUnsafe(target,
|
|
4167
|
-
return propertyIsOnObject(target,
|
|
4166
|
+
function propertyIsUnsafe(target, key) {
|
|
4167
|
+
return propertyIsOnObject(target, key) && !(Object.hasOwnProperty.call(target, key) && Object.propertyIsEnumerable.call(target, key));
|
|
4168
4168
|
}
|
|
4169
4169
|
function mergeObject(target, source, options) {
|
|
4170
4170
|
var destination = {};
|
|
4171
4171
|
if (options.isMergeableObject(target)) {
|
|
4172
|
-
getKeys(target).forEach(function(
|
|
4173
|
-
destination[
|
|
4172
|
+
getKeys(target).forEach(function(key) {
|
|
4173
|
+
destination[key] = cloneUnlessOtherwiseSpecified(target[key], options);
|
|
4174
4174
|
});
|
|
4175
4175
|
}
|
|
4176
|
-
getKeys(source).forEach(function(
|
|
4177
|
-
if (propertyIsUnsafe(target,
|
|
4176
|
+
getKeys(source).forEach(function(key) {
|
|
4177
|
+
if (propertyIsUnsafe(target, key)) {
|
|
4178
4178
|
return;
|
|
4179
4179
|
}
|
|
4180
|
-
if (propertyIsOnObject(target,
|
|
4181
|
-
destination[
|
|
4180
|
+
if (propertyIsOnObject(target, key) && options.isMergeableObject(source[key])) {
|
|
4181
|
+
destination[key] = getMergeFunction(key, options)(target[key], source[key], options);
|
|
4182
4182
|
} else {
|
|
4183
|
-
destination[
|
|
4183
|
+
destination[key] = cloneUnlessOtherwiseSpecified(source[key], options);
|
|
4184
4184
|
}
|
|
4185
4185
|
});
|
|
4186
4186
|
return destination;
|
|
@@ -4239,8 +4239,8 @@ var require_fast_deep_equal = __commonJS({
|
|
|
4239
4239
|
for (i = length; i-- !== 0; )
|
|
4240
4240
|
if (!Object.prototype.hasOwnProperty.call(b, keys2[i])) return false;
|
|
4241
4241
|
for (i = length; i-- !== 0; ) {
|
|
4242
|
-
var
|
|
4243
|
-
if (!equal(a[
|
|
4242
|
+
var key = keys2[i];
|
|
4243
|
+
if (!equal(a[key], b[key])) return false;
|
|
4244
4244
|
}
|
|
4245
4245
|
return true;
|
|
4246
4246
|
}
|
|
@@ -4311,10 +4311,10 @@ var require_object = __commonJS({
|
|
|
4311
4311
|
var keys2 = Object.keys(obj);
|
|
4312
4312
|
var res = {};
|
|
4313
4313
|
for (var i = 0; i < keys2.length; i++) {
|
|
4314
|
-
var
|
|
4315
|
-
var val = obj[
|
|
4316
|
-
if (!props || props.indexOf(
|
|
4317
|
-
res[
|
|
4314
|
+
var key = keys2[i];
|
|
4315
|
+
var val = obj[key];
|
|
4316
|
+
if (!props || props.indexOf(key) === -1 && (!isFunction3 || fn(val, key, obj))) {
|
|
4317
|
+
res[key] = val;
|
|
4318
4318
|
}
|
|
4319
4319
|
}
|
|
4320
4320
|
return res;
|
|
@@ -4341,9 +4341,9 @@ var require_object2 = __commonJS({
|
|
|
4341
4341
|
var len = keys2.length;
|
|
4342
4342
|
var idx = -1;
|
|
4343
4343
|
while (++idx < len) {
|
|
4344
|
-
var
|
|
4345
|
-
if (
|
|
4346
|
-
res[
|
|
4344
|
+
var key = keys2[idx];
|
|
4345
|
+
if (key in obj) {
|
|
4346
|
+
res[key] = obj[key];
|
|
4347
4347
|
}
|
|
4348
4348
|
}
|
|
4349
4349
|
return res;
|
|
@@ -6054,7 +6054,7 @@ import { memo } from "react";
|
|
|
6054
6054
|
import { jsx } from "react/jsx-runtime";
|
|
6055
6055
|
var Text = memo(({ children, ...props }) => {
|
|
6056
6056
|
const { getRootProps } = useRemirrorContext();
|
|
6057
|
-
const { key
|
|
6057
|
+
const { key, ...rootProps } = getRootProps();
|
|
6058
6058
|
const style = Object.assign(
|
|
6059
6059
|
{
|
|
6060
6060
|
position: "relative"
|
|
@@ -6146,7 +6146,7 @@ function buildHtmlStringFromAst(ast) {
|
|
|
6146
6146
|
if (ast.attrs) {
|
|
6147
6147
|
const filteredAttrs = Object.entries(ast.attrs).filter(([, value]) => value);
|
|
6148
6148
|
if (filteredAttrs.length) {
|
|
6149
|
-
attrs = `${filteredAttrs.map(([
|
|
6149
|
+
attrs = `${filteredAttrs.map(([key, value]) => `${key}="${value}"`).join(" ")}`;
|
|
6150
6150
|
}
|
|
6151
6151
|
}
|
|
6152
6152
|
if (ast.voidElement) {
|
|
@@ -6628,11 +6628,11 @@ import { Decoration, DecorationSet } from "@remirror/pm/view";
|
|
|
6628
6628
|
function createElement(tagName, attributes, ...children) {
|
|
6629
6629
|
const element = document.createElement(tagName);
|
|
6630
6630
|
if (attributes) {
|
|
6631
|
-
Object.entries(attributes).forEach(([
|
|
6631
|
+
Object.entries(attributes).forEach(([key, value]) => {
|
|
6632
6632
|
if (typeof value === "string") {
|
|
6633
|
-
element.setAttribute(
|
|
6633
|
+
element.setAttribute(key, value);
|
|
6634
6634
|
} else {
|
|
6635
|
-
element[
|
|
6635
|
+
element[key] = value;
|
|
6636
6636
|
}
|
|
6637
6637
|
});
|
|
6638
6638
|
}
|
|
@@ -20463,13 +20463,12 @@ function createParseDomRules() {
|
|
|
20463
20463
|
}
|
|
20464
20464
|
|
|
20465
20465
|
// src/editor/extensions/List/core/schema/to-dom.ts
|
|
20466
|
-
function listToDOM(
|
|
20467
|
-
|
|
20468
|
-
|
|
20469
|
-
|
|
20470
|
-
|
|
20471
|
-
|
|
20472
|
-
} = options;
|
|
20466
|
+
function listToDOM({
|
|
20467
|
+
node,
|
|
20468
|
+
nativeList = false,
|
|
20469
|
+
getMarkers = defaultMarkerGetter,
|
|
20470
|
+
getAttributes = defaultAttributesGetter
|
|
20471
|
+
}) {
|
|
20473
20472
|
const attrs = node.attrs;
|
|
20474
20473
|
const markerHidden = node.firstChild?.type === node.type;
|
|
20475
20474
|
const markers = markerHidden ? null : getMarkers(node);
|
|
@@ -20564,10 +20563,9 @@ function createListSpec() {
|
|
|
20564
20563
|
};
|
|
20565
20564
|
}
|
|
20566
20565
|
|
|
20567
|
-
// src/editor/extensions/List/core/utils/get-list-type
|
|
20568
|
-
|
|
20569
|
-
|
|
20570
|
-
let name = schema.cached[key];
|
|
20566
|
+
// src/editor/extensions/List/core/utils/get-list-type.ts
|
|
20567
|
+
function getListType(schema) {
|
|
20568
|
+
let name = schema.cached["PROSEMIRROR_FLAT_LIST_LIST_TYPE_NAME"];
|
|
20571
20569
|
if (!name) {
|
|
20572
20570
|
for (const type of Object.values(schema.nodes)) {
|
|
20573
20571
|
if ((type.spec.group || "").split(" ").includes(flatListGroup)) {
|
|
@@ -20580,15 +20578,14 @@ function getListTypeName(schema) {
|
|
|
20580
20578
|
"[prosemirror-flat-list] Unable to find a flat list type in the schema"
|
|
20581
20579
|
);
|
|
20582
20580
|
}
|
|
20583
|
-
schema.cached[
|
|
20584
|
-
return name;
|
|
20581
|
+
schema.cached["PROSEMIRROR_FLAT_LIST_LIST_TYPE_NAME"] = name;
|
|
20585
20582
|
}
|
|
20586
|
-
return name;
|
|
20583
|
+
return schema.nodes[name];
|
|
20587
20584
|
}
|
|
20588
20585
|
|
|
20589
20586
|
// src/editor/extensions/List/core/utils/is-list-type.ts
|
|
20590
20587
|
function isListType(type) {
|
|
20591
|
-
return
|
|
20588
|
+
return getListType(type.schema) === type;
|
|
20592
20589
|
}
|
|
20593
20590
|
|
|
20594
20591
|
// src/editor/extensions/List/core/utils/is-list-node.ts
|
|
@@ -20706,11 +20703,6 @@ function atEndBlockBoundary($pos, depth) {
|
|
|
20706
20703
|
return true;
|
|
20707
20704
|
}
|
|
20708
20705
|
|
|
20709
|
-
// src/editor/extensions/List/core/utils/get-list-type.ts
|
|
20710
|
-
function getListType(schema) {
|
|
20711
|
-
return schema.nodes[getListTypeName(schema)];
|
|
20712
|
-
}
|
|
20713
|
-
|
|
20714
20706
|
// src/editor/extensions/List/core/utils/list-range.ts
|
|
20715
20707
|
function findListsRange($from, $to = $from) {
|
|
20716
20708
|
if ($to.pos < $from.pos) {
|
|
@@ -21309,9 +21301,9 @@ function isCollapsedListNode(node) {
|
|
|
21309
21301
|
// src/editor/extensions/List/core/utils/set-node-attributes.ts
|
|
21310
21302
|
function setNodeAttributes(tr, pos, oldAttrs, newAttrs) {
|
|
21311
21303
|
let needUpdate = false;
|
|
21312
|
-
for (const
|
|
21313
|
-
if (newAttrs[
|
|
21314
|
-
tr.setNodeAttribute(pos,
|
|
21304
|
+
for (const key of Object.keys(newAttrs)) {
|
|
21305
|
+
if (newAttrs[key] !== oldAttrs[key]) {
|
|
21306
|
+
tr.setNodeAttribute(pos, key, newAttrs[key]);
|
|
21315
21307
|
needUpdate = true;
|
|
21316
21308
|
}
|
|
21317
21309
|
}
|
|
@@ -21956,8 +21948,8 @@ var macBaseKeymap = {
|
|
|
21956
21948
|
"Ctrl-a": selectTextblockStart,
|
|
21957
21949
|
"Ctrl-e": selectTextblockEnd
|
|
21958
21950
|
};
|
|
21959
|
-
for (let
|
|
21960
|
-
macBaseKeymap[
|
|
21951
|
+
for (let key in pcBaseKeymap)
|
|
21952
|
+
macBaseKeymap[key] = pcBaseKeymap[key];
|
|
21961
21953
|
var mac = typeof navigator != "undefined" ? /Mac|iP(hone|[oa]d)/.test(navigator.platform) : typeof os != "undefined" && os.platform ? os.platform() == "darwin" : false;
|
|
21962
21954
|
|
|
21963
21955
|
// src/editor/extensions/List/core/commands/enter-without-lift.ts
|
|
@@ -22030,9 +22022,7 @@ function splitAndIndentRange(range, tr, splitIndex) {
|
|
|
22030
22022
|
const getRange2To = mapPos(tr, $to.pos);
|
|
22031
22023
|
indentRange(range1, tr, void 0, true);
|
|
22032
22024
|
const range2 = tr.doc.resolve(getRange2From()).blockRange(tr.doc.resolve(getRange2To()));
|
|
22033
|
-
|
|
22034
|
-
indentRange(range2, tr, true, void 0);
|
|
22035
|
-
}
|
|
22025
|
+
range2 && indentRange(range2, tr, true, void 0);
|
|
22036
22026
|
return true;
|
|
22037
22027
|
}
|
|
22038
22028
|
function indentNodeRange(range, tr) {
|
|
@@ -22450,8 +22440,10 @@ function doMoveList(tr, direction, canDedent, dispatch) {
|
|
|
22450
22440
|
}
|
|
22451
22441
|
|
|
22452
22442
|
// src/editor/extensions/List/core/commands/toggle-collapsed.ts
|
|
22453
|
-
function createToggleCollapsedCommand(
|
|
22454
|
-
|
|
22443
|
+
function createToggleCollapsedCommand({
|
|
22444
|
+
collapsed = void 0,
|
|
22445
|
+
isToggleable = defaultIsToggleable
|
|
22446
|
+
} = {}) {
|
|
22455
22447
|
const toggleCollapsed = (state, dispatch) => {
|
|
22456
22448
|
const { $from } = state.selection;
|
|
22457
22449
|
for (let depth = $from.depth; depth >= 0; depth--) {
|
|
@@ -22717,15 +22709,15 @@ function wrappingListInputRule(regexp, getAttrs2) {
|
|
|
22717
22709
|
if (listNode && isListNode(listNode)) {
|
|
22718
22710
|
const oldAttrs = listNode.attrs;
|
|
22719
22711
|
const newAttrs2 = typeof getAttrs2 === "function" ? getAttrs2({ match, attributes: oldAttrs }) : getAttrs2;
|
|
22720
|
-
const entries = Object.entries(newAttrs2).filter(([
|
|
22721
|
-
return oldAttrs[
|
|
22712
|
+
const entries = Object.entries(newAttrs2).filter(([key, value]) => {
|
|
22713
|
+
return oldAttrs[key] !== value;
|
|
22722
22714
|
});
|
|
22723
22715
|
if (entries.length === 0) {
|
|
22724
22716
|
return null;
|
|
22725
22717
|
} else {
|
|
22726
22718
|
const pos = $pos.before(-1);
|
|
22727
|
-
for (const [
|
|
22728
|
-
tr.setNodeAttribute(pos,
|
|
22719
|
+
for (const [key, value] of entries) {
|
|
22720
|
+
tr.setNodeAttribute(pos, key, value);
|
|
22729
22721
|
}
|
|
22730
22722
|
return tr;
|
|
22731
22723
|
}
|
|
@@ -22887,8 +22879,7 @@ function createSafariInputMethodWorkaroundPlugin() {
|
|
|
22887
22879
|
}
|
|
22888
22880
|
|
|
22889
22881
|
// src/editor/extensions/List/core/plugins/index.ts
|
|
22890
|
-
function createListPlugins(
|
|
22891
|
-
const { schema } = options;
|
|
22882
|
+
function createListPlugins({ schema }) {
|
|
22892
22883
|
return [
|
|
22893
22884
|
createListEventPlugin(),
|
|
22894
22885
|
createListRenderingPlugin(),
|
|
@@ -22913,8 +22904,8 @@ var ListExtension = class extends NodeExtension7 {
|
|
|
22913
22904
|
}
|
|
22914
22905
|
createKeymap() {
|
|
22915
22906
|
const bindings = {};
|
|
22916
|
-
for (const [
|
|
22917
|
-
bindings[
|
|
22907
|
+
for (const [key, command5] of Object.entries(listKeymap)) {
|
|
22908
|
+
bindings[key] = convertCommand4(command5);
|
|
22918
22909
|
}
|
|
22919
22910
|
bindings["Tab"] = alwaysTrue(bindings["Mod-]"]);
|
|
22920
22911
|
bindings["Shift-Tab"] = alwaysTrue(bindings["Mod-["]);
|
|
@@ -23390,8 +23381,8 @@ var ShortcutManager = class _ShortcutManager {
|
|
|
23390
23381
|
}
|
|
23391
23382
|
return _ShortcutManager.instance;
|
|
23392
23383
|
}
|
|
23393
|
-
setShortcut(
|
|
23394
|
-
this.shortcuts[
|
|
23384
|
+
setShortcut(key, command5) {
|
|
23385
|
+
this.shortcuts[key] = command5;
|
|
23395
23386
|
}
|
|
23396
23387
|
setShortcuts(shortcuts) {
|
|
23397
23388
|
this.shortcuts = { ...this.shortcuts, ...shortcuts };
|
|
@@ -23424,8 +23415,8 @@ var ShortcutsExtension = class extends PlainExtension7 {
|
|
|
23424
23415
|
}
|
|
23425
23416
|
createExternalAPI() {
|
|
23426
23417
|
return {
|
|
23427
|
-
setShortcut: (
|
|
23428
|
-
ShortcutManager.getInstance().setShortcut(
|
|
23418
|
+
setShortcut: (key, command5) => {
|
|
23419
|
+
ShortcutManager.getInstance().setShortcut(key, command5);
|
|
23429
23420
|
},
|
|
23430
23421
|
setShortcuts: (shortcuts) => {
|
|
23431
23422
|
ShortcutManager.getInstance().setShortcuts(shortcuts);
|
|
@@ -23463,7 +23454,7 @@ ShortcutsExtension = __decorateClass([
|
|
|
23463
23454
|
], ShortcutsExtension);
|
|
23464
23455
|
|
|
23465
23456
|
// src/editor/extensions/SlashMenu/utils.ts
|
|
23466
|
-
var dispatchWithMeta = (view,
|
|
23457
|
+
var dispatchWithMeta = (view, key, meta) => view.dispatch(view.state.tr.setMeta(key, meta));
|
|
23467
23458
|
var defaultIgnoredKeys = [
|
|
23468
23459
|
"Unidentified",
|
|
23469
23460
|
"Alt",
|
|
@@ -25143,11 +25134,11 @@ var createSourceCodeDelegate = (options) => {
|
|
|
25143
25134
|
// src/editor/components/ErrorBoundary.tsx
|
|
25144
25135
|
import React2 from "react";
|
|
25145
25136
|
import styled6 from "styled-components";
|
|
25146
|
-
import { Fragment as
|
|
25137
|
+
import { Fragment as Fragment5, jsx as jsx12, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
25147
25138
|
var Title = styled6.h1`
|
|
25148
25139
|
color: ${({ theme }) => theme.dangerColor};
|
|
25149
25140
|
`;
|
|
25150
|
-
var DefaultFallback = (props) => /* @__PURE__ */ jsxs3(
|
|
25141
|
+
var DefaultFallback = (props) => /* @__PURE__ */ jsxs3(Fragment5, { children: [
|
|
25151
25142
|
/* @__PURE__ */ jsx12(Title, { children: "Sorry, something went wrong!" }),
|
|
25152
25143
|
/* @__PURE__ */ jsx12("p", { children: String(props.error) })
|
|
25153
25144
|
] });
|
|
@@ -25592,7 +25583,7 @@ var MenuItem = styled8.li.attrs((props) => ({
|
|
|
25592
25583
|
|
|
25593
25584
|
// src/editor/toolbar/SlashMenu/index.tsx
|
|
25594
25585
|
import styled9 from "styled-components";
|
|
25595
|
-
import { Fragment as
|
|
25586
|
+
import { Fragment as Fragment6, jsx as jsx16 } from "react/jsx-runtime";
|
|
25596
25587
|
var SlashMenu = () => {
|
|
25597
25588
|
const { view: editorView, getState, commands } = useRemirrorContext3({ autoUpdate: true });
|
|
25598
25589
|
if (!editorView) {
|
|
@@ -25667,7 +25658,7 @@ var SlashMenu = () => {
|
|
|
25667
25658
|
useEffect6(() => {
|
|
25668
25659
|
editorView.focus();
|
|
25669
25660
|
}, [menuState?.open]);
|
|
25670
|
-
return /* @__PURE__ */ jsx16(
|
|
25661
|
+
return /* @__PURE__ */ jsx16(Fragment6, { children: menuState.open ? /* @__PURE__ */ jsx16(
|
|
25671
25662
|
Container2,
|
|
25672
25663
|
{
|
|
25673
25664
|
ref: setPopperElement,
|
|
@@ -25755,7 +25746,7 @@ var ActiveCellMenu = (props) => {
|
|
|
25755
25746
|
}
|
|
25756
25747
|
setOpen(false);
|
|
25757
25748
|
};
|
|
25758
|
-
const { ref, key
|
|
25749
|
+
const { ref, key, x, y } = positioner;
|
|
25759
25750
|
return /* @__PURE__ */ jsxs7(
|
|
25760
25751
|
Container3,
|
|
25761
25752
|
{
|
|
@@ -25808,7 +25799,7 @@ var ActiveCellMenu = (props) => {
|
|
|
25808
25799
|
)
|
|
25809
25800
|
]
|
|
25810
25801
|
},
|
|
25811
|
-
|
|
25802
|
+
key
|
|
25812
25803
|
);
|
|
25813
25804
|
};
|
|
25814
25805
|
var ActiveCellMenu_default = ActiveCellMenu;
|
|
@@ -25825,7 +25816,7 @@ var Container4 = styled11.div`
|
|
|
25825
25816
|
function TableBar(props) {
|
|
25826
25817
|
const { positioner } = props;
|
|
25827
25818
|
const commands = useCommands2();
|
|
25828
|
-
const { ref, key
|
|
25819
|
+
const { ref, key, x, y } = positioner;
|
|
25829
25820
|
return /* @__PURE__ */ jsx18(
|
|
25830
25821
|
Container4,
|
|
25831
25822
|
{
|
|
@@ -25843,7 +25834,7 @@ function TableBar(props) {
|
|
|
25843
25834
|
},
|
|
25844
25835
|
children: /* @__PURE__ */ jsx18(Tooltip2, { title: "delete", children: /* @__PURE__ */ jsx18("i", { className: "ri-delete-bin-line" }) })
|
|
25845
25836
|
},
|
|
25846
|
-
|
|
25837
|
+
key
|
|
25847
25838
|
);
|
|
25848
25839
|
}
|
|
25849
25840
|
var TableBar_default = TableBar;
|
|
@@ -25931,7 +25922,7 @@ var activeCellColumnAndRowPositioner = Positioner.create({
|
|
|
25931
25922
|
});
|
|
25932
25923
|
|
|
25933
25924
|
// src/editor/toolbar/TableToolbar/index.tsx
|
|
25934
|
-
import { Fragment as
|
|
25925
|
+
import { Fragment as Fragment7, jsx as jsx19 } from "react/jsx-runtime";
|
|
25935
25926
|
var MultiPositionerIllustration = ({ positioner }) => {
|
|
25936
25927
|
const positioners = useMultiPositioner(positioner, []);
|
|
25937
25928
|
const { forceUpdatePositioners } = useCommands3();
|
|
@@ -25940,13 +25931,13 @@ var MultiPositionerIllustration = ({ positioner }) => {
|
|
|
25940
25931
|
}, [forceUpdatePositioners]);
|
|
25941
25932
|
if (positioners.length === 0) return null;
|
|
25942
25933
|
const positionersRender = [TableBar_default, ActiveCellMenu_default];
|
|
25943
|
-
return /* @__PURE__ */ jsx19(
|
|
25934
|
+
return /* @__PURE__ */ jsx19(Fragment7, { children: positioners.map((pos, i) => {
|
|
25944
25935
|
const Component = positionersRender[i];
|
|
25945
25936
|
return /* @__PURE__ */ jsx19(Component, { positioner: pos }, pos.key);
|
|
25946
25937
|
}) });
|
|
25947
25938
|
};
|
|
25948
25939
|
var TableToolbar = () => {
|
|
25949
|
-
return /* @__PURE__ */ jsx19(
|
|
25940
|
+
return /* @__PURE__ */ jsx19(Fragment7, { children: /* @__PURE__ */ jsx19(PositionerPortal, { children: /* @__PURE__ */ jsx19(MultiPositionerIllustration, { positioner: activeCellColumnAndRowPositioner }) }) });
|
|
25950
25941
|
};
|
|
25951
25942
|
var TableToolbar_default = TableToolbar;
|
|
25952
25943
|
|