sibujs 3.2.2 → 3.3.1

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 (60) hide show
  1. package/dist/browser.cjs +217 -27
  2. package/dist/browser.js +5 -5
  3. package/dist/build.cjs +236 -105
  4. package/dist/build.js +14 -14
  5. package/dist/cdn.global.js +7 -7
  6. package/dist/{chunk-5N74TKLD.js → chunk-37BUKSLH.js} +1 -1
  7. package/dist/{chunk-BGNLPNGV.js → chunk-4UUMSLSL.js} +4 -4
  8. package/dist/{chunk-2UPRY23K.js → chunk-5VGSK6D2.js} +1 -1
  9. package/dist/{chunk-OYLPZO4N.js → chunk-6LTFHJQG.js} +4 -4
  10. package/dist/{chunk-VOCE4NNK.js → chunk-AMIKDMLP.js} +5 -5
  11. package/dist/{chunk-LMLD24FC.js → chunk-COY6PUD2.js} +7 -1
  12. package/dist/{chunk-YFDGQWDA.js → chunk-F7FXQ3QS.js} +1 -1
  13. package/dist/{chunk-V2MTG5FT.js → chunk-IKLYI3RF.js} +33 -16
  14. package/dist/{chunk-HMJFCBRR.js → chunk-L3GAGWCC.js} +10 -1
  15. package/dist/{chunk-X67UYC74.js → chunk-LU2MQXQQ.js} +14 -24
  16. package/dist/{chunk-4JCAUOLN.js → chunk-M5KBNOSJ.js} +22 -12
  17. package/dist/{chunk-FDY42FIU.js → chunk-MHBCEJQO.js} +2 -2
  18. package/dist/{chunk-RLUJL2MV.js → chunk-NHKQKKZU.js} +6 -7
  19. package/dist/{chunk-HXMS4SNP.js → chunk-R3QEDXFS.js} +2 -2
  20. package/dist/{chunk-NPIEEKPT.js → chunk-RYMOSG5B.js} +6 -6
  21. package/dist/{chunk-H6PCHJZQ.js → chunk-SLMFA3ZZ.js} +11 -3
  22. package/dist/{chunk-Z2FWAE4B.js → chunk-TEFZT5PJ.js} +84 -16
  23. package/dist/{chunk-7XDYVJLE.js → chunk-ULLTNDRA.js} +6 -6
  24. package/dist/{chunk-GOUM4JCT.js → chunk-VOVVTOEA.js} +2 -2
  25. package/dist/{chunk-FOI23UJL.js → chunk-WL7BIR6O.js} +1 -1
  26. package/dist/{chunk-JYXOEYI4.js → chunk-WW6DAGGR.js} +5 -5
  27. package/dist/{chunk-C427DVQF.js → chunk-WZG2SZOT.js} +22 -5
  28. package/dist/{chunk-NFYWLRUO.js → chunk-XH2RTYEQ.js} +3 -3
  29. package/dist/{chunk-2C4E3HBM.js → chunk-Z37APKBV.js} +5 -5
  30. package/dist/{chunk-RDRSWYNP.js → chunk-ZUVLC7TM.js} +1 -1
  31. package/dist/data.cjs +168 -24
  32. package/dist/data.js +8 -8
  33. package/dist/devtools.cjs +252 -32
  34. package/dist/devtools.js +7 -7
  35. package/dist/ecosystem.cjs +205 -64
  36. package/dist/ecosystem.js +10 -10
  37. package/dist/extras.cjs +245 -112
  38. package/dist/extras.js +24 -24
  39. package/dist/index.cjs +236 -105
  40. package/dist/index.d.cts +72 -8
  41. package/dist/index.d.ts +72 -8
  42. package/dist/index.js +14 -14
  43. package/dist/motion.cjs +336 -14
  44. package/dist/motion.js +4 -4
  45. package/dist/patterns.cjs +168 -24
  46. package/dist/patterns.js +6 -6
  47. package/dist/performance.cjs +305 -32
  48. package/dist/performance.js +8 -8
  49. package/dist/plugins.cjs +268 -69
  50. package/dist/plugins.js +12 -12
  51. package/dist/{ssr-2QDQ27EV.js → ssr-6D67RAVB.js} +3 -3
  52. package/dist/ssr.cjs +205 -63
  53. package/dist/ssr.js +11 -11
  54. package/dist/testing.cjs +415 -12
  55. package/dist/testing.js +16 -10
  56. package/dist/ui.cjs +248 -36
  57. package/dist/ui.js +9 -9
  58. package/dist/widgets.cjs +176 -26
  59. package/dist/widgets.js +8 -8
  60. package/package.json +1 -1
