sibujs 4.5.0 → 4.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.
Files changed (109) hide show
  1. package/dist/browser.cjs +309 -129
  2. package/dist/browser.d.cts +46 -14
  3. package/dist/browser.d.ts +46 -14
  4. package/dist/browser.js +8 -6
  5. package/dist/build.cjs +184 -72
  6. package/dist/build.js +15 -16
  7. package/dist/cdn.dev.global.js +12 -12
  8. package/dist/cdn.full.dev.global.js +11 -11
  9. package/dist/cdn.full.global.js +10 -10
  10. package/dist/cdn.global.js +12 -12
  11. package/dist/{chunk-IXKSNWV5.js → chunk-2INLLLMZ.js} +1 -1
  12. package/dist/chunk-3ISI6ACU.js +44 -0
  13. package/dist/{chunk-ONOHFDLG.js → chunk-47M47FOM.js} +3 -3
  14. package/dist/chunk-5HZXGZ6T.js +24 -0
  15. package/dist/{chunk-KKLW7YWL.js → chunk-5MT6SJ3P.js} +275 -144
  16. package/dist/{chunk-UGRX3S57.js → chunk-5Q4R7HCL.js} +12 -3
  17. package/dist/{chunk-S373NSMK.js → chunk-7GQCWFOE.js} +150 -59
  18. package/dist/{chunk-FTIR4QW2.js → chunk-7NCARGJW.js} +6 -8
  19. package/dist/{chunk-5DXA2J44.js → chunk-7XHATCIH.js} +5 -2
  20. package/dist/{chunk-VZKNK2V7.js → chunk-AIF3Z2T7.js} +296 -38
  21. package/dist/{chunk-4PMLNECI.js → chunk-BAAG6ZTI.js} +98 -29
  22. package/dist/{chunk-XZZOBQAY.js → chunk-D33YTSX5.js} +2 -2
  23. package/dist/{chunk-TBYTO6BS.js → chunk-DKGBBKOF.js} +136 -80
  24. package/dist/{chunk-NIOYEGBQ.js → chunk-HURREPU2.js} +27 -13
  25. package/dist/{chunk-GW3SCCZG.js → chunk-HYXDKS4N.js} +153 -110
  26. package/dist/chunk-J6FW5TV6.js +233 -0
  27. package/dist/{chunk-PCT43HW3.js → chunk-JSXPZCET.js} +1 -1
  28. package/dist/chunk-NYNYSPK7.js +318 -0
  29. package/dist/{chunk-RJE2BNI4.js → chunk-ORMZXBKQ.js} +108 -45
  30. package/dist/{chunk-OMJJM3KM.js → chunk-OXUY2A6L.js} +287 -130
  31. package/dist/{chunk-3JZ4L5TJ.js → chunk-PK6FK2G2.js} +181 -66
  32. package/dist/{chunk-RBTPLM32.js → chunk-QE4TTDU3.js} +2 -2
  33. package/dist/{chunk-2DCGACUU.js → chunk-SXXVZMKZ.js} +251 -66
  34. package/dist/{chunk-R25EFXXC.js → chunk-TUCPL2HB.js} +3 -3
  35. package/dist/{chunk-7LN645I6.js → chunk-UZQ6ALFS.js} +3 -3
  36. package/dist/{chunk-KEISJXBU.js → chunk-VVWPJ543.js} +6 -8
  37. package/dist/{chunk-RIXRAYIU.js → chunk-XC4MEKGA.js} +3 -3
  38. package/dist/{chunk-B3WHI2QA.js → chunk-XRRZKZYX.js} +55 -31
  39. package/dist/{contracts-DBdg9J_a.d.cts → contracts-DRIuclVT.d.cts} +10 -2
  40. package/dist/{contracts-DBdg9J_a.d.ts → contracts-DRIuclVT.d.ts} +10 -2
  41. package/dist/{customElement-OB9CIsc5.d.cts → customElement-MmInOW1U.d.cts} +21 -0
  42. package/dist/{customElement-OB9CIsc5.d.ts → customElement-MmInOW1U.d.ts} +21 -0
  43. package/dist/data.cjs +213 -117
  44. package/dist/data.d.cts +47 -9
  45. package/dist/data.d.ts +47 -9
  46. package/dist/data.js +12 -9
  47. package/dist/devtools.cjs +81 -57
  48. package/dist/devtools.js +7 -8
  49. package/dist/dispose-GEIG2KOF.js +28 -0
  50. package/dist/ecosystem.cjs +309 -104
  51. package/dist/ecosystem.d.cts +19 -3
  52. package/dist/ecosystem.d.ts +19 -3
  53. package/dist/ecosystem.js +12 -12
  54. package/dist/extras.cjs +2133 -863
  55. package/dist/extras.d.cts +10 -9
  56. package/dist/extras.d.ts +10 -9
  57. package/dist/extras.js +39 -28
  58. package/dist/index.cjs +184 -72
  59. package/dist/index.d.cts +22 -5
  60. package/dist/index.d.ts +22 -5
  61. package/dist/index.js +24 -27
  62. package/dist/motion.cjs +107 -41
  63. package/dist/motion.js +5 -5
  64. package/dist/patterns.cjs +317 -39
  65. package/dist/patterns.d.cts +27 -9
  66. package/dist/patterns.d.ts +27 -9
  67. package/dist/patterns.js +8 -8
  68. package/dist/performance.cjs +308 -216
  69. package/dist/performance.d.cts +2 -2
  70. package/dist/performance.d.ts +2 -2
  71. package/dist/performance.js +8 -9
  72. package/dist/plugin-DVgSnTfK.d.cts +112 -0
  73. package/dist/plugin-DVgSnTfK.d.ts +112 -0
  74. package/dist/plugins.cjs +549 -202
  75. package/dist/plugins.d.cts +3 -3
  76. package/dist/plugins.d.ts +3 -3
  77. package/dist/plugins.js +35 -23
  78. package/dist/signal-EotCj4hS.d.cts +110 -0
  79. package/dist/signal-EotCj4hS.d.ts +110 -0
  80. package/dist/{ssr-BiPRdZ6n.d.cts → ssr-Bli9XRW5.d.cts} +5 -0
  81. package/dist/{ssr-BiPRdZ6n.d.ts → ssr-Bli9XRW5.d.ts} +5 -0
  82. package/dist/{ssr-Y7XOEPEN.js → ssr-XOTUASDO.js} +4 -5
  83. package/dist/ssr.cjs +176 -72
  84. package/dist/ssr.d.cts +9 -3
  85. package/dist/ssr.d.ts +9 -3
  86. package/dist/ssr.js +11 -12
  87. package/dist/{startup-BMpaiMhP.d.ts → startup-BLfSeL15.d.cts} +73 -22
  88. package/dist/{startup-BMpaiMhP.d.cts → startup-BLfSeL15.d.ts} +73 -22
  89. package/dist/{tagFactory-DVoDpHye.d.ts → tagFactory-DFstCLQV.d.cts} +2 -100
  90. package/dist/{tagFactory-DVoDpHye.d.cts → tagFactory-DkaNVUNV.d.ts} +2 -100
  91. package/dist/testing.cjs +2484 -2185
  92. package/dist/testing.d.cts +56 -5
  93. package/dist/testing.d.ts +56 -5
  94. package/dist/testing.js +580 -307
  95. package/dist/ui.cjs +707 -317
  96. package/dist/ui.d.cts +40 -7
  97. package/dist/ui.d.ts +40 -7
  98. package/dist/ui.js +151 -56
  99. package/dist/widgets.cjs +246 -278
  100. package/dist/widgets.js +9 -10
  101. package/package.json +1 -1
  102. package/dist/chunk-2WLZ6757.js +0 -149
  103. package/dist/chunk-CCSJMTRN.js +0 -15
  104. package/dist/chunk-QKRPLZ2V.js +0 -108
  105. package/dist/chunk-VUF4ALSW.js +0 -60
  106. package/dist/chunk-WWV3SJ3L.js +0 -131
  107. package/dist/dispose-46BOMMQJ.js +0 -19
  108. package/dist/plugin-D30wlGW5.d.cts +0 -71
  109. package/dist/plugin-D30wlGW5.d.ts +0 -71
