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