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/node.js CHANGED
@@ -782,7 +782,7 @@ var $;
782
782
  'color': 'gray',
783
783
  });
784
784
  $.$mol_dev_format_indent = $.$mol_dev_format_div.bind(null, {
785
- 'margin-left': '13px'
785
+ 'margin-inline-start': '13px'
786
786
  });
787
787
  class Stack extends Array {
788
788
  // [ Symbol.toPrimitive ]() {
@@ -2087,14 +2087,14 @@ var $;
2087
2087
  reuse: if (existen) {
2088
2088
  if (!existen.temp)
2089
2089
  break reuse;
2090
- if (existen.task !== task) {
2091
- cause = 'task';
2092
- break reuse;
2093
- }
2094
2090
  if (existen.host !== host) {
2095
2091
  cause = 'host';
2096
2092
  break reuse;
2097
2093
  }
2094
+ if (existen.task !== task) {
2095
+ cause = 'task';
2096
+ break reuse;
2097
+ }
2098
2098
  if (!$mol_compare_deep(existen.args, args)) {
2099
2099
  cause = 'args';
2100
2100
  break reuse;
@@ -2347,7 +2347,7 @@ var $;
2347
2347
  "use strict";
2348
2348
  var $;
2349
2349
  (function ($) {
2350
- $.$mol_dom_context = new $node.jsdom.JSDOM('', { url: 'https://localhost/' }).window;
2350
+ $.$mol_dom_context = new $node.jsdom.JSDOM('', { url: `http://${process.env.DOMAIN || 'localhost'}/` }).window;
2351
2351
  })($ || ($ = {}));
2352
2352
 
2353
2353
  ;
@@ -3553,7 +3553,7 @@ var $;
3553
3553
  "use strict";
3554
3554
  var $;
3555
3555
  (function ($) {
3556
- $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");
3556
+ $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");
3557
3557
  })($ || ($ = {}));
3558
3558
 
3559
3559
  ;
@@ -4959,7 +4959,7 @@ var $;
4959
4959
  'spoiler': /^((?:(?:[\?] )(?:[^]*?)$(\r?\n?))+)([\n\r]*)/,
4960
4960
  'header': /^([#=]+)(\s+)(.*?)$([\n\r]*)/,
4961
4961
  'list': /^((?:(?: ?([*+-])|(?:\d+[\.\)])+) +(?:[^]*?)$(?:\r?\n?)(?: (?:[^]*?)$(?:\r?\n?))*)+)((?:\r?\n)*)/,
4962
- 'code': /^(```\s*)([\w.-]*)[\r\n]+([^]*?)^(```)$([\n\r]*)/,
4962
+ 'code': /^(```)([\w.-]*)[\r\n]+([^]*?)^(```)$([\n\r]*)/,
4963
4963
  'code-indent': /^((?:(?: |\t)(?:[^]*?)$\r?\n?)+)([\n\r]*)/,
4964
4964
  'table': /((?:^\|.+?$\r?\n?)+)([\n\r]*)/,
4965
4965
  'grid': /((?:^ *! .*?$\r?\n?)+)([\n\r]*)/,
@@ -4987,7 +4987,7 @@ var $;
4987
4987
  'code-link': /(?:\w+:\/\/|#)\S+?(?=\s|\\\\|""|$)/,
4988
4988
  'code-comment-inline': /\/\/.*?(?:$|\/\/)|- \\(?!\\).*|(?<=^| )#!? .*/,
4989
4989
  'code-string': /(?:".*?"|'.*?'|`.*?`| ?\\\\.+?\\\\|\/.+?\/[dygimsu]*(?!\p{Letter})|[ \t]*\\[^\n]*)/u,
4990
- 'code-number': /[+-]?(?:\d*\.)?\d+\w*/,
4990
+ 'code-number': /[+-]?(?:\d*\.)?\d+(\uFE0F.|\w*)/,
4991
4991
  'code-call': /\.?\w+(?=\()/,
4992
4992
  'code-sexpr': /\((\w+ )/,
4993
4993
  'code-field': /(?:(?<=\.|::|->)[a-z][\w-]*|(?<=[, \t] |\t)[\w-]+\??:(?!\/\/|:))/,
@@ -5134,11 +5134,11 @@ var $;
5134
5134
  family: 'monospace',
5135
5135
  },
5136
5136
  Numb: {
5137
- textAlign: 'right',
5137
+ textAlign: 'end',
5138
5138
  color: $mol_theme.shade,
5139
5139
  width: rem(3),
5140
5140
  margin: {
5141
- left: rem(-4),
5141
+ inlineStart: '-4rem',
5142
5142
  },
5143
5143
  display: 'inline-block',
5144
5144
  whiteSpace: 'nowrap',
@@ -5478,7 +5478,7 @@ var $;
5478
5478
  "use strict";
5479
5479
  var $;
5480
5480
  (function ($) {
5481
- $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");
5481
+ $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");
5482
5482
  })($ || ($ = {}));
5483
5483
 
5484
5484
  ;
@@ -6151,71 +6151,80 @@ var $;
6151
6151
  "use strict";
6152
6152
  var $;
6153
6153
  (function ($) {
6154
- $.$mol_mem_persist = $mol_wire_solid;
6155
- })($ || ($ = {}));
6156
-
6157
- ;
6158
- "use strict";
6159
- var $;
6160
- (function ($) {
6161
- function $mol_wait_user_async() {
6162
- return new Promise(done => $mol_dom.addEventListener('click', function onclick() {
6163
- $mol_dom.removeEventListener('click', onclick);
6164
- done(null);
6165
- }));
6166
- }
6167
- $.$mol_wait_user_async = $mol_wait_user_async;
6168
- function $mol_wait_user() {
6169
- return this.$mol_wire_sync(this).$mol_wait_user_async();
6154
+ class $mol_storage extends $mol_object2 {
6155
+ /** Is storage a long term. */
6156
+ static persisted(next) {
6157
+ return false;
6158
+ }
6159
+ /** Total storage quota in bytes. */
6160
+ static total() {
6161
+ return 0;
6162
+ }
6163
+ /** Total storage usage in bytes. */
6164
+ static used() {
6165
+ return 0;
6166
+ }
6167
+ /** Minimum available free space in bytes. */
6168
+ static free() {
6169
+ return this.total() - this.used();
6170
+ }
6171
+ /** Fulfillness of storage. */
6172
+ static portion() {
6173
+ const total = this.total();
6174
+ if (!total)
6175
+ return 1;
6176
+ return this.used() / total;
6177
+ }
6178
+ /**
6179
+ * Fulfillness logarithmic level.
6180
+ * `0` - empty
6181
+ * `1` - half free
6182
+ * `2` - quart free
6183
+ * `Infinity` - fulfilled
6184
+ */
6185
+ static level() {
6186
+ return Math.floor(-Math.log2(1 - this.portion()));
6187
+ }
6170
6188
  }
6171
- $.$mol_wait_user = $mol_wait_user;
6189
+ $.$mol_storage = $mol_storage;
6172
6190
  })($ || ($ = {}));
6173
6191
 
6174
6192
  ;
6175
6193
  "use strict";
6176
6194
  var $;
6177
6195
  (function ($) {
6178
- class $mol_storage extends $mol_object2 {
6179
- static native() {
6180
- return this.$.$mol_dom_context.navigator.storage ?? {
6181
- persisted: async () => false,
6182
- persist: async () => false,
6183
- estimate: async () => ({}),
6184
- getDirectory: async () => null,
6185
- };
6196
+ class $mol_storage_node extends $mol_storage {
6197
+ static persisted() {
6198
+ return true;
6186
6199
  }
6187
- static persisted(next, cache) {
6188
- $mol_mem_persist();
6189
- if (cache)
6190
- return Boolean(next);
6191
- const native = this.native();
6192
- if (next && !$mol_mem_cached(() => this.persisted())) {
6193
- this.$.$mol_wait_user_async()
6194
- .then(() => native.persist())
6195
- .then(actual => {
6196
- setTimeout(() => this.persisted(actual, 'cache'), 5000);
6197
- if (actual)
6198
- this.$.$mol_log3_done({ place: `$mol_storage`, message: `Persist: Yes` });
6199
- else
6200
- this.$.$mol_log3_fail({ place: `$mol_storage`, message: `Persist: No` });
6201
- });
6202
- }
6203
- return next ?? $mol_wire_sync(native).persisted();
6200
+ static stats() {
6201
+ $mol_state_time.now(1000);
6202
+ return $node.fs.statfsSync('.');
6204
6203
  }
6205
- static estimate() {
6206
- return $mol_wire_sync(this.native() ?? {}).estimate();
6204
+ static total() {
6205
+ const { blocks, bsize } = this.stats();
6206
+ return blocks * bsize;
6207
6207
  }
6208
- static dir() {
6209
- return $mol_wire_sync(this.native()).getDirectory();
6208
+ static used() {
6209
+ const { blocks, bfree, bsize } = this.stats();
6210
+ return (blocks - bfree) * bsize;
6211
+ }
6212
+ static free() {
6213
+ const { bfree, bsize } = this.stats();
6214
+ return bfree * bsize;
6215
+ }
6216
+ static portion() {
6217
+ const { blocks, bfree } = this.stats();
6218
+ if (!blocks)
6219
+ return 1;
6220
+ return (blocks - bfree) / blocks;
6210
6221
  }
6211
6222
  }
6212
6223
  __decorate([
6213
6224
  $mol_mem
6214
- ], $mol_storage, "native", null);
6215
- __decorate([
6216
- $mol_mem
6217
- ], $mol_storage, "persisted", null);
6218
- $.$mol_storage = $mol_storage;
6225
+ ], $mol_storage_node, "stats", null);
6226
+ $.$mol_storage_node = $mol_storage_node;
6227
+ $.$mol_storage = $.$mol_storage_node;
6219
6228
  })($ || ($ = {}));
6220
6229
 
6221
6230
  ;
@@ -7175,6 +7184,19 @@ var $;
7175
7184
  static lang(next) {
7176
7185
  return this.$.$mol_state_local.value('locale', next) || $mol_dom_context.navigator.language.replace(/-.*/, '') || this.lang_default();
7177
7186
  }
7187
+ static langs_rtl() {
7188
+ return ['ar', 'he', 'fa', 'ur', 'yi', 'ps', 'ug', 'sd'];
7189
+ }
7190
+ static direction() {
7191
+ const lang = this.lang();
7192
+ try {
7193
+ return new Intl.Locale(lang).getTextInfo().direction ?? 'ltr';
7194
+ }
7195
+ catch (e) {
7196
+ $mol_fail_log(e);
7197
+ return this.langs_rtl().includes(lang) ? 'rtl' : 'ltr';
7198
+ }
7199
+ }
7178
7200
  static source(lang) {
7179
7201
  return JSON.parse(this.$.$mol_file.relative(`web.locale=${lang}.json`).text().toString());
7180
7202
  }
@@ -7215,6 +7237,9 @@ var $;
7215
7237
  __decorate([
7216
7238
  $mol_mem
7217
7239
  ], $mol_locale, "lang", null);
7240
+ __decorate([
7241
+ $mol_mem
7242
+ ], $mol_locale, "direction", null);
7218
7243
  __decorate([
7219
7244
  $mol_mem_key
7220
7245
  ], $mol_locale, "source", null);
@@ -7436,7 +7461,7 @@ var $;
7436
7461
  true: {
7437
7462
  $mol_text_code_line: {
7438
7463
  margin: {
7439
- left: rem(1.75),
7464
+ inlineStart: '1.75rem',
7440
7465
  },
7441
7466
  },
7442
7467
  },
@@ -7520,7 +7545,7 @@ var $;
7520
7545
  "use strict";
7521
7546
  var $;
7522
7547
  (function ($) {
7523
- $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");
7548
+ $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");
7524
7549
  })($ || ($ = {}));
7525
7550
 
7526
7551
  ;
@@ -7637,7 +7662,7 @@ var $;
7637
7662
  "use strict";
7638
7663
  var $;
7639
7664
  (function ($) {
7640
- $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");
7665
+ $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");
7641
7666
  })($ || ($ = {}));
7642
7667
 
7643
7668
  ;
@@ -8080,7 +8105,7 @@ var $;
8080
8105
  "use strict";
8081
8106
  var $;
8082
8107
  (function ($) {
8083
- $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");
8108
+ $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");
8084
8109
  })($ || ($ = {}));
8085
8110
 
8086
8111