mol_dump_lib 0.0.149 → 0.0.151

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
@@ -879,11 +879,15 @@ var $;
879
879
  (function ($) {
880
880
  $.$mol_key_store = new WeakMap();
881
881
  function $mol_key(value) {
882
+ if (typeof value === 'bigint')
883
+ return value.toString() + 'n';
882
884
  if (!value)
883
885
  return JSON.stringify(value);
884
886
  if (typeof value !== 'object' && typeof value !== 'function')
885
887
  return JSON.stringify(value);
886
888
  return JSON.stringify(value, (field, value) => {
889
+ if (typeof value === 'bigint')
890
+ return value.toString() + 'n';
887
891
  if (!value)
888
892
  return value;
889
893
  if (typeof value !== 'object' && typeof value !== 'function')
@@ -4592,16 +4596,78 @@ var $;
4592
4596
  ;
4593
4597
  "use strict";
4594
4598
  var $;
4599
+ (function ($) {
4600
+ function $mol_log3_area_lazy(event) {
4601
+ const self = this;
4602
+ const stack = self.$mol_log3_stack;
4603
+ const deep = stack.length;
4604
+ let logged = false;
4605
+ stack.push(() => {
4606
+ logged = true;
4607
+ self.$mol_log3_area.call(self, event);
4608
+ });
4609
+ return () => {
4610
+ if (logged)
4611
+ self.console.groupEnd();
4612
+ if (stack.length > deep)
4613
+ stack.length = deep;
4614
+ };
4615
+ }
4616
+ $.$mol_log3_area_lazy = $mol_log3_area_lazy;
4617
+ $.$mol_log3_stack = [];
4618
+ })($ || ($ = {}));
4619
+ //mol/log3/log3.ts
4620
+ ;
4621
+ "use strict";
4622
+ var $;
4623
+ (function ($) {
4624
+ function $mol_log3_web_make(level, color) {
4625
+ return function $mol_log3_logger(event) {
4626
+ const pending = this.$mol_log3_stack.pop();
4627
+ if (pending)
4628
+ pending();
4629
+ let tpl = '%c';
4630
+ const chunks = Object.values(event);
4631
+ for (let i = 0; i < chunks.length; ++i) {
4632
+ tpl += (typeof chunks[i] === 'string') ? ' ⦙ %s' : ' ⦙ %o';
4633
+ }
4634
+ const style = `color:${color};font-weight:bolder`;
4635
+ this.console[level](tpl, style, ...chunks);
4636
+ const self = this;
4637
+ return () => self.console.groupEnd();
4638
+ };
4639
+ }
4640
+ $.$mol_log3_web_make = $mol_log3_web_make;
4641
+ $.$mol_log3_come = $mol_log3_web_make('info', 'royalblue');
4642
+ $.$mol_log3_done = $mol_log3_web_make('info', 'forestgreen');
4643
+ $.$mol_log3_fail = $mol_log3_web_make('error', 'orangered');
4644
+ $.$mol_log3_warn = $mol_log3_web_make('warn', 'goldenrod');
4645
+ $.$mol_log3_rise = $mol_log3_web_make('log', 'magenta');
4646
+ $.$mol_log3_area = $mol_log3_web_make('group', 'cyan');
4647
+ })($ || ($ = {}));
4648
+ //mol/log3/log3.web.ts
4649
+ ;
4650
+ "use strict";
4651
+ var $;
4595
4652
  (function ($) {
4596
4653
  class $mol_storage extends $mol_object2 {
4597
4654
  static native() {
4598
4655
  return this.$.$mol_dom_context.navigator.storage;
4599
4656
  }
4600
- static persisted(next) {
4657
+ static persisted(next, cache) {
4601
4658
  $mol_mem_persist();
4659
+ if (cache)
4660
+ return Boolean(next);
4602
4661
  const native = this.native();
4603
- if (next)
4604
- native.persist();
4662
+ if (next && !$mol_mem_cached(() => this.persisted())) {
4663
+ native.persist().then(actual => {
4664
+ setTimeout(() => this.persisted(actual, 'cache'), 5000);
4665
+ if (actual)
4666
+ this.$.$mol_log3_rise({ place: this, message: `Persist` });
4667
+ else
4668
+ this.$.$mol_log3_fail({ place: this, message: `Non persist` });
4669
+ });
4670
+ }
4605
4671
  return next ?? $mol_wire_sync(native).persisted();
4606
4672
  }
4607
4673
  static estimate() {
@@ -5536,7 +5602,7 @@ var $;
5536
5602
  "use strict";
5537
5603
  var $;
5538
5604
  (function ($) {
5539
- $mol_style_attach("mol/check/check.css", "[mol_check] {\n\tflex: 0 0 auto;\n\tjustify-content: flex-start;\n\talign-content: center;\n\talign-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");
5605
+ $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");
5540
5606
  })($ || ($ = {}));
5541
5607
  //mol/check/-css/check.css.ts
5542
5608
  ;