voodoojs 0.7.0 → 0.10.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.
Files changed (41) hide show
  1. package/README.md +1 -1
  2. package/dist/{chunk-4T2UIPWX.js → chunk-246ZC2JD.js} +4 -4
  3. package/dist/{chunk-YOZTHZS2.js → chunk-2UST7MKN.js} +3 -3
  4. package/dist/{chunk-II3XBOAP.js → chunk-4MJIS5RZ.js} +13 -13
  5. package/dist/{chunk-QO3I7VLJ.js → chunk-5D7TM3GL.js} +5 -5
  6. package/dist/{chunk-JB2YYNK6.js → chunk-5E3UZREN.js} +325 -64
  7. package/dist/{chunk-MMLUK37L.js → chunk-D4DNTWIS.js} +4 -3
  8. package/dist/{chunk-WSDB7K4X.js → chunk-DNIQLT66.js} +6 -6
  9. package/dist/{chunk-ZIWLQZZL.js → chunk-F3Z3HMZR.js} +4 -4
  10. package/dist/{chunk-GIWKGFGY.js → chunk-KQRWQPD6.js} +4 -4
  11. package/dist/{chunk-CYN6VLMD.js → chunk-RREZZ4FB.js} +4 -4
  12. package/dist/{chunk-E5T65CEI.js → chunk-WYSN4IOV.js} +5 -5
  13. package/dist/essential.cjs +317 -58
  14. package/dist/essential.d.cts +2 -2
  15. package/dist/essential.d.ts +2 -2
  16. package/dist/essential.js +10 -10
  17. package/dist/gpu.cjs +1 -1
  18. package/dist/gpu.js +10 -10
  19. package/dist/http.cjs +1 -1
  20. package/dist/http.js +5 -5
  21. package/dist/index.cjs +596 -76
  22. package/dist/index.d.cts +118 -4
  23. package/dist/index.d.ts +118 -4
  24. package/dist/index.js +282 -31
  25. package/dist/{query-CC-_z7v0.d.ts → query-Cf-7iibE.d.ts} +53 -2
  26. package/dist/{query-sEJXe_cO.d.cts → query-DiQAS73Q.d.cts} +53 -2
  27. package/dist/reactivity.cjs +1 -1
  28. package/dist/reactivity.js +2 -2
  29. package/dist/socket.cjs +303 -57
  30. package/dist/socket.js +9 -9
  31. package/dist/style-BSEVBI4K.js +5 -0
  32. package/dist/utils.cjs +1 -1
  33. package/dist/utils.js +2 -2
  34. package/dist/voodoo.core.js +322 -58
  35. package/dist/voodoo.core.min.js +18 -18
  36. package/dist/voodoo.full.js +599 -74
  37. package/dist/voodoo.full.min.js +61 -61
  38. package/dist/voodoo.js +322 -58
  39. package/dist/voodoo.min.js +25 -25
  40. package/package.json +127 -127
  41. package/dist/style-SLQ6PHZK.js +0 -5
package/dist/index.d.cts CHANGED
@@ -1,5 +1,5 @@
1
- import { c as core, V as VoodooCollection } from './query-sEJXe_cO.cjs';
2
- export { A as App, a as AppOptions, C as ComponentDefinition, D as DirectiveBinding, b as DirectiveHooks, P as PRIORITY, R as Resource, d as ResourceOptions, S as Scope, e as VoodooConfig, f as VoodooPlugin, g as VoodooRuntimeError, h as VoodooSyntaxError, i as addCleanup, j as allStores, k as allowedGlobals, l as cache, m as clearParseCache, n as config, o as cookie, p as createApp, q as createResource, r as defineComponent, s as defineDirective, t as destroy, u as documentReady, v as ensureTokens, w as enter, x as evaluate, y as fadeIn, z as fadeOut, B as findScope, E as fromHtml, F as getScope, G as injectStyle, H as instances, I as leave, J as magic, K as magics, L as mountComponent, M as parse, N as query, O as ready, Q as refresh, T as removeStore, q as resource, U as rootScope, W as session, X as slideDown, Y as slideUp, Z as start, _ as storage, $ as store, a0 as storeNames, a1 as stringify, a2 as theme, a3 as toast, a4 as tokenize, a5 as url, a6 as viewTransition, a7 as walk, a8 as whenElement, a9 as whenReady } from './query-sEJXe_cO.cjs';
1
+ import { S as Scope, c as core, V as VoodooCollection } from './query-DiQAS73Q.cjs';
2
+ export { A as App, a as AppOptions, C as ComponentDefinition, D as DirectiveBinding, b as DirectiveHooks, P as PRIORITY, R as Resource, d as ResourceOptions, e as VoodooConfig, f as VoodooPlugin, g as VoodooRuntimeError, h as VoodooSyntaxError, i as addCleanup, j as allStores, k as allowedGlobals, l as cache, m as clearParseCache, n as config, o as cookie, p as createApp, q as createResource, r as defineComponent, s as defineDirective, t as destroy, u as documentReady, v as ensureTokens, w as enter, x as evaluate, y as fadeIn, z as fadeOut, B as findScope, E as fromHtml, F as getScope, G as injectStyle, H as instances, I as leave, J as magic, K as magics, L as mountComponent, M as parse, N as query, O as ready, Q as refresh, T as removeStore, q as resource, U as rootScope, W as session, X as slideDown, Y as slideUp, Z as start, _ as storage, $ as store, a0 as storeNames, a1 as stringify, a2 as theme, a3 as toast, a4 as tokenize, a5 as url, a6 as viewTransition, a7 as walk, a8 as whenElement, a9 as whenReady } from './query-DiQAS73Q.cjs';
3
3
  export { EffectScope, computed, effect, effectScope, flushSync, isReactive, markRaw, nextTick, reactive, ref, shallowRef, stop, toRaw, unref, watch, watchEffect } from './reactivity.cjs';
