mol_jsx_lib 0.0.1097 → 0.0.1099
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 +6 -4
- package/node.d.ts.map +1 -1
- package/node.deps.json +1 -1
- package/node.js +16 -5
- package/node.js.map +1 -1
- package/node.mjs +16 -5
- package/node.test.js +40 -16
- package/node.test.js.map +1 -1
- package/package.json +1 -1
- package/web.d.ts +6 -4
- package/web.d.ts.map +1 -1
- package/web.deps.json +1 -1
- package/web.js +16 -5
- package/web.js.map +1 -1
- package/web.mjs +16 -5
- package/web.test.js +24 -11
- package/web.test.js.map +1 -1
package/web.mjs
CHANGED
|
@@ -1073,6 +1073,12 @@ var $;
|
|
|
1073
1073
|
};
|
|
1074
1074
|
});
|
|
1075
1075
|
}
|
|
1076
|
+
destructor() {
|
|
1077
|
+
super.destructor();
|
|
1078
|
+
if ($mol_owning_check(this, this.cache)) {
|
|
1079
|
+
this.cache.destructor();
|
|
1080
|
+
}
|
|
1081
|
+
}
|
|
1076
1082
|
}
|
|
1077
1083
|
$.$mol_wire_fiber = $mol_wire_fiber;
|
|
1078
1084
|
})($ || ($ = {}));
|
|
@@ -1403,7 +1409,8 @@ var $;
|
|
|
1403
1409
|
$$.$mol_log3_warn({
|
|
1404
1410
|
place: '$mol_wire_task',
|
|
1405
1411
|
message: `Non idempotency`,
|
|
1406
|
-
|
|
1412
|
+
sub,
|
|
1413
|
+
pubs: [...sub?.pub_list ?? [], existen],
|
|
1407
1414
|
next,
|
|
1408
1415
|
hint: 'Ignore it',
|
|
1409
1416
|
});
|
|
@@ -1426,6 +1433,14 @@ var $;
|
|
|
1426
1433
|
this.cursor = $mol_wire_cursor.fresh;
|
|
1427
1434
|
if (next !== prev)
|
|
1428
1435
|
this.emit();
|
|
1436
|
+
if ($mol_owning_catch(this, next)) {
|
|
1437
|
+
try {
|
|
1438
|
+
next[Symbol.toStringTag] = this[Symbol.toStringTag];
|
|
1439
|
+
}
|
|
1440
|
+
catch {
|
|
1441
|
+
Object.defineProperty(next, Symbol.toStringTag, { value: this[Symbol.toStringTag] });
|
|
1442
|
+
}
|
|
1443
|
+
}
|
|
1429
1444
|
return next;
|
|
1430
1445
|
}
|
|
1431
1446
|
this.cursor = $mol_wire_cursor.final;
|
|
@@ -1580,10 +1595,6 @@ var $;
|
|
|
1580
1595
|
}
|
|
1581
1596
|
destructor() {
|
|
1582
1597
|
super.destructor();
|
|
1583
|
-
const prev = this.cache;
|
|
1584
|
-
if ($mol_owning_check(this, prev)) {
|
|
1585
|
-
prev.destructor();
|
|
1586
|
-
}
|
|
1587
1598
|
if (this.pub_from === 0) {
|
|
1588
1599
|
;
|
|
1589
1600
|
(this.host ?? this.task)[this.field()] = null;
|
package/web.test.js
CHANGED
|
@@ -230,6 +230,17 @@ var $;
|
|
|
230
230
|
});
|
|
231
231
|
})($ || ($ = {}));
|
|
232
232
|
|
|
233
|
+
;
|
|
234
|
+
"use strict";
|
|
235
|
+
var $;
|
|
236
|
+
(function ($) {
|
|
237
|
+
function $mol_dom_serialize(node) {
|
|
238
|
+
const serializer = new $mol_dom_context.XMLSerializer;
|
|
239
|
+
return serializer.serializeToString(node);
|
|
240
|
+
}
|
|
241
|
+
$.$mol_dom_serialize = $mol_dom_serialize;
|
|
242
|
+
})($ || ($ = {}));
|
|
243
|
+
|
|
233
244
|
;
|
|
234
245
|
"use strict";
|
|
235
246
|
var $;
|
|
@@ -266,6 +277,19 @@ var $;
|
|
|
266
277
|
"!");
|
|
267
278
|
$mol_assert_equal(dom.outerHTML, '<div>hello<strong>world</strong>!</div>');
|
|
268
279
|
},
|
|
280
|
+
'Make fragment'() {
|
|
281
|
+
const dom = $mol_jsx($mol_jsx_frag, null,
|
|
282
|
+
$mol_jsx("br", null),
|
|
283
|
+
$mol_jsx("hr", null));
|
|
284
|
+
$mol_assert_equal($mol_dom_serialize(dom), '<br xmlns="http://www.w3.org/1999/xhtml" /><hr xmlns="http://www.w3.org/1999/xhtml" />');
|
|
285
|
+
},
|
|
286
|
+
'Spread fragment'() {
|
|
287
|
+
const dom = $mol_jsx("div", null,
|
|
288
|
+
$mol_jsx($mol_jsx_frag, null,
|
|
289
|
+
$mol_jsx("br", null),
|
|
290
|
+
$mol_jsx("hr", null)));
|
|
291
|
+
$mol_assert_equal(dom.outerHTML, '<div><br><hr></div>');
|
|
292
|
+
},
|
|
269
293
|
'Function as component'() {
|
|
270
294
|
const Button = (props, target) => {
|
|
271
295
|
return $mol_jsx("button", { title: props.hint }, target());
|
|
@@ -1993,17 +2017,6 @@ var $;
|
|
|
1993
2017
|
});
|
|
1994
2018
|
})($ || ($ = {}));
|
|
1995
2019
|
|
|
1996
|
-
;
|
|
1997
|
-
"use strict";
|
|
1998
|
-
var $;
|
|
1999
|
-
(function ($) {
|
|
2000
|
-
function $mol_dom_serialize(node) {
|
|
2001
|
-
const serializer = new $mol_dom_context.XMLSerializer;
|
|
2002
|
-
return serializer.serializeToString(node);
|
|
2003
|
-
}
|
|
2004
|
-
$.$mol_dom_serialize = $mol_dom_serialize;
|
|
2005
|
-
})($ || ($ = {}));
|
|
2006
|
-
|
|
2007
2020
|
;
|
|
2008
2021
|
"use strict";
|
|
2009
2022
|
var $;
|