sibujs 4.0.0 → 4.1.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 (55) hide show
  1. package/README.md +5 -1
  2. package/dist/browser.cjs +9 -2
  3. package/dist/browser.js +4 -4
  4. package/dist/build.cjs +93 -14
  5. package/dist/build.js +10 -10
  6. package/dist/cdn.global.js +10 -10
  7. package/dist/{chunk-F64ZPCFE.js → chunk-4RH6D7GR.js} +3 -3
  8. package/dist/{chunk-WOOMUJFT.js → chunk-4U7KD3RY.js} +3 -3
  9. package/dist/{chunk-O3QQ3XOL.js → chunk-5GJ5RTHA.js} +1 -1
  10. package/dist/{chunk-GCSGGA3Q.js → chunk-ANGSYNPX.js} +77 -14
  11. package/dist/{chunk-VFHIVEPF.js → chunk-BMSN6NWQ.js} +3 -3
  12. package/dist/{chunk-ACBT6UZS.js → chunk-D3SZ4LVS.js} +9 -2
  13. package/dist/{chunk-EWEE7NBF.js → chunk-DAKLOMKS.js} +2 -2
  14. package/dist/{chunk-Z2CE42DB.js → chunk-DCDS2PQ6.js} +1 -1
  15. package/dist/{chunk-WN6WDFCB.js → chunk-FB7KQXZI.js} +4 -4
  16. package/dist/{chunk-6LG2T7LO.js → chunk-FMHIQNMP.js} +4 -4
  17. package/dist/{chunk-DQVUBVNX.js → chunk-I3VI34DP.js} +10 -11
  18. package/dist/{chunk-E62UADKL.js → chunk-IM7N5WR4.js} +1 -1
  19. package/dist/{chunk-RRIDJQ5C.js → chunk-KSOEJGFO.js} +1 -1
  20. package/dist/{chunk-3EKJK5FZ.js → chunk-LOFZHP6V.js} +2 -2
  21. package/dist/{chunk-ES2GERY2.js → chunk-MRAMKDHQ.js} +1 -1
  22. package/dist/{chunk-PBQEW5VW.js → chunk-PFTDGEPZ.js} +1 -1
  23. package/dist/{chunk-4MFZMLUU.js → chunk-SHDVWATN.js} +1 -1
  24. package/dist/{chunk-W55YHPEP.js → chunk-UFSQEO7P.js} +14 -2
  25. package/dist/{chunk-DR7H6UGM.js → chunk-XIHMS2Y6.js} +5 -5
  26. package/dist/{chunk-NF3LYCQH.js → chunk-XSZRJW76.js} +4 -4
  27. package/dist/data.cjs +9 -2
  28. package/dist/data.js +6 -6
  29. package/dist/devtools.cjs +9 -2
  30. package/dist/devtools.js +4 -4
  31. package/dist/ecosystem.cjs +16 -9
  32. package/dist/ecosystem.js +7 -7
  33. package/dist/extras.cjs +16 -9
  34. package/dist/extras.js +19 -19
  35. package/dist/index.cjs +94 -14
  36. package/dist/index.d.cts +133 -1
  37. package/dist/index.d.ts +133 -1
  38. package/dist/index.js +12 -10
  39. package/dist/motion.cjs +9 -2
  40. package/dist/motion.js +3 -3
  41. package/dist/patterns.cjs +9 -2
  42. package/dist/patterns.js +5 -5
  43. package/dist/performance.cjs +9 -2
  44. package/dist/performance.js +4 -4
  45. package/dist/plugins.cjs +16 -9
  46. package/dist/plugins.js +6 -6
  47. package/dist/ssr.cjs +16 -9
  48. package/dist/ssr.js +7 -7
  49. package/dist/testing.cjs +9 -2
  50. package/dist/testing.js +2 -2
  51. package/dist/ui.cjs +9 -2
  52. package/dist/ui.js +6 -6
  53. package/dist/widgets.cjs +9 -2
  54. package/dist/widgets.js +6 -6
  55. package/package.json +7 -1
