@sveltejs/vite-plugin-svelte 1.0.7 → 1.0.8
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/package.json
CHANGED
|
@@ -36,13 +36,16 @@
|
|
|
36
36
|
y = event.y;
|
|
37
37
|
}
|
|
38
38
|
|
|
39
|
-
function find_selectable_parent(el) {
|
|
40
|
-
|
|
39
|
+
function find_selectable_parent(el, include_self = false) {
|
|
40
|
+
if (!include_self) {
|
|
41
41
|
el = el.parentNode;
|
|
42
|
+
}
|
|
43
|
+
while (el) {
|
|
42
44
|
if (is_selectable(el)) {
|
|
43
45
|
return el;
|
|
44
46
|
}
|
|
45
|
-
|
|
47
|
+
el = el.parentNode;
|
|
48
|
+
}
|
|
46
49
|
}
|
|
47
50
|
|
|
48
51
|
function find_selectable_child(el) {
|
|
@@ -89,8 +92,8 @@
|
|
|
89
92
|
return true;
|
|
90
93
|
}
|
|
91
94
|
|
|
92
|
-
function mouseover(
|
|
93
|
-
const el = find_selectable_parent(
|
|
95
|
+
function mouseover({ target }) {
|
|
96
|
+
const el = find_selectable_parent(target, true);
|
|
94
97
|
activate(el, false);
|
|
95
98
|
}
|
|
96
99
|
|
|
@@ -171,14 +174,16 @@
|
|
|
171
174
|
if (options.holdMode && enabled) {
|
|
172
175
|
enabled_ts = Date.now();
|
|
173
176
|
}
|
|
174
|
-
} else if (
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
177
|
+
} else if (enabled) {
|
|
178
|
+
if (is_nav(event)) {
|
|
179
|
+
const el = find_selectable_for_nav(event.key);
|
|
180
|
+
if (el) {
|
|
181
|
+
activate(el);
|
|
182
|
+
stop(event);
|
|
183
|
+
}
|
|
184
|
+
} else if (is_open(event)) {
|
|
185
|
+
open_editor(event);
|
|
179
186
|
}
|
|
180
|
-
} else if (is_open(event)) {
|
|
181
|
-
open_editor(event);
|
|
182
187
|
}
|
|
183
188
|
}
|
|
184
189
|
|
|
@@ -217,10 +222,10 @@
|
|
|
217
222
|
|
|
218
223
|
function activate_initial_el() {
|
|
219
224
|
const hov = innermost_hover_el();
|
|
220
|
-
let el =
|
|
225
|
+
let el = find_selectable_parent(hov, true);
|
|
221
226
|
if (!el) {
|
|
222
227
|
const act = document.activeElement;
|
|
223
|
-
el =
|
|
228
|
+
el = find_selectable_parent(act, true);
|
|
224
229
|
}
|
|
225
230
|
if (!el) {
|
|
226
231
|
el = find_selectable_child(document.body);
|