mol_wire_lib 1.0.300 → 1.0.301

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
@@ -1377,6 +1377,103 @@ var $;
1377
1377
  ;
1378
1378
  "use strict";
1379
1379
  var $;
1380
+ (function ($_1) {
1381
+ let $$;
1382
+ (function ($$) {
1383
+ let $;
1384
+ })($$ = $_1.$$ || ($_1.$$ = {}));
1385
+ $_1.$mol_object_field = Symbol('$mol_object_field');
1386
+ class $mol_object extends $mol_object2 {
1387
+ static make(config) {
1388
+ return super.create(obj => {
1389
+ for (let key in config)
1390
+ obj[key] = config[key];
1391
+ });
1392
+ }
1393
+ }
1394
+ $_1.$mol_object = $mol_object;
1395
+ })($ || ($ = {}));
1396
+ //mol/object/object.ts
1397
+ ;
1398
+ "use strict";
1399
+ var $;
1400
+ (function ($) {
1401
+ $.$mol_mem = $mol_wire_solo;
1402
+ $.$mol_mem_key = $mol_wire_plex;
1403
+ })($ || ($ = {}));
1404
+ //mol/mem/mem.ts
1405
+ ;
1406
+ "use strict";
1407
+ var $;
1408
+ (function ($) {
1409
+ class $mol_after_timeout extends $mol_object2 {
1410
+ delay;
1411
+ task;
1412
+ id;
1413
+ constructor(delay, task) {
1414
+ super();
1415
+ this.delay = delay;
1416
+ this.task = task;
1417
+ this.id = setTimeout(task, delay);
1418
+ }
1419
+ destructor() {
1420
+ clearTimeout(this.id);
1421
+ }
1422
+ }
1423
+ $.$mol_after_timeout = $mol_after_timeout;
1424
+ })($ || ($ = {}));
1425
+ //mol/after/timeout/timeout.ts
1426
+ ;
1427
+ "use strict";
1428
+ var $;
1429
+ (function ($) {
1430
+ class $mol_state_time extends $mol_object {
1431
+ static task(precision, reset) {
1432
+ if (precision) {
1433
+ return new $mol_after_timeout(precision, () => this.task(precision, null));
1434
+ }
1435
+ else {
1436
+ return new $mol_after_frame(() => this.task(precision, null));
1437
+ }
1438
+ }
1439
+ static now(precision) {
1440
+ this.task(precision);
1441
+ return Date.now();
1442
+ }
1443
+ }
1444
+ __decorate([
1445
+ $mol_mem_key
1446
+ ], $mol_state_time, "task", null);
1447
+ __decorate([
1448
+ $mol_mem_key
1449
+ ], $mol_state_time, "now", null);
1450
+ $.$mol_state_time = $mol_state_time;
1451
+ })($ || ($ = {}));
1452
+ //mol/state/time/time.ts
1453
+ ;
1454
+ "use strict";
1455
+ var $;
1456
+ (function ($) {
1457
+ function $mol_wire_easing(next) {
1458
+ const atom = $mol_wire_auto();
1459
+ if (!(atom instanceof $mol_wire_atom))
1460
+ $mol_fail(new Error('Allowed only inside atom'));
1461
+ const prev = atom.result() ?? next;
1462
+ if (typeof prev !== 'number')
1463
+ return next;
1464
+ const current = (prev * 2 + next) / 3;
1465
+ const diff = Math.abs(current - next);
1466
+ if (diff < 1)
1467
+ return next;
1468
+ $mol_state_time.now(0);
1469
+ return current;
1470
+ }
1471
+ $.$mol_wire_easing = $mol_wire_easing;
1472
+ })($ || ($ = {}));
1473
+ //mol/wire/easing/easing.ts
1474
+ ;
1475
+ "use strict";
1476
+ var $;
1380
1477
  (function ($) {
1381
1478
  function $mol_wire_patch(obj) {
1382
1479
  for (const field of Reflect.ownKeys(obj)) {
@@ -1564,27 +1661,6 @@ var $;
1564
1661
  ;
1565
1662
  "use strict";
1566
1663
  var $;
1567
- (function ($) {
1568
- class $mol_after_timeout extends $mol_object2 {
1569
- delay;
1570
- task;
1571
- id;
1572
- constructor(delay, task) {
1573
- super();
1574
- this.delay = delay;
1575
- this.task = task;
1576
- this.id = setTimeout(task, delay);
1577
- }
1578
- destructor() {
1579
- clearTimeout(this.id);
1580
- }
1581
- }
1582
- $.$mol_after_timeout = $mol_after_timeout;
1583
- })($ || ($ = {}));
1584
- //mol/after/timeout/timeout.ts
1585
- ;
1586
- "use strict";
1587
- var $;
1588
1664
  (function ($) {
1589
1665
  function $mol_wait_timeout_async(timeout) {
1590
1666
  const promise = $mol_promise();
@@ -1603,14 +1679,6 @@ var $;
1603
1679
  ;
1604
1680
  "use strict";
1605
1681
  var $;
1606
- (function ($) {
1607
- $.$mol_mem = $mol_wire_solo;
1608
- $.$mol_mem_key = $mol_wire_plex;
1609
- })($ || ($ = {}));
1610
- //mol/mem/mem.ts
1611
- ;
1612
- "use strict";
1613
- var $;
1614
1682
  (function ($) {
1615
1683
  function $mol_log3_area_lazy(event) {
1616
1684
  const self = this;