@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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sveltejs/vite-plugin-svelte",
3
- "version": "1.0.7",
3
+ "version": "1.0.8",
4
4
  "license": "MIT",
5
5
  "author": "dominikg",
6
6
  "files": [
@@ -36,13 +36,16 @@
36
36
  y = event.y;
37
37
  }
38
38
 
39
- function find_selectable_parent(el) {
40
- do {
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
- } while (el);
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(event) {
93
- const el = find_selectable_parent(event.target);
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 (is_nav(event)) {
175
- const el = find_selectable_for_nav(event.key);
176
- if (el) {
177
- activate(el);
178
- stop(event);
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 = is_selectable(hov) ? hov : find_selectable_parent(hov);
225
+ let el = find_selectable_parent(hov, true);
221
226
  if (!el) {
222
227
  const act = document.activeElement;
223
- el = is_selectable(act) ? act : find_selectable_parent(act);
228
+ el = find_selectable_parent(act, true);
224
229
  }
225
230
  if (!el) {
226
231
  el = find_selectable_child(document.body);