@@ -41,7 +41,9 @@ function sanitizeSrcset(value) {
41
41
  }
42
42
  return out.join(", ");
43
43
  }
44
+ var CSS_DANGER_GATE = /[(:@\\]/;
44
45
  function sanitizeCSSValue(value) {
46
+ if (!CSS_DANGER_GATE.test(value)) return value;
45
47
  const decoded = value.replace(/\\([0-9a-fA-F]{1,6})\s?/g, (_m, hex) => {
46
48
  const code = Number.parseInt(hex, 16);
47
49
  if (!Number.isFinite(code) || code < 0 || code > 1114111) return "";
@@ -90,6 +92,12 @@ var URL_ATTRIBUTES = /* @__PURE__ */ new Set([
90
92
  function isUrlAttribute(attr) {
91
93
  return URL_ATTRIBUTES.has(attr.toLowerCase());
92
94
  }
95
+ function sanitizeAttributeString(attr, value) {
96
+ const lower = attr.toLowerCase();
97
+ if (lower === "srcset") return sanitizeSrcset(value);
98
+ if (URL_ATTRIBUTES.has(lower)) return sanitizeUrl(value);
99
+ return value;
100
+ }
93
101
 
94
102
  export {
95
103
  stripControlChars,
@@ -98,5 +106,6 @@ export {
98
106
  sanitizeSrcset,
99
107
  sanitizeCSSValue,
100
108
  stripHtml,
101
- isUrlAttribute
109
+ isUrlAttribute,
110
+ sanitizeAttributeString
102
111
  };
@@ -1,25 +1,23 @@
1
1
  import {
2
2
  bindAttribute
3
- } from "./chunk-RLUJL2MV.js";
3
+ } from "./chunk-NHKQKKZU.js";
4
4
  import {
5
5
  dispose,
6
6
  registerDisposer
7
- } from "./chunk-2UPRY23K.js";
7
+ } from "./chunk-5VGSK6D2.js";
8
8
  import {
9
9
  isEventHandlerAttr,
10
- isUrlAttribute,
11
- sanitizeCSSValue,
12
- sanitizeSrcset,
13
- sanitizeUrl
14
- } from "./chunk-HMJFCBRR.js";
10
+ sanitizeAttributeString,
11
+ sanitizeCSSValue
12
+ } from "./chunk-L3GAGWCC.js";
15
13
  import {
16
14
  reactiveBinding,
17
15
  track
18
- } from "./chunk-Z2FWAE4B.js";
16
+ } from "./chunk-TEFZT5PJ.js";
19
17
  import {
20
18
  devWarn,
21
19
  isDev
22
- } from "./chunk-LMLD24FC.js";
20
+ } from "./chunk-COY6PUD2.js";
23
21
 
24
22
  // src/reactivity/bindChildNode.ts
25
23
  var _isDev = isDev();
@@ -98,11 +96,8 @@ function bindChildNode(placeholder, getter) {
98
96
  var SVG_NS = "http://www.w3.org/2000/svg";
99
97
  var _isDev2 = isDev();
100
98
  var BLOCKED_TAGS = /* @__PURE__ */ new Set(["script", "iframe", "object", "embed", "frame", "frameset"]);
101
- function validateTagName(tag) {
102
- const lower = tag.toLowerCase();
103
- if (BLOCKED_TAGS.has(lower)) {
104
- throw new Error(`tagFactory: refusing to create <${tag}> \u2014 tag is blocked for security reasons.`);
105
- }
99
+ function isBlockedTag(tag) {
100
+ return BLOCKED_TAGS.has(tag.toLowerCase());
106
101
  }
107
102
  var CLOBBER_RISKY_IDS = /* @__PURE__ */ new Set([
108
103
  "config",
@@ -257,8 +252,11 @@ function appendChildren(el, nodes) {
257
252
  }
258
253
  }
259
254
  var tagFactory = (tag, ns) => {
255
+ const blocked = isBlockedTag(tag);
260
256
  return (first, second) => {
261
- validateTagName(tag);
257
+ if (blocked) {
258
+ throw new Error(`tagFactory: refusing to create <${tag}> \u2014 tag is blocked for security reasons.`);
259
+ }
262
260
  const el = ns ? document.createElementNS(ns, tag) : document.createElement(tag);
263
261
  if (first === void 0) return el;
264
262
  if (typeof first === "string") {
@@ -328,7 +326,6 @@ var tagFactory = (tag, ns) => {
328
326
  default: {
329
327
  const value = props[key];
330
328
  if (value == null) continue;
331
- const lkey = key.toLowerCase();
332
329
  if (isEventHandlerAttr(key)) continue;
333
330
  if (typeof value === "function") {
334
331
  registerDisposer(el, bindAttribute(el, key, value));
@@ -341,14 +338,7 @@ var tagFactory = (tag, ns) => {
341
338
  el.removeAttribute(key);
342
339
  }
343
340
  } else {
344
- const str = String(value);
345
- if (lkey === "srcset") {
346
- el.setAttribute(key, sanitizeSrcset(str));
347
- } else if (isUrlAttribute(lkey)) {
348
- el.setAttribute(key, sanitizeUrl(str));
349
- } else {
350
- el.setAttribute(key, str);
351
- }
341
+ el.setAttribute(key, sanitizeAttributeString(key, String(value)));
352
342
  }
353
343
  }
354
344
  }
@@ -1,16 +1,19 @@
1
1
  import {
2
2
  dispose
3
- } from "./chunk-2UPRY23K.js";
3
+ } from "./chunk-5VGSK6D2.js";
4
+ import {
5
+ sanitizeUrl
6
+ } from "./chunk-L3GAGWCC.js";
4
7
  import {
5
8
  effect
6
- } from "./chunk-FDY42FIU.js";
9
+ } from "./chunk-MHBCEJQO.js";
7
10
  import {
8
11
  signal
9
- } from "./chunk-C427DVQF.js";
12
+ } from "./chunk-WZG2SZOT.js";
10
13
  import {
11
14
  devWarn,
12
15
  isDev
13
- } from "./chunk-LMLD24FC.js";
16
+ } from "./chunk-COY6PUD2.js";
14
17
 
15
18
  // src/performance/scheduler.ts
16
19
  var Priority = {
@@ -284,11 +287,13 @@ function getDOMPool() {
284
287
  }
285
288
  var preloadedResources = /* @__PURE__ */ new Set();
286
289
  function preloadResource(url, type = "fetch") {
287
- if (preloadedResources.has(url)) return;
288
- preloadedResources.add(url);
290
+ const safe = sanitizeUrl(url);
291
+ if (!safe) return;
292
+ if (preloadedResources.has(safe)) return;
293
+ preloadedResources.add(safe);
289
294
  const link = document.createElement("link");
290
295
  link.rel = "preload";
291
- link.href = url;
296
+ link.href = safe;
292
297
  switch (type) {
293
298
  case "script":
294
299
  link.setAttribute("as", "script");
@@ -306,11 +311,13 @@ function preloadResource(url, type = "fetch") {
306
311
  document.head.appendChild(link);
307
312
  }
308
313
  function prefetch(url) {
309
- if (preloadedResources.has(url)) return;
310
- preloadedResources.add(url);
314
+ const safe = sanitizeUrl(url);
315
+ if (!safe) return;
316
+ if (preloadedResources.has(safe)) return;
317
+ preloadedResources.add(safe);
311
318
  const link = document.createElement("link");
312
319
  link.rel = "prefetch";
313
- link.href = url;
320
+ link.href = safe;
314
321
  document.head.appendChild(link);
315
322
  }
316
323
  function preloadImage(src) {
@@ -679,11 +686,14 @@ function lazyChunk(id, loader, registry, fallback) {
679
686
  }
680
687
  function preloadModule(url) {
681
688
  if (typeof document === "undefined") return;
682
- const existing = document.querySelector(`link[href="${url}"][rel="modulepreload"]`);
689
+ const safe = sanitizeUrl(url);
690
+ if (!safe) return;
691
+ const safeHref = typeof CSS !== "undefined" && typeof CSS.escape === "function" ? CSS.escape(safe) : safe.replace(/["\\]/g, "\\$&");
692
+ const existing = document.querySelector(`link[rel="modulepreload"][href="${safeHref}"]`);
683
693
  if (existing) return;
684
694
  const link = document.createElement("link");
685
695
  link.rel = "modulepreload";
686
- link.href = url;
696
+ link.href = safe;
687
697
  document.head.appendChild(link);
688
698
  }
689
699
  function preloadModules(urls) {
@@ -5,10 +5,10 @@ import {
5
5
  cleanup,
6
6
  retrack,
7
7
  untracked
8
- } from "./chunk-Z2FWAE4B.js";
8
+ } from "./chunk-TEFZT5PJ.js";
9
9
  import {
10
10
  devAssert
11
- } from "./chunk-LMLD24FC.js";
11
+ } from "./chunk-COY6PUD2.js";
12
12
 
13
13
  // src/core/signals/effect.ts
14
14
  var _g = globalThis;
@@ -1,15 +1,14 @@
1
1
  import {
2
2
  isEventHandlerAttr,
3
- isUrlAttribute,
4
- sanitizeUrl
5
- } from "./chunk-HMJFCBRR.js";
3
+ sanitizeAttributeString
4
+ } from "./chunk-L3GAGWCC.js";
6
5
  import {
7
6
  reactiveBinding
8
- } from "./chunk-Z2FWAE4B.js";
7
+ } from "./chunk-TEFZT5PJ.js";
9
8
  import {
10
9
  devWarn,
11
10
  isDev
12
- } from "./chunk-LMLD24FC.js";
11
+ } from "./chunk-COY6PUD2.js";
13
12
 
14
13
  // src/reactivity/bindAttribute.ts
15
14
  var _isDev = isDev();
@@ -48,7 +47,7 @@ function bindAttribute(el, attr, getter) {
48
47
  if ((attr === "value" || attr === "checked") && attr in el) {
49
48
  setProp(el, attr, attr === "checked" ? Boolean(value) : str);
50
49
  } else {
51
- el.setAttribute(attr, isUrlAttribute(attr) ? sanitizeUrl(str) : str);
50
+ el.setAttribute(attr, sanitizeAttributeString(attr, str));
52
51
  }
53
52
  }
54
53
  return reactiveBinding(commit);
@@ -78,7 +77,7 @@ function bindDynamic(el, nameGetter, valueGetter) {
78
77
  if ((name === "value" || name === "checked") && name in el) {
79
78
  setProp(el, name, name === "checked" ? Boolean(value) : str);
80
79
  } else {
81
- el.setAttribute(name, isUrlAttribute(name) ? sanitizeUrl(str) : str);
80
+ el.setAttribute(name, sanitizeAttributeString(name, str));
82
81
  }
83
82
  prevName = name;
84
83
  }
@@ -3,13 +3,13 @@ import {
3
3
  sanitizeSrcset,
4
4
  sanitizeUrl,
5
5
  stripControlChars
6
- } from "./chunk-HMJFCBRR.js";
6
+ } from "./chunk-L3GAGWCC.js";
7
7
  import {
8
8
  getSSRStore
9
9
  } from "./chunk-GOJMFRBL.js";
10
10
  import {
11
11
  isDev
12
- } from "./chunk-LMLD24FC.js";
12
+ } from "./chunk-COY6PUD2.js";
13
13
 
14
14
  // src/platform/ssr.ts
15
15
  function sanitizeUrlAttr(name, value) {
@@ -1,22 +1,22 @@
1
1
  import {
2
2
  bindAttribute
3
- } from "./chunk-RLUJL2MV.js";
3
+ } from "./chunk-NHKQKKZU.js";
4
4
  import {
5
5
  derived
6
- } from "./chunk-JYXOEYI4.js";
6
+ } from "./chunk-WW6DAGGR.js";
7
7
  import {
8
8
  dispose,
9
9
  registerDisposer
10
- } from "./chunk-2UPRY23K.js";
10
+ } from "./chunk-5VGSK6D2.js";
11
11
  import {
12
12
  effect
13
- } from "./chunk-FDY42FIU.js";
13
+ } from "./chunk-MHBCEJQO.js";
14
14
  import {
15
15
  signal
16
- } from "./chunk-C427DVQF.js";
16
+ } from "./chunk-WZG2SZOT.js";
17
17
  import {
18
18
  track
19
- } from "./chunk-Z2FWAE4B.js";
19
+ } from "./chunk-TEFZT5PJ.js";
20
20
 
