sibujs 4.12.0 → 4.13.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 (74) hide show
  1. package/dist/browser.cjs +71 -18
  2. package/dist/browser.js +4 -4
  3. package/dist/build.cjs +6618 -6178
  4. package/dist/build.d.cts +554 -415
  5. package/dist/build.d.ts +554 -415
  6. package/dist/build.js +2091 -1735
  7. package/dist/cdn.dev.global.js +12 -12
  8. package/dist/cdn.full.dev.global.js +13 -13
  9. package/dist/cdn.full.global.js +12 -12
  10. package/dist/cdn.global.js +12 -12
  11. package/dist/{chunk-WFRQ6D7H.js → chunk-22OPSWMF.js} +1 -1
  12. package/dist/{chunk-ZJCHY2IB.js → chunk-2NC56RGY.js} +1 -1
  13. package/dist/{chunk-NB7TFSJE.js → chunk-2O6JJCUR.js} +4 -4
  14. package/dist/{chunk-B2Y5BJSP.js → chunk-4UTGDVSA.js} +70 -16
  15. package/dist/{chunk-NAVLCP4S.js → chunk-5RIBLY2N.js} +4 -4
  16. package/dist/{chunk-T5O2CUHV.js → chunk-5XUGJM3J.js} +1 -1
  17. package/dist/{chunk-HXT2RNH5.js → chunk-ADZHPN2B.js} +1 -1
  18. package/dist/chunk-B36ADEIR.js +21 -0
  19. package/dist/{chunk-DFZL3AX7.js → chunk-C73VBPEF.js} +9 -5
  20. package/dist/{chunk-WH4U2VUE.js → chunk-CPQKWCJ2.js} +13 -5
  21. package/dist/{chunk-LEUEKK4G.js → chunk-EU7T7EB3.js} +2 -2
  22. package/dist/{chunk-QLG5IK7F.js → chunk-G3Z2FEBR.js} +4 -4
  23. package/dist/{chunk-ZPY2UAKM.js → chunk-J4X7ICH4.js} +3 -3
  24. package/dist/{chunk-XX4BRMWF.js → chunk-K4LNUT5L.js} +1 -1
  25. package/dist/{chunk-CI4W6XAU.js → chunk-KC62VURU.js} +3 -3
  26. package/dist/chunk-N5TBYXHW.js +17 -0
  27. package/dist/{chunk-653KGQS2.js → chunk-OIKD7YDY.js} +2 -2
  28. package/dist/{chunk-LYTUTXQP.js → chunk-PBJYCE2Z.js} +46 -4
  29. package/dist/{chunk-EMB5PG7V.js → chunk-QC3NP47A.js} +1 -1
  30. package/dist/{chunk-IHA62NGJ.js → chunk-QKFVMIAV.js} +1 -1
  31. package/dist/{chunk-LXBMVGVB.js → chunk-QZ47OZ25.js} +3 -3
  32. package/dist/{chunk-ZTYCCBU3.js → chunk-VFPLWUT7.js} +44 -26
  33. package/dist/{chunk-RK7EPQPG.js → chunk-YFTBCCVH.js} +1 -1
  34. package/dist/data.cjs +71 -18
  35. package/dist/data.js +5 -5
  36. package/dist/datePicker-DxuxWpgF.d.cts +285 -0
  37. package/dist/datePicker-DxuxWpgF.d.ts +285 -0
  38. package/dist/devtools.cjs +71 -18
  39. package/dist/devtools.js +4 -4
  40. package/dist/ecosystem.cjs +82 -21
  41. package/dist/ecosystem.js +7 -7
  42. package/dist/extras.cjs +131 -23
  43. package/dist/extras.d.cts +2 -2
  44. package/dist/extras.d.ts +2 -2
  45. package/dist/extras.js +21 -20
  46. package/dist/index.cjs +115 -37
  47. package/dist/index.d.cts +59 -5
  48. package/dist/index.d.ts +59 -5
  49. package/dist/index.js +10 -10
  50. package/dist/motion.cjs +69 -16
  51. package/dist/motion.js +3 -3
  52. package/dist/patterns.cjs +71 -18
  53. package/dist/patterns.js +5 -5
  54. package/dist/performance.cjs +69 -16
  55. package/dist/performance.js +4 -4
  56. package/dist/plugins.cjs +1421 -996
  57. package/dist/plugins.d.cts +132 -3
  58. package/dist/plugins.d.ts +132 -3
  59. package/dist/plugins.js +262 -11
  60. package/dist/routeMiddleware-B1sp4P7a.d.ts +688 -0
  61. package/dist/routeMiddleware-CedQTsLK.d.cts +688 -0
  62. package/dist/ssr.cjs +3607 -3524
  63. package/dist/ssr.d.cts +20 -671
  64. package/dist/ssr.d.ts +20 -671
  65. package/dist/ssr.js +15 -7
  66. package/dist/testing.cjs +71 -18
  67. package/dist/testing.js +2 -2
  68. package/dist/ui.cjs +78 -18
  69. package/dist/ui.js +8 -7
  70. package/dist/widgets.cjs +1352 -952
  71. package/dist/widgets.d.cts +100 -268
  72. package/dist/widgets.d.ts +100 -268
  73. package/dist/widgets.js +316 -7
  74. package/package.json +9 -1
package/dist/browser.cjs CHANGED
@@ -345,6 +345,7 @@ function bindOwnerScope(fn) {
345
345
  if (scope === null) return fn;
346
346
  return (...args) => runWithOwnerScope(scope, () => fn(...args));
347
347
  }
348
+ var currentStructOwner = null;
348
349
  var subscriberEpochCounter = 0;
349
350
  function retrack(effectFn, subscriber) {
350
351
  const prev = currentSubscriber;
@@ -364,6 +365,9 @@ function retrack(effectFn, subscriber) {
364
365
  if (prevScope !== null && !sub._epoch && sub._scope === void 0) sub._scope = prevScope;
365
366
  const scope = sub._scope === void 0 ? null : sub._scope;
366
367
  if (scope !== prevScope) currentOwnerScope = scope;
368
+ const prevStructOwner = currentStructOwner;
369
+ if (prevStructOwner !== null && !sub._epoch && !sub._c && sub._owner == null) sub._owner = prevStructOwner;
370
+ if (sub._tok != null) currentStructOwner = sub._tok;
367
371
  const epoch = ++subscriberEpochCounter;
368
372
  sub._epoch = epoch;
369
373
  sub._structDirty = false;
@@ -377,6 +381,7 @@ function retrack(effectFn, subscriber) {
377
381
  } finally {
378
382
  currentSubscriber = prev;
379
383
  currentOwnerScope = prevScope;
384
+ currentStructOwner = prevStructOwner;
380
385
  if (savedDepth !== 0) {
381
386
  suspendDepth = savedDepth;
382
387
  suspendSavedSub = savedSuspendSub;
@@ -433,7 +438,25 @@ function track(effectFn, subscriber) {
433
438
  }
434
439
  return sub._dispose ?? (sub._dispose = () => cleanup(subscriber));
435
440
  }
436
- function reactiveBinding(commit, ownerNode) {
441
+ function reactiveBinding(commit, ownerNode, structural) {
442
+ return createBinding(commit, ownerNode, structural === true)._dispose;
443
+ }
444
+ function structuralBinding(commit, ownerNode) {
445
+ const sub = createBinding(commit, ownerNode, true);
446
+ return {
447
+ stop: sub._dispose,
448
+ run: (fn) => {
449
+ const prev = currentStructOwner;
450
+ currentStructOwner = sub._tok ?? null;
451
+ try {
452
+ return fn();
453
+ } finally {
454
+ currentStructOwner = prev;
455
+ }
456
+ }
457
+ };
458
+ }
459
+ function createBinding(commit, ownerNode, structural) {
437
460
  const run = () => {
438
461
  const s = subscriber;
439
462
  if (s._disposed || s._reentrant) return;
@@ -456,19 +479,25 @@ function reactiveBinding(commit, ownerNode) {
456
479
  subscriber._disposed = false;
457
480
  subscriber._errorPhase = "binding";
458
481
  subscriber._errorNode = ownerNode;
482
+ subscriber._tok = null;
483
+ subscriber._owner = null;
484
+ if (structural) subscriber._tok = { sub: subscriber };
459
485
  try {
460
486
  run();
461
487
  } catch (err) {
462
488
  subscriber._disposed = true;
463
489
  subscriber._errorNode = void 0;
490
+ if (subscriber._tok != null) subscriber._tok.sub = null;
464
491
  cleanup(subscriber);
465
492
  throw err;
466
493
  }
467
- return subscriber._dispose ?? (subscriber._dispose = () => {
494
+ subscriber._dispose = () => {
468
495
  subscriber._disposed = true;
469
496
  subscriber._errorNode = void 0;
497
+ if (subscriber._tok != null) subscriber._tok.sub = null;
470
498
  cleanup(subscriber);
471
- });
499
+ };
500
+ return subscriber;
472
501
  }
473
502
  function recordDependency(signal2) {
474
503
  if (!currentSubscriber) return;
@@ -492,6 +521,7 @@ function recordDependency(signal2) {
492
521
  }
493
522
  function cleanup(subscriber) {
494
523
  const sub = subscriber;
524
+ if (sub._owner != null) sub._owner = null;
495
525
  let node = sub.depsHead ?? null;
496
526
  sub.depsHead = null;
497
527
  sub.depsTail = null;
@@ -551,20 +581,41 @@ function drainQueue() {
551
581
  break;
552
582
  }
553
583
  const sub = pendingQueue[i++];
554
- pendingSet.delete(sub);
555
- if (quarantined.size > 0 && quarantined.has(sub)) continue;
556
- if (sub._hasComputedDep === true && !depsChanged(sub)) continue;
557
- if (tickRepeat(sub)) {
558
- cycleError(sub);
559
- quarantined.add(sub);
560
- continue;
561
- }
562
- const pushed = beginDisposerCapture(sub._cap ?? null);
563
- try {
564
- safeInvoke(sub);
565
- } finally {
566
- if (pushed) endDisposerCapture();
567
- }
584
+ if (!pendingSet.delete(sub)) continue;
585
+ if (sub._owner != null && pendingSet.size > 0) {
586
+ runPendingOwners(sub);
587
+ if (pendingSet.has(sub)) continue;
588
+ }
589
+ runQueued(sub);
590
+ }
591
+ }
592
+ function runPendingOwners(sub) {
593
+ for (; ; ) {
594
+ let outer = null;
595
+ for (let t = sub._owner ?? null; t !== null; ) {
596
+ const o = t.sub;
597
+ if (o === null) break;
598
+ if (pendingSet.has(o)) outer = o;
599
+ t = o._owner ?? null;
600
+ }
601
+ if (outer === null) return;
602
+ pendingSet.delete(outer);
603
+ runQueued(outer);
604
+ }
605
+ }
606
+ function runQueued(sub) {
607
+ if (quarantined.size > 0 && quarantined.has(sub)) return;
608
+ if (sub._hasComputedDep === true && !depsChanged(sub)) return;
609
+ if (tickRepeat(sub)) {
610
+ cycleError(sub);
611
+ quarantined.add(sub);
612
+ return;
613
+ }
614
+ const pushed = beginDisposerCapture(sub._cap ?? null);
615
+ try {
616
+ safeInvoke(sub);
617
+ } finally {
618
+ if (pushed) endDisposerCapture();
568
619
  }
569
620
  }
570
621
  function drainNotificationQueue() {
@@ -700,7 +751,7 @@ function forEachSubscriber(signal2, visit) {
700
751
  }
701
752
 
702
753
  // src/reactivity/track.ts
703
- var _runtimeVersion = true ? "4.12.0" : "dev";
754
+ var _runtimeVersion = true ? "4.13.1" : "dev";
704
755
  var REGISTRY_KEY = /* @__PURE__ */ Symbol.for("sibujs.reactive.v1");
705
756
  function resolveReactiveApi() {
706
757
  const g = globalThis;
@@ -735,6 +786,7 @@ function resolveReactiveApi() {
735
786
  getOwnerScope,
736
787
  runWithOwnerScope,
737
788
  bindOwnerScope,
789
+ structuralBinding,
738
790
  version: _runtimeVersion
739
791
  };
740
792
  g[REGISTRY_KEY] = local;
@@ -761,6 +813,7 @@ var forEachSubscriber2 = API.forEachSubscriber;
761
813
  var getOwnerScope2 = API.getOwnerScope ?? getOwnerScope;
762
814
  var runWithOwnerScope2 = API.runWithOwnerScope ?? runWithOwnerScope;
763
815
  var bindOwnerScope2 = API.bindOwnerScope ?? bindOwnerScope;
816
+ var structuralBinding2 = API.structuralBinding ?? ((commit, ownerNode) => ({ stop: API.reactiveBinding(commit, ownerNode), run: (fn) => fn() }));
764
817
 
765
818
  // src/reactivity/batch.ts
766
819
  var batchDepth = 0;
package/dist/browser.js CHANGED
@@ -36,15 +36,15 @@ import {
36
36
  visibility,
37
37
  wakeLock,
38
38
  windowSize
39
- } from "./chunk-LEUEKK4G.js";
39
+ } from "./chunk-EU7T7EB3.js";
40
40
  import "./chunk-52XFPGSN.js";
41
41
  import "./chunk-62BDYGAG.js";
42
42
  import "./chunk-7ZHH77QA.js";
43
- import "./chunk-EMB5PG7V.js";
43
+ import "./chunk-QC3NP47A.js";
44
44
  import "./chunk-EXXSN3BW.js";
45
45
  import "./chunk-7XHATCIH.js";
46
- import "./chunk-IHA62NGJ.js";
47
- import "./chunk-B2Y5BJSP.js";
46
+ import "./chunk-QKFVMIAV.js";
47
+ import "./chunk-4UTGDVSA.js";
48
48
  import "./chunk-NYNYSPK7.js";
49
49
  export {
50
50
  __resetSpeechCoordinator,