reacthub-pixitweenjs 0.2.20 → 0.2.21
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/index.es.js +45 -50
- package/dist/index.umd.js +3 -3
- package/dist/utils/PixiTransformer.d.ts +1 -2
- package/package.json +1 -1
package/dist/index.es.js
CHANGED
|
@@ -10457,79 +10457,77 @@ const jn = {}, Yy = Rt.IDENTITY, Ky = {
|
|
|
10457
10457
|
}), Sa = ({
|
|
10458
10458
|
pixiTransformerRef: e,
|
|
10459
10459
|
imageRef: t,
|
|
10460
|
-
|
|
10461
|
-
|
|
10462
|
-
|
|
10463
|
-
|
|
10464
|
-
|
|
10465
|
-
uniqueId: o = ""
|
|
10460
|
+
transformCommit: r,
|
|
10461
|
+
transformChange: n,
|
|
10462
|
+
mouseoverEvent: i,
|
|
10463
|
+
onDoubleClick: s,
|
|
10464
|
+
uniqueId: a = ""
|
|
10466
10465
|
}) => {
|
|
10467
10466
|
console.log("transformer props", {
|
|
10468
10467
|
pixiTransformerRef: e,
|
|
10469
10468
|
imageRef: t,
|
|
10470
|
-
|
|
10471
|
-
|
|
10472
|
-
|
|
10473
|
-
|
|
10474
|
-
|
|
10475
|
-
uniqueId: o
|
|
10469
|
+
transformCommit: r,
|
|
10470
|
+
transformChange: n,
|
|
10471
|
+
mouseoverEvent: i,
|
|
10472
|
+
onDoubleClick: s,
|
|
10473
|
+
uniqueId: a
|
|
10476
10474
|
});
|
|
10477
|
-
const
|
|
10475
|
+
const o = de.utils.string2hex("#F3C409"), l = de.utils.string2hex("#F3C409"), h = ot.useRef({
|
|
10478
10476
|
isDragging: !1
|
|
10479
|
-
}),
|
|
10480
|
-
|
|
10481
|
-
}, [
|
|
10482
|
-
|
|
10483
|
-
}, [
|
|
10484
|
-
|
|
10485
|
-
}, []),
|
|
10486
|
-
|
|
10487
|
-
}, []),
|
|
10488
|
-
(
|
|
10489
|
-
|
|
10477
|
+
}), c = ot.useCallback(() => {
|
|
10478
|
+
i && !h.current.isDragging && i(!0);
|
|
10479
|
+
}, [i]), f = ot.useCallback(() => {
|
|
10480
|
+
i && !h.current.isDragging && i(!1);
|
|
10481
|
+
}, [i]), u = ot.useCallback(() => {
|
|
10482
|
+
h.current.isDragging = !0;
|
|
10483
|
+
}, []), d = ot.useCallback(() => {
|
|
10484
|
+
h.current.isDragging = !1;
|
|
10485
|
+
}, []), p = ot.useCallback(
|
|
10486
|
+
(g) => {
|
|
10487
|
+
h.current.isDragging = !0, n && n(g);
|
|
10490
10488
|
},
|
|
10491
|
-
[
|
|
10492
|
-
),
|
|
10489
|
+
[n]
|
|
10490
|
+
), m = ot.useCallback(() => {
|
|
10493
10491
|
if (t.current === null)
|
|
10494
10492
|
return;
|
|
10495
|
-
const
|
|
10493
|
+
const g = t.current.x, y = t.current.y, b = t.current.width, _ = t.current.height, v = t.current.rotation, x = [
|
|
10496
10494
|
t.current.scale.x,
|
|
10497
10495
|
t.current.scale.y
|
|
10498
10496
|
];
|
|
10499
|
-
|
|
10500
|
-
uniqueId:
|
|
10497
|
+
r && r({
|
|
10498
|
+
uniqueId: a,
|
|
10501
10499
|
transformation: {
|
|
10502
|
-
x: Math.round(
|
|
10503
|
-
y: Math.round(
|
|
10504
|
-
width: Math.round(Math.max(5,
|
|
10505
|
-
height: Math.round(Math.max(5,
|
|
10506
|
-
rotate: Math.round(
|
|
10507
|
-
scale:
|
|
10500
|
+
x: Math.round(g),
|
|
10501
|
+
y: Math.round(y),
|
|
10502
|
+
width: Math.round(Math.max(5, b)),
|
|
10503
|
+
height: Math.round(Math.max(5, _)),
|
|
10504
|
+
rotate: Math.round(v),
|
|
10505
|
+
scale: x
|
|
10508
10506
|
}
|
|
10509
|
-
}),
|
|
10510
|
-
}, [
|
|
10511
|
-
return ot.useEffect(() => (e.current && (e.current.on("mouseover",
|
|
10512
|
-
e.current && (e.current.off("mouseover",
|
|
10507
|
+
}), h.current.isDragging = !1;
|
|
10508
|
+
}, [r]);
|
|
10509
|
+
return ot.useEffect(() => (e.current && (e.current.on("mouseover", c), e.current.on("mouseout", f), e.current.on("mousedown", u), e.current.on("mouseup", d)), () => {
|
|
10510
|
+
e.current && (e.current.off("mouseover", c), e.current.off("mouseout", f), e.current.off("mousedown", u), e.current.off("mouseup", d));
|
|
10513
10511
|
}), []), /* @__PURE__ */ ft.jsx(
|
|
10514
10512
|
Zy,
|
|
10515
10513
|
{
|
|
10516
10514
|
ref: e,
|
|
10517
|
-
group:
|
|
10515
|
+
group: [t.current],
|
|
10518
10516
|
rotateEnabled: !0,
|
|
10519
10517
|
boxRotationEnabled: !0,
|
|
10520
10518
|
centeredScaling: !0,
|
|
10521
10519
|
boxScalingEnabled: !0,
|
|
10522
|
-
wireframeStyle: { thickness: 1, color:
|
|
10520
|
+
wireframeStyle: { thickness: 1, color: l },
|
|
10523
10521
|
lockAspectRatio: !0,
|
|
10524
10522
|
scaleEnabled: !0,
|
|
10525
10523
|
handleStyle: {
|
|
10526
10524
|
// color: colorYellow,
|
|
10527
|
-
outlineColor:
|
|
10525
|
+
outlineColor: o,
|
|
10528
10526
|
shape: "circle",
|
|
10529
10527
|
radius: 9
|
|
10530
10528
|
},
|
|
10531
|
-
transformchange:
|
|
10532
|
-
transformcommit:
|
|
10529
|
+
transformchange: p,
|
|
10530
|
+
transformcommit: m
|
|
10533
10531
|
}
|
|
10534
10532
|
);
|
|
10535
10533
|
};
|
|
@@ -10995,12 +10993,11 @@ const ee = /* @__PURE__ */ Mr(Kg), Zg = [1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1,
|
|
|
10995
10993
|
]
|
|
10996
10994
|
}
|
|
10997
10995
|
),
|
|
10998
|
-
x && /* @__PURE__ */ ft.jsx(
|
|
10996
|
+
x && t && /* @__PURE__ */ ft.jsx(
|
|
10999
10997
|
Sa,
|
|
11000
10998
|
{
|
|
11001
10999
|
pixiTransformerRef: l,
|
|
11002
11000
|
imageRef: s,
|
|
11003
|
-
isMounted: t,
|
|
11004
11001
|
transformCommit: R,
|
|
11005
11002
|
transformChange: O,
|
|
11006
11003
|
mouseoverEvent: i,
|
|
@@ -14158,12 +14155,11 @@ const kT = (e) => ({
|
|
|
14158
14155
|
] })
|
|
14159
14156
|
}
|
|
14160
14157
|
),
|
|
14161
|
-
tt && /* @__PURE__ */ ft.jsx(
|
|
14158
|
+
tt && w && /* @__PURE__ */ ft.jsx(
|
|
14162
14159
|
Sa,
|
|
14163
14160
|
{
|
|
14164
14161
|
pixiTransformerRef: b,
|
|
14165
14162
|
imageRef: m,
|
|
14166
|
-
isMounted: w,
|
|
14167
14163
|
transformCommit: J,
|
|
14168
14164
|
transformChange: Gt,
|
|
14169
14165
|
mouseoverEvent: c,
|
|
@@ -21960,12 +21956,11 @@ const oA = (e) => {
|
|
|
21960
21956
|
)
|
|
21961
21957
|
}
|
|
21962
21958
|
),
|
|
21963
|
-
q && /* @__PURE__ */ ft.jsx(
|
|
21959
|
+
q && t && /* @__PURE__ */ ft.jsx(
|
|
21964
21960
|
Sa,
|
|
21965
21961
|
{
|
|
21966
21962
|
pixiTransformerRef: d,
|
|
21967
21963
|
imageRef: c,
|
|
21968
|
-
isMounted: t,
|
|
21969
21964
|
transformCommit: V,
|
|
21970
21965
|
transformChange: St,
|
|
21971
21966
|
mouseoverEvent: n,
|