21
21
  // src/ui/form.ts
22
22
  function required(message = "This field is required") {
@@ -2,11 +2,13 @@ import {
2
2
  isSSR
3
3
  } from "./chunk-GOJMFRBL.js";
4
4
  import {
5
+ resumeTracking,
6
+ suspendTracking,
5
7
  track
6
- } from "./chunk-Z2FWAE4B.js";
8
+ } from "./chunk-TEFZT5PJ.js";
7
9
  import {
8
10
  devAssert
9
- } from "./chunk-LMLD24FC.js";
11
+ } from "./chunk-COY6PUD2.js";
10
12
 
11
13
  // src/core/signals/watch.ts
12
14
  function watch(getter, callback) {
@@ -24,8 +26,14 @@ function watch(getter, callback) {
24
26
  return;
25
27
  }
26
28
  if (!Object.is(newValue, oldValue)) {
27
- callback(newValue, oldValue);
29
+ const prev = oldValue;
28
30
  oldValue = newValue;
31
+ suspendTracking();
32
+ try {
33
+ callback(newValue, prev);
34
+ } finally {
35
+ resumeTracking();
36
+ }
29
37
  }
30
38
  };
31
39
  const teardown = track(subscriber);
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  devWarn,
3
3
  isDev
4
- } from "./chunk-LMLD24FC.js";
4
+ } from "./chunk-COY6PUD2.js";
5
5
 
