sibujs 4.6.0 → 4.8.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 (94) hide show
  1. package/README.md +1 -1
  2. package/dist/browser.cjs +62 -8
  3. package/dist/browser.d.cts +23 -0
  4. package/dist/browser.d.ts +23 -0
  5. package/dist/browser.js +6 -5
  6. package/dist/build.cjs +2388 -1004
  7. package/dist/build.d.cts +147 -44
  8. package/dist/build.d.ts +147 -44
  9. package/dist/build.js +1410 -564
  10. package/dist/cdn.dev.global.js +14 -12
  11. package/dist/cdn.full.dev.global.js +15 -13
  12. package/dist/cdn.full.global.js +14 -12
  13. package/dist/cdn.global.js +12 -10
  14. package/dist/chunk-3ACAAQIN.js +224 -0
  15. package/dist/{chunk-7NCARGJW.js → chunk-44MTL7ED.js} +6 -6
  16. package/dist/{chunk-BAAG6ZTI.js → chunk-4WMSTZ7J.js} +8 -5
  17. package/dist/{chunk-H3SRKIYX.js → chunk-62BDYGAG.js} +8 -0
  18. package/dist/{chunk-DKGBBKOF.js → chunk-C5PEWEGH.js} +20 -5
  19. package/dist/{chunk-3ISI6ACU.js → chunk-C7AA2CZX.js} +1 -1
  20. package/dist/{chunk-UZQ6ALFS.js → chunk-CZPRSWSS.js} +1 -1
  21. package/dist/{chunk-D33YTSX5.js → chunk-DSID757X.js} +5 -4
  22. package/dist/{chunk-OXUY2A6L.js → chunk-EGUQLBHE.js} +22 -8
  23. package/dist/{chunk-2INLLLMZ.js → chunk-EXXSN3BW.js} +202 -26
  24. package/dist/{chunk-HURREPU2.js → chunk-FC6KCJSA.js} +87 -150
  25. package/dist/{chunk-HYXDKS4N.js → chunk-GSGNX35Q.js} +5 -5
  26. package/dist/{chunk-7GQCWFOE.js → chunk-J3YQ457H.js} +171 -85
  27. package/dist/{chunk-ORMZXBKQ.js → chunk-JUTFX2RM.js} +18 -10
  28. package/dist/{chunk-QE4TTDU3.js → chunk-KJ3UKABJ.js} +12 -11
  29. package/dist/{chunk-XRRZKZYX.js → chunk-LI4W3U6C.js} +1 -1
  30. package/dist/{chunk-47M47FOM.js → chunk-O6TRVMJI.js} +58 -6
  31. package/dist/{chunk-JSXPZCET.js → chunk-Q5J2LVKH.js} +1 -1
  32. package/dist/{chunk-5MT6SJ3P.js → chunk-QGMSESDD.js} +10 -5
  33. package/dist/{chunk-AIF3Z2T7.js → chunk-RGLPEBDE.js} +13 -10
  34. package/dist/{chunk-5Q4R7HCL.js → chunk-TQQUN4WR.js} +11 -2
  35. package/dist/{chunk-PK6FK2G2.js → chunk-UCNP3HVM.js} +183 -30
  36. package/dist/{chunk-XC4MEKGA.js → chunk-V3LHZSU5.js} +8 -2
  37. package/dist/{chunk-VVWPJ543.js → chunk-VWT3VXPL.js} +55 -20
  38. package/dist/{chunk-SXXVZMKZ.js → chunk-ZVLHNEEL.js} +17 -35
  39. package/dist/{contracts-DRIuclVT.d.cts → contracts-CLqzJnOV.d.ts} +28 -17
  40. package/dist/{contracts-DRIuclVT.d.ts → contracts-CTOJXu-x.d.cts} +28 -17
  41. package/dist/{customElement-MmInOW1U.d.ts → customElement-pYDKUzWl.d.cts} +11 -3
  42. package/dist/{customElement-MmInOW1U.d.cts → customElement-pYDKUzWl.d.ts} +11 -3
  43. package/dist/data.cjs +205 -39
  44. package/dist/data.d.cts +119 -3
  45. package/dist/data.d.ts +119 -3
  46. package/dist/data.js +6 -6
  47. package/dist/devtools.cjs +18 -5
  48. package/dist/devtools.js +5 -5
  49. package/dist/ecosystem.cjs +462 -58
  50. package/dist/ecosystem.d.cts +2 -1
  51. package/dist/ecosystem.d.ts +2 -1
  52. package/dist/ecosystem.js +9 -8
  53. package/dist/extras.cjs +852 -296
  54. package/dist/extras.d.cts +5 -4
  55. package/dist/extras.d.ts +5 -4
  56. package/dist/extras.js +24 -23
  57. package/dist/index.cjs +721 -176
  58. package/dist/index.d.cts +220 -169
  59. package/dist/index.d.ts +220 -169
  60. package/dist/index.js +16 -12
  61. package/dist/motion.cjs +12 -4
  62. package/dist/motion.js +3 -3
  63. package/dist/patterns.cjs +37 -21
  64. package/dist/patterns.d.cts +2 -1
  65. package/dist/patterns.d.ts +2 -1
  66. package/dist/patterns.js +6 -6
  67. package/dist/performance.cjs +48 -6
  68. package/dist/performance.d.cts +12 -2
  69. package/dist/performance.d.ts +12 -2
  70. package/dist/performance.js +8 -6
  71. package/dist/plugins.cjs +672 -261
  72. package/dist/plugins.d.cts +131 -13
  73. package/dist/plugins.d.ts +131 -13
  74. package/dist/plugins.js +83 -47
  75. package/dist/{ssr-XOTUASDO.js → ssr-5OWAH3U2.js} +4 -2
  76. package/dist/{ssr-Bli9XRW5.d.cts → ssr-C8hgIAw7.d.cts} +6 -0
  77. package/dist/{ssr-Bli9XRW5.d.ts → ssr-C8hgIAw7.d.ts} +6 -0
  78. package/dist/ssr.cjs +509 -142
  79. package/dist/ssr.d.cts +55 -5
  80. package/dist/ssr.d.ts +55 -5
  81. package/dist/ssr.js +11 -9
  82. package/dist/{tagFactory-DFstCLQV.d.cts → tagFactory-8qL9LCIx.d.cts} +58 -19
  83. package/dist/{tagFactory-DkaNVUNV.d.ts → tagFactory-BL2fymez.d.ts} +58 -19
  84. package/dist/testing.cjs +17 -4
  85. package/dist/testing.js +4 -4
  86. package/dist/types-CJFViL6Q.d.cts +26 -0
  87. package/dist/types-CJFViL6Q.d.ts +26 -0
  88. package/dist/ui.cjs +635 -254
  89. package/dist/ui.d.cts +3 -2
  90. package/dist/ui.d.ts +3 -2
  91. package/dist/ui.js +9 -8
  92. package/dist/widgets.cjs +22 -14
  93. package/dist/widgets.js +7 -7
  94. package/package.json +8 -5