package/dist/index.d.ts CHANGED
@@ -1186,6 +1186,70 @@ interface SignalOptions<T = unknown> {
1186
1186
  * @param options Optional config: `{ name: "count" }` for devtools labeling
1187
1187
  */
1188
1188
  declare function signal<T>(initial: T, options?: SignalOptions<T>): StateTuple<T>;
1189
+ /**
1190
+ * A valueless reactive token standing in for state SibuJS does not own.
1191
+ *
1192
+ * See {@link external}.
1193
+ */
1194
+ interface ExternalSource {
1195
+ /**
1196
+ * Declare, from inside a reactive computation, that it reads the external
1197
+ * state this source represents. Call it in the same places you would read a
1198
+ * signal — the top of a binding getter, a `derived()` body, an `effect()`.
1199
+ *
1200
+ * Outside a tracking context it is a no-op, exactly like reading a signal.
1201
+ */
1202
+ track(): void;
1203
+ /**
1204
+ * Declare that the external state changed. Every consumer that called
1205
+ * {@link ExternalSource.track} is invalidated.
1206
+ *
1207
+ * Participates in `batch()` like any signal write: inside a batch, consumers
1208
+ * are notified once when the outermost batch flushes.
1209
+ */
1210
+ invalidate(): void;
1211
+ }
1212
+ /**
1213
+ * Create a reactive source for state that lives outside SibuJS — a domain
1214
+ * engine, a media element, a canvas scene, an editor document, a cache a
1215
+ * socket writes into.
1216
+ *
1217
+ * The pattern is two lines: `track()` where you read, `invalidate()` after you
1218
+ * mutate.
1219
+ *
1220
+ * ```ts
1221
+ * import { Chess } from "chess.js";
1222
+ * import { external } from "sibujs";
1223
+ *
1224
+ * const game = new Chess(); // owns the rules and the mutable state
1225
+ * const moved = external(); // owns "something changed"
1226
+ *
1227
+ * ctx.text("@status", () => {
1228
+ * moved.track(); // this binding reads the engine
1229
+ * return game.isCheckmate() ? "Checkmate" : `${game.turn()} to move`;
1230
+ * });
1231
+ *
1232
+ * game.move({ from: "e2", to: "e4" });
1233
+ * moved.invalidate(); // every consumer above re-reads
1234
+ * ```
1235
+ *
1236
+ * **One source is one invalidation domain.** Every consumer of a source
1237
+ * re-runs on every `invalidate()`, so the granularity of your updates is
1238
+ * exactly the granularity of your sources: one for a whole engine is the
1239
+ * cheapest to write, several (`board`, `clock`, `history`) let an update touch
1240
+ * only what it affects. See `docs/architecture/external-state.md` for the
1241
+ * trade-offs and when subdividing is worth it.
1242
+ *
1243
+ * Ownership, disposal and error routing are the consumer's, not the source's:
1244
+ * a disposed binding or effect is never invalidated, and a consumer that
1245
+ * throws is reported through the normal runtime error pipeline with its own
1246
+ * phase and node.
1247
+ *
1248
+ * @param options `name` labels the source in devtools (development only).
1249
+ */
1250
+ declare function external(options?: {
1251
+ name?: string;
1252
+ }): ExternalSource;
1189
1253
 
1190
1254
  /**
1191
1255
  * Reactive array hook. Provides common array operations that
@@ -1683,6 +1747,37 @@ declare function strict<T>(fn: () => T): T;
1683
1747
  */
1684
1748
  declare function strictEffect(fn: () => void): () => void;
1685
1749
 
1750
+ /** Event handlers for {@link EachBindings}, typed per event name. */
1751
+ type EachEventBindings = {
1752
+ [K in keyof HTMLElementEventMap]?: (event: HTMLElementEventMap[K], el: HTMLElement) => void;
1753
+ };
1754
+ /**
1755
+ * What {@link EnhanceContext.each} attaches to one element.
1756
+ *
1757
+ * Every field maps one-to-one onto an existing `ctx.*` helper and is committed
1758
+ * through it — this is a shorthand for calls you could write by hand, not a
1759
+ * template language and not a second binding engine. There is no expression
1760
+ * parsing, no string interpolation and no `eval`: every value is a plain
1761
+ * function you wrote, so it stays CSP-safe and fully type-checked.
1762
+ *
1763
+ * Anything not covered here (two-way `model()`, listener options, a nested
1764
+ * `enhance`) is written imperatively in the same callback — it receives the
1765
+ * element, so `ctx.model(el, …)` beside a returned descriptor is normal.
1766
+ */
1767
+ interface EachBindings {
1768
+ /** Reactive `textContent` — same as `ctx.text(el, value)`. */
1769
+ text?: () => unknown;
1770
+ /** Reactive attributes by name — same as `ctx.attr(el, name, value)`. */
1771
+ attr?: Record<string, () => unknown>;
1772
+ /** Reactive class toggles by class name — same as `ctx.classed(el, name, on)`. */
1773
+ class?: Record<string, () => boolean>;
1774
+ /** Reactive visibility — same as `ctx.show(el, when)`. */
1775
+ show?: () => boolean;
1776
+ /** Event listeners by event name — same as `ctx.on(el, event, handler)`. */
1777
+ on?: EachEventBindings;
1778
+ /** Per-element teardown, run with the rest of the enhancement's cleanups. */
1779
+ cleanup?: () => void;
1780
+ }
1686
1781
  /**
1687
1782
  * Helpers handed to an `enhance` setup. Every binding is fine-grained (its own
1688
1783
  * effect) and auto-disposed when the root element (or the returned dispose) is
@@ -1715,6 +1810,43 @@ interface EnhanceContext {
1715
1810
  model<T>(target: string | Element, state: readonly [() => T, (value: T) => void], options?: {
1716
1811
  event?: string;
1717
1812
  }): void;
1813
+ /**
1814
+ * Bind a set of elements the server already rendered — a board, a table, a
1815
+ * keyboard, a timeline, a legend — one descriptor at a time.
1816
+ *
1817
+ * The callback receives each element and its index and returns what to
1818
+ * attach; every field is committed through the matching `ctx.*` helper, so
1819
+ * ownership, disposal, write elision, attribute sanitization and error
1820
+ * routing are byte-for-byte the same as writing the calls out by hand. No
1821
+ * element is created, replaced, moved or re-parented — node identity is
1822
+ * preserved, which is the entire point of enhancing existing markup.
1823
+ *
1824
+ * ```ts
1825
+ * ctx.each<HTMLButtonElement>("@square", (el) => {
1826
+ * const square = el.dataset.square as Square;
1827
+ * return {
1828
+ * text: () => pieceAt(square),
1829
+ * class: { selected: () => selected() === square },
1830
+ * attr: { "aria-label": () => describe(square) },
1831
+ * on: { click: () => choose(square) },
1832
+ * };
1833
+ * });
1834
+ * ```
1835
+ *
1836
+ * The callback may also return nothing and wire the element imperatively —
1837
+ * `ctx.model(el, …)`, `ctx.on(el, "click", h, { passive: true })` — for the
1838
+ * cases the descriptor deliberately does not cover.
1839
+ *
1840
+ * Zero matches is a silent no-op. Calling `each` twice over the same
1841
+ * elements creates two independent sets of bindings, exactly as calling
1842
+ * `ctx.text()` twice on one node does; the helper is sugar over those calls
1843
+ * and does not track what a previous call attached.
1844
+ *
1845
+ * @param target A `@ref`/CSS selector resolved with {@link EnhanceContext.refs},
1846
+ * or any iterable of elements (an array, a `NodeList`, an `HTMLCollection`).
1847
+ * @param describe Called once per element, in document order.
1848
+ */
1849
+ each<T extends Element = HTMLElement>(target: string | Iterable<Element>, describe: (element: T, index: number) => EachBindings | void): void;
1718
1850
  /** Register arbitrary teardown to run on disposal. */
1719
1851
  cleanup(fn: () => void): void;
1720
1852
  }