4
4
  export { HttpError, HttpMethod, HttpResponse, RequestConfig, http, request } from './http.cjs';
5
5
  export { R as RoomOptions, a as RoomState, S as SocketMessage, b as SocketOptions, c as SocketRoom, d as SocketState, e as SocketTransport, V as VoodooSocket, f as createSocket, s as socket, g as socketSupported } from './index-DTllqUtj.cjs';
@@ -520,6 +520,120 @@ declare const clipboard: {
520
520
  read(): Promise<string>;
521
521
  };
522
522
 
523
+ /**
524
+ * @module jsx
525
+ *
526
+ * JSX written directly in ordinary HTML, with no build step and no compiler.
527
+ *
528
+ * ```html
529
+ * <ul>
530
+ * {frutas.map((fruta) => (
531
+ * <li>{fruta}</li>
532
+ * ))}
533
+ * </ul>
534
+ * ```
535
+ *
536
+ * The trick is that the browser has already parsed the page before any of this
537
+ * runs, and what it leaves behind is recoverable. For the block above the DOM is
538
+ * three siblings:
539
+ *
540
+ * text "{frutas.map((fruta) => ("
541
+ * element <li>{fruta}</li>
542
+ * text "))}"
543
+ *
544
+ * The element is not a mistake to be worked around, it is the template. Joining
545
+ * the text back together with a placeholder where the element sat reconstructs
546
+ * the expression exactly as it was typed:
547
+ *
548
+ * frutas.map((fruta) => ($t(0, $__jsx)))
549
+ *
550
+ * `$t` returns a handle to that `<li>` together with the scope the call was made
551
+ * in, so the arrow returns one clone per item, each rendered where `fruta` is
552
+ * bound. Nothing is compiled, nothing is evaluated as a string, and the whole
553
+ * thing goes through the same lexer, parser and interpreter as every other
554
+ * expression, which is what keeps it working under a strict Content Security
555
+ * Policy.
556
+ *
557
+ * ATTRIBUTE VALUES MUST BE QUOTED
558
+ *
559
+ * style="{{ backgroundColor: cor }}" works
560
+ * style={{ backgroundColor: cor }} does not
561
+ *
562
+ * This one is not a decision, it is the order things happen in. An unquoted
563
+ * attribute value ends at the first space, so the browser turns the second line
564
+ * into six separate attributes, `style="{{"`, `backgroundcolor:=""`, `cor,=""`
565
+ * and so on, before a single line of JavaScript has run.
566
+ *
567
+ * The pieces do survive in order, so they could in principle be rejoined. What
568
+ * does not survive is case: the browser lowercases every attribute NAME, so
569
+ * `backgroundColor` comes back as `backgroundcolor` and any identifier with a
570
+ * capital in it is gone. Quoting costs two characters and has no such rule.
571
+ */
572
+
573
+ /**
574
+ * Finds and installs every `{ ... }` region inside one element's children.
575
+ *
576
+ * Text-only interpolation such as `<h1>Ola, {nome}!</h1>` is deliberately left
577
+ * alone: the core already renders it, and taking it over here would mean two
578
+ * implementations of the same thing disagreeing at some point. This module only
579
+ * claims a region that spans an element, which is the part the core cannot do.
580
+ */
581
+ declare function applyRegions(root: Element, parentScope?: Scope): void;
582
+ /**
583
+ * Reads a top-level declaration block into state.
584
+ *
585
+ * ```html
586
+ * {
587
+ * const produtos = [...];
588
+ * const ativo = true;
589
+ * }
590
+ * ```
591
+ *
592
+ * The block is a text node in `<body>`, and `const` is not part of the
593
+ * expression language, so the keywords are stripped and what remains is a
594
+ * sequence of assignments, which the parser already understands. The names land
595
+ * on a reactive object that becomes the root scope's data, so everything below
596
+ * sees them and updates when they change.
597
+ */
598
+ declare function readDeclarationBlock(root?: ParentNode): Record<string, unknown> | null;
599
+ /**
600
+ * Turns the whole page into one where JSX works.
601
+ *
602
+ * ```js
603
+ * V.jsx(); // the document
604
+ * V.jsx(document.querySelector('#app'));
605
+ * ```
606
+ *
607
+ * Reads the declaration block if there is one, puts its names in scope, and
608
+ * then installs every `{ ... }` region below the root.
609
+ */
610
+ /**
611
+ * Makes every extracted region live.
612
+ *
613
+ * Separate from `jsx()` because it must run after `V.start()`, once `v-data`
614
+ * has created the scopes a region may need to resolve against. `jsx()` takes
615
+ * the templates out of the document; this puts the rendered result back.
616
+ */
617
+ declare function activateJsx(): void;
618
+ /**
619
+ * Takes every region out of the document, without rendering anything yet.
620
+ *
621
+ * This is the half that must run BEFORE `V.start()`. `jsx()` is extract plus
622
+ * activate in one call, which is right for a caller doing it by hand and wrong
623
+ * for the bootstrap: calling `jsx()` there activated immediately, with the
624
+ * `v-data` scopes not yet created, and the later `activateJsx()` found an empty
625
+ * queue. Every list on the page came out blank.
626
+ */
627
+ declare function extractJsx(root?: Element): void;
628
+ /**
629
+ * Extract and render in one call, for a caller doing this by hand.
630
+ *
631
+ * The bootstrap does not use this: it calls `extractJsx()` before `V.start()`
632
+ * and `activateJsx()` after, because the two halves belong on opposite sides of
633
+ * it.
634
+ */
635
+ declare function jsx(root?: Element): void;
636
+
523
637
  /**
524
638
  * @module ui/dialog
525
639
  *
@@ -1513,7 +1627,7 @@ declare function isXrayEnabled(): boolean;
1513
1627
  * V.xray(false) // disable
1514
1628
  * ```
1515
1629
  *
1516
- * The first call also installs the `Alt+Shift+V` shortcut.
1630
+ * The first call also installs the `Ctrl+Shift+F2` shortcut.
1517
1631
  *
1518
1632
  * @param force enable or disable explicitly. Without argument, toggles.
1519
1633
  * @returns the state after the call.
@@ -1600,4 +1714,4 @@ interface Voodoo extends Omit<typeof core, never> {
1600
1714
  }
1601
1715
  declare const V: Voodoo;
1602
1716
 
1603
- export { V, type Voodoo, VoodooCollection, alert, animate, applyMask, charts, clearErrors, clipboard, confirm, V as default, devtoolsBus, devtoolsWidget, dialog, disableXray, easings, enableXray, getLocale, hotkey, i18n, inView, isDevtoolsWidgetMounted, isXrayEnabled, mask, masks, modal, motionPresets, mountDevtoolsWidget, navigate, network, palette, prompt, registerMask, renderChart, route, router, screen, scrollProgress, serializeForm, setLocale, showFormErrors, sound, efeitos as soundEffects, spring, stagger, t, unmask, unmountDevtoolsWidget, validate, validator, xray };
1717
+ export { Scope, V, type Voodoo, VoodooCollection, activateJsx, alert, animate, applyMask, applyRegions, charts, clearErrors, clipboard, confirm, V as default, devtoolsBus, devtoolsWidget, dialog, disableXray, easings, enableXray, extractJsx, getLocale, hotkey, i18n, inView, isDevtoolsWidgetMounted, isXrayEnabled, jsx, mask, masks, modal, motionPresets, mountDevtoolsWidget, navigate, network, palette, prompt, readDeclarationBlock, registerMask, renderChart, route, router, screen, scrollProgress, serializeForm, setLocale, showFormErrors, sound, efeitos as soundEffects, spring, stagger, t, unmask, unmountDevtoolsWidget, validate, validator, xray };
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { c as core, V as VoodooCollection } from './query-CC-_z7v0.js';
2
- export { A as App, a as AppOptions, C as ComponentDefinition, D as DirectiveBinding, b as DirectiveHooks, P as PRIORITY, R as Resource, d as ResourceOptions, S as Scope, e as VoodooConfig, f as VoodooPlugin, g as VoodooRuntimeError, h as VoodooSyntaxError, i as addCleanup, j as allStores, k as allowedGlobals, l as cache, m as clearParseCache, n as config, o as cookie, p as createApp, q as createResource, r as defineComponent, s as defineDirective, t as destroy, u as documentReady, v as ensureTokens, w as enter, x as evaluate, y as fadeIn, z as fadeOut, B as findScope, E as fromHtml, F as getScope, G as injectStyle, H as instances, I as leave, J as magic, K as magics, L as mountComponent, M as parse, N as query, O as ready, Q as refresh, T as removeStore, q as resource, U as rootScope, W as session, X as slideDown, Y as slideUp, Z as start, _ as storage, $ as store, a0 as storeNames, a1 as stringify, a2 as theme, a3 as toast, a4 as tokenize, a5 as url, a6 as viewTransition, a7 as walk, a8 as whenElement, a9 as whenReady } from './query-CC-_z7v0.js';
1
+ import { S as Scope, c as core, V as VoodooCollection } from './query-Cf-7iibE.js';
2
+ export { A as App, a as AppOptions, C as ComponentDefinition, D as DirectiveBinding, b as DirectiveHooks, P as PRIORITY, R as Resource, d as ResourceOptions, e as VoodooConfig, f as VoodooPlugin, g as VoodooRuntimeError, h as VoodooSyntaxError, i as addCleanup, j as allStores, k as allowedGlobals, l as cache, m as clearParseCache, n as config, o as cookie, p as createApp, q as createResource, r as defineComponent, s as defineDirective, t as destroy, u as documentReady, v as ensureTokens, w as enter, x as evaluate, y as fadeIn, z as fadeOut, B as findScope, E as fromHtml, F as getScope, G as injectStyle, H as instances, I as leave, J as magic, K as magics, L as mountComponent, M as parse, N as query, O as ready, Q as refresh, T as removeStore, q as resource, U as rootScope, W as session, X as slideDown, Y as slideUp, Z as start, _ as storage, $ as store, a0 as storeNames, a1 as stringify, a2 as theme, a3 as toast, a4 as tokenize, a5 as url, a6 as viewTransition, a7 as walk, a8 as whenElement, a9 as whenReady } from './query-Cf-7iibE.js';
3
3
  export { EffectScope, computed, effect, effectScope, flushSync, isReactive, markRaw, nextTick, reactive, ref, shallowRef, stop, toRaw, unref, watch, watchEffect } from './reactivity.js';
4
4
  export { HttpError, HttpMethod, HttpResponse, RequestConfig, http, request } from './http.js';
5
5
  export { R as RoomOptions, a as RoomState, S as SocketMessage, b as SocketOptions, c as SocketRoom, d as SocketState, e as SocketTransport, V as VoodooSocket, f as createSocket, s as socket, g as socketSupported } from './index-DTllqUtj.js';
@@ -520,6 +520,120 @@ declare const clipboard: {
520
520
  read(): Promise<string>;
521
521
  };
522
522
 
523
+ /**
524
+ * @module jsx
525
+ *
526
+ * JSX written directly in ordinary HTML, with no build step and no compiler.
527
+ *
528
+ * ```html
529
+ * <ul>
530
+ * {frutas.map((fruta) => (
531
+ * <li>{fruta}</li>
532
+ * ))}
533
+ * </ul>
534
+ * ```
535
+ *
536
+ * The trick is that the browser has already parsed the page before any of this
537
+ * runs, and what it leaves behind is recoverable. For the block above the DOM is
538
+ * three siblings:
539
+ *
540
+ * text "{frutas.map((fruta) => ("
541
+ * element <li>{fruta}</li>
542
+ * text "))}"
543
+ *
544
+ * The element is not a mistake to be worked around, it is the template. Joining
545
+ * the text back together with a placeholder where the element sat reconstructs
546
+ * the expression exactly as it was typed:
547
+ *
548
+ * frutas.map((fruta) => ($t(0, $__jsx)))
549
+ *
550
+ * `$t` returns a handle to that `<li>` together with the scope the call was made
551
+ * in, so the arrow returns one clone per item, each rendered where `fruta` is
552
+ * bound. Nothing is compiled, nothing is evaluated as a string, and the whole
553
+ * thing goes through the same lexer, parser and interpreter as every other
554
+ * expression, which is what keeps it working under a strict Content Security
555
+ * Policy.
556
+ *
557
+ * ATTRIBUTE VALUES MUST BE QUOTED
558
+ *
559
+ * style="{{ backgroundColor: cor }}" works
560
+ * style={{ backgroundColor: cor }} does not
561
+ *
562
+ * This one is not a decision, it is the order things happen in. An unquoted
563
+ * attribute value ends at the first space, so the browser turns the second line
564
+ * into six separate attributes, `style="{{"`, `backgroundcolor:=""`, `cor,=""`
565
+ * and so on, before a single line of JavaScript has run.
566
+ *
567
+ * The pieces do survive in order, so they could in principle be rejoined. What
568
+ * does not survive is case: the browser lowercases every attribute NAME, so
569
+ * `backgroundColor` comes back as `backgroundcolor` and any identifier with a
570
+ * capital in it is gone. Quoting costs two characters and has no such rule.
571
+ */
572
+
573
+ /**
574
+ * Finds and installs every `{ ... }` region inside one element's children.
575
+ *
576
+ * Text-only interpolation such as `<h1>Ola, {nome}!</h1>` is deliberately left
577
+ * alone: the core already renders it, and taking it over here would mean two
578
+ * implementations of the same thing disagreeing at some point. This module only
579
+ * claims a region that spans an element, which is the part the core cannot do.
580
+ */
581
+ declare function applyRegions(root: Element, parentScope?: Scope): void;
582
+ /**
583
+ * Reads a top-level declaration block into state.
584
+ *
585
+ * ```html
586
+ * {
587
+ * const produtos = [...];
588
+ * const ativo = true;
589
+ * }
590
+ * ```
591
+ *
592
+ * The block is a text node in `<body>`, and `const` is not part of the
593
+ * expression language, so the keywords are stripped and what remains is a
594
+ * sequence of assignments, which the parser already understands. The names land
595
+ * on a reactive object that becomes the root scope's data, so everything below
596
+ * sees them and updates when they change.
597
+ */
598
+ declare function readDeclarationBlock(root?: ParentNode): Record<string, unknown> | null;
599
+ /**
600
+ * Turns the whole page into one where JSX works.
601
+ *
602
+ * ```js
603
+ * V.jsx(); // the document
604
+ * V.jsx(document.querySelector('#app'));
605
+ * ```
606
+ *
607
+ * Reads the declaration block if there is one, puts its names in scope, and
608
+ * then installs every `{ ... }` region below the root.
609
+ */
610
+ /**
611
+ * Makes every extracted region live.
612
+ *
613
+ * Separate from `jsx()` because it must run after `V.start()`, once `v-data`
614
+ * has created the scopes a region may need to resolve against. `jsx()` takes
615
+ * the templates out of the document; this puts the rendered result back.
616
+ */
617
+ declare function activateJsx(): void;
618
+ /**
619
+ * Takes every region out of the document, without rendering anything yet.
620
+ *
621
+ * This is the half that must run BEFORE `V.start()`. `jsx()` is extract plus
622
+ * activate in one call, which is right for a caller doing it by hand and wrong
623
+ * for the bootstrap: calling `jsx()` there activated immediately, with the
624
+ * `v-data` scopes not yet created, and the later `activateJsx()` found an empty
625
+ * queue. Every list on the page came out blank.
626
+ */
627
+ declare function extractJsx(root?: Element): void;
628
+ /**
629
+ * Extract and render in one call, for a caller doing this by hand.
630
+ *
631
+ * The bootstrap does not use this: it calls `extractJsx()` before `V.start()`
632
+ * and `activateJsx()` after, because the two halves belong on opposite sides of
633
+ * it.
634
+ */
635
+ declare function jsx(root?: Element): void;
636
+
523
637
  /**
524
638
  * @module ui/dialog
525
639
  *
@@ -1513,7 +1627,7 @@ declare function isXrayEnabled(): boolean;
1513
1627
  * V.xray(false) // disable
1514
1628
  * ```
1515
1629
  *
1516
- * The first call also installs the `Alt+Shift+V` shortcut.
1630
+ * The first call also installs the `Ctrl+Shift+F2` shortcut.
1517
1631
  *
1518
1632
  * @param force enable or disable explicitly. Without argument, toggles.
1519
1633
  * @returns the state after the call.
@@ -1600,4 +1714,4 @@ interface Voodoo extends Omit<typeof core, never> {
1600
1714
  }
1601
1715
  declare const V: Voodoo;
1602
1716
 
1603
- export { V, type Voodoo, VoodooCollection, alert, animate, applyMask, charts, clearErrors, clipboard, confirm, V as default, devtoolsBus, devtoolsWidget, dialog, disableXray, easings, enableXray, getLocale, hotkey, i18n, inView, isDevtoolsWidgetMounted, isXrayEnabled, mask, masks, modal, motionPresets, mountDevtoolsWidget, navigate, network, palette, prompt, registerMask, renderChart, route, router, screen, scrollProgress, serializeForm, setLocale, showFormErrors, sound, efeitos as soundEffects, spring, stagger, t, unmask, unmountDevtoolsWidget, validate, validator, xray };
1717
+ export { Scope, V, type Voodoo, VoodooCollection, activateJsx, alert, animate, applyMask, applyRegions, charts, clearErrors, clipboard, confirm, V as default, devtoolsBus, devtoolsWidget, dialog, disableXray, easings, enableXray, extractJsx, getLocale, hotkey, i18n, inView, isDevtoolsWidgetMounted, isXrayEnabled, jsx, mask, masks, modal, motionPresets, mountDevtoolsWidget, navigate, network, palette, prompt, readDeclarationBlock, registerMask, renderChart, route, router, screen, scrollProgress, serializeForm, setLocale, showFormErrors, sound, efeitos as soundEffects, spring, stagger, t, unmask, unmountDevtoolsWidget, validate, validator, xray };
package/dist/index.js CHANGED
@@ -1,25 +1,25 @@
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-II3XBOAP.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-II3XBOAP.js';
3
- export { gpu, reflectWgsl } from './chunk-E5T65CEI.js';
4
- import { http } from './chunk-WSDB7K4X.js';
5
- export { HttpError, http, request } from './chunk-WSDB7K4X.js';
6
- import { devtoolsBus } from './chunk-QO3I7VLJ.js';
7
- export { createSocket, devtoolsBus, socket, socketSupported } from './chunk-QO3I7VLJ.js';
8
- import { magic, markSkipChildren, destroy, readAttr, walk, hadDirectives, getScope, collectDirectives, findScope, getEffectScopes, evaluateIn } from './chunk-JB2YYNK6.js';
9
- export { Scope, VoodooRuntimeError, VoodooSyntaxError, addCleanup, allowedGlobals, clearParseCache, destroy, evaluate, findScope, getScope, magic, magics, parse, refresh, rootScope, start, stringify, tokenize, walk } from './chunk-JB2YYNK6.js';
10
- import { reactive, warn, handleError, queuePostFlush, nextTick } from './chunk-4T2UIPWX.js';
11
- export { EffectScope, computed, effect, effectScope, flushSync, isReactive, markRaw, nextTick, reactive, ref, shallowRef, stop, toRaw, unref, watch, watchEffect } from './chunk-4T2UIPWX.js';
12
- import { warnAlias } from './chunk-CYN6VLMD.js';
13
- import { parseDuration, formatNumber, formatCurrency, formatDate, relativeTime, device, setFormatDefaults, uid, merge, escapeHtml, truncate, get, titleCase } from './chunk-ZIWLQZZL.js';
14
- export { capitalize, chunk, clone, debounce, device, escapeHtml, formatCurrency, formatDate, formatFileSize, formatNumber, formatPercent, get, groupBy, isBrowser, matchesMedia, memoize, merge, once, parseDuration, random, relativeTime, sample, set, setFormatDefaults, sleep, slugify, sortBy, stripTags, throttle, titleCase, truncate, uid, unique, uuid } from './chunk-ZIWLQZZL.js';
15
- import { ensureTokens, injectStyle } from './chunk-GIWKGFGY.js';
16
- export { ensureTokens, injectStyle } from './chunk-GIWKGFGY.js';
17
- import { defineDirective, PRIORITY, config } from './chunk-MMLUK37L.js';
18
- export { PRIORITY, config, defineDirective } from './chunk-MMLUK37L.js';
19
- import './chunk-YOZTHZS2.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-4MJIS5RZ.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-4MJIS5RZ.js';
3
+ export { gpu, reflectWgsl } from './chunk-WYSN4IOV.js';
4
+ import { http } from './chunk-DNIQLT66.js';
5
+ export { HttpError, http, request } from './chunk-DNIQLT66.js';
6
+ import { devtoolsBus } from './chunk-5D7TM3GL.js';
7
+ export { createSocket, devtoolsBus, socket, socketSupported } from './chunk-5D7TM3GL.js';
8
+ import { magic, markSkipChildren, onStart, rootScope, findScope, destroy, readAttr, evaluate, parse, Scope, getScope, walk, unwrap, addCleanup, hadDirectives, collectDirectives, getEffectScopes, evaluateIn } from './chunk-5E3UZREN.js';
9
+ export { Scope, VoodooRuntimeError, VoodooSyntaxError, addCleanup, allowedGlobals, clearParseCache, destroy, evaluate, findScope, getScope, magic, magics, parse, refresh, rootScope, start, stringify, tokenize, walk } from './chunk-5E3UZREN.js';
10
+ import { reactive, warn, handleError, effect, queuePostFlush, nextTick } from './chunk-246ZC2JD.js';
11
+ export { EffectScope, computed, effect, effectScope, flushSync, isReactive, markRaw, nextTick, reactive, ref, shallowRef, stop, toRaw, unref, watch, watchEffect } from './chunk-246ZC2JD.js';
12
+ import { warnAlias } from './chunk-RREZZ4FB.js';
13
+ import { parseDuration, formatNumber, formatCurrency, formatDate, relativeTime, device, setFormatDefaults, uid, merge, escapeHtml, truncate, get, titleCase } from './chunk-F3Z3HMZR.js';
14
+ export { capitalize, chunk, clone, debounce, device, escapeHtml, formatCurrency, formatDate, formatFileSize, formatNumber, formatPercent, get, groupBy, isBrowser, matchesMedia, memoize, merge, once, parseDuration, random, relativeTime, sample, set, setFormatDefaults, sleep, slugify, sortBy, stripTags, throttle, titleCase, truncate, uid, unique, uuid } from './chunk-F3Z3HMZR.js';
15
+ import { ensureTokens, injectStyle } from './chunk-KQRWQPD6.js';
16
+ export { ensureTokens, injectStyle } from './chunk-KQRWQPD6.js';
17
+ import { defineDirective, PRIORITY, config } from './chunk-D4DNTWIS.js';
18
+ export { PRIORITY, config, defineDirective } from './chunk-D4DNTWIS.js';
19
+ import './chunk-2UST7MKN.js';
20
20
 
21
21
  /**
22
- * Voodoo.js v0.7.0
22
+ * Voodoo.js v0.10.1
23
23
  * JavaScript feels like magic.
24
24
  * (c) 2026 Voodoo.js contributors. MIT License.
25
25
  */
