sibujs 4.4.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 (112) hide show
  1. package/README.md +11 -0
  2. package/dist/browser.cjs +339 -130
  3. package/dist/browser.d.cts +61 -16
  4. package/dist/browser.d.ts +61 -16
  5. package/dist/browser.js +8 -6
  6. package/dist/build.cjs +273 -82
  7. package/dist/build.js +15 -16
  8. package/dist/cdn.dev.global.js +12 -12
  9. package/dist/cdn.full.dev.global.js +11 -11
  10. package/dist/cdn.full.global.js +10 -10
  11. package/dist/cdn.global.js +12 -12
  12. package/dist/{chunk-IXKSNWV5.js → chunk-2INLLLMZ.js} +1 -1
  13. package/dist/chunk-3ISI6ACU.js +44 -0
  14. package/dist/{chunk-VCTAEPSB.js → chunk-47M47FOM.js} +11 -3
  15. package/dist/chunk-5HZXGZ6T.js +24 -0
  16. package/dist/{chunk-KKLW7YWL.js → chunk-5MT6SJ3P.js} +275 -144
  17. package/dist/{chunk-3BTTCZ5J.js → chunk-5Q4R7HCL.js} +42 -4
  18. package/dist/{chunk-ADM46X22.js → chunk-7GQCWFOE.js} +157 -61
  19. package/dist/{chunk-4Z3SPQ67.js → chunk-7NCARGJW.js} +16 -8
  20. package/dist/{chunk-5DXA2J44.js → chunk-7XHATCIH.js} +5 -2
  21. package/dist/{chunk-LQFGQNMV.js → chunk-AIF3Z2T7.js} +302 -39
  22. package/dist/{chunk-UCALUKB5.js → chunk-BAAG6ZTI.js} +98 -29
  23. package/dist/{chunk-NVNJH22U.js → chunk-D33YTSX5.js} +2 -2
  24. package/dist/{chunk-M2F7TZHH.js → chunk-DKGBBKOF.js} +136 -80
  25. package/dist/{chunk-NIOYEGBQ.js → chunk-HURREPU2.js} +27 -13
  26. package/dist/{chunk-HFCOH2GN.js → chunk-HYXDKS4N.js} +153 -110
  27. package/dist/chunk-J6FW5TV6.js +233 -0
  28. package/dist/{chunk-36S2YPP4.js → chunk-JSXPZCET.js} +1 -1
  29. package/dist/chunk-NYNYSPK7.js +318 -0
  30. package/dist/{chunk-HQSEH5F6.js → chunk-ORMZXBKQ.js} +108 -45
  31. package/dist/{chunk-LYVUX7NT.js → chunk-OXUY2A6L.js} +287 -130
  32. package/dist/{chunk-6GSIXTWX.js → chunk-PK6FK2G2.js} +187 -66
  33. package/dist/{chunk-W2EQ7X2L.js → chunk-QE4TTDU3.js} +47 -9
  34. package/dist/{chunk-XLO7SLIX.js → chunk-SXXVZMKZ.js} +262 -70
  35. package/dist/{chunk-R25EFXXC.js → chunk-TUCPL2HB.js} +3 -3
  36. package/dist/{chunk-RR7M3FHM.js → chunk-UZQ6ALFS.js} +3 -3
  37. package/dist/{chunk-PNIRUQ4C.js → chunk-VVWPJ543.js} +6 -8
  38. package/dist/{chunk-7GIHSAWB.js → chunk-XC4MEKGA.js} +3 -3
  39. package/dist/{chunk-SKPTERHP.js → chunk-XRRZKZYX.js} +55 -31
  40. package/dist/{contracts-DBdg9J_a.d.cts → contracts-DRIuclVT.d.cts} +10 -2
  41. package/dist/{contracts-DBdg9J_a.d.ts → contracts-DRIuclVT.d.ts} +10 -2
  42. package/dist/{customElement-CNZxEB9G.d.ts → customElement-MmInOW1U.d.cts} +59 -10
  43. package/dist/{customElement-CNZxEB9G.d.cts → customElement-MmInOW1U.d.ts} +59 -10
  44. package/dist/data.cjs +293 -125
  45. package/dist/data.d.cts +47 -9
  46. package/dist/data.d.ts +47 -9
  47. package/dist/data.js +12 -9
  48. package/dist/devtools.cjs +121 -58
  49. package/dist/devtools.js +7 -8
  50. package/dist/dispose-GEIG2KOF.js +28 -0
  51. package/dist/ecosystem.cjs +391 -112
  52. package/dist/ecosystem.d.cts +31 -7
  53. package/dist/ecosystem.d.ts +31 -7
  54. package/dist/ecosystem.js +12 -12
  55. package/dist/extras.cjs +2250 -879
  56. package/dist/extras.d.cts +10 -9
  57. package/dist/extras.d.ts +10 -9
  58. package/dist/extras.js +39 -28
  59. package/dist/index.cjs +273 -82
  60. package/dist/index.d.cts +44 -154
  61. package/dist/index.d.ts +44 -154
  62. package/dist/index.js +24 -27
  63. package/dist/motion.cjs +137 -42
  64. package/dist/motion.js +5 -5
  65. package/dist/patterns.cjs +397 -48
  66. package/dist/patterns.d.cts +32 -9
  67. package/dist/patterns.d.ts +32 -9
  68. package/dist/patterns.js +8 -8
  69. package/dist/performance.cjs +338 -217
  70. package/dist/performance.d.cts +2 -2
  71. package/dist/performance.d.ts +2 -2
  72. package/dist/performance.js +8 -9
  73. package/dist/plugin-DVgSnTfK.d.cts +112 -0
  74. package/dist/plugin-DVgSnTfK.d.ts +112 -0
  75. package/dist/plugins.cjs +587 -203
  76. package/dist/plugins.d.cts +3 -3
  77. package/dist/plugins.d.ts +3 -3
  78. package/dist/plugins.js +35 -23
  79. package/dist/signal-EotCj4hS.d.cts +110 -0
  80. package/dist/signal-EotCj4hS.d.ts +110 -0
  81. package/dist/{ssr-BiPRdZ6n.d.cts → ssr-Bli9XRW5.d.cts} +5 -0
  82. package/dist/{ssr-BiPRdZ6n.d.ts → ssr-Bli9XRW5.d.ts} +5 -0
  83. package/dist/{ssr-Y7XOEPEN.js → ssr-XOTUASDO.js} +4 -5
  84. package/dist/ssr.cjs +214 -73
  85. package/dist/ssr.d.cts +9 -3
  86. package/dist/ssr.d.ts +9 -3
  87. package/dist/ssr.js +11 -12
  88. package/dist/{startup-BMpaiMhP.d.ts → startup-BLfSeL15.d.cts} +73 -22
  89. package/dist/{startup-BMpaiMhP.d.cts → startup-BLfSeL15.d.ts} +73 -22
  90. package/dist/tagFactory-DFstCLQV.d.cts +117 -0
  91. package/dist/tagFactory-DkaNVUNV.d.ts +117 -0
  92. package/dist/testing.cjs +2481 -2153
  93. package/dist/testing.d.cts +56 -5
  94. package/dist/testing.d.ts +56 -5
  95. package/dist/testing.js +580 -307
  96. package/dist/ui.cjs +798 -328
  97. package/dist/ui.d.cts +40 -7
  98. package/dist/ui.d.ts +40 -7
  99. package/dist/ui.js +151 -56
  100. package/dist/widgets.cjs +319 -285
  101. package/dist/widgets.js +9 -10
  102. package/package.json +2 -2
  103. package/dist/chunk-2WLZ6757.js +0 -149
  104. package/dist/chunk-7NBDXVHS.js +0 -60
  105. package/dist/chunk-CCSJMTRN.js +0 -15
  106. package/dist/chunk-QKRPLZ2V.js +0 -108
  107. package/dist/chunk-WWV3SJ3L.js +0 -131
  108. package/dist/dispose-46BOMMQJ.js +0 -19
  109. package/dist/plugin-D30wlGW5.d.cts +0 -71
  110. package/dist/plugin-D30wlGW5.d.ts +0 -71
  111. package/dist/tagFactory-Bzupt4Pj.d.cts +0 -55
  112. package/dist/tagFactory-Bzupt4Pj.d.ts +0 -55
