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/node.js CHANGED
@@ -2147,6 +2147,19 @@ var $;
2147
2147
  ;
2148
2148
  "use strict";
2149
2149
  var $;
2150
+ (function ($) {
2151
+ function $mol_const(value) {
2152
+ const getter = (() => value);
2153
+ getter['()'] = value;
2154
+ getter[Symbol.toStringTag] = value;
2155
+ return getter;
2156
+ }
2157
+ $.$mol_const = $mol_const;
2158
+ })($ || ($ = {}));
2159
+ //mol/const/const.ts
2160
+ ;
2161
+ "use strict";
2162
+ var $;
2150
2163
  (function ($) {
2151
2164
  function $mol_wire_solid() {
2152
2165
  const current = $mol_wire_auto();
@@ -2163,19 +2176,6 @@ var $;
2163
2176
  ;
2164
2177
  "use strict";
2165
2178
  var $;
2166
- (function ($) {
2167
- function $mol_const(value) {
2168
- const getter = (() => value);
2169
- getter['()'] = value;
2170
- getter[Symbol.toStringTag] = value;
2171
- return getter;
2172
- }
2173
- $.$mol_const = $mol_const;
2174
- })($ || ($ = {}));
2175
- //mol/const/const.ts
2176
- ;
2177
- "use strict";
2178
- var $;
2179
2179
  (function ($) {
2180
2180
  function $mol_dom_render_attributes(el, attrs) {
2181
2181
  for (let name in attrs) {
@@ -2199,36 +2199,6 @@ var $;
2199
2199
  ;
2200
2200
  "use strict";
2201
2201
  var $;
2202
- (function ($) {
2203
- function $mol_wire_async(obj) {
2204
- let fiber;
2205
- const temp = $mol_wire_task.getter(obj);
2206
- return new Proxy(obj, {
2207
- get(obj, field) {
2208
- const val = obj[field];
2209
- if (typeof val !== 'function')
2210
- return val;
2211
- let fiber;
2212
- const temp = $mol_wire_task.getter(val);
2213
- return function $mol_wire_async(...args) {
2214
- fiber?.destructor();
2215
- fiber = temp(obj, args);
2216
- return fiber.async();
2217
- };
2218
- },
2219
- apply(obj, self, args) {
2220
- fiber?.destructor();
2221
- fiber = temp(self, args);
2222
- return fiber.async();
2223
- },
2224
- });
2225
- }
2226
- $.$mol_wire_async = $mol_wire_async;
2227
- })($ || ($ = {}));
2228
- //mol/wire/async/async.ts
2229
- ;
2230
- "use strict";
2231
- var $;
2232
2202
  (function ($) {
2233
2203
  function $mol_dom_render_events(el, events, passive = false) {
2234
2204
  for (let name in events) {
@@ -2330,6 +2300,36 @@ var $;
2330
2300
  //mol/dom/render/fields/fields.ts
2331
2301
  ;
2332
2302
  "use strict";
2303
+ var $;
2304
+ (function ($) {
2305
+ function $mol_wire_async(obj) {
2306
+ let fiber;
2307
+ const temp = $mol_wire_task.getter(obj);
2308
+ return new Proxy(obj, {
2309
+ get(obj, field) {
2310
+ const val = obj[field];
2311
+ if (typeof val !== 'function')
2312
+ return val;
2313
+ let fiber;
2314
+ const temp = $mol_wire_task.getter(val);
2315
+ return function $mol_wire_async(...args) {
2316
+ fiber?.destructor();
2317
+ fiber = temp(obj, args);
2318
+ return fiber.async();
2319
+ };
2320
+ },
2321
+ apply(obj, self, args) {
2322
+ fiber?.destructor();
2323
+ fiber = temp(self, args);
2324
+ return fiber.async();
2325
+ },
2326
+ });
2327
+ }
2328
+ $.$mol_wire_async = $mol_wire_async;
2329
+ })($ || ($ = {}));
2330
+ //mol/wire/async/async.ts
2331
+ ;
2332
+ "use strict";
2333
2333
  //mol/type/keys/extract/extract.ts
2334
2334
  ;
2335
2335
  "use strict";
@@ -2695,14 +2695,18 @@ var $;
2695
2695
  dom_id() {
2696
2696
  return this.toString();
2697
2697
  }
2698
- dom_node(next) {
2699
- $mol_wire_solid();
2700
- const node = next || $mol_dom_context.document.createElementNS(this.dom_name_space(), this.dom_name());
2698
+ dom_node_external(next) {
2699
+ const node = next ?? $mol_dom_context.document.createElementNS(this.dom_name_space(), this.dom_name());
2701
2700
  const id = this.dom_id();
2702
2701
  node.setAttribute('id', id);
2703
2702
  node.toString = $mol_const('<#' + id + '>');
2703
+ return node;
2704
+ }
2705
+ dom_node(next) {
2706
+ $mol_wire_solid();
2707
+ const node = this.dom_node_external(next);
2704
2708
  $mol_dom_render_attributes(node, this.attr_static());
2705
- const events = $mol_wire_async(this.event());
2709
+ const events = this.event_async();
2706
2710
  $mol_dom_render_events(node, events);
2707
2711
  return node;
2708
2712
  }
@@ -2875,6 +2879,9 @@ var $;
2875
2879
  event() {
2876
2880
  return {};
2877
2881
  }
2882
+ event_async() {
2883
+ return { ...$mol_wire_async(this.event()) };
2884
+ }
2878
2885
  plugins() {
2879
2886
  return [];
2880
2887
  }
@@ -2931,6 +2938,17 @@ var $;
2931
2938
  this.focused(true);
2932
2939
  });
2933
2940
  }
2941
+ destructor() {
2942
+ const node = $mol_wire_probe(() => this.dom_node());
2943
+ if (!node)
2944
+ return;
2945
+ const events = $mol_wire_probe(() => this.event_async());
2946
+ if (!events)
2947
+ return;
2948
+ for (let event_name in events) {
2949
+ node.removeEventListener(event_name, events[event_name]);
2950
+ }
2951
+ }
2934
2952
  }
2935
2953
  __decorate([
2936
2954
  $mol_mem
@@ -2977,6 +2995,9 @@ var $;
2977
2995
  __decorate([
2978
2996
  $mol_mem
2979
2997
  ], $mol_view.prototype, "theme", null);
2998
+ __decorate([
2999
+ $mol_mem
3000
+ ], $mol_view.prototype, "event_async", null);
2980
3001
  __decorate([
2981
3002
  $mol_mem_key
2982
3003
  ], $mol_view, "Root", null);
@@ -3001,28 +3022,17 @@ var $;
3001
3022
  var $;
3002
3023
  (function ($) {
3003
3024
  class $mol_plugin extends $mol_view {
3004
- dom_node(next) {
3005
- const node = next || $mol_owning_get(this).host.dom_node();
3006
- $mol_dom_render_attributes(node, this.attr_static());
3007
- const events = $mol_wire_async(this.event());
3008
- for (let event_name in events) {
3009
- node.addEventListener(event_name, events[event_name], { passive: false });
3010
- }
3011
- return node;
3025
+ dom_node_external(next) {
3026
+ const host = $mol_owning_get(this).host;
3027
+ return next ?? host.dom_node();
3012
3028
  }
3013
3029
  attr_static() {
3014
3030
  return {};
3015
3031
  }
3016
- event() {
3017
- return {};
3018
- }
3019
3032
  render() {
3020
3033
  this.dom_node_actual();
3021
3034
  }
3022
3035
  }
3023
- __decorate([
3024
- $mol_mem
3025
- ], $mol_plugin.prototype, "dom_node", null);
3026
3036
  $.$mol_plugin = $mol_plugin;
3027
3037
  })($ || ($ = {}));
3028
3038
  //mol/plugin/plugin.ts