Skip to content

Commit 5f2a96b

Browse files
committed
Some fixes after rebase
1 parent c65a65a commit 5f2a96b

4 files changed

Lines changed: 21 additions & 21 deletions

File tree

apps/common-app/src/apps/css/examples/animations/screens/animatedProperties/svg/Polyline.tsx

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@ export default function PolylineExample() {
1616
PolylineProps
1717
>
1818
buildAnimation={({ keyframes }) => ({
19-
animationName: keyframes,
2019
animationDirection: 'alternate',
2120
animationDuration: '1s',
2221
animationIterationCount: 'infinite',
22+
animationName: keyframes,
2323
animationTimingFunction: 'ease-in-out',
2424
})}
2525
renderExample={({ animation }) => (
@@ -40,9 +40,10 @@ export default function PolylineExample() {
4040
name: 'Points',
4141
sections: [
4242
{
43-
title: 'Same Number of Points',
4443
examples: [
4544
{
45+
description:
46+
'Smooth interpolation between two zigzag shapes with the same number of points',
4647
keyframes: {
4748
from: {
4849
points: '10,80 30,20 50,80 70,20 90,80',
@@ -52,10 +53,10 @@ export default function PolylineExample() {
5253
},
5354
},
5455
title: 'Zigzag',
55-
description:
56-
'Smooth interpolation between two zigzag shapes with the same number of points',
5756
},
5857
{
58+
description:
59+
'Smooth animation between two wave phases with the same number of points',
5960
keyframes: {
6061
from: {
6162
points: '10,50 27,20 44,50 61,80 78,50 95,20',
@@ -65,10 +66,10 @@ export default function PolylineExample() {
6566
},
6667
},
6768
title: 'Wave',
68-
description:
69-
'Smooth animation between two wave phases with the same number of points',
7069
},
7170
{
71+
description:
72+
'Points morph from one corner configuration to another',
7273
keyframes: {
7374
from: {
7475
points: '10,90 10,10 90,10',
@@ -78,10 +79,10 @@ export default function PolylineExample() {
7879
},
7980
},
8081
title: 'Corner sweep',
81-
description:
82-
'Points morph from one corner configuration to another',
8382
},
8483
{
84+
description:
85+
'Smooth animation of an S-curve between two mirror states',
8586
keyframes: {
8687
from: {
8788
points: '10,50 30,10 50,50 70,90 90,50',
@@ -91,15 +92,15 @@ export default function PolylineExample() {
9192
},
9293
},
9394
title: 'S-curve',
94-
description:
95-
'Smooth animation of an S-curve between two mirror states',
9695
},
9796
],
97+
title: 'Same Number of Points',
9898
},
9999
{
100-
title: 'Different Number of Points',
101100
examples: [
102101
{
102+
description:
103+
'Interpolation between different numbers of points is **not supported**, so the points change **abruptly**',
103104
keyframes: {
104105
from: {
105106
points: '10,80 50,20 90,80',
@@ -109,10 +110,10 @@ export default function PolylineExample() {
109110
},
110111
},
111112
title: 'Growing polyline',
112-
description:
113-
'Interpolation between different numbers of points is **not supported**, so the points change **abruptly**',
114113
},
115114
{
115+
description:
116+
'Reducing the number of points also causes an **abrupt** change instead of a smooth transition',
116117
keyframes: {
117118
from: {
118119
points: '10,50 25,20 40,80 55,20 70,80 85,20 90,50',
@@ -122,18 +123,16 @@ export default function PolylineExample() {
122123
},
123124
},
124125
title: 'Shrinking polyline',
125-
description:
126-
'Reducing the number of points also causes an **abrupt** change instead of a smooth transition',
127126
},
128127
],
128+
title: 'Different Number of Points',
129129
},
130130
],
131131
},
132132
{
133133
name: 'Appearance',
134134
sections: [
135135
{
136-
title: 'Opacity',
137136
examples: [
138137
{
139138
keyframes: {
@@ -144,6 +143,7 @@ export default function PolylineExample() {
144143
title: 'Opacity',
145144
},
146145
],
146+
title: 'Opacity',
147147
},
148148
],
149149
},

packages/react-native-reanimated/src/css/svg/native/configs/polyline.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@ import type { PolylineProps } from 'react-native-svg';
66

77
import { processPolylinePoints } from '../processors';
88
import type { SvgStyleBuilderConfig } from './common';
9-
import { commonSvgProps } from './common';
9+
import { SVG_COMMON_PROPERTIES_CONFIG } from './common';
1010

1111
// TODO: Fix me
1212
// @ts-ignore RNSVG doesn't export types for web, see https://github.com/software-mansion/react-native-svg/pull/2801
1313
export const SVG_POLYLINE_PROPERTIES_CONFIG: SvgStyleBuilderConfig<PolylineProps> =
1414
{
15-
...commonSvgProps,
15+
...SVG_COMMON_PROPERTIES_CONFIG,
1616
points: { process: processPolylinePoints },
1717
};

packages/react-native-reanimated/src/css/svg/native/processors/path.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,12 @@ export const ERROR_MESSAGES = {
2020

2121
type PathCommand = [string, ...number[]];
2222

23-
export const processSVGPath: ValueProcessor<string, string> = (d) => {
23+
export const processSVGPath = ((d) => {
2424
let pathSegments: PathCommand[] = parsePathString(d);
2525
pathSegments = normalizePath(pathSegments);
2626

2727
return pathSegments.flatMap((subArr) => subArr).join(' ');
28-
};
28+
}) satisfies ValueProcessor<string, string>;
2929

3030
function processPathSegment(
3131
command: string,

packages/react-native-reanimated/src/css/svg/native/processors/polypoints.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,6 @@ export const processPolylinePoints: ValueProcessor<
1515
.replace(/([^eE])-/g, '$1 -')
1616
.split(/(?:\s+|\s*,\s*)/g)
1717
.join(' ')}`
18-
) as string,
18+
),
1919
};
2020
};

0 commit comments

Comments
 (0)