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.mjs 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
package/node.test.js CHANGED
@@ -2139,6 +2139,19 @@ var $;
2139
2139
  ;
2140
2140
  "use strict";
2141
2141
  var $;
2142
+ (function ($) {
2143
+ function $mol_const(value) {
2144
+ const getter = (() => value);
2145
+ getter['()'] = value;
2146
+ getter[Symbol.toStringTag] = value;
2147
+ return getter;
2148
+ }
2149
+ $.$mol_const = $mol_const;
2150
+ })($ || ($ = {}));
2151
+ //mol/const/const.ts
2152
+ ;
2153
+ "use strict";
2154
+ var $;
2142
2155
  (function ($) {
2143
2156
  function $mol_wire_solid() {
2144
2157
  const current = $mol_wire_auto();
@@ -2155,19 +2168,6 @@ var $;
2155
2168
  ;
2156
2169
  "use strict";
2157
2170
  var $;
2158
- (function ($) {
2159
- function $mol_const(value) {
2160
- const getter = (() => value);
2161
- getter['()'] = value;
2162
- getter[Symbol.toStringTag] = value;
2163
- return getter;
2164
- }
2165
- $.$mol_const = $mol_const;
2166
- })($ || ($ = {}));
2167
- //mol/const/const.ts
2168
- ;
2169
- "use strict";
2170
- var $;
2171
2171
  (function ($) {
2172
2172
  function $mol_dom_render_attributes(el, attrs) {
2173
2173
  for (let name in attrs) {
@@ -2191,36 +2191,6 @@ var $;
2191
2191
  ;
2192
2192
  "use strict";
2193
2193
  var $;
2194
- (function ($) {
2195
- function $mol_wire_async(obj) {
2196
- let fiber;
2197
- const temp = $mol_wire_task.getter(obj);
2198
- return new Proxy(obj, {
2199
- get(obj, field) {
2200
- const val = obj[field];
2201
- if (typeof val !== 'function')
2202
- return val;
2203
- let fiber;
2204
- const temp = $mol_wire_task.getter(val);
2205
- return function $mol_wire_async(...args) {
2206
- fiber?.destructor();
2207
- fiber = temp(obj, args);
2208
- return fiber.async();
2209
- };
2210
- },
2211
- apply(obj, self, args) {
2212
- fiber?.destructor();
2213
- fiber = temp(self, args);
2214
- return fiber.async();
2215
- },
2216
- });
2217
- }
2218
- $.$mol_wire_async = $mol_wire_async;
2219
- })($ || ($ = {}));
2220
- //mol/wire/async/async.ts
2221
- ;
2222
- "use strict";
2223
- var $;
2224
2194
  (function ($) {
2225
2195
  function $mol_dom_render_events(el, events, passive = false) {
2226
2196
  for (let name in events) {
@@ -2322,6 +2292,36 @@ var $;
2322
2292
  //mol/dom/render/fields/fields.ts
2323
2293
  ;
2324
2294
  "use strict";
2295
+ var $;
2296
+ (function ($) {
2297
+ function $mol_wire_async(obj) {
2298
+ let fiber;
2299
+ const temp = $mol_wire_task.getter(obj);
2300
+ return new Proxy(obj, {
2301
+ get(obj, field) {
2302
+ const val = obj[field];
2303
+ if (typeof val !== 'function')
2304
+ return val;
2305
+ let fiber;
2306
+ const temp = $mol_wire_task.getter(val);
2307
+ return function $mol_wire_async(...args) {
2308
+ fiber?.destructor();
2309
+ fiber = temp(obj, args);
2310
+ return fiber.async();
2311
+ };
2312
+ },
2313
+ apply(obj, self, args) {
2314
+ fiber?.destructor();
2315
+ fiber = temp(self, args);
2316
+ return fiber.async();
2317
+ },
2318
+ });
2319
+ }
2320
+ $.$mol_wire_async = $mol_wire_async;
2321
+ })($ || ($ = {}));
2322
+ //mol/wire/async/async.ts
2323
+ ;
2324
+ "use strict";
2325
2325
  //mol/type/keys/extract/extract.ts
2326
2326
  ;
2327
2327
  "use strict";
@@ -2687,14 +2687,18 @@ var $;
2687
2687
  dom_id() {
2688
2688
  return this.toString();
2689
2689
  }
2690
- dom_node(next) {
2691
- $mol_wire_solid();
2692
- const node = next || $mol_dom_context.document.createElementNS(this.dom_name_space(), this.dom_name());
2690
+ dom_node_external(next) {
2691
+ const node = next ?? $mol_dom_context.document.createElementNS(this.dom_name_space(), this.dom_name());
2693
2692
  const id = this.dom_id();
2694
2693
  node.setAttribute('id', id);
2695
2694
  node.toString = $mol_const('<#' + id + '>');
2695
+ return node;
2696
+ }
2697
+ dom_node(next) {
2698
+ $mol_wire_solid();
2699
+ const node = this.dom_node_external(next);
2696
2700
  $mol_dom_render_attributes(node, this.attr_static());
2697
- const events = $mol_wire_async(this.event());
2701
+ const events = this.event_async();
2698
2702
  $mol_dom_render_events(node, events);
2699
2703
  return node;
2700
2704
  }
@@ -2867,6 +2871,9 @@ var $;
2867
2871
  event() {
2868
2872
  return {};
2869
2873
  }
2874
+ event_async() {
2875
+ return { ...$mol_wire_async(this.event()) };
2876
+ }
2870
2877
  plugins() {
2871
2878
  return [];
2872
2879
  }
@@ -2923,6 +2930,17 @@ var $;
2923
2930
  this.focused(true);
2924
2931
  });
2925
2932
  }
2933
+ destructor() {
2934
+ const node = $mol_wire_probe(() => this.dom_node());
2935
+ if (!node)
2936
+ return;
2937
+ const events = $mol_wire_probe(() => this.event_async());
2938
+ if (!events)
2939
+ return;
2940
+ for (let event_name in events) {
2941
+ node.removeEventListener(event_name, events[event_name]);
2942
+ }
2943
+ }
2926
2944
  }
2927
2945
  __decorate([
2928
2946
  $mol_mem
@@ -2969,6 +2987,9 @@ var $;
2969
2987
  __decorate([
2970
2988
  $mol_mem
2971
2989
  ], $mol_view.prototype, "theme", null);
2990
+ __decorate([
2991
+ $mol_mem
2992
+ ], $mol_view.prototype, "event_async", null);
2972
2993
  __decorate([
2973
2994
  $mol_mem_key
2974
2995
  ], $mol_view, "Root", null);
@@ -2993,28 +3014,17 @@ var $;
2993
3014
  var $;
2994
3015
  (function ($) {
2995
3016
  class $mol_plugin extends $mol_view {
2996
- dom_node(next) {
2997
- const node = next || $mol_owning_get(this).host.dom_node();
2998
- $mol_dom_render_attributes(node, this.attr_static());
2999
- const events = $mol_wire_async(this.event());
3000
- for (let event_name in events) {
3001
- node.addEventListener(event_name, events[event_name], { passive: false });
3002
- }
3003
- return node;
3017
+ dom_node_external(next) {
3018
+ const host = $mol_owning_get(this).host;
3019
+ return next ?? host.dom_node();
3004
3020
  }
3005
3021
  attr_static() {
3006
3022
  return {};
3007
3023
  }
3008
- event() {
3009
- return {};
3010
- }
3011
3024
  render() {
3012
3025
  this.dom_node_actual();
3013
3026
  }
3014
3027
  }
3015
- __decorate([
3016
- $mol_mem
3017
- ], $mol_plugin.prototype, "dom_node", null);
3018
3028
  $.$mol_plugin = $mol_plugin;
3019
3029
  })($ || ($ = {}));
3020
3030
  //mol/plugin/plugin.ts