mol_plot_all 1.2.1216 → 1.2.1218
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 +8 -6
- package/node.d.ts.map +1 -1
- package/node.deps.json +1 -1
- package/node.js +49 -31
- package/node.js.map +1 -1
- package/node.mjs +49 -31
- package/node.test.js +73 -31
- package/node.test.js.map +1 -1
- package/package.json +1 -1
- package/web.d.ts +8 -6
- package/web.d.ts.map +1 -1
- package/web.deps.json +1 -1
- package/web.js +49 -31
- package/web.js.map +1 -1
- package/web.mjs +49 -31
- package/web.test.js +24 -0
- package/web.test.js.map +1 -1
package/node.mjs
CHANGED
|
@@ -653,7 +653,7 @@ var $;
|
|
|
653
653
|
"use strict";
|
|
654
654
|
var $;
|
|
655
655
|
(function ($) {
|
|
656
|
-
const
|
|
656
|
+
const wrappers = new WeakMap();
|
|
657
657
|
class $mol_wire_fiber extends $mol_wire_pub_sub {
|
|
658
658
|
task;
|
|
659
659
|
host;
|
|
@@ -788,14 +788,21 @@ var $;
|
|
|
788
788
|
result = this.task.call(this.host, ...this.args);
|
|
789
789
|
break;
|
|
790
790
|
}
|
|
791
|
-
if ($mol_promise_like(result)
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
791
|
+
if ($mol_promise_like(result)) {
|
|
792
|
+
if (wrappers.has(result)) {
|
|
793
|
+
result = wrappers.get(result).then(a => a);
|
|
794
|
+
}
|
|
795
|
+
else {
|
|
796
|
+
const put = (res) => {
|
|
797
|
+
if (this.cache === result)
|
|
798
|
+
this.put(res);
|
|
799
|
+
return res;
|
|
800
|
+
};
|
|
801
|
+
wrappers.set(result, result = Object.assign(result.then(put, put), { destructor: result.destructor || (() => { }) }));
|
|
802
|
+
wrappers.set(result, result);
|
|
803
|
+
const error = new Error(`Promise in ${this}`);
|
|
804
|
+
Object.defineProperty(result, 'stack', { get: () => error.stack });
|
|
805
|
+
}
|
|
799
806
|
}
|
|
800
807
|
}
|
|
801
808
|
catch (error) {
|
|
@@ -805,22 +812,20 @@ var $;
|
|
|
805
812
|
else {
|
|
806
813
|
result = new Error(String(error), { cause: error });
|
|
807
814
|
}
|
|
808
|
-
if ($mol_promise_like(result)
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
815
|
+
if ($mol_promise_like(result)) {
|
|
816
|
+
if (wrappers.has(result)) {
|
|
817
|
+
result = wrappers.get(result);
|
|
818
|
+
}
|
|
819
|
+
else {
|
|
820
|
+
wrappers.set(result, result = Object.assign(result.finally(() => {
|
|
821
|
+
if (this.cache === result)
|
|
822
|
+
this.absorb();
|
|
823
|
+
}), { destructor: result.destructor || (() => { }) }));
|
|
824
|
+
const error = new Error(`Promise in ${this}`);
|
|
825
|
+
Object.defineProperty(result, 'stack', { get: () => error.stack });
|
|
826
|
+
}
|
|
814
827
|
}
|
|
815
828
|
}
|
|
816
|
-
if ($mol_promise_like(result) && !handled.has(result)) {
|
|
817
|
-
result = Object.assign(result, {
|
|
818
|
-
destructor: result['destructor'] ?? (() => { })
|
|
819
|
-
});
|
|
820
|
-
handled.add(result);
|
|
821
|
-
const error = new Error(`Promise in ${this}`);
|
|
822
|
-
Object.defineProperty(result, 'stack', { get: () => error.stack });
|
|
823
|
-
}
|
|
824
829
|
if (!$mol_promise_like(result)) {
|
|
825
830
|
this.track_cut();
|
|
826
831
|
}
|
|
@@ -880,6 +885,12 @@ var $;
|
|
|
880
885
|
};
|
|
881
886
|
});
|
|
882
887
|
}
|
|
888
|
+
destructor() {
|
|
889
|
+
super.destructor();
|
|
890
|
+
if ($mol_owning_check(this, this.cache)) {
|
|
891
|
+
this.cache.destructor();
|
|
892
|
+
}
|
|
893
|
+
}
|
|
883
894
|
}
|
|
884
895
|
$.$mol_wire_fiber = $mol_wire_fiber;
|
|
885
896
|
})($ || ($ = {}));
|
|
@@ -904,6 +915,7 @@ var $;
|
|
|
904
915
|
var $;
|
|
905
916
|
(function ($) {
|
|
906
917
|
$.$mol_key_store = new WeakMap();
|
|
918
|
+
const TypedArray = Object.getPrototypeOf(Uint8Array);
|
|
907
919
|
function $mol_key(value) {
|
|
908
920
|
if (typeof value === 'bigint')
|
|
909
921
|
return value.toString() + 'n';
|
|
@@ -933,7 +945,7 @@ var $;
|
|
|
933
945
|
return value;
|
|
934
946
|
if (value instanceof RegExp)
|
|
935
947
|
return value.toString();
|
|
936
|
-
if (value instanceof
|
|
948
|
+
if (value instanceof TypedArray)
|
|
937
949
|
return [...value];
|
|
938
950
|
let key = $.$mol_key_store.get(value);
|
|
939
951
|
if (key)
|
|
@@ -1664,7 +1676,8 @@ var $;
|
|
|
1664
1676
|
$$.$mol_log3_warn({
|
|
1665
1677
|
place: '$mol_wire_task',
|
|
1666
1678
|
message: `Non idempotency`,
|
|
1667
|
-
|
|
1679
|
+
sub,
|
|
1680
|
+
pubs: [...sub?.pub_list ?? [], existen],
|
|
1668
1681
|
next,
|
|
1669
1682
|
hint: 'Ignore it',
|
|
1670
1683
|
});
|
|
@@ -1687,6 +1700,14 @@ var $;
|
|
|
1687
1700
|
this.cursor = $mol_wire_cursor.fresh;
|
|
1688
1701
|
if (next !== prev)
|
|
1689
1702
|
this.emit();
|
|
1703
|
+
if ($mol_owning_catch(this, next)) {
|
|
1704
|
+
try {
|
|
1705
|
+
next[Symbol.toStringTag] = this[Symbol.toStringTag];
|
|
1706
|
+
}
|
|
1707
|
+
catch {
|
|
1708
|
+
Object.defineProperty(next, Symbol.toStringTag, { value: this[Symbol.toStringTag] });
|
|
1709
|
+
}
|
|
1710
|
+
}
|
|
1690
1711
|
return next;
|
|
1691
1712
|
}
|
|
1692
1713
|
this.cursor = $mol_wire_cursor.final;
|
|
@@ -1841,10 +1862,6 @@ var $;
|
|
|
1841
1862
|
}
|
|
1842
1863
|
destructor() {
|
|
1843
1864
|
super.destructor();
|
|
1844
|
-
const prev = this.cache;
|
|
1845
|
-
if ($mol_owning_check(this, prev)) {
|
|
1846
|
-
prev.destructor();
|
|
1847
|
-
}
|
|
1848
1865
|
if (this.pub_from === 0) {
|
|
1849
1866
|
;
|
|
1850
1867
|
(this.host ?? this.task)[this.field()] = null;
|
|
@@ -2319,13 +2336,15 @@ var $;
|
|
|
2319
2336
|
class $mol_memo extends $mol_wrapper {
|
|
2320
2337
|
static wrap(task) {
|
|
2321
2338
|
const store = new WeakMap();
|
|
2322
|
-
|
|
2339
|
+
const fun = function (next) {
|
|
2323
2340
|
if (next === undefined && store.has(this))
|
|
2324
2341
|
return store.get(this);
|
|
2325
2342
|
const val = task.call(this, next) ?? next;
|
|
2326
2343
|
store.set(this, val);
|
|
2327
2344
|
return val;
|
|
2328
2345
|
};
|
|
2346
|
+
Reflect.defineProperty(fun, 'name', { value: task.name + ' ' });
|
|
2347
|
+
return fun;
|
|
2329
2348
|
}
|
|
2330
2349
|
}
|
|
2331
2350
|
$.$mol_memo = $mol_memo;
|
|
@@ -3162,7 +3181,6 @@ var $;
|
|
|
3162
3181
|
const win = this.$.$mol_dom_context;
|
|
3163
3182
|
if (win.parent !== win.self && !win.document.hasFocus())
|
|
3164
3183
|
return;
|
|
3165
|
-
this.focused(true);
|
|
3166
3184
|
}
|
|
3167
3185
|
destructor() {
|
|
3168
3186
|
const node = $mol_wire_probe(() => this.dom_node());
|
package/node.test.js
CHANGED
|
@@ -644,7 +644,7 @@ var $;
|
|
|
644
644
|
"use strict";
|
|
645
645
|
var $;
|
|
646
646
|
(function ($) {
|
|
647
|
-
const
|
|
647
|
+
const wrappers = new WeakMap();
|
|
648
648
|
class $mol_wire_fiber extends $mol_wire_pub_sub {
|
|
649
649
|
task;
|
|
650
650
|
host;
|
|
@@ -779,14 +779,21 @@ var $;
|
|
|
779
779
|
result = this.task.call(this.host, ...this.args);
|
|
780
780
|
break;
|
|
781
781
|
}
|
|
782
|
-
if ($mol_promise_like(result)
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
782
|
+
if ($mol_promise_like(result)) {
|
|
783
|
+
if (wrappers.has(result)) {
|
|
784
|
+
result = wrappers.get(result).then(a => a);
|
|
785
|
+
}
|
|
786
|
+
else {
|
|
787
|
+
const put = (res) => {
|
|
788
|
+
if (this.cache === result)
|
|
789
|
+
this.put(res);
|
|
790
|
+
return res;
|
|
791
|
+
};
|
|
792
|
+
wrappers.set(result, result = Object.assign(result.then(put, put), { destructor: result.destructor || (() => { }) }));
|
|
793
|
+
wrappers.set(result, result);
|
|
794
|
+
const error = new Error(`Promise in ${this}`);
|
|
795
|
+
Object.defineProperty(result, 'stack', { get: () => error.stack });
|
|
796
|
+
}
|
|
790
797
|
}
|
|
791
798
|
}
|
|
792
799
|
catch (error) {
|
|
@@ -796,22 +803,20 @@ var $;
|
|
|
796
803
|
else {
|
|
797
804
|
result = new Error(String(error), { cause: error });
|
|
798
805
|
}
|
|
799
|
-
if ($mol_promise_like(result)
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
806
|
+
if ($mol_promise_like(result)) {
|
|
807
|
+
if (wrappers.has(result)) {
|
|
808
|
+
result = wrappers.get(result);
|
|
809
|
+
}
|
|
810
|
+
else {
|
|
811
|
+
wrappers.set(result, result = Object.assign(result.finally(() => {
|
|
812
|
+
if (this.cache === result)
|
|
813
|
+
this.absorb();
|
|
814
|
+
}), { destructor: result.destructor || (() => { }) }));
|
|
815
|
+
const error = new Error(`Promise in ${this}`);
|
|
816
|
+
Object.defineProperty(result, 'stack', { get: () => error.stack });
|
|
817
|
+
}
|
|
805
818
|
}
|
|
806
819
|
}
|
|
807
|
-
if ($mol_promise_like(result) && !handled.has(result)) {
|
|
808
|
-
result = Object.assign(result, {
|
|
809
|
-
destructor: result['destructor'] ?? (() => { })
|
|
810
|
-
});
|
|
811
|
-
handled.add(result);
|
|
812
|
-
const error = new Error(`Promise in ${this}`);
|
|
813
|
-
Object.defineProperty(result, 'stack', { get: () => error.stack });
|
|
814
|
-
}
|
|
815
820
|
if (!$mol_promise_like(result)) {
|
|
816
821
|
this.track_cut();
|
|
817
822
|
}
|
|
@@ -871,6 +876,12 @@ var $;
|
|
|
871
876
|
};
|
|
872
877
|
});
|
|
873
878
|
}
|
|
879
|
+
destructor() {
|
|
880
|
+
super.destructor();
|
|
881
|
+
if ($mol_owning_check(this, this.cache)) {
|
|
882
|
+
this.cache.destructor();
|
|
883
|
+
}
|
|
884
|
+
}
|
|
874
885
|
}
|
|
875
886
|
$.$mol_wire_fiber = $mol_wire_fiber;
|
|
876
887
|
})($ || ($ = {}));
|
|
@@ -895,6 +906,7 @@ var $;
|
|
|
895
906
|
var $;
|
|
896
907
|
(function ($) {
|
|
897
908
|
$.$mol_key_store = new WeakMap();
|
|
909
|
+
const TypedArray = Object.getPrototypeOf(Uint8Array);
|
|
898
910
|
function $mol_key(value) {
|
|
899
911
|
if (typeof value === 'bigint')
|
|
900
912
|
return value.toString() + 'n';
|
|
@@ -924,7 +936,7 @@ var $;
|
|
|
924
936
|
return value;
|
|
925
937
|
if (value instanceof RegExp)
|
|
926
938
|
return value.toString();
|
|
927
|
-
if (value instanceof
|
|
939
|
+
if (value instanceof TypedArray)
|
|
928
940
|
return [...value];
|
|
929
941
|
let key = $.$mol_key_store.get(value);
|
|
930
942
|
if (key)
|
|
@@ -1655,7 +1667,8 @@ var $;
|
|
|
1655
1667
|
$$.$mol_log3_warn({
|
|
1656
1668
|
place: '$mol_wire_task',
|
|
1657
1669
|
message: `Non idempotency`,
|
|
1658
|
-
|
|
1670
|
+
sub,
|
|
1671
|
+
pubs: [...sub?.pub_list ?? [], existen],
|
|
1659
1672
|
next,
|
|
1660
1673
|
hint: 'Ignore it',
|
|
1661
1674
|
});
|
|
@@ -1678,6 +1691,14 @@ var $;
|
|
|
1678
1691
|
this.cursor = $mol_wire_cursor.fresh;
|
|
1679
1692
|
if (next !== prev)
|
|
1680
1693
|
this.emit();
|
|
1694
|
+
if ($mol_owning_catch(this, next)) {
|
|
1695
|
+
try {
|
|
1696
|
+
next[Symbol.toStringTag] = this[Symbol.toStringTag];
|
|
1697
|
+
}
|
|
1698
|
+
catch {
|
|
1699
|
+
Object.defineProperty(next, Symbol.toStringTag, { value: this[Symbol.toStringTag] });
|
|
1700
|
+
}
|
|
1701
|
+
}
|
|
1681
1702
|
return next;
|
|
1682
1703
|
}
|
|
1683
1704
|
this.cursor = $mol_wire_cursor.final;
|
|
@@ -1832,10 +1853,6 @@ var $;
|
|
|
1832
1853
|
}
|
|
1833
1854
|
destructor() {
|
|
1834
1855
|
super.destructor();
|
|
1835
|
-
const prev = this.cache;
|
|
1836
|
-
if ($mol_owning_check(this, prev)) {
|
|
1837
|
-
prev.destructor();
|
|
1838
|
-
}
|
|
1839
1856
|
if (this.pub_from === 0) {
|
|
1840
1857
|
;
|
|
1841
1858
|
(this.host ?? this.task)[this.field()] = null;
|
|
@@ -2310,13 +2327,15 @@ var $;
|
|
|
2310
2327
|
class $mol_memo extends $mol_wrapper {
|
|
2311
2328
|
static wrap(task) {
|
|
2312
2329
|
const store = new WeakMap();
|
|
2313
|
-
|
|
2330
|
+
const fun = function (next) {
|
|
2314
2331
|
if (next === undefined && store.has(this))
|
|
2315
2332
|
return store.get(this);
|
|
2316
2333
|
const val = task.call(this, next) ?? next;
|
|
2317
2334
|
store.set(this, val);
|
|
2318
2335
|
return val;
|
|
2319
2336
|
};
|
|
2337
|
+
Reflect.defineProperty(fun, 'name', { value: task.name + ' ' });
|
|
2338
|
+
return fun;
|
|
2320
2339
|
}
|
|
2321
2340
|
}
|
|
2322
2341
|
$.$mol_memo = $mol_memo;
|
|
@@ -3153,7 +3172,6 @@ var $;
|
|
|
3153
3172
|
const win = this.$.$mol_dom_context;
|
|
3154
3173
|
if (win.parent !== win.self && !win.document.hasFocus())
|
|
3155
3174
|
return;
|
|
3156
|
-
this.focused(true);
|
|
3157
3175
|
}
|
|
3158
3176
|
destructor() {
|
|
3159
3177
|
const node = $mol_wire_probe(() => this.dom_node());
|
|
@@ -6468,6 +6486,17 @@ var $;
|
|
|
6468
6486
|
;
|
|
6469
6487
|
"use strict";
|
|
6470
6488
|
|
|
6489
|
+
;
|
|
6490
|
+
"use strict";
|
|
6491
|
+
var $;
|
|
6492
|
+
(function ($) {
|
|
6493
|
+
function $mol_dom_serialize(node) {
|
|
6494
|
+
const serializer = new $mol_dom_context.XMLSerializer;
|
|
6495
|
+
return serializer.serializeToString(node);
|
|
6496
|
+
}
|
|
6497
|
+
$.$mol_dom_serialize = $mol_dom_serialize;
|
|
6498
|
+
})($ || ($ = {}));
|
|
6499
|
+
|
|
6471
6500
|
;
|
|
6472
6501
|
"use strict";
|
|
6473
6502
|
var $;
|
|
@@ -6625,6 +6654,19 @@ var $;
|
|
|
6625
6654
|
"!");
|
|
6626
6655
|
$mol_assert_equal(dom.outerHTML, '<div>hello<strong>world</strong>!</div>');
|
|
6627
6656
|
},
|
|
6657
|
+
'Make fragment'() {
|
|
6658
|
+
const dom = $mol_jsx($mol_jsx_frag, null,
|
|
6659
|
+
$mol_jsx("br", null),
|
|
6660
|
+
$mol_jsx("hr", null));
|
|
6661
|
+
$mol_assert_equal($mol_dom_serialize(dom), '<br xmlns="http://www.w3.org/1999/xhtml" /><hr xmlns="http://www.w3.org/1999/xhtml" />');
|
|
6662
|
+
},
|
|
6663
|
+
'Spread fragment'() {
|
|
6664
|
+
const dom = $mol_jsx("div", null,
|
|
6665
|
+
$mol_jsx($mol_jsx_frag, null,
|
|
6666
|
+
$mol_jsx("br", null),
|
|
6667
|
+
$mol_jsx("hr", null)));
|
|
6668
|
+
$mol_assert_equal(dom.outerHTML, '<div><br><hr></div>');
|
|
6669
|
+
},
|
|
6628
6670
|
'Function as component'() {
|
|
6629
6671
|
const Button = (props, target) => {
|
|
6630
6672
|
return $mol_jsx("button", { title: props.hint }, target());
|