sibujs 4.4.0 → 4.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.
Files changed (74) hide show
  1. package/README.md +11 -0
  2. package/dist/browser.cjs +31 -2
  3. package/dist/browser.d.cts +15 -2
  4. package/dist/browser.d.ts +15 -2
  5. package/dist/browser.js +4 -4
  6. package/dist/build.cjs +92 -13
  7. package/dist/build.js +10 -10
  8. package/dist/cdn.dev.global.js +9 -9
  9. package/dist/cdn.full.dev.global.js +10 -10
  10. package/dist/cdn.full.global.js +9 -9
  11. package/dist/cdn.global.js +9 -9
  12. package/dist/{chunk-XLO7SLIX.js → chunk-2DCGACUU.js} +16 -9
  13. package/dist/{chunk-6GSIXTWX.js → chunk-3JZ4L5TJ.js} +10 -4
  14. package/dist/{chunk-UCALUKB5.js → chunk-4PMLNECI.js} +4 -4
  15. package/dist/{chunk-RR7M3FHM.js → chunk-7LN645I6.js} +1 -1
  16. package/dist/{chunk-SKPTERHP.js → chunk-B3WHI2QA.js} +1 -1
  17. package/dist/{chunk-4Z3SPQ67.js → chunk-FTIR4QW2.js} +13 -3
  18. package/dist/{chunk-HFCOH2GN.js → chunk-GW3SCCZG.js} +4 -4
  19. package/dist/{chunk-PNIRUQ4C.js → chunk-KEISJXBU.js} +2 -2
  20. package/dist/{chunk-LYVUX7NT.js → chunk-OMJJM3KM.js} +2 -2
  21. package/dist/{chunk-VCTAEPSB.js → chunk-ONOHFDLG.js} +9 -1
  22. package/dist/{chunk-36S2YPP4.js → chunk-PCT43HW3.js} +1 -1
  23. package/dist/{chunk-W2EQ7X2L.js → chunk-RBTPLM32.js} +46 -8
  24. package/dist/{chunk-7GIHSAWB.js → chunk-RIXRAYIU.js} +1 -1
  25. package/dist/{chunk-HQSEH5F6.js → chunk-RJE2BNI4.js} +3 -3
  26. package/dist/{chunk-ADM46X22.js → chunk-S373NSMK.js} +18 -13
  27. package/dist/{chunk-M2F7TZHH.js → chunk-TBYTO6BS.js} +2 -2
  28. package/dist/{chunk-3BTTCZ5J.js → chunk-UGRX3S57.js} +31 -2
  29. package/dist/{chunk-7NBDXVHS.js → chunk-VUF4ALSW.js} +1 -1
  30. package/dist/{chunk-LQFGQNMV.js → chunk-VZKNK2V7.js} +9 -4
  31. package/dist/{chunk-NVNJH22U.js → chunk-XZZOBQAY.js} +1 -1
  32. package/dist/{customElement-CNZxEB9G.d.ts → customElement-OB9CIsc5.d.cts} +38 -10
  33. package/dist/{customElement-CNZxEB9G.d.cts → customElement-OB9CIsc5.d.ts} +38 -10
  34. package/dist/data.cjs +81 -9
  35. package/dist/data.js +6 -6
  36. package/dist/devtools.cjs +41 -2
  37. package/dist/devtools.js +4 -4
  38. package/dist/ecosystem.cjs +83 -9
  39. package/dist/ecosystem.d.cts +13 -5
  40. package/dist/ecosystem.d.ts +13 -5
  41. package/dist/ecosystem.js +7 -7
  42. package/dist/extras.cjs +115 -14
  43. package/dist/extras.d.cts +2 -2
  44. package/dist/extras.d.ts +2 -2
  45. package/dist/extras.js +19 -19
  46. package/dist/index.cjs +92 -13
  47. package/dist/index.d.cts +24 -151
  48. package/dist/index.d.ts +24 -151
  49. package/dist/index.js +10 -10
  50. package/dist/motion.cjs +31 -2
  51. package/dist/motion.js +3 -3
  52. package/dist/patterns.cjs +81 -10
  53. package/dist/patterns.d.cts +5 -0
  54. package/dist/patterns.d.ts +5 -0
  55. package/dist/patterns.js +5 -5
  56. package/dist/performance.cjs +31 -2
  57. package/dist/performance.js +4 -4
  58. package/dist/plugins.cjs +39 -2
  59. package/dist/plugins.js +6 -6
  60. package/dist/ssr.cjs +39 -2
  61. package/dist/ssr.js +7 -7
  62. package/dist/tagFactory-DVoDpHye.d.cts +215 -0
  63. package/dist/tagFactory-DVoDpHye.d.ts +215 -0
  64. package/dist/testing.cjs +31 -2
  65. package/dist/testing.js +2 -2
  66. package/dist/ui.cjs +93 -13
  67. package/dist/ui.d.cts +1 -1
  68. package/dist/ui.d.ts +1 -1
  69. package/dist/ui.js +6 -6
  70. package/dist/widgets.cjs +75 -9
  71. package/dist/widgets.js +6 -6
  72. package/package.json +2 -2
  73. package/dist/tagFactory-Bzupt4Pj.d.cts +0 -55
  74. package/dist/tagFactory-Bzupt4Pj.d.ts +0 -55