package/dist/ui.d.cts CHANGED
@@ -1,5 +1,6 @@
1
- export { A as AttributeSource, a as AttributeValue, B as BoundFieldProps, C as CustomElementOptions, F as FieldConfig, b as FocusTrap, c as FormConfig, d as FormField, e as FormReturn, I as IntersectionResult, M as MaskOptions, P as PaginationResult, T as Toast, f as ToastInstance, V as ValidatorFn, g as VirtualList, h as VirtualListProps, _ as __resetDialogStack, i as announce, j as aria, k as bindAttrs, l as bindBoolAttr, m as bindData, n as bindField, o as creditCardMask, p as custom, q as dateMask, r as defineElement, s as dialog, t as email, u as eventBus, v as focus, w as form, x as hotkey, y as infiniteScroll, z as inputMask, D as intersection, E as lazyLoad, G as matchesPattern, H as max, J as maxLength, K as min, L as minLength, N as pagination, O as phoneMask, Q as removeScopedStyle, R as required, S as scopedStyle, U as ssnMask, W as svgElement, X as timeMask, Y as toast, Z as withScopedStyle, $ as zipMask } from './customElement-MmInOW1U.cjs';
2
- 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.cjs';
1
+ export { A as AttributeSource, a as AttributeValue, B as BoundFieldProps, C as CustomElementOptions, F as FieldConfig, b as FocusTrap, c as FormConfig, d as FormField, e as FormReturn, I as IntersectionResult, M as MaskOptions, P as PaginationResult, T as Toast, f as ToastInstance, V as ValidatorFn, g as VirtualList, h as VirtualListProps, _ as __resetDialogStack, i as announce, j as aria, k as bindAttrs, l as bindBoolAttr, m as bindData, n as bindField, o as creditCardMask, p as custom, q as dateMask, r as defineElement, s as dialog, t as email, u as eventBus, v as focus, w as form, x as hotkey, y as infiniteScroll, z as inputMask, D as intersection, E as lazyLoad, G as matchesPattern, H as max, J as maxLength, K as min, L as minLength, N as pagination, O as phoneMask, Q as removeScopedStyle, R as required, S as scopedStyle, U as ssnMask, W as svgElement, X as timeMask, Y as toast, Z as withScopedStyle, $ as zipMask } from './customElement-pYDKUzWl.cjs';
2
+ 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-CTOJXu-x.cjs';
3
+ import './types-CJFViL6Q.cjs';
3
4
 