@@ -536,7 +536,7 @@ defineDirective(
536
536
  el.innerHTML = html ?? fallbackHtml;
537
537
  for (const child of Array.from(el.childNodes)) walk(child, scope);
538
538
  };
539
- const render = async (record, current) => {
539
+ const render2 = async (record, current) => {
540
540
  let html = null;
541
541
  if (record?.view) {
542
542
  el.classList.add("v-router-loading");
@@ -557,7 +557,7 @@ defineDirective(
557
557
  const matched = route.matched;
558
558
  void paramsSignature(route.params);
559
559
  const record = findRecord(matched);
560
- void render(record, ++token);
560
+ void render2(record, ++token);
561
561
  });
562
562
  cleanup(() => {
563
563
  token++;
@@ -765,8 +765,8 @@ async function loadMessages(locale, source) {
765
765
  addMessages(locale, source);
766
766
  return;
767
767
  }
768
- const pending = loading.get(locale);
769
- if (pending) return pending;
768
+ const pending2 = loading.get(locale);
769
+ if (pending2) return pending2;
770
770
  const task = http.get(source, { responseType: "json" }).then((data) => {
771
771
  if (data && typeof data === "object") addMessages(locale, data);
772
772
  }).catch((err) => {
@@ -917,8 +917,8 @@ var frameCallbacks = /* @__PURE__ */ new Set();
917
917
  var frameHandle = 0;
918
918
  function runFrame(now) {
919
919
  frameHandle = 0;
920
- const pending = Array.from(frameCallbacks);
921
- for (const callback of pending) {
920
+ const pending2 = Array.from(frameCallbacks);
921
+ for (const callback of pending2) {
922
922
  if (frameCallbacks.has(callback)) callback(now);
923
923
  }
924
924
  if (frameCallbacks.size > 0) frameHandle = requestAnimationFrame(runFrame);
@@ -6497,12 +6497,39 @@ function disableXray() {
6497
6497
  function isXrayEnabled() {
6498
6498
  return enabled;
6499
6499
  }
6500
+ function parseShortcut(text) {
6501
+ const parts = text.toLowerCase().split("+").map((part) => part.trim()).filter(Boolean);
6502
+ if (!parts.length) return null;
6503
+ const key = parts.pop();
6504
+ const shortcut = {
6505
+ ctrl: false,
6506
+ alt: false,
6507
+ shift: false,
6508
+ meta: false,
6509
+ code: /^f\d{1,2}$/.test(key) ? key.toUpperCase() : key.length === 1 && key >= "a" && key <= "z" ? `Key${key.toUpperCase()}` : key.length === 1 && key >= "0" && key <= "9" ? `Digit${key}` : key.charAt(0).toUpperCase() + key.slice(1)
6510
+ };
6511
+ for (const part of parts) {
6512
+ if (part === "ctrl" || part === "control") shortcut.ctrl = true;
6513
+ else if (part === "alt" || part === "option") shortcut.alt = true;
6514
+ else if (part === "shift") shortcut.shift = true;
6515
+ else if (part === "meta" || part === "cmd" || part === "command" || part === "win")
6516
+ shortcut.meta = true;
6517
+ else return null;
6518
+ }
6519
+ return shortcut;
6520
+ }
6500
6521
  function enableXrayShortcut() {
6501
6522
  if (shortcutInstalled || typeof document === "undefined") return;
6502
6523
  shortcutInstalled = true;
6503
6524
  document.addEventListener("keydown", (event) => {
6504
- if (!event.altKey || !event.shiftKey || event.ctrlKey || event.metaKey) return;
6505
- if (event.code !== "KeyV" && event.key !== "V" && event.key !== "v") return;
6525
+ const setting = config.xrayShortcut;
6526
+ if (setting === false) return;
6527
+ const wanted = parseShortcut(typeof setting === "string" ? setting : "ctrl+shift+f2");
6528
+ if (!wanted) return;
6529
+ if (event.ctrlKey !== wanted.ctrl || event.altKey !== wanted.alt || event.shiftKey !== wanted.shift || event.metaKey !== wanted.meta)
6530
+ return;
6531
+ if (event.code !== wanted.code && event.key.toUpperCase() !== wanted.code.replace(/^Key/, ""))
6532
+ return;
6506
6533
  event.preventDefault();
6507
6534
  xray();
6508
6535
  });
@@ -6515,6 +6542,227 @@ function xray(force) {
6515
6542
  return enabled;
6516
6543
  }
6517
6544
 
6545
+ // src/jsx/index.ts
6546
+ var OPAQUE = /* @__PURE__ */ new Set([
6547
+ "SCRIPT",
6548
+ "STYLE",
6549
+ "PRE",
6550
+ "CODE",
6551
+ "SAMP",
6552
+ "KBD",
6553
+ "TEXTAREA",
6554
+ "TEMPLATE",
6555
+ "NOSCRIPT"
6556
+ ]);
6557
+ magic("$__jsx", (scope) => scope);
6558
+ onStart((root, after) => {
6559
+ if (after) activateJsx();
6560
+ else extractJsx(root);
6561
+ });
6562
+ var TEMPLATE = /* @__PURE__ */ Symbol("voodoo.jsx.template");
6563
+ function isTemplate(value) {
6564
+ return typeof value === "object" && value !== null && TEMPLATE in value;
6565
+ }
6566
+ function collect(start2, offset) {
6567
+ const templates = [];
6568
+ const nodes = [];
6569
+ let source = "";
6570
+ let depth = 0;
6571
+ let quote = null;
6572
+ let escaped = false;
6573
+ let node = start2;
6574
+ let index = offset;
6575
+ let closed = false;
6576
+ let tail = null;
6577
+ while (node) {
6578
+ if (node.nodeType === Node.TEXT_NODE) {
6579
+ const text = node.textContent ?? "";
6580
+ for (; index < text.length; index++) {
6581
+ const ch = text[index];
6582
+ if (escaped) {
6583
+ escaped = false;
6584
+ source += ch;
6585
+ continue;
6586
+ }
6587
+ if (quote) {
6588
+ if (ch === "\\") escaped = true;
6589
+ else if (ch === quote) quote = null;
6590
+ source += ch;
6591
+ continue;
6592
+ }
6593
+ if (ch === '"' || ch === "'" || ch === "`") {
6594
+ quote = ch;
6595
+ source += ch;
6596
+ continue;
6597
+ }
6598
+ if (ch === "{") {
6599
+ depth++;
6600
+ if (depth > 1) source += ch;
6601
+ continue;
6602
+ }
6603
+ if (ch === "}") {
6604
+ depth--;
6605
+ if (depth === 0) {
6606
+ index++;
6607
+ closed = true;
6608
+ break;
6609
+ }
6610
+ source += ch;
6611
+ continue;
6612
+ }
6613
+ source += ch;
6614
+ }
6615
+ nodes.push(node);
6616
+ if (closed) {
6617
+ tail = { node, offset: index };
6618
+ break;
6619
+ }
6620
+ } else if (node.nodeType === Node.ELEMENT_NODE) {
6621
+ if (depth === 0) return null;
6622
+ source += `$t(${templates.length}, $__jsx)`;
6623
+ templates.push(node);
6624
+ nodes.push(node);
6625
+ } else {
6626
+ nodes.push(node);
6627
+ }
6628
+ index = 0;
6629
+ node = node.nextSibling;
6630
+ }
6631
+ if (!closed) return null;
6632
+ return { source, templates, nodes, tail };
6633
+ }
6634
+ function render(value, templates, scope, out) {
6635
+ if (value == null || value === false || value === true) return;
6636
+ if (Array.isArray(value)) {
6637
+ for (const item of value) render(item, templates, scope, out);
6638
+ return;
6639
+ }
6640
+ if (isTemplate(value)) {
6641
+ const handle = value;
6642
+ const source = templates[handle.index];
6643
+ const clone2 = source.cloneNode(true);
6644
+ const at = handle.scope ?? scope;
6645
+ applyRegions(clone2, at);
6646
+ activateJsx();
6647
+ walk(clone2, at);
6648
+ out.push(clone2);
6649
+ return;
6650
+ }
6651
+ out.push(document.createTextNode(String(value)));
6652
+ }
6653
+ function applyRegions(root, parentScope) {
6654
+ if (OPAQUE.has(root.tagName)) return;
6655
+ const scope = parentScope ?? findScope(root);
6656
+ let child = root.firstChild;
6657
+ while (child) {
6658
+ const next = child.nextSibling;
6659
+ if (child.nodeType === Node.ELEMENT_NODE) {
6660
+ applyRegions(child, getScope(child) ?? scope);
6661
+ child = next;
6662
+ continue;
6663
+ }
6664
+ if (child.nodeType !== Node.TEXT_NODE) {
6665
+ child = next;
6666
+ continue;
6667
+ }
6668
+ const text = child.textContent ?? "";
6669
+ const open = text.indexOf("{");
6670
+ if (open < 0) {
6671
+ child = next;
6672
+ continue;
6673
+ }
6674
+ const collected = collect(child, open);
6675
+ if (!collected || collected.templates.length === 0) {
6676
+ child = next;
6677
+ continue;
6678
+ }
6679
+ install(root, collected, scope);
6680
+ child = collected.nodes[collected.nodes.length - 1]?.nextSibling;
6681
+ }
6682
+ }
6683
+ var pending = [];
6684
+ function install(parent, collected, hint) {
6685
+ const { source, templates, nodes, tail } = collected;
6686
+ let ast;
6687
+ try {
6688
+ ast = parse(source);
6689
+ } catch (error) {
6690
+ if (config.devtools) {
6691
+ console.warn(`[Voodoo] could not parse the inline expression: ${source}`, error);
6692
+ }
6693
+ return;
6694
+ }
6695
+ if (tail && tail.offset < (tail.node.textContent ?? "").length) {
6696
+ tail.node.splitText(tail.offset);
6697
+ }
6698
+ const anchor = document.createComment("v-jsx");
6699
+ parent.insertBefore(anchor, nodes[0]);
6700
+ for (const node of nodes) node.remove();
6701
+ let rendered = [];
6702
+ pending.push(() => activateRegion());
6703
+ function activateRegion() {
6704
+ const found = findScope(anchor);
6705
+ const scope = found === rootScope && hint ? hint : found;
6706
+ const local = scope.child({
6707
+ $t: (index, at) => ({ [TEMPLATE]: true, index, scope: at })
6708
+ });
6709
+ const runner = effect(() => {
6710
+ const value = unwrap(evaluate(ast, local));
6711
+ const out = [];
6712
+ render(value, templates, local, out);
6713
+ for (const node of rendered) node.remove();
6714
+ rendered = out;
6715
+ for (const node of out) parent.insertBefore(node, anchor);
6716
+ });
6717
+ addCleanup(anchor, () => {
6718
+ runner.effect.stop();
6719
+ for (const node of rendered) node.remove();
6720
+ });
6721
+ }
6722
+ }
6723
+ function readDeclarationBlock(root = document.body) {
6724
+ for (const node of Array.from(root.childNodes)) {
6725
+ if (node.nodeType !== Node.TEXT_NODE) continue;
6726
+ const text = (node.textContent ?? "").trim();
6727
+ if (!text.startsWith("{") || !text.endsWith("}")) continue;
6728
+ if (!/\b(const|let|var)\s/.test(text)) continue;
6729
+ const body = text.slice(1, -1).replace(/\b(?:const|let|var)\s+/g, "");
6730
+ const data = reactive({});
6731
+ try {
6732
+ evaluate(parse(body), new Scope(data));
6733
+ } catch (error) {
6734
+ if (config.devtools) {
6735
+ console.warn("[Voodoo] could not read the declaration block", error);
6736
+ }
6737
+ return null;
6738
+ }
6739
+ node.remove();
6740
+ return data;
6741
+ }
6742
+ return null;
6743
+ }
6744
+ function activateJsx() {
6745
+ const work = pending.splice(0, pending.length);
6746
+ for (const run of work) {
6747
+ try {
6748
+ run();
6749
+ } catch (error) {
6750
+ console.error("[Voodoo] a JSX region failed to render", error);
6751
+ }
6752
+ }
6753
+ }
6754
+ function extractJsx(root = document.body) {
6755
+ const data = readDeclarationBlock(root);
6756
+ if (data) {
6757
+ Object.assign(rootScope.data, data);
6758
+ }
6759
+ applyRegions(root, findScope(root));
6760
+ }
6761
+ function jsx(root = document.body) {
6762
+ extractJsx(root);
6763
+ activateJsx();
6764
+ }
6765
+
6518
6766
  // src/devtools/launcher.ts
6519
6767
  var POSITION_KEY = "voodoo:devtools:widget-position";
6520
6768
  var HIDDEN_KEY = "voodoo:devtools:widget-hidden";
@@ -6694,9 +6942,9 @@ function build() {
6694
6942
  const button = document.createElement("button");
6695
6943
  button.type = "button";
6696
6944
  button.className = "v-devtools-btn";
6697
- button.setAttribute("aria-label", "Open Voodoo devtools (Alt+Shift+V)");
6945
+ button.setAttribute("aria-label", "Open Voodoo devtools (Ctrl+Shift+F2)");
6698
6946
  button.setAttribute("aria-pressed", "false");
6699
- button.title = "Voodoo devtools \u2014 click to inspect, drag to move (Alt+Shift+V)";
6947
+ button.title = "Voodoo devtools \u2014 click to inspect, drag to move (Ctrl+Shift+F2)";
6700
6948
  button.innerHTML = MARK;
6701
6949
  const label = document.createElement("span");
6702
6950
  label.className = "v-devtools-label";
@@ -6885,6 +7133,9 @@ Object.assign(V, core, {
6885
7133
  query,
6886
7134
  ready: ready2,
6887
7135
  fromHtml,
7136
+ jsx,
7137
+ extractJsx,
7138
+ activateJsx,
6888
7139
  Collection: VoodooCollection,
6889
7140
  // Routes
6890
7141
  router,
@@ -6944,6 +7195,6 @@ Object.assign(V, core, {
6944
7195
  });
6945
7196
  var src_default = V;
6946
7197
 
6947
- export { V, animate, charts, src_default as default, devtoolsWidget, disableXray, easings, enableXray, getLocale, i18n, inView, isDevtoolsWidgetMounted, isXrayEnabled, motionPresets, mountDevtoolsWidget, navigate, renderChart, route, router, scrollProgress, setLocale, spring, stagger, t, unmountDevtoolsWidget, xray };
7198
+ export { V, activateJsx, animate, applyRegions, charts, src_default as default, devtoolsWidget, disableXray, easings, enableXray, extractJsx, getLocale, i18n, inView, isDevtoolsWidgetMounted, isXrayEnabled, jsx, motionPresets, mountDevtoolsWidget, navigate, readDeclarationBlock, renderChart, route, router, scrollProgress, setLocale, spring, stagger, t, unmountDevtoolsWidget, xray };
6948
7199
  //# sourceMappingURL=index.js.map
6949
7200
  //# sourceMappingURL=index.js.map