@zyzgroup/core-web 0.1.9 → 0.1.10

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.
Files changed (107) hide show
  1. package/dist/zyzgroup_core_web.iife.js +4 -4
  2. package/dist/zyzgroup_core_web.iife.js.map +1 -1
  3. package/dist/zyzgroup_core_web.js +14 -12
  4. package/dist/zyzgroup_core_web.js.map +1 -1
  5. package/dist/zyzgroup_core_web.umd.cjs +4 -4
  6. package/dist/zyzgroup_core_web.umd.cjs.map +1 -1
  7. package/package.json +1 -1
  8. package/types/dom/DOMEventBus.d.ts +4 -4
  9. package/types/dom/DOMEventBus.d.ts.map +1 -1
  10. package/types/dom/DOMParse.d.ts +2 -2
  11. package/types/dom/DOMParse.d.ts.map +1 -1
  12. package/types/math/Shape.d.ts +2 -2
  13. package/types/math/Shape.d.ts.map +1 -1
  14. package/types/math/core/Box2.d.ts.map +1 -0
  15. package/types/math/{math/math → core}/Box3.d.ts +2 -2
  16. package/types/math/core/Box3.d.ts.map +1 -0
  17. package/types/math/{math/core → core}/BufferAttribute.d.ts +2 -2
  18. package/types/math/core/BufferAttribute.d.ts.map +1 -0
  19. package/types/math/core/Color.d.ts.map +1 -0
  20. package/types/math/core/ColorManagement.d.ts.map +1 -0
  21. package/types/math/core/Cylindrical.d.ts.map +1 -0
  22. package/types/math/core/Euler.d.ts.map +1 -0
  23. package/types/math/{math/math → core}/Frustum.d.ts +1 -1
  24. package/types/math/core/Frustum.d.ts.map +1 -0
  25. package/types/math/core/Layers.d.ts.map +1 -0
  26. package/types/math/core/Line3.d.ts.map +1 -0
  27. package/types/math/core/Matrix.d.ts.map +1 -0
  28. package/types/math/core/Matrix2.d.ts.map +1 -0
  29. package/types/math/core/Matrix3.d.ts.map +1 -0
  30. package/types/math/core/Matrix4.d.ts.map +1 -0
  31. package/types/math/{math/core → core}/Object3D.d.ts +10 -7
  32. package/types/math/core/Object3D.d.ts.map +1 -0
  33. package/types/math/core/Plane.d.ts.map +1 -0
  34. package/types/math/core/Quaternion.d.ts.map +1 -0
  35. package/types/math/core/Ray.d.ts.map +1 -0
  36. package/types/math/core/Sphere.d.ts.map +1 -0
  37. package/types/math/core/Spherical.d.ts.map +1 -0
  38. package/types/math/core/SphericalHarmonics3.d.ts.map +1 -0
  39. package/types/math/core/Triangle.d.ts.map +1 -0
  40. package/types/math/core/Vector.d.ts.map +1 -0
  41. package/types/math/{math/math → core}/Vector2.d.ts +1 -1
  42. package/types/math/core/Vector2.d.ts.map +1 -0
  43. package/types/math/{math/math → core}/Vector3.d.ts +1 -1
  44. package/types/math/core/Vector3.d.ts.map +1 -0
  45. package/types/math/core/Vector4.d.ts.map +1 -0
  46. package/types/math/{math → core}/constants.d.ts.map +1 -1
  47. package/types/math/core/index.d.ts +9 -0
  48. package/types/math/core/index.d.ts.map +1 -0
  49. package/types/math/index.d.ts +1 -1
  50. package/types/math/index.d.ts.map +1 -1
  51. package/types/math/math/cameras/Camera.d.ts +0 -11
  52. package/types/math/math/cameras/Camera.d.ts.map +1 -1
  53. package/types/math/math/controls/Controls.d.ts +0 -24
  54. package/types/math/math/controls/Controls.d.ts.map +1 -1
  55. package/types/math/math/core/GLBufferAttribute.d.ts +0 -18
  56. package/types/math/math/core/GLBufferAttribute.d.ts.map +1 -1
  57. package/types/math/math/core/BufferAttribute.d.ts.map +0 -1
  58. package/types/math/math/core/EventDispatcher.d.ts +0 -14
  59. package/types/math/math/core/EventDispatcher.d.ts.map +0 -1
  60. package/types/math/math/core/Layers.d.ts.map +0 -1
  61. package/types/math/math/core/Object3D.d.ts.map +0 -1
  62. package/types/math/math/index.d.ts +0 -10
  63. package/types/math/math/index.d.ts.map +0 -1
  64. package/types/math/math/math/Box2.d.ts.map +0 -1
  65. package/types/math/math/math/Box3.d.ts.map +0 -1
  66. package/types/math/math/math/Color.d.ts.map +0 -1
  67. package/types/math/math/math/ColorManagement.d.ts.map +0 -1
  68. package/types/math/math/math/Cylindrical.d.ts.map +0 -1
  69. package/types/math/math/math/Euler.d.ts.map +0 -1
  70. package/types/math/math/math/Frustum.d.ts.map +0 -1
  71. package/types/math/math/math/Line3.d.ts.map +0 -1
  72. package/types/math/math/math/Matrix.d.ts.map +0 -1
  73. package/types/math/math/math/Matrix2.d.ts.map +0 -1
  74. package/types/math/math/math/Matrix3.d.ts.map +0 -1
  75. package/types/math/math/math/Matrix4.d.ts.map +0 -1
  76. package/types/math/math/math/Plane.d.ts.map +0 -1
  77. package/types/math/math/math/Quaternion.d.ts.map +0 -1
  78. package/types/math/math/math/Ray.d.ts.map +0 -1
  79. package/types/math/math/math/Sphere.d.ts.map +0 -1
  80. package/types/math/math/math/Spherical.d.ts.map +0 -1
  81. package/types/math/math/math/SphericalHarmonics3.d.ts.map +0 -1
  82. package/types/math/math/math/Triangle.d.ts.map +0 -1
  83. package/types/math/math/math/Vector.d.ts.map +0 -1
  84. package/types/math/math/math/Vector2.d.ts.map +0 -1
  85. package/types/math/math/math/Vector3.d.ts.map +0 -1
  86. package/types/math/math/math/Vector4.d.ts.map +0 -1
  87. /package/types/math/{math/math → core}/Box2.d.ts +0 -0
  88. /package/types/math/{math/math → core}/Color.d.ts +0 -0
  89. /package/types/math/{math/math → core}/ColorManagement.d.ts +0 -0
  90. /package/types/math/{math/math → core}/Cylindrical.d.ts +0 -0
  91. /package/types/math/{math/math → core}/Euler.d.ts +0 -0
  92. /package/types/math/{math/core → core}/Layers.d.ts +0 -0
  93. /package/types/math/{math/math → core}/Line3.d.ts +0 -0
  94. /package/types/math/{math/math → core}/Matrix.d.ts +0 -0
  95. /package/types/math/{math/math → core}/Matrix2.d.ts +0 -0
  96. /package/types/math/{math/math → core}/Matrix3.d.ts +0 -0
  97. /package/types/math/{math/math → core}/Matrix4.d.ts +0 -0
  98. /package/types/math/{math/math → core}/Plane.d.ts +0 -0
  99. /package/types/math/{math/math → core}/Quaternion.d.ts +0 -0
  100. /package/types/math/{math/math → core}/Ray.d.ts +0 -0
  101. /package/types/math/{math/math → core}/Sphere.d.ts +0 -0
  102. /package/types/math/{math/math → core}/Spherical.d.ts +0 -0
  103. /package/types/math/{math/math → core}/SphericalHarmonics3.d.ts +0 -0
  104. /package/types/math/{math/math → core}/Triangle.d.ts +0 -0
  105. /package/types/math/{math/math → core}/Vector.d.ts +0 -0
  106. /package/types/math/{math/math → core}/Vector4.d.ts +0 -0
  107. /package/types/math/{math → core}/constants.d.ts +0 -0
