sibujs 4.14.0 → 4.15.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 (93) hide show
  1. package/dist/browser.cjs +297 -45
  2. package/dist/browser.js +6 -7
  3. package/dist/build.cjs +2189 -573
  4. package/dist/build.js +16 -15
  5. package/dist/cdn.dev.global.js +13 -12
  6. package/dist/cdn.full.dev.global.js +14 -13
  7. package/dist/cdn.full.global.js +12 -12
  8. package/dist/cdn.global.js +12 -12
  9. package/dist/{chunk-RVR5NPFL.js → chunk-2VKTFA7C.js} +1 -1
  10. package/dist/{chunk-7ILEHTVX.js → chunk-4AEFGRYW.js} +1 -1
  11. package/dist/{chunk-4TQDTWWN.js → chunk-6IV5ZRG6.js} +5 -7
  12. package/dist/{chunk-GVAMIU6K.js → chunk-75EAQH3U.js} +2 -2
  13. package/dist/{chunk-TLS4NVIB.js → chunk-7JO7DPSS.js} +4 -4
  14. package/dist/{chunk-SVULV7O4.js → chunk-AQH7WDSE.js} +6 -8
  15. package/dist/{chunk-S37PZD6I.js → chunk-BF3WBJJQ.js} +60 -10
  16. package/dist/{chunk-LJMX4SQ7.js → chunk-BG4BP44S.js} +3 -3
  17. package/dist/{chunk-N7A6FKWW.js → chunk-D44TAGCT.js} +2 -2
  18. package/dist/{chunk-CCKUNHVU.js → chunk-DAEXQJQA.js} +1 -1
  19. package/dist/chunk-DNCQDFJJ.js +22 -0
  20. package/dist/{chunk-BKZ5N6NK.js → chunk-DNCT2UXB.js} +4 -4
  21. package/dist/{chunk-BOYKGGVD.js → chunk-DRWOD7RZ.js} +4 -4
  22. package/dist/chunk-DS5V2PRE.js +64 -0
  23. package/dist/{chunk-VM2U5LEL.js → chunk-EHSJESRN.js} +595 -123
  24. package/dist/{chunk-MIRKTVH4.js → chunk-GFM5WWPU.js} +252 -5
  25. package/dist/{chunk-52XFPGSN.js → chunk-HTPOIAAL.js} +1 -1
  26. package/dist/{chunk-3HEX6QJQ.js → chunk-I2R5QALY.js} +2 -4
  27. package/dist/{chunk-4FJSAUKB.js → chunk-IUBV5WO5.js} +1 -1
  28. package/dist/{chunk-A454RAEK.js → chunk-KIDETDMU.js} +5 -7
  29. package/dist/{chunk-JTFQ7IL4.js → chunk-KPAXG5IR.js} +7 -9
  30. package/dist/{chunk-AE32RGWX.js → chunk-LGUXYHTZ.js} +3 -3
  31. package/dist/{chunk-Y4LUM2XS.js → chunk-LQWLPQOK.js} +6 -8
  32. package/dist/{chunk-CNPT6NKV.js → chunk-MINLMJUY.js} +48 -9
  33. package/dist/{chunk-BNXRWZZV.js → chunk-OURTGOJT.js} +8 -10
  34. package/dist/{chunk-F67F77IA.js → chunk-TQ24Y3IV.js} +2 -2
  35. package/dist/{chunk-2TTRW2TE.js → chunk-UM3M5PXS.js} +8 -8
  36. package/dist/{chunk-CJ7KS3DF.js → chunk-VSTX3XSX.js} +205 -15
  37. package/dist/{chunk-HQIAL7F2.js → chunk-XPDZ2LDR.js} +2 -2
  38. package/dist/{chunk-UUIKJJIK.js → chunk-Y7JM7GY2.js} +5 -7
  39. package/dist/{chunk-QS6GMWDD.js → chunk-YAFITBOK.js} +1269 -162
  40. package/dist/data.cjs +285 -33
  41. package/dist/data.js +6 -7
  42. package/dist/devtools.cjs +289 -39
  43. package/dist/devtools.js +5 -6
  44. package/dist/{dispose-EIHHHDC7.js → dispose-3WDBYJMH.js} +3 -1
  45. package/dist/ecosystem.cjs +345 -61
  46. package/dist/ecosystem.d.cts +1 -1
  47. package/dist/ecosystem.d.ts +1 -1
  48. package/dist/ecosystem.js +10 -10
  49. package/dist/extras.cjs +568 -248
  50. package/dist/extras.d.cts +1 -1
  51. package/dist/extras.d.ts +1 -1
  52. package/dist/extras.js +27 -27
  53. package/dist/index.cjs +2134 -515
  54. package/dist/index.d.cts +628 -211
  55. package/dist/index.d.ts +628 -211
  56. package/dist/index.js +22 -15
  57. package/dist/motion.cjs +286 -30
  58. package/dist/motion.js +4 -4
  59. package/dist/patterns.cjs +301 -43
  60. package/dist/patterns.js +6 -6
  61. package/dist/performance.cjs +286 -36
  62. package/dist/performance.js +9 -9
  63. package/dist/plugins.cjs +1237 -291
  64. package/dist/plugins.d.cts +3 -1
  65. package/dist/plugins.d.ts +3 -1
  66. package/dist/plugins.js +20 -19
  67. package/dist/{renderRoute-fxgsm2Ir.d.ts → renderRoute-B84MONaO.d.cts} +2 -2
  68. package/dist/{renderRoute-DP20XwMS.d.cts → renderRoute-_yxPuEQY.d.ts} +2 -2
  69. package/dist/{routeHead-CE9SV-cH.d.cts → routeHead-DLxlq15W.d.cts} +94 -0
  70. package/dist/{routeHead-DzVxPviY.d.ts → routeHead-w8nANZ3M.d.ts} +94 -0
  71. package/dist/{ssr-NECEU4X4.js → ssr-EF3IUHTE.js} +6 -6
  72. package/dist/ssr-dom.cjs +64 -9
  73. package/dist/ssr-dom.d.cts +2 -0
  74. package/dist/ssr-dom.d.ts +2 -0
  75. package/dist/ssr-dom.js +2 -1
  76. package/dist/ssr.cjs +850 -170
  77. package/dist/ssr.d.cts +5 -3
  78. package/dist/ssr.d.ts +5 -3
  79. package/dist/ssr.js +16 -15
  80. package/dist/{tagFactory-DkytnJws.d.cts → tagFactory-BfEh69VF.d.cts} +7 -0
  81. package/dist/{tagFactory-Bnd_Nph9.d.ts → tagFactory-pSYiLYyh.d.ts} +7 -0
  82. package/dist/testing.cjs +817 -132
  83. package/dist/testing.d.cts +4 -2
  84. package/dist/testing.d.ts +4 -2
  85. package/dist/testing.js +18 -17
  86. package/dist/track-core-0edROAF5.d.ts +187 -0
  87. package/dist/track-core-DN5fYLWi.d.cts +187 -0
  88. package/dist/ui.cjs +293 -43
  89. package/dist/ui.js +10 -12
  90. package/dist/widgets.cjs +285 -27
  91. package/dist/widgets.js +7 -7
  92. package/package.json +1 -1
  93. package/dist/chunk-7ZHH77QA.js +0 -9