6
- // src/reactivity/track.ts
6
+ // src/reactivity/track-core.ts
7
7
  var _isDev = isDev();
8
8
  var POOL_MAX = 4096;
9
9
  var nodePool = [];
@@ -117,6 +117,9 @@ function resumeTracking() {
117
117
  trackingSuspended = false;
118
118
  }
119
119
  }
120
+ function isTrackingSuspended() {
121
+ return trackingSuspended;
122
+ }
120
123
  function untracked(fn) {
121
124
  suspendTracking();
122
125
  try {
@@ -234,6 +237,11 @@ function cleanup(subscriber) {
234
237
  var maxSubscriberRepeats = 50;
235
238
  var maxDrainIterations = 1e6;
236
239
  var drainEpoch = 0;
240
+ function setMaxSubscriberRepeats(n) {
241
+ const prev = maxSubscriberRepeats;
242
+ if (Number.isFinite(n) && n > 0) maxSubscriberRepeats = Math.floor(n);
243
+ return prev;
244
+ }
237
245
  function setMaxDrainIterations(n) {
238
246
  const prev = maxDrainIterations;
239
247
  if (Number.isFinite(n) && n > 0) maxDrainIterations = Math.floor(n);
@@ -409,19 +417,79 @@ function forEachSubscriber(signal, visit) {
409
417
  }
410
418
  }
411
419
 
420
+ // src/reactivity/track.ts
421
+ var _isDev2 = isDev();
422
+ var _runtimeVersion = typeof __SIBU_VERSION__ !== "undefined" ? __SIBU_VERSION__ : "dev";
423
+ var REGISTRY_KEY = /* @__PURE__ */ Symbol.for("sibujs.reactive.v1");
424
+ function resolveReactiveApi() {
425
+ const g = globalThis;
426
+ const existing = g[REGISTRY_KEY];
427
+ if (existing) {
428
+ if (_isDev2 && !existing.__dupWarned) {
429
+ existing.__dupWarned = true;
430
+ devWarn(
431
+ `Multiple instances of the reactive runtime detected on this page (active: ${existing.version}, duplicate: ${_runtimeVersion}). Reactivity still works \u2014 all copies share the first one \u2014 but de-duplicate sibujs in your bundler (e.g. Vite optimizeDeps.exclude: ['sibujs'] or resolve.dedupe: ['sibujs']).`
432
+ );
433
+ }
434
+ return existing;
435
+ }
436
+ const local = {
437
+ suspendTracking,
438
+ resumeTracking,
439
+ isTrackingSuspended,
440
+ untracked,
441
+ retrack,
442
+ track,
443
+ reactiveBinding,
444
+ recordDependency,
445
+ cleanup,
446
+ setMaxSubscriberRepeats,
447
+ setMaxDrainIterations,
448
+ drainNotificationQueue,
449
+ queueSignalNotification,
450
+ notifySubscribers,
451
+ getSubscriberCount,
452
+ getSubscriberDeps,
453
+ forEachSubscriber,
454
+ version: _runtimeVersion
455
+ };
456
+ g[REGISTRY_KEY] = local;
457
+ return local;
458
+ }
459
+ var API = resolveReactiveApi();
460
+ var suspendTracking2 = API.suspendTracking;
461
+ var resumeTracking2 = API.resumeTracking;
462
+ var isTrackingSuspended2 = API.isTrackingSuspended;
463
+ var untracked2 = API.untracked;
464
+ var retrack2 = API.retrack;
465
+ var track2 = API.track;
466
+ var reactiveBinding2 = API.reactiveBinding;
467
+ var recordDependency2 = API.recordDependency;
468
+ var cleanup2 = API.cleanup;
469
+ var setMaxSubscriberRepeats2 = API.setMaxSubscriberRepeats;
470
+ var setMaxDrainIterations2 = API.setMaxDrainIterations;
471
+ var drainNotificationQueue2 = API.drainNotificationQueue;
472
+ var queueSignalNotification2 = API.queueSignalNotification;
473
+ var notifySubscribers2 = API.notifySubscribers;
474
+ var getSubscriberCount2 = API.getSubscriberCount;
475
+ var getSubscriberDeps2 = API.getSubscriberDeps;
476
+ var forEachSubscriber2 = API.forEachSubscriber;
477
+
412
478
  export {
413
- trackingSuspended,
414
- untracked,
415
- retrack,
416
- track,
417
- reactiveBinding,
418
- recordDependency,
419
- cleanup,
420
- setMaxDrainIterations,
421
- drainNotificationQueue,
422
- queueSignalNotification,
423
- notifySubscribers,
424
- getSubscriberCount,
425
- getSubscriberDeps,
426
- forEachSubscriber
479
+ suspendTracking2 as suspendTracking,
480
+ resumeTracking2 as resumeTracking,
481
+ isTrackingSuspended2 as isTrackingSuspended,
482
+ untracked2 as untracked,
483
+ retrack2 as retrack,
484
+ track2 as track,
485
+ reactiveBinding2 as reactiveBinding,
486
+ recordDependency2 as recordDependency,
487
+ cleanup2 as cleanup,
488
+ setMaxDrainIterations2 as setMaxDrainIterations,
489
+ drainNotificationQueue2 as drainNotificationQueue,
490
+ queueSignalNotification2 as queueSignalNotification,
491
+ notifySubscribers2 as notifySubscribers,
492
+ getSubscriberCount2 as getSubscriberCount,
493
+ getSubscriberDeps2 as getSubscriberDeps,
494
+ forEachSubscriber2 as forEachSubscriber
427
495
  };
@@ -1,23 +1,23 @@
1
1
  import {
2
2
  dispose
3
- } from "./chunk-2UPRY23K.js";
3
+ } from "./chunk-5VGSK6D2.js";
4
4
  import {
5
5
  stripHtml
6
- } from "./chunk-HMJFCBRR.js";
6
+ } from "./chunk-L3GAGWCC.js";
7
7
  import {
8
8
  effect
9
- } from "./chunk-FDY42FIU.js";
9
+ } from "./chunk-MHBCEJQO.js";
10
10
  import {
11
11
  signal
12
- } from "./chunk-C427DVQF.js";
12
+ } from "./chunk-WZG2SZOT.js";
13
13
  import {
14
14
  forEachSubscriber,
15
15
  getSubscriberCount,
16
16
  getSubscriberDeps
17
- } from "./chunk-Z2FWAE4B.js";
17
+ } from "./chunk-TEFZT5PJ.js";
18
18
  import {
19
19
  isDev
20
- } from "./chunk-LMLD24FC.js";
20
+ } from "./chunk-COY6PUD2.js";
21
21
 
