mol_jsx_lib 0.0.128 → 0.0.129

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
@@ -1660,6 +1660,95 @@ var $;
1660
1660
  ;
1661
1661
  "use strict";
1662
1662
  var $;
1663
+ (function ($_1) {
1664
+ let $$;
1665
+ (function ($$) {
1666
+ let $;
1667
+ })($$ = $_1.$$ || ($_1.$$ = {}));
1668
+ $_1.$mol_object_field = Symbol('$mol_object_field');
1669
+ class $mol_object extends $mol_object2 {
1670
+ static make(config) {
1671
+ return super.create(obj => {
1672
+ for (let key in config)
1673
+ obj[key] = config[key];
1674
+ });
1675
+ }
1676
+ }
1677
+ $_1.$mol_object = $mol_object;
1678
+ })($ || ($ = {}));
1679
+ //mol/object/object.ts
1680
+ ;
1681
+ "use strict";
1682
+ var $;
1683
+ (function ($) {
1684
+ class $mol_after_timeout extends $mol_object2 {
1685
+ delay;
1686
+ task;
1687
+ id;
1688
+ constructor(delay, task) {
1689
+ super();
1690
+ this.delay = delay;
1691
+ this.task = task;
1692
+ this.id = setTimeout(task, delay);
1693
+ }
1694
+ destructor() {
1695
+ clearTimeout(this.id);
1696
+ }
1697
+ }
1698
+ $.$mol_after_timeout = $mol_after_timeout;
1699
+ })($ || ($ = {}));
1700
+ //mol/after/timeout/timeout.ts
1701
+ ;
1702
+ "use strict";
1703
+ var $;
1704
+ (function ($) {
1705
+ class $mol_state_time extends $mol_object {
1706
+ static task(precision, reset) {
1707
+ if (precision) {
1708
+ return new $mol_after_timeout(precision, () => this.task(precision, null));
1709
+ }
1710
+ else {
1711
+ return new $mol_after_frame(() => this.task(precision, null));
1712
+ }
1713
+ }
1714
+ static now(precision) {
1715
+ this.task(precision);
1716
+ return Date.now();
1717
+ }
1718
+ }
1719
+ __decorate([
1720
+ $mol_mem_key
1721
+ ], $mol_state_time, "task", null);
1722
+ __decorate([
1723
+ $mol_mem_key
1724
+ ], $mol_state_time, "now", null);
1725
+ $.$mol_state_time = $mol_state_time;
1726
+ })($ || ($ = {}));
1727
+ //mol/state/time/time.ts
1728
+ ;
1729
+ "use strict";
1730
+ var $;
1731
+ (function ($) {
1732
+ function $mol_wire_trans(next) {
1733
+ const atom = $mol_wire_auto();
1734
+ if (!(atom instanceof $mol_wire_atom))
1735
+ $mol_fail(new Error('Allowed only inside atom'));
1736
+ const prev = atom.result() ?? next;
1737
+ if (typeof prev !== 'number')
1738
+ return next;
1739
+ const current = (prev * 2 + next) / 3;
1740
+ const diff = Math.abs(current - next);
1741
+ if (diff < 1)
1742
+ return next;
1743
+ $mol_state_time.now(0);
1744
+ return current;
1745
+ }
1746
+ $.$mol_wire_trans = $mol_wire_trans;
1747
+ })($ || ($ = {}));
1748
+ //mol/wire/trans/trans.ts
1749
+ ;
1750
+ "use strict";
1751
+ var $;
1663
1752
  (function ($) {
1664
1753
  function $mol_wire_patch(obj) {
1665
1754
  for (const field of Reflect.ownKeys(obj)) {
@@ -1847,27 +1936,6 @@ var $;
1847
1936
  ;
1848
1937
  "use strict";
1849
1938
  var $;
1850
- (function ($) {
1851
- class $mol_after_timeout extends $mol_object2 {
1852
- delay;
1853
- task;
1854
- id;
1855
- constructor(delay, task) {
1856
- super();
1857
- this.delay = delay;
1858
- this.task = task;
1859
- this.id = setTimeout(task, delay);
1860
- }
1861
- destructor() {
1862
- clearTimeout(this.id);
1863
- }
1864
- }
1865
- $.$mol_after_timeout = $mol_after_timeout;
1866
- })($ || ($ = {}));
1867
- //mol/after/timeout/timeout.ts
1868
- ;
1869
- "use strict";
1870
- var $;
1871
1939
  (function ($) {
1872
1940
  function $mol_wait_timeout_async(timeout) {
1873
1941
  const promise = $mol_promise();