mol_dump_lib 0.0.461 → 0.0.462

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.
package/web.mjs CHANGED
@@ -595,21 +595,28 @@ var $;
595
595
  "use strict";
596
596
  var $;
597
597
  (function ($) {
598
- class $mol_after_timeout extends $mol_object2 {
599
- delay;
598
+ class $mol_after_tick extends $mol_object2 {
600
599
  task;
601
- id;
602
- constructor(delay, task) {
600
+ static promise = null;
601
+ cancelled = false;
602
+ constructor(task) {
603
603
  super();
604
- this.delay = delay;
605
604
  this.task = task;
606
- this.id = setTimeout(task, delay);
605
+ if (!$mol_after_tick.promise)
606
+ $mol_after_tick.promise = Promise.resolve().then(() => {
607
+ $mol_after_tick.promise = null;
608
+ });
609
+ $mol_after_tick.promise.then(() => {
610
+ if (this.cancelled)
611
+ return;
612
+ task();
613
+ });
607
614
  }
608
615
  destructor() {
609
- clearTimeout(this.id);
616
+ this.cancelled = true;
610
617
  }
611
618
  }
612
- $.$mol_after_timeout = $mol_after_timeout;
619
+ $.$mol_after_tick = $mol_after_tick;
613
620
  })($ || ($ = {}));
614
621
 
615
622
  ;
@@ -642,7 +649,7 @@ var $;
642
649
  static plan() {
643
650
  if (this.plan_task)
644
651
  return;
645
- this.plan_task = new $mol_after_timeout(0, () => {
652
+ this.plan_task = new $mol_after_tick(() => {
646
653
  try {
647
654
  this.sync();
648
655
  }
@@ -1530,30 +1537,6 @@ var $;
1530
1537
  $.$mol_dom_context = self;
1531
1538
  })($ || ($ = {}));
1532
1539
 
1533
- ;
1534
- "use strict";
1535
- var $;
1536
- (function ($) {
1537
- class $mol_after_tick extends $mol_object2 {
1538
- task;
1539
- promise;
1540
- cancelled = false;
1541
- constructor(task) {
1542
- super();
1543
- this.task = task;
1544
- this.promise = Promise.resolve().then(() => {
1545
- if (this.cancelled)
1546
- return;
1547
- task();
1548
- });
1549
- }
1550
- destructor() {
1551
- this.cancelled = true;
1552
- }
1553
- }
1554
- $.$mol_after_tick = $mol_after_tick;
1555
- })($ || ($ = {}));
1556
-
1557
1540
  ;
1558
1541
  "use strict";
1559
1542
  var $;
@@ -2492,9 +2475,7 @@ var $;
2492
2475
  const win = this.$.$mol_dom_context;
2493
2476
  if (win.parent !== win.self && !win.document.hasFocus())
2494
2477
  return;
2495
- new this.$.$mol_after_timeout(500, () => {
2496
- this.focused(true);
2497
- });
2478
+ this.focused(true);
2498
2479
  }
2499
2480
  destructor() {
2500
2481
  const node = $mol_wire_probe(() => this.dom_node());
@@ -2575,7 +2556,7 @@ var $;
2575
2556
  "use strict";
2576
2557
  var $;
2577
2558
  (function ($) {
2578
- $mol_style_attach("mol/view/view/view.css", "[mol_view] {\n\ttransition-property: height, width, min-height, min-width, max-width, max-height, transform;\n\ttransition-duration: .2s;\n\ttransition-timing-function: ease-out;\n\t-webkit-appearance: none;\n\tbox-sizing: border-box;\n\tdisplay: flex;\n\tflex-shrink: 0;\n\tcontain: style;\n\tscrollbar-color: var(--mol_theme_line) transparent;\n\tscrollbar-width: thin;\n}\t\n\n[mol_view]::selection {\n\tbackground: var(--mol_theme_line);\n}\t\n\n[mol_view]::-webkit-scrollbar {\n\twidth: .25rem;\n\theight: .25rem;\n}\n\n[mol_view]::-webkit-scrollbar-corner {\n\tbackground-color: var(--mol_theme_line);\n}\n\n[mol_view]::-webkit-scrollbar-track {\n\tbackground-color: transparent;\n}\n\n[mol_view]::-webkit-scrollbar-thumb {\n\tbackground-color: var(--mol_theme_line);\n\tborder-radius: var(--mol_gap_round);\n}\n\n[mol_view] > * {\n\tword-break: inherit;\n}\n\n[mol_view_root] {\n\tmargin: 0;\n\tpadding: 0;\n\twidth: 100%;\n\theight: 100%;\n\tbox-sizing: border-box;\n\tfont-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;\n\tfont-size: 1rem;\n\tline-height: 1.5rem;\n\tbackground: var(--mol_theme_back);\n\tcolor: var(--mol_theme_text);\n\tcontain: unset; /** Fixes bg ignoring when applied to body on Chrome */\n\ttab-size: 4;\n\toverscroll-behavior: contain; /** Disable navigation gestures **/\n}\n\n@media print {\n\t[mol_view_root] {\n\t\theight: auto;\n\t}\n}\n\n[mol_view][mol_view_error]:not([mol_view_error=\"Promise\"]) {\n\tbackground-image: repeating-linear-gradient(\n\t\t-45deg,\n\t\t#f92323,\n\t\t#f92323 .5rem,\n\t\t#ff3d3d .5rem,\n\t\t#ff3d3d 1.5rem\n\t);\n\tcolor: black;\n\talign-items: center;\n\tjustify-content: center;\n}\n\n@keyframes mol_view_wait {\n\tfrom {\n\t\topacity: .25;\n\t}\n\t20% {\n\t\topacity: .75;\n\t}\n\tto {\n\t\topacity: .25;\n\t}\n}\n\n:where([mol_view][mol_view_error=\"Promise\"]) {\n\tbackground: var(--mol_theme_hover);\n}\n\n[mol_view][mol_view_error=\"Promise\"] {\n\tanimation: mol_view_wait 1s steps( 20, end ) infinite;\n}\n");
2559
+ $mol_style_attach("mol/view/view/view.css", "[mol_view] {\n\ttransition-property: height, width, min-height, min-width, max-width, max-height, transform;\n\ttransition-duration: .2s;\n\ttransition-timing-function: ease-out;\n\t-webkit-appearance: none;\n\tbox-sizing: border-box;\n\tdisplay: flex;\n\tflex-shrink: 0;\n\tcontain: style;\n\tscrollbar-color: var(--mol_theme_line) transparent;\n\tscrollbar-width: thin;\n}\t\n\n[mol_view]::selection {\n\tbackground: var(--mol_theme_line);\n}\t\n\n[mol_view]::-webkit-scrollbar {\n\twidth: .25rem;\n\theight: .25rem;\n}\n\n[mol_view]::-webkit-scrollbar-corner {\n\tbackground-color: var(--mol_theme_line);\n}\n\n[mol_view]::-webkit-scrollbar-track {\n\tbackground-color: transparent;\n}\n\n[mol_view]::-webkit-scrollbar-thumb {\n\tbackground-color: var(--mol_theme_line);\n\tborder-radius: var(--mol_gap_round);\n}\n\n[mol_view] > * {\n\tword-break: inherit;\n}\n\n[mol_view_root] {\n\tmargin: 0;\n\tpadding: 0;\n\twidth: 100%;\n\theight: 100%;\n\tbox-sizing: border-box;\n\tfont-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;\n\tfont-size: 1rem;\n\tline-height: 1.5rem;\n\tbackground: var(--mol_theme_back);\n\tcolor: var(--mol_theme_text);\n\tcontain: unset; /** Fixes bg ignoring when applied to body on Chrome */\n\ttab-size: 4;\n\toverscroll-behavior: contain; /** Disable navigation gestures **/\n}\n\n@media print {\n\t[mol_view_root] {\n\t\theight: auto;\n\t}\n}\n\n[mol_view][mol_view_error]:not([mol_view_error=\"Promise\"]) {\n\tbackground-image: repeating-linear-gradient(\n\t\t-45deg,\n\t\t#f92323,\n\t\t#f92323 .5rem,\n\t\t#ff3d3d .5rem,\n\t\t#ff3d3d 1.5rem\n\t);\n\tcolor: black;\n\talign-items: center;\n\tjustify-content: center;\n}\n\n@keyframes mol_view_wait {\n\tfrom {\n\t\topacity: .25;\n\t}\n\t20% {\n\t\topacity: .75;\n\t}\n\tto {\n\t\topacity: .25;\n\t}\n}\n\n:where([mol_view][mol_view_error=\"Promise\"]) {\n\tbackground: var(--mol_theme_hover);\n}\n\n[mol_view][mol_view_error=\"Promise\"] {\n\tanimation: mol_view_wait 1s steps(20,end) infinite;\n}\n");
2579
2560
  })($ || ($ = {}));
2580
2561
 
2581
2562
  ;
@@ -4292,6 +4273,27 @@ var $;
4292
4273
  };
4293
4274
 
4294
4275
 
4276
+ ;
4277
+ "use strict";
4278
+ var $;
4279
+ (function ($) {
4280
+ class $mol_after_timeout extends $mol_object2 {
4281
+ delay;
4282
+ task;
4283
+ id;
4284
+ constructor(delay, task) {
4285
+ super();
4286
+ this.delay = delay;
4287
+ this.task = task;
4288
+ this.id = setTimeout(task, delay);
4289
+ }
4290
+ destructor() {
4291
+ clearTimeout(this.id);
4292
+ }
4293
+ }
4294
+ $.$mol_after_timeout = $mol_after_timeout;
4295
+ })($ || ($ = {}));
4296
+
4295
4297
  ;
4296
4298
  "use strict";
4297
4299
  var $;
package/web.test.js CHANGED
@@ -1074,7 +1074,7 @@ var $;
1074
1074
  var $;
1075
1075
  (function ($_1) {
1076
1076
  $mol_test_mocks.push($ => {
1077
- $.$mol_after_timeout = $mol_after_mock_timeout;
1077
+ $.$mol_after_tick = $mol_after_mock_commmon;
1078
1078
  });
1079
1079
  })($ || ($ = {}));
1080
1080
 
@@ -1182,6 +1182,15 @@ var $;
1182
1182
  $.$mol_promise = $mol_promise;
1183
1183
  })($ || ($ = {}));
1184
1184
 
1185
+ ;
1186
+ "use strict";
1187
+ var $;
1188
+ (function ($_1) {
1189
+ $mol_test_mocks.push($ => {
1190
+ $.$mol_after_timeout = $mol_after_mock_timeout;
1191
+ });
1192
+ })($ || ($ = {}));
1193
+
1185
1194
  ;
1186
1195
  "use strict";
1187
1196
  var $;
@@ -2038,15 +2047,6 @@ var $;
2038
2047
  $mol_wire_log.active();
2039
2048
  })($ || ($ = {}));
2040
2049
 
2041
- ;
2042
- "use strict";
2043
- var $;
2044
- (function ($_1) {
2045
- $mol_test_mocks.push($ => {
2046
- $.$mol_after_tick = $mol_after_mock_commmon;
2047
- });
2048
- })($ || ($ = {}));
2049
-
2050
2050
  ;
2051
2051
  "use strict";
2052
2052
  var $;