package/dist/browser.cjs CHANGED
@@ -175,13 +175,26 @@ function reportError(error, context) {
175
175
  });
176
176
  }
177
177
 
178
+ // src/utils/globalSingleton.ts
179
+ function globalSingleton(key, create) {
180
+ const g = globalThis;
181
+ return g[key] ?? (g[key] = create());
182
+ }
183
+
178
184
  // src/core/rendering/dispose.ts
185
+ var state2 = globalSingleton(/* @__PURE__ */ Symbol.for("sibujs.disposers.v1"), () => ({
186
+ disposers: /* @__PURE__ */ new WeakMap(),
187
+ captures: [],
188
+ bindings: { count: 0 }
189
+ }));
190
+ var elementDisposers = state2.disposers;
191
+ var bindings = state2.bindings;
179
192
  function resolveCapture(capture) {
180
193
  let frame = capture;
181
194
  while (frame?.closed) frame = frame.forwardTo;
182
195
  return frame ?? null;
183
196
  }
184
- var registrationCaptures = [];
197
+ var registrationCaptures = state2.captures;
185
198
  function currentDisposerCapture() {
186
199
  return resolveCapture(registrationCaptures[registrationCaptures.length - 1]);
187
200
  }
@@ -357,6 +370,201 @@ function bindOwnerScope(fn) {
357
370
  return (...args) => runWithOwnerScope(scope, () => fn(...args));
358
371
  }
