mol_plot_all 1.2.1009 → 1.2.1011

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/node.mjs CHANGED
@@ -610,35 +610,24 @@ var $;
610
610
  "use strict";
611
611
  var $;
612
612
  (function ($) {
613
- class $mol_after_timeout extends $mol_object2 {
614
- delay;
613
+ class $mol_after_tick extends $mol_object2 {
615
614
  task;
616
- id;
617
- constructor(delay, task) {
615
+ promise;
616
+ cancelled = false;
617
+ constructor(task) {
618
618
  super();
619
- this.delay = delay;
620
619
  this.task = task;
621
- this.id = setTimeout(task, delay);
620
+ this.promise = Promise.resolve().then(() => {
621
+ if (this.cancelled)
622
+ return;
623
+ task();
624
+ });
622
625
  }
623
626
  destructor() {
624
- clearTimeout(this.id);
625
- }
626
- }
627
- $.$mol_after_timeout = $mol_after_timeout;
628
- })($ || ($ = {}));
629
-
630
- ;
631
- "use strict";
632
- var $;
633
- (function ($) {
634
- class $mol_after_frame extends $mol_after_timeout {
635
- task;
636
- constructor(task) {
637
- super(16, task);
638
- this.task = task;
627
+ this.cancelled = true;
639
628
  }
640
629
  }
641
- $.$mol_after_frame = $mol_after_frame;
630
+ $.$mol_after_tick = $mol_after_tick;
642
631
  })($ || ($ = {}));
643
632
 
644
633
  ;
@@ -666,7 +655,7 @@ var $;
666
655
  static plan() {
667
656
  if (this.plan_task)
668
657
  return;
669
- this.plan_task = new $mol_after_frame(() => {
658
+ this.plan_task = new $mol_after_tick(() => {
670
659
  try {
671
660
  this.sync();
672
661
  }
@@ -868,7 +857,7 @@ var $;
868
857
  sub.track_off(prev);
869
858
  sub.absorb = () => {
870
859
  done(null);
871
- sub.destructor();
860
+ setTimeout(() => sub.destructor());
872
861
  };
873
862
  });
874
863
  }
@@ -938,6 +927,41 @@ var $;
938
927
  $.$mol_key = $mol_key;
939
928
  })($ || ($ = {}));
940
929
 
930
+ ;
931
+ "use strict";
932
+ var $;
933
+ (function ($) {
934
+ class $mol_after_timeout extends $mol_object2 {
935
+ delay;
936
+ task;
937
+ id;
938
+ constructor(delay, task) {
939
+ super();
940
+ this.delay = delay;
941
+ this.task = task;
942
+ this.id = setTimeout(task, delay);
943
+ }
944
+ destructor() {
945
+ clearTimeout(this.id);
946
+ }
947
+ }
948
+ $.$mol_after_timeout = $mol_after_timeout;
949
+ })($ || ($ = {}));
950
+
951
+ ;
952
+ "use strict";
953
+ var $;
954
+ (function ($) {
955
+ class $mol_after_frame extends $mol_after_timeout {
956
+ task;
957
+ constructor(task) {
958
+ super(16, task);
959
+ this.task = task;
960
+ }
961
+ }
962
+ $.$mol_after_frame = $mol_after_frame;
963
+ })($ || ($ = {}));
964
+
941
965
  ;
942
966
  "use strict";
943
967
  var $;
@@ -2051,30 +2075,6 @@ var $;
2051
2075
  $.$mol_dom_context = new $node.jsdom.JSDOM('', { url: 'https://localhost/' }).window;
2052
2076
  })($ || ($ = {}));
2053
2077
 
2054
- ;
2055
- "use strict";
2056
- var $;
2057
- (function ($) {
2058
- class $mol_after_tick extends $mol_object2 {
2059
- task;
2060
- promise;
2061
- cancelled = false;
2062
- constructor(task) {
2063
- super();
2064
- this.task = task;
2065
- this.promise = Promise.resolve().then(() => {
2066
- if (this.cancelled)
2067
- return;
2068
- task();
2069
- });
2070
- }
2071
- destructor() {
2072
- this.cancelled = true;
2073
- }
2074
- }
2075
- $.$mol_after_tick = $mol_after_tick;
2076
- })($ || ($ = {}));
2077
-
2078
2078
  ;
2079
2079
  "use strict";
2080
2080
  var $;
@@ -2408,29 +2408,19 @@ var $;
2408
2408
  "use strict";
2409
2409
  var $;
