sibujs 1.5.0 → 2.0.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 (207) hide show
  1. package/dist/browser.cjs +238 -69
  2. package/dist/browser.d.cts +5 -0
  3. package/dist/browser.d.ts +5 -0
  4. package/dist/browser.js +6 -6
  5. package/dist/build.cjs +916 -292
  6. package/dist/build.js +15 -13
  7. package/dist/cdn.global.js +17 -16
  8. package/dist/chunk-2RA7SHDA.js +65 -0
  9. package/dist/chunk-2UPRY23K.js +80 -0
  10. package/dist/chunk-3JHCYHWN.js +125 -0
  11. package/dist/{chunk-VAPYJN4X.js → chunk-3LR7GLWQ.js} +93 -23
  12. package/dist/{chunk-RJ46C3CS.js → chunk-3NSGB5JN.js} +71 -20
  13. package/dist/{chunk-XUEEGU5O.js → chunk-52YJLLRO.js} +16 -4
  14. package/dist/{chunk-XHK6BDAJ.js → chunk-54EDRCEF.js} +25 -8
  15. package/dist/chunk-7JDB7I65.js +1327 -0
  16. package/dist/{chunk-WZSPOOER.js → chunk-CC65Y57T.js} +8 -5
  17. package/dist/{chunk-23VV7YD3.js → chunk-DFPFITST.js} +25 -30
  18. package/dist/{chunk-BGN5ZMP4.js → chunk-GTBNNBJ6.js} +14 -2
  19. package/dist/chunk-HB24TBAF.js +121 -0
  20. package/dist/{chunk-CZUGLNJS.js → chunk-ITX6OO3F.js} +3 -3
  21. package/dist/{chunk-BGTHZHJ5.js → chunk-JA6667UN.js} +188 -44
  22. package/dist/{chunk-7GRNSCFT.js → chunk-JXMMDLBY.js} +306 -183
  23. package/dist/{chunk-3X2YG6YM.js → chunk-JYD2PWXH.js} +59 -28
  24. package/dist/{chunk-SFKNRVCU.js → chunk-KLRMB5ZS.js} +135 -79
  25. package/dist/{chunk-5X6PP2UK.js → chunk-LMLD24FC.js} +2 -2
  26. package/dist/{chunk-M4NLBH4I.js → chunk-LYTCUZ7H.js} +3 -2
  27. package/dist/{chunk-BMPL52BF.js → chunk-MIUAXB7K.js} +118 -66
  28. package/dist/{chunk-JCDUJN2F.js → chunk-ND2664SF.js} +486 -153
  29. package/dist/{chunk-VQDZK23A.js → chunk-O2MNQFLP.js} +181 -66
  30. package/dist/{chunk-NHUC2QWH.js → chunk-R73P76YZ.js} +1 -1
  31. package/dist/{chunk-2BYQDGN3.js → chunk-SAHNHTFC.js} +234 -63
  32. package/dist/chunk-UCS6AMJ7.js +79 -0
  33. package/dist/{chunk-K4G4ZQNR.js → chunk-VLPPXTYG.js} +84 -38
  34. package/dist/{chunk-OUZZEE4S.js → chunk-WOMYAHHI.js} +17 -11
  35. package/dist/{customElement-BL3Uo8dL.d.cts → customElement-CPfIrbvg.d.cts} +14 -10
  36. package/dist/{customElement-BL3Uo8dL.d.ts → customElement-CPfIrbvg.d.ts} +14 -10
  37. package/dist/data.cjs +410 -99
  38. package/dist/data.d.cts +20 -2
  39. package/dist/data.d.ts +20 -2
  40. package/dist/data.js +11 -9
  41. package/dist/devtools.cjs +513 -223
  42. package/dist/devtools.d.cts +1 -1
  43. package/dist/devtools.d.ts +1 -1
  44. package/dist/devtools.js +12 -6
  45. package/dist/ecosystem.cjs +475 -144
  46. package/dist/ecosystem.d.cts +9 -7
  47. package/dist/ecosystem.d.ts +9 -7
  48. package/dist/ecosystem.js +12 -11
  49. package/dist/extras.cjs +3355 -1541
  50. package/dist/extras.d.cts +9 -9
  51. package/dist/extras.d.ts +9 -9
  52. package/dist/extras.js +58 -45
  53. package/dist/index.cjs +920 -292
  54. package/dist/index.d.cts +71 -8
  55. package/dist/index.d.ts +71 -8
  56. package/dist/index.js +28 -16
  57. package/dist/{introspect-BumjnBKr.d.cts → introspect-BWNjNw64.d.cts} +22 -2
  58. package/dist/{introspect-CZrlcaYy.d.ts → introspect-cY2pg9pW.d.ts} +22 -2
  59. package/dist/motion.cjs +77 -34
  60. package/dist/motion.js +4 -4
  61. package/dist/patterns.cjs +335 -69
  62. package/dist/patterns.d.cts +11 -12
  63. package/dist/patterns.d.ts +11 -12
  64. package/dist/patterns.js +7 -7
  65. package/dist/performance.cjs +279 -108
  66. package/dist/performance.d.cts +23 -16
  67. package/dist/performance.d.ts +23 -16
  68. package/dist/performance.js +13 -8
  69. package/dist/plugin-D30wlGW5.d.cts +71 -0
  70. package/dist/plugin-D30wlGW5.d.ts +71 -0
  71. package/dist/plugins.cjs +635 -260
  72. package/dist/plugins.d.cts +10 -3
  73. package/dist/plugins.d.ts +10 -3
  74. package/dist/plugins.js +106 -38
  75. package/dist/{ssr-Do_SiVoL.d.cts → ssr-CrVNy6Pa.d.cts} +9 -15
  76. package/dist/{ssr-Do_SiVoL.d.ts → ssr-CrVNy6Pa.d.ts} +9 -15
  77. package/dist/{ssr-4PBXAOO3.js → ssr-FXD2PPMC.js} +4 -3
  78. package/dist/ssr.cjs +642 -222
  79. package/dist/ssr.d.cts +26 -6
  80. package/dist/ssr.d.ts +26 -6
  81. package/dist/ssr.js +12 -11
  82. package/dist/{tagFactory-DaJ0YWX6.d.cts → tagFactory-S17H2qxu.d.cts} +9 -1
  83. package/dist/{tagFactory-DaJ0YWX6.d.ts → tagFactory-S17H2qxu.d.ts} +9 -1
  84. package/dist/testing.cjs +252 -63
  85. package/dist/testing.d.cts +17 -4
  86. package/dist/testing.d.ts +17 -4
  87. package/dist/testing.js +100 -44
  88. package/dist/ui.cjs +463 -137
  89. package/dist/ui.d.cts +1 -1
  90. package/dist/ui.d.ts +1 -1
  91. package/dist/ui.js +20 -17
  92. package/dist/widgets.cjs +977 -94
  93. package/dist/widgets.d.cts +104 -2
  94. package/dist/widgets.d.ts +104 -2
  95. package/dist/widgets.js +9 -7
  96. package/package.json +8 -2
  97. package/dist/chunk-32DY64NT.js +0 -282
  98. package/dist/chunk-3AIRKM3B.js +0 -1263
  99. package/dist/chunk-3ARAQO7B.js +0 -398
  100. package/dist/chunk-3CRQALYP.js +0 -877
  101. package/dist/chunk-4EI4AG32.js +0 -482
  102. package/dist/chunk-4MYMUBRS.js +0 -21
  103. package/dist/chunk-5ZYQ6KDD.js +0 -154
  104. package/dist/chunk-6BMPXPUW.js +0 -26
  105. package/dist/chunk-6HLLIF3K.js +0 -398
  106. package/dist/chunk-6LSNVCS2.js +0 -937
  107. package/dist/chunk-6SA3QQES.js +0 -61
  108. package/dist/chunk-77L6NL3X.js +0 -1097
  109. package/dist/chunk-7BF6TK55.js +0 -1097
  110. package/dist/chunk-7TQKR4PP.js +0 -294
  111. package/dist/chunk-7V26P53V.js +0 -712
  112. package/dist/chunk-AZ3ISID5.js +0 -298
  113. package/dist/chunk-B7SWRFUT.js +0 -332
  114. package/dist/chunk-BTU3TJDS.js +0 -365
  115. package/dist/chunk-BW3WT46K.js +0 -937
  116. package/dist/chunk-C6KFWOFV.js +0 -616
  117. package/dist/chunk-CHF5OHIA.js +0 -61
  118. package/dist/chunk-CHJ27IGK.js +0 -26
  119. package/dist/chunk-CMBFNA7L.js +0 -27
  120. package/dist/chunk-DAHRH4ON.js +0 -331
  121. package/dist/chunk-DKOHBI74.js +0 -924
  122. package/dist/chunk-DTCOOBMX.js +0 -725
  123. package/dist/chunk-EBGIRKQY.js +0 -616
  124. package/dist/chunk-EUZND3CB.js +0 -27
  125. package/dist/chunk-EVCZO745.js +0 -365
  126. package/dist/chunk-EWFVA3TJ.js +0 -282
  127. package/dist/chunk-F3FA4F32.js +0 -292
  128. package/dist/chunk-FGOEVHY3.js +0 -60
  129. package/dist/chunk-G3BOQPVO.js +0 -365
  130. package/dist/chunk-GCOK2LC3.js +0 -282
  131. package/dist/chunk-GJPXRJ45.js +0 -37
  132. package/dist/chunk-HGMJFBC7.js +0 -654
  133. package/dist/chunk-JAKHTMQU.js +0 -1000
  134. package/dist/chunk-JCI5M6U6.js +0 -956
  135. package/dist/chunk-K5ZUMYVS.js +0 -89
  136. package/dist/chunk-KQPDEVVS.js +0 -398
  137. package/dist/chunk-L6JRBDNS.js +0 -60
  138. package/dist/chunk-LA6KQEDU.js +0 -712
  139. package/dist/chunk-MB6QFH3I.js +0 -2776
  140. package/dist/chunk-MDVXJWFN.js +0 -304
  141. package/dist/chunk-MEZVEBPN.js +0 -2008
  142. package/dist/chunk-MK4ERFYL.js +0 -2249
  143. package/dist/chunk-MLKGABMK.js +0 -9
  144. package/dist/chunk-MQ5GOYPH.js +0 -2249
  145. package/dist/chunk-MYRV7VDM.js +0 -742
  146. package/dist/chunk-N6IZB6KJ.js +0 -567
  147. package/dist/chunk-NEKUBFPT.js +0 -60
  148. package/dist/chunk-NMRUZALC.js +0 -1097
  149. package/dist/chunk-NYVAC6P5.js +0 -37
  150. package/dist/chunk-NZIIMDWI.js +0 -84
  151. package/dist/chunk-OF7UZIVB.js +0 -725
  152. package/dist/chunk-P3XWXJZU.js +0 -282
  153. package/dist/chunk-P6W3STU4.js +0 -2249
  154. package/dist/chunk-PBHF5WKN.js +0 -616
  155. package/dist/chunk-PDZQY43A.js +0 -616
  156. package/dist/chunk-PTQJDMRT.js +0 -146
  157. package/dist/chunk-PZEGYCF5.js +0 -61
  158. package/dist/chunk-QBMDLBU2.js +0 -975
  159. package/dist/chunk-QWZG56ET.js +0 -2744
  160. package/dist/chunk-RQGQSLQK.js +0 -725
  161. package/dist/chunk-SDLZDHKP.js +0 -107
  162. package/dist/chunk-TDGZL5CU.js +0 -365
  163. package/dist/chunk-TNQWPPE6.js +0 -37
  164. package/dist/chunk-TSOKIX5Z.js +0 -654
  165. package/dist/chunk-UHNL42EF.js +0 -2730
  166. package/dist/chunk-UNXCEF6S.js +0 -21
  167. package/dist/chunk-V2XTI523.js +0 -347
  168. package/dist/chunk-VAU366PN.js +0 -2241
  169. package/dist/chunk-VMVDTCXB.js +0 -712
  170. package/dist/chunk-VQNQZCWJ.js +0 -61
  171. package/dist/chunk-VRW3FULF.js +0 -725
  172. package/dist/chunk-WADYRCO2.js +0 -304
  173. package/dist/chunk-WILQZRO4.js +0 -282
  174. package/dist/chunk-WR5D4EGH.js +0 -26
  175. package/dist/chunk-WUHJISPP.js +0 -298
  176. package/dist/chunk-XYU6TZOW.js +0 -182
  177. package/dist/chunk-Y6GP4QGG.js +0 -276
  178. package/dist/chunk-YECR7UIA.js +0 -347
  179. package/dist/chunk-YUTWTI4B.js +0 -654
  180. package/dist/chunk-Z65KYU7I.js +0 -26
  181. package/dist/chunk-Z6POF5YC.js +0 -975
  182. package/dist/chunk-ZBJP6WFL.js +0 -482
  183. package/dist/chunk-ZD6OAMTH.js +0 -277
  184. package/dist/chunk-ZWKZCBO6.js +0 -317
  185. package/dist/contracts-DDrwxvJ-.d.cts +0 -245
  186. package/dist/contracts-DDrwxvJ-.d.ts +0 -245
  187. package/dist/contracts-DOrhwbke.d.cts +0 -245
  188. package/dist/contracts-DOrhwbke.d.ts +0 -245
  189. package/dist/contracts-xo5ckdRP.d.cts +0 -240
  190. package/dist/contracts-xo5ckdRP.d.ts +0 -240
  191. package/dist/customElement-BKQfbSZQ.d.cts +0 -262
  192. package/dist/customElement-BKQfbSZQ.d.ts +0 -262
  193. package/dist/customElement-D2DJp_xn.d.cts +0 -313
  194. package/dist/customElement-D2DJp_xn.d.ts +0 -313
  195. package/dist/customElement-yz8uyk-0.d.cts +0 -308
  196. package/dist/customElement-yz8uyk-0.d.ts +0 -308
  197. package/dist/introspect-Cb0zgpi2.d.cts +0 -477
  198. package/dist/introspect-Y2xNXGSf.d.ts +0 -477
  199. package/dist/plugin-Bek4RhJY.d.cts +0 -43
  200. package/dist/plugin-Bek4RhJY.d.ts +0 -43
  201. package/dist/ssr-3RXHP5ES.js +0 -38
  202. package/dist/ssr-6GIMY5MX.js +0 -38
  203. package/dist/ssr-BA6sxxUd.d.cts +0 -135
  204. package/dist/ssr-BA6sxxUd.d.ts +0 -135
  205. package/dist/ssr-WKUPVSSK.js +0 -36
  206. package/dist/tagFactory-Dl8QCLga.d.cts +0 -23
  207. package/dist/tagFactory-Dl8QCLga.d.ts +0 -23