@@ -2021,4 +2153,4 @@ declare const untracked: ReactiveApi["untracked"];
2021
2153
  declare const retrack: ReactiveApi["retrack"];
2022
2154
  declare const setMaxDrainIterations: ReactiveApi["setMaxDrainIterations"];
2023
2155
 
2024
- export { type Accessor, type ActionFn, type AnchorProps, type ArrayActions, type AsyncDerivedContext, type AsyncDerivedState, type AudioProps, type ButtonProps, type Context, DynamicComponent, type EffectBody, type EffectOptions, type EnhanceContext, type EnhanceSetup, ErrorBoundary, type ErrorBoundaryOptions, type ErrorBoundaryProps, ErrorDisplay, type ErrorDisplayProps, type ErrorSeverity, type FormProps, Fragment, type ImgProps, type InputProps, type InputType, type IslandLoader, type IslandRegistration, type IslandStrategy, KeepAlive, type KeepAliveOptions, type LabelProps, Loading, type LoadingProps, type LongPressOptions, MAX_DRAIN_TEARDOWNS, type MediaProps, type MountIslandsOptions, NodeChild, NodeChildren, type OnCleanup, type OptionProps, Portal, type Ref, type RuntimeErrorContext, type RuntimeErrorHandler, type RuntimeErrorPhase, 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, enhance, enhanceAll, enqueueBatchedSignal, fieldset, figcaption, figure, font, footer, form, g, getAction, getRequestScopedCache, getRuntimeErrorHandler, getSSRStore, getSlot, h1, h2, h3, h4, h5, h6, head, header, hr, html, i, iframe, img, input, ins, isBatching, isSSR, kbd, label, lazy, lazyIsland, legend, li, line, linearGradient, link, longPress, main, map, mark, marker, marquee, mask, match, math, menu, meta, meter, mount, mountIslands, 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, registerAction, registerComponent, registerDisposer, registerIsland, replaceChildrenSafely, reportDrainRunaway, reportError, resolveComponent, retrack, rp, rt, ruby, runInSSRContext, s, samp, script, section, select, setGlobalErrorHandler, setMaxDrainIterations, setRuntimeErrorHandler, 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$1 as track, transition, trapFocus, tspan, u, ul, unregisterComponent, unregisterDisposer, unregisterIsland, untracked, use, var_, video, watch, when, withSSR, writable };
2156
+ export { type Accessor, type ActionFn, type AnchorProps, type ArrayActions, type AsyncDerivedContext, type AsyncDerivedState, type AudioProps, type ButtonProps, type Context, DynamicComponent, type EachBindings, type EachEventBindings, type EffectBody, type EffectOptions, type EnhanceContext, type EnhanceSetup, ErrorBoundary, type ErrorBoundaryOptions, type ErrorBoundaryProps, ErrorDisplay, type ErrorDisplayProps, type ErrorSeverity, type ExternalSource, type FormProps, Fragment, type ImgProps, type InputProps, type InputType, type IslandLoader, type IslandRegistration, type IslandStrategy, KeepAlive, type KeepAliveOptions, type LabelProps, Loading, type LoadingProps, type LongPressOptions, MAX_DRAIN_TEARDOWNS, type MediaProps, type MountIslandsOptions, NodeChild, NodeChildren, type OnCleanup, type OptionProps, Portal, type Ref, type RuntimeErrorContext, type RuntimeErrorHandler, type RuntimeErrorPhase, 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, enhance, enhanceAll, enqueueBatchedSignal, external, fieldset, figcaption, figure, font, footer, form, g, getAction, getRequestScopedCache, getRuntimeErrorHandler, getSSRStore, getSlot, h1, h2, h3, h4, h5, h6, head, header, hr, html, i, iframe, img, input, ins, isBatching, isSSR, kbd, label, lazy, lazyIsland, legend, li, line, linearGradient, link, longPress, main, map, mark, marker, marquee, mask, match, math, menu, meta, meter, mount, mountIslands, 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, registerAction, registerComponent, registerDisposer, registerIsland, replaceChildrenSafely, reportDrainRunaway, reportError, resolveComponent, retrack, rp, rt, ruby, runInSSRContext, s, samp, script, section, select, setGlobalErrorHandler, setMaxDrainIterations, setRuntimeErrorHandler, 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$1 as track, transition, trapFocus, tspan, u, ul, unregisterComponent, unregisterDisposer, unregisterIsland, untracked, use, var_, video, watch, when, withSSR, writable };
package/dist/index.js CHANGED
@@ -52,7 +52,7 @@ import {
52
52
  unregisterIsland,
53
53
  when,
54
54
  writable
55
- } from "./chunk-GCSGGA3Q.js";
55
+ } from "./chunk-ANGSYNPX.js";
56
56
  import {
57
57
  a,
58
58
  abbr,
@@ -190,36 +190,36 @@ import {
190
190
  use,
191
191
  var_,
192
192
  video
193
- } from "./chunk-ES2GERY2.js";
193
+ } from "./chunk-MRAMKDHQ.js";
194
194
  import {
195
195
  trustHTML
196
196
  } from "./chunk-HYCCIYNS.js";
