@aevantec/litevue 0.6.0 → 0.6.2
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/LICENSE +2 -1
- package/dist/litevue-devtools.iife.js +1 -1
- package/dist/litevue-devtools.mjs +1 -1
- package/dist/litevue-devtools.umd.js +1 -1
- package/dist/litevue-plugins.dev.iife.js +120 -81
- package/dist/litevue-plugins.dev.mjs +120 -80
- package/dist/litevue-plugins.iife.js +1 -1
- package/dist/litevue-plugins.mjs +1 -1
- package/dist/litevue-plugins.umd.js +1 -1
- package/dist/litevue.dev.iife.js +132 -48
- package/dist/litevue.dev.mjs +132 -47
- package/dist/litevue.iife.js +1 -1
- package/dist/litevue.mjs +1 -1
- package/dist/litevue.umd.js +1 -1
- package/dist/plugins/collapse.iife.js +1 -1
- package/dist/plugins/collapse.mjs +1 -1
- package/dist/plugins/collapse.umd.js +1 -1
- package/dist/plugins/focus.iife.js +1 -1
- package/dist/plugins/focus.mjs +1 -1
- package/dist/plugins/focus.umd.js +1 -1
- package/dist/plugins/intersect.iife.js +1 -1
- package/dist/plugins/intersect.umd.js +1 -1
- package/dist/plugins/mask.iife.js +1 -1
- package/dist/plugins/mask.mjs +1 -1
- package/dist/plugins/mask.umd.js +1 -1
- package/dist/plugins/media.dev.iife.js +3 -4
- package/dist/plugins/media.dev.mjs +3 -3
- package/dist/plugins/media.iife.js +1 -1
- package/dist/plugins/media.mjs +1 -1
- package/dist/plugins/media.umd.js +1 -1
- package/dist/plugins/morph.dev.iife.js +58 -19
- package/dist/plugins/morph.dev.mjs +58 -18
- package/dist/plugins/morph.iife.js +1 -1
- package/dist/plugins/morph.mjs +1 -1
- package/dist/plugins/morph.umd.js +1 -1
- package/dist/plugins/navigate.dev.iife.js +49 -36
- package/dist/plugins/navigate.dev.mjs +49 -35
- package/dist/plugins/navigate.iife.js +1 -1
- package/dist/plugins/navigate.mjs +1 -1
- package/dist/plugins/navigate.umd.js +1 -1
- package/dist/plugins/persist.dev.iife.js +8 -11
- package/dist/plugins/persist.dev.mjs +8 -10
- package/dist/plugins/persist.iife.js +1 -1
- package/dist/plugins/persist.mjs +1 -1
- package/dist/plugins/persist.umd.js +1 -1
- package/dist/plugins/popover.iife.js +1 -1
- package/dist/plugins/popover.mjs +1 -1
- package/dist/plugins/popover.umd.js +1 -1
- package/dist/plugins/resize.iife.js +1 -1
- package/dist/plugins/resize.umd.js +1 -1
- package/dist/plugins/transition.iife.js +1 -1
- package/dist/plugins/transition.mjs +1 -1
- package/dist/plugins/transition.umd.js +1 -1
- package/dist/types/app.d.mts +3 -1
- package/dist/types/app.d.ts +3 -1
- package/dist/types/context.d.mts +1 -1
- package/dist/types/context.d.ts +1 -1
- package/dist/types/devtools-panel/chrome.d.mts +6 -5
- package/dist/types/devtools-panel/chrome.d.ts +6 -5
- package/dist/types/devtools-panel/menu.d.mts +12 -0
- package/dist/types/devtools-panel/menu.d.ts +12 -0
- package/dist/types/devtools-panel/styles.d.mts +5 -2
- package/dist/types/devtools-panel/styles.d.ts +5 -2
- package/dist/types/devtools-panel/values.d.mts +17 -5
- package/dist/types/devtools-panel/values.d.ts +17 -5
- package/dist/types/directives/show.d.mts +1 -0
- package/dist/types/directives/show.d.ts +1 -0
- package/dist/types/errors.d.mts +1 -1
- package/dist/types/errors.d.ts +1 -1
- package/dist/types/plugins/focus/index.d.mts +1 -1
- package/dist/types/plugins/focus/index.d.ts +1 -1
- package/dist/types/plugins/morph/index.d.mts +6 -0
- package/dist/types/plugins/morph/index.d.ts +6 -0
- package/dist/types/store.d.mts +5 -1
- package/dist/types/store.d.ts +5 -1
- package/package.json +3 -3
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
var LiteVuePlugins = (function(exports, _aevantec_litevue) {
|
|
2
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
2
|
// src/plugins/intersect/index.ts
|
|
4
3
|
/**
|
|
5
4
|
* v-intersect="expression" — evaluates the expression when the element
|
|
@@ -34,7 +33,7 @@ var LiteVuePlugins = (function(exports, _aevantec_litevue) {
|
|
|
34
33
|
a: /[a-zA-Z]/,
|
|
35
34
|
"*": /[a-zA-Z0-9]/
|
|
36
35
|
};
|
|
37
|
-
var format = (value, mask) => {
|
|
36
|
+
var format = (value, mask, end) => {
|
|
38
37
|
let out = "";
|
|
39
38
|
let literals = "";
|
|
40
39
|
let vi = 0;
|
|
@@ -42,7 +41,7 @@ var LiteVuePlugins = (function(exports, _aevantec_litevue) {
|
|
|
42
41
|
const re = tokens[mask[mi]];
|
|
43
42
|
if (re) {
|
|
44
43
|
while (vi < value.length && !re.test(value[vi])) vi++;
|
|
45
|
-
if (vi >= value.length)
|
|
44
|
+
if (vi >= value.length) return out;
|
|
46
45
|
out += literals + value[vi++];
|
|
47
46
|
literals = "";
|
|
48
47
|
} else {
|
|
@@ -50,7 +49,7 @@ var LiteVuePlugins = (function(exports, _aevantec_litevue) {
|
|
|
50
49
|
if (value[vi] === mask[mi]) vi++;
|
|
51
50
|
}
|
|
52
51
|
}
|
|
53
|
-
return out;
|
|
52
|
+
return end ? out + literals : out;
|
|
54
53
|
};
|
|
55
54
|
/**
|
|
56
55
|
* v-mask="(999) 999-9999" — formats the input's value as the user types.
|
|
@@ -61,23 +60,27 @@ var LiteVuePlugins = (function(exports, _aevantec_litevue) {
|
|
|
61
60
|
var mask = (app) => {
|
|
62
61
|
app.directive("mask", ({ el, exp }) => {
|
|
63
62
|
const input = el;
|
|
64
|
-
const apply = () => {
|
|
63
|
+
const apply = (e) => {
|
|
65
64
|
const { value, selectionStart: at } = input;
|
|
66
|
-
const
|
|
65
|
+
const type = e?.inputType;
|
|
66
|
+
const masked = format(value, exp, !type?.startsWith("del"));
|
|
67
67
|
if (masked === value) return false;
|
|
68
68
|
input.value = masked;
|
|
69
69
|
if (at != null && document.activeElement === input) {
|
|
70
70
|
let to = format(value.slice(0, at), exp).length;
|
|
71
|
-
while (to < masked.length && !tokens[exp[to]]) to++;
|
|
71
|
+
if (!to || !type?.endsWith("Backward")) while (to < masked.length && !tokens[exp[to]]) to++;
|
|
72
72
|
input.setSelectionRange(to, to);
|
|
73
73
|
}
|
|
74
74
|
return true;
|
|
75
75
|
};
|
|
76
76
|
el.addEventListener("input", apply);
|
|
77
|
-
apply();
|
|
77
|
+
const dirty = apply();
|
|
78
78
|
let live = true;
|
|
79
79
|
Promise.resolve().then(() => {
|
|
80
|
-
if (live && apply()
|
|
80
|
+
if (live && (apply() || dirty)) {
|
|
81
|
+
el.dispatchEvent(new Event("input"));
|
|
82
|
+
el.dispatchEvent(new Event("change"));
|
|
83
|
+
}
|
|
81
84
|
});
|
|
82
85
|
return () => {
|
|
83
86
|
live = false;
|
|
@@ -114,7 +117,6 @@ var LiteVuePlugins = (function(exports, _aevantec_litevue) {
|
|
|
114
117
|
const name = arg || "v";
|
|
115
118
|
const cls = (phase) => `${name}-${phase}`;
|
|
116
119
|
let seq = 0;
|
|
117
|
-
let first = true;
|
|
118
120
|
let endTimer;
|
|
119
121
|
const clear = () => {
|
|
120
122
|
elem.classList.remove(cls("enter-from"), cls("enter-active"), cls("enter-to"), cls("leave-from"), cls("leave-active"), cls("leave-to"));
|
|
@@ -139,7 +141,11 @@ var LiteVuePlugins = (function(exports, _aevantec_litevue) {
|
|
|
139
141
|
Promise.resolve().then(() => {
|
|
140
142
|
if (live) run("enter");
|
|
141
143
|
});
|
|
142
|
-
elem.__leave = () =>
|
|
144
|
+
elem.__leave = () => {
|
|
145
|
+
live = false;
|
|
146
|
+
elem.__leaving = 1;
|
|
147
|
+
return new Promise((resolve) => run("leave", resolve));
|
|
148
|
+
};
|
|
143
149
|
return () => {
|
|
144
150
|
live = false;
|
|
145
151
|
clearTimeout(endTimer);
|
|
@@ -148,24 +154,24 @@ var LiteVuePlugins = (function(exports, _aevantec_litevue) {
|
|
|
148
154
|
};
|
|
149
155
|
}
|
|
150
156
|
const display = elem.style.display == "none" ? "" : elem.style.display;
|
|
157
|
+
let shown;
|
|
151
158
|
effect(() => {
|
|
152
159
|
const show = !!get();
|
|
153
|
-
if (
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
if (show && modifiers?.appear) run("enter");
|
|
157
|
-
return;
|
|
158
|
-
}
|
|
160
|
+
if (show === shown) return;
|
|
161
|
+
const animate = shown != null;
|
|
162
|
+
shown = show;
|
|
159
163
|
if (show) {
|
|
160
164
|
elem.style.display = display;
|
|
161
|
-
run("enter");
|
|
162
|
-
} else run("leave", () => {
|
|
165
|
+
if (animate || modifiers?.appear) run("enter");
|
|
166
|
+
} else if (animate) run("leave", () => {
|
|
163
167
|
elem.style.display = "none";
|
|
164
168
|
});
|
|
169
|
+
else elem.style.display = "none";
|
|
165
170
|
});
|
|
166
171
|
return () => {
|
|
167
172
|
clearTimeout(endTimer);
|
|
168
173
|
clear();
|
|
174
|
+
if (shown === false) elem.style.display = "none";
|
|
169
175
|
};
|
|
170
176
|
});
|
|
171
177
|
};
|
|
@@ -183,7 +189,7 @@ var LiteVuePlugins = (function(exports, _aevantec_litevue) {
|
|
|
183
189
|
var resolve$1 = (storage) => {
|
|
184
190
|
const target = storage ?? defaultStorage;
|
|
185
191
|
if (typeof target !== "string") return target;
|
|
186
|
-
return registry[target] ?? builtin(target);
|
|
192
|
+
return registry[target.toLowerCase()] ?? builtin(target);
|
|
187
193
|
};
|
|
188
194
|
/**
|
|
189
195
|
* Register a custom storage under a name, selectable anywhere — including as a
|
|
@@ -194,7 +200,7 @@ var LiteVuePlugins = (function(exports, _aevantec_litevue) {
|
|
|
194
200
|
* <div v-persist.memory="scratch">…</div>
|
|
195
201
|
*/
|
|
196
202
|
var registerStorage = (name, storage) => {
|
|
197
|
-
registry[name] = storage;
|
|
203
|
+
registry[name.toLowerCase()] = storage;
|
|
198
204
|
};
|
|
199
205
|
/**
|
|
200
206
|
* Switch the storage used when none is specified. Accepts a registered name
|
|
@@ -225,7 +231,7 @@ var LiteVuePlugins = (function(exports, _aevantec_litevue) {
|
|
|
225
231
|
try {
|
|
226
232
|
const saved = JSON.parse(storage.getItem(key) || "null");
|
|
227
233
|
if (saved) {
|
|
228
|
-
for (const k of fields) if (k
|
|
234
|
+
for (const k of fields) if ({}.hasOwnProperty.call(saved, k)) target[k] = saved[k];
|
|
229
235
|
}
|
|
230
236
|
} catch {}
|
|
231
237
|
return run(() => {
|
|
@@ -253,16 +259,14 @@ var LiteVuePlugins = (function(exports, _aevantec_litevue) {
|
|
|
253
259
|
app.directive("persist", ({ ctx, el, exp, arg, modifiers, effect }) => {
|
|
254
260
|
const key = PREFIX + (exp || el.id);
|
|
255
261
|
if (key === PREFIX) console.error(`v-persist needs a key: v-persist="my-key".`);
|
|
256
|
-
let storage;
|
|
257
|
-
for (const name in modifiers
|
|
258
|
-
if (resolve$1(name))
|
|
259
|
-
storage = name;
|
|
260
|
-
break;
|
|
261
|
-
}
|
|
262
|
+
let storage = modifiers ? void 0 : resolve$1();
|
|
263
|
+
for (const name in modifiers) {
|
|
264
|
+
if (storage = resolve$1(name)) break;
|
|
262
265
|
console.error(`v-persist: unknown storage ".${name}" — use .local, .session, or a name passed to registerStorage().`);
|
|
263
266
|
}
|
|
264
267
|
const keys = arg ? arg.split(",").map((k) => k.trim()).filter(Boolean) : void 0;
|
|
265
|
-
|
|
268
|
+
for (const k of keys || []) if (!(k in ctx.scope)) console.warn(`v-persist: "${k}" is not in the scope, so it is not persisted. Attribute names are lowercase; list lowercase keys, or use persistStore() with keys.`);
|
|
269
|
+
sync(ctx.scope, key, keys, storage, effect);
|
|
266
270
|
});
|
|
267
271
|
};
|
|
268
272
|
/**
|
|
@@ -293,7 +297,7 @@ var LiteVuePlugins = (function(exports, _aevantec_litevue) {
|
|
|
293
297
|
/**
|
|
294
298
|
* Focus utilities.
|
|
295
299
|
*
|
|
296
|
-
* v-focus="expression" — focuses the element
|
|
300
|
+
* v-focus="expression" — focuses the element when the expression becomes truthy,
|
|
297
301
|
* on mount included, making it an autofocus.
|
|
298
302
|
* - .select also select the text (inputs/textareas)
|
|
299
303
|
*
|
|
@@ -304,8 +308,9 @@ var LiteVuePlugins = (function(exports, _aevantec_litevue) {
|
|
|
304
308
|
var focus = (app) => {
|
|
305
309
|
app.directive("focus", ({ el, get, effect, modifiers }) => {
|
|
306
310
|
let live = true;
|
|
311
|
+
let on = false;
|
|
307
312
|
effect(() => {
|
|
308
|
-
|
|
313
|
+
if (on === (on = !!get())) return;
|
|
309
314
|
Promise.resolve().then(() => {
|
|
310
315
|
if (live && on) {
|
|
311
316
|
el.focus();
|
|
@@ -320,9 +325,9 @@ var LiteVuePlugins = (function(exports, _aevantec_litevue) {
|
|
|
320
325
|
app.directive("trap", ({ el, get, effect }) => {
|
|
321
326
|
let active = false;
|
|
322
327
|
let prevFocus = null;
|
|
323
|
-
const focusables = () => [...el.querySelectorAll(FOCUSABLE)].filter((e) => e.tabIndex >= 0 && !e.matches(":disabled,[inert] *") && e.checkVisibility?.({ visibilityProperty: true }) !== false).filter(isTabStop);
|
|
328
|
+
const focusables = () => [...el.querySelectorAll(FOCUSABLE)].filter((e) => e.tabIndex >= 0 && !e.matches(":disabled,[inert],[inert] *") && e.checkVisibility?.({ visibilityProperty: true }) !== false).filter(isTabStop);
|
|
324
329
|
const onKeydown = (e) => {
|
|
325
|
-
if (e.key !== "Tab" || traps.at(-1) !==
|
|
330
|
+
if (e.key !== "Tab" || traps.at(-1) !== el) return;
|
|
326
331
|
const els = focusables();
|
|
327
332
|
if (!els.length) {
|
|
328
333
|
e.preventDefault();
|
|
@@ -334,17 +339,14 @@ var LiteVuePlugins = (function(exports, _aevantec_litevue) {
|
|
|
334
339
|
if (!el.contains(current)) {
|
|
335
340
|
e.preventDefault();
|
|
336
341
|
first.focus();
|
|
337
|
-
} else if (e.shiftKey
|
|
338
|
-
e.preventDefault();
|
|
339
|
-
last.focus();
|
|
340
|
-
} else if (!e.shiftKey && current === last) {
|
|
342
|
+
} else if (!((e.shiftKey ? first : last).compareDocumentPosition(current) & (e.shiftKey ? 4 : 2))) {
|
|
341
343
|
e.preventDefault();
|
|
342
|
-
first.focus();
|
|
344
|
+
(e.shiftKey ? last : first).focus();
|
|
343
345
|
}
|
|
344
346
|
};
|
|
345
347
|
const release = () => {
|
|
346
348
|
active = false;
|
|
347
|
-
traps.splice(traps.indexOf(
|
|
349
|
+
traps.splice(traps.indexOf(el), 1);
|
|
348
350
|
document.removeEventListener("keydown", onKeydown, true);
|
|
349
351
|
if (prevFocus && prevFocus.focus) prevFocus.focus();
|
|
350
352
|
};
|
|
@@ -353,10 +355,10 @@ var LiteVuePlugins = (function(exports, _aevantec_litevue) {
|
|
|
353
355
|
if (on && !active) {
|
|
354
356
|
active = true;
|
|
355
357
|
prevFocus = document.activeElement;
|
|
356
|
-
traps.
|
|
358
|
+
traps.splice(traps.findIndex((t) => el.contains(t)) >>> 0, 0, el);
|
|
357
359
|
document.addEventListener("keydown", onKeydown, true);
|
|
358
360
|
Promise.resolve().then(() => {
|
|
359
|
-
if (active) (focusables()[0] || el).focus();
|
|
361
|
+
if (active && traps.at(-1) === el) (focusables()[0] || el).focus();
|
|
360
362
|
});
|
|
361
363
|
} else if (!on && active) release();
|
|
362
364
|
});
|
|
@@ -390,8 +392,7 @@ var LiteVuePlugins = (function(exports, _aevantec_litevue) {
|
|
|
390
392
|
];
|
|
391
393
|
const before = owned.map((k) => elem.style[k]);
|
|
392
394
|
const hide = (hidden) => elem.style.visibility = hidden ? "hidden" : before[3];
|
|
393
|
-
|
|
394
|
-
let first = true;
|
|
395
|
+
let shown;
|
|
395
396
|
let seq = 0;
|
|
396
397
|
const timers = /* @__PURE__ */ new Set();
|
|
397
398
|
const later = (fn, ms) => {
|
|
@@ -403,27 +404,25 @@ var LiteVuePlugins = (function(exports, _aevantec_litevue) {
|
|
|
403
404
|
};
|
|
404
405
|
effect(() => {
|
|
405
406
|
const show = !!get();
|
|
407
|
+
if (show === shown) return;
|
|
406
408
|
const id = ++seq;
|
|
407
|
-
if (first) {
|
|
408
|
-
first = false;
|
|
409
|
-
if (!show) elem.style.height = "0px";
|
|
410
|
-
hide(!show);
|
|
411
|
-
later(() => {
|
|
412
|
-
elem.style.transition = `height ${duration}ms ease, visibility ${duration}ms`;
|
|
413
|
-
});
|
|
414
|
-
return;
|
|
415
|
-
}
|
|
416
409
|
hide(!show);
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
410
|
+
elem.style.overflow = show && shown == null ? before[0] : "hidden";
|
|
411
|
+
if (shown == null) later(() => {
|
|
412
|
+
elem.style.transition = `height ${duration}ms ease, visibility ${duration}ms`;
|
|
413
|
+
});
|
|
414
|
+
else {
|
|
415
|
+
elem.style.height = before[1] || elem.scrollHeight + "px";
|
|
416
|
+
if (show) later(() => {
|
|
417
|
+
if (id === seq) {
|
|
418
|
+
elem.style.height = before[1];
|
|
419
|
+
elem.style.overflow = before[0];
|
|
420
|
+
}
|
|
421
421
|
}, duration);
|
|
422
|
-
|
|
423
|
-
elem.style.height = elem.scrollHeight + "px";
|
|
424
|
-
elem.offsetHeight;
|
|
425
|
-
elem.style.height = "0px";
|
|
422
|
+
else elem.offsetHeight;
|
|
426
423
|
}
|
|
424
|
+
if (!show) elem.style.height = "0px";
|
|
425
|
+
shown = show;
|
|
427
426
|
});
|
|
428
427
|
return () => {
|
|
429
428
|
timers.forEach(clearTimeout);
|
|
@@ -437,7 +436,8 @@ var LiteVuePlugins = (function(exports, _aevantec_litevue) {
|
|
|
437
436
|
* logs an unknown-directive error, and registering one would have the walker
|
|
438
437
|
* strip it, leaving nothing for the next morph. Matches `data-morph-skip`.
|
|
439
438
|
*/
|
|
440
|
-
var preserved = (node, opts) => node.nodeType === 1 && (node.hasAttribute("data-morph-preserve") || !!opts.preserve?.(node));
|
|
439
|
+
var preserved = (node, opts) => node.nodeType === 1 && (node.hasAttribute("data-morph-preserve") || node.__marker || !!opts.preserve?.(node));
|
|
440
|
+
var LAZY = "[v-scope\\.visible],[v-scope\\.idle],[v-scope\\.interaction]";
|
|
441
441
|
var dirRE = /^(?:v-|:|@)/;
|
|
442
442
|
var bindRE = /^(?::|v-bind:)/;
|
|
443
443
|
var clientStyleRE = /^v-(?!scope|on:)/;
|
|
@@ -482,12 +482,17 @@ var LiteVuePlugins = (function(exports, _aevantec_litevue) {
|
|
|
482
482
|
var boundAttrs = (to) => {
|
|
483
483
|
const owned = /* @__PURE__ */ new Set();
|
|
484
484
|
if (to.matches("details,dialog")) owned.add("open");
|
|
485
|
-
for (const { name } of to.attributes) if (bindRE.test(name))
|
|
486
|
-
|
|
485
|
+
for (const { name } of to.attributes) if (bindRE.test(name)) {
|
|
486
|
+
const attr = name.replace(bindRE, "").split(".")[0];
|
|
487
|
+
owned.add(/\.camel\b/.test(name) ? attr.replace(/-(\w)/g, (_, c) => c.toUpperCase()) : attr);
|
|
488
|
+
} else if (/^v-model\b/.test(name)) {
|
|
487
489
|
owned.add("value");
|
|
488
490
|
owned.add("checked");
|
|
489
491
|
} else if (name === "v-bind") owned.add("*");
|
|
490
|
-
else if (clientStyleRE.test(name))
|
|
492
|
+
else if (clientStyleRE.test(name)) {
|
|
493
|
+
owned.add("style");
|
|
494
|
+
name == "v-popover" && owned.add("popover");
|
|
495
|
+
}
|
|
491
496
|
return owned;
|
|
492
497
|
};
|
|
493
498
|
/**
|
|
@@ -502,8 +507,25 @@ var LiteVuePlugins = (function(exports, _aevantec_litevue) {
|
|
|
502
507
|
for (let c = to.firstElementChild; c; c = c.nextElementSibling) if (isBlockRoot(c)) return true;
|
|
503
508
|
return false;
|
|
504
509
|
};
|
|
505
|
-
var
|
|
510
|
+
var FIELD_PROPS = [
|
|
511
|
+
"Value",
|
|
512
|
+
"Checked",
|
|
513
|
+
"Selected"
|
|
514
|
+
];
|
|
515
|
+
var syncValues = (from, to, owned) => {
|
|
516
|
+
const ctl = boundAttrs(to.closest("select") || to);
|
|
517
|
+
if (owned.has("*") || ctl.has("*") || ctl.has("value") || from.type == "output" || from.type == "textarea" && to.value.includes("{{")) return;
|
|
518
|
+
for (const name of FIELD_PROPS) {
|
|
519
|
+
const prop = name.toLowerCase();
|
|
520
|
+
const init = "default" + name;
|
|
521
|
+
const src = name == "Selected" ? init : prop;
|
|
522
|
+
if (!owned.has(prop) && init in from && from[prop] !== to[src]) from[prop] = to[src];
|
|
523
|
+
}
|
|
524
|
+
};
|
|
525
|
+
var patchAttrs = (from, to, values) => {
|
|
506
526
|
const owned = boundAttrs(to);
|
|
527
|
+
if (from.__anchor) owned.add("style");
|
|
528
|
+
if (values) syncValues(from, to, owned);
|
|
507
529
|
const bound = Object(from.__bound);
|
|
508
530
|
for (const { name, value } of to.attributes) {
|
|
509
531
|
if (dirRE.test(name) || owned.has(name) || name in bound) continue;
|
|
@@ -523,7 +545,8 @@ var LiteVuePlugins = (function(exports, _aevantec_litevue) {
|
|
|
523
545
|
if (from.nodeType !== to.nodeType) return replaceNode(from, to, ctx, opts);
|
|
524
546
|
if (from.nodeType === 3 || from.nodeType === 8) {
|
|
525
547
|
const data = to.data;
|
|
526
|
-
if (isInterpolation(data, ctx)) return;
|
|
548
|
+
if (isInterpolation(data, ctx) && from.parentNode?.nodeName != "SCRIPT") return;
|
|
549
|
+
if (!from.data) return replaceNode(from, to, ctx, opts);
|
|
527
550
|
if (from.data !== data) from.data = data;
|
|
528
551
|
return;
|
|
529
552
|
}
|
|
@@ -532,8 +555,10 @@ var LiteVuePlugins = (function(exports, _aevantec_litevue) {
|
|
|
532
555
|
const b = to;
|
|
533
556
|
if (a.tagName !== b.tagName) return replaceNode(from, to, ctx, opts);
|
|
534
557
|
if (opts.skip?.(a, b) || a.hasAttribute("data-morph-skip")) return;
|
|
535
|
-
|
|
536
|
-
|
|
558
|
+
if (a.matches(LAZY)) return a.isEqualNode(b) ? void 0 : replaceNode(from, to, ctx, opts);
|
|
559
|
+
patchAttrs(a, b, opts.values);
|
|
560
|
+
if (a.tagName == "TEMPLATE" && !a.content.isEqualNode(b.content)) a.innerHTML = b.innerHTML;
|
|
561
|
+
if (!ownsChildren(b) && !Object.getOwnPropertyDescriptor(Object(a.__ctx?.scope), "$template")) patchChildren(a, b, a.__ctx || ctx, opts);
|
|
537
562
|
};
|
|
538
563
|
var replaceNode = (from, to, ctx, opts) => {
|
|
539
564
|
if (preserved(from, opts)) return;
|
|
@@ -543,6 +568,7 @@ var LiteVuePlugins = (function(exports, _aevantec_litevue) {
|
|
|
543
568
|
from.parentNode.replaceChild(fresh, from);
|
|
544
569
|
opts.afterNodeRemoved?.(from);
|
|
545
570
|
mountNew(fresh, ctx);
|
|
571
|
+
return fresh;
|
|
546
572
|
};
|
|
547
573
|
/**
|
|
548
574
|
* Bind never-walked markup with the scope it was inserted into. The walker
|
|
@@ -550,6 +576,7 @@ var LiteVuePlugins = (function(exports, _aevantec_litevue) {
|
|
|
550
576
|
* copy of the core into the plugins bundle.
|
|
551
577
|
*/
|
|
552
578
|
var mountNew = (node, ctx) => {
|
|
579
|
+
if (node.parentElement?.closest(LAZY)) return;
|
|
553
580
|
const target = ctx || nearestCtx(node.parentNode);
|
|
554
581
|
target?.walk?.(node, target);
|
|
555
582
|
};
|
|
@@ -563,6 +590,15 @@ var LiteVuePlugins = (function(exports, _aevantec_litevue) {
|
|
|
563
590
|
keyed.set(k, n);
|
|
564
591
|
}
|
|
565
592
|
const keyOf = (n) => n && n.nodeType === 1 ? key(n) : null;
|
|
593
|
+
const wanted = /* @__PURE__ */ new Set();
|
|
594
|
+
for (let n = to.firstChild; n; n = n.nextSibling) wanted.add(keyOf(n));
|
|
595
|
+
const drop = (node) => {
|
|
596
|
+
if (!preserved(node, opts)) {
|
|
597
|
+
release(node, ctx);
|
|
598
|
+
from.removeChild(node);
|
|
599
|
+
opts.afterNodeRemoved?.(node);
|
|
600
|
+
}
|
|
601
|
+
};
|
|
566
602
|
let oldChild = from.firstChild;
|
|
567
603
|
let newChild = to.firstChild;
|
|
568
604
|
const insert = (node) => {
|
|
@@ -574,7 +610,8 @@ var LiteVuePlugins = (function(exports, _aevantec_litevue) {
|
|
|
574
610
|
while (newChild) {
|
|
575
611
|
const nextNew = newChild.nextSibling;
|
|
576
612
|
const wantKey = keyOf(newChild);
|
|
577
|
-
if (
|
|
613
|
+
if (oldChild?.data === "" && newChild.hasAttribute?.("v-teleport")) oldChild = oldChild.nextSibling;
|
|
614
|
+
else if (wantKey != null) {
|
|
578
615
|
const match = keyed.get(wantKey);
|
|
579
616
|
if (match) {
|
|
580
617
|
if (match === oldChild) oldChild = oldChild.nextSibling;
|
|
@@ -590,16 +627,17 @@ var LiteVuePlugins = (function(exports, _aevantec_litevue) {
|
|
|
590
627
|
const nextOld = oldChild.nextSibling;
|
|
591
628
|
patchNode(oldChild, newChild, ctx, opts);
|
|
592
629
|
oldChild = nextOld;
|
|
630
|
+
} else if (oldChild && !wanted.has(keyOf(oldChild))) {
|
|
631
|
+
const nextOld = oldChild.nextSibling;
|
|
632
|
+
drop(oldChild);
|
|
633
|
+
oldChild = nextOld;
|
|
634
|
+
continue;
|
|
593
635
|
} else insert(newChild);
|
|
594
636
|
newChild = nextNew;
|
|
595
637
|
}
|
|
596
638
|
while (oldChild) {
|
|
597
639
|
const next = oldChild.nextSibling;
|
|
598
|
-
|
|
599
|
-
release(oldChild, ctx);
|
|
600
|
-
from.removeChild(oldChild);
|
|
601
|
-
opts.afterNodeRemoved?.(oldChild);
|
|
602
|
-
}
|
|
640
|
+
drop(oldChild);
|
|
603
641
|
oldChild = next;
|
|
604
642
|
}
|
|
605
643
|
};
|
|
@@ -611,18 +649,19 @@ var LiteVuePlugins = (function(exports, _aevantec_litevue) {
|
|
|
611
649
|
let target;
|
|
612
650
|
if (typeof to === "string") {
|
|
613
651
|
const holder = document.createElement("template");
|
|
614
|
-
|
|
615
|
-
|
|
652
|
+
const svg = from instanceof SVGElement;
|
|
653
|
+
holder.innerHTML = svg ? `<svg>${to.trim()}</svg>` : to.trim();
|
|
654
|
+
const content = svg ? holder.content.firstChild : holder.content;
|
|
616
655
|
target = content.childNodes.length === 1 && content.firstElementChild ? content.firstElementChild : (() => {
|
|
617
656
|
const wrapper = from.cloneNode(false);
|
|
618
|
-
wrapper.
|
|
657
|
+
wrapper.append(...content.childNodes);
|
|
619
658
|
return wrapper;
|
|
620
659
|
})();
|
|
621
660
|
} else target = to;
|
|
622
661
|
if (target) {
|
|
623
662
|
const patch = () => {
|
|
624
663
|
const restore = captureFocus();
|
|
625
|
-
patchNode(from, target, nearestCtx(from), opts);
|
|
664
|
+
from = patchNode(from, target, nearestCtx(from.parentNode), opts) || from;
|
|
626
665
|
restore();
|
|
627
666
|
};
|
|
628
667
|
opts.transition && document.startViewTransition ? document.startViewTransition(patch) : patch();
|
|
@@ -672,7 +711,7 @@ var LiteVuePlugins = (function(exports, _aevantec_litevue) {
|
|
|
672
711
|
* replaces rather than merges, so adjusting one breakpoint means spreading
|
|
673
712
|
* this rather than retyping all five.
|
|
674
713
|
*/
|
|
675
|
-
var defaultBreakpoints = Object.freeze({ ...DEFAULT_BREAKPOINTS });
|
|
714
|
+
var defaultBreakpoints = /* @__PURE__ */ Object.freeze({ ...DEFAULT_BREAKPOINTS });
|
|
676
715
|
var ALIASES = {
|
|
677
716
|
mobile: "base",
|
|
678
717
|
tablet: "md",
|
|
@@ -688,7 +727,7 @@ var LiteVuePlugins = (function(exports, _aevantec_litevue) {
|
|
|
688
727
|
* MediaQueryList rather than mirrored, since registering a query inside a
|
|
689
728
|
* running effect would write a dependency it just read and re-run it.
|
|
690
729
|
*/
|
|
691
|
-
var state = (0, _aevantec_litevue.reactive)({
|
|
730
|
+
var state = /* @__PURE__ */ (0, _aevantec_litevue.reactive)({
|
|
692
731
|
bp: "base",
|
|
693
732
|
tick: 0
|
|
694
733
|
});
|
|
@@ -815,7 +854,7 @@ var LiteVuePlugins = (function(exports, _aevantec_litevue) {
|
|
|
815
854
|
return DEFAULT_BREAKPOINTS[name];
|
|
816
855
|
};
|
|
817
856
|
var mqFn = (map, fallback) => resolve(map, fallback);
|
|
818
|
-
var mq = Object.defineProperties(mqFn, {
|
|
857
|
+
var mq = /* @__PURE__ */ Object.defineProperties(mqFn, {
|
|
819
858
|
props: { value: (maps) => {
|
|
820
859
|
trackAll();
|
|
821
860
|
const out = {};
|