rme 0.1.21 → 0.1.22
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 +241 -238
- package/dist/index.mjs.map +4 -4
- package/package.json +7 -6
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 key2 of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key2) && key2 !== except)
|
|
14
|
+
__defProp(to, key2, { get: () => from[key2], enumerable: !(desc = __getOwnPropDesc(from, key2)) || 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, key2, kind) => {
|
|
27
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key2) : 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, key2, result) : decorator(result)) || result;
|
|
31
|
+
if (kind && result) __defProp(target, key2, 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, key2) {
|
|
1297
|
+
mapParts.push(inspect(key2, 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(key2) {
|
|
1412
|
+
return key2 in this;
|
|
1413
1413
|
};
|
|
1414
|
-
function has(obj,
|
|
1415
|
-
return hasOwn.call(obj,
|
|
1414
|
+
function has(obj, key2) {
|
|
1415
|
+
return hasOwn.call(obj, key2);
|
|
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 key2 in obj) {
|
|
1605
|
+
if (!has(obj, key2)) {
|
|
1606
1606
|
continue;
|
|
1607
1607
|
}
|
|
1608
|
-
if (isArr && String(Number(
|
|
1608
|
+
if (isArr && String(Number(key2)) === key2 && key2 < obj.length) {
|
|
1609
1609
|
continue;
|
|
1610
1610
|
}
|
|
1611
|
-
if (hasShammedSymbols && symMap["$" +
|
|
1611
|
+
if (hasShammedSymbols && symMap["$" + key2] instanceof Symbol) {
|
|
1612
1612
|
continue;
|
|
1613
|
-
} else if ($test.call(/[^\w$]/,
|
|
1614
|
-
xs.push(inspect(
|
|
1613
|
+
} else if ($test.call(/[^\w$]/, key2)) {
|
|
1614
|
+
xs.push(inspect(key2, obj) + ": " + inspect(obj[key2], obj));
|
|
1615
1615
|
} else {
|
|
1616
|
-
xs.push(
|
|
1616
|
+
xs.push(key2 + ": " + inspect(obj[key2], 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 key2 in Desc) {
|
|
2435
|
+
if (hasOwn(Desc, key2) && !allowed[key2]) {
|
|
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, key2, 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(key2)) {
|
|
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, key2, 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, key2) {
|
|
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 === key2) {
|
|
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, key2) {
|
|
2787
|
+
var node = listGetNode(objects, key2);
|
|
2788
2788
|
return node && node.value;
|
|
2789
2789
|
};
|
|
2790
|
-
var listSet = function(objects,
|
|
2791
|
-
var node = listGetNode(objects,
|
|
2790
|
+
var listSet = function(objects, key2, value) {
|
|
2791
|
+
var node = listGetNode(objects, key2);
|
|
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: key2,
|
|
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, key2) {
|
|
2805
|
+
return !!listGetNode(objects, key2);
|
|
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(key2) {
|
|
2813
|
+
if (!channel.has(key2)) {
|
|
2814
|
+
throw new $TypeError("Side channel does not contain " + inspect(key2));
|
|
2815
2815
|
}
|
|
2816
2816
|
},
|
|
2817
|
-
get: function(
|
|
2818
|
-
if ($WeakMap &&
|
|
2817
|
+
get: function(key2) {
|
|
2818
|
+
if ($WeakMap && key2 && (typeof key2 === "object" || typeof key2 === "function")) {
|
|
2819
2819
|
if ($wm) {
|
|
2820
|
-
return $weakMapGet($wm,
|
|
2820
|
+
return $weakMapGet($wm, key2);
|
|
2821
2821
|
}
|
|
2822
2822
|
} else if ($Map) {
|
|
2823
2823
|
if ($m) {
|
|
2824
|
-
return $mapGet($m,
|
|
2824
|
+
return $mapGet($m, key2);
|
|
2825
2825
|
}
|
|
2826
2826
|
} else {
|
|
2827
2827
|
if ($o) {
|
|
2828
|
-
return listGet($o,
|
|
2828
|
+
return listGet($o, key2);
|
|
2829
2829
|
}
|
|
2830
2830
|
}
|
|
2831
2831
|
},
|
|
2832
|
-
has: function(
|
|
2833
|
-
if ($WeakMap &&
|
|
2832
|
+
has: function(key2) {
|
|
2833
|
+
if ($WeakMap && key2 && (typeof key2 === "object" || typeof key2 === "function")) {
|
|
2834
2834
|
if ($wm) {
|
|
2835
|
-
return $weakMapHas($wm,
|
|
2835
|
+
return $weakMapHas($wm, key2);
|
|
2836
2836
|
}
|
|
2837
2837
|
} else if ($Map) {
|
|
2838
2838
|
if ($m) {
|
|
2839
|
-
return $mapHas($m,
|
|
2839
|
+
return $mapHas($m, key2);
|
|
2840
2840
|
}
|
|
2841
2841
|
} else {
|
|
2842
2842
|
if ($o) {
|
|
2843
|
-
return listHas($o,
|
|
2843
|
+
return listHas($o, key2);
|
|
2844
2844
|
}
|
|
2845
2845
|
}
|
|
2846
2846
|
return false;
|
|
2847
2847
|
},
|
|
2848
|
-
set: function(
|
|
2849
|
-
if ($WeakMap &&
|
|
2848
|
+
set: function(key2, value) {
|
|
2849
|
+
if ($WeakMap && key2 && (typeof key2 === "object" || typeof key2 === "function")) {
|
|
2850
2850
|
if (!$wm) {
|
|
2851
2851
|
$wm = new $WeakMap();
|
|
2852
2852
|
}
|
|
2853
|
-
$weakMapSet($wm,
|
|
2853
|
+
$weakMapSet($wm, key2, value);
|
|
2854
2854
|
} else if ($Map) {
|
|
2855
2855
|
if (!$m) {
|
|
2856
2856
|
$m = new $Map();
|
|
2857
2857
|
}
|
|
2858
|
-
$mapSet($m,
|
|
2858
|
+
$mapSet($m, key2, value);
|
|
2859
2859
|
} else {
|
|
2860
2860
|
if (!$o) {
|
|
2861
2861
|
$o = { key: {}, next: null };
|
|
2862
2862
|
}
|
|
2863
|
-
listSet($o,
|
|
2863
|
+
listSet($o, key2, 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 key2 = decode(part[1]), value = decode(part[2]);
|
|
3968
|
+
if (key2 === null || value === null || key2 in result) continue;
|
|
3969
|
+
result[key2] = 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, key2;
|
|
3976
3976
|
if ("string" !== typeof prefix) prefix = "?";
|
|
3977
|
-
for (
|
|
3978
|
-
if (has.call(obj,
|
|
3979
|
-
value = obj[
|
|
3977
|
+
for (key2 in obj) {
|
|
3978
|
+
if (has.call(obj, key2)) {
|
|
3979
|
+
value = obj[key2];
|
|
3980
3980
|
if (!value && (value === null || value === undef || isNaN(value))) {
|
|
3981
3981
|
value = "";
|
|
3982
3982
|
}
|
|
3983
|
-
|
|
3983
|
+
key2 = encode(key2);
|
|
3984
3984
|
value = encode(value);
|
|
3985
|
-
if (
|
|
3986
|
-
pairs.push(
|
|
3985
|
+
if (key2 === null || value === null) continue;
|
|
3986
|
+
pairs.push(key2 + "=" + 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(key2, options) {
|
|
4145
4145
|
if (!options.customMerge) {
|
|
4146
4146
|
return deepmerge2;
|
|
4147
4147
|
}
|
|
4148
|
-
var customMerge = options.customMerge(
|
|
4148
|
+
var customMerge = options.customMerge(key2);
|
|
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, key2) {
|
|
4167
|
+
return propertyIsOnObject(target, key2) && !(Object.hasOwnProperty.call(target, key2) && Object.propertyIsEnumerable.call(target, key2));
|
|
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(key2) {
|
|
4173
|
+
destination[key2] = cloneUnlessOtherwiseSpecified(target[key2], options);
|
|
4174
4174
|
});
|
|
4175
4175
|
}
|
|
4176
|
-
getKeys(source).forEach(function(
|
|
4177
|
-
if (propertyIsUnsafe(target,
|
|
4176
|
+
getKeys(source).forEach(function(key2) {
|
|
4177
|
+
if (propertyIsUnsafe(target, key2)) {
|
|
4178
4178
|
return;
|
|
4179
4179
|
}
|
|
4180
|
-
if (propertyIsOnObject(target,
|
|
4181
|
-
destination[
|
|
4180
|
+
if (propertyIsOnObject(target, key2) && options.isMergeableObject(source[key2])) {
|
|
4181
|
+
destination[key2] = getMergeFunction(key2, options)(target[key2], source[key2], options);
|
|
4182
4182
|
} else {
|
|
4183
|
-
destination[
|
|
4183
|
+
destination[key2] = cloneUnlessOtherwiseSpecified(source[key2], 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 key2 = keys2[i];
|
|
4243
|
+
if (!equal(a[key2], b[key2])) 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 key2 = keys2[i];
|
|
4315
|
+
var val = obj[key2];
|
|
4316
|
+
if (!props || props.indexOf(key2) === -1 && (!isFunction3 || fn(val, key2, obj))) {
|
|
4317
|
+
res[key2] = 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 key2 = keys2[idx];
|
|
4345
|
+
if (key2 in obj) {
|
|
4346
|
+
res[key2] = obj[key2];
|
|
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, ...rootProps } = getRootProps();
|
|
6057
|
+
const { key: key2, ...rootProps } = getRootProps();
|
|
6058
6058
|
const style = Object.assign(
|
|
6059
6059
|
{
|
|
6060
6060
|
position: "relative"
|
|
@@ -6091,7 +6091,6 @@ var rule = (state) => {
|
|
|
6091
6091
|
let edited = false;
|
|
6092
6092
|
const tokens = state.tokens;
|
|
6093
6093
|
const tokensLength = tokens.length;
|
|
6094
|
-
console.log("tokens", tokens);
|
|
6095
6094
|
for (let i = tokensLength - 3; i >= 0; i--) {
|
|
6096
6095
|
if (isBulletListItemToken(tokens[i]) && isParagraphOpenToken(tokens[i + 1]) && isInlineToken(tokens[i + 2])) {
|
|
6097
6096
|
const inlineToken = tokens[i + 2];
|
|
@@ -6146,7 +6145,7 @@ function buildHtmlStringFromAst(ast) {
|
|
|
6146
6145
|
if (ast.attrs) {
|
|
6147
6146
|
const filteredAttrs = Object.entries(ast.attrs).filter(([, value]) => value);
|
|
6148
6147
|
if (filteredAttrs.length) {
|
|
6149
|
-
attrs = `${filteredAttrs.map(([
|
|
6148
|
+
attrs = `${filteredAttrs.map(([key2, value]) => `${key2}="${value}"`).join(" ")}`;
|
|
6150
6149
|
}
|
|
6151
6150
|
}
|
|
6152
6151
|
if (ast.voidElement) {
|
|
@@ -6628,11 +6627,11 @@ import { Decoration, DecorationSet } from "@remirror/pm/view";
|
|
|
6628
6627
|
function createElement(tagName, attributes, ...children) {
|
|
6629
6628
|
const element = document.createElement(tagName);
|
|
6630
6629
|
if (attributes) {
|
|
6631
|
-
Object.entries(attributes).forEach(([
|
|
6630
|
+
Object.entries(attributes).forEach(([key2, value]) => {
|
|
6632
6631
|
if (typeof value === "string") {
|
|
6633
|
-
element.setAttribute(
|
|
6632
|
+
element.setAttribute(key2, value);
|
|
6634
6633
|
} else {
|
|
6635
|
-
element[
|
|
6634
|
+
element[key2] = value;
|
|
6636
6635
|
}
|
|
6637
6636
|
});
|
|
6638
6637
|
}
|
|
@@ -6866,33 +6865,109 @@ var LineTableExtension = class extends TableExtension {
|
|
|
6866
6865
|
super(...arguments);
|
|
6867
6866
|
this.createKeymap = () => {
|
|
6868
6867
|
const schema = this.store.schema;
|
|
6869
|
-
return
|
|
6870
|
-
|
|
6871
|
-
|
|
6872
|
-
|
|
6873
|
-
|
|
6874
|
-
|
|
6875
|
-
|
|
6876
|
-
|
|
6877
|
-
|
|
6878
|
-
|
|
6879
|
-
|
|
6880
|
-
|
|
6881
|
-
|
|
6882
|
-
|
|
6868
|
+
return {
|
|
6869
|
+
...buildBlockEnterKeymap(
|
|
6870
|
+
/^\|((?:[^\|]+\|){2,})\s*$/,
|
|
6871
|
+
({ match }) => {
|
|
6872
|
+
const texts = match[1].split("|").slice(0, -1).map((text) => {
|
|
6873
|
+
text = text.trim();
|
|
6874
|
+
if (!text) text = " ";
|
|
6875
|
+
return schema.text(text);
|
|
6876
|
+
});
|
|
6877
|
+
const cells1 = texts.map((text) => schema.nodes.tableCell.create(null, text));
|
|
6878
|
+
const cells2 = texts.map(() => schema.nodes.tableCell.create(null));
|
|
6879
|
+
const row1 = schema.nodes.tableRow.create(null, cells1);
|
|
6880
|
+
const row2 = schema.nodes.tableRow.create(null, cells2);
|
|
6881
|
+
const table = schema.nodes.table.create(null, [row1, row2]);
|
|
6882
|
+
return table;
|
|
6883
|
+
},
|
|
6884
|
+
({ tr }) => {
|
|
6885
|
+
const $cursor = tr.selection?.$cursor;
|
|
6886
|
+
if (!$cursor) {
|
|
6887
|
+
return tr;
|
|
6888
|
+
} else {
|
|
6889
|
+
const depth = $cursor.depth - 1;
|
|
6890
|
+
const pos = $cursor.posAtIndex($cursor.index(depth) - 1, depth);
|
|
6891
|
+
const $pos = tr.doc.resolve(pos);
|
|
6892
|
+
return tr.setSelection(TextSelection2.near($pos));
|
|
6893
|
+
}
|
|
6894
|
+
}
|
|
6895
|
+
),
|
|
6896
|
+
ArrowUp: ({ state, dispatch }) => {
|
|
6897
|
+
const { selection } = state;
|
|
6898
|
+
const { $head } = selection;
|
|
6899
|
+
const cell = findParentNodeOfType3({ selection: $head, types: "tableCell" });
|
|
6900
|
+
if (!cell) return false;
|
|
6901
|
+
const cellNode = cell.node;
|
|
6902
|
+
const cellContent = cellNode.content;
|
|
6903
|
+
const posInCell = $head.pos - cell.pos - 1;
|
|
6904
|
+
const nodePositions = getNodePositionByCellContent(cellContent);
|
|
6905
|
+
let isAtFirstLine = posInCell <= nodePositions[0].end;
|
|
6906
|
+
if (!isAtFirstLine) return false;
|
|
6907
|
+
const table = findTable(selection);
|
|
6908
|
+
if (!table) return false;
|
|
6909
|
+
const map = TableMap4.get(table.node);
|
|
6910
|
+
const cellPos = cell.pos;
|
|
6911
|
+
const cellIndex = cellPos - table.start;
|
|
6912
|
+
let cellRow = -1;
|
|
6913
|
+
let cellCol = -1;
|
|
6914
|
+
for (let row = 0; row < map.height; row++) {
|
|
6915
|
+
for (let col = 0; col < map.width; col++) {
|
|
6916
|
+
const index = row * map.width + col;
|
|
6917
|
+
if (map.map[index] === cellIndex) {
|
|
6918
|
+
cellRow = row;
|
|
6919
|
+
cellCol = col;
|
|
6920
|
+
break;
|
|
6921
|
+
}
|
|
6922
|
+
}
|
|
6923
|
+
if (cellRow !== -1) break;
|
|
6924
|
+
}
|
|
6925
|
+
if (cellRow === -1 || cellRow === 0) return false;
|
|
6926
|
+
const targetCellIndex = map.map[(cellRow - 1) * map.width + cellCol];
|
|
6927
|
+
if (targetCellIndex === void 0) return false;
|
|
6928
|
+
const targetPos = table.start + targetCellIndex;
|
|
6929
|
+
const tr = state.tr.setSelection(TextSelection2.near(state.doc.resolve(targetPos + 1)));
|
|
6930
|
+
if (dispatch) dispatch(tr);
|
|
6931
|
+
return true;
|
|
6883
6932
|
},
|
|
6884
|
-
({
|
|
6885
|
-
const
|
|
6886
|
-
|
|
6887
|
-
|
|
6888
|
-
|
|
6889
|
-
|
|
6890
|
-
|
|
6891
|
-
|
|
6892
|
-
|
|
6933
|
+
ArrowDown: ({ state, dispatch }) => {
|
|
6934
|
+
const { selection } = state;
|
|
6935
|
+
const { $head } = selection;
|
|
6936
|
+
const cell = findParentNodeOfType3({ selection: $head, types: "tableCell" });
|
|
6937
|
+
if (!cell) return false;
|
|
6938
|
+
const cellNode = cell.node;
|
|
6939
|
+
const cellContent = cellNode.content;
|
|
6940
|
+
const posInCell = $head.pos - cell.pos - 1;
|
|
6941
|
+
const nodePositions = getNodePositionByCellContent(cellContent);
|
|
6942
|
+
let isAtLastLine = posInCell >= nodePositions[nodePositions.length - 1].start;
|
|
6943
|
+
if (!isAtLastLine) return false;
|
|
6944
|
+
const table = findTable(selection);
|
|
6945
|
+
if (!table) return false;
|
|
6946
|
+
const map = TableMap4.get(table.node);
|
|
6947
|
+
const cellPos = cell.pos;
|
|
6948
|
+
const cellIndex = cellPos - table.start;
|
|
6949
|
+
let cellRow = -1;
|
|
6950
|
+
let cellCol = -1;
|
|
6951
|
+
for (let row = 0; row < map.height; row++) {
|
|
6952
|
+
for (let col = 0; col < map.width; col++) {
|
|
6953
|
+
const index = row * map.width + col;
|
|
6954
|
+
if (map.map[index] === cellIndex) {
|
|
6955
|
+
cellRow = row;
|
|
6956
|
+
cellCol = col;
|
|
6957
|
+
break;
|
|
6958
|
+
}
|
|
6959
|
+
}
|
|
6960
|
+
if (cellRow !== -1) break;
|
|
6893
6961
|
}
|
|
6962
|
+
if (cellRow === -1 || cellRow === map.height - 1) return false;
|
|
6963
|
+
const targetCellIndex = map.map[(cellRow + 1) * map.width + cellCol];
|
|
6964
|
+
if (targetCellIndex === void 0) return false;
|
|
6965
|
+
const targetPos = table.start + targetCellIndex;
|
|
6966
|
+
const tr = state.tr.setSelection(TextSelection2.near(state.doc.resolve(targetPos + 1)));
|
|
6967
|
+
if (dispatch) dispatch(tr);
|
|
6968
|
+
return true;
|
|
6894
6969
|
}
|
|
6895
|
-
|
|
6970
|
+
};
|
|
6896
6971
|
};
|
|
6897
6972
|
}
|
|
6898
6973
|
get name() {
|
|
@@ -7021,87 +7096,6 @@ var LineTableHeaderCellExtension = class extends TableHeaderCellExtension {
|
|
|
7021
7096
|
}
|
|
7022
7097
|
};
|
|
7023
7098
|
var LineTableCellExtension = class extends TableCellExtension {
|
|
7024
|
-
constructor() {
|
|
7025
|
-
super(...arguments);
|
|
7026
|
-
this.createKeymap = () => {
|
|
7027
|
-
return {
|
|
7028
|
-
ArrowUp: ({ state, dispatch }) => {
|
|
7029
|
-
const { selection } = state;
|
|
7030
|
-
const { $head } = selection;
|
|
7031
|
-
const cell = findParentNodeOfType3({ selection: $head, types: "tableCell" });
|
|
7032
|
-
if (!cell) return false;
|
|
7033
|
-
const cellNode = cell.node;
|
|
7034
|
-
const cellContent = cellNode.content;
|
|
7035
|
-
const posInCell = $head.pos - cell.pos - 1;
|
|
7036
|
-
const nodePositions = getNodePositionByCellContent(cellContent);
|
|
7037
|
-
let isAtFirstLine = posInCell <= nodePositions[0].end;
|
|
7038
|
-
if (!isAtFirstLine) return false;
|
|
7039
|
-
const table = findTable(selection);
|
|
7040
|
-
if (!table) return false;
|
|
7041
|
-
const map = TableMap4.get(table.node);
|
|
7042
|
-
const cellPos = cell.pos;
|
|
7043
|
-
const cellIndex = cellPos - table.start;
|
|
7044
|
-
let cellRow = -1;
|
|
7045
|
-
let cellCol = -1;
|
|
7046
|
-
for (let row = 0; row < map.height; row++) {
|
|
7047
|
-
for (let col = 0; col < map.width; col++) {
|
|
7048
|
-
const index = row * map.width + col;
|
|
7049
|
-
if (map.map[index] === cellIndex) {
|
|
7050
|
-
cellRow = row;
|
|
7051
|
-
cellCol = col;
|
|
7052
|
-
break;
|
|
7053
|
-
}
|
|
7054
|
-
}
|
|
7055
|
-
if (cellRow !== -1) break;
|
|
7056
|
-
}
|
|
7057
|
-
if (cellRow === -1 || cellRow === 0) return false;
|
|
7058
|
-
const targetCellIndex = map.map[(cellRow - 1) * map.width + cellCol];
|
|
7059
|
-
if (targetCellIndex === void 0) return false;
|
|
7060
|
-
const targetPos = table.start + targetCellIndex;
|
|
7061
|
-
const tr = state.tr.setSelection(TextSelection2.near(state.doc.resolve(targetPos + 1)));
|
|
7062
|
-
if (dispatch) dispatch(tr);
|
|
7063
|
-
return true;
|
|
7064
|
-
},
|
|
7065
|
-
ArrowDown: ({ state, dispatch }) => {
|
|
7066
|
-
const { selection } = state;
|
|
7067
|
-
const { $head } = selection;
|
|
7068
|
-
const cell = findParentNodeOfType3({ selection: $head, types: "tableCell" });
|
|
7069
|
-
if (!cell) return false;
|
|
7070
|
-
const cellNode = cell.node;
|
|
7071
|
-
const cellContent = cellNode.content;
|
|
7072
|
-
const posInCell = $head.pos - cell.pos - 1;
|
|
7073
|
-
const nodePositions = getNodePositionByCellContent(cellContent);
|
|
7074
|
-
let isAtLastLine = posInCell >= nodePositions[nodePositions.length - 1].start;
|
|
7075
|
-
if (!isAtLastLine) return false;
|
|
7076
|
-
const table = findTable(selection);
|
|
7077
|
-
if (!table) return false;
|
|
7078
|
-
const map = TableMap4.get(table.node);
|
|
7079
|
-
const cellPos = cell.pos;
|
|
7080
|
-
const cellIndex = cellPos - table.start;
|
|
7081
|
-
let cellRow = -1;
|
|
7082
|
-
let cellCol = -1;
|
|
7083
|
-
for (let row = 0; row < map.height; row++) {
|
|
7084
|
-
for (let col = 0; col < map.width; col++) {
|
|
7085
|
-
const index = row * map.width + col;
|
|
7086
|
-
if (map.map[index] === cellIndex) {
|
|
7087
|
-
cellRow = row;
|
|
7088
|
-
cellCol = col;
|
|
7089
|
-
break;
|
|
7090
|
-
}
|
|
7091
|
-
}
|
|
7092
|
-
if (cellRow !== -1) break;
|
|
7093
|
-
}
|
|
7094
|
-
if (cellRow === -1 || cellRow === map.height - 1) return false;
|
|
7095
|
-
const targetCellIndex = map.map[(cellRow + 1) * map.width + cellCol];
|
|
7096
|
-
if (targetCellIndex === void 0) return false;
|
|
7097
|
-
const targetPos = table.start + targetCellIndex;
|
|
7098
|
-
const tr = state.tr.setSelection(TextSelection2.near(state.doc.resolve(targetPos + 1)));
|
|
7099
|
-
if (dispatch) dispatch(tr);
|
|
7100
|
-
return true;
|
|
7101
|
-
}
|
|
7102
|
-
};
|
|
7103
|
-
};
|
|
7104
|
-
}
|
|
7105
7099
|
get name() {
|
|
7106
7100
|
return "tableCell";
|
|
7107
7101
|
}
|
|
@@ -20463,12 +20457,13 @@ function createParseDomRules() {
|
|
|
20463
20457
|
}
|
|
20464
20458
|
|
|
20465
20459
|
// src/editor/extensions/List/core/schema/to-dom.ts
|
|
20466
|
-
function listToDOM({
|
|
20467
|
-
|
|
20468
|
-
|
|
20469
|
-
|
|
20470
|
-
|
|
20471
|
-
|
|
20460
|
+
function listToDOM(options) {
|
|
20461
|
+
const {
|
|
20462
|
+
node,
|
|
20463
|
+
nativeList = false,
|
|
20464
|
+
getMarkers = defaultMarkerGetter,
|
|
20465
|
+
getAttributes = defaultAttributesGetter
|
|
20466
|
+
} = options;
|
|
20472
20467
|
const attrs = node.attrs;
|
|
20473
20468
|
const markerHidden = node.firstChild?.type === node.type;
|
|
20474
20469
|
const markers = markerHidden ? null : getMarkers(node);
|
|
@@ -20563,9 +20558,10 @@ function createListSpec() {
|
|
|
20563
20558
|
};
|
|
20564
20559
|
}
|
|
20565
20560
|
|
|
20566
|
-
// src/editor/extensions/List/core/utils/get-list-type.ts
|
|
20567
|
-
|
|
20568
|
-
|
|
20561
|
+
// src/editor/extensions/List/core/utils/get-list-type-name.ts
|
|
20562
|
+
var key = "PROSEMIRROR_FLAT_LIST_TYPE_NAME";
|
|
20563
|
+
function getListTypeName(schema) {
|
|
20564
|
+
let name = schema.cached[key];
|
|
20569
20565
|
if (!name) {
|
|
20570
20566
|
for (const type of Object.values(schema.nodes)) {
|
|
20571
20567
|
if ((type.spec.group || "").split(" ").includes(flatListGroup)) {
|
|
@@ -20578,14 +20574,15 @@ function getListType(schema) {
|
|
|
20578
20574
|
"[prosemirror-flat-list] Unable to find a flat list type in the schema"
|
|
20579
20575
|
);
|
|
20580
20576
|
}
|
|
20581
|
-
schema.cached[
|
|
20577
|
+
schema.cached[key] = name;
|
|
20578
|
+
return name;
|
|
20582
20579
|
}
|
|
20583
|
-
return
|
|
20580
|
+
return name;
|
|
20584
20581
|
}
|
|
20585
20582
|
|
|
20586
20583
|
// src/editor/extensions/List/core/utils/is-list-type.ts
|
|
20587
20584
|
function isListType(type) {
|
|
20588
|
-
return
|
|
20585
|
+
return getListTypeName(type.schema) === type.name;
|
|
20589
20586
|
}
|
|
20590
20587
|
|
|
20591
20588
|
// src/editor/extensions/List/core/utils/is-list-node.ts
|
|
@@ -20703,6 +20700,11 @@ function atEndBlockBoundary($pos, depth) {
|
|
|
20703
20700
|
return true;
|
|
20704
20701
|
}
|
|
20705
20702
|
|
|
20703
|
+
// src/editor/extensions/List/core/utils/get-list-type.ts
|
|
20704
|
+
function getListType(schema) {
|
|
20705
|
+
return schema.nodes[getListTypeName(schema)];
|
|
20706
|
+
}
|
|
20707
|
+
|
|
20706
20708
|
// src/editor/extensions/List/core/utils/list-range.ts
|
|
20707
20709
|
function findListsRange($from, $to = $from) {
|
|
20708
20710
|
if ($to.pos < $from.pos) {
|
|
@@ -21301,9 +21303,9 @@ function isCollapsedListNode(node) {
|
|
|
21301
21303
|
// src/editor/extensions/List/core/utils/set-node-attributes.ts
|
|
21302
21304
|
function setNodeAttributes(tr, pos, oldAttrs, newAttrs) {
|
|
21303
21305
|
let needUpdate = false;
|
|
21304
|
-
for (const
|
|
21305
|
-
if (newAttrs[
|
|
21306
|
-
tr.setNodeAttribute(pos,
|
|
21306
|
+
for (const key2 of Object.keys(newAttrs)) {
|
|
21307
|
+
if (newAttrs[key2] !== oldAttrs[key2]) {
|
|
21308
|
+
tr.setNodeAttribute(pos, key2, newAttrs[key2]);
|
|
21307
21309
|
needUpdate = true;
|
|
21308
21310
|
}
|
|
21309
21311
|
}
|
|
@@ -21948,8 +21950,8 @@ var macBaseKeymap = {
|
|
|
21948
21950
|
"Ctrl-a": selectTextblockStart,
|
|
21949
21951
|
"Ctrl-e": selectTextblockEnd
|
|
21950
21952
|
};
|
|
21951
|
-
for (let
|
|
21952
|
-
macBaseKeymap[
|
|
21953
|
+
for (let key2 in pcBaseKeymap)
|
|
21954
|
+
macBaseKeymap[key2] = pcBaseKeymap[key2];
|
|
21953
21955
|
var mac = typeof navigator != "undefined" ? /Mac|iP(hone|[oa]d)/.test(navigator.platform) : typeof os != "undefined" && os.platform ? os.platform() == "darwin" : false;
|
|
21954
21956
|
|
|
21955
21957
|
// src/editor/extensions/List/core/commands/enter-without-lift.ts
|
|
@@ -22022,7 +22024,9 @@ function splitAndIndentRange(range, tr, splitIndex) {
|
|
|
22022
22024
|
const getRange2To = mapPos(tr, $to.pos);
|
|
22023
22025
|
indentRange(range1, tr, void 0, true);
|
|
22024
22026
|
const range2 = tr.doc.resolve(getRange2From()).blockRange(tr.doc.resolve(getRange2To()));
|
|
22025
|
-
|
|
22027
|
+
if (range2) {
|
|
22028
|
+
indentRange(range2, tr, true, void 0);
|
|
22029
|
+
}
|
|
22026
22030
|
return true;
|
|
22027
22031
|
}
|
|
22028
22032
|
function indentNodeRange(range, tr) {
|
|
@@ -22440,10 +22444,8 @@ function doMoveList(tr, direction, canDedent, dispatch) {
|
|
|
22440
22444
|
}
|
|
22441
22445
|
|
|
22442
22446
|
// src/editor/extensions/List/core/commands/toggle-collapsed.ts
|
|
22443
|
-
function createToggleCollapsedCommand({
|
|
22444
|
-
collapsed = void 0,
|
|
22445
|
-
isToggleable = defaultIsToggleable
|
|
22446
|
-
} = {}) {
|
|
22447
|
+
function createToggleCollapsedCommand(options = {}) {
|
|
22448
|
+
const { collapsed = void 0, isToggleable = defaultIsToggleable } = options;
|
|
22447
22449
|
const toggleCollapsed = (state, dispatch) => {
|
|
22448
22450
|
const { $from } = state.selection;
|
|
22449
22451
|
for (let depth = $from.depth; depth >= 0; depth--) {
|
|
@@ -22709,15 +22711,15 @@ function wrappingListInputRule(regexp, getAttrs2) {
|
|
|
22709
22711
|
if (listNode && isListNode(listNode)) {
|
|
22710
22712
|
const oldAttrs = listNode.attrs;
|
|
22711
22713
|
const newAttrs2 = typeof getAttrs2 === "function" ? getAttrs2({ match, attributes: oldAttrs }) : getAttrs2;
|
|
22712
|
-
const entries = Object.entries(newAttrs2).filter(([
|
|
22713
|
-
return oldAttrs[
|
|
22714
|
+
const entries = Object.entries(newAttrs2).filter(([key2, value]) => {
|
|
22715
|
+
return oldAttrs[key2] !== value;
|
|
22714
22716
|
});
|
|
22715
22717
|
if (entries.length === 0) {
|
|
22716
22718
|
return null;
|
|
22717
22719
|
} else {
|
|
22718
22720
|
const pos = $pos.before(-1);
|
|
22719
|
-
for (const [
|
|
22720
|
-
tr.setNodeAttribute(pos,
|
|
22721
|
+
for (const [key2, value] of entries) {
|
|
22722
|
+
tr.setNodeAttribute(pos, key2, value);
|
|
22721
22723
|
}
|
|
22722
22724
|
return tr;
|
|
22723
22725
|
}
|
|
@@ -22879,7 +22881,8 @@ function createSafariInputMethodWorkaroundPlugin() {
|
|
|
22879
22881
|
}
|
|
22880
22882
|
|
|
22881
22883
|
// src/editor/extensions/List/core/plugins/index.ts
|
|
22882
|
-
function createListPlugins(
|
|
22884
|
+
function createListPlugins(options) {
|
|
22885
|
+
const { schema } = options;
|
|
22883
22886
|
return [
|
|
22884
22887
|
createListEventPlugin(),
|
|
22885
22888
|
createListRenderingPlugin(),
|
|
@@ -22904,8 +22907,8 @@ var ListExtension = class extends NodeExtension7 {
|
|
|
22904
22907
|
}
|
|
22905
22908
|
createKeymap() {
|
|
22906
22909
|
const bindings = {};
|
|
22907
|
-
for (const [
|
|
22908
|
-
bindings[
|
|
22910
|
+
for (const [key2, command5] of Object.entries(listKeymap)) {
|
|
22911
|
+
bindings[key2] = convertCommand4(command5);
|
|
22909
22912
|
}
|
|
22910
22913
|
bindings["Tab"] = alwaysTrue(bindings["Mod-]"]);
|
|
22911
22914
|
bindings["Shift-Tab"] = alwaysTrue(bindings["Mod-["]);
|
|
@@ -23381,8 +23384,8 @@ var ShortcutManager = class _ShortcutManager {
|
|
|
23381
23384
|
}
|
|
23382
23385
|
return _ShortcutManager.instance;
|
|
23383
23386
|
}
|
|
23384
|
-
setShortcut(
|
|
23385
|
-
this.shortcuts[
|
|
23387
|
+
setShortcut(key2, command5) {
|
|
23388
|
+
this.shortcuts[key2] = command5;
|
|
23386
23389
|
}
|
|
23387
23390
|
setShortcuts(shortcuts) {
|
|
23388
23391
|
this.shortcuts = { ...this.shortcuts, ...shortcuts };
|
|
@@ -23415,8 +23418,8 @@ var ShortcutsExtension = class extends PlainExtension7 {
|
|
|
23415
23418
|
}
|
|
23416
23419
|
createExternalAPI() {
|
|
23417
23420
|
return {
|
|
23418
|
-
setShortcut: (
|
|
23419
|
-
ShortcutManager.getInstance().setShortcut(
|
|
23421
|
+
setShortcut: (key2, command5) => {
|
|
23422
|
+
ShortcutManager.getInstance().setShortcut(key2, command5);
|
|
23420
23423
|
},
|
|
23421
23424
|
setShortcuts: (shortcuts) => {
|
|
23422
23425
|
ShortcutManager.getInstance().setShortcuts(shortcuts);
|
|
@@ -23454,7 +23457,7 @@ ShortcutsExtension = __decorateClass([
|
|
|
23454
23457
|
], ShortcutsExtension);
|
|
23455
23458
|
|
|
23456
23459
|
// src/editor/extensions/SlashMenu/utils.ts
|
|
23457
|
-
var dispatchWithMeta = (view,
|
|
23460
|
+
var dispatchWithMeta = (view, key2, meta) => view.dispatch(view.state.tr.setMeta(key2, meta));
|
|
23458
23461
|
var defaultIgnoredKeys = [
|
|
23459
23462
|
"Unidentified",
|
|
23460
23463
|
"Alt",
|
|
@@ -25134,11 +25137,11 @@ var createSourceCodeDelegate = (options) => {
|
|
|
25134
25137
|
// src/editor/components/ErrorBoundary.tsx
|
|
25135
25138
|
import React2 from "react";
|
|
25136
25139
|
import styled6 from "styled-components";
|
|
25137
|
-
import { Fragment as
|
|
25140
|
+
import { Fragment as Fragment4, jsx as jsx12, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
25138
25141
|
var Title = styled6.h1`
|
|
25139
25142
|
color: ${({ theme }) => theme.dangerColor};
|
|
25140
25143
|
`;
|
|
25141
|
-
var DefaultFallback = (props) => /* @__PURE__ */ jsxs3(
|
|
25144
|
+
var DefaultFallback = (props) => /* @__PURE__ */ jsxs3(Fragment4, { children: [
|
|
25142
25145
|
/* @__PURE__ */ jsx12(Title, { children: "Sorry, something went wrong!" }),
|
|
25143
25146
|
/* @__PURE__ */ jsx12("p", { children: String(props.error) })
|
|
25144
25147
|
] });
|
|
@@ -25583,7 +25586,7 @@ var MenuItem = styled8.li.attrs((props) => ({
|
|
|
25583
25586
|
|
|
25584
25587
|
// src/editor/toolbar/SlashMenu/index.tsx
|
|
25585
25588
|
import styled9 from "styled-components";
|
|
25586
|
-
import { Fragment as
|
|
25589
|
+
import { Fragment as Fragment5, jsx as jsx16 } from "react/jsx-runtime";
|
|
25587
25590
|
var SlashMenu = () => {
|
|
25588
25591
|
const { view: editorView, getState, commands } = useRemirrorContext3({ autoUpdate: true });
|
|
25589
25592
|
if (!editorView) {
|
|
@@ -25658,7 +25661,7 @@ var SlashMenu = () => {
|
|
|
25658
25661
|
useEffect6(() => {
|
|
25659
25662
|
editorView.focus();
|
|
25660
25663
|
}, [menuState?.open]);
|
|
25661
|
-
return /* @__PURE__ */ jsx16(
|
|
25664
|
+
return /* @__PURE__ */ jsx16(Fragment5, { children: menuState.open ? /* @__PURE__ */ jsx16(
|
|
25662
25665
|
Container2,
|
|
25663
25666
|
{
|
|
25664
25667
|
ref: setPopperElement,
|
|
@@ -25746,7 +25749,7 @@ var ActiveCellMenu = (props) => {
|
|
|
25746
25749
|
}
|
|
25747
25750
|
setOpen(false);
|
|
25748
25751
|
};
|
|
25749
|
-
const { ref, key, x, y } = positioner;
|
|
25752
|
+
const { ref, key: key2, x, y } = positioner;
|
|
25750
25753
|
return /* @__PURE__ */ jsxs7(
|
|
25751
25754
|
Container3,
|
|
25752
25755
|
{
|
|
@@ -25799,7 +25802,7 @@ var ActiveCellMenu = (props) => {
|
|
|
25799
25802
|
)
|
|
25800
25803
|
]
|
|
25801
25804
|
},
|
|
25802
|
-
|
|
25805
|
+
key2
|
|
25803
25806
|
);
|
|
25804
25807
|
};
|
|
25805
25808
|
var ActiveCellMenu_default = ActiveCellMenu;
|
|
@@ -25816,7 +25819,7 @@ var Container4 = styled11.div`
|
|
|
25816
25819
|
function TableBar(props) {
|
|
25817
25820
|
const { positioner } = props;
|
|
25818
25821
|
const commands = useCommands2();
|
|
25819
|
-
const { ref, key, x, y } = positioner;
|
|
25822
|
+
const { ref, key: key2, x, y } = positioner;
|
|
25820
25823
|
return /* @__PURE__ */ jsx18(
|
|
25821
25824
|
Container4,
|
|
25822
25825
|
{
|
|
@@ -25834,7 +25837,7 @@ function TableBar(props) {
|
|
|
25834
25837
|
},
|
|
25835
25838
|
children: /* @__PURE__ */ jsx18(Tooltip2, { title: "delete", children: /* @__PURE__ */ jsx18("i", { className: "ri-delete-bin-line" }) })
|
|
25836
25839
|
},
|
|
25837
|
-
|
|
25840
|
+
key2
|
|
25838
25841
|
);
|
|
25839
25842
|
}
|
|
25840
25843
|
var TableBar_default = TableBar;
|
|
@@ -25922,7 +25925,7 @@ var activeCellColumnAndRowPositioner = Positioner.create({
|
|
|
25922
25925
|
});
|
|
25923
25926
|
|
|
25924
25927
|
// src/editor/toolbar/TableToolbar/index.tsx
|
|
25925
|
-
import { Fragment as
|
|
25928
|
+
import { Fragment as Fragment6, jsx as jsx19 } from "react/jsx-runtime";
|
|
25926
25929
|
var MultiPositionerIllustration = ({ positioner }) => {
|
|
25927
25930
|
const positioners = useMultiPositioner(positioner, []);
|
|
25928
25931
|
const { forceUpdatePositioners } = useCommands3();
|
|
@@ -25931,13 +25934,13 @@ var MultiPositionerIllustration = ({ positioner }) => {
|
|
|
25931
25934
|
}, [forceUpdatePositioners]);
|
|
25932
25935
|
if (positioners.length === 0) return null;
|
|
25933
25936
|
const positionersRender = [TableBar_default, ActiveCellMenu_default];
|
|
25934
|
-
return /* @__PURE__ */ jsx19(
|
|
25937
|
+
return /* @__PURE__ */ jsx19(Fragment6, { children: positioners.map((pos, i) => {
|
|
25935
25938
|
const Component = positionersRender[i];
|
|
25936
25939
|
return /* @__PURE__ */ jsx19(Component, { positioner: pos }, pos.key);
|
|
25937
25940
|
}) });
|
|
25938
25941
|
};
|
|
25939
25942
|
var TableToolbar = () => {
|
|
25940
|
-
return /* @__PURE__ */ jsx19(
|
|
25943
|
+
return /* @__PURE__ */ jsx19(Fragment6, { children: /* @__PURE__ */ jsx19(PositionerPortal, { children: /* @__PURE__ */ jsx19(MultiPositionerIllustration, { positioner: activeCellColumnAndRowPositioner }) }) });
|
|
25941
25944
|
};
|
|
25942
25945
|
var TableToolbar_default = TableToolbar;
|
|
25943
25946
|
|