sibujs 1.2.0 → 1.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +29 -25
- package/dist/browser.cjs +804 -2
- package/dist/browser.d.cts +591 -1
- package/dist/browser.d.ts +591 -1
- package/dist/browser.js +50 -8
- package/dist/build.cjs +655 -237
- package/dist/build.js +15 -93
- package/dist/cdn.global.js +188 -7
- package/dist/chunk-2BYQDGN3.js +742 -0
- package/dist/chunk-32DY64NT.js +282 -0
- package/dist/chunk-3AIRKM3B.js +1263 -0
- package/dist/chunk-3X2YG6YM.js +505 -0
- package/dist/chunk-5X6PP2UK.js +28 -0
- package/dist/chunk-77L6NL3X.js +1097 -0
- package/dist/chunk-BGN5ZMP4.js +26 -0
- package/dist/chunk-BTU3TJDS.js +365 -0
- package/dist/chunk-CHF5OHIA.js +61 -0
- package/dist/chunk-CMBFNA7L.js +27 -0
- package/dist/chunk-CNZ35WI2.js +178 -0
- package/dist/chunk-DAHRH4ON.js +331 -0
- package/dist/chunk-EBGIRKQY.js +616 -0
- package/dist/chunk-EUZND3CB.js +27 -0
- package/dist/chunk-F3FA4F32.js +292 -0
- package/dist/chunk-JAKHTMQU.js +1000 -0
- package/dist/chunk-JCI5M6U6.js +956 -0
- package/dist/chunk-KQPDEVVS.js +398 -0
- package/dist/chunk-M4NLBH4I.js +725 -0
- package/dist/chunk-NEKUBFPT.js +60 -0
- package/dist/chunk-NYVAC6P5.js +37 -0
- package/dist/chunk-PTQJDMRT.js +146 -0
- package/dist/chunk-QWZG56ET.js +2744 -0
- package/dist/chunk-TSOKIX5Z.js +654 -0
- package/dist/chunk-UHNL42EF.js +2730 -0
- package/dist/chunk-VRW3FULF.js +725 -0
- package/dist/chunk-WZSPOOER.js +84 -0
- package/dist/chunk-YT6HQ6AM.js +14 -0
- package/dist/chunk-ZD6OAMTH.js +277 -0
- package/dist/chunk-ZWKZCBO6.js +317 -0
- package/dist/contracts-DDrwxvJ-.d.cts +245 -0
- package/dist/contracts-DDrwxvJ-.d.ts +245 -0
- package/dist/contracts-xo5ckdRP.d.cts +240 -0
- package/dist/contracts-xo5ckdRP.d.ts +240 -0
- package/dist/data.cjs +35 -2
- package/dist/data.d.cts +7 -0
- package/dist/data.d.ts +7 -0
- package/dist/data.js +9 -8
- package/dist/devtools.cjs +122 -0
- package/dist/devtools.d.cts +69 -461
- package/dist/devtools.d.ts +69 -461
- package/dist/devtools.js +127 -6
- package/dist/ecosystem.cjs +23 -6
- package/dist/ecosystem.d.cts +1 -1
- package/dist/ecosystem.d.ts +1 -1
- package/dist/ecosystem.js +10 -9
- package/dist/extras.cjs +1208 -88
- package/dist/extras.d.cts +6 -6
- package/dist/extras.d.ts +6 -6
- package/dist/extras.js +70 -33
- package/dist/index.cjs +663 -158
- package/dist/index.d.cts +398 -40
- package/dist/index.d.ts +398 -40
- package/dist/index.js +39 -21
- package/dist/introspect-BumjnBKr.d.cts +477 -0
- package/dist/introspect-CZrlcaYy.d.ts +477 -0
- package/dist/introspect-Cb0zgpi2.d.cts +477 -0
- package/dist/introspect-Y2xNXGSf.d.ts +477 -0
- package/dist/motion.js +4 -4
- package/dist/patterns.cjs +51 -24
- package/dist/patterns.d.cts +19 -57
- package/dist/patterns.d.ts +19 -57
- package/dist/patterns.js +8 -16
- package/dist/performance.js +4 -4
- package/dist/plugins.cjs +429 -82
- package/dist/plugins.d.cts +27 -4
- package/dist/plugins.d.ts +27 -4
- package/dist/plugins.js +156 -37
- package/dist/ssr-4PBXAOO3.js +40 -0
- package/dist/ssr-Do_SiVoL.d.cts +201 -0
- package/dist/ssr-Do_SiVoL.d.ts +201 -0
- package/dist/ssr.cjs +312 -60
- package/dist/ssr.d.cts +10 -1
- package/dist/ssr.d.ts +10 -1
- package/dist/ssr.js +13 -10
- package/dist/tagFactory-DaJ0YWX6.d.cts +47 -0
- package/dist/tagFactory-DaJ0YWX6.d.ts +47 -0
- package/dist/testing.cjs +233 -2
- package/dist/testing.d.cts +42 -1
- package/dist/testing.d.ts +42 -1
- package/dist/testing.js +129 -2
- package/dist/ui.cjs +374 -8
- package/dist/ui.d.cts +252 -2
- package/dist/ui.d.ts +252 -2
- package/dist/ui.js +329 -11
- package/dist/widgets.js +7 -7
- package/package.json +1 -1
package/dist/patterns.d.cts
CHANGED
|
@@ -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
|
|
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-xo5ckdRP.cjs';
|
|
2
2
|
|
|
3
3
|
interface MachineConfig<S extends string, E extends string, C extends Record<string, unknown> = Record<string, unknown>> {
|
|
4
4
|
initial: S;
|
|
@@ -54,23 +54,33 @@ interface PersistOptions<T = unknown> {
|
|
|
54
54
|
deserialize?: (raw: string) => unknown;
|
|
55
55
|
/** Optional type guard to validate deserialized data. Falls back to initial on failure. */
|
|
56
56
|
validate?: (value: unknown) => value is T;
|
|
57
|
+
/**
|
|
58
|
+
* Sync the signal across browser tabs via the `storage` event.
|
|
59
|
+
* Only applies when using localStorage (not sessionStorage — session storage
|
|
60
|
+
* is already isolated per tab). Default: `true` for localStorage.
|
|
61
|
+
*/
|
|
62
|
+
syncTabs?: boolean;
|
|
57
63
|
/**
|
|
58
64
|
* Encrypt the serialized value before writing to storage.
|
|
59
65
|
* Paired with `decrypt` for reading. Use for sensitive data.
|
|
60
66
|
*
|
|
61
|
-
* **Security:**
|
|
62
|
-
*
|
|
63
|
-
*
|
|
67
|
+
* **Security requirement:** use an authenticated encryption algorithm
|
|
68
|
+
* such as AES-GCM via the Web Crypto API. Do NOT:
|
|
69
|
+
*
|
|
70
|
+
* - use `btoa()` / `atob()` — Base64 is encoding, not encryption
|
|
71
|
+
* - use XOR with a static key — trivially reversible
|
|
72
|
+
* - roll your own cipher — nearly always broken
|
|
64
73
|
*
|
|
65
74
|
* @example
|
|
66
75
|
* ```ts
|
|
67
|
-
* // Example using a simple XOR cipher for illustration — in production,
|
|
68
|
-
* // use crypto.subtle.encrypt() with AES-GCM or a proven library.
|
|
69
76
|
* persisted("token", "", {
|
|
70
|
-
* encrypt: (v) =>
|
|
71
|
-
* decrypt: (v) =>
|
|
77
|
+
* encrypt: async (v) => aesGcmEncrypt(v, await getKey()),
|
|
78
|
+
* decrypt: async (v) => aesGcmDecrypt(v, await getKey()),
|
|
72
79
|
* });
|
|
73
80
|
* ```
|
|
81
|
+
*
|
|
82
|
+
* Note that because localStorage is synchronous, any real AES-GCM
|
|
83
|
+
* flow needs pre-derived keys and is inherently best-effort.
|
|
74
84
|
*/
|
|
75
85
|
encrypt?: (value: string) => string;
|
|
76
86
|
/** Decrypt the stored value before deserialization. Required if `encrypt` is set. */
|
|
@@ -141,52 +151,4 @@ declare function globalStore<S extends Record<string, unknown>, A extends Record
|
|
|
141
151
|
middleware?: Middleware<S>[];
|
|
142
152
|
}): GlobalStore<S, A>;
|
|
143
153
|
|
|
144
|
-
|
|
145
|
-
* SolidJS-style reactive primitives — standalone APIs that don't require
|
|
146
|
-
* being inside a component. These are thin wrappers around the signal system.
|
|
147
|
-
*/
|
|
148
|
-
/**
|
|
149
|
-
* Creates a reactive signal. Equivalent to signal but with SolidJS naming.
|
|
150
|
-
*
|
|
151
|
-
* @param value Initial value
|
|
152
|
-
* @returns Tuple [getter, setter]
|
|
153
|
-
*
|
|
154
|
-
* @example
|
|
155
|
-
* ```ts
|
|
156
|
-
* const [count, setCount] = createSignal(0);
|
|
157
|
-
* console.log(count()); // 0
|
|
158
|
-
* setCount(5);
|
|
159
|
-
* ```
|
|
160
|
-
*/
|
|
161
|
-
declare function createSignal<T>(value: T): [() => T, (next: T | ((prev: T) => T)) => void];
|
|
162
|
-
/**
|
|
163
|
-
* Creates a derived/computed reactive value. Equivalent to derived.
|
|
164
|
-
*
|
|
165
|
-
* @param fn Computation function that reads other signals
|
|
166
|
-
* @returns Getter for the computed value
|
|
167
|
-
*
|
|
168
|
-
* @example
|
|
169
|
-
* ```ts
|
|
170
|
-
* const [count] = createSignal(5);
|
|
171
|
-
* const doubled = createMemo(() => count() * 2);
|
|
172
|
-
* console.log(doubled()); // 10
|
|
173
|
-
* ```
|
|
174
|
-
*/
|
|
175
|
-
declare function createMemo<T>(fn: () => T): () => T;
|
|
176
|
-
/**
|
|
177
|
-
* Creates a reactive side effect. Equivalent to effect.
|
|
178
|
-
*
|
|
179
|
-
* @param fn Effect function that reads reactive signals
|
|
180
|
-
* @returns Cleanup/teardown function
|
|
181
|
-
*
|
|
182
|
-
* @example
|
|
183
|
-
* ```ts
|
|
184
|
-
* const [count] = createSignal(0);
|
|
185
|
-
* const cleanup = createEffect(() => {
|
|
186
|
-
* console.log("Count is:", count());
|
|
187
|
-
* });
|
|
188
|
-
* ```
|
|
189
|
-
*/
|
|
190
|
-
declare function createEffect(fn: () => void): () => void;
|
|
191
|
-
|
|
192
|
-
export { type GlobalStore, type MachineConfig, type MachineReturn, type Middleware, type OptimisticAction, type PersistOptions, type Selector, type TimeTravelReturn, createEffect, createMemo, createSignal, globalStore, machine, optimistic, optimisticList, persisted, timeline };
|
|
154
|
+
export { type GlobalStore, type MachineConfig, type MachineReturn, type Middleware, type OptimisticAction, type PersistOptions, type Selector, type TimeTravelReturn, globalStore, machine, optimistic, optimisticList, persisted, timeline };
|
package/dist/patterns.d.ts
CHANGED
|
@@ -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
|
|
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-xo5ckdRP.js';
|
|
2
2
|
|
|
3
3
|
interface MachineConfig<S extends string, E extends string, C extends Record<string, unknown> = Record<string, unknown>> {
|
|
4
4
|
initial: S;
|
|
@@ -54,23 +54,33 @@ interface PersistOptions<T = unknown> {
|
|
|
54
54
|
deserialize?: (raw: string) => unknown;
|
|
55
55
|
/** Optional type guard to validate deserialized data. Falls back to initial on failure. */
|
|
56
56
|
validate?: (value: unknown) => value is T;
|
|
57
|
+
/**
|
|
58
|
+
* Sync the signal across browser tabs via the `storage` event.
|
|
59
|
+
* Only applies when using localStorage (not sessionStorage — session storage
|
|
60
|
+
* is already isolated per tab). Default: `true` for localStorage.
|
|
61
|
+
*/
|
|
62
|
+
syncTabs?: boolean;
|
|
57
63
|
/**
|
|
58
64
|
* Encrypt the serialized value before writing to storage.
|
|
59
65
|
* Paired with `decrypt` for reading. Use for sensitive data.
|
|
60
66
|
*
|
|
61
|
-
* **Security:**
|
|
62
|
-
*
|
|
63
|
-
*
|
|
67
|
+
* **Security requirement:** use an authenticated encryption algorithm
|
|
68
|
+
* such as AES-GCM via the Web Crypto API. Do NOT:
|
|
69
|
+
*
|
|
70
|
+
* - use `btoa()` / `atob()` — Base64 is encoding, not encryption
|
|
71
|
+
* - use XOR with a static key — trivially reversible
|
|
72
|
+
* - roll your own cipher — nearly always broken
|
|
64
73
|
*
|
|
65
74
|
* @example
|
|
66
75
|
* ```ts
|
|
67
|
-
* // Example using a simple XOR cipher for illustration — in production,
|
|
68
|
-
* // use crypto.subtle.encrypt() with AES-GCM or a proven library.
|
|
69
76
|
* persisted("token", "", {
|
|
70
|
-
* encrypt: (v) =>
|
|
71
|
-
* decrypt: (v) =>
|
|
77
|
+
* encrypt: async (v) => aesGcmEncrypt(v, await getKey()),
|
|
78
|
+
* decrypt: async (v) => aesGcmDecrypt(v, await getKey()),
|
|
72
79
|
* });
|
|
73
80
|
* ```
|
|
81
|
+
*
|
|
82
|
+
* Note that because localStorage is synchronous, any real AES-GCM
|
|
83
|
+
* flow needs pre-derived keys and is inherently best-effort.
|
|
74
84
|
*/
|
|
75
85
|
encrypt?: (value: string) => string;
|
|
76
86
|
/** Decrypt the stored value before deserialization. Required if `encrypt` is set. */
|
|
@@ -141,52 +151,4 @@ declare function globalStore<S extends Record<string, unknown>, A extends Record
|
|
|
141
151
|
middleware?: Middleware<S>[];
|
|
142
152
|
}): GlobalStore<S, A>;
|
|
143
153
|
|
|
144
|
-
|
|
145
|
-
* SolidJS-style reactive primitives — standalone APIs that don't require
|
|
146
|
-
* being inside a component. These are thin wrappers around the signal system.
|
|
147
|
-
*/
|
|
148
|
-
/**
|
|
149
|
-
* Creates a reactive signal. Equivalent to signal but with SolidJS naming.
|
|
150
|
-
*
|
|
151
|
-
* @param value Initial value
|
|
152
|
-
* @returns Tuple [getter, setter]
|
|
153
|
-
*
|
|
154
|
-
* @example
|
|
155
|
-
* ```ts
|
|
156
|
-
* const [count, setCount] = createSignal(0);
|
|
157
|
-
* console.log(count()); // 0
|
|
158
|
-
* setCount(5);
|
|
159
|
-
* ```
|
|
160
|
-
*/
|
|
161
|
-
declare function createSignal<T>(value: T): [() => T, (next: T | ((prev: T) => T)) => void];
|
|
162
|
-
/**
|
|
163
|
-
* Creates a derived/computed reactive value. Equivalent to derived.
|
|
164
|
-
*
|
|
165
|
-
* @param fn Computation function that reads other signals
|
|
166
|
-
* @returns Getter for the computed value
|
|
167
|
-
*
|
|
168
|
-
* @example
|
|
169
|
-
* ```ts
|
|
170
|
-
* const [count] = createSignal(5);
|
|
171
|
-
* const doubled = createMemo(() => count() * 2);
|
|
172
|
-
* console.log(doubled()); // 10
|
|
173
|
-
* ```
|
|
174
|
-
*/
|
|
175
|
-
declare function createMemo<T>(fn: () => T): () => T;
|
|
176
|
-
/**
|
|
177
|
-
* Creates a reactive side effect. Equivalent to effect.
|
|
178
|
-
*
|
|
179
|
-
* @param fn Effect function that reads reactive signals
|
|
180
|
-
* @returns Cleanup/teardown function
|
|
181
|
-
*
|
|
182
|
-
* @example
|
|
183
|
-
* ```ts
|
|
184
|
-
* const [count] = createSignal(0);
|
|
185
|
-
* const cleanup = createEffect(() => {
|
|
186
|
-
* console.log("Count is:", count());
|
|
187
|
-
* });
|
|
188
|
-
* ```
|
|
189
|
-
*/
|
|
190
|
-
declare function createEffect(fn: () => void): () => void;
|
|
191
|
-
|
|
192
|
-
export { type GlobalStore, type MachineConfig, type MachineReturn, type Middleware, type OptimisticAction, type PersistOptions, type Selector, type TimeTravelReturn, createEffect, createMemo, createSignal, globalStore, machine, optimistic, optimisticList, persisted, timeline };
|
|
154
|
+
export { type GlobalStore, type MachineConfig, type MachineReturn, type Middleware, type OptimisticAction, type PersistOptions, type Selector, type TimeTravelReturn, globalStore, machine, optimistic, optimisticList, persisted, timeline };
|
package/dist/patterns.js
CHANGED
|
@@ -1,18 +1,14 @@
|
|
|
1
1
|
import {
|
|
2
|
-
createEffect,
|
|
3
|
-
createMemo,
|
|
4
|
-
createSignal,
|
|
5
2
|
globalStore,
|
|
6
3
|
machine,
|
|
7
4
|
optimistic,
|
|
8
5
|
optimisticList,
|
|
9
6
|
persisted,
|
|
10
7
|
timeline
|
|
11
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-ZWKZCBO6.js";
|
|
12
9
|
import {
|
|
13
10
|
RenderProp,
|
|
14
11
|
assertType,
|
|
15
|
-
composable,
|
|
16
12
|
compose,
|
|
17
13
|
createGuard,
|
|
18
14
|
createSlots,
|
|
@@ -25,22 +21,18 @@ import {
|
|
|
25
21
|
withDefaults,
|
|
26
22
|
withProps,
|
|
27
23
|
withWrapper
|
|
28
|
-
} from "./chunk-
|
|
29
|
-
import "./chunk-
|
|
30
|
-
import "./chunk-
|
|
31
|
-
import "./chunk-
|
|
32
|
-
import "./chunk-
|
|
33
|
-
import "./chunk-
|
|
34
|
-
import "./chunk-
|
|
24
|
+
} from "./chunk-CNZ35WI2.js";
|
|
25
|
+
import "./chunk-NEKUBFPT.js";
|
|
26
|
+
import "./chunk-CHF5OHIA.js";
|
|
27
|
+
import "./chunk-EUZND3CB.js";
|
|
28
|
+
import "./chunk-WZSPOOER.js";
|
|
29
|
+
import "./chunk-ZD6OAMTH.js";
|
|
30
|
+
import "./chunk-5X6PP2UK.js";
|
|
35
31
|
export {
|
|
36
32
|
RenderProp,
|
|
37
33
|
assertType,
|
|
38
|
-
composable,
|
|
39
34
|
compose,
|
|
40
|
-
createEffect,
|
|
41
35
|
createGuard,
|
|
42
|
-
createMemo,
|
|
43
|
-
createSignal,
|
|
44
36
|
createSlots,
|
|
45
37
|
defineComponent,
|
|
46
38
|
defineSlottedComponent,
|
package/dist/performance.js
CHANGED
|
@@ -33,10 +33,10 @@ import {
|
|
|
33
33
|
transitionState,
|
|
34
34
|
uniqueId,
|
|
35
35
|
yieldToMain
|
|
36
|
-
} from "./chunk-
|
|
37
|
-
import "./chunk-
|
|
38
|
-
import "./chunk-
|
|
39
|
-
import "./chunk-
|
|
36
|
+
} from "./chunk-TSOKIX5Z.js";
|
|
37
|
+
import "./chunk-WZSPOOER.js";
|
|
38
|
+
import "./chunk-ZD6OAMTH.js";
|
|
39
|
+
import "./chunk-5X6PP2UK.js";
|
|
40
40
|
export {
|
|
41
41
|
DOMPool,
|
|
42
42
|
Features,
|