From a84adb53743f7117a971349845a55445f1b57692 Mon Sep 17 00:00:00 2001 From: Carlos Nogueira Date: Fri, 12 Sep 2025 14:16:21 +0100 Subject: [PATCH 01/35] Add constants' values definining SVG's elements and properties to target --- .../libraries/react-native-svg/constants.ts | 293 ++++++++++++++++++ yarn.lock | 130 +++++++- 2 files changed, 421 insertions(+), 2 deletions(-) create mode 100644 packages/react-native-babel-plugin/src/libraries/react-native-svg/constants.ts diff --git a/packages/react-native-babel-plugin/src/libraries/react-native-svg/constants.ts b/packages/react-native-babel-plugin/src/libraries/react-native-svg/constants.ts new file mode 100644 index 000000000..f9524c9d6 --- /dev/null +++ b/packages/react-native-babel-plugin/src/libraries/react-native-svg/constants.ts @@ -0,0 +1,293 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache License Version 2.0. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2016-Present Datadog, Inc. + */ + +export const rnAttributeNames = [ + '__self', + 'accessibilityLabel', + 'accessibilityRole', + 'style' +]; + +export const rnSvgArrayAttributeValues = [ + 'stroke-dasharray', // this attribute is already in the web compliant format, sice the RN to web conversion already occured when this is used + 'points', + 'gradientTransform', + 'stdDeviation', + 'values' +]; + +// All these values are deprecated, but still allowed in react-native-svg +// translate, scale, rotate ? +export const rnSvgTransformAttributeValues = [ + 'translateX', + 'translateY', + 'scaleX', + 'scaleY', + 'rotate', + 'skewX', + 'skewY', + 'matrix' +]; + +export const svgSupportedNames = ['Svg', 'SvgUri']; + +export const xmlNamespace = ['xmlns', 'http://www.w3.org/2000/svg']; + +export const svgElements = [ + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '