infinity-forge 4.4.1 → 4.4.3
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/ui/components/next-image/index.js +3 -1
- package/dist/ui/components/next-image/index.js.map +1 -1
- package/dist/ui/hooks/index.d.ts +1 -0
- package/dist/ui/hooks/index.js +1 -0
- package/dist/ui/hooks/index.js.map +1 -1
- package/dist/ui/hooks/use-timer/index.d.ts +2 -0
- package/dist/ui/hooks/use-timer/index.js +19 -0
- package/dist/ui/hooks/use-timer/index.js.map +1 -0
- package/dist/ui/hooks/use-timer/interfaces.d.ts +22 -0
- package/dist/ui/hooks/use-timer/interfaces.js +3 -0
- package/dist/ui/hooks/use-timer/interfaces.js.map +1 -0
- package/dist/ui/hooks/use-timer/use-timer.d.ts +17 -0
- package/dist/ui/hooks/use-timer/use-timer.js +55 -0
- package/dist/ui/hooks/use-timer/use-timer.js.map +1 -0
- package/dist/ui/utils/libs/moment/verify-date-and-return-value-formatted.d.ts +1 -1
- package/package.json +1 -1
|
@@ -28,13 +28,15 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
28
28
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
29
|
exports.NextImage = void 0;
|
|
30
30
|
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
31
|
+
var react_1 = require("react");
|
|
31
32
|
var image_1 = __importDefault(require("next/image"));
|
|
32
33
|
var error_boundary_1 = require("../error-boundary/index.js");
|
|
33
34
|
var loader_circle_1 = require("../loader-circle/index.js");
|
|
34
35
|
var S = __importStar(require("./styles.js"));
|
|
35
36
|
function NextImage(_a) {
|
|
36
37
|
var src = _a.src, alt = _a.alt, forceLoading = _a.forceLoading;
|
|
37
|
-
|
|
38
|
+
var _b = (0, react_1.useState)(false), error = _b[0], setError = _b[1];
|
|
39
|
+
return ((0, jsx_runtime_1.jsx)(error_boundary_1.Error, { name: 'next-image', children: (0, jsx_runtime_1.jsx)(S.Image, { children: forceLoading ? (0, jsx_runtime_1.jsx)(loader_circle_1.LoaderCircle, { size: 30, color: '#fff' }) : (0, jsx_runtime_1.jsx)(image_1.default, { fill: true, alt: alt || src, onError: function () { return setError(true); }, src: error ? "/images/default-image.png" : src }) }) }));
|
|
38
40
|
}
|
|
39
41
|
exports.NextImage = NextImage;
|
|
40
42
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/ui/components/next-image/index.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,qDAA8B;AAE9B,oDAAyC;AACzC,kDAA+C;AAI/C,0CAA6B;AAE7B,SAAgB,SAAS,CAAC,EAA0C;QAAxC,GAAG,SAAA,EAAE,GAAG,SAAA,EAAE,YAAY,kBAAA;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/ui/components/next-image/index.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+BAAgC;AAEhC,qDAA8B;AAE9B,oDAAyC;AACzC,kDAA+C;AAI/C,0CAA6B;AAE7B,SAAgB,SAAS,CAAC,EAA0C;QAAxC,GAAG,SAAA,EAAE,GAAG,SAAA,EAAE,YAAY,kBAAA;IAC1C,IAAA,KAAoB,IAAA,gBAAQ,EAAC,KAAK,CAAC,EAAlC,KAAK,QAAA,EAAE,QAAQ,QAAmB,CAAC;IAE1C,OAAO,CACL,uBAAC,sBAAK,IAAC,IAAI,EAAC,YAAY,YACtB,uBAAC,CAAC,CAAC,KAAK,cACL,YAAY,CAAC,CAAC,CAAC,uBAAC,4BAAY,IAAC,IAAI,EAAE,EAAE,EAAE,KAAK,EAAC,MAAM,GAAG,CAAC,CAAC,CAAC,uBAAC,eAAK,IAAC,IAAI,QAAC,GAAG,EAAE,GAAG,IAAI,GAAG,EAAE,OAAO,EAAE,cAAM,OAAA,QAAQ,CAAC,IAAI,CAAC,EAAd,CAAc,EAAE,GAAG,EAAE,KAAK,CAAC,CAAC,CAAC,2BAA2B,CAAC,CAAC,CAAC,GAAG,GAAI,GAChK,GACJ,CACT,CAAA;AACH,CAAC;AAVD,8BAUC"}
|
package/dist/ui/hooks/index.d.ts
CHANGED
package/dist/ui/hooks/index.js
CHANGED
|
@@ -14,6 +14,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./use-timer/index.js"), exports);
|
|
17
18
|
__exportStar(require("./use-window.js"), exports);
|
|
18
19
|
__exportStar(require("./use-scroll.js"), exports);
|
|
19
20
|
__exportStar(require("./permitions/index.js"), exports);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/ui/hooks/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,+CAA4B;AAC5B,+CAA4B;AAC5B,+CAA4B;AAC5B,mDAAgC;AAChC,6DAA0C"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/ui/hooks/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,8CAA2B;AAC3B,+CAA4B;AAC5B,+CAA4B;AAC5B,+CAA4B;AAC5B,mDAAgC;AAChC,6DAA0C"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./use-timer.js"), exports);
|
|
18
|
+
__exportStar(require("./interfaces.js"), exports);
|
|
19
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/ui/hooks/use-timer/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,8CAA2B;AAC3B,+CAA4B"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { Dispatch, SetStateAction } from "react";
|
|
2
|
+
export type UseTimerProps = {
|
|
3
|
+
time?: Date;
|
|
4
|
+
continuous?: boolean;
|
|
5
|
+
onPause?: (time: number) => void;
|
|
6
|
+
onFinish?: (time: number) => void;
|
|
7
|
+
};
|
|
8
|
+
export type UseTimerResponse = {
|
|
9
|
+
timerState: {
|
|
10
|
+
isPaused: boolean;
|
|
11
|
+
isFinished: boolean;
|
|
12
|
+
elapsedTime: number;
|
|
13
|
+
timeContinuous: number;
|
|
14
|
+
};
|
|
15
|
+
setTimerState: Dispatch<SetStateAction<{
|
|
16
|
+
isPaused: boolean;
|
|
17
|
+
isFinished: boolean;
|
|
18
|
+
elapsedTime: number;
|
|
19
|
+
timeContinuous: number;
|
|
20
|
+
}>>;
|
|
21
|
+
differenceBetwenContinuoustimerAndElapsedTime: number;
|
|
22
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../../../src/ui/hooks/use-timer/interfaces.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { UseTimerProps } from './interfaces.js';
|
|
3
|
+
export declare function useTimer({ time, onPause, onFinish, continuous }: UseTimerProps): {
|
|
4
|
+
timerState: {
|
|
5
|
+
isPaused: boolean;
|
|
6
|
+
isFinished: boolean;
|
|
7
|
+
elapsedTime: number;
|
|
8
|
+
timeContinuous: number;
|
|
9
|
+
};
|
|
10
|
+
setTimerState: import("react").Dispatch<import("react").SetStateAction<{
|
|
11
|
+
isPaused: boolean;
|
|
12
|
+
isFinished: boolean;
|
|
13
|
+
elapsedTime: number;
|
|
14
|
+
timeContinuous: number;
|
|
15
|
+
}>>;
|
|
16
|
+
differenceBetwenContinuoustimerAndElapsedTime: number;
|
|
17
|
+
};
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __assign = (this && this.__assign) || function () {
|
|
3
|
+
__assign = Object.assign || function(t) {
|
|
4
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
+
s = arguments[i];
|
|
6
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
+
t[p] = s[p];
|
|
8
|
+
}
|
|
9
|
+
return t;
|
|
10
|
+
};
|
|
11
|
+
return __assign.apply(this, arguments);
|
|
12
|
+
};
|
|
13
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
14
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
exports.useTimer = void 0;
|
|
18
|
+
var react_1 = require("react");
|
|
19
|
+
var moment_1 = __importDefault(require("moment"));
|
|
20
|
+
function useTimer(_a) {
|
|
21
|
+
var time = _a.time, onPause = _a.onPause, onFinish = _a.onFinish, _b = _a.continuous, continuous = _b === void 0 ? false : _b;
|
|
22
|
+
var _c = (0, react_1.useState)({
|
|
23
|
+
isPaused: false,
|
|
24
|
+
isFinished: false,
|
|
25
|
+
elapsedTime: 0,
|
|
26
|
+
timeContinuous: 0,
|
|
27
|
+
}), timerState = _c[0], setTimerState = _c[1];
|
|
28
|
+
(0, react_1.useEffect)(function () {
|
|
29
|
+
if (timerState.isPaused) {
|
|
30
|
+
onPause === null || onPause === void 0 ? void 0 : onPause(timerState.elapsedTime);
|
|
31
|
+
}
|
|
32
|
+
var interval = setInterval(function () {
|
|
33
|
+
if ((time && (0, moment_1.default)(time).isSame((0, moment_1.default)(timerState.elapsedTime))) || timerState.isFinished) {
|
|
34
|
+
return onFinish === null || onFinish === void 0 ? void 0 : onFinish(timerState.elapsedTime);
|
|
35
|
+
}
|
|
36
|
+
if (!timerState.isPaused) {
|
|
37
|
+
setTimerState(function (prev) { return (__assign(__assign({}, prev), { elapsedTime: prev.elapsedTime + 1000 })); });
|
|
38
|
+
}
|
|
39
|
+
if (continuous) {
|
|
40
|
+
setTimerState(function (prev) { return (__assign(__assign({}, prev), { timeContinuous: prev.timeContinuous + 1000 })); });
|
|
41
|
+
}
|
|
42
|
+
}, 1000);
|
|
43
|
+
return function () {
|
|
44
|
+
clearInterval(interval);
|
|
45
|
+
};
|
|
46
|
+
}, [timerState.isPaused, timerState.isFinished, timerState.elapsedTime]);
|
|
47
|
+
var differenceBetwenContinuoustimerAndElapsedTime = timerState.timeContinuous - timerState.elapsedTime;
|
|
48
|
+
return {
|
|
49
|
+
timerState: timerState,
|
|
50
|
+
setTimerState: setTimerState,
|
|
51
|
+
differenceBetwenContinuoustimerAndElapsedTime: differenceBetwenContinuoustimerAndElapsedTime,
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
exports.useTimer = useTimer;
|
|
55
|
+
//# sourceMappingURL=use-timer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-timer.js","sourceRoot":"","sources":["../../../../src/ui/hooks/use-timer/use-timer.tsx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AC,EAAE,IAAI,CAAC,CAAA;QAER,OAAO;YACL,aAAa,CAAC,QAAQ,CAAC,CAAA;QACzB,CAAC,CAAA;IACH,CAAC,EAAE,CAAC,UAAU,CAAC,QAAQ,EAAE,UAAU,CAAC,UAAU,EAAE,UAAU,CAAC,WAAW,CAAC,CAAC,CAAA;IAExE,IAAM,6CAA6C,GAAG,UAAU,CAAC,cAAc,GAAG,UAAU,CAAC,WAAW,CAAA;IAExG,OAAO;QACL,UAAU,YAAA;QACV,aAAa,eAAA;QACb,6CAA6C,+CAAA;KAC9C,CAAA;AACH,CAAC;AA7CD,4BA6CC"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
export type TransformValueToMomentFormatOptions = 'DD/MM/YYYY HH:mm' | 'DD/MM/YYYY' | "Data";
|
|
2
2
|
export declare function verifyDateStringIsValid(date: string): boolean;
|
|
3
|
-
export declare function transformValueToMomentFormat(value: string | string[], format: TransformValueToMomentFormatOptions): string | string[]
|
|
3
|
+
export declare function transformValueToMomentFormat(value: string | string[], format: TransformValueToMomentFormatOptions): string | Date | string[];
|