@artsy/palette-mobile 22.1.0--canary.424.5073.0 → 22.1.0--canary.425.5083.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -3,7 +3,8 @@ import FastImage from "@d11/react-native-fast-image";
3
3
  import { memo, useState } from "react";
4
4
  // @ts-expect-error
5
5
  import { Blurhash } from "react-native-blurhash";
6
- import Animated, { runOnJS, useAnimatedStyle, useSharedValue, withSpring, } from "react-native-reanimated";
6
+ import Animated, { useAnimatedStyle, useSharedValue, withSpring } from "react-native-reanimated";
7
+ import { scheduleOnRN } from "react-native-worklets";
7
8
  import { getImageURL } from "./helpers/getImageURL";
8
9
  import { DEFAULT_ANIMATION_DURATION } from "../../constants";
9
10
  import { useColor } from "../../utils/hooks";
@@ -17,7 +18,7 @@ export const Image = memo(({ aspectRatio, width, height, performResize = true, s
17
18
  const color = useColor();
18
19
  const onLoadEnd = () => {
19
20
  opacity.value = withSpring(0, { duration: DEFAULT_ANIMATION_DURATION }, () => {
20
- runOnJS(setIsLoading)(false);
21
+ scheduleOnRN(setIsLoading, false);
21
22
  });
22
23
  };
23
24
  const skeletonStyle = useAnimatedStyle(() => {
@@ -13,6 +13,7 @@ export interface HeaderProps {
13
13
  title?: string | JSX.Element;
14
14
  titleProps?: FlexProps;
15
15
  titleShown?: boolean;
16
+ zIndex?: number;
16
17
  }
17
18
  export declare const AnimatedHeader: React.FC<HeaderProps>;
18
19
  export declare const Header: React.FC<HeaderProps>;
@@ -11,13 +11,13 @@ import { Touchable } from "../Touchable";
11
11
  export const AnimatedHeader = (props) => {
12
12
  return _jsx(Header, { animated: true, ...props });
13
13
  };
14
- export const Header = ({ animated = false, hideLeftElements, hideRightElements, hideTitle, leftElements, onBack, rightElements, title, titleProps = {}, }) => {
14
+ export const Header = ({ animated = false, hideLeftElements, hideRightElements, hideTitle, leftElements, onBack, rightElements, title, titleProps = {}, zIndex = ZINDEX.header, }) => {
15
15
  const { width } = useScreenDimensions();
16
16
  const space = useSpace();
17
17
  // Assumes small left and right elements, it protects from overflowing
18
18
  // but doesn't cover edge cases where right or left are bigger
19
19
  const centerMaxWidth = width - space(4) - DEFAULT_ICON_SIZE * 2;
20
- return (_jsxs(Flex, { height: NAVBAR_HEIGHT, flexDirection: "row", px: 2, zIndex: ZINDEX.header, backgroundColor: "background", alignItems: "center", children: [_jsx(Flex, { flex: 1, children: _jsx(Left, { leftElements: leftElements, onBack: onBack, hideLeftElements: hideLeftElements }) }), _jsx(Flex, { maxWidth: centerMaxWidth, ...titleProps, children: _jsx(Center, { animated: animated, title: title, hideTitle: hideTitle }) }), _jsx(Flex, { flex: 1, alignItems: "flex-end", children: _jsx(Right, { rightElements: rightElements, hideRightElements: hideRightElements }) })] }));
20
+ return (_jsxs(Flex, { height: NAVBAR_HEIGHT, flexDirection: "row", px: 2, zIndex: zIndex, backgroundColor: "background", alignItems: "center", children: [_jsx(Flex, { flex: 1, children: _jsx(Left, { leftElements: leftElements, onBack: onBack, hideLeftElements: hideLeftElements }) }), _jsx(Flex, { maxWidth: centerMaxWidth, ...titleProps, children: _jsx(Center, { animated: animated, title: title, hideTitle: hideTitle }) }), _jsx(Flex, { flex: 1, alignItems: "flex-end", children: _jsx(Right, { rightElements: rightElements, hideRightElements: hideRightElements }) })] }));
21
21
  };
22
22
  const Right = ({ hideRightElements, rightElements }) => {
23
23
  return _jsx(_Fragment, { children: !hideRightElements && rightElements });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@artsy/palette-mobile",
3
- "version": "22.1.0--canary.424.5073.0",
3
+ "version": "22.1.0--canary.425.5083.0",
4
4
  "description": "Artsy's design system for React Native",
5
5
  "workspaces": [
6
6
  "Example"
@@ -124,9 +124,10 @@
124
124
  "react-native": "0.81.5",
125
125
  "react-native-haptic-feedback": "1.14.0",
126
126
  "react-native-linear-gradient": "2.6.2",
127
- "react-native-reanimated": "3.19.4",
127
+ "react-native-reanimated": "4.1.5",
128
128
  "react-native-safe-area-context": "5.6.0",
129
129
  "react-native-svg": "15.12.1",
130
+ "react-native-worklets": "0.6.1",
130
131
  "react-test-renderer": "19.1.0",
131
132
  "rimraf": "4.1.2",
132
133
  "styled-components": "6.1.19",