mol_plot_all 1.2.741 → 1.2.742

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
@@ -1580,6 +1580,19 @@ var $;
1580
1580
  ;
1581
1581
  "use strict";
1582
1582
  var $;
1583
+ (function ($) {
1584
+ function $mol_const(value) {
1585
+ const getter = (() => value);
1586
+ getter['()'] = value;
1587
+ getter[Symbol.toStringTag] = value;
1588
+ return getter;
1589
+ }
1590
+ $.$mol_const = $mol_const;
1591
+ })($ || ($ = {}));
1592
+ //mol/const/const.ts
1593
+ ;
1594
+ "use strict";
1595
+ var $;
1583
1596
  (function ($) {
1584
1597
  function $mol_wire_solid() {
1585
1598
  const current = $mol_wire_auto();
@@ -1596,19 +1609,6 @@ var $;
1596
1609
  ;
1597
1610
  "use strict";
1598
1611
  var $;
1599
- (function ($) {
1600
- function $mol_const(value) {
1601
- const getter = (() => value);
1602
- getter['()'] = value;
1603
- getter[Symbol.toStringTag] = value;
1604
- return getter;
1605
- }
1606
- $.$mol_const = $mol_const;
1607
- })($ || ($ = {}));
1608
- //mol/const/const.ts
1609
- ;
1610
- "use strict";
1611
- var $;
1612
1612
  (function ($) {
1613
1613
  function $mol_dom_render_attributes(el, attrs) {
1614
1614
  for (let name in attrs) {
@@ -1632,36 +1632,6 @@ var $;
1632
1632
  ;
1633
1633
  "use strict";
1634
1634
  var $;
1635
- (function ($) {
1636
- function $mol_wire_async(obj) {
1637
- let fiber;
1638
- const temp = $mol_wire_task.getter(obj);
1639
- return new Proxy(obj, {
1640
- get(obj, field) {
1641
- const val = obj[field];
1642
- if (typeof val !== 'function')
1643
- return val;
1644
- let fiber;
1645
- const temp = $mol_wire_task.getter(val);
1646
- return function $mol_wire_async(...args) {
1647
- fiber?.destructor();
1648
- fiber = temp(obj, args);
1649
- return fiber.async();
1650
- };
1651
- },
1652
- apply(obj, self, args) {
1653
- fiber?.destructor();
1654
- fiber = temp(self, args);
1655
- return fiber.async();
1656
- },
1657
- });
1658
- }
1659
- $.$mol_wire_async = $mol_wire_async;
1660
- })($ || ($ = {}));
1661
- //mol/wire/async/async.ts
1662
- ;
1663
- "use strict";
1664
- var $;
1665
1635
  (function ($) {
1666
1636
  function $mol_dom_render_events(el, events, passive = false) {
1667
1637
  for (let name in events) {
@@ -1763,6 +1733,36 @@ var $;
1763
1733
  //mol/dom/render/fields/fields.ts
1764
1734
  ;
1765
1735
  "use strict";
1736
+ var $;
1737
+ (function ($) {
1738
+ function $mol_wire_async(obj) {
1739
+ let fiber;
1740
+ const temp = $mol_wire_task.getter(obj);
1741
+ return new Proxy(obj, {
1742
+ get(obj, field) {
1743
+ const val = obj[field];
1744
+ if (typeof val !== 'function')
1745
+ return val;
1746
+ let fiber;
1747
+ const temp = $mol_wire_task.getter(val);
1748
+ return function $mol_wire_async(...args) {
1749
+ fiber?.destructor();
1750
+ fiber = temp(obj, args);
1751
+ return fiber.async();
1752
+ };
1753
+ },
1754
+ apply(obj, self, args) {
1755
+ fiber?.destructor();
1756
+ fiber = temp(self, args);
1757
+ return fiber.async();
1758
+ },
1759
+ });
1760
+ }
1761
+ $.$mol_wire_async = $mol_wire_async;
1762
+ })($ || ($ = {}));
1763
+ //mol/wire/async/async.ts
1764
+ ;
1765
+ "use strict";
1766
1766
  //mol/type/keys/extract/extract.ts
1767
1767
  ;
1768
1768
  "use strict";
@@ -2128,14 +2128,18 @@ var $;
2128
2128
  dom_id() {
2129
2129
  return this.toString();
2130
2130
  }
2131
- dom_node(next) {
2132
- $mol_wire_solid();
2133
- const node = next || $mol_dom_context.document.createElementNS(this.dom_name_space(), this.dom_name());
2131
+ dom_node_external(next) {
2132
+ const node = next ?? $mol_dom_context.document.createElementNS(this.dom_name_space(), this.dom_name());
2134
2133
  const id = this.dom_id();
2135
2134
  node.setAttribute('id', id);
2136
2135
  node.toString = $mol_const('<#' + id + '>');
2136
+ return node;
2137
+ }
2138
+ dom_node(next) {
2139
+ $mol_wire_solid();
2140
+ const node = this.dom_node_external(next);
2137
2141
  $mol_dom_render_attributes(node, this.attr_static());
2138
- const events = $mol_wire_async(this.event());
2142
+ const events = this.event_async();
2139
2143
  $mol_dom_render_events(node, events);
2140
2144
  return node;
2141
2145
  }
@@ -2308,6 +2312,9 @@ var $;
2308
2312
  event() {
2309
2313
  return {};
2310
2314
  }
2315
+ event_async() {
2316
+ return { ...$mol_wire_async(this.event()) };
2317
+ }
2311
2318
  plugins() {
2312
2319
  return [];
2313
2320
  }
@@ -2364,6 +2371,17 @@ var $;
2364
2371
  this.focused(true);
2365
2372
  });
2366
2373
  }
2374
+ destructor() {
2375
+ const node = $mol_wire_probe(() => this.dom_node());
2376
+ if (!node)
2377
+ return;
2378
+ const events = $mol_wire_probe(() => this.event_async());
2379
+ if (!events)
2380
+ return;
2381
+ for (let event_name in events) {
2382
+ node.removeEventListener(event_name, events[event_name]);
2383
+ }
2384
+ }
2367
2385
  }
2368
2386
  __decorate([
2369
2387
  $mol_mem
@@ -2410,6 +2428,9 @@ var $;
2410
2428
  __decorate([
2411
2429
  $mol_mem
2412
2430
  ], $mol_view.prototype, "theme", null);
2431
+ __decorate([
2432
+ $mol_mem
2433
+ ], $mol_view.prototype, "event_async", null);
2413
2434
  __decorate([
2414
2435
  $mol_mem_key
2415
2436
  ], $mol_view, "Root", null);
@@ -2441,28 +2462,17 @@ var $;
2441
2462
  var $;
2442
2463
  (function ($) {
2443
2464
  class $mol_plugin extends $mol_view {
2444
- dom_node(next) {
2445
- const node = next || $mol_owning_get(this).host.dom_node();
2446
- $mol_dom_render_attributes(node, this.attr_static());
2447
- const events = $mol_wire_async(this.event());
2448
- for (let event_name in events) {
2449
- node.addEventListener(event_name, events[event_name], { passive: false });
2450
- }
2451
- return node;
2465
+ dom_node_external(next) {
2466
+ const host = $mol_owning_get(this).host;
2467
+ return next ?? host.dom_node();
2452
2468
  }
2453
2469
  attr_static() {
2454
2470
  return {};
2455
2471
  }
2456
- event() {
2457
- return {};
2458
- }
2459
2472
  render() {
2460
2473
  this.dom_node_actual();
2461
2474
  }
2462
2475
  }
2463
- __decorate([
2464
- $mol_mem
2465
- ], $mol_plugin.prototype, "dom_node", null);
2466
2476
  $.$mol_plugin = $mol_plugin;
2467
2477
  })($ || ($ = {}));
2468
2478
  //mol/plugin/plugin.ts