voodoojs 0.5.0 → 0.6.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{chunk-RJUNPXQF.js → chunk-4LR3IFPX.js} +2 -2
- package/dist/{chunk-ABRZI32G.js → chunk-CNHNFTPC.js} +72 -69
- package/dist/{chunk-34CGORMO.js → chunk-PHMBDPWH.js} +3 -3
- package/dist/essential.cjs +69 -66
- package/dist/essential.d.cts +1 -1
- package/dist/essential.d.ts +1 -1
- package/dist/essential.js +2 -2
- package/dist/gpu.cjs +18 -18
- package/dist/gpu.js +20 -20
- package/dist/index.cjs +304 -277
- package/dist/index.d.cts +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.js +231 -207
- package/dist/{query-BeYufh-f.d.ts → query-CC-_z7v0.d.ts} +5 -5
- package/dist/{query-Bja83lRJ.d.cts → query-sEJXe_cO.d.cts} +5 -5
- package/dist/socket.d.cts +4 -4
- package/dist/socket.d.ts +4 -4
- package/dist/socket.js +3 -3
- package/dist/voodoo.core.js +38 -35
- package/dist/voodoo.core.min.js +15 -15
- package/dist/voodoo.full.js +299 -272
- package/dist/voodoo.full.min.js +74 -74
- package/dist/voodoo.js +70 -67
- package/dist/voodoo.min.js +22 -22
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { core, sound, hotkey, palette, registerMask, unmask, applyMask, masks, mask, clearErrors, showFieldError, showFormErrors, messages, serializeForm, validate, validator, dialog, prompt, confirm, alert, modal, VoodooCollection, fromHtml, ready2, query, viewTransition, defineComponent, storage, ensurePalette, instances, storeNames, allStores } from './chunk-
|
|
2
|
-
export { VoodooCollection, alert, allStores, applyMask, cache, clearErrors, clipboard, confirm, cookie, createApp, createResource, defineComponent, dialog, ready as documentReady, enter, fadeIn, fadeOut, fromHtml, hotkey, instances, leave, mask, masks, modal, mountComponent, network, palette, prompt, query, ready2 as ready, registerMask, removeStore, createResource as resource, screen, serializeForm, session, showFormErrors, slideDown, slideUp, sound, efeitos as soundEffects, storage, store, storeNames, theme, toast, unmask, url, validate, validator, viewTransition, whenElement, whenReady } from './chunk-
|
|
1
|
+
import { core, sound, hotkey, palette, registerMask, unmask, applyMask, masks, mask, clearErrors, showFieldError, showFormErrors, messages, serializeForm, validate, validator, dialog, prompt, confirm, alert, modal, VoodooCollection, fromHtml, ready2, query, viewTransition, defineComponent, storage, ensurePalette, instances, storeNames, allStores } from './chunk-CNHNFTPC.js';
|
|
2
|
+
export { VoodooCollection, alert, allStores, applyMask, cache, clearErrors, clipboard, confirm, cookie, createApp, createResource, defineComponent, dialog, ready as documentReady, enter, fadeIn, fadeOut, fromHtml, hotkey, instances, leave, mask, masks, modal, mountComponent, network, palette, prompt, query, ready2 as ready, registerMask, removeStore, createResource as resource, screen, serializeForm, session, showFormErrors, slideDown, slideUp, sound, efeitos as soundEffects, storage, store, storeNames, theme, toast, unmask, url, validate, validator, viewTransition, whenElement, whenReady } from './chunk-CNHNFTPC.js';
|
|
3
3
|
export { gpu, reflectWgsl } from './chunk-JZIYRIY6.js';
|
|
4
4
|
import { http } from './chunk-PQZEVFVZ.js';
|
|
5
5
|
export { HttpError, http, request } from './chunk-PQZEVFVZ.js';
|
|
6
|
-
import { devtoolsBus } from './chunk-
|
|
7
|
-
export { createSocket, devtoolsBus, socket, socketSupported } from './chunk-
|
|
8
|
-
import { magic, markSkipChildren, destroy, readAttr, walk, hadDirectives, getScope, collectDirectives, findScope, getEffectScopes, evaluateIn } from './chunk-
|
|
9
|
-
export { Scope, VoodooRuntimeError, VoodooSyntaxError, addCleanup, allowedGlobals, clearParseCache, destroy, evaluate, findScope, getScope, magic, magics, parse, refresh, rootScope, start, stringify, tokenize, walk } from './chunk-
|
|
6
|
+
import { devtoolsBus } from './chunk-4LR3IFPX.js';
|
|
7
|
+
export { createSocket, devtoolsBus, socket, socketSupported } from './chunk-4LR3IFPX.js';
|
|
8
|
+
import { magic, markSkipChildren, destroy, readAttr, walk, hadDirectives, getScope, collectDirectives, findScope, getEffectScopes, evaluateIn } from './chunk-PHMBDPWH.js';
|
|
9
|
+
export { Scope, VoodooRuntimeError, VoodooSyntaxError, addCleanup, allowedGlobals, clearParseCache, destroy, evaluate, findScope, getScope, magic, magics, parse, refresh, rootScope, start, stringify, tokenize, walk } from './chunk-PHMBDPWH.js';
|
|
10
10
|
import { reactive, warn, handleError, queuePostFlush, nextTick } from './chunk-NNU6WOOU.js';
|
|
11
11
|
export { EffectScope, computed, effect, effectScope, flushSync, isReactive, markRaw, nextTick, reactive, ref, shallowRef, stop, toRaw, unref, watch, watchEffect } from './chunk-NNU6WOOU.js';
|
|
12
12
|
import { warnAlias } from './chunk-A2UOVQBP.js';
|
|
@@ -128,6 +128,32 @@ function buildUrl(location) {
|
|
|
128
128
|
const base = settings.base === "/" ? "" : settings.base.replace(/\/$/, "");
|
|
129
129
|
return `${base}${suffix}` || "/";
|
|
130
130
|
}
|
|
131
|
+
var historyRefused = false;
|
|
132
|
+
var writingHash = false;
|
|
133
|
+
function writeUrl(state2, url2, replace) {
|
|
134
|
+
if (!historyRefused) {
|
|
135
|
+
try {
|
|
136
|
+
if (replace) window.history.replaceState(state2, "", url2);
|
|
137
|
+
else window.history.pushState(state2, "", url2);
|
|
138
|
+
return;
|
|
139
|
+
} catch (error) {
|
|
140
|
+
if (!(error instanceof Error) || error.name !== "SecurityError") throw error;
|
|
141
|
+
historyRefused = true;
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
if (settings.mode !== "hash") return;
|
|
145
|
+
const hash = url2.slice(url2.indexOf("#"));
|
|
146
|
+
if (window.location.hash === hash) return;
|
|
147
|
+
writingHash = true;
|
|
148
|
+
try {
|
|
149
|
+
if (replace) window.location.replace(url2);
|
|
150
|
+
else window.location.hash = hash;
|
|
151
|
+
} finally {
|
|
152
|
+
setTimeout(() => {
|
|
153
|
+
writingHash = false;
|
|
154
|
+
}, 0);
|
|
155
|
+
}
|
|
156
|
+
}
|
|
131
157
|
function compileRoute(pattern, record) {
|
|
132
158
|
const clean = pattern === "*" ? "*" : normalizePath(pattern);
|
|
133
159
|
const raw = clean === "*" ? ["*"] : clean.split("/").filter(Boolean);
|
|
@@ -314,8 +340,7 @@ async function navigate(target, options = {}) {
|
|
|
314
340
|
const key = uid("rota");
|
|
315
341
|
const historyState = { ...options.state ?? {}, [HISTORY_KEY]: key };
|
|
316
342
|
const url2 = buildUrl(destination);
|
|
317
|
-
|
|
318
|
-
else window.history.pushState(historyState, "", url2);
|
|
343
|
+
writeUrl(historyState, url2, options.replace === true);
|
|
319
344
|
currentKey = key;
|
|
320
345
|
applyLocation(destination);
|
|
321
346
|
if (options.scroll !== false) scheduleScroll(destination, from, null);
|
|
@@ -328,17 +353,14 @@ async function navigate(target, options = {}) {
|
|
|
328
353
|
return true;
|
|
329
354
|
}
|
|
330
355
|
async function onHistoryChange(event) {
|
|
356
|
+
if (writingHash) return;
|
|
331
357
|
const { path, query: query2, hash } = readLocation();
|
|
332
358
|
const destination = locationFor(path, query2, hash);
|
|
333
359
|
const from = snapshot();
|
|
334
360
|
if (destination.fullPath === from.fullPath) return;
|
|
335
361
|
const verdict = await runGuards(destination, from);
|
|
336
362
|
if (verdict === false) {
|
|
337
|
-
|
|
338
|
-
{ [HISTORY_KEY]: currentKey },
|
|
339
|
-
"",
|
|
340
|
-
buildUrl(from)
|
|
341
|
-
);
|
|
363
|
+
writeUrl({ [HISTORY_KEY]: currentKey }, buildUrl(from), true);
|
|
342
364
|
devtoolsBus.emit("navigation", {
|
|
343
365
|
from: from.fullPath,
|
|
344
366
|
to: destination.fullPath,
|
|
@@ -381,6 +403,8 @@ function stopRouter() {
|
|
|
381
403
|
window.removeEventListener("popstate", historyListener);
|
|
382
404
|
window.removeEventListener("hashchange", historyListener);
|
|
383
405
|
window.removeEventListener("beforeunload", saveScroll);
|
|
406
|
+
historyRefused = false;
|
|
407
|
+
writingHash = false;
|
|
384
408
|
}
|
|
385
409
|
async function enterInitialRoute() {
|
|
386
410
|
if (typeof window === "undefined") return;
|
|
@@ -401,7 +425,7 @@ async function enterInitialRoute() {
|
|
|
401
425
|
break;
|
|
402
426
|
}
|
|
403
427
|
currentKey = uid("rota");
|
|
404
|
-
|
|
428
|
+
writeUrl({ [HISTORY_KEY]: currentKey }, buildUrl(destination), true);
|
|
405
429
|
applyLocation(destination);
|
|
406
430
|
if (destination.hash) scheduleScroll(destination, from, null);
|
|
407
431
|
settings.afterEach?.(snapshot(), from);
|
|
@@ -2077,7 +2101,7 @@ function normalize(options, type) {
|
|
|
2077
2101
|
const labels = fromOptions ? options.labels.map((label) => String(label)) : [];
|
|
2078
2102
|
const series = [];
|
|
2079
2103
|
const raw = options.data;
|
|
2080
|
-
const singleName = options.name ?? "
|
|
2104
|
+
const singleName = options.name ?? "Value";
|
|
2081
2105
|
if (typeof raw === "number") {
|
|
2082
2106
|
series.push({ name: singleName, values: [raw], xs: null, color: palette2[0] });
|
|
2083
2107
|
} else if (Array.isArray(raw) && raw.length > 0) {
|
|
@@ -2807,7 +2831,7 @@ function draw(state2) {
|
|
|
2807
2831
|
const palette2 = options.colors && options.colors.length > 0 ? options.colors : CHART_COLORS;
|
|
2808
2832
|
const format = options.format ?? "number";
|
|
2809
2833
|
const width = Math.max(160, Math.round(el.clientWidth || options.width || 640));
|
|
2810
|
-
const height = Math.max(48, Math.round(options.height ?? defaultHeight(type)));
|
|
2834
|
+
const height = Math.max(48, Math.round(options.height ?? (el.clientHeight || defaultHeight(type))));
|
|
2811
2835
|
state2.lastWidth = width;
|
|
2812
2836
|
state2.viewWidth = width;
|
|
2813
2837
|
state2.viewHeight = height;
|
|
@@ -3174,7 +3198,7 @@ var CSS2 = `
|
|
|
3174
3198
|
@keyframes v-shimmer{0%{background-position:-180% 0}100%{background-position:180% 0}}
|
|
3175
3199
|
@keyframes v-indeterminate{0%{transform:translateX(-100%)}100%{transform:translateX(340%)}}
|
|
3176
3200
|
|
|
3177
|
-
/*
|
|
3201
|
+
/* ----------------------------------------------------------------- button */
|
|
3178
3202
|
.v-btn{appearance:none;-webkit-appearance:none;position:relative;display:inline-flex;
|
|
3179
3203
|
align-items:center;justify-content:center;gap:8px;vertical-align:middle;white-space:nowrap;
|
|
3180
3204
|
font-family:var(--v-font-sans);font-weight:600;line-height:1;text-decoration:none;
|
|
@@ -3218,7 +3242,7 @@ var CSS2 = `
|
|
|
3218
3242
|
.v-btn-spin{width:1em;height:1em;border-radius:50%;border:2px solid currentColor;
|
|
3219
3243
|
border-top-color:transparent;animation:v-spin .7s linear infinite;flex:none}
|
|
3220
3244
|
|
|
3221
|
-
/*
|
|
3245
|
+
/* ------------------------------------------------------------ icon button */
|
|
3222
3246
|
.v-icon-btn{appearance:none;-webkit-appearance:none;display:inline-grid;place-items:center;
|
|
3223
3247
|
border:1px solid transparent;border-radius:var(--v-radius-sm);cursor:pointer;
|
|
3224
3248
|
font-family:var(--v-font-sans);
|
|
@@ -3263,7 +3287,7 @@ var CSS2 = `
|
|
|
3263
3287
|
.v-card-foot:empty{display:none}
|
|
3264
3288
|
.v-card[data-padded="false"] .v-card-body{padding:0}
|
|
3265
3289
|
|
|
3266
|
-
/*
|
|
3290
|
+
/* ------------------------------------------------------------------- form */
|
|
3267
3291
|
.v-field{display:flex;flex-direction:column;gap:6px;font-family:var(--v-font-sans);min-width:0}
|
|
3268
3292
|
.v-label{display:inline-flex;align-items:center;gap:4px;font-size:13px;font-weight:600;
|
|
3269
3293
|
line-height:1.3;color:var(--v-text)}
|
|
@@ -3342,7 +3366,7 @@ var CSS2 = `
|
|
|
3342
3366
|
.v-select-opt.is-selected .v-select-check{opacity:1}
|
|
3343
3367
|
.v-select-empty{padding:14px 10px;text-align:center;font-size:13.5px;color:var(--v-text-muted)}
|
|
3344
3368
|
|
|
3345
|
-
/*
|
|
3369
|
+
/* --------------------------------------------- checkbox, radio and switch */
|
|
3346
3370
|
.v-check{display:inline-flex;align-items:flex-start;gap:9px;cursor:pointer;
|
|
3347
3371
|
font-family:var(--v-font-sans);font-size:14px;line-height:1.45;color:var(--v-text)}
|
|
3348
3372
|
.v-check[data-disabled="true"]{cursor:not-allowed;opacity:.6}
|
|
@@ -3379,7 +3403,7 @@ var CSS2 = `
|
|
|
3379
3403
|
.v-check[data-size="sm"] .v-switch-thumb{width:16px;height:16px}
|
|
3380
3404
|
.v-check[data-size="sm"] .v-check-native:checked+.v-switch-track .v-switch-thumb{transform:translateX(14px)}
|
|
3381
3405
|
|
|
3382
|
-
/*
|
|
3406
|
+
/* ------------------------------------------------------ badge, tag, alert */
|
|
3383
3407
|
.v-badge{display:inline-flex;align-items:center;gap:5px;font-family:var(--v-font-sans);
|
|
3384
3408
|
font-weight:600;line-height:1;border-radius:var(--v-radius-full);border:1px solid transparent;
|
|
3385
3409
|
white-space:nowrap;vertical-align:middle}
|
|
@@ -3456,7 +3480,7 @@ var CSS2 = `
|
|
|
3456
3480
|
.v-avatar-status[data-status="busy"]{background:var(--v-danger)}
|
|
3457
3481
|
.v-avatar-status[data-status="away"]{background:var(--v-warning)}
|
|
3458
3482
|
|
|
3459
|
-
/*
|
|
3483
|
+
/* --------------------------------------------------- spinner and skeleton */
|
|
3460
3484
|
.v-spinner{display:inline-block;border-radius:50%;border-style:solid;border-color:var(--v-border);
|
|
3461
3485
|
border-top-color:var(--v-primary);animation:v-spin .7s linear infinite;vertical-align:middle}
|
|
3462
3486
|
.v-spinner[data-tone="accent"]{border-top-color:var(--v-accent)}
|
|
@@ -3473,7 +3497,7 @@ var CSS2 = `
|
|
|
3473
3497
|
.v-skeleton[data-circle="true"]{border-radius:var(--v-radius-full)}
|
|
3474
3498
|
.v-skeleton-stack{display:flex;flex-direction:column;gap:8px}
|
|
3475
3499
|
|
|
3476
|
-
/*
|
|
3500
|
+
/* --------------------------------------------------------------- progress */
|
|
3477
3501
|
.v-progress{font-family:var(--v-font-sans);display:flex;flex-direction:column;gap:6px}
|
|
3478
3502
|
.v-progress-head{display:flex;justify-content:space-between;gap:12px;font-size:13px;color:var(--v-text-muted)}
|
|
3479
3503
|
.v-progress-value{font-weight:650;color:var(--v-text)}
|
|
@@ -3490,7 +3514,7 @@ var CSS2 = `
|
|
|
3490
3514
|
.v-progress[data-tone="danger"] .v-progress-bar{background:var(--v-danger)}
|
|
3491
3515
|
.v-progress[data-indeterminate="true"] .v-progress-bar{width:30% !important;animation:v-indeterminate 1.3s var(--v-ease) infinite}
|
|
3492
3516
|
|
|
3493
|
-
/*
|
|
3517
|
+
/* ---------------------------------------------------------------- divider */
|
|
3494
3518
|
.v-divider{display:flex;align-items:center;gap:12px;color:var(--v-text-soft);
|
|
3495
3519
|
font-family:var(--v-font-sans);font-size:12.5px;font-weight:600;margin:16px 0}
|
|
3496
3520
|
.v-divider::before,.v-divider::after{content:"";flex:1;height:1px;background:var(--v-border)}
|
|
@@ -3498,7 +3522,7 @@ var CSS2 = `
|
|
|
3498
3522
|
.v-divider[data-vertical="true"]{flex-direction:column;margin:0 16px;align-self:stretch;height:auto}
|
|
3499
3523
|
.v-divider[data-vertical="true"]::before,.v-divider[data-vertical="true"]::after{width:1px;height:auto;flex:1}
|
|
3500
3524
|
|
|
3501
|
-
/*
|
|
3525
|
+
/* ------------------------------------------------------------------ table */
|
|
3502
3526
|
.v-table-wrap{width:100%;overflow-x:auto;background:var(--v-surface);border:1px solid var(--v-border);
|
|
3503
3527
|
border-radius:var(--v-radius);font-family:var(--v-font-sans)}
|
|
3504
3528
|
.v-table{width:100%;border-collapse:collapse;font-size:14px;color:var(--v-text)}
|
|
@@ -3519,7 +3543,7 @@ var CSS2 = `
|
|
|
3519
3543
|
.v-th[aria-sort="ascending"] .v-th-arrow,.v-th[aria-sort="descending"] .v-th-arrow{opacity:1;color:var(--v-primary)}
|
|
3520
3544
|
.v-table-empty{text-align:center;color:var(--v-text-muted);padding:34px 14px;font-size:14px}
|
|
3521
3545
|
|
|
3522
|
-
/*
|
|
3546
|
+
/* ------------------------------------------------------------- pagination */
|
|
3523
3547
|
.v-pagination{display:flex;align-items:center;gap:6px;flex-wrap:wrap;font-family:var(--v-font-sans)}
|
|
3524
3548
|
.v-page{appearance:none;min-width:34px;height:34px;padding:0 9px;display:inline-grid;place-items:center;
|
|
3525
3549
|
background:transparent;border:1px solid transparent;border-radius:var(--v-radius-sm);
|
|
@@ -3531,7 +3555,7 @@ var CSS2 = `
|
|
|
3531
3555
|
.v-page[aria-current="page"]{background:var(--v-primary);border-color:var(--v-primary);color:var(--v-primary-contrast)}
|
|
3532
3556
|
.v-page-gap{min-width:24px;text-align:center;color:var(--v-text-soft);user-select:none}
|
|
3533
3557
|
|
|
3534
|
-
/*
|
|
3558
|
+
/* ------------------------------------------------------------- breadcrumb */
|
|
3535
3559
|
.v-breadcrumb{font-family:var(--v-font-sans);font-size:13.5px}
|
|
3536
3560
|
.v-breadcrumb-list{list-style:none;display:flex;flex-wrap:wrap;align-items:center;gap:6px;margin:0;padding:0}
|
|
3537
3561
|
.v-breadcrumb-item{display:inline-flex;align-items:center;gap:6px;color:var(--v-text-muted)}
|
|
@@ -3541,7 +3565,7 @@ var CSS2 = `
|
|
|
3541
3565
|
.v-breadcrumb-item[aria-current="page"]{color:var(--v-text);font-weight:600}
|
|
3542
3566
|
.v-breadcrumb-sep{color:var(--v-text-soft);user-select:none}
|
|
3543
3567
|
|
|
3544
|
-
/*
|
|
3568
|
+
/* ------------------------------------------------------------------- stat */
|
|
3545
3569
|
.v-stat{display:flex;gap:14px;align-items:flex-start;padding:16px 18px;background:var(--v-surface);
|
|
3546
3570
|
border:1px solid var(--v-border);border-radius:var(--v-radius);font-family:var(--v-font-sans)}
|
|
3547
3571
|
.v-stat-icon{flex:none;width:40px;height:40px;display:grid;place-items:center;font-size:19px;
|
|
@@ -3559,7 +3583,7 @@ var CSS2 = `
|
|
|
3559
3583
|
.v-stat-delta[data-dir="flat"]{background:var(--v-surface-3);color:var(--v-text-muted)}
|
|
3560
3584
|
.v-stat-hint{font-size:12.5px;color:var(--v-text-muted)}
|
|
3561
3585
|
|
|
3562
|
-
/*
|
|
3586
|
+
/* ------------------------------------------------------------ empty state */
|
|
3563
3587
|
.v-empty{display:flex;flex-direction:column;align-items:center;text-align:center;gap:10px;
|
|
3564
3588
|
padding:44px 22px;font-family:var(--v-font-sans);color:var(--v-text)}
|
|
3565
3589
|
.v-empty-icon{width:58px;height:58px;display:grid;place-items:center;font-size:27px;
|
|
@@ -3569,7 +3593,7 @@ var CSS2 = `
|
|
|
3569
3593
|
.v-empty-actions{margin-top:6px;display:flex;gap:10px;flex-wrap:wrap;justify-content:center}
|
|
3570
3594
|
.v-empty-actions:empty{display:none}
|
|
3571
3595
|
|
|
3572
|
-
/*
|
|
3596
|
+
/* --------------------------------------------------------------- timeline */
|
|
3573
3597
|
.v-timeline{list-style:none;margin:0;padding:0;font-family:var(--v-font-sans);
|
|
3574
3598
|
display:flex;flex-direction:column}
|
|
3575
3599
|
.v-timeline-item{position:relative;display:flex;gap:14px;padding-bottom:20px}
|
|
@@ -3589,7 +3613,7 @@ var CSS2 = `
|
|
|
3589
3613
|
.v-timeline-desc{margin:3px 0 0;font-size:13.5px;line-height:1.55;color:var(--v-text-muted)}
|
|
3590
3614
|
.v-timeline-time{display:block;margin-top:3px;font-size:12px;color:var(--v-text-soft)}
|
|
3591
3615
|
|
|
3592
|
-
/*
|
|
3616
|
+
/* ------------------------------------------------------------------ steps */
|
|
3593
3617
|
.v-steps{display:flex;gap:0;font-family:var(--v-font-sans);list-style:none;margin:0;padding:0}
|
|
3594
3618
|
.v-steps[data-vertical="true"]{flex-direction:column;gap:4px}
|
|
3595
3619
|
.v-step{flex:1;display:flex;align-items:flex-start;gap:10px;min-width:0;position:relative;padding-right:12px}
|
|
@@ -3608,7 +3632,7 @@ var CSS2 = `
|
|
|
3608
3632
|
.v-steps[data-vertical="true"] .v-step-line{left:13px;right:auto;top:30px;bottom:2px;width:2px;height:auto}
|
|
3609
3633
|
.v-step:last-child .v-step-line{display:none}
|
|
3610
3634
|
|
|
3611
|
-
/*
|
|
3635
|
+
/* ----------------------------------------------------------------- rating */
|
|
3612
3636
|
.v-rating{display:inline-flex;align-items:center;gap:6px;font-family:var(--v-font-sans)}
|
|
3613
3637
|
.v-rating-stars{display:inline-flex;gap:2px}
|
|
3614
3638
|
.v-star{appearance:none;background:none;border:0;padding:2px;cursor:pointer;line-height:0;
|
|
@@ -3635,7 +3659,7 @@ var CSS2 = `
|
|
|
3635
3659
|
.v-tip[data-placement="right"]{left:calc(100% + 8px);top:50%;translate:0 -50%}
|
|
3636
3660
|
.v-tipwrap:hover .v-tip,.v-tipwrap:focus-within .v-tip{opacity:1;transform:none}
|
|
3637
3661
|
|
|
3638
|
-
/*
|
|
3662
|
+
/* ------------------------------------------------------------------- code */
|
|
3639
3663
|
.v-code{position:relative;background:var(--v-surface-inset);border:1px solid var(--v-border);
|
|
3640
3664
|
border-radius:var(--v-radius);overflow:hidden;font-family:var(--v-font-mono)}
|
|
3641
3665
|
.v-code-head{display:flex;align-items:center;justify-content:space-between;gap:10px;
|
|
@@ -4636,7 +4660,7 @@ register("v-table", {
|
|
|
4636
4660
|
props: {
|
|
4637
4661
|
columns: { type: "any", default: "" },
|
|
4638
4662
|
rows: { type: "any", default: "" },
|
|
4639
|
-
empty: { type: "string", default: "
|
|
4663
|
+
empty: { type: "string", default: "No records found" },
|
|
4640
4664
|
sortable: { type: "any", default: true },
|
|
4641
4665
|
dense: BOOL,
|
|
4642
4666
|
striped: BOOL,
|
|
@@ -4746,9 +4770,9 @@ register("v-pagination", {
|
|
|
4746
4770
|
total: { type: "number", default: 0 },
|
|
4747
4771
|
perPage: { type: "number", default: 10 },
|
|
4748
4772
|
siblings: { type: "number", default: 1 },
|
|
4749
|
-
previousLabel: { type: "string", default: "
|
|
4750
|
-
nextLabel: { type: "string", default: "
|
|
4751
|
-
ariaLabel: { type: "string", default: "
|
|
4773
|
+
previousLabel: { type: "string", default: "Previous" },
|
|
4774
|
+
nextLabel: { type: "string", default: "Next" },
|
|
4775
|
+
ariaLabel: { type: "string", default: "Pagination" }
|
|
4752
4776
|
},
|
|
4753
4777
|
computed: {
|
|
4754
4778
|
lastPage() {
|
|
@@ -4762,7 +4786,7 @@ register("v-pagination", {
|
|
|
4762
4786
|
const value = Number(this.page) || 1;
|
|
4763
4787
|
return Math.min(Math.max(1, Math.round(value)), this.lastPage);
|
|
4764
4788
|
},
|
|
4765
|
-
/**
|
|
4789
|
+
/** Visible page numbers, with `0` marking the ellipsis. */
|
|
4766
4790
|
items() {
|
|
4767
4791
|
const last = this.lastPage;
|
|
4768
4792
|
const current = this.currentPage;
|
|
@@ -4807,7 +4831,7 @@ register("v-pagination", {
|
|
|
4807
4831
|
<template v-for="(item, index) in items" :key="index">
|
|
4808
4832
|
<span class="v-page-gap" v-if="item === 0" aria-hidden="true">...</span>
|
|
4809
4833
|
<button type="button" class="v-page" v-if="item !== 0" :aria-current="isCurrent(item)"
|
|
4810
|
-
:aria-label="'
|
|
4834
|
+
:aria-label="'Page ' + item" v-click="go(item)" v-text="item"></button>
|
|
4811
4835
|
</template>
|
|
4812
4836
|
<button type="button" class="v-page" :disabled="currentPage >= lastPage"
|
|
4813
4837
|
:aria-label="nextLabel" v-click="go(currentPage + 1)" v-html="svgIcon('chevron-right')"></button>
|
|
@@ -4839,7 +4863,7 @@ register("v-breadcrumb", {
|
|
|
4839
4863
|
props: {
|
|
4840
4864
|
items: { type: "any", default: "" },
|
|
4841
4865
|
separator: { type: "string", default: "/" },
|
|
4842
|
-
ariaLabel: { type: "string", default: "
|
|
4866
|
+
ariaLabel: { type: "string", default: "Breadcrumb" }
|
|
4843
4867
|
},
|
|
4844
4868
|
computed: {
|
|
4845
4869
|
crumbs() {
|
|
@@ -4872,7 +4896,7 @@ register("v-stat", {
|
|
|
4872
4896
|
hint: TEXT,
|
|
4873
4897
|
icon: TEXT,
|
|
4874
4898
|
suffix: { type: "string", default: "%" },
|
|
4875
|
-
/**
|
|
4899
|
+
/** When `true`, a negative change counts as positive. */
|
|
4876
4900
|
inverted: BOOL
|
|
4877
4901
|
},
|
|
4878
4902
|
computed: {
|
|
@@ -4925,7 +4949,7 @@ register("v-stat", {
|
|
|
4925
4949
|
register("v-empty-state", {
|
|
4926
4950
|
props: {
|
|
4927
4951
|
icon: { type: "string", default: "inbox" },
|
|
4928
|
-
title: { type: "string", default: "
|
|
4952
|
+
title: { type: "string", default: "Nothing here yet" },
|
|
4929
4953
|
description: TEXT
|
|
4930
4954
|
},
|
|
4931
4955
|
template: `
|
|
@@ -4996,7 +5020,7 @@ register("v-steps", {
|
|
|
4996
5020
|
steps: { type: "any", default: "" },
|
|
4997
5021
|
current: { type: "number", default: 0 },
|
|
4998
5022
|
vertical: BOOL,
|
|
4999
|
-
ariaLabel: { type: "string", default: "
|
|
5023
|
+
ariaLabel: { type: "string", default: "Steps" }
|
|
5000
5024
|
},
|
|
5001
5025
|
computed: {
|
|
5002
5026
|
...flags("vertical"),
|
|
@@ -5040,7 +5064,7 @@ register("v-rating", {
|
|
|
5040
5064
|
value: { type: "number", default: 0 },
|
|
5041
5065
|
max: { type: "number", default: 5 },
|
|
5042
5066
|
size: { type: "string", default: "md" },
|
|
5043
|
-
label: { type: "string", default: "
|
|
5067
|
+
label: { type: "string", default: "Rating" },
|
|
5044
5068
|
readonly: BOOL,
|
|
5045
5069
|
disabled: BOOL,
|
|
5046
5070
|
showValue: BOOL,
|
|
@@ -5066,7 +5090,7 @@ register("v-rating", {
|
|
|
5066
5090
|
return this.hovered > 0 ? this.hovered : this.score;
|
|
5067
5091
|
},
|
|
5068
5092
|
valueText() {
|
|
5069
|
-
return `${this.score}
|
|
5093
|
+
return `${this.score} of ${this.total}`;
|
|
5070
5094
|
}
|
|
5071
5095
|
},
|
|
5072
5096
|
methods: {
|
|
@@ -5122,7 +5146,7 @@ register("v-rating", {
|
|
|
5122
5146
|
:tabindex="locked ? -1 : 0" :aria-readonly="locked" v-keydown="onKey" v-mouseleave="reset">
|
|
5123
5147
|
<span class="v-rating-stars">
|
|
5124
5148
|
<button type="button" class="v-star" v-for="index in total" :key="index"
|
|
5125
|
-
:data-on="isOn(index)" :disabled="locked" :aria-label="index + '
|
|
5149
|
+
:data-on="isOn(index)" :disabled="locked" :aria-label="index + ' of ' + total"
|
|
5126
5150
|
:tabindex="-1" v-click="pick(index)" v-mouseenter="preview(index)"
|
|
5127
5151
|
v-html="svgIcon('star')"></button>
|
|
5128
5152
|
</span>
|
|
@@ -5190,8 +5214,8 @@ register("v-code-block", {
|
|
|
5190
5214
|
code: TEXT,
|
|
5191
5215
|
language: TEXT,
|
|
5192
5216
|
filename: TEXT,
|
|
5193
|
-
copyLabel: { type: "string", default: "
|
|
5194
|
-
copiedLabel: { type: "string", default: "
|
|
5217
|
+
copyLabel: { type: "string", default: "Copy" },
|
|
5218
|
+
copiedLabel: { type: "string", default: "Copied" },
|
|
5195
5219
|
wrap: BOOL
|
|
5196
5220
|
},
|
|
5197
5221
|
state() {
|
|
@@ -6491,14 +6515,14 @@ function xray(force) {
|
|
|
6491
6515
|
}
|
|
6492
6516
|
|
|
6493
6517
|
// src/devtools/launcher.ts
|
|
6494
|
-
var
|
|
6495
|
-
var
|
|
6496
|
-
var
|
|
6518
|
+
var POSITION_KEY = "voodoo:devtools:widget-position";
|
|
6519
|
+
var HIDDEN_KEY = "voodoo:devtools:widget-hidden";
|
|
6520
|
+
var DRAG_THRESHOLD = 4;
|
|
6497
6521
|
var refs2 = null;
|
|
6498
|
-
var
|
|
6499
|
-
var
|
|
6500
|
-
var
|
|
6501
|
-
var
|
|
6522
|
+
var mounted = false;
|
|
6523
|
+
var counterTimer = 0;
|
|
6524
|
+
var pulseTimer = 0;
|
|
6525
|
+
var teardown = [];
|
|
6502
6526
|
var WIDGET_CSS = `
|
|
6503
6527
|
.v-devtools-widget{
|
|
6504
6528
|
all: initial;
|
|
@@ -6631,220 +6655,220 @@ var WIDGET_CSS = `
|
|
|
6631
6655
|
.v-devtools-btn:hover{transform:none}
|
|
6632
6656
|
}
|
|
6633
6657
|
`;
|
|
6634
|
-
var
|
|
6658
|
+
var MARK = `<svg class="v-devtools-mark" viewBox="0 0 24 24" fill="none" aria-hidden="true">
|
|
6635
6659
|
<path d="M4 4l8 16 8-16" stroke="#6D3BF5" stroke-width="2.4" stroke-linecap="round" stroke-linejoin="round"/>
|
|
6636
6660
|
<circle cx="12" cy="7.5" r="2" fill="#FF3D8B"/>
|
|
6637
6661
|
</svg>`;
|
|
6638
|
-
function
|
|
6662
|
+
function readPosition() {
|
|
6639
6663
|
try {
|
|
6640
|
-
const
|
|
6641
|
-
if (!
|
|
6642
|
-
const
|
|
6643
|
-
if (typeof
|
|
6644
|
-
return
|
|
6664
|
+
const raw = localStorage.getItem(POSITION_KEY);
|
|
6665
|
+
if (!raw) return null;
|
|
6666
|
+
const value = JSON.parse(raw);
|
|
6667
|
+
if (typeof value?.x !== "number" || typeof value?.y !== "number") return null;
|
|
6668
|
+
return value;
|
|
6645
6669
|
} catch {
|
|
6646
6670
|
return null;
|
|
6647
6671
|
}
|
|
6648
6672
|
}
|
|
6649
|
-
function
|
|
6673
|
+
function writePosition(pos) {
|
|
6650
6674
|
try {
|
|
6651
|
-
localStorage.setItem(
|
|
6675
|
+
localStorage.setItem(POSITION_KEY, JSON.stringify(pos));
|
|
6652
6676
|
} catch {
|
|
6653
6677
|
}
|
|
6654
6678
|
}
|
|
6655
|
-
function
|
|
6656
|
-
const
|
|
6657
|
-
const
|
|
6658
|
-
const x = Math.min(Math.max(8, pos.x), Math.max(8, window.innerWidth -
|
|
6659
|
-
const y = Math.min(Math.max(8, pos.y), Math.max(8, window.innerHeight -
|
|
6660
|
-
|
|
6661
|
-
|
|
6662
|
-
|
|
6663
|
-
|
|
6664
|
-
}
|
|
6665
|
-
function
|
|
6666
|
-
const
|
|
6667
|
-
|
|
6668
|
-
|
|
6669
|
-
const
|
|
6670
|
-
|
|
6671
|
-
|
|
6672
|
-
|
|
6673
|
-
|
|
6674
|
-
|
|
6675
|
-
|
|
6676
|
-
const
|
|
6677
|
-
|
|
6678
|
-
|
|
6679
|
-
const
|
|
6680
|
-
|
|
6681
|
-
|
|
6682
|
-
const
|
|
6683
|
-
|
|
6684
|
-
|
|
6685
|
-
|
|
6686
|
-
const
|
|
6687
|
-
|
|
6688
|
-
|
|
6689
|
-
|
|
6690
|
-
|
|
6691
|
-
|
|
6692
|
-
|
|
6693
|
-
document.body.appendChild(
|
|
6694
|
-
const
|
|
6695
|
-
if (
|
|
6696
|
-
|
|
6679
|
+
function applyPosition(root, pos) {
|
|
6680
|
+
const width = root.offsetWidth || 120;
|
|
6681
|
+
const height = root.offsetHeight || 38;
|
|
6682
|
+
const x = Math.min(Math.max(8, pos.x), Math.max(8, window.innerWidth - width - 8));
|
|
6683
|
+
const y = Math.min(Math.max(8, pos.y), Math.max(8, window.innerHeight - height - 8));
|
|
6684
|
+
root.style.left = `${x}px`;
|
|
6685
|
+
root.style.top = `${y}px`;
|
|
6686
|
+
root.style.right = "auto";
|
|
6687
|
+
root.style.bottom = "auto";
|
|
6688
|
+
}
|
|
6689
|
+
function build() {
|
|
6690
|
+
const root = document.createElement("div");
|
|
6691
|
+
root.className = "v-devtools-widget";
|
|
6692
|
+
root.setAttribute("data-voodoo-devtools", "widget");
|
|
6693
|
+
const button = document.createElement("button");
|
|
6694
|
+
button.type = "button";
|
|
6695
|
+
button.className = "v-devtools-btn";
|
|
6696
|
+
button.setAttribute("aria-label", "Open Voodoo devtools (Ctrl+Shift+X)");
|
|
6697
|
+
button.setAttribute("aria-pressed", "false");
|
|
6698
|
+
button.title = "Voodoo devtools \u2014 click to inspect, drag to move (Ctrl+Shift+X)";
|
|
6699
|
+
button.innerHTML = MARK;
|
|
6700
|
+
const label = document.createElement("span");
|
|
6701
|
+
label.className = "v-devtools-label";
|
|
6702
|
+
label.textContent = "Voodoo";
|
|
6703
|
+
const counter = document.createElement("span");
|
|
6704
|
+
counter.className = "v-devtools-count";
|
|
6705
|
+
counter.textContent = "0";
|
|
6706
|
+
const pulse = document.createElement("span");
|
|
6707
|
+
pulse.className = "v-devtools-pulse";
|
|
6708
|
+
pulse.setAttribute("data-on", "false");
|
|
6709
|
+
button.append(label, counter, pulse);
|
|
6710
|
+
const close = document.createElement("button");
|
|
6711
|
+
close.type = "button";
|
|
6712
|
+
close.className = "v-devtools-close";
|
|
6713
|
+
close.setAttribute("aria-label", "Hide the devtools widget in this tab");
|
|
6714
|
+
close.title = "Hide in this tab";
|
|
6715
|
+
close.textContent = "\xD7";
|
|
6716
|
+
root.append(button, close);
|
|
6717
|
+
document.body.appendChild(root);
|
|
6718
|
+
const saved = readPosition();
|
|
6719
|
+
if (saved) {
|
|
6720
|
+
applyPosition(root, saved);
|
|
6697
6721
|
} else {
|
|
6698
|
-
|
|
6699
|
-
|
|
6700
|
-
}
|
|
6701
|
-
return {
|
|
6702
|
-
}
|
|
6703
|
-
function
|
|
6704
|
-
let
|
|
6705
|
-
let
|
|
6706
|
-
let
|
|
6707
|
-
let
|
|
6708
|
-
let
|
|
6709
|
-
let
|
|
6710
|
-
const
|
|
6711
|
-
if (
|
|
6712
|
-
const
|
|
6713
|
-
|
|
6714
|
-
|
|
6715
|
-
|
|
6716
|
-
|
|
6717
|
-
|
|
6718
|
-
|
|
6719
|
-
refs3.
|
|
6722
|
+
root.style.right = "16px";
|
|
6723
|
+
root.style.bottom = "16px";
|
|
6724
|
+
}
|
|
6725
|
+
return { root, button, pulse, counter, close };
|
|
6726
|
+
}
|
|
6727
|
+
function enableDrag(refs3, onClick) {
|
|
6728
|
+
let dragging = false;
|
|
6729
|
+
let moved = false;
|
|
6730
|
+
let offsetX = 0;
|
|
6731
|
+
let offsetY = 0;
|
|
6732
|
+
let startX = 0;
|
|
6733
|
+
let startY = 0;
|
|
6734
|
+
const onPointerDown = (event) => {
|
|
6735
|
+
if (event.button !== 0) return;
|
|
6736
|
+
const box = refs3.root.getBoundingClientRect();
|
|
6737
|
+
dragging = true;
|
|
6738
|
+
moved = false;
|
|
6739
|
+
startX = event.clientX;
|
|
6740
|
+
startY = event.clientY;
|
|
6741
|
+
offsetX = event.clientX - box.left;
|
|
6742
|
+
offsetY = event.clientY - box.top;
|
|
6743
|
+
refs3.button.setPointerCapture?.(event.pointerId);
|
|
6720
6744
|
};
|
|
6721
|
-
const
|
|
6722
|
-
if (!
|
|
6723
|
-
const
|
|
6724
|
-
if (!
|
|
6725
|
-
|
|
6726
|
-
|
|
6727
|
-
|
|
6745
|
+
const onPointerMove2 = (event) => {
|
|
6746
|
+
if (!dragging) return;
|
|
6747
|
+
const distance = Math.hypot(event.clientX - startX, event.clientY - startY);
|
|
6748
|
+
if (!moved && distance < DRAG_THRESHOLD) return;
|
|
6749
|
+
moved = true;
|
|
6750
|
+
event.preventDefault();
|
|
6751
|
+
applyPosition(refs3.root, { x: event.clientX - offsetX, y: event.clientY - offsetY });
|
|
6728
6752
|
};
|
|
6729
|
-
const
|
|
6730
|
-
if (!
|
|
6731
|
-
|
|
6732
|
-
refs3.
|
|
6733
|
-
if (!
|
|
6734
|
-
|
|
6753
|
+
const onPointerUp = (event) => {
|
|
6754
|
+
if (!dragging) return;
|
|
6755
|
+
dragging = false;
|
|
6756
|
+
refs3.button.releasePointerCapture?.(event.pointerId);
|
|
6757
|
+
if (!moved) {
|
|
6758
|
+
onClick();
|
|
6735
6759
|
return;
|
|
6736
6760
|
}
|
|
6737
|
-
const
|
|
6738
|
-
|
|
6761
|
+
const box = refs3.root.getBoundingClientRect();
|
|
6762
|
+
writePosition({ x: box.left, y: box.top });
|
|
6739
6763
|
};
|
|
6740
|
-
const
|
|
6741
|
-
if (
|
|
6742
|
-
|
|
6743
|
-
|
|
6764
|
+
const onKeyDown = (event) => {
|
|
6765
|
+
if (event.key !== "Enter" && event.key !== " ") return;
|
|
6766
|
+
event.preventDefault();
|
|
6767
|
+
onClick();
|
|
6744
6768
|
};
|
|
6745
|
-
const
|
|
6746
|
-
const
|
|
6747
|
-
if (refs3.
|
|
6769
|
+
const onResize = () => {
|
|
6770
|
+
const box = refs3.root.getBoundingClientRect();
|
|
6771
|
+
if (refs3.root.style.left) applyPosition(refs3.root, { x: box.left, y: box.top });
|
|
6748
6772
|
};
|
|
6749
|
-
refs3.
|
|
6750
|
-
refs3.
|
|
6751
|
-
refs3.
|
|
6752
|
-
refs3.
|
|
6753
|
-
refs3.
|
|
6754
|
-
window.addEventListener("resize",
|
|
6773
|
+
refs3.button.addEventListener("pointerdown", onPointerDown);
|
|
6774
|
+
refs3.button.addEventListener("pointermove", onPointerMove2);
|
|
6775
|
+
refs3.button.addEventListener("pointerup", onPointerUp);
|
|
6776
|
+
refs3.button.addEventListener("pointercancel", onPointerUp);
|
|
6777
|
+
refs3.button.addEventListener("keydown", onKeyDown);
|
|
6778
|
+
window.addEventListener("resize", onResize);
|
|
6755
6779
|
return () => {
|
|
6756
|
-
refs3.
|
|
6757
|
-
refs3.
|
|
6758
|
-
refs3.
|
|
6759
|
-
refs3.
|
|
6760
|
-
refs3.
|
|
6761
|
-
window.removeEventListener("resize",
|
|
6780
|
+
refs3.button.removeEventListener("pointerdown", onPointerDown);
|
|
6781
|
+
refs3.button.removeEventListener("pointermove", onPointerMove2);
|
|
6782
|
+
refs3.button.removeEventListener("pointerup", onPointerUp);
|
|
6783
|
+
refs3.button.removeEventListener("pointercancel", onPointerUp);
|
|
6784
|
+
refs3.button.removeEventListener("keydown", onKeyDown);
|
|
6785
|
+
window.removeEventListener("resize", onResize);
|
|
6762
6786
|
};
|
|
6763
6787
|
}
|
|
6764
|
-
function
|
|
6788
|
+
function blink() {
|
|
6765
6789
|
if (!refs2) return;
|
|
6766
|
-
refs2.
|
|
6767
|
-
window.clearTimeout(
|
|
6768
|
-
|
|
6769
|
-
refs2?.
|
|
6790
|
+
refs2.pulse.setAttribute("data-on", "true");
|
|
6791
|
+
window.clearTimeout(pulseTimer);
|
|
6792
|
+
pulseTimer = window.setTimeout(() => {
|
|
6793
|
+
refs2?.pulse.setAttribute("data-on", "false");
|
|
6770
6794
|
}, 320);
|
|
6771
6795
|
}
|
|
6772
|
-
function
|
|
6796
|
+
function updateCounter() {
|
|
6773
6797
|
if (!refs2) return;
|
|
6774
6798
|
const total = instances.size;
|
|
6775
|
-
const
|
|
6776
|
-
if (refs2.
|
|
6799
|
+
const text = total === 1 ? "1 component" : `${total} components`;
|
|
6800
|
+
if (refs2.counter.textContent !== text) refs2.counter.textContent = text;
|
|
6777
6801
|
}
|
|
6778
6802
|
function mountDevtoolsWidget() {
|
|
6779
|
-
if (
|
|
6803
|
+
if (mounted || typeof document === "undefined" || !document.body) return;
|
|
6780
6804
|
try {
|
|
6781
|
-
if (sessionStorage.getItem(
|
|
6805
|
+
if (sessionStorage.getItem(HIDDEN_KEY) === "1") return;
|
|
6782
6806
|
} catch {
|
|
6783
6807
|
}
|
|
6784
|
-
|
|
6808
|
+
mounted = true;
|
|
6785
6809
|
injectStyle("devtools-widget", WIDGET_CSS);
|
|
6786
|
-
refs2 =
|
|
6787
|
-
const
|
|
6788
|
-
const
|
|
6789
|
-
refs2?.
|
|
6790
|
-
refs2?.
|
|
6810
|
+
refs2 = build();
|
|
6811
|
+
const toggle = () => {
|
|
6812
|
+
const enabled2 = xray();
|
|
6813
|
+
refs2?.root.setAttribute("data-active", String(enabled2));
|
|
6814
|
+
refs2?.button.setAttribute("aria-pressed", String(enabled2));
|
|
6791
6815
|
};
|
|
6792
|
-
|
|
6793
|
-
const
|
|
6794
|
-
|
|
6816
|
+
teardown.push(enableDrag(refs2, toggle));
|
|
6817
|
+
const onClose = (event) => {
|
|
6818
|
+
event.stopPropagation();
|
|
6795
6819
|
try {
|
|
6796
|
-
sessionStorage.setItem(
|
|
6820
|
+
sessionStorage.setItem(HIDDEN_KEY, "1");
|
|
6797
6821
|
} catch {
|
|
6798
6822
|
}
|
|
6799
6823
|
unmountDevtoolsWidget();
|
|
6800
6824
|
console.info("[Voodoo] devtools widget hidden. Use V.devtoolsWidget(true) to bring back.");
|
|
6801
6825
|
};
|
|
6802
|
-
refs2.
|
|
6803
|
-
|
|
6804
|
-
const
|
|
6805
|
-
const
|
|
6806
|
-
refs2?.
|
|
6807
|
-
refs2?.
|
|
6826
|
+
refs2.close.addEventListener("click", onClose);
|
|
6827
|
+
teardown.push(() => refs2?.close.removeEventListener("click", onClose));
|
|
6828
|
+
const onGlobalKeyUp = () => {
|
|
6829
|
+
const enabled2 = isXrayEnabled();
|
|
6830
|
+
refs2?.root.setAttribute("data-active", String(enabled2));
|
|
6831
|
+
refs2?.button.setAttribute("aria-pressed", String(enabled2));
|
|
6808
6832
|
};
|
|
6809
|
-
document.addEventListener("keyup",
|
|
6810
|
-
|
|
6811
|
-
for (const
|
|
6812
|
-
|
|
6833
|
+
document.addEventListener("keyup", onGlobalKeyUp);
|
|
6834
|
+
teardown.push(() => document.removeEventListener("keyup", onGlobalKeyUp));
|
|
6835
|
+
for (const type of ["network", "event", "navigation", "update"]) {
|
|
6836
|
+
teardown.push(devtoolsBus.on(type, blink));
|
|
6813
6837
|
}
|
|
6814
|
-
|
|
6815
|
-
|
|
6838
|
+
updateCounter();
|
|
6839
|
+
counterTimer = window.setInterval(updateCounter, 1e3);
|
|
6816
6840
|
}
|
|
6817
6841
|
function unmountDevtoolsWidget() {
|
|
6818
|
-
if (!
|
|
6819
|
-
|
|
6820
|
-
for (const fn of
|
|
6842
|
+
if (!mounted) return;
|
|
6843
|
+
mounted = false;
|
|
6844
|
+
for (const fn of teardown.splice(0)) {
|
|
6821
6845
|
try {
|
|
6822
6846
|
fn();
|
|
6823
6847
|
} catch {
|
|
6824
6848
|
}
|
|
6825
6849
|
}
|
|
6826
|
-
window.clearInterval(
|
|
6827
|
-
window.clearTimeout(
|
|
6828
|
-
|
|
6829
|
-
|
|
6830
|
-
refs2?.
|
|
6850
|
+
window.clearInterval(counterTimer);
|
|
6851
|
+
window.clearTimeout(pulseTimer);
|
|
6852
|
+
counterTimer = 0;
|
|
6853
|
+
pulseTimer = 0;
|
|
6854
|
+
refs2?.root.remove();
|
|
6831
6855
|
refs2 = null;
|
|
6832
6856
|
}
|
|
6833
6857
|
function isDevtoolsWidgetMounted() {
|
|
6834
|
-
return
|
|
6858
|
+
return mounted;
|
|
6835
6859
|
}
|
|
6836
6860
|
function devtoolsWidget(force) {
|
|
6837
|
-
const
|
|
6838
|
-
if (
|
|
6861
|
+
const target = force ?? !mounted;
|
|
6862
|
+
if (target) {
|
|
6839
6863
|
try {
|
|
6840
|
-
sessionStorage.removeItem(
|
|
6864
|
+
sessionStorage.removeItem(HIDDEN_KEY);
|
|
6841
6865
|
} catch {
|
|
6842
6866
|
}
|
|
6843
6867
|
mountDevtoolsWidget();
|
|
6844
6868
|
} else {
|
|
6845
6869
|
unmountDevtoolsWidget();
|
|
6846
6870
|
}
|
|
6847
|
-
return
|
|
6871
|
+
return mounted;
|
|
6848
6872
|
}
|
|
6849
6873
|
|
|
6850
6874
|
// src/index.ts
|