197
197
  import {
198
198
  watch
199
- } from "./chunk-RRIDJQ5C.js";
199
+ } from "./chunk-KSOEJGFO.js";
200
200
  import {
201
201
  __resetIdCounter,
202
202
  createId
203
203
  } from "./chunk-CCSJMTRN.js";
204
204
  import {
205
205
  context
206
- } from "./chunk-O3QQ3XOL.js";
206
+ } from "./chunk-5GJ5RTHA.js";
207
207
  import {
208
208
  SVG_NS,
209
209
  tagFactory
210
- } from "./chunk-DQVUBVNX.js";
210
+ } from "./chunk-I3VI34DP.js";
211
211
  import {
212
212
  bindDynamic
213
- } from "./chunk-4MFZMLUU.js";
213
+ } from "./chunk-SHDVWATN.js";
214
214
  import {
215
215
  derived
216
- } from "./chunk-Z2CE42DB.js";
216
+ } from "./chunk-DCDS2PQ6.js";
217
217
  import "./chunk-5INI7D2L.js";
218
218
  import "./chunk-7ZHH77QA.js";
219
219
  import {
220
220
  effect,
221
221
  on
222
- } from "./chunk-PBQEW5VW.js";
222
+ } from "./chunk-PFTDGEPZ.js";
223
223
  import {
224
224
  disableSSR,
225
225
  enableSSR,
@@ -241,14 +241,15 @@ import {
241
241
  import {
242
242
  batch,
243
243
  enqueueBatchedSignal,
244
+ external,
244
245
  isBatching,
245
246
  signal
246
- } from "./chunk-W55YHPEP.js";
247
+ } from "./chunk-UFSQEO7P.js";
247
248
  import {
248
249
  retrack,
249
250
  setMaxDrainIterations,
250
251
  untracked
251
- } from "./chunk-ACBT6UZS.js";
252
+ } from "./chunk-D3SZ4LVS.js";
252
253
  import {
253
254
  getRuntimeErrorHandler,
254
255
  reportError,
@@ -330,6 +331,7 @@ export {
330
331
  enhance,
331
332
  enhanceAll,
332
333
  enqueueBatchedSignal,
334
+ external,
333
335
  fieldset,
334
336
  figcaption,
335
337
  figure,
package/dist/motion.cjs CHANGED
@@ -469,7 +469,14 @@ function reactiveBinding(commit, ownerNode) {
469
469
  subscriber._disposed = false;
470
470
  subscriber._errorPhase = "binding";
471
471
  subscriber._errorNode = ownerNode;
472
- run();
472
+ try {
473
+ run();
474
+ } catch (err) {
475
+ subscriber._disposed = true;
476
+ subscriber._errorNode = void 0;
477
+ cleanup(subscriber);
478
+ throw err;
479
+ }
473
480
  return subscriber._dispose ?? (subscriber._dispose = () => {
474
481
  subscriber._disposed = true;
475
482
  subscriber._errorNode = void 0;
@@ -701,7 +708,7 @@ function forEachSubscriber(signal2, visit) {
701
708
 
702
709
  // src/reactivity/track.ts
703
710
  var _isDev3 = isDev();
704
- var _runtimeVersion = true ? "4.0.0" : "dev";
711
+ var _runtimeVersion = true ? "4.1.0" : "dev";
705
712
  var REGISTRY_KEY = /* @__PURE__ */ Symbol.for("sibujs.reactive.v1");
706
713
  function resolveReactiveApi() {
707
714
  const g = globalThis;
package/dist/motion.js CHANGED
@@ -20,10 +20,10 @@ import {
20
20
  stagger,
21
21
  transition,
22
22
  viewTransition
23
- } from "./chunk-E62UADKL.js";
23
+ } from "./chunk-IM7N5WR4.js";
24
24
  import "./chunk-DHDZ7IVN.js";
25
- import "./chunk-W55YHPEP.js";
26
- import "./chunk-ACBT6UZS.js";
25
+ import "./chunk-UFSQEO7P.js";
26
+ import "./chunk-D3SZ4LVS.js";
27
27
  import "./chunk-VPP2FONR.js";
28
28
  export {
29
29
  TransitionGroup,
package/dist/patterns.cjs CHANGED
@@ -371,7 +371,14 @@ function reactiveBinding(commit, ownerNode) {
371
371
  subscriber._disposed = false;
372
372
  subscriber._errorPhase = "binding";
373
373
  subscriber._errorNode = ownerNode;
374
- run();
374
+ try {
375
+ run();
376
+ } catch (err) {
377
+ subscriber._disposed = true;
378
+ subscriber._errorNode = void 0;
379
+ cleanup(subscriber);
380
+ throw err;
381
+ }
375
382
  return subscriber._dispose ?? (subscriber._dispose = () => {
376
383
  subscriber._disposed = true;
377
384
  subscriber._errorNode = void 0;
@@ -603,7 +610,7 @@ function forEachSubscriber(signal2, visit) {
603
610
 
604
611
  // src/reactivity/track.ts
605
612
  var _isDev2 = isDev();
606
- var _runtimeVersion = true ? "4.0.0" : "dev";
613
+ var _runtimeVersion = true ? "4.1.0" : "dev";
607
614
  var REGISTRY_KEY = /* @__PURE__ */ Symbol.for("sibujs.reactive.v1");
608
615
  function resolveReactiveApi() {
609
616
  const g = globalThis;
package/dist/patterns.js CHANGED
@@ -5,7 +5,7 @@ import {
5
5
  optimisticList,
6
6
  persisted,
7
7
  timeline
8
- } from "./chunk-WOOMUJFT.js";
8
+ } from "./chunk-4U7KD3RY.js";
9
9
  import {
10
10
  RenderProp,
11
11
  assertType,
@@ -23,11 +23,11 @@ import {
23
23
  withWrapper
24
24
  } from "./chunk-VJE6DDYM.js";
25
25
  import "./chunk-H3SRKIYX.js";
26
- import "./chunk-Z2CE42DB.js";
27
- import "./chunk-PBQEW5VW.js";
26
+ import "./chunk-DCDS2PQ6.js";
27
+ import "./chunk-PFTDGEPZ.js";
28
28
  import "./chunk-TIRZCERI.js";
29
- import "./chunk-W55YHPEP.js";
30
- import "./chunk-ACBT6UZS.js";
29
+ import "./chunk-UFSQEO7P.js";
30
+ import "./chunk-D3SZ4LVS.js";
31
31
  import "./chunk-VPP2FONR.js";
32
32
  export {
33
33
  RenderProp,
@@ -558,7 +558,14 @@ function reactiveBinding(commit, ownerNode) {
558
558
  subscriber._disposed = false;
559
559
  subscriber._errorPhase = "binding";
560
560
  subscriber._errorNode = ownerNode;
561
- run();
561
+ try {
562
+ run();
563
+ } catch (err) {
564
+ subscriber._disposed = true;
565
+ subscriber._errorNode = void 0;
566
+ cleanup(subscriber);
567
+ throw err;
568
+ }
562
569
  return subscriber._dispose ?? (subscriber._dispose = () => {
563
570
  subscriber._disposed = true;
564
571
  subscriber._errorNode = void 0;
@@ -790,7 +797,7 @@ function forEachSubscriber(signal2, visit) {
790
797
 
791
798
  // src/reactivity/track.ts
792
799
  var _isDev2 = isDev();
793
- var _runtimeVersion = true ? "4.0.0" : "dev";
800
+ var _runtimeVersion = true ? "4.1.0" : "dev";
794
801
  var REGISTRY_KEY = /* @__PURE__ */ Symbol.for("sibujs.reactive.v1");
795
802
  function resolveReactiveApi() {
796
803
  const g = globalThis;
@@ -33,17 +33,17 @@ import {
33
33
  transitionState,
34
34
  uniqueId,
35
35
  yieldToMain
36
- } from "./chunk-3EKJK5FZ.js";
36
+ } from "./chunk-LOFZHP6V.js";
37
37
  import {
38
38
  trustHTML
39
39
  } from "./chunk-HYCCIYNS.js";
40
40
  import "./chunk-5INI7D2L.js";
41
41
  import "./chunk-7ZHH77QA.js";
42
- import "./chunk-PBQEW5VW.js";
42
+ import "./chunk-PFTDGEPZ.js";
43
43
  import "./chunk-TIRZCERI.js";
44
44
  import "./chunk-DHDZ7IVN.js";
45
- import "./chunk-W55YHPEP.js";
46
- import "./chunk-ACBT6UZS.js";
45
+ import "./chunk-UFSQEO7P.js";
46
+ import "./chunk-D3SZ4LVS.js";
47
47
  import "./chunk-VPP2FONR.js";
48
48
  export {
49
49
  DOMPool,
package/dist/plugins.cjs CHANGED
@@ -1587,7 +1587,14 @@ function reactiveBinding(commit, ownerNode) {
1587
1587
  subscriber._disposed = false;
1588
1588
  subscriber._errorPhase = "binding";
1589
1589
  subscriber._errorNode = ownerNode;
1590
- run();
1590
+ try {
1591
+ run();
1592
+ } catch (err) {
1593
+ subscriber._disposed = true;
1594
+ subscriber._errorNode = void 0;
1595
+ cleanup(subscriber);
1596
+ throw err;
1597
+ }
1591
1598
  return subscriber._dispose ?? (subscriber._dispose = () => {
1592
1599
  subscriber._disposed = true;
1593
1600
  subscriber._errorNode = void 0;
@@ -1819,7 +1826,7 @@ function forEachSubscriber(signal2, visit) {
1819
1826
 
1820
1827
  // src/reactivity/track.ts
1821
1828
  var _isDev3 = isDev();
1822
- var _runtimeVersion = true ? "4.0.0" : "dev";
1829
+ var _runtimeVersion = true ? "4.1.0" : "dev";
1823
1830
  var REGISTRY_KEY = /* @__PURE__ */ Symbol.for("sibujs.reactive.v1");
1824
1831
  function resolveReactiveApi() {
1825
1832
  const g2 = globalThis;
@@ -2015,9 +2022,9 @@ function toKebab(prop) {
2015
2022
  }
2016
2023
  function applyStyle(el, style2) {
2017
2024
  if (typeof style2 === "function") {
2018
- const teardown = track2(() => {
2025
+ const teardown = reactiveBinding2(() => {
2019
2026
  el.setAttribute("style", sanitizeStyleAttribute(String(style2())));
2020
- });
2027
+ }, el);
2021
2028
  registerDisposer(el, teardown);
2022
2029
  return;
2023
2030
  }
@@ -2031,9 +2038,9 @@ function applyStyle(el, style2) {
2031
2038
  const name = toKebab(prop);
2032
2039
  if (typeof val === "function") {
2033
2040
  const getter = val;
2034
- const teardown = track2(() => {
2041
+ const teardown = reactiveBinding2(() => {
2035
2042
  htmlEl.style.setProperty(name, sanitizeCSSValue(String(getter())));
2036
- });
2043
+ }, el);
2037
2044
  registerDisposer(el, teardown);
2038
2045
  } else {
2039
2046
  htmlEl.style.setProperty(name, sanitizeCSSValue(String(val)));
@@ -2046,9 +2053,9 @@ function applyClass(el, cls) {
2046
2053
  return;
2047
2054
  }
2048
2055
  if (typeof cls === "function") {
2049
- const teardown = track2(() => {
2056
+ const teardown = reactiveBinding2(() => {
2050
2057
  el.setAttribute("class", cls());
2051
- });
2058
+ }, el);
2052
2059
  registerDisposer(el, teardown);
2053
2060
  return;
2054
2061
  }
@@ -2073,7 +2080,7 @@ function applyClass(el, cls) {
2073
2080
  }
2074
2081
  el.setAttribute("class", r);
2075
2082
  };
2076
- const teardown = track2(update);
2083
+ const teardown = reactiveBinding2(update, el);
2077
2084
  registerDisposer(el, teardown);
2078
2085
  } else {
2079
2086
  el.setAttribute("class", result);
package/dist/plugins.js CHANGED
@@ -35,14 +35,14 @@ import {
35
35
  } from "./chunk-WWV3SJ3L.js";
36
36
  import {
37
37
  span
38
- } from "./chunk-ES2GERY2.js";
38
+ } from "./chunk-MRAMKDHQ.js";
39
39
  import {
40
40
  escapeScriptJson,
41
41
  renderToString,
42
42
  serializeHeadEntry
43
43
  } from "./chunk-HYCCIYNS.js";
44
- import "./chunk-DQVUBVNX.js";
45
- import "./chunk-4MFZMLUU.js";
44
+ import "./chunk-I3VI34DP.js";
45
+ import "./chunk-SHDVWATN.js";
46
46
  import {
47
47
  isUrlAttribute,
48
48
  sanitizeStyleAttribute,
@@ -54,7 +54,7 @@ import {
54
54
  } from "./chunk-7ZHH77QA.js";
55
55
  import {
56
56
  effect
57
- } from "./chunk-PBQEW5VW.js";
57
+ } from "./chunk-PFTDGEPZ.js";
58
58
  import {
59
59
  getRequestStore
60
60
  } from "./chunk-TIRZCERI.js";
@@ -64,10 +64,10 @@ import {
64
64
  } from "./chunk-DHDZ7IVN.js";
65
65
  import {
66
66
  signal
67
- } from "./chunk-W55YHPEP.js";
67
+ } from "./chunk-UFSQEO7P.js";
68
68
  import {
69
69
  track
70
- } from "./chunk-ACBT6UZS.js";
70
+ } from "./chunk-D3SZ4LVS.js";
71
71
  import {
72
72
  devWarn,
73
73
  isDev
package/dist/ssr.cjs CHANGED
@@ -1346,7 +1346,14 @@ function reactiveBinding(commit, ownerNode) {
1346
1346
  subscriber._disposed = false;
1347
1347
  subscriber._errorPhase = "binding";
1348
1348
  subscriber._errorNode = ownerNode;
1349
- run();
1349
+ try {
1350
+ run();
1351
+ } catch (err) {
1352
+ subscriber._disposed = true;
1353
+ subscriber._errorNode = void 0;
1354
+ cleanup(subscriber);
1355
+ throw err;
1356
+ }
1350
1357
  return subscriber._dispose ?? (subscriber._dispose = () => {
1351
1358
  subscriber._disposed = true;
1352
1359
  subscriber._errorNode = void 0;
@@ -1578,7 +1585,7 @@ function forEachSubscriber(signal2, visit) {
1578
1585
 
1579
1586
  // src/reactivity/track.ts
1580
1587
  var _isDev4 = isDev();
1581
- var _runtimeVersion = true ? "4.0.0" : "dev";
1588
+ var _runtimeVersion = true ? "4.1.0" : "dev";
1582
1589
  var REGISTRY_KEY = /* @__PURE__ */ Symbol.for("sibujs.reactive.v1");
1583
1590
  function resolveReactiveApi() {
1584
1591
  const g2 = globalThis;
@@ -2567,9 +2574,9 @@ function toKebab(prop) {
2567
2574
  }
2568
2575
  function applyStyle(el, style2) {
2569
2576
  if (typeof style2 === "function") {
2570
- const teardown = track2(() => {
2577
+ const teardown = reactiveBinding2(() => {
2571
2578
  el.setAttribute("style", sanitizeStyleAttribute(String(style2())));
2572
- });
2579
+ }, el);
2573
2580
  registerDisposer(el, teardown);
2574
2581
  return;
2575
2582
  }
@@ -2583,9 +2590,9 @@ function applyStyle(el, style2) {
2583
2590
  const name = toKebab(prop);
2584
2591
  if (typeof val === "function") {
2585
2592
  const getter = val;
2586
- const teardown = track2(() => {
2593
+ const teardown = reactiveBinding2(() => {
2587
2594
  htmlEl.style.setProperty(name, sanitizeCSSValue(String(getter())));
2588
- });
2595
+ }, el);
2589
2596
  registerDisposer(el, teardown);
2590
2597
  } else {
2591
2598
  htmlEl.style.setProperty(name, sanitizeCSSValue(String(val)));
@@ -2598,9 +2605,9 @@ function applyClass(el, cls) {
2598
2605
  return;
2599
2606
  }
2600
2607
  if (typeof cls === "function") {
2601
- const teardown = track2(() => {
2608
+ const teardown = reactiveBinding2(() => {
2602
2609
  el.setAttribute("class", cls());
2603
- });
2610
+ }, el);
2604
2611
  registerDisposer(el, teardown);
2605
2612
  return;
2606
2613
  }
@@ -2625,7 +2632,7 @@ function applyClass(el, cls) {
2625
2632
  }
2626
2633
  el.setAttribute("class", r);
2627
2634
  };
2628
- const teardown = track2(update);
2635
+ const teardown = reactiveBinding2(update, el);
2629
2636
  registerDisposer(el, teardown);
2630
2637
  } else {
2631
2638
  el.setAttribute("class", result);
package/dist/ssr.js CHANGED
@@ -23,9 +23,9 @@ import {
23
23
  wasm,
24
24
  worker,
25
25
  workerFn
26
- } from "./chunk-VFHIVEPF.js";
26
+ } from "./chunk-BMSN6NWQ.js";
27
27
  import "./chunk-52XFPGSN.js";
28
- import "./chunk-ES2GERY2.js";
28
+ import "./chunk-MRAMKDHQ.js";
29
29
  import {
30
30
  collectStream,
31
31
  deserializeState,
@@ -46,15 +46,15 @@ import {
46
46
  suspenseSwapScript,
47
47
  trustHTML
48
48
  } from "./chunk-HYCCIYNS.js";
49
- import "./chunk-DQVUBVNX.js";
50
- import "./chunk-4MFZMLUU.js";
49
+ import "./chunk-I3VI34DP.js";
50
+ import "./chunk-SHDVWATN.js";
51
51
  import "./chunk-5INI7D2L.js";
52
52
  import "./chunk-7ZHH77QA.js";
53
- import "./chunk-PBQEW5VW.js";
53
+ import "./chunk-PFTDGEPZ.js";
54
54
  import "./chunk-TIRZCERI.js";
55
55
  import "./chunk-DHDZ7IVN.js";
56
- import "./chunk-W55YHPEP.js";
57
- import "./chunk-ACBT6UZS.js";
56
+ import "./chunk-UFSQEO7P.js";
57
+ import "./chunk-D3SZ4LVS.js";
58
58
  import "./chunk-VPP2FONR.js";
59
59
  export {
60
60
  Head,
package/dist/testing.cjs CHANGED
@@ -1899,7 +1899,14 @@ function reactiveBinding(commit, ownerNode) {
1899
1899
  subscriber._disposed = false;
1900
1900
  subscriber._errorPhase = "binding";
1901
1901
  subscriber._errorNode = ownerNode;
1902
- run();
1902
+ try {
1903
+ run();
1904
+ } catch (err) {
1905
+ subscriber._disposed = true;
1906
+ subscriber._errorNode = void 0;
1907
+ cleanup(subscriber);
1908
+ throw err;
1909
+ }
1903
1910
  return subscriber._dispose ?? (subscriber._dispose = () => {
1904
1911
  subscriber._disposed = true;
1905
1912
  subscriber._errorNode = void 0;
@@ -2131,7 +2138,7 @@ function forEachSubscriber(signal, visit) {
2131
2138
 
2132
2139
  // src/reactivity/track.ts
2133
2140
  var _isDev3 = isDev();
2134
- var _runtimeVersion = true ? "4.0.0" : "dev";
2141
+ var _runtimeVersion = true ? "4.1.0" : "dev";
2135
2142
  var REGISTRY_KEY = /* @__PURE__ */ Symbol.for("sibujs.reactive.v1");
2136
2143
  function resolveReactiveApi() {
2137
2144
  const g = globalThis;
package/dist/testing.js CHANGED
@@ -3,12 +3,12 @@ import {
3
3
  } from "./chunk-7ZHH77QA.js";
4
4
  import {
5
5
  effect
6
- } from "./chunk-PBQEW5VW.js";
6
+ } from "./chunk-PFTDGEPZ.js";
7
7
  import "./chunk-TIRZCERI.js";
8
8
  import {
9
9
  replaceChildrenSafely
10
10
  } from "./chunk-DHDZ7IVN.js";
11
- import "./chunk-ACBT6UZS.js";
11
+ import "./chunk-D3SZ4LVS.js";
12
12
  import "./chunk-VPP2FONR.js";
13
13
 
14
14
  // src/testing/a11y.ts
package/dist/ui.cjs CHANGED
@@ -489,7 +489,14 @@ function reactiveBinding(commit, ownerNode) {
489
489
  subscriber._disposed = false;
490
490
  subscriber._errorPhase = "binding";
491
491
  subscriber._errorNode = ownerNode;
492
- run();
492
+ try {
493
+ run();
494
+ } catch (err) {
495
+ subscriber._disposed = true;
496
+ subscriber._errorNode = void 0;
497
+ cleanup(subscriber);
498
+ throw err;
499
+ }
493
500
  return subscriber._dispose ?? (subscriber._dispose = () => {
494
501
  subscriber._disposed = true;
495
502
  subscriber._errorNode = void 0;
@@ -721,7 +728,7 @@ function forEachSubscriber(signal2, visit) {
721
728
 
722
729
  // src/reactivity/track.ts
723
730
  var _isDev3 = isDev();
724
- var _runtimeVersion = true ? "4.0.0" : "dev";
731
+ var _runtimeVersion = true ? "4.1.0" : "dev";
725
732
  var REGISTRY_KEY = /* @__PURE__ */ Symbol.for("sibujs.reactive.v1");
726
733
  function resolveReactiveApi() {
727
734
  const g = globalThis;