voodoojs 0.5.0 → 0.6.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/{chunk-RJUNPXQF.js → chunk-4LR3IFPX.js} +2 -2
- package/dist/{chunk-ABRZI32G.js → chunk-CNHNFTPC.js} +72 -69
- package/dist/{chunk-34CGORMO.js → chunk-PHMBDPWH.js} +3 -3
- package/dist/essential.cjs +69 -66
- package/dist/essential.d.cts +1 -1
- package/dist/essential.d.ts +1 -1
- package/dist/essential.js +2 -2
- package/dist/gpu.cjs +18 -18
- package/dist/gpu.js +20 -20
- package/dist/index.cjs +304 -277
- package/dist/index.d.cts +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.js +231 -207
- package/dist/{query-BeYufh-f.d.ts → query-CC-_z7v0.d.ts} +5 -5
- package/dist/{query-Bja83lRJ.d.cts → query-sEJXe_cO.d.cts} +5 -5
- package/dist/socket.d.cts +4 -4
- package/dist/socket.d.ts +4 -4
- package/dist/socket.js +3 -3
- package/dist/voodoo.core.js +38 -35
- package/dist/voodoo.core.min.js +15 -15
- package/dist/voodoo.full.js +299 -272
- package/dist/voodoo.full.min.js +74 -74
- package/dist/voodoo.js +70 -67
- package/dist/voodoo.min.js +22 -22
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -3349,7 +3349,7 @@ init_reactivity();
|
|
|
3349
3349
|
// src/store/index.ts
|
|
3350
3350
|
init_reactivity();
|
|
3351
3351
|
var stores = /* @__PURE__ */ new Map();
|
|
3352
|
-
var
|
|
3352
|
+
var version = ref(0);
|
|
3353
3353
|
var persistHandles = /* @__PURE__ */ new Map();
|
|
3354
3354
|
function store(name, definition, options = {}) {
|
|
3355
3355
|
const existing = stores.get(name);
|
|
@@ -3366,30 +3366,30 @@ function store(name, definition, options = {}) {
|
|
|
3366
3366
|
return existing;
|
|
3367
3367
|
}
|
|
3368
3368
|
const key = typeof options.persist === "string" ? options.persist : `voodoo:store:${name}`;
|
|
3369
|
-
const
|
|
3370
|
-
const initial = Object.defineProperties({},
|
|
3369
|
+
const descriptors = Object.getOwnPropertyDescriptors(definition);
|
|
3370
|
+
const initial = Object.defineProperties({}, descriptors);
|
|
3371
3371
|
if (options.persist && typeof localStorage !== "undefined") {
|
|
3372
3372
|
try {
|
|
3373
3373
|
const saved = localStorage.getItem(key);
|
|
3374
3374
|
if (saved) {
|
|
3375
|
-
const
|
|
3376
|
-
for (const [
|
|
3377
|
-
if (
|
|
3378
|
-
initial[
|
|
3375
|
+
const parsed = JSON.parse(saved);
|
|
3376
|
+
for (const [field, value] of Object.entries(parsed)) {
|
|
3377
|
+
if (descriptors[field] && !("value" in descriptors[field])) continue;
|
|
3378
|
+
initial[field] = value;
|
|
3379
3379
|
}
|
|
3380
3380
|
}
|
|
3381
3381
|
} catch {
|
|
3382
3382
|
}
|
|
3383
3383
|
}
|
|
3384
3384
|
const created = reactive(initial);
|
|
3385
|
-
for (const [prop,
|
|
3386
|
-
const value =
|
|
3385
|
+
for (const [prop, descriptor] of Object.entries(descriptors)) {
|
|
3386
|
+
const value = descriptor.value;
|
|
3387
3387
|
if (typeof value === "function") {
|
|
3388
3388
|
created[prop] = (...args) => value.apply(created, args);
|
|
3389
3389
|
}
|
|
3390
3390
|
}
|
|
3391
3391
|
stores.set(name, created);
|
|
3392
|
-
|
|
3392
|
+
version.value++;
|
|
3393
3393
|
if (options.persist && typeof localStorage !== "undefined") {
|
|
3394
3394
|
const stop2 = watch(
|
|
3395
3395
|
created,
|
|
@@ -3407,10 +3407,10 @@ function store(name, definition, options = {}) {
|
|
|
3407
3407
|
}
|
|
3408
3408
|
function stripFunctions(source) {
|
|
3409
3409
|
const out = {};
|
|
3410
|
-
const
|
|
3410
|
+
const descriptors = Object.getOwnPropertyDescriptors(toRaw(source));
|
|
3411
3411
|
for (const [key, value] of Object.entries(source)) {
|
|
3412
3412
|
if (typeof value === "function") continue;
|
|
3413
|
-
if (
|
|
3413
|
+
if (descriptors[key] && !("value" in descriptors[key])) continue;
|
|
3414
3414
|
out[key] = value;
|
|
3415
3415
|
}
|
|
3416
3416
|
return out;
|
|
@@ -3419,11 +3419,11 @@ var allStores = new Proxy(
|
|
|
3419
3419
|
{},
|
|
3420
3420
|
{
|
|
3421
3421
|
get: (_t, key) => {
|
|
3422
|
-
void
|
|
3422
|
+
void version.value;
|
|
3423
3423
|
return stores.get(key);
|
|
3424
3424
|
},
|
|
3425
3425
|
has: (_t, key) => {
|
|
3426
|
-
void
|
|
3426
|
+
void version.value;
|
|
3427
3427
|
return stores.has(key);
|
|
3428
3428
|
},
|
|
3429
3429
|
ownKeys: () => [...stores.keys()],
|
|
@@ -4673,10 +4673,11 @@ var cache2 = {
|
|
|
4673
4673
|
}
|
|
4674
4674
|
};
|
|
4675
4675
|
var THEME_KEY = "voodoo:theme";
|
|
4676
|
+
var picked = null;
|
|
4676
4677
|
var theme = {
|
|
4677
4678
|
/** Theme chosen by the user, or `system` when never set. */
|
|
4678
4679
|
get current() {
|
|
4679
|
-
return storage.get(THEME_KEY) ?? "system";
|
|
4680
|
+
return storage.get(THEME_KEY) ?? picked ?? "system";
|
|
4680
4681
|
},
|
|
4681
4682
|
/** Theme effectively applied, resolving `system`. */
|
|
4682
4683
|
get resolved() {
|
|
@@ -4686,6 +4687,7 @@ var theme = {
|
|
|
4686
4687
|
return matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light";
|
|
4687
4688
|
},
|
|
4688
4689
|
set(value) {
|
|
4690
|
+
picked = value;
|
|
4689
4691
|
storage.set(THEME_KEY, value);
|
|
4690
4692
|
this.apply();
|
|
4691
4693
|
},
|
|
@@ -4696,7 +4698,7 @@ var theme = {
|
|
|
4696
4698
|
},
|
|
4697
4699
|
/** `true` once the visitor has actually picked a theme. */
|
|
4698
4700
|
get chosen() {
|
|
4699
|
-
return storage.get(THEME_KEY) != null;
|
|
4701
|
+
return picked !== null || storage.get(THEME_KEY) != null;
|
|
4700
4702
|
},
|
|
4701
4703
|
/** Writes `data-theme` on the root element and notifies the page. */
|
|
4702
4704
|
apply() {
|
|
@@ -4720,7 +4722,8 @@ var theme = {
|
|
|
4720
4722
|
init() {
|
|
4721
4723
|
if (typeof document === "undefined") return;
|
|
4722
4724
|
this.apply();
|
|
4723
|
-
|
|
4725
|
+
if (typeof matchMedia === "undefined") return;
|
|
4726
|
+
matchMedia("(prefers-color-scheme: dark)").addEventListener("change", () => {
|
|
4724
4727
|
if (this.current === "system") this.apply();
|
|
4725
4728
|
});
|
|
4726
4729
|
}
|
|
@@ -5155,8 +5158,8 @@ function transitionOptions(el) {
|
|
|
5155
5158
|
defineDirective("text", ({ el, effect: effect3, evaluate: ev }) => {
|
|
5156
5159
|
effect3(() => {
|
|
5157
5160
|
el.textContent = stringify(ev());
|
|
5158
|
-
const
|
|
5159
|
-
if (
|
|
5161
|
+
const first = el.firstChild;
|
|
5162
|
+
if (first && first.nodeType === 3) markInitialized(first);
|
|
5160
5163
|
});
|
|
5161
5164
|
});
|
|
5162
5165
|
defineDirective("html", (ctx) => {
|
|
@@ -5359,10 +5362,10 @@ defineDirective(
|
|
|
5359
5362
|
next.push({ key, scope: childScope, nodes, data: childScope.data });
|
|
5360
5363
|
});
|
|
5361
5364
|
if (batch.fragment.firstChild) anchor.parentNode?.insertBefore(batch.fragment, anchor);
|
|
5362
|
-
for (const [node,
|
|
5363
|
-
const
|
|
5365
|
+
for (const [node, rowScope] of batch.pending) walk(node, rowScope);
|
|
5366
|
+
const reused = new Set(next);
|
|
5364
5367
|
for (const block2 of blocks) {
|
|
5365
|
-
if (used.has(block2.key) &&
|
|
5368
|
+
if (used.has(block2.key) && reused.has(block2)) continue;
|
|
5366
5369
|
for (const node of block2.nodes) {
|
|
5367
5370
|
destroy(node);
|
|
5368
5371
|
node.remove();
|
|
@@ -5432,7 +5435,7 @@ var BOOLEAN_ATTRIBUTES = /* @__PURE__ */ new Set([
|
|
|
5432
5435
|
"novalidate",
|
|
5433
5436
|
"inert"
|
|
5434
5437
|
]);
|
|
5435
|
-
var
|
|
5438
|
+
var URL_ATTRIBUTES = /* @__PURE__ */ new Set([
|
|
5436
5439
|
"href",
|
|
5437
5440
|
"src",
|
|
5438
5441
|
"action",
|
|
@@ -5441,15 +5444,15 @@ var ATRIBUTOS_DE_URL = /* @__PURE__ */ new Set([
|
|
|
5441
5444
|
"ping",
|
|
5442
5445
|
"poster"
|
|
5443
5446
|
]);
|
|
5444
|
-
var
|
|
5445
|
-
function
|
|
5446
|
-
const
|
|
5447
|
-
return
|
|
5447
|
+
var SCHEME_NOISE = /[\s\x00-\x1f]/g;
|
|
5448
|
+
function isDangerousUrl(value) {
|
|
5449
|
+
const clean = value.replace(SCHEME_NOISE, "").toLowerCase();
|
|
5450
|
+
return clean.startsWith("javascript:") || clean.startsWith("vbscript:") || clean.startsWith("data:text/html") || clean.startsWith("data:application/xhtml");
|
|
5448
5451
|
}
|
|
5449
|
-
function applyBinding(el, name, value, asProp = false,
|
|
5452
|
+
function applyBinding(el, name, value, asProp = false, allowDangerous = false) {
|
|
5450
5453
|
if (name === "class") return applyClass(el, value);
|
|
5451
5454
|
if (name === "style") return applyStyle(el, value);
|
|
5452
|
-
if (exports.config.sanitizeUrls && !
|
|
5455
|
+
if (exports.config.sanitizeUrls && !allowDangerous && name === "srcdoc") {
|
|
5453
5456
|
warn2(
|
|
5454
5457
|
`:srcdoc refused in ${describeElement(el)}: the value becomes a document with active script inside the iframe, the same way v-html becomes markup. If the content is trusted, write :srcdoc.dangerous="..."; to turn off this protection on the entire application, set V.config.sanitizeUrls = false.`
|
|
5455
5458
|
);
|
|
@@ -5457,7 +5460,7 @@ function applyBinding(el, name, value, asProp = false, perigoLiberado = false) {
|
|
|
5457
5460
|
return;
|
|
5458
5461
|
}
|
|
5459
5462
|
if (exports.config.sanitizeUrls && !asProp) {
|
|
5460
|
-
if (
|
|
5463
|
+
if (URL_ATTRIBUTES.has(name) && typeof value === "string" && isDangerousUrl(value)) {
|
|
5461
5464
|
warn2(
|
|
5462
5465
|
`value refused in :${name} of ${describeElement(el)}: "${value.slice(0, 60)}" uses a scheme that executes code. Use an http(s) or relative address. To turn off this protection, set V.config.sanitizeUrls = false.`
|
|
5463
5466
|
);
|
|
@@ -5554,9 +5557,9 @@ defineDirective(
|
|
|
5554
5557
|
}
|
|
5555
5558
|
if (arg === "key") return;
|
|
5556
5559
|
const asProp = !!modifiers.prop;
|
|
5557
|
-
const
|
|
5560
|
+
const allowDangerous = !!modifiers.dangerous;
|
|
5558
5561
|
effect3(() => {
|
|
5559
|
-
applyBinding(el, arg, ev(), asProp,
|
|
5562
|
+
applyBinding(el, arg, ev(), asProp, allowDangerous);
|
|
5560
5563
|
});
|
|
5561
5564
|
},
|
|
5562
5565
|
{ priority: exports.PRIORITY.BIND }
|
|
@@ -6473,7 +6476,7 @@ function directive(name, definition) {
|
|
|
6473
6476
|
name,
|
|
6474
6477
|
(ctx) => {
|
|
6475
6478
|
let oldValue;
|
|
6476
|
-
let
|
|
6479
|
+
let mounted2 = false;
|
|
6477
6480
|
const makeBinding = (value) => ({
|
|
6478
6481
|
el: ctx.el,
|
|
6479
6482
|
value,
|
|
@@ -6489,8 +6492,8 @@ function directive(name, definition) {
|
|
|
6489
6492
|
hooks.beforeMount?.(ctx.el, makeBinding(initial));
|
|
6490
6493
|
ctx.effect(() => {
|
|
6491
6494
|
const value = hooks.raw ? ctx.expression : ctx.evaluate();
|
|
6492
|
-
if (!
|
|
6493
|
-
|
|
6495
|
+
if (!mounted2) {
|
|
6496
|
+
mounted2 = true;
|
|
6494
6497
|
oldValue = value;
|
|
6495
6498
|
hooks.mounted?.(ctx.el, makeBinding(value));
|
|
6496
6499
|
return;
|
|
@@ -6513,11 +6516,11 @@ function data(values) {
|
|
|
6513
6516
|
Object.defineProperties(rootScope.data, Object.getOwnPropertyDescriptors(values));
|
|
6514
6517
|
return rootScope.data;
|
|
6515
6518
|
}
|
|
6516
|
-
var
|
|
6519
|
+
var version2 = "0.4.6";
|
|
6517
6520
|
var core = {
|
|
6518
6521
|
// Utilities first: Voodoo's own names can override.
|
|
6519
6522
|
...utils_exports,
|
|
6520
|
-
version,
|
|
6523
|
+
version: version2,
|
|
6521
6524
|
config: exports.config,
|
|
6522
6525
|
// Reactivity
|
|
6523
6526
|
reactive,
|
|
@@ -7729,6 +7732,32 @@ function buildUrl(location2) {
|
|
|
7729
7732
|
const base = settings2.base === "/" ? "" : settings2.base.replace(/\/$/, "");
|
|
7730
7733
|
return `${base}${suffix}` || "/";
|
|
7731
7734
|
}
|
|
7735
|
+
var historyRefused = false;
|
|
7736
|
+
var writingHash = false;
|
|
7737
|
+
function writeUrl(state2, url2, replace) {
|
|
7738
|
+
if (!historyRefused) {
|
|
7739
|
+
try {
|
|
7740
|
+
if (replace) window.history.replaceState(state2, "", url2);
|
|
7741
|
+
else window.history.pushState(state2, "", url2);
|
|
7742
|
+
return;
|
|
7743
|
+
} catch (error) {
|
|
7744
|
+
if (!(error instanceof Error) || error.name !== "SecurityError") throw error;
|
|
7745
|
+
historyRefused = true;
|
|
7746
|
+
}
|
|
7747
|
+
}
|
|
7748
|
+
if (settings2.mode !== "hash") return;
|
|
7749
|
+
const hash = url2.slice(url2.indexOf("#"));
|
|
7750
|
+
if (window.location.hash === hash) return;
|
|
7751
|
+
writingHash = true;
|
|
7752
|
+
try {
|
|
7753
|
+
if (replace) window.location.replace(url2);
|
|
7754
|
+
else window.location.hash = hash;
|
|
7755
|
+
} finally {
|
|
7756
|
+
setTimeout(() => {
|
|
7757
|
+
writingHash = false;
|
|
7758
|
+
}, 0);
|
|
7759
|
+
}
|
|
7760
|
+
}
|
|
7732
7761
|
function compileRoute(pattern, record) {
|
|
7733
7762
|
const clean = pattern === "*" ? "*" : normalizePath(pattern);
|
|
7734
7763
|
const raw = clean === "*" ? ["*"] : clean.split("/").filter(Boolean);
|
|
@@ -7915,8 +7944,7 @@ async function navigate(target2, options = {}) {
|
|
|
7915
7944
|
const key = uid("rota");
|
|
7916
7945
|
const historyState = { ...options.state ?? {}, [HISTORY_KEY]: key };
|
|
7917
7946
|
const url2 = buildUrl(destination);
|
|
7918
|
-
|
|
7919
|
-
else window.history.pushState(historyState, "", url2);
|
|
7947
|
+
writeUrl(historyState, url2, options.replace === true);
|
|
7920
7948
|
currentKey = key;
|
|
7921
7949
|
applyLocation(destination);
|
|
7922
7950
|
if (options.scroll !== false) scheduleScroll(destination, from, null);
|
|
@@ -7929,17 +7957,14 @@ async function navigate(target2, options = {}) {
|
|
|
7929
7957
|
return true;
|
|
7930
7958
|
}
|
|
7931
7959
|
async function onHistoryChange(event) {
|
|
7960
|
+
if (writingHash) return;
|
|
7932
7961
|
const { path, query: query2, hash } = readLocation();
|
|
7933
7962
|
const destination = locationFor(path, query2, hash);
|
|
7934
7963
|
const from = snapshot();
|
|
7935
7964
|
if (destination.fullPath === from.fullPath) return;
|
|
7936
7965
|
const verdict = await runGuards(destination, from);
|
|
7937
7966
|
if (verdict === false) {
|
|
7938
|
-
|
|
7939
|
-
{ [HISTORY_KEY]: currentKey },
|
|
7940
|
-
"",
|
|
7941
|
-
buildUrl(from)
|
|
7942
|
-
);
|
|
7967
|
+
writeUrl({ [HISTORY_KEY]: currentKey }, buildUrl(from), true);
|
|
7943
7968
|
devtoolsBus.emit("navigation", {
|
|
7944
7969
|
from: from.fullPath,
|
|
7945
7970
|
to: destination.fullPath,
|
|
@@ -7982,6 +8007,8 @@ function stopRouter() {
|
|
|
7982
8007
|
window.removeEventListener("popstate", historyListener);
|
|
7983
8008
|
window.removeEventListener("hashchange", historyListener);
|
|
7984
8009
|
window.removeEventListener("beforeunload", saveScroll);
|
|
8010
|
+
historyRefused = false;
|
|
8011
|
+
writingHash = false;
|
|
7985
8012
|
}
|
|
7986
8013
|
async function enterInitialRoute() {
|
|
7987
8014
|
if (typeof window === "undefined") return;
|
|
@@ -8002,7 +8029,7 @@ async function enterInitialRoute() {
|
|
|
8002
8029
|
break;
|
|
8003
8030
|
}
|
|
8004
8031
|
currentKey = uid("rota");
|
|
8005
|
-
|
|
8032
|
+
writeUrl({ [HISTORY_KEY]: currentKey }, buildUrl(destination), true);
|
|
8006
8033
|
applyLocation(destination);
|
|
8007
8034
|
if (destination.hash) scheduleScroll(destination, from, null);
|
|
8008
8035
|
settings2.afterEach?.(snapshot(), from);
|
|
@@ -9841,7 +9868,7 @@ defineDirective("tooltip", ({ el, expression, cleanup }) => {
|
|
|
9841
9868
|
if (addedTabIndex) el.setAttribute("tabindex", "0");
|
|
9842
9869
|
let bubble = null;
|
|
9843
9870
|
let timer = null;
|
|
9844
|
-
const
|
|
9871
|
+
const build2 = () => {
|
|
9845
9872
|
const node = document.createElement("div");
|
|
9846
9873
|
node.className = "v-tooltip";
|
|
9847
9874
|
node.setAttribute("role", "tooltip");
|
|
@@ -9855,7 +9882,7 @@ defineDirective("tooltip", ({ el, expression, cleanup }) => {
|
|
|
9855
9882
|
};
|
|
9856
9883
|
const open = () => {
|
|
9857
9884
|
if (bubble) return;
|
|
9858
|
-
bubble =
|
|
9885
|
+
bubble = build2();
|
|
9859
9886
|
el.setAttribute("aria-describedby", bubble.id);
|
|
9860
9887
|
reposition();
|
|
9861
9888
|
requestAnimationFrame(() => bubble?.classList.add("v-in"));
|
|
@@ -11041,37 +11068,37 @@ init_reactivity();
|
|
|
11041
11068
|
init_registry();
|
|
11042
11069
|
init_style();
|
|
11043
11070
|
var messages = {
|
|
11044
|
-
required: "
|
|
11045
|
-
email: "
|
|
11046
|
-
url: "
|
|
11047
|
-
number: "
|
|
11048
|
-
integer: "
|
|
11049
|
-
decimal: "
|
|
11050
|
-
alpha: "Use
|
|
11051
|
-
alphanumeric: "Use
|
|
11052
|
-
minlength: "Use
|
|
11053
|
-
maxlength: "Use
|
|
11054
|
-
min: "
|
|
11055
|
-
max: "
|
|
11056
|
-
between: "
|
|
11057
|
-
match: "
|
|
11058
|
-
regex: "
|
|
11059
|
-
date: "
|
|
11060
|
-
after: "
|
|
11061
|
-
before: "
|
|
11062
|
-
accepted: "
|
|
11063
|
-
same: "
|
|
11064
|
-
different: "
|
|
11065
|
-
in: "
|
|
11066
|
-
notin: "
|
|
11067
|
-
phone: "
|
|
11068
|
-
cpf: "CPF
|
|
11069
|
-
cnpj: "CNPJ
|
|
11070
|
-
cep: "
|
|
11071
|
-
creditcard: "
|
|
11072
|
-
strongpassword: "Use {param}
|
|
11073
|
-
unique: "
|
|
11074
|
-
invalid: "
|
|
11071
|
+
required: "Please fill in this field.",
|
|
11072
|
+
email: "Enter a valid email address.",
|
|
11073
|
+
url: "Enter a valid URL.",
|
|
11074
|
+
number: "Enter a valid number.",
|
|
11075
|
+
integer: "Enter a whole number.",
|
|
11076
|
+
decimal: "Enter a valid decimal number.",
|
|
11077
|
+
alpha: "Use letters only.",
|
|
11078
|
+
alphanumeric: "Use letters and numbers only.",
|
|
11079
|
+
minlength: "Use at least {param} characters.",
|
|
11080
|
+
maxlength: "Use at most {param} characters.",
|
|
11081
|
+
min: "The smallest allowed value is {param}.",
|
|
11082
|
+
max: "The largest allowed value is {param}.",
|
|
11083
|
+
between: "Enter a value between {min} and {max}.",
|
|
11084
|
+
match: "The fields do not match.",
|
|
11085
|
+
regex: "That format is not valid.",
|
|
11086
|
+
date: "Enter a valid date.",
|
|
11087
|
+
after: "The date has to be later than {param}.",
|
|
11088
|
+
before: "The date has to be earlier than {param}.",
|
|
11089
|
+
accepted: "You have to tick this to continue.",
|
|
11090
|
+
same: "The values have to be the same.",
|
|
11091
|
+
different: "The values have to be different.",
|
|
11092
|
+
in: "Choose one of the allowed options.",
|
|
11093
|
+
notin: "That value is not allowed.",
|
|
11094
|
+
phone: "Enter a valid phone number, including the area code.",
|
|
11095
|
+
cpf: "Invalid CPF.",
|
|
11096
|
+
cnpj: "Invalid CNPJ.",
|
|
11097
|
+
cep: "Invalid postcode.",
|
|
11098
|
+
creditcard: "Invalid card number.",
|
|
11099
|
+
strongpassword: "Use {param} characters or more, with an upper case letter, a lower case letter, a number and a symbol.",
|
|
11100
|
+
unique: "That value is already taken.",
|
|
11101
|
+
invalid: "Invalid value."
|
|
11075
11102
|
};
|
|
11076
11103
|
function formatMessage(template, data2) {
|
|
11077
11104
|
const param = data2.param ?? "";
|
|
@@ -14444,7 +14471,7 @@ function normalize2(options, type) {
|
|
|
14444
14471
|
const labels2 = fromOptions ? options.labels.map((label) => String(label)) : [];
|
|
14445
14472
|
const series = [];
|
|
14446
14473
|
const raw = options.data;
|
|
14447
|
-
const singleName = options.name ?? "
|
|
14474
|
+
const singleName = options.name ?? "Value";
|
|
14448
14475
|
if (typeof raw === "number") {
|
|
14449
14476
|
series.push({ name: singleName, values: [raw], xs: null, color: palette2[0] });
|
|
14450
14477
|
} else if (Array.isArray(raw) && raw.length > 0) {
|
|
@@ -15174,7 +15201,7 @@ function draw(state2) {
|
|
|
15174
15201
|
const palette2 = options.colors && options.colors.length > 0 ? options.colors : CHART_COLORS;
|
|
15175
15202
|
const format = options.format ?? "number";
|
|
15176
15203
|
const width = Math.max(160, Math.round(el.clientWidth || options.width || 640));
|
|
15177
|
-
const height = Math.max(48, Math.round(options.height ?? defaultHeight(type)));
|
|
15204
|
+
const height = Math.max(48, Math.round(options.height ?? (el.clientHeight || defaultHeight(type))));
|
|
15178
15205
|
state2.lastWidth = width;
|
|
15179
15206
|
state2.viewWidth = width;
|
|
15180
15207
|
state2.viewHeight = height;
|
|
@@ -16026,7 +16053,7 @@ var CSS5 = `
|
|
|
16026
16053
|
@keyframes v-shimmer{0%{background-position:-180% 0}100%{background-position:180% 0}}
|
|
16027
16054
|
@keyframes v-indeterminate{0%{transform:translateX(-100%)}100%{transform:translateX(340%)}}
|
|
16028
16055
|
|
|
16029
|
-
/*
|
|
16056
|
+
/* ----------------------------------------------------------------- button */
|
|
16030
16057
|
.v-btn{appearance:none;-webkit-appearance:none;position:relative;display:inline-flex;
|
|
16031
16058
|
align-items:center;justify-content:center;gap:8px;vertical-align:middle;white-space:nowrap;
|
|
16032
16059
|
font-family:var(--v-font-sans);font-weight:600;line-height:1;text-decoration:none;
|
|
@@ -16070,7 +16097,7 @@ var CSS5 = `
|
|
|
16070
16097
|
.v-btn-spin{width:1em;height:1em;border-radius:50%;border:2px solid currentColor;
|
|
16071
16098
|
border-top-color:transparent;animation:v-spin .7s linear infinite;flex:none}
|
|
16072
16099
|
|
|
16073
|
-
/*
|
|
16100
|
+
/* ------------------------------------------------------------ icon button */
|
|
16074
16101
|
.v-icon-btn{appearance:none;-webkit-appearance:none;display:inline-grid;place-items:center;
|
|
16075
16102
|
border:1px solid transparent;border-radius:var(--v-radius-sm);cursor:pointer;
|
|
16076
16103
|
font-family:var(--v-font-sans);
|
|
@@ -16115,7 +16142,7 @@ var CSS5 = `
|
|
|
16115
16142
|
.v-card-foot:empty{display:none}
|
|
16116
16143
|
.v-card[data-padded="false"] .v-card-body{padding:0}
|
|
16117
16144
|
|
|
16118
|
-
/*
|
|
16145
|
+
/* ------------------------------------------------------------------- form */
|
|
16119
16146
|
.v-field{display:flex;flex-direction:column;gap:6px;font-family:var(--v-font-sans);min-width:0}
|
|
16120
16147
|
.v-label{display:inline-flex;align-items:center;gap:4px;font-size:13px;font-weight:600;
|
|
16121
16148
|
line-height:1.3;color:var(--v-text)}
|
|
@@ -16194,7 +16221,7 @@ var CSS5 = `
|
|
|
16194
16221
|
.v-select-opt.is-selected .v-select-check{opacity:1}
|
|
16195
16222
|
.v-select-empty{padding:14px 10px;text-align:center;font-size:13.5px;color:var(--v-text-muted)}
|
|
16196
16223
|
|
|
16197
|
-
/*
|
|
16224
|
+
/* --------------------------------------------- checkbox, radio and switch */
|
|
16198
16225
|
.v-check{display:inline-flex;align-items:flex-start;gap:9px;cursor:pointer;
|
|
16199
16226
|
font-family:var(--v-font-sans);font-size:14px;line-height:1.45;color:var(--v-text)}
|
|
16200
16227
|
.v-check[data-disabled="true"]{cursor:not-allowed;opacity:.6}
|
|
@@ -16231,7 +16258,7 @@ var CSS5 = `
|
|
|
16231
16258
|
.v-check[data-size="sm"] .v-switch-thumb{width:16px;height:16px}
|
|
16232
16259
|
.v-check[data-size="sm"] .v-check-native:checked+.v-switch-track .v-switch-thumb{transform:translateX(14px)}
|
|
16233
16260
|
|
|
16234
|
-
/*
|
|
16261
|
+
/* ------------------------------------------------------ badge, tag, alert */
|
|
16235
16262
|
.v-badge{display:inline-flex;align-items:center;gap:5px;font-family:var(--v-font-sans);
|
|
16236
16263
|
font-weight:600;line-height:1;border-radius:var(--v-radius-full);border:1px solid transparent;
|
|
16237
16264
|
white-space:nowrap;vertical-align:middle}
|
|
@@ -16308,7 +16335,7 @@ var CSS5 = `
|
|
|
16308
16335
|
.v-avatar-status[data-status="busy"]{background:var(--v-danger)}
|
|
16309
16336
|
.v-avatar-status[data-status="away"]{background:var(--v-warning)}
|
|
16310
16337
|
|
|
16311
|
-
/*
|
|
16338
|
+
/* --------------------------------------------------- spinner and skeleton */
|
|
16312
16339
|
.v-spinner{display:inline-block;border-radius:50%;border-style:solid;border-color:var(--v-border);
|
|
16313
16340
|
border-top-color:var(--v-primary);animation:v-spin .7s linear infinite;vertical-align:middle}
|
|
16314
16341
|
.v-spinner[data-tone="accent"]{border-top-color:var(--v-accent)}
|
|
@@ -16325,7 +16352,7 @@ var CSS5 = `
|
|
|
16325
16352
|
.v-skeleton[data-circle="true"]{border-radius:var(--v-radius-full)}
|
|
16326
16353
|
.v-skeleton-stack{display:flex;flex-direction:column;gap:8px}
|
|
16327
16354
|
|
|
16328
|
-
/*
|
|
16355
|
+
/* --------------------------------------------------------------- progress */
|
|
16329
16356
|
.v-progress{font-family:var(--v-font-sans);display:flex;flex-direction:column;gap:6px}
|
|
16330
16357
|
.v-progress-head{display:flex;justify-content:space-between;gap:12px;font-size:13px;color:var(--v-text-muted)}
|
|
16331
16358
|
.v-progress-value{font-weight:650;color:var(--v-text)}
|
|
@@ -16342,7 +16369,7 @@ var CSS5 = `
|
|
|
16342
16369
|
.v-progress[data-tone="danger"] .v-progress-bar{background:var(--v-danger)}
|
|
16343
16370
|
.v-progress[data-indeterminate="true"] .v-progress-bar{width:30% !important;animation:v-indeterminate 1.3s var(--v-ease) infinite}
|
|
16344
16371
|
|
|
16345
|
-
/*
|
|
16372
|
+
/* ---------------------------------------------------------------- divider */
|
|
16346
16373
|
.v-divider{display:flex;align-items:center;gap:12px;color:var(--v-text-soft);
|
|
16347
16374
|
font-family:var(--v-font-sans);font-size:12.5px;font-weight:600;margin:16px 0}
|
|
16348
16375
|
.v-divider::before,.v-divider::after{content:"";flex:1;height:1px;background:var(--v-border)}
|
|
@@ -16350,7 +16377,7 @@ var CSS5 = `
|
|
|
16350
16377
|
.v-divider[data-vertical="true"]{flex-direction:column;margin:0 16px;align-self:stretch;height:auto}
|
|
16351
16378
|
.v-divider[data-vertical="true"]::before,.v-divider[data-vertical="true"]::after{width:1px;height:auto;flex:1}
|
|
16352
16379
|
|
|
16353
|
-
/*
|
|
16380
|
+
/* ------------------------------------------------------------------ table */
|
|
16354
16381
|
.v-table-wrap{width:100%;overflow-x:auto;background:var(--v-surface);border:1px solid var(--v-border);
|
|
16355
16382
|
border-radius:var(--v-radius);font-family:var(--v-font-sans)}
|
|
16356
16383
|
.v-table{width:100%;border-collapse:collapse;font-size:14px;color:var(--v-text)}
|
|
@@ -16371,7 +16398,7 @@ var CSS5 = `
|
|
|
16371
16398
|
.v-th[aria-sort="ascending"] .v-th-arrow,.v-th[aria-sort="descending"] .v-th-arrow{opacity:1;color:var(--v-primary)}
|
|
16372
16399
|
.v-table-empty{text-align:center;color:var(--v-text-muted);padding:34px 14px;font-size:14px}
|
|
16373
16400
|
|
|
16374
|
-
/*
|
|
16401
|
+
/* ------------------------------------------------------------- pagination */
|
|
16375
16402
|
.v-pagination{display:flex;align-items:center;gap:6px;flex-wrap:wrap;font-family:var(--v-font-sans)}
|
|
16376
16403
|
.v-page{appearance:none;min-width:34px;height:34px;padding:0 9px;display:inline-grid;place-items:center;
|
|
16377
16404
|
background:transparent;border:1px solid transparent;border-radius:var(--v-radius-sm);
|
|
@@ -16383,7 +16410,7 @@ var CSS5 = `
|
|
|
16383
16410
|
.v-page[aria-current="page"]{background:var(--v-primary);border-color:var(--v-primary);color:var(--v-primary-contrast)}
|
|
16384
16411
|
.v-page-gap{min-width:24px;text-align:center;color:var(--v-text-soft);user-select:none}
|
|
16385
16412
|
|
|
16386
|
-
/*
|
|
16413
|
+
/* ------------------------------------------------------------- breadcrumb */
|
|
16387
16414
|
.v-breadcrumb{font-family:var(--v-font-sans);font-size:13.5px}
|
|
16388
16415
|
.v-breadcrumb-list{list-style:none;display:flex;flex-wrap:wrap;align-items:center;gap:6px;margin:0;padding:0}
|
|
16389
16416
|
.v-breadcrumb-item{display:inline-flex;align-items:center;gap:6px;color:var(--v-text-muted)}
|
|
@@ -16393,7 +16420,7 @@ var CSS5 = `
|
|
|
16393
16420
|
.v-breadcrumb-item[aria-current="page"]{color:var(--v-text);font-weight:600}
|
|
16394
16421
|
.v-breadcrumb-sep{color:var(--v-text-soft);user-select:none}
|
|
16395
16422
|
|
|
16396
|
-
/*
|
|
16423
|
+
/* ------------------------------------------------------------------- stat */
|
|
16397
16424
|
.v-stat{display:flex;gap:14px;align-items:flex-start;padding:16px 18px;background:var(--v-surface);
|
|
16398
16425
|
border:1px solid var(--v-border);border-radius:var(--v-radius);font-family:var(--v-font-sans)}
|
|
16399
16426
|
.v-stat-icon{flex:none;width:40px;height:40px;display:grid;place-items:center;font-size:19px;
|
|
@@ -16411,7 +16438,7 @@ var CSS5 = `
|
|
|
16411
16438
|
.v-stat-delta[data-dir="flat"]{background:var(--v-surface-3);color:var(--v-text-muted)}
|
|
16412
16439
|
.v-stat-hint{font-size:12.5px;color:var(--v-text-muted)}
|
|
16413
16440
|
|
|
16414
|
-
/*
|
|
16441
|
+
/* ------------------------------------------------------------ empty state */
|
|
16415
16442
|
.v-empty{display:flex;flex-direction:column;align-items:center;text-align:center;gap:10px;
|
|
16416
16443
|
padding:44px 22px;font-family:var(--v-font-sans);color:var(--v-text)}
|
|
16417
16444
|
.v-empty-icon{width:58px;height:58px;display:grid;place-items:center;font-size:27px;
|
|
@@ -16421,7 +16448,7 @@ var CSS5 = `
|
|
|
16421
16448
|
.v-empty-actions{margin-top:6px;display:flex;gap:10px;flex-wrap:wrap;justify-content:center}
|
|
16422
16449
|
.v-empty-actions:empty{display:none}
|
|
16423
16450
|
|
|
16424
|
-
/*
|
|
16451
|
+
/* --------------------------------------------------------------- timeline */
|
|
16425
16452
|
.v-timeline{list-style:none;margin:0;padding:0;font-family:var(--v-font-sans);
|
|
16426
16453
|
display:flex;flex-direction:column}
|
|
16427
16454
|
.v-timeline-item{position:relative;display:flex;gap:14px;padding-bottom:20px}
|
|
@@ -16441,7 +16468,7 @@ var CSS5 = `
|
|
|
16441
16468
|
.v-timeline-desc{margin:3px 0 0;font-size:13.5px;line-height:1.55;color:var(--v-text-muted)}
|
|
16442
16469
|
.v-timeline-time{display:block;margin-top:3px;font-size:12px;color:var(--v-text-soft)}
|
|
16443
16470
|
|
|
16444
|
-
/*
|
|
16471
|
+
/* ------------------------------------------------------------------ steps */
|
|
16445
16472
|
.v-steps{display:flex;gap:0;font-family:var(--v-font-sans);list-style:none;margin:0;padding:0}
|
|
16446
16473
|
.v-steps[data-vertical="true"]{flex-direction:column;gap:4px}
|
|
16447
16474
|
.v-step{flex:1;display:flex;align-items:flex-start;gap:10px;min-width:0;position:relative;padding-right:12px}
|
|
@@ -16460,7 +16487,7 @@ var CSS5 = `
|
|
|
16460
16487
|
.v-steps[data-vertical="true"] .v-step-line{left:13px;right:auto;top:30px;bottom:2px;width:2px;height:auto}
|
|
16461
16488
|
.v-step:last-child .v-step-line{display:none}
|
|
16462
16489
|
|
|
16463
|
-
/*
|
|
16490
|
+
/* ----------------------------------------------------------------- rating */
|
|
16464
16491
|
.v-rating{display:inline-flex;align-items:center;gap:6px;font-family:var(--v-font-sans)}
|
|
16465
16492
|
.v-rating-stars{display:inline-flex;gap:2px}
|
|
16466
16493
|
.v-star{appearance:none;background:none;border:0;padding:2px;cursor:pointer;line-height:0;
|
|
@@ -16487,7 +16514,7 @@ var CSS5 = `
|
|
|
16487
16514
|
.v-tip[data-placement="right"]{left:calc(100% + 8px);top:50%;translate:0 -50%}
|
|
16488
16515
|
.v-tipwrap:hover .v-tip,.v-tipwrap:focus-within .v-tip{opacity:1;transform:none}
|
|
16489
16516
|
|
|
16490
|
-
/*
|
|
16517
|
+
/* ------------------------------------------------------------------- code */
|
|
16491
16518
|
.v-code{position:relative;background:var(--v-surface-inset);border:1px solid var(--v-border);
|
|
16492
16519
|
border-radius:var(--v-radius);overflow:hidden;font-family:var(--v-font-mono)}
|
|
16493
16520
|
.v-code-head{display:flex;align-items:center;justify-content:space-between;gap:10px;
|
|
@@ -17488,7 +17515,7 @@ register("v-table", {
|
|
|
17488
17515
|
props: {
|
|
17489
17516
|
columns: { type: "any", default: "" },
|
|
17490
17517
|
rows: { type: "any", default: "" },
|
|
17491
|
-
empty: { type: "string", default: "
|
|
17518
|
+
empty: { type: "string", default: "No records found" },
|
|
17492
17519
|
sortable: { type: "any", default: true },
|
|
17493
17520
|
dense: BOOL,
|
|
17494
17521
|
striped: BOOL,
|
|
@@ -17598,9 +17625,9 @@ register("v-pagination", {
|
|
|
17598
17625
|
total: { type: "number", default: 0 },
|
|
17599
17626
|
perPage: { type: "number", default: 10 },
|
|
17600
17627
|
siblings: { type: "number", default: 1 },
|
|
17601
|
-
previousLabel: { type: "string", default: "
|
|
17602
|
-
nextLabel: { type: "string", default: "
|
|
17603
|
-
ariaLabel: { type: "string", default: "
|
|
17628
|
+
previousLabel: { type: "string", default: "Previous" },
|
|
17629
|
+
nextLabel: { type: "string", default: "Next" },
|
|
17630
|
+
ariaLabel: { type: "string", default: "Pagination" }
|
|
17604
17631
|
},
|
|
17605
17632
|
computed: {
|
|
17606
17633
|
lastPage() {
|
|
@@ -17614,7 +17641,7 @@ register("v-pagination", {
|
|
|
17614
17641
|
const value = Number(this.page) || 1;
|
|
17615
17642
|
return Math.min(Math.max(1, Math.round(value)), this.lastPage);
|
|
17616
17643
|
},
|
|
17617
|
-
/**
|
|
17644
|
+
/** Visible page numbers, with `0` marking the ellipsis. */
|
|
17618
17645
|
items() {
|
|
17619
17646
|
const last = this.lastPage;
|
|
17620
17647
|
const current2 = this.currentPage;
|
|
@@ -17659,7 +17686,7 @@ register("v-pagination", {
|
|
|
17659
17686
|
<template v-for="(item, index) in items" :key="index">
|
|
17660
17687
|
<span class="v-page-gap" v-if="item === 0" aria-hidden="true">...</span>
|
|
17661
17688
|
<button type="button" class="v-page" v-if="item !== 0" :aria-current="isCurrent(item)"
|
|
17662
|
-
:aria-label="'
|
|
17689
|
+
:aria-label="'Page ' + item" v-click="go(item)" v-text="item"></button>
|
|
17663
17690
|
</template>
|
|
17664
17691
|
<button type="button" class="v-page" :disabled="currentPage >= lastPage"
|
|
17665
17692
|
:aria-label="nextLabel" v-click="go(currentPage + 1)" v-html="svgIcon('chevron-right')"></button>
|
|
@@ -17691,7 +17718,7 @@ register("v-breadcrumb", {
|
|
|
17691
17718
|
props: {
|
|
17692
17719
|
items: { type: "any", default: "" },
|
|
17693
17720
|
separator: { type: "string", default: "/" },
|
|
17694
|
-
ariaLabel: { type: "string", default: "
|
|
17721
|
+
ariaLabel: { type: "string", default: "Breadcrumb" }
|
|
17695
17722
|
},
|
|
17696
17723
|
computed: {
|
|
17697
17724
|
crumbs() {
|
|
@@ -17724,7 +17751,7 @@ register("v-stat", {
|
|
|
17724
17751
|
hint: TEXT,
|
|
17725
17752
|
icon: TEXT,
|
|
17726
17753
|
suffix: { type: "string", default: "%" },
|
|
17727
|
-
/**
|
|
17754
|
+
/** When `true`, a negative change counts as positive. */
|
|
17728
17755
|
inverted: BOOL
|
|
17729
17756
|
},
|
|
17730
17757
|
computed: {
|
|
@@ -17777,7 +17804,7 @@ register("v-stat", {
|
|
|
17777
17804
|
register("v-empty-state", {
|
|
17778
17805
|
props: {
|
|
17779
17806
|
icon: { type: "string", default: "inbox" },
|
|
17780
|
-
title: { type: "string", default: "
|
|
17807
|
+
title: { type: "string", default: "Nothing here yet" },
|
|
17781
17808
|
description: TEXT
|
|
17782
17809
|
},
|
|
17783
17810
|
template: `
|
|
@@ -17848,7 +17875,7 @@ register("v-steps", {
|
|
|
17848
17875
|
steps: { type: "any", default: "" },
|
|
17849
17876
|
current: { type: "number", default: 0 },
|
|
17850
17877
|
vertical: BOOL,
|
|
17851
|
-
ariaLabel: { type: "string", default: "
|
|
17878
|
+
ariaLabel: { type: "string", default: "Steps" }
|
|
17852
17879
|
},
|
|
17853
17880
|
computed: {
|
|
17854
17881
|
...flags("vertical"),
|
|
@@ -17892,7 +17919,7 @@ register("v-rating", {
|
|
|
17892
17919
|
value: { type: "number", default: 0 },
|
|
17893
17920
|
max: { type: "number", default: 5 },
|
|
17894
17921
|
size: { type: "string", default: "md" },
|
|
17895
|
-
label: { type: "string", default: "
|
|
17922
|
+
label: { type: "string", default: "Rating" },
|
|
17896
17923
|
readonly: BOOL,
|
|
17897
17924
|
disabled: BOOL,
|
|
17898
17925
|
showValue: BOOL,
|
|
@@ -17918,7 +17945,7 @@ register("v-rating", {
|
|
|
17918
17945
|
return this.hovered > 0 ? this.hovered : this.score;
|
|
17919
17946
|
},
|
|
17920
17947
|
valueText() {
|
|
17921
|
-
return `${this.score}
|
|
17948
|
+
return `${this.score} of ${this.total}`;
|
|
17922
17949
|
}
|
|
17923
17950
|
},
|
|
17924
17951
|
methods: {
|
|
@@ -17974,7 +18001,7 @@ register("v-rating", {
|
|
|
17974
18001
|
:tabindex="locked ? -1 : 0" :aria-readonly="locked" v-keydown="onKey" v-mouseleave="reset">
|
|
17975
18002
|
<span class="v-rating-stars">
|
|
17976
18003
|
<button type="button" class="v-star" v-for="index in total" :key="index"
|
|
17977
|
-
:data-on="isOn(index)" :disabled="locked" :aria-label="index + '
|
|
18004
|
+
:data-on="isOn(index)" :disabled="locked" :aria-label="index + ' of ' + total"
|
|
17978
18005
|
:tabindex="-1" v-click="pick(index)" v-mouseenter="preview(index)"
|
|
17979
18006
|
v-html="svgIcon('star')"></button>
|
|
17980
18007
|
</span>
|
|
@@ -18042,8 +18069,8 @@ register("v-code-block", {
|
|
|
18042
18069
|
code: TEXT,
|
|
18043
18070
|
language: TEXT,
|
|
18044
18071
|
filename: TEXT,
|
|
18045
|
-
copyLabel: { type: "string", default: "
|
|
18046
|
-
copiedLabel: { type: "string", default: "
|
|
18072
|
+
copyLabel: { type: "string", default: "Copy" },
|
|
18073
|
+
copiedLabel: { type: "string", default: "Copied" },
|
|
18047
18074
|
wrap: BOOL
|
|
18048
18075
|
},
|
|
18049
18076
|
state() {
|
|
@@ -18383,7 +18410,7 @@ function openDialog(request2) {
|
|
|
18383
18410
|
source.remove();
|
|
18384
18411
|
}
|
|
18385
18412
|
sourceAnchors.delete(source);
|
|
18386
|
-
if (source
|
|
18413
|
+
if (hasDirective(source, "modal-content")) {
|
|
18387
18414
|
source.setAttribute("hidden", "");
|
|
18388
18415
|
}
|
|
18389
18416
|
}
|
|
@@ -20385,14 +20412,14 @@ function xray(force) {
|
|
|
20385
20412
|
|
|
20386
20413
|
// src/devtools/launcher.ts
|
|
20387
20414
|
init_style();
|
|
20388
|
-
var
|
|
20389
|
-
var
|
|
20390
|
-
var
|
|
20415
|
+
var POSITION_KEY = "voodoo:devtools:widget-position";
|
|
20416
|
+
var HIDDEN_KEY = "voodoo:devtools:widget-hidden";
|
|
20417
|
+
var DRAG_THRESHOLD = 4;
|
|
20391
20418
|
var refs2 = null;
|
|
20392
|
-
var
|
|
20393
|
-
var
|
|
20394
|
-
var
|
|
20395
|
-
var
|
|
20419
|
+
var mounted = false;
|
|
20420
|
+
var counterTimer = 0;
|
|
20421
|
+
var pulseTimer = 0;
|
|
20422
|
+
var teardown2 = [];
|
|
20396
20423
|
var WIDGET_CSS = `
|
|
20397
20424
|
.v-devtools-widget{
|
|
20398
20425
|
all: initial;
|
|
@@ -20525,220 +20552,220 @@ var WIDGET_CSS = `
|
|
|
20525
20552
|
.v-devtools-btn:hover{transform:none}
|
|
20526
20553
|
}
|
|
20527
20554
|
`;
|
|
20528
|
-
var
|
|
20555
|
+
var MARK = `<svg class="v-devtools-mark" viewBox="0 0 24 24" fill="none" aria-hidden="true">
|
|
20529
20556
|
<path d="M4 4l8 16 8-16" stroke="#6D3BF5" stroke-width="2.4" stroke-linecap="round" stroke-linejoin="round"/>
|
|
20530
20557
|
<circle cx="12" cy="7.5" r="2" fill="#FF3D8B"/>
|
|
20531
20558
|
</svg>`;
|
|
20532
|
-
function
|
|
20559
|
+
function readPosition() {
|
|
20533
20560
|
try {
|
|
20534
|
-
const
|
|
20535
|
-
if (!
|
|
20536
|
-
const
|
|
20537
|
-
if (typeof
|
|
20538
|
-
return
|
|
20561
|
+
const raw = localStorage.getItem(POSITION_KEY);
|
|
20562
|
+
if (!raw) return null;
|
|
20563
|
+
const value = JSON.parse(raw);
|
|
20564
|
+
if (typeof value?.x !== "number" || typeof value?.y !== "number") return null;
|
|
20565
|
+
return value;
|
|
20539
20566
|
} catch {
|
|
20540
20567
|
return null;
|
|
20541
20568
|
}
|
|
20542
20569
|
}
|
|
20543
|
-
function
|
|
20570
|
+
function writePosition(pos) {
|
|
20544
20571
|
try {
|
|
20545
|
-
localStorage.setItem(
|
|
20572
|
+
localStorage.setItem(POSITION_KEY, JSON.stringify(pos));
|
|
20546
20573
|
} catch {
|
|
20547
20574
|
}
|
|
20548
20575
|
}
|
|
20549
|
-
function
|
|
20550
|
-
const
|
|
20551
|
-
const
|
|
20552
|
-
const x = Math.min(Math.max(8, pos.x), Math.max(8, window.innerWidth -
|
|
20553
|
-
const y = Math.min(Math.max(8, pos.y), Math.max(8, window.innerHeight -
|
|
20554
|
-
|
|
20555
|
-
|
|
20556
|
-
|
|
20557
|
-
|
|
20558
|
-
}
|
|
20559
|
-
function
|
|
20560
|
-
const
|
|
20561
|
-
|
|
20562
|
-
|
|
20563
|
-
const
|
|
20564
|
-
|
|
20565
|
-
|
|
20566
|
-
|
|
20567
|
-
|
|
20568
|
-
|
|
20569
|
-
|
|
20570
|
-
const
|
|
20571
|
-
|
|
20572
|
-
|
|
20573
|
-
const
|
|
20574
|
-
|
|
20575
|
-
|
|
20576
|
-
const
|
|
20577
|
-
|
|
20578
|
-
|
|
20579
|
-
|
|
20580
|
-
const
|
|
20581
|
-
|
|
20582
|
-
|
|
20583
|
-
|
|
20584
|
-
|
|
20585
|
-
|
|
20586
|
-
|
|
20587
|
-
document.body.appendChild(
|
|
20588
|
-
const
|
|
20589
|
-
if (
|
|
20590
|
-
|
|
20576
|
+
function applyPosition(root, pos) {
|
|
20577
|
+
const width = root.offsetWidth || 120;
|
|
20578
|
+
const height = root.offsetHeight || 38;
|
|
20579
|
+
const x = Math.min(Math.max(8, pos.x), Math.max(8, window.innerWidth - width - 8));
|
|
20580
|
+
const y = Math.min(Math.max(8, pos.y), Math.max(8, window.innerHeight - height - 8));
|
|
20581
|
+
root.style.left = `${x}px`;
|
|
20582
|
+
root.style.top = `${y}px`;
|
|
20583
|
+
root.style.right = "auto";
|
|
20584
|
+
root.style.bottom = "auto";
|
|
20585
|
+
}
|
|
20586
|
+
function build() {
|
|
20587
|
+
const root = document.createElement("div");
|
|
20588
|
+
root.className = "v-devtools-widget";
|
|
20589
|
+
root.setAttribute("data-voodoo-devtools", "widget");
|
|
20590
|
+
const button = document.createElement("button");
|
|
20591
|
+
button.type = "button";
|
|
20592
|
+
button.className = "v-devtools-btn";
|
|
20593
|
+
button.setAttribute("aria-label", "Open Voodoo devtools (Ctrl+Shift+X)");
|
|
20594
|
+
button.setAttribute("aria-pressed", "false");
|
|
20595
|
+
button.title = "Voodoo devtools \u2014 click to inspect, drag to move (Ctrl+Shift+X)";
|
|
20596
|
+
button.innerHTML = MARK;
|
|
20597
|
+
const label = document.createElement("span");
|
|
20598
|
+
label.className = "v-devtools-label";
|
|
20599
|
+
label.textContent = "Voodoo";
|
|
20600
|
+
const counter2 = document.createElement("span");
|
|
20601
|
+
counter2.className = "v-devtools-count";
|
|
20602
|
+
counter2.textContent = "0";
|
|
20603
|
+
const pulse = document.createElement("span");
|
|
20604
|
+
pulse.className = "v-devtools-pulse";
|
|
20605
|
+
pulse.setAttribute("data-on", "false");
|
|
20606
|
+
button.append(label, counter2, pulse);
|
|
20607
|
+
const close = document.createElement("button");
|
|
20608
|
+
close.type = "button";
|
|
20609
|
+
close.className = "v-devtools-close";
|
|
20610
|
+
close.setAttribute("aria-label", "Hide the devtools widget in this tab");
|
|
20611
|
+
close.title = "Hide in this tab";
|
|
20612
|
+
close.textContent = "\xD7";
|
|
20613
|
+
root.append(button, close);
|
|
20614
|
+
document.body.appendChild(root);
|
|
20615
|
+
const saved = readPosition();
|
|
20616
|
+
if (saved) {
|
|
20617
|
+
applyPosition(root, saved);
|
|
20591
20618
|
} else {
|
|
20592
|
-
|
|
20593
|
-
|
|
20594
|
-
}
|
|
20595
|
-
return {
|
|
20596
|
-
}
|
|
20597
|
-
function
|
|
20598
|
-
let
|
|
20599
|
-
let
|
|
20600
|
-
let
|
|
20601
|
-
let
|
|
20602
|
-
let
|
|
20603
|
-
let
|
|
20604
|
-
const
|
|
20605
|
-
if (
|
|
20606
|
-
const
|
|
20607
|
-
|
|
20608
|
-
|
|
20609
|
-
|
|
20610
|
-
|
|
20611
|
-
|
|
20612
|
-
|
|
20613
|
-
refs3.
|
|
20619
|
+
root.style.right = "16px";
|
|
20620
|
+
root.style.bottom = "16px";
|
|
20621
|
+
}
|
|
20622
|
+
return { root, button, pulse, counter: counter2, close };
|
|
20623
|
+
}
|
|
20624
|
+
function enableDrag(refs3, onClick) {
|
|
20625
|
+
let dragging = false;
|
|
20626
|
+
let moved = false;
|
|
20627
|
+
let offsetX = 0;
|
|
20628
|
+
let offsetY = 0;
|
|
20629
|
+
let startX = 0;
|
|
20630
|
+
let startY = 0;
|
|
20631
|
+
const onPointerDown = (event) => {
|
|
20632
|
+
if (event.button !== 0) return;
|
|
20633
|
+
const box = refs3.root.getBoundingClientRect();
|
|
20634
|
+
dragging = true;
|
|
20635
|
+
moved = false;
|
|
20636
|
+
startX = event.clientX;
|
|
20637
|
+
startY = event.clientY;
|
|
20638
|
+
offsetX = event.clientX - box.left;
|
|
20639
|
+
offsetY = event.clientY - box.top;
|
|
20640
|
+
refs3.button.setPointerCapture?.(event.pointerId);
|
|
20614
20641
|
};
|
|
20615
|
-
const
|
|
20616
|
-
if (!
|
|
20617
|
-
const
|
|
20618
|
-
if (!
|
|
20619
|
-
|
|
20620
|
-
|
|
20621
|
-
|
|
20642
|
+
const onPointerMove2 = (event) => {
|
|
20643
|
+
if (!dragging) return;
|
|
20644
|
+
const distance = Math.hypot(event.clientX - startX, event.clientY - startY);
|
|
20645
|
+
if (!moved && distance < DRAG_THRESHOLD) return;
|
|
20646
|
+
moved = true;
|
|
20647
|
+
event.preventDefault();
|
|
20648
|
+
applyPosition(refs3.root, { x: event.clientX - offsetX, y: event.clientY - offsetY });
|
|
20622
20649
|
};
|
|
20623
|
-
const
|
|
20624
|
-
if (!
|
|
20625
|
-
|
|
20626
|
-
refs3.
|
|
20627
|
-
if (!
|
|
20628
|
-
|
|
20650
|
+
const onPointerUp = (event) => {
|
|
20651
|
+
if (!dragging) return;
|
|
20652
|
+
dragging = false;
|
|
20653
|
+
refs3.button.releasePointerCapture?.(event.pointerId);
|
|
20654
|
+
if (!moved) {
|
|
20655
|
+
onClick();
|
|
20629
20656
|
return;
|
|
20630
20657
|
}
|
|
20631
|
-
const
|
|
20632
|
-
|
|
20658
|
+
const box = refs3.root.getBoundingClientRect();
|
|
20659
|
+
writePosition({ x: box.left, y: box.top });
|
|
20633
20660
|
};
|
|
20634
|
-
const
|
|
20635
|
-
if (
|
|
20636
|
-
|
|
20637
|
-
|
|
20661
|
+
const onKeyDown = (event) => {
|
|
20662
|
+
if (event.key !== "Enter" && event.key !== " ") return;
|
|
20663
|
+
event.preventDefault();
|
|
20664
|
+
onClick();
|
|
20638
20665
|
};
|
|
20639
|
-
const
|
|
20640
|
-
const
|
|
20641
|
-
if (refs3.
|
|
20666
|
+
const onResize = () => {
|
|
20667
|
+
const box = refs3.root.getBoundingClientRect();
|
|
20668
|
+
if (refs3.root.style.left) applyPosition(refs3.root, { x: box.left, y: box.top });
|
|
20642
20669
|
};
|
|
20643
|
-
refs3.
|
|
20644
|
-
refs3.
|
|
20645
|
-
refs3.
|
|
20646
|
-
refs3.
|
|
20647
|
-
refs3.
|
|
20648
|
-
window.addEventListener("resize",
|
|
20670
|
+
refs3.button.addEventListener("pointerdown", onPointerDown);
|
|
20671
|
+
refs3.button.addEventListener("pointermove", onPointerMove2);
|
|
20672
|
+
refs3.button.addEventListener("pointerup", onPointerUp);
|
|
20673
|
+
refs3.button.addEventListener("pointercancel", onPointerUp);
|
|
20674
|
+
refs3.button.addEventListener("keydown", onKeyDown);
|
|
20675
|
+
window.addEventListener("resize", onResize);
|
|
20649
20676
|
return () => {
|
|
20650
|
-
refs3.
|
|
20651
|
-
refs3.
|
|
20652
|
-
refs3.
|
|
20653
|
-
refs3.
|
|
20654
|
-
refs3.
|
|
20655
|
-
window.removeEventListener("resize",
|
|
20677
|
+
refs3.button.removeEventListener("pointerdown", onPointerDown);
|
|
20678
|
+
refs3.button.removeEventListener("pointermove", onPointerMove2);
|
|
20679
|
+
refs3.button.removeEventListener("pointerup", onPointerUp);
|
|
20680
|
+
refs3.button.removeEventListener("pointercancel", onPointerUp);
|
|
20681
|
+
refs3.button.removeEventListener("keydown", onKeyDown);
|
|
20682
|
+
window.removeEventListener("resize", onResize);
|
|
20656
20683
|
};
|
|
20657
20684
|
}
|
|
20658
|
-
function
|
|
20685
|
+
function blink() {
|
|
20659
20686
|
if (!refs2) return;
|
|
20660
|
-
refs2.
|
|
20661
|
-
window.clearTimeout(
|
|
20662
|
-
|
|
20663
|
-
refs2?.
|
|
20687
|
+
refs2.pulse.setAttribute("data-on", "true");
|
|
20688
|
+
window.clearTimeout(pulseTimer);
|
|
20689
|
+
pulseTimer = window.setTimeout(() => {
|
|
20690
|
+
refs2?.pulse.setAttribute("data-on", "false");
|
|
20664
20691
|
}, 320);
|
|
20665
20692
|
}
|
|
20666
|
-
function
|
|
20693
|
+
function updateCounter() {
|
|
20667
20694
|
if (!refs2) return;
|
|
20668
20695
|
const total = instances.size;
|
|
20669
|
-
const
|
|
20670
|
-
if (refs2.
|
|
20696
|
+
const text = total === 1 ? "1 component" : `${total} components`;
|
|
20697
|
+
if (refs2.counter.textContent !== text) refs2.counter.textContent = text;
|
|
20671
20698
|
}
|
|
20672
20699
|
function mountDevtoolsWidget() {
|
|
20673
|
-
if (
|
|
20700
|
+
if (mounted || typeof document === "undefined" || !document.body) return;
|
|
20674
20701
|
try {
|
|
20675
|
-
if (sessionStorage.getItem(
|
|
20702
|
+
if (sessionStorage.getItem(HIDDEN_KEY) === "1") return;
|
|
20676
20703
|
} catch {
|
|
20677
20704
|
}
|
|
20678
|
-
|
|
20705
|
+
mounted = true;
|
|
20679
20706
|
injectStyle("devtools-widget", WIDGET_CSS);
|
|
20680
|
-
refs2 =
|
|
20681
|
-
const
|
|
20682
|
-
const
|
|
20683
|
-
refs2?.
|
|
20684
|
-
refs2?.
|
|
20707
|
+
refs2 = build();
|
|
20708
|
+
const toggle = () => {
|
|
20709
|
+
const enabled2 = xray();
|
|
20710
|
+
refs2?.root.setAttribute("data-active", String(enabled2));
|
|
20711
|
+
refs2?.button.setAttribute("aria-pressed", String(enabled2));
|
|
20685
20712
|
};
|
|
20686
|
-
|
|
20687
|
-
const
|
|
20688
|
-
|
|
20713
|
+
teardown2.push(enableDrag(refs2, toggle));
|
|
20714
|
+
const onClose = (event) => {
|
|
20715
|
+
event.stopPropagation();
|
|
20689
20716
|
try {
|
|
20690
|
-
sessionStorage.setItem(
|
|
20717
|
+
sessionStorage.setItem(HIDDEN_KEY, "1");
|
|
20691
20718
|
} catch {
|
|
20692
20719
|
}
|
|
20693
20720
|
unmountDevtoolsWidget();
|
|
20694
20721
|
console.info("[Voodoo] devtools widget hidden. Use V.devtoolsWidget(true) to bring back.");
|
|
20695
20722
|
};
|
|
20696
|
-
refs2.
|
|
20697
|
-
|
|
20698
|
-
const
|
|
20699
|
-
const
|
|
20700
|
-
refs2?.
|
|
20701
|
-
refs2?.
|
|
20723
|
+
refs2.close.addEventListener("click", onClose);
|
|
20724
|
+
teardown2.push(() => refs2?.close.removeEventListener("click", onClose));
|
|
20725
|
+
const onGlobalKeyUp = () => {
|
|
20726
|
+
const enabled2 = isXrayEnabled();
|
|
20727
|
+
refs2?.root.setAttribute("data-active", String(enabled2));
|
|
20728
|
+
refs2?.button.setAttribute("aria-pressed", String(enabled2));
|
|
20702
20729
|
};
|
|
20703
|
-
document.addEventListener("keyup",
|
|
20704
|
-
|
|
20705
|
-
for (const
|
|
20706
|
-
|
|
20730
|
+
document.addEventListener("keyup", onGlobalKeyUp);
|
|
20731
|
+
teardown2.push(() => document.removeEventListener("keyup", onGlobalKeyUp));
|
|
20732
|
+
for (const type of ["network", "event", "navigation", "update"]) {
|
|
20733
|
+
teardown2.push(devtoolsBus.on(type, blink));
|
|
20707
20734
|
}
|
|
20708
|
-
|
|
20709
|
-
|
|
20735
|
+
updateCounter();
|
|
20736
|
+
counterTimer = window.setInterval(updateCounter, 1e3);
|
|
20710
20737
|
}
|
|
20711
20738
|
function unmountDevtoolsWidget() {
|
|
20712
|
-
if (!
|
|
20713
|
-
|
|
20714
|
-
for (const fn of
|
|
20739
|
+
if (!mounted) return;
|
|
20740
|
+
mounted = false;
|
|
20741
|
+
for (const fn of teardown2.splice(0)) {
|
|
20715
20742
|
try {
|
|
20716
20743
|
fn();
|
|
20717
20744
|
} catch {
|
|
20718
20745
|
}
|
|
20719
20746
|
}
|
|
20720
|
-
window.clearInterval(
|
|
20721
|
-
window.clearTimeout(
|
|
20722
|
-
|
|
20723
|
-
|
|
20724
|
-
refs2?.
|
|
20747
|
+
window.clearInterval(counterTimer);
|
|
20748
|
+
window.clearTimeout(pulseTimer);
|
|
20749
|
+
counterTimer = 0;
|
|
20750
|
+
pulseTimer = 0;
|
|
20751
|
+
refs2?.root.remove();
|
|
20725
20752
|
refs2 = null;
|
|
20726
20753
|
}
|
|
20727
20754
|
function isDevtoolsWidgetMounted() {
|
|
20728
|
-
return
|
|
20755
|
+
return mounted;
|
|
20729
20756
|
}
|
|
20730
20757
|
function devtoolsWidget(force) {
|
|
20731
|
-
const
|
|
20732
|
-
if (
|
|
20758
|
+
const target2 = force ?? !mounted;
|
|
20759
|
+
if (target2) {
|
|
20733
20760
|
try {
|
|
20734
|
-
sessionStorage.removeItem(
|
|
20761
|
+
sessionStorage.removeItem(HIDDEN_KEY);
|
|
20735
20762
|
} catch {
|
|
20736
20763
|
}
|
|
20737
20764
|
mountDevtoolsWidget();
|
|
20738
20765
|
} else {
|
|
20739
20766
|
unmountDevtoolsWidget();
|
|
20740
20767
|
}
|
|
20741
|
-
return
|
|
20768
|
+
return mounted;
|
|
20742
20769
|
}
|
|
20743
20770
|
|
|
20744
20771
|
// src/index.ts
|
|
@@ -22760,20 +22787,20 @@ function buildFrame2(gpu2, encoder, relogio) {
|
|
|
22760
22787
|
};
|
|
22761
22788
|
return frameObj;
|
|
22762
22789
|
}
|
|
22763
|
-
function frame(gpu2,
|
|
22790
|
+
function frame(gpu2, build2, relogio = EMPTY_CLOCK) {
|
|
22764
22791
|
if (!live(gpu2)) {
|
|
22765
|
-
|
|
22792
|
+
build2(noFrame());
|
|
22766
22793
|
return;
|
|
22767
22794
|
}
|
|
22768
22795
|
try {
|
|
22769
22796
|
const encoder = gpu2.device.createCommandEncoder({ label: "voodoo-frame" });
|
|
22770
|
-
|
|
22797
|
+
build2(buildFrame2(gpu2, encoder, relogio));
|
|
22771
22798
|
gpu2.queue.submit([encoder.finish()]);
|
|
22772
22799
|
} catch (err) {
|
|
22773
22800
|
handleError(err, "V.gpu.frame");
|
|
22774
22801
|
}
|
|
22775
22802
|
}
|
|
22776
|
-
function frameLoop(gpu2,
|
|
22803
|
+
function frameLoop(gpu2, build2) {
|
|
22777
22804
|
if (!live(gpu2) || typeof requestAnimationFrame !== "function") return () => void 0;
|
|
22778
22805
|
const relogio = clock();
|
|
22779
22806
|
let handle = 0;
|
|
@@ -22782,7 +22809,7 @@ function frameLoop(gpu2, build) {
|
|
|
22782
22809
|
handle = 0;
|
|
22783
22810
|
if (!running || !live(gpu2)) return;
|
|
22784
22811
|
relogio.tick(now2);
|
|
22785
|
-
frame(gpu2,
|
|
22812
|
+
frame(gpu2, build2, relogio);
|
|
22786
22813
|
if (running) handle = requestAnimationFrame(step2);
|
|
22787
22814
|
};
|
|
22788
22815
|
handle = requestAnimationFrame(step2);
|