mol_jsx_lib 0.0.166 → 0.0.167

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