@@ -1,4 +1,4 @@
1
- export { C as ComponentProps, P as PropDef, a as PropSchema, R as RenderProp, V as Validator, b as assertType, c as compose, d as createGuard, e as createSlots, f as defineComponent, g as defineSlottedComponent, h as defineStrictComponent, v as validateProps, i as validators, w as withBoundary, j as withDefaults, k as withProps, l as withWrapper } from './contracts-DBdg9J_a.js';
1
+ export { C as ComponentProps, P as PropDef, a as PropSchema, R as RenderProp, V as Validator, W as WithDefaultsProps, b as assertType, c as compose, d as createGuard, e as createSlots, f as defineComponent, g as defineSlottedComponent, h as defineStrictComponent, v as validateProps, i as validators, w as withBoundary, j as withDefaults, k as withProps, l as withWrapper } from './contracts-DRIuclVT.js';
2
2
 
3
3
  interface MachineConfig<S extends string, E extends string, C extends object = Record<string, unknown>> {
4
4
  initial: S;
@@ -36,10 +36,10 @@ declare function machine<S extends string, E extends string, C extends object =
36
36
  * @param key Storage key
37
37
  * @param initial Default value when no persisted value exists
38
38
  * @param options Storage options
39
- * @returns The same `[getter, setter]` tuple as `signal()`. For localStorage
40
- * (cross-tab sync on), the setter additionally carries a non-enumerable
41
- * `dispose()` method — call `setter.dispose()` on unmount to remove the
42
- * `storage` event listener; otherwise it lives for the page's lifetime.
39
+ * @returns The same `[getter, setter]` tuple as `signal()`. The setter also
40
+ * carries a non-enumerable `dispose()` method — call `setter.dispose()` on
41
+ * unmount to stop persisting and remove the cross-tab `storage` listener;
42
+ * otherwise both live for the page's lifetime.
43
43
  *
44
44
  * @example
45
45
  * ```ts
@@ -94,15 +94,21 @@ interface PersistOptions<T = unknown> {
94
94
  * Must be synchronous — see `encrypt` docs. */
95
95
  decrypt?: (value: string) => string;
96
96
  }
97
+ /** Setter returned by {@link persisted}: writes like a `signal()` setter, released with `dispose()`. */
98
+ type PersistedSetter<T> = ((next: T | ((prev: T) => T)) => void) & {
99
+ /** Stop persisting changes and remove the cross-tab `storage` listener. */
100
+ dispose(): void;
101
+ };
97
102
  /**
98
103
  * A signal mirrored into persistent storage, rehydrated on creation.
99
104
  *
100
105
  * @param key Storage key.
101
106
  * @param initial Value used when storage holds nothing (or holds junk).
102
107
  * @param options Storage backend, serializer and version/migration settings.
103
- * @returns A `[accessor, setter]` pair with the same shape as `signal`.
108
+ * @returns A `[accessor, setter]` pair with the same shape as `signal`; the
109
+ * setter carries `dispose()`.
104
110
  */
105
- declare function persisted<T>(key: string, initial: T, options?: PersistOptions<T>): [() => T, (next: T | ((prev: T) => T)) => void];
111
+ declare function persisted<T>(key: string, initial: T, options?: PersistOptions<T>): [() => T, PersistedSetter<T>];
106
112
 
107
113
  /**
108
114
  * optimistic provides optimistic UI updates that can be reverted on failure.
@@ -202,13 +208,30 @@ interface TimeTravelReturn<T> {
202
208
  index: () => number;
203
209
  reset: () => void;
204
210
  jumpTo: (index: number) => void;
211
+ /**
212
+ * Dispose the internal `value`, `canUndo` and `canRedo` deriveds and remove
213
+ * them from DevTools. Afterwards they return their last values. Idempotent.
214
+ */
215
+ dispose: () => void;
205
216
  }
206
217
  /**
207
218
  * timeline wraps a state value with undo/redo history.
219
+ *
220
+ * @param maxHistory How many entries (including the current one) to keep. Must
221
+ * be a positive safe integer — `0`, negative, fractional, `NaN` or infinite
222
+ * capacities throw a `RangeError`, since they would evict the current value
223
+ * and break the index invariant.
208
224
  */
209
225
  declare function timeline<T>(initial: T, maxHistory?: number): TimeTravelReturn<T>;
210
226
 
211
- type Middleware<S> = (state: S, action: string, payload: unknown, next: () => void) => void;
227
+ /**
228
+ * Store middleware. Call `next()` once to continue the chain — synchronously or
229
+ * later (after an `await`, from a timer). A middleware may be `async`: a
230
+ * rejection is reported through the runtime error handler, and a middleware
231
+ * that fails (throws, or rejects) before calling `next()` never continues —
232
+ * a later `next()` from it is ignored.
233
+ */
234
+ type Middleware<S> = (state: S, action: string, payload: unknown, next: () => void) => void | PromiseLike<void>;
212
235
  type Selector<S, R> = (state: S) => R;
213
236
  /**
214
237
  * Action-map constraint.
@@ -242,4 +265,4 @@ declare function globalStore<S extends object, A extends StoreActionMap<S>>(conf
242
265
  middleware?: Middleware<S>[];
243
266
  }): GlobalStore<S, A>;
244
267
 
245
- export { type GlobalStore, type MachineConfig, type MachineReturn, type Middleware, type PersistOptions, type Selector, type StoreActionMap, type TimeTravelReturn, globalStore, machine, optimistic, optimisticList, persisted, timeline };
268
+ export { type GlobalStore, type MachineConfig, type MachineReturn, type Middleware, type PersistOptions, type PersistedSetter, type Selector, type StoreActionMap, type TimeTravelReturn, globalStore, machine, optimistic, optimisticList, persisted, timeline };
package/dist/patterns.js CHANGED
@@ -5,7 +5,7 @@ import {
5
5
  optimisticList,
6
6
  persisted,
7
7
  timeline
8
- } from "./chunk-LQFGQNMV.js";
8
+ } from "./chunk-AIF3Z2T7.js";
9
9
  import {
10
10
  RenderProp,
11
11
  assertType,
@@ -21,14 +21,14 @@ import {
21
21
  withDefaults,
22
22
  withProps,
23
23
  withWrapper
24
- } from "./chunk-R25EFXXC.js";
24
+ } from "./chunk-TUCPL2HB.js";
25
25
  import "./chunk-H3SRKIYX.js";
26
- import "./chunk-W2EQ7X2L.js";
27
- import "./chunk-7GIHSAWB.js";
28
- import "./chunk-5DXA2J44.js";
29
- import "./chunk-NVNJH22U.js";
30
- import "./chunk-3BTTCZ5J.js";
31
- import "./chunk-2WLZ6757.js";
26
+ import "./chunk-QE4TTDU3.js";
27
+ import "./chunk-XC4MEKGA.js";
28
+ import "./chunk-7XHATCIH.js";
29
+ import "./chunk-D33YTSX5.js";
30
+ import "./chunk-5Q4R7HCL.js";
31
+ import "./chunk-NYNYSPK7.js";
32
32
  export {
33
33
  RenderProp,
34
34
  assertType,