chore: update map
This commit is contained in:
+6
-57
@@ -1,61 +1,10 @@
|
||||
'use strict';
|
||||
|
||||
export { createAnimatedComponent } from './createAnimatedComponent';
|
||||
export { AnimatedText as Text } from './reanimated2/component/Text';
|
||||
export { AnimatedView as View } from './reanimated2/component/View';
|
||||
export { AnimatedScrollView as ScrollView } from './reanimated2/component/ScrollView';
|
||||
export { AnimatedImage as Image } from './reanimated2/component/Image';
|
||||
export { ReanimatedFlatList as FlatList } from './reanimated2/component/FlatList';
|
||||
export { ReanimatedFlatList as FlatList } from './component/FlatList';
|
||||
export { AnimatedImage as Image } from './component/Image';
|
||||
export { AnimatedScrollView as ScrollView } from './component/ScrollView';
|
||||
export { AnimatedText as Text } from './component/Text';
|
||||
export { AnimatedView as View } from './component/View';
|
||||
export { addWhitelistedNativeProps, addWhitelistedUIProps } from './ConfigHelper';
|
||||
/**
|
||||
* @deprecated Please import `Extrapolate` directly from `react-native-reanimated` instead of `Animated` namespace.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @deprecated Please import `SharedValue` directly from `react-native-reanimated` instead of `Animated` namespace.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @deprecated Please import `DerivedValue` directly from `react-native-reanimated` instead of `Animated` namespace.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @deprecated Please import `Adaptable` directly from `react-native-reanimated` instead of `Animated` namespace.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @deprecated Please import `TransformStyleTypes` directly from `react-native-reanimated` instead of `Animated` namespace.
|
||||
* */
|
||||
|
||||
/**
|
||||
* @deprecated Please import `AdaptTransforms` directly from `react-native-reanimated` instead of `Animated` namespace.
|
||||
* */
|
||||
|
||||
/**
|
||||
* @deprecated Please import `AnimatedTransform` directly from `react-native-reanimated` instead of `Animated` namespace.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @deprecated Please import `AnimateStyle` directly from `react-native-reanimated` instead of `Animated` namespace.
|
||||
* */
|
||||
|
||||
/**
|
||||
* @deprecated Please import `StylesOrDefault` directly from `react-native-reanimated` instead of `Animated` namespace.
|
||||
* */
|
||||
|
||||
/**
|
||||
* @deprecated Please import `AnimateProps` directly from `react-native-reanimated` instead of `Animated` namespace.
|
||||
* */
|
||||
|
||||
/**
|
||||
* @deprecated Please import `EasingFunction` directly from `react-native-reanimated` instead of `Animated` namespace.
|
||||
* */
|
||||
|
||||
/**
|
||||
* @deprecated Please import `AnimatedScrollViewProps` directly from `react-native-reanimated` instead of `Animated` namespace.
|
||||
* */
|
||||
|
||||
/**
|
||||
* @deprecated Please import `FlatListPropsWithLayout` directly from `react-native-reanimated` instead of `Animated` namespace.
|
||||
* */
|
||||
export { createAnimatedComponent } from './createAnimatedComponent';
|
||||
//# sourceMappingURL=Animated.js.map
|
||||
+1
-1
@@ -1 +1 @@
|
||||
{"version":3,"names":["createAnimatedComponent","AnimatedText","Text","AnimatedView","View","AnimatedScrollView","ScrollView","AnimatedImage","Image","ReanimatedFlatList","FlatList","addWhitelistedNativeProps","addWhitelistedUIProps"],"sources":["Animated.ts"],"sourcesContent":["'use strict';\nimport type { Extrapolate as _Extrapolate } from './reanimated2/interpolateColor';\nimport type { SharedValue as _SharedValue } from './reanimated2/commonTypes';\nimport type { DerivedValue as _DerivedValue } from './reanimated2/hook/useDerivedValue';\nimport type {\n TransformStyleTypes as _TransformStyleTypes,\n Adaptable as _Adaptable,\n AdaptTransforms as _AdaptTransforms,\n AnimatedTransform as _AnimatedTransform,\n AnimateStyle as _AnimateStyle,\n StylesOrDefault as _StylesOrDefault,\n AnimateProps as _AnimateProps,\n} from './reanimated2/helperTypes';\nimport type { EasingFunction as _EasingFunction } from './reanimated2/Easing';\n\nimport type { AnimatedScrollViewProps as _AnimatedScrollViewProps } from './reanimated2/component/ScrollView';\nimport type { FlatListPropsWithLayout as _FlatListPropsWithLayout } from './reanimated2/component/FlatList';\n\nexport { createAnimatedComponent } from './createAnimatedComponent';\nexport { AnimatedText as Text } from './reanimated2/component/Text';\nexport { AnimatedView as View } from './reanimated2/component/View';\nexport { AnimatedScrollView as ScrollView } from './reanimated2/component/ScrollView';\nexport { AnimatedImage as Image } from './reanimated2/component/Image';\nexport { ReanimatedFlatList as FlatList } from './reanimated2/component/FlatList';\nexport {\n addWhitelistedNativeProps,\n addWhitelistedUIProps,\n} from './ConfigHelper';\n/**\n * @deprecated Please import `Extrapolate` directly from `react-native-reanimated` instead of `Animated` namespace.\n */\nexport type Extrapolate = typeof _Extrapolate;\n/**\n * @deprecated Please import `SharedValue` directly from `react-native-reanimated` instead of `Animated` namespace.\n */\n\nexport type SharedValue<T> = _SharedValue<T>;\n/**\n * @deprecated Please import `DerivedValue` directly from `react-native-reanimated` instead of `Animated` namespace.\n */\nexport type DerivedValue<T> = _DerivedValue<T>;\n/**\n * @deprecated Please import `Adaptable` directly from `react-native-reanimated` instead of `Animated` namespace.\n */\nexport type Adaptable<T> = _Adaptable<T>;\n/**\n * @deprecated Please import `TransformStyleTypes` directly from `react-native-reanimated` instead of `Animated` namespace.\n * */\nexport type TransformStyleTypes = _TransformStyleTypes;\n/**\n * @deprecated Please import `AdaptTransforms` directly from `react-native-reanimated` instead of `Animated` namespace.\n * */\nexport type AdaptTransforms<T> = _AdaptTransforms<T>;\n/**\n * @deprecated Please import `AnimatedTransform` directly from `react-native-reanimated` instead of `Animated` namespace.\n */\nexport type AnimatedTransform = _AnimatedTransform;\n/**\n * @deprecated Please import `AnimateStyle` directly from `react-native-reanimated` instead of `Animated` namespace.\n * */\nexport type AnimateStyle<S> = _AnimateStyle<S>;\n/**\n * @deprecated Please import `StylesOrDefault` directly from `react-native-reanimated` instead of `Animated` namespace.\n * */\nexport type StylesOrDefault<S> = _StylesOrDefault<S>;\n/**\n * @deprecated Please import `AnimateProps` directly from `react-native-reanimated` instead of `Animated` namespace.\n * */\nexport type AnimateProps<P extends object> = _AnimateProps<P>;\n/**\n * @deprecated Please import `EasingFunction` directly from `react-native-reanimated` instead of `Animated` namespace.\n * */\nexport type EasingFunction = _EasingFunction;\n/**\n * @deprecated Please import `AnimatedScrollViewProps` directly from `react-native-reanimated` instead of `Animated` namespace.\n * */\nexport type AnimatedScrollViewProps = _AnimatedScrollViewProps;\n/**\n * @deprecated Please import `FlatListPropsWithLayout` directly from `react-native-reanimated` instead of `Animated` namespace.\n * */\nexport type FlatListPropsWithLayout<T> = _FlatListPropsWithLayout<T>;\n"],"mappings":"AAAA,YAAY;;AAkBZ,SAASA,uBAAuB,QAAQ,2BAA2B;AACnE,SAASC,YAAY,IAAIC,IAAI,QAAQ,8BAA8B;AACnE,SAASC,YAAY,IAAIC,IAAI,QAAQ,8BAA8B;AACnE,SAASC,kBAAkB,IAAIC,UAAU,QAAQ,oCAAoC;AACrF,SAASC,aAAa,IAAIC,KAAK,QAAQ,+BAA+B;AACtE,SAASC,kBAAkB,IAAIC,QAAQ,QAAQ,kCAAkC;AACjF,SACEC,yBAAyB,EACzBC,qBAAqB,QAChB,gBAAgB;AACvB;AACA;AACA;;AAEA;AACA;AACA;;AAGA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA"}
|
||||
{"version":3,"names":["ReanimatedFlatList","FlatList","AnimatedImage","Image","AnimatedScrollView","ScrollView","AnimatedText","Text","AnimatedView","View","addWhitelistedNativeProps","addWhitelistedUIProps","createAnimatedComponent"],"sourceRoot":"../../src","sources":["Animated.ts"],"mappings":"AAAA,YAAY;;AACZ,SAASA,kBAAkB,IAAIC,QAAQ,QAAQ,sBAAsB;AACrE,SAASC,aAAa,IAAIC,KAAK,QAAQ,mBAAmB;AAC1D,SAASC,kBAAkB,IAAIC,UAAU,QAAQ,wBAAwB;AACzE,SAASC,YAAY,IAAIC,IAAI,QAAQ,kBAAkB;AACvD,SAASC,YAAY,IAAIC,IAAI,QAAQ,kBAAkB;AACvD,SACEC,yBAAyB,EACzBC,qBAAqB,QAChB,gBAAgB;AACvB,SAASC,uBAAuB,QAAQ,2BAA2B","ignoreList":[]}
|
||||
|
||||
+26
-52
@@ -1,61 +1,35 @@
|
||||
'use strict';
|
||||
|
||||
import { PropsAllowlists } from './propsAllowlists';
|
||||
import { jsiConfigureProps } from './reanimated2/core';
|
||||
function assertNoOverlapInLists() {
|
||||
for (const key in PropsAllowlists.NATIVE_THREAD_PROPS_WHITELIST) {
|
||||
if (key in PropsAllowlists.UI_THREAD_PROPS_WHITELIST) {
|
||||
throw new Error(`[Reanimated] Property \`${key}\` was whitelisted both as UI and native prop. Please remove it from one of the lists.`);
|
||||
}
|
||||
}
|
||||
import { executeOnUIRuntimeSync } from 'react-native-worklets';
|
||||
import { getLoggerConfig, SHOULD_BE_USE_WEB, updateLoggerConfig } from './common';
|
||||
|
||||
/** @deprecated This function is a no-op in Reanimated 4. */
|
||||
export function addWhitelistedNativeProps(_props) {
|
||||
// Do nothing. This is just for backward compatibility.
|
||||
}
|
||||
function configureProps() {
|
||||
assertNoOverlapInLists();
|
||||
jsiConfigureProps(Object.keys(PropsAllowlists.UI_THREAD_PROPS_WHITELIST), Object.keys(PropsAllowlists.NATIVE_THREAD_PROPS_WHITELIST));
|
||||
|
||||
/** @deprecated This function is a no-op in Reanimated 4. */
|
||||
export function addWhitelistedUIProps(_props) {
|
||||
// Do nothing. This is just for backward compatibility.
|
||||
}
|
||||
export function addWhitelistedNativeProps(props) {
|
||||
const oldSize = Object.keys(PropsAllowlists.NATIVE_THREAD_PROPS_WHITELIST).length;
|
||||
PropsAllowlists.NATIVE_THREAD_PROPS_WHITELIST = {
|
||||
...PropsAllowlists.NATIVE_THREAD_PROPS_WHITELIST,
|
||||
...props
|
||||
};
|
||||
if (oldSize !== Object.keys(PropsAllowlists.NATIVE_THREAD_PROPS_WHITELIST).length) {
|
||||
configureProps();
|
||||
}
|
||||
}
|
||||
export function addWhitelistedUIProps(props) {
|
||||
const oldSize = Object.keys(PropsAllowlists.UI_THREAD_PROPS_WHITELIST).length;
|
||||
PropsAllowlists.UI_THREAD_PROPS_WHITELIST = {
|
||||
...PropsAllowlists.UI_THREAD_PROPS_WHITELIST,
|
||||
...props
|
||||
};
|
||||
if (oldSize !== Object.keys(PropsAllowlists.UI_THREAD_PROPS_WHITELIST).length) {
|
||||
configureProps();
|
||||
}
|
||||
}
|
||||
const PROCESSED_VIEW_NAMES = new Set();
|
||||
|
||||
/**
|
||||
* updates UI props whitelist for given view host instance
|
||||
* this will work just once for every view name
|
||||
* Updates Reanimated logger config with the user-provided configuration. Will
|
||||
* affect Reanimated code executed after call to this function so it should be
|
||||
* called before any Reanimated code is executed to take effect. Each call to
|
||||
* this function will override the previous configuration (it's recommended to
|
||||
* call it only once).
|
||||
*
|
||||
* @param config - The new logger configuration to apply.
|
||||
*/
|
||||
|
||||
export function adaptViewConfig(viewConfig) {
|
||||
const viewName = viewConfig.uiViewClassName;
|
||||
const props = viewConfig.validAttributes;
|
||||
|
||||
// update whitelist of UI props for this view name only once
|
||||
if (!PROCESSED_VIEW_NAMES.has(viewName)) {
|
||||
const propsToAdd = {};
|
||||
Object.keys(props).forEach(key => {
|
||||
// we don't want to add native props as they affect layout
|
||||
// we also skip props which repeat here
|
||||
if (!(key in PropsAllowlists.NATIVE_THREAD_PROPS_WHITELIST) && !(key in PropsAllowlists.UI_THREAD_PROPS_WHITELIST)) {
|
||||
propsToAdd[key] = true;
|
||||
}
|
||||
});
|
||||
addWhitelistedUIProps(propsToAdd);
|
||||
PROCESSED_VIEW_NAMES.add(viewName);
|
||||
export function configureReanimatedLogger(config) {
|
||||
// Get the current config from the React runtime (to have a single source of truth)
|
||||
const currentConfig = getLoggerConfig();
|
||||
// Update the configuration object in the React runtime
|
||||
updateLoggerConfig(currentConfig, config);
|
||||
// Register the updated configuration in the UI runtime
|
||||
if (!SHOULD_BE_USE_WEB) {
|
||||
executeOnUIRuntimeSync(updateLoggerConfig)(currentConfig, config);
|
||||
}
|
||||
}
|
||||
configureProps();
|
||||
//# sourceMappingURL=ConfigHelper.js.map
|
||||
Generated
Vendored
+1
-1
@@ -1 +1 @@
|
||||
{"version":3,"names":["PropsAllowlists","jsiConfigureProps","assertNoOverlapInLists","key","NATIVE_THREAD_PROPS_WHITELIST","UI_THREAD_PROPS_WHITELIST","Error","configureProps","Object","keys","addWhitelistedNativeProps","props","oldSize","length","addWhitelistedUIProps","PROCESSED_VIEW_NAMES","Set","adaptViewConfig","viewConfig","viewName","uiViewClassName","validAttributes","has","propsToAdd","forEach","add"],"sources":["ConfigHelper.ts"],"sourcesContent":["'use strict';\nimport { PropsAllowlists } from './propsAllowlists';\nimport { jsiConfigureProps } from './reanimated2/core';\nfunction assertNoOverlapInLists() {\n for (const key in PropsAllowlists.NATIVE_THREAD_PROPS_WHITELIST) {\n if (key in PropsAllowlists.UI_THREAD_PROPS_WHITELIST) {\n throw new Error(\n `[Reanimated] Property \\`${key}\\` was whitelisted both as UI and native prop. Please remove it from one of the lists.`\n );\n }\n }\n}\n\nfunction configureProps(): void {\n assertNoOverlapInLists();\n jsiConfigureProps(\n Object.keys(PropsAllowlists.UI_THREAD_PROPS_WHITELIST),\n Object.keys(PropsAllowlists.NATIVE_THREAD_PROPS_WHITELIST)\n );\n}\n\nexport function addWhitelistedNativeProps(\n props: Record<string, boolean>\n): void {\n const oldSize = Object.keys(\n PropsAllowlists.NATIVE_THREAD_PROPS_WHITELIST\n ).length;\n PropsAllowlists.NATIVE_THREAD_PROPS_WHITELIST = {\n ...PropsAllowlists.NATIVE_THREAD_PROPS_WHITELIST,\n ...props,\n };\n if (\n oldSize !==\n Object.keys(PropsAllowlists.NATIVE_THREAD_PROPS_WHITELIST).length\n ) {\n configureProps();\n }\n}\n\nexport function addWhitelistedUIProps(props: Record<string, boolean>): void {\n const oldSize = Object.keys(PropsAllowlists.UI_THREAD_PROPS_WHITELIST).length;\n PropsAllowlists.UI_THREAD_PROPS_WHITELIST = {\n ...PropsAllowlists.UI_THREAD_PROPS_WHITELIST,\n ...props,\n };\n if (\n oldSize !== Object.keys(PropsAllowlists.UI_THREAD_PROPS_WHITELIST).length\n ) {\n configureProps();\n }\n}\n\nconst PROCESSED_VIEW_NAMES = new Set();\n\nexport interface ViewConfig {\n uiViewClassName: string;\n validAttributes: Record<string, unknown>;\n}\n/**\n * updates UI props whitelist for given view host instance\n * this will work just once for every view name\n */\n\nexport function adaptViewConfig(viewConfig: ViewConfig): void {\n const viewName = viewConfig.uiViewClassName;\n const props = viewConfig.validAttributes;\n\n // update whitelist of UI props for this view name only once\n if (!PROCESSED_VIEW_NAMES.has(viewName)) {\n const propsToAdd: Record<string, boolean> = {};\n Object.keys(props).forEach((key) => {\n // we don't want to add native props as they affect layout\n // we also skip props which repeat here\n if (\n !(key in PropsAllowlists.NATIVE_THREAD_PROPS_WHITELIST) &&\n !(key in PropsAllowlists.UI_THREAD_PROPS_WHITELIST)\n ) {\n propsToAdd[key] = true;\n }\n });\n addWhitelistedUIProps(propsToAdd);\n\n PROCESSED_VIEW_NAMES.add(viewName);\n }\n}\n\nconfigureProps();\n"],"mappings":"AAAA,YAAY;;AACZ,SAASA,eAAe,QAAQ,mBAAmB;AACnD,SAASC,iBAAiB,QAAQ,oBAAoB;AACtD,SAASC,sBAAsBA,CAAA,EAAG;EAChC,KAAK,MAAMC,GAAG,IAAIH,eAAe,CAACI,6BAA6B,EAAE;IAC/D,IAAID,GAAG,IAAIH,eAAe,CAACK,yBAAyB,EAAE;MACpD,MAAM,IAAIC,KAAK,CACZ,2BAA0BH,GAAI,wFAAuF,CACvH;IACH;EACF;AACF;AAEA,SAASI,cAAcA,CAAA,EAAS;EAC9BL,sBAAsB,EAAE;EACxBD,iBAAiB,CACfO,MAAM,CAACC,IAAI,CAACT,eAAe,CAACK,yBAAyB,CAAC,EACtDG,MAAM,CAACC,IAAI,CAACT,eAAe,CAACI,6BAA6B,CAAC,CAC3D;AACH;AAEA,OAAO,SAASM,yBAAyBA,CACvCC,KAA8B,EACxB;EACN,MAAMC,OAAO,GAAGJ,MAAM,CAACC,IAAI,CACzBT,eAAe,CAACI,6BAA6B,CAC9C,CAACS,MAAM;EACRb,eAAe,CAACI,6BAA6B,GAAG;IAC9C,GAAGJ,eAAe,CAACI,6BAA6B;IAChD,GAAGO;EACL,CAAC;EACD,IACEC,OAAO,KACPJ,MAAM,CAACC,IAAI,CAACT,eAAe,CAACI,6BAA6B,CAAC,CAACS,MAAM,EACjE;IACAN,cAAc,EAAE;EAClB;AACF;AAEA,OAAO,SAASO,qBAAqBA,CAACH,KAA8B,EAAQ;EAC1E,MAAMC,OAAO,GAAGJ,MAAM,CAACC,IAAI,CAACT,eAAe,CAACK,yBAAyB,CAAC,CAACQ,MAAM;EAC7Eb,eAAe,CAACK,yBAAyB,GAAG;IAC1C,GAAGL,eAAe,CAACK,yBAAyB;IAC5C,GAAGM;EACL,CAAC;EACD,IACEC,OAAO,KAAKJ,MAAM,CAACC,IAAI,CAACT,eAAe,CAACK,yBAAyB,CAAC,CAACQ,MAAM,EACzE;IACAN,cAAc,EAAE;EAClB;AACF;AAEA,MAAMQ,oBAAoB,GAAG,IAAIC,GAAG,EAAE;AAMtC;AACA;AACA;AACA;;AAEA,OAAO,SAASC,eAAeA,CAACC,UAAsB,EAAQ;EAC5D,MAAMC,QAAQ,GAAGD,UAAU,CAACE,eAAe;EAC3C,MAAMT,KAAK,GAAGO,UAAU,CAACG,eAAe;;EAExC;EACA,IAAI,CAACN,oBAAoB,CAACO,GAAG,CAACH,QAAQ,CAAC,EAAE;IACvC,MAAMI,UAAmC,GAAG,CAAC,CAAC;IAC9Cf,MAAM,CAACC,IAAI,CAACE,KAAK,CAAC,CAACa,OAAO,CAAErB,GAAG,IAAK;MAClC;MACA;MACA,IACE,EAAEA,GAAG,IAAIH,eAAe,CAACI,6BAA6B,CAAC,IACvD,EAAED,GAAG,IAAIH,eAAe,CAACK,yBAAyB,CAAC,EACnD;QACAkB,UAAU,CAACpB,GAAG,CAAC,GAAG,IAAI;MACxB;IACF,CAAC,CAAC;IACFW,qBAAqB,CAACS,UAAU,CAAC;IAEjCR,oBAAoB,CAACU,GAAG,CAACN,QAAQ,CAAC;EACpC;AACF;AAEAZ,cAAc,EAAE"}
|
||||
{"version":3,"names":["executeOnUIRuntimeSync","getLoggerConfig","SHOULD_BE_USE_WEB","updateLoggerConfig","addWhitelistedNativeProps","_props","addWhitelistedUIProps","configureReanimatedLogger","config","currentConfig"],"sourceRoot":"../../src","sources":["ConfigHelper.ts"],"mappings":"AAAA,YAAY;;AACZ,SAASA,sBAAsB,QAAQ,uBAAuB;AAG9D,SACEC,eAAe,EACfC,iBAAiB,EACjBC,kBAAkB,QACb,UAAU;;AAEjB;AACA,OAAO,SAASC,yBAAyBA,CACvCC,MAA+B,EACzB;EACN;AAAA;;AAGF;AACA,OAAO,SAASC,qBAAqBA,CAACD,MAA+B,EAAQ;EAC3E;AAAA;;AAGF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASE,yBAAyBA,CAACC,MAAoB,EAAE;EAC9D;EACA,MAAMC,aAAa,GAAGR,eAAe,CAAC,CAAC;EACvC;EACAE,kBAAkB,CAACM,aAAa,EAAED,MAAM,CAAC;EACzC;EACA,IAAI,CAACN,iBAAiB,EAAE;IACtBF,sBAAsB,CAACG,kBAAkB,CAAC,CAACM,aAAa,EAAED,MAAM,CAAC;EACnE;AACF","ignoreList":[]}
|
||||
|
||||
Generated
Vendored
+20
-7
@@ -1,5 +1,6 @@
|
||||
'use strict';
|
||||
|
||||
import { logger } from './common';
|
||||
const mockTargetValues = {
|
||||
targetOriginX: 0,
|
||||
targetOriginY: 0,
|
||||
@@ -18,18 +19,30 @@ const mockTargetValues = {
|
||||
currentGlobalOriginY: 0,
|
||||
currentBorderRadius: 0
|
||||
};
|
||||
function getCommonProperties(layoutStyle, componentStyle) {
|
||||
let componentStyleFlat = Array.isArray(componentStyle) ? componentStyle.flat() : [componentStyle];
|
||||
componentStyleFlat = componentStyleFlat.filter(Boolean);
|
||||
componentStyleFlat = componentStyleFlat.map(style => 'initial' in style ? style.initial.value // Include properties of animated style
|
||||
: style);
|
||||
const componentStylesKeys = componentStyleFlat.flatMap(style => Object.keys(style));
|
||||
const commonKeys = Object.keys(layoutStyle).filter(key => componentStylesKeys.includes(key));
|
||||
return commonKeys;
|
||||
}
|
||||
function maybeReportOverwrittenProperties(layoutAnimationStyle, style, displayName) {
|
||||
const commonProperties = getCommonProperties(layoutAnimationStyle, style);
|
||||
if (commonProperties.length > 0) {
|
||||
logger.warn(`${commonProperties.length === 1 ? 'Property' : 'Properties'} "${commonProperties.join(', ')}" of ${displayName} may be overwritten by a layout animation. Please wrap your component with an animated view and apply the layout animation on the wrapper.`);
|
||||
}
|
||||
}
|
||||
export function maybeBuild(layoutAnimationOrBuilder, style, displayName) {
|
||||
const isAnimationBuilder = value => 'build' in layoutAnimationOrBuilder && typeof layoutAnimationOrBuilder.build === 'function';
|
||||
if (isAnimationBuilder(layoutAnimationOrBuilder)) {
|
||||
const animationFactory = layoutAnimationOrBuilder.build();
|
||||
const layoutAnimation = animationFactory(mockTargetValues);
|
||||
const animatedStyle = layoutAnimation.animations;
|
||||
const getCommonProperties = (obj1, obj2) => Object.keys(obj1).filter(key => Object.prototype.hasOwnProperty.call(obj2, key));
|
||||
const commonProperties = getCommonProperties(animatedStyle, style || {});
|
||||
if (commonProperties.length > 0) {
|
||||
console.warn(`[Reanimated] ${commonProperties.length === 1 ? 'Property' : 'Properties: '} "${commonProperties}" of ${displayName} may be overwritten with layout animation. Please create a wrapper with the layout animation you want to apply.`);
|
||||
if (__DEV__ && style) {
|
||||
const layoutAnimation = animationFactory(mockTargetValues);
|
||||
maybeReportOverwrittenProperties(layoutAnimation.animations, style, displayName);
|
||||
}
|
||||
return layoutAnimationOrBuilder.build();
|
||||
return animationFactory;
|
||||
} else {
|
||||
return layoutAnimationOrBuilder;
|
||||
}
|
||||
|
||||
Generated
Vendored
+1
-1
@@ -1 +1 @@
|
||||
{"version":3,"names":["mockTargetValues","targetOriginX","targetOriginY","targetWidth","targetHeight","targetGlobalOriginX","targetGlobalOriginY","targetBorderRadius","windowWidth","windowHeight","currentOriginX","currentOriginY","currentWidth","currentHeight","currentGlobalOriginX","currentGlobalOriginY","currentBorderRadius","maybeBuild","layoutAnimationOrBuilder","style","displayName","isAnimationBuilder","value","build","animationFactory","layoutAnimation","animatedStyle","animations","getCommonProperties","obj1","obj2","Object","keys","filter","key","prototype","hasOwnProperty","call","commonProperties","length","console","warn"],"sources":["animationBuilder.tsx"],"sourcesContent":["'use strict';\nimport type {\n ILayoutAnimationBuilder,\n LayoutAnimationFunction,\n LayoutAnimationsValues,\n} from './reanimated2/layoutReanimation';\nimport type { StyleProps } from './reanimated2/commonTypes';\n\nconst mockTargetValues: LayoutAnimationsValues = {\n targetOriginX: 0,\n targetOriginY: 0,\n targetWidth: 0,\n targetHeight: 0,\n targetGlobalOriginX: 0,\n targetGlobalOriginY: 0,\n targetBorderRadius: 0,\n windowWidth: 0,\n windowHeight: 0,\n currentOriginX: 0,\n currentOriginY: 0,\n currentWidth: 0,\n currentHeight: 0,\n currentGlobalOriginX: 0,\n currentGlobalOriginY: 0,\n currentBorderRadius: 0,\n};\n\nexport function maybeBuild(\n layoutAnimationOrBuilder:\n | ILayoutAnimationBuilder\n | LayoutAnimationFunction\n | Keyframe,\n style: StyleProps | undefined,\n displayName: string\n): LayoutAnimationFunction | Keyframe {\n const isAnimationBuilder = (\n value: ILayoutAnimationBuilder | LayoutAnimationFunction | Keyframe\n ): value is ILayoutAnimationBuilder =>\n 'build' in layoutAnimationOrBuilder &&\n typeof layoutAnimationOrBuilder.build === 'function';\n\n if (isAnimationBuilder(layoutAnimationOrBuilder)) {\n const animationFactory = layoutAnimationOrBuilder.build();\n const layoutAnimation = animationFactory(mockTargetValues);\n const animatedStyle = layoutAnimation.animations;\n\n const getCommonProperties = (obj1: object, obj2: object) =>\n Object.keys(obj1).filter((key) =>\n Object.prototype.hasOwnProperty.call(obj2, key)\n );\n\n const commonProperties = getCommonProperties(animatedStyle, style || {});\n if (commonProperties.length > 0) {\n console.warn(\n `[Reanimated] ${\n commonProperties.length === 1 ? 'Property' : 'Properties: '\n } \"${commonProperties}\" of ${displayName} may be overwritten with layout animation. Please create a wrapper with the layout animation you want to apply.`\n );\n }\n\n return layoutAnimationOrBuilder.build();\n } else {\n return layoutAnimationOrBuilder;\n }\n}\n"],"mappings":"AAAA,YAAY;;AAQZ,MAAMA,gBAAwC,GAAG;EAC/CC,aAAa,EAAE,CAAC;EAChBC,aAAa,EAAE,CAAC;EAChBC,WAAW,EAAE,CAAC;EACdC,YAAY,EAAE,CAAC;EACfC,mBAAmB,EAAE,CAAC;EACtBC,mBAAmB,EAAE,CAAC;EACtBC,kBAAkB,EAAE,CAAC;EACrBC,WAAW,EAAE,CAAC;EACdC,YAAY,EAAE,CAAC;EACfC,cAAc,EAAE,CAAC;EACjBC,cAAc,EAAE,CAAC;EACjBC,YAAY,EAAE,CAAC;EACfC,aAAa,EAAE,CAAC;EAChBC,oBAAoB,EAAE,CAAC;EACvBC,oBAAoB,EAAE,CAAC;EACvBC,mBAAmB,EAAE;AACvB,CAAC;AAED,OAAO,SAASC,UAAUA,CACxBC,wBAGY,EACZC,KAA6B,EAC7BC,WAAmB,EACiB;EACpC,MAAMC,kBAAkB,GACtBC,KAAmE,IAEnE,OAAO,IAAIJ,wBAAwB,IACnC,OAAOA,wBAAwB,CAACK,KAAK,KAAK,UAAU;EAEtD,IAAIF,kBAAkB,CAACH,wBAAwB,CAAC,EAAE;IAChD,MAAMM,gBAAgB,GAAGN,wBAAwB,CAACK,KAAK,EAAE;IACzD,MAAME,eAAe,GAAGD,gBAAgB,CAACxB,gBAAgB,CAAC;IAC1D,MAAM0B,aAAa,GAAGD,eAAe,CAACE,UAAU;IAEhD,MAAMC,mBAAmB,GAAGA,CAACC,IAAY,EAAEC,IAAY,KACrDC,MAAM,CAACC,IAAI,CAACH,IAAI,CAAC,CAACI,MAAM,CAAEC,GAAG,IAC3BH,MAAM,CAACI,SAAS,CAACC,cAAc,CAACC,IAAI,CAACP,IAAI,EAAEI,GAAG,CAAC,CAChD;IAEH,MAAMI,gBAAgB,GAAGV,mBAAmB,CAACF,aAAa,EAAEP,KAAK,IAAI,CAAC,CAAC,CAAC;IACxE,IAAImB,gBAAgB,CAACC,MAAM,GAAG,CAAC,EAAE;MAC/BC,OAAO,CAACC,IAAI,CACT,gBACCH,gBAAgB,CAACC,MAAM,KAAK,CAAC,GAAG,UAAU,GAAG,cAC9C,KAAID,gBAAiB,QAAOlB,WAAY,iHAAgH,CAC1J;IACH;IAEA,OAAOF,wBAAwB,CAACK,KAAK,EAAE;EACzC,CAAC,MAAM;IACL,OAAOL,wBAAwB;EACjC;AACF"}
|
||||
{"version":3,"names":["logger","mockTargetValues","targetOriginX","targetOriginY","targetWidth","targetHeight","targetGlobalOriginX","targetGlobalOriginY","targetBorderRadius","windowWidth","windowHeight","currentOriginX","currentOriginY","currentWidth","currentHeight","currentGlobalOriginX","currentGlobalOriginY","currentBorderRadius","getCommonProperties","layoutStyle","componentStyle","componentStyleFlat","Array","isArray","flat","filter","Boolean","map","style","initial","value","componentStylesKeys","flatMap","Object","keys","commonKeys","key","includes","maybeReportOverwrittenProperties","layoutAnimationStyle","displayName","commonProperties","length","warn","join","maybeBuild","layoutAnimationOrBuilder","isAnimationBuilder","build","animationFactory","__DEV__","layoutAnimation","animations"],"sourceRoot":"../../src","sources":["animationBuilder.tsx"],"mappings":"AAAA,YAAY;;AACZ,SAASA,MAAM,QAAQ,UAAU;AASjC,MAAMC,gBAAuC,GAAG;EAC9CC,aAAa,EAAE,CAAC;EAChBC,aAAa,EAAE,CAAC;EAChBC,WAAW,EAAE,CAAC;EACdC,YAAY,EAAE,CAAC;EACfC,mBAAmB,EAAE,CAAC;EACtBC,mBAAmB,EAAE,CAAC;EACtBC,kBAAkB,EAAE,CAAC;EACrBC,WAAW,EAAE,CAAC;EACdC,YAAY,EAAE,CAAC;EACfC,cAAc,EAAE,CAAC;EACjBC,cAAc,EAAE,CAAC;EACjBC,YAAY,EAAE,CAAC;EACfC,aAAa,EAAE,CAAC;EAChBC,oBAAoB,EAAE,CAAC;EACvBC,oBAAoB,EAAE,CAAC;EACvBC,mBAAmB,EAAE;AACvB,CAAC;AAED,SAASC,mBAAmBA,CAC1BC,WAAuB,EACvBC,cAAuC,EACvC;EACA,IAAIC,kBAAkB,GAAGC,KAAK,CAACC,OAAO,CAACH,cAAc,CAAC,GAClDA,cAAc,CAACI,IAAI,CAAC,CAAC,GACrB,CAACJ,cAAc,CAAC;EAEpBC,kBAAkB,GAAGA,kBAAkB,CAACI,MAAM,CAACC,OAAO,CAAC;EAEvDL,kBAAkB,GAAGA,kBAAkB,CAACM,GAAG,CAAEC,KAAK,IAChD,SAAS,IAAIA,KAAK,GACdA,KAAK,CAACC,OAAO,CAACC,KAAK,CAAC;EAAA,EACpBF,KACN,CAAC;EAED,MAAMG,mBAAmB,GAAGV,kBAAkB,CAACW,OAAO,CAAEJ,KAAK,IAC3DK,MAAM,CAACC,IAAI,CAACN,KAAK,CACnB,CAAC;EAED,MAAMO,UAAU,GAAGF,MAAM,CAACC,IAAI,CAACf,WAAW,CAAC,CAACM,MAAM,CAAEW,GAAG,IACrDL,mBAAmB,CAACM,QAAQ,CAACD,GAAG,CAClC,CAAC;EAED,OAAOD,UAAU;AACnB;AAEA,SAASG,gCAAgCA,CACvCC,oBAAgC,EAChCX,KAA8B,EAC9BY,WAAmB,EACnB;EACA,MAAMC,gBAAgB,GAAGvB,mBAAmB,CAACqB,oBAAoB,EAAEX,KAAK,CAAC;EAEzE,IAAIa,gBAAgB,CAACC,MAAM,GAAG,CAAC,EAAE;IAC/B1C,MAAM,CAAC2C,IAAI,CACT,GACEF,gBAAgB,CAACC,MAAM,KAAK,CAAC,GAAG,UAAU,GAAG,YAAY,KACtDD,gBAAgB,CAACG,IAAI,CACxB,IACF,CAAC,QAAQJ,WAAW,4IACtB,CAAC;EACH;AACF;AAEA,OAAO,SAASK,UAAUA,CACxBC,wBAGY,EACZlB,KAA0C,EAC1CY,WAAmB,EACiB;EACpC,MAAMO,kBAAkB,GACtBjB,KAAmE,IAEnE,OAAO,IAAIgB,wBAAwB,IACnC,OAAOA,wBAAwB,CAACE,KAAK,KAAK,UAAU;EAEtD,IAAID,kBAAkB,CAACD,wBAAwB,CAAC,EAAE;IAChD,MAAMG,gBAAgB,GAAGH,wBAAwB,CAACE,KAAK,CAAC,CAAC;IAEzD,IAAIE,OAAO,IAAItB,KAAK,EAAE;MACpB,MAAMuB,eAAe,GAAGF,gBAAgB,CAAChD,gBAAgB,CAAC;MAC1DqC,gCAAgC,CAC9Ba,eAAe,CAACC,UAAU,EAC1BxB,KAAK,EACLY,WACF,CAAC;IACH;IAEA,OAAOS,gBAAgB;EACzB,CAAC,MAAM;IACL,OAAOH,wBAAwB;EACjC;AACF","ignoreList":[]}
|
||||
|
||||
Generated
Vendored
+30
-50
@@ -1,16 +1,10 @@
|
||||
'use strict';
|
||||
|
||||
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
||||
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
||||
function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
||||
import { isSharedValue } from '../isSharedValue';
|
||||
import { startMapper, stopMapper } from '../mappers';
|
||||
import { updateProps } from '../updateProps';
|
||||
import { makeViewDescriptorsSet } from '../ViewDescriptorsSet';
|
||||
import { flattenArray } from './utils';
|
||||
import { makeViewDescriptorsSet } from '../reanimated2/ViewDescriptorsSet';
|
||||
import { adaptViewConfig } from '../ConfigHelper';
|
||||
import updateProps from '../reanimated2/UpdateProps';
|
||||
import { stopMapper, startMapper } from '../reanimated2/mappers';
|
||||
import { isSharedValue } from '../reanimated2/isSharedValue';
|
||||
import { shouldBeUseWeb } from '../reanimated2/PlatformChecker';
|
||||
const SHOULD_BE_USE_WEB = shouldBeUseWeb();
|
||||
function isInlineStyleTransform(transform) {
|
||||
if (!Array.isArray(transform)) {
|
||||
return false;
|
||||
@@ -22,28 +16,29 @@ function inlinePropsHasChanged(styles1, styles2) {
|
||||
return true;
|
||||
}
|
||||
for (const key of Object.keys(styles1)) {
|
||||
if (styles1[key] !== styles2[key]) return true;
|
||||
if (styles1[key] !== styles2[key]) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
function getInlinePropsUpdate(inlineProps) {
|
||||
function getInlinePropsUpdate(styleValue) {
|
||||
'worklet';
|
||||
|
||||
const update = {};
|
||||
for (const [key, styleValue] of Object.entries(inlineProps)) {
|
||||
if (isSharedValue(styleValue)) {
|
||||
update[key] = styleValue.value;
|
||||
} else if (Array.isArray(styleValue)) {
|
||||
update[key] = styleValue.map(item => {
|
||||
return getInlinePropsUpdate(item);
|
||||
});
|
||||
} else if (typeof styleValue === 'object') {
|
||||
update[key] = getInlinePropsUpdate(styleValue);
|
||||
} else {
|
||||
update[key] = styleValue;
|
||||
}
|
||||
if (isSharedValue(styleValue)) {
|
||||
return styleValue.value;
|
||||
}
|
||||
return update;
|
||||
if (Array.isArray(styleValue)) {
|
||||
return styleValue.map(getInlinePropsUpdate);
|
||||
}
|
||||
if (styleValue && typeof styleValue === 'object') {
|
||||
const update = {};
|
||||
for (const [key, value] of Object.entries(styleValue)) {
|
||||
update[key] = getInlinePropsUpdate(value);
|
||||
}
|
||||
return update;
|
||||
}
|
||||
return styleValue;
|
||||
}
|
||||
function extractSharedValuesMapFromProps(props) {
|
||||
const inlineProps = {};
|
||||
@@ -55,11 +50,11 @@ function extractSharedValuesMapFromProps(props) {
|
||||
if (!style) {
|
||||
return;
|
||||
}
|
||||
for (const [key, styleValue] of Object.entries(style)) {
|
||||
for (const [styleKey, styleValue] of Object.entries(style)) {
|
||||
if (isSharedValue(styleValue)) {
|
||||
inlineProps[key] = styleValue;
|
||||
} else if (key === 'transform' && isInlineStyleTransform(styleValue)) {
|
||||
inlineProps[key] = styleValue;
|
||||
inlineProps[styleKey] = styleValue;
|
||||
} else if (styleKey === 'transform' && isInlineStyleTransform(styleValue)) {
|
||||
inlineProps[styleKey] = styleValue;
|
||||
}
|
||||
}
|
||||
});
|
||||
@@ -91,11 +86,9 @@ export function getInlineStyle(style, isFirstRender) {
|
||||
return newStyle;
|
||||
}
|
||||
export class InlinePropManager {
|
||||
constructor() {
|
||||
_defineProperty(this, "_inlinePropsViewDescriptors", null);
|
||||
_defineProperty(this, "_inlinePropsMapperId", null);
|
||||
_defineProperty(this, "_inlineProps", {});
|
||||
}
|
||||
_inlinePropsViewDescriptors = null;
|
||||
_inlinePropsMapperId = null;
|
||||
_inlineProps = {};
|
||||
attachInlineProps(animatedComponent, viewInfo) {
|
||||
const newInlineProps = extractSharedValuesMapFromProps(animatedComponent.props);
|
||||
const hasChanged = inlinePropsHasChanged(newInlineProps, this._inlineProps);
|
||||
@@ -104,32 +97,19 @@ export class InlinePropManager {
|
||||
this._inlinePropsViewDescriptors = makeViewDescriptorsSet();
|
||||
const {
|
||||
viewTag,
|
||||
viewName,
|
||||
shadowNodeWrapper,
|
||||
viewConfig
|
||||
shadowNodeWrapper
|
||||
} = viewInfo;
|
||||
if (Object.keys(newInlineProps).length && viewConfig) {
|
||||
adaptViewConfig(viewConfig);
|
||||
}
|
||||
this._inlinePropsViewDescriptors.add({
|
||||
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
||||
tag: viewTag,
|
||||
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
||||
name: viewName,
|
||||
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
||||
shadowNodeWrapper: shadowNodeWrapper
|
||||
});
|
||||
}
|
||||
const shareableViewDescriptors = this._inlinePropsViewDescriptors.shareableViewDescriptors;
|
||||
const maybeViewRef = SHOULD_BE_USE_WEB ? {
|
||||
items: new Set([animatedComponent])
|
||||
} // see makeViewsRefSet
|
||||
: undefined;
|
||||
const updaterFunction = () => {
|
||||
'worklet';
|
||||
|
||||
const update = getInlinePropsUpdate(newInlineProps);
|
||||
updateProps(shareableViewDescriptors, update, maybeViewRef);
|
||||
updateProps(shareableViewDescriptors, update);
|
||||
};
|
||||
this._inlineProps = newInlineProps;
|
||||
if (this._inlinePropsMapperId) {
|
||||
|
||||
Generated
Vendored
+1
-1
File diff suppressed because one or more lines are too long
Generated
Vendored
+32
-68
@@ -1,86 +1,50 @@
|
||||
'use strict';
|
||||
|
||||
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
||||
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
||||
function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
||||
import { NativeEventEmitter, NativeModules, findNodeHandle } from 'react-native';
|
||||
import { shouldBeUseWeb } from '../reanimated2/PlatformChecker';
|
||||
import { runOnJS, runOnUIImmediately } from '../reanimated2/threads';
|
||||
const SHOULD_BE_USE_WEB = shouldBeUseWeb();
|
||||
class JSPropsUpdaterPaper {
|
||||
constructor() {
|
||||
_defineProperty(this, "_reanimatedEventEmitter", void 0);
|
||||
this._reanimatedEventEmitter = new NativeEventEmitter(NativeModules.ReanimatedModule);
|
||||
import { runOnUI } from 'react-native-worklets';
|
||||
import { SHOULD_BE_USE_WEB } from '../common';
|
||||
class JSPropsUpdaterNative {
|
||||
static _tagToComponentMapping = new Map();
|
||||
registerComponent(animatedComponent, jsProps) {
|
||||
const viewTag = animatedComponent.getComponentViewTag();
|
||||
JSPropsUpdaterNative._tagToComponentMapping.set(viewTag, animatedComponent);
|
||||
runOnUI(() => {
|
||||
global._tagToJSPropNamesMapping[viewTag] = Object.fromEntries(jsProps.map(propName => [propName, true]));
|
||||
})();
|
||||
}
|
||||
addOnJSPropsChangeListener(animatedComponent) {
|
||||
const viewTag = findNodeHandle(animatedComponent);
|
||||
JSPropsUpdaterPaper._tagToComponentMapping.set(viewTag, animatedComponent);
|
||||
if (JSPropsUpdaterPaper._tagToComponentMapping.size === 1) {
|
||||
const listener = data => {
|
||||
const component = JSPropsUpdaterPaper._tagToComponentMapping.get(data.viewTag);
|
||||
component === null || component === void 0 ? void 0 : component._updateFromNative(data.props);
|
||||
};
|
||||
this._reanimatedEventEmitter.addListener('onReanimatedPropsChange', listener);
|
||||
}
|
||||
unregisterComponent(animatedComponent) {
|
||||
const viewTag = animatedComponent.getComponentViewTag();
|
||||
JSPropsUpdaterNative._tagToComponentMapping.delete(viewTag);
|
||||
runOnUI(() => {
|
||||
delete global._tagToJSPropNamesMapping[viewTag];
|
||||
})();
|
||||
}
|
||||
removeOnJSPropsChangeListener(animatedComponent) {
|
||||
const viewTag = findNodeHandle(animatedComponent);
|
||||
JSPropsUpdaterPaper._tagToComponentMapping.delete(viewTag);
|
||||
if (JSPropsUpdaterPaper._tagToComponentMapping.size === 0) {
|
||||
this._reanimatedEventEmitter.removeAllListeners('onReanimatedPropsChange');
|
||||
}
|
||||
updateProps(operations) {
|
||||
operations.forEach(({
|
||||
tag,
|
||||
updates
|
||||
}) => {
|
||||
const component = JSPropsUpdaterNative._tagToComponentMapping.get(tag);
|
||||
component?.setNativeProps(updates);
|
||||
});
|
||||
}
|
||||
}
|
||||
_defineProperty(JSPropsUpdaterPaper, "_tagToComponentMapping", new Map());
|
||||
class JSPropsUpdaterFabric {
|
||||
constructor() {
|
||||
if (!JSPropsUpdaterFabric.isInitialized) {
|
||||
const updater = (viewTag, props) => {
|
||||
const component = JSPropsUpdaterFabric._tagToComponentMapping.get(viewTag);
|
||||
component === null || component === void 0 ? void 0 : component._updateFromNative(props);
|
||||
};
|
||||
runOnUIImmediately(() => {
|
||||
'worklet';
|
||||
|
||||
global.updateJSProps = (viewTag, props) => {
|
||||
runOnJS(updater)(viewTag, props);
|
||||
};
|
||||
})();
|
||||
JSPropsUpdaterFabric.isInitialized = true;
|
||||
}
|
||||
}
|
||||
addOnJSPropsChangeListener(animatedComponent) {
|
||||
if (!JSPropsUpdaterFabric.isInitialized) {
|
||||
return;
|
||||
}
|
||||
const viewTag = findNodeHandle(animatedComponent);
|
||||
JSPropsUpdaterFabric._tagToComponentMapping.set(viewTag, animatedComponent);
|
||||
}
|
||||
removeOnJSPropsChangeListener(animatedComponent) {
|
||||
if (!JSPropsUpdaterFabric.isInitialized) {
|
||||
return;
|
||||
}
|
||||
const viewTag = findNodeHandle(animatedComponent);
|
||||
JSPropsUpdaterFabric._tagToComponentMapping.delete(viewTag);
|
||||
}
|
||||
}
|
||||
_defineProperty(JSPropsUpdaterFabric, "_tagToComponentMapping", new Map());
|
||||
_defineProperty(JSPropsUpdaterFabric, "isInitialized", false);
|
||||
class JSPropsUpdaterWeb {
|
||||
addOnJSPropsChangeListener(_animatedComponent) {
|
||||
registerComponent(_animatedComponent) {
|
||||
// noop
|
||||
}
|
||||
removeOnJSPropsChangeListener(_animatedComponent) {
|
||||
unregisterComponent(_animatedComponent) {
|
||||
// noop
|
||||
}
|
||||
updateProps(_operations) {
|
||||
// noop
|
||||
}
|
||||
}
|
||||
let JSPropsUpdater;
|
||||
if (SHOULD_BE_USE_WEB) {
|
||||
JSPropsUpdater = JSPropsUpdaterWeb;
|
||||
} else if (global._IS_FABRIC) {
|
||||
JSPropsUpdater = JSPropsUpdaterFabric;
|
||||
} else {
|
||||
JSPropsUpdater = JSPropsUpdaterPaper;
|
||||
JSPropsUpdater = JSPropsUpdaterNative;
|
||||
}
|
||||
export default JSPropsUpdater;
|
||||
const jsPropsUpdater = new JSPropsUpdater();
|
||||
export default jsPropsUpdater;
|
||||
//# sourceMappingURL=JSPropsUpdater.js.map
|
||||
Generated
Vendored
+1
-1
File diff suppressed because one or more lines are too long
Generated
Vendored
+29
-35
@@ -1,23 +1,16 @@
|
||||
'use strict';
|
||||
|
||||
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
||||
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
||||
function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
||||
import { isSharedValue } from '../reanimated2';
|
||||
import { isChromeDebugger } from '../reanimated2/PlatformChecker';
|
||||
import WorkletEventHandler from '../reanimated2/WorkletEventHandler';
|
||||
import { initialUpdaterRun } from '../reanimated2/animation';
|
||||
import { hasInlineStyles, getInlineStyle } from './InlinePropManager';
|
||||
import { initialUpdaterRun } from '../animation';
|
||||
import { isSharedValue } from '../isSharedValue';
|
||||
import { WorkletEventHandler } from '../WorkletEventHandler';
|
||||
import { getInlineStyle, hasInlineStyles } from './InlinePropManager';
|
||||
import { flattenArray, has } from './utils';
|
||||
import { StyleSheet } from 'react-native';
|
||||
function dummyListener() {
|
||||
// empty listener we use to assign to listener properties for which animated
|
||||
// event is used.
|
||||
}
|
||||
export class PropsFilter {
|
||||
constructor() {
|
||||
_defineProperty(this, "_initialStyle", {});
|
||||
}
|
||||
_initialPropsMap = new Map();
|
||||
filterNonAnimatedProps(component) {
|
||||
const inputProps = component.props;
|
||||
const props = {};
|
||||
@@ -27,37 +20,38 @@ export class PropsFilter {
|
||||
const styleProp = inputProps.style;
|
||||
const styles = flattenArray(styleProp ?? []);
|
||||
const processedStyle = styles.map(style => {
|
||||
if (style && style.viewDescriptors) {
|
||||
// this is how we recognize styles returned by useAnimatedStyle
|
||||
style.viewsRef.add(component);
|
||||
if (style?.viewDescriptors) {
|
||||
const handle = style;
|
||||
if (component._isFirstRender) {
|
||||
this._initialStyle = {
|
||||
...style.initial.value,
|
||||
...this._initialStyle,
|
||||
...initialUpdaterRun(style.initial.updater)
|
||||
};
|
||||
this._initialPropsMap.set(handle, {
|
||||
...handle.initial.value,
|
||||
...initialUpdaterRun(handle.initial.updater)
|
||||
});
|
||||
}
|
||||
return this._initialStyle;
|
||||
return this._initialPropsMap.get(handle) ?? {};
|
||||
} else if (hasInlineStyles(style)) {
|
||||
return getInlineStyle(style, component._isFirstRender);
|
||||
} else {
|
||||
return style;
|
||||
}
|
||||
});
|
||||
props[key] = StyleSheet.flatten(processedStyle);
|
||||
// keep styles as they were passed by the user
|
||||
// it will help other libs to interpret styles correctly
|
||||
props[key] = processedStyle;
|
||||
} else if (key === 'animatedProps') {
|
||||
const animatedProp = inputProps.animatedProps;
|
||||
if (animatedProp.initial !== undefined) {
|
||||
Object.keys(animatedProp.initial.value).forEach(key => {
|
||||
var _animatedProp$initial, _animatedProp$viewsRe;
|
||||
props[key] = (_animatedProp$initial = animatedProp.initial) === null || _animatedProp$initial === void 0 ? void 0 : _animatedProp$initial.value[key];
|
||||
(_animatedProp$viewsRe = animatedProp.viewsRef) === null || _animatedProp$viewsRe === void 0 ? void 0 : _animatedProp$viewsRe.add(component);
|
||||
});
|
||||
}
|
||||
} else if (has('current', value) && value.current instanceof WorkletEventHandler) {
|
||||
if (value.current.eventNames.length > 0) {
|
||||
value.current.eventNames.forEach(eventName => {
|
||||
props[eventName] = has('listeners', value.current) ? value.current.listeners[eventName] : dummyListener;
|
||||
const animatedPropsProp = inputProps.animatedProps;
|
||||
const animatedPropsArray = flattenArray(animatedPropsProp ?? []);
|
||||
animatedPropsArray.forEach(animatedProps => {
|
||||
if (animatedProps?.viewDescriptors && animatedProps.initial) {
|
||||
Object.keys(animatedProps.initial.value).forEach(initialValueKey => {
|
||||
props[initialValueKey] = animatedProps.initial?.value[initialValueKey];
|
||||
});
|
||||
}
|
||||
});
|
||||
} else if (has('workletEventHandler', value) && value.workletEventHandler instanceof WorkletEventHandler) {
|
||||
if (value.workletEventHandler.eventNames.length > 0) {
|
||||
value.workletEventHandler.eventNames.forEach(eventName => {
|
||||
props[eventName] = has('listeners', value.workletEventHandler) ? value.workletEventHandler.listeners[eventName] : dummyListener;
|
||||
});
|
||||
} else {
|
||||
props[key] = dummyListener;
|
||||
@@ -66,7 +60,7 @@ export class PropsFilter {
|
||||
if (component._isFirstRender) {
|
||||
props[key] = value.value;
|
||||
}
|
||||
} else if (key !== 'onGestureHandlerStateChange' || !isChromeDebugger()) {
|
||||
} else {
|
||||
props[key] = value;
|
||||
}
|
||||
}
|
||||
|
||||
Generated
Vendored
+1
-1
File diff suppressed because one or more lines are too long
Generated
Vendored
+1
-1
@@ -1 +1 @@
|
||||
{"version":3,"names":[],"sources":["commonTypes.ts"],"sourcesContent":["'use strict';\nimport type { Ref, Component } from 'react';\nimport type {\n StyleProps,\n BaseAnimationBuilder,\n ILayoutAnimationBuilder,\n EntryExitAnimationFunction,\n SharedTransition,\n SharedValue,\n} from '../reanimated2';\nimport type {\n ViewDescriptorsSet,\n ViewRefSet,\n} from '../reanimated2/ViewDescriptorsSet';\nimport type { SkipEnteringContext } from '../reanimated2/component/LayoutAnimationConfig';\nimport type { ShadowNodeWrapper } from '../reanimated2/commonTypes';\nimport type { ViewConfig } from '../ConfigHelper';\n\nexport interface AnimatedProps extends Record<string, unknown> {\n viewDescriptors?: ViewDescriptorsSet;\n viewsRef?: ViewRefSet<unknown>;\n initial?: SharedValue<StyleProps>;\n}\n\nexport interface ViewInfo {\n viewTag: number | HTMLElement | null;\n viewName: string | null;\n shadowNodeWrapper: ShadowNodeWrapper | null;\n viewConfig: ViewConfig;\n}\n\nexport interface IInlinePropManager {\n attachInlineProps(\n animatedComponent: React.Component<unknown, unknown>,\n viewInfo: ViewInfo\n ): void;\n detachInlineProps(): void;\n}\n\nexport interface IPropsFilter {\n filterNonAnimatedProps: (\n component: React.Component<unknown, unknown> & IAnimatedComponentInternal\n ) => Record<string, unknown>;\n}\n\nexport interface IJSPropsUpdater {\n addOnJSPropsChangeListener(\n animatedComponent: React.Component<unknown, unknown> &\n IAnimatedComponentInternal\n ): void;\n removeOnJSPropsChangeListener(\n animatedComponent: React.Component<unknown, unknown> &\n IAnimatedComponentInternal\n ): void;\n}\n\nexport type LayoutAnimationStaticContext = {\n presetName: string;\n};\n\nexport type AnimatedComponentProps<P extends Record<string, unknown>> = P & {\n forwardedRef?: Ref<Component>;\n style?: NestedArray<StyleProps>;\n animatedProps?: Partial<AnimatedComponentProps<AnimatedProps>>;\n animatedStyle?: StyleProps;\n layout?: (\n | BaseAnimationBuilder\n | ILayoutAnimationBuilder\n | typeof BaseAnimationBuilder\n ) &\n LayoutAnimationStaticContext;\n entering?: (\n | BaseAnimationBuilder\n | typeof BaseAnimationBuilder\n | EntryExitAnimationFunction\n | Keyframe\n ) &\n LayoutAnimationStaticContext;\n exiting?: (\n | BaseAnimationBuilder\n | typeof BaseAnimationBuilder\n | EntryExitAnimationFunction\n | Keyframe\n ) &\n LayoutAnimationStaticContext;\n sharedTransitionTag?: string;\n sharedTransitionStyle?: SharedTransition;\n};\n\nexport interface AnimatedComponentRef extends Component {\n setNativeProps?: (props: Record<string, unknown>) => void;\n getScrollableNode?: () => AnimatedComponentRef;\n getAnimatableRef?: () => AnimatedComponentRef;\n}\n\nexport interface IAnimatedComponentInternal {\n _styles: StyleProps[] | null;\n _animatedProps?: Partial<AnimatedComponentProps<AnimatedProps>>;\n _viewTag: number;\n _isFirstRender: boolean;\n animatedStyle: { value: StyleProps };\n _component: AnimatedComponentRef | HTMLElement | null;\n _sharedElementTransition: SharedTransition | null;\n _jsPropsUpdater: IJSPropsUpdater;\n _InlinePropManager: IInlinePropManager;\n _PropsFilter: IPropsFilter;\n _viewInfo?: ViewInfo;\n context: React.ContextType<typeof SkipEnteringContext>;\n}\n\nexport type NestedArray<T> = T | NestedArray<T>[];\n\nexport interface InitialComponentProps extends Record<string, unknown> {\n ref?: Ref<Component>;\n collapsable?: boolean;\n}\n"],"mappings":"AAAA,YAAY;;AAAC"}
|
||||
{"version":3,"names":[],"sourceRoot":"../../../src","sources":["createAnimatedComponent/commonTypes.ts"],"mappings":"AAAA,YAAY;;AAAC","ignoreList":[]}
|
||||
|
||||
Generated
Vendored
+32
-391
@@ -1,41 +1,9 @@
|
||||
'use strict';
|
||||
|
||||
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
||||
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
||||
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
||||
function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
||||
import React from 'react';
|
||||
import { findNodeHandle, Platform } from 'react-native';
|
||||
import WorkletEventHandler from '../reanimated2/WorkletEventHandler';
|
||||
import '../reanimated2/layoutReanimation/animationsManager';
|
||||
import invariant from 'invariant';
|
||||
import { adaptViewConfig } from '../ConfigHelper';
|
||||
import { RNRenderer } from '../reanimated2/platform-specific/RNRenderer';
|
||||
import { configureLayoutAnimations, enableLayoutAnimations } from '../reanimated2/core';
|
||||
import { SharedTransition, LayoutAnimationType } from '../reanimated2/layoutReanimation';
|
||||
import { getShadowNodeWrapperFromRef } from '../reanimated2/fabricUtils';
|
||||
import { removeFromPropsRegistry } from '../reanimated2/PropsRegistry';
|
||||
import { getReduceMotionFromConfig } from '../reanimated2/animation/util';
|
||||
import { maybeBuild } from '../animationBuilder';
|
||||
import { SkipEnteringContext } from '../reanimated2/component/LayoutAnimationConfig';
|
||||
import JSPropsUpdater from './JSPropsUpdater';
|
||||
import { has, flattenArray } from './utils';
|
||||
import setAndForwardRef from './setAndForwardRef';
|
||||
import { isFabric, isJest, isWeb, shouldBeUseWeb } from '../reanimated2/PlatformChecker';
|
||||
import { InlinePropManager } from './InlinePropManager';
|
||||
import { PropsFilter } from './PropsFilter';
|
||||
import { startWebLayoutAnimation, tryActivateLayoutTransition, configureWebLayoutAnimations, getReducedMotionFromConfig } from '../reanimated2/layoutReanimation/web';
|
||||
const IS_WEB = isWeb();
|
||||
const IS_FABRIC = isFabric();
|
||||
function onlyAnimatedStyles(styles) {
|
||||
return styles.filter(style => style === null || style === void 0 ? void 0 : style.viewDescriptors);
|
||||
}
|
||||
function isSameAnimatedStyle(style1, style2) {
|
||||
// We cannot use equality check to compare useAnimatedStyle outputs directly.
|
||||
// Instead, we can compare its viewsRefs.
|
||||
return (style1 === null || style1 === void 0 ? void 0 : style1.viewsRef) === (style2 === null || style2 === void 0 ? void 0 : style2.viewsRef);
|
||||
}
|
||||
const isSameAnimatedProps = isSameAnimatedStyle;
|
||||
import AnimatedComponentImpl from './AnimatedComponent';
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
|
||||
/**
|
||||
* Lets you create an Animated version of any React Native component.
|
||||
@@ -45,366 +13,39 @@ const isSameAnimatedProps = isSameAnimatedStyle;
|
||||
* @see https://docs.swmansion.com/react-native-reanimated/docs/core/createAnimatedComponent
|
||||
*/
|
||||
|
||||
// Don't change the order of overloads, since such a change breaks current behavior
|
||||
|
||||
/**
|
||||
* @deprecated Please use `Animated.FlatList` component instead of calling `Animated.createAnimatedComponent(FlatList)` manually.
|
||||
*/ // @ts-ignore This is required to create this overload, since type of createAnimatedComponent is incorrect and doesn't include typeof FlatList
|
||||
* @deprecated Please use `Animated.FlatList` component instead of calling
|
||||
* `Animated.createAnimatedComponent(FlatList)` manually.
|
||||
*/
|
||||
// @ts-ignore This is required to create this overload, since type of createAnimatedComponent is incorrect and doesn't include typeof FlatList
|
||||
import { jsx as _jsx } from "react/jsx-runtime";
|
||||
export function createAnimatedComponent(Component, options) {
|
||||
invariant(typeof Component !== 'function' || Component.prototype && Component.prototype.isReactComponent, `Looks like you're passing a function component \`${Component.name}\` to \`createAnimatedComponent\` function which supports only class components. Please wrap your function component with \`React.forwardRef()\` or use a class component instead.`);
|
||||
class AnimatedComponent extends React.Component {
|
||||
class AnimatedComponent extends AnimatedComponentImpl {
|
||||
static displayName = `AnimatedComponent(${Component.displayName || Component.name || 'Component'})`;
|
||||
constructor(props) {
|
||||
super(props);
|
||||
_defineProperty(this, "_styles", null);
|
||||
_defineProperty(this, "_animatedProps", void 0);
|
||||
_defineProperty(this, "_viewTag", -1);
|
||||
_defineProperty(this, "_isFirstRender", true);
|
||||
_defineProperty(this, "animatedStyle", {
|
||||
value: {}
|
||||
});
|
||||
_defineProperty(this, "_component", null);
|
||||
_defineProperty(this, "_sharedElementTransition", null);
|
||||
_defineProperty(this, "_jsPropsUpdater", new JSPropsUpdater());
|
||||
_defineProperty(this, "_InlinePropManager", new InlinePropManager());
|
||||
_defineProperty(this, "_PropsFilter", new PropsFilter());
|
||||
_defineProperty(this, "_viewInfo", void 0);
|
||||
_defineProperty(this, "context", void 0);
|
||||
_defineProperty(this, "_setComponentRef", setAndForwardRef({
|
||||
getForwardedRef: () => this.props.forwardedRef,
|
||||
setLocalRef: ref => {
|
||||
// TODO update config
|
||||
|
||||
const tag = IS_WEB ? ref : findNodeHandle(ref);
|
||||
const {
|
||||
layout,
|
||||
entering,
|
||||
exiting,
|
||||
sharedTransitionTag
|
||||
} = this.props;
|
||||
if ((layout || entering || exiting || sharedTransitionTag) && tag != null) {
|
||||
var _this$context;
|
||||
if (!shouldBeUseWeb()) {
|
||||
enableLayoutAnimations(true, false);
|
||||
}
|
||||
if (layout) {
|
||||
configureLayoutAnimations(tag, LayoutAnimationType.LAYOUT, maybeBuild(layout, undefined /* We don't have to warn user if style has common properties with animation for LAYOUT */, AnimatedComponent.displayName));
|
||||
}
|
||||
const skipEntering = (_this$context = this.context) === null || _this$context === void 0 ? void 0 : _this$context.current;
|
||||
if (entering && !skipEntering) {
|
||||
var _this$props;
|
||||
configureLayoutAnimations(tag, LayoutAnimationType.ENTERING, maybeBuild(entering, (_this$props = this.props) === null || _this$props === void 0 ? void 0 : _this$props.style, AnimatedComponent.displayName));
|
||||
}
|
||||
if (exiting) {
|
||||
const reduceMotionInExiting = 'getReduceMotion' in exiting && typeof exiting.getReduceMotion === 'function' ? getReduceMotionFromConfig(exiting.getReduceMotion()) : getReduceMotionFromConfig();
|
||||
if (!reduceMotionInExiting) {
|
||||
var _this$props2;
|
||||
configureLayoutAnimations(tag, LayoutAnimationType.EXITING, maybeBuild(exiting, (_this$props2 = this.props) === null || _this$props2 === void 0 ? void 0 : _this$props2.style, AnimatedComponent.displayName));
|
||||
}
|
||||
}
|
||||
if (sharedTransitionTag && !IS_WEB) {
|
||||
const sharedElementTransition = this.props.sharedTransitionStyle ?? new SharedTransition();
|
||||
const reduceMotionInTransition = getReduceMotionFromConfig(sharedElementTransition.getReduceMotion());
|
||||
if (!reduceMotionInTransition) {
|
||||
sharedElementTransition.registerTransition(tag, sharedTransitionTag);
|
||||
this._sharedElementTransition = sharedElementTransition;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (ref !== this._component) {
|
||||
this._component = ref;
|
||||
}
|
||||
}
|
||||
}));
|
||||
if (isJest()) {
|
||||
this.animatedStyle = {
|
||||
value: {}
|
||||
};
|
||||
}
|
||||
}
|
||||
componentDidMount() {
|
||||
this._attachNativeEvents();
|
||||
this._jsPropsUpdater.addOnJSPropsChangeListener(this);
|
||||
this._attachAnimatedStyles();
|
||||
this._InlinePropManager.attachInlineProps(this, this._getViewInfo());
|
||||
if (IS_WEB) {
|
||||
configureWebLayoutAnimations();
|
||||
if (!this.props.entering) {
|
||||
this._isFirstRender = false;
|
||||
return;
|
||||
}
|
||||
if (getReducedMotionFromConfig(this.props.entering)) {
|
||||
this._isFirstRender = false;
|
||||
return;
|
||||
}
|
||||
startWebLayoutAnimation(this.props, this._component, LayoutAnimationType.ENTERING);
|
||||
}
|
||||
this._isFirstRender = false;
|
||||
}
|
||||
componentWillUnmount() {
|
||||
var _this$_sharedElementT;
|
||||
this._detachNativeEvents();
|
||||
this._jsPropsUpdater.removeOnJSPropsChangeListener(this);
|
||||
this._detachStyles();
|
||||
this._InlinePropManager.detachInlineProps();
|
||||
(_this$_sharedElementT = this._sharedElementTransition) === null || _this$_sharedElementT === void 0 ? void 0 : _this$_sharedElementT.unregisterTransition(this._viewTag);
|
||||
if (IS_WEB && this.props.exiting && !getReducedMotionFromConfig(this.props.exiting)) {
|
||||
startWebLayoutAnimation(this.props, this._component, LayoutAnimationType.EXITING);
|
||||
}
|
||||
}
|
||||
_getEventViewRef() {
|
||||
var _this$_component, _getScrollableNode, _ref;
|
||||
// Make sure to get the scrollable node for components that implement
|
||||
// `ScrollResponder.Mixin`.
|
||||
return (_this$_component = this._component) !== null && _this$_component !== void 0 && _this$_component.getScrollableNode ? (_getScrollableNode = (_ref = this._component).getScrollableNode) === null || _getScrollableNode === void 0 ? void 0 : _getScrollableNode.call(_ref) : this._component;
|
||||
}
|
||||
_attachNativeEvents() {
|
||||
const node = this._getEventViewRef();
|
||||
let viewTag = null; // We set it only if needed
|
||||
|
||||
for (const key in this.props) {
|
||||
const prop = this.props[key];
|
||||
if (has('current', prop) && prop.current instanceof WorkletEventHandler) {
|
||||
if (viewTag === null) {
|
||||
viewTag = findNodeHandle(options !== null && options !== void 0 && options.setNativeProps ? this : node);
|
||||
}
|
||||
prop.current.registerForEvents(viewTag, key);
|
||||
}
|
||||
}
|
||||
}
|
||||
_detachNativeEvents() {
|
||||
for (const key in this.props) {
|
||||
const prop = this.props[key];
|
||||
if (has('current', prop) && prop.current instanceof WorkletEventHandler) {
|
||||
prop.current.unregisterFromEvents();
|
||||
}
|
||||
}
|
||||
}
|
||||
_detachStyles() {
|
||||
if (IS_WEB && this._styles !== null) {
|
||||
for (const style of this._styles) {
|
||||
if (style !== null && style !== void 0 && style.viewsRef) {
|
||||
style.viewsRef.remove(this);
|
||||
}
|
||||
}
|
||||
} else if (this._viewTag !== -1 && this._styles !== null) {
|
||||
var _this$props$animatedP;
|
||||
for (const style of this._styles) {
|
||||
style.viewDescriptors.remove(this._viewTag);
|
||||
}
|
||||
if ((_this$props$animatedP = this.props.animatedProps) !== null && _this$props$animatedP !== void 0 && _this$props$animatedP.viewDescriptors) {
|
||||
this.props.animatedProps.viewDescriptors.remove(this._viewTag);
|
||||
}
|
||||
if (IS_FABRIC) {
|
||||
removeFromPropsRegistry(this._viewTag);
|
||||
}
|
||||
}
|
||||
}
|
||||
_reattachNativeEvents(prevProps) {
|
||||
for (const key in prevProps) {
|
||||
const prop = this.props[key];
|
||||
if (has('current', prop) && prop.current instanceof WorkletEventHandler && prop.current.reattachNeeded) {
|
||||
prop.current.unregisterFromEvents();
|
||||
}
|
||||
}
|
||||
let viewTag = null;
|
||||
for (const key in this.props) {
|
||||
const prop = this.props[key];
|
||||
if (has('current', prop) && prop.current instanceof WorkletEventHandler && prop.current.reattachNeeded) {
|
||||
if (viewTag === null) {
|
||||
const node = this._getEventViewRef();
|
||||
viewTag = findNodeHandle(options !== null && options !== void 0 && options.setNativeProps ? this : node);
|
||||
}
|
||||
prop.current.registerForEvents(viewTag, key);
|
||||
prop.current.reattachNeeded = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
_updateFromNative(props) {
|
||||
if (options !== null && options !== void 0 && options.setNativeProps) {
|
||||
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
||||
options.setNativeProps(this._component, props);
|
||||
} else {
|
||||
var _this$_component2, _this$_component2$set;
|
||||
// eslint-disable-next-line no-unused-expressions
|
||||
(_this$_component2 = this._component) === null || _this$_component2 === void 0 ? void 0 : (_this$_component2$set = _this$_component2.setNativeProps) === null || _this$_component2$set === void 0 ? void 0 : _this$_component2$set.call(_this$_component2, props);
|
||||
}
|
||||
}
|
||||
_getViewInfo() {
|
||||
var _this$_component3, _getAnimatableRef, _ref2;
|
||||
if (this._viewInfo !== undefined) {
|
||||
return this._viewInfo;
|
||||
}
|
||||
let viewTag;
|
||||
let viewName;
|
||||
let shadowNodeWrapper = null;
|
||||
let viewConfig;
|
||||
// Component can specify ref which should be animated when animated version of the component is created.
|
||||
// Otherwise, we animate the component itself.
|
||||
const component = (_this$_component3 = this._component) !== null && _this$_component3 !== void 0 && _this$_component3.getAnimatableRef ? (_getAnimatableRef = (_ref2 = this._component).getAnimatableRef) === null || _getAnimatableRef === void 0 ? void 0 : _getAnimatableRef.call(_ref2) : this;
|
||||
if (IS_WEB) {
|
||||
// At this point I assume that `_setComponentRef` was already called and `_component` is set.
|
||||
// `this._component` on web represents HTMLElement of our component, that's why we use casting
|
||||
viewTag = this._component;
|
||||
viewName = null;
|
||||
shadowNodeWrapper = null;
|
||||
viewConfig = null;
|
||||
} else {
|
||||
var _hostInstance$viewCon;
|
||||
// hostInstance can be null for a component that doesn't render anything (render function returns null). Example: svg Stop: https://github.com/react-native-svg/react-native-svg/blob/develop/src/elements/Stop.tsx
|
||||
const hostInstance = RNRenderer.findHostInstance_DEPRECATED(component);
|
||||
if (!hostInstance) {
|
||||
throw new Error('[Reanimated] Cannot find host instance for this component. Maybe it renders nothing?');
|
||||
}
|
||||
// we can access view tag in the same way it's accessed here https://github.com/facebook/react/blob/e3f4eb7272d4ca0ee49f27577156b57eeb07cf73/packages/react-native-renderer/src/ReactFabric.js#L146
|
||||
viewTag = hostInstance === null || hostInstance === void 0 ? void 0 : hostInstance._nativeTag;
|
||||
/**
|
||||
* RN uses viewConfig for components for storing different properties of the component(example: https://github.com/facebook/react-native/blob/main/packages/react-native/Libraries/Components/ScrollView/ScrollViewNativeComponent.js#L24).
|
||||
* The name we're looking for is in the field named uiViewClassName.
|
||||
*/
|
||||
viewName = hostInstance === null || hostInstance === void 0 ? void 0 : (_hostInstance$viewCon = hostInstance.viewConfig) === null || _hostInstance$viewCon === void 0 ? void 0 : _hostInstance$viewCon.uiViewClassName;
|
||||
viewConfig = hostInstance === null || hostInstance === void 0 ? void 0 : hostInstance.viewConfig;
|
||||
if (IS_FABRIC) {
|
||||
shadowNodeWrapper = getShadowNodeWrapperFromRef(this);
|
||||
}
|
||||
}
|
||||
this._viewInfo = {
|
||||
viewTag,
|
||||
viewName,
|
||||
shadowNodeWrapper,
|
||||
viewConfig
|
||||
};
|
||||
return this._viewInfo;
|
||||
}
|
||||
_attachAnimatedStyles() {
|
||||
var _this$props$animatedP2, _this$props$animatedP3;
|
||||
const styles = this.props.style ? onlyAnimatedStyles(flattenArray(this.props.style)) : [];
|
||||
const prevStyles = this._styles;
|
||||
this._styles = styles;
|
||||
const prevAnimatedProps = this._animatedProps;
|
||||
this._animatedProps = this.props.animatedProps;
|
||||
const {
|
||||
viewTag,
|
||||
viewName,
|
||||
shadowNodeWrapper,
|
||||
viewConfig
|
||||
} = this._getViewInfo();
|
||||
|
||||
// update UI props whitelist for this view
|
||||
const hasReanimated2Props = ((_this$props$animatedP2 = this.props.animatedProps) === null || _this$props$animatedP2 === void 0 ? void 0 : _this$props$animatedP2.viewDescriptors) || styles.length;
|
||||
if (hasReanimated2Props && viewConfig) {
|
||||
adaptViewConfig(viewConfig);
|
||||
}
|
||||
this._viewTag = viewTag;
|
||||
|
||||
// remove old styles
|
||||
if (prevStyles) {
|
||||
// in most of the cases, views have only a single animated style and it remains unchanged
|
||||
const hasOneSameStyle = styles.length === 1 && prevStyles.length === 1 && isSameAnimatedStyle(styles[0], prevStyles[0]);
|
||||
if (!hasOneSameStyle) {
|
||||
// otherwise, remove each style that is not present in new styles
|
||||
for (const prevStyle of prevStyles) {
|
||||
const isPresent = styles.some(style => isSameAnimatedStyle(style, prevStyle));
|
||||
if (!isPresent) {
|
||||
prevStyle.viewDescriptors.remove(viewTag);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
styles.forEach(style => {
|
||||
style.viewDescriptors.add({
|
||||
tag: viewTag,
|
||||
name: viewName,
|
||||
shadowNodeWrapper
|
||||
});
|
||||
if (isJest()) {
|
||||
/**
|
||||
* We need to connect Jest's TestObject instance whose contains just props object
|
||||
* with the updateProps() function where we update the properties of the component.
|
||||
* We can't update props object directly because TestObject contains a copy of props - look at render function:
|
||||
* const props = this._filterNonAnimatedProps(this.props);
|
||||
*/
|
||||
this.animatedStyle.value = {
|
||||
...this.animatedStyle.value,
|
||||
...style.initial.value
|
||||
};
|
||||
style.animatedStyle.current = this.animatedStyle;
|
||||
}
|
||||
});
|
||||
|
||||
// detach old animatedProps
|
||||
if (prevAnimatedProps && !isSameAnimatedProps(prevAnimatedProps, this.props.animatedProps)) {
|
||||
prevAnimatedProps.viewDescriptors.remove(viewTag);
|
||||
}
|
||||
|
||||
// attach animatedProps property
|
||||
if ((_this$props$animatedP3 = this.props.animatedProps) !== null && _this$props$animatedP3 !== void 0 && _this$props$animatedP3.viewDescriptors) {
|
||||
this.props.animatedProps.viewDescriptors.add({
|
||||
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
||||
tag: viewTag,
|
||||
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
||||
name: viewName,
|
||||
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
||||
shadowNodeWrapper: shadowNodeWrapper
|
||||
});
|
||||
}
|
||||
}
|
||||
componentDidUpdate(prevProps, _prevState,
|
||||
// This type comes straight from React
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
snapshot) {
|
||||
this._reattachNativeEvents(prevProps);
|
||||
this._attachAnimatedStyles();
|
||||
this._InlinePropManager.attachInlineProps(this, this._getViewInfo());
|
||||
|
||||
// Snapshot won't be undefined because it comes from getSnapshotBeforeUpdate method
|
||||
if (IS_WEB && snapshot !== null && this.props.layout && !getReducedMotionFromConfig(this.props.layout)) {
|
||||
tryActivateLayoutTransition(this.props, this._component, snapshot);
|
||||
}
|
||||
}
|
||||
// This is a component lifecycle method from React, therefore we are not calling it directly.
|
||||
// It is called before the component gets rerendered. This way we can access components' position before it changed
|
||||
// and later on, in componentDidUpdate, calculate translation for layout transition.
|
||||
getSnapshotBeforeUpdate() {
|
||||
if (this._component.getBoundingClientRect !== undefined) {
|
||||
return this._component.getBoundingClientRect();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
render() {
|
||||
const props = this._PropsFilter.filterNonAnimatedProps(this);
|
||||
if (isJest()) {
|
||||
props.animatedStyle = this.animatedStyle;
|
||||
}
|
||||
|
||||
// Layout animations on web are set inside `componentDidMount` method, which is called after first render.
|
||||
// Because of that we can encounter a situation in which component is visible for a short amount of time, and later on animation triggers.
|
||||
// I've tested that on various browsers and devices and it did not happen to me. To be sure that it won't happen to someone else,
|
||||
// I've decided to hide component at first render. Its visibility is reset in `componentDidMount`.
|
||||
if (this._isFirstRender && IS_WEB && props.entering && !getReducedMotionFromConfig(props.entering)) {
|
||||
props.style = {
|
||||
...(props.style ?? {}),
|
||||
visibility: 'hidden' // Hide component until `componentDidMount` triggers
|
||||
};
|
||||
}
|
||||
|
||||
const platformProps = Platform.select({
|
||||
web: {},
|
||||
default: {
|
||||
collapsable: false
|
||||
}
|
||||
});
|
||||
return /*#__PURE__*/React.createElement(Component, _extends({}, props, {
|
||||
// Casting is used here, because ref can be null - in that case it cannot be assigned to HTMLElement.
|
||||
// After spending some time trying to figure out what to do with this problem, we decided to leave it this way
|
||||
ref: this._setComponentRef
|
||||
}, platformProps));
|
||||
// User can override component-defined jsProps via options
|
||||
const jsProps = options?.jsProps ?? Component.jsProps;
|
||||
const modifiedOptions = jsProps?.length ? {
|
||||
...options,
|
||||
jsProps
|
||||
} : options;
|
||||
super(Component, props, AnimatedComponent.displayName, modifiedOptions);
|
||||
}
|
||||
}
|
||||
_defineProperty(AnimatedComponent, "displayName", void 0);
|
||||
_defineProperty(AnimatedComponent, "contextType", SkipEnteringContext);
|
||||
AnimatedComponent.displayName = `AnimatedComponent(${Component.displayName || Component.name || 'Component'})`;
|
||||
return /*#__PURE__*/React.forwardRef((props, ref) => {
|
||||
return /*#__PURE__*/React.createElement(AnimatedComponent, _extends({}, props, ref === null ? null : {
|
||||
forwardedRef: ref
|
||||
}));
|
||||
});
|
||||
const animatedComponent = props => {
|
||||
return /*#__PURE__*/_jsx(AnimatedComponent, {
|
||||
...props,
|
||||
// Needed to prevent react from signing AnimatedComponent to the ref
|
||||
// (we want to handle the ref assignment in the AnimatedComponent)
|
||||
ref: null,
|
||||
...(props.ref === null ? null : {
|
||||
forwardedRef: props.ref
|
||||
})
|
||||
});
|
||||
};
|
||||
animatedComponent.displayName = Component.displayName || Component.name || 'Component';
|
||||
return animatedComponent;
|
||||
}
|
||||
//# sourceMappingURL=createAnimatedComponent.js.map
|
||||
Generated
Vendored
+1
-1
File diff suppressed because one or more lines are too long
Generated
Vendored
+1
-1
@@ -1 +1 @@
|
||||
{"version":3,"names":["createAnimatedComponent"],"sources":["index.ts"],"sourcesContent":["'use strict';\nexport { createAnimatedComponent } from './createAnimatedComponent';\n"],"mappings":"AAAA,YAAY;;AACZ,SAASA,uBAAuB,QAAQ,2BAA2B"}
|
||||
{"version":3,"names":["createAnimatedComponent"],"sourceRoot":"../../../src","sources":["createAnimatedComponent/index.ts"],"mappings":"AAAA,YAAY;;AACZ,SAASA,uBAAuB,QAAQ,2BAA2B","ignoreList":[]}
|
||||
|
||||
Generated
Vendored
+28
@@ -27,4 +27,32 @@ export const has = (key, x) => {
|
||||
}
|
||||
return false;
|
||||
};
|
||||
export function filterStyles(styles) {
|
||||
if (!styles) {
|
||||
return {
|
||||
animatedStyles: [],
|
||||
cssStyle: null
|
||||
};
|
||||
}
|
||||
return styles.reduce(({
|
||||
animatedStyles,
|
||||
cssStyle
|
||||
}, style) => {
|
||||
if (style?.viewDescriptors) {
|
||||
animatedStyles.push(style);
|
||||
} else {
|
||||
cssStyle = {
|
||||
...cssStyle,
|
||||
...style
|
||||
};
|
||||
}
|
||||
return {
|
||||
animatedStyles,
|
||||
cssStyle
|
||||
};
|
||||
}, {
|
||||
animatedStyles: [],
|
||||
cssStyle: null
|
||||
});
|
||||
}
|
||||
//# sourceMappingURL=utils.js.map
|
||||
Generated
Vendored
+1
-1
@@ -1 +1 @@
|
||||
{"version":3,"names":["flattenArray","array","Array","isArray","resultArr","_flattenArray","arr","forEach","item","push","has","key","x","undefined"],"sources":["utils.ts"],"sourcesContent":["'use strict';\nimport type { NestedArray } from './commonTypes';\n\nexport function flattenArray<T>(array: NestedArray<T>): T[] {\n if (!Array.isArray(array)) {\n return [array];\n }\n const resultArr: T[] = [];\n\n const _flattenArray = (arr: NestedArray<T>[]): void => {\n arr.forEach((item) => {\n if (Array.isArray(item)) {\n _flattenArray(item);\n } else {\n resultArr.push(item);\n }\n });\n };\n _flattenArray(array);\n return resultArr;\n}\n\nexport const has = <K extends string>(\n key: K,\n x: unknown\n): x is typeof x & { [key in K]: unknown } => {\n if (typeof x === 'function' || typeof x === 'object') {\n if (x === null || x === undefined) {\n return false;\n } else {\n return key in x;\n }\n }\n return false;\n};\n"],"mappings":"AAAA,YAAY;;AAGZ,OAAO,SAASA,YAAYA,CAAIC,KAAqB,EAAO;EAC1D,IAAI,CAACC,KAAK,CAACC,OAAO,CAACF,KAAK,CAAC,EAAE;IACzB,OAAO,CAACA,KAAK,CAAC;EAChB;EACA,MAAMG,SAAc,GAAG,EAAE;EAEzB,MAAMC,aAAa,GAAIC,GAAqB,IAAW;IACrDA,GAAG,CAACC,OAAO,CAAEC,IAAI,IAAK;MACpB,IAAIN,KAAK,CAACC,OAAO,CAACK,IAAI,CAAC,EAAE;QACvBH,aAAa,CAACG,IAAI,CAAC;MACrB,CAAC,MAAM;QACLJ,SAAS,CAACK,IAAI,CAACD,IAAI,CAAC;MACtB;IACF,CAAC,CAAC;EACJ,CAAC;EACDH,aAAa,CAACJ,KAAK,CAAC;EACpB,OAAOG,SAAS;AAClB;AAEA,OAAO,MAAMM,GAAG,GAAGA,CACjBC,GAAM,EACNC,CAAU,KACkC;EAC5C,IAAI,OAAOA,CAAC,KAAK,UAAU,IAAI,OAAOA,CAAC,KAAK,QAAQ,EAAE;IACpD,IAAIA,CAAC,KAAK,IAAI,IAAIA,CAAC,KAAKC,SAAS,EAAE;MACjC,OAAO,KAAK;IACd,CAAC,MAAM;MACL,OAAOF,GAAG,IAAIC,CAAC;IACjB;EACF;EACA,OAAO,KAAK;AACd,CAAC"}
|
||||
{"version":3,"names":["flattenArray","array","Array","isArray","resultArr","_flattenArray","arr","forEach","item","push","has","key","x","undefined","filterStyles","styles","animatedStyles","cssStyle","reduce","style","viewDescriptors"],"sourceRoot":"../../../src","sources":["createAnimatedComponent/utils.ts"],"mappings":"AAAA,YAAY;;AAKZ,OAAO,SAASA,YAAYA,CAAIC,KAAqB,EAAO;EAC1D,IAAI,CAACC,KAAK,CAACC,OAAO,CAACF,KAAK,CAAC,EAAE;IACzB,OAAO,CAACA,KAAK,CAAC;EAChB;EACA,MAAMG,SAAc,GAAG,EAAE;EAEzB,MAAMC,aAAa,GAAIC,GAAqB,IAAW;IACrDA,GAAG,CAACC,OAAO,CAAEC,IAAI,IAAK;MACpB,IAAIN,KAAK,CAACC,OAAO,CAACK,IAAI,CAAC,EAAE;QACvBH,aAAa,CAACG,IAAI,CAAC;MACrB,CAAC,MAAM;QACLJ,SAAS,CAACK,IAAI,CAACD,IAAI,CAAC;MACtB;IACF,CAAC,CAAC;EACJ,CAAC;EACDH,aAAa,CAACJ,KAAK,CAAC;EACpB,OAAOG,SAAS;AAClB;AAEA,OAAO,MAAMM,GAAG,GAAGA,CACjBC,GAAM,EACNC,CAAU,KACuB;EACjC,IAAI,OAAOA,CAAC,KAAK,UAAU,IAAI,OAAOA,CAAC,KAAK,QAAQ,EAAE;IACpD,IAAIA,CAAC,KAAK,IAAI,IAAIA,CAAC,KAAKC,SAAS,EAAE;MACjC,OAAO,KAAK;IACd,CAAC,MAAM;MACL,OAAOF,GAAG,IAAIC,CAAC;IACjB;EACF;EACA,OAAO,KAAK;AACd,CAAC;AAOD,OAAO,SAASE,YAAYA,CAACC,MAAgC,EAAkB;EAC7E,IAAI,CAACA,MAAM,EAAE;IACX,OAAO;MAAEC,cAAc,EAAE,EAAE;MAAEC,QAAQ,EAAE;IAAK,CAAC;EAC/C;EAEA,OAAOF,MAAM,CAACG,MAAM,CAClB,CAAC;IAAEF,cAAc;IAAEC;EAAS,CAAC,EAAEE,KAAK,KAAK;IACvC,IAAIA,KAAK,EAAEC,eAAe,EAAE;MAC1BJ,cAAc,CAACP,IAAI,CAACU,KAAK,CAAC;IAC5B,CAAC,MAAM;MACLF,QAAQ,GAAG;QAAE,GAAGA,QAAQ;QAAE,GAAGE;MAAM,CAAa;IAClD;IACA,OAAO;MAAEH,cAAc;MAAEC;IAAS,CAAC;EACrC,CAAC,EACD;IAAED,cAAc,EAAE,EAAE;IAAEC,QAAQ,EAAE;EAAK,CACvC,CAAC;AACH","ignoreList":[]}
|
||||
|
||||
+59
-1
@@ -1,6 +1,64 @@
|
||||
'use strict';
|
||||
|
||||
import './publicGlobals';
|
||||
import { initializeReanimatedModule } from './initializers';
|
||||
import { ReanimatedModule } from './ReanimatedModule';
|
||||
|
||||
// TODO: Specify the initialization pipeline since now there's no
|
||||
// universal source of truth for it.
|
||||
initializeReanimatedModule(ReanimatedModule);
|
||||
|
||||
// eslint-disable-next-line import/first
|
||||
import * as Animated from './Animated';
|
||||
export * from './reanimated2';
|
||||
export default Animated;
|
||||
export { createAnimatedComponent } from './Animated';
|
||||
export { cancelAnimation, defineAnimation, GentleSpringConfig, GentleSpringConfigWithDuration, Reanimated3DefaultSpringConfig, Reanimated3DefaultSpringConfigWithDuration, SnappySpringConfig, SnappySpringConfigWithDuration, WigglySpringConfig, WigglySpringConfigWithDuration, withClamp, withDecay, withDelay, withRepeat, withSequence, withSpring, withTiming } from './animation';
|
||||
export { convertToRGBA, isColor } from './Colors';
|
||||
export { processColor, ReanimatedLogLevel } from './common';
|
||||
export { InterfaceOrientation, IOSReferenceFrame, KeyboardState, ReduceMotion, SensorType } from './commonTypes';
|
||||
export { LayoutAnimationConfig } from './component/LayoutAnimationConfig';
|
||||
export { PerformanceMonitor } from './component/PerformanceMonitor';
|
||||
export { ReducedMotionConfig } from './component/ReducedMotionConfig';
|
||||
export { configureReanimatedLogger } from './ConfigHelper';
|
||||
export { enableLayoutAnimations, getViewProp, isConfigured, isReanimated3, makeMutable } from './core';
|
||||
export * from './css';
|
||||
export { Easing } from './Easing';
|
||||
export { getStaticFeatureFlag, setDynamicFeatureFlag } from './featureFlags';
|
||||
export { useAnimatedKeyboard, useAnimatedProps, useAnimatedReaction, useAnimatedRef, useAnimatedScrollHandler, useAnimatedSensor, useAnimatedStyle, useComposedEventHandler, useDerivedValue, useEvent, useFrameCallback, useHandler, useReducedMotion, useScrollOffset, /** @deprecated Please use {@link useScrollOffset} instead. */
|
||||
useScrollOffset as useScrollViewOffset, useSharedValue } from './hook';
|
||||
export { ColorSpace, /** @deprecated Please use {@link Extrapolation} instead. */
|
||||
Extrapolate, interpolateColor, useInterpolateConfig } from './interpolateColor';
|
||||
export { clamp, Extrapolation, interpolate } from './interpolation';
|
||||
export { isSharedValue } from './isSharedValue';
|
||||
export { advanceAnimationByFrame, advanceAnimationByTime, getAnimatedStyle, setUpTests, withReanimatedTimer } from './jestUtils';
|
||||
export { BaseAnimationBuilder,
|
||||
// Bounce
|
||||
BounceIn, BounceInDown, BounceInLeft, BounceInRight, BounceInUp, BounceOut, BounceOutDown, BounceOutLeft, BounceOutRight, BounceOutUp, ComplexAnimationBuilder, CurvedTransition, EntryExitTransition,
|
||||
// Fade
|
||||
FadeIn, FadeInDown, FadeInLeft, FadeInRight, FadeInUp, FadeOut, FadeOutDown, FadeOutLeft, FadeOutRight, FadeOutUp, FadingTransition, FlipInEasyX, FlipInEasyY, FlipInXDown,
|
||||
// Flip
|
||||
FlipInXUp, FlipInYLeft, FlipInYRight, FlipOutEasyX, FlipOutEasyY, FlipOutXDown, FlipOutXUp, FlipOutYLeft, FlipOutYRight, JumpingTransition, Keyframe,
|
||||
// Transitions
|
||||
Layout, LightSpeedInLeft,
|
||||
// Lightspeed
|
||||
LightSpeedInRight, LightSpeedOutLeft, LightSpeedOutRight, LinearTransition,
|
||||
// Pinwheel
|
||||
PinwheelIn, PinwheelOut,
|
||||
// Roll
|
||||
RollInLeft, RollInRight, RollOutLeft, RollOutRight,
|
||||
// Rotate
|
||||
RotateInDownLeft, RotateInDownRight, RotateInUpLeft, RotateInUpRight, RotateOutDownLeft, RotateOutDownRight, RotateOutUpLeft, RotateOutUpRight, SequencedTransition, SlideInDown, SlideInLeft,
|
||||
// Slide
|
||||
SlideInRight, SlideInUp, SlideOutDown, SlideOutLeft, SlideOutRight, SlideOutUp,
|
||||
// Stretch
|
||||
StretchInX, StretchInY, StretchOutX, StretchOutY,
|
||||
// Zoom
|
||||
ZoomIn, ZoomInDown, ZoomInEasyDown, ZoomInEasyUp, ZoomInLeft, ZoomInRight, ZoomInRotate, ZoomInUp, ZoomOut, ZoomOutDown, ZoomOutEasyDown, ZoomOutEasyUp, ZoomOutLeft, ZoomOutRight, ZoomOutRotate, ZoomOutUp } from './layoutReanimation';
|
||||
export { startMapper, stopMapper } from './mappers';
|
||||
export { jsVersion as reanimatedVersion } from './platform-specific/jsVersion';
|
||||
export { dispatchCommand, getRelativeCoords, measure, scrollTo, setGestureState, setNativeProps } from './platformFunctions';
|
||||
export { getUseOfValueInStyleWarning } from './pluginUtils';
|
||||
export { createAnimatedPropAdapter } from './PropAdapters';
|
||||
export { finishScreenTransition, ScreenTransition, startScreenTransition } from './screenTransition';
|
||||
export { createWorkletRuntime, executeOnUIRuntimeSync, isWorkletFunction, makeShareableCloneRecursive, runOnJS, runOnRuntime, runOnUI } from './workletFunctions';
|
||||
//# sourceMappingURL=index.js.map
|
||||
+1
-1
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user