359
372
  var currentStructOwner = null;
373
+ var frozenOwners = 0;
374
+ var ACTIVE = 0;
375
+ var PAUSED = 1;
376
+ var ENDED = 2;
377
+ var NOOP = () => {
378
+ };
379
+ var skippedWhileHeld = /* @__PURE__ */ new Set();
380
+ var waiters = /* @__PURE__ */ new Set();
381
+ var heldRoots = /* @__PURE__ */ new Set();
382
+ function ownerState(tok) {
383
+ let state3 = ACTIVE;
384
+ for (let t = tok; t !== null; ) {
385
+ const o = t.sub;
386
+ if (o === null) return ENDED;
387
+ if (o._frozen === true) state3 = PAUSED;
388
+ t = o._owner ?? null;
389
+ }
390
+ return state3;
391
+ }
392
+ var endWatchers = /* @__PURE__ */ new Set();
393
+ var stateWatchers = /* @__PURE__ */ new Set();
394
+ var stateCheckQueued = false;
395
+ function queueStateCheck() {
396
+ if (stateCheckQueued || stateWatchers.size === 0) return;
397
+ stateCheckQueued = true;
398
+ queueMicrotask(() => {
399
+ stateCheckQueued = false;
400
+ for (const watcher of [...stateWatchers]) {
401
+ if (!stateWatchers.has(watcher)) continue;
402
+ const state3 = watcher.check.state();
403
+ if (state3 === ENDED) stateWatchers.delete(watcher);
404
+ if (state3 === ENDED || state3 === watcher.last) continue;
405
+ watcher.last = state3;
406
+ try {
407
+ watcher.listener(state3);
408
+ } catch (err) {
409
+ reportError(err, { phase: "effect" });
410
+ }
411
+ }
412
+ });
413
+ }
414
+ var ALWAYS_ACTIVE = Object.assign(() => false, {
415
+ state: () => ACTIVE,
416
+ wait: (onActive) => {
417
+ onActive();
418
+ return NOOP;
419
+ },
420
+ onEnd: () => NOOP,
421
+ run: (fn) => fn(),
422
+ onChange: () => NOOP,
423
+ within: () => false
424
+ });
425
+ function captureFrozen() {
426
+ const tok = currentStructOwner;
427
+ if (tok === null) return ALWAYS_ACTIVE;
428
+ const state3 = () => ownerState(tok);
429
+ const check = Object.assign(() => state3() !== ACTIVE, {
430
+ state: state3,
431
+ wait: (onActive, onEnd) => {
432
+ const now = state3();
433
+ if (now !== PAUSED) {
434
+ (now === ACTIVE ? onActive : onEnd)();
435
+ return NOOP;
436
+ }
437
+ const waiter = { check, onActive, onEnd };
438
+ waiters.add(waiter);
439
+ return () => {
440
+ waiters.delete(waiter);
441
+ };
442
+ },
443
+ onEnd: (onEnd) => {
444
+ if (state3() === ENDED) {
445
+ onEnd();
446
+ return NOOP;
447
+ }
448
+ const watcher = { check, onActive: NOOP, onEnd };
449
+ endWatchers.add(watcher);
450
+ return () => {
451
+ endWatchers.delete(watcher);
452
+ };
453
+ },
454
+ run: (fn) => {
455
+ const prev = currentStructOwner;
456
+ currentStructOwner = tok.sub === null ? null : tok;
457
+ try {
458
+ return fn();
459
+ } finally {
460
+ currentStructOwner = prev;
461
+ }
462
+ },
463
+ onChange: (listener) => {
464
+ const last = state3();
465
+ if (last === ENDED) return NOOP;
466
+ const watcher = { check, last, listener };
467
+ stateWatchers.add(watcher);
468
+ return () => {
469
+ stateWatchers.delete(watcher);
470
+ };
471
+ },
472
+ within: (owner) => {
473
+ const target = owner.run(() => currentStructOwner);
474
+ if (target === null) return false;
475
+ for (let t = tok; t !== null; ) {
476
+ if (t === target) return true;
477
+ const o = t.sub;
478
+ if (o === null) return false;
479
+ t = o._owner ?? null;
480
+ }
481
+ return false;
482
+ }
483
+ });
484
+ return check;
485
+ }
486
+ function holdSubtree(root) {
487
+ heldRoots.add(root);
488
+ return () => {
489
+ if (heldRoots.delete(root)) settleHeld();
490
+ };
491
+ }
492
+ function isHeld(sub) {
493
+ if (frozenOwners !== 0 && hasFrozenOwner(sub)) return true;
494
+ if (heldRoots.size !== 0) {
495
+ const node = sub._errorNode;
496
+ if (node != null) {
497
+ for (const root of heldRoots) if (root.contains(node)) return true;
498
+ }
499
+ }
500
+ return false;
501
+ }
502
+ function notifyEnded() {
503
+ for (const watcher of stateWatchers) if (watcher.check.state() === ENDED) stateWatchers.delete(watcher);
504
+ let ended = null;
505
+ for (const watcher of endWatchers) {
506
+ if (watcher.check.state() !== ENDED) continue;
507
+ endWatchers.delete(watcher);
508
+ (ended ?? (ended = [])).push(watcher);
509
+ }
510
+ if (ended === null) return;
511
+ for (const watcher of ended) {
512
+ try {
513
+ watcher.onEnd();
514
+ } catch (err) {
515
+ reportError(err, { phase: "cleanup" });
516
+ }
517
+ }
518
+ }
519
+ function dropReleasedSkipped() {
520
+ for (const sub of skippedWhileHeld) {
521
+ if (sub._disposed === true || sub.depsHead == null) skippedWhileHeld.delete(sub);
522
+ }
523
+ }
524
+ function settleHeld() {
525
+ for (const sub of skippedWhileHeld) {
526
+ if (sub._disposed === true) skippedWhileHeld.delete(sub);
527
+ else if (!isHeld(sub)) {
528
+ skippedWhileHeld.delete(sub);
529
+ if (!pendingSet.has(sub)) {
530
+ pendingSet.add(sub);
531
+ pendingQueue.push(sub);
532
+ }
533
+ }
534
+ }
535
+ if (frozenOwners === 0 && heldRoots.size === 0) skippedWhileHeld.clear();
536
+ let ready = null;
537
+ for (const waiter of waiters) {
538
+ if (waiter.check.state() === PAUSED) continue;
539
+ waiters.delete(waiter);
540
+ (ready ?? (ready = [])).push(waiter);
541
+ }
542
+ if (ready !== null) {
543
+ const settle = ready;
544
+ queueMicrotask(() => {
545
+ for (const waiter of settle) {
546
+ const state3 = waiter.check.state();
547
+ if (state3 === PAUSED) waiters.add(waiter);
548
+ else
549
+ try {
550
+ (state3 === ACTIVE ? waiter.onActive : waiter.onEnd)();
551
+ } catch (err) {
552
+ reportError(err, { phase: "effect" });
553
+ }
554
+ }
555
+ });
556
+ }
557
+ if (pendingQueue.length > 0) drainNotificationQueue();
558
+ }
559
+ function hasFrozenOwner(sub) {
560
+ for (let t = sub._owner ?? null; t !== null; ) {
561
+ const o = t.sub;
562
+ if (o === null) return false;
563
+ if (o._frozen === true) return true;
564
+ t = o._owner ?? null;
565
+ }
566
+ return false;
567
+ }
360
568
  var subscriberEpochCounter = 0;