2410
2410
  (function ($) {
2411
- let all = [];
2412
- let el = null;
2413
- let timer = null;
2414
- function $mol_style_attach_force() {
2415
- if (all.length) {
2416
- el.innerHTML += '\n' + all.join('\n\n');
2417
- all = [];
2418
- }
2419
- timer = null;
2420
- return el;
2421
- }
2422
- $.$mol_style_attach_force = $mol_style_attach_force;
2423
2411
  function $mol_style_attach(id, text) {
2424
- all.push(`/* ${id} */\n\n${text}`);
2425
- if (timer)
2426
- return el;
2427
2412
  const doc = $mol_dom_context.document;
2428
2413
  if (!doc)
2429
2414
  return null;
2430
- el = doc.createElement('style');
2431
- el.id = `$mol_style_attach`;
2432
- doc.head.appendChild(el);
2433
- timer = new $mol_after_tick($mol_style_attach_force);
2415
+ const elid = `$mol_style_attach:${id}`;
2416
+ let el = doc.getElementById(elid);
2417
+ if (!el) {
2418
+ el = doc.createElement('style');
2419
+ el.id = elid;
2420
+ doc.head.appendChild(el);
2421
+ }
2422
+ if (el.innerHTML != text)
2423
+ el.innerHTML = text;
2434
2424
  return el;
2435
2425
  }
2436
2426
  $.$mol_style_attach = $mol_style_attach;
package/node.test.js CHANGED
@@ -601,35 +601,24 @@ var $;
601
601
  "use strict";
602
602
  var $;
603
603
  (function ($) {
604
- class $mol_after_timeout extends $mol_object2 {
605
- delay;
604
+ class $mol_after_tick extends $mol_object2 {
606
605
  task;
607
- id;
608
- constructor(delay, task) {
606
+ promise;
607
+ cancelled = false;
608
+ constructor(task) {
609
609
  super();
610
- this.delay = delay;
611
610
  this.task = task;
612
- this.id = setTimeout(task, delay);
611
+ this.promise = Promise.resolve().then(() => {
612
+ if (this.cancelled)
613
+ return;
614
+ task();
615
+ });
613
616
  }
614
617
  destructor() {
615
- clearTimeout(this.id);
616
- }
617
- }
618
- $.$mol_after_timeout = $mol_after_timeout;
619
- })($ || ($ = {}));
620
-
621
- ;
622
- "use strict";
623
- var $;
624
- (function ($) {
625
- class $mol_after_frame extends $mol_after_timeout {
626
- task;
627
- constructor(task) {
628
- super(16, task);
629
- this.task = task;
618
+ this.cancelled = true;
630
619
  }
631
620
  }
632
- $.$mol_after_frame = $mol_after_frame;
621
+ $.$mol_after_tick = $mol_after_tick;
633
622
  })($ || ($ = {}));
634
623
 
635
624
  ;
@@ -657,7 +646,7 @@ var $;
657
646
  static plan() {
658
647
  if (this.plan_task)
659
648
  return;
660
- this.plan_task = new $mol_after_frame(() => {
649
+ this.plan_task = new $mol_after_tick(() => {
661
650
  try {
662
651
  this.sync();
663
652
  }
@@ -859,7 +848,7 @@ var $;
859
848
  sub.track_off(prev);
860
849
  sub.absorb = () => {
861
850
  done(null);
862
- sub.destructor();
851
+ setTimeout(() => sub.destructor());
863
852
  };
864
853
  });
865
854
  }
@@ -929,6 +918,41 @@ var $;
929
918
  $.$mol_key = $mol_key;
930
919
  })($ || ($ = {}));
931
920
 
921
+ ;
922
+ "use strict";
923
+ var $;
924
+ (function ($) {
925
+ class $mol_after_timeout extends $mol_object2 {
926
+ delay;
927
+ task;
928
+ id;
929
+ constructor(delay, task) {
930
+ super();
931
+ this.delay = delay;
932
+ this.task = task;
933
+ this.id = setTimeout(task, delay);
934
+ }
935
+ destructor() {
936
+ clearTimeout(this.id);
937
+ }
938
+ }
939
+ $.$mol_after_timeout = $mol_after_timeout;
940
+ })($ || ($ = {}));
941
+
942
+ ;
943
+ "use strict";
944
+ var $;
945
+ (function ($) {
946
+ class $mol_after_frame extends $mol_after_timeout {
947
+ task;
948
+ constructor(task) {
949
+ super(16, task);
950
+ this.task = task;
951
+ }
952
+ }
953
+ $.$mol_after_frame = $mol_after_frame;
954
+ })($ || ($ = {}));
955
+
932
956
  ;
933
957
  "use strict";
934
958
  var $;
@@ -2042,30 +2066,6 @@ var $;
2042
2066
  $.$mol_dom_context = new $node.jsdom.JSDOM('', { url: 'https://localhost/' }).window;
2043
2067
  })($ || ($ = {}));
2044
2068
 
2045
- ;
2046
- "use strict";
2047
- var $;
2048
- (function ($) {
2049
- class $mol_after_tick extends $mol_object2 {
2050
- task;
2051
- promise;
2052
- cancelled = false;
2053
- constructor(task) {
2054
- super();
2055
- this.task = task;
2056
- this.promise = Promise.resolve().then(() => {
2057
- if (this.cancelled)
2058
- return;
2059
- task();
2060
- });
2061
- }
2062
- destructor() {
2063
- this.cancelled = true;
2064
- }
2065
- }
2066
- $.$mol_after_tick = $mol_after_tick;
2067
- })($ || ($ = {}));
2068
-
2069
2069
  ;
2070
2070
  "use strict";
2071
2071
  var $;
@@ -2399,29 +2399,19 @@ var $;
2399
2399
  "use strict";
2400
2400
  var $;
2401
2401
  (function ($) {
2402
- let all = [];
2403
- let el = null;
2404
- let timer = null;
2405
- function $mol_style_attach_force() {
2406
- if (all.length) {
2407
- el.innerHTML += '\n' + all.join('\n\n');
2408
- all = [];
2409
- }
2410
- timer = null;
2411
- return el;
2412
- }
2413
- $.$mol_style_attach_force = $mol_style_attach_force;
2414
2402
  function $mol_style_attach(id, text) {
2415
- all.push(`/* ${id} */\n\n${text}`);
2416
- if (timer)
2417
- return el;
2418
2403
  const doc = $mol_dom_context.document;
2419
2404
  if (!doc)
2420
2405
  return null;
2421
- el = doc.createElement('style');
2422
- el.id = `$mol_style_attach`;
2423
- doc.head.appendChild(el);
2424
- timer = new $mol_after_tick($mol_style_attach_force);
2406
+ const elid = `$mol_style_attach:${id}`;
2407
+ let el = doc.getElementById(elid);
2408
+ if (!el) {
2409
+ el = doc.createElement('style');
2410
+ el.id = elid;
2411
+ doc.head.appendChild(el);
2412
+ }
2413
+ if (el.innerHTML != text)
2414
+ el.innerHTML = text;
2425
2415
  return el;
2426
2416
  }
2427
2417
  $.$mol_style_attach = $mol_style_attach;
@@ -7302,16 +7292,7 @@ var $;
7302
7292
  var $;
7303
7293
  (function ($_1) {
7304
7294
  $mol_test_mocks.push($ => {
7305
- $.$mol_after_timeout = $mol_after_mock_timeout;
7306
- });
7307
- })($ || ($ = {}));
7308
-
7309
- ;
7310
- "use strict";
7311
- var $;
7312
- (function ($_1) {
7313
- $mol_test_mocks.push($ => {
7314
- $.$mol_after_frame = $mol_after_mock_commmon;
7295
+ $.$mol_after_tick = $mol_after_mock_commmon;
7315
7296
  });
7316
7297
  })($ || ($ = {}));
7317
7298
 
@@ -7419,6 +7400,15 @@ var $;
7419
7400
  $.$mol_promise = $mol_promise;
7420
7401
  })($ || ($ = {}));
7421
7402
 
7403
+ ;
7404
+ "use strict";
7405
+ var $;
7406
+ (function ($_1) {
7407
+ $mol_test_mocks.push($ => {
7408
+ $.$mol_after_timeout = $mol_after_mock_timeout;
7409
+ });
7410
+ })($ || ($ = {}));
7411
+
7422
7412
  ;
7423
7413
  "use strict";
7424
7414
  var $;
@@ -8148,15 +8138,6 @@ var $;
8148
8138
  });
8149
8139
  })($ || ($ = {}));
8150
8140
 
8151
- ;
8152
- "use strict";
8153
- var $;
8154
- (function ($_1) {
8155
- $mol_test_mocks.push($ => {
8156
- $.$mol_after_tick = $mol_after_mock_commmon;
8157
- });
8158
- })($ || ($ = {}));
8159
-
8160
8141
  ;
8161
8142
  "use strict";
8162
8143
  var $;
@@ -8361,6 +8342,15 @@ var $;
8361
8342
  });
8362
8343
  })($ || ($ = {}));
8363
8344
 
8345
+ ;
8346
+ "use strict";
8347
+ var $;
8348
+ (function ($_1) {
8349
+ $mol_test_mocks.push($ => {
8350
+ $.$mol_after_frame = $mol_after_mock_commmon;
8351
+ });
8352
+ })($ || ($ = {}));
8353
+
8364
8354
  ;
8365
8355
  "use strict";
8366
8356