sibujs 1.4.0 → 1.5.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 +105 -119
- package/dist/browser.cjs +53 -14
- package/dist/browser.d.cts +14 -9
- package/dist/browser.d.ts +14 -9
- package/dist/browser.js +4 -4
- package/dist/build.cjs +124 -42
- package/dist/build.d.cts +1 -1
- package/dist/build.d.ts +1 -1
- package/dist/build.js +10 -10
- package/dist/cdn.global.js +7 -7
- package/dist/chunk-5ZYQ6KDD.js +154 -0
- package/dist/chunk-6BMPXPUW.js +26 -0
- package/dist/chunk-7GRNSCFT.js +1097 -0
- package/dist/chunk-BGTHZHJ5.js +1016 -0
- package/dist/chunk-BMPL52BF.js +654 -0
- package/dist/chunk-GJPXRJ45.js +37 -0
- package/dist/chunk-JCDUJN2F.js +2779 -0
- package/dist/chunk-K4G4ZQNR.js +286 -0
- package/dist/chunk-MB6QFH3I.js +2776 -0
- package/dist/chunk-MYRV7VDM.js +742 -0
- package/dist/chunk-NZIIMDWI.js +84 -0
- package/dist/chunk-P3XWXJZU.js +282 -0
- package/dist/chunk-PDZQY43A.js +616 -0
- package/dist/chunk-RJ46C3CS.js +1293 -0
- package/dist/chunk-SFKNRVCU.js +292 -0
- package/dist/chunk-TDGZL5CU.js +365 -0
- package/dist/chunk-VAPYJN4X.js +368 -0
- package/dist/chunk-VQDZK23A.js +1023 -0
- package/dist/chunk-VQNQZCWJ.js +61 -0
- package/dist/chunk-XHK6BDAJ.js +76 -0
- package/dist/chunk-XUEEGU5O.js +409 -0
- package/dist/contracts-ey_Qh8ef.d.cts +239 -0
- package/dist/contracts-ey_Qh8ef.d.ts +239 -0
- package/dist/customElement-BL3Uo8dL.d.cts +318 -0
- package/dist/customElement-BL3Uo8dL.d.ts +318 -0
- package/dist/data.cjs +52 -11
- package/dist/data.js +6 -6
- package/dist/devtools.cjs +22 -24
- package/dist/devtools.js +26 -28
- package/dist/ecosystem.cjs +31 -6
- package/dist/ecosystem.d.cts +4 -4
- package/dist/ecosystem.d.ts +4 -4
- package/dist/ecosystem.js +7 -7
- package/dist/extras.cjs +304 -108
- package/dist/extras.d.cts +3 -3
- package/dist/extras.d.ts +3 -3
- package/dist/extras.js +19 -19
- package/dist/index.cjs +124 -42
- package/dist/index.d.cts +58 -48
- package/dist/index.d.ts +58 -48
- package/dist/index.js +10 -10
- package/dist/motion.cjs +13 -2
- package/dist/motion.d.cts +1 -1
- package/dist/motion.d.ts +1 -1
- package/dist/motion.js +3 -3
- package/dist/patterns.cjs +91 -24
- package/dist/patterns.d.cts +46 -12
- package/dist/patterns.d.ts +46 -12
- package/dist/patterns.js +5 -5
- package/dist/performance.cjs +97 -12
- package/dist/performance.d.cts +6 -1
- package/dist/performance.d.ts +6 -1
- package/dist/performance.js +5 -3
- package/dist/plugins.cjs +19 -13
- package/dist/plugins.d.cts +3 -3
- package/dist/plugins.d.ts +3 -3
- package/dist/plugins.js +16 -18
- package/dist/ssr.cjs +9 -0
- package/dist/ssr.d.cts +1 -1
- package/dist/ssr.d.ts +1 -1
- package/dist/ssr.js +7 -7
- package/dist/testing.js +2 -2
- package/dist/ui.cjs +130 -48
- package/dist/ui.d.cts +13 -16
- package/dist/ui.d.ts +13 -16
- package/dist/ui.js +6 -6
- package/dist/widgets.cjs +31 -6
- package/dist/widgets.js +5 -5
- package/package.json +1 -1
package/dist/ui.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export { B as BoundFieldProps, C as CustomElementOptions, F as FieldConfig, a as FocusTrap, b as FormConfig, c as FormField, d as FormReturn, I as IntersectionResult, M as MaskOptions, T as Toast, e as ToastInstance, V as ValidatorFn, f as VirtualList, g as VirtualListProps, h as announce, i as aria, j as bindAttrs, k as bindBoolAttr, l as bindData, m as bindField, n as creditCardMask, o as custom, p as dateMask, q as defineElement, r as dialog, s as email, t as eventBus, u as focus, v as form, w as hotkey, x as infiniteScroll, y as inputMask, z as intersection, A as lazyLoad, D as matchesPattern, E as max, G as maxLength, H as min, J as minLength, K as pagination, L as phoneMask, N as removeScopedStyle, O as required, P as scopedStyle, Q as ssnMask, R as svgElement, S as timeMask, U as toast, W as withScopedStyle, X as zipMask } from './customElement-
|
|
2
|
-
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-
|
|
1
|
+
export { B as BoundFieldProps, C as CustomElementOptions, F as FieldConfig, a as FocusTrap, b as FormConfig, c as FormField, d as FormReturn, I as IntersectionResult, M as MaskOptions, T as Toast, e as ToastInstance, V as ValidatorFn, f as VirtualList, g as VirtualListProps, h as announce, i as aria, j as bindAttrs, k as bindBoolAttr, l as bindData, m as bindField, n as creditCardMask, o as custom, p as dateMask, q as defineElement, r as dialog, s as email, t as eventBus, u as focus, v as form, w as hotkey, x as infiniteScroll, y as inputMask, z as intersection, A as lazyLoad, D as matchesPattern, E as max, G as maxLength, H as min, J as minLength, K as pagination, L as phoneMask, N as removeScopedStyle, O as required, P as scopedStyle, Q as ssnMask, R as svgElement, S as timeMask, U as toast, W as withScopedStyle, X as zipMask } from './customElement-BL3Uo8dL.js';
|
|
2
|
+
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-ey_Qh8ef.js';
|
|
3
3
|
|
|
4
4
|
interface FormActionHandle<TArgs extends unknown[], TResult> {
|
|
5
5
|
/** Invoke the action. Rejections become `error()`, resolutions `result()`. */
|
|
@@ -30,14 +30,11 @@ interface FormActionHandle<TArgs extends unknown[], TResult> {
|
|
|
30
30
|
* return res.json();
|
|
31
31
|
* });
|
|
32
32
|
*
|
|
33
|
-
* form({
|
|
34
|
-
*
|
|
35
|
-
*
|
|
36
|
-
*
|
|
37
|
-
*
|
|
38
|
-
* when(() => save.error() != null, () => div({ class: "error", nodes: () => String(save.error()) })),
|
|
39
|
-
* ],
|
|
40
|
-
* });
|
|
33
|
+
* form({ on: { submit: save.onSubmit } }, [
|
|
34
|
+
* input({ name: "title" }),
|
|
35
|
+
* button({ disabled: save.pending }, () => (save.pending() ? "Saving..." : "Save")),
|
|
36
|
+
* when(() => save.error() != null, () => div("error", () => String(save.error()))),
|
|
37
|
+
* ]);
|
|
41
38
|
* ```
|
|
42
39
|
*/
|
|
43
40
|
declare function formAction<TArgs extends unknown[], TResult>(fn: (...args: TArgs) => Promise<TResult>): FormActionHandle<TArgs, TResult>;
|
|
@@ -102,10 +99,10 @@ interface ListboxHandle {
|
|
|
102
99
|
*
|
|
103
100
|
* @example
|
|
104
101
|
* ```ts
|
|
105
|
-
* const container = ul(
|
|
106
|
-
* li({ role: "option", "data-value": "a",
|
|
107
|
-
* li({ role: "option", "data-value": "b",
|
|
108
|
-
* ]
|
|
102
|
+
* const container = ul([
|
|
103
|
+
* li({ role: "option", "data-value": "a" }, "Apple"),
|
|
104
|
+
* li({ role: "option", "data-value": "b" }, "Banana"),
|
|
105
|
+
* ]) as HTMLElement;
|
|
109
106
|
*
|
|
110
107
|
* const lb = createListbox(container, { onSelect: v => console.log(v) });
|
|
111
108
|
* ```
|
|
@@ -142,8 +139,8 @@ interface DialogAriaHandle {
|
|
|
142
139
|
* const dlg = document.createElement("div");
|
|
143
140
|
* const aria = createDialogAria(dlg, { alert: false });
|
|
144
141
|
* dlg.append(
|
|
145
|
-
* h2({ id: aria.titleId,
|
|
146
|
-
* p({ id: aria.descriptionId,
|
|
142
|
+
* h2({ id: aria.titleId }, "Delete?"),
|
|
143
|
+
* p({ id: aria.descriptionId }, "This cannot be undone."),
|
|
147
144
|
* );
|
|
148
145
|
* ```
|
|
149
146
|
*/
|
package/dist/ui.js
CHANGED
|
@@ -37,7 +37,7 @@ import {
|
|
|
37
37
|
toast,
|
|
38
38
|
withScopedStyle,
|
|
39
39
|
zipMask
|
|
40
|
-
} from "./chunk-
|
|
40
|
+
} from "./chunk-VQDZK23A.js";
|
|
41
41
|
import {
|
|
42
42
|
RenderProp,
|
|
43
43
|
assertType,
|
|
@@ -59,17 +59,17 @@ import {
|
|
|
59
59
|
} from "./chunk-YT6HQ6AM.js";
|
|
60
60
|
import {
|
|
61
61
|
registerDisposer
|
|
62
|
-
} from "./chunk-
|
|
63
|
-
import "./chunk-
|
|
62
|
+
} from "./chunk-5ZYQ6KDD.js";
|
|
63
|
+
import "./chunk-XHK6BDAJ.js";
|
|
64
64
|
import "./chunk-CMBFNA7L.js";
|
|
65
65
|
import {
|
|
66
66
|
effect
|
|
67
|
-
} from "./chunk-
|
|
67
|
+
} from "./chunk-VQNQZCWJ.js";
|
|
68
68
|
import "./chunk-EUZND3CB.js";
|
|
69
69
|
import {
|
|
70
70
|
signal
|
|
71
|
-
} from "./chunk-
|
|
72
|
-
import "./chunk-
|
|
71
|
+
} from "./chunk-NZIIMDWI.js";
|
|
72
|
+
import "./chunk-K4G4ZQNR.js";
|
|
73
73
|
import "./chunk-5X6PP2UK.js";
|
|
74
74
|
|
|
75
75
|
// src/ui/formAction.ts
|
package/dist/widgets.cjs
CHANGED
|
@@ -127,12 +127,21 @@ function queueSignalNotification(signal2) {
|
|
|
127
127
|
}
|
|
128
128
|
}
|
|
129
129
|
}
|
|
130
|
+
var MAX_DRAIN_ITERATIONS = 1e3;
|
|
130
131
|
function drainNotificationQueue() {
|
|
131
132
|
if (notifyDepth > 0) return;
|
|
132
133
|
notifyDepth++;
|
|
133
134
|
try {
|
|
134
135
|
let i = 0;
|
|
135
136
|
while (i < pendingQueue.length) {
|
|
137
|
+
if (i >= MAX_DRAIN_ITERATIONS) {
|
|
138
|
+
if (typeof console !== "undefined") {
|
|
139
|
+
console.error(
|
|
140
|
+
`[SibuJS] Notification queue exceeded ${MAX_DRAIN_ITERATIONS} iterations \u2014 likely an effect that writes to a signal it reads. Breaking to prevent infinite loop.`
|
|
141
|
+
);
|
|
142
|
+
}
|
|
143
|
+
break;
|
|
144
|
+
}
|
|
136
145
|
safeInvoke(pendingQueue[i]);
|
|
137
146
|
i++;
|
|
138
147
|
}
|
|
@@ -299,21 +308,37 @@ function derived(getter, options) {
|
|
|
299
308
|
cs._v = getter();
|
|
300
309
|
}, markDirty);
|
|
301
310
|
const hook = globalThis.__SIBU_DEVTOOLS_GLOBAL_HOOK__;
|
|
311
|
+
let evaluating = false;
|
|
302
312
|
function computedGetter() {
|
|
313
|
+
if (evaluating) {
|
|
314
|
+
throw new Error(
|
|
315
|
+
`[SibuJS] Circular dependency detected in derived${debugName ? ` "${debugName}"` : ""}. A derived signal cannot read itself (directly or through a chain).`
|
|
316
|
+
);
|
|
317
|
+
}
|
|
303
318
|
if (trackingSuspended) {
|
|
304
319
|
if (cs._d) {
|
|
305
|
-
|
|
306
|
-
|
|
320
|
+
evaluating = true;
|
|
321
|
+
try {
|
|
322
|
+
cs._d = false;
|
|
323
|
+
cs._v = getter();
|
|
324
|
+
} finally {
|
|
325
|
+
evaluating = false;
|
|
326
|
+
}
|
|
307
327
|
}
|
|
308
328
|
return cs._v;
|
|
309
329
|
}
|
|
310
330
|
recordDependency(cs);
|
|
311
331
|
if (cs._d) {
|
|
312
332
|
const oldValue = cs._v;
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
333
|
+
evaluating = true;
|
|
334
|
+
try {
|
|
335
|
+
track(() => {
|
|
336
|
+
cs._d = false;
|
|
337
|
+
cs._v = getter();
|
|
338
|
+
}, markDirty);
|
|
339
|
+
} finally {
|
|
340
|
+
evaluating = false;
|
|
341
|
+
}
|
|
317
342
|
if (hook && oldValue !== cs._v) {
|
|
318
343
|
hook.emit("computed:update", { signal: cs, oldValue, newValue: cs._v });
|
|
319
344
|
}
|
package/dist/widgets.js
CHANGED
|
@@ -8,12 +8,12 @@ import {
|
|
|
8
8
|
select,
|
|
9
9
|
tabs,
|
|
10
10
|
tooltip
|
|
11
|
-
} from "./chunk-
|
|
12
|
-
import "./chunk-
|
|
13
|
-
import "./chunk-
|
|
11
|
+
} from "./chunk-PDZQY43A.js";
|
|
12
|
+
import "./chunk-GJPXRJ45.js";
|
|
13
|
+
import "./chunk-XHK6BDAJ.js";
|
|
14
14
|
import "./chunk-EUZND3CB.js";
|
|
15
|
-
import "./chunk-
|
|
16
|
-
import "./chunk-
|
|
15
|
+
import "./chunk-NZIIMDWI.js";
|
|
16
|
+
import "./chunk-K4G4ZQNR.js";
|
|
17
17
|
import "./chunk-5X6PP2UK.js";
|
|
18
18
|
export {
|
|
19
19
|
accordion,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "sibujs",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.5.0",
|
|
4
4
|
"description": "A lightweight, function-based frontend framework that combines the best of React, Svelte, and Vue — with zero VDOM and maximum simplicity. Designed for developers who want fine-grained reactivity and full control without compilation or magic.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"frontend",
|