4
5
  /** The parts of a form-action handle available for every action signature. */
5
6
  interface FormActionState<TArgs extends unknown[], TResult> {
package/dist/ui.d.ts CHANGED
@@ -1,5 +1,6 @@
1
- export { A as AttributeSource, a as AttributeValue, B as BoundFieldProps, C as CustomElementOptions, F as FieldConfig, b as FocusTrap, c as FormConfig, d as FormField, e as FormReturn, I as IntersectionResult, M as MaskOptions, P as PaginationResult, T as Toast, f as ToastInstance, V as ValidatorFn, g as VirtualList, h as VirtualListProps, _ as __resetDialogStack, i as announce, j as aria, k as bindAttrs, l as bindBoolAttr, m as bindData, n as bindField, o as creditCardMask, p as custom, q as dateMask, r as defineElement, s as dialog, t as email, u as eventBus, v as focus, w as form, x as hotkey, y as infiniteScroll, z as inputMask, D as intersection, E as lazyLoad, G as matchesPattern, H as max, J as maxLength, K as min, L as minLength, N as pagination, O as phoneMask, Q as removeScopedStyle, R as required, S as scopedStyle, U as ssnMask, W as svgElement, X as timeMask, Y as toast, Z as withScopedStyle, $ as zipMask } from './customElement-MmInOW1U.js';
2
- 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';
1
+ export { A as AttributeSource, a as AttributeValue, B as BoundFieldProps, C as CustomElementOptions, F as FieldConfig, b as FocusTrap, c as FormConfig, d as FormField, e as FormReturn, I as IntersectionResult, M as MaskOptions, P as PaginationResult, T as Toast, f as ToastInstance, V as ValidatorFn, g as VirtualList, h as VirtualListProps, _ as __resetDialogStack, i as announce, j as aria, k as bindAttrs, l as bindBoolAttr, m as bindData, n as bindField, o as creditCardMask, p as custom, q as dateMask, r as defineElement, s as dialog, t as email, u as eventBus, v as focus, w as form, x as hotkey, y as infiniteScroll, z as inputMask, D as intersection, E as lazyLoad, G as matchesPattern, H as max, J as maxLength, K as min, L as minLength, N as pagination, O as phoneMask, Q as removeScopedStyle, R as required, S as scopedStyle, U as ssnMask, W as svgElement, X as timeMask, Y as toast, Z as withScopedStyle, $ as zipMask } from './customElement-pYDKUzWl.js';
2
+ 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-CLqzJnOV.js';
3
+ import './types-CJFViL6Q.js';
3
4
 
4
5
  /** The parts of a form-action handle available for every action signature. */
5
6
  interface FormActionState<TArgs extends unknown[], TResult> {
package/dist/ui.js CHANGED
@@ -38,7 +38,7 @@ import {
38
38
  toast,
39
39
  withScopedStyle,
40
40
  zipMask
41
- } from "./chunk-SXXVZMKZ.js";
41
+ } from "./chunk-ZVLHNEEL.js";
42
42
  import {
43
43
  RenderProp,
44
44
  assertType,
@@ -57,23 +57,24 @@ import {
57
57
  } from "./chunk-TUCPL2HB.js";
58
58
  import {
59
59
  createId
60
- } from "./chunk-3ISI6ACU.js";
61
- import "./chunk-47M47FOM.js";
62
- import "./chunk-QE4TTDU3.js";
63
- import "./chunk-2INLLLMZ.js";
60
+ } from "./chunk-C7AA2CZX.js";
61
+ import "./chunk-O6TRVMJI.js";
62
+ import "./chunk-3ACAAQIN.js";
63
+ import "./chunk-KJ3UKABJ.js";
64
64
  import {
65
65
  globalSingleton
66
66
  } from "./chunk-7ZHH77QA.js";
67
67
  import {
68
68
  effect
69
- } from "./chunk-XC4MEKGA.js";
69
+ } from "./chunk-V3LHZSU5.js";
70
+ import "./chunk-EXXSN3BW.js";
70
71
  import "./chunk-7XHATCIH.js";
