mol_plot_all 1.2.560 → 1.2.562
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.d.ts +4 -0
- package/node.deps.json +1 -1
- package/node.js +27 -16
- package/node.js.map +1 -1
- package/node.mjs +27 -16
- package/node.mjs.map +1 -1
- package/node.test.js +30 -19
- package/node.test.js.map +1 -1
- package/package.json +3 -1
- package/web.d.ts +4 -0
- package/web.deps.json +1 -1
- package/web.js +27 -16
- package/web.js.map +1 -1
- package/web.mjs +27 -16
- package/web.mjs.map +1 -1
- package/web.test.js +3 -3
- package/web.test.js.map +1 -1
package/node.js
CHANGED
|
@@ -599,6 +599,16 @@ var $;
|
|
|
599
599
|
;
|
|
600
600
|
"use strict";
|
|
601
601
|
var $;
|
|
602
|
+
(function ($) {
|
|
603
|
+
function $mol_promise_like(val) {
|
|
604
|
+
return val && typeof val.then === 'function';
|
|
605
|
+
}
|
|
606
|
+
$.$mol_promise_like = $mol_promise_like;
|
|
607
|
+
})($ || ($ = {}));
|
|
608
|
+
//mol/promise/like/like.ts
|
|
609
|
+
;
|
|
610
|
+
"use strict";
|
|
611
|
+
var $;
|
|
602
612
|
(function ($) {
|
|
603
613
|
const handled = new WeakSet();
|
|
604
614
|
class $mol_wire_fiber extends $mol_wire_pub_sub {
|
|
@@ -647,7 +657,7 @@ var $;
|
|
|
647
657
|
return this.data.slice(0, this.pub_from);
|
|
648
658
|
}
|
|
649
659
|
result() {
|
|
650
|
-
if (this.cache
|
|
660
|
+
if ($mol_promise_like(this.cache))
|
|
651
661
|
return;
|
|
652
662
|
if (this.cache instanceof Error)
|
|
653
663
|
return;
|
|
@@ -726,7 +736,7 @@ var $;
|
|
|
726
736
|
result = this.task.call(this.host, ...this.args);
|
|
727
737
|
break;
|
|
728
738
|
}
|
|
729
|
-
if (result
|
|
739
|
+
if ($mol_promise_like(result)) {
|
|
730
740
|
const put = (res) => {
|
|
731
741
|
if (this.cache === result)
|
|
732
742
|
this.put(res);
|
|
@@ -739,13 +749,13 @@ var $;
|
|
|
739
749
|
}
|
|
740
750
|
}
|
|
741
751
|
catch (error) {
|
|
742
|
-
if (error instanceof Error || error
|
|
752
|
+
if (error instanceof Error || $mol_promise_like(error)) {
|
|
743
753
|
result = error;
|
|
744
754
|
}
|
|
745
755
|
else {
|
|
746
756
|
result = new Error(String(error), { cause: error });
|
|
747
757
|
}
|
|
748
|
-
if (result
|
|
758
|
+
if ($mol_promise_like(result) && !handled.has(result)) {
|
|
749
759
|
result = Object.assign(result.finally(() => {
|
|
750
760
|
if (this.cache === result)
|
|
751
761
|
this.absorb();
|
|
@@ -755,7 +765,7 @@ var $;
|
|
|
755
765
|
handled.add(result);
|
|
756
766
|
}
|
|
757
767
|
}
|
|
758
|
-
if (
|
|
768
|
+
if (!$mol_promise_like(result)) {
|
|
759
769
|
this.track_cut();
|
|
760
770
|
}
|
|
761
771
|
this.track_off(bu);
|
|
@@ -774,7 +784,7 @@ var $;
|
|
|
774
784
|
if (this.cache instanceof Error) {
|
|
775
785
|
return $mol_fail_hidden(this.cache);
|
|
776
786
|
}
|
|
777
|
-
if (this.cache
|
|
787
|
+
if ($mol_promise_like(this.cache)) {
|
|
778
788
|
return $mol_fail_hidden(this.cache);
|
|
779
789
|
}
|
|
780
790
|
return this.cache;
|
|
@@ -785,7 +795,7 @@ var $;
|
|
|
785
795
|
if (this.cache instanceof Error) {
|
|
786
796
|
$mol_fail_hidden(this.cache);
|
|
787
797
|
}
|
|
788
|
-
if (
|
|
798
|
+
if (!$mol_promise_like(this.cache))
|
|
789
799
|
return this.cache;
|
|
790
800
|
await this.cache;
|
|
791
801
|
if (this.cursor === $mol_wire_cursor.final) {
|
|
@@ -1040,14 +1050,14 @@ var $;
|
|
|
1040
1050
|
};
|
|
1041
1051
|
}
|
|
1042
1052
|
complete() {
|
|
1043
|
-
if (this.cache
|
|
1053
|
+
if ($mol_promise_like(this.cache))
|
|
1044
1054
|
return;
|
|
1045
1055
|
this.destructor();
|
|
1046
1056
|
}
|
|
1047
1057
|
put(next) {
|
|
1048
1058
|
const prev = this.cache;
|
|
1049
1059
|
this.cache = next;
|
|
1050
|
-
if (next
|
|
1060
|
+
if ($mol_promise_like(next)) {
|
|
1051
1061
|
this.cursor = $mol_wire_cursor.fresh;
|
|
1052
1062
|
if (next !== prev)
|
|
1053
1063
|
this.emit();
|
|
@@ -1104,7 +1114,7 @@ var $;
|
|
|
1104
1114
|
function $mol_fail_catch(error) {
|
|
1105
1115
|
if (typeof error !== 'object')
|
|
1106
1116
|
return false;
|
|
1107
|
-
if (error
|
|
1117
|
+
if ($mol_promise_like(error))
|
|
1108
1118
|
$mol_fail_hidden(error);
|
|
1109
1119
|
if (catched.get(error))
|
|
1110
1120
|
return false;
|
|
@@ -1119,7 +1129,7 @@ var $;
|
|
|
1119
1129
|
var $;
|
|
1120
1130
|
(function ($) {
|
|
1121
1131
|
function $mol_fail_log(error) {
|
|
1122
|
-
if (error
|
|
1132
|
+
if ($mol_promise_like(error))
|
|
1123
1133
|
return false;
|
|
1124
1134
|
if (!$mol_fail_catch(error))
|
|
1125
1135
|
return false;
|
|
@@ -1243,7 +1253,7 @@ var $;
|
|
|
1243
1253
|
}
|
|
1244
1254
|
this.cache = next;
|
|
1245
1255
|
this.cursor = $mol_wire_cursor.fresh;
|
|
1246
|
-
if (next
|
|
1256
|
+
if ($mol_promise_like(next))
|
|
1247
1257
|
return next;
|
|
1248
1258
|
this.complete_pubs();
|
|
1249
1259
|
return next;
|
|
@@ -2212,11 +2222,12 @@ var $;
|
|
|
2212
2222
|
for (let name in styles) {
|
|
2213
2223
|
let val = styles[name];
|
|
2214
2224
|
const style = el.style;
|
|
2225
|
+
const kebab = (name) => name.replace(/[A-Z]/g, letter => '-' + letter.toLowerCase());
|
|
2215
2226
|
if (typeof val === 'number') {
|
|
2216
|
-
style
|
|
2227
|
+
style.setProperty(kebab(name), `${val}px`);
|
|
2217
2228
|
}
|
|
2218
2229
|
else {
|
|
2219
|
-
style
|
|
2230
|
+
style.setProperty(kebab(name), val);
|
|
2220
2231
|
}
|
|
2221
2232
|
}
|
|
2222
2233
|
}
|
|
@@ -2637,7 +2648,7 @@ var $;
|
|
|
2637
2648
|
catch (error) {
|
|
2638
2649
|
$mol_fail_log(error);
|
|
2639
2650
|
$mol_dom_render_attributes(node, { mol_view_error: error.name || error.constructor.name });
|
|
2640
|
-
if (error
|
|
2651
|
+
if ($mol_promise_like(error))
|
|
2641
2652
|
break render;
|
|
2642
2653
|
if ((error_showed.get(error) ?? this) !== this)
|
|
2643
2654
|
break render;
|
|
@@ -2787,7 +2798,7 @@ var $;
|
|
|
2787
2798
|
}
|
|
2788
2799
|
}
|
|
2789
2800
|
catch (error) {
|
|
2790
|
-
if (error
|
|
2801
|
+
if ($mol_promise_like(error))
|
|
2791
2802
|
$mol_fail_hidden(error);
|
|
2792
2803
|
$mol_fail_log(error);
|
|
2793
2804
|
}
|