voodoojs 0.4.6 → 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-4HQEOXTK.js → chunk-CNHNFTPC.js} +73 -69
- package/dist/{chunk-5CKGDARU.js → chunk-PHMBDPWH.js} +3 -3
- package/dist/essential.cjs +70 -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 +273 -269
- package/dist/index.d.cts +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.js +199 -199
- package/dist/{query-DQFRmu3u.d.ts → query-CC-_z7v0.d.ts} +33 -33
- package/dist/{query-CKJ4oSpG.d.cts → query-sEJXe_cO.d.cts} +33 -33
- 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 +39 -35
- package/dist/voodoo.core.min.js +15 -15
- package/dist/voodoo.full.js +268 -264
- package/dist/voodoo.full.min.js +74 -74
- package/dist/voodoo.js +71 -67
- package/dist/voodoo.min.js +22 -22
- package/package.json +1 -1
package/dist/voodoo.full.js
CHANGED
|
@@ -3387,7 +3387,7 @@ Suggestion: attribute expressions accept a single value. If the logic spans more
|
|
|
3387
3387
|
// src/store/index.ts
|
|
3388
3388
|
init_reactivity();
|
|
3389
3389
|
var stores = /* @__PURE__ */ new Map();
|
|
3390
|
-
var
|
|
3390
|
+
var version = ref(0);
|
|
3391
3391
|
var persistHandles = /* @__PURE__ */ new Map();
|
|
3392
3392
|
function store(name, definition, options = {}) {
|
|
3393
3393
|
const existing = stores.get(name);
|
|
@@ -3404,30 +3404,30 @@ Suggestion: attribute expressions accept a single value. If the logic spans more
|
|
|
3404
3404
|
return existing;
|
|
3405
3405
|
}
|
|
3406
3406
|
const key = typeof options.persist === "string" ? options.persist : `voodoo:store:${name}`;
|
|
3407
|
-
const
|
|
3408
|
-
const initial = Object.defineProperties({},
|
|
3407
|
+
const descriptors = Object.getOwnPropertyDescriptors(definition);
|
|
3408
|
+
const initial = Object.defineProperties({}, descriptors);
|
|
3409
3409
|
if (options.persist && typeof localStorage !== "undefined") {
|
|
3410
3410
|
try {
|
|
3411
3411
|
const saved = localStorage.getItem(key);
|
|
3412
3412
|
if (saved) {
|
|
3413
|
-
const
|
|
3414
|
-
for (const [
|
|
3415
|
-
if (
|
|
3416
|
-
initial[
|
|
3413
|
+
const parsed = JSON.parse(saved);
|
|
3414
|
+
for (const [field, value] of Object.entries(parsed)) {
|
|
3415
|
+
if (descriptors[field] && !("value" in descriptors[field])) continue;
|
|
3416
|
+
initial[field] = value;
|
|
3417
3417
|
}
|
|
3418
3418
|
}
|
|
3419
3419
|
} catch (e) {
|
|
3420
3420
|
}
|
|
3421
3421
|
}
|
|
3422
3422
|
const created = reactive(initial);
|
|
3423
|
-
for (const [prop,
|
|
3424
|
-
const value =
|
|
3423
|
+
for (const [prop, descriptor] of Object.entries(descriptors)) {
|
|
3424
|
+
const value = descriptor.value;
|
|
3425
3425
|
if (typeof value === "function") {
|
|
3426
3426
|
created[prop] = (...args) => value.apply(created, args);
|
|
3427
3427
|
}
|
|
3428
3428
|
}
|
|
3429
3429
|
stores.set(name, created);
|
|
3430
|
-
|
|
3430
|
+
version.value++;
|
|
3431
3431
|
if (options.persist && typeof localStorage !== "undefined") {
|
|
3432
3432
|
const stop2 = watch(
|
|
3433
3433
|
created,
|
|
@@ -3445,10 +3445,10 @@ Suggestion: attribute expressions accept a single value. If the logic spans more
|
|
|
3445
3445
|
}
|
|
3446
3446
|
function stripFunctions(source) {
|
|
3447
3447
|
const out = {};
|
|
3448
|
-
const
|
|
3448
|
+
const descriptors = Object.getOwnPropertyDescriptors(toRaw(source));
|
|
3449
3449
|
for (const [key, value] of Object.entries(source)) {
|
|
3450
3450
|
if (typeof value === "function") continue;
|
|
3451
|
-
if (
|
|
3451
|
+
if (descriptors[key] && !("value" in descriptors[key])) continue;
|
|
3452
3452
|
out[key] = value;
|
|
3453
3453
|
}
|
|
3454
3454
|
return out;
|
|
@@ -3457,11 +3457,11 @@ Suggestion: attribute expressions accept a single value. If the logic spans more
|
|
|
3457
3457
|
{},
|
|
3458
3458
|
{
|
|
3459
3459
|
get: (_t, key) => {
|
|
3460
|
-
void
|
|
3460
|
+
void version.value;
|
|
3461
3461
|
return stores.get(key);
|
|
3462
3462
|
},
|
|
3463
3463
|
has: (_t, key) => {
|
|
3464
|
-
void
|
|
3464
|
+
void version.value;
|
|
3465
3465
|
return stores.has(key);
|
|
3466
3466
|
},
|
|
3467
3467
|
ownKeys: () => [...stores.keys()],
|
|
@@ -4404,6 +4404,7 @@ Suggestion: attribute expressions accept a single value. If the logic spans more
|
|
|
4404
4404
|
element.setAttribute("data-type", type);
|
|
4405
4405
|
element.setAttribute("role", type === "error" ? "alert" : "status");
|
|
4406
4406
|
element.setAttribute("aria-live", type === "error" ? "assertive" : "polite");
|
|
4407
|
+
element.setAttribute("aria-atomic", "true");
|
|
4407
4408
|
let closed = false;
|
|
4408
4409
|
let timer = null;
|
|
4409
4410
|
const close = () => {
|
|
@@ -4735,11 +4736,12 @@ Suggestion: attribute expressions accept a single value. If the logic spans more
|
|
|
4735
4736
|
}
|
|
4736
4737
|
};
|
|
4737
4738
|
var THEME_KEY = "voodoo:theme";
|
|
4739
|
+
var picked = null;
|
|
4738
4740
|
var theme = {
|
|
4739
4741
|
/** Theme chosen by the user, or `system` when never set. */
|
|
4740
4742
|
get current() {
|
|
4741
|
-
var _a2;
|
|
4742
|
-
return (_a2 = storage.get(THEME_KEY)) != null ? _a2 : "system";
|
|
4743
|
+
var _a2, _b;
|
|
4744
|
+
return (_b = (_a2 = storage.get(THEME_KEY)) != null ? _a2 : picked) != null ? _b : "system";
|
|
4743
4745
|
},
|
|
4744
4746
|
/** Theme effectively applied, resolving `system`. */
|
|
4745
4747
|
get resolved() {
|
|
@@ -4749,6 +4751,7 @@ Suggestion: attribute expressions accept a single value. If the logic spans more
|
|
|
4749
4751
|
return matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light";
|
|
4750
4752
|
},
|
|
4751
4753
|
set(value) {
|
|
4754
|
+
picked = value;
|
|
4752
4755
|
storage.set(THEME_KEY, value);
|
|
4753
4756
|
this.apply();
|
|
4754
4757
|
},
|
|
@@ -4759,7 +4762,7 @@ Suggestion: attribute expressions accept a single value. If the logic spans more
|
|
|
4759
4762
|
},
|
|
4760
4763
|
/** `true` once the visitor has actually picked a theme. */
|
|
4761
4764
|
get chosen() {
|
|
4762
|
-
return storage.get(THEME_KEY) != null;
|
|
4765
|
+
return picked !== null || storage.get(THEME_KEY) != null;
|
|
4763
4766
|
},
|
|
4764
4767
|
/** Writes `data-theme` on the root element and notifies the page. */
|
|
4765
4768
|
apply() {
|
|
@@ -4783,7 +4786,8 @@ Suggestion: attribute expressions accept a single value. If the logic spans more
|
|
|
4783
4786
|
init() {
|
|
4784
4787
|
if (typeof document === "undefined") return;
|
|
4785
4788
|
this.apply();
|
|
4786
|
-
|
|
4789
|
+
if (typeof matchMedia === "undefined") return;
|
|
4790
|
+
matchMedia("(prefers-color-scheme: dark)").addEventListener("change", () => {
|
|
4787
4791
|
if (this.current === "system") this.apply();
|
|
4788
4792
|
});
|
|
4789
4793
|
}
|
|
@@ -5233,8 +5237,8 @@ Suggestion: attribute expressions accept a single value. If the logic spans more
|
|
|
5233
5237
|
defineDirective("text", ({ el, effect: effect2, evaluate: ev }) => {
|
|
5234
5238
|
effect2(() => {
|
|
5235
5239
|
el.textContent = stringify(ev());
|
|
5236
|
-
const
|
|
5237
|
-
if (
|
|
5240
|
+
const first = el.firstChild;
|
|
5241
|
+
if (first && first.nodeType === 3) markInitialized(first);
|
|
5238
5242
|
});
|
|
5239
5243
|
});
|
|
5240
5244
|
defineDirective("html", (ctx) => {
|
|
@@ -5440,10 +5444,10 @@ Suggestion: attribute expressions accept a single value. If the logic spans more
|
|
|
5440
5444
|
next.push({ key, scope: childScope, nodes, data: childScope.data });
|
|
5441
5445
|
});
|
|
5442
5446
|
if (batch.fragment.firstChild) (_a3 = anchor.parentNode) == null ? void 0 : _a3.insertBefore(batch.fragment, anchor);
|
|
5443
|
-
for (const [node,
|
|
5444
|
-
const
|
|
5447
|
+
for (const [node, rowScope] of batch.pending) walk(node, rowScope);
|
|
5448
|
+
const reused = new Set(next);
|
|
5445
5449
|
for (const block2 of blocks) {
|
|
5446
|
-
if (used.has(block2.key) &&
|
|
5450
|
+
if (used.has(block2.key) && reused.has(block2)) continue;
|
|
5447
5451
|
for (const node of block2.nodes) {
|
|
5448
5452
|
destroy(node);
|
|
5449
5453
|
node.remove();
|
|
@@ -5513,7 +5517,7 @@ Suggestion: attribute expressions accept a single value. If the logic spans more
|
|
|
5513
5517
|
"novalidate",
|
|
5514
5518
|
"inert"
|
|
5515
5519
|
]);
|
|
5516
|
-
var
|
|
5520
|
+
var URL_ATTRIBUTES = /* @__PURE__ */ new Set([
|
|
5517
5521
|
"href",
|
|
5518
5522
|
"src",
|
|
5519
5523
|
"action",
|
|
@@ -5522,15 +5526,15 @@ Suggestion: attribute expressions accept a single value. If the logic spans more
|
|
|
5522
5526
|
"ping",
|
|
5523
5527
|
"poster"
|
|
5524
5528
|
]);
|
|
5525
|
-
var
|
|
5526
|
-
function
|
|
5527
|
-
const
|
|
5528
|
-
return
|
|
5529
|
+
var SCHEME_NOISE = /[\s\x00-\x1f]/g;
|
|
5530
|
+
function isDangerousUrl(value) {
|
|
5531
|
+
const clean = value.replace(SCHEME_NOISE, "").toLowerCase();
|
|
5532
|
+
return clean.startsWith("javascript:") || clean.startsWith("vbscript:") || clean.startsWith("data:text/html") || clean.startsWith("data:application/xhtml");
|
|
5529
5533
|
}
|
|
5530
|
-
function applyBinding(el, name, value, asProp = false,
|
|
5534
|
+
function applyBinding(el, name, value, asProp = false, allowDangerous = false) {
|
|
5531
5535
|
if (name === "class") return applyClass(el, value);
|
|
5532
5536
|
if (name === "style") return applyStyle(el, value);
|
|
5533
|
-
if (config.sanitizeUrls && !
|
|
5537
|
+
if (config.sanitizeUrls && !allowDangerous && name === "srcdoc") {
|
|
5534
5538
|
warn2(
|
|
5535
5539
|
`: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.`
|
|
5536
5540
|
);
|
|
@@ -5538,7 +5542,7 @@ Suggestion: attribute expressions accept a single value. If the logic spans more
|
|
|
5538
5542
|
return;
|
|
5539
5543
|
}
|
|
5540
5544
|
if (config.sanitizeUrls && !asProp) {
|
|
5541
|
-
if (
|
|
5545
|
+
if (URL_ATTRIBUTES.has(name) && typeof value === "string" && isDangerousUrl(value)) {
|
|
5542
5546
|
warn2(
|
|
5543
5547
|
`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.`
|
|
5544
5548
|
);
|
|
@@ -5635,9 +5639,9 @@ Suggestion: attribute expressions accept a single value. If the logic spans more
|
|
|
5635
5639
|
}
|
|
5636
5640
|
if (arg === "key") return;
|
|
5637
5641
|
const asProp = !!modifiers.prop;
|
|
5638
|
-
const
|
|
5642
|
+
const allowDangerous = !!modifiers.dangerous;
|
|
5639
5643
|
effect2(() => {
|
|
5640
|
-
applyBinding(el, arg, ev(), asProp,
|
|
5644
|
+
applyBinding(el, arg, ev(), asProp, allowDangerous);
|
|
5641
5645
|
});
|
|
5642
5646
|
void expression;
|
|
5643
5647
|
},
|
|
@@ -6572,7 +6576,7 @@ Suggestion: attribute expressions accept a single value. If the logic spans more
|
|
|
6572
6576
|
(ctx) => {
|
|
6573
6577
|
var _a3, _b2;
|
|
6574
6578
|
let oldValue;
|
|
6575
|
-
let
|
|
6579
|
+
let mounted2 = false;
|
|
6576
6580
|
const makeBinding = (value) => {
|
|
6577
6581
|
var _a4, _b3;
|
|
6578
6582
|
return {
|
|
@@ -6592,8 +6596,8 @@ Suggestion: attribute expressions accept a single value. If the logic spans more
|
|
|
6592
6596
|
ctx.effect(() => {
|
|
6593
6597
|
var _a4, _b3;
|
|
6594
6598
|
const value = hooks.raw ? ctx.expression : ctx.evaluate();
|
|
6595
|
-
if (!
|
|
6596
|
-
|
|
6599
|
+
if (!mounted2) {
|
|
6600
|
+
mounted2 = true;
|
|
6597
6601
|
oldValue = value;
|
|
6598
6602
|
(_a4 = hooks.mounted) == null ? void 0 : _a4.call(hooks, ctx.el, makeBinding(value));
|
|
6599
6603
|
return;
|
|
@@ -6617,11 +6621,11 @@ Suggestion: attribute expressions accept a single value. If the logic spans more
|
|
|
6617
6621
|
Object.defineProperties(rootScope.data, Object.getOwnPropertyDescriptors(values));
|
|
6618
6622
|
return rootScope.data;
|
|
6619
6623
|
}
|
|
6620
|
-
var
|
|
6624
|
+
var version2 = "0.4.6";
|
|
6621
6625
|
var core = {
|
|
6622
6626
|
// Utilities first: Voodoo's own names can override.
|
|
6623
6627
|
...utils_exports,
|
|
6624
|
-
version,
|
|
6628
|
+
version: version2,
|
|
6625
6629
|
config,
|
|
6626
6630
|
// Reactivity
|
|
6627
6631
|
reactive,
|
|
@@ -9992,7 +9996,7 @@ Suggestion: attribute expressions accept a single value. If the logic spans more
|
|
|
9992
9996
|
if (addedTabIndex) el.setAttribute("tabindex", "0");
|
|
9993
9997
|
let bubble = null;
|
|
9994
9998
|
let timer = null;
|
|
9995
|
-
const
|
|
9999
|
+
const build2 = () => {
|
|
9996
10000
|
const node = document.createElement("div");
|
|
9997
10001
|
node.className = "v-tooltip";
|
|
9998
10002
|
node.setAttribute("role", "tooltip");
|
|
@@ -10006,7 +10010,7 @@ Suggestion: attribute expressions accept a single value. If the logic spans more
|
|
|
10006
10010
|
};
|
|
10007
10011
|
const open = () => {
|
|
10008
10012
|
if (bubble) return;
|
|
10009
|
-
bubble =
|
|
10013
|
+
bubble = build2();
|
|
10010
10014
|
el.setAttribute("aria-describedby", bubble.id);
|
|
10011
10015
|
reposition();
|
|
10012
10016
|
requestAnimationFrame(() => bubble == null ? void 0 : bubble.classList.add("v-in"));
|
|
@@ -11216,37 +11220,37 @@ Suggestion: attribute expressions accept a single value. If the logic spans more
|
|
|
11216
11220
|
init_registry();
|
|
11217
11221
|
init_style();
|
|
11218
11222
|
var messages = {
|
|
11219
|
-
required: "
|
|
11220
|
-
email: "
|
|
11221
|
-
url: "
|
|
11222
|
-
number: "
|
|
11223
|
-
integer: "
|
|
11224
|
-
decimal: "
|
|
11225
|
-
alpha: "Use
|
|
11226
|
-
alphanumeric: "Use
|
|
11227
|
-
minlength: "Use
|
|
11228
|
-
maxlength: "Use
|
|
11229
|
-
min: "
|
|
11230
|
-
max: "
|
|
11231
|
-
between: "
|
|
11232
|
-
match: "
|
|
11233
|
-
regex: "
|
|
11234
|
-
date: "
|
|
11235
|
-
after: "
|
|
11236
|
-
before: "
|
|
11237
|
-
accepted: "
|
|
11238
|
-
same: "
|
|
11239
|
-
different: "
|
|
11240
|
-
in: "
|
|
11241
|
-
notin: "
|
|
11242
|
-
phone: "
|
|
11243
|
-
cpf: "CPF
|
|
11244
|
-
cnpj: "CNPJ
|
|
11245
|
-
cep: "
|
|
11246
|
-
creditcard: "
|
|
11247
|
-
strongpassword: "Use {param}
|
|
11248
|
-
unique: "
|
|
11249
|
-
invalid: "
|
|
11223
|
+
required: "Please fill in this field.",
|
|
11224
|
+
email: "Enter a valid email address.",
|
|
11225
|
+
url: "Enter a valid URL.",
|
|
11226
|
+
number: "Enter a valid number.",
|
|
11227
|
+
integer: "Enter a whole number.",
|
|
11228
|
+
decimal: "Enter a valid decimal number.",
|
|
11229
|
+
alpha: "Use letters only.",
|
|
11230
|
+
alphanumeric: "Use letters and numbers only.",
|
|
11231
|
+
minlength: "Use at least {param} characters.",
|
|
11232
|
+
maxlength: "Use at most {param} characters.",
|
|
11233
|
+
min: "The smallest allowed value is {param}.",
|
|
11234
|
+
max: "The largest allowed value is {param}.",
|
|
11235
|
+
between: "Enter a value between {min} and {max}.",
|
|
11236
|
+
match: "The fields do not match.",
|
|
11237
|
+
regex: "That format is not valid.",
|
|
11238
|
+
date: "Enter a valid date.",
|
|
11239
|
+
after: "The date has to be later than {param}.",
|
|
11240
|
+
before: "The date has to be earlier than {param}.",
|
|
11241
|
+
accepted: "You have to tick this to continue.",
|
|
11242
|
+
same: "The values have to be the same.",
|
|
11243
|
+
different: "The values have to be different.",
|
|
11244
|
+
in: "Choose one of the allowed options.",
|
|
11245
|
+
notin: "That value is not allowed.",
|
|
11246
|
+
phone: "Enter a valid phone number, including the area code.",
|
|
11247
|
+
cpf: "Invalid CPF.",
|
|
11248
|
+
cnpj: "Invalid CNPJ.",
|
|
11249
|
+
cep: "Invalid postcode.",
|
|
11250
|
+
creditcard: "Invalid card number.",
|
|
11251
|
+
strongpassword: "Use {param} characters or more, with an upper case letter, a lower case letter, a number and a symbol.",
|
|
11252
|
+
unique: "That value is already taken.",
|
|
11253
|
+
invalid: "Invalid value."
|
|
11250
11254
|
};
|
|
11251
11255
|
function formatMessage(template, data2) {
|
|
11252
11256
|
var _a2, _b, _c, _d, _e, _f;
|
|
@@ -14683,7 +14687,7 @@ form.v-loading [type="submit"],form.v-loading button[disabled]{opacity:.6}
|
|
|
14683
14687
|
const labels2 = fromOptions ? options.labels.map((label) => String(label)) : [];
|
|
14684
14688
|
const series = [];
|
|
14685
14689
|
const raw = options.data;
|
|
14686
|
-
const singleName = (_a2 = options.name) != null ? _a2 : "
|
|
14690
|
+
const singleName = (_a2 = options.name) != null ? _a2 : "Value";
|
|
14687
14691
|
if (typeof raw === "number") {
|
|
14688
14692
|
series.push({ name: singleName, values: [raw], xs: null, color: palette2[0] });
|
|
14689
14693
|
} else if (Array.isArray(raw) && raw.length > 0) {
|
|
@@ -15416,7 +15420,7 @@ form.v-loading [type="submit"],form.v-loading button[disabled]{opacity:.6}
|
|
|
15416
15420
|
const palette2 = options.colors && options.colors.length > 0 ? options.colors : CHART_COLORS;
|
|
15417
15421
|
const format = (_b = options.format) != null ? _b : "number";
|
|
15418
15422
|
const width = Math.max(160, Math.round(el.clientWidth || options.width || 640));
|
|
15419
|
-
const height = Math.max(48, Math.round((_c = options.height) != null ? _c : defaultHeight(type)));
|
|
15423
|
+
const height = Math.max(48, Math.round((_c = options.height) != null ? _c : el.clientHeight || defaultHeight(type)));
|
|
15420
15424
|
state2.lastWidth = width;
|
|
15421
15425
|
state2.viewWidth = width;
|
|
15422
15426
|
state2.viewHeight = height;
|
|
@@ -16279,7 +16283,7 @@ ${block(':root:not([data-theme="light"])', dark.vars)}
|
|
|
16279
16283
|
@keyframes v-shimmer{0%{background-position:-180% 0}100%{background-position:180% 0}}
|
|
16280
16284
|
@keyframes v-indeterminate{0%{transform:translateX(-100%)}100%{transform:translateX(340%)}}
|
|
16281
16285
|
|
|
16282
|
-
/*
|
|
16286
|
+
/* ----------------------------------------------------------------- button */
|
|
16283
16287
|
.v-btn{appearance:none;-webkit-appearance:none;position:relative;display:inline-flex;
|
|
16284
16288
|
align-items:center;justify-content:center;gap:8px;vertical-align:middle;white-space:nowrap;
|
|
16285
16289
|
font-family:var(--v-font-sans);font-weight:600;line-height:1;text-decoration:none;
|
|
@@ -16323,7 +16327,7 @@ ${block(':root:not([data-theme="light"])', dark.vars)}
|
|
|
16323
16327
|
.v-btn-spin{width:1em;height:1em;border-radius:50%;border:2px solid currentColor;
|
|
16324
16328
|
border-top-color:transparent;animation:v-spin .7s linear infinite;flex:none}
|
|
16325
16329
|
|
|
16326
|
-
/*
|
|
16330
|
+
/* ------------------------------------------------------------ icon button */
|
|
16327
16331
|
.v-icon-btn{appearance:none;-webkit-appearance:none;display:inline-grid;place-items:center;
|
|
16328
16332
|
border:1px solid transparent;border-radius:var(--v-radius-sm);cursor:pointer;
|
|
16329
16333
|
font-family:var(--v-font-sans);
|
|
@@ -16368,7 +16372,7 @@ ${block(':root:not([data-theme="light"])', dark.vars)}
|
|
|
16368
16372
|
.v-card-foot:empty{display:none}
|
|
16369
16373
|
.v-card[data-padded="false"] .v-card-body{padding:0}
|
|
16370
16374
|
|
|
16371
|
-
/*
|
|
16375
|
+
/* ------------------------------------------------------------------- form */
|
|
16372
16376
|
.v-field{display:flex;flex-direction:column;gap:6px;font-family:var(--v-font-sans);min-width:0}
|
|
16373
16377
|
.v-label{display:inline-flex;align-items:center;gap:4px;font-size:13px;font-weight:600;
|
|
16374
16378
|
line-height:1.3;color:var(--v-text)}
|
|
@@ -16447,7 +16451,7 @@ ${block(':root:not([data-theme="light"])', dark.vars)}
|
|
|
16447
16451
|
.v-select-opt.is-selected .v-select-check{opacity:1}
|
|
16448
16452
|
.v-select-empty{padding:14px 10px;text-align:center;font-size:13.5px;color:var(--v-text-muted)}
|
|
16449
16453
|
|
|
16450
|
-
/*
|
|
16454
|
+
/* --------------------------------------------- checkbox, radio and switch */
|
|
16451
16455
|
.v-check{display:inline-flex;align-items:flex-start;gap:9px;cursor:pointer;
|
|
16452
16456
|
font-family:var(--v-font-sans);font-size:14px;line-height:1.45;color:var(--v-text)}
|
|
16453
16457
|
.v-check[data-disabled="true"]{cursor:not-allowed;opacity:.6}
|
|
@@ -16484,7 +16488,7 @@ ${block(':root:not([data-theme="light"])', dark.vars)}
|
|
|
16484
16488
|
.v-check[data-size="sm"] .v-switch-thumb{width:16px;height:16px}
|
|
16485
16489
|
.v-check[data-size="sm"] .v-check-native:checked+.v-switch-track .v-switch-thumb{transform:translateX(14px)}
|
|
16486
16490
|
|
|
16487
|
-
/*
|
|
16491
|
+
/* ------------------------------------------------------ badge, tag, alert */
|
|
16488
16492
|
.v-badge{display:inline-flex;align-items:center;gap:5px;font-family:var(--v-font-sans);
|
|
16489
16493
|
font-weight:600;line-height:1;border-radius:var(--v-radius-full);border:1px solid transparent;
|
|
16490
16494
|
white-space:nowrap;vertical-align:middle}
|
|
@@ -16561,7 +16565,7 @@ ${block(':root:not([data-theme="light"])', dark.vars)}
|
|
|
16561
16565
|
.v-avatar-status[data-status="busy"]{background:var(--v-danger)}
|
|
16562
16566
|
.v-avatar-status[data-status="away"]{background:var(--v-warning)}
|
|
16563
16567
|
|
|
16564
|
-
/*
|
|
16568
|
+
/* --------------------------------------------------- spinner and skeleton */
|
|
16565
16569
|
.v-spinner{display:inline-block;border-radius:50%;border-style:solid;border-color:var(--v-border);
|
|
16566
16570
|
border-top-color:var(--v-primary);animation:v-spin .7s linear infinite;vertical-align:middle}
|
|
16567
16571
|
.v-spinner[data-tone="accent"]{border-top-color:var(--v-accent)}
|
|
@@ -16578,7 +16582,7 @@ ${block(':root:not([data-theme="light"])', dark.vars)}
|
|
|
16578
16582
|
.v-skeleton[data-circle="true"]{border-radius:var(--v-radius-full)}
|
|
16579
16583
|
.v-skeleton-stack{display:flex;flex-direction:column;gap:8px}
|
|
16580
16584
|
|
|
16581
|
-
/*
|
|
16585
|
+
/* --------------------------------------------------------------- progress */
|
|
16582
16586
|
.v-progress{font-family:var(--v-font-sans);display:flex;flex-direction:column;gap:6px}
|
|
16583
16587
|
.v-progress-head{display:flex;justify-content:space-between;gap:12px;font-size:13px;color:var(--v-text-muted)}
|
|
16584
16588
|
.v-progress-value{font-weight:650;color:var(--v-text)}
|
|
@@ -16595,7 +16599,7 @@ ${block(':root:not([data-theme="light"])', dark.vars)}
|
|
|
16595
16599
|
.v-progress[data-tone="danger"] .v-progress-bar{background:var(--v-danger)}
|
|
16596
16600
|
.v-progress[data-indeterminate="true"] .v-progress-bar{width:30% !important;animation:v-indeterminate 1.3s var(--v-ease) infinite}
|
|
16597
16601
|
|
|
16598
|
-
/*
|
|
16602
|
+
/* ---------------------------------------------------------------- divider */
|
|
16599
16603
|
.v-divider{display:flex;align-items:center;gap:12px;color:var(--v-text-soft);
|
|
16600
16604
|
font-family:var(--v-font-sans);font-size:12.5px;font-weight:600;margin:16px 0}
|
|
16601
16605
|
.v-divider::before,.v-divider::after{content:"";flex:1;height:1px;background:var(--v-border)}
|
|
@@ -16603,7 +16607,7 @@ ${block(':root:not([data-theme="light"])', dark.vars)}
|
|
|
16603
16607
|
.v-divider[data-vertical="true"]{flex-direction:column;margin:0 16px;align-self:stretch;height:auto}
|
|
16604
16608
|
.v-divider[data-vertical="true"]::before,.v-divider[data-vertical="true"]::after{width:1px;height:auto;flex:1}
|
|
16605
16609
|
|
|
16606
|
-
/*
|
|
16610
|
+
/* ------------------------------------------------------------------ table */
|
|
16607
16611
|
.v-table-wrap{width:100%;overflow-x:auto;background:var(--v-surface);border:1px solid var(--v-border);
|
|
16608
16612
|
border-radius:var(--v-radius);font-family:var(--v-font-sans)}
|
|
16609
16613
|
.v-table{width:100%;border-collapse:collapse;font-size:14px;color:var(--v-text)}
|
|
@@ -16624,7 +16628,7 @@ ${block(':root:not([data-theme="light"])', dark.vars)}
|
|
|
16624
16628
|
.v-th[aria-sort="ascending"] .v-th-arrow,.v-th[aria-sort="descending"] .v-th-arrow{opacity:1;color:var(--v-primary)}
|
|
16625
16629
|
.v-table-empty{text-align:center;color:var(--v-text-muted);padding:34px 14px;font-size:14px}
|
|
16626
16630
|
|
|
16627
|
-
/*
|
|
16631
|
+
/* ------------------------------------------------------------- pagination */
|
|
16628
16632
|
.v-pagination{display:flex;align-items:center;gap:6px;flex-wrap:wrap;font-family:var(--v-font-sans)}
|
|
16629
16633
|
.v-page{appearance:none;min-width:34px;height:34px;padding:0 9px;display:inline-grid;place-items:center;
|
|
16630
16634
|
background:transparent;border:1px solid transparent;border-radius:var(--v-radius-sm);
|
|
@@ -16636,7 +16640,7 @@ ${block(':root:not([data-theme="light"])', dark.vars)}
|
|
|
16636
16640
|
.v-page[aria-current="page"]{background:var(--v-primary);border-color:var(--v-primary);color:var(--v-primary-contrast)}
|
|
16637
16641
|
.v-page-gap{min-width:24px;text-align:center;color:var(--v-text-soft);user-select:none}
|
|
16638
16642
|
|
|
16639
|
-
/*
|
|
16643
|
+
/* ------------------------------------------------------------- breadcrumb */
|
|
16640
16644
|
.v-breadcrumb{font-family:var(--v-font-sans);font-size:13.5px}
|
|
16641
16645
|
.v-breadcrumb-list{list-style:none;display:flex;flex-wrap:wrap;align-items:center;gap:6px;margin:0;padding:0}
|
|
16642
16646
|
.v-breadcrumb-item{display:inline-flex;align-items:center;gap:6px;color:var(--v-text-muted)}
|
|
@@ -16646,7 +16650,7 @@ ${block(':root:not([data-theme="light"])', dark.vars)}
|
|
|
16646
16650
|
.v-breadcrumb-item[aria-current="page"]{color:var(--v-text);font-weight:600}
|
|
16647
16651
|
.v-breadcrumb-sep{color:var(--v-text-soft);user-select:none}
|
|
16648
16652
|
|
|
16649
|
-
/*
|
|
16653
|
+
/* ------------------------------------------------------------------- stat */
|
|
16650
16654
|
.v-stat{display:flex;gap:14px;align-items:flex-start;padding:16px 18px;background:var(--v-surface);
|
|
16651
16655
|
border:1px solid var(--v-border);border-radius:var(--v-radius);font-family:var(--v-font-sans)}
|
|
16652
16656
|
.v-stat-icon{flex:none;width:40px;height:40px;display:grid;place-items:center;font-size:19px;
|
|
@@ -16664,7 +16668,7 @@ ${block(':root:not([data-theme="light"])', dark.vars)}
|
|
|
16664
16668
|
.v-stat-delta[data-dir="flat"]{background:var(--v-surface-3);color:var(--v-text-muted)}
|
|
16665
16669
|
.v-stat-hint{font-size:12.5px;color:var(--v-text-muted)}
|
|
16666
16670
|
|
|
16667
|
-
/*
|
|
16671
|
+
/* ------------------------------------------------------------ empty state */
|
|
16668
16672
|
.v-empty{display:flex;flex-direction:column;align-items:center;text-align:center;gap:10px;
|
|
16669
16673
|
padding:44px 22px;font-family:var(--v-font-sans);color:var(--v-text)}
|
|
16670
16674
|
.v-empty-icon{width:58px;height:58px;display:grid;place-items:center;font-size:27px;
|
|
@@ -16674,7 +16678,7 @@ ${block(':root:not([data-theme="light"])', dark.vars)}
|
|
|
16674
16678
|
.v-empty-actions{margin-top:6px;display:flex;gap:10px;flex-wrap:wrap;justify-content:center}
|
|
16675
16679
|
.v-empty-actions:empty{display:none}
|
|
16676
16680
|
|
|
16677
|
-
/*
|
|
16681
|
+
/* --------------------------------------------------------------- timeline */
|
|
16678
16682
|
.v-timeline{list-style:none;margin:0;padding:0;font-family:var(--v-font-sans);
|
|
16679
16683
|
display:flex;flex-direction:column}
|
|
16680
16684
|
.v-timeline-item{position:relative;display:flex;gap:14px;padding-bottom:20px}
|
|
@@ -16694,7 +16698,7 @@ ${block(':root:not([data-theme="light"])', dark.vars)}
|
|
|
16694
16698
|
.v-timeline-desc{margin:3px 0 0;font-size:13.5px;line-height:1.55;color:var(--v-text-muted)}
|
|
16695
16699
|
.v-timeline-time{display:block;margin-top:3px;font-size:12px;color:var(--v-text-soft)}
|
|
16696
16700
|
|
|
16697
|
-
/*
|
|
16701
|
+
/* ------------------------------------------------------------------ steps */
|
|
16698
16702
|
.v-steps{display:flex;gap:0;font-family:var(--v-font-sans);list-style:none;margin:0;padding:0}
|
|
16699
16703
|
.v-steps[data-vertical="true"]{flex-direction:column;gap:4px}
|
|
16700
16704
|
.v-step{flex:1;display:flex;align-items:flex-start;gap:10px;min-width:0;position:relative;padding-right:12px}
|
|
@@ -16713,7 +16717,7 @@ ${block(':root:not([data-theme="light"])', dark.vars)}
|
|
|
16713
16717
|
.v-steps[data-vertical="true"] .v-step-line{left:13px;right:auto;top:30px;bottom:2px;width:2px;height:auto}
|
|
16714
16718
|
.v-step:last-child .v-step-line{display:none}
|
|
16715
16719
|
|
|
16716
|
-
/*
|
|
16720
|
+
/* ----------------------------------------------------------------- rating */
|
|
16717
16721
|
.v-rating{display:inline-flex;align-items:center;gap:6px;font-family:var(--v-font-sans)}
|
|
16718
16722
|
.v-rating-stars{display:inline-flex;gap:2px}
|
|
16719
16723
|
.v-star{appearance:none;background:none;border:0;padding:2px;cursor:pointer;line-height:0;
|
|
@@ -16740,7 +16744,7 @@ ${block(':root:not([data-theme="light"])', dark.vars)}
|
|
|
16740
16744
|
.v-tip[data-placement="right"]{left:calc(100% + 8px);top:50%;translate:0 -50%}
|
|
16741
16745
|
.v-tipwrap:hover .v-tip,.v-tipwrap:focus-within .v-tip{opacity:1;transform:none}
|
|
16742
16746
|
|
|
16743
|
-
/*
|
|
16747
|
+
/* ------------------------------------------------------------------- code */
|
|
16744
16748
|
.v-code{position:relative;background:var(--v-surface-inset);border:1px solid var(--v-border);
|
|
16745
16749
|
border-radius:var(--v-radius);overflow:hidden;font-family:var(--v-font-mono)}
|
|
16746
16750
|
.v-code-head{display:flex;align-items:center;justify-content:space-between;gap:10px;
|
|
@@ -17753,7 +17757,7 @@ ${block(':root:not([data-theme="light"])', dark.vars)}
|
|
|
17753
17757
|
props: {
|
|
17754
17758
|
columns: { type: "any", default: "" },
|
|
17755
17759
|
rows: { type: "any", default: "" },
|
|
17756
|
-
empty: { type: "string", default: "
|
|
17760
|
+
empty: { type: "string", default: "No records found" },
|
|
17757
17761
|
sortable: { type: "any", default: true },
|
|
17758
17762
|
dense: BOOL,
|
|
17759
17763
|
striped: BOOL,
|
|
@@ -17865,9 +17869,9 @@ ${block(':root:not([data-theme="light"])', dark.vars)}
|
|
|
17865
17869
|
total: { type: "number", default: 0 },
|
|
17866
17870
|
perPage: { type: "number", default: 10 },
|
|
17867
17871
|
siblings: { type: "number", default: 1 },
|
|
17868
|
-
previousLabel: { type: "string", default: "
|
|
17869
|
-
nextLabel: { type: "string", default: "
|
|
17870
|
-
ariaLabel: { type: "string", default: "
|
|
17872
|
+
previousLabel: { type: "string", default: "Previous" },
|
|
17873
|
+
nextLabel: { type: "string", default: "Next" },
|
|
17874
|
+
ariaLabel: { type: "string", default: "Pagination" }
|
|
17871
17875
|
},
|
|
17872
17876
|
computed: {
|
|
17873
17877
|
lastPage() {
|
|
@@ -17881,7 +17885,7 @@ ${block(':root:not([data-theme="light"])', dark.vars)}
|
|
|
17881
17885
|
const value = Number(this.page) || 1;
|
|
17882
17886
|
return Math.min(Math.max(1, Math.round(value)), this.lastPage);
|
|
17883
17887
|
},
|
|
17884
|
-
/**
|
|
17888
|
+
/** Visible page numbers, with `0` marking the ellipsis. */
|
|
17885
17889
|
items() {
|
|
17886
17890
|
const last = this.lastPage;
|
|
17887
17891
|
const current2 = this.currentPage;
|
|
@@ -17926,7 +17930,7 @@ ${block(':root:not([data-theme="light"])', dark.vars)}
|
|
|
17926
17930
|
<template v-for="(item, index) in items" :key="index">
|
|
17927
17931
|
<span class="v-page-gap" v-if="item === 0" aria-hidden="true">...</span>
|
|
17928
17932
|
<button type="button" class="v-page" v-if="item !== 0" :aria-current="isCurrent(item)"
|
|
17929
|
-
:aria-label="'
|
|
17933
|
+
:aria-label="'Page ' + item" v-click="go(item)" v-text="item"></button>
|
|
17930
17934
|
</template>
|
|
17931
17935
|
<button type="button" class="v-page" :disabled="currentPage >= lastPage"
|
|
17932
17936
|
:aria-label="nextLabel" v-click="go(currentPage + 1)" v-html="svgIcon('chevron-right')"></button>
|
|
@@ -17959,7 +17963,7 @@ ${block(':root:not([data-theme="light"])', dark.vars)}
|
|
|
17959
17963
|
props: {
|
|
17960
17964
|
items: { type: "any", default: "" },
|
|
17961
17965
|
separator: { type: "string", default: "/" },
|
|
17962
|
-
ariaLabel: { type: "string", default: "
|
|
17966
|
+
ariaLabel: { type: "string", default: "Breadcrumb" }
|
|
17963
17967
|
},
|
|
17964
17968
|
computed: {
|
|
17965
17969
|
crumbs() {
|
|
@@ -17993,7 +17997,7 @@ ${block(':root:not([data-theme="light"])', dark.vars)}
|
|
|
17993
17997
|
hint: TEXT,
|
|
17994
17998
|
icon: TEXT,
|
|
17995
17999
|
suffix: { type: "string", default: "%" },
|
|
17996
|
-
/**
|
|
18000
|
+
/** When `true`, a negative change counts as positive. */
|
|
17997
18001
|
inverted: BOOL
|
|
17998
18002
|
},
|
|
17999
18003
|
computed: {
|
|
@@ -18046,7 +18050,7 @@ ${block(':root:not([data-theme="light"])', dark.vars)}
|
|
|
18046
18050
|
register("v-empty-state", {
|
|
18047
18051
|
props: {
|
|
18048
18052
|
icon: { type: "string", default: "inbox" },
|
|
18049
|
-
title: { type: "string", default: "
|
|
18053
|
+
title: { type: "string", default: "Nothing here yet" },
|
|
18050
18054
|
description: TEXT
|
|
18051
18055
|
},
|
|
18052
18056
|
template: `
|
|
@@ -18120,7 +18124,7 @@ ${block(':root:not([data-theme="light"])', dark.vars)}
|
|
|
18120
18124
|
steps: { type: "any", default: "" },
|
|
18121
18125
|
current: { type: "number", default: 0 },
|
|
18122
18126
|
vertical: BOOL,
|
|
18123
|
-
ariaLabel: { type: "string", default: "
|
|
18127
|
+
ariaLabel: { type: "string", default: "Steps" }
|
|
18124
18128
|
},
|
|
18125
18129
|
computed: {
|
|
18126
18130
|
...flags("vertical"),
|
|
@@ -18168,7 +18172,7 @@ ${block(':root:not([data-theme="light"])', dark.vars)}
|
|
|
18168
18172
|
value: { type: "number", default: 0 },
|
|
18169
18173
|
max: { type: "number", default: 5 },
|
|
18170
18174
|
size: { type: "string", default: "md" },
|
|
18171
|
-
label: { type: "string", default: "
|
|
18175
|
+
label: { type: "string", default: "Rating" },
|
|
18172
18176
|
readonly: BOOL,
|
|
18173
18177
|
disabled: BOOL,
|
|
18174
18178
|
showValue: BOOL,
|
|
@@ -18194,7 +18198,7 @@ ${block(':root:not([data-theme="light"])', dark.vars)}
|
|
|
18194
18198
|
return this.hovered > 0 ? this.hovered : this.score;
|
|
18195
18199
|
},
|
|
18196
18200
|
valueText() {
|
|
18197
|
-
return `${this.score}
|
|
18201
|
+
return `${this.score} of ${this.total}`;
|
|
18198
18202
|
}
|
|
18199
18203
|
},
|
|
18200
18204
|
methods: {
|
|
@@ -18250,7 +18254,7 @@ ${block(':root:not([data-theme="light"])', dark.vars)}
|
|
|
18250
18254
|
:tabindex="locked ? -1 : 0" :aria-readonly="locked" v-keydown="onKey" v-mouseleave="reset">
|
|
18251
18255
|
<span class="v-rating-stars">
|
|
18252
18256
|
<button type="button" class="v-star" v-for="index in total" :key="index"
|
|
18253
|
-
:data-on="isOn(index)" :disabled="locked" :aria-label="index + '
|
|
18257
|
+
:data-on="isOn(index)" :disabled="locked" :aria-label="index + ' of ' + total"
|
|
18254
18258
|
:tabindex="-1" v-click="pick(index)" v-mouseenter="preview(index)"
|
|
18255
18259
|
v-html="svgIcon('star')"></button>
|
|
18256
18260
|
</span>
|
|
@@ -18318,8 +18322,8 @@ ${block(':root:not([data-theme="light"])', dark.vars)}
|
|
|
18318
18322
|
code: TEXT,
|
|
18319
18323
|
language: TEXT,
|
|
18320
18324
|
filename: TEXT,
|
|
18321
|
-
copyLabel: { type: "string", default: "
|
|
18322
|
-
copiedLabel: { type: "string", default: "
|
|
18325
|
+
copyLabel: { type: "string", default: "Copy" },
|
|
18326
|
+
copiedLabel: { type: "string", default: "Copied" },
|
|
18323
18327
|
wrap: BOOL
|
|
18324
18328
|
},
|
|
18325
18329
|
state() {
|
|
@@ -18663,7 +18667,7 @@ textarea.v-dialog-input{min-height:96px;resize:vertical}
|
|
|
18663
18667
|
source.remove();
|
|
18664
18668
|
}
|
|
18665
18669
|
sourceAnchors.delete(source);
|
|
18666
|
-
if (source
|
|
18670
|
+
if (hasDirective(source, "modal-content")) {
|
|
18667
18671
|
source.setAttribute("hidden", "");
|
|
18668
18672
|
}
|
|
18669
18673
|
}
|
|
@@ -20699,14 +20703,14 @@ textarea.v-dialog-input{min-height:96px;resize:vertical}
|
|
|
20699
20703
|
|
|
20700
20704
|
// src/devtools/launcher.ts
|
|
20701
20705
|
init_style();
|
|
20702
|
-
var
|
|
20703
|
-
var
|
|
20704
|
-
var
|
|
20706
|
+
var POSITION_KEY = "voodoo:devtools:widget-position";
|
|
20707
|
+
var HIDDEN_KEY = "voodoo:devtools:widget-hidden";
|
|
20708
|
+
var DRAG_THRESHOLD = 4;
|
|
20705
20709
|
var refs2 = null;
|
|
20706
|
-
var
|
|
20707
|
-
var
|
|
20708
|
-
var
|
|
20709
|
-
var
|
|
20710
|
+
var mounted = false;
|
|
20711
|
+
var counterTimer = 0;
|
|
20712
|
+
var pulseTimer = 0;
|
|
20713
|
+
var teardown2 = [];
|
|
20710
20714
|
var WIDGET_CSS = `
|
|
20711
20715
|
.v-devtools-widget{
|
|
20712
20716
|
all: initial;
|
|
@@ -20839,219 +20843,219 @@ textarea.v-dialog-input{min-height:96px;resize:vertical}
|
|
|
20839
20843
|
.v-devtools-btn:hover{transform:none}
|
|
20840
20844
|
}
|
|
20841
20845
|
`;
|
|
20842
|
-
var
|
|
20846
|
+
var MARK = `<svg class="v-devtools-mark" viewBox="0 0 24 24" fill="none" aria-hidden="true">
|
|
20843
20847
|
<path d="M4 4l8 16 8-16" stroke="#6D3BF5" stroke-width="2.4" stroke-linecap="round" stroke-linejoin="round"/>
|
|
20844
20848
|
<circle cx="12" cy="7.5" r="2" fill="#FF3D8B"/>
|
|
20845
20849
|
</svg>`;
|
|
20846
|
-
function
|
|
20850
|
+
function readPosition() {
|
|
20847
20851
|
try {
|
|
20848
|
-
const
|
|
20849
|
-
if (!
|
|
20850
|
-
const
|
|
20851
|
-
if (typeof (
|
|
20852
|
-
return
|
|
20852
|
+
const raw = localStorage.getItem(POSITION_KEY);
|
|
20853
|
+
if (!raw) return null;
|
|
20854
|
+
const value = JSON.parse(raw);
|
|
20855
|
+
if (typeof (value == null ? void 0 : value.x) !== "number" || typeof (value == null ? void 0 : value.y) !== "number") return null;
|
|
20856
|
+
return value;
|
|
20853
20857
|
} catch (e) {
|
|
20854
20858
|
return null;
|
|
20855
20859
|
}
|
|
20856
20860
|
}
|
|
20857
|
-
function
|
|
20861
|
+
function writePosition(pos) {
|
|
20858
20862
|
try {
|
|
20859
|
-
localStorage.setItem(
|
|
20863
|
+
localStorage.setItem(POSITION_KEY, JSON.stringify(pos));
|
|
20860
20864
|
} catch (e) {
|
|
20861
20865
|
}
|
|
20862
20866
|
}
|
|
20863
|
-
function
|
|
20864
|
-
const
|
|
20865
|
-
const
|
|
20866
|
-
const x = Math.min(Math.max(8, pos.x), Math.max(8, window.innerWidth -
|
|
20867
|
-
const y = Math.min(Math.max(8, pos.y), Math.max(8, window.innerHeight -
|
|
20868
|
-
|
|
20869
|
-
|
|
20870
|
-
|
|
20871
|
-
|
|
20872
|
-
}
|
|
20873
|
-
function
|
|
20874
|
-
const
|
|
20875
|
-
|
|
20876
|
-
|
|
20877
|
-
const
|
|
20878
|
-
|
|
20879
|
-
|
|
20880
|
-
|
|
20881
|
-
|
|
20882
|
-
|
|
20883
|
-
|
|
20884
|
-
const
|
|
20885
|
-
|
|
20886
|
-
|
|
20887
|
-
const
|
|
20888
|
-
|
|
20889
|
-
|
|
20890
|
-
const
|
|
20891
|
-
|
|
20892
|
-
|
|
20893
|
-
|
|
20894
|
-
const
|
|
20895
|
-
|
|
20896
|
-
|
|
20897
|
-
|
|
20898
|
-
|
|
20899
|
-
|
|
20900
|
-
|
|
20901
|
-
document.body.appendChild(
|
|
20902
|
-
const
|
|
20903
|
-
if (
|
|
20904
|
-
|
|
20867
|
+
function applyPosition(root, pos) {
|
|
20868
|
+
const width = root.offsetWidth || 120;
|
|
20869
|
+
const height = root.offsetHeight || 38;
|
|
20870
|
+
const x = Math.min(Math.max(8, pos.x), Math.max(8, window.innerWidth - width - 8));
|
|
20871
|
+
const y = Math.min(Math.max(8, pos.y), Math.max(8, window.innerHeight - height - 8));
|
|
20872
|
+
root.style.left = `${x}px`;
|
|
20873
|
+
root.style.top = `${y}px`;
|
|
20874
|
+
root.style.right = "auto";
|
|
20875
|
+
root.style.bottom = "auto";
|
|
20876
|
+
}
|
|
20877
|
+
function build() {
|
|
20878
|
+
const root = document.createElement("div");
|
|
20879
|
+
root.className = "v-devtools-widget";
|
|
20880
|
+
root.setAttribute("data-voodoo-devtools", "widget");
|
|
20881
|
+
const button = document.createElement("button");
|
|
20882
|
+
button.type = "button";
|
|
20883
|
+
button.className = "v-devtools-btn";
|
|
20884
|
+
button.setAttribute("aria-label", "Open Voodoo devtools (Ctrl+Shift+X)");
|
|
20885
|
+
button.setAttribute("aria-pressed", "false");
|
|
20886
|
+
button.title = "Voodoo devtools \u2014 click to inspect, drag to move (Ctrl+Shift+X)";
|
|
20887
|
+
button.innerHTML = MARK;
|
|
20888
|
+
const label = document.createElement("span");
|
|
20889
|
+
label.className = "v-devtools-label";
|
|
20890
|
+
label.textContent = "Voodoo";
|
|
20891
|
+
const counter2 = document.createElement("span");
|
|
20892
|
+
counter2.className = "v-devtools-count";
|
|
20893
|
+
counter2.textContent = "0";
|
|
20894
|
+
const pulse = document.createElement("span");
|
|
20895
|
+
pulse.className = "v-devtools-pulse";
|
|
20896
|
+
pulse.setAttribute("data-on", "false");
|
|
20897
|
+
button.append(label, counter2, pulse);
|
|
20898
|
+
const close = document.createElement("button");
|
|
20899
|
+
close.type = "button";
|
|
20900
|
+
close.className = "v-devtools-close";
|
|
20901
|
+
close.setAttribute("aria-label", "Hide the devtools widget in this tab");
|
|
20902
|
+
close.title = "Hide in this tab";
|
|
20903
|
+
close.textContent = "\xD7";
|
|
20904
|
+
root.append(button, close);
|
|
20905
|
+
document.body.appendChild(root);
|
|
20906
|
+
const saved = readPosition();
|
|
20907
|
+
if (saved) {
|
|
20908
|
+
applyPosition(root, saved);
|
|
20905
20909
|
} else {
|
|
20906
|
-
|
|
20907
|
-
|
|
20908
|
-
}
|
|
20909
|
-
return {
|
|
20910
|
-
}
|
|
20911
|
-
function
|
|
20912
|
-
let
|
|
20913
|
-
let
|
|
20914
|
-
let
|
|
20915
|
-
let
|
|
20916
|
-
let
|
|
20917
|
-
let
|
|
20918
|
-
const
|
|
20910
|
+
root.style.right = "16px";
|
|
20911
|
+
root.style.bottom = "16px";
|
|
20912
|
+
}
|
|
20913
|
+
return { root, button, pulse, counter: counter2, close };
|
|
20914
|
+
}
|
|
20915
|
+
function enableDrag(refs3, onClick) {
|
|
20916
|
+
let dragging = false;
|
|
20917
|
+
let moved = false;
|
|
20918
|
+
let offsetX = 0;
|
|
20919
|
+
let offsetY = 0;
|
|
20920
|
+
let startX = 0;
|
|
20921
|
+
let startY = 0;
|
|
20922
|
+
const onPointerDown = (event) => {
|
|
20919
20923
|
var _a2, _b;
|
|
20920
|
-
if (
|
|
20921
|
-
const
|
|
20922
|
-
|
|
20923
|
-
|
|
20924
|
-
|
|
20925
|
-
|
|
20926
|
-
|
|
20927
|
-
|
|
20928
|
-
(_b = (_a2 = refs3.
|
|
20924
|
+
if (event.button !== 0) return;
|
|
20925
|
+
const box = refs3.root.getBoundingClientRect();
|
|
20926
|
+
dragging = true;
|
|
20927
|
+
moved = false;
|
|
20928
|
+
startX = event.clientX;
|
|
20929
|
+
startY = event.clientY;
|
|
20930
|
+
offsetX = event.clientX - box.left;
|
|
20931
|
+
offsetY = event.clientY - box.top;
|
|
20932
|
+
(_b = (_a2 = refs3.button).setPointerCapture) == null ? void 0 : _b.call(_a2, event.pointerId);
|
|
20929
20933
|
};
|
|
20930
|
-
const
|
|
20931
|
-
if (!
|
|
20932
|
-
const
|
|
20933
|
-
if (!
|
|
20934
|
-
|
|
20935
|
-
|
|
20936
|
-
|
|
20934
|
+
const onPointerMove2 = (event) => {
|
|
20935
|
+
if (!dragging) return;
|
|
20936
|
+
const distance = Math.hypot(event.clientX - startX, event.clientY - startY);
|
|
20937
|
+
if (!moved && distance < DRAG_THRESHOLD) return;
|
|
20938
|
+
moved = true;
|
|
20939
|
+
event.preventDefault();
|
|
20940
|
+
applyPosition(refs3.root, { x: event.clientX - offsetX, y: event.clientY - offsetY });
|
|
20937
20941
|
};
|
|
20938
|
-
const
|
|
20942
|
+
const onPointerUp = (event) => {
|
|
20939
20943
|
var _a2, _b;
|
|
20940
|
-
if (!
|
|
20941
|
-
|
|
20942
|
-
(_b = (_a2 = refs3.
|
|
20943
|
-
if (!
|
|
20944
|
-
|
|
20944
|
+
if (!dragging) return;
|
|
20945
|
+
dragging = false;
|
|
20946
|
+
(_b = (_a2 = refs3.button).releasePointerCapture) == null ? void 0 : _b.call(_a2, event.pointerId);
|
|
20947
|
+
if (!moved) {
|
|
20948
|
+
onClick();
|
|
20945
20949
|
return;
|
|
20946
20950
|
}
|
|
20947
|
-
const
|
|
20948
|
-
|
|
20951
|
+
const box = refs3.root.getBoundingClientRect();
|
|
20952
|
+
writePosition({ x: box.left, y: box.top });
|
|
20949
20953
|
};
|
|
20950
|
-
const
|
|
20951
|
-
if (
|
|
20952
|
-
|
|
20953
|
-
|
|
20954
|
+
const onKeyDown = (event) => {
|
|
20955
|
+
if (event.key !== "Enter" && event.key !== " ") return;
|
|
20956
|
+
event.preventDefault();
|
|
20957
|
+
onClick();
|
|
20954
20958
|
};
|
|
20955
|
-
const
|
|
20956
|
-
const
|
|
20957
|
-
if (refs3.
|
|
20959
|
+
const onResize = () => {
|
|
20960
|
+
const box = refs3.root.getBoundingClientRect();
|
|
20961
|
+
if (refs3.root.style.left) applyPosition(refs3.root, { x: box.left, y: box.top });
|
|
20958
20962
|
};
|
|
20959
|
-
refs3.
|
|
20960
|
-
refs3.
|
|
20961
|
-
refs3.
|
|
20962
|
-
refs3.
|
|
20963
|
-
refs3.
|
|
20964
|
-
window.addEventListener("resize",
|
|
20963
|
+
refs3.button.addEventListener("pointerdown", onPointerDown);
|
|
20964
|
+
refs3.button.addEventListener("pointermove", onPointerMove2);
|
|
20965
|
+
refs3.button.addEventListener("pointerup", onPointerUp);
|
|
20966
|
+
refs3.button.addEventListener("pointercancel", onPointerUp);
|
|
20967
|
+
refs3.button.addEventListener("keydown", onKeyDown);
|
|
20968
|
+
window.addEventListener("resize", onResize);
|
|
20965
20969
|
return () => {
|
|
20966
|
-
refs3.
|
|
20967
|
-
refs3.
|
|
20968
|
-
refs3.
|
|
20969
|
-
refs3.
|
|
20970
|
-
refs3.
|
|
20971
|
-
window.removeEventListener("resize",
|
|
20970
|
+
refs3.button.removeEventListener("pointerdown", onPointerDown);
|
|
20971
|
+
refs3.button.removeEventListener("pointermove", onPointerMove2);
|
|
20972
|
+
refs3.button.removeEventListener("pointerup", onPointerUp);
|
|
20973
|
+
refs3.button.removeEventListener("pointercancel", onPointerUp);
|
|
20974
|
+
refs3.button.removeEventListener("keydown", onKeyDown);
|
|
20975
|
+
window.removeEventListener("resize", onResize);
|
|
20972
20976
|
};
|
|
20973
20977
|
}
|
|
20974
|
-
function
|
|
20978
|
+
function blink() {
|
|
20975
20979
|
if (!refs2) return;
|
|
20976
|
-
refs2.
|
|
20977
|
-
window.clearTimeout(
|
|
20978
|
-
|
|
20979
|
-
refs2 == null ? void 0 : refs2.
|
|
20980
|
+
refs2.pulse.setAttribute("data-on", "true");
|
|
20981
|
+
window.clearTimeout(pulseTimer);
|
|
20982
|
+
pulseTimer = window.setTimeout(() => {
|
|
20983
|
+
refs2 == null ? void 0 : refs2.pulse.setAttribute("data-on", "false");
|
|
20980
20984
|
}, 320);
|
|
20981
20985
|
}
|
|
20982
|
-
function
|
|
20986
|
+
function updateCounter() {
|
|
20983
20987
|
if (!refs2) return;
|
|
20984
20988
|
const total = instances.size;
|
|
20985
|
-
const
|
|
20986
|
-
if (refs2.
|
|
20989
|
+
const text = total === 1 ? "1 component" : `${total} components`;
|
|
20990
|
+
if (refs2.counter.textContent !== text) refs2.counter.textContent = text;
|
|
20987
20991
|
}
|
|
20988
20992
|
function mountDevtoolsWidget() {
|
|
20989
|
-
if (
|
|
20993
|
+
if (mounted || typeof document === "undefined" || !document.body) return;
|
|
20990
20994
|
try {
|
|
20991
|
-
if (sessionStorage.getItem(
|
|
20995
|
+
if (sessionStorage.getItem(HIDDEN_KEY) === "1") return;
|
|
20992
20996
|
} catch (e) {
|
|
20993
20997
|
}
|
|
20994
|
-
|
|
20998
|
+
mounted = true;
|
|
20995
20999
|
injectStyle("devtools-widget", WIDGET_CSS);
|
|
20996
|
-
refs2 =
|
|
20997
|
-
const
|
|
20998
|
-
const
|
|
20999
|
-
refs2 == null ? void 0 : refs2.
|
|
21000
|
-
refs2 == null ? void 0 : refs2.
|
|
21000
|
+
refs2 = build();
|
|
21001
|
+
const toggle = () => {
|
|
21002
|
+
const enabled2 = xray();
|
|
21003
|
+
refs2 == null ? void 0 : refs2.root.setAttribute("data-active", String(enabled2));
|
|
21004
|
+
refs2 == null ? void 0 : refs2.button.setAttribute("aria-pressed", String(enabled2));
|
|
21001
21005
|
};
|
|
21002
|
-
|
|
21003
|
-
const
|
|
21004
|
-
|
|
21006
|
+
teardown2.push(enableDrag(refs2, toggle));
|
|
21007
|
+
const onClose = (event) => {
|
|
21008
|
+
event.stopPropagation();
|
|
21005
21009
|
try {
|
|
21006
|
-
sessionStorage.setItem(
|
|
21010
|
+
sessionStorage.setItem(HIDDEN_KEY, "1");
|
|
21007
21011
|
} catch (e) {
|
|
21008
21012
|
}
|
|
21009
21013
|
unmountDevtoolsWidget();
|
|
21010
21014
|
console.info("[Voodoo] devtools widget hidden. Use V.devtoolsWidget(true) to bring back.");
|
|
21011
21015
|
};
|
|
21012
|
-
refs2.
|
|
21013
|
-
|
|
21014
|
-
const
|
|
21015
|
-
const
|
|
21016
|
-
refs2 == null ? void 0 : refs2.
|
|
21017
|
-
refs2 == null ? void 0 : refs2.
|
|
21016
|
+
refs2.close.addEventListener("click", onClose);
|
|
21017
|
+
teardown2.push(() => refs2 == null ? void 0 : refs2.close.removeEventListener("click", onClose));
|
|
21018
|
+
const onGlobalKeyUp = () => {
|
|
21019
|
+
const enabled2 = isXrayEnabled();
|
|
21020
|
+
refs2 == null ? void 0 : refs2.root.setAttribute("data-active", String(enabled2));
|
|
21021
|
+
refs2 == null ? void 0 : refs2.button.setAttribute("aria-pressed", String(enabled2));
|
|
21018
21022
|
};
|
|
21019
|
-
document.addEventListener("keyup",
|
|
21020
|
-
|
|
21021
|
-
for (const
|
|
21022
|
-
|
|
21023
|
+
document.addEventListener("keyup", onGlobalKeyUp);
|
|
21024
|
+
teardown2.push(() => document.removeEventListener("keyup", onGlobalKeyUp));
|
|
21025
|
+
for (const type of ["network", "event", "navigation", "update"]) {
|
|
21026
|
+
teardown2.push(devtoolsBus.on(type, blink));
|
|
21023
21027
|
}
|
|
21024
|
-
|
|
21025
|
-
|
|
21028
|
+
updateCounter();
|
|
21029
|
+
counterTimer = window.setInterval(updateCounter, 1e3);
|
|
21026
21030
|
}
|
|
21027
21031
|
function unmountDevtoolsWidget() {
|
|
21028
|
-
if (!
|
|
21029
|
-
|
|
21030
|
-
for (const fn of
|
|
21032
|
+
if (!mounted) return;
|
|
21033
|
+
mounted = false;
|
|
21034
|
+
for (const fn of teardown2.splice(0)) {
|
|
21031
21035
|
try {
|
|
21032
21036
|
fn();
|
|
21033
21037
|
} catch (e) {
|
|
21034
21038
|
}
|
|
21035
21039
|
}
|
|
21036
|
-
window.clearInterval(
|
|
21037
|
-
window.clearTimeout(
|
|
21038
|
-
|
|
21039
|
-
|
|
21040
|
-
refs2 == null ? void 0 : refs2.
|
|
21040
|
+
window.clearInterval(counterTimer);
|
|
21041
|
+
window.clearTimeout(pulseTimer);
|
|
21042
|
+
counterTimer = 0;
|
|
21043
|
+
pulseTimer = 0;
|
|
21044
|
+
refs2 == null ? void 0 : refs2.root.remove();
|
|
21041
21045
|
refs2 = null;
|
|
21042
21046
|
}
|
|
21043
21047
|
function devtoolsWidget(force) {
|
|
21044
|
-
const
|
|
21045
|
-
if (
|
|
21048
|
+
const target = force != null ? force : !mounted;
|
|
21049
|
+
if (target) {
|
|
21046
21050
|
try {
|
|
21047
|
-
sessionStorage.removeItem(
|
|
21051
|
+
sessionStorage.removeItem(HIDDEN_KEY);
|
|
21048
21052
|
} catch (e) {
|
|
21049
21053
|
}
|
|
21050
21054
|
mountDevtoolsWidget();
|
|
21051
21055
|
} else {
|
|
21052
21056
|
unmountDevtoolsWidget();
|
|
21053
21057
|
}
|
|
21054
|
-
return
|
|
21058
|
+
return mounted;
|
|
21055
21059
|
}
|
|
21056
21060
|
|
|
21057
21061
|
// src/index.ts
|