71
72
  import "./chunk-5HZXGZ6T.js";
72
73
  import {
73
74
  batch,
74
75
  signal
75
- } from "./chunk-D33YTSX5.js";
76
- import "./chunk-5Q4R7HCL.js";
76
+ } from "./chunk-DSID757X.js";
77
+ import "./chunk-TQQUN4WR.js";
77
78
  import {
78
79
  registerDisposer,
79
80
  unregisterDisposer
package/dist/widgets.cjs CHANGED
@@ -709,7 +709,7 @@ function forEachSubscriber(signal2, visit) {
709
709
  }
710
710
 
711
711
  // src/reactivity/track.ts
712
- var _runtimeVersion = true ? "4.6.0" : "dev";
712
+ var _runtimeVersion = true ? "4.8.0" : "dev";
713
713
  var REGISTRY_KEY = /* @__PURE__ */ Symbol.for("sibujs.reactive.v1");
714
714
  function resolveReactiveApi() {
715
715
  const g = globalThis;
@@ -765,6 +765,14 @@ var getSubscriberCount2 = API.getSubscriberCount;
765
765
  var getSubscriberDeps2 = API.getSubscriberDeps;
766
766
  var forEachSubscriber2 = API.forEachSubscriber;
767
767
 
768
+ // src/core/devtoolsHook.ts
769
+ function emitDevtools(hook, event, payload) {
770
+ try {
771
+ hook.emit(event, payload);
772
+ } catch {
773
+ }
774
+ }
775
+
768
776
  // src/core/signals/derived.ts
769
777
  function derived(getter, options) {
770
778
  devAssert(typeof getter === "function", "derived: argument must be a getter function.");
@@ -791,17 +799,17 @@ function derived(getter, options) {
791
799
  cs._d = false;
792
800
  cs._init = true;
793
801
  };
794
- track2(() => {
795
- let threw = true;
796
- try {
802
+ try {
803
+ track2(() => {
797
804
  cs._v = getter();
798
805
  cs._d = false;
799
806
  cs._init = true;
800
- threw = false;
801
- } finally {
802
- if (threw) cs._d = true;
803
- }
804
- }, markDirty);
807
+ }, markDirty);
808
+ } catch (err) {
809
+ disposed = true;
810
+ cleanup2(markDirty);
811
+ throw err;
812
+ }
805
813
  const hook = globalThis.__SIBU_DEVTOOLS_GLOBAL_HOOK__;
806
814
  const validate = () => {
807
815
  if (!cs._d || disposed || pendingError !== void 0) return;
@@ -820,7 +828,7 @@ function derived(getter, options) {
820
828
  if (disposed) cleanup2(markDirty);
821
829
  }
822
830
  if (hook && !disposed && !Object.is(oldValue, cs._v)) {
823
- hook.emit("computed:update", { signal: cs, oldValue, newValue: cs._v });
831
+ emitDevtools(hook, "computed:update", { signal: cs, oldValue, newValue: cs._v });
824
832
  }
825
833
  };
826
834
  cs._validate = validate;
@@ -871,7 +879,7 @@ function derived(getter, options) {
871
879
  }
872
880
  }
873
881
  };
874
- if (hook) hook.emit("computed:create", { signal: cs, name: debugName, getter: computedGetter });
882
+ if (hook) emitDevtools(hook, "computed:create", { signal: cs, name: debugName, getter: computedGetter });
875
883
  return computedGetter;
876
884
  }
877
885
 
