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/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-ABRZI32G.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-ABRZI32G.js';
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-RJUNPXQF.js';
7
- export { createSocket, devtoolsBus, socket, socketSupported } from './chunk-RJUNPXQF.js';
8
- import { magic, markSkipChildren, destroy, readAttr, walk, hadDirectives, getScope, collectDirectives, findScope, getEffectScopes, evaluateIn } from './chunk-34CGORMO.js';
9
- export { Scope, VoodooRuntimeError, VoodooSyntaxError, addCleanup, allowedGlobals, clearParseCache, destroy, evaluate, findScope, getScope, magic, magics, parse, refresh, rootScope, start, stringify, tokenize, walk } from './chunk-34CGORMO.js';
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
- if (options.replace) window.history.replaceState(historyState, "", url2);
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
- window.history.replaceState(
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
- window.history.replaceState({ [HISTORY_KEY]: currentKey }, "", buildUrl(destination));
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 ?? "Valor";
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
- /* ------------------------------------------------------------------ botao */
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
- /* ------------------------------------------------------- botao de icone */
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
- /* ------------------------------------------------------------ formulario */
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
- /* -------------------------------------------- caixa, radio e interruptor */
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
- /* --------------------------------------------------- selo, etiqueta, alerta */
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
- /* ------------------------------------------------- spinner e esqueleto */
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
- /* ------------------------------------------------------------- progresso */
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
- /* ------------------------------------------------------------- divisor */
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
- /* -------------------------------------------------------------- tabela */
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
- /* ---------------------------------------------------------- paginacao */
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
- /* ----------------------------------------------------------- migalhas */
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
- /* ------------------------------------------------------------ metrica */
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
- /* ------------------------------------------------------- estado vazio */
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
- /* ----------------------------------------------------------- linha do tempo */
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
- /* ---------------------------------------------------------------- passos */
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
- /* ------------------------------------------------------------ avaliacao */
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
- /* ------------------------------------------------------------ codigo */
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: "Nenhum registro encontrado" },
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: "Anterior" },
4750
- nextLabel: { type: "string", default: "Pr\xF3xima" },
4751
- ariaLabel: { type: "string", default: "Pagina\xE7\xE3o" }
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
- /** Numeros visiveis, com `0` marcando as reticencias. */
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="'P\xE1gina ' + item" v-click="go(item)" v-text="item"></button>
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: "Trilha de navega\xE7\xE3o" }
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
- /** Quando `true`, uma variacao negativa e considerada positiva. */
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: "Nada por aqui" },
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: "Etapas" }
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: "Avalia\xE7\xE3o" },
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} de ${this.total}`;
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 + ' de ' + total"
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: "Copiar" },
5194
- copiedLabel: { type: "string", default: "Copiado" },
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 POSICAO_KEY = "voodoo:devtools:widget-position";
6495
- var ESCONDIDO_KEY = "voodoo:devtools:widget-hidden";
6496
- var LIMIAR_ARRASTO = 4;
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 montado = false;
6499
- var timerContador = 0;
6500
- var timerPulso = 0;
6501
- var desligar = [];
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 MARCA = `<svg class="v-devtools-mark" viewBox="0 0 24 24" fill="none" aria-hidden="true">
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 lerPosicao() {
6662
+ function readPosition() {
6639
6663
  try {
6640
- const bruto = localStorage.getItem(POSICAO_KEY);
6641
- if (!bruto) return null;
6642
- const valor = JSON.parse(bruto);
6643
- if (typeof valor?.x !== "number" || typeof valor?.y !== "number") return null;
6644
- return valor;
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 gravarPosicao(pos) {
6673
+ function writePosition(pos) {
6650
6674
  try {
6651
- localStorage.setItem(POSICAO_KEY, JSON.stringify(pos));
6675
+ localStorage.setItem(POSITION_KEY, JSON.stringify(pos));
6652
6676
  } catch {
6653
6677
  }
6654
6678
  }
6655
- function aplicarPosicao(raiz, pos) {
6656
- const largura = raiz.offsetWidth || 120;
6657
- const altura = raiz.offsetHeight || 38;
6658
- const x = Math.min(Math.max(8, pos.x), Math.max(8, window.innerWidth - largura - 8));
6659
- const y = Math.min(Math.max(8, pos.y), Math.max(8, window.innerHeight - altura - 8));
6660
- raiz.style.left = `${x}px`;
6661
- raiz.style.top = `${y}px`;
6662
- raiz.style.right = "auto";
6663
- raiz.style.bottom = "auto";
6664
- }
6665
- function construir() {
6666
- const raiz = document.createElement("div");
6667
- raiz.className = "v-devtools-widget";
6668
- raiz.setAttribute("data-voodoo-devtools", "widget");
6669
- const botao = document.createElement("button");
6670
- botao.type = "button";
6671
- botao.className = "v-devtools-btn";
6672
- botao.setAttribute("aria-label", "Open Voodoo devtools (Ctrl+Shift+X)");
6673
- botao.setAttribute("aria-pressed", "false");
6674
- botao.title = "Voodoo devtools \u2014 click to inspect, drag to move (Ctrl+Shift+X)";
6675
- botao.innerHTML = MARCA;
6676
- const rotulo = document.createElement("span");
6677
- rotulo.className = "v-devtools-label";
6678
- rotulo.textContent = "Voodoo";
6679
- const contador = document.createElement("span");
6680
- contador.className = "v-devtools-count";
6681
- contador.textContent = "0";
6682
- const pulso = document.createElement("span");
6683
- pulso.className = "v-devtools-pulse";
6684
- pulso.setAttribute("data-on", "false");
6685
- botao.append(rotulo, contador, pulso);
6686
- const fechar = document.createElement("button");
6687
- fechar.type = "button";
6688
- fechar.className = "v-devtools-close";
6689
- fechar.setAttribute("aria-label", "Hide the devtools widget in this tab");
6690
- fechar.title = "Hide in this tab";
6691
- fechar.textContent = "\xD7";
6692
- raiz.append(botao, fechar);
6693
- document.body.appendChild(raiz);
6694
- const salva = lerPosicao();
6695
- if (salva) {
6696
- aplicarPosicao(raiz, salva);
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
- raiz.style.right = "16px";
6699
- raiz.style.bottom = "16px";
6700
- }
6701
- return { raiz, botao, pulso, contador, fechar };
6702
- }
6703
- function ligarArrasto(refs3, aoClicar) {
6704
- let arrastando = false;
6705
- let moveu = false;
6706
- let deslocX = 0;
6707
- let deslocY = 0;
6708
- let inicioX = 0;
6709
- let inicioY = 0;
6710
- const aoDescer = (evento) => {
6711
- if (evento.button !== 0) return;
6712
- const caixa = refs3.raiz.getBoundingClientRect();
6713
- arrastando = true;
6714
- moveu = false;
6715
- inicioX = evento.clientX;
6716
- inicioY = evento.clientY;
6717
- deslocX = evento.clientX - caixa.left;
6718
- deslocY = evento.clientY - caixa.top;
6719
- refs3.botao.setPointerCapture?.(evento.pointerId);
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 aoMover = (evento) => {
6722
- if (!arrastando) return;
6723
- const distancia = Math.hypot(evento.clientX - inicioX, evento.clientY - inicioY);
6724
- if (!moveu && distancia < LIMIAR_ARRASTO) return;
6725
- moveu = true;
6726
- evento.preventDefault();
6727
- aplicarPosicao(refs3.raiz, { x: evento.clientX - deslocX, y: evento.clientY - deslocY });
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 aoSubir = (evento) => {
6730
- if (!arrastando) return;
6731
- arrastando = false;
6732
- refs3.botao.releasePointerCapture?.(evento.pointerId);
6733
- if (!moveu) {
6734
- aoClicar();
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 caixa = refs3.raiz.getBoundingClientRect();
6738
- gravarPosicao({ x: caixa.left, y: caixa.top });
6761
+ const box = refs3.root.getBoundingClientRect();
6762
+ writePosition({ x: box.left, y: box.top });
6739
6763
  };
6740
- const aoTeclar = (evento) => {
6741
- if (evento.key !== "Enter" && evento.key !== " ") return;
6742
- evento.preventDefault();
6743
- aoClicar();
6764
+ const onKeyDown = (event) => {
6765
+ if (event.key !== "Enter" && event.key !== " ") return;
6766
+ event.preventDefault();
6767
+ onClick();
6744
6768
  };
6745
- const aoRedimensionar = () => {
6746
- const caixa = refs3.raiz.getBoundingClientRect();
6747
- if (refs3.raiz.style.left) aplicarPosicao(refs3.raiz, { x: caixa.left, y: caixa.top });
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.botao.addEventListener("pointerdown", aoDescer);
6750
- refs3.botao.addEventListener("pointermove", aoMover);
6751
- refs3.botao.addEventListener("pointerup", aoSubir);
6752
- refs3.botao.addEventListener("pointercancel", aoSubir);
6753
- refs3.botao.addEventListener("keydown", aoTeclar);
6754
- window.addEventListener("resize", aoRedimensionar);
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.botao.removeEventListener("pointerdown", aoDescer);
6757
- refs3.botao.removeEventListener("pointermove", aoMover);
6758
- refs3.botao.removeEventListener("pointerup", aoSubir);
6759
- refs3.botao.removeEventListener("pointercancel", aoSubir);
6760
- refs3.botao.removeEventListener("keydown", aoTeclar);
6761
- window.removeEventListener("resize", aoRedimensionar);
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 piscar() {
6788
+ function blink() {
6765
6789
  if (!refs2) return;
6766
- refs2.pulso.setAttribute("data-on", "true");
6767
- window.clearTimeout(timerPulso);
6768
- timerPulso = window.setTimeout(() => {
6769
- refs2?.pulso.setAttribute("data-on", "false");
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 atualizarContador() {
6796
+ function updateCounter() {
6773
6797
  if (!refs2) return;
6774
6798
  const total = instances.size;
6775
- const texto = total === 1 ? "1 component" : `${total} components`;
6776
- if (refs2.contador.textContent !== texto) refs2.contador.textContent = texto;
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 (montado || typeof document === "undefined" || !document.body) return;
6803
+ if (mounted || typeof document === "undefined" || !document.body) return;
6780
6804
  try {
6781
- if (sessionStorage.getItem(ESCONDIDO_KEY) === "1") return;
6805
+ if (sessionStorage.getItem(HIDDEN_KEY) === "1") return;
6782
6806
  } catch {
6783
6807
  }
6784
- montado = true;
6808
+ mounted = true;
6785
6809
  injectStyle("devtools-widget", WIDGET_CSS);
6786
- refs2 = construir();
6787
- const alternar = () => {
6788
- const ligado = xray();
6789
- refs2?.raiz.setAttribute("data-active", String(ligado));
6790
- refs2?.botao.setAttribute("aria-pressed", String(ligado));
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
- desligar.push(ligarArrasto(refs2, alternar));
6793
- const aoFechar = (evento) => {
6794
- evento.stopPropagation();
6816
+ teardown.push(enableDrag(refs2, toggle));
6817
+ const onClose = (event) => {
6818
+ event.stopPropagation();
6795
6819
  try {
6796
- sessionStorage.setItem(ESCONDIDO_KEY, "1");
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.fechar.addEventListener("click", aoFechar);
6803
- desligar.push(() => refs2?.fechar.removeEventListener("click", aoFechar));
6804
- const aoTeclarGlobal = () => {
6805
- const ligado = isXrayEnabled();
6806
- refs2?.raiz.setAttribute("data-active", String(ligado));
6807
- refs2?.botao.setAttribute("aria-pressed", String(ligado));
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", aoTeclarGlobal);
6810
- desligar.push(() => document.removeEventListener("keyup", aoTeclarGlobal));
6811
- for (const tipo of ["network", "event", "navigation", "update"]) {
6812
- desligar.push(devtoolsBus.on(tipo, piscar));
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
- atualizarContador();
6815
- timerContador = window.setInterval(atualizarContador, 1e3);
6838
+ updateCounter();
6839
+ counterTimer = window.setInterval(updateCounter, 1e3);
6816
6840
  }
6817
6841
  function unmountDevtoolsWidget() {
6818
- if (!montado) return;
6819
- montado = false;
6820
- for (const fn of desligar.splice(0)) {
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(timerContador);
6827
- window.clearTimeout(timerPulso);
6828
- timerContador = 0;
6829
- timerPulso = 0;
6830
- refs2?.raiz.remove();
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 montado;
6858
+ return mounted;
6835
6859
  }
6836
6860
  function devtoolsWidget(force) {
6837
- const alvo = force ?? !montado;
6838
- if (alvo) {
6861
+ const target = force ?? !mounted;
6862
+ if (target) {
6839
6863
  try {
6840
- sessionStorage.removeItem(ESCONDIDO_KEY);
6864
+ sessionStorage.removeItem(HIDDEN_KEY);
6841
6865
  } catch {
6842
6866
  }
6843
6867
  mountDevtoolsWidget();
6844
6868
  } else {
6845
6869
  unmountDevtoolsWidget();
6846
6870
  }
6847
- return montado;
6871
+ return mounted;
6848
6872
  }
6849
6873
 
6850
6874
  // src/index.ts