@tamagui/animations-react-native
Advanced tools
Comparing version 1.107.0 to 1.108.0-1722728147390
@@ -0,5 +1,6 @@ | ||
var __create = Object.create; | ||
var __defProp = Object.defineProperty; | ||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor; | ||
var __getOwnPropNames = Object.getOwnPropertyNames; | ||
var __hasOwnProp = Object.prototype.hasOwnProperty; | ||
var __getProtoOf = Object.getPrototypeOf, __hasOwnProp = Object.prototype.hasOwnProperty; | ||
var __export = (target, all) => { | ||
@@ -14,3 +15,10 @@ for (var name in all) | ||
}; | ||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod); | ||
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( | ||
// If the importer is in node compatibility mode or this is not an ESM | ||
// file that has been converted to a CommonJS file using a Babel- | ||
// compatible transform (i.e. "__esModule" has not been set), then set | ||
// "default" to the CommonJS "module.exports" for node compatibility. | ||
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: !0 }) : target, | ||
mod | ||
)), __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod); | ||
var createAnimations_exports = {}; | ||
@@ -26,3 +34,3 @@ __export(createAnimations_exports, { | ||
module.exports = __toCommonJS(createAnimations_exports); | ||
var import_use_presence = require("@tamagui/use-presence"), import_constants = require("@tamagui/constants"), import_web = require("@tamagui/web"), import_react = require("react"), import_react_native = require("react-native-web"); | ||
var import_react = __toESM(require("react")), import_use_presence = require("@tamagui/use-presence"), import_constants = require("@tamagui/constants"), import_web = require("@tamagui/web"), import_react_native = require("react-native-web"); | ||
const animatedStyleKey = { | ||
@@ -54,3 +62,3 @@ transform: !0, | ||
function useAnimatedNumber(initial) { | ||
const state = (0, import_react.useRef)( | ||
const state = import_react.default.useRef( | ||
null | ||
@@ -96,9 +104,7 @@ ); | ||
} | ||
function useAnimatedNumberReaction({ | ||
value | ||
}, onValue) { | ||
function useAnimatedNumberReaction({ value }, onValue) { | ||
const onChange = (0, import_web.useEvent)((current) => { | ||
onValue(current.value); | ||
}); | ||
(0, import_react.useEffect)(() => { | ||
import_react.default.useEffect(() => { | ||
const id = value.getInstance().addListener(onChange); | ||
@@ -125,5 +131,5 @@ return () => { | ||
useAnimations: ({ props, onDidAnimate, style, componentState, presence }) => { | ||
const isExiting = presence?.[0] === !1, sendExitComplete = presence?.[1], animateStyles = (0, import_react.useRef)({}), animatedTranforms = (0, import_react.useRef)([]), animationsState = (0, import_react.useRef)( | ||
const isExiting = presence?.[0] === !1, sendExitComplete = presence?.[1], animateStyles = import_react.default.useRef({}), animatedTranforms = import_react.default.useRef([]), animationsState = import_react.default.useRef( | ||
/* @__PURE__ */ new WeakMap() | ||
), animateOnly = props.animateOnly || [], hasAnimateOnly = !!props.animateOnly, args = [JSON.stringify(style), componentState, isExiting, !!onDidAnimate], isThereNoNativeStyleKeys = (0, import_react.useMemo)(() => import_constants.isWeb ? !0 : Object.keys(style).some((key) => animateOnly.length ? !animatedStyleKey[key] && animateOnly.indexOf(key) === -1 : !animatedStyleKey[key]), args), res = (0, import_react.useMemo)(() => { | ||
), animateOnly = props.animateOnly || [], hasAnimateOnly = !!props.animateOnly, args = [JSON.stringify(style), componentState, isExiting, !!onDidAnimate], isThereNoNativeStyleKeys = import_react.default.useMemo(() => import_constants.isWeb ? !0 : Object.keys(style).some((key) => animateOnly.length ? !animatedStyleKey[key] && animateOnly.indexOf(key) === -1 : !animatedStyleKey[key]), args), res = import_react.default.useMemo(() => { | ||
const runners = [], completions = [], nonAnimatedStyle = {}; | ||
@@ -130,0 +136,0 @@ for (const key in style) { |
"use strict"; | ||
var __create = Object.create; | ||
var __defProp = Object.defineProperty; | ||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor; | ||
var __getOwnPropNames = Object.getOwnPropertyNames; | ||
var __hasOwnProp = Object.prototype.hasOwnProperty; | ||
var __getProtoOf = Object.getPrototypeOf, __hasOwnProp = Object.prototype.hasOwnProperty; | ||
var __export = (target, all) => { | ||
@@ -15,3 +16,10 @@ for (var name in all) | ||
}; | ||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod); | ||
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( | ||
// If the importer is in node compatibility mode or this is not an ESM | ||
// file that has been converted to a CommonJS file using a Babel- | ||
// compatible transform (i.e. "__esModule" has not been set), then set | ||
// "default" to the CommonJS "module.exports" for node compatibility. | ||
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: !0 }) : target, | ||
mod | ||
)), __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod); | ||
var createAnimations_exports = {}; | ||
@@ -27,3 +35,3 @@ __export(createAnimations_exports, { | ||
module.exports = __toCommonJS(createAnimations_exports); | ||
var import_use_presence = require("@tamagui/use-presence"), import_constants = require("@tamagui/constants"), import_web = require("@tamagui/web"), import_react = require("react"), import_react_native = require("react-native"); | ||
var import_react = __toESM(require("react")), import_use_presence = require("@tamagui/use-presence"), import_constants = require("@tamagui/constants"), import_web = require("@tamagui/web"), import_react_native = require("react-native"); | ||
function _array_like_to_array(arr, len) { | ||
@@ -157,3 +165,3 @@ (len == null || len > arr.length) && (len = arr.length); | ||
function useAnimatedNumber(initial) { | ||
var state = (0, import_react.useRef)(null); | ||
var state = import_react.default.useRef(null); | ||
return state.current || (state.current = { | ||
@@ -211,3 +219,3 @@ composite: null, | ||
}); | ||
(0, import_react.useEffect)(function() { | ||
import_react.default.useEffect(function() { | ||
var id = value.getInstance().addListener(onChange); | ||
@@ -237,3 +245,3 @@ return function() { | ||
useAnimations: function(param) { | ||
var props = param.props, onDidAnimate = param.onDidAnimate, style = param.style, componentState = param.componentState, presence = param.presence, isExiting = (presence == null ? void 0 : presence[0]) === !1, sendExitComplete = presence == null ? void 0 : presence[1], animateStyles = (0, import_react.useRef)({}), animatedTranforms = (0, import_react.useRef)([]), animationsState = (0, import_react.useRef)(/* @__PURE__ */ new WeakMap()), animateOnly = props.animateOnly || [], hasAnimateOnly = !!props.animateOnly, args = [ | ||
var props = param.props, onDidAnimate = param.onDidAnimate, style = param.style, componentState = param.componentState, presence = param.presence, isExiting = (presence == null ? void 0 : presence[0]) === !1, sendExitComplete = presence == null ? void 0 : presence[1], animateStyles = import_react.default.useRef({}), animatedTranforms = import_react.default.useRef([]), animationsState = import_react.default.useRef(/* @__PURE__ */ new WeakMap()), animateOnly = props.animateOnly || [], hasAnimateOnly = !!props.animateOnly, args = [ | ||
JSON.stringify(style), | ||
@@ -243,7 +251,7 @@ componentState, | ||
!!onDidAnimate | ||
], isThereNoNativeStyleKeys = (0, import_react.useMemo)(function() { | ||
], isThereNoNativeStyleKeys = import_react.default.useMemo(function() { | ||
return import_constants.isWeb ? !0 : Object.keys(style).some(function(key) { | ||
return animateOnly.length ? !animatedStyleKey[key] && animateOnly.indexOf(key) === -1 : !animatedStyleKey[key]; | ||
}); | ||
}, args), res = (0, import_react.useMemo)(function() { | ||
}, args), res = import_react.default.useMemo(function() { | ||
var update = function(key2, animated, valIn) { | ||
@@ -250,0 +258,0 @@ var isColorStyleKey = colorStyleKey[key2], _ref = _sliced_to_array(isColorStyleKey ? [ |
@@ -0,5 +1,5 @@ | ||
import React from "react"; | ||
import { ResetPresence, usePresence } from "@tamagui/use-presence"; | ||
import { isWeb, useIsomorphicLayoutEffect } from "@tamagui/constants"; | ||
import { useEvent } from "@tamagui/web"; | ||
import { useEffect, useMemo, useRef } from "react"; | ||
import { Animated } from "react-native-web"; | ||
@@ -32,3 +32,3 @@ const animatedStyleKey = { | ||
function useAnimatedNumber(initial) { | ||
const state = useRef( | ||
const state = React.useRef( | ||
null | ||
@@ -74,9 +74,7 @@ ); | ||
} | ||
function useAnimatedNumberReaction({ | ||
value | ||
}, onValue) { | ||
function useAnimatedNumberReaction({ value }, onValue) { | ||
const onChange = useEvent((current) => { | ||
onValue(current.value); | ||
}); | ||
useEffect(() => { | ||
React.useEffect(() => { | ||
const id = value.getInstance().addListener(onChange); | ||
@@ -103,5 +101,5 @@ return () => { | ||
useAnimations: ({ props, onDidAnimate, style, componentState, presence }) => { | ||
const isExiting = presence?.[0] === !1, sendExitComplete = presence?.[1], animateStyles = useRef({}), animatedTranforms = useRef([]), animationsState = useRef( | ||
const isExiting = presence?.[0] === !1, sendExitComplete = presence?.[1], animateStyles = React.useRef({}), animatedTranforms = React.useRef([]), animationsState = React.useRef( | ||
/* @__PURE__ */ new WeakMap() | ||
), animateOnly = props.animateOnly || [], hasAnimateOnly = !!props.animateOnly, args = [JSON.stringify(style), componentState, isExiting, !!onDidAnimate], isThereNoNativeStyleKeys = useMemo(() => isWeb ? !0 : Object.keys(style).some((key) => animateOnly.length ? !animatedStyleKey[key] && animateOnly.indexOf(key) === -1 : !animatedStyleKey[key]), args), res = useMemo(() => { | ||
), animateOnly = props.animateOnly || [], hasAnimateOnly = !!props.animateOnly, args = [JSON.stringify(style), componentState, isExiting, !!onDidAnimate], isThereNoNativeStyleKeys = React.useMemo(() => isWeb ? !0 : Object.keys(style).some((key) => animateOnly.length ? !animatedStyleKey[key] && animateOnly.indexOf(key) === -1 : !animatedStyleKey[key]), args), res = React.useMemo(() => { | ||
const runners = [], completions = [], nonAnimatedStyle = {}; | ||
@@ -108,0 +106,0 @@ for (const key in style) { |
@@ -0,5 +1,5 @@ | ||
import React from "react"; | ||
import { ResetPresence, usePresence } from "@tamagui/use-presence"; | ||
import { isWeb, useIsomorphicLayoutEffect } from "@tamagui/constants"; | ||
import { useEvent } from "@tamagui/web"; | ||
import { useEffect, useMemo, useRef } from "react"; | ||
import { Animated } from "react-native"; | ||
@@ -134,3 +134,3 @@ function _array_like_to_array(arr, len) { | ||
function useAnimatedNumber(initial) { | ||
var state = useRef(null); | ||
var state = React.useRef(null); | ||
return state.current || (state.current = { | ||
@@ -188,3 +188,3 @@ composite: null, | ||
}); | ||
useEffect(function() { | ||
React.useEffect(function() { | ||
var id = value.getInstance().addListener(onChange); | ||
@@ -214,3 +214,3 @@ return function() { | ||
useAnimations: function(param) { | ||
var props = param.props, onDidAnimate = param.onDidAnimate, style = param.style, componentState = param.componentState, presence = param.presence, isExiting = (presence == null ? void 0 : presence[0]) === !1, sendExitComplete = presence == null ? void 0 : presence[1], animateStyles = useRef({}), animatedTranforms = useRef([]), animationsState = useRef(/* @__PURE__ */ new WeakMap()), animateOnly = props.animateOnly || [], hasAnimateOnly = !!props.animateOnly, args = [ | ||
var props = param.props, onDidAnimate = param.onDidAnimate, style = param.style, componentState = param.componentState, presence = param.presence, isExiting = (presence == null ? void 0 : presence[0]) === !1, sendExitComplete = presence == null ? void 0 : presence[1], animateStyles = React.useRef({}), animatedTranforms = React.useRef([]), animationsState = React.useRef(/* @__PURE__ */ new WeakMap()), animateOnly = props.animateOnly || [], hasAnimateOnly = !!props.animateOnly, args = [ | ||
JSON.stringify(style), | ||
@@ -220,7 +220,7 @@ componentState, | ||
!!onDidAnimate | ||
], isThereNoNativeStyleKeys = useMemo(function() { | ||
], isThereNoNativeStyleKeys = React.useMemo(function() { | ||
return isWeb ? !0 : Object.keys(style).some(function(key) { | ||
return animateOnly.length ? !animatedStyleKey[key] && animateOnly.indexOf(key) === -1 : !animatedStyleKey[key]; | ||
}); | ||
}, args), res = useMemo(function() { | ||
}, args), res = React.useMemo(function() { | ||
var update = function(key2, animated, valIn) { | ||
@@ -227,0 +227,0 @@ var isColorStyleKey = colorStyleKey[key2], _ref = _sliced_to_array(isColorStyleKey ? [ |
{ | ||
"name": "@tamagui/animations-react-native", | ||
"version": "1.107.0", | ||
"version": "1.108.0-1722728147390", | ||
"source": "src/index.ts", | ||
@@ -28,8 +28,8 @@ "removeSideEffects": true, | ||
"dependencies": { | ||
"@tamagui/constants": "1.107.0", | ||
"@tamagui/use-presence": "1.107.0", | ||
"@tamagui/web": "1.107.0" | ||
"@tamagui/constants": "1.108.0-1722728147390", | ||
"@tamagui/use-presence": "1.108.0-1722728147390", | ||
"@tamagui/web": "1.108.0-1722728147390" | ||
}, | ||
"devDependencies": { | ||
"@tamagui/build": "1.107.0", | ||
"@tamagui/build": "1.108.0-1722728147390", | ||
"react": "^18.2.0 || ^19.0.0", | ||
@@ -36,0 +36,0 @@ "react-native": "0.74.1" |
@@ -16,3 +16,3 @@ import type { AnimationDriver, UniversalAnimatedNumber } from '@tamagui/web'; | ||
export declare function useAnimatedNumber(initial: number): UniversalAnimatedNumber<Animated.Value>; | ||
export declare function useAnimatedNumberReaction({ value, }: { | ||
export declare function useAnimatedNumberReaction({ value }: { | ||
value: UniversalAnimatedNumber<Animated.Value>; | ||
@@ -19,0 +19,0 @@ }, onValue: (current: number) => void): void; |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
140385
2206
2
+ Added@tamagui/compose-refs@1.108.0-1722728147390(transitive)
+ Added@tamagui/constants@1.108.0-1722728147390(transitive)
+ Added@tamagui/helpers@1.108.0-1722728147390(transitive)
+ Added@tamagui/normalize-css-color@1.108.0-1722728147390(transitive)
+ Added@tamagui/simple-hash@1.108.0-1722728147390(transitive)
+ Added@tamagui/timer@1.108.0-1722728147390(transitive)
+ Added@tamagui/types@1.108.0-1722728147390(transitive)
+ Added@tamagui/use-did-finish-ssr@1.108.0-1722728147390(transitive)
+ Added@tamagui/use-event@1.108.0-1722728147390(transitive)
+ Added@tamagui/use-force-update@1.108.0-1722728147390(transitive)
+ Added@tamagui/use-presence@1.108.0-1722728147390(transitive)
+ Added@tamagui/web@1.108.0-1722728147390(transitive)
- Removed@tamagui/compose-refs@1.107.0(transitive)
- Removed@tamagui/constants@1.107.0(transitive)
- Removed@tamagui/helpers@1.107.0(transitive)
- Removed@tamagui/normalize-css-color@1.107.0(transitive)
- Removed@tamagui/simple-hash@1.107.0(transitive)
- Removed@tamagui/timer@1.107.0(transitive)
- Removed@tamagui/types@1.107.0(transitive)
- Removed@tamagui/use-did-finish-ssr@1.107.0(transitive)
- Removed@tamagui/use-event@1.107.0(transitive)
- Removed@tamagui/use-force-update@1.107.0(transitive)
- Removed@tamagui/use-presence@1.107.0(transitive)
- Removed@tamagui/web@1.107.0(transitive)