@@ -958,7 +966,7 @@ function signal(initial, options) {
958
966
  state2.__v++;
959
967
  if (DEV) {
960
968
  const hook = _g.__SIBU_DEVTOOLS_GLOBAL_HOOK__;
961
- if (hook) hook.emit("signal:update", { signal: state2, name: debugName, oldValue: prev, newValue });
969
+ if (hook) emitDevtools(hook, "signal:update", { signal: state2, name: debugName, oldValue: prev, newValue });
962
970
  }
963
971
  if (!enqueueBatchedSignal(state2)) {
964
972
  notifySubscribers2(state2);
@@ -972,7 +980,7 @@ function signal(initial, options) {
972
980
  state2.value = newValue;
973
981
  state2.__v++;
974
982
  const hook = _g.__SIBU_DEVTOOLS_GLOBAL_HOOK__;
975
- if (hook) hook.emit("signal:update", { signal: state2, name: debugName, oldValue: prev, newValue });
983
+ if (hook) emitDevtools(hook, "signal:update", { signal: state2, name: debugName, oldValue: prev, newValue });
976
984
  if (!enqueueBatchedSignal(state2)) {
977
985
  notifySubscribers2(state2);
978
986
  }
@@ -991,7 +999,7 @@ function signal(initial, options) {
991
999
  }
992
1000
  if (DEV) {
993
1001
  const hook = _g.__SIBU_DEVTOOLS_GLOBAL_HOOK__;
994
- if (hook) hook.emit("signal:create", { signal: state2, name: debugName, getter: get, initial });
1002
+ if (hook) emitDevtools(hook, "signal:create", { signal: state2, name: debugName, getter: get, initial });
995
1003
  }
996
1004
  return [get, set];
997
1005
  }
package/dist/widgets.js CHANGED
@@ -8,14 +8,14 @@ import {
8
8
  select,
9
9
  tabs,
10
10
  tooltip
11
- } from "./chunk-HYXDKS4N.js";
12
- import "./chunk-UZQ6ALFS.js";
13
- import "./chunk-3ISI6ACU.js";
14
- import "./chunk-QE4TTDU3.js";
15
- import "./chunk-2INLLLMZ.js";
11
+ } from "./chunk-GSGNX35Q.js";
12
+ import "./chunk-CZPRSWSS.js";
13
+ import "./chunk-C7AA2CZX.js";
14
+ import "./chunk-KJ3UKABJ.js";
15
+ import "./chunk-EXXSN3BW.js";
16
16
  import "./chunk-7XHATCIH.js";
17
- import "./chunk-D33YTSX5.js";
18
- import "./chunk-5Q4R7HCL.js";
17
+ import "./chunk-DSID757X.js";
18
+ import "./chunk-TQQUN4WR.js";
19
19
  import "./chunk-NYNYSPK7.js";
20
20
  export {
21
21
  accordion,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sibujs",
3
- "version": "4.6.0",
3
+ "version": "4.8.0",
4
4
  "description": "A function-based frontend framework with fine-grained reactivity and no virtual DOM. Tag factories return live DOM nodes you can hold and mutate, signals update only what changed, and nothing needs a compiler — it runs from a script tag or a bundler.",
5
5
  "keywords": [
6
6
  "frontend",
@@ -39,6 +39,7 @@
39
39
  "test:soak:gc": "node --expose-gc ./node_modules/vitest/vitest.mjs run -c vitest.soak.config.ts",
40
40
  "typecheck": "tsc --noEmit",
41
41
  "typecheck:tests": "tsc -p tsconfig.test.json",
42
+ "hooks:install": "node scripts/hooks/install.mjs",
42
43
  "certify:rc": "node scripts/certify/run.mjs",
43
44
  "build": "tsup index.ts data.ts browser.ts patterns.ts motion.ts ui.ts widgets.ts ssr.ts devtools.ts performance.ts ecosystem.ts plugins.ts build.ts testing.ts extras.ts --dts --format esm,cjs --out-dir dist --clean && tsup --config tsup.cdn.config.ts",
44
45
  "example:chess:build": "node scripts/build-example-chess.mjs",
@@ -49,7 +50,8 @@
49
50
  "bench:save": "node bench.mjs --save",
50
51
  "bench:check": "node bench.mjs --compare",
51
52
  "publish:npm": "node publish.mjs",
52
- "prepublishOnly": "npm run build"
53
+ "prepublishOnly": "npm run build",
54
+ "prepare": "node scripts/hooks/install.mjs"
53
55
  },
54
56
  "types": "dist/index.d.ts",
55
57
  "exports": {
@@ -157,14 +159,15 @@
157
159
  "@biomejs/biome": "2.4.7",
158
160
  "@playwright/test": "^1.61.1",
159
161
  "@types/node": "^22.20.1",
160
- "@vitest/coverage-v8": "^3.1.3",
161
- "@vitest/ui": "^3.1.3",
162
+ "@vitest/coverage-v8": "^4.1.11",
163
+ "@vitest/ui": "^4.1.11",
162
164
  "chess.js": "^1.4.0",
163
165
  "esbuild": "^0.27.7",
164
166
  "fake-indexeddb": "^6.2.5",
165
167
  "jsdom": "^26.1.0",
166
168
  "tsup": "^8.5.1",
167
169
  "typescript": "^5.8.3",
168
- "vitest": "^3.1.3"
170
+ "vite": "^6.4.3",
171
+ "vitest": "^4.1.11"
169
172
  }
170
173
  }