voodoojs 0.5.0 → 0.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{chunk-RJUNPXQF.js → chunk-4LR3IFPX.js} +2 -2
- package/dist/{chunk-ABRZI32G.js → chunk-CNHNFTPC.js} +72 -69
- package/dist/{chunk-34CGORMO.js → chunk-PHMBDPWH.js} +3 -3
- package/dist/essential.cjs +69 -66
- package/dist/essential.d.cts +1 -1
- package/dist/essential.d.ts +1 -1
- package/dist/essential.js +2 -2
- package/dist/gpu.cjs +18 -18
- package/dist/gpu.js +20 -20
- package/dist/index.cjs +272 -269
- package/dist/index.d.cts +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.js +199 -199
- package/dist/{query-BeYufh-f.d.ts → query-CC-_z7v0.d.ts} +5 -5
- package/dist/{query-Bja83lRJ.d.cts → query-sEJXe_cO.d.cts} +5 -5
- package/dist/socket.d.cts +4 -4
- package/dist/socket.d.ts +4 -4
- package/dist/socket.js +3 -3
- package/dist/voodoo.core.js +38 -35
- package/dist/voodoo.core.min.js +15 -15
- package/dist/voodoo.full.js +267 -264
- package/dist/voodoo.full.min.js +74 -74
- package/dist/voodoo.js +70 -67
- package/dist/voodoo.min.js +22 -22
- package/package.json +1 -1
package/dist/index.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';
|
|
@@ -2077,7 +2077,7 @@ function normalize(options, type) {
|
|
|
2077
2077
|
const labels = fromOptions ? options.labels.map((label) => String(label)) : [];
|
|
2078
2078
|
const series = [];
|
|
2079
2079
|
const raw = options.data;
|
|
2080
|
-
const singleName = options.name ?? "
|
|
2080
|
+
const singleName = options.name ?? "Value";
|
|
2081
2081
|
if (typeof raw === "number") {
|
|
2082
2082
|
series.push({ name: singleName, values: [raw], xs: null, color: palette2[0] });
|
|
2083
2083
|
} else if (Array.isArray(raw) && raw.length > 0) {
|
|
@@ -2807,7 +2807,7 @@ function draw(state2) {
|
|
|
2807
2807
|
const palette2 = options.colors && options.colors.length > 0 ? options.colors : CHART_COLORS;
|
|
2808
2808
|
const format = options.format ?? "number";
|
|
2809
2809
|
const width = Math.max(160, Math.round(el.clientWidth || options.width || 640));
|
|
2810
|
-
const height = Math.max(48, Math.round(options.height ?? defaultHeight(type)));
|
|
2810
|
+
const height = Math.max(48, Math.round(options.height ?? (el.clientHeight || defaultHeight(type))));
|
|
2811
2811
|
state2.lastWidth = width;
|
|
2812
2812
|
state2.viewWidth = width;
|
|
2813
2813
|
state2.viewHeight = height;
|
|
@@ -3174,7 +3174,7 @@ var CSS2 = `
|
|
|
3174
3174
|
@keyframes v-shimmer{0%{background-position:-180% 0}100%{background-position:180% 0}}
|
|
3175
3175
|
@keyframes v-indeterminate{0%{transform:translateX(-100%)}100%{transform:translateX(340%)}}
|
|
3176
3176
|
|
|
3177
|
-
/*
|
|
3177
|
+
/* ----------------------------------------------------------------- button */
|
|
3178
3178
|
.v-btn{appearance:none;-webkit-appearance:none;position:relative;display:inline-flex;
|
|
3179
3179
|
align-items:center;justify-content:center;gap:8px;vertical-align:middle;white-space:nowrap;
|
|
3180
3180
|
font-family:var(--v-font-sans);font-weight:600;line-height:1;text-decoration:none;
|
|
@@ -3218,7 +3218,7 @@ var CSS2 = `
|
|
|
3218
3218
|
.v-btn-spin{width:1em;height:1em;border-radius:50%;border:2px solid currentColor;
|
|
3219
3219
|
border-top-color:transparent;animation:v-spin .7s linear infinite;flex:none}
|
|
3220
3220
|
|
|
3221
|
-
/*
|
|
3221
|
+
/* ------------------------------------------------------------ icon button */
|
|
3222
3222
|
.v-icon-btn{appearance:none;-webkit-appearance:none;display:inline-grid;place-items:center;
|
|
3223
3223
|
border:1px solid transparent;border-radius:var(--v-radius-sm);cursor:pointer;
|
|
3224
3224
|
font-family:var(--v-font-sans);
|
|
@@ -3263,7 +3263,7 @@ var CSS2 = `
|
|
|
3263
3263
|
.v-card-foot:empty{display:none}
|
|
3264
3264
|
.v-card[data-padded="false"] .v-card-body{padding:0}
|
|
3265
3265
|
|
|
3266
|
-
/*
|
|
3266
|
+
/* ------------------------------------------------------------------- form */
|
|
3267
3267
|
.v-field{display:flex;flex-direction:column;gap:6px;font-family:var(--v-font-sans);min-width:0}
|
|
3268
3268
|
.v-label{display:inline-flex;align-items:center;gap:4px;font-size:13px;font-weight:600;
|
|
3269
3269
|
line-height:1.3;color:var(--v-text)}
|
|
@@ -3342,7 +3342,7 @@ var CSS2 = `
|
|
|
3342
3342
|
.v-select-opt.is-selected .v-select-check{opacity:1}
|
|
3343
3343
|
.v-select-empty{padding:14px 10px;text-align:center;font-size:13.5px;color:var(--v-text-muted)}
|
|
3344
3344
|
|
|
3345
|
-
/*
|
|
3345
|
+
/* --------------------------------------------- checkbox, radio and switch */
|
|
3346
3346
|
.v-check{display:inline-flex;align-items:flex-start;gap:9px;cursor:pointer;
|
|
3347
3347
|
font-family:var(--v-font-sans);font-size:14px;line-height:1.45;color:var(--v-text)}
|
|
3348
3348
|
.v-check[data-disabled="true"]{cursor:not-allowed;opacity:.6}
|
|
@@ -3379,7 +3379,7 @@ var CSS2 = `
|
|
|
3379
3379
|
.v-check[data-size="sm"] .v-switch-thumb{width:16px;height:16px}
|
|
3380
3380
|
.v-check[data-size="sm"] .v-check-native:checked+.v-switch-track .v-switch-thumb{transform:translateX(14px)}
|
|
3381
3381
|
|
|
3382
|
-
/*
|
|
3382
|
+
/* ------------------------------------------------------ badge, tag, alert */
|
|
3383
3383
|
.v-badge{display:inline-flex;align-items:center;gap:5px;font-family:var(--v-font-sans);
|
|
3384
3384
|
font-weight:600;line-height:1;border-radius:var(--v-radius-full);border:1px solid transparent;
|
|
3385
3385
|
white-space:nowrap;vertical-align:middle}
|
|
@@ -3456,7 +3456,7 @@ var CSS2 = `
|
|
|
3456
3456
|
.v-avatar-status[data-status="busy"]{background:var(--v-danger)}
|
|
3457
3457
|
.v-avatar-status[data-status="away"]{background:var(--v-warning)}
|
|
3458
3458
|
|
|
3459
|
-
/*
|
|
3459
|
+
/* --------------------------------------------------- spinner and skeleton */
|
|
3460
3460
|
.v-spinner{display:inline-block;border-radius:50%;border-style:solid;border-color:var(--v-border);
|
|
3461
3461
|
border-top-color:var(--v-primary);animation:v-spin .7s linear infinite;vertical-align:middle}
|
|
3462
3462
|
.v-spinner[data-tone="accent"]{border-top-color:var(--v-accent)}
|
|
@@ -3473,7 +3473,7 @@ var CSS2 = `
|
|
|
3473
3473
|
.v-skeleton[data-circle="true"]{border-radius:var(--v-radius-full)}
|
|
3474
3474
|
.v-skeleton-stack{display:flex;flex-direction:column;gap:8px}
|
|
3475
3475
|
|
|
3476
|
-
/*
|
|
3476
|
+
/* --------------------------------------------------------------- progress */
|
|
3477
3477
|
.v-progress{font-family:var(--v-font-sans);display:flex;flex-direction:column;gap:6px}
|
|
3478
3478
|
.v-progress-head{display:flex;justify-content:space-between;gap:12px;font-size:13px;color:var(--v-text-muted)}
|
|
3479
3479
|
.v-progress-value{font-weight:650;color:var(--v-text)}
|
|
@@ -3490,7 +3490,7 @@ var CSS2 = `
|
|
|
3490
3490
|
.v-progress[data-tone="danger"] .v-progress-bar{background:var(--v-danger)}
|
|
3491
3491
|
.v-progress[data-indeterminate="true"] .v-progress-bar{width:30% !important;animation:v-indeterminate 1.3s var(--v-ease) infinite}
|
|
3492
3492
|
|
|
3493
|
-
/*
|
|
3493
|
+
/* ---------------------------------------------------------------- divider */
|
|
3494
3494
|
.v-divider{display:flex;align-items:center;gap:12px;color:var(--v-text-soft);
|
|
3495
3495
|
font-family:var(--v-font-sans);font-size:12.5px;font-weight:600;margin:16px 0}
|
|
3496
3496
|
.v-divider::before,.v-divider::after{content:"";flex:1;height:1px;background:var(--v-border)}
|
|
@@ -3498,7 +3498,7 @@ var CSS2 = `
|
|
|
3498
3498
|
.v-divider[data-vertical="true"]{flex-direction:column;margin:0 16px;align-self:stretch;height:auto}
|
|
3499
3499
|
.v-divider[data-vertical="true"]::before,.v-divider[data-vertical="true"]::after{width:1px;height:auto;flex:1}
|
|
3500
3500
|
|
|
3501
|
-
/*
|
|
3501
|
+
/* ------------------------------------------------------------------ table */
|
|
3502
3502
|
.v-table-wrap{width:100%;overflow-x:auto;background:var(--v-surface);border:1px solid var(--v-border);
|
|
3503
3503
|
border-radius:var(--v-radius);font-family:var(--v-font-sans)}
|
|
3504
3504
|
.v-table{width:100%;border-collapse:collapse;font-size:14px;color:var(--v-text)}
|
|
@@ -3519,7 +3519,7 @@ var CSS2 = `
|
|
|
3519
3519
|
.v-th[aria-sort="ascending"] .v-th-arrow,.v-th[aria-sort="descending"] .v-th-arrow{opacity:1;color:var(--v-primary)}
|
|
3520
3520
|
.v-table-empty{text-align:center;color:var(--v-text-muted);padding:34px 14px;font-size:14px}
|
|
3521
3521
|
|
|
3522
|
-
/*
|
|
3522
|
+
/* ------------------------------------------------------------- pagination */
|
|
3523
3523
|
.v-pagination{display:flex;align-items:center;gap:6px;flex-wrap:wrap;font-family:var(--v-font-sans)}
|
|
3524
3524
|
.v-page{appearance:none;min-width:34px;height:34px;padding:0 9px;display:inline-grid;place-items:center;
|
|
3525
3525
|
background:transparent;border:1px solid transparent;border-radius:var(--v-radius-sm);
|
|
@@ -3531,7 +3531,7 @@ var CSS2 = `
|
|
|
3531
3531
|
.v-page[aria-current="page"]{background:var(--v-primary);border-color:var(--v-primary);color:var(--v-primary-contrast)}
|
|
3532
3532
|
.v-page-gap{min-width:24px;text-align:center;color:var(--v-text-soft);user-select:none}
|
|
3533
3533
|
|
|
3534
|
-
/*
|
|
3534
|
+
/* ------------------------------------------------------------- breadcrumb */
|
|
3535
3535
|
.v-breadcrumb{font-family:var(--v-font-sans);font-size:13.5px}
|
|
3536
3536
|
.v-breadcrumb-list{list-style:none;display:flex;flex-wrap:wrap;align-items:center;gap:6px;margin:0;padding:0}
|
|
3537
3537
|
.v-breadcrumb-item{display:inline-flex;align-items:center;gap:6px;color:var(--v-text-muted)}
|
|
@@ -3541,7 +3541,7 @@ var CSS2 = `
|
|
|
3541
3541
|
.v-breadcrumb-item[aria-current="page"]{color:var(--v-text);font-weight:600}
|
|
3542
3542
|
.v-breadcrumb-sep{color:var(--v-text-soft);user-select:none}
|
|
3543
3543
|
|
|
3544
|
-
/*
|
|
3544
|
+
/* ------------------------------------------------------------------- stat */
|
|
3545
3545
|
.v-stat{display:flex;gap:14px;align-items:flex-start;padding:16px 18px;background:var(--v-surface);
|
|
3546
3546
|
border:1px solid var(--v-border);border-radius:var(--v-radius);font-family:var(--v-font-sans)}
|
|
3547
3547
|
.v-stat-icon{flex:none;width:40px;height:40px;display:grid;place-items:center;font-size:19px;
|
|
@@ -3559,7 +3559,7 @@ var CSS2 = `
|
|
|
3559
3559
|
.v-stat-delta[data-dir="flat"]{background:var(--v-surface-3);color:var(--v-text-muted)}
|
|
3560
3560
|
.v-stat-hint{font-size:12.5px;color:var(--v-text-muted)}
|
|
3561
3561
|
|
|
3562
|
-
/*
|
|
3562
|
+
/* ------------------------------------------------------------ empty state */
|
|
3563
3563
|
.v-empty{display:flex;flex-direction:column;align-items:center;text-align:center;gap:10px;
|
|
3564
3564
|
padding:44px 22px;font-family:var(--v-font-sans);color:var(--v-text)}
|
|
3565
3565
|
.v-empty-icon{width:58px;height:58px;display:grid;place-items:center;font-size:27px;
|
|
@@ -3569,7 +3569,7 @@ var CSS2 = `
|
|
|
3569
3569
|
.v-empty-actions{margin-top:6px;display:flex;gap:10px;flex-wrap:wrap;justify-content:center}
|
|
3570
3570
|
.v-empty-actions:empty{display:none}
|
|
3571
3571
|
|
|
3572
|
-
/*
|
|
3572
|
+
/* --------------------------------------------------------------- timeline */
|
|
3573
3573
|
.v-timeline{list-style:none;margin:0;padding:0;font-family:var(--v-font-sans);
|
|
3574
3574
|
display:flex;flex-direction:column}
|
|
3575
3575
|
.v-timeline-item{position:relative;display:flex;gap:14px;padding-bottom:20px}
|
|
@@ -3589,7 +3589,7 @@ var CSS2 = `
|
|
|
3589
3589
|
.v-timeline-desc{margin:3px 0 0;font-size:13.5px;line-height:1.55;color:var(--v-text-muted)}
|
|
3590
3590
|
.v-timeline-time{display:block;margin-top:3px;font-size:12px;color:var(--v-text-soft)}
|
|
3591
3591
|
|
|
3592
|
-
/*
|
|
3592
|
+
/* ------------------------------------------------------------------ steps */
|
|
3593
3593
|
.v-steps{display:flex;gap:0;font-family:var(--v-font-sans);list-style:none;margin:0;padding:0}
|
|
3594
3594
|
.v-steps[data-vertical="true"]{flex-direction:column;gap:4px}
|
|
3595
3595
|
.v-step{flex:1;display:flex;align-items:flex-start;gap:10px;min-width:0;position:relative;padding-right:12px}
|
|
@@ -3608,7 +3608,7 @@ var CSS2 = `
|
|
|
3608
3608
|
.v-steps[data-vertical="true"] .v-step-line{left:13px;right:auto;top:30px;bottom:2px;width:2px;height:auto}
|
|
3609
3609
|
.v-step:last-child .v-step-line{display:none}
|
|
3610
3610
|
|
|
3611
|
-
/*
|
|
3611
|
+
/* ----------------------------------------------------------------- rating */
|
|
3612
3612
|
.v-rating{display:inline-flex;align-items:center;gap:6px;font-family:var(--v-font-sans)}
|
|
3613
3613
|
.v-rating-stars{display:inline-flex;gap:2px}
|
|
3614
3614
|
.v-star{appearance:none;background:none;border:0;padding:2px;cursor:pointer;line-height:0;
|
|
@@ -3635,7 +3635,7 @@ var CSS2 = `
|
|
|
3635
3635
|
.v-tip[data-placement="right"]{left:calc(100% + 8px);top:50%;translate:0 -50%}
|
|
3636
3636
|
.v-tipwrap:hover .v-tip,.v-tipwrap:focus-within .v-tip{opacity:1;transform:none}
|
|
3637
3637
|
|
|
3638
|
-
/*
|
|
3638
|
+
/* ------------------------------------------------------------------- code */
|
|
3639
3639
|
.v-code{position:relative;background:var(--v-surface-inset);border:1px solid var(--v-border);
|
|
3640
3640
|
border-radius:var(--v-radius);overflow:hidden;font-family:var(--v-font-mono)}
|
|
3641
3641
|
.v-code-head{display:flex;align-items:center;justify-content:space-between;gap:10px;
|
|
@@ -4636,7 +4636,7 @@ register("v-table", {
|
|
|
4636
4636
|
props: {
|
|
4637
4637
|
columns: { type: "any", default: "" },
|
|
4638
4638
|
rows: { type: "any", default: "" },
|
|
4639
|
-
empty: { type: "string", default: "
|
|
4639
|
+
empty: { type: "string", default: "No records found" },
|
|
4640
4640
|
sortable: { type: "any", default: true },
|
|
4641
4641
|
dense: BOOL,
|
|
4642
4642
|
striped: BOOL,
|
|
@@ -4746,9 +4746,9 @@ register("v-pagination", {
|
|
|
4746
4746
|
total: { type: "number", default: 0 },
|
|
4747
4747
|
perPage: { type: "number", default: 10 },
|
|
4748
4748
|
siblings: { type: "number", default: 1 },
|
|
4749
|
-
previousLabel: { type: "string", default: "
|
|
4750
|
-
nextLabel: { type: "string", default: "
|
|
4751
|
-
ariaLabel: { type: "string", default: "
|
|
4749
|
+
previousLabel: { type: "string", default: "Previous" },
|
|
4750
|
+
nextLabel: { type: "string", default: "Next" },
|
|
4751
|
+
ariaLabel: { type: "string", default: "Pagination" }
|
|
4752
4752
|
},
|
|
4753
4753
|
computed: {
|
|
4754
4754
|
lastPage() {
|
|
@@ -4762,7 +4762,7 @@ register("v-pagination", {
|
|
|
4762
4762
|
const value = Number(this.page) || 1;
|
|
4763
4763
|
return Math.min(Math.max(1, Math.round(value)), this.lastPage);
|
|
4764
4764
|
},
|
|
4765
|
-
/**
|
|
4765
|
+
/** Visible page numbers, with `0` marking the ellipsis. */
|
|
4766
4766
|
items() {
|
|
4767
4767
|
const last = this.lastPage;
|
|
4768
4768
|
const current = this.currentPage;
|
|
@@ -4807,7 +4807,7 @@ register("v-pagination", {
|
|
|
4807
4807
|
<template v-for="(item, index) in items" :key="index">
|
|
4808
4808
|
<span class="v-page-gap" v-if="item === 0" aria-hidden="true">...</span>
|
|
4809
4809
|
<button type="button" class="v-page" v-if="item !== 0" :aria-current="isCurrent(item)"
|
|
4810
|
-
:aria-label="'
|
|
4810
|
+
:aria-label="'Page ' + item" v-click="go(item)" v-text="item"></button>
|
|
4811
4811
|
</template>
|
|
4812
4812
|
<button type="button" class="v-page" :disabled="currentPage >= lastPage"
|
|
4813
4813
|
:aria-label="nextLabel" v-click="go(currentPage + 1)" v-html="svgIcon('chevron-right')"></button>
|
|
@@ -4839,7 +4839,7 @@ register("v-breadcrumb", {
|
|
|
4839
4839
|
props: {
|
|
4840
4840
|
items: { type: "any", default: "" },
|
|
4841
4841
|
separator: { type: "string", default: "/" },
|
|
4842
|
-
ariaLabel: { type: "string", default: "
|
|
4842
|
+
ariaLabel: { type: "string", default: "Breadcrumb" }
|
|
4843
4843
|
},
|
|
4844
4844
|
computed: {
|
|
4845
4845
|
crumbs() {
|
|
@@ -4872,7 +4872,7 @@ register("v-stat", {
|
|
|
4872
4872
|
hint: TEXT,
|
|
4873
4873
|
icon: TEXT,
|
|
4874
4874
|
suffix: { type: "string", default: "%" },
|
|
4875
|
-
/**
|
|
4875
|
+
/** When `true`, a negative change counts as positive. */
|
|
4876
4876
|
inverted: BOOL
|
|
4877
4877
|
},
|
|
4878
4878
|
computed: {
|
|
@@ -4925,7 +4925,7 @@ register("v-stat", {
|
|
|
4925
4925
|
register("v-empty-state", {
|
|
4926
4926
|
props: {
|
|
4927
4927
|
icon: { type: "string", default: "inbox" },
|
|
4928
|
-
title: { type: "string", default: "
|
|
4928
|
+
title: { type: "string", default: "Nothing here yet" },
|
|
4929
4929
|
description: TEXT
|
|
4930
4930
|
},
|
|
4931
4931
|
template: `
|
|
@@ -4996,7 +4996,7 @@ register("v-steps", {
|
|
|
4996
4996
|
steps: { type: "any", default: "" },
|
|
4997
4997
|
current: { type: "number", default: 0 },
|
|
4998
4998
|
vertical: BOOL,
|
|
4999
|
-
ariaLabel: { type: "string", default: "
|
|
4999
|
+
ariaLabel: { type: "string", default: "Steps" }
|
|
5000
5000
|
},
|
|
5001
5001
|
computed: {
|
|
5002
5002
|
...flags("vertical"),
|
|
@@ -5040,7 +5040,7 @@ register("v-rating", {
|
|
|
5040
5040
|
value: { type: "number", default: 0 },
|
|
5041
5041
|
max: { type: "number", default: 5 },
|
|
5042
5042
|
size: { type: "string", default: "md" },
|
|
5043
|
-
label: { type: "string", default: "
|
|
5043
|
+
label: { type: "string", default: "Rating" },
|
|
5044
5044
|
readonly: BOOL,
|
|
5045
5045
|
disabled: BOOL,
|
|
5046
5046
|
showValue: BOOL,
|
|
@@ -5066,7 +5066,7 @@ register("v-rating", {
|
|
|
5066
5066
|
return this.hovered > 0 ? this.hovered : this.score;
|
|
5067
5067
|
},
|
|
5068
5068
|
valueText() {
|
|
5069
|
-
return `${this.score}
|
|
5069
|
+
return `${this.score} of ${this.total}`;
|
|
5070
5070
|
}
|
|
5071
5071
|
},
|
|
5072
5072
|
methods: {
|
|
@@ -5122,7 +5122,7 @@ register("v-rating", {
|
|
|
5122
5122
|
:tabindex="locked ? -1 : 0" :aria-readonly="locked" v-keydown="onKey" v-mouseleave="reset">
|
|
5123
5123
|
<span class="v-rating-stars">
|
|
5124
5124
|
<button type="button" class="v-star" v-for="index in total" :key="index"
|
|
5125
|
-
:data-on="isOn(index)" :disabled="locked" :aria-label="index + '
|
|
5125
|
+
:data-on="isOn(index)" :disabled="locked" :aria-label="index + ' of ' + total"
|
|
5126
5126
|
:tabindex="-1" v-click="pick(index)" v-mouseenter="preview(index)"
|
|
5127
5127
|
v-html="svgIcon('star')"></button>
|
|
5128
5128
|
</span>
|
|
@@ -5190,8 +5190,8 @@ register("v-code-block", {
|
|
|
5190
5190
|
code: TEXT,
|
|
5191
5191
|
language: TEXT,
|
|
5192
5192
|
filename: TEXT,
|
|
5193
|
-
copyLabel: { type: "string", default: "
|
|
5194
|
-
copiedLabel: { type: "string", default: "
|
|
5193
|
+
copyLabel: { type: "string", default: "Copy" },
|
|
5194
|
+
copiedLabel: { type: "string", default: "Copied" },
|
|
5195
5195
|
wrap: BOOL
|
|
5196
5196
|
},
|
|
5197
5197
|
state() {
|
|
@@ -6491,14 +6491,14 @@ function xray(force) {
|
|
|
6491
6491
|
}
|
|
6492
6492
|
|
|
6493
6493
|
// src/devtools/launcher.ts
|
|
6494
|
-
var
|
|
6495
|
-
var
|
|
6496
|
-
var
|
|
6494
|
+
var POSITION_KEY = "voodoo:devtools:widget-position";
|
|
6495
|
+
var HIDDEN_KEY = "voodoo:devtools:widget-hidden";
|
|
6496
|
+
var DRAG_THRESHOLD = 4;
|
|
6497
6497
|
var refs2 = null;
|
|
6498
|
-
var
|
|
6499
|
-
var
|
|
6500
|
-
var
|
|
6501
|
-
var
|
|
6498
|
+
var mounted = false;
|
|
6499
|
+
var counterTimer = 0;
|
|
6500
|
+
var pulseTimer = 0;
|
|
6501
|
+
var teardown = [];
|
|
6502
6502
|
var WIDGET_CSS = `
|
|
6503
6503
|
.v-devtools-widget{
|
|
6504
6504
|
all: initial;
|
|
@@ -6631,220 +6631,220 @@ var WIDGET_CSS = `
|
|
|
6631
6631
|
.v-devtools-btn:hover{transform:none}
|
|
6632
6632
|
}
|
|
6633
6633
|
`;
|
|
6634
|
-
var
|
|
6634
|
+
var MARK = `<svg class="v-devtools-mark" viewBox="0 0 24 24" fill="none" aria-hidden="true">
|
|
6635
6635
|
<path d="M4 4l8 16 8-16" stroke="#6D3BF5" stroke-width="2.4" stroke-linecap="round" stroke-linejoin="round"/>
|
|
6636
6636
|
<circle cx="12" cy="7.5" r="2" fill="#FF3D8B"/>
|
|
6637
6637
|
</svg>`;
|
|
6638
|
-
function
|
|
6638
|
+
function readPosition() {
|
|
6639
6639
|
try {
|
|
6640
|
-
const
|
|
6641
|
-
if (!
|
|
6642
|
-
const
|
|
6643
|
-
if (typeof
|
|
6644
|
-
return
|
|
6640
|
+
const raw = localStorage.getItem(POSITION_KEY);
|
|
6641
|
+
if (!raw) return null;
|
|
6642
|
+
const value = JSON.parse(raw);
|
|
6643
|
+
if (typeof value?.x !== "number" || typeof value?.y !== "number") return null;
|
|
6644
|
+
return value;
|
|
6645
6645
|
} catch {
|
|
6646
6646
|
return null;
|
|
6647
6647
|
}
|
|
6648
6648
|
}
|
|
6649
|
-
function
|
|
6649
|
+
function writePosition(pos) {
|
|
6650
6650
|
try {
|
|
6651
|
-
localStorage.setItem(
|
|
6651
|
+
localStorage.setItem(POSITION_KEY, JSON.stringify(pos));
|
|
6652
6652
|
} catch {
|
|
6653
6653
|
}
|
|
6654
6654
|
}
|
|
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
|
-
|
|
6655
|
+
function applyPosition(root, pos) {
|
|
6656
|
+
const width = root.offsetWidth || 120;
|
|
6657
|
+
const height = root.offsetHeight || 38;
|
|
6658
|
+
const x = Math.min(Math.max(8, pos.x), Math.max(8, window.innerWidth - width - 8));
|
|
6659
|
+
const y = Math.min(Math.max(8, pos.y), Math.max(8, window.innerHeight - height - 8));
|
|
6660
|
+
root.style.left = `${x}px`;
|
|
6661
|
+
root.style.top = `${y}px`;
|
|
6662
|
+
root.style.right = "auto";
|
|
6663
|
+
root.style.bottom = "auto";
|
|
6664
|
+
}
|
|
6665
|
+
function build() {
|
|
6666
|
+
const root = document.createElement("div");
|
|
6667
|
+
root.className = "v-devtools-widget";
|
|
6668
|
+
root.setAttribute("data-voodoo-devtools", "widget");
|
|
6669
|
+
const button = document.createElement("button");
|
|
6670
|
+
button.type = "button";
|
|
6671
|
+
button.className = "v-devtools-btn";
|
|
6672
|
+
button.setAttribute("aria-label", "Open Voodoo devtools (Ctrl+Shift+X)");
|
|
6673
|
+
button.setAttribute("aria-pressed", "false");
|
|
6674
|
+
button.title = "Voodoo devtools \u2014 click to inspect, drag to move (Ctrl+Shift+X)";
|
|
6675
|
+
button.innerHTML = MARK;
|
|
6676
|
+
const label = document.createElement("span");
|
|
6677
|
+
label.className = "v-devtools-label";
|
|
6678
|
+
label.textContent = "Voodoo";
|
|
6679
|
+
const counter = document.createElement("span");
|
|
6680
|
+
counter.className = "v-devtools-count";
|
|
6681
|
+
counter.textContent = "0";
|
|
6682
|
+
const pulse = document.createElement("span");
|
|
6683
|
+
pulse.className = "v-devtools-pulse";
|
|
6684
|
+
pulse.setAttribute("data-on", "false");
|
|
6685
|
+
button.append(label, counter, pulse);
|
|
6686
|
+
const close = document.createElement("button");
|
|
6687
|
+
close.type = "button";
|
|
6688
|
+
close.className = "v-devtools-close";
|
|
6689
|
+
close.setAttribute("aria-label", "Hide the devtools widget in this tab");
|
|
6690
|
+
close.title = "Hide in this tab";
|
|
6691
|
+
close.textContent = "\xD7";
|
|
6692
|
+
root.append(button, close);
|
|
6693
|
+
document.body.appendChild(root);
|
|
6694
|
+
const saved = readPosition();
|
|
6695
|
+
if (saved) {
|
|
6696
|
+
applyPosition(root, saved);
|
|
6697
6697
|
} 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.
|
|
6698
|
+
root.style.right = "16px";
|
|
6699
|
+
root.style.bottom = "16px";
|
|
6700
|
+
}
|
|
6701
|
+
return { root, button, pulse, counter, close };
|
|
6702
|
+
}
|
|
6703
|
+
function enableDrag(refs3, onClick) {
|
|
6704
|
+
let dragging = false;
|
|
6705
|
+
let moved = false;
|
|
6706
|
+
let offsetX = 0;
|
|
6707
|
+
let offsetY = 0;
|
|
6708
|
+
let startX = 0;
|
|
6709
|
+
let startY = 0;
|
|
6710
|
+
const onPointerDown = (event) => {
|
|
6711
|
+
if (event.button !== 0) return;
|
|
6712
|
+
const box = refs3.root.getBoundingClientRect();
|
|
6713
|
+
dragging = true;
|
|
6714
|
+
moved = false;
|
|
6715
|
+
startX = event.clientX;
|
|
6716
|
+
startY = event.clientY;
|
|
6717
|
+
offsetX = event.clientX - box.left;
|
|
6718
|
+
offsetY = event.clientY - box.top;
|
|
6719
|
+
refs3.button.setPointerCapture?.(event.pointerId);
|
|
6720
6720
|
};
|
|
6721
|
-
const
|
|
6722
|
-
if (!
|
|
6723
|
-
const
|
|
6724
|
-
if (!
|
|
6725
|
-
|
|
6726
|
-
|
|
6727
|
-
|
|
6721
|
+
const onPointerMove2 = (event) => {
|
|
6722
|
+
if (!dragging) return;
|
|
6723
|
+
const distance = Math.hypot(event.clientX - startX, event.clientY - startY);
|
|
6724
|
+
if (!moved && distance < DRAG_THRESHOLD) return;
|
|
6725
|
+
moved = true;
|
|
6726
|
+
event.preventDefault();
|
|
6727
|
+
applyPosition(refs3.root, { x: event.clientX - offsetX, y: event.clientY - offsetY });
|
|
6728
6728
|
};
|
|
6729
|
-
const
|
|
6730
|
-
if (!
|
|
6731
|
-
|
|
6732
|
-
refs3.
|
|
6733
|
-
if (!
|
|
6734
|
-
|
|
6729
|
+
const onPointerUp = (event) => {
|
|
6730
|
+
if (!dragging) return;
|
|
6731
|
+
dragging = false;
|
|
6732
|
+
refs3.button.releasePointerCapture?.(event.pointerId);
|
|
6733
|
+
if (!moved) {
|
|
6734
|
+
onClick();
|
|
6735
6735
|
return;
|
|
6736
6736
|
}
|
|
6737
|
-
const
|
|
6738
|
-
|
|
6737
|
+
const box = refs3.root.getBoundingClientRect();
|
|
6738
|
+
writePosition({ x: box.left, y: box.top });
|
|
6739
6739
|
};
|
|
6740
|
-
const
|
|
6741
|
-
if (
|
|
6742
|
-
|
|
6743
|
-
|
|
6740
|
+
const onKeyDown = (event) => {
|
|
6741
|
+
if (event.key !== "Enter" && event.key !== " ") return;
|
|
6742
|
+
event.preventDefault();
|
|
6743
|
+
onClick();
|
|
6744
6744
|
};
|
|
6745
|
-
const
|
|
6746
|
-
const
|
|
6747
|
-
if (refs3.
|
|
6745
|
+
const onResize = () => {
|
|
6746
|
+
const box = refs3.root.getBoundingClientRect();
|
|
6747
|
+
if (refs3.root.style.left) applyPosition(refs3.root, { x: box.left, y: box.top });
|
|
6748
6748
|
};
|
|
6749
|
-
refs3.
|
|
6750
|
-
refs3.
|
|
6751
|
-
refs3.
|
|
6752
|
-
refs3.
|
|
6753
|
-
refs3.
|
|
6754
|
-
window.addEventListener("resize",
|
|
6749
|
+
refs3.button.addEventListener("pointerdown", onPointerDown);
|
|
6750
|
+
refs3.button.addEventListener("pointermove", onPointerMove2);
|
|
6751
|
+
refs3.button.addEventListener("pointerup", onPointerUp);
|
|
6752
|
+
refs3.button.addEventListener("pointercancel", onPointerUp);
|
|
6753
|
+
refs3.button.addEventListener("keydown", onKeyDown);
|
|
6754
|
+
window.addEventListener("resize", onResize);
|
|
6755
6755
|
return () => {
|
|
6756
|
-
refs3.
|
|
6757
|
-
refs3.
|
|
6758
|
-
refs3.
|
|
6759
|
-
refs3.
|
|
6760
|
-
refs3.
|
|
6761
|
-
window.removeEventListener("resize",
|
|
6756
|
+
refs3.button.removeEventListener("pointerdown", onPointerDown);
|
|
6757
|
+
refs3.button.removeEventListener("pointermove", onPointerMove2);
|
|
6758
|
+
refs3.button.removeEventListener("pointerup", onPointerUp);
|
|
6759
|
+
refs3.button.removeEventListener("pointercancel", onPointerUp);
|
|
6760
|
+
refs3.button.removeEventListener("keydown", onKeyDown);
|
|
6761
|
+
window.removeEventListener("resize", onResize);
|
|
6762
6762
|
};
|
|
6763
6763
|
}
|
|
6764
|
-
function
|
|
6764
|
+
function blink() {
|
|
6765
6765
|
if (!refs2) return;
|
|
6766
|
-
refs2.
|
|
6767
|
-
window.clearTimeout(
|
|
6768
|
-
|
|
6769
|
-
refs2?.
|
|
6766
|
+
refs2.pulse.setAttribute("data-on", "true");
|
|
6767
|
+
window.clearTimeout(pulseTimer);
|
|
6768
|
+
pulseTimer = window.setTimeout(() => {
|
|
6769
|
+
refs2?.pulse.setAttribute("data-on", "false");
|
|
6770
6770
|
}, 320);
|
|
6771
6771
|
}
|
|
6772
|
-
function
|
|
6772
|
+
function updateCounter() {
|
|
6773
6773
|
if (!refs2) return;
|
|
6774
6774
|
const total = instances.size;
|
|
6775
|
-
const
|
|
6776
|
-
if (refs2.
|
|
6775
|
+
const text = total === 1 ? "1 component" : `${total} components`;
|
|
6776
|
+
if (refs2.counter.textContent !== text) refs2.counter.textContent = text;
|
|
6777
6777
|
}
|
|
6778
6778
|
function mountDevtoolsWidget() {
|
|
6779
|
-
if (
|
|
6779
|
+
if (mounted || typeof document === "undefined" || !document.body) return;
|
|
6780
6780
|
try {
|
|
6781
|
-
if (sessionStorage.getItem(
|
|
6781
|
+
if (sessionStorage.getItem(HIDDEN_KEY) === "1") return;
|
|
6782
6782
|
} catch {
|
|
6783
6783
|
}
|
|
6784
|
-
|
|
6784
|
+
mounted = true;
|
|
6785
6785
|
injectStyle("devtools-widget", WIDGET_CSS);
|
|
6786
|
-
refs2 =
|
|
6787
|
-
const
|
|
6788
|
-
const
|
|
6789
|
-
refs2?.
|
|
6790
|
-
refs2?.
|
|
6786
|
+
refs2 = build();
|
|
6787
|
+
const toggle = () => {
|
|
6788
|
+
const enabled2 = xray();
|
|
6789
|
+
refs2?.root.setAttribute("data-active", String(enabled2));
|
|
6790
|
+
refs2?.button.setAttribute("aria-pressed", String(enabled2));
|
|
6791
6791
|
};
|
|
6792
|
-
|
|
6793
|
-
const
|
|
6794
|
-
|
|
6792
|
+
teardown.push(enableDrag(refs2, toggle));
|
|
6793
|
+
const onClose = (event) => {
|
|
6794
|
+
event.stopPropagation();
|
|
6795
6795
|
try {
|
|
6796
|
-
sessionStorage.setItem(
|
|
6796
|
+
sessionStorage.setItem(HIDDEN_KEY, "1");
|
|
6797
6797
|
} catch {
|
|
6798
6798
|
}
|
|
6799
6799
|
unmountDevtoolsWidget();
|
|
6800
6800
|
console.info("[Voodoo] devtools widget hidden. Use V.devtoolsWidget(true) to bring back.");
|
|
6801
6801
|
};
|
|
6802
|
-
refs2.
|
|
6803
|
-
|
|
6804
|
-
const
|
|
6805
|
-
const
|
|
6806
|
-
refs2?.
|
|
6807
|
-
refs2?.
|
|
6802
|
+
refs2.close.addEventListener("click", onClose);
|
|
6803
|
+
teardown.push(() => refs2?.close.removeEventListener("click", onClose));
|
|
6804
|
+
const onGlobalKeyUp = () => {
|
|
6805
|
+
const enabled2 = isXrayEnabled();
|
|
6806
|
+
refs2?.root.setAttribute("data-active", String(enabled2));
|
|
6807
|
+
refs2?.button.setAttribute("aria-pressed", String(enabled2));
|
|
6808
6808
|
};
|
|
6809
|
-
document.addEventListener("keyup",
|
|
6810
|
-
|
|
6811
|
-
for (const
|
|
6812
|
-
|
|
6809
|
+
document.addEventListener("keyup", onGlobalKeyUp);
|
|
6810
|
+
teardown.push(() => document.removeEventListener("keyup", onGlobalKeyUp));
|
|
6811
|
+
for (const type of ["network", "event", "navigation", "update"]) {
|
|
6812
|
+
teardown.push(devtoolsBus.on(type, blink));
|
|
6813
6813
|
}
|
|
6814
|
-
|
|
6815
|
-
|
|
6814
|
+
updateCounter();
|
|
6815
|
+
counterTimer = window.setInterval(updateCounter, 1e3);
|
|
6816
6816
|
}
|
|
6817
6817
|
function unmountDevtoolsWidget() {
|
|
6818
|
-
if (!
|
|
6819
|
-
|
|
6820
|
-
for (const fn of
|
|
6818
|
+
if (!mounted) return;
|
|
6819
|
+
mounted = false;
|
|
6820
|
+
for (const fn of teardown.splice(0)) {
|
|
6821
6821
|
try {
|
|
6822
6822
|
fn();
|
|
6823
6823
|
} catch {
|
|
6824
6824
|
}
|
|
6825
6825
|
}
|
|
6826
|
-
window.clearInterval(
|
|
6827
|
-
window.clearTimeout(
|
|
6828
|
-
|
|
6829
|
-
|
|
6830
|
-
refs2?.
|
|
6826
|
+
window.clearInterval(counterTimer);
|
|
6827
|
+
window.clearTimeout(pulseTimer);
|
|
6828
|
+
counterTimer = 0;
|
|
6829
|
+
pulseTimer = 0;
|
|
6830
|
+
refs2?.root.remove();
|
|
6831
6831
|
refs2 = null;
|
|
6832
6832
|
}
|
|
6833
6833
|
function isDevtoolsWidgetMounted() {
|
|
6834
|
-
return
|
|
6834
|
+
return mounted;
|
|
6835
6835
|
}
|
|
6836
6836
|
function devtoolsWidget(force) {
|
|
6837
|
-
const
|
|
6838
|
-
if (
|
|
6837
|
+
const target = force ?? !mounted;
|
|
6838
|
+
if (target) {
|
|
6839
6839
|
try {
|
|
6840
|
-
sessionStorage.removeItem(
|
|
6840
|
+
sessionStorage.removeItem(HIDDEN_KEY);
|
|
6841
6841
|
} catch {
|
|
6842
6842
|
}
|
|
6843
6843
|
mountDevtoolsWidget();
|
|
6844
6844
|
} else {
|
|
6845
6845
|
unmountDevtoolsWidget();
|
|
6846
6846
|
}
|
|
6847
|
-
return
|
|
6847
|
+
return mounted;
|
|
6848
6848
|
}
|
|
6849
6849
|
|
|
6850
6850
|
// src/index.ts
|