@matchain/matchid-sdk-react 0.1.55-alpha.15 → 0.1.55-alpha.16
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/api.js +16431 -73
- package/dist/api.js.map +1 -1
- package/dist/api.mjs +2 -2
- package/dist/{chunk-ULDTUWGQ.mjs → chunk-HVCBDIGY.mjs} +2 -2
- package/dist/{chunk-BWGTZNIT.mjs → chunk-KYTL3LIF.mjs} +17138 -493
- package/dist/chunk-KYTL3LIF.mjs.map +1 -0
- package/dist/components.d.mts +2 -2
- package/dist/components.d.ts +2 -2
- package/dist/components.js +752 -959
- package/dist/components.js.map +1 -1
- package/dist/components.mjs +1 -1
- package/dist/hooks.d.mts +1 -1
- package/dist/hooks.d.ts +1 -1
- package/dist/hooks.js +485 -692
- package/dist/hooks.js.map +1 -1
- package/dist/hooks.mjs +1 -1
- package/dist/icon.d.mts +1 -1
- package/dist/icon.d.ts +1 -1
- package/dist/{index-QPdWAVPk.d.mts → index-BKSGbw7b.d.mts} +2 -2
- package/dist/{index-C14uKUDG.d.mts → index-BXbfmVoU.d.mts} +1 -1
- package/dist/{index-B80rDuha.d.ts → index-BtjgRcNJ.d.ts} +2 -2
- package/dist/{index-BBghnVDr.d.ts → index-C82WIWvx.d.ts} +4 -4
- package/dist/{index--EI6w9pi.d.mts → index-CHG4-0Z1.d.mts} +3 -3
- package/dist/{index-DGbpUvkd.d.ts → index-CsUEaGtM.d.ts} +1 -1
- package/dist/{index-Cl0JpAc1.d.ts → index-D1Ep9UMx.d.ts} +3 -3
- package/dist/{index-CHtFnnZk.d.mts → index-D7E317WV.d.mts} +4 -4
- package/dist/{index-hiCo96Vc.d.ts → index-DK7l3lsH.d.ts} +10 -7
- package/dist/{index-Dx4OFZhG.d.mts → index-YPRyEYt6.d.mts} +10 -7
- package/dist/index.d.mts +7 -8
- package/dist/index.d.ts +7 -8
- package/dist/index.js +471 -678
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +2 -2
- package/dist/ui.d.mts +2 -3
- package/dist/ui.d.ts +2 -3
- package/dist/ui.js +299 -506
- package/dist/ui.js.map +1 -1
- package/dist/ui.mjs +1 -1
- package/package.json +1 -1
- package/dist/chunk-BWGTZNIT.mjs.map +0 -1
- package/dist/index.es-FMP4VX4N.mjs +0 -16847
- package/dist/index.es-FMP4VX4N.mjs.map +0 -1
- /package/dist/{chunk-ULDTUWGQ.mjs.map → chunk-HVCBDIGY.mjs.map} +0 -0
package/dist/ui.js
CHANGED
|
@@ -6,9 +6,6 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
|
6
6
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
7
7
|
var __getProtoOf = Object.getPrototypeOf;
|
|
8
8
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
9
|
-
var __esm = (fn, res) => function __init() {
|
|
10
|
-
return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
|
|
11
|
-
};
|
|
12
9
|
var __commonJS = (cb, mod2) => function __require() {
|
|
13
10
|
return mod2 || (0, cb[__getOwnPropNames(cb)[0]])((mod2 = { exports: {} }).exports, mod2), mod2.exports;
|
|
14
11
|
};
|
|
@@ -16376,496 +16373,6 @@ var require_lottie = __commonJS({
|
|
|
16376
16373
|
}
|
|
16377
16374
|
});
|
|
16378
16375
|
|
|
16379
|
-
// node_modules/lottie-react/build/index.es.js
|
|
16380
|
-
var index_es_exports = {};
|
|
16381
|
-
__export(index_es_exports, {
|
|
16382
|
-
LottiePlayer: () => import_lottie_web2.default,
|
|
16383
|
-
default: () => Lottie,
|
|
16384
|
-
useLottie: () => useLottie,
|
|
16385
|
-
useLottieInteractivity: () => useLottieInteractivity
|
|
16386
|
-
});
|
|
16387
|
-
function _arrayLikeToArray(r, a) {
|
|
16388
|
-
(null == a || a > r.length) && (a = r.length);
|
|
16389
|
-
for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];
|
|
16390
|
-
return n;
|
|
16391
|
-
}
|
|
16392
|
-
function _arrayWithHoles(r) {
|
|
16393
|
-
if (Array.isArray(r)) return r;
|
|
16394
|
-
}
|
|
16395
|
-
function _defineProperty(e, r, t) {
|
|
16396
|
-
return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
|
|
16397
|
-
value: t,
|
|
16398
|
-
enumerable: true,
|
|
16399
|
-
configurable: true,
|
|
16400
|
-
writable: true
|
|
16401
|
-
}) : e[r] = t, e;
|
|
16402
|
-
}
|
|
16403
|
-
function _iterableToArrayLimit(r, l) {
|
|
16404
|
-
var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
|
|
16405
|
-
if (null != t) {
|
|
16406
|
-
var e, n, i, u, a = [], f = true, o = false;
|
|
16407
|
-
try {
|
|
16408
|
-
if (i = (t = t.call(r)).next, 0 === l) {
|
|
16409
|
-
if (Object(t) !== t) return;
|
|
16410
|
-
f = false;
|
|
16411
|
-
} else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = true) ;
|
|
16412
|
-
} catch (r2) {
|
|
16413
|
-
o = true, n = r2;
|
|
16414
|
-
} finally {
|
|
16415
|
-
try {
|
|
16416
|
-
if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return;
|
|
16417
|
-
} finally {
|
|
16418
|
-
if (o) throw n;
|
|
16419
|
-
}
|
|
16420
|
-
}
|
|
16421
|
-
return a;
|
|
16422
|
-
}
|
|
16423
|
-
}
|
|
16424
|
-
function _nonIterableRest() {
|
|
16425
|
-
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
16426
|
-
}
|
|
16427
|
-
function ownKeys(e, r) {
|
|
16428
|
-
var t = Object.keys(e);
|
|
16429
|
-
if (Object.getOwnPropertySymbols) {
|
|
16430
|
-
var o = Object.getOwnPropertySymbols(e);
|
|
16431
|
-
r && (o = o.filter(function(r2) {
|
|
16432
|
-
return Object.getOwnPropertyDescriptor(e, r2).enumerable;
|
|
16433
|
-
})), t.push.apply(t, o);
|
|
16434
|
-
}
|
|
16435
|
-
return t;
|
|
16436
|
-
}
|
|
16437
|
-
function _objectSpread2(e) {
|
|
16438
|
-
for (var r = 1; r < arguments.length; r++) {
|
|
16439
|
-
var t = null != arguments[r] ? arguments[r] : {};
|
|
16440
|
-
r % 2 ? ownKeys(Object(t), true).forEach(function(r2) {
|
|
16441
|
-
_defineProperty(e, r2, t[r2]);
|
|
16442
|
-
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function(r2) {
|
|
16443
|
-
Object.defineProperty(e, r2, Object.getOwnPropertyDescriptor(t, r2));
|
|
16444
|
-
});
|
|
16445
|
-
}
|
|
16446
|
-
return e;
|
|
16447
|
-
}
|
|
16448
|
-
function _objectWithoutProperties(e, t) {
|
|
16449
|
-
if (null == e) return {};
|
|
16450
|
-
var o, r, i = _objectWithoutPropertiesLoose(e, t);
|
|
16451
|
-
if (Object.getOwnPropertySymbols) {
|
|
16452
|
-
var s = Object.getOwnPropertySymbols(e);
|
|
16453
|
-
for (r = 0; r < s.length; r++) o = s[r], t.includes(o) || {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]);
|
|
16454
|
-
}
|
|
16455
|
-
return i;
|
|
16456
|
-
}
|
|
16457
|
-
function _objectWithoutPropertiesLoose(r, e) {
|
|
16458
|
-
if (null == r) return {};
|
|
16459
|
-
var t = {};
|
|
16460
|
-
for (var n in r) if ({}.hasOwnProperty.call(r, n)) {
|
|
16461
|
-
if (e.includes(n)) continue;
|
|
16462
|
-
t[n] = r[n];
|
|
16463
|
-
}
|
|
16464
|
-
return t;
|
|
16465
|
-
}
|
|
16466
|
-
function _slicedToArray(r, e) {
|
|
16467
|
-
return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest();
|
|
16468
|
-
}
|
|
16469
|
-
function _toPrimitive(t, r) {
|
|
16470
|
-
if ("object" != typeof t || !t) return t;
|
|
16471
|
-
var e = t[Symbol.toPrimitive];
|
|
16472
|
-
if (void 0 !== e) {
|
|
16473
|
-
var i = e.call(t, r || "default");
|
|
16474
|
-
if ("object" != typeof i) return i;
|
|
16475
|
-
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
16476
|
-
}
|
|
16477
|
-
return ("string" === r ? String : Number)(t);
|
|
16478
|
-
}
|
|
16479
|
-
function _toPropertyKey(t) {
|
|
16480
|
-
var i = _toPrimitive(t, "string");
|
|
16481
|
-
return "symbol" == typeof i ? i : i + "";
|
|
16482
|
-
}
|
|
16483
|
-
function _unsupportedIterableToArray(r, a) {
|
|
16484
|
-
if (r) {
|
|
16485
|
-
if ("string" == typeof r) return _arrayLikeToArray(r, a);
|
|
16486
|
-
var t = {}.toString.call(r).slice(8, -1);
|
|
16487
|
-
return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0;
|
|
16488
|
-
}
|
|
16489
|
-
}
|
|
16490
|
-
function getContainerVisibility(container) {
|
|
16491
|
-
var _container$getBoundin = container.getBoundingClientRect(), top = _container$getBoundin.top, height2 = _container$getBoundin.height;
|
|
16492
|
-
var current = window.innerHeight - top;
|
|
16493
|
-
var max = window.innerHeight + height2;
|
|
16494
|
-
return current / max;
|
|
16495
|
-
}
|
|
16496
|
-
function getContainerCursorPosition(container, cursorX, cursorY) {
|
|
16497
|
-
var _container$getBoundin2 = container.getBoundingClientRect(), top = _container$getBoundin2.top, left = _container$getBoundin2.left, width2 = _container$getBoundin2.width, height2 = _container$getBoundin2.height;
|
|
16498
|
-
var x = (cursorX - left) / width2;
|
|
16499
|
-
var y = (cursorY - top) / height2;
|
|
16500
|
-
return {
|
|
16501
|
-
x,
|
|
16502
|
-
y
|
|
16503
|
-
};
|
|
16504
|
-
}
|
|
16505
|
-
var import_lottie_web, import_lottie_web2, import_react43, _excluded$1, useLottie, useInitInteractivity, useLottieInteractivity, _excluded, Lottie;
|
|
16506
|
-
var init_index_es = __esm({
|
|
16507
|
-
"node_modules/lottie-react/build/index.es.js"() {
|
|
16508
|
-
"use strict";
|
|
16509
|
-
import_lottie_web = __toESM(require_lottie());
|
|
16510
|
-
import_lottie_web2 = __toESM(require_lottie());
|
|
16511
|
-
import_react43 = __toESM(require("react"));
|
|
16512
|
-
_excluded$1 = ["animationData", "loop", "autoplay", "initialSegment", "onComplete", "onLoopComplete", "onEnterFrame", "onSegmentStart", "onConfigReady", "onDataReady", "onDataFailed", "onLoadedImages", "onDOMLoaded", "onDestroy", "lottieRef", "renderer", "name", "assetsPath", "rendererSettings"];
|
|
16513
|
-
useLottie = function useLottie2(props, style) {
|
|
16514
|
-
var animationData2 = props.animationData, loop = props.loop, autoplay = props.autoplay, initialSegment = props.initialSegment, onComplete = props.onComplete, onLoopComplete = props.onLoopComplete, onEnterFrame = props.onEnterFrame, onSegmentStart = props.onSegmentStart, onConfigReady = props.onConfigReady, onDataReady = props.onDataReady, onDataFailed = props.onDataFailed, onLoadedImages = props.onLoadedImages, onDOMLoaded = props.onDOMLoaded, onDestroy = props.onDestroy;
|
|
16515
|
-
props.lottieRef;
|
|
16516
|
-
props.renderer;
|
|
16517
|
-
props.name;
|
|
16518
|
-
props.assetsPath;
|
|
16519
|
-
props.rendererSettings;
|
|
16520
|
-
var rest = _objectWithoutProperties(props, _excluded$1);
|
|
16521
|
-
var _useState = (0, import_react43.useState)(false), _useState2 = _slicedToArray(_useState, 2), animationLoaded = _useState2[0], setAnimationLoaded = _useState2[1];
|
|
16522
|
-
var animationInstanceRef = (0, import_react43.useRef)();
|
|
16523
|
-
var animationContainer = (0, import_react43.useRef)(null);
|
|
16524
|
-
var play = function play2() {
|
|
16525
|
-
var _a;
|
|
16526
|
-
(_a = animationInstanceRef.current) === null || _a === void 0 ? void 0 : _a.play();
|
|
16527
|
-
};
|
|
16528
|
-
var stop = function stop2() {
|
|
16529
|
-
var _a;
|
|
16530
|
-
(_a = animationInstanceRef.current) === null || _a === void 0 ? void 0 : _a.stop();
|
|
16531
|
-
};
|
|
16532
|
-
var pause = function pause2() {
|
|
16533
|
-
var _a;
|
|
16534
|
-
(_a = animationInstanceRef.current) === null || _a === void 0 ? void 0 : _a.pause();
|
|
16535
|
-
};
|
|
16536
|
-
var setSpeed = function setSpeed2(speed) {
|
|
16537
|
-
var _a;
|
|
16538
|
-
(_a = animationInstanceRef.current) === null || _a === void 0 ? void 0 : _a.setSpeed(speed);
|
|
16539
|
-
};
|
|
16540
|
-
var goToAndPlay = function goToAndPlay2(value2, isFrame) {
|
|
16541
|
-
var _a;
|
|
16542
|
-
(_a = animationInstanceRef.current) === null || _a === void 0 ? void 0 : _a.goToAndPlay(value2, isFrame);
|
|
16543
|
-
};
|
|
16544
|
-
var goToAndStop = function goToAndStop2(value2, isFrame) {
|
|
16545
|
-
var _a;
|
|
16546
|
-
(_a = animationInstanceRef.current) === null || _a === void 0 ? void 0 : _a.goToAndStop(value2, isFrame);
|
|
16547
|
-
};
|
|
16548
|
-
var setDirection = function setDirection2(direction) {
|
|
16549
|
-
var _a;
|
|
16550
|
-
(_a = animationInstanceRef.current) === null || _a === void 0 ? void 0 : _a.setDirection(direction);
|
|
16551
|
-
};
|
|
16552
|
-
var playSegments = function playSegments2(segments, forceFlag) {
|
|
16553
|
-
var _a;
|
|
16554
|
-
(_a = animationInstanceRef.current) === null || _a === void 0 ? void 0 : _a.playSegments(segments, forceFlag);
|
|
16555
|
-
};
|
|
16556
|
-
var setSubframe = function setSubframe2(useSubFrames) {
|
|
16557
|
-
var _a;
|
|
16558
|
-
(_a = animationInstanceRef.current) === null || _a === void 0 ? void 0 : _a.setSubframe(useSubFrames);
|
|
16559
|
-
};
|
|
16560
|
-
var getDuration = function getDuration2(inFrames) {
|
|
16561
|
-
var _a;
|
|
16562
|
-
return (_a = animationInstanceRef.current) === null || _a === void 0 ? void 0 : _a.getDuration(inFrames);
|
|
16563
|
-
};
|
|
16564
|
-
var destroy = function destroy2() {
|
|
16565
|
-
var _a;
|
|
16566
|
-
(_a = animationInstanceRef.current) === null || _a === void 0 ? void 0 : _a.destroy();
|
|
16567
|
-
animationInstanceRef.current = void 0;
|
|
16568
|
-
};
|
|
16569
|
-
var loadAnimation2 = function loadAnimation3() {
|
|
16570
|
-
var forcedConfigs = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
16571
|
-
var _a;
|
|
16572
|
-
if (!animationContainer.current) {
|
|
16573
|
-
return;
|
|
16574
|
-
}
|
|
16575
|
-
(_a = animationInstanceRef.current) === null || _a === void 0 ? void 0 : _a.destroy();
|
|
16576
|
-
var config = _objectSpread2(_objectSpread2(_objectSpread2({}, props), forcedConfigs), {}, {
|
|
16577
|
-
container: animationContainer.current
|
|
16578
|
-
});
|
|
16579
|
-
animationInstanceRef.current = import_lottie_web.default.loadAnimation(config);
|
|
16580
|
-
setAnimationLoaded(!!animationInstanceRef.current);
|
|
16581
|
-
return function() {
|
|
16582
|
-
var _a2;
|
|
16583
|
-
(_a2 = animationInstanceRef.current) === null || _a2 === void 0 ? void 0 : _a2.destroy();
|
|
16584
|
-
animationInstanceRef.current = void 0;
|
|
16585
|
-
};
|
|
16586
|
-
};
|
|
16587
|
-
(0, import_react43.useEffect)(function() {
|
|
16588
|
-
var onUnmount = loadAnimation2();
|
|
16589
|
-
return function() {
|
|
16590
|
-
return onUnmount === null || onUnmount === void 0 ? void 0 : onUnmount();
|
|
16591
|
-
};
|
|
16592
|
-
}, [animationData2, loop]);
|
|
16593
|
-
(0, import_react43.useEffect)(function() {
|
|
16594
|
-
if (!animationInstanceRef.current) {
|
|
16595
|
-
return;
|
|
16596
|
-
}
|
|
16597
|
-
animationInstanceRef.current.autoplay = !!autoplay;
|
|
16598
|
-
}, [autoplay]);
|
|
16599
|
-
(0, import_react43.useEffect)(function() {
|
|
16600
|
-
if (!animationInstanceRef.current) {
|
|
16601
|
-
return;
|
|
16602
|
-
}
|
|
16603
|
-
if (!initialSegment) {
|
|
16604
|
-
animationInstanceRef.current.resetSegments(true);
|
|
16605
|
-
return;
|
|
16606
|
-
}
|
|
16607
|
-
if (!Array.isArray(initialSegment) || !initialSegment.length) {
|
|
16608
|
-
return;
|
|
16609
|
-
}
|
|
16610
|
-
if (animationInstanceRef.current.currentRawFrame < initialSegment[0] || animationInstanceRef.current.currentRawFrame > initialSegment[1]) {
|
|
16611
|
-
animationInstanceRef.current.currentRawFrame = initialSegment[0];
|
|
16612
|
-
}
|
|
16613
|
-
animationInstanceRef.current.setSegment(initialSegment[0], initialSegment[1]);
|
|
16614
|
-
}, [initialSegment]);
|
|
16615
|
-
(0, import_react43.useEffect)(function() {
|
|
16616
|
-
var partialListeners = [{
|
|
16617
|
-
name: "complete",
|
|
16618
|
-
handler: onComplete
|
|
16619
|
-
}, {
|
|
16620
|
-
name: "loopComplete",
|
|
16621
|
-
handler: onLoopComplete
|
|
16622
|
-
}, {
|
|
16623
|
-
name: "enterFrame",
|
|
16624
|
-
handler: onEnterFrame
|
|
16625
|
-
}, {
|
|
16626
|
-
name: "segmentStart",
|
|
16627
|
-
handler: onSegmentStart
|
|
16628
|
-
}, {
|
|
16629
|
-
name: "config_ready",
|
|
16630
|
-
handler: onConfigReady
|
|
16631
|
-
}, {
|
|
16632
|
-
name: "data_ready",
|
|
16633
|
-
handler: onDataReady
|
|
16634
|
-
}, {
|
|
16635
|
-
name: "data_failed",
|
|
16636
|
-
handler: onDataFailed
|
|
16637
|
-
}, {
|
|
16638
|
-
name: "loaded_images",
|
|
16639
|
-
handler: onLoadedImages
|
|
16640
|
-
}, {
|
|
16641
|
-
name: "DOMLoaded",
|
|
16642
|
-
handler: onDOMLoaded
|
|
16643
|
-
}, {
|
|
16644
|
-
name: "destroy",
|
|
16645
|
-
handler: onDestroy
|
|
16646
|
-
}];
|
|
16647
|
-
var listeners = partialListeners.filter(function(listener) {
|
|
16648
|
-
return listener.handler != null;
|
|
16649
|
-
});
|
|
16650
|
-
if (!listeners.length) {
|
|
16651
|
-
return;
|
|
16652
|
-
}
|
|
16653
|
-
var deregisterList = listeners.map(
|
|
16654
|
-
/**
|
|
16655
|
-
* Handle the process of adding an event listener
|
|
16656
|
-
* @param {Listener} listener
|
|
16657
|
-
* @return {Function} Function that deregister the listener
|
|
16658
|
-
*/
|
|
16659
|
-
function(listener) {
|
|
16660
|
-
var _a;
|
|
16661
|
-
(_a = animationInstanceRef.current) === null || _a === void 0 ? void 0 : _a.addEventListener(listener.name, listener.handler);
|
|
16662
|
-
return function() {
|
|
16663
|
-
var _a2;
|
|
16664
|
-
(_a2 = animationInstanceRef.current) === null || _a2 === void 0 ? void 0 : _a2.removeEventListener(listener.name, listener.handler);
|
|
16665
|
-
};
|
|
16666
|
-
}
|
|
16667
|
-
);
|
|
16668
|
-
return function() {
|
|
16669
|
-
deregisterList.forEach(function(deregister) {
|
|
16670
|
-
return deregister();
|
|
16671
|
-
});
|
|
16672
|
-
};
|
|
16673
|
-
}, [onComplete, onLoopComplete, onEnterFrame, onSegmentStart, onConfigReady, onDataReady, onDataFailed, onLoadedImages, onDOMLoaded, onDestroy]);
|
|
16674
|
-
var View = /* @__PURE__ */ import_react43.default.createElement("div", _objectSpread2({
|
|
16675
|
-
style,
|
|
16676
|
-
ref: animationContainer
|
|
16677
|
-
}, rest));
|
|
16678
|
-
return {
|
|
16679
|
-
View,
|
|
16680
|
-
play,
|
|
16681
|
-
stop,
|
|
16682
|
-
pause,
|
|
16683
|
-
setSpeed,
|
|
16684
|
-
goToAndStop,
|
|
16685
|
-
goToAndPlay,
|
|
16686
|
-
setDirection,
|
|
16687
|
-
playSegments,
|
|
16688
|
-
setSubframe,
|
|
16689
|
-
getDuration,
|
|
16690
|
-
destroy,
|
|
16691
|
-
animationContainerRef: animationContainer,
|
|
16692
|
-
animationLoaded,
|
|
16693
|
-
animationItem: animationInstanceRef.current
|
|
16694
|
-
};
|
|
16695
|
-
};
|
|
16696
|
-
useInitInteractivity = function useInitInteractivity2(_ref) {
|
|
16697
|
-
var wrapperRef = _ref.wrapperRef, animationItem = _ref.animationItem, mode = _ref.mode, actions = _ref.actions;
|
|
16698
|
-
(0, import_react43.useEffect)(function() {
|
|
16699
|
-
var wrapper = wrapperRef.current;
|
|
16700
|
-
if (!wrapper || !animationItem || !actions.length) {
|
|
16701
|
-
return;
|
|
16702
|
-
}
|
|
16703
|
-
animationItem.stop();
|
|
16704
|
-
var scrollModeHandler = function scrollModeHandler2() {
|
|
16705
|
-
var assignedSegment = null;
|
|
16706
|
-
var scrollHandler = function scrollHandler2() {
|
|
16707
|
-
var currentPercent = getContainerVisibility(wrapper);
|
|
16708
|
-
var action = actions.find(function(_ref2) {
|
|
16709
|
-
var visibility = _ref2.visibility;
|
|
16710
|
-
return visibility && currentPercent >= visibility[0] && currentPercent <= visibility[1];
|
|
16711
|
-
});
|
|
16712
|
-
if (!action) {
|
|
16713
|
-
return;
|
|
16714
|
-
}
|
|
16715
|
-
if (action.type === "seek" && action.visibility && action.frames.length === 2) {
|
|
16716
|
-
var frameToGo = action.frames[0] + Math.ceil((currentPercent - action.visibility[0]) / (action.visibility[1] - action.visibility[0]) * action.frames[1]);
|
|
16717
|
-
animationItem.goToAndStop(frameToGo - animationItem.firstFrame - 1, true);
|
|
16718
|
-
}
|
|
16719
|
-
if (action.type === "loop") {
|
|
16720
|
-
if (assignedSegment === null) {
|
|
16721
|
-
animationItem.playSegments(action.frames, true);
|
|
16722
|
-
assignedSegment = action.frames;
|
|
16723
|
-
} else {
|
|
16724
|
-
if (assignedSegment !== action.frames) {
|
|
16725
|
-
animationItem.playSegments(action.frames, true);
|
|
16726
|
-
assignedSegment = action.frames;
|
|
16727
|
-
} else if (animationItem.isPaused) {
|
|
16728
|
-
animationItem.playSegments(action.frames, true);
|
|
16729
|
-
assignedSegment = action.frames;
|
|
16730
|
-
}
|
|
16731
|
-
}
|
|
16732
|
-
}
|
|
16733
|
-
if (action.type === "play" && animationItem.isPaused) {
|
|
16734
|
-
animationItem.resetSegments(true);
|
|
16735
|
-
animationItem.play();
|
|
16736
|
-
}
|
|
16737
|
-
if (action.type === "stop") {
|
|
16738
|
-
animationItem.goToAndStop(action.frames[0] - animationItem.firstFrame - 1, true);
|
|
16739
|
-
}
|
|
16740
|
-
};
|
|
16741
|
-
document.addEventListener("scroll", scrollHandler);
|
|
16742
|
-
return function() {
|
|
16743
|
-
document.removeEventListener("scroll", scrollHandler);
|
|
16744
|
-
};
|
|
16745
|
-
};
|
|
16746
|
-
var cursorModeHandler = function cursorModeHandler2() {
|
|
16747
|
-
var handleCursor = function handleCursor2(_x, _y) {
|
|
16748
|
-
var x = _x;
|
|
16749
|
-
var y = _y;
|
|
16750
|
-
if (x !== -1 && y !== -1) {
|
|
16751
|
-
var pos = getContainerCursorPosition(wrapper, x, y);
|
|
16752
|
-
x = pos.x;
|
|
16753
|
-
y = pos.y;
|
|
16754
|
-
}
|
|
16755
|
-
var action = actions.find(function(_ref3) {
|
|
16756
|
-
var position2 = _ref3.position;
|
|
16757
|
-
if (position2 && Array.isArray(position2.x) && Array.isArray(position2.y)) {
|
|
16758
|
-
return x >= position2.x[0] && x <= position2.x[1] && y >= position2.y[0] && y <= position2.y[1];
|
|
16759
|
-
}
|
|
16760
|
-
if (position2 && !Number.isNaN(position2.x) && !Number.isNaN(position2.y)) {
|
|
16761
|
-
return x === position2.x && y === position2.y;
|
|
16762
|
-
}
|
|
16763
|
-
return false;
|
|
16764
|
-
});
|
|
16765
|
-
if (!action) {
|
|
16766
|
-
return;
|
|
16767
|
-
}
|
|
16768
|
-
if (action.type === "seek" && action.position && Array.isArray(action.position.x) && Array.isArray(action.position.y) && action.frames.length === 2) {
|
|
16769
|
-
var xPercent = (x - action.position.x[0]) / (action.position.x[1] - action.position.x[0]);
|
|
16770
|
-
var yPercent = (y - action.position.y[0]) / (action.position.y[1] - action.position.y[0]);
|
|
16771
|
-
animationItem.playSegments(action.frames, true);
|
|
16772
|
-
animationItem.goToAndStop(Math.ceil((xPercent + yPercent) / 2 * (action.frames[1] - action.frames[0])), true);
|
|
16773
|
-
}
|
|
16774
|
-
if (action.type === "loop") {
|
|
16775
|
-
animationItem.playSegments(action.frames, true);
|
|
16776
|
-
}
|
|
16777
|
-
if (action.type === "play") {
|
|
16778
|
-
if (animationItem.isPaused) {
|
|
16779
|
-
animationItem.resetSegments(false);
|
|
16780
|
-
}
|
|
16781
|
-
animationItem.playSegments(action.frames);
|
|
16782
|
-
}
|
|
16783
|
-
if (action.type === "stop") {
|
|
16784
|
-
animationItem.goToAndStop(action.frames[0], true);
|
|
16785
|
-
}
|
|
16786
|
-
};
|
|
16787
|
-
var mouseMoveHandler = function mouseMoveHandler2(ev) {
|
|
16788
|
-
handleCursor(ev.clientX, ev.clientY);
|
|
16789
|
-
};
|
|
16790
|
-
var mouseOutHandler = function mouseOutHandler2() {
|
|
16791
|
-
handleCursor(-1, -1);
|
|
16792
|
-
};
|
|
16793
|
-
wrapper.addEventListener("mousemove", mouseMoveHandler);
|
|
16794
|
-
wrapper.addEventListener("mouseout", mouseOutHandler);
|
|
16795
|
-
return function() {
|
|
16796
|
-
wrapper.removeEventListener("mousemove", mouseMoveHandler);
|
|
16797
|
-
wrapper.removeEventListener("mouseout", mouseOutHandler);
|
|
16798
|
-
};
|
|
16799
|
-
};
|
|
16800
|
-
switch (mode) {
|
|
16801
|
-
case "scroll":
|
|
16802
|
-
return scrollModeHandler();
|
|
16803
|
-
case "cursor":
|
|
16804
|
-
return cursorModeHandler();
|
|
16805
|
-
}
|
|
16806
|
-
}, [mode, animationItem]);
|
|
16807
|
-
};
|
|
16808
|
-
useLottieInteractivity = function useLottieInteractivity2(_ref4) {
|
|
16809
|
-
var actions = _ref4.actions, mode = _ref4.mode, lottieObj = _ref4.lottieObj;
|
|
16810
|
-
var animationItem = lottieObj.animationItem, View = lottieObj.View, animationContainerRef = lottieObj.animationContainerRef;
|
|
16811
|
-
useInitInteractivity({
|
|
16812
|
-
actions,
|
|
16813
|
-
animationItem,
|
|
16814
|
-
mode,
|
|
16815
|
-
wrapperRef: animationContainerRef
|
|
16816
|
-
});
|
|
16817
|
-
return View;
|
|
16818
|
-
};
|
|
16819
|
-
_excluded = ["style", "interactivity"];
|
|
16820
|
-
Lottie = function Lottie2(props) {
|
|
16821
|
-
var _a, _b, _c;
|
|
16822
|
-
var style = props.style, interactivity = props.interactivity, lottieProps = _objectWithoutProperties(props, _excluded);
|
|
16823
|
-
var _useLottie = useLottie(lottieProps, style), View = _useLottie.View, play = _useLottie.play, stop = _useLottie.stop, pause = _useLottie.pause, setSpeed = _useLottie.setSpeed, goToAndStop = _useLottie.goToAndStop, goToAndPlay = _useLottie.goToAndPlay, setDirection = _useLottie.setDirection, playSegments = _useLottie.playSegments, setSubframe = _useLottie.setSubframe, getDuration = _useLottie.getDuration, destroy = _useLottie.destroy, animationContainerRef = _useLottie.animationContainerRef, animationLoaded = _useLottie.animationLoaded, animationItem = _useLottie.animationItem;
|
|
16824
|
-
(0, import_react43.useEffect)(function() {
|
|
16825
|
-
if (props.lottieRef) {
|
|
16826
|
-
props.lottieRef.current = {
|
|
16827
|
-
play,
|
|
16828
|
-
stop,
|
|
16829
|
-
pause,
|
|
16830
|
-
setSpeed,
|
|
16831
|
-
goToAndPlay,
|
|
16832
|
-
goToAndStop,
|
|
16833
|
-
setDirection,
|
|
16834
|
-
playSegments,
|
|
16835
|
-
setSubframe,
|
|
16836
|
-
getDuration,
|
|
16837
|
-
destroy,
|
|
16838
|
-
animationContainerRef,
|
|
16839
|
-
animationLoaded,
|
|
16840
|
-
animationItem
|
|
16841
|
-
};
|
|
16842
|
-
}
|
|
16843
|
-
}, [(_a = props.lottieRef) === null || _a === void 0 ? void 0 : _a.current]);
|
|
16844
|
-
return useLottieInteractivity({
|
|
16845
|
-
lottieObj: {
|
|
16846
|
-
View,
|
|
16847
|
-
play,
|
|
16848
|
-
stop,
|
|
16849
|
-
pause,
|
|
16850
|
-
setSpeed,
|
|
16851
|
-
goToAndStop,
|
|
16852
|
-
goToAndPlay,
|
|
16853
|
-
setDirection,
|
|
16854
|
-
playSegments,
|
|
16855
|
-
setSubframe,
|
|
16856
|
-
getDuration,
|
|
16857
|
-
destroy,
|
|
16858
|
-
animationContainerRef,
|
|
16859
|
-
animationLoaded,
|
|
16860
|
-
animationItem
|
|
16861
|
-
},
|
|
16862
|
-
actions: (_b = interactivity === null || interactivity === void 0 ? void 0 : interactivity.actions) !== null && _b !== void 0 ? _b : [],
|
|
16863
|
-
mode: (_c = interactivity === null || interactivity === void 0 ? void 0 : interactivity.mode) !== null && _c !== void 0 ? _c : "scroll"
|
|
16864
|
-
});
|
|
16865
|
-
};
|
|
16866
|
-
}
|
|
16867
|
-
});
|
|
16868
|
-
|
|
16869
16376
|
// src/ui/index.ts
|
|
16870
16377
|
var ui_exports = {};
|
|
16871
16378
|
__export(ui_exports, {
|
|
@@ -18401,18 +17908,307 @@ function Tabs(props) {
|
|
|
18401
17908
|
}) });
|
|
18402
17909
|
}
|
|
18403
17910
|
|
|
17911
|
+
// node_modules/lottie-react/build/index.es.js
|
|
17912
|
+
var import_lottie_web = __toESM(require_lottie());
|
|
17913
|
+
var import_lottie_web2 = __toESM(require_lottie());
|
|
17914
|
+
var import_react43 = __toESM(require("react"));
|
|
17915
|
+
function _arrayLikeToArray(r, a) {
|
|
17916
|
+
(null == a || a > r.length) && (a = r.length);
|
|
17917
|
+
for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];
|
|
17918
|
+
return n;
|
|
17919
|
+
}
|
|
17920
|
+
function _arrayWithHoles(r) {
|
|
17921
|
+
if (Array.isArray(r)) return r;
|
|
17922
|
+
}
|
|
17923
|
+
function _defineProperty(e, r, t) {
|
|
17924
|
+
return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
|
|
17925
|
+
value: t,
|
|
17926
|
+
enumerable: true,
|
|
17927
|
+
configurable: true,
|
|
17928
|
+
writable: true
|
|
17929
|
+
}) : e[r] = t, e;
|
|
17930
|
+
}
|
|
17931
|
+
function _iterableToArrayLimit(r, l) {
|
|
17932
|
+
var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
|
|
17933
|
+
if (null != t) {
|
|
17934
|
+
var e, n, i, u, a = [], f = true, o = false;
|
|
17935
|
+
try {
|
|
17936
|
+
if (i = (t = t.call(r)).next, 0 === l) {
|
|
17937
|
+
if (Object(t) !== t) return;
|
|
17938
|
+
f = false;
|
|
17939
|
+
} else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = true) ;
|
|
17940
|
+
} catch (r2) {
|
|
17941
|
+
o = true, n = r2;
|
|
17942
|
+
} finally {
|
|
17943
|
+
try {
|
|
17944
|
+
if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return;
|
|
17945
|
+
} finally {
|
|
17946
|
+
if (o) throw n;
|
|
17947
|
+
}
|
|
17948
|
+
}
|
|
17949
|
+
return a;
|
|
17950
|
+
}
|
|
17951
|
+
}
|
|
17952
|
+
function _nonIterableRest() {
|
|
17953
|
+
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
17954
|
+
}
|
|
17955
|
+
function ownKeys(e, r) {
|
|
17956
|
+
var t = Object.keys(e);
|
|
17957
|
+
if (Object.getOwnPropertySymbols) {
|
|
17958
|
+
var o = Object.getOwnPropertySymbols(e);
|
|
17959
|
+
r && (o = o.filter(function(r2) {
|
|
17960
|
+
return Object.getOwnPropertyDescriptor(e, r2).enumerable;
|
|
17961
|
+
})), t.push.apply(t, o);
|
|
17962
|
+
}
|
|
17963
|
+
return t;
|
|
17964
|
+
}
|
|
17965
|
+
function _objectSpread2(e) {
|
|
17966
|
+
for (var r = 1; r < arguments.length; r++) {
|
|
17967
|
+
var t = null != arguments[r] ? arguments[r] : {};
|
|
17968
|
+
r % 2 ? ownKeys(Object(t), true).forEach(function(r2) {
|
|
17969
|
+
_defineProperty(e, r2, t[r2]);
|
|
17970
|
+
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function(r2) {
|
|
17971
|
+
Object.defineProperty(e, r2, Object.getOwnPropertyDescriptor(t, r2));
|
|
17972
|
+
});
|
|
17973
|
+
}
|
|
17974
|
+
return e;
|
|
17975
|
+
}
|
|
17976
|
+
function _objectWithoutProperties(e, t) {
|
|
17977
|
+
if (null == e) return {};
|
|
17978
|
+
var o, r, i = _objectWithoutPropertiesLoose(e, t);
|
|
17979
|
+
if (Object.getOwnPropertySymbols) {
|
|
17980
|
+
var s = Object.getOwnPropertySymbols(e);
|
|
17981
|
+
for (r = 0; r < s.length; r++) o = s[r], t.includes(o) || {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]);
|
|
17982
|
+
}
|
|
17983
|
+
return i;
|
|
17984
|
+
}
|
|
17985
|
+
function _objectWithoutPropertiesLoose(r, e) {
|
|
17986
|
+
if (null == r) return {};
|
|
17987
|
+
var t = {};
|
|
17988
|
+
for (var n in r) if ({}.hasOwnProperty.call(r, n)) {
|
|
17989
|
+
if (e.includes(n)) continue;
|
|
17990
|
+
t[n] = r[n];
|
|
17991
|
+
}
|
|
17992
|
+
return t;
|
|
17993
|
+
}
|
|
17994
|
+
function _slicedToArray(r, e) {
|
|
17995
|
+
return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest();
|
|
17996
|
+
}
|
|
17997
|
+
function _toPrimitive(t, r) {
|
|
17998
|
+
if ("object" != typeof t || !t) return t;
|
|
17999
|
+
var e = t[Symbol.toPrimitive];
|
|
18000
|
+
if (void 0 !== e) {
|
|
18001
|
+
var i = e.call(t, r || "default");
|
|
18002
|
+
if ("object" != typeof i) return i;
|
|
18003
|
+
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
18004
|
+
}
|
|
18005
|
+
return ("string" === r ? String : Number)(t);
|
|
18006
|
+
}
|
|
18007
|
+
function _toPropertyKey(t) {
|
|
18008
|
+
var i = _toPrimitive(t, "string");
|
|
18009
|
+
return "symbol" == typeof i ? i : i + "";
|
|
18010
|
+
}
|
|
18011
|
+
function _unsupportedIterableToArray(r, a) {
|
|
18012
|
+
if (r) {
|
|
18013
|
+
if ("string" == typeof r) return _arrayLikeToArray(r, a);
|
|
18014
|
+
var t = {}.toString.call(r).slice(8, -1);
|
|
18015
|
+
return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0;
|
|
18016
|
+
}
|
|
18017
|
+
}
|
|
18018
|
+
var _excluded$1 = ["animationData", "loop", "autoplay", "initialSegment", "onComplete", "onLoopComplete", "onEnterFrame", "onSegmentStart", "onConfigReady", "onDataReady", "onDataFailed", "onLoadedImages", "onDOMLoaded", "onDestroy", "lottieRef", "renderer", "name", "assetsPath", "rendererSettings"];
|
|
18019
|
+
var useLottie = function useLottie2(props, style) {
|
|
18020
|
+
var animationData2 = props.animationData, loop = props.loop, autoplay = props.autoplay, initialSegment = props.initialSegment, onComplete = props.onComplete, onLoopComplete = props.onLoopComplete, onEnterFrame = props.onEnterFrame, onSegmentStart = props.onSegmentStart, onConfigReady = props.onConfigReady, onDataReady = props.onDataReady, onDataFailed = props.onDataFailed, onLoadedImages = props.onLoadedImages, onDOMLoaded = props.onDOMLoaded, onDestroy = props.onDestroy;
|
|
18021
|
+
props.lottieRef;
|
|
18022
|
+
props.renderer;
|
|
18023
|
+
props.name;
|
|
18024
|
+
props.assetsPath;
|
|
18025
|
+
props.rendererSettings;
|
|
18026
|
+
var rest = _objectWithoutProperties(props, _excluded$1);
|
|
18027
|
+
var _useState = (0, import_react43.useState)(false), _useState2 = _slicedToArray(_useState, 2), animationLoaded = _useState2[0], setAnimationLoaded = _useState2[1];
|
|
18028
|
+
var animationInstanceRef = (0, import_react43.useRef)();
|
|
18029
|
+
var animationContainer = (0, import_react43.useRef)(null);
|
|
18030
|
+
var play = function play2() {
|
|
18031
|
+
var _a;
|
|
18032
|
+
(_a = animationInstanceRef.current) === null || _a === void 0 ? void 0 : _a.play();
|
|
18033
|
+
};
|
|
18034
|
+
var stop = function stop2() {
|
|
18035
|
+
var _a;
|
|
18036
|
+
(_a = animationInstanceRef.current) === null || _a === void 0 ? void 0 : _a.stop();
|
|
18037
|
+
};
|
|
18038
|
+
var pause = function pause2() {
|
|
18039
|
+
var _a;
|
|
18040
|
+
(_a = animationInstanceRef.current) === null || _a === void 0 ? void 0 : _a.pause();
|
|
18041
|
+
};
|
|
18042
|
+
var setSpeed = function setSpeed2(speed) {
|
|
18043
|
+
var _a;
|
|
18044
|
+
(_a = animationInstanceRef.current) === null || _a === void 0 ? void 0 : _a.setSpeed(speed);
|
|
18045
|
+
};
|
|
18046
|
+
var goToAndPlay = function goToAndPlay2(value2, isFrame) {
|
|
18047
|
+
var _a;
|
|
18048
|
+
(_a = animationInstanceRef.current) === null || _a === void 0 ? void 0 : _a.goToAndPlay(value2, isFrame);
|
|
18049
|
+
};
|
|
18050
|
+
var goToAndStop = function goToAndStop2(value2, isFrame) {
|
|
18051
|
+
var _a;
|
|
18052
|
+
(_a = animationInstanceRef.current) === null || _a === void 0 ? void 0 : _a.goToAndStop(value2, isFrame);
|
|
18053
|
+
};
|
|
18054
|
+
var setDirection = function setDirection2(direction) {
|
|
18055
|
+
var _a;
|
|
18056
|
+
(_a = animationInstanceRef.current) === null || _a === void 0 ? void 0 : _a.setDirection(direction);
|
|
18057
|
+
};
|
|
18058
|
+
var playSegments = function playSegments2(segments, forceFlag) {
|
|
18059
|
+
var _a;
|
|
18060
|
+
(_a = animationInstanceRef.current) === null || _a === void 0 ? void 0 : _a.playSegments(segments, forceFlag);
|
|
18061
|
+
};
|
|
18062
|
+
var setSubframe = function setSubframe2(useSubFrames) {
|
|
18063
|
+
var _a;
|
|
18064
|
+
(_a = animationInstanceRef.current) === null || _a === void 0 ? void 0 : _a.setSubframe(useSubFrames);
|
|
18065
|
+
};
|
|
18066
|
+
var getDuration = function getDuration2(inFrames) {
|
|
18067
|
+
var _a;
|
|
18068
|
+
return (_a = animationInstanceRef.current) === null || _a === void 0 ? void 0 : _a.getDuration(inFrames);
|
|
18069
|
+
};
|
|
18070
|
+
var destroy = function destroy2() {
|
|
18071
|
+
var _a;
|
|
18072
|
+
(_a = animationInstanceRef.current) === null || _a === void 0 ? void 0 : _a.destroy();
|
|
18073
|
+
animationInstanceRef.current = void 0;
|
|
18074
|
+
};
|
|
18075
|
+
var loadAnimation2 = function loadAnimation3() {
|
|
18076
|
+
var forcedConfigs = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
18077
|
+
var _a;
|
|
18078
|
+
if (!animationContainer.current) {
|
|
18079
|
+
return;
|
|
18080
|
+
}
|
|
18081
|
+
(_a = animationInstanceRef.current) === null || _a === void 0 ? void 0 : _a.destroy();
|
|
18082
|
+
var config = _objectSpread2(_objectSpread2(_objectSpread2({}, props), forcedConfigs), {}, {
|
|
18083
|
+
container: animationContainer.current
|
|
18084
|
+
});
|
|
18085
|
+
animationInstanceRef.current = import_lottie_web.default.loadAnimation(config);
|
|
18086
|
+
setAnimationLoaded(!!animationInstanceRef.current);
|
|
18087
|
+
return function() {
|
|
18088
|
+
var _a2;
|
|
18089
|
+
(_a2 = animationInstanceRef.current) === null || _a2 === void 0 ? void 0 : _a2.destroy();
|
|
18090
|
+
animationInstanceRef.current = void 0;
|
|
18091
|
+
};
|
|
18092
|
+
};
|
|
18093
|
+
(0, import_react43.useEffect)(function() {
|
|
18094
|
+
var onUnmount = loadAnimation2();
|
|
18095
|
+
return function() {
|
|
18096
|
+
return onUnmount === null || onUnmount === void 0 ? void 0 : onUnmount();
|
|
18097
|
+
};
|
|
18098
|
+
}, [animationData2, loop]);
|
|
18099
|
+
(0, import_react43.useEffect)(function() {
|
|
18100
|
+
if (!animationInstanceRef.current) {
|
|
18101
|
+
return;
|
|
18102
|
+
}
|
|
18103
|
+
animationInstanceRef.current.autoplay = !!autoplay;
|
|
18104
|
+
}, [autoplay]);
|
|
18105
|
+
(0, import_react43.useEffect)(function() {
|
|
18106
|
+
if (!animationInstanceRef.current) {
|
|
18107
|
+
return;
|
|
18108
|
+
}
|
|
18109
|
+
if (!initialSegment) {
|
|
18110
|
+
animationInstanceRef.current.resetSegments(true);
|
|
18111
|
+
return;
|
|
18112
|
+
}
|
|
18113
|
+
if (!Array.isArray(initialSegment) || !initialSegment.length) {
|
|
18114
|
+
return;
|
|
18115
|
+
}
|
|
18116
|
+
if (animationInstanceRef.current.currentRawFrame < initialSegment[0] || animationInstanceRef.current.currentRawFrame > initialSegment[1]) {
|
|
18117
|
+
animationInstanceRef.current.currentRawFrame = initialSegment[0];
|
|
18118
|
+
}
|
|
18119
|
+
animationInstanceRef.current.setSegment(initialSegment[0], initialSegment[1]);
|
|
18120
|
+
}, [initialSegment]);
|
|
18121
|
+
(0, import_react43.useEffect)(function() {
|
|
18122
|
+
var partialListeners = [{
|
|
18123
|
+
name: "complete",
|
|
18124
|
+
handler: onComplete
|
|
18125
|
+
}, {
|
|
18126
|
+
name: "loopComplete",
|
|
18127
|
+
handler: onLoopComplete
|
|
18128
|
+
}, {
|
|
18129
|
+
name: "enterFrame",
|
|
18130
|
+
handler: onEnterFrame
|
|
18131
|
+
}, {
|
|
18132
|
+
name: "segmentStart",
|
|
18133
|
+
handler: onSegmentStart
|
|
18134
|
+
}, {
|
|
18135
|
+
name: "config_ready",
|
|
18136
|
+
handler: onConfigReady
|
|
18137
|
+
}, {
|
|
18138
|
+
name: "data_ready",
|
|
18139
|
+
handler: onDataReady
|
|
18140
|
+
}, {
|
|
18141
|
+
name: "data_failed",
|
|
18142
|
+
handler: onDataFailed
|
|
18143
|
+
}, {
|
|
18144
|
+
name: "loaded_images",
|
|
18145
|
+
handler: onLoadedImages
|
|
18146
|
+
}, {
|
|
18147
|
+
name: "DOMLoaded",
|
|
18148
|
+
handler: onDOMLoaded
|
|
18149
|
+
}, {
|
|
18150
|
+
name: "destroy",
|
|
18151
|
+
handler: onDestroy
|
|
18152
|
+
}];
|
|
18153
|
+
var listeners = partialListeners.filter(function(listener) {
|
|
18154
|
+
return listener.handler != null;
|
|
18155
|
+
});
|
|
18156
|
+
if (!listeners.length) {
|
|
18157
|
+
return;
|
|
18158
|
+
}
|
|
18159
|
+
var deregisterList = listeners.map(
|
|
18160
|
+
/**
|
|
18161
|
+
* Handle the process of adding an event listener
|
|
18162
|
+
* @param {Listener} listener
|
|
18163
|
+
* @return {Function} Function that deregister the listener
|
|
18164
|
+
*/
|
|
18165
|
+
function(listener) {
|
|
18166
|
+
var _a;
|
|
18167
|
+
(_a = animationInstanceRef.current) === null || _a === void 0 ? void 0 : _a.addEventListener(listener.name, listener.handler);
|
|
18168
|
+
return function() {
|
|
18169
|
+
var _a2;
|
|
18170
|
+
(_a2 = animationInstanceRef.current) === null || _a2 === void 0 ? void 0 : _a2.removeEventListener(listener.name, listener.handler);
|
|
18171
|
+
};
|
|
18172
|
+
}
|
|
18173
|
+
);
|
|
18174
|
+
return function() {
|
|
18175
|
+
deregisterList.forEach(function(deregister) {
|
|
18176
|
+
return deregister();
|
|
18177
|
+
});
|
|
18178
|
+
};
|
|
18179
|
+
}, [onComplete, onLoopComplete, onEnterFrame, onSegmentStart, onConfigReady, onDataReady, onDataFailed, onLoadedImages, onDOMLoaded, onDestroy]);
|
|
18180
|
+
var View = /* @__PURE__ */ import_react43.default.createElement("div", _objectSpread2({
|
|
18181
|
+
style,
|
|
18182
|
+
ref: animationContainer
|
|
18183
|
+
}, rest));
|
|
18184
|
+
return {
|
|
18185
|
+
View,
|
|
18186
|
+
play,
|
|
18187
|
+
stop,
|
|
18188
|
+
pause,
|
|
18189
|
+
setSpeed,
|
|
18190
|
+
goToAndStop,
|
|
18191
|
+
goToAndPlay,
|
|
18192
|
+
setDirection,
|
|
18193
|
+
playSegments,
|
|
18194
|
+
setSubframe,
|
|
18195
|
+
getDuration,
|
|
18196
|
+
destroy,
|
|
18197
|
+
animationContainerRef: animationContainer,
|
|
18198
|
+
animationLoaded,
|
|
18199
|
+
animationItem: animationInstanceRef.current
|
|
18200
|
+
};
|
|
18201
|
+
};
|
|
18202
|
+
|
|
18404
18203
|
// src/ui/Lottie/index.tsx
|
|
18405
|
-
var import_react44 = require("react");
|
|
18406
|
-
var import_jsx_runtime99 = require("react/jsx-runtime");
|
|
18407
18204
|
var LazyLottie = (props) => {
|
|
18408
|
-
const
|
|
18409
|
-
|
|
18410
|
-
|
|
18411
|
-
|
|
18412
|
-
|
|
18413
|
-
},
|
|
18414
|
-
|
|
18415
|
-
return /* @__PURE__ */ (0, import_jsx_runtime99.jsx)(LottieReact, { loop: true, autoplay: true, ...props });
|
|
18205
|
+
const options = {
|
|
18206
|
+
animationData: props.animationData,
|
|
18207
|
+
loop: true,
|
|
18208
|
+
autoplay: true
|
|
18209
|
+
};
|
|
18210
|
+
const { View } = useLottie(options, props.style);
|
|
18211
|
+
return View;
|
|
18416
18212
|
};
|
|
18417
18213
|
var Lottie_default = LazyLottie;
|
|
18418
18214
|
// Annotate the CommonJS export names for ESM import in node:
|
|
@@ -18446,8 +18242,5 @@ lottie-web/build/player/lottie.js:
|
|
|
18446
18242
|
Contributions by leeoniya.
|
|
18447
18243
|
License: MIT, header required.
|
|
18448
18244
|
*)
|
|
18449
|
-
|
|
18450
|
-
lottie-react/build/index.es.js:
|
|
18451
|
-
(*! goToAndStop must be relative to the start of the current segment *)
|
|
18452
18245
|
*/
|
|
18453
18246
|
//# sourceMappingURL=ui.js.map
|