22
22
  // src/devtools/debug.ts
23
23
  var debugEnabled = false;
@@ -3,11 +3,11 @@ import {
3
3
  } from "./chunk-H3SRKIYX.js";
4
4
  import {
5
5
  effect
6
- } from "./chunk-FDY42FIU.js";
6
+ } from "./chunk-MHBCEJQO.js";
7
7
  import {
8
8
  batch,
9
9
  signal
10
- } from "./chunk-C427DVQF.js";
10
+ } from "./chunk-WZG2SZOT.js";
11
11
 
12
12
  // src/browser/media.ts
13
13
  function media(query) {
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  signal
3
- } from "./chunk-C427DVQF.js";
3
+ } from "./chunk-WZG2SZOT.js";
4
4
 
5
5
  // src/ui/transition.ts
6
6
  function transition(element, options = {}) {
@@ -1,12 +1,12 @@
1
1
  import {
2
+ isTrackingSuspended,
2
3
  recordDependency,
3
4
  retrack,
4
- track,
5
- trackingSuspended
6
- } from "./chunk-Z2FWAE4B.js";
5
+ track
6
+ } from "./chunk-TEFZT5PJ.js";
7
7
  import {
8
8
  devAssert
9
- } from "./chunk-LMLD24FC.js";
9
+ } from "./chunk-COY6PUD2.js";
10
10
 