@@ -160,15 +160,6 @@ declare function draggable(element: ElementTarget, data?: unknown): {
160
160
  isDragging: () => boolean;
161
161
  dispose: () => void;
162
162
  };
163
- /**
164
- * dropZone turns an element into a drop zone and tracks drag-over state.
165
- * Listens for dragenter, dragleave, dragover, and drop events.
166
- * Calls options.onDrop with the parsed data payload and the DragEvent.
167
- *
168
- * @param element Reactive getter or ref returning the HTMLElement to use as drop zone (or null)
169
- * @param options Object with onDrop callback receiving the transferred data and event
170
- * @returns Object with reactive isOver getter and dispose function
171
- */
172
163
  declare function dropZone(element: ElementTarget, options: {
173
164
  onDrop: (data: unknown, event: DragEvent) => void;
174
165
  }): {
@@ -218,9 +209,11 @@ declare function colorScheme(): {
218
209
  declare function formatNumber(value: number, options?: Intl.NumberFormatOptions & {
219
210
  locale?: string;
220
211
  }): string;
221
- declare function formatCurrency(value: number, currency: string, options?: Intl.NumberFormatOptions & {
212
+ /** Options for {@link formatCurrency}: any `Intl.NumberFormat` option except the ones it fixes. */
213
+ type CurrencyFormatOptions = Omit<Intl.NumberFormatOptions, "style" | "currency"> & {
222
214
  locale?: string;
223
- }): string;
215
+ };
216
+ declare function formatCurrency(value: number, currency: string, options?: CurrencyFormatOptions): string;
224
217
 
225
218
  /**
226
219
  * visibility tracks the document's Page Visibility state.
@@ -384,6 +377,15 @@ declare function windowSize(): {
384
377
  interface UrlStateOptions {
385
378
  /** Use `replaceState` instead of `pushState`. Default: false */
386
379
  replace?: boolean;
380
+ /**
381
+ * The history entry's state. When omitted, the current `history.state` is
382
+ * kept — on a replaced entry and carried forward onto a pushed one — so router
383
+ * metadata, scroll restoration data and application state are not erased. A
384
+ * pushed entry does not inherit `scrollRestoration()`'s entry identity
385
+ * (`__sibuScrollKey`), which belongs to the entry it was set on.
386
+ * Pass it (including `null`) only to set new state deliberately.
387
+ */
388
+ state?: unknown;
387
389
  }
388
390
  declare function urlState(): {
389
391
  params: () => URLSearchParams;
@@ -410,6 +412,9 @@ declare function urlState(): {
410
412
  * the local `last()` signal — BroadcastChannel doesn't deliver to its own
411
413
  * sender, matching the browser's native behavior.
412
414
  *
415
+ * After `dispose()`, `post()` is a no-op and `last()` no longer changes;
416
+ * `dispose()` may be called repeatedly.
417
+ *
413
418
  * @param channelName Name of the broadcast channel
414
419
  * @returns `{ last, post, dispose }`
415
420
  *
@@ -652,11 +657,27 @@ interface SpeakOptions {
652
657
  /** Voice name (match against `getVoices()[i].name`). */
653
658
  voice?: string;
654
659
  }
660
+ /**
661
+ * Reset the shared queue. Intended for tests only.
662
+ *
663
+ * @internal
664
+ */
665
+ declare function __resetSpeechCoordinator(): void;
655
666
  /**
656
667
  * speech wraps the Web Speech Synthesis API as a reactive controller.
657
668
  * Exposes `speaking` / `paused` reactive booleans plus `speak()`, `pause()`,
658
669
  * `resume()`, `cancel()` actions.
659
670
  *
671
+ * Controllers are isolated from each other: utterances from every controller
672
+ * play in order, one at a time, and `cancel()`, `pause()`, `resume()` and
673
+ * `dispose()` affect only this controller's utterances. The native
674
+ * `speechSynthesis` queue is paused, resumed or cancelled only while one of this
675
+ * controller's utterances is the one being spoken — and native cancellation
676
+ * also drops utterances queued directly on `speechSynthesis` by other code.
677
+ *
678
+ * - `speaking()` — this controller has an utterance playing or waiting.
679
+ * - `paused()` — this controller is paused; its waiting utterances do not start.
680
+ *
660
681
  * Automatically gracefully degrades on runtimes without `speechSynthesis`.
661
682
  *
662
683
  * @example
@@ -731,7 +752,15 @@ declare function gamepad(): {
731
752
  */
732
753
  declare function pointerLock(): {
733
754
  locked: () => boolean;
734
- request: (element: Element) => void;
755
+ /**
756
+ * Request pointer lock on `element`. Resolves once the browser grants it and
757
+ * rejects with the browser's own error (e.g. missing user activation), so the
758
+ * failure can be caught and shown. Resolves without doing anything when the
759
+ * element has no Pointer Lock support (e.g. iOS Safari) or during SSR, so a
760
+ * fire-and-forget `onclick: () => lock.request(el)` never raises an unhandled
761
+ * rejection there; check `locked()` to see whether the lock took effect.
762
+ */
763
+ request: (element: Element) => Promise<void>;
735
764
  exit: () => void;
736
765
  dispose: () => void;
737
766
  };
@@ -829,7 +858,10 @@ interface ImageLoaderState {
829
858
  width: () => number;
830
859
  /** Intrinsic height, 0 until loaded. */
831
860
  height: () => number;
832
- /** Abort in-flight load and reset state. */
861
+ /**
862
+ * Stop tracking `src`, best-effort cancel an in-flight load (its result is
863
+ * ignored either way), and reset every signal to its initial value.
864
+ */
833
865
  dispose: () => void;
834
866
  }
835
867
  /**
@@ -853,4 +885,4 @@ interface ImageLoaderState {
853
885
  */
854
886
  declare function imageLoader(src: string | (() => string)): ImageLoaderState;
855
887
 
856
- export { type AnimationFrameOptions, type BoundsRect, type GamepadSnapshot, type ImageLoaderState, type KeyboardOptions, type MouseOptions, type MutationObserverOptions, type SpeakOptions, type SwipeDirection, type SwipeOptions, type TextSelectionState, type UrlStateOptions, animationFrame, battery, bounds, broadcast, clipboard, colorScheme, draggable, dropZone, favicon, formatCurrency, formatNumber, fullscreen, gamepad, geo, idle, imageLoader, keyboard, media, mouse, mutationObserver, network, online, permissions, pointerLock, resize, scroll, speech, svgFavicon, swipe, textSelection, title, urlState, vibrate, visibility, wakeLock, windowSize };
888
+ export { type AnimationFrameOptions, type BoundsRect, type CurrencyFormatOptions, type GamepadSnapshot, type ImageLoaderState, type KeyboardOptions, type MouseOptions, type MutationObserverOptions, type SpeakOptions, type SwipeDirection, type SwipeOptions, type TextSelectionState, type UrlStateOptions, __resetSpeechCoordinator, animationFrame, battery, bounds, broadcast, clipboard, colorScheme, draggable, dropZone, favicon, formatCurrency, formatNumber, fullscreen, gamepad, geo, idle, imageLoader, keyboard, media, mouse, mutationObserver, network, online, permissions, pointerLock, resize, scroll, speech, svgFavicon, swipe, textSelection, title, urlState, vibrate, visibility, wakeLock, windowSize };
package/dist/browser.d.ts CHANGED
@@ -160,15 +160,6 @@ declare function draggable(element: ElementTarget, data?: unknown): {
160
160
  isDragging: () => boolean;
161
161
  dispose: () => void;
162
162
  };
163
- /**
164
- * dropZone turns an element into a drop zone and tracks drag-over state.
165
- * Listens for dragenter, dragleave, dragover, and drop events.
166
- * Calls options.onDrop with the parsed data payload and the DragEvent.
167
- *
168
- * @param element Reactive getter or ref returning the HTMLElement to use as drop zone (or null)
169
- * @param options Object with onDrop callback receiving the transferred data and event
170
- * @returns Object with reactive isOver getter and dispose function
171
- */
172
163
  declare function dropZone(element: ElementTarget, options: {
173
164
  onDrop: (data: unknown, event: DragEvent) => void;
174
165
  }): {
@@ -218,9 +209,11 @@ declare function colorScheme(): {
218
209
  declare function formatNumber(value: number, options?: Intl.NumberFormatOptions & {
219
210
  locale?: string;
220
211
  }): string;
221
- declare function formatCurrency(value: number, currency: string, options?: Intl.NumberFormatOptions & {
212
+ /** Options for {@link formatCurrency}: any `Intl.NumberFormat` option except the ones it fixes. */
213
+ type CurrencyFormatOptions = Omit<Intl.NumberFormatOptions, "style" | "currency"> & {
222
214
  locale?: string;
223
- }): string;
215
+ };
216
+ declare function formatCurrency(value: number, currency: string, options?: CurrencyFormatOptions): string;
224
217
 
225
218
  /**
226
219
  * visibility tracks the document's Page Visibility state.
@@ -384,6 +377,15 @@ declare function windowSize(): {
384
377
  interface UrlStateOptions {
385
378
  /** Use `replaceState` instead of `pushState`. Default: false */
386
379
  replace?: boolean;
380
+ /**
381
+ * The history entry's state. When omitted, the current `history.state` is
382
+ * kept — on a replaced entry and carried forward onto a pushed one — so router
383
+ * metadata, scroll restoration data and application state are not erased. A
384
+ * pushed entry does not inherit `scrollRestoration()`'s entry identity
385
+ * (`__sibuScrollKey`), which belongs to the entry it was set on.
386
+ * Pass it (including `null`) only to set new state deliberately.
387
+ */
388
+ state?: unknown;
387
389
  }
388
390
  declare function urlState(): {
389
391
  params: () => URLSearchParams;
@@ -410,6 +412,9 @@ declare function urlState(): {
410
412
  * the local `last()` signal — BroadcastChannel doesn't deliver to its own
411
413
  * sender, matching the browser's native behavior.
412
414
  *
415
+ * After `dispose()`, `post()` is a no-op and `last()` no longer changes;
416
+ * `dispose()` may be called repeatedly.
417
+ *
413
418
  * @param channelName Name of the broadcast channel
414
419
  * @returns `{ last, post, dispose }`
415
420
  *
@@ -652,11 +657,27 @@ interface SpeakOptions {
652
657
  /** Voice name (match against `getVoices()[i].name`). */
653
658
  voice?: string;
654
659
  }
660
+ /**
661
+ * Reset the shared queue. Intended for tests only.
662
+ *
663
+ * @internal
664
+ */
665
+ declare function __resetSpeechCoordinator(): void;
655
666
  /**
656
667
  * speech wraps the Web Speech Synthesis API as a reactive controller.
657
668
  * Exposes `speaking` / `paused` reactive booleans plus `speak()`, `pause()`,
658
669
  * `resume()`, `cancel()` actions.
659
670
  *
671
+ * Controllers are isolated from each other: utterances from every controller
672
+ * play in order, one at a time, and `cancel()`, `pause()`, `resume()` and
673
+ * `dispose()` affect only this controller's utterances. The native
674
+ * `speechSynthesis` queue is paused, resumed or cancelled only while one of this
675
+ * controller's utterances is the one being spoken — and native cancellation
676
+ * also drops utterances queued directly on `speechSynthesis` by other code.
677
+ *
678
+ * - `speaking()` — this controller has an utterance playing or waiting.
679
+ * - `paused()` — this controller is paused; its waiting utterances do not start.
680
+ *
660
681
  * Automatically gracefully degrades on runtimes without `speechSynthesis`.
661
682
  *
662
683
  * @example
@@ -731,7 +752,15 @@ declare function gamepad(): {
731
752
  */
732
753
  declare function pointerLock(): {
733
754
  locked: () => boolean;
734
- request: (element: Element) => void;
755
+ /**
756
+ * Request pointer lock on `element`. Resolves once the browser grants it and
757
+ * rejects with the browser's own error (e.g. missing user activation), so the
758
+ * failure can be caught and shown. Resolves without doing anything when the
759
+ * element has no Pointer Lock support (e.g. iOS Safari) or during SSR, so a
760
+ * fire-and-forget `onclick: () => lock.request(el)` never raises an unhandled
761
+ * rejection there; check `locked()` to see whether the lock took effect.
762
+ */
763
+ request: (element: Element) => Promise<void>;
735
764
  exit: () => void;
736
765
  dispose: () => void;
737
766
  };
@@ -829,7 +858,10 @@ interface ImageLoaderState {
829
858
  width: () => number;
830
859
  /** Intrinsic height, 0 until loaded. */
831
860
  height: () => number;
832
- /** Abort in-flight load and reset state. */
861
+ /**
862
+ * Stop tracking `src`, best-effort cancel an in-flight load (its result is
863
+ * ignored either way), and reset every signal to its initial value.
864
+ */
833
865
  dispose: () => void;
834
866
  }
835
867
  /**
@@ -853,4 +885,4 @@ interface ImageLoaderState {
853
885
  */
854
886
  declare function imageLoader(src: string | (() => string)): ImageLoaderState;
855
887
 
856
- export { type AnimationFrameOptions, type BoundsRect, type GamepadSnapshot, type ImageLoaderState, type KeyboardOptions, type MouseOptions, type MutationObserverOptions, type SpeakOptions, type SwipeDirection, type SwipeOptions, type TextSelectionState, type UrlStateOptions, animationFrame, battery, bounds, broadcast, clipboard, colorScheme, draggable, dropZone, favicon, formatCurrency, formatNumber, fullscreen, gamepad, geo, idle, imageLoader, keyboard, media, mouse, mutationObserver, network, online, permissions, pointerLock, resize, scroll, speech, svgFavicon, swipe, textSelection, title, urlState, vibrate, visibility, wakeLock, windowSize };
888
+ export { type AnimationFrameOptions, type BoundsRect, type CurrencyFormatOptions, type GamepadSnapshot, type ImageLoaderState, type KeyboardOptions, type MouseOptions, type MutationObserverOptions, type SpeakOptions, type SwipeDirection, type SwipeOptions, type TextSelectionState, type UrlStateOptions, __resetSpeechCoordinator, animationFrame, battery, bounds, broadcast, clipboard, colorScheme, draggable, dropZone, favicon, formatCurrency, formatNumber, fullscreen, gamepad, geo, idle, imageLoader, keyboard, media, mouse, mutationObserver, network, online, permissions, pointerLock, resize, scroll, speech, svgFavicon, swipe, textSelection, title, urlState, vibrate, visibility, wakeLock, windowSize };
package/dist/browser.js CHANGED
@@ -1,4 +1,5 @@
1
1
  import {
2
+ __resetSpeechCoordinator,
2
3
  animationFrame,
3
4
  battery,
4
5
  bounds,
@@ -35,16 +36,17 @@ import {
35
36
  visibility,
36
37
  wakeLock,
37
38
  windowSize
38
- } from "./chunk-OMJJM3KM.js";
39
+ } from "./chunk-OXUY2A6L.js";
39
40
  import "./chunk-H3SRKIYX.js";
40
41
  import "./chunk-52XFPGSN.js";
41
42
  import "./chunk-7ZHH77QA.js";
42
- import "./chunk-RIXRAYIU.js";
43
- import "./chunk-5DXA2J44.js";
44
- import "./chunk-XZZOBQAY.js";
45
- import "./chunk-UGRX3S57.js";
46
- import "./chunk-2WLZ6757.js";
43
+ import "./chunk-XC4MEKGA.js";
44
+ import "./chunk-7XHATCIH.js";
45
+ import "./chunk-D33YTSX5.js";
46
+ import "./chunk-5Q4R7HCL.js";
47
+ import "./chunk-NYNYSPK7.js";
47
48
  export {
49
+ __resetSpeechCoordinator,
48
50
  animationFrame,
49
51
  battery,
50
52
  bounds,