voodoojs 0.5.0 → 0.6.0
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 +272 -269
- package/dist/index.d.cts +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.js +199 -199
- 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 +267 -264
- 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,
|
|
@@ -9841,7 +9844,7 @@ defineDirective("tooltip", ({ el, expression, cleanup }) => {
|
|
|
9841
9844
|
if (addedTabIndex) el.setAttribute("tabindex", "0");
|
|
9842
9845
|
let bubble = null;
|
|
9843
9846
|
let timer = null;
|
|
9844
|
-
const
|
|
9847
|
+
const build2 = () => {
|
|
9845
9848
|
const node = document.createElement("div");
|
|
9846
9849
|
node.className = "v-tooltip";
|
|
9847
9850
|
node.setAttribute("role", "tooltip");
|
|
@@ -9855,7 +9858,7 @@ defineDirective("tooltip", ({ el, expression, cleanup }) => {
|
|
|
9855
9858
|
};
|
|
9856
9859
|
const open = () => {
|
|
9857
9860
|
if (bubble) return;
|
|
9858
|
-
bubble =
|
|
9861
|
+
bubble = build2();
|
|
9859
9862
|
el.setAttribute("aria-describedby", bubble.id);
|
|
9860
9863
|
reposition();
|
|
9861
9864
|
requestAnimationFrame(() => bubble?.classList.add("v-in"));
|
|
@@ -11041,37 +11044,37 @@ init_reactivity();
|
|
|
11041
11044
|
init_registry();
|
|
11042
11045
|
init_style();
|
|
11043
11046
|
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: "
|
|
11047
|
+
required: "Please fill in this field.",
|
|
11048
|
+
email: "Enter a valid email address.",
|
|
11049
|
+
url: "Enter a valid URL.",
|
|
11050
|
+
number: "Enter a valid number.",
|
|
11051
|
+
integer: "Enter a whole number.",
|
|
11052
|
+
decimal: "Enter a valid decimal number.",
|
|
11053
|
+
alpha: "Use letters only.",
|
|
11054
|
+
alphanumeric: "Use letters and numbers only.",
|
|
11055
|
+
minlength: "Use at least {param} characters.",
|
|
11056
|
+
maxlength: "Use at most {param} characters.",
|
|
11057
|
+
min: "The smallest allowed value is {param}.",
|
|
11058
|
+
max: "The largest allowed value is {param}.",
|
|
11059
|
+
between: "Enter a value between {min} and {max}.",
|
|
11060
|
+
match: "The fields do not match.",
|
|
11061
|
+
regex: "That format is not valid.",
|
|
11062
|
+
date: "Enter a valid date.",
|
|
11063
|
+
after: "The date has to be later than {param}.",
|
|
11064
|
+
before: "The date has to be earlier than {param}.",
|
|
11065
|
+
accepted: "You have to tick this to continue.",
|
|
11066
|
+
same: "The values have to be the same.",
|
|
11067
|
+
different: "The values have to be different.",
|
|
11068
|
+
in: "Choose one of the allowed options.",
|
|
11069
|
+
notin: "That value is not allowed.",
|
|
11070
|
+
phone: "Enter a valid phone number, including the area code.",
|
|
11071
|
+
cpf: "Invalid CPF.",
|
|
11072
|
+
cnpj: "Invalid CNPJ.",
|
|
11073
|
+
cep: "Invalid postcode.",
|
|
11074
|
+
creditcard: "Invalid card number.",
|
|
11075
|
+
strongpassword: "Use {param} characters or more, with an upper case letter, a lower case letter, a number and a symbol.",
|
|
11076
|
+
unique: "That value is already taken.",
|
|
11077
|
+
invalid: "Invalid value."
|
|
11075
11078
|
};
|
|
11076
11079
|
function formatMessage(template, data2) {
|
|
11077
11080
|
const param = data2.param ?? "";
|
|
@@ -14444,7 +14447,7 @@ function normalize2(options, type) {
|
|
|
14444
14447
|
const labels2 = fromOptions ? options.labels.map((label) => String(label)) : [];
|
|
14445
14448
|
const series = [];
|
|
14446
14449
|
const raw = options.data;
|
|
14447
|
-
const singleName = options.name ?? "
|
|
14450
|
+
const singleName = options.name ?? "Value";
|
|
14448
14451
|
if (typeof raw === "number") {
|
|
14449
14452
|
series.push({ name: singleName, values: [raw], xs: null, color: palette2[0] });
|
|
14450
14453
|
} else if (Array.isArray(raw) && raw.length > 0) {
|
|
@@ -15174,7 +15177,7 @@ function draw(state2) {
|
|
|
15174
15177
|
const palette2 = options.colors && options.colors.length > 0 ? options.colors : CHART_COLORS;
|
|
15175
15178
|
const format = options.format ?? "number";
|
|
15176
15179
|
const width = Math.max(160, Math.round(el.clientWidth || options.width || 640));
|
|
15177
|
-
const height = Math.max(48, Math.round(options.height ?? defaultHeight(type)));
|
|
15180
|
+
const height = Math.max(48, Math.round(options.height ?? (el.clientHeight || defaultHeight(type))));
|
|
15178
15181
|
state2.lastWidth = width;
|
|
15179
15182
|
state2.viewWidth = width;
|
|
15180
15183
|
state2.viewHeight = height;
|
|
@@ -16026,7 +16029,7 @@ var CSS5 = `
|
|
|
16026
16029
|
@keyframes v-shimmer{0%{background-position:-180% 0}100%{background-position:180% 0}}
|
|
16027
16030
|
@keyframes v-indeterminate{0%{transform:translateX(-100%)}100%{transform:translateX(340%)}}
|
|
16028
16031
|
|
|
16029
|
-
/*
|
|
16032
|
+
/* ----------------------------------------------------------------- button */
|
|
16030
16033
|
.v-btn{appearance:none;-webkit-appearance:none;position:relative;display:inline-flex;
|
|
16031
16034
|
align-items:center;justify-content:center;gap:8px;vertical-align:middle;white-space:nowrap;
|
|
16032
16035
|
font-family:var(--v-font-sans);font-weight:600;line-height:1;text-decoration:none;
|
|
@@ -16070,7 +16073,7 @@ var CSS5 = `
|
|
|
16070
16073
|
.v-btn-spin{width:1em;height:1em;border-radius:50%;border:2px solid currentColor;
|
|
16071
16074
|
border-top-color:transparent;animation:v-spin .7s linear infinite;flex:none}
|
|
16072
16075
|
|
|
16073
|
-
/*
|
|
16076
|
+
/* ------------------------------------------------------------ icon button */
|
|
16074
16077
|
.v-icon-btn{appearance:none;-webkit-appearance:none;display:inline-grid;place-items:center;
|
|
16075
16078
|
border:1px solid transparent;border-radius:var(--v-radius-sm);cursor:pointer;
|
|
16076
16079
|
font-family:var(--v-font-sans);
|
|
@@ -16115,7 +16118,7 @@ var CSS5 = `
|
|
|
16115
16118
|
.v-card-foot:empty{display:none}
|
|
16116
16119
|
.v-card[data-padded="false"] .v-card-body{padding:0}
|
|
16117
16120
|
|
|
16118
|
-
/*
|
|
16121
|
+
/* ------------------------------------------------------------------- form */
|
|
16119
16122
|
.v-field{display:flex;flex-direction:column;gap:6px;font-family:var(--v-font-sans);min-width:0}
|
|
16120
16123
|
.v-label{display:inline-flex;align-items:center;gap:4px;font-size:13px;font-weight:600;
|
|
16121
16124
|
line-height:1.3;color:var(--v-text)}
|
|
@@ -16194,7 +16197,7 @@ var CSS5 = `
|
|
|
16194
16197
|
.v-select-opt.is-selected .v-select-check{opacity:1}
|
|
16195
16198
|
.v-select-empty{padding:14px 10px;text-align:center;font-size:13.5px;color:var(--v-text-muted)}
|
|
16196
16199
|
|
|
16197
|
-
/*
|
|
16200
|
+
/* --------------------------------------------- checkbox, radio and switch */
|
|
16198
16201
|
.v-check{display:inline-flex;align-items:flex-start;gap:9px;cursor:pointer;
|
|
16199
16202
|
font-family:var(--v-font-sans);font-size:14px;line-height:1.45;color:var(--v-text)}
|
|
16200
16203
|
.v-check[data-disabled="true"]{cursor:not-allowed;opacity:.6}
|
|
@@ -16231,7 +16234,7 @@ var CSS5 = `
|
|
|
16231
16234
|
.v-check[data-size="sm"] .v-switch-thumb{width:16px;height:16px}
|
|
16232
16235
|
.v-check[data-size="sm"] .v-check-native:checked+.v-switch-track .v-switch-thumb{transform:translateX(14px)}
|
|
16233
16236
|
|
|
16234
|
-
/*
|
|
16237
|
+
/* ------------------------------------------------------ badge, tag, alert */
|
|
16235
16238
|
.v-badge{display:inline-flex;align-items:center;gap:5px;font-family:var(--v-font-sans);
|
|
16236
16239
|
font-weight:600;line-height:1;border-radius:var(--v-radius-full);border:1px solid transparent;
|
|
16237
16240
|
white-space:nowrap;vertical-align:middle}
|
|
@@ -16308,7 +16311,7 @@ var CSS5 = `
|
|
|
16308
16311
|
.v-avatar-status[data-status="busy"]{background:var(--v-danger)}
|
|
16309
16312
|
.v-avatar-status[data-status="away"]{background:var(--v-warning)}
|
|
16310
16313
|
|
|
16311
|
-
/*
|
|
16314
|
+
/* --------------------------------------------------- spinner and skeleton */
|
|
16312
16315
|
.v-spinner{display:inline-block;border-radius:50%;border-style:solid;border-color:var(--v-border);
|
|
16313
16316
|
border-top-color:var(--v-primary);animation:v-spin .7s linear infinite;vertical-align:middle}
|
|
16314
16317
|
.v-spinner[data-tone="accent"]{border-top-color:var(--v-accent)}
|
|
@@ -16325,7 +16328,7 @@ var CSS5 = `
|
|
|
16325
16328
|
.v-skeleton[data-circle="true"]{border-radius:var(--v-radius-full)}
|
|
16326
16329
|
.v-skeleton-stack{display:flex;flex-direction:column;gap:8px}
|
|
16327
16330
|
|
|
16328
|
-
/*
|
|
16331
|
+
/* --------------------------------------------------------------- progress */
|
|
16329
16332
|
.v-progress{font-family:var(--v-font-sans);display:flex;flex-direction:column;gap:6px}
|
|
16330
16333
|
.v-progress-head{display:flex;justify-content:space-between;gap:12px;font-size:13px;color:var(--v-text-muted)}
|
|
16331
16334
|
.v-progress-value{font-weight:650;color:var(--v-text)}
|
|
@@ -16342,7 +16345,7 @@ var CSS5 = `
|
|
|
16342
16345
|
.v-progress[data-tone="danger"] .v-progress-bar{background:var(--v-danger)}
|
|
16343
16346
|
.v-progress[data-indeterminate="true"] .v-progress-bar{width:30% !important;animation:v-indeterminate 1.3s var(--v-ease) infinite}
|
|
16344
16347
|
|
|
16345
|
-
/*
|
|
16348
|
+
/* ---------------------------------------------------------------- divider */
|
|
16346
16349
|
.v-divider{display:flex;align-items:center;gap:12px;color:var(--v-text-soft);
|
|
16347
16350
|
font-family:var(--v-font-sans);font-size:12.5px;font-weight:600;margin:16px 0}
|
|
16348
16351
|
.v-divider::before,.v-divider::after{content:"";flex:1;height:1px;background:var(--v-border)}
|
|
@@ -16350,7 +16353,7 @@ var CSS5 = `
|
|
|
16350
16353
|
.v-divider[data-vertical="true"]{flex-direction:column;margin:0 16px;align-self:stretch;height:auto}
|
|
16351
16354
|
.v-divider[data-vertical="true"]::before,.v-divider[data-vertical="true"]::after{width:1px;height:auto;flex:1}
|
|
16352
16355
|
|
|
16353
|
-
/*
|
|
16356
|
+
/* ------------------------------------------------------------------ table */
|
|
16354
16357
|
.v-table-wrap{width:100%;overflow-x:auto;background:var(--v-surface);border:1px solid var(--v-border);
|
|
16355
16358
|
border-radius:var(--v-radius);font-family:var(--v-font-sans)}
|
|
16356
16359
|
.v-table{width:100%;border-collapse:collapse;font-size:14px;color:var(--v-text)}
|
|
@@ -16371,7 +16374,7 @@ var CSS5 = `
|
|
|
16371
16374
|
.v-th[aria-sort="ascending"] .v-th-arrow,.v-th[aria-sort="descending"] .v-th-arrow{opacity:1;color:var(--v-primary)}
|
|
16372
16375
|
.v-table-empty{text-align:center;color:var(--v-text-muted);padding:34px 14px;font-size:14px}
|
|
16373
16376
|
|
|
16374
|
-
/*
|
|
16377
|
+
/* ------------------------------------------------------------- pagination */
|
|
16375
16378
|
.v-pagination{display:flex;align-items:center;gap:6px;flex-wrap:wrap;font-family:var(--v-font-sans)}
|
|
16376
16379
|
.v-page{appearance:none;min-width:34px;height:34px;padding:0 9px;display:inline-grid;place-items:center;
|
|
16377
16380
|
background:transparent;border:1px solid transparent;border-radius:var(--v-radius-sm);
|
|
@@ -16383,7 +16386,7 @@ var CSS5 = `
|
|
|
16383
16386
|
.v-page[aria-current="page"]{background:var(--v-primary);border-color:var(--v-primary);color:var(--v-primary-contrast)}
|
|
16384
16387
|
.v-page-gap{min-width:24px;text-align:center;color:var(--v-text-soft);user-select:none}
|
|
16385
16388
|
|
|
16386
|
-
/*
|
|
16389
|
+
/* ------------------------------------------------------------- breadcrumb */
|
|
16387
16390
|
.v-breadcrumb{font-family:var(--v-font-sans);font-size:13.5px}
|
|
16388
16391
|
.v-breadcrumb-list{list-style:none;display:flex;flex-wrap:wrap;align-items:center;gap:6px;margin:0;padding:0}
|
|
16389
16392
|
.v-breadcrumb-item{display:inline-flex;align-items:center;gap:6px;color:var(--v-text-muted)}
|
|
@@ -16393,7 +16396,7 @@ var CSS5 = `
|
|
|
16393
16396
|
.v-breadcrumb-item[aria-current="page"]{color:var(--v-text);font-weight:600}
|
|
16394
16397
|
.v-breadcrumb-sep{color:var(--v-text-soft);user-select:none}
|
|
16395
16398
|
|
|
16396
|
-
/*
|
|
16399
|
+
/* ------------------------------------------------------------------- stat */
|
|
16397
16400
|
.v-stat{display:flex;gap:14px;align-items:flex-start;padding:16px 18px;background:var(--v-surface);
|
|
16398
16401
|
border:1px solid var(--v-border);border-radius:var(--v-radius);font-family:var(--v-font-sans)}
|
|
16399
16402
|
.v-stat-icon{flex:none;width:40px;height:40px;display:grid;place-items:center;font-size:19px;
|
|
@@ -16411,7 +16414,7 @@ var CSS5 = `
|
|
|
16411
16414
|
.v-stat-delta[data-dir="flat"]{background:var(--v-surface-3);color:var(--v-text-muted)}
|
|
16412
16415
|
.v-stat-hint{font-size:12.5px;color:var(--v-text-muted)}
|
|
16413
16416
|
|
|
16414
|
-
/*
|
|
16417
|
+
/* ------------------------------------------------------------ empty state */
|
|
16415
16418
|
.v-empty{display:flex;flex-direction:column;align-items:center;text-align:center;gap:10px;
|
|
16416
16419
|
padding:44px 22px;font-family:var(--v-font-sans);color:var(--v-text)}
|
|
16417
16420
|
.v-empty-icon{width:58px;height:58px;display:grid;place-items:center;font-size:27px;
|
|
@@ -16421,7 +16424,7 @@ var CSS5 = `
|
|
|
16421
16424
|
.v-empty-actions{margin-top:6px;display:flex;gap:10px;flex-wrap:wrap;justify-content:center}
|
|
16422
16425
|
.v-empty-actions:empty{display:none}
|
|
16423
16426
|
|
|
16424
|
-
/*
|
|
16427
|
+
/* --------------------------------------------------------------- timeline */
|
|
16425
16428
|
.v-timeline{list-style:none;margin:0;padding:0;font-family:var(--v-font-sans);
|
|
16426
16429
|
display:flex;flex-direction:column}
|
|
16427
16430
|
.v-timeline-item{position:relative;display:flex;gap:14px;padding-bottom:20px}
|
|
@@ -16441,7 +16444,7 @@ var CSS5 = `
|
|
|
16441
16444
|
.v-timeline-desc{margin:3px 0 0;font-size:13.5px;line-height:1.55;color:var(--v-text-muted)}
|
|
16442
16445
|
.v-timeline-time{display:block;margin-top:3px;font-size:12px;color:var(--v-text-soft)}
|
|
16443
16446
|
|
|
16444
|
-
/*
|
|
16447
|
+
/* ------------------------------------------------------------------ steps */
|
|
16445
16448
|
.v-steps{display:flex;gap:0;font-family:var(--v-font-sans);list-style:none;margin:0;padding:0}
|
|
16446
16449
|
.v-steps[data-vertical="true"]{flex-direction:column;gap:4px}
|
|
16447
16450
|
.v-step{flex:1;display:flex;align-items:flex-start;gap:10px;min-width:0;position:relative;padding-right:12px}
|
|
@@ -16460,7 +16463,7 @@ var CSS5 = `
|
|
|
16460
16463
|
.v-steps[data-vertical="true"] .v-step-line{left:13px;right:auto;top:30px;bottom:2px;width:2px;height:auto}
|
|
16461
16464
|
.v-step:last-child .v-step-line{display:none}
|
|
16462
16465
|
|
|
16463
|
-
/*
|
|
16466
|
+
/* ----------------------------------------------------------------- rating */
|
|
16464
16467
|
.v-rating{display:inline-flex;align-items:center;gap:6px;font-family:var(--v-font-sans)}
|
|
16465
16468
|
.v-rating-stars{display:inline-flex;gap:2px}
|
|
16466
16469
|
.v-star{appearance:none;background:none;border:0;padding:2px;cursor:pointer;line-height:0;
|
|
@@ -16487,7 +16490,7 @@ var CSS5 = `
|
|
|
16487
16490
|
.v-tip[data-placement="right"]{left:calc(100% + 8px);top:50%;translate:0 -50%}
|
|
16488
16491
|
.v-tipwrap:hover .v-tip,.v-tipwrap:focus-within .v-tip{opacity:1;transform:none}
|
|
16489
16492
|
|
|
16490
|
-
/*
|
|
16493
|
+
/* ------------------------------------------------------------------- code */
|
|
16491
16494
|
.v-code{position:relative;background:var(--v-surface-inset);border:1px solid var(--v-border);
|
|
16492
16495
|
border-radius:var(--v-radius);overflow:hidden;font-family:var(--v-font-mono)}
|
|
16493
16496
|
.v-code-head{display:flex;align-items:center;justify-content:space-between;gap:10px;
|
|
@@ -17488,7 +17491,7 @@ register("v-table", {
|
|
|
17488
17491
|
props: {
|
|
17489
17492
|
columns: { type: "any", default: "" },
|
|
17490
17493
|
rows: { type: "any", default: "" },
|
|
17491
|
-
empty: { type: "string", default: "
|
|
17494
|
+
empty: { type: "string", default: "No records found" },
|
|
17492
17495
|
sortable: { type: "any", default: true },
|
|
17493
17496
|
dense: BOOL,
|
|
17494
17497
|
striped: BOOL,
|
|
@@ -17598,9 +17601,9 @@ register("v-pagination", {
|
|
|
17598
17601
|
total: { type: "number", default: 0 },
|
|
17599
17602
|
perPage: { type: "number", default: 10 },
|
|
17600
17603
|
siblings: { type: "number", default: 1 },
|
|
17601
|
-
previousLabel: { type: "string", default: "
|
|
17602
|
-
nextLabel: { type: "string", default: "
|
|
17603
|
-
ariaLabel: { type: "string", default: "
|
|
17604
|
+
previousLabel: { type: "string", default: "Previous" },
|
|
17605
|
+
nextLabel: { type: "string", default: "Next" },
|
|
17606
|
+
ariaLabel: { type: "string", default: "Pagination" }
|
|
17604
17607
|
},
|
|
17605
17608
|
computed: {
|
|
17606
17609
|
lastPage() {
|
|
@@ -17614,7 +17617,7 @@ register("v-pagination", {
|
|
|
17614
17617
|
const value = Number(this.page) || 1;
|
|
17615
17618
|
return Math.min(Math.max(1, Math.round(value)), this.lastPage);
|
|
17616
17619
|
},
|
|
17617
|
-
/**
|
|
17620
|
+
/** Visible page numbers, with `0` marking the ellipsis. */
|
|
17618
17621
|
items() {
|
|
17619
17622
|
const last = this.lastPage;
|
|
17620
17623
|
const current2 = this.currentPage;
|
|
@@ -17659,7 +17662,7 @@ register("v-pagination", {
|
|
|
17659
17662
|
<template v-for="(item, index) in items" :key="index">
|
|
17660
17663
|
<span class="v-page-gap" v-if="item === 0" aria-hidden="true">...</span>
|
|
17661
17664
|
<button type="button" class="v-page" v-if="item !== 0" :aria-current="isCurrent(item)"
|
|
17662
|
-
:aria-label="'
|
|
17665
|
+
:aria-label="'Page ' + item" v-click="go(item)" v-text="item"></button>
|
|
17663
17666
|
</template>
|
|
17664
17667
|
<button type="button" class="v-page" :disabled="currentPage >= lastPage"
|
|
17665
17668
|
:aria-label="nextLabel" v-click="go(currentPage + 1)" v-html="svgIcon('chevron-right')"></button>
|
|
@@ -17691,7 +17694,7 @@ register("v-breadcrumb", {
|
|
|
17691
17694
|
props: {
|
|
17692
17695
|
items: { type: "any", default: "" },
|
|
17693
17696
|
separator: { type: "string", default: "/" },
|
|
17694
|
-
ariaLabel: { type: "string", default: "
|
|
17697
|
+
ariaLabel: { type: "string", default: "Breadcrumb" }
|
|
17695
17698
|
},
|
|
17696
17699
|
computed: {
|
|
17697
17700
|
crumbs() {
|
|
@@ -17724,7 +17727,7 @@ register("v-stat", {
|
|
|
17724
17727
|
hint: TEXT,
|
|
17725
17728
|
icon: TEXT,
|
|
17726
17729
|
suffix: { type: "string", default: "%" },
|
|
17727
|
-
/**
|
|
17730
|
+
/** When `true`, a negative change counts as positive. */
|
|
17728
17731
|
inverted: BOOL
|
|
17729
17732
|
},
|
|
17730
17733
|
computed: {
|
|
@@ -17777,7 +17780,7 @@ register("v-stat", {
|
|
|
17777
17780
|
register("v-empty-state", {
|
|
17778
17781
|
props: {
|
|
17779
17782
|
icon: { type: "string", default: "inbox" },
|
|
17780
|
-
title: { type: "string", default: "
|
|
17783
|
+
title: { type: "string", default: "Nothing here yet" },
|
|
17781
17784
|
description: TEXT
|
|
17782
17785
|
},
|
|
17783
17786
|
template: `
|
|
@@ -17848,7 +17851,7 @@ register("v-steps", {
|
|
|
17848
17851
|
steps: { type: "any", default: "" },
|
|
17849
17852
|
current: { type: "number", default: 0 },
|
|
17850
17853
|
vertical: BOOL,
|
|
17851
|
-
ariaLabel: { type: "string", default: "
|
|
17854
|
+
ariaLabel: { type: "string", default: "Steps" }
|
|
17852
17855
|
},
|
|
17853
17856
|
computed: {
|
|
17854
17857
|
...flags("vertical"),
|
|
@@ -17892,7 +17895,7 @@ register("v-rating", {
|
|
|
17892
17895
|
value: { type: "number", default: 0 },
|
|
17893
17896
|
max: { type: "number", default: 5 },
|
|
17894
17897
|
size: { type: "string", default: "md" },
|
|
17895
|
-
label: { type: "string", default: "
|
|
17898
|
+
label: { type: "string", default: "Rating" },
|
|
17896
17899
|
readonly: BOOL,
|
|
17897
17900
|
disabled: BOOL,
|
|
17898
17901
|
showValue: BOOL,
|
|
@@ -17918,7 +17921,7 @@ register("v-rating", {
|
|
|
17918
17921
|
return this.hovered > 0 ? this.hovered : this.score;
|
|
17919
17922
|
},
|
|
17920
17923
|
valueText() {
|
|
17921
|
-
return `${this.score}
|
|
17924
|
+
return `${this.score} of ${this.total}`;
|
|
17922
17925
|
}
|
|
17923
17926
|
},
|
|
17924
17927
|
methods: {
|
|
@@ -17974,7 +17977,7 @@ register("v-rating", {
|
|
|
17974
17977
|
:tabindex="locked ? -1 : 0" :aria-readonly="locked" v-keydown="onKey" v-mouseleave="reset">
|
|
17975
17978
|
<span class="v-rating-stars">
|
|
17976
17979
|
<button type="button" class="v-star" v-for="index in total" :key="index"
|
|
17977
|
-
:data-on="isOn(index)" :disabled="locked" :aria-label="index + '
|
|
17980
|
+
:data-on="isOn(index)" :disabled="locked" :aria-label="index + ' of ' + total"
|
|
17978
17981
|
:tabindex="-1" v-click="pick(index)" v-mouseenter="preview(index)"
|
|
17979
17982
|
v-html="svgIcon('star')"></button>
|
|
17980
17983
|
</span>
|
|
@@ -18042,8 +18045,8 @@ register("v-code-block", {
|
|
|
18042
18045
|
code: TEXT,
|
|
18043
18046
|
language: TEXT,
|
|
18044
18047
|
filename: TEXT,
|
|
18045
|
-
copyLabel: { type: "string", default: "
|
|
18046
|
-
copiedLabel: { type: "string", default: "
|
|
18048
|
+
copyLabel: { type: "string", default: "Copy" },
|
|
18049
|
+
copiedLabel: { type: "string", default: "Copied" },
|
|
18047
18050
|
wrap: BOOL
|
|
18048
18051
|
},
|
|
18049
18052
|
state() {
|
|
@@ -18383,7 +18386,7 @@ function openDialog(request2) {
|
|
|
18383
18386
|
source.remove();
|
|
18384
18387
|
}
|
|
18385
18388
|
sourceAnchors.delete(source);
|
|
18386
|
-
if (source
|
|
18389
|
+
if (hasDirective(source, "modal-content")) {
|
|
18387
18390
|
source.setAttribute("hidden", "");
|
|
18388
18391
|
}
|
|
18389
18392
|
}
|
|
@@ -20385,14 +20388,14 @@ function xray(force) {
|
|
|
20385
20388
|
|
|
20386
20389
|
// src/devtools/launcher.ts
|
|
20387
20390
|
init_style();
|
|
20388
|
-
var
|
|
20389
|
-
var
|
|
20390
|
-
var
|
|
20391
|
+
var POSITION_KEY = "voodoo:devtools:widget-position";
|
|
20392
|
+
var HIDDEN_KEY = "voodoo:devtools:widget-hidden";
|
|
20393
|
+
var DRAG_THRESHOLD = 4;
|
|
20391
20394
|
var refs2 = null;
|
|
20392
|
-
var
|
|
20393
|
-
var
|
|
20394
|
-
var
|
|
20395
|
-
var
|
|
20395
|
+
var mounted = false;
|
|
20396
|
+
var counterTimer = 0;
|
|
20397
|
+
var pulseTimer = 0;
|
|
20398
|
+
var teardown2 = [];
|
|
20396
20399
|
var WIDGET_CSS = `
|
|
20397
20400
|
.v-devtools-widget{
|
|
20398
20401
|
all: initial;
|
|
@@ -20525,220 +20528,220 @@ var WIDGET_CSS = `
|
|
|
20525
20528
|
.v-devtools-btn:hover{transform:none}
|
|
20526
20529
|
}
|
|
20527
20530
|
`;
|
|
20528
|
-
var
|
|
20531
|
+
var MARK = `<svg class="v-devtools-mark" viewBox="0 0 24 24" fill="none" aria-hidden="true">
|
|
20529
20532
|
<path d="M4 4l8 16 8-16" stroke="#6D3BF5" stroke-width="2.4" stroke-linecap="round" stroke-linejoin="round"/>
|
|
20530
20533
|
<circle cx="12" cy="7.5" r="2" fill="#FF3D8B"/>
|
|
20531
20534
|
</svg>`;
|
|
20532
|
-
function
|
|
20535
|
+
function readPosition() {
|
|
20533
20536
|
try {
|
|
20534
|
-
const
|
|
20535
|
-
if (!
|
|
20536
|
-
const
|
|
20537
|
-
if (typeof
|
|
20538
|
-
return
|
|
20537
|
+
const raw = localStorage.getItem(POSITION_KEY);
|
|
20538
|
+
if (!raw) return null;
|
|
20539
|
+
const value = JSON.parse(raw);
|
|
20540
|
+
if (typeof value?.x !== "number" || typeof value?.y !== "number") return null;
|
|
20541
|
+
return value;
|
|
20539
20542
|
} catch {
|
|
20540
20543
|
return null;
|
|
20541
20544
|
}
|
|
20542
20545
|
}
|
|
20543
|
-
function
|
|
20546
|
+
function writePosition(pos) {
|
|
20544
20547
|
try {
|
|
20545
|
-
localStorage.setItem(
|
|
20548
|
+
localStorage.setItem(POSITION_KEY, JSON.stringify(pos));
|
|
20546
20549
|
} catch {
|
|
20547
20550
|
}
|
|
20548
20551
|
}
|
|
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
|
-
|
|
20552
|
+
function applyPosition(root, pos) {
|
|
20553
|
+
const width = root.offsetWidth || 120;
|
|
20554
|
+
const height = root.offsetHeight || 38;
|
|
20555
|
+
const x = Math.min(Math.max(8, pos.x), Math.max(8, window.innerWidth - width - 8));
|
|
20556
|
+
const y = Math.min(Math.max(8, pos.y), Math.max(8, window.innerHeight - height - 8));
|
|
20557
|
+
root.style.left = `${x}px`;
|
|
20558
|
+
root.style.top = `${y}px`;
|
|
20559
|
+
root.style.right = "auto";
|
|
20560
|
+
root.style.bottom = "auto";
|
|
20561
|
+
}
|
|
20562
|
+
function build() {
|
|
20563
|
+
const root = document.createElement("div");
|
|
20564
|
+
root.className = "v-devtools-widget";
|
|
20565
|
+
root.setAttribute("data-voodoo-devtools", "widget");
|
|
20566
|
+
const button = document.createElement("button");
|
|
20567
|
+
button.type = "button";
|
|
20568
|
+
button.className = "v-devtools-btn";
|
|
20569
|
+
button.setAttribute("aria-label", "Open Voodoo devtools (Ctrl+Shift+X)");
|
|
20570
|
+
button.setAttribute("aria-pressed", "false");
|
|
20571
|
+
button.title = "Voodoo devtools \u2014 click to inspect, drag to move (Ctrl+Shift+X)";
|
|
20572
|
+
button.innerHTML = MARK;
|
|
20573
|
+
const label = document.createElement("span");
|
|
20574
|
+
label.className = "v-devtools-label";
|
|
20575
|
+
label.textContent = "Voodoo";
|
|
20576
|
+
const counter2 = document.createElement("span");
|
|
20577
|
+
counter2.className = "v-devtools-count";
|
|
20578
|
+
counter2.textContent = "0";
|
|
20579
|
+
const pulse = document.createElement("span");
|
|
20580
|
+
pulse.className = "v-devtools-pulse";
|
|
20581
|
+
pulse.setAttribute("data-on", "false");
|
|
20582
|
+
button.append(label, counter2, pulse);
|
|
20583
|
+
const close = document.createElement("button");
|
|
20584
|
+
close.type = "button";
|
|
20585
|
+
close.className = "v-devtools-close";
|
|
20586
|
+
close.setAttribute("aria-label", "Hide the devtools widget in this tab");
|
|
20587
|
+
close.title = "Hide in this tab";
|
|
20588
|
+
close.textContent = "\xD7";
|
|
20589
|
+
root.append(button, close);
|
|
20590
|
+
document.body.appendChild(root);
|
|
20591
|
+
const saved = readPosition();
|
|
20592
|
+
if (saved) {
|
|
20593
|
+
applyPosition(root, saved);
|
|
20591
20594
|
} 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.
|
|
20595
|
+
root.style.right = "16px";
|
|
20596
|
+
root.style.bottom = "16px";
|
|
20597
|
+
}
|
|
20598
|
+
return { root, button, pulse, counter: counter2, close };
|
|
20599
|
+
}
|
|
20600
|
+
function enableDrag(refs3, onClick) {
|
|
20601
|
+
let dragging = false;
|
|
20602
|
+
let moved = false;
|
|
20603
|
+
let offsetX = 0;
|
|
20604
|
+
let offsetY = 0;
|
|
20605
|
+
let startX = 0;
|
|
20606
|
+
let startY = 0;
|
|
20607
|
+
const onPointerDown = (event) => {
|
|
20608
|
+
if (event.button !== 0) return;
|
|
20609
|
+
const box = refs3.root.getBoundingClientRect();
|
|
20610
|
+
dragging = true;
|
|
20611
|
+
moved = false;
|
|
20612
|
+
startX = event.clientX;
|
|
20613
|
+
startY = event.clientY;
|
|
20614
|
+
offsetX = event.clientX - box.left;
|
|
20615
|
+
offsetY = event.clientY - box.top;
|
|
20616
|
+
refs3.button.setPointerCapture?.(event.pointerId);
|
|
20614
20617
|
};
|
|
20615
|
-
const
|
|
20616
|
-
if (!
|
|
20617
|
-
const
|
|
20618
|
-
if (!
|
|
20619
|
-
|
|
20620
|
-
|
|
20621
|
-
|
|
20618
|
+
const onPointerMove2 = (event) => {
|
|
20619
|
+
if (!dragging) return;
|
|
20620
|
+
const distance = Math.hypot(event.clientX - startX, event.clientY - startY);
|
|
20621
|
+
if (!moved && distance < DRAG_THRESHOLD) return;
|
|
20622
|
+
moved = true;
|
|
20623
|
+
event.preventDefault();
|
|
20624
|
+
applyPosition(refs3.root, { x: event.clientX - offsetX, y: event.clientY - offsetY });
|
|
20622
20625
|
};
|
|
20623
|
-
const
|
|
20624
|
-
if (!
|
|
20625
|
-
|
|
20626
|
-
refs3.
|
|
20627
|
-
if (!
|
|
20628
|
-
|
|
20626
|
+
const onPointerUp = (event) => {
|
|
20627
|
+
if (!dragging) return;
|
|
20628
|
+
dragging = false;
|
|
20629
|
+
refs3.button.releasePointerCapture?.(event.pointerId);
|
|
20630
|
+
if (!moved) {
|
|
20631
|
+
onClick();
|
|
20629
20632
|
return;
|
|
20630
20633
|
}
|
|
20631
|
-
const
|
|
20632
|
-
|
|
20634
|
+
const box = refs3.root.getBoundingClientRect();
|
|
20635
|
+
writePosition({ x: box.left, y: box.top });
|
|
20633
20636
|
};
|
|
20634
|
-
const
|
|
20635
|
-
if (
|
|
20636
|
-
|
|
20637
|
-
|
|
20637
|
+
const onKeyDown = (event) => {
|
|
20638
|
+
if (event.key !== "Enter" && event.key !== " ") return;
|
|
20639
|
+
event.preventDefault();
|
|
20640
|
+
onClick();
|
|
20638
20641
|
};
|
|
20639
|
-
const
|
|
20640
|
-
const
|
|
20641
|
-
if (refs3.
|
|
20642
|
+
const onResize = () => {
|
|
20643
|
+
const box = refs3.root.getBoundingClientRect();
|
|
20644
|
+
if (refs3.root.style.left) applyPosition(refs3.root, { x: box.left, y: box.top });
|
|
20642
20645
|
};
|
|
20643
|
-
refs3.
|
|
20644
|
-
refs3.
|
|
20645
|
-
refs3.
|
|
20646
|
-
refs3.
|
|
20647
|
-
refs3.
|
|
20648
|
-
window.addEventListener("resize",
|
|
20646
|
+
refs3.button.addEventListener("pointerdown", onPointerDown);
|
|
20647
|
+
refs3.button.addEventListener("pointermove", onPointerMove2);
|
|
20648
|
+
refs3.button.addEventListener("pointerup", onPointerUp);
|
|
20649
|
+
refs3.button.addEventListener("pointercancel", onPointerUp);
|
|
20650
|
+
refs3.button.addEventListener("keydown", onKeyDown);
|
|
20651
|
+
window.addEventListener("resize", onResize);
|
|
20649
20652
|
return () => {
|
|
20650
|
-
refs3.
|
|
20651
|
-
refs3.
|
|
20652
|
-
refs3.
|
|
20653
|
-
refs3.
|
|
20654
|
-
refs3.
|
|
20655
|
-
window.removeEventListener("resize",
|
|
20653
|
+
refs3.button.removeEventListener("pointerdown", onPointerDown);
|
|
20654
|
+
refs3.button.removeEventListener("pointermove", onPointerMove2);
|
|
20655
|
+
refs3.button.removeEventListener("pointerup", onPointerUp);
|
|
20656
|
+
refs3.button.removeEventListener("pointercancel", onPointerUp);
|
|
20657
|
+
refs3.button.removeEventListener("keydown", onKeyDown);
|
|
20658
|
+
window.removeEventListener("resize", onResize);
|
|
20656
20659
|
};
|
|
20657
20660
|
}
|
|
20658
|
-
function
|
|
20661
|
+
function blink() {
|
|
20659
20662
|
if (!refs2) return;
|
|
20660
|
-
refs2.
|
|
20661
|
-
window.clearTimeout(
|
|
20662
|
-
|
|
20663
|
-
refs2?.
|
|
20663
|
+
refs2.pulse.setAttribute("data-on", "true");
|
|
20664
|
+
window.clearTimeout(pulseTimer);
|
|
20665
|
+
pulseTimer = window.setTimeout(() => {
|
|
20666
|
+
refs2?.pulse.setAttribute("data-on", "false");
|
|
20664
20667
|
}, 320);
|
|
20665
20668
|
}
|
|
20666
|
-
function
|
|
20669
|
+
function updateCounter() {
|
|
20667
20670
|
if (!refs2) return;
|
|
20668
20671
|
const total = instances.size;
|
|
20669
|
-
const
|
|
20670
|
-
if (refs2.
|
|
20672
|
+
const text = total === 1 ? "1 component" : `${total} components`;
|
|
20673
|
+
if (refs2.counter.textContent !== text) refs2.counter.textContent = text;
|
|
20671
20674
|
}
|
|
20672
20675
|
function mountDevtoolsWidget() {
|
|
20673
|
-
if (
|
|
20676
|
+
if (mounted || typeof document === "undefined" || !document.body) return;
|
|
20674
20677
|
try {
|
|
20675
|
-
if (sessionStorage.getItem(
|
|
20678
|
+
if (sessionStorage.getItem(HIDDEN_KEY) === "1") return;
|
|
20676
20679
|
} catch {
|
|
20677
20680
|
}
|
|
20678
|
-
|
|
20681
|
+
mounted = true;
|
|
20679
20682
|
injectStyle("devtools-widget", WIDGET_CSS);
|
|
20680
|
-
refs2 =
|
|
20681
|
-
const
|
|
20682
|
-
const
|
|
20683
|
-
refs2?.
|
|
20684
|
-
refs2?.
|
|
20683
|
+
refs2 = build();
|
|
20684
|
+
const toggle = () => {
|
|
20685
|
+
const enabled2 = xray();
|
|
20686
|
+
refs2?.root.setAttribute("data-active", String(enabled2));
|
|
20687
|
+
refs2?.button.setAttribute("aria-pressed", String(enabled2));
|
|
20685
20688
|
};
|
|
20686
|
-
|
|
20687
|
-
const
|
|
20688
|
-
|
|
20689
|
+
teardown2.push(enableDrag(refs2, toggle));
|
|
20690
|
+
const onClose = (event) => {
|
|
20691
|
+
event.stopPropagation();
|
|
20689
20692
|
try {
|
|
20690
|
-
sessionStorage.setItem(
|
|
20693
|
+
sessionStorage.setItem(HIDDEN_KEY, "1");
|
|
20691
20694
|
} catch {
|
|
20692
20695
|
}
|
|
20693
20696
|
unmountDevtoolsWidget();
|
|
20694
20697
|
console.info("[Voodoo] devtools widget hidden. Use V.devtoolsWidget(true) to bring back.");
|
|
20695
20698
|
};
|
|
20696
|
-
refs2.
|
|
20697
|
-
|
|
20698
|
-
const
|
|
20699
|
-
const
|
|
20700
|
-
refs2?.
|
|
20701
|
-
refs2?.
|
|
20699
|
+
refs2.close.addEventListener("click", onClose);
|
|
20700
|
+
teardown2.push(() => refs2?.close.removeEventListener("click", onClose));
|
|
20701
|
+
const onGlobalKeyUp = () => {
|
|
20702
|
+
const enabled2 = isXrayEnabled();
|
|
20703
|
+
refs2?.root.setAttribute("data-active", String(enabled2));
|
|
20704
|
+
refs2?.button.setAttribute("aria-pressed", String(enabled2));
|
|
20702
20705
|
};
|
|
20703
|
-
document.addEventListener("keyup",
|
|
20704
|
-
|
|
20705
|
-
for (const
|
|
20706
|
-
|
|
20706
|
+
document.addEventListener("keyup", onGlobalKeyUp);
|
|
20707
|
+
teardown2.push(() => document.removeEventListener("keyup", onGlobalKeyUp));
|
|
20708
|
+
for (const type of ["network", "event", "navigation", "update"]) {
|
|
20709
|
+
teardown2.push(devtoolsBus.on(type, blink));
|
|
20707
20710
|
}
|
|
20708
|
-
|
|
20709
|
-
|
|
20711
|
+
updateCounter();
|
|
20712
|
+
counterTimer = window.setInterval(updateCounter, 1e3);
|
|
20710
20713
|
}
|
|
20711
20714
|
function unmountDevtoolsWidget() {
|
|
20712
|
-
if (!
|
|
20713
|
-
|
|
20714
|
-
for (const fn of
|
|
20715
|
+
if (!mounted) return;
|
|
20716
|
+
mounted = false;
|
|
20717
|
+
for (const fn of teardown2.splice(0)) {
|
|
20715
20718
|
try {
|
|
20716
20719
|
fn();
|
|
20717
20720
|
} catch {
|
|
20718
20721
|
}
|
|
20719
20722
|
}
|
|
20720
|
-
window.clearInterval(
|
|
20721
|
-
window.clearTimeout(
|
|
20722
|
-
|
|
20723
|
-
|
|
20724
|
-
refs2?.
|
|
20723
|
+
window.clearInterval(counterTimer);
|
|
20724
|
+
window.clearTimeout(pulseTimer);
|
|
20725
|
+
counterTimer = 0;
|
|
20726
|
+
pulseTimer = 0;
|
|
20727
|
+
refs2?.root.remove();
|
|
20725
20728
|
refs2 = null;
|
|
20726
20729
|
}
|
|
20727
20730
|
function isDevtoolsWidgetMounted() {
|
|
20728
|
-
return
|
|
20731
|
+
return mounted;
|
|
20729
20732
|
}
|
|
20730
20733
|
function devtoolsWidget(force) {
|
|
20731
|
-
const
|
|
20732
|
-
if (
|
|
20734
|
+
const target2 = force ?? !mounted;
|
|
20735
|
+
if (target2) {
|
|
20733
20736
|
try {
|
|
20734
|
-
sessionStorage.removeItem(
|
|
20737
|
+
sessionStorage.removeItem(HIDDEN_KEY);
|
|
20735
20738
|
} catch {
|
|
20736
20739
|
}
|
|
20737
20740
|
mountDevtoolsWidget();
|
|
20738
20741
|
} else {
|
|
20739
20742
|
unmountDevtoolsWidget();
|
|
20740
20743
|
}
|
|
20741
|
-
return
|
|
20744
|
+
return mounted;
|
|
20742
20745
|
}
|
|
20743
20746
|
|
|
20744
20747
|
// src/index.ts
|
|
@@ -22760,20 +22763,20 @@ function buildFrame2(gpu2, encoder, relogio) {
|
|
|
22760
22763
|
};
|
|
22761
22764
|
return frameObj;
|
|
22762
22765
|
}
|
|
22763
|
-
function frame(gpu2,
|
|
22766
|
+
function frame(gpu2, build2, relogio = EMPTY_CLOCK) {
|
|
22764
22767
|
if (!live(gpu2)) {
|
|
22765
|
-
|
|
22768
|
+
build2(noFrame());
|
|
22766
22769
|
return;
|
|
22767
22770
|
}
|
|
22768
22771
|
try {
|
|
22769
22772
|
const encoder = gpu2.device.createCommandEncoder({ label: "voodoo-frame" });
|
|
22770
|
-
|
|
22773
|
+
build2(buildFrame2(gpu2, encoder, relogio));
|
|
22771
22774
|
gpu2.queue.submit([encoder.finish()]);
|
|
22772
22775
|
} catch (err) {
|
|
22773
22776
|
handleError(err, "V.gpu.frame");
|
|
22774
22777
|
}
|
|
22775
22778
|
}
|
|
22776
|
-
function frameLoop(gpu2,
|
|
22779
|
+
function frameLoop(gpu2, build2) {
|
|
22777
22780
|
if (!live(gpu2) || typeof requestAnimationFrame !== "function") return () => void 0;
|
|
22778
22781
|
const relogio = clock();
|
|
22779
22782
|
let handle = 0;
|
|
@@ -22782,7 +22785,7 @@ function frameLoop(gpu2, build) {
|
|
|
22782
22785
|
handle = 0;
|
|
22783
22786
|
if (!running || !live(gpu2)) return;
|
|
22784
22787
|
relogio.tick(now2);
|
|
22785
|
-
frame(gpu2,
|
|
22788
|
+
frame(gpu2, build2, relogio);
|
|
22786
22789
|
if (running) handle = requestAnimationFrame(step2);
|
|
22787
22790
|
};
|
|
22788
22791
|
handle = requestAnimationFrame(step2);
|