11
11
  // src/core/signals/derived.ts
12
12
  function derived(getter, options) {
@@ -49,7 +49,7 @@ function derived(getter, options) {
49
49
  `[SibuJS] Circular dependency detected in derived${debugName ? ` "${debugName}"` : ""}. A derived signal cannot read itself (directly or through a chain).`
50
50
  );
51
51
  }
52
- if (trackingSuspended) {
52
+ if (isTrackingSuspended()) {
53
53
  if (cs._d) {
54
54
  const prev = cs._v;
55
55
  evaluating = true;
@@ -3,15 +3,15 @@ import {
3
3
  notifySubscribers,
4
4
  queueSignalNotification,
5
5
  recordDependency
6
- } from "./chunk-Z2FWAE4B.js";
6
+ } from "./chunk-TEFZT5PJ.js";
7
7
  import {
8
8
  isDev
9
- } from "./chunk-LMLD24FC.js";
9
+ } from "./chunk-COY6PUD2.js";
10
10
 
11
11
  // src/reactivity/batch.ts
12
12
  var batchDepth = 0;
13
13
  var pendingSignals = /* @__PURE__ */ new Set();
14
- function batch(fn) {
14
+ function batchImpl(fn) {
15
15
  batchDepth++;
16
16
  try {
17
17
  return fn();
@@ -22,12 +22,12 @@ function batch(fn) {
22
22
  }
23
23
  }
24
24
  }
25
- function enqueueBatchedSignal(signal2) {
25
+ function enqueueBatchedSignalImpl(signal2) {
26
26
  if (batchDepth === 0) return false;
27
27
  pendingSignals.add(signal2);
28
28
  return true;
29
29
  }
30
- function isBatching() {
30
+ function isBatchingImpl() {
31
31
  return batchDepth > 0;
32
32
  }
33
33
  function flushBatch() {
@@ -40,6 +40,23 @@ function flushBatch() {
40
40
  }
41
41
  drainNotificationQueue();
42
42
  }
43
+ var BATCH_REGISTRY_KEY = /* @__PURE__ */ Symbol.for("sibujs.reactive.batch.v1");
44
+ function resolveBatchApi() {
45
+ const g = globalThis;
46
+ const existing = g[BATCH_REGISTRY_KEY];
47
+ if (existing) return existing;
48
+ const local = {
49
+ batch: batchImpl,
50
+ enqueueBatchedSignal: enqueueBatchedSignalImpl,
51
+ isBatching: isBatchingImpl
52
+ };
53
+ g[BATCH_REGISTRY_KEY] = local;
54
+ return local;
55
+ }
56
+ var API = resolveBatchApi();
57
+ var batch = API.batch;
58
+ var enqueueBatchedSignal = API.enqueueBatchedSignal;
59
+ var isBatching = API.isBatching;
43
60
 
44
61
  // src/core/signals/signal.ts
45
62
  var _g = globalThis;
@@ -4,14 +4,14 @@ import {
4
4
  } from "./chunk-H3SRKIYX.js";
5
5
  import {
6
6
  derived
7
- } from "./chunk-JYXOEYI4.js";
7
+ } from "./chunk-WW6DAGGR.js";
8
8
  import {
9
9
  effect
10
- } from "./chunk-FDY42FIU.js";
10
+ } from "./chunk-MHBCEJQO.js";
11
11
  import {
12
12
  batch,
13
13
  signal
14
- } from "./chunk-C427DVQF.js";
14
+ } from "./chunk-WZG2SZOT.js";
15
15
 
16
16
  // src/patterns/machine.ts
17
17
  function machine(config) {
@@ -1,19 +1,19 @@
1
1
  import {
2
2
  watch
3
- } from "./chunk-H6PCHJZQ.js";
3
+ } from "./chunk-SLMFA3ZZ.js";
4
4
  import {
5
5
  derived
6
- } from "./chunk-JYXOEYI4.js";
6
+ } from "./chunk-WW6DAGGR.js";
7
7
  import {
8
8
  stripHtml
9
- } from "./chunk-HMJFCBRR.js";
9
+ } from "./chunk-L3GAGWCC.js";
10
10
  import {
11
11
  effect
12
- } from "./chunk-FDY42FIU.js";
12
+ } from "./chunk-MHBCEJQO.js";
13
13
  import {
14
14
  batch,
15
15
  signal
16
- } from "./chunk-C427DVQF.js";
16
+ } from "./chunk-WZG2SZOT.js";
17
17
 
18
18
  // src/widgets/Combobox.ts
19
19
  var comboboxIdCounter = 0;
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  renderToString
3
- } from "./chunk-HXMS4SNP.js";
3
+ } from "./chunk-R3QEDXFS.js";
4
4
 
5
5
  // src/plugins/modular.ts
6
6
  function createModuleRegistry() {