@gamelearn/arcade-components 3.16.3 → 3.17.1
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.
|
@@ -20,7 +20,7 @@ var Nc = (l, e, n, t) => ({
|
|
|
20
20
|
import * as React$2 from "react";
|
|
21
21
|
import React__default, { useRef, useEffect, useCallback, createContext, useReducer, forwardRef, useImperativeHandle, useMemo, useContext, useLayoutEffect, useState } from "react";
|
|
22
22
|
import { OrbitControls, PerspectiveCamera as PerspectiveCamera$1 } from "@react-three/drei";
|
|
23
|
-
import { Renderer, SceneResource, CameraControls, SettingsController, EnvironmentWrapper, QualityManager, HtmlPro } from "@gamelearn/arcade-three-core";
|
|
23
|
+
import { Renderer, SceneResource, CameraControls, SettingsController, EnvironmentWrapper, QualityManager, HtmlPro, ProgressManager, AssetLoader } from "@gamelearn/arcade-three-core";
|
|
24
24
|
import { useThree, useFrame } from "@react-three/fiber";
|
|
25
25
|
import { Vector3, Box3, AnimationUtils, TrianglesDrawMode, TriangleFanDrawMode, TriangleStripDrawMode, Loader, LoaderUtils, FileLoader, Color, LinearSRGBColorSpace, SpotLight, PointLight, DirectionalLight, MeshBasicMaterial, SRGBColorSpace, MeshPhysicalMaterial, Vector2, Matrix4, Quaternion, InstancedMesh, InstancedBufferAttribute, Object3D, TextureLoader, ImageBitmapLoader, BufferAttribute, InterleavedBuffer, InterleavedBufferAttribute, LinearFilter, LinearMipmapLinearFilter, RepeatWrapping, PointsMaterial, Material, LineBasicMaterial, MeshStandardMaterial, DoubleSide, PropertyBinding, BufferGeometry, SkinnedMesh, Mesh, LineSegments, Line as Line$3, LineLoop, Points, Group as Group$3, PerspectiveCamera, MathUtils, OrthographicCamera, Skeleton, AnimationClip, Bone, InterpolateLinear, ColorManagement, NearestFilter, NearestMipmapNearestFilter, LinearMipmapNearestFilter, NearestMipmapLinearFilter, ClampToEdgeWrapping, MirroredRepeatWrapping, InterpolateDiscrete, FrontSide, Texture, VectorKeyframeTrack, NumberKeyframeTrack, QuaternionKeyframeTrack, Sphere, Interpolant, Raycaster, LoopRepeat } from "three";
|
|
26
26
|
import require$$0 from "react-dom";
|
|
@@ -35670,9 +35670,9 @@ let Group$1 = class extends Container_1.Container {
|
|
|
35670
35670
|
Group$2.Group = Group$1;
|
|
35671
35671
|
Group$1.prototype.nodeType = "Group";
|
|
35672
35672
|
(0, Global_1$i._registerNode)(Group$1);
|
|
35673
|
-
var Animation$
|
|
35674
|
-
Object.defineProperty(Animation$
|
|
35675
|
-
Animation$
|
|
35673
|
+
var Animation$3 = {};
|
|
35674
|
+
Object.defineProperty(Animation$3, "__esModule", { value: !0 });
|
|
35675
|
+
Animation$3.Animation = void 0;
|
|
35676
35676
|
const Global_1$h = Global, Util_1$8 = Util, now = function() {
|
|
35677
35677
|
return Global_1$h.glob.performance && Global_1$h.glob.performance.now ? function() {
|
|
35678
35678
|
return Global_1$h.glob.performance.now();
|
|
@@ -35680,7 +35680,7 @@ const Global_1$h = Global, Util_1$8 = Util, now = function() {
|
|
|
35680
35680
|
return (/* @__PURE__ */ new Date()).getTime();
|
|
35681
35681
|
};
|
|
35682
35682
|
}();
|
|
35683
|
-
let Animation$
|
|
35683
|
+
let Animation$2 = class su {
|
|
35684
35684
|
constructor(e, n) {
|
|
35685
35685
|
this.id = su.animIdCounter++, this.frame = {
|
|
35686
35686
|
time: 0,
|
|
@@ -35754,14 +35754,14 @@ let Animation$1 = class su {
|
|
|
35754
35754
|
this.animRunning || (this.animRunning = !0, Util_1$8.Util.requestAnimFrame(this._animationLoop));
|
|
35755
35755
|
}
|
|
35756
35756
|
};
|
|
35757
|
-
Animation$
|
|
35758
|
-
Animation$
|
|
35759
|
-
Animation$
|
|
35760
|
-
Animation$
|
|
35757
|
+
Animation$3.Animation = Animation$2;
|
|
35758
|
+
Animation$2.animations = [];
|
|
35759
|
+
Animation$2.animIdCounter = 0;
|
|
35760
|
+
Animation$2.animRunning = !1;
|
|
35761
35761
|
var Tween$1 = {};
|
|
35762
35762
|
(function(l) {
|
|
35763
35763
|
Object.defineProperty(l, "__esModule", { value: !0 }), l.Easings = l.Tween = void 0;
|
|
35764
|
-
const e = Util, n = Animation$
|
|
35764
|
+
const e = Util, n = Animation$3, t = Node$1, s = Global;
|
|
35765
35765
|
var o = {
|
|
35766
35766
|
node: 1,
|
|
35767
35767
|
duration: 1,
|
|
@@ -35990,7 +35990,7 @@ var Tween$1 = {};
|
|
|
35990
35990
|
})(Tween$1);
|
|
35991
35991
|
(function(l) {
|
|
35992
35992
|
Object.defineProperty(l, "__esModule", { value: !0 }), l.Konva = void 0;
|
|
35993
|
-
const e = Global, n = Util, t = Node$1, s = Container$2, o = Stage$1, d = Layer$2, f = FastLayer$1, h = Group$2, u = DragAndDrop, p = Shape, _ = Animation$
|
|
35993
|
+
const e = Global, n = Util, t = Node$1, s = Container$2, o = Stage$1, d = Layer$2, f = FastLayer$1, h = Group$2, u = DragAndDrop, p = Shape, _ = Animation$3, b = Tween$1, S = Context$2, E = Canvas$1;
|
|
35994
35994
|
l.Konva = n.Util._assign(e.Konva, {
|
|
35995
35995
|
Util: n.Util,
|
|
35996
35996
|
Transform: n.Transform,
|
|
@@ -37623,7 +37623,7 @@ Factory_1$l.Factory.addGetterSetter(Ring, "outerRadius", 0, (0, Validators_1$l.g
|
|
|
37623
37623
|
var Sprite$1 = {};
|
|
37624
37624
|
Object.defineProperty(Sprite$1, "__esModule", { value: !0 });
|
|
37625
37625
|
Sprite$1.Sprite = void 0;
|
|
37626
|
-
const Factory_1$k = Factory, Shape_1$5 = Shape, Animation_1 = Animation$
|
|
37626
|
+
const Factory_1$k = Factory, Shape_1$5 = Shape, Animation_1 = Animation$3, Validators_1$k = Validators, Global_1$5 = Global;
|
|
37627
37627
|
class Sprite extends Shape_1$5.Shape {
|
|
37628
37628
|
constructor(e) {
|
|
37629
37629
|
super(e), this._updated = !0, this.anim = new Animation_1.Animation(() => {
|
|
@@ -59199,7 +59199,7 @@ _forEachName("onComplete,onUpdate,onStart,onRepeat,onReverseComplete,onInterrupt
|
|
|
59199
59199
|
});
|
|
59200
59200
|
var GSCache = function l(e, n) {
|
|
59201
59201
|
this.id = _gsID++, e._gsap = this, this.target = e, this.harness = n, this.get = n ? n.get : _getProperty, this.set = n ? n.getSetter : _getSetter;
|
|
59202
|
-
}, Animation = /* @__PURE__ */ function() {
|
|
59202
|
+
}, Animation$1 = /* @__PURE__ */ function() {
|
|
59203
59203
|
function l(n) {
|
|
59204
59204
|
this.vars = n, this._delay = +n.delay || 0, (this._repeat = n.repeat === 1 / 0 ? -2 : n.repeat || 0) && (this._rDelay = n.repeatDelay || 0, this._yoyo = !!n.yoyo || !!n.yoyoEase), this._ts = 1, _setDuration(this, +n.duration, 1, 1), this.data = n.data, _context && (this._ctx = _context, _context.data.push(this)), _tickerActive || _ticker.wake();
|
|
59205
59205
|
}
|
|
@@ -59303,7 +59303,7 @@ var GSCache = function l(e, n) {
|
|
|
59303
59303
|
_interrupt(this);
|
|
59304
59304
|
}, l;
|
|
59305
59305
|
}();
|
|
59306
|
-
_setDefaults(Animation.prototype, {
|
|
59306
|
+
_setDefaults(Animation$1.prototype, {
|
|
59307
59307
|
_time: 0,
|
|
59308
59308
|
_start: 0,
|
|
59309
59309
|
_end: 0,
|
|
@@ -59396,7 +59396,7 @@ var Timeline = /* @__PURE__ */ function(l) {
|
|
|
59396
59396
|
return this;
|
|
59397
59397
|
}, n.add = function(s, o) {
|
|
59398
59398
|
var d = this;
|
|
59399
|
-
if (_isNumber(o) || (o = _parsePosition(this, o, s)), !(s instanceof Animation)) {
|
|
59399
|
+
if (_isNumber(o) || (o = _parsePosition(this, o, s)), !(s instanceof Animation$1)) {
|
|
59400
59400
|
if (_isArray(s))
|
|
59401
59401
|
return s.forEach(function(f) {
|
|
59402
59402
|
return d.add(f, o);
|
|
@@ -59512,7 +59512,7 @@ var Timeline = /* @__PURE__ */ function(l) {
|
|
|
59512
59512
|
}
|
|
59513
59513
|
}
|
|
59514
59514
|
}, e;
|
|
59515
|
-
}(Animation);
|
|
59515
|
+
}(Animation$1);
|
|
59516
59516
|
_setDefaults(Timeline.prototype, {
|
|
59517
59517
|
_lock: 0,
|
|
59518
59518
|
_hasPause: 0,
|
|
@@ -59768,7 +59768,7 @@ var Tween = /* @__PURE__ */ function(l) {
|
|
|
59768
59768
|
}, e.killTweensOf = function(s, o, d) {
|
|
59769
59769
|
return _globalTimeline.killTweensOf(s, o, d);
|
|
59770
59770
|
}, e;
|
|
59771
|
-
}(Animation);
|
|
59771
|
+
}(Animation$1);
|
|
59772
59772
|
_setDefaults(Tween.prototype, {
|
|
59773
59773
|
_targets: [],
|
|
59774
59774
|
_lazy: 0,
|
|
@@ -60073,7 +60073,7 @@ var _media = [], _listeners = {}, _emptyArray = [], _lastMediaTime = 0, _context
|
|
|
60073
60073
|
globals: _addGlobal,
|
|
60074
60074
|
Tween,
|
|
60075
60075
|
Timeline,
|
|
60076
|
-
Animation,
|
|
60076
|
+
Animation: Animation$1,
|
|
60077
60077
|
getCache: _getCache,
|
|
60078
60078
|
_removeLinkedListItem,
|
|
60079
60079
|
reverting: function l() {
|
|
@@ -60722,17 +60722,19 @@ function useStateMachine(l) {
|
|
|
60722
60722
|
return b.mix("idle"), b.getAction("idle");
|
|
60723
60723
|
{
|
|
60724
60724
|
const S = n[u], E = p.split("_")[0], g = S[E], v = cache[S.talking];
|
|
60725
|
-
|
|
60726
|
-
|
|
60727
|
-
|
|
60728
|
-
|
|
60729
|
-
|
|
60730
|
-
|
|
60731
|
-
_.userData._active
|
|
60732
|
-
|
|
60733
|
-
|
|
60734
|
-
|
|
60735
|
-
|
|
60725
|
+
if (g) {
|
|
60726
|
+
let R = cache[g];
|
|
60727
|
+
if (!R) {
|
|
60728
|
+
const { animations: T } = await loader.loadAsync(g);
|
|
60729
|
+
R = cache[g] = T[0];
|
|
60730
|
+
}
|
|
60731
|
+
if (p.includes("talking") && p !== "talking" && (R = mixWithTalkingClip(v, R)), !_.userData._active || _.userData._active !== p) {
|
|
60732
|
+
_.userData._active = p;
|
|
60733
|
+
const T = b.register(p, R);
|
|
60734
|
+
return new Promise((x) => {
|
|
60735
|
+
b.mix(p).then((C) => x(C ? T : !1));
|
|
60736
|
+
});
|
|
60737
|
+
}
|
|
60736
60738
|
}
|
|
60737
60739
|
}
|
|
60738
60740
|
return new Promise((S) => S(!1));
|
|
@@ -61178,52 +61180,71 @@ function DialogComponent({
|
|
|
61178
61180
|
)
|
|
61179
61181
|
] });
|
|
61180
61182
|
}
|
|
61181
|
-
|
|
61182
|
-
|
|
61183
|
+
const activeCache = ProgressManager.request("AssetLoader").cache, assetLoader = new AssetLoader(void 0, activeCache);
|
|
61184
|
+
function Animation({ animation: l, loopTimes: e, onAnimationFinish: n, onAnimationSave: t, resource: s, makeDefault: o, emitEvent: d }) {
|
|
61185
|
+
const f = useThree((p) => p.scene), h = useRef(1), u = useRef();
|
|
61183
61186
|
return useEffect(() => {
|
|
61184
|
-
|
|
61185
|
-
|
|
61186
|
-
|
|
61187
|
-
|
|
61188
|
-
|
|
61189
|
-
if (s)
|
|
61190
|
-
o({
|
|
61191
|
-
type: "saveAnimation",
|
|
61192
|
-
payload: { uid: n.uid, animation: l.id, index: _.index }
|
|
61193
|
-
}), o({ type: "success" });
|
|
61187
|
+
if (!u.current) {
|
|
61188
|
+
const p = f.getObjectByProperty("uid", s.uid);
|
|
61189
|
+
if (p && l && p.skeletonId === l.skeletonId)
|
|
61190
|
+
if (o)
|
|
61191
|
+
t({ uid: s.uid, animation: l.id, index: p.index }), n(l);
|
|
61194
61192
|
else {
|
|
61195
|
-
const b =
|
|
61196
|
-
|
|
61197
|
-
|
|
61198
|
-
|
|
61199
|
-
|
|
61200
|
-
|
|
61201
|
-
|
|
61202
|
-
|
|
61203
|
-
R && S.addEventListener("loop", v);
|
|
61204
|
-
}), f(!0);
|
|
61193
|
+
const _ = p.userData.animator, b = () => {
|
|
61194
|
+
_.getAction(l.url).setLoop(LoopRepeat, 1 / 0), h.current = 1;
|
|
61195
|
+
function E() {
|
|
61196
|
+
h.current >= e && (_.mix("idle"), n(l), _.removeEventListener("loop", E)), h.current += 1;
|
|
61197
|
+
}
|
|
61198
|
+
_.mix(l.url).then((g) => {
|
|
61199
|
+
g && _.addEventListener("loop", E);
|
|
61200
|
+
});
|
|
61205
61201
|
};
|
|
61206
|
-
|
|
61207
|
-
|
|
61202
|
+
_.getAction(l.url) ? b() : assetLoader.load(l.url, (S) => {
|
|
61203
|
+
_.register(l.url, S.animations[0]), b();
|
|
61208
61204
|
});
|
|
61209
61205
|
}
|
|
61210
61206
|
else
|
|
61211
|
-
|
|
61207
|
+
n(l);
|
|
61208
|
+
u.current = l.id;
|
|
61212
61209
|
}
|
|
61213
61210
|
}, [
|
|
61214
|
-
|
|
61215
|
-
l
|
|
61211
|
+
f,
|
|
61212
|
+
l.url,
|
|
61216
61213
|
e,
|
|
61217
|
-
o,
|
|
61218
61214
|
d,
|
|
61219
|
-
|
|
61220
|
-
|
|
61221
|
-
s,
|
|
61215
|
+
s.uid,
|
|
61216
|
+
o,
|
|
61222
61217
|
l,
|
|
61218
|
+
s,
|
|
61223
61219
|
n,
|
|
61224
61220
|
t
|
|
61225
61221
|
]), null;
|
|
61226
61222
|
}
|
|
61223
|
+
function MultipleAnimation({ animations: l = [], enableInteraction: e, emitEvent: n }) {
|
|
61224
|
+
const [t, s] = useState(!1), o = l.length, d = useRef(0), f = () => {
|
|
61225
|
+
d.current += 1, d.current >= o && s(!0);
|
|
61226
|
+
}, h = (u) => {
|
|
61227
|
+
n({
|
|
61228
|
+
type: "saveAnimation",
|
|
61229
|
+
payload: u
|
|
61230
|
+
});
|
|
61231
|
+
};
|
|
61232
|
+
return useEffect(() => {
|
|
61233
|
+
t && n({ type: "success" });
|
|
61234
|
+
}, [n, t]), useEffect(() => {
|
|
61235
|
+
e && s(!0);
|
|
61236
|
+
}, [e]), l.map(({ animation: u, resource: p, ..._ }) => /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
61237
|
+
Animation,
|
|
61238
|
+
{
|
|
61239
|
+
animation: u,
|
|
61240
|
+
resource: p,
|
|
61241
|
+
..._,
|
|
61242
|
+
onAnimationSave: h,
|
|
61243
|
+
onAnimationFinish: f
|
|
61244
|
+
},
|
|
61245
|
+
`${u.id}_${p.uid}`
|
|
61246
|
+
));
|
|
61247
|
+
}
|
|
61227
61248
|
function EmailPill({ text: l, error: e, handleClick: n }) {
|
|
61228
61249
|
return /* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
61229
61250
|
"div",
|
|
@@ -61390,7 +61411,7 @@ function ReferralComponent({ emitEvent: l, text: e, rewards: n, referrals: t })
|
|
|
61390
61411
|
] }) });
|
|
61391
61412
|
}
|
|
61392
61413
|
export {
|
|
61393
|
-
AnimationComponent,
|
|
61414
|
+
MultipleAnimation as AnimationComponent,
|
|
61394
61415
|
AutoEvaluation as AutoEvaluationComponent,
|
|
61395
61416
|
CardsSelectorPuzzleComponent,
|
|
61396
61417
|
CartelComponent,
|