@rific/timer 0.2.3 → 0.3.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.
- package/dist/index.js +1 -1
- package/dist/index.mjs +2 -2
- package/package.json +15 -15
- package/src/Timer.tsx +2 -2
package/dist/index.js
CHANGED
|
@@ -46,7 +46,7 @@ var Timer = ({ children, color, duration, onStart, onStop, radius, startProgress
|
|
|
46
46
|
const progressRef = (0, import_react.useRef)(startProgress);
|
|
47
47
|
const startedRef = (0, import_react.useRef)(null);
|
|
48
48
|
const circumference = 2 * Math.PI * radius;
|
|
49
|
-
const animation = (0, import_react.
|
|
49
|
+
const [animation] = (0, import_react.useState)(() => new import_react_native.Animated.Value(0));
|
|
50
50
|
const animatedProps = {
|
|
51
51
|
strokeDashoffset: animation.interpolate({
|
|
52
52
|
inputRange: [0, 1],
|
package/dist/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// src/Timer.tsx
|
|
2
|
-
import { useCallback, useEffect, useRef } from "react";
|
|
2
|
+
import { useCallback, useEffect, useRef, useState } from "react";
|
|
3
3
|
import { Animated, Easing, StyleSheet, View } from "react-native";
|
|
4
4
|
import Svg, { Circle, G } from "react-native-svg";
|
|
5
5
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
@@ -10,7 +10,7 @@ var Timer = ({ children, color, duration, onStart, onStop, radius, startProgress
|
|
|
10
10
|
const progressRef = useRef(startProgress);
|
|
11
11
|
const startedRef = useRef(null);
|
|
12
12
|
const circumference = 2 * Math.PI * radius;
|
|
13
|
-
const animation =
|
|
13
|
+
const [animation] = useState(() => new Animated.Value(0));
|
|
14
14
|
const animatedProps = {
|
|
15
15
|
strokeDashoffset: animation.interpolate({
|
|
16
16
|
inputRange: [0, 1],
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rific/timer",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.1",
|
|
4
4
|
"description": "Animated SVG progress ring timer for React Native",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react-native",
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
"type": "commonjs",
|
|
27
27
|
"exports": {
|
|
28
28
|
".": {
|
|
29
|
-
"react-native": "./
|
|
29
|
+
"react-native": "./src/index.ts",
|
|
30
30
|
"types": "./dist/index.d.ts",
|
|
31
31
|
"import": "./dist/index.mjs",
|
|
32
32
|
"require": "./dist/index.js"
|
|
@@ -34,6 +34,7 @@
|
|
|
34
34
|
},
|
|
35
35
|
"main": "dist/index.js",
|
|
36
36
|
"module": "dist/index.mjs",
|
|
37
|
+
"react-native": "src/index.ts",
|
|
37
38
|
"types": "dist/index.d.ts",
|
|
38
39
|
"files": [
|
|
39
40
|
"dist",
|
|
@@ -44,30 +45,30 @@
|
|
|
44
45
|
"scripts": {
|
|
45
46
|
"build": "tsup src/index.ts --format cjs,esm --dts --clean",
|
|
46
47
|
"build:watch": "tsup src/index.ts --format cjs,esm --dts --watch",
|
|
48
|
+
"ci": "npm run lint && npm test && npm run typecheck && npm run build",
|
|
47
49
|
"fix": "eslint --fix",
|
|
48
50
|
"lint": "eslint",
|
|
49
51
|
"prepublishOnly": "npm run build",
|
|
50
52
|
"release": "git push --follow-tags",
|
|
51
|
-
"release:major": "npm version major &&
|
|
52
|
-
"release:minor": "npm version minor &&
|
|
53
|
-
"release:patch": "npm version patch &&
|
|
53
|
+
"release:major": "npm version major && npm run release",
|
|
54
|
+
"release:minor": "npm version minor && npm run release",
|
|
55
|
+
"release:patch": "npm version patch && npm run release",
|
|
54
56
|
"test": "jest",
|
|
55
57
|
"test:watch": "jest --watchAll",
|
|
56
58
|
"typecheck": "tsc --noEmit",
|
|
57
|
-
"preversion": "npm run
|
|
59
|
+
"preversion": "npm run ci"
|
|
58
60
|
},
|
|
61
|
+
"prettier": "@infinitetoken/eslint-config/prettier",
|
|
59
62
|
"devDependencies": {
|
|
63
|
+
"@infinitetoken/eslint-config": "^0.1.4",
|
|
64
|
+
"@infinitetoken/tsconfig": "^0.1.1",
|
|
60
65
|
"@testing-library/dom": "^10.4.1",
|
|
61
66
|
"@testing-library/react": "^16.3.2",
|
|
62
67
|
"@types/jest": "^30.0.0",
|
|
63
68
|
"@types/react": "^19.0.0",
|
|
64
|
-
"@typescript-eslint/parser": "^8.59.3",
|
|
65
69
|
"eslint": "^9.39.4",
|
|
66
|
-
"eslint-
|
|
67
|
-
"eslint-plugin-package-json": "^1.0.0",
|
|
68
|
-
"eslint-plugin-prettier": "^5.5.5",
|
|
70
|
+
"eslint-plugin-react-hooks": "^7.1.1",
|
|
69
71
|
"eslint-plugin-react-native": "^5.0.0",
|
|
70
|
-
"eslint-plugin-simple-import-sort": "^13.0.0",
|
|
71
72
|
"jest": "^30.4.2",
|
|
72
73
|
"jest-environment-jsdom": "^30.4.1",
|
|
73
74
|
"prettier": "^3.8.3",
|
|
@@ -78,13 +79,12 @@
|
|
|
78
79
|
"ts-jest": "^29.4.9",
|
|
79
80
|
"ts-node": "^10.9.2",
|
|
80
81
|
"tsup": "^8.0.0",
|
|
81
|
-
"typescript": "^6.0.3"
|
|
82
|
-
"typescript-eslint": "^8.59.3"
|
|
82
|
+
"typescript": "^6.0.3"
|
|
83
83
|
},
|
|
84
84
|
"peerDependencies": {
|
|
85
|
-
"react": ">=
|
|
85
|
+
"react": ">=19.0.0",
|
|
86
86
|
"react-native": ">=0.76.0",
|
|
87
|
-
"react-native-svg": ">=
|
|
87
|
+
"react-native-svg": ">=15.0.0"
|
|
88
88
|
},
|
|
89
89
|
"publishConfig": {
|
|
90
90
|
"access": "public"
|
package/src/Timer.tsx
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type ReactNode, useCallback, useEffect, useRef } from 'react'
|
|
1
|
+
import { type ReactNode, useCallback, useEffect, useRef, useState } from 'react'
|
|
2
2
|
import { Animated, Easing, StyleSheet, View, ViewStyle } from 'react-native'
|
|
3
3
|
import Svg, { Circle, G } from 'react-native-svg'
|
|
4
4
|
|
|
@@ -24,7 +24,7 @@ export const Timer = ({ children, color, duration, onStart, onStop, radius, star
|
|
|
24
24
|
const progressRef = useRef(startProgress)
|
|
25
25
|
const startedRef = useRef<string | null>(null)
|
|
26
26
|
const circumference = 2 * Math.PI * radius
|
|
27
|
-
const animation =
|
|
27
|
+
const [animation] = useState(() => new Animated.Value(0))
|
|
28
28
|
const animatedProps = {
|
|
29
29
|
strokeDashoffset: animation.interpolate({
|
|
30
30
|
inputRange: [0, 1],
|