mol_plot_all 1.2.1705 → 1.2.1707

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.mjs CHANGED
@@ -125,6 +125,10 @@ var $;
125
125
  "use strict";
126
126
  var $;
127
127
  (function ($) {
128
+ /**
129
+ * CSS Units
130
+ * @see https://mol.hyoo.ru/#!section=docs/=xwq9q5_f966fg
131
+ */
128
132
  class $mol_style_unit extends $mol_decor {
129
133
  literal;
130
134
  constructor(value, literal) {
@@ -171,6 +175,10 @@ var $;
171
175
  var $;
172
176
  (function ($) {
173
177
  const { per } = $mol_style_unit;
178
+ /**
179
+ * CSS Functions
180
+ * @see https://mol.hyoo.ru/#!section=docs/=xwq9q5_f966fg
181
+ */
174
182
  class $mol_style_func extends $mol_decor {
175
183
  name;
176
184
  constructor(name, value) {
@@ -265,6 +273,7 @@ var $;
265
273
  "use strict";
266
274
  var $;
267
275
  (function ($) {
276
+ /** Create record of CSS variables. */
268
277
  function $mol_style_prop(prefix, keys) {
269
278
  const record = keys.reduce((rec, key) => {
270
279
  rec[key] = $mol_style_func.vary(`--${prefix}_${key}`);
@@ -279,6 +288,10 @@ var $;
279
288
  "use strict";
280
289
  var $;
281
290
  (function ($) {
291
+ /**
292
+ * Theme css variables
293
+ * @see https://mol.hyoo.ru/#!section=demos/demo=mol_textarea_demo
294
+ */
282
295
  $.$mol_theme = $mol_style_prop('mol_theme', [
283
296
  'back',
284
297
  'hover',
@@ -307,11 +320,18 @@ var $;
307
320
 
308
321
  ;
309
322
  "use strict";
323
+ // namespace $ {
324
+ // $mol_style_attach( '$mol_theme_lights', `:root { --mol_theme_back: oklch( ${ $$.$mol_lights() ? 92 : 20 }% .01 var(--mol_theme_hue) ) }` )
325
+ // }
310
326
 
311
327
  ;
312
328
  "use strict";
313
329
  var $;
314
330
  (function ($) {
331
+ /**
332
+ * Gap in CSS
333
+ * @see https://page.hyoo.ru/#!=msdb74_bm7nsq
334
+ */
315
335
  $.$mol_gap = $mol_style_prop('mol_gap', [
316
336
  'page',
317
337
  'block',
@@ -443,6 +463,12 @@ var $;
443
463
  createDocumentFragment: () => $mol_dom_context.document.createDocumentFragment(),
444
464
  };
445
465
  $.$mol_jsx_frag = '';
466
+ /**
467
+ * JSX adapter that makes DOM tree.
468
+ * Generates global unique ids for every DOM-element by components tree with ids.
469
+ * Ensures all local ids are unique.
470
+ * Can reuse an existing nodes by GUIDs when used inside [`mol_jsx_attach`](https://github.com/hyoo-ru/mam_mol/tree/master/jsx/attach).
471
+ */
446
472
  function $mol_jsx(Elem, props, ...childNodes) {
447
473
  const id = props && props.id || '';
448
474
  const guid = id ? $.$mol_jsx_prefix ? $.$mol_jsx_prefix + '/' + id : id : $.$mol_jsx_prefix;
@@ -567,6 +593,11 @@ var $;
567
593
  var $;
568
594
  (function ($) {
569
595
  const instances = new WeakSet();
596
+ /**
597
+ * Proxy that delegates all to lazy returned target.
598
+ *
599
+ * $mol_delegate( Array.prototype , ()=> fetch_array() )
600
+ */
570
601
  function $mol_delegate(proto, target) {
571
602
  const proxy = new Proxy(proto, {
572
603
  get: (_, field) => {
@@ -660,7 +691,7 @@ var $;
660
691
  var $;
661
692
  (function ($) {
662
693
  function $mol_fail_hidden(error) {
663
- throw error;
694
+ throw error; /// Use 'Never Pause Here' breakpoint in DevTools or simply blackbox this script
664
695
  }
665
696
  $.$mol_fail_hidden = $mol_fail_hidden;
666
697
  })($ || ($ = {}));
@@ -720,6 +751,9 @@ var $;
720
751
  [Symbol.dispose]() {
721
752
  this.destructor();
722
753
  }
754
+ //[ Symbol.toPrimitive ]( hint: string ) {
755
+ // return hint === 'number' ? this.valueOf() : this.toString()
756
+ //}
723
757
  toString() {
724
758
  return this[Symbol.toStringTag] || this.constructor.name + '<>';
725
759
  }
@@ -751,6 +785,7 @@ var $;
751
785
  "use strict";
752
786
  var $;
753
787
  (function ($) {
788
+ /** Generates unique identifier. */
754
789
  function $mol_guid(length = 8, exists = () => false) {
755
790
  for (;;) {
756
791
  let id = Math.random().toString(36).substring(2, length + 2).toUpperCase();
@@ -766,11 +801,16 @@ var $;
766
801
  "use strict";
767
802
  var $;
768
803
  (function ($) {
804
+ /** Special status statuses. */
769
805
  let $mol_wire_cursor;
770
806
  (function ($mol_wire_cursor) {
807
+ /** Update required. */
771
808
  $mol_wire_cursor[$mol_wire_cursor["stale"] = -1] = "stale";
809
+ /** Some of (transitive) pub update required. */
772
810
  $mol_wire_cursor[$mol_wire_cursor["doubt"] = -2] = "doubt";
811
+ /** Actual state but may be dropped. */
773
812
  $mol_wire_cursor[$mol_wire_cursor["fresh"] = -3] = "fresh";
813
+ /** State will never be changed. */
774
814
  $mol_wire_cursor[$mol_wire_cursor["final"] = -4] = "final";
775
815
  })($mol_wire_cursor = $.$mol_wire_cursor || ($.$mol_wire_cursor = {}));
776
816
  })($ || ($ = {}));
@@ -779,6 +819,9 @@ var $;
779
819
  "use strict";
780
820
  var $;
781
821
  (function ($) {
822
+ /**
823
+ * Collects subscribers in compact array. 28B
824
+ */
782
825
  class $mol_wire_pub extends Object {
783
826
  constructor(id = `$mol_wire_pub:${$mol_guid()}`) {
784
827
  super();
@@ -786,10 +829,17 @@ var $;
786
829
  }
787
830
  [Symbol.toStringTag];
788
831
  data = [];
832
+ // Derived objects should be Arrays.
789
833
  static get [Symbol.species]() {
790
834
  return Array;
791
835
  }
792
- sub_from = 0;
836
+ /**
837
+ * Index of first subscriber.
838
+ */
839
+ sub_from = 0; // 4B
840
+ /**
841
+ * All current subscribers.
842
+ */
793
843
  get sub_list() {
794
844
  const res = [];
795
845
  for (let i = this.sub_from; i < this.data.length; i += 2) {
@@ -797,14 +847,23 @@ var $;
797
847
  }
798
848
  return res;
799
849
  }
850
+ /**
851
+ * Has any subscribers or not.
852
+ */
800
853
  get sub_empty() {
801
854
  return this.sub_from === this.data.length;
802
855
  }
856
+ /**
857
+ * Subscribe subscriber to this publisher events and return position of subscriber that required to unsubscribe.
858
+ */
803
859
  sub_on(sub, pub_pos) {
804
860
  const pos = this.data.length;
805
861
  this.data.push(sub, pub_pos);
806
862
  return pos;
807
863
  }
864
+ /**
865
+ * Unsubscribe subscriber from this publisher events by subscriber position provided by `on(pub)`.
866
+ */
808
867
  sub_off(sub_pos) {
809
868
  if (!(sub_pos < this.data.length)) {
810
869
  $mol_fail(new Error(`Wrong pos ${sub_pos}`));
@@ -817,21 +876,39 @@ var $;
817
876
  if (end === this.sub_from)
818
877
  this.reap();
819
878
  }
879
+ /**
880
+ * Called when last sub was unsubscribed.
881
+ **/
820
882
  reap() { }
883
+ /**
884
+ * Autowire this publisher with current subscriber.
885
+ **/
821
886
  promote() {
822
887
  $mol_wire_auto()?.track_next(this);
823
888
  }
889
+ /**
890
+ * Enforce actualization. Should not throw errors.
891
+ */
824
892
  fresh() { }
893
+ /**
894
+ * Allow to put data to caches in the subtree.
895
+ */
825
896
  complete() { }
826
897
  get incompleted() {
827
898
  return false;
828
899
  }
900
+ /**
901
+ * Notify subscribers about self changes.
902
+ */
829
903
  emit(quant = $mol_wire_cursor.stale) {
830
904
  for (let i = this.sub_from; i < this.data.length; i += 2) {
831
905
  ;
832
906
  this.data[i].absorb(quant, this.data[i + 1]);
833
907
  }
834
908
  }
909
+ /**
910
+ * Moves peer from one position to another. Doesn't clear data at old position!
911
+ */
835
912
  peer_move(from_pos, to_pos) {
836
913
  const peer = this.data[from_pos];
837
914
  const self_pos = this.data[from_pos + 1];
@@ -839,6 +916,9 @@ var $;
839
916
  this.data[to_pos + 1] = self_pos;
840
917
  peer.peer_repos(self_pos, to_pos);
841
918
  }
919
+ /**
920
+ * Updates self position in the peer.
921
+ */
842
922
  peer_repos(peer_pos, self_pos) {
843
923
  this.data[peer_pos + 1] = self_pos;
844
924
  }
@@ -854,10 +934,16 @@ var $;
854
934
  var $;
855
935
  (function ($) {
856
936
  $.$mol_wire_auto_sub = null;
937
+ /**
938
+ * When fulfilled, all publishers are promoted to this subscriber on access to its.
939
+ */
857
940
  function $mol_wire_auto(next = $.$mol_wire_auto_sub) {
858
941
  return $.$mol_wire_auto_sub = next;
859
942
  }
860
943
  $.$mol_wire_auto = $mol_wire_auto;
944
+ /**
945
+ * Affection queue. Used to prevent accidental stack overflow on emit.
946
+ */
861
947
  $.$mol_wire_affected = [];
862
948
  })($ || ($ = {}));
863
949
 
@@ -865,6 +951,7 @@ var $;
865
951
  "use strict";
866
952
  var $;
867
953
  (function ($) {
954
+ // https://docs.google.com/document/d/1FTascZXT9cxfetuPRT2eXPQKXui4nWFivUnS_335T3U/preview#
868
955
  $['devtoolsFormatters'] ||= [];
869
956
  function $mol_dev_format_register(config) {
870
957
  $['devtoolsFormatters'].push(config);
@@ -916,6 +1003,7 @@ var $;
916
1003
  return false;
917
1004
  if (!val)
918
1005
  return false;
1006
+ // if( Error.isError( val ) ) true
919
1007
  if (val[$.$mol_dev_format_body])
920
1008
  return true;
921
1009
  return false;
@@ -933,12 +1021,16 @@ var $;
933
1021
  return $.$mol_dev_format_accent($mol_dev_format_native(val), '💨', $mol_dev_format_native(error), '');
934
1022
  }
935
1023
  }
1024
+ // if( Error.isError( val ) ) {
1025
+ // return $mol_dev_format_native( val )
1026
+ // }
936
1027
  return null;
937
1028
  },
938
1029
  });
939
1030
  function $mol_dev_format_native(obj) {
940
1031
  if (typeof obj === 'undefined')
941
1032
  return $.$mol_dev_format_shade('undefined');
1033
+ // if( ![ 'object', 'function', 'symbol' ].includes( typeof obj ) ) return obj
942
1034
  return [
943
1035
  'object',
944
1036
  {
@@ -996,6 +1088,9 @@ var $;
996
1088
  'margin-left': '13px'
997
1089
  });
998
1090
  class Stack extends Array {
1091
+ // [ Symbol.toPrimitive ]() {
1092
+ // return this.toString()
1093
+ // }
999
1094
  toString() {
1000
1095
  return this.join('\n');
1001
1096
  }
@@ -1018,6 +1113,7 @@ var $;
1018
1113
  this.method = call.getMethodName() ?? '';
1019
1114
  if (this.method === this.function)
1020
1115
  this.method = '';
1116
+ // const func = c.getFunction()
1021
1117
  this.pos = [call.getEnclosingLineNumber() ?? 0, call.getEnclosingColumnNumber() ?? 0];
1022
1118
  this.eval = call.getEvalOrigin() ?? '';
1023
1119
  this.source = call.getScriptNameOrSourceURL() ?? '';
@@ -1064,9 +1160,16 @@ var $;
1064
1160
  "use strict";
1065
1161
  var $;
1066
1162
  (function ($) {
1163
+ /**
1164
+ * Publisher that can auto collect other publishers. 32B
1165
+ *
1166
+ * P1 P2 P3 P4 S1 S2 S3
1167
+ * ^ ^
1168
+ * pubs_from subs_from
1169
+ */
1067
1170
  class $mol_wire_pub_sub extends $mol_wire_pub {
1068
- pub_from = 0;
1069
- cursor = $mol_wire_cursor.stale;
1171
+ pub_from = 0; // 4B
1172
+ cursor = $mol_wire_cursor.stale; // 4B
1070
1173
  get temp() {
1071
1174
  return false;
1072
1175
  }
@@ -1184,10 +1287,27 @@ var $;
1184
1287
  return;
1185
1288
  this.cursor = quant;
1186
1289
  this.emit($mol_wire_cursor.doubt);
1290
+ // if( pos >= 0 && pos < this.sub_from - 2 ) {
1291
+ // const pub = this.data[ pos ] as $mol_wire_pub
1292
+ // if( pub instanceof $mol_wire_task ) return
1293
+ // for(
1294
+ // let cursor = this.pub_from;
1295
+ // cursor < this.sub_from;
1296
+ // cursor += 2
1297
+ // ) {
1298
+ // const pub = this.data[ cursor ] as $mol_wire_pub
1299
+ // if( pub instanceof $mol_wire_task ) {
1300
+ // pub.destructor()
1301
+ // }
1302
+ // }
1303
+ // }
1187
1304
  }
1188
1305
  [$mol_dev_format_head]() {
1189
1306
  return $mol_dev_format_native(this);
1190
1307
  }
1308
+ /**
1309
+ * Is subscribed to any publisher or not.
1310
+ */
1191
1311
  get pub_empty() {
1192
1312
  return this.sub_from === this.pub_from;
1193
1313
  }
@@ -1243,6 +1363,13 @@ var $;
1243
1363
  var $;
1244
1364
  (function ($) {
1245
1365
  const wrappers = new WeakMap();
1366
+ /**
1367
+ * Suspendable task with support both sync/async api.
1368
+ *
1369
+ * A1 A2 A3 A4 P1 P2 P3 P4 S1 S2 S3
1370
+ * ^ ^ ^
1371
+ * args_from pubs_from subs_from
1372
+ **/
1246
1373
  class $mol_wire_fiber extends $mol_wire_pub_sub {
1247
1374
  task;
1248
1375
  host;
@@ -1263,6 +1390,7 @@ var $;
1263
1390
  });
1264
1391
  }
1265
1392
  static sync() {
1393
+ // Sync whole fiber graph
1266
1394
  while (this.planning.size) {
1267
1395
  for (const fiber of this.planning) {
1268
1396
  this.planning.delete(fiber);
@@ -1273,6 +1401,7 @@ var $;
1273
1401
  fiber.fresh();
1274
1402
  }
1275
1403
  }
1404
+ // Collect garbage
1276
1405
  while (this.reaping.size) {
1277
1406
  const fibers = this.reaping;
1278
1407
  this.reaping = new Set;
@@ -1424,6 +1553,10 @@ var $;
1424
1553
  this.cursor = $mol_wire_cursor.stale;
1425
1554
  this.fresh();
1426
1555
  }
1556
+ /**
1557
+ * Synchronous execution. Throws Promise when waits async task (SuspenseAPI provider).
1558
+ * Should be called inside SuspenseAPI consumer (ie fiber).
1559
+ */
1427
1560
  sync() {
1428
1561
  if (!$mol_wire_fiber.warm) {
1429
1562
  return this.result();
@@ -1438,6 +1571,10 @@ var $;
1438
1571
  }
1439
1572
  return this.cache;
1440
1573
  }
1574
+ /**
1575
+ * Asynchronous execution.
1576
+ * It's SuspenseAPI consumer. So SuspenseAPI providers can be called inside.
1577
+ */
1441
1578
  async async_raw() {
1442
1579
  while (true) {
1443
1580
  this.fresh();
@@ -1450,6 +1587,7 @@ var $;
1450
1587
  if (!$mol_promise_like(this.cache))
1451
1588
  return this.cache;
1452
1589
  if (this.cursor === $mol_wire_cursor.final) {
1590
+ // never ends on destructed fiber
1453
1591
  await new Promise(() => { });
1454
1592
  }
1455
1593
  }
@@ -1497,6 +1635,7 @@ var $;
1497
1635
  var $;
1498
1636
  (function ($) {
1499
1637
  const TypedArray = Object.getPrototypeOf(Uint8Array);
1638
+ /** Returns string key for any value. */
1500
1639
  function $mol_key(value) {
1501
1640
  primitives: {
1502
1641
  if (typeof value === 'bigint')
@@ -1504,9 +1643,9 @@ var $;
1504
1643
  if (typeof value === 'symbol')
1505
1644
  return `Symbol(${value.description})`;
1506
1645
  if (!value)
1507
- return JSON.stringify(value);
1646
+ return JSON.stringify(value); // 0, null, ""
1508
1647
  if (typeof value !== 'object' && typeof value !== 'function')
1509
- return JSON.stringify(value);
1648
+ return JSON.stringify(value); // boolean, number, string
1510
1649
  }
1511
1650
  caching: {
1512
1651
  let key = $mol_key_store.get(value);
@@ -1590,6 +1729,10 @@ var $;
1590
1729
  var $;
1591
1730
  (function ($) {
1592
1731
  $.$mol_compare_deep_cache = new WeakMap();
1732
+ /**
1733
+ * Deeply compares two values. Returns true if equal.
1734
+ * Define `Symbol.toPrimitive` to customize.
1735
+ */
1593
1736
  function $mol_compare_deep(left, right) {
1594
1737
  if (Object.is(left, right))
1595
1738
  return true;
@@ -1729,6 +1872,7 @@ var $;
1729
1872
  "use strict";
1730
1873
  var $;
1731
1874
  (function ($) {
1875
+ /** Log begin of collapsed group only when some logged inside, returns func to close group */
1732
1876
  function $mol_log3_area_lazy(event) {
1733
1877
  const self = this.$;
1734
1878
  const stack = self.$mol_log3_stack;
@@ -1785,6 +1929,7 @@ var $;
1785
1929
  "use strict";
1786
1930
  var $;
1787
1931
  (function ($) {
1932
+ /** One-shot fiber */
1788
1933
  class $mol_wire_task extends $mol_wire_fiber {
1789
1934
  static getter(task) {
1790
1935
  return function $mol_wire_task_get(host, args) {
@@ -1810,6 +1955,7 @@ var $;
1810
1955
  }
1811
1956
  const key = (host?.[Symbol.toStringTag] ?? host) + ('.' + task.name + '<#>');
1812
1957
  const next = new $mol_wire_task(key, task, host, args);
1958
+ // Disabled because non-idempotency is required for try-catch
1813
1959
  if (existen?.temp) {
1814
1960
  $$.$mol_log3_warn({
1815
1961
  place: '$mol_wire_task',
@@ -1842,7 +1988,7 @@ var $;
1842
1988
  try {
1843
1989
  next[Symbol.toStringTag] = this[Symbol.toStringTag];
1844
1990
  }
1845
- catch {
1991
+ catch { // Promises throw in strict mode
1846
1992
  Object.defineProperty(next, Symbol.toStringTag, { value: this[Symbol.toStringTag] });
1847
1993
  }
1848
1994
  }
@@ -1867,6 +2013,9 @@ var $;
1867
2013
  "use strict";
1868
2014
  var $;
1869
2015
  (function ($) {
2016
+ /**
2017
+ * Decorates method to fiber to ensure it is executed only once inside other fiber.
2018
+ */
1870
2019
  function $mol_wire_method(host, field, descr) {
1871
2020
  if (!descr)
1872
2021
  descr = Reflect.getOwnPropertyDescriptor(host, field);
@@ -1936,6 +2085,7 @@ var $;
1936
2085
  let error;
1937
2086
  let result;
1938
2087
  let handler;
2088
+ /// Debugger will stop at exceptions but exception will be returned normally
1939
2089
  function $mol_try_web(handler2) {
1940
2090
  handler = handler2;
1941
2091
  error = undefined;
@@ -1976,6 +2126,7 @@ var $;
1976
2126
  "use strict";
1977
2127
  var $;
1978
2128
  (function ($) {
2129
+ /** Long-living fiber. */
1979
2130
  class $mol_wire_atom extends $mol_wire_fiber {
1980
2131
  static solo(host, task) {
1981
2132
  const field = task.name + '()';
@@ -2026,7 +2177,11 @@ var $;
2026
2177
  }
2027
2178
  $mol_wire_atom.watching.add(this);
2028
2179
  }
2180
+ /**
2181
+ * Update atom value through another temp fiber.
2182
+ */
2029
2183
  resync(args) {
2184
+ // enforce pulling tasks abort
2030
2185
  for (let cursor = this.pub_from; cursor < this.sub_from; cursor += 2) {
2031
2186
  const pub = this.data[cursor];
2032
2187
  if (pub && pub instanceof $mol_wire_task) {
@@ -2087,7 +2242,7 @@ var $;
2087
2242
  try {
2088
2243
  next[Symbol.toStringTag] = this[Symbol.toStringTag];
2089
2244
  }
2090
- catch {
2245
+ catch { // Promises throw in strict mode
2091
2246
  Object.defineProperty(next, Symbol.toStringTag, { value: this[Symbol.toStringTag] });
2092
2247
  }
2093
2248
  }
@@ -2115,6 +2270,7 @@ var $;
2115
2270
  "use strict";
2116
2271
  var $;
2117
2272
  (function ($) {
2273
+ /** Decorates solo object channel to [mol_wire_atom](../atom/atom.ts). */
2118
2274
  function $mol_wire_solo(host, field, descr) {
2119
2275
  if (!descr)
2120
2276
  descr = Reflect.getOwnPropertyDescriptor(host, field);
@@ -2153,6 +2309,7 @@ var $;
2153
2309
  "use strict";
2154
2310
  var $;
2155
2311
  (function ($) {
2312
+ /** Reactive memoizing multiplexed property decorator. */
2156
2313
  function $mol_wire_plex(host, field, descr) {
2157
2314
  if (!descr)
2158
2315
  descr = Reflect.getOwnPropertyDescriptor(host, field);
@@ -2191,7 +2348,25 @@ var $;
2191
2348
  "use strict";
2192
2349
  var $;
2193
2350
  (function ($) {
2351
+ /**
2352
+ * Reactive memoizing solo property decorator from [mol_wire](../wire/README.md)
2353
+ * @example
2354
+ * '@' $mol_mem
2355
+ * name(next?: string) {
2356
+ * return next ?? 'default'
2357
+ * }
2358
+ * @see https://mol.hyoo.ru/#!section=docs/=qxmh6t_sinbmb
2359
+ */
2194
2360
  $.$mol_mem = $mol_wire_solo;
2361
+ /**
2362
+ * Reactive memoizing multiplexed property decorator [mol_wire](../wire/README.md)
2363
+ * @example
2364
+ * '@' $mol_mem_key
2365
+ * name(id: number, next?: string) {
2366
+ * return next ?? 'default'
2367
+ * }
2368
+ * @see https://mol.hyoo.ru/#!section=docs/=qxmh6t_sinbmb
2369
+ */
2195
2370
  $.$mol_mem_key = $mol_wire_plex;
2196
2371
  })($ || ($ = {}));
2197
2372
 
@@ -2280,6 +2455,10 @@ var $;
2280
2455
  "use strict";
2281
2456
  var $;
2282
2457
  (function ($) {
2458
+ /**
2459
+ * Key names code for hotkey
2460
+ * @see [mol_hotkey](../../hotkey/hotkey.view.ts)
2461
+ */
2283
2462
  let $mol_keyboard_code;
2284
2463
  (function ($mol_keyboard_code) {
2285
2464
  $mol_keyboard_code[$mol_keyboard_code["backspace"] = 8] = "backspace";
@@ -2528,6 +2707,7 @@ var $;
2528
2707
  "use strict";
2529
2708
  var $;
2530
2709
  (function ($) {
2710
+ /** Run code without state changes */
2531
2711
  function $mol_wire_probe(task, def) {
2532
2712
  const warm = $mol_wire_fiber.warm;
2533
2713
  try {
@@ -2548,6 +2728,10 @@ var $;
2548
2728
  "use strict";
2549
2729
  var $;
2550
2730
  (function ($) {
2731
+ /**
2732
+ * Real-time refresh current atom.
2733
+ * Don't use if possible. May reduce performance.
2734
+ */
2551
2735
  function $mol_wire_watch() {
2552
2736
  const atom = $mol_wire_auto();
2553
2737
  if (atom instanceof $mol_wire_atom) {
@@ -2564,6 +2748,11 @@ var $;
2564
2748
  "use strict";
2565
2749
  var $;
2566
2750
  (function ($) {
2751
+ /**
2752
+ * Returns closure that returns constant value.
2753
+ * @example
2754
+ * const rnd = $mol_const( Math.random() )
2755
+ */
2567
2756
  function $mol_const(value) {
2568
2757
  const getter = (() => value);
2569
2758
  getter['()'] = value;
@@ -2578,6 +2767,9 @@ var $;
2578
2767
  "use strict";
2579
2768
  var $;
2580
2769
  (function ($) {
2770
+ /**
2771
+ * Disable reaping of current subscriber
2772
+ */
2581
2773
  function $mol_wire_solid() {
2582
2774
  let current = $mol_wire_auto();
2583
2775
  if (current.temp)
@@ -2681,6 +2873,7 @@ var $;
2681
2873
  "use strict";
2682
2874
  var $;
2683
2875
  (function ($) {
2876
+ /** Convert a pseudo-synchronous (Suspense API) API to an explicit asynchronous one (for integrating with external systems). */
2684
2877
  function $mol_wire_async(obj) {
2685
2878
  let fiber;
2686
2879
  const temp = $mol_wire_task.getter(obj);
@@ -2740,6 +2933,7 @@ var $;
2740
2933
 
2741
2934
  ;
2742
2935
  "use strict";
2936
+ /** @jsx $mol_jsx */
2743
2937
  var $;
2744
2938
  (function ($) {
2745
2939
  function $mol_view_visible_width() {
@@ -2754,6 +2948,11 @@ var $;
2754
2948
  return suffix;
2755
2949
  }
2756
2950
  $.$mol_view_state_key = $mol_view_state_key;
2951
+ /**
2952
+ * The base class for all visual components. It provides the infrastructure for reactive lazy rendering, handling exceptions.
2953
+ * @see https://mol.hyoo.ru/#!section=docs/=vv2nig_s5zr0f
2954
+ */
2955
+ /// Reactive statefull lazy ViewModel
2757
2956
  class $mol_view extends $mol_object {
2758
2957
  static Root(id) {
2759
2958
  return new this;
@@ -2818,16 +3017,22 @@ var $;
2818
3017
  state_key(suffix = '') {
2819
3018
  return this.$.$mol_view_state_key(suffix);
2820
3019
  }
3020
+ /// Name of element that created when element not found in DOM
2821
3021
  dom_name() {
2822
3022
  return $mol_dom_qname(this.constructor.toString()) || 'div';
2823
3023
  }
3024
+ /// NameSpace of element that created when element not found in DOM
2824
3025
  dom_name_space() { return 'http://www.w3.org/1999/xhtml'; }
3026
+ /// Raw child views
2825
3027
  sub() {
2826
3028
  return [];
2827
3029
  }
3030
+ /// Visible sub views with defined ambient context
3031
+ /// Render all by default
2828
3032
  sub_visible() {
2829
3033
  return this.sub();
2830
3034
  }
3035
+ /// Minimal width that used for lazy rendering
2831
3036
  minimal_width() {
2832
3037
  let min = 0;
2833
3038
  try {
@@ -2849,6 +3054,7 @@ var $;
2849
3054
  maximal_width() {
2850
3055
  return this.minimal_width();
2851
3056
  }
3057
+ /// Minimal height that used for lazy rendering
2852
3058
  minimal_height() {
2853
3059
  let min = 0;
2854
3060
  try {
@@ -2868,11 +3074,11 @@ var $;
2868
3074
  view_rect() {
2869
3075
  if ($mol_wire_probe(() => this.view_rect()) === undefined) {
2870
3076
  $mol_wire_watch();
2871
- return null;
3077
+ return null; // don't touch DOM to prevent instant reflow
2872
3078
  }
2873
3079
  else {
2874
3080
  const { width, height, left, right, top, bottom } = this.dom_node().getBoundingClientRect();
2875
- return { width, height, left, right, top, bottom };
3081
+ return { width, height, left, right, top, bottom }; // pick to optimize compare
2876
3082
  }
2877
3083
  }
2878
3084
  dom_id() {
@@ -3062,6 +3268,7 @@ var $;
3062
3268
  [$mol_dev_format_head]() {
3063
3269
  return $mol_dev_format_span({}, $mol_dev_format_native(this));
3064
3270
  }
3271
+ /** Deep search view by predicate. */
3065
3272
  *view_find(check, path = []) {
3066
3273
  if (path.length === 0 && check(this))
3067
3274
  return yield [this];
@@ -3090,6 +3297,7 @@ var $;
3090
3297
  $mol_fail_log(error);
3091
3298
  }
3092
3299
  }
3300
+ /** Renders path of views to DOM. */
3093
3301
  force_render(path) {
3094
3302
  const kids = this.sub();
3095
3303
  const index = kids.findIndex(item => {
@@ -3104,6 +3312,7 @@ var $;
3104
3312
  kids[index].force_render(path);
3105
3313
  }
3106
3314
  }
3315
+ /** Renders view to DOM and scroll to it. */
3107
3316
  ensure_visible(view, align = "start") {
3108
3317
  const path = this.view_find(v => v === view).next().value;
3109
3318
  this.force_render(new Set(path));
@@ -3118,6 +3327,9 @@ var $;
3118
3327
  const win = this.$.$mol_dom_context;
3119
3328
  if (win.parent !== win.self && !win.document.hasFocus())
3120
3329
  return;
3330
+ // new this.$.$mol_after_frame( ()=> {
3331
+ // this.dom_node().scrollIntoView({ block: 'start', inline: 'nearest' })
3332
+ // } )
3121
3333
  new this.$.$mol_after_timeout(0, () => {
3122
3334
  this.focused(true);
3123
3335
  });
@@ -3205,6 +3417,7 @@ var $;
3205
3417
  "use strict";
3206
3418
  var $;
3207
3419
  (function ($) {
3420
+ /** Plugin is component without its own DOM element, but instead uses the owner DOM element */
3208
3421
  class $mol_plugin extends $mol_view {
3209
3422
  dom_node_external(next) {
3210
3423
  return next ?? $mol_owning_get(this).host.dom_node();
@@ -3240,6 +3453,7 @@ var $;
3240
3453
  "use strict";
3241
3454
  var $;
3242
3455
  (function ($) {
3456
+ /** State of time moment */
3243
3457
  class $mol_state_time extends $mol_object {
3244
3458
  static task(precision, reset) {
3245
3459
  if (precision) {
@@ -3266,12 +3480,14 @@ var $;
3266
3480
  ;
3267
3481
  "use strict";
3268
3482
 
3483
+
3269
3484
  ;
3270
3485
  "use strict";
3271
3486
  var $;
3272
3487
  (function ($) {
3273
3488
  var $$;
3274
3489
  (function ($$) {
3490
+ /** Base SVG component to display SVG images or icons. */
3275
3491
  class $mol_svg extends $.$mol_svg {
3276
3492
  computed_style() {
3277
3493
  const win = this.$.$mol_dom_context;
@@ -3331,6 +3547,7 @@ var $;
3331
3547
  ;
3332
3548
  "use strict";
3333
3549
 
3550
+
3334
3551
  ;
3335
3552
  "use strict";
3336
3553
  var $;
@@ -3640,12 +3857,17 @@ var $;
3640
3857
  ;
3641
3858
  "use strict";
3642
3859
 
3860
+
3643
3861
  ;
3644
3862
  "use strict";
3645
3863
  var $;
3646
3864
  (function ($) {
3647
3865
  var $$;
3648
3866
  (function ($$) {
3867
+ /**
3868
+ * Plugin for touch gestures.
3869
+ * @see [mol_plugin](../plugin/readme.md)
3870
+ */
3649
3871
  class $mol_touch extends $.$mol_touch {
3650
3872
  auto() {
3651
3873
  this.pointer_events();
@@ -4129,6 +4351,7 @@ var $;
4129
4351
  ;
4130
4352
  "use strict";
4131
4353
 
4354
+
4132
4355
  ;
4133
4356
  ($.$mol_svg_title) = class $mol_svg_title extends ($.$mol_svg) {
4134
4357
  dom_name(){
@@ -4143,6 +4366,7 @@ var $;
4143
4366
  ;
4144
4367
  "use strict";
4145
4368
 
4369
+
4146
4370
  ;
4147
4371
  ($.$mol_plot_graph) = class $mol_plot_graph extends ($.$mol_svg_group) {
4148
4372
  type(){
@@ -4297,6 +4521,7 @@ var $;
4297
4521
  ;
4298
4522
  "use strict";
4299
4523
 
4524
+
4300
4525
  ;
4301
4526
  "use strict";
4302
4527
  var $;
@@ -4380,12 +4605,17 @@ var $;
4380
4605
  ;
4381
4606
  "use strict";
4382
4607
 
4608
+
4383
4609
  ;
4384
4610
  "use strict";
4385
4611
  var $;
4386
4612
  (function ($) {
4387
4613
  var $$;
4388
4614
  (function ($$) {
4615
+ /**
4616
+ * Fastest plot lib for vector graphics.
4617
+ * @see https://mol.hyoo.ru/#!section=demos/demo=mol_plot_demo
4618
+ */
4389
4619
  class $mol_plot_pane extends $.$mol_plot_pane {
4390
4620
  dimensions() {
4391
4621
  const graphs = this.graphs();
@@ -4625,6 +4855,7 @@ var $;
4625
4855
  ;
4626
4856
  "use strict";
4627
4857
 
4858
+
4628
4859
  ;
4629
4860
  "use strict";
4630
4861
  var $;
@@ -4717,6 +4948,7 @@ var $;
4717
4948
  ;
4718
4949
  "use strict";
4719
4950
 
4951
+
4720
4952
  ;
4721
4953
  "use strict";
4722
4954
  var $;
@@ -4799,6 +5031,7 @@ var $;
4799
5031
  ;
4800
5032
  "use strict";
4801
5033
 
5034
+
4802
5035
  ;
4803
5036
  ($.$mol_plot_dot) = class $mol_plot_dot extends ($.$mol_plot_graph) {
4804
5037
  diameter(){
@@ -4838,6 +5071,7 @@ var $;
4838
5071
  "use strict";
4839
5072
  var $;
4840
5073
  (function ($) {
5074
+ // 00 HHHHH HHHHH HHHHH LLLLL LLLLL LLLLL
4841
5075
  const mask = 0b11111_11111_11111;
4842
5076
  function $mol_coord_pack(high, low) {
4843
5077
  return (high << 17 >>> 2) | (low & mask);
@@ -4856,6 +5090,7 @@ var $;
4856
5090
  ;
4857
5091
  "use strict";
4858
5092
 
5093
+
4859
5094
  ;
4860
5095
  "use strict";
4861
5096
  var $;
@@ -4868,6 +5103,7 @@ var $;
4868
5103
  }
4869
5104
  indexes() {
4870
5105
  const radius = this.diameter() / 2;
5106
+ // calculate by cpu
4871
5107
  const points_max = this.points_max();
4872
5108
  const viewport = this.viewport();
4873
5109
  const viewport_left = viewport.x.min - radius;
@@ -5004,12 +5240,17 @@ var $;
5004
5240
  ;
5005
5241
  "use strict";
5006
5242
 
5243
+
5007
5244
  ;
5008
5245
  "use strict";
5009
5246
  var $;
5010
5247
  (function ($) {
5011
5248
  var $$;
5012
5249
  (function ($$) {
5250
+ /**
5251
+ * Heat map graph.
5252
+ * @see https://mol.hyoo.ru/#!section=demos/demo=mol_plot_map_heat_demo
5253
+ */
5013
5254
  class $mol_plot_map_heat extends $.$mol_plot_map_heat {
5014
5255
  levels() {
5015
5256
  return [...new Set(this.series_z())].sort((a, b) => a - b);
@@ -5106,6 +5347,7 @@ var $;
5106
5347
  ;
5107
5348
  "use strict";
5108
5349
 
5350
+
5109
5351
  ;
5110
5352
  "use strict";
5111
5353
  var $;
@@ -5208,6 +5450,7 @@ var $;
5208
5450
  ;
5209
5451
  "use strict";
5210
5452
 
5453
+
5211
5454
  ;
5212
5455
  "use strict";
5213
5456
  var $;
@@ -5276,6 +5519,7 @@ var $;
5276
5519
  ;
5277
5520
  "use strict";
5278
5521
 
5522
+
5279
5523
  ;
5280
5524
  "use strict";
5281
5525
  var $;
@@ -5338,6 +5582,7 @@ var $;
5338
5582
  ;
5339
5583
  "use strict";
5340
5584
 
5585
+
5341
5586
  ;
5342
5587
  "use strict";
5343
5588
  var $;
@@ -5503,6 +5748,7 @@ var $;
5503
5748
  ;
5504
5749
  "use strict";
5505
5750
 
5751
+
5506
5752
  ;
5507
5753
  "use strict";
5508
5754
  var $;
@@ -5572,6 +5818,7 @@ var $;
5572
5818
  }
5573
5819
  front() {
5574
5820
  return [
5821
+ // this.Background(),
5575
5822
  ...this.labels_formatted(),
5576
5823
  this.Title()
5577
5824
  ];
@@ -5623,6 +5870,7 @@ var $;
5623
5870
  ;
5624
5871
  "use strict";
5625
5872
 
5873
+
5626
5874
  ;
5627
5875
  "use strict";
5628
5876
  var $;
@@ -5698,6 +5946,7 @@ var $;
5698
5946
  ;
5699
5947
  "use strict";
5700
5948
 
5949
+
5701
5950
  ;
5702
5951
  "use strict";
5703
5952
  var $;
@@ -5835,6 +6084,7 @@ var $;
5835
6084
  ;
5836
6085
  "use strict";
5837
6086
 
6087
+
5838
6088
  ;
5839
6089
  "use strict";
5840
6090
  var $;
@@ -5962,6 +6212,7 @@ var $;
5962
6212
  ;
5963
6213
  "use strict";
5964
6214
 
6215
+
5965
6216
  ;
5966
6217
  "use strict";
5967
6218
  var $;
@@ -6074,6 +6325,7 @@ var $;
6074
6325
  ;
6075
6326
  "use strict";
6076
6327
 
6328
+
6077
6329
  ;
6078
6330
  "use strict";
6079
6331
  var $;