361
569
  function retrack(effectFn, subscriber) {
362
570
  const prev = currentSubscriber;
@@ -464,6 +672,20 @@ function structuralBinding(commit, ownerNode) {
464
672
  } finally {
465
673
  currentStructOwner = prev;
466
674
  }
675
+ },
676
+ freeze: () => {
677
+ const s = sub;
678
+ if (s._disposed || s._frozen) return;
679
+ s._frozen = true;
680
+ frozenOwners++;
681
+ queueStateCheck();
682
+ },
683
+ thaw: () => {
684
+ if (!sub._frozen) return;
685
+ sub._frozen = false;
686
+ frozenOwners--;
687
+ queueStateCheck();
688
+ settleHeld();
467
689
  }
468
690
  };
469
691
  }
@@ -492,20 +714,34 @@ function createBinding(commit, ownerNode, structural) {
492
714
  subscriber._errorNode = ownerNode;
493
715
  subscriber._tok = null;
494
716
  subscriber._owner = null;
717
+ subscriber._frozen = false;
495
718
  if (structural) subscriber._tok = { sub: subscriber };
496
719
  try {
497
720
  run();
498
721
  } catch (err) {
499
722
  subscriber._disposed = true;
500
723
  subscriber._errorNode = void 0;
501
- if (subscriber._tok != null) subscriber._tok.sub = null;
724
+ if (subscriber._tok != null) {
725
+ subscriber._tok.sub = null;
726
+ if (endWatchers.size !== 0 || stateWatchers.size !== 0) notifyEnded();
727
+ }
502
728
  cleanup(subscriber);
503
729
  throw err;
504
730
  }
505
731
  subscriber._dispose = () => {
506
732
  subscriber._disposed = true;
733
+ const wasFrozen = subscriber._frozen === true;
734
+ if (wasFrozen) {
735
+ subscriber._frozen = false;
736
+ frozenOwners--;
737
+ }
507
738
  subscriber._errorNode = void 0;
508
- if (subscriber._tok != null) subscriber._tok.sub = null;
739
+ if (subscriber._tok != null) {
740
+ subscriber._tok.sub = null;
741
+ if (endWatchers.size !== 0 || stateWatchers.size !== 0) notifyEnded();
742
+ if (skippedWhileHeld.size !== 0) dropReleasedSkipped();
743
+ if (wasFrozen || waiters.size !== 0) settleHeld();
744
+ }
509
745
  cleanup(subscriber);
510
746
  };
511
747
  return subscriber;
@@ -615,6 +851,10 @@ function runPendingOwners(sub) {
615
851
  }
616
852
  }