package/dist/index.d.cts CHANGED
@@ -1,6 +1,7 @@
1
- import { T as TagProps, N as NodeChildren, a as NodeChild } from './tagFactory-DaJ0YWX6.cjs';
2
- export { S as SVG_NS, t as tagFactory } from './tagFactory-DaJ0YWX6.cjs';
1
+ import { T as TagProps, N as NodeChildren, a as NodeChild } from './tagFactory-S17H2qxu.cjs';
2
+ export { D as Dispose, S as SVG_NS, t as tagFactory } from './tagFactory-S17H2qxu.cjs';
3
3
  import { R as ReactiveSignal } from './signal-BnWpq6WB.cjs';
4
+ export { T as TrustedHTML, t as trustHTML } from './ssr-CrVNy6Pa.cjs';
4
5
 
5
6
  type reactive<T> = T | (() => T);
6
7
  interface AnchorProps extends TagProps {
@@ -734,14 +735,29 @@ interface EffectOptions {
734
735
  * ```
735
736
  */
736
737
  declare function on<T>(deps: () => T, handler: (value: T, prev: T | undefined) => void): () => void;
738
+ /** Registers a function to run before the effect re-runs or is disposed.
739
+ * Called with the same signature inside every invocation. */
740
+ type OnCleanup = (fn: () => void) => void;
741
+ /** The user's effect body — may accept an `onCleanup` callback to register
742
+ * teardown that runs before the next re-run or on dispose. */
743
+ type EffectBody = (onCleanup: OnCleanup) => void;
737
744
  /**
738
745
  * effect runs the provided effectFn immediately and re-runs it whenever
739
746
  * any reactive dependency changes.
740
747
  * Returns a cleanup function to stop further executions.
741
748
  *
742
749
  * In SSR mode, effect is a no-op — side effects should not run on the server.
750
+ *
751
+ * @example addEventListener pattern with built-in teardown:
752
+ * ```ts
753
+ * effect((onCleanup) => {
754
+ * const handler = (e: Event) => { ... };
755
+ * window.addEventListener("resize", handler);
756
+ * onCleanup(() => window.removeEventListener("resize", handler));
757
+ * });
758
+ * ```
743
759
  */
744
- declare function effect(effectFn: () => void, options?: EffectOptions): () => void;
760
+ declare function effect(effectFn: EffectBody | (() => void), options?: EffectOptions): () => void;
745
761
 
746
762
  /**
747
763
  * derived creates a derived reactive signal whose value updates when dependencies change.
@@ -755,6 +771,9 @@ declare function effect(effectFn: () => void, options?: EffectOptions): () => vo
755
771
  */
756
772
  declare function derived<T>(getter: () => T, options?: {
757
773
  name?: string;
774
+ /** Custom equality — when the recomputed value equals the previous,
775
+ * downstream subscribers are not notified. Defaults to `Object.is`. */
776
+ equals?: (a: T, b: T) => boolean;
758
777
  }): Accessor<T>;
759
778
 
760
779
  /**
@@ -1044,7 +1063,8 @@ type CleanupFn = () => void;
1044
1063
  declare function onMount(callback: () => undefined | CleanupFn, element?: HTMLElement): void;
1045
1064
  /**
1046
1065
  * Runs a callback when the given element is removed from the DOM.
1047
- * Uses MutationObserver to watch for disconnection.
1066
+ * Uses a shared MutationObserver to watch for disconnection, plus
1067
+ * `registerDisposer` so explicit dispose() paths also trigger the callback.
1048
1068
  *
1049
1069
  * @param callback Function to run on unmount
1050
1070
  * @param element The element to watch for removal
@@ -1095,14 +1115,32 @@ declare function onCleanup(callback: CleanupFn, element: Node): void;
1095
1115
  * ```
1096
1116
  */
1097
1117
  interface Context<T> {
1098
- /** Set the context value globally. Affects all consumers. */
1099
- provide(value: T): void;
1118
+ /**
1119
+ * Set the context value globally. Affects all consumers.
1120
+ *
1121
+ * Returns a `restore` function that re-sets the context to the value it
1122
+ * had *before* this `provide` call. Useful for scoped overrides:
1123
+ *
1124
+ * ```ts
1125
+ * const restore = Theme.provide("dark");
1126
+ * try { renderChild(); } finally { restore(); }
1127
+ * ```
1128
+ *
1129
+ * Callers that don't need scoping can ignore the return value — existing
1130
+ * semantics are preserved.
1131
+ */
1132
+ provide(value: T): () => void;
1100
1133
  /** Get a reactive getter for the current context value. */
1101
1134
  use(): () => T;
1102
1135
  /** Get the current value directly (non-reactive). */
1103
1136
  get(): T;
1104
1137
  /** Update the provided value reactively. */
1105
1138
  set(value: T): void;
1139
+ /**
1140
+ * Run `fn` with the context temporarily set to `value`, then restore the
1141
+ * previous value (even if `fn` throws). Returns the result of `fn`.
1142
+ */
1143
+ withContext<R>(value: T, fn: () => R): R;
1106
1144
  }
1107
1145
  /**
1108
1146
  * Creates a new context with an optional default value.
@@ -1158,6 +1196,11 @@ declare function strictEffect(fn: () => void): () => void;
1158
1196
  * During server-side rendering, side effects (effect, watch, onMount)
1159
1197
  * should not run. This module provides a flag to enable/disable SSR mode.
1160
1198
  *
1199
+ * Concurrency: on Node we back the flag with AsyncLocalStorage so
1200
+ * simultaneous requests get independent SSR scopes. On runtimes without
1201
+ * AsyncLocalStorage (browser, some edge runtimes) we fall back to a
1202
+ * module-global boolean.
1203
+ *
1161
1204
  * Usage:
1162
1205
  * enableSSR(); // Call before rendering on the server
1163
1206
  * renderToString(...);
@@ -1165,13 +1208,30 @@ declare function strictEffect(fn: () => void): () => void;
1165
1208
  *
1166
1209
  * Or use the scoped helper:
1167
1210
  * withSSR(() => renderToString(...));
1211
+ * runInSSRContext(() => renderToString(...));
1212
+ */
1213
+ /**
1214
+ * Per-request SSR store. Currently holds the SSR flag plus a
1215
+ * suspense-id counter so concurrent streaming renders never collide.
1168
1216
  */
1217
+ interface SSRStore {
1218
+ ssr: boolean;
1219
+ suspenseIdCounter: number;
1220
+ }
1221
+ /** Returns the active store (ALS or fallback). */
1222
+ declare function getSSRStore(): SSRStore;
1169
1223
  /** Returns true when running in SSR mode. */
1170
1224
  declare function isSSR(): boolean;
1171
1225
  /** Enable SSR mode. Side effects (effect, watch, onMount) become no-ops. */
1172
1226
  declare function enableSSR(): void;
1173
1227
  /** Disable SSR mode. Side effects resume normal behavior. */
1174
1228
  declare function disableSSR(): void;
1229
+ /**
1230
+ * Run `fn` inside a fresh request-scoped SSR context. On Node this uses
1231
+ * AsyncLocalStorage so concurrent requests never share state; elsewhere
1232
+ * it falls back to mutating the module-global store.
1233
+ */
1234
+ declare function runInSSRContext<T>(fn: () => T): T;
1175
1235
  /**
1176
1236
  * Run a function in SSR mode. Automatically enables/disables SSR around the callback.
1177
1237
  * Returns whatever the callback returns.
@@ -1256,7 +1316,9 @@ declare function nextTick(): Promise<void>;
1256
1316
  * each(() => heavyFilter(items, deferredQuery()), row => li(row.name));
1257
1317
  * ```
1258
1318
  */
1259
- declare function defer<T>(getter: () => T): () => T;
1319
+ declare function defer<T>(getter: () => T): (() => T) & {
1320
+ dispose: () => void;
1321
+ };
1260
1322
  interface TransitionState {
1261
1323
  pending: () => boolean;
1262
1324
  start: (fn: () => void | Promise<void>) => void;
@@ -1306,6 +1368,7 @@ declare function untracked<T>(fn: () => T): T;
1306
1368
  */
1307
1369
  declare function bindDynamic(el: HTMLElement, nameGetter: string | (() => string), valueGetter: string | (() => unknown)): () => void;
1308
1370
 
1371
+ declare function takePendingError(node: Element): Error | undefined;
1309
1372
  type Component = () => HTMLElement;
1310
1373
  type LazyImport = () => Promise<{
1311
1374
  default: Component;
@@ -1471,4 +1534,4 @@ interface LoadingProps {
1471
1534
  */
1472
1535
  declare function Loading(props?: LoadingProps): HTMLElement;
1473
1536
 
1474
- export { type Accessor, type ActionFn, type AnchorProps, type ArrayActions, type AsyncDerivedState, type AudioProps, type ButtonProps, type Context, DynamicComponent, type EffectOptions, ErrorBoundary, type ErrorBoundaryProps, ErrorDisplay, type ErrorDisplayProps, type ErrorSeverity, type FormProps, Fragment, type ImgProps, type InputProps, type InputType, KeepAlive, type KeepAliveOptions, type LabelProps, Loading, type LoadingProps, type LongPressOptions, type MediaProps, NodeChild, NodeChildren, type OptionProps, Portal, type Ref, type SelectProps, type SignalOptions, type SlotFn, type Slots, type StoreActions, Suspense, type SuspenseProps, TagProps, type TextareaProps, type TypedTagFunction, type VideoProps, __resetIdCounter, a, abbr, action, address, area, array, article, aside, asyncDerived, audio, autoResize, b, base, batch, bdi, bdo, bindDynamic, blockquote, body, br, button, canvas, caption, catchError, catchErrorAsync, center, checkLeaks, circle, cite, clickOutside, clipPath, code, col, colgroup, context, copyOnClick, createId, customElement, data, datalist, dd, deepEqual, deepSignal, defer, defs, del, derived, details, dfn, dialog, disableSSR, dispose, div, dl, dt, each, effect, ellipse, em, embed, enableSSR, enqueueBatchedSignal, fieldset, figcaption, figure, font, footer, form, g, getSlot, h1, h2, h3, h4, h5, h6, head, header, hr, html, i, iframe, img, input, ins, isBatching, isSSR, kbd, label, lazy, legend, li, line, linearGradient, link, longPress, main, map, mark, marker, marquee, mask, match, math, menu, meta, meter, mount, nav, nextTick, noscript, object, ol, on, onCleanup, onMount, onUnmount, optgroup, option, output, p, param, path, pattern, picture, polygon, polyline, portal, pre, progress, q, radialGradient, reactiveArray, rect, ref, registerComponent, registerDisposer, resolveComponent, rp, rt, ruby, s, samp, script, section, select, setGlobalErrorHandler, show, signal, slot, small, source, span, stop, store, strict, strictEffect, strong, style, sub, summary, sup, svg, symbol, table, tbody, td, template, text, textarea, tfoot, th, thead, time, title, tr, track, transition, trapFocus, tspan, u, ul, unregisterComponent, untracked, use, var_, video, watch, when, withSSR, writable };
1537
+ export { type Accessor, type ActionFn, type AnchorProps, type ArrayActions, type AsyncDerivedState, type AudioProps, type ButtonProps, type Context, DynamicComponent, type EffectBody, type EffectOptions, ErrorBoundary, type ErrorBoundaryProps, ErrorDisplay, type ErrorDisplayProps, type ErrorSeverity, type FormProps, Fragment, type ImgProps, type InputProps, type InputType, KeepAlive, type KeepAliveOptions, type LabelProps, Loading, type LoadingProps, type LongPressOptions, type MediaProps, NodeChild, NodeChildren, type OnCleanup, type OptionProps, Portal, type Ref, type SSRStore, type SelectProps, type SignalOptions, type SlotFn, type Slots, type StoreActions, Suspense, type SuspenseProps, TagProps, type TextareaProps, type TypedTagFunction, type VideoProps, __resetIdCounter, a, abbr, action, address, area, array, article, aside, asyncDerived, audio, autoResize, b, base, batch, bdi, bdo, bindDynamic, blockquote, body, br, button, canvas, caption, catchError, catchErrorAsync, center, checkLeaks, circle, cite, clickOutside, clipPath, code, col, colgroup, context, copyOnClick, createId, customElement, data, datalist, dd, deepEqual, deepSignal, defer, defs, del, derived, details, dfn, dialog, disableSSR, dispose, div, dl, dt, each, effect, ellipse, em, embed, enableSSR, enqueueBatchedSignal, fieldset, figcaption, figure, font, footer, form, g, getSSRStore, getSlot, h1, h2, h3, h4, h5, h6, head, header, hr, html, i, iframe, img, input, ins, isBatching, isSSR, kbd, label, lazy, legend, li, line, linearGradient, link, longPress, main, map, mark, marker, marquee, mask, match, math, menu, meta, meter, mount, nav, nextTick, noscript, object, ol, on, onCleanup, onMount, onUnmount, optgroup, option, output, p, param, path, pattern, picture, polygon, polyline, portal, pre, progress, q, radialGradient, reactiveArray, rect, ref, registerComponent, registerDisposer, resolveComponent, rp, rt, ruby, runInSSRContext, s, samp, script, section, select, setGlobalErrorHandler, show, signal, slot, small, source, span, stop, store, strict, strictEffect, strong, style, sub, summary, sup, svg, symbol, table, takePendingError, tbody, td, template, text, textarea, tfoot, th, thead, time, title, tr, track, transition, trapFocus, tspan, u, ul, unregisterComponent, untracked, use, var_, video, watch, when, withSSR, writable };
package/dist/index.d.ts CHANGED
@@ -1,6 +1,7 @@
1
- import { T as TagProps, N as NodeChildren, a as NodeChild } from './tagFactory-DaJ0YWX6.js';
2
- export { S as SVG_NS, t as tagFactory } from './tagFactory-DaJ0YWX6.js';
1
+ import { T as TagProps, N as NodeChildren, a as NodeChild } from './tagFactory-S17H2qxu.js';
2
+ export { D as Dispose, S as SVG_NS, t as tagFactory } from './tagFactory-S17H2qxu.js';
3
3
  import { R as ReactiveSignal } from './signal-BnWpq6WB.js';
4
+ export { T as TrustedHTML, t as trustHTML } from './ssr-CrVNy6Pa.js';
4
5
 
5
6
  type reactive<T> = T | (() => T);
6
7
  interface AnchorProps extends TagProps {
@@ -734,14 +735,29 @@ interface EffectOptions {
734
735
  * ```
735
736
  */
736
737
  declare function on<T>(deps: () => T, handler: (value: T, prev: T | undefined) => void): () => void;
738
+ /** Registers a function to run before the effect re-runs or is disposed.
739
+ * Called with the same signature inside every invocation. */
740
+ type OnCleanup = (fn: () => void) => void;
741
+ /** The user's effect body — may accept an `onCleanup` callback to register
742
+ * teardown that runs before the next re-run or on dispose. */
743
+ type EffectBody = (onCleanup: OnCleanup) => void;
737
744
  /**
738
745
  * effect runs the provided effectFn immediately and re-runs it whenever
739
746
  * any reactive dependency changes.
740
747
  * Returns a cleanup function to stop further executions.
741
748
  *
742
749
  * In SSR mode, effect is a no-op — side effects should not run on the server.
750
+ *
751
+ * @example addEventListener pattern with built-in teardown:
752
+ * ```ts
753
+ * effect((onCleanup) => {
754
+ * const handler = (e: Event) => { ... };
755
+ * window.addEventListener("resize", handler);
756
+ * onCleanup(() => window.removeEventListener("resize", handler));
757
+ * });
758
+ * ```
743
759
  */
744
- declare function effect(effectFn: () => void, options?: EffectOptions): () => void;
760
+ declare function effect(effectFn: EffectBody | (() => void), options?: EffectOptions): () => void;
745
761
 
746
762
  /**
747
763
  * derived creates a derived reactive signal whose value updates when dependencies change.
@@ -755,6 +771,9 @@ declare function effect(effectFn: () => void, options?: EffectOptions): () => vo
755
771
  */
756
772
  declare function derived<T>(getter: () => T, options?: {
757
773
  name?: string;
774
+ /** Custom equality — when the recomputed value equals the previous,
775
+ * downstream subscribers are not notified. Defaults to `Object.is`. */
776
+ equals?: (a: T, b: T) => boolean;
758
777
  }): Accessor<T>;
759
778
 
760
779
  /**
@@ -1044,7 +1063,8 @@ type CleanupFn = () => void;
1044
1063
  declare function onMount(callback: () => undefined | CleanupFn, element?: HTMLElement): void;
1045
1064
  /**
1046
1065
  * Runs a callback when the given element is removed from the DOM.
1047
- * Uses MutationObserver to watch for disconnection.
1066
+ * Uses a shared MutationObserver to watch for disconnection, plus
1067
+ * `registerDisposer` so explicit dispose() paths also trigger the callback.
1048
1068
  *
1049
1069
  * @param callback Function to run on unmount
1050
1070
  * @param element The element to watch for removal
@@ -1095,14 +1115,32 @@ declare function onCleanup(callback: CleanupFn, element: Node): void;
1095
1115
  * ```
1096
1116
  */
1097
1117
  interface Context<T> {
1098
- /** Set the context value globally. Affects all consumers. */
1099
- provide(value: T): void;
1118
+ /**
1119
+ * Set the context value globally. Affects all consumers.
1120
+ *
1121
+ * Returns a `restore` function that re-sets the context to the value it
1122
+ * had *before* this `provide` call. Useful for scoped overrides:
1123
+ *
1124
+ * ```ts
1125
+ * const restore = Theme.provide("dark");
1126
+ * try { renderChild(); } finally { restore(); }
1127
+ * ```
1128
+ *
1129
+ * Callers that don't need scoping can ignore the return value — existing
1130
+ * semantics are preserved.
1131
+ */
1132
+ provide(value: T): () => void;
1100
1133
  /** Get a reactive getter for the current context value. */
1101
1134
  use(): () => T;
1102
1135
  /** Get the current value directly (non-reactive). */
1103
1136
  get(): T;
1104
1137
  /** Update the provided value reactively. */
1105
1138
  set(value: T): void;
1139
+ /**
1140
+ * Run `fn` with the context temporarily set to `value`, then restore the
1141
+ * previous value (even if `fn` throws). Returns the result of `fn`.
1142
+ */
1143
+ withContext<R>(value: T, fn: () => R): R;
1106
1144
  }
1107
1145
  /**
1108
1146
  * Creates a new context with an optional default value.
@@ -1158,6 +1196,11 @@ declare function strictEffect(fn: () => void): () => void;
1158
1196
  * During server-side rendering, side effects (effect, watch, onMount)
1159
1197
  * should not run. This module provides a flag to enable/disable SSR mode.
1160
1198
  *
1199
+ * Concurrency: on Node we back the flag with AsyncLocalStorage so
1200
+ * simultaneous requests get independent SSR scopes. On runtimes without
1201
+ * AsyncLocalStorage (browser, some edge runtimes) we fall back to a
1202
+ * module-global boolean.
1203
+ *
1161
1204
  * Usage:
1162
1205
  * enableSSR(); // Call before rendering on the server
1163
1206
  * renderToString(...);
@@ -1165,13 +1208,30 @@ declare function strictEffect(fn: () => void): () => void;
1165
1208
  *
1166
1209
  * Or use the scoped helper:
1167
1210
  * withSSR(() => renderToString(...));
1211
+ * runInSSRContext(() => renderToString(...));
1212
+ */
1213
+ /**
1214
+ * Per-request SSR store. Currently holds the SSR flag plus a
1215
+ * suspense-id counter so concurrent streaming renders never collide.
1168
1216
  */
1217
+ interface SSRStore {
1218
+ ssr: boolean;
1219
+ suspenseIdCounter: number;
1220
+ }
1221
+ /** Returns the active store (ALS or fallback). */
1222
+ declare function getSSRStore(): SSRStore;
1169
1223
  /** Returns true when running in SSR mode. */
1170
1224
  declare function isSSR(): boolean;
1171
1225
  /** Enable SSR mode. Side effects (effect, watch, onMount) become no-ops. */
1172
1226
  declare function enableSSR(): void;
1173
1227
  /** Disable SSR mode. Side effects resume normal behavior. */
1174
1228
  declare function disableSSR(): void;
1229
+ /**
1230
+ * Run `fn` inside a fresh request-scoped SSR context. On Node this uses
1231
+ * AsyncLocalStorage so concurrent requests never share state; elsewhere
1232
+ * it falls back to mutating the module-global store.
1233
+ */
1234
+ declare function runInSSRContext<T>(fn: () => T): T;
1175
1235
  /**
1176
1236
  * Run a function in SSR mode. Automatically enables/disables SSR around the callback.
1177
1237
  * Returns whatever the callback returns.
@@ -1256,7 +1316,9 @@ declare function nextTick(): Promise<void>;
1256
1316
  * each(() => heavyFilter(items, deferredQuery()), row => li(row.name));
1257
1317
  * ```
1258
1318
  */
1259
- declare function defer<T>(getter: () => T): () => T;
1319
+ declare function defer<T>(getter: () => T): (() => T) & {
1320
+ dispose: () => void;
1321
+ };
1260
1322
  interface TransitionState {
1261
1323
  pending: () => boolean;
1262
1324
  start: (fn: () => void | Promise<void>) => void;
@@ -1306,6 +1368,7 @@ declare function untracked<T>(fn: () => T): T;
1306
1368
  */
1307
1369
  declare function bindDynamic(el: HTMLElement, nameGetter: string | (() => string), valueGetter: string | (() => unknown)): () => void;
1308
1370
 
1371
+ declare function takePendingError(node: Element): Error | undefined;
1309
1372
  type Component = () => HTMLElement;
1310
1373
  type LazyImport = () => Promise<{
1311
1374
  default: Component;
@@ -1471,4 +1534,4 @@ interface LoadingProps {
1471
1534
  */
1472
1535
  declare function Loading(props?: LoadingProps): HTMLElement;
1473
1536
 
1474
- export { type Accessor, type ActionFn, type AnchorProps, type ArrayActions, type AsyncDerivedState, type AudioProps, type ButtonProps, type Context, DynamicComponent, type EffectOptions, ErrorBoundary, type ErrorBoundaryProps, ErrorDisplay, type ErrorDisplayProps, type ErrorSeverity, type FormProps, Fragment, type ImgProps, type InputProps, type InputType, KeepAlive, type KeepAliveOptions, type LabelProps, Loading, type LoadingProps, type LongPressOptions, type MediaProps, NodeChild, NodeChildren, type OptionProps, Portal, type Ref, type SelectProps, type SignalOptions, type SlotFn, type Slots, type StoreActions, Suspense, type SuspenseProps, TagProps, type TextareaProps, type TypedTagFunction, type VideoProps, __resetIdCounter, a, abbr, action, address, area, array, article, aside, asyncDerived, audio, autoResize, b, base, batch, bdi, bdo, bindDynamic, blockquote, body, br, button, canvas, caption, catchError, catchErrorAsync, center, checkLeaks, circle, cite, clickOutside, clipPath, code, col, colgroup, context, copyOnClick, createId, customElement, data, datalist, dd, deepEqual, deepSignal, defer, defs, del, derived, details, dfn, dialog, disableSSR, dispose, div, dl, dt, each, effect, ellipse, em, embed, enableSSR, enqueueBatchedSignal, fieldset, figcaption, figure, font, footer, form, g, getSlot, h1, h2, h3, h4, h5, h6, head, header, hr, html, i, iframe, img, input, ins, isBatching, isSSR, kbd, label, lazy, legend, li, line, linearGradient, link, longPress, main, map, mark, marker, marquee, mask, match, math, menu, meta, meter, mount, nav, nextTick, noscript, object, ol, on, onCleanup, onMount, onUnmount, optgroup, option, output, p, param, path, pattern, picture, polygon, polyline, portal, pre, progress, q, radialGradient, reactiveArray, rect, ref, registerComponent, registerDisposer, resolveComponent, rp, rt, ruby, s, samp, script, section, select, setGlobalErrorHandler, show, signal, slot, small, source, span, stop, store, strict, strictEffect, strong, style, sub, summary, sup, svg, symbol, table, tbody, td, template, text, textarea, tfoot, th, thead, time, title, tr, track, transition, trapFocus, tspan, u, ul, unregisterComponent, untracked, use, var_, video, watch, when, withSSR, writable };
1537
+ export { type Accessor, type ActionFn, type AnchorProps, type ArrayActions, type AsyncDerivedState, type AudioProps, type ButtonProps, type Context, DynamicComponent, type EffectBody, type EffectOptions, ErrorBoundary, type ErrorBoundaryProps, ErrorDisplay, type ErrorDisplayProps, type ErrorSeverity, type FormProps, Fragment, type ImgProps, type InputProps, type InputType, KeepAlive, type KeepAliveOptions, type LabelProps, Loading, type LoadingProps, type LongPressOptions, type MediaProps, NodeChild, NodeChildren, type OnCleanup, type OptionProps, Portal, type Ref, type SSRStore, type SelectProps, type SignalOptions, type SlotFn, type Slots, type StoreActions, Suspense, type SuspenseProps, TagProps, type TextareaProps, type TypedTagFunction, type VideoProps, __resetIdCounter, a, abbr, action, address, area, array, article, aside, asyncDerived, audio, autoResize, b, base, batch, bdi, bdo, bindDynamic, blockquote, body, br, button, canvas, caption, catchError, catchErrorAsync, center, checkLeaks, circle, cite, clickOutside, clipPath, code, col, colgroup, context, copyOnClick, createId, customElement, data, datalist, dd, deepEqual, deepSignal, defer, defs, del, derived, details, dfn, dialog, disableSSR, dispose, div, dl, dt, each, effect, ellipse, em, embed, enableSSR, enqueueBatchedSignal, fieldset, figcaption, figure, font, footer, form, g, getSSRStore, getSlot, h1, h2, h3, h4, h5, h6, head, header, hr, html, i, iframe, img, input, ins, isBatching, isSSR, kbd, label, lazy, legend, li, line, linearGradient, link, longPress, main, map, mark, marker, marquee, mask, match, math, menu, meta, meter, mount, nav, nextTick, noscript, object, ol, on, onCleanup, onMount, onUnmount, optgroup, option, output, p, param, path, pattern, picture, polygon, polyline, portal, pre, progress, q, radialGradient, reactiveArray, rect, ref, registerComponent, registerDisposer, resolveComponent, rp, rt, ruby, runInSSRContext, s, samp, script, section, select, setGlobalErrorHandler, show, signal, slot, small, source, span, stop, store, strict, strictEffect, strong, style, sub, summary, sup, svg, symbol, table, takePendingError, tbody, td, template, text, textarea, tfoot, th, thead, time, title, tr, track, transition, trapFocus, tspan, u, ul, unregisterComponent, untracked, use, var_, video, watch, when, withSSR, writable };
package/dist/index.js CHANGED
@@ -38,12 +38,13 @@ import {
38
38
  store,
39
39
  strict,
40
40
  strictEffect,
41
+ takePendingError,
41
42
  transition,
42
43
  trapFocus,
43
44
  unregisterComponent,
44
45
  when,
45
46
  writable
46
- } from "./chunk-JCDUJN2F.js";
47
+ } from "./chunk-ND2664SF.js";
47
48
  import {
48
49
  __resetIdCounter,
49
50
  createId
@@ -185,47 +186,54 @@ import {
185
186
  use,
186
187
  var_,
187
188
  video
188
- } from "./chunk-P3XWXJZU.js";
189
+ } from "./chunk-R73P76YZ.js";
189
190
  import {
190
191
  watch
191
- } from "./chunk-GJPXRJ45.js";
192
+ } from "./chunk-ITX6OO3F.js";
193
+ import {
194
+ trustHTML
195
+ } from "./chunk-JYD2PWXH.js";
192
196
  import {
193
197
  context
194
- } from "./chunk-6BMPXPUW.js";
198
+ } from "./chunk-GTBNNBJ6.js";
195
199
  import {
196
200
  SVG_NS,
197
201
  tagFactory
198
- } from "./chunk-SFKNRVCU.js";
202
+ } from "./chunk-KLRMB5ZS.js";
203
+ import {
204
+ bindDynamic
205
+ } from "./chunk-DFPFITST.js";
206
+ import {
207
+ derived
208
+ } from "./chunk-54EDRCEF.js";
199
209
  import {
200
- bindDynamic,
201
210
  checkLeaks,
202
211
  dispose,
203
212
  registerDisposer
204
- } from "./chunk-5ZYQ6KDD.js";
205
- import {
206
- derived
207
- } from "./chunk-XHK6BDAJ.js";
208
- import "./chunk-CMBFNA7L.js";
213
+ } from "./chunk-2UPRY23K.js";
214
+ import "./chunk-UCS6AMJ7.js";
209
215
  import {
210
216
  effect,
211
217
  on
212
- } from "./chunk-VQNQZCWJ.js";
218
+ } from "./chunk-HB24TBAF.js";
213
219
  import {
214
220
  disableSSR,
215
221
  enableSSR,
222
+ getSSRStore,
216
223
  isSSR,
224
+ runInSSRContext,
217
225
  withSSR
218
- } from "./chunk-EUZND3CB.js";
226
+ } from "./chunk-2RA7SHDA.js";
219
227
  import {
220
228
  batch,
221
229
  enqueueBatchedSignal,
222
230
  isBatching,
223
231
  signal
224
- } from "./chunk-NZIIMDWI.js";
232
+ } from "./chunk-CC65Y57T.js";
225
233
  import {
226
234
  untracked
227
- } from "./chunk-K4G4ZQNR.js";
228
- import "./chunk-5X6PP2UK.js";
235
+ } from "./chunk-VLPPXTYG.js";
236
+ import "./chunk-LMLD24FC.js";
229
237
  export {
230
238
  DynamicComponent,
231
239
  ErrorBoundary,
@@ -306,6 +314,7 @@ export {
306
314
  footer,
307
315
  form,
308
316
  g,
317
+ getSSRStore,
309
318
  getSlot,
310
319
  h1,
311
320
  h2,
@@ -378,6 +387,7 @@ export {
378
387
  rp,
379
388
  rt,
380
389
  ruby,
390
+ runInSSRContext,
381
391
  s,
382
392
  samp,
383
393
  script,
@@ -403,6 +413,7 @@ export {
403
413
  symbol,
404
414
  table,
405
415
  tagFactory,
416
+ takePendingError,
406
417
  tbody,
407
418
  td,
408
419
  template,
@@ -417,6 +428,7 @@ export {
417
428
  track,
418
429
  transition,
419
430
  trapFocus,
431
+ trustHTML,
420
432
  tspan,
421
433
  u,
422
434
  ul,
@@ -102,6 +102,13 @@ interface DevToolsConfig {
102
102
  maxEvents?: number;
103
103
  enabled?: boolean;
104
104
  maxSignals?: number;
105
+ /**
106
+ * When true, attach the devtools API and data providers onto
107
+ * `globalThis.__SIBU__` (and the deprecated legacy `__SIBU_DEVTOOLS__*`
108
+ * aliases) so the browser extension / panel can read them. Defaults to
109
+ * `false` — production and tests should leave this off.
110
+ */
111
+ expose?: boolean;
105
112
  }
106
113
  interface ComponentEntry {
107
114
  element: HTMLElement;
@@ -134,6 +141,7 @@ declare function initDevTools(config?: DevToolsConfig): {
134
141
  setEnabled: (v: boolean) => void;
135
142
  snapshot: () => Record<string, unknown>;
136
143
  highlightElement: (name: string) => void;
144
+ getElementHTML: (name: string, max?: number) => string | null;
137
145
  destroy: () => void;
138
146
  };
139
147
  declare function devState<T>(name: string, initial: T): [() => T, (value: T | ((prev: T) => T)) => void];
@@ -150,6 +158,12 @@ declare function devState<T>(name: string, initial: T): [() => T, (value: T | ((
150
158
  * The utilities integrate with bundlers that expose a `module.hot` or
151
159
  * `import.meta.hot` API (Webpack, Vite, Parcel, etc.).
152
160
  */
161
+ /**
162
+ * Remove a single HMR module entry (state + registry) by id.
163
+ * Call this from `import.meta.hot.accept()` / `module.hot.dispose()` handlers
164
+ * when the module is being fully replaced or torn down.
165
+ */
166
+ declare function clearHMRModule(id: string): void;
153
167
  /**
154
168
  * Create an HMR-aware state that persists across module reloads.
155
169
  * During development, state is stored in a global map keyed by a unique `id`.
@@ -228,6 +242,12 @@ declare function createHMRBoundary(id: string): {
228
242
  * Clear all HMR state (useful for a full page refresh or test teardown).
229
243
  */
230
244
  declare function clearHMRState(): void;
245
+ /**
246
+ * Register HMR helpers under `__SIBU__.hmr` so devtools panels can reach them.
247
+ * Call this explicitly from your app bootstrap when you want the exposure —
248
+ * nothing is attached by default, matching initDevTools({ expose: true }).
249
+ */
250
+ declare function exposeHMR(): void;
231
251
  /**
232
252
  * Check if HMR is available in the current environment.
233
253
  * Returns `true` when any of the common bundler HMR APIs are detected
@@ -468,10 +488,10 @@ declare function inspectSignal(getter: () => unknown): ReactiveNodeInfo | null;
468
488
  *
469
489
  * Set maxDepth to limit traversal (default: 10).
470
490
  */
471
- declare function walkDependencyGraph(getter: () => unknown, maxDepth?: number): {
491
+ declare function walkDependencyGraph(getter: () => unknown, maxDepth?: number, visited?: WeakSet<ReactiveSignal>): {
472
492
  name: string | undefined;
473
493
  subscribers: number;
474
494
  downstream: ReturnType<typeof walkDependencyGraph>[];
475
495
  };
476
496
 
477
- export { measureRender as A, perfTracker as B, registerHMR as C, type DevToolsEvent as D, runCleanups as E, startMeasure as F, trackCleanup as G, walkDependencyGraph as H, withErrorTracking as I, type ProfilerResult as P, type ReactiveNodeInfo as R, SibuError as S, type DevtoolsOverlayOptions as a, clearDebugValues as b, checkLeaks as c, clearHMRState as d, clearPerformanceData as e, createDevtoolsOverlay as f, createErrorReporter as g, createHMRBoundary as h, createProfiler as i, debugLog as j, debugValue as k, devState as l, disableDebug as m, enableDebug as n, formatError as o, getActiveDevTools as p, getDebugValues as q, getDependencies as r, getPerformanceReport as s, getSignalName as t, getSubscriberCount as u, hmrState as v, initDevTools as w, inspectSignal as x, isDebugEnabled as y, isHMRAvailable as z };
497
+ export { isDebugEnabled as A, isHMRAvailable as B, measureRender as C, type DevToolsEvent as D, perfTracker as E, registerHMR as F, runCleanups as G, startMeasure as H, trackCleanup as I, walkDependencyGraph as J, withErrorTracking as K, type ProfilerResult as P, type ReactiveNodeInfo as R, SibuError as S, type DevtoolsOverlayOptions as a, clearDebugValues as b, checkLeaks as c, clearHMRModule as d, clearHMRState as e, clearPerformanceData as f, createDevtoolsOverlay as g, createErrorReporter as h, createHMRBoundary as i, createProfiler as j, debugLog as k, debugValue as l, devState as m, disableDebug as n, enableDebug as o, exposeHMR as p, formatError as q, getActiveDevTools as r, getDebugValues as s, getDependencies as t, getPerformanceReport as u, getSignalName as v, getSubscriberCount as w, hmrState as x, initDevTools as y, inspectSignal as z };
@@ -102,6 +102,13 @@ interface DevToolsConfig {
102
102
  maxEvents?: number;
103
103
  enabled?: boolean;
104
104
  maxSignals?: number;
105
+ /**
106
+ * When true, attach the devtools API and data providers onto
107
+ * `globalThis.__SIBU__` (and the deprecated legacy `__SIBU_DEVTOOLS__*`
108
+ * aliases) so the browser extension / panel can read them. Defaults to
109
+ * `false` — production and tests should leave this off.
110
+ */
111
+ expose?: boolean;
105
112
  }
106
113
  interface ComponentEntry {
107
114
  element: HTMLElement;
@@ -134,6 +141,7 @@ declare function initDevTools(config?: DevToolsConfig): {
134
141
  setEnabled: (v: boolean) => void;
135
142
  snapshot: () => Record<string, unknown>;
136
143
  highlightElement: (name: string) => void;
144
+ getElementHTML: (name: string, max?: number) => string | null;
137
145
  destroy: () => void;
138
146
  };
139
147
  declare function devState<T>(name: string, initial: T): [() => T, (value: T | ((prev: T) => T)) => void];
@@ -150,6 +158,12 @@ declare function devState<T>(name: string, initial: T): [() => T, (value: T | ((
150
158
  * The utilities integrate with bundlers that expose a `module.hot` or
151
159
  * `import.meta.hot` API (Webpack, Vite, Parcel, etc.).
152
160
  */
161
+ /**
162
+ * Remove a single HMR module entry (state + registry) by id.
163
+ * Call this from `import.meta.hot.accept()` / `module.hot.dispose()` handlers
164
+ * when the module is being fully replaced or torn down.
165
+ */
166
+ declare function clearHMRModule(id: string): void;
153
167
  /**
154
168
  * Create an HMR-aware state that persists across module reloads.
155
169
  * During development, state is stored in a global map keyed by a unique `id`.
@@ -228,6 +242,12 @@ declare function createHMRBoundary(id: string): {
228
242
  * Clear all HMR state (useful for a full page refresh or test teardown).
229
243
  */
230
244
  declare function clearHMRState(): void;
245
+ /**
246
+ * Register HMR helpers under `__SIBU__.hmr` so devtools panels can reach them.
247
+ * Call this explicitly from your app bootstrap when you want the exposure —
248
+ * nothing is attached by default, matching initDevTools({ expose: true }).
249
+ */
250
+ declare function exposeHMR(): void;
231
251
  /**
232
252
  * Check if HMR is available in the current environment.
233
253
  * Returns `true` when any of the common bundler HMR APIs are detected
@@ -468,10 +488,10 @@ declare function inspectSignal(getter: () => unknown): ReactiveNodeInfo | null;
468
488
  *
469
489
  * Set maxDepth to limit traversal (default: 10).
470
490
  */
471
- declare function walkDependencyGraph(getter: () => unknown, maxDepth?: number): {
491
+ declare function walkDependencyGraph(getter: () => unknown, maxDepth?: number, visited?: WeakSet<ReactiveSignal>): {
472
492
  name: string | undefined;
473
493
  subscribers: number;
474
494
  downstream: ReturnType<typeof walkDependencyGraph>[];
475
495
  };
476
496
 
477
- export { measureRender as A, perfTracker as B, registerHMR as C, type DevToolsEvent as D, runCleanups as E, startMeasure as F, trackCleanup as G, walkDependencyGraph as H, withErrorTracking as I, type ProfilerResult as P, type ReactiveNodeInfo as R, SibuError as S, type DevtoolsOverlayOptions as a, clearDebugValues as b, checkLeaks as c, clearHMRState as d, clearPerformanceData as e, createDevtoolsOverlay as f, createErrorReporter as g, createHMRBoundary as h, createProfiler as i, debugLog as j, debugValue as k, devState as l, disableDebug as m, enableDebug as n, formatError as o, getActiveDevTools as p, getDebugValues as q, getDependencies as r, getPerformanceReport as s, getSignalName as t, getSubscriberCount as u, hmrState as v, initDevTools as w, inspectSignal as x, isDebugEnabled as y, isHMRAvailable as z };
497
+ export { isDebugEnabled as A, isHMRAvailable as B, measureRender as C, type DevToolsEvent as D, perfTracker as E, registerHMR as F, runCleanups as G, startMeasure as H, trackCleanup as I, walkDependencyGraph as J, withErrorTracking as K, type ProfilerResult as P, type ReactiveNodeInfo as R, SibuError as S, type DevtoolsOverlayOptions as a, clearDebugValues as b, checkLeaks as c, clearHMRModule as d, clearHMRState as e, clearPerformanceData as f, createDevtoolsOverlay as g, createErrorReporter as h, createHMRBoundary as i, createProfiler as j, debugLog as k, debugValue as l, devState as m, disableDebug as n, enableDebug as o, exposeHMR as p, formatError as q, getActiveDevTools as r, getDebugValues as s, getDependencies as t, getPerformanceReport as u, getSignalName as v, getSubscriberCount as w, hmrState as x, initDevTools as y, inspectSignal as z };