Skip to content

Commit d700021

Browse files
authored
chore: Relocate style processors to the common dir (#8391)
## Summary This PR relocates style prop value preprocessors from the `css` dir to the `common` dir. It also moves all dependent code, like some utils and types.
1 parent 953b379 commit d700021

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

74 files changed

+368
-354
lines changed

apps/common-app/src/apps/css/examples/animations/screens/animatedProperties/base/appearance/colors/ColorProperties.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import type { JSX } from 'react';
12
import type {
23
ImageProps,
34
ImageStyle,
@@ -22,7 +23,6 @@ import {
2223
} from '@/apps/css/components';
2324
import { stringifyConfig } from '@/apps/css/utils';
2425
import { colors, radius, sizes, spacing } from '@/theme';
25-
import type { JSX } from 'react';
2626

2727
const sharedConfig: CSSAnimationSettings = {
2828
animationDirection: 'alternate',

packages/react-native-reanimated/src/Colors.ts

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -354,16 +354,6 @@ export const ColorProperties = [
354354
'stroke',
355355
];
356356

357-
/* copied from:
358-
* https://github.com/facebook/react-native/blob/v0.81.0/packages/react-native/Libraries/StyleSheet/PlatformColorValueTypesIOS.d.ts
359-
*/
360-
export const DynamicColorIOSProperties = [
361-
'light',
362-
'dark',
363-
'highContrastLight',
364-
'highContrastDark',
365-
] as const;
366-
367357
export function normalizeColor(color: unknown): number | null | undefined {
368358
'worklet';
369359

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
'use strict';
2+
export * from './font';
3+
export * from './platform';

packages/react-native-reanimated/src/common/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@
22
export * from './constants';
33
export * from './errors';
44
export * from './logger';
5-
export * from './processors';
5+
export * from './style';
66
export type * from './types';
77
export * from './utils';

packages/react-native-reanimated/src/common/processors/index.ts

Lines changed: 0 additions & 9 deletions
This file was deleted.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
'use strict';
2-
import type { PlainStyle } from '../../../../common';
2+
import type { PlainStyle } from '../../types';
33
import createStyleBuilder from '../createStyleBuilder';
44
// TODO - add more tests
55

packages/react-native-reanimated/src/css/native/style/config.ts renamed to packages/react-native-reanimated/src/common/style/config.ts

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,11 @@
11
'use strict';
2-
import type { PlainStyle } from '../../../common';
2+
import { IS_ANDROID } from '../constants';
3+
import type { PlainStyle } from '../types';
4+
import { processTransformOrigin } from '../web';
35
import {
4-
IS_ANDROID,
6+
processAspectRatio,
57
processBoxShadowNative,
68
processColor,
7-
processTransformOrigin,
8-
} from '../../../common';
9-
import {
10-
processAspectRatio,
119
processFontWeight,
1210
processGap,
1311
processInset,

packages/react-native-reanimated/src/css/native/style/createStyleBuilder.ts renamed to packages/react-native-reanimated/src/common/style/createStyleBuilder.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
'use strict';
22

3-
import type { AnyRecord } from '../../../common';
4-
import { isConfigPropertyAlias, isDefined, isRecord } from '../../utils';
3+
import type { AnyRecord } from '../types';
4+
import { isConfigPropertyAlias, isDefined, isRecord } from '../utils';
55
import type {
66
StyleBuilder,
77
StyleBuilderConfig,

0 commit comments

Comments
 (0)