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/web.meta.tree
CHANGED
|
@@ -15,8 +15,9 @@
|
|
|
15
15
|
pack rise git \https://github.com/stan-donarise/mam_rise.git
|
|
16
16
|
pack yuf git \https://github.com/zerkalica/yuf.git
|
|
17
17
|
pack apxu git \https://github.com/ApxuTechTop/apxu
|
|
18
|
-
pack bog git \https://github.com/
|
|
18
|
+
pack bog git \https://github.com/b-on-g/bog.git
|
|
19
19
|
pack mws git \https://github.com/reatailret/milkywaystd_mol.git
|
|
20
|
+
pack raggu git \https://github.com/RaguTeam/raggu.git
|
|
20
21
|
\/mol
|
|
21
22
|
pack icon git \https://github.com/nin-jin/mol_icon.git
|
|
22
23
|
\/mol/view
|
package/web.mjs
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 ]() {
|
|
@@ -3592,14 +3592,14 @@ var $;
|
|
|
3592
3592
|
reuse: if (existen) {
|
|
3593
3593
|
if (!existen.temp)
|
|
3594
3594
|
break reuse;
|
|
3595
|
-
if (existen.task !== task) {
|
|
3596
|
-
cause = 'task';
|
|
3597
|
-
break reuse;
|
|
3598
|
-
}
|
|
3599
3595
|
if (existen.host !== host) {
|
|
3600
3596
|
cause = 'host';
|
|
3601
3597
|
break reuse;
|
|
3602
3598
|
}
|
|
3599
|
+
if (existen.task !== task) {
|
|
3600
|
+
cause = 'task';
|
|
3601
|
+
break reuse;
|
|
3602
|
+
}
|
|
3603
3603
|
if (!$mol_compare_deep(existen.args, args)) {
|
|
3604
3604
|
cause = 'args';
|
|
3605
3605
|
break reuse;
|
|
@@ -4036,6 +4036,48 @@ var $;
|
|
|
4036
4036
|
$.$mol_dom_context = self;
|
|
4037
4037
|
})($ || ($ = {}));
|
|
4038
4038
|
|
|
4039
|
+
;
|
|
4040
|
+
"use strict";
|
|
4041
|
+
var $;
|
|
4042
|
+
(function ($) {
|
|
4043
|
+
class $mol_storage extends $mol_object2 {
|
|
4044
|
+
/** Is storage a long term. */
|
|
4045
|
+
static persisted(next) {
|
|
4046
|
+
return false;
|
|
4047
|
+
}
|
|
4048
|
+
/** Total storage quota in bytes. */
|
|
4049
|
+
static total() {
|
|
4050
|
+
return 0;
|
|
4051
|
+
}
|
|
4052
|
+
/** Total storage usage in bytes. */
|
|
4053
|
+
static used() {
|
|
4054
|
+
return 0;
|
|
4055
|
+
}
|
|
4056
|
+
/** Minimum available free space in bytes. */
|
|
4057
|
+
static free() {
|
|
4058
|
+
return this.total() - this.used();
|
|
4059
|
+
}
|
|
4060
|
+
/** Fulfillness of storage. */
|
|
4061
|
+
static portion() {
|
|
4062
|
+
const total = this.total();
|
|
4063
|
+
if (!total)
|
|
4064
|
+
return 1;
|
|
4065
|
+
return this.used() / total;
|
|
4066
|
+
}
|
|
4067
|
+
/**
|
|
4068
|
+
* Fulfillness logarithmic level.
|
|
4069
|
+
* `0` - empty
|
|
4070
|
+
* `1` - half free
|
|
4071
|
+
* `2` - quart free
|
|
4072
|
+
* `Infinity` - fulfilled
|
|
4073
|
+
*/
|
|
4074
|
+
static level() {
|
|
4075
|
+
return Math.floor(-Math.log2(1 - this.portion()));
|
|
4076
|
+
}
|
|
4077
|
+
}
|
|
4078
|
+
$.$mol_storage = $mol_storage;
|
|
4079
|
+
})($ || ($ = {}));
|
|
4080
|
+
|
|
4039
4081
|
;
|
|
4040
4082
|
"use strict";
|
|
4041
4083
|
var $;
|
|
@@ -4186,7 +4228,56 @@ var $;
|
|
|
4186
4228
|
"use strict";
|
|
4187
4229
|
var $;
|
|
4188
4230
|
(function ($) {
|
|
4189
|
-
class $
|
|
4231
|
+
class $mol_after_timeout extends $mol_object2 {
|
|
4232
|
+
delay;
|
|
4233
|
+
task;
|
|
4234
|
+
id;
|
|
4235
|
+
constructor(delay, task) {
|
|
4236
|
+
super();
|
|
4237
|
+
this.delay = delay;
|
|
4238
|
+
this.task = task;
|
|
4239
|
+
this.id = setTimeout(task, delay);
|
|
4240
|
+
}
|
|
4241
|
+
destructor() {
|
|
4242
|
+
clearTimeout(this.id);
|
|
4243
|
+
}
|
|
4244
|
+
}
|
|
4245
|
+
$.$mol_after_timeout = $mol_after_timeout;
|
|
4246
|
+
})($ || ($ = {}));
|
|
4247
|
+
|
|
4248
|
+
;
|
|
4249
|
+
"use strict";
|
|
4250
|
+
var $;
|
|
4251
|
+
(function ($) {
|
|
4252
|
+
/** State of time moment */
|
|
4253
|
+
class $mol_state_time extends $mol_object {
|
|
4254
|
+
static task(precision, reset) {
|
|
4255
|
+
if (precision) {
|
|
4256
|
+
return new $mol_after_timeout(precision, () => this.task(precision, null));
|
|
4257
|
+
}
|
|
4258
|
+
else {
|
|
4259
|
+
return new $mol_after_frame(() => this.task(precision, null));
|
|
4260
|
+
}
|
|
4261
|
+
}
|
|
4262
|
+
static now(precision) {
|
|
4263
|
+
this.task(precision);
|
|
4264
|
+
return Date.now();
|
|
4265
|
+
}
|
|
4266
|
+
}
|
|
4267
|
+
__decorate([
|
|
4268
|
+
$mol_mem_key
|
|
4269
|
+
], $mol_state_time, "task", null);
|
|
4270
|
+
__decorate([
|
|
4271
|
+
$mol_mem_key
|
|
4272
|
+
], $mol_state_time, "now", null);
|
|
4273
|
+
$.$mol_state_time = $mol_state_time;
|
|
4274
|
+
})($ || ($ = {}));
|
|
4275
|
+
|
|
4276
|
+
;
|
|
4277
|
+
"use strict";
|
|
4278
|
+
var $;
|
|
4279
|
+
(function ($) {
|
|
4280
|
+
class $mol_storage_web extends $mol_storage {
|
|
4190
4281
|
static native() {
|
|
4191
4282
|
return this.$.$mol_dom_context.navigator.storage ?? {
|
|
4192
4283
|
persisted: async () => false,
|
|
@@ -4214,19 +4305,40 @@ var $;
|
|
|
4214
4305
|
return next ?? $mol_wire_sync(native).persisted();
|
|
4215
4306
|
}
|
|
4216
4307
|
static estimate() {
|
|
4308
|
+
$mol_state_time.now(1000);
|
|
4217
4309
|
return $mol_wire_sync(this.native() ?? {}).estimate();
|
|
4218
4310
|
}
|
|
4311
|
+
static total() {
|
|
4312
|
+
return this.estimate().quota ?? 0;
|
|
4313
|
+
}
|
|
4314
|
+
static used() {
|
|
4315
|
+
return this.estimate().usage ?? 0;
|
|
4316
|
+
}
|
|
4317
|
+
static free() {
|
|
4318
|
+
const { usage = 0, quota = 0 } = this.estimate();
|
|
4319
|
+
return quota - usage;
|
|
4320
|
+
}
|
|
4321
|
+
static portion() {
|
|
4322
|
+
const { usage = 0, quota = 0 } = this.estimate();
|
|
4323
|
+
if (!quota)
|
|
4324
|
+
return 1;
|
|
4325
|
+
return usage / quota;
|
|
4326
|
+
}
|
|
4219
4327
|
static dir() {
|
|
4220
4328
|
return $mol_wire_sync(this.native()).getDirectory();
|
|
4221
4329
|
}
|
|
4222
4330
|
}
|
|
4223
4331
|
__decorate([
|
|
4224
4332
|
$mol_mem
|
|
4225
|
-
], $
|
|
4333
|
+
], $mol_storage_web, "native", null);
|
|
4226
4334
|
__decorate([
|
|
4227
4335
|
$mol_mem
|
|
4228
|
-
], $
|
|
4229
|
-
|
|
4336
|
+
], $mol_storage_web, "persisted", null);
|
|
4337
|
+
__decorate([
|
|
4338
|
+
$mol_mem
|
|
4339
|
+
], $mol_storage_web, "estimate", null);
|
|
4340
|
+
$.$mol_storage_web = $mol_storage_web;
|
|
4341
|
+
$.$mol_storage = $.$mol_storage_web;
|
|
4230
4342
|
})($ || ($ = {}));
|
|
4231
4343
|
|
|
4232
4344
|
;
|
|
@@ -4326,27 +4438,6 @@ var $;
|
|
|
4326
4438
|
$.$mol_action = $mol_wire_method;
|
|
4327
4439
|
})($ || ($ = {}));
|
|
4328
4440
|
|
|
4329
|
-
;
|
|
4330
|
-
"use strict";
|
|
4331
|
-
var $;
|
|
4332
|
-
(function ($) {
|
|
4333
|
-
class $mol_after_timeout extends $mol_object2 {
|
|
4334
|
-
delay;
|
|
4335
|
-
task;
|
|
4336
|
-
id;
|
|
4337
|
-
constructor(delay, task) {
|
|
4338
|
-
super();
|
|
4339
|
-
this.delay = delay;
|
|
4340
|
-
this.task = task;
|
|
4341
|
-
this.id = setTimeout(task, delay);
|
|
4342
|
-
}
|
|
4343
|
-
destructor() {
|
|
4344
|
-
clearTimeout(this.id);
|
|
4345
|
-
}
|
|
4346
|
-
}
|
|
4347
|
-
$.$mol_after_timeout = $mol_after_timeout;
|
|
4348
|
-
})($ || ($ = {}));
|
|
4349
|
-
|
|
4350
4441
|
;
|
|
4351
4442
|
"use strict";
|
|
4352
4443
|
var $;
|
|
@@ -5452,6 +5543,19 @@ var $;
|
|
|
5452
5543
|
static lang(next) {
|
|
5453
5544
|
return this.$.$mol_state_local.value('locale', next) || $mol_dom_context.navigator.language.replace(/-.*/, '') || this.lang_default();
|
|
5454
5545
|
}
|
|
5546
|
+
static langs_rtl() {
|
|
5547
|
+
return ['ar', 'he', 'fa', 'ur', 'yi', 'ps', 'ug', 'sd'];
|
|
5548
|
+
}
|
|
5549
|
+
static direction() {
|
|
5550
|
+
const lang = this.lang();
|
|
5551
|
+
try {
|
|
5552
|
+
return new Intl.Locale(lang).getTextInfo().direction ?? 'ltr';
|
|
5553
|
+
}
|
|
5554
|
+
catch (e) {
|
|
5555
|
+
$mol_fail_log(e);
|
|
5556
|
+
return this.langs_rtl().includes(lang) ? 'rtl' : 'ltr';
|
|
5557
|
+
}
|
|
5558
|
+
}
|
|
5455
5559
|
static source(lang) {
|
|
5456
5560
|
return JSON.parse(this.$.$mol_file.relative(`web.locale=${lang}.json`).text().toString());
|
|
5457
5561
|
}
|
|
@@ -5492,6 +5596,9 @@ var $;
|
|
|
5492
5596
|
__decorate([
|
|
5493
5597
|
$mol_mem
|
|
5494
5598
|
], $mol_locale, "lang", null);
|
|
5599
|
+
__decorate([
|
|
5600
|
+
$mol_mem
|
|
5601
|
+
], $mol_locale, "direction", null);
|
|
5495
5602
|
__decorate([
|
|
5496
5603
|
$mol_mem_key
|
|
5497
5604
|
], $mol_locale, "source", null);
|
package/web.test.js
CHANGED
|
@@ -4352,7 +4352,7 @@ var $;
|
|
|
4352
4352
|
"use strict";
|
|
4353
4353
|
var $;
|
|
4354
4354
|
(function ($) {
|
|
4355
|
-
$mol_style_attach("mol/view/view/view.css", "@view-transition {\n\tnavigation: auto;\n}\n\n[mol_view] {\n\ttransition-property: height, width, min-height, min-width, max-width, max-height, transform, scale, translate, rotate;\n\ttransition-duration: .2s;\n\ttransition-timing-function: ease-out;\n\t-webkit-appearance: none;\n\tbox-sizing: border-box;\n\tdisplay: flex;\n\tflex-shrink: 0;\n\tcontain: style;\n\tscrollbar-color: var(--mol_theme_line) transparent;\n\tscrollbar-width: thin;\n
|
|
4355
|
+
$mol_style_attach("mol/view/view/view.css", "@view-transition {\n\tnavigation: auto;\n}\n\n[mol_view] {\n\ttransition-property: height, width, min-height, min-width, max-width, max-height, transform, scale, translate, rotate;\n\ttransition-duration: .2s;\n\ttransition-timing-function: ease-out;\n\t-webkit-appearance: none;\n\tbox-sizing: border-box;\n\tdisplay: flex;\n\tflex-shrink: 0;\n\tcontain: style;\n\tscrollbar-color: var(--mol_theme_line) transparent;\n\tscrollbar-width: thin;\n\t/* text-wrap-style: pretty; dont work in textarea */\n\tunicode-bidi: plaintext\n}\n\n[mol_view]::selection {\n\tbackground: var(--mol_theme_line);\n}\t\n\n[mol_view]::-webkit-scrollbar {\n\twidth: .25rem;\n\theight: .25rem;\n}\n\n[mol_view]::-webkit-scrollbar-corner {\n\tbackground-color: var(--mol_theme_line);\n}\n\n[mol_view]::-webkit-scrollbar-track {\n\tbackground-color: transparent;\n}\n\n[mol_view]::-webkit-scrollbar-thumb {\n\tbackground-color: var(--mol_theme_line);\n\tborder-radius: var(--mol_gap_round);\n}\n\n[mol_view] > * {\n\tword-break: inherit;\n}\n\n[mol_view_root] {\n\tmargin: 0;\n\tpadding: 0;\n\twidth: 100%;\n\theight: 100%;\n\tbox-sizing: border-box;\n\tfont-family: system-ui, 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;\n\tfont-size: 1rem;\n\tline-height: 1.5rem;\n\t/* background: var(--mol_theme_back);\n\tcolor: var(--mol_theme_text); */\n\tcontain: unset; /** Fixes bg ignoring when applied to body on Chrome */\n\ttab-size: 4;\n\t/*overscroll-behavior: contain; /** Disable navigation gestures **/\n}\n\n@media print {\n\t[mol_view_root] {\n\t\theight: auto;\n\t}\n}\n[mol_view][mol_view_error]:not([mol_view_error=\"Promise\"], [mol_view_error=\"$mol_promise_blocker\"]) {\n\tbackground-image: repeating-linear-gradient(\n\t\t-45deg,\n\t\t#f92323,\n\t\t#f92323 .5rem,\n\t\t#ff3d3d .5rem,\n\t\t#ff3d3d 1.5rem\n\t);\n\tcolor: black;\n\talign-items: center;\n\tjustify-content: center;\n}\n\n@keyframes mol_view_wait {\n\tfrom {\n\t\topacity: .25;\n\t}\n\t20% {\n\t\topacity: .75;\n\t}\n\tto {\n\t\topacity: .25;\n\t}\n}\n\n:where([mol_view][mol_view_error=\"$mol_promise_blocker\"]),\n:where([mol_view][mol_view_error=\"Promise\"]) {\n\tbackground: var(--mol_theme_hover);\n}\n\n[mol_view][mol_view_error=\"Promise\"] {\n\tanimation: mol_view_wait 1s steps(20,end) infinite;\n}\n");
|
|
4356
4356
|
})($ || ($ = {}));
|
|
4357
4357
|
|
|
4358
4358
|
;
|
|
@@ -5306,7 +5306,7 @@ var $;
|
|
|
5306
5306
|
"use strict";
|
|
5307
5307
|
var $;
|
|
5308
5308
|
(function ($) {
|
|
5309
|
-
$mol_style_attach("mol/string/string.view.css", "[mol_string] {\n\tbox-sizing: border-box;\n\toutline-offset: 0;\n\tborder: none;\n\tborder-radius: var(--mol_gap_round);\n\twhite-space: pre-line;\n\toverflow: hidden;\n\ttext-overflow: ellipsis;\n\tpadding: var(--mol_gap_text);\n\ttext-align:
|
|
5309
|
+
$mol_style_attach("mol/string/string.view.css", "[mol_string] {\n\tbox-sizing: border-box;\n\toutline-offset: 0;\n\tborder: none;\n\tborder-radius: var(--mol_gap_round);\n\twhite-space: pre-line;\n\toverflow: hidden;\n\ttext-overflow: ellipsis;\n\tpadding: var(--mol_gap_text);\n\ttext-align: start;\n\tposition: relative;\n\tfont: inherit;\n\tflex: 1 1 auto;\n\tbackground: transparent;\n\tmin-width: 0;\n\tcolor: inherit;\n\tbackground: var(--mol_theme_field);\n}\n\n[mol_string]:disabled:not(:placeholder-shown) {\n\tbackground-color: transparent;\n\tcolor: var(--mol_theme_text);\n}\n\n[mol_string]:where(:not(:disabled)) {\n\tbox-shadow: inset 0 0 0 1px var(--mol_theme_line);\n}\n\n[mol_string]:where(:not(:disabled)):hover {\n\tbox-shadow: inset 0 0 0 2px var(--mol_theme_line);\n\tz-index: var(--mol_layer_hover);\n}\n\n[mol_string]:focus {\n\toutline: none;\n\tz-index: var(--mol_layer_focus);\n\tcolor: var(--mol_theme_text);\n\tbox-shadow: inset 0 0 0 1px var(--mol_theme_focus);\n}\n\n[mol_string]::placeholder {\n\tcolor: var(--mol_theme_shade);\n}\n\n[mol_string]::-ms-clear {\n\tdisplay: none;\n}\n");
|
|
5310
5310
|
})($ || ($ = {}));
|
|
5311
5311
|
|
|
5312
5312
|
;
|
|
@@ -5822,7 +5822,7 @@ var $;
|
|
|
5822
5822
|
needle <= query? \\
|
|
5823
5823
|
key * escape? <=> clear? null
|
|
5824
5824
|
Clear ${d}mol_button_minor
|
|
5825
|
-
click?
|
|
5825
|
+
click? <=> clear? null
|
|
5826
5826
|
`;
|
|
5827
5827
|
const dest = `
|
|
5828
5828
|
query? \\
|
|
@@ -5848,7 +5848,7 @@ var $;
|
|
|
5848
5848
|
<= title
|
|
5849
5849
|
<= Close ${d}mol_button
|
|
5850
5850
|
title \\close
|
|
5851
|
-
click?
|
|
5851
|
+
click? <=> close? null
|
|
5852
5852
|
`;
|
|
5853
5853
|
const dest = `
|
|
5854
5854
|
Close_icon ${d}mol_icon_cross
|
|
@@ -5913,13 +5913,13 @@ var $;
|
|
|
5913
5913
|
Suggest_label ${d}mol_dimmer
|
|
5914
5914
|
clear => clear
|
|
5915
5915
|
Clear ${d}mol_button_minor
|
|
5916
|
-
click?
|
|
5916
|
+
click? <=> clear? null
|
|
5917
5917
|
`;
|
|
5918
|
-
$mol_assert_fail(() => normalize($, src).input, `Need an equal default values at \`/mol/view/tree2/class/props.test.ts#4:16/5\` vs \`/mol/view/tree2/class/props.test.ts#6:
|
|
5918
|
+
$mol_assert_fail(() => normalize($, src).input, `Need an equal default values at \`/mol/view/tree2/class/props.test.ts#4:16/5\` vs \`/mol/view/tree2/class/props.test.ts#6:18/6\`
|
|
5919
5919
|
<=>
|
|
5920
|
-
/mol/view/tree2/class/props.test.ts#6:
|
|
5920
|
+
/mol/view/tree2/class/props.test.ts#6:14/3
|
|
5921
5921
|
click?
|
|
5922
|
-
/mol/view/tree2/class/props.test.ts#6:7/
|
|
5922
|
+
/mol/view/tree2/class/props.test.ts#6:7/6
|
|
5923
5923
|
$mol_button_minor
|
|
5924
5924
|
/mol/view/tree2/class/props.test.ts#5:12/17
|
|
5925
5925
|
Clear
|