@zyzgroup/core-web 0.1.8 → 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.
- package/dist/zyzgroup_core_web.iife.js +5 -5
- package/dist/zyzgroup_core_web.iife.js.map +1 -1
- package/dist/zyzgroup_core_web.js +34 -28
- package/dist/zyzgroup_core_web.js.map +1 -1
- package/dist/zyzgroup_core_web.umd.cjs +5 -5
- package/dist/zyzgroup_core_web.umd.cjs.map +1 -1
- package/package.json +1 -1
- package/types/dom/DOMEventBus.d.ts +4 -4
- package/types/dom/DOMEventBus.d.ts.map +1 -1
- package/types/dom/DOMParse.d.ts +2 -2
- package/types/dom/DOMParse.d.ts.map +1 -1
- package/types/hooks/useDragDrop.d.ts +6 -1
- package/types/hooks/useDragDrop.d.ts.map +1 -1
- package/types/math/Shape.d.ts +2 -2
- package/types/math/Shape.d.ts.map +1 -1
- package/types/math/core/Box2.d.ts.map +1 -0
- package/types/math/{math/math → core}/Box3.d.ts +2 -2
- package/types/math/core/Box3.d.ts.map +1 -0
- package/types/math/{math/core → core}/BufferAttribute.d.ts +2 -2
- package/types/math/core/BufferAttribute.d.ts.map +1 -0
- package/types/math/core/Color.d.ts.map +1 -0
- package/types/math/core/ColorManagement.d.ts.map +1 -0
- package/types/math/core/Cylindrical.d.ts.map +1 -0
- package/types/math/core/Euler.d.ts.map +1 -0
- package/types/math/{math/math → core}/Frustum.d.ts +1 -1
- package/types/math/core/Frustum.d.ts.map +1 -0
- package/types/math/core/Layers.d.ts.map +1 -0
- package/types/math/core/Line3.d.ts.map +1 -0
- package/types/math/core/Matrix.d.ts.map +1 -0
- package/types/math/core/Matrix2.d.ts.map +1 -0
- package/types/math/core/Matrix3.d.ts.map +1 -0
- package/types/math/core/Matrix4.d.ts.map +1 -0
- package/types/math/{math/core → core}/Object3D.d.ts +10 -7
- package/types/math/core/Object3D.d.ts.map +1 -0
- package/types/math/core/Plane.d.ts.map +1 -0
- package/types/math/core/Quaternion.d.ts.map +1 -0
- package/types/math/core/Ray.d.ts.map +1 -0
- package/types/math/core/Sphere.d.ts.map +1 -0
- package/types/math/core/Spherical.d.ts.map +1 -0
- package/types/math/core/SphericalHarmonics3.d.ts.map +1 -0
- package/types/math/core/Triangle.d.ts.map +1 -0
- package/types/math/core/Vector.d.ts.map +1 -0
- package/types/math/{math/math → core}/Vector2.d.ts +1 -1
- package/types/math/core/Vector2.d.ts.map +1 -0
- package/types/math/{math/math → core}/Vector3.d.ts +1 -1
- package/types/math/core/Vector3.d.ts.map +1 -0
- package/types/math/core/Vector4.d.ts.map +1 -0
- package/types/math/{math → core}/constants.d.ts.map +1 -1
- package/types/math/core/index.d.ts +9 -0
- package/types/math/core/index.d.ts.map +1 -0
- package/types/math/index.d.ts +1 -1
- package/types/math/index.d.ts.map +1 -1
- package/types/math/math/cameras/Camera.d.ts +0 -11
- package/types/math/math/cameras/Camera.d.ts.map +1 -1
- package/types/math/math/controls/Controls.d.ts +0 -24
- package/types/math/math/controls/Controls.d.ts.map +1 -1
- package/types/math/math/core/GLBufferAttribute.d.ts +0 -18
- package/types/math/math/core/GLBufferAttribute.d.ts.map +1 -1
- package/types/math/math/core/BufferAttribute.d.ts.map +0 -1
- package/types/math/math/core/EventDispatcher.d.ts +0 -14
- package/types/math/math/core/EventDispatcher.d.ts.map +0 -1
- package/types/math/math/core/Layers.d.ts.map +0 -1
- package/types/math/math/core/Object3D.d.ts.map +0 -1
- package/types/math/math/index.d.ts +0 -10
- package/types/math/math/index.d.ts.map +0 -1
- package/types/math/math/math/Box2.d.ts.map +0 -1
- package/types/math/math/math/Box3.d.ts.map +0 -1
- package/types/math/math/math/Color.d.ts.map +0 -1
- package/types/math/math/math/ColorManagement.d.ts.map +0 -1
- package/types/math/math/math/Cylindrical.d.ts.map +0 -1
- package/types/math/math/math/Euler.d.ts.map +0 -1
- package/types/math/math/math/Frustum.d.ts.map +0 -1
- package/types/math/math/math/Line3.d.ts.map +0 -1
- package/types/math/math/math/Matrix.d.ts.map +0 -1
- package/types/math/math/math/Matrix2.d.ts.map +0 -1
- package/types/math/math/math/Matrix3.d.ts.map +0 -1
- package/types/math/math/math/Matrix4.d.ts.map +0 -1
- package/types/math/math/math/Plane.d.ts.map +0 -1
- package/types/math/math/math/Quaternion.d.ts.map +0 -1
- package/types/math/math/math/Ray.d.ts.map +0 -1
- package/types/math/math/math/Sphere.d.ts.map +0 -1
- package/types/math/math/math/Spherical.d.ts.map +0 -1
- package/types/math/math/math/SphericalHarmonics3.d.ts.map +0 -1
- package/types/math/math/math/Triangle.d.ts.map +0 -1
- package/types/math/math/math/Vector.d.ts.map +0 -1
- package/types/math/math/math/Vector2.d.ts.map +0 -1
- package/types/math/math/math/Vector3.d.ts.map +0 -1
- package/types/math/math/math/Vector4.d.ts.map +0 -1
- /package/types/math/{math/math → core}/Box2.d.ts +0 -0
- /package/types/math/{math/math → core}/Color.d.ts +0 -0
- /package/types/math/{math/math → core}/ColorManagement.d.ts +0 -0
- /package/types/math/{math/math → core}/Cylindrical.d.ts +0 -0
- /package/types/math/{math/math → core}/Euler.d.ts +0 -0
- /package/types/math/{math/core → core}/Layers.d.ts +0 -0
- /package/types/math/{math/math → core}/Line3.d.ts +0 -0
- /package/types/math/{math/math → core}/Matrix.d.ts +0 -0
- /package/types/math/{math/math → core}/Matrix2.d.ts +0 -0
- /package/types/math/{math/math → core}/Matrix3.d.ts +0 -0
- /package/types/math/{math/math → core}/Matrix4.d.ts +0 -0
- /package/types/math/{math/math → core}/Plane.d.ts +0 -0
- /package/types/math/{math/math → core}/Quaternion.d.ts +0 -0
- /package/types/math/{math/math → core}/Ray.d.ts +0 -0
- /package/types/math/{math/math → core}/Sphere.d.ts +0 -0
- /package/types/math/{math/math → core}/Spherical.d.ts +0 -0
- /package/types/math/{math/math → core}/SphericalHarmonics3.d.ts +0 -0
- /package/types/math/{math/math → core}/Triangle.d.ts +0 -0
- /package/types/math/{math/math → core}/Vector.d.ts +0 -0
- /package/types/math/{math/math → core}/Vector4.d.ts +0 -0
- /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
|
-
|
|
450
|
-
return this.events[t]
|
|
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
|
-
|
|
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((
|
|
470
|
-
|
|
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) {
|
|
@@ -7865,30 +7867,30 @@ function Hu(n, t) {
|
|
|
7865
7867
|
s != "" && n.removeAttribute(s);
|
|
7866
7868
|
});
|
|
7867
7869
|
}
|
|
7868
|
-
function $u(n) {
|
|
7870
|
+
function $u(n, t) {
|
|
7869
7871
|
zn(n, "draggable", "true");
|
|
7870
|
-
const
|
|
7871
|
-
return
|
|
7872
|
+
const e = [];
|
|
7873
|
+
return e.push(
|
|
7872
7874
|
K(
|
|
7873
7875
|
n,
|
|
7874
7876
|
"dragstart",
|
|
7875
|
-
(
|
|
7876
|
-
ue(
|
|
7877
|
-
const
|
|
7878
|
-
|
|
7877
|
+
(s) => {
|
|
7878
|
+
ue(s), Ac(s);
|
|
7879
|
+
const i = s.dataTransfer;
|
|
7880
|
+
i && (i.effectAllowed = "move", i.setData("text/plain", "some-data")), t?.onStart?.(s);
|
|
7879
7881
|
},
|
|
7880
7882
|
!0
|
|
7881
7883
|
)
|
|
7882
|
-
),
|
|
7883
|
-
K(n, "drag", (
|
|
7884
|
-
ue(
|
|
7884
|
+
), e.push(
|
|
7885
|
+
K(n, "drag", (s) => {
|
|
7886
|
+
ue(s), t?.onDrag?.(s);
|
|
7885
7887
|
})
|
|
7886
|
-
),
|
|
7887
|
-
K(n, "dragend", (
|
|
7888
|
-
ue(
|
|
7888
|
+
), e.push(
|
|
7889
|
+
K(n, "dragend", (s) => {
|
|
7890
|
+
ue(s), t?.onEnd?.(s);
|
|
7889
7891
|
})
|
|
7890
7892
|
), () => {
|
|
7891
|
-
|
|
7893
|
+
e.forEach((s) => s());
|
|
7892
7894
|
};
|
|
7893
7895
|
}
|
|
7894
7896
|
function Wu(n, t) {
|
|
@@ -7901,7 +7903,7 @@ function Wu(n, t) {
|
|
|
7901
7903
|
K(n, "dragover", (s) => {
|
|
7902
7904
|
ue(s);
|
|
7903
7905
|
const i = s.dataTransfer;
|
|
7904
|
-
i && (i.dropEffect = "move");
|
|
7906
|
+
i && (i.dropEffect = "move"), t?.onOver?.(s);
|
|
7905
7907
|
})
|
|
7906
7908
|
), e.push(
|
|
7907
7909
|
K(n, "dragleave", (s) => {
|
|
@@ -7911,7 +7913,11 @@ function Wu(n, t) {
|
|
|
7911
7913
|
K(n, "drop", (s) => {
|
|
7912
7914
|
ue(s);
|
|
7913
7915
|
const i = s.dataTransfer;
|
|
7914
|
-
|
|
7916
|
+
if (!i) {
|
|
7917
|
+
t?.onDrop?.(s, []);
|
|
7918
|
+
return;
|
|
7919
|
+
}
|
|
7920
|
+
t?.onDrop?.(s, [...i.files]);
|
|
7915
7921
|
})
|
|
7916
7922
|
), () => {
|
|
7917
7923
|
e.forEach((s) => s());
|
|
@@ -11629,7 +11635,7 @@ class sd extends ks {
|
|
|
11629
11635
|
}, tt = (D) => {
|
|
11630
11636
|
this.emit("dragend", D);
|
|
11631
11637
|
}, kt = (D) => {
|
|
11632
|
-
D.dataTransfer, this.emit("drop", D, D.dataTransfer?.files);
|
|
11638
|
+
D.dataTransfer, this.emit("drop", D, D.dataTransfer?.files || null);
|
|
11633
11639
|
};
|
|
11634
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);
|
|
11635
11641
|
const W = () => {
|
|
@@ -12578,7 +12584,7 @@ class nd {
|
|
|
12578
12584
|
}), this.app.on("tap", () => {
|
|
12579
12585
|
for (const r of this.shapes)
|
|
12580
12586
|
if (this.currentMouseInShape == r) {
|
|
12581
|
-
r.emit("clicked");
|
|
12587
|
+
r.emit("clicked", r);
|
|
12582
12588
|
let o = r.parent;
|
|
12583
12589
|
for (; o; )
|
|
12584
12590
|
o.emit("clicked", r), o = o.parent;
|
|
@@ -15470,7 +15476,7 @@ class am {
|
|
|
15470
15476
|
}), this.app.on("tap", () => {
|
|
15471
15477
|
for (const s of this.shapes)
|
|
15472
15478
|
if (this.currentMouseInShape == s) {
|
|
15473
|
-
s.emit("clicked");
|
|
15479
|
+
s.emit("clicked", s);
|
|
15474
15480
|
let i = s.parent;
|
|
15475
15481
|
for (; i; )
|
|
15476
15482
|
i.emit("clicked", s), i = i.parent;
|