mol_view_tree2_lib 1.0.213 → 1.0.215
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 +54 -28
- package/node.d.ts.map +1 -1
- package/node.deps.json +1 -1
- package/node.js +157 -104
- package/node.js.map +1 -1
- package/node.meta.tree +2 -1
- package/node.mjs +157 -104
- package/node.test.js +165 -112
- package/node.test.js.map +1 -1
- package/package.json +5 -7
- package/web.d.ts +48 -11
- package/web.d.ts.map +1 -1
- package/web.deps.json +1 -1
- package/web.js +138 -31
- package/web.js.map +1 -1
- package/web.meta.tree +2 -1
- package/web.mjs +138 -31
- package/web.test.js +8 -8
- package/web.test.js.map +1 -1
package/node.js
CHANGED
|
@@ -2020,7 +2020,7 @@ var $;
|
|
|
2020
2020
|
"use strict";
|
|
2021
2021
|
var $;
|
|
2022
2022
|
(function ($) {
|
|
2023
|
-
const class_regex = /^[$A-Z][$\w<>\[\]()"'
|
|
2023
|
+
const class_regex = /^[$A-Z][$\w<>\[\]()"'?|,]+$/;
|
|
2024
2024
|
function $mol_view_tree2_class_match(klass) {
|
|
2025
2025
|
if (!klass?.type)
|
|
2026
2026
|
return false;
|
|
@@ -2732,7 +2732,7 @@ var $;
|
|
|
2732
2732
|
'color': 'gray',
|
|
2733
2733
|
});
|
|
2734
2734
|
$.$mol_dev_format_indent = $.$mol_dev_format_div.bind(null, {
|
|
2735
|
-
'margin-
|
|
2735
|
+
'margin-inline-start': '13px'
|
|
2736
2736
|
});
|
|
2737
2737
|
class Stack extends Array {
|
|
2738
2738
|
// [ Symbol.toPrimitive ]() {
|
|
@@ -3626,14 +3626,14 @@ var $;
|
|
|
3626
3626
|
reuse: if (existen) {
|
|
3627
3627
|
if (!existen.temp)
|
|
3628
3628
|
break reuse;
|
|
3629
|
-
if (existen.task !== task) {
|
|
3630
|
-
cause = 'task';
|
|
3631
|
-
break reuse;
|
|
3632
|
-
}
|
|
3633
3629
|
if (existen.host !== host) {
|
|
3634
3630
|
cause = 'host';
|
|
3635
3631
|
break reuse;
|
|
3636
3632
|
}
|
|
3633
|
+
if (existen.task !== task) {
|
|
3634
|
+
cause = 'task';
|
|
3635
|
+
break reuse;
|
|
3636
|
+
}
|
|
3637
3637
|
if (!$mol_compare_deep(existen.args, args)) {
|
|
3638
3638
|
cause = 'args';
|
|
3639
3639
|
break reuse;
|
|
@@ -4358,134 +4358,115 @@ var $;
|
|
|
4358
4358
|
"use strict";
|
|
4359
4359
|
var $;
|
|
4360
4360
|
(function ($) {
|
|
4361
|
-
$.$mol_dom_context = new $node.jsdom.JSDOM('', { url: '
|
|
4361
|
+
$.$mol_dom_context = new $node.jsdom.JSDOM('', { url: `http://${process.env.DOMAIN || 'localhost'}/` }).window;
|
|
4362
4362
|
})($ || ($ = {}));
|
|
4363
4363
|
|
|
4364
4364
|
;
|
|
4365
4365
|
"use strict";
|
|
4366
4366
|
var $;
|
|
4367
4367
|
(function ($) {
|
|
4368
|
-
|
|
4369
|
-
|
|
4370
|
-
|
|
4371
|
-
|
|
4372
|
-
let current = $mol_wire_auto();
|
|
4373
|
-
if (current.temp)
|
|
4374
|
-
current = current.host;
|
|
4375
|
-
if (current.reap !== nothing) {
|
|
4376
|
-
current?.sub_on(sub, sub.data.length);
|
|
4368
|
+
class $mol_storage extends $mol_object2 {
|
|
4369
|
+
/** Is storage a long term. */
|
|
4370
|
+
static persisted(next) {
|
|
4371
|
+
return false;
|
|
4377
4372
|
}
|
|
4378
|
-
|
|
4379
|
-
|
|
4380
|
-
|
|
4381
|
-
const nothing = () => { };
|
|
4382
|
-
const sub = new $mol_wire_pub_sub;
|
|
4383
|
-
})($ || ($ = {}));
|
|
4384
|
-
|
|
4385
|
-
;
|
|
4386
|
-
"use strict";
|
|
4387
|
-
var $;
|
|
4388
|
-
(function ($) {
|
|
4389
|
-
$.$mol_mem_persist = $mol_wire_solid;
|
|
4390
|
-
})($ || ($ = {}));
|
|
4391
|
-
|
|
4392
|
-
;
|
|
4393
|
-
"use strict";
|
|
4394
|
-
var $;
|
|
4395
|
-
(function ($) {
|
|
4396
|
-
/** Run code without state changes */
|
|
4397
|
-
function $mol_wire_probe(task, def) {
|
|
4398
|
-
const warm = $mol_wire_fiber.warm;
|
|
4399
|
-
try {
|
|
4400
|
-
$mol_wire_fiber.warm = false;
|
|
4401
|
-
const res = task();
|
|
4402
|
-
if (res === undefined)
|
|
4403
|
-
return def;
|
|
4404
|
-
return res;
|
|
4373
|
+
/** Total storage quota in bytes. */
|
|
4374
|
+
static total() {
|
|
4375
|
+
return 0;
|
|
4405
4376
|
}
|
|
4406
|
-
|
|
4407
|
-
|
|
4377
|
+
/** Total storage usage in bytes. */
|
|
4378
|
+
static used() {
|
|
4379
|
+
return 0;
|
|
4380
|
+
}
|
|
4381
|
+
/** Minimum available free space in bytes. */
|
|
4382
|
+
static free() {
|
|
4383
|
+
return this.total() - this.used();
|
|
4384
|
+
}
|
|
4385
|
+
/** Fulfillness of storage. */
|
|
4386
|
+
static portion() {
|
|
4387
|
+
const total = this.total();
|
|
4388
|
+
if (!total)
|
|
4389
|
+
return 1;
|
|
4390
|
+
return this.used() / total;
|
|
4391
|
+
}
|
|
4392
|
+
/**
|
|
4393
|
+
* Fulfillness logarithmic level.
|
|
4394
|
+
* `0` - empty
|
|
4395
|
+
* `1` - half free
|
|
4396
|
+
* `2` - quart free
|
|
4397
|
+
* `Infinity` - fulfilled
|
|
4398
|
+
*/
|
|
4399
|
+
static level() {
|
|
4400
|
+
return Math.floor(-Math.log2(1 - this.portion()));
|
|
4408
4401
|
}
|
|
4409
4402
|
}
|
|
4410
|
-
$.$
|
|
4411
|
-
})($ || ($ = {}));
|
|
4412
|
-
|
|
4413
|
-
;
|
|
4414
|
-
"use strict";
|
|
4415
|
-
var $;
|
|
4416
|
-
(function ($) {
|
|
4417
|
-
$.$mol_mem_cached = $mol_wire_probe;
|
|
4418
|
-
})($ || ($ = {}));
|
|
4419
|
-
|
|
4420
|
-
;
|
|
4421
|
-
"use strict";
|
|
4422
|
-
var $;
|
|
4423
|
-
(function ($) {
|
|
4424
|
-
$.$mol_dom = $mol_dom_context;
|
|
4403
|
+
$.$mol_storage = $mol_storage;
|
|
4425
4404
|
})($ || ($ = {}));
|
|
4426
4405
|
|
|
4427
4406
|
;
|
|
4428
4407
|
"use strict";
|
|
4429
4408
|
var $;
|
|
4430
4409
|
(function ($) {
|
|
4431
|
-
|
|
4432
|
-
|
|
4433
|
-
|
|
4434
|
-
|
|
4435
|
-
|
|
4436
|
-
|
|
4437
|
-
|
|
4438
|
-
|
|
4439
|
-
|
|
4410
|
+
/** State of time moment */
|
|
4411
|
+
class $mol_state_time extends $mol_object {
|
|
4412
|
+
static task(precision, reset) {
|
|
4413
|
+
if (precision) {
|
|
4414
|
+
return new $mol_after_timeout(precision, () => this.task(precision, null));
|
|
4415
|
+
}
|
|
4416
|
+
else {
|
|
4417
|
+
return new $mol_after_frame(() => this.task(precision, null));
|
|
4418
|
+
}
|
|
4419
|
+
}
|
|
4420
|
+
static now(precision) {
|
|
4421
|
+
this.task(precision);
|
|
4422
|
+
return Date.now();
|
|
4423
|
+
}
|
|
4440
4424
|
}
|
|
4441
|
-
|
|
4425
|
+
__decorate([
|
|
4426
|
+
$mol_mem_key
|
|
4427
|
+
], $mol_state_time, "task", null);
|
|
4428
|
+
__decorate([
|
|
4429
|
+
$mol_mem_key
|
|
4430
|
+
], $mol_state_time, "now", null);
|
|
4431
|
+
$.$mol_state_time = $mol_state_time;
|
|
4442
4432
|
})($ || ($ = {}));
|
|
4443
4433
|
|
|
4444
4434
|
;
|
|
4445
4435
|
"use strict";
|
|
4446
4436
|
var $;
|
|
4447
4437
|
(function ($) {
|
|
4448
|
-
class $
|
|
4449
|
-
static
|
|
4450
|
-
return
|
|
4451
|
-
persisted: async () => false,
|
|
4452
|
-
persist: async () => false,
|
|
4453
|
-
estimate: async () => ({}),
|
|
4454
|
-
getDirectory: async () => null,
|
|
4455
|
-
};
|
|
4438
|
+
class $mol_storage_node extends $mol_storage {
|
|
4439
|
+
static persisted() {
|
|
4440
|
+
return true;
|
|
4456
4441
|
}
|
|
4457
|
-
static
|
|
4458
|
-
$
|
|
4459
|
-
|
|
4460
|
-
return Boolean(next);
|
|
4461
|
-
const native = this.native();
|
|
4462
|
-
if (next && !$mol_mem_cached(() => this.persisted())) {
|
|
4463
|
-
this.$.$mol_wait_user_async()
|
|
4464
|
-
.then(() => native.persist())
|
|
4465
|
-
.then(actual => {
|
|
4466
|
-
setTimeout(() => this.persisted(actual, 'cache'), 5000);
|
|
4467
|
-
if (actual)
|
|
4468
|
-
this.$.$mol_log3_done({ place: `$mol_storage`, message: `Persist: Yes` });
|
|
4469
|
-
else
|
|
4470
|
-
this.$.$mol_log3_fail({ place: `$mol_storage`, message: `Persist: No` });
|
|
4471
|
-
});
|
|
4472
|
-
}
|
|
4473
|
-
return next ?? $mol_wire_sync(native).persisted();
|
|
4442
|
+
static stats() {
|
|
4443
|
+
$mol_state_time.now(1000);
|
|
4444
|
+
return $node.fs.statfsSync('.');
|
|
4474
4445
|
}
|
|
4475
|
-
static
|
|
4476
|
-
|
|
4446
|
+
static total() {
|
|
4447
|
+
const { blocks, bsize } = this.stats();
|
|
4448
|
+
return blocks * bsize;
|
|
4477
4449
|
}
|
|
4478
|
-
static
|
|
4479
|
-
|
|
4450
|
+
static used() {
|
|
4451
|
+
const { blocks, bfree, bsize } = this.stats();
|
|
4452
|
+
return (blocks - bfree) * bsize;
|
|
4453
|
+
}
|
|
4454
|
+
static free() {
|
|
4455
|
+
const { bfree, bsize } = this.stats();
|
|
4456
|
+
return bfree * bsize;
|
|
4457
|
+
}
|
|
4458
|
+
static portion() {
|
|
4459
|
+
const { blocks, bfree } = this.stats();
|
|
4460
|
+
if (!blocks)
|
|
4461
|
+
return 1;
|
|
4462
|
+
return (blocks - bfree) / blocks;
|
|
4480
4463
|
}
|
|
4481
4464
|
}
|
|
4482
4465
|
__decorate([
|
|
4483
4466
|
$mol_mem
|
|
4484
|
-
], $
|
|
4485
|
-
|
|
4486
|
-
|
|
4487
|
-
], $mol_storage, "persisted", null);
|
|
4488
|
-
$.$mol_storage = $mol_storage;
|
|
4467
|
+
], $mol_storage_node, "stats", null);
|
|
4468
|
+
$.$mol_storage_node = $mol_storage_node;
|
|
4469
|
+
$.$mol_storage = $.$mol_storage_node;
|
|
4489
4470
|
})($ || ($ = {}));
|
|
4490
4471
|
|
|
4491
4472
|
;
|
|
@@ -4609,6 +4590,27 @@ var $;
|
|
|
4609
4590
|
$.$mol_wire_async = $mol_wire_async;
|
|
4610
4591
|
})($ || ($ = {}));
|
|
4611
4592
|
|
|
4593
|
+
;
|
|
4594
|
+
"use strict";
|
|
4595
|
+
var $;
|
|
4596
|
+
(function ($) {
|
|
4597
|
+
/** Run code without state changes */
|
|
4598
|
+
function $mol_wire_probe(task, def) {
|
|
4599
|
+
const warm = $mol_wire_fiber.warm;
|
|
4600
|
+
try {
|
|
4601
|
+
$mol_wire_fiber.warm = false;
|
|
4602
|
+
const res = task();
|
|
4603
|
+
if (res === undefined)
|
|
4604
|
+
return def;
|
|
4605
|
+
return res;
|
|
4606
|
+
}
|
|
4607
|
+
finally {
|
|
4608
|
+
$mol_wire_fiber.warm = warm;
|
|
4609
|
+
}
|
|
4610
|
+
}
|
|
4611
|
+
$.$mol_wire_probe = $mol_wire_probe;
|
|
4612
|
+
})($ || ($ = {}));
|
|
4613
|
+
|
|
4612
4614
|
;
|
|
4613
4615
|
"use strict";
|
|
4614
4616
|
var $;
|
|
@@ -4642,6 +4644,13 @@ var $;
|
|
|
4642
4644
|
$.$mol_lock = $mol_lock;
|
|
4643
4645
|
})($ || ($ = {}));
|
|
4644
4646
|
|
|
4647
|
+
;
|
|
4648
|
+
"use strict";
|
|
4649
|
+
var $;
|
|
4650
|
+
(function ($) {
|
|
4651
|
+
$.$mol_mem_cached = $mol_wire_probe;
|
|
4652
|
+
})($ || ($ = {}));
|
|
4653
|
+
|
|
4645
4654
|
;
|
|
4646
4655
|
"use strict";
|
|
4647
4656
|
var $;
|
|
@@ -4775,6 +4784,27 @@ var $;
|
|
|
4775
4784
|
$.$mol_file_transaction = $mol_file_transaction;
|
|
4776
4785
|
})($ || ($ = {}));
|
|
4777
4786
|
|
|
4787
|
+
;
|
|
4788
|
+
"use strict";
|
|
4789
|
+
var $;
|
|
4790
|
+
(function ($) {
|
|
4791
|
+
/**
|
|
4792
|
+
* Disable reaping of current subscriber
|
|
4793
|
+
*/
|
|
4794
|
+
function $mol_wire_solid() {
|
|
4795
|
+
let current = $mol_wire_auto();
|
|
4796
|
+
if (current.temp)
|
|
4797
|
+
current = current.host;
|
|
4798
|
+
if (current.reap !== nothing) {
|
|
4799
|
+
current?.sub_on(sub, sub.data.length);
|
|
4800
|
+
}
|
|
4801
|
+
current.reap = nothing;
|
|
4802
|
+
}
|
|
4803
|
+
$.$mol_wire_solid = $mol_wire_solid;
|
|
4804
|
+
const nothing = () => { };
|
|
4805
|
+
const sub = new $mol_wire_pub_sub;
|
|
4806
|
+
})($ || ($ = {}));
|
|
4807
|
+
|
|
4778
4808
|
;
|
|
4779
4809
|
"use strict";
|
|
4780
4810
|
var $;
|
|
@@ -5451,6 +5481,13 @@ var $;
|
|
|
5451
5481
|
$.$mol_file = $mol_file_node;
|
|
5452
5482
|
})($ || ($ = {}));
|
|
5453
5483
|
|
|
5484
|
+
;
|
|
5485
|
+
"use strict";
|
|
5486
|
+
var $;
|
|
5487
|
+
(function ($) {
|
|
5488
|
+
$.$mol_dom = $mol_dom_context;
|
|
5489
|
+
})($ || ($ = {}));
|
|
5490
|
+
|
|
5454
5491
|
;
|
|
5455
5492
|
"use strict";
|
|
5456
5493
|
var $;
|
|
@@ -5495,6 +5532,19 @@ var $;
|
|
|
5495
5532
|
static lang(next) {
|
|
5496
5533
|
return this.$.$mol_state_local.value('locale', next) || $mol_dom_context.navigator.language.replace(/-.*/, '') || this.lang_default();
|
|
5497
5534
|
}
|
|
5535
|
+
static langs_rtl() {
|
|
5536
|
+
return ['ar', 'he', 'fa', 'ur', 'yi', 'ps', 'ug', 'sd'];
|
|
5537
|
+
}
|
|
5538
|
+
static direction() {
|
|
5539
|
+
const lang = this.lang();
|
|
5540
|
+
try {
|
|
5541
|
+
return new Intl.Locale(lang).getTextInfo().direction ?? 'ltr';
|
|
5542
|
+
}
|
|
5543
|
+
catch (e) {
|
|
5544
|
+
$mol_fail_log(e);
|
|
5545
|
+
return this.langs_rtl().includes(lang) ? 'rtl' : 'ltr';
|
|
5546
|
+
}
|
|
5547
|
+
}
|
|
5498
5548
|
static source(lang) {
|
|
5499
5549
|
return JSON.parse(this.$.$mol_file.relative(`web.locale=${lang}.json`).text().toString());
|
|
5500
5550
|
}
|
|
@@ -5535,6 +5585,9 @@ var $;
|
|
|
5535
5585
|
__decorate([
|
|
5536
5586
|
$mol_mem
|
|
5537
5587
|
], $mol_locale, "lang", null);
|
|
5588
|
+
__decorate([
|
|
5589
|
+
$mol_mem
|
|
5590
|
+
], $mol_locale, "direction", null);
|
|
5538
5591
|
__decorate([
|
|
5539
5592
|
$mol_mem_key
|
|
5540
5593
|
], $mol_locale, "source", null);
|