mol_plot_all 1.2.561 → 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/web.mjs
CHANGED
|
@@ -590,6 +590,16 @@ var $;
|
|
|
590
590
|
;
|
|
591
591
|
"use strict";
|
|
592
592
|
var $;
|
|
593
|
+
(function ($) {
|
|
594
|
+
function $mol_promise_like(val) {
|
|
595
|
+
return val && typeof val.then === 'function';
|
|
596
|
+
}
|
|
597
|
+
$.$mol_promise_like = $mol_promise_like;
|
|
598
|
+
})($ || ($ = {}));
|
|
599
|
+
//mol/promise/like/like.ts
|
|
600
|
+
;
|
|
601
|
+
"use strict";
|
|
602
|
+
var $;
|
|
593
603
|
(function ($) {
|
|
594
604
|
const handled = new WeakSet();
|
|
595
605
|
class $mol_wire_fiber extends $mol_wire_pub_sub {
|
|
@@ -638,7 +648,7 @@ var $;
|
|
|
638
648
|
return this.data.slice(0, this.pub_from);
|
|
639
649
|
}
|
|
640
650
|
result() {
|
|
641
|
-
if (this.cache
|
|
651
|
+
if ($mol_promise_like(this.cache))
|
|
642
652
|
return;
|
|
643
653
|
if (this.cache instanceof Error)
|
|
644
654
|
return;
|
|
@@ -717,7 +727,7 @@ var $;
|
|
|
717
727
|
result = this.task.call(this.host, ...this.args);
|
|
718
728
|
break;
|
|
719
729
|
}
|
|
720
|
-
if (result
|
|
730
|
+
if ($mol_promise_like(result)) {
|
|
721
731
|
const put = (res) => {
|
|
722
732
|
if (this.cache === result)
|
|
723
733
|
this.put(res);
|
|
@@ -730,13 +740,13 @@ var $;
|
|
|
730
740
|
}
|
|
731
741
|
}
|
|
732
742
|
catch (error) {
|
|
733
|
-
if (error instanceof Error || error
|
|
743
|
+
if (error instanceof Error || $mol_promise_like(error)) {
|
|
734
744
|
result = error;
|
|
735
745
|
}
|
|
736
746
|
else {
|
|
737
747
|
result = new Error(String(error), { cause: error });
|
|
738
748
|
}
|
|
739
|
-
if (result
|
|
749
|
+
if ($mol_promise_like(result) && !handled.has(result)) {
|
|
740
750
|
result = Object.assign(result.finally(() => {
|
|
741
751
|
if (this.cache === result)
|
|
742
752
|
this.absorb();
|
|
@@ -746,7 +756,7 @@ var $;
|
|
|
746
756
|
handled.add(result);
|
|
747
757
|
}
|
|
748
758
|
}
|
|
749
|
-
if (
|
|
759
|
+
if (!$mol_promise_like(result)) {
|
|
750
760
|
this.track_cut();
|
|
751
761
|
}
|
|
752
762
|
this.track_off(bu);
|
|
@@ -765,7 +775,7 @@ var $;
|
|
|
765
775
|
if (this.cache instanceof Error) {
|
|
766
776
|
return $mol_fail_hidden(this.cache);
|
|
767
777
|
}
|
|
768
|
-
if (this.cache
|
|
778
|
+
if ($mol_promise_like(this.cache)) {
|
|
769
779
|
return $mol_fail_hidden(this.cache);
|
|
770
780
|
}
|
|
771
781
|
return this.cache;
|
|
@@ -776,7 +786,7 @@ var $;
|
|
|
776
786
|
if (this.cache instanceof Error) {
|
|
777
787
|
$mol_fail_hidden(this.cache);
|
|
778
788
|
}
|
|
779
|
-
if (
|
|
789
|
+
if (!$mol_promise_like(this.cache))
|
|
780
790
|
return this.cache;
|
|
781
791
|
await this.cache;
|
|
782
792
|
if (this.cursor === $mol_wire_cursor.final) {
|
|
@@ -1031,14 +1041,14 @@ var $;
|
|
|
1031
1041
|
};
|
|
1032
1042
|
}
|
|
1033
1043
|
complete() {
|
|
1034
|
-
if (this.cache
|
|
1044
|
+
if ($mol_promise_like(this.cache))
|
|
1035
1045
|
return;
|
|
1036
1046
|
this.destructor();
|
|
1037
1047
|
}
|
|
1038
1048
|
put(next) {
|
|
1039
1049
|
const prev = this.cache;
|
|
1040
1050
|
this.cache = next;
|
|
1041
|
-
if (next
|
|
1051
|
+
if ($mol_promise_like(next)) {
|
|
1042
1052
|
this.cursor = $mol_wire_cursor.fresh;
|
|
1043
1053
|
if (next !== prev)
|
|
1044
1054
|
this.emit();
|
|
@@ -1095,7 +1105,7 @@ var $;
|
|
|
1095
1105
|
function $mol_fail_catch(error) {
|
|
1096
1106
|
if (typeof error !== 'object')
|
|
1097
1107
|
return false;
|
|
1098
|
-
if (error
|
|
1108
|
+
if ($mol_promise_like(error))
|
|
1099
1109
|
$mol_fail_hidden(error);
|
|
1100
1110
|
if (catched.get(error))
|
|
1101
1111
|
return false;
|
|
@@ -1110,7 +1120,7 @@ var $;
|
|
|
1110
1120
|
var $;
|
|
1111
1121
|
(function ($) {
|
|
1112
1122
|
function $mol_fail_log(error) {
|
|
1113
|
-
if (error
|
|
1123
|
+
if ($mol_promise_like(error))
|
|
1114
1124
|
return false;
|
|
1115
1125
|
if (!$mol_fail_catch(error))
|
|
1116
1126
|
return false;
|
|
@@ -1234,7 +1244,7 @@ var $;
|
|
|
1234
1244
|
}
|
|
1235
1245
|
this.cache = next;
|
|
1236
1246
|
this.cursor = $mol_wire_cursor.fresh;
|
|
1237
|
-
if (next
|
|
1247
|
+
if ($mol_promise_like(next))
|
|
1238
1248
|
return next;
|
|
1239
1249
|
this.complete_pubs();
|
|
1240
1250
|
return next;
|
|
@@ -1645,11 +1655,12 @@ var $;
|
|
|
1645
1655
|
for (let name in styles) {
|
|
1646
1656
|
let val = styles[name];
|
|
1647
1657
|
const style = el.style;
|
|
1658
|
+
const kebab = (name) => name.replace(/[A-Z]/g, letter => '-' + letter.toLowerCase());
|
|
1648
1659
|
if (typeof val === 'number') {
|
|
1649
|
-
style
|
|
1660
|
+
style.setProperty(kebab(name), `${val}px`);
|
|
1650
1661
|
}
|
|
1651
1662
|
else {
|
|
1652
|
-
style
|
|
1663
|
+
style.setProperty(kebab(name), val);
|
|
1653
1664
|
}
|
|
1654
1665
|
}
|
|
1655
1666
|
}
|
|
@@ -2070,7 +2081,7 @@ var $;
|
|
|
2070
2081
|
catch (error) {
|
|
2071
2082
|
$mol_fail_log(error);
|
|
2072
2083
|
$mol_dom_render_attributes(node, { mol_view_error: error.name || error.constructor.name });
|
|
2073
|
-
if (error
|
|
2084
|
+
if ($mol_promise_like(error))
|
|
2074
2085
|
break render;
|
|
2075
2086
|
if ((error_showed.get(error) ?? this) !== this)
|
|
2076
2087
|
break render;
|
|
@@ -2220,7 +2231,7 @@ var $;
|
|
|
2220
2231
|
}
|
|
2221
2232
|
}
|
|
2222
2233
|
catch (error) {
|
|
2223
|
-
if (error
|
|
2234
|
+
if ($mol_promise_like(error))
|
|
2224
2235
|
$mol_fail_hidden(error);
|
|
2225
2236
|
$mol_fail_log(error);
|
|
2226
2237
|
}
|