@mulsense/xnew 0.1.4 → 0.1.5

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/dist/xnew.js CHANGED
@@ -502,7 +502,7 @@
502
502
  this._.systems[type].push(listener);
503
503
  }
504
504
  if (this._.listeners1.has(type, listener) === false) {
505
- const execute = Unit.wrap(this, listener);
505
+ const execute = Unit.wrap(Unit.current, listener);
506
506
  this._.listeners1.set(type, listener, [this.element, execute]);
507
507
  Unit.typeUnits.add(type, this);
508
508
  if (/^[A-Za-z]/.test(type)) {
@@ -577,9 +577,11 @@
577
577
  // event
578
578
  //----------------------------------------------------------------------------------------------------
579
579
  Unit.typeUnits = new MapSet();
580
- Unit.reset();
581
580
 
582
581
  const xnew$1 = function (...args) {
582
+ if (Unit.root === null) {
583
+ Unit.reset();
584
+ }
583
585
  let target;
584
586
  if (args[0] instanceof HTMLElement || args[0] instanceof SVGElement) {
585
587
  target = args.shift(); // an existing html element
package/dist/xnew.mjs CHANGED
@@ -496,7 +496,7 @@ class Unit {
496
496
  this._.systems[type].push(listener);
497
497
  }
498
498
  if (this._.listeners1.has(type, listener) === false) {
499
- const execute = Unit.wrap(this, listener);
499
+ const execute = Unit.wrap(Unit.current, listener);
500
500
  this._.listeners1.set(type, listener, [this.element, execute]);
501
501
  Unit.typeUnits.add(type, this);
502
502
  if (/^[A-Za-z]/.test(type)) {
@@ -571,9 +571,11 @@ Unit.componentUnits = new MapSet();
571
571
  // event
572
572
  //----------------------------------------------------------------------------------------------------
573
573
  Unit.typeUnits = new MapSet();
574
- Unit.reset();
575
574
 
576
575
  const xnew$1 = function (...args) {
576
+ if (Unit.root === null) {
577
+ Unit.reset();
578
+ }
577
579
  let target;
578
580
  if (args[0] instanceof HTMLElement || args[0] instanceof SVGElement) {
579
581
  target = args.shift(); // an existing html element
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "keywords": [
5
5
  "Component-Oriented Programming"
6
6
  ],
7
- "version": "0.1.4",
7
+ "version": "0.1.5",
8
8
  "main": "dist/xnew.js",
9
9
  "module": "dist/xnew.mjs",
10
10
  "types": "dist/xnew.d.ts",