@@ -446,18 +446,20 @@ class ks {
446
446
  constructor() {
447
447
  this.events = {};
448
448
  }
449
- on(t, e) {
450
- return this.events[t] || (this.events[t] = []), this.events[t].push(e), this;
451
- }
452
- addListener(t, e) {
453
- return this.on(t, e), this;
449
+ has(t, e) {
450
+ return this.events[t] !== void 0 && this.events[t].indexOf(e) !== -1;
454
451
  }
455
452
  prependListener(t, e) {
456
453
  return this.events[t] || (this.events[t] = []), this.events[t].unshift(e), this;
457
454
  }
455
+ addListener(t, e) {
456
+ return this.events[t] || (this.events[t] = []), this.events[t].push(e), this;
457
+ }
458
+ on(t, e) {
459
+ return this.addListener(t, e), this;
460
+ }
458
461
  removeListener(t, e) {
459
- if (this.events[t])
460
- return this.events[t] = this.events[t].filter((s) => s !== e), this;
462
+ return this.events[t] && (this.events[t] = this.events[t].filter((s) => s !== e)), this;
461
463
  }
462
464
  off(t, e) {
463
465
  return this.removeListener(t, e), this;
@@ -466,8 +468,8 @@ class ks {
466
468
  return t ? this.events[t] = [] : this.events = {}, this;
467
469
  }
468
470
  emit(t, ...e) {
469
- return this.events[t] && this.events[t].forEach((s) => {
470
- s(...e);
471
+ return this.events[t] && this.events[t].slice(0).forEach((i) => {
472
+ i(...e);
471
473
  }), this;
472
474
  }
473
475
  once(t, e) {
@@ -11633,7 +11635,7 @@ class sd extends ks {
11633
11635
  }, tt = (D) => {
11634
11636
  this.emit("dragend", D);
11635
11637
  }, kt = (D) => {
11636
- D.dataTransfer, this.emit("drop", D, D.dataTransfer?.files);
11638
+ D.dataTransfer, this.emit("drop", D, D.dataTransfer?.files || null);
11637
11639
  };
11638
11640
  this.container.addEventListener("mousedown", t, !1), this.container.addEventListener("mouseup", e, !1), this.container.addEventListener("mousemove", s, !1), this.container.addEventListener("mouseover", i, !1), this.container.addEventListener("mouseout", r, !1), this.container.addEventListener("mouseenter", o, !1), this.container.addEventListener("mouseleave", a, !1), this.container.addEventListener("click", h, !1), this.container.addEventListener("dblclick", c, !1), this.container.addEventListener("wheel", l, !1), this.container.addEventListener("contextmenu", f, !1), this.container.addEventListener("touchstart", g, !1), this.container.addEventListener("touchend", x, !1), this.container.addEventListener("touchcancel", y, !1), this.container.addEventListener("touchmove", E, !1), this.container.addEventListener("pointerdown", v, !1), this.container.addEventListener("pointerup", b, !1), this.container.addEventListener("pointercancel", w, !1), this.container.addEventListener("pointermove", m, !1), this.hammer.on("pan", p), this.hammer.on("panstart", P), this.hammer.on("panmove", S), this.hammer.on("panend", O), this.hammer.on("pancancel", z), this.hammer.on("panleft", G), this.hammer.on("panright", J), this.hammer.on("panup", Z), this.hammer.on("pandown", it), this.hammer.on("pinch", Tt), this.hammer.on("press", dt), this.hammer.on("rotate", ye), this.hammer.on("swipe", Ht), this.hammer.on("swipeleft", ie), this.hammer.on("swiperight", we), this.hammer.on("swipeup", L), this.hammer.on("swipedown", M), this.hammer.on("tap", F), document.addEventListener("pointerdown", V, !1), this.container instanceof HTMLInputElement && this.container.addEventListener("change", ot, !1), this.container.addEventListener("dragstart", At, !1), this.container.addEventListener("dragover", Ze, !1), this.container.addEventListener("dragenter", Ke, !1), this.container.addEventListener("dragend", tt, !1), this.container.addEventListener("drop", kt, !1);
11639
11641
  const W = () => {
@@ -12582,7 +12584,7 @@ class nd {
12582
12584
  }), this.app.on("tap", () => {
12583
12585
  for (const r of this.shapes)
12584
12586
  if (this.currentMouseInShape == r) {
12585
- r.emit("clicked");
12587
+ r.emit("clicked", r);
12586
12588
  let o = r.parent;
12587
12589
  for (; o; )
12588
12590
  o.emit("clicked", r), o = o.parent;
@@ -15474,7 +15476,7 @@ class am {
15474
15476
  }), this.app.on("tap", () => {
15475
15477
  for (const s of this.shapes)
15476
15478
  if (this.currentMouseInShape == s) {
15477
- s.emit("clicked");
15479
+ s.emit("clicked", s);
15478
15480
  let i = s.parent;
15479
15481
  for (; i; )
15480
15482
  i.emit("clicked", s), i = i.parent;