617
853
  function runQueued(sub) {
854
+ if ((frozenOwners !== 0 || heldRoots.size !== 0) && isHeld(sub)) {
855
+ skippedWhileHeld.add(sub);
856
+ return;
857
+ }
618
858
  if (quarantined.size > 0 && quarantined.has(sub)) return;
619
859
  if (sub._hasComputedDep === true && !depsChanged(sub)) return;
620
860
  if (tickRepeat(sub)) {
@@ -762,7 +1002,7 @@ function forEachSubscriber(signal2, visit) {
762
1002
  }
763
1003
 
764
1004
  // src/reactivity/track.ts
765
- var _runtimeVersion = true ? "4.14.0" : "dev";
1005
+ var _runtimeVersion = true ? "4.15.0" : "dev";
766
1006
  var REGISTRY_KEY = /* @__PURE__ */ Symbol.for("sibujs.reactive.v1");
767
1007
  function resolveReactiveApi() {
768
1008
  const g = globalThis;
@@ -798,6 +1038,8 @@ function resolveReactiveApi() {
798
1038
  runWithOwnerScope,
799
1039
  bindOwnerScope,
800
1040
  structuralBinding,
1041
+ captureFrozen,
1042
+ holdSubtree,
801
1043
  version: _runtimeVersion
802
1044
  };
803
1045
  g[REGISTRY_KEY] = local;
@@ -825,6 +1067,22 @@ var getOwnerScope2 = API.getOwnerScope ?? getOwnerScope;
825
1067
  var runWithOwnerScope2 = API.runWithOwnerScope ?? runWithOwnerScope;
826
1068
  var bindOwnerScope2 = API.bindOwnerScope ?? bindOwnerScope;
827
1069
  var structuralBinding2 = API.structuralBinding ?? ((commit, ownerNode) => ({ stop: API.reactiveBinding(commit, ownerNode), run: (fn) => fn() }));
1070
+ var captureFrozen2 = API.captureFrozen ?? (() => Object.assign(() => false, {
1071
+ state: () => 0,
1072
+ wait: (onActive) => {
1073
+ onActive();
1074
+ return () => {
1075
+ };
1076
+ },
1077
+ onEnd: () => () => {
1078
+ },
1079
+ run: (fn) => fn(),
1080
+ onChange: () => () => {
1081
+ },
1082
+ within: () => false
1083
+ }));
1084
+ var holdSubtree2 = API.holdSubtree ?? (() => () => {
1085
+ });
828
1086
 
829
1087
  // src/reactivity/batch.ts
830
1088
  var batchDepth = 0;
@@ -887,7 +1145,7 @@ function emitDevtools(hook, event, payload) {
887
1145
  // src/core/signals/signal.ts
888
1146
  var _g = globalThis;
889
1147
  function signal(initial, options) {
890
- const state2 = {
1148
+ const state3 = {
891
1149
  value: initial,
892
1150
  __v: 0,
893
1151
  __sc: 0,
@@ -900,57 +1158,57 @@ function signal(initial, options) {
900
1158
  };
901
1159
  const debugName = DEV ? options?.name : void 0;
902
1160
  const equalsFn = options?.equals;
903
- if (debugName) state2.__name = debugName;
1161
+ if (debugName) state3.__name = debugName;
904
1162
  function get() {
905
- recordDependency2(state2);
906
- return state2.value;
1163
+ recordDependency2(state3);
1164
+ return state3.value;
907
1165
  }
908
- get.__signal = state2;
1166
+ get.__signal = state3;
909
1167
  if (debugName) get.__name = debugName;
910
1168
  let set;
911
1169
  if (equalsFn) {
912
1170
  set = (next) => {
913
- const prev = state2.value;
1171
+ const prev = state3.value;
914
1172
  const newValue = typeof next === "function" ? next(prev) : next;
915
1173
  if (equalsFn(prev, newValue)) return;
916
- state2.value = newValue;
917
- state2.__v++;
1174
+ state3.value = newValue;
1175
+ state3.__v++;
918
1176
  if (DEV) {
919
1177
  const hook = _g.__SIBU_DEVTOOLS_GLOBAL_HOOK__;
920
- if (hook) emitDevtools(hook, "signal:update", { signal: state2, name: debugName, oldValue: prev, newValue });
1178
+ if (hook) emitDevtools(hook, "signal:update", { signal: state3, name: debugName, oldValue: prev, newValue });
921
1179
  }
922
- if (!enqueueBatchedSignal(state2)) {
923
- notifySubscribers2(state2);
1180
+ if (!enqueueBatchedSignal(state3)) {
1181
+ notifySubscribers2(state3);
924
1182
  }
925
1183
  };
926
1184
  } else if (DEV) {
927
1185
  set = (next) => {
928
- const prev = state2.value;
1186
+ const prev = state3.value;
929
1187
  const newValue = typeof next === "function" ? next(prev) : next;
930
1188
  if (Object.is(newValue, prev)) return;
931
- state2.value = newValue;
932
- state2.__v++;
1189
+ state3.value = newValue;
1190
+ state3.__v++;
933
1191
  const hook = _g.__SIBU_DEVTOOLS_GLOBAL_HOOK__;
934
- if (hook) emitDevtools(hook, "signal:update", { signal: state2, name: debugName, oldValue: prev, newValue });
935
- if (!enqueueBatchedSignal(state2)) {
936
- notifySubscribers2(state2);
1192
+ if (hook) emitDevtools(hook, "signal:update", { signal: state3, name: debugName, oldValue: prev, newValue });
1193
+ if (!enqueueBatchedSignal(state3)) {
1194
+ notifySubscribers2(state3);
937
1195
  }
938
1196
  };
939
1197
  } else {
940
1198
  set = (next) => {
941
- const prev = state2.value;
1199
+ const prev = state3.value;
942
1200
  const newValue = typeof next === "function" ? next(prev) : next;
943
1201
  if (Object.is(newValue, prev)) return;
944
- state2.value = newValue;
945
- state2.__v++;
946
- if (!enqueueBatchedSignal(state2)) {
947
- notifySubscribers2(state2);
1202
+ state3.value = newValue;
1203
+ state3.__v++;
1204
+ if (!enqueueBatchedSignal(state3)) {
1205
+ notifySubscribers2(state3);
948
1206
  }
949
1207
  };
950
1208
  }
951
1209
  if (DEV) {
952
1210
  const hook = _g.__SIBU_DEVTOOLS_GLOBAL_HOOK__;
953
- if (hook) emitDevtools(hook, "signal:create", { signal: state2, name: debugName, getter: get, initial });
1211
+ if (hook) emitDevtools(hook, "signal:create", { signal: state3, name: debugName, getter: get, initial });
954
1212
  }
955
1213
  return [get, set];
956
1214
  }
@@ -1383,13 +1641,13 @@ function idle(timeout = 6e4) {
1383
1641
 
1384
1642
  // src/browser/permissions.ts
1385
1643
  function permissions(name) {
1386
- const [state2, setState] = signal("prompt");
1644
+ const [state3, setState] = signal("prompt");
1387
1645
  let permissionStatus = null;
1388
1646
  let onChange = null;
1389
1647
  let disposed = false;
1390
1648
  if (typeof navigator === "undefined" || !navigator.permissions) {
1391
1649
  setState("unsupported");
1392
- return { state: state2, dispose: () => {
1650
+ return { state: state3, dispose: () => {
1393
1651
  } };
1394
1652
  }
1395
1653
  navigator.permissions.query({ name }).then((status) => {
@@ -1412,7 +1670,7 @@ function permissions(name) {
1412
1670
  onChange = null;
1413
1671
  }
1414
1672
  }
1415
- return { state: state2, dispose };
1673
+ return { state: state3, dispose };
1416
1674
  }
1417
1675
 
1418
1676
  // src/browser/clipboard.ts
@@ -1608,12 +1866,6 @@ function dropZone(element, options) {
1608
1866
  return { isOver, dispose };
1609
1867
  }
1610
1868
 
1611
- // src/utils/globalSingleton.ts
1612
- function globalSingleton(key, create) {
1613
- const g = globalThis;
1614
- return g[key] ?? (g[key] = create());
1615
- }
1616
-
1617
1869
  // src/utils/singletonResource.ts
1618
1870
  function singletonResource(io) {
1619
1871
  let original = null;
@@ -1763,9 +2015,9 @@ function colorScheme() {
1763
2015
  // src/browser/format.ts
1764
2016
  var I18N_STATE = /* @__PURE__ */ Symbol.for("sibujs.i18n.v1");
1765
2017
  function activeI18nLocale() {
1766
- const state2 = globalThis[I18N_STATE];
1767
- if (!state2) return void 0;
1768
- return state2.getLocale ? state2.getLocale() : state2.locale?.[0]();
2018
+ const state3 = globalThis[I18N_STATE];
2019
+ if (!state3) return void 0;
2020
+ return state3.getLocale ? state3.getLocale() : state3.locale?.[0]();
1769
2021
  }
1770
2022
  function formatNumber(value, options) {
1771
2023
  const { locale, ...formatOptions } = options ?? {};
@@ -1947,9 +2199,9 @@ function notifyUrlWrite() {
1947
2199
  for (const sync of Array.from(_url.instances)) sync();
1948
2200
  }
1949
2201
  var SCROLL_ENTRY_KEY = "__sibuScrollKey";
1950
- function withoutEntryIdentity(state2) {
1951
- if (state2 === null || typeof state2 !== "object" || !Object.hasOwn(state2, SCROLL_ENTRY_KEY)) return state2;
1952
- const { [SCROLL_ENTRY_KEY]: _identity, ...rest } = state2;
2202
+ function withoutEntryIdentity(state3) {
2203
+ if (state3 === null || typeof state3 !== "object" || !Object.hasOwn(state3, SCROLL_ENTRY_KEY)) return state3;
2204
+ const { [SCROLL_ENTRY_KEY]: _identity, ...rest } = state3;
1953
2205
  return rest;
1954
2206
  }
1955
2207
  function urlState() {
@@ -1987,9 +2239,9 @@ function urlState() {
1987
2239
  window.addEventListener("hashchange", syncFromLocation);
1988
2240
  _url.instances.add(syncFromLocation);
1989
2241
  function writeHistory(newUrl, opts) {
1990
- const state2 = "state" in opts ? opts.state : window.history.state;
1991
- if (opts.replace) window.history.replaceState(state2, "", newUrl);
1992
- else window.history.pushState("state" in opts ? state2 : withoutEntryIdentity(state2), "", newUrl);
2242
+ const state3 = "state" in opts ? opts.state : window.history.state;
2243
+ if (opts.replace) window.history.replaceState(state3, "", newUrl);
2244
+ else window.history.pushState("state" in opts ? state3 : withoutEntryIdentity(state3), "", newUrl);
1993
2245
  }
1994
2246
  function setParams(next, opts = {}) {
1995
2247
  const p = next instanceof URLSearchParams ? next : new URLSearchParams(next);
package/dist/browser.js CHANGED
@@ -36,16 +36,15 @@ import {
36
36
  visibility,
37
37
  wakeLock,
38
38
  windowSize
39
- } from "./chunk-A454RAEK.js";
40
- import "./chunk-52XFPGSN.js";
39
+ } from "./chunk-KIDETDMU.js";
40
+ import "./chunk-HTPOIAAL.js";
41
41
  import "./chunk-62BDYGAG.js";
42
- import "./chunk-7ZHH77QA.js";
43
- import "./chunk-AE32RGWX.js";
42
+ import "./chunk-LGUXYHTZ.js";
44
43
  import "./chunk-B3HOT4TK.js";
45
44
  import "./chunk-UYTYNCMZ.js";
46
- import "./chunk-4FJSAUKB.js";
47
- import "./chunk-MIRKTVH4.js";
48
- import "./chunk-S37PZD6I.js";
45
+ import "./chunk-IUBV5WO5.js";
46
+ import "./chunk-GFM5WWPU.js";
47
+ import "./chunk-BF3WBJJQ.js";
49
48
  import "./chunk-NT3ZYB5S.js";
50
49
  import "./chunk-R5U7XKVJ.js";
51
50
  export {