mol_dump_lib 0.0.1041 → 0.0.1043

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/web.js CHANGED
@@ -1085,7 +1085,7 @@ var $;
1085
1085
  'color': 'gray',
1086
1086
  });
1087
1087
  $.$mol_dev_format_indent = $.$mol_dev_format_div.bind(null, {
1088
- 'margin-left': '13px'
1088
+ 'margin-inline-start': '13px'
1089
1089
  });
1090
1090
  class Stack extends Array {
1091
1091
  // [ Symbol.toPrimitive ]() {
@@ -1945,14 +1945,14 @@ var $;
1945
1945
  reuse: if (existen) {
1946
1946
  if (!existen.temp)
1947
1947
  break reuse;
1948
- if (existen.task !== task) {
1949
- cause = 'task';
1950
- break reuse;
1951
- }
1952
1948
  if (existen.host !== host) {
1953
1949
  cause = 'host';
1954
1950
  break reuse;
1955
1951
  }
1952
+ if (existen.task !== task) {
1953
+ cause = 'task';
1954
+ break reuse;
1955
+ }
1956
1956
  if (!$mol_compare_deep(existen.args, args)) {
1957
1957
  cause = 'args';
1958
1958
  break reuse;
@@ -2934,7 +2934,7 @@ var $;
2934
2934
  "use strict";
2935
2935
  var $;
2936
2936
  (function ($) {
2937
- $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\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");
2937
+ $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");
2938
2938
  })($ || ($ = {}));
2939
2939
 
2940
2940
  ;
@@ -4347,7 +4347,7 @@ var $;
4347
4347
  'spoiler': /^((?:(?:[\?] )(?:[^]*?)$(\r?\n?))+)([\n\r]*)/,
4348
4348
  'header': /^([#=]+)(\s+)(.*?)$([\n\r]*)/,
4349
4349
  'list': /^((?:(?: ?([*+-])|(?:\d+[\.\)])+) +(?:[^]*?)$(?:\r?\n?)(?: (?:[^]*?)$(?:\r?\n?))*)+)((?:\r?\n)*)/,
4350
- 'code': /^(```\s*)([\w.-]*)[\r\n]+([^]*?)^(```)$([\n\r]*)/,
4350
+ 'code': /^(```)([\w.-]*)[\r\n]+([^]*?)^(```)$([\n\r]*)/,
4351
4351
  'code-indent': /^((?:(?: |\t)(?:[^]*?)$\r?\n?)+)([\n\r]*)/,
4352
4352
  'table': /((?:^\|.+?$\r?\n?)+)([\n\r]*)/,
4353
4353
  'grid': /((?:^ *! .*?$\r?\n?)+)([\n\r]*)/,
@@ -4375,7 +4375,7 @@ var $;
4375
4375
  'code-link': /(?:\w+:\/\/|#)\S+?(?=\s|\\\\|""|$)/,
4376
4376
  'code-comment-inline': /\/\/.*?(?:$|\/\/)|- \\(?!\\).*|(?<=^| )#!? .*/,
4377
4377
  'code-string': /(?:".*?"|'.*?'|`.*?`| ?\\\\.+?\\\\|\/.+?\/[dygimsu]*(?!\p{Letter})|[ \t]*\\[^\n]*)/u,
4378
- 'code-number': /[+-]?(?:\d*\.)?\d+\w*/,
4378
+ 'code-number': /[+-]?(?:\d*\.)?\d+(\uFE0F.|\w*)/,
4379
4379
  'code-call': /\.?\w+(?=\()/,
4380
4380
  'code-sexpr': /\((\w+ )/,
4381
4381
  'code-field': /(?:(?<=\.|::|->)[a-z][\w-]*|(?<=[, \t] |\t)[\w-]+\??:(?!\/\/|:))/,
@@ -4522,11 +4522,11 @@ var $;
4522
4522
  family: 'monospace',
4523
4523
  },
4524
4524
  Numb: {
4525
- textAlign: 'right',
4525
+ textAlign: 'end',
4526
4526
  color: $mol_theme.shade,
4527
4527
  width: rem(3),
4528
4528
  margin: {
4529
- left: rem(-4),
4529
+ inlineStart: '-4rem',
4530
4530
  },
4531
4531
  display: 'inline-block',
4532
4532
  whiteSpace: 'nowrap',
@@ -4866,7 +4866,7 @@ var $;
4866
4866
  "use strict";
4867
4867
  var $;
4868
4868
  (function ($) {
4869
- $mol_style_attach("mol/list/list.view.css", "[mol_list] {\n\twill-change: contents;\n\tdisplay: flex;\n\tflex-direction: column;\n\tflex-shrink: 0;\n\tmax-width: 100%;\n\t/* display: flex;\n\talign-items: stretch;\n\talign-content: stretch; */\n\ttransition: none;\n\tmin-height: 1.5rem;\n\t/* will-change: contents; */\n}\n\n[mol_list_gap_before] ,\n[mol_list_gap_after] {\n\tdisplay: block !important;\n\tflex: none;\n\ttransition: none;\n\toverflow-anchor: none;\n}\n");
4869
+ $mol_style_attach("mol/list/list.view.css", "[mol_list] {\n\twill-change: contents;\n\tdisplay: flex;\n\tflex-direction: column;\n\tflex-shrink: 0;\n\tmax-width: 100%;\n\t/* display: flex;\n\talign-items: stretch;\n\talign-content: stretch; */\n\ttransition: none;\n\t/* will-change: contents; */\n}\n\n[mol_list]:where([mol_view_error]) {\n\tmin-height: 1.5rem;\n}\n\n[mol_list_gap_before] ,\n[mol_list_gap_after] {\n\tdisplay: block !important;\n\tflex: none;\n\ttransition: none;\n\toverflow-anchor: none;\n}\n");
4870
4870
  })($ || ($ = {}));
4871
4871
 
4872
4872
  ;
@@ -5496,6 +5496,48 @@ var $;
5496
5496
  })($$ = $.$$ || ($.$$ = {}));
5497
5497
  })($ || ($ = {}));
5498
5498
 
5499
+ ;
5500
+ "use strict";
5501
+ var $;
5502
+ (function ($) {
5503
+ class $mol_storage extends $mol_object2 {
5504
+ /** Is storage a long term. */
5505
+ static persisted(next) {
5506
+ return false;
5507
+ }
5508
+ /** Total storage quota in bytes. */
5509
+ static total() {
5510
+ return 0;
5511
+ }
5512
+ /** Total storage usage in bytes. */
5513
+ static used() {
5514
+ return 0;
5515
+ }
5516
+ /** Minimum available free space in bytes. */
5517
+ static free() {
5518
+ return this.total() - this.used();
5519
+ }
5520
+ /** Fulfillness of storage. */
5521
+ static portion() {
5522
+ const total = this.total();
5523
+ if (!total)
5524
+ return 1;
5525
+ return this.used() / total;
5526
+ }
5527
+ /**
5528
+ * Fulfillness logarithmic level.
5529
+ * `0` - empty
5530
+ * `1` - half free
5531
+ * `2` - quart free
5532
+ * `Infinity` - fulfilled
5533
+ */
5534
+ static level() {
5535
+ return Math.floor(-Math.log2(1 - this.portion()));
5536
+ }
5537
+ }
5538
+ $.$mol_storage = $mol_storage;
5539
+ })($ || ($ = {}));
5540
+
5499
5541
  ;
5500
5542
  "use strict";
5501
5543
  var $;
@@ -5524,7 +5566,7 @@ var $;
5524
5566
  "use strict";
5525
5567
  var $;
5526
5568
  (function ($) {
5527
- class $mol_storage extends $mol_object2 {
5569
+ class $mol_storage_web extends $mol_storage {
5528
5570
  static native() {
5529
5571
  return this.$.$mol_dom_context.navigator.storage ?? {
5530
5572
  persisted: async () => false,
@@ -5552,19 +5594,40 @@ var $;
5552
5594
  return next ?? $mol_wire_sync(native).persisted();
5553
5595
  }
5554
5596
  static estimate() {
5597
+ $mol_state_time.now(1000);
5555
5598
  return $mol_wire_sync(this.native() ?? {}).estimate();
5556
5599
  }
5600
+ static total() {
5601
+ return this.estimate().quota ?? 0;
5602
+ }
5603
+ static used() {
5604
+ return this.estimate().usage ?? 0;
5605
+ }
5606
+ static free() {
5607
+ const { usage = 0, quota = 0 } = this.estimate();
5608
+ return quota - usage;
5609
+ }
5610
+ static portion() {
5611
+ const { usage = 0, quota = 0 } = this.estimate();
5612
+ if (!quota)
5613
+ return 1;
5614
+ return usage / quota;
5615
+ }
5557
5616
  static dir() {
5558
5617
  return $mol_wire_sync(this.native()).getDirectory();
5559
5618
  }
5560
5619
  }
5561
5620
  __decorate([
5562
5621
  $mol_mem
5563
- ], $mol_storage, "native", null);
5622
+ ], $mol_storage_web, "native", null);
5564
5623
  __decorate([
5565
5624
  $mol_mem
5566
- ], $mol_storage, "persisted", null);
5567
- $.$mol_storage = $mol_storage;
5625
+ ], $mol_storage_web, "persisted", null);
5626
+ __decorate([
5627
+ $mol_mem
5628
+ ], $mol_storage_web, "estimate", null);
5629
+ $.$mol_storage_web = $mol_storage_web;
5630
+ $.$mol_storage = $.$mol_storage_web;
5568
5631
  })($ || ($ = {}));
5569
5632
 
5570
5633
  ;
@@ -6719,6 +6782,19 @@ var $;
6719
6782
  static lang(next) {
6720
6783
  return this.$.$mol_state_local.value('locale', next) || $mol_dom_context.navigator.language.replace(/-.*/, '') || this.lang_default();
6721
6784
  }
6785
+ static langs_rtl() {
6786
+ return ['ar', 'he', 'fa', 'ur', 'yi', 'ps', 'ug', 'sd'];
6787
+ }
6788
+ static direction() {
6789
+ const lang = this.lang();
6790
+ try {
6791
+ return new Intl.Locale(lang).getTextInfo().direction ?? 'ltr';
6792
+ }
6793
+ catch (e) {
6794
+ $mol_fail_log(e);
6795
+ return this.langs_rtl().includes(lang) ? 'rtl' : 'ltr';
6796
+ }
6797
+ }
6722
6798
  static source(lang) {
6723
6799
  return JSON.parse(this.$.$mol_file.relative(`web.locale=${lang}.json`).text().toString());
6724
6800
  }
@@ -6759,6 +6835,9 @@ var $;
6759
6835
  __decorate([
6760
6836
  $mol_mem
6761
6837
  ], $mol_locale, "lang", null);
6838
+ __decorate([
6839
+ $mol_mem
6840
+ ], $mol_locale, "direction", null);
6762
6841
  __decorate([
6763
6842
  $mol_mem_key
6764
6843
  ], $mol_locale, "source", null);
@@ -6980,7 +7059,7 @@ var $;
6980
7059
  true: {
6981
7060
  $mol_text_code_line: {
6982
7061
  margin: {
6983
- left: rem(1.75),
7062
+ inlineStart: '1.75rem',
6984
7063
  },
6985
7064
  },
6986
7065
  },
@@ -7064,7 +7143,7 @@ var $;
7064
7143
  "use strict";
7065
7144
  var $;
7066
7145
  (function ($) {
7067
- $mol_style_attach("mol/check/check.css", "[mol_check] {\n\tflex: 0 0 auto;\n\tjustify-content: flex-start;\n\talign-content: center;\n\t/* align-items: flex-start; */\n\tborder: none;\n\tfont-weight: inherit;\n\tbox-shadow: none;\n\ttext-align: left;\n\tdisplay: inline-flex;\n\tflex-wrap: nowrap;\n}\n\n[mol_check_title] {\n\tflex-shrink: 1;\n}\n");
7146
+ $mol_style_attach("mol/check/check.css", "[mol_check] {\n\tflex: 0 0 auto;\n\tjustify-content: flex-start;\n\talign-content: center;\n\t/* align-items: flex-start; */\n\tborder: none;\n\tfont-weight: inherit;\n\tbox-shadow: none;\n\ttext-align: start;\n\tdisplay: inline-flex;\n\tflex-wrap: nowrap;\n}\n\n[mol_check_title] {\n\tflex-shrink: 1;\n}\n");
7068
7147
  })($ || ($ = {}));
7069
7148
 
7070
7149
  ;
@@ -7181,7 +7260,7 @@ var $;
7181
7260
  "use strict";
7182
7261
  var $;
7183
7262
  (function ($) {
7184
- $mol_style_attach("mol/check/expand/expand.view.css", "[mol_check_expand] {\n\tmin-width: 20px;\n}\n\n:where([mol_check_expand][disabled]) [mol_check_expand_icon] {\n\tvisibility: hidden;\n}\n\n[mol_check_expand_icon] {\n\tbox-shadow: none;\n\tmargin-left: -0.375rem;\n}\n[mol_check_expand_icon] {\n\ttransform: rotateZ(0deg);\n}\n\n:where([mol_check_checked]) [mol_check_expand_icon] {\n\ttransform: rotateZ(90deg);\n}\n\n[mol_check_expand_icon] {\n\tvertical-align: text-top;\n}\n\n[mol_check_expand_label] {\n\tmargin-left: 0;\n}\n");
7263
+ $mol_style_attach("mol/check/expand/expand.view.css", "[mol_check_expand] {\n\tmin-width: 20px;\n}\n\n:where([mol_check_expand][disabled]) [mol_check_expand_icon] {\n\tvisibility: hidden;\n}\n\n[mol_check_expand_icon] {\n\tbox-shadow: none;\n\tmargin-inline-start: -0.375rem;\n}\n[mol_check_expand_icon] {\n\ttransform: rotateZ(0deg);\n}\n\n:where([mol_check_checked]) [mol_check_expand_icon] {\n\ttransform: rotateZ(90deg);\n}\n\n[mol_check_expand_icon] {\n\tvertical-align: text-top;\n}\n\n[mol_check_expand_label] {\n\tmargin-inline-start: 0;\n}\n");
7185
7264
  })($ || ($ = {}));
7186
7265
 
7187
7266
  ;
@@ -7624,7 +7703,7 @@ var $;
7624
7703
  "use strict";
7625
7704
  var $;
7626
7705
  (function ($) {
7627
- $mol_style_attach("mol/dump/value/value.view.css", "[mol_dump_value] {\n\tmin-height: 1.5rem;\n}\n\n[mol_dump_value_simple] {\n\tpadding: 0;\n}\n\n[mol_dump_value_expand_head] {\n\tmin-height: 1.5rem;\n}\n\n[mol_dump_value_expand_content] {\n\tpadding-left: 1.5rem;\n\talign-items: flex-start;\n}\n\n[mol_dump_value_expand_title_rows],\n[mol_dump_value_simple_rows],\n[mol_dump_value_expand_head] {\n\tpadding: 0;\n\tgap: 0;\n}\n");
7706
+ $mol_style_attach("mol/dump/value/value.view.css", "[mol_dump_value] {\n\tmin-height: 1.5rem;\n}\n\n[mol_dump_value_simple] {\n\tpadding: 0;\n}\n\n[mol_dump_value_expand_head] {\n\tmin-height: 1.5rem;\n}\n\n[mol_dump_value_expand_content] {\n\tpadding-inline-start: 1.5rem;\n\talign-items: flex-start;\n}\n\n[mol_dump_value_expand_title_rows],\n[mol_dump_value_simple_rows],\n[mol_dump_value_expand_head] {\n\tpadding: 0;\n\tgap: 0;\n}\n");
7628
7707
  })($ || ($ = {}));
7629
7708
 
7630
7709