slate-vue3 0.7.0 → 0.7.1
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/core.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a6, a7, a8, d, e, f, a, h, aj, c, i, j, k, ap, ak, l, m, o, p, q, g, b, r, t, u, v, w, x, aq, y, a9, z, A, B, C, D, E, F, G, H, I, J, aa, K, ab, al, ac, L, M, N, O, n, P, S, Q, R, V, T, U, W, X, _, Y, Z, $, ad, am, ae, a0, an, ao, a5, s, af, a1, a2, a3, ag, ah, a4, ai } from "./create-editor-
|
|
1
|
+
import { a6, a7, a8, d, e, f, a, h, aj, c, i, j, k, ap, ak, l, m, o, p, q, g, b, r, t, u, v, w, x, aq, y, a9, z, A, B, C, D, E, F, G, H, I, J, aa, K, ab, al, ac, L, M, N, O, n, P, S, Q, R, V, T, U, W, X, _, Y, Z, $, ad, am, ae, a0, an, ao, a5, s, af, a1, a2, a3, ag, ah, a4, ai } from "./create-editor-BQTV3YKB.js";
|
|
2
2
|
import { E as E2, a as a10, N as N2, O as O2, P as P2, b as b2, R as R2, S as S2, T as T2, c as c2, i as i2, d as d2 } from "./batch-dirty-paths-DTifjYae.js";
|
|
3
3
|
import { L as L2, S as S3 } from "./location-V9fJlEiJ.js";
|
|
4
4
|
export {
|
|
@@ -851,8 +851,7 @@ function* nodes(editor, options = {}) {
|
|
|
851
851
|
universal = false,
|
|
852
852
|
reverse = false,
|
|
853
853
|
voids = false,
|
|
854
|
-
pass
|
|
855
|
-
ignoreNonSelectable = false
|
|
854
|
+
pass
|
|
856
855
|
} = options;
|
|
857
856
|
let { match } = options;
|
|
858
857
|
if (!match) {
|
|
@@ -881,16 +880,12 @@ function* nodes(editor, options = {}) {
|
|
|
881
880
|
if (!Element.isElement(node2)) return false;
|
|
882
881
|
if (!voids && (Editor.isVoid(editor, node2) || Editor.isElementReadOnly(editor, node2)))
|
|
883
882
|
return true;
|
|
884
|
-
if (ignoreNonSelectable && !Editor.isSelectable(editor, node2)) return true;
|
|
885
883
|
return false;
|
|
886
884
|
}
|
|
887
885
|
});
|
|
888
886
|
const matches = [];
|
|
889
887
|
let hit;
|
|
890
888
|
for (const [node2, path2] of nodeEntries) {
|
|
891
|
-
if (ignoreNonSelectable && Element.isElement(node2) && !Editor.isSelectable(editor, node2)) {
|
|
892
|
-
continue;
|
|
893
|
-
}
|
|
894
889
|
const isLower = hit && Path.compare(path2, hit[1]) === 0;
|
|
895
890
|
if (mode === "highest" && isLower) {
|
|
896
891
|
continue;
|
|
@@ -1099,8 +1094,7 @@ function* positions(editor, options = {}) {
|
|
|
1099
1094
|
at = editor.selection,
|
|
1100
1095
|
unit = "offset",
|
|
1101
1096
|
reverse = false,
|
|
1102
|
-
voids = false
|
|
1103
|
-
ignoreNonSelectable = false
|
|
1097
|
+
voids = false
|
|
1104
1098
|
} = options;
|
|
1105
1099
|
if (!at) {
|
|
1106
1100
|
return;
|
|
@@ -1116,10 +1110,18 @@ function* positions(editor, options = {}) {
|
|
|
1116
1110
|
for (const [node2, path2] of Editor.nodes(editor, {
|
|
1117
1111
|
at,
|
|
1118
1112
|
reverse,
|
|
1119
|
-
voids
|
|
1120
|
-
ignoreNonSelectable
|
|
1113
|
+
voids
|
|
1121
1114
|
})) {
|
|
1122
1115
|
if (Element.isElement(node2)) {
|
|
1116
|
+
if (!editor.isSelectable(node2)) {
|
|
1117
|
+
if (reverse) {
|
|
1118
|
+
yield Editor.end(editor, Path.previous(path2));
|
|
1119
|
+
continue;
|
|
1120
|
+
} else {
|
|
1121
|
+
yield Editor.start(editor, Path.next(path2));
|
|
1122
|
+
continue;
|
|
1123
|
+
}
|
|
1124
|
+
}
|
|
1123
1125
|
if (!voids && (editor.isVoid(node2) || editor.isElementReadOnly(node2))) {
|
|
1124
1126
|
yield Editor.start(editor, path2);
|
|
1125
1127
|
continue;
|
|
@@ -1461,7 +1463,9 @@ const deleteText = (editor, options = {}) => {
|
|
|
1461
1463
|
voids
|
|
1462
1464
|
});
|
|
1463
1465
|
}
|
|
1464
|
-
if (isCollapsed && reverse && unit === "character" && removedText.length > 1 && removedText.match(
|
|
1466
|
+
if (isCollapsed && reverse && unit === "character" && removedText.length > 1 && removedText.match(
|
|
1467
|
+
/[\u0980-\u09FF\u0E00-\u0E7F\u1000-\u109F\u0900-\u097F\u1780-\u17FF\u0D00-\u0D7F\u0B00-\u0B7F\u0A00-\u0A7F\u0B80-\u0BFF\u0C00-\u0C7F]+/
|
|
1468
|
+
)) {
|
|
1465
1469
|
Transforms.insertText(
|
|
1466
1470
|
editor,
|
|
1467
1471
|
removedText.slice(0, removedText.length - distance)
|
|
@@ -1682,7 +1686,7 @@ const move = (editor, options = {}) => {
|
|
|
1682
1686
|
edge = Range.isBackward(selection) ? "anchor" : "focus";
|
|
1683
1687
|
}
|
|
1684
1688
|
const { anchor, focus } = selection;
|
|
1685
|
-
const opts = { distance, unit
|
|
1689
|
+
const opts = { distance, unit };
|
|
1686
1690
|
const props = {};
|
|
1687
1691
|
if (edge == null || edge === "anchor") {
|
|
1688
1692
|
const point2 = reverse ? Editor.before(editor, anchor, opts) : Editor.after(editor, anchor, opts);
|
package/dist/hyperscript.js
CHANGED
|
@@ -2,7 +2,7 @@ var __defProp = Object.defineProperty;
|
|
|
2
2
|
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
3
3
|
var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
4
4
|
import { t as toRawWeakMap, R as Range, N as Node, T as Text, a as Element, d as isObject } from "./batch-dirty-paths-DTifjYae.js";
|
|
5
|
-
import { c as createEditor$1 } from "./create-editor-
|
|
5
|
+
import { c as createEditor$1 } from "./create-editor-BQTV3YKB.js";
|
|
6
6
|
import "vue";
|
|
7
7
|
const ANCHOR = new toRawWeakMap();
|
|
8
8
|
const FOCUS = new toRawWeakMap();
|
|
@@ -177,7 +177,6 @@ export interface EditorNodesOptions<T extends Node> {
|
|
|
177
177
|
reverse?: boolean;
|
|
178
178
|
voids?: boolean;
|
|
179
179
|
pass?: (entry: NodeEntry) => boolean;
|
|
180
|
-
ignoreNonSelectable?: boolean;
|
|
181
180
|
}
|
|
182
181
|
export interface EditorNormalizeOptions {
|
|
183
182
|
force?: boolean;
|
|
@@ -205,7 +204,6 @@ export interface EditorPositionsOptions {
|
|
|
205
204
|
unit?: TextUnitAdjustment;
|
|
206
205
|
reverse?: boolean;
|
|
207
206
|
voids?: boolean;
|
|
208
|
-
ignoreNonSelectable?: boolean;
|
|
209
207
|
}
|
|
210
208
|
export interface EditorPreviousOptions<T extends Node> {
|
|
211
209
|
at?: Location;
|