package/dist/extras.cjs CHANGED
@@ -579,6 +579,15 @@ function untracked(fn) {
579
579
  var subscriberEpochCounter = 0;
580
580
  function retrack(effectFn, subscriber) {
581
581
  const prev = currentSubscriber;
582
+ let savedDepth = 0;
583
+ let savedSuspendSub = null;
584
+ if (trackingSuspended) {
585
+ savedDepth = suspendDepth;
586
+ savedSuspendSub = suspendSavedSub;
587
+ suspendDepth = 0;
588
+ suspendSavedSub = null;
589
+ trackingSuspended = false;
590
+ }
582
591
  currentSubscriber = subscriber;
583
592
  const sub2 = subscriber;
584
593
  const epoch = ++subscriberEpochCounter;
@@ -593,6 +602,11 @@ function retrack(effectFn, subscriber) {
593
602
  effectFn();
594
603
  } finally {
595
604
  currentSubscriber = prev;
605
+ if (savedDepth !== 0) {
606
+ suspendDepth = savedDepth;
607
+ suspendSavedSub = savedSuspendSub;
608
+ trackingSuspended = true;
609
+ }
596
610
  let node = sub2.depsHead ?? null;
597
611
  while (node !== null) {
598
612
  const next = node.subNext;
@@ -612,11 +626,25 @@ function track(effectFn, subscriber) {
612
626
  if (!subscriber) return reactiveBinding(effectFn);
613
627
  cleanup(subscriber);
614
628
  const prev = currentSubscriber;
629
+ let savedDepth = 0;
630
+ let savedSuspendSub = null;
631
+ if (trackingSuspended) {
632
+ savedDepth = suspendDepth;
633
+ savedSuspendSub = suspendSavedSub;
634
+ suspendDepth = 0;
635
+ suspendSavedSub = null;
636
+ trackingSuspended = false;
637
+ }
615
638
  currentSubscriber = subscriber;
616
639
  try {
617
640
  effectFn();
618
641
  } finally {
619
642
  currentSubscriber = prev;
643
+ if (savedDepth !== 0) {
644
+ suspendDepth = savedDepth;
645
+ suspendSavedSub = savedSuspendSub;
646
+ trackingSuspended = true;
647
+ }
620
648
  const sub3 = subscriber;
621
649
  for (let n = sub3.depsHead ?? null; n !== null; n = n.subNext) {
622
650
  const sig = n.sig;
@@ -787,8 +815,9 @@ function propagateDirty(sub2) {
787
815
  if (s2._c) {
788
816
  const nSig = s2._sig;
789
817
  if (nSig) {
790
- if (!nSig._d) {
818
+ if (!nSig._d || nSig._f === true) {
791
819
  nSig._d = true;
820
+ nSig._f = false;
792
821
  stack.push(nSig);
793
822
  }
794
823
  } else {
@@ -888,7 +917,7 @@ function forEachSubscriber(signal2, visit) {
888
917
  }
889
918
 
890
919
  // src/reactivity/track.ts
891
- var _runtimeVersion = true ? "4.4.0" : "dev";
920
+ var _runtimeVersion = true ? "4.5.0" : "dev";
892
921
  var REGISTRY_KEY = /* @__PURE__ */ Symbol.for("sibujs.reactive.v1");
893
922
  function resolveReactiveApi() {
894
923
  const g2 = globalThis;
@@ -952,10 +981,14 @@ function derived(getter, options) {
952
981
  const cs = {};
953
982
  cs._d = false;
954
983
  cs._init = false;
984
+ cs._f = false;
955
985
  cs._g = getter;
956
986
  cs.__v = 0;
987
+ let evaluating = false;
988
+ let disposed = false;
989
+ let pendingError;
957
990
  const markDirty = () => {
958
- if (cs._d) return;
991
+ if (cs._d || disposed) return;
959
992
  cs._d = true;
960
993
  };
961
994
  markDirty._c = 1;
@@ -978,33 +1011,53 @@ function derived(getter, options) {
978
1011
  }
979
1012
  }, markDirty);
980
1013
  const hook = globalThis.__SIBU_DEVTOOLS_GLOBAL_HOOK__;
981
- let evaluating = false;
982
1014
  const validate = () => {
983
- if (!cs._d) return;
1015
+ if (!cs._d || disposed || pendingError !== void 0) return;
984
1016
  const oldValue = cs._v;
985
1017
  evaluating = true;
986
1018
  try {
987
1019
  retrack2(recompute, markDirty);
988
1020
  if (!Object.is(oldValue, cs._v)) cs.__v++;
1021
+ } catch (err) {
1022
+ pendingError = { error: err };
1023
+ cs.__v++;
1024
+ if (disposed) cs._d = true;
1025
+ else cs._f = true;
989
1026
  } finally {
990
1027
  evaluating = false;
1028
+ if (disposed) cleanup2(markDirty);
991
1029
  }
992
- if (hook && !Object.is(oldValue, cs._v)) {
1030
+ if (hook && !disposed && !Object.is(oldValue, cs._v)) {
993
1031
  hook.emit("computed:update", { signal: cs, oldValue, newValue: cs._v });
994
1032
  }
995
1033
  };
996
1034
  cs._validate = validate;
1035
+ const throwPending = () => {
1036
+ const { error } = pendingError;
1037
+ pendingError = void 0;
1038
+ if (disposed) cs._d = false;
1039
+ throw error;
1040
+ };
997
1041
  function computedGetter() {
998
1042
  if (evaluating) {
999
1043
  throw new Error(
1000
1044
  `[SibuJS] Circular dependency detected in derived${debugName ? ` "${debugName}"` : ""}. A derived signal cannot read itself (directly or through a chain).`
1001
1045
  );
1002
1046
  }
1003
- if (isTrackingSuspended2()) {
1004
- if (cs._d) validate();
1047
+ if (isTrackingSuspended2() || disposed) {
1048
+ if (cs._d) {
1049
+ validate();
1050
+ if (pendingError !== void 0) throwPending();
1051
+ }
1005
1052
  return cs._v;
1006
1053
  }
1007
- if (cs._d) validate();
1054
+ if (cs._d) {
1055
+ validate();
1056
+ if (pendingError !== void 0) {
1057
+ recordDependency2(cs);
1058
+ throwPending();
1059
+ }
1060
+ }
1008
1061
  recordDependency2(cs);
1009
1062
  return cs._v;
1010
1063
  }
@@ -1013,6 +1066,19 @@ function derived(getter, options) {
1013
1066
  cs.__name = debugName;
1014
1067
  }
1015
1068
  computedGetter.__signal = cs;
1069
+ computedGetter.dispose = () => {
1070
+ if (disposed) return;
1071
+ disposed = true;
1072
+ cs._d = pendingError !== void 0;
1073
+ cleanup2(markDirty);
1074
+ const h = globalThis.__SIBU_DEVTOOLS_GLOBAL_HOOK__;
1075
+ if (h) {
1076
+ try {
1077
+ h.emit("computed:destroy", { signal: cs, getter: computedGetter });
1078
+ } catch {
1079
+ }
1080
+ }
1081
+ };
1016
1082
  if (hook) hook.emit("computed:create", { signal: cs, name: debugName, getter: computedGetter });
1017
1083
  return computedGetter;
1018
1084
  }
@@ -1686,6 +1752,8 @@ function query(key, fetcher, options = {}) {
1686
1752
  if (disposed) return;
1687
1753
  disposed = true;
1688
1754
  effectCleanup();
1755
+ loading.dispose();
1756
+ isStale.dispose();
1689
1757
  if (intervalTimer) clearInterval(intervalTimer);
1690
1758
  detachFromEntry();
1691
1759
  if (focusHandler && typeof globalThis.removeEventListener === "function") {
@@ -1975,6 +2043,10 @@ function infiniteQuery(key, fetcher, options) {
1975
2043
  disposed = true;
1976
2044
  abortController?.abort();
1977
2045
  effectCleanup();
2046
+ data2.dispose();
2047
+ loading.dispose();
2048
+ hasNextPage.dispose();
2049
+ hasPreviousPage.dispose();
1978
2050
  }
1979
2051
  return {
1980
2052
  data: data2,
@@ -4924,7 +4996,12 @@ function timeline(initial, maxHistory = 100) {
4924
4996
  setIndex(targetIndex);
4925
4997
  }
4926
4998
  }
4927
- return { value, set, undo, redo, canUndo, canRedo, history: history2, index, reset, jumpTo };
4999
+ function dispose2() {
5000
+ value.dispose();
5001
+ canUndo.dispose();
5002
+ canRedo.dispose();
5003
+ }
5004
+ return { value, set, undo, redo, canUndo, canRedo, history: history2, index, reset, jumpTo, dispose: dispose2 };
4928
5005
  }
4929
5006
 
4930
5007
  // src/patterns/globalStore.ts
@@ -6576,6 +6653,14 @@ function setSafeAttribute(el, name, value, options = {}) {
6576
6653
  const html2 = isHtmlElement(el);
6577
6654
  const idlName = html2 ? name.toLowerCase() : name;
6578
6655
  if (typeof value === "boolean") {
6656
+ if (name.length > 5 && name.slice(0, 5).toLowerCase() === "aria-") {
6657
+ const token = value ? "true" : "false";
6658
+ if ((ns ? el.getAttributeNS(ns, localName) : el.getAttribute(name)) !== token) {
6659
+ if (ns) el.setAttributeNS(ns, name, token);
6660
+ else el.setAttribute(name, token);
6661
+ }
6662
+ return true;
6663
+ }
6579
6664
  if (html2 && BOOLEAN_IDL_ATTRS.has(idlName) && idlName in el) {
6580
6665
  setProp(el, idlName, value);
6581
6666
  } else if (value) {
@@ -6649,13 +6734,13 @@ function bindBoolAttr(el, attr, getter) {
6649
6734
  let value;
6650
6735
  try {
6651
6736
  value = reactiveGetter();
6652
- } catch {
6737
+ } catch (err) {
6738
+ reportError(err, { phase: "binding", name: "bindBoolAttr", node: el });
6653
6739
  return;
6654
6740
  }
6655
6741
  setSafeAttribute(el, attr, Boolean(value), { label: "bindBoolAttr" });
6656
6742
  }
6657
- const teardown = track2(commit);
6658
- return teardown;
6743
+ return reactiveBinding2(commit, el);
6659
6744
  }
6660
6745
  function bindData(el, key, getter) {
6661
6746
  const dataAttr = `data-${key}`;
@@ -6919,7 +7004,13 @@ function pagination(options) {
6919
7004
  const clamped = Math.max(1, Math.min(target, totalPages()));
6920
7005
  setPage(clamped);
6921
7006
  }
6922
- return { page: currentPage, pageSize, totalPages, next, prev, goTo, startIndex, endIndex };
7007
+ function dispose2() {
7008
+ startIndex.dispose();
7009
+ endIndex.dispose();
7010
+ currentPage.dispose();
7011
+ totalPages.dispose();
7012
+ }
7013
+ return { page: currentPage, pageSize, totalPages, next, prev, goTo, startIndex, endIndex, dispose: dispose2 };
6923
7014
  }
6924
7015
 
6925
7016
  // src/ui/eventBus.ts
@@ -11098,6 +11189,16 @@ function initDevTools(config) {
11098
11189
  });
11099
11190
  emit();
11100
11191
  });
11192
+ hook.on("computed:destroy", (payload) => {
11193
+ const p2 = payload;
11194
+ for (const [id, node] of hook.nodes) {
11195
+ if (node.ref === p2.signal) {
11196
+ hook.nodes.delete(id);
11197
+ break;
11198
+ }
11199
+ }
11200
+ emit();
11201
+ });
11101
11202
  hook.on("effect:create", (payload) => {
11102
11203
  _dt.nextNodeId++;
11103
11204
  const name = inferName();
package/dist/extras.d.cts CHANGED
@@ -3,7 +3,7 @@ export { AnimationFrameOptions, BoundsRect, GamepadSnapshot, ImageLoaderState, K
3
3
  export { GlobalStore, MachineConfig, MachineReturn, Middleware, PersistOptions, Selector, StoreActionMap, TimeTravelReturn, globalStore, machine, optimistic, optimisticList, persisted, timeline } from './patterns.cjs';
4
4
  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.cjs';
5
5
  export { AnimationPreset, PresetOptions, SlideDirection, SpringOptions, TransitionGroup, TransitionGroupOptions, TransitionOptions, animate, bounceIn, bounceOut, fadeIn, fadeOut, flipIn, prefersReducedMotion, pulse, reducedMotion, scaleDown, scaleUp, sequence, shake, slideIn, slideOut, spring, springSignal, stagger, transition, viewTransition } from './motion.cjs';
6
- 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, 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, P as removeScopedStyle, Q as required, R as scopedStyle, S as ssnMask, U as svgElement, W as timeMask, X as toast, Y as withScopedStyle, Z as zipMask } from './customElement-CNZxEB9G.cjs';
6
+ 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-OB9CIsc5.cjs';
7
7
  export { ChunkConfig, DOMPool, Features, NormalizeResult, NormalizedEntities, NormalizedSchema, NormalizedState, NormalizedStoreActions, Priority, PriorityLevel, block, cloneTemplate, conditional, createChunkRegistry, deferredValue, denormalize, devOnly, flushScheduler, getDOMPool, hoistable, lazyChunk, noSideEffect, normalize, normalizedStore, pendingTasks, precompile, prefetch, preloadImage, preloadModule, preloadModules, preloadResource, processInChunks, pure, resetIdCounter, scheduleUpdate, setIdPrefix, startTransition, staticTemplate, transitionState, uniqueId, yieldToMain } from './performance.cjs';
8
8
  export { ActionFn, ActionResult, Head, ISROptions, LoadRemoteModuleOptions, LoadWasmOptions, MicroApp, MicroAppConfig, MiddlewareFn, SSGOptions, SSGResult, ScrollRestorationOptions, ServiceWorkerState, SharedScope, UseWorkerFnReturn, UseWorkerReturn, WasmConfig, WasmModuleState, WorkerPool, clearWasmCache, composeMiddleware, createAction, createISR, createMicroApp, createMiddlewareChain, createSharedScope, createWasmBridge, createWorkerPool, defineRemoteComponent, generateStaticSite, isWasmCached, loadRemoteModule, loadWasmModule, loadWasmModuleWithOptions, preloadWasm, scrollRestoration, serviceWorker, setCanonical, setStructuredData, wasm, worker, workerFn } from './ssr.cjs';
9
9
  export { H as HydrateOptions, a as HydrationMismatch, T as TrustedHTML, c as collectStream, d as deserializeState, e as escapeScriptJson, h as hydrate, b as hydrateIslands, f as hydrateProgressively, i as isDangerousMetaRefresh, g as island, r as renderToDocument, j as renderToReadableStream, k as renderToStream, l as renderToString, m as renderToSuspenseStream, n as resetSSRState, s as serializeState, o as ssrSuspense, p as suspenseSwapScript, t as trustHTML } from './ssr-BiPRdZ6n.cjs';
@@ -13,4 +13,4 @@ export { D as DevToolsEvent, a as DevtoolsOverlayOptions, P as ProfilerResult, R
13
13
  export { AccordionAriaBinding, AccordionOptions, ComboboxOptions, DatePickerOptions, FileUploadOptions, SelectOptions, SetContentOptions, TabsAriaBinding, TabsOptions, accordion, combobox, contentEditable, datePicker, fileUpload, popover, select, tabs, tooltip } from './widgets.cjs';
14
14
  export { AdaptedComponent, AdaptedComponentProps, AdapterConfig, ComponentMapping, MobXAdapterAPI, MobXAdapterOptions, MobXReactionDisposer, ReduxAdapterAPI, ReduxAdapterOptions, ReduxStore, ThemeAPI, ThemeConfig, ZustandAdapterAPI, ZustandAdapterOptions, ZustandStore, antdAdapter, chakraAdapter, componentAdapter, createTheme, materialAdapter, mobXAdapter, reduxAdapter, zustandAdapter } from './ecosystem.cjs';
15
15
  import './signal-BnWpq6WB.cjs';
16
- import './tagFactory-Bzupt4Pj.cjs';
16
+ import './tagFactory-DVoDpHye.cjs';
package/dist/extras.d.ts CHANGED
@@ -3,7 +3,7 @@ export { AnimationFrameOptions, BoundsRect, GamepadSnapshot, ImageLoaderState, K
3
3
  export { GlobalStore, MachineConfig, MachineReturn, Middleware, PersistOptions, Selector, StoreActionMap, TimeTravelReturn, globalStore, machine, optimistic, optimisticList, persisted, timeline } from './patterns.js';
4
4
  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';
5
5
  export { AnimationPreset, PresetOptions, SlideDirection, SpringOptions, TransitionGroup, TransitionGroupOptions, TransitionOptions, animate, bounceIn, bounceOut, fadeIn, fadeOut, flipIn, prefersReducedMotion, pulse, reducedMotion, scaleDown, scaleUp, sequence, shake, slideIn, slideOut, spring, springSignal, stagger, transition, viewTransition } from './motion.js';
6
- 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, 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, P as removeScopedStyle, Q as required, R as scopedStyle, S as ssnMask, U as svgElement, W as timeMask, X as toast, Y as withScopedStyle, Z as zipMask } from './customElement-CNZxEB9G.js';
6
+ 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-OB9CIsc5.js';
7
7
  export { ChunkConfig, DOMPool, Features, NormalizeResult, NormalizedEntities, NormalizedSchema, NormalizedState, NormalizedStoreActions, Priority, PriorityLevel, block, cloneTemplate, conditional, createChunkRegistry, deferredValue, denormalize, devOnly, flushScheduler, getDOMPool, hoistable, lazyChunk, noSideEffect, normalize, normalizedStore, pendingTasks, precompile, prefetch, preloadImage, preloadModule, preloadModules, preloadResource, processInChunks, pure, resetIdCounter, scheduleUpdate, setIdPrefix, startTransition, staticTemplate, transitionState, uniqueId, yieldToMain } from './performance.js';
8
8
  export { ActionFn, ActionResult, Head, ISROptions, LoadRemoteModuleOptions, LoadWasmOptions, MicroApp, MicroAppConfig, MiddlewareFn, SSGOptions, SSGResult, ScrollRestorationOptions, ServiceWorkerState, SharedScope, UseWorkerFnReturn, UseWorkerReturn, WasmConfig, WasmModuleState, WorkerPool, clearWasmCache, composeMiddleware, createAction, createISR, createMicroApp, createMiddlewareChain, createSharedScope, createWasmBridge, createWorkerPool, defineRemoteComponent, generateStaticSite, isWasmCached, loadRemoteModule, loadWasmModule, loadWasmModuleWithOptions, preloadWasm, scrollRestoration, serviceWorker, setCanonical, setStructuredData, wasm, worker, workerFn } from './ssr.js';
9
9
  export { H as HydrateOptions, a as HydrationMismatch, T as TrustedHTML, c as collectStream, d as deserializeState, e as escapeScriptJson, h as hydrate, b as hydrateIslands, f as hydrateProgressively, i as isDangerousMetaRefresh, g as island, r as renderToDocument, j as renderToReadableStream, k as renderToStream, l as renderToString, m as renderToSuspenseStream, n as resetSSRState, s as serializeState, o as ssrSuspense, p as suspenseSwapScript, t as trustHTML } from './ssr-BiPRdZ6n.js';
@@ -13,4 +13,4 @@ export { D as DevToolsEvent, a as DevtoolsOverlayOptions, P as ProfilerResult, R
13
13
  export { AccordionAriaBinding, AccordionOptions, ComboboxOptions, DatePickerOptions, FileUploadOptions, SelectOptions, SetContentOptions, TabsAriaBinding, TabsOptions, accordion, combobox, contentEditable, datePicker, fileUpload, popover, select, tabs, tooltip } from './widgets.js';
14
14
  export { AdaptedComponent, AdaptedComponentProps, AdapterConfig, ComponentMapping, MobXAdapterAPI, MobXAdapterOptions, MobXReactionDisposer, ReduxAdapterAPI, ReduxAdapterOptions, ReduxStore, ThemeAPI, ThemeConfig, ZustandAdapterAPI, ZustandAdapterOptions, ZustandStore, antdAdapter, chakraAdapter, componentAdapter, createTheme, materialAdapter, mobXAdapter, reduxAdapter, zustandAdapter } from './ecosystem.js';
15
15
  import './signal-BnWpq6WB.js';
16
- import './tagFactory-Bzupt4Pj.js';
16
+ import './tagFactory-DVoDpHye.js';
package/dist/extras.js CHANGED
@@ -5,7 +5,7 @@ import {
5
5
  optimisticList,
6
6
  persisted,
7
7
  timeline
8
- } from "./chunk-LQFGQNMV.js";
8
+ } from "./chunk-VZKNK2V7.js";
9
9
  import {
10
10
  DOMPool,
11
11
  Features,
@@ -41,7 +41,7 @@ import {
41
41
  transitionState,
42
42
  uniqueId,
43
43
  yieldToMain
44
- } from "./chunk-M2F7TZHH.js";
44
+ } from "./chunk-TBYTO6BS.js";
45
45
  import {
46
46
  VERSION,
47
47
  bundlerMetadata,
@@ -88,7 +88,7 @@ import {
88
88
  wasm,
89
89
  worker,
90
90
  workerFn
91
- } from "./chunk-HQSEH5F6.js";
91
+ } from "./chunk-RJE2BNI4.js";
92
92
  import {
93
93
  FocusTrap,
94
94
  VirtualList,
@@ -129,7 +129,7 @@ import {
129
129
  toast,
130
130
  withScopedStyle,
131
131
  zipMask
132
- } from "./chunk-XLO7SLIX.js";
132
+ } from "./chunk-2DCGACUU.js";
133
133
  import {
134
134
  RenderProp,
135
135
  assertType,
@@ -156,7 +156,7 @@ import {
156
156
  select,
157
157
  tabs,
158
158
  tooltip
159
- } from "./chunk-HFCOH2GN.js";
159
+ } from "./chunk-GW3SCCZG.js";
160
160
  import {
161
161
  animationFrame,
162
162
  battery,
@@ -194,7 +194,7 @@ import {
194
194
  visibility,
195
195
  wakeLock,
196
196
  windowSize
197
- } from "./chunk-LYVUX7NT.js";
197
+ } from "./chunk-OMJJM3KM.js";
198
198
  import "./chunk-H3SRKIYX.js";
199
199
  import "./chunk-52XFPGSN.js";
200
200
  import {
@@ -219,7 +219,7 @@ import {
219
219
  syncAdapter,
220
220
  throttle,
221
221
  withRetry
222
- } from "./chunk-6GSIXTWX.js";
222
+ } from "./chunk-3JZ4L5TJ.js";
223
223
  import {
224
224
  SibuError,
225
225
  checkLeaks,
@@ -257,7 +257,7 @@ import {
257
257
  trackCleanup,
258
258
  walkDependencyGraph,
259
259
  withErrorTracking
260
- } from "./chunk-4Z3SPQ67.js";
260
+ } from "./chunk-FTIR4QW2.js";
261
261
  import {
262
262
  antdAdapter,
263
263
  chakraAdapter,
@@ -267,7 +267,7 @@ import {
267
267
  mobXAdapter,
268
268
  reduxAdapter,
269
269
  zustandAdapter
270
- } from "./chunk-UCALUKB5.js";
270
+ } from "./chunk-4PMLNECI.js";
271
271
  import {
272
272
  createPlugin,
273
273
  createPluginRegistry,
@@ -279,7 +279,7 @@ import {
279
279
  triggerPluginMount,
280
280
  triggerPluginUnmount
281
281
  } from "./chunk-WWV3SJ3L.js";
282
- import "./chunk-36S2YPP4.js";
282
+ import "./chunk-PCT43HW3.js";
283
283
  import {
284
284
  collectStream,
285
285
  deserializeState,
@@ -300,15 +300,15 @@ import {
300
300
  suspenseSwapScript,
301
301
  trustHTML
302
302
  } from "./chunk-NIOYEGBQ.js";
303
- import "./chunk-RR7M3FHM.js";
303
+ import "./chunk-7LN645I6.js";
304
304
  import "./chunk-CCSJMTRN.js";
305
- import "./chunk-7NBDXVHS.js";
306
- import "./chunk-PNIRUQ4C.js";
307
- import "./chunk-VCTAEPSB.js";
308
- import "./chunk-W2EQ7X2L.js";
305
+ import "./chunk-VUF4ALSW.js";
306
+ import "./chunk-KEISJXBU.js";
307
+ import "./chunk-ONOHFDLG.js";
308
+ import "./chunk-RBTPLM32.js";
309
309
  import "./chunk-IXKSNWV5.js";
310
310
  import "./chunk-7ZHH77QA.js";
311
- import "./chunk-7GIHSAWB.js";
311
+ import "./chunk-RIXRAYIU.js";
312
312
  import "./chunk-5DXA2J44.js";
313
313
  import {
314
314
  TransitionGroup,
@@ -332,10 +332,10 @@ import {
332
332
  stagger,
333
333
  transition,
334
334
  viewTransition
335
- } from "./chunk-SKPTERHP.js";
335
+ } from "./chunk-B3WHI2QA.js";
336
336
  import "./chunk-QKRPLZ2V.js";
337
- import "./chunk-NVNJH22U.js";
338
- import "./chunk-3BTTCZ5J.js";
337
+ import "./chunk-XZZOBQAY.js";
338
+ import "./chunk-UGRX3S57.js";
339
339
  import "./chunk-2WLZ6757.js";
340
340
  export {
341
341
  DOMPool,
package/dist/index.cjs CHANGED
@@ -729,6 +729,14 @@ function setSafeAttribute(el, name, value, options = {}) {
729
729
  const html3 = isHtmlElement(el);
730
730
  const idlName = html3 ? name.toLowerCase() : name;
731
731
  if (typeof value === "boolean") {
732
+ if (name.length > 5 && name.slice(0, 5).toLowerCase() === "aria-") {
733
+ const token = value ? "true" : "false";
734
+ if ((ns ? el.getAttributeNS(ns, localName) : el.getAttribute(name)) !== token) {
735
+ if (ns) el.setAttributeNS(ns, name, token);
736
+ else el.setAttribute(name, token);
737
+ }
738
+ return true;
739
+ }
732
740
  if (html3 && BOOLEAN_IDL_ATTRS.has(idlName) && idlName in el) {
733
741
  setProp(el, idlName, value);
734
742
  } else if (value) {
@@ -901,6 +909,15 @@ function untracked(fn) {
901
909
  var subscriberEpochCounter = 0;
902
910
  function retrack(effectFn, subscriber) {
903
911
  const prev = currentSubscriber;
912
+ let savedDepth = 0;
913
+ let savedSuspendSub = null;
914
+ if (trackingSuspended) {
915
+ savedDepth = suspendDepth;
916
+ savedSuspendSub = suspendSavedSub;
917
+ suspendDepth = 0;
918
+ suspendSavedSub = null;
919
+ trackingSuspended = false;
920
+ }
904
921
  currentSubscriber = subscriber;
905
922
  const sub2 = subscriber;
906
923
  const epoch = ++subscriberEpochCounter;
@@ -915,6 +932,11 @@ function retrack(effectFn, subscriber) {
915
932
  effectFn();
916
933
  } finally {
917
934
  currentSubscriber = prev;
935
+ if (savedDepth !== 0) {
936
+ suspendDepth = savedDepth;
937
+ suspendSavedSub = savedSuspendSub;
938
+ trackingSuspended = true;
939
+ }
918
940
  let node = sub2.depsHead ?? null;
919
941
  while (node !== null) {
920
942
  const next = node.subNext;
@@ -934,11 +956,25 @@ function track(effectFn, subscriber) {
934
956
  if (!subscriber) return reactiveBinding(effectFn);
935
957
  cleanup(subscriber);
936
958
  const prev = currentSubscriber;
959
+ let savedDepth = 0;
960
+ let savedSuspendSub = null;
961
+ if (trackingSuspended) {
962
+ savedDepth = suspendDepth;
963
+ savedSuspendSub = suspendSavedSub;
964
+ suspendDepth = 0;
965
+ suspendSavedSub = null;
966
+ trackingSuspended = false;
967
+ }
937
968
  currentSubscriber = subscriber;
938
969
  try {
939
970
  effectFn();
940
971
  } finally {
941
972
  currentSubscriber = prev;
973
+ if (savedDepth !== 0) {
974
+ suspendDepth = savedDepth;
975
+ suspendSavedSub = savedSuspendSub;
976
+ trackingSuspended = true;
977
+ }
942
978
  const sub3 = subscriber;
943
979
  for (let n = sub3.depsHead ?? null; n !== null; n = n.subNext) {
944
980
  const sig = n.sig;
@@ -1109,8 +1145,9 @@ function propagateDirty(sub2) {
1109
1145
  if (s2._c) {
1110
1146
  const nSig = s2._sig;
1111
1147
  if (nSig) {
1112
- if (!nSig._d) {
1148
+ if (!nSig._d || nSig._f === true) {
1113
1149
  nSig._d = true;
1150
+ nSig._f = false;
1114
1151
  stack.push(nSig);
1115
1152
  }
1116
1153
  } else {
@@ -1210,7 +1247,7 @@ function forEachSubscriber(signal2, visit) {
1210
1247
  }
1211
1248
 
1212
1249
  // src/reactivity/track.ts
1213
- var _runtimeVersion = true ? "4.4.0" : "dev";
1250
+ var _runtimeVersion = true ? "4.5.0" : "dev";
1214
1251
  var REGISTRY_KEY = /* @__PURE__ */ Symbol.for("sibujs.reactive.v1");
1215
1252
  function resolveReactiveApi() {
1216
1253
  const g2 = globalThis;
@@ -3612,7 +3649,7 @@ function show(condition, element) {
3612
3649
  const update = () => {
3613
3650
  resolved.style.display = condition() ? "" : "none";
3614
3651
  };
3615
- registerDisposer(resolved, track2(update));
3652
+ registerDisposer(resolved, reactiveBinding2(update, resolved));
3616
3653
  return resolved;
3617
3654
  }
3618
3655
  function attachBranch(parent, anchor, branch, attachedOnce, where) {
@@ -3657,7 +3694,7 @@ function when(condition, thenBranch, elseBranch) {
3657
3694
  restoreFocusWithin(focused, currentNode ? [currentNode] : [], "when");
3658
3695
  initialized = true;
3659
3696
  };
3660
- registerDisposer(anchor, track2(update));
3697
+ registerDisposer(anchor, reactiveBinding2(update, anchor));
3661
3698
  if (!initialized) {
3662
3699
  queueMicrotask(() => {
3663
3700
  if (!initialized && anchor.parentNode) update();
@@ -3691,7 +3728,7 @@ function match(value, cases, fallback) {
3691
3728
  restoreFocusWithin(focused, currentNode ? [currentNode] : [], "match");
3692
3729
  initialized = true;
3693
3730
  };
3694
- registerDisposer(anchor, track2(update));
3731
+ registerDisposer(anchor, reactiveBinding2(update, anchor));
3695
3732
  if (!initialized) {
3696
3733
  queueMicrotask(() => {
3697
3734
  if (!initialized && anchor.parentNode) update();
@@ -3846,7 +3883,12 @@ function each(getArray, render, options) {
3846
3883
  const [indexGetter, setIndex] = signal(i2);
3847
3884
  let node;
3848
3885
  try {
3849
- node = resolveNodeChild(render(itemGetter, indexGetter));
3886
+ suspendTracking2();
3887
+ try {
3888
+ node = resolveNodeChild(render(itemGetter, indexGetter));
3889
+ } finally {
3890
+ resumeTracking2();
3891
+ }
3850
3892
  } catch (err) {
3851
3893
  const key2 = newKeys[i2];
3852
3894
  node = document.createComment(`each:error:${i2}`);
@@ -4889,10 +4931,14 @@ function derived(getter, options) {
4889
4931
  const cs = {};
4890
4932
  cs._d = false;
4891
4933
  cs._init = false;
4934
+ cs._f = false;
4892
4935
  cs._g = getter;
4893
4936
  cs.__v = 0;
4937
+ let evaluating = false;
4938
+ let disposed = false;
4939
+ let pendingError;
4894
4940
  const markDirty = () => {
4895
- if (cs._d) return;
4941
+ if (cs._d || disposed) return;
4896
4942
  cs._d = true;
4897
4943
  };
4898
4944
  markDirty._c = 1;
@@ -4915,33 +4961,53 @@ function derived(getter, options) {
4915
4961
  }
4916
4962
  }, markDirty);
4917
4963
  const hook = globalThis.__SIBU_DEVTOOLS_GLOBAL_HOOK__;
4918
- let evaluating = false;
4919
4964
  const validate = () => {
4920
- if (!cs._d) return;
4965
+ if (!cs._d || disposed || pendingError !== void 0) return;
4921
4966
  const oldValue = cs._v;
4922
4967
  evaluating = true;
4923
4968
  try {
4924
4969
  retrack2(recompute, markDirty);
4925
4970
  if (!Object.is(oldValue, cs._v)) cs.__v++;
4971
+ } catch (err) {
4972
+ pendingError = { error: err };
4973
+ cs.__v++;
4974
+ if (disposed) cs._d = true;
4975
+ else cs._f = true;
4926
4976
  } finally {
4927
4977
  evaluating = false;
4978
+ if (disposed) cleanup2(markDirty);
4928
4979
  }
4929
- if (hook && !Object.is(oldValue, cs._v)) {
4980
+ if (hook && !disposed && !Object.is(oldValue, cs._v)) {
4930
4981
  hook.emit("computed:update", { signal: cs, oldValue, newValue: cs._v });
4931
4982
  }
4932
4983
  };
4933
4984
  cs._validate = validate;
4985
+ const throwPending = () => {
4986
+ const { error } = pendingError;
4987
+ pendingError = void 0;
4988
+ if (disposed) cs._d = false;
4989
+ throw error;
4990
+ };
4934
4991
  function computedGetter() {
4935
4992
  if (evaluating) {
4936
4993
  throw new Error(
4937
4994
  `[SibuJS] Circular dependency detected in derived${debugName ? ` "${debugName}"` : ""}. A derived signal cannot read itself (directly or through a chain).`
4938
4995
  );
4939
4996
  }
4940
- if (isTrackingSuspended2()) {
4941
- if (cs._d) validate();
4997
+ if (isTrackingSuspended2() || disposed) {
4998
+ if (cs._d) {
4999
+ validate();
5000
+ if (pendingError !== void 0) throwPending();
5001
+ }
4942
5002
  return cs._v;
4943
5003
  }
4944
- if (cs._d) validate();
5004
+ if (cs._d) {
5005
+ validate();
5006
+ if (pendingError !== void 0) {
5007
+ recordDependency2(cs);
5008
+ throwPending();
5009
+ }
5010
+ }
4945
5011
  recordDependency2(cs);
4946
5012
  return cs._v;
4947
5013
  }
@@ -4950,6 +5016,19 @@ function derived(getter, options) {
4950
5016
  cs.__name = debugName;
4951
5017
  }
4952
5018
  computedGetter.__signal = cs;
5019
+ computedGetter.dispose = () => {
5020
+ if (disposed) return;
5021
+ disposed = true;
5022
+ cs._d = pendingError !== void 0;
5023
+ cleanup2(markDirty);
5024
+ const h = globalThis.__SIBU_DEVTOOLS_GLOBAL_HOOK__;
5025
+ if (h) {
5026
+ try {
5027
+ h.emit("computed:destroy", { signal: cs, getter: computedGetter });
5028
+ } catch {
5029
+ }
5030
+ }
5031
+ };
4953
5032
  if (hook) hook.emit("computed:create", { signal: cs, name: debugName, getter: computedGetter });
4954
5033
  return computedGetter;
4955
5034
  }