diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000000000000000000000000000000000000..d61a345839e67ac5691b0cde138b49cea81772e0 --- /dev/null +++ b/.gitignore @@ -0,0 +1,8 @@ +node_modules +*.tgz +.vscode +/**/.vscode +bundle.harmony.js +*.code-workspace +tester/package-lock.json +tester/harmony/react_native_openharmony.har diff --git a/react-native-harmony-svg/.gitignore b/react-native-harmony-svg/.gitignore new file mode 100644 index 0000000000000000000000000000000000000000..427935cd02f7409d30ddde510a05a0ac52ab1c40 --- /dev/null +++ b/react-native-harmony-svg/.gitignore @@ -0,0 +1,3 @@ +lib +*.tar.gz +harmony/svg \ No newline at end of file diff --git a/react-native-harmony-svg/.npmrc b/react-native-harmony-svg/.npmrc new file mode 100644 index 0000000000000000000000000000000000000000..d69bbd79812b022f8baaa223039bf8cb6671d895 --- /dev/null +++ b/react-native-harmony-svg/.npmrc @@ -0,0 +1,2 @@ +@rnoh:registry=https://gl.swmansion.com/api/v4/projects/458/packages/npm/ +//gl.swmansion.com/api/v4/projects/458/packages/npm/:_authToken="${RNOH_NPM_TOKEN}" diff --git a/react-native-harmony-svg/.prettierrc.js b/react-native-harmony-svg/.prettierrc.js new file mode 100644 index 0000000000000000000000000000000000000000..15096d6c89c49a7782a99d49555a7022fd94194c --- /dev/null +++ b/react-native-harmony-svg/.prettierrc.js @@ -0,0 +1,8 @@ +module.exports = { + arrowParens: 'avoid', + jsxBracketSameLine: true, + bracketSameLine: true, + bracketSpacing: false, + singleQuote: true, + trailingComma: 'all', +} diff --git a/react-native-harmony-svg/css/package.json b/react-native-harmony-svg/css/package.json new file mode 100644 index 0000000000000000000000000000000000000000..f801298a17ce77ef42885c40d680db97c59cae62 --- /dev/null +++ b/react-native-harmony-svg/css/package.json @@ -0,0 +1,6 @@ +{ + "main": "../lib/commonjs/css/index", + "module": "../lib/module/css/index", + "react-native": "../src/css/index", + "types": "../lib/typescript/css/index" + } \ No newline at end of file diff --git a/react-native-harmony-svg/harmony/svg.har b/react-native-harmony-svg/harmony/svg.har new file mode 100644 index 0000000000000000000000000000000000000000..5fe0e42fbd00adb115f8e58055023d90f263b6ad Binary files /dev/null and b/react-native-harmony-svg/harmony/svg.har differ diff --git a/react-native-harmony-svg/package-lock.json b/react-native-harmony-svg/package-lock.json new file mode 100644 index 0000000000000000000000000000000000000000..b1d425271532499343690b79afd4e5ac010739bc --- /dev/null +++ b/react-native-harmony-svg/package-lock.json @@ -0,0 +1,7965 @@ +{ + "name": "@react-native-oh-tpl/react-native-svg", + "version": "15.0.0-0.5.7", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "@react-native-oh-tpl/react-native-svg", + "version": "15.0.0-0.5.7", + "license": "ISC", + "devDependencies": { + "@tsconfig/react-native": "^3.0.0", + "@types/jest": "^29.5.1", + "@types/react": "^18.2.0", + "@types/react-native": "^0.71.6", + "react-native-builder-bob": "^0.20.4", + "typescript": "^5.0.4" + }, + "peerDependencies": { + "react": "*", + "react-native": "*", + "react-native-svg": "15.0.0" + } + }, + "node_modules/@ampproject/remapping": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/@ampproject/remapping/-/remapping-2.2.1.tgz", + "integrity": "sha512-lFMjJTrFL3j7L9yBxwYfCq2k6qqwHyzuUl/XBnif78PWTJYyL/dfowQHWE3sp6U6ZzqWiiIZnpTMO96zhkjwtg==", + "dependencies": { + "@jridgewell/gen-mapping": "^0.3.0", + "@jridgewell/trace-mapping": "^0.3.9" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@babel/code-frame": { + "version": "7.21.4", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.21.4.tgz", + "integrity": "sha512-LYvhNKfwWSPpocw8GI7gpK2nq3HSDuEPC/uSYaALSJu9xjsalaaYFOq0Pwt5KmVqwEbZlDu81aLXwBOmD/Fv9g==", + "dependencies": { + "@babel/highlight": "^7.18.6" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/compat-data": { + "version": "7.21.7", + "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.21.7.tgz", + "integrity": "sha512-KYMqFYTaenzMK4yUtf4EW9wc4N9ef80FsbMtkwool5zpwl4YrT1SdWYSTRcT94KO4hannogdS+LxY7L+arP3gA==", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/core": { + "version": "7.21.8", + "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.21.8.tgz", + "integrity": "sha512-YeM22Sondbo523Sz0+CirSPnbj9bG3P0CdHcBZdqUuaeOaYEFbOLoGU7lebvGP6P5J/WE9wOn7u7C4J9HvS1xQ==", + "dependencies": { + "@ampproject/remapping": "^2.2.0", + "@babel/code-frame": "^7.21.4", + "@babel/generator": "^7.21.5", + "@babel/helper-compilation-targets": "^7.21.5", + "@babel/helper-module-transforms": "^7.21.5", + "@babel/helpers": "^7.21.5", + "@babel/parser": "^7.21.8", + "@babel/template": "^7.20.7", + "@babel/traverse": "^7.21.5", + "@babel/types": "^7.21.5", + "convert-source-map": "^1.7.0", + "debug": "^4.1.0", + "gensync": "^1.0.0-beta.2", + "json5": "^2.2.2", + "semver": "^6.3.0" + }, + "engines": { + "node": ">=6.9.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/babel" + } + }, + "node_modules/@babel/core/node_modules/debug": { + "version": "4.3.4", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", + "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", + "dependencies": { + "ms": "2.1.2" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/@babel/core/node_modules/ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" + }, + "node_modules/@babel/generator": { + "version": "7.21.5", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.21.5.tgz", + "integrity": "sha512-SrKK/sRv8GesIW1bDagf9cCG38IOMYZusoe1dfg0D8aiUe3Amvoj1QtjTPAWcfrZFvIwlleLb0gxzQidL9w14w==", + "dependencies": { + "@babel/types": "^7.21.5", + "@jridgewell/gen-mapping": "^0.3.2", + "@jridgewell/trace-mapping": "^0.3.17", + "jsesc": "^2.5.1" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-annotate-as-pure": { + "version": "7.18.6", + "resolved": "https://registry.npmjs.org/@babel/helper-annotate-as-pure/-/helper-annotate-as-pure-7.18.6.tgz", + "integrity": "sha512-duORpUiYrEpzKIop6iNbjnwKLAKnJ47csTyRACyEmWj0QdUrm5aqNJGHSSEQSUAvNW0ojX0dOmK9dZduvkfeXA==", + "dependencies": { + "@babel/types": "^7.18.6" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-builder-binary-assignment-operator-visitor": { + "version": "7.21.5", + "resolved": "https://registry.npmjs.org/@babel/helper-builder-binary-assignment-operator-visitor/-/helper-builder-binary-assignment-operator-visitor-7.21.5.tgz", + "integrity": "sha512-uNrjKztPLkUk7bpCNC0jEKDJzzkvel/W+HguzbN8krA+LPfC1CEobJEvAvGka2A/M+ViOqXdcRL0GqPUJSjx9g==", + "dependencies": { + "@babel/types": "^7.21.5" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-compilation-targets": { + "version": "7.21.5", + "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.21.5.tgz", + "integrity": "sha512-1RkbFGUKex4lvsB9yhIfWltJM5cZKUftB2eNajaDv3dCMEp49iBG0K14uH8NnX9IPux2+mK7JGEOB0jn48/J6w==", + "dependencies": { + "@babel/compat-data": "^7.21.5", + "@babel/helper-validator-option": "^7.21.0", + "browserslist": "^4.21.3", + "lru-cache": "^5.1.1", + "semver": "^6.3.0" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0" + } + }, + "node_modules/@babel/helper-create-class-features-plugin": { + "version": "7.21.8", + "resolved": "https://registry.npmjs.org/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.21.8.tgz", + "integrity": "sha512-+THiN8MqiH2AczyuZrnrKL6cAxFRRQDKW9h1YkBvbgKmAm6mwiacig1qT73DHIWMGo40GRnsEfN3LA+E6NtmSw==", + "dependencies": { + "@babel/helper-annotate-as-pure": "^7.18.6", + "@babel/helper-environment-visitor": "^7.21.5", + "@babel/helper-function-name": "^7.21.0", + "@babel/helper-member-expression-to-functions": "^7.21.5", + "@babel/helper-optimise-call-expression": "^7.18.6", + "@babel/helper-replace-supers": "^7.21.5", + "@babel/helper-skip-transparent-expression-wrappers": "^7.20.0", + "@babel/helper-split-export-declaration": "^7.18.6", + "semver": "^6.3.0" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0" + } + }, + "node_modules/@babel/helper-create-regexp-features-plugin": { + "version": "7.21.8", + "resolved": "https://registry.npmjs.org/@babel/helper-create-regexp-features-plugin/-/helper-create-regexp-features-plugin-7.21.8.tgz", + "integrity": "sha512-zGuSdedkFtsFHGbexAvNuipg1hbtitDLo2XE8/uf6Y9sOQV1xsYX/2pNbtedp/X0eU1pIt+kGvaqHCowkRbS5g==", + "dependencies": { + "@babel/helper-annotate-as-pure": "^7.18.6", + "regexpu-core": "^5.3.1", + "semver": "^6.3.0" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0" + } + }, + "node_modules/@babel/helper-define-polyfill-provider": { + "version": "0.3.3", + "resolved": "https://registry.npmjs.org/@babel/helper-define-polyfill-provider/-/helper-define-polyfill-provider-0.3.3.tgz", + "integrity": "sha512-z5aQKU4IzbqCC1XH0nAqfsFLMVSo22SBKUc0BxGrLkolTdPTructy0ToNnlO2zA4j9Q/7pjMZf0DSY+DSTYzww==", + "dependencies": { + "@babel/helper-compilation-targets": "^7.17.7", + "@babel/helper-plugin-utils": "^7.16.7", + "debug": "^4.1.1", + "lodash.debounce": "^4.0.8", + "resolve": "^1.14.2", + "semver": "^6.1.2" + }, + "peerDependencies": { + "@babel/core": "^7.4.0-0" + } + }, + "node_modules/@babel/helper-define-polyfill-provider/node_modules/debug": { + "version": "4.3.4", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", + "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", + "dependencies": { + "ms": "2.1.2" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/@babel/helper-define-polyfill-provider/node_modules/ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" + }, + "node_modules/@babel/helper-environment-visitor": { + "version": "7.21.5", + "resolved": "https://registry.npmjs.org/@babel/helper-environment-visitor/-/helper-environment-visitor-7.21.5.tgz", + "integrity": "sha512-IYl4gZ3ETsWocUWgsFZLM5i1BYx9SoemminVEXadgLBa9TdeorzgLKm8wWLA6J1N/kT3Kch8XIk1laNzYoHKvQ==", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-function-name": { + "version": "7.21.0", + "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.21.0.tgz", + "integrity": "sha512-HfK1aMRanKHpxemaY2gqBmL04iAPOPRj7DxtNbiDOrJK+gdwkiNRVpCpUJYbUT+aZyemKN8brqTOxzCaG6ExRg==", + "dependencies": { + "@babel/template": "^7.20.7", + "@babel/types": "^7.21.0" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-hoist-variables": { + "version": "7.18.6", + "resolved": "https://registry.npmjs.org/@babel/helper-hoist-variables/-/helper-hoist-variables-7.18.6.tgz", + "integrity": "sha512-UlJQPkFqFULIcyW5sbzgbkxn2FKRgwWiRexcuaR8RNJRy8+LLveqPjwZV/bwrLZCN0eUHD/x8D0heK1ozuoo6Q==", + "dependencies": { + "@babel/types": "^7.18.6" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-member-expression-to-functions": { + "version": "7.21.5", + "resolved": "https://registry.npmjs.org/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.21.5.tgz", + "integrity": "sha512-nIcGfgwpH2u4n9GG1HpStW5Ogx7x7ekiFHbjjFRKXbn5zUvqO9ZgotCO4x1aNbKn/x/xOUaXEhyNHCwtFCpxWg==", + "dependencies": { + "@babel/types": "^7.21.5" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-module-imports": { + "version": "7.21.4", + "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.21.4.tgz", + "integrity": "sha512-orajc5T2PsRYUN3ZryCEFeMDYwyw09c/pZeaQEZPH0MpKzSvn3e0uXsDBu3k03VI+9DBiRo+l22BfKTpKwa/Wg==", + "dependencies": { + "@babel/types": "^7.21.4" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-module-transforms": { + "version": "7.21.5", + "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.21.5.tgz", + "integrity": "sha512-bI2Z9zBGY2q5yMHoBvJ2a9iX3ZOAzJPm7Q8Yz6YeoUjU/Cvhmi2G4QyTNyPBqqXSgTjUxRg3L0xV45HvkNWWBw==", + "dependencies": { + "@babel/helper-environment-visitor": "^7.21.5", + "@babel/helper-module-imports": "^7.21.4", + "@babel/helper-simple-access": "^7.21.5", + "@babel/helper-split-export-declaration": "^7.18.6", + "@babel/helper-validator-identifier": "^7.19.1", + "@babel/template": "^7.20.7", + "@babel/traverse": "^7.21.5", + "@babel/types": "^7.21.5" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-optimise-call-expression": { + "version": "7.18.6", + "resolved": "https://registry.npmjs.org/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.18.6.tgz", + "integrity": "sha512-HP59oD9/fEHQkdcbgFCnbmgH5vIQTJbxh2yf+CdM89/glUNnuzr87Q8GIjGEnOktTROemO0Pe0iPAYbqZuOUiA==", + "dependencies": { + "@babel/types": "^7.18.6" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-plugin-utils": { + "version": "7.21.5", + "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.21.5.tgz", + "integrity": "sha512-0WDaIlXKOX/3KfBK/dwP1oQGiPh6rjMkT7HIRv7i5RR2VUMwrx5ZL0dwBkKx7+SW1zwNdgjHd34IMk5ZjTeHVg==", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-remap-async-to-generator": { + "version": "7.18.9", + "resolved": "https://registry.npmjs.org/@babel/helper-remap-async-to-generator/-/helper-remap-async-to-generator-7.18.9.tgz", + "integrity": "sha512-dI7q50YKd8BAv3VEfgg7PS7yD3Rtbi2J1XMXaalXO0W0164hYLnh8zpjRS0mte9MfVp/tltvr/cfdXPvJr1opA==", + "dependencies": { + "@babel/helper-annotate-as-pure": "^7.18.6", + "@babel/helper-environment-visitor": "^7.18.9", + "@babel/helper-wrap-function": "^7.18.9", + "@babel/types": "^7.18.9" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0" + } + }, + "node_modules/@babel/helper-replace-supers": { + "version": "7.21.5", + "resolved": "https://registry.npmjs.org/@babel/helper-replace-supers/-/helper-replace-supers-7.21.5.tgz", + "integrity": "sha512-/y7vBgsr9Idu4M6MprbOVUfH3vs7tsIfnVWv/Ml2xgwvyH6LTngdfbf5AdsKwkJy4zgy1X/kuNrEKvhhK28Yrg==", + "dependencies": { + "@babel/helper-environment-visitor": "^7.21.5", + "@babel/helper-member-expression-to-functions": "^7.21.5", + "@babel/helper-optimise-call-expression": "^7.18.6", + "@babel/template": "^7.20.7", + "@babel/traverse": "^7.21.5", + "@babel/types": "^7.21.5" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-simple-access": { + "version": "7.21.5", + "resolved": "https://registry.npmjs.org/@babel/helper-simple-access/-/helper-simple-access-7.21.5.tgz", + "integrity": "sha512-ENPDAMC1wAjR0uaCUwliBdiSl1KBJAVnMTzXqi64c2MG8MPR6ii4qf7bSXDqSFbr4W6W028/rf5ivoHop5/mkg==", + "dependencies": { + "@babel/types": "^7.21.5" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-skip-transparent-expression-wrappers": { + "version": "7.20.0", + "resolved": "https://registry.npmjs.org/@babel/helper-skip-transparent-expression-wrappers/-/helper-skip-transparent-expression-wrappers-7.20.0.tgz", + "integrity": "sha512-5y1JYeNKfvnT8sZcK9DVRtpTbGiomYIHviSP3OQWmDPU3DeH4a1ZlT/N2lyQ5P8egjcRaT/Y9aNqUxK0WsnIIg==", + "dependencies": { + "@babel/types": "^7.20.0" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-split-export-declaration": { + "version": "7.18.6", + "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.18.6.tgz", + "integrity": "sha512-bde1etTx6ZyTmobl9LLMMQsaizFVZrquTEHOqKeQESMKo4PlObf+8+JA25ZsIpZhT/WEd39+vOdLXAFG/nELpA==", + "dependencies": { + "@babel/types": "^7.18.6" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-string-parser": { + "version": "7.21.5", + "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.21.5.tgz", + "integrity": "sha512-5pTUx3hAJaZIdW99sJ6ZUUgWq/Y+Hja7TowEnLNMm1VivRgZQL3vpBY3qUACVsvw+yQU6+YgfBVmcbLaZtrA1w==", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-validator-identifier": { + "version": "7.19.1", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.19.1.tgz", + "integrity": "sha512-awrNfaMtnHUr653GgGEs++LlAvW6w+DcPrOliSMXWCKo597CwL5Acf/wWdNkf/tfEQE3mjkeD1YOVZOUV/od1w==", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-validator-option": { + "version": "7.21.0", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-7.21.0.tgz", + "integrity": "sha512-rmL/B8/f0mKS2baE9ZpyTcTavvEuWhTTW8amjzXNvYG4AwBsqTLikfXsEofsJEfKHf+HQVQbFOHy6o+4cnC/fQ==", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-wrap-function": { + "version": "7.20.5", + "resolved": "https://registry.npmjs.org/@babel/helper-wrap-function/-/helper-wrap-function-7.20.5.tgz", + "integrity": "sha512-bYMxIWK5mh+TgXGVqAtnu5Yn1un+v8DDZtqyzKRLUzrh70Eal2O3aZ7aPYiMADO4uKlkzOiRiZ6GX5q3qxvW9Q==", + "dependencies": { + "@babel/helper-function-name": "^7.19.0", + "@babel/template": "^7.18.10", + "@babel/traverse": "^7.20.5", + "@babel/types": "^7.20.5" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helpers": { + "version": "7.21.5", + "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.21.5.tgz", + "integrity": "sha512-BSY+JSlHxOmGsPTydUkPf1MdMQ3M81x5xGCOVgWM3G8XH77sJ292Y2oqcp0CbbgxhqBuI46iUz1tT7hqP7EfgA==", + "dependencies": { + "@babel/template": "^7.20.7", + "@babel/traverse": "^7.21.5", + "@babel/types": "^7.21.5" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/highlight": { + "version": "7.18.6", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.18.6.tgz", + "integrity": "sha512-u7stbOuYjaPezCuLj29hNW1v64M2Md2qupEKP1fHc7WdOA3DgLh37suiSrZYY7haUB7iBeQZ9P1uiRF359do3g==", + "dependencies": { + "@babel/helper-validator-identifier": "^7.18.6", + "chalk": "^2.0.0", + "js-tokens": "^4.0.0" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/highlight/node_modules/ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dependencies": { + "color-convert": "^1.9.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/@babel/highlight/node_modules/chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "dependencies": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/@babel/highlight/node_modules/color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "dependencies": { + "color-name": "1.1.3" + } + }, + "node_modules/@babel/highlight/node_modules/color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==" + }, + "node_modules/@babel/highlight/node_modules/escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", + "engines": { + "node": ">=0.8.0" + } + }, + "node_modules/@babel/highlight/node_modules/has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", + "engines": { + "node": ">=4" + } + }, + "node_modules/@babel/highlight/node_modules/supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dependencies": { + "has-flag": "^3.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/@babel/parser": { + "version": "7.21.8", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.21.8.tgz", + "integrity": "sha512-6zavDGdzG3gUqAdWvlLFfk+36RilI+Pwyuuh7HItyeScCWP3k6i8vKclAQ0bM/0y/Kz/xiwvxhMv9MgTJP5gmA==", + "bin": { + "parser": "bin/babel-parser.js" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression": { + "version": "7.18.6", + "resolved": "https://registry.npmjs.org/@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression/-/plugin-bugfix-safari-id-destructuring-collision-in-function-expression-7.18.6.tgz", + "integrity": "sha512-Dgxsyg54Fx1d4Nge8UnvTrED63vrwOdPmyvPzlNN/boaliRP54pm3pGzZD1SJUwrBA+Cs/xdG8kXX6Mn/RfISQ==", + "dependencies": { + "@babel/helper-plugin-utils": "^7.18.6" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0" + } + }, + "node_modules/@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining": { + "version": "7.20.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining/-/plugin-bugfix-v8-spread-parameters-in-optional-chaining-7.20.7.tgz", + "integrity": "sha512-sbr9+wNE5aXMBBFBICk01tt7sBf2Oc9ikRFEcem/ZORup9IMUdNhW7/wVLEbbtlWOsEubJet46mHAL2C8+2jKQ==", + "dependencies": { + "@babel/helper-plugin-utils": "^7.20.2", + "@babel/helper-skip-transparent-expression-wrappers": "^7.20.0", + "@babel/plugin-proposal-optional-chaining": "^7.20.7" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.13.0" + } + }, + "node_modules/@babel/plugin-proposal-async-generator-functions": { + "version": "7.20.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-async-generator-functions/-/plugin-proposal-async-generator-functions-7.20.7.tgz", + "integrity": "sha512-xMbiLsn/8RK7Wq7VeVytytS2L6qE69bXPB10YCmMdDZbKF4okCqY74pI/jJQ/8U0b/F6NrT2+14b8/P9/3AMGA==", + "dependencies": { + "@babel/helper-environment-visitor": "^7.18.9", + "@babel/helper-plugin-utils": "^7.20.2", + "@babel/helper-remap-async-to-generator": "^7.18.9", + "@babel/plugin-syntax-async-generators": "^7.8.4" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-proposal-class-properties": { + "version": "7.18.6", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-class-properties/-/plugin-proposal-class-properties-7.18.6.tgz", + "integrity": "sha512-cumfXOF0+nzZrrN8Rf0t7M+tF6sZc7vhQwYQck9q1/5w2OExlD+b4v4RpMJFaV1Z7WcDRgO6FqvxqxGlwo+RHQ==", + "dependencies": { + "@babel/helper-create-class-features-plugin": "^7.18.6", + "@babel/helper-plugin-utils": "^7.18.6" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-proposal-class-static-block": { + "version": "7.21.0", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-class-static-block/-/plugin-proposal-class-static-block-7.21.0.tgz", + "integrity": "sha512-XP5G9MWNUskFuP30IfFSEFB0Z6HzLIUcjYM4bYOPHXl7eiJ9HFv8tWj6TXTN5QODiEhDZAeI4hLok2iHFFV4hw==", + "dependencies": { + "@babel/helper-create-class-features-plugin": "^7.21.0", + "@babel/helper-plugin-utils": "^7.20.2", + "@babel/plugin-syntax-class-static-block": "^7.14.5" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.12.0" + } + }, + "node_modules/@babel/plugin-proposal-dynamic-import": { + "version": "7.18.6", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-dynamic-import/-/plugin-proposal-dynamic-import-7.18.6.tgz", + "integrity": "sha512-1auuwmK+Rz13SJj36R+jqFPMJWyKEDd7lLSdOj4oJK0UTgGueSAtkrCvz9ewmgyU/P941Rv2fQwZJN8s6QruXw==", + "dependencies": { + "@babel/helper-plugin-utils": "^7.18.6", + "@babel/plugin-syntax-dynamic-import": "^7.8.3" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-proposal-export-default-from": { + "version": "7.18.10", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-export-default-from/-/plugin-proposal-export-default-from-7.18.10.tgz", + "integrity": "sha512-5H2N3R2aQFxkV4PIBUR/i7PUSwgTZjouJKzI8eKswfIjT0PhvzkPn0t0wIS5zn6maQuvtT0t1oHtMUz61LOuow==", + "peer": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.18.9", + "@babel/plugin-syntax-export-default-from": "^7.18.6" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-proposal-export-namespace-from": { + "version": "7.18.9", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-export-namespace-from/-/plugin-proposal-export-namespace-from-7.18.9.tgz", + "integrity": "sha512-k1NtHyOMvlDDFeb9G5PhUXuGj8m/wiwojgQVEhJ/fsVsMCpLyOP4h0uGEjYJKrRI+EVPlb5Jk+Gt9P97lOGwtA==", + "dependencies": { + "@babel/helper-plugin-utils": "^7.18.9", + "@babel/plugin-syntax-export-namespace-from": "^7.8.3" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-proposal-json-strings": { + "version": "7.18.6", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-json-strings/-/plugin-proposal-json-strings-7.18.6.tgz", + "integrity": "sha512-lr1peyn9kOdbYc0xr0OdHTZ5FMqS6Di+H0Fz2I/JwMzGmzJETNeOFq2pBySw6X/KFL5EWDjlJuMsUGRFb8fQgQ==", + "dependencies": { + "@babel/helper-plugin-utils": "^7.18.6", + "@babel/plugin-syntax-json-strings": "^7.8.3" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-proposal-logical-assignment-operators": { + "version": "7.20.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-logical-assignment-operators/-/plugin-proposal-logical-assignment-operators-7.20.7.tgz", + "integrity": "sha512-y7C7cZgpMIjWlKE5T7eJwp+tnRYM89HmRvWM5EQuB5BoHEONjmQ8lSNmBUwOyy/GFRsohJED51YBF79hE1djug==", + "dependencies": { + "@babel/helper-plugin-utils": "^7.20.2", + "@babel/plugin-syntax-logical-assignment-operators": "^7.10.4" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-proposal-nullish-coalescing-operator": { + "version": "7.18.6", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-nullish-coalescing-operator/-/plugin-proposal-nullish-coalescing-operator-7.18.6.tgz", + "integrity": "sha512-wQxQzxYeJqHcfppzBDnm1yAY0jSRkUXR2z8RePZYrKwMKgMlE8+Z6LUno+bd6LvbGh8Gltvy74+9pIYkr+XkKA==", + "dependencies": { + "@babel/helper-plugin-utils": "^7.18.6", + "@babel/plugin-syntax-nullish-coalescing-operator": "^7.8.3" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-proposal-numeric-separator": { + "version": "7.18.6", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-numeric-separator/-/plugin-proposal-numeric-separator-7.18.6.tgz", + "integrity": "sha512-ozlZFogPqoLm8WBr5Z8UckIoE4YQ5KESVcNudyXOR8uqIkliTEgJ3RoketfG6pmzLdeZF0H/wjE9/cCEitBl7Q==", + "dependencies": { + "@babel/helper-plugin-utils": "^7.18.6", + "@babel/plugin-syntax-numeric-separator": "^7.10.4" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-proposal-object-rest-spread": { + "version": "7.20.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-object-rest-spread/-/plugin-proposal-object-rest-spread-7.20.7.tgz", + "integrity": "sha512-d2S98yCiLxDVmBmE8UjGcfPvNEUbA1U5q5WxaWFUGRzJSVAZqm5W6MbPct0jxnegUZ0niLeNX+IOzEs7wYg9Dg==", + "dependencies": { + "@babel/compat-data": "^7.20.5", + "@babel/helper-compilation-targets": "^7.20.7", + "@babel/helper-plugin-utils": "^7.20.2", + "@babel/plugin-syntax-object-rest-spread": "^7.8.3", + "@babel/plugin-transform-parameters": "^7.20.7" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-proposal-optional-catch-binding": { + "version": "7.18.6", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-optional-catch-binding/-/plugin-proposal-optional-catch-binding-7.18.6.tgz", + "integrity": "sha512-Q40HEhs9DJQyaZfUjjn6vE8Cv4GmMHCYuMGIWUnlxH6400VGxOuwWsPt4FxXxJkC/5eOzgn0z21M9gMT4MOhbw==", + "dependencies": { + "@babel/helper-plugin-utils": "^7.18.6", + "@babel/plugin-syntax-optional-catch-binding": "^7.8.3" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-proposal-optional-chaining": { + "version": "7.21.0", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-optional-chaining/-/plugin-proposal-optional-chaining-7.21.0.tgz", + "integrity": "sha512-p4zeefM72gpmEe2fkUr/OnOXpWEf8nAgk7ZYVqqfFiyIG7oFfVZcCrU64hWn5xp4tQ9LkV4bTIa5rD0KANpKNA==", + "dependencies": { + "@babel/helper-plugin-utils": "^7.20.2", + "@babel/helper-skip-transparent-expression-wrappers": "^7.20.0", + "@babel/plugin-syntax-optional-chaining": "^7.8.3" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-proposal-private-methods": { + "version": "7.18.6", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-private-methods/-/plugin-proposal-private-methods-7.18.6.tgz", + "integrity": "sha512-nutsvktDItsNn4rpGItSNV2sz1XwS+nfU0Rg8aCx3W3NOKVzdMjJRu0O5OkgDp3ZGICSTbgRpxZoWsxoKRvbeA==", + "dependencies": { + "@babel/helper-create-class-features-plugin": "^7.18.6", + "@babel/helper-plugin-utils": "^7.18.6" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-proposal-private-property-in-object": { + "version": "7.21.0", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-private-property-in-object/-/plugin-proposal-private-property-in-object-7.21.0.tgz", + "integrity": "sha512-ha4zfehbJjc5MmXBlHec1igel5TJXXLDDRbuJ4+XT2TJcyD9/V1919BA8gMvsdHcNMBy4WBUBiRb3nw/EQUtBw==", + "dependencies": { + "@babel/helper-annotate-as-pure": "^7.18.6", + "@babel/helper-create-class-features-plugin": "^7.21.0", + "@babel/helper-plugin-utils": "^7.20.2", + "@babel/plugin-syntax-private-property-in-object": "^7.14.5" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-proposal-unicode-property-regex": { + "version": "7.18.6", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-unicode-property-regex/-/plugin-proposal-unicode-property-regex-7.18.6.tgz", + "integrity": "sha512-2BShG/d5yoZyXZfVePH91urL5wTG6ASZU9M4o03lKK8u8UW1y08OMttBSOADTcJrnPMpvDXRG3G8fyLh4ovs8w==", + "dependencies": { + "@babel/helper-create-regexp-features-plugin": "^7.18.6", + "@babel/helper-plugin-utils": "^7.18.6" + }, + "engines": { + "node": ">=4" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-async-generators": { + "version": "7.8.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-async-generators/-/plugin-syntax-async-generators-7.8.4.tgz", + "integrity": "sha512-tycmZxkGfZaxhMRbXlPXuVFpdWlXpir2W4AMhSJgRKzk/eDlIXOhb2LHWoLpDF7TEHylV5zNhykX6KAgHJmTNw==", + "dependencies": { + "@babel/helper-plugin-utils": "^7.8.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-class-properties": { + "version": "7.12.13", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-class-properties/-/plugin-syntax-class-properties-7.12.13.tgz", + "integrity": "sha512-fm4idjKla0YahUNgFNLCB0qySdsoPiZP3iQE3rky0mBUtMZ23yDJ9SJdg6dXTSDnulOVqiF3Hgr9nbXvXTQZYA==", + "dependencies": { + "@babel/helper-plugin-utils": "^7.12.13" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-class-static-block": { + "version": "7.14.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-class-static-block/-/plugin-syntax-class-static-block-7.14.5.tgz", + "integrity": "sha512-b+YyPmr6ldyNnM6sqYeMWE+bgJcJpO6yS4QD7ymxgH34GBPNDM/THBh8iunyvKIZztiwLH4CJZ0RxTk9emgpjw==", + "dependencies": { + "@babel/helper-plugin-utils": "^7.14.5" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-dynamic-import": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-dynamic-import/-/plugin-syntax-dynamic-import-7.8.3.tgz", + "integrity": "sha512-5gdGbFon+PszYzqs83S3E5mpi7/y/8M9eC90MRTZfduQOYW76ig6SOSPNe41IG5LoP3FGBn2N0RjVDSQiS94kQ==", + "dependencies": { + "@babel/helper-plugin-utils": "^7.8.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-export-default-from": { + "version": "7.18.6", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-export-default-from/-/plugin-syntax-export-default-from-7.18.6.tgz", + "integrity": "sha512-Kr//z3ujSVNx6E9z9ih5xXXMqK07VVTuqPmqGe6Mss/zW5XPeLZeSDZoP9ab/hT4wPKqAgjl2PnhPrcpk8Seew==", + "peer": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.18.6" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-export-namespace-from": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-export-namespace-from/-/plugin-syntax-export-namespace-from-7.8.3.tgz", + "integrity": "sha512-MXf5laXo6c1IbEbegDmzGPwGNTsHZmEy6QGznu5Sh2UCWvueywb2ee+CCE4zQiZstxU9BMoQO9i6zUFSY0Kj0Q==", + "dependencies": { + "@babel/helper-plugin-utils": "^7.8.3" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-flow": { + "version": "7.21.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-flow/-/plugin-syntax-flow-7.21.4.tgz", + "integrity": "sha512-l9xd3N+XG4fZRxEP3vXdK6RW7vN1Uf5dxzRC/09wV86wqZ/YYQooBIGNsiRdfNR3/q2/5pPzV4B54J/9ctX5jw==", + "dependencies": { + "@babel/helper-plugin-utils": "^7.20.2" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-import-assertions": { + "version": "7.20.0", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-import-assertions/-/plugin-syntax-import-assertions-7.20.0.tgz", + "integrity": "sha512-IUh1vakzNoWalR8ch/areW7qFopR2AEw03JlG7BbrDqmQ4X3q9uuipQwSGrUn7oGiemKjtSLDhNtQHzMHr1JdQ==", + "dependencies": { + "@babel/helper-plugin-utils": "^7.19.0" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-import-meta": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-import-meta/-/plugin-syntax-import-meta-7.10.4.tgz", + "integrity": "sha512-Yqfm+XDx0+Prh3VSeEQCPU81yC+JWZ2pDPFSS4ZdpfZhp4MkFMaDC1UqseovEKwSUpnIL7+vK+Clp7bfh0iD7g==", + "dependencies": { + "@babel/helper-plugin-utils": "^7.10.4" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-json-strings": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-json-strings/-/plugin-syntax-json-strings-7.8.3.tgz", + "integrity": "sha512-lY6kdGpWHvjoe2vk4WrAapEuBR69EMxZl+RoGRhrFGNYVK8mOPAW8VfbT/ZgrFbXlDNiiaxQnAtgVCZ6jv30EA==", + "dependencies": { + "@babel/helper-plugin-utils": "^7.8.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-jsx": { + "version": "7.21.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-jsx/-/plugin-syntax-jsx-7.21.4.tgz", + "integrity": "sha512-5hewiLct5OKyh6PLKEYaFclcqtIgCb6bmELouxjF6up5q3Sov7rOayW4RwhbaBL0dit8rA80GNfY+UuDp2mBbQ==", + "dependencies": { + "@babel/helper-plugin-utils": "^7.20.2" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-logical-assignment-operators": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-logical-assignment-operators/-/plugin-syntax-logical-assignment-operators-7.10.4.tgz", + "integrity": "sha512-d8waShlpFDinQ5MtvGU9xDAOzKH47+FFoney2baFIoMr952hKOLp1HR7VszoZvOsV/4+RRszNY7D17ba0te0ig==", + "dependencies": { + "@babel/helper-plugin-utils": "^7.10.4" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-nullish-coalescing-operator": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-nullish-coalescing-operator/-/plugin-syntax-nullish-coalescing-operator-7.8.3.tgz", + "integrity": "sha512-aSff4zPII1u2QD7y+F8oDsz19ew4IGEJg9SVW+bqwpwtfFleiQDMdzA/R+UlWDzfnHFCxxleFT0PMIrR36XLNQ==", + "dependencies": { + "@babel/helper-plugin-utils": "^7.8.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-numeric-separator": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-numeric-separator/-/plugin-syntax-numeric-separator-7.10.4.tgz", + "integrity": "sha512-9H6YdfkcK/uOnY/K7/aA2xpzaAgkQn37yzWUMRK7OaPOqOpGS1+n0H5hxT9AUw9EsSjPW8SVyMJwYRtWs3X3ug==", + "dependencies": { + "@babel/helper-plugin-utils": "^7.10.4" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-object-rest-spread": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-object-rest-spread/-/plugin-syntax-object-rest-spread-7.8.3.tgz", + "integrity": "sha512-XoqMijGZb9y3y2XskN+P1wUGiVwWZ5JmoDRwx5+3GmEplNyVM2s2Dg8ILFQm8rWM48orGy5YpI5Bl8U1y7ydlA==", + "dependencies": { + "@babel/helper-plugin-utils": "^7.8.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-optional-catch-binding": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-optional-catch-binding/-/plugin-syntax-optional-catch-binding-7.8.3.tgz", + "integrity": "sha512-6VPD0Pc1lpTqw0aKoeRTMiB+kWhAoT24PA+ksWSBrFtl5SIRVpZlwN3NNPQjehA2E/91FV3RjLWoVTglWcSV3Q==", + "dependencies": { + "@babel/helper-plugin-utils": "^7.8.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-optional-chaining": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-optional-chaining/-/plugin-syntax-optional-chaining-7.8.3.tgz", + "integrity": "sha512-KoK9ErH1MBlCPxV0VANkXW2/dw4vlbGDrFgz8bmUsBGYkFRcbRwMh6cIJubdPrkxRwuGdtCk0v/wPTKbQgBjkg==", + "dependencies": { + "@babel/helper-plugin-utils": "^7.8.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-private-property-in-object": { + "version": "7.14.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-private-property-in-object/-/plugin-syntax-private-property-in-object-7.14.5.tgz", + "integrity": "sha512-0wVnp9dxJ72ZUJDV27ZfbSj6iHLoytYZmh3rFcxNnvsJF3ktkzLDZPy/mA17HGsaQT3/DQsWYX1f1QGWkCoVUg==", + "dependencies": { + "@babel/helper-plugin-utils": "^7.14.5" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-top-level-await": { + "version": "7.14.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-top-level-await/-/plugin-syntax-top-level-await-7.14.5.tgz", + "integrity": "sha512-hx++upLv5U1rgYfwe1xBQUhRmU41NEvpUvrp8jkrSCdvGSnM5/qdRMtylJ6PG5OFkBaHkbTAKTnd3/YyESRHFw==", + "dependencies": { + "@babel/helper-plugin-utils": "^7.14.5" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-typescript": { + "version": "7.21.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-typescript/-/plugin-syntax-typescript-7.21.4.tgz", + "integrity": "sha512-xz0D39NvhQn4t4RNsHmDnnsaQizIlUkdtYvLs8La1BlfjQ6JEwxkJGeqJMW2tAXx+q6H+WFuUTXNdYVpEya0YA==", + "dependencies": { + "@babel/helper-plugin-utils": "^7.20.2" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-arrow-functions": { + "version": "7.21.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-arrow-functions/-/plugin-transform-arrow-functions-7.21.5.tgz", + "integrity": "sha512-wb1mhwGOCaXHDTcsRYMKF9e5bbMgqwxtqa2Y1ifH96dXJPwbuLX9qHy3clhrxVqgMz7nyNXs8VkxdH8UBcjKqA==", + "dependencies": { + "@babel/helper-plugin-utils": "^7.21.5" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-async-to-generator": { + "version": "7.20.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-async-to-generator/-/plugin-transform-async-to-generator-7.20.7.tgz", + "integrity": "sha512-Uo5gwHPT9vgnSXQxqGtpdufUiWp96gk7yiP4Mp5bm1QMkEmLXBO7PAGYbKoJ6DhAwiNkcHFBol/x5zZZkL/t0Q==", + "dependencies": { + "@babel/helper-module-imports": "^7.18.6", + "@babel/helper-plugin-utils": "^7.20.2", + "@babel/helper-remap-async-to-generator": "^7.18.9" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-block-scoped-functions": { + "version": "7.18.6", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-block-scoped-functions/-/plugin-transform-block-scoped-functions-7.18.6.tgz", + "integrity": "sha512-ExUcOqpPWnliRcPqves5HJcJOvHvIIWfuS4sroBUenPuMdmW+SMHDakmtS7qOo13sVppmUijqeTv7qqGsvURpQ==", + "dependencies": { + "@babel/helper-plugin-utils": "^7.18.6" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-block-scoping": { + "version": "7.21.0", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-block-scoping/-/plugin-transform-block-scoping-7.21.0.tgz", + "integrity": "sha512-Mdrbunoh9SxwFZapeHVrwFmri16+oYotcZysSzhNIVDwIAb1UV+kvnxULSYq9J3/q5MDG+4X6w8QVgD1zhBXNQ==", + "dependencies": { + "@babel/helper-plugin-utils": "^7.20.2" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-classes": { + "version": "7.21.0", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-classes/-/plugin-transform-classes-7.21.0.tgz", + "integrity": "sha512-RZhbYTCEUAe6ntPehC4hlslPWosNHDox+vAs4On/mCLRLfoDVHf6hVEd7kuxr1RnHwJmxFfUM3cZiZRmPxJPXQ==", + "dependencies": { + "@babel/helper-annotate-as-pure": "^7.18.6", + "@babel/helper-compilation-targets": "^7.20.7", + "@babel/helper-environment-visitor": "^7.18.9", + "@babel/helper-function-name": "^7.21.0", + "@babel/helper-optimise-call-expression": "^7.18.6", + "@babel/helper-plugin-utils": "^7.20.2", + "@babel/helper-replace-supers": "^7.20.7", + "@babel/helper-split-export-declaration": "^7.18.6", + "globals": "^11.1.0" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-computed-properties": { + "version": "7.21.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-computed-properties/-/plugin-transform-computed-properties-7.21.5.tgz", + "integrity": "sha512-TR653Ki3pAwxBxUe8srfF3e4Pe3FTA46uaNHYyQwIoM4oWKSoOZiDNyHJ0oIoDIUPSRQbQG7jzgVBX3FPVne1Q==", + "dependencies": { + "@babel/helper-plugin-utils": "^7.21.5", + "@babel/template": "^7.20.7" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-destructuring": { + "version": "7.21.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-destructuring/-/plugin-transform-destructuring-7.21.3.tgz", + "integrity": "sha512-bp6hwMFzuiE4HqYEyoGJ/V2LeIWn+hLVKc4pnj++E5XQptwhtcGmSayM029d/j2X1bPKGTlsyPwAubuU22KhMA==", + "dependencies": { + "@babel/helper-plugin-utils": "^7.20.2" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-dotall-regex": { + "version": "7.18.6", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-dotall-regex/-/plugin-transform-dotall-regex-7.18.6.tgz", + "integrity": "sha512-6S3jpun1eEbAxq7TdjLotAsl4WpQI9DxfkycRcKrjhQYzU87qpXdknpBg/e+TdcMehqGnLFi7tnFUBR02Vq6wg==", + "dependencies": { + "@babel/helper-create-regexp-features-plugin": "^7.18.6", + "@babel/helper-plugin-utils": "^7.18.6" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-duplicate-keys": { + "version": "7.18.9", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-duplicate-keys/-/plugin-transform-duplicate-keys-7.18.9.tgz", + "integrity": "sha512-d2bmXCtZXYc59/0SanQKbiWINadaJXqtvIQIzd4+hNwkWBgyCd5F/2t1kXoUdvPMrxzPvhK6EMQRROxsue+mfw==", + "dependencies": { + "@babel/helper-plugin-utils": "^7.18.9" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-exponentiation-operator": { + "version": "7.18.6", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-exponentiation-operator/-/plugin-transform-exponentiation-operator-7.18.6.tgz", + "integrity": "sha512-wzEtc0+2c88FVR34aQmiz56dxEkxr2g8DQb/KfaFa1JYXOFVsbhvAonFN6PwVWj++fKmku8NP80plJ5Et4wqHw==", + "dependencies": { + "@babel/helper-builder-binary-assignment-operator-visitor": "^7.18.6", + "@babel/helper-plugin-utils": "^7.18.6" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-flow-strip-types": { + "version": "7.21.0", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-flow-strip-types/-/plugin-transform-flow-strip-types-7.21.0.tgz", + "integrity": "sha512-FlFA2Mj87a6sDkW4gfGrQQqwY/dLlBAyJa2dJEZ+FHXUVHBflO2wyKvg+OOEzXfrKYIa4HWl0mgmbCzt0cMb7w==", + "dependencies": { + "@babel/helper-plugin-utils": "^7.20.2", + "@babel/plugin-syntax-flow": "^7.18.6" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-for-of": { + "version": "7.21.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-for-of/-/plugin-transform-for-of-7.21.5.tgz", + "integrity": "sha512-nYWpjKW/7j/I/mZkGVgHJXh4bA1sfdFnJoOXwJuj4m3Q2EraO/8ZyrkCau9P5tbHQk01RMSt6KYLCsW7730SXQ==", + "dependencies": { + "@babel/helper-plugin-utils": "^7.21.5" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-function-name": { + "version": "7.18.9", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-function-name/-/plugin-transform-function-name-7.18.9.tgz", + "integrity": "sha512-WvIBoRPaJQ5yVHzcnJFor7oS5Ls0PYixlTYE63lCj2RtdQEl15M68FXQlxnG6wdraJIXRdR7KI+hQ7q/9QjrCQ==", + "dependencies": { + "@babel/helper-compilation-targets": "^7.18.9", + "@babel/helper-function-name": "^7.18.9", + "@babel/helper-plugin-utils": "^7.18.9" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-literals": { + "version": "7.18.9", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-literals/-/plugin-transform-literals-7.18.9.tgz", + "integrity": "sha512-IFQDSRoTPnrAIrI5zoZv73IFeZu2dhu6irxQjY9rNjTT53VmKg9fenjvoiOWOkJ6mm4jKVPtdMzBY98Fp4Z4cg==", + "dependencies": { + "@babel/helper-plugin-utils": "^7.18.9" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-member-expression-literals": { + "version": "7.18.6", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-member-expression-literals/-/plugin-transform-member-expression-literals-7.18.6.tgz", + "integrity": "sha512-qSF1ihLGO3q+/g48k85tUjD033C29TNTVB2paCwZPVmOsjn9pClvYYrM2VeJpBY2bcNkuny0YUyTNRyRxJ54KA==", + "dependencies": { + "@babel/helper-plugin-utils": "^7.18.6" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-modules-amd": { + "version": "7.20.11", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-amd/-/plugin-transform-modules-amd-7.20.11.tgz", + "integrity": "sha512-NuzCt5IIYOW0O30UvqktzHYR2ud5bOWbY0yaxWZ6G+aFzOMJvrs5YHNikrbdaT15+KNO31nPOy5Fim3ku6Zb5g==", + "dependencies": { + "@babel/helper-module-transforms": "^7.20.11", + "@babel/helper-plugin-utils": "^7.20.2" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-modules-commonjs": { + "version": "7.21.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-commonjs/-/plugin-transform-modules-commonjs-7.21.5.tgz", + "integrity": "sha512-OVryBEgKUbtqMoB7eG2rs6UFexJi6Zj6FDXx+esBLPTCxCNxAY9o+8Di7IsUGJ+AVhp5ncK0fxWUBd0/1gPhrQ==", + "dependencies": { + "@babel/helper-module-transforms": "^7.21.5", + "@babel/helper-plugin-utils": "^7.21.5", + "@babel/helper-simple-access": "^7.21.5" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-modules-systemjs": { + "version": "7.20.11", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-systemjs/-/plugin-transform-modules-systemjs-7.20.11.tgz", + "integrity": "sha512-vVu5g9BPQKSFEmvt2TA4Da5N+QVS66EX21d8uoOihC+OCpUoGvzVsXeqFdtAEfVa5BILAeFt+U7yVmLbQnAJmw==", + "dependencies": { + "@babel/helper-hoist-variables": "^7.18.6", + "@babel/helper-module-transforms": "^7.20.11", + "@babel/helper-plugin-utils": "^7.20.2", + "@babel/helper-validator-identifier": "^7.19.1" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-modules-umd": { + "version": "7.18.6", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-umd/-/plugin-transform-modules-umd-7.18.6.tgz", + "integrity": "sha512-dcegErExVeXcRqNtkRU/z8WlBLnvD4MRnHgNs3MytRO1Mn1sHRyhbcpYbVMGclAqOjdW+9cfkdZno9dFdfKLfQ==", + "dependencies": { + "@babel/helper-module-transforms": "^7.18.6", + "@babel/helper-plugin-utils": "^7.18.6" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-named-capturing-groups-regex": { + "version": "7.20.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-named-capturing-groups-regex/-/plugin-transform-named-capturing-groups-regex-7.20.5.tgz", + "integrity": "sha512-mOW4tTzi5iTLnw+78iEq3gr8Aoq4WNRGpmSlrogqaiCBoR1HFhpU4JkpQFOHfeYx3ReVIFWOQJS4aZBRvuZ6mA==", + "dependencies": { + "@babel/helper-create-regexp-features-plugin": "^7.20.5", + "@babel/helper-plugin-utils": "^7.20.2" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0" + } + }, + "node_modules/@babel/plugin-transform-new-target": { + "version": "7.18.6", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-new-target/-/plugin-transform-new-target-7.18.6.tgz", + "integrity": "sha512-DjwFA/9Iu3Z+vrAn+8pBUGcjhxKguSMlsFqeCKbhb9BAV756v0krzVK04CRDi/4aqmk8BsHb4a/gFcaA5joXRw==", + "dependencies": { + "@babel/helper-plugin-utils": "^7.18.6" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-object-super": { + "version": "7.18.6", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-object-super/-/plugin-transform-object-super-7.18.6.tgz", + "integrity": "sha512-uvGz6zk+pZoS1aTZrOvrbj6Pp/kK2mp45t2B+bTDre2UgsZZ8EZLSJtUg7m/no0zOJUWgFONpB7Zv9W2tSaFlA==", + "dependencies": { + "@babel/helper-plugin-utils": "^7.18.6", + "@babel/helper-replace-supers": "^7.18.6" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-parameters": { + "version": "7.21.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-parameters/-/plugin-transform-parameters-7.21.3.tgz", + "integrity": "sha512-Wxc+TvppQG9xWFYatvCGPvZ6+SIUxQ2ZdiBP+PHYMIjnPXD+uThCshaz4NZOnODAtBjjcVQQ/3OKs9LW28purQ==", + "dependencies": { + "@babel/helper-plugin-utils": "^7.20.2" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-property-literals": { + "version": "7.18.6", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-property-literals/-/plugin-transform-property-literals-7.18.6.tgz", + "integrity": "sha512-cYcs6qlgafTud3PAzrrRNbQtfpQ8+y/+M5tKmksS9+M1ckbH6kzY8MrexEM9mcA6JDsukE19iIRvAyYl463sMg==", + "dependencies": { + "@babel/helper-plugin-utils": "^7.18.6" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-react-display-name": { + "version": "7.18.6", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-react-display-name/-/plugin-transform-react-display-name-7.18.6.tgz", + "integrity": "sha512-TV4sQ+T013n61uMoygyMRm+xf04Bd5oqFpv2jAEQwSZ8NwQA7zeRPg1LMVg2PWi3zWBz+CLKD+v5bcpZ/BS0aA==", + "dependencies": { + "@babel/helper-plugin-utils": "^7.18.6" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-react-jsx": { + "version": "7.21.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-react-jsx/-/plugin-transform-react-jsx-7.21.5.tgz", + "integrity": "sha512-ELdlq61FpoEkHO6gFRpfj0kUgSwQTGoaEU8eMRoS8Dv3v6e7BjEAj5WMtIBRdHUeAioMhKP5HyxNzNnP+heKbA==", + "dependencies": { + "@babel/helper-annotate-as-pure": "^7.18.6", + "@babel/helper-module-imports": "^7.21.4", + "@babel/helper-plugin-utils": "^7.21.5", + "@babel/plugin-syntax-jsx": "^7.21.4", + "@babel/types": "^7.21.5" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-react-jsx-development": { + "version": "7.18.6", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-react-jsx-development/-/plugin-transform-react-jsx-development-7.18.6.tgz", + "integrity": "sha512-SA6HEjwYFKF7WDjWcMcMGUimmw/nhNRDWxr+KaLSCrkD/LMDBvWRmHAYgE1HDeF8KUuI8OAu+RT6EOtKxSW2qA==", + "dev": true, + "dependencies": { + "@babel/plugin-transform-react-jsx": "^7.18.6" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-react-jsx-self": { + "version": "7.21.0", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-react-jsx-self/-/plugin-transform-react-jsx-self-7.21.0.tgz", + "integrity": "sha512-f/Eq+79JEu+KUANFks9UZCcvydOOGMgF7jBrcwjHa5jTZD8JivnhCJYvmlhR/WTXBWonDExPoW0eO/CR4QJirA==", + "peer": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.20.2" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-react-jsx-source": { + "version": "7.19.6", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-react-jsx-source/-/plugin-transform-react-jsx-source-7.19.6.tgz", + "integrity": "sha512-RpAi004QyMNisst/pvSanoRdJ4q+jMCWyk9zdw/CyLB9j8RXEahodR6l2GyttDRyEVWZtbN+TpLiHJ3t34LbsQ==", + "peer": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.19.0" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-react-pure-annotations": { + "version": "7.18.6", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-react-pure-annotations/-/plugin-transform-react-pure-annotations-7.18.6.tgz", + "integrity": "sha512-I8VfEPg9r2TRDdvnHgPepTKvuRomzA8+u+nhY7qSI1fR2hRNebasZEETLyM5mAUr0Ku56OkXJ0I7NHJnO6cJiQ==", + "dev": true, + "dependencies": { + "@babel/helper-annotate-as-pure": "^7.18.6", + "@babel/helper-plugin-utils": "^7.18.6" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-regenerator": { + "version": "7.21.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-regenerator/-/plugin-transform-regenerator-7.21.5.tgz", + "integrity": "sha512-ZoYBKDb6LyMi5yCsByQ5jmXsHAQDDYeexT1Szvlmui+lADvfSecr5Dxd/PkrTC3pAD182Fcju1VQkB4oCp9M+w==", + "dependencies": { + "@babel/helper-plugin-utils": "^7.21.5", + "regenerator-transform": "^0.15.1" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-reserved-words": { + "version": "7.18.6", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-reserved-words/-/plugin-transform-reserved-words-7.18.6.tgz", + "integrity": "sha512-oX/4MyMoypzHjFrT1CdivfKZ+XvIPMFXwwxHp/r0Ddy2Vuomt4HDFGmft1TAY2yiTKiNSsh3kjBAzcM8kSdsjA==", + "dependencies": { + "@babel/helper-plugin-utils": "^7.18.6" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-runtime": { + "version": "7.21.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-runtime/-/plugin-transform-runtime-7.21.4.tgz", + "integrity": "sha512-1J4dhrw1h1PqnNNpzwxQ2UBymJUF8KuPjAAnlLwZcGhHAIqUigFW7cdK6GHoB64ubY4qXQNYknoUeks4Wz7CUA==", + "peer": true, + "dependencies": { + "@babel/helper-module-imports": "^7.21.4", + "@babel/helper-plugin-utils": "^7.20.2", + "babel-plugin-polyfill-corejs2": "^0.3.3", + "babel-plugin-polyfill-corejs3": "^0.6.0", + "babel-plugin-polyfill-regenerator": "^0.4.1", + "semver": "^6.3.0" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-shorthand-properties": { + "version": "7.18.6", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-shorthand-properties/-/plugin-transform-shorthand-properties-7.18.6.tgz", + "integrity": "sha512-eCLXXJqv8okzg86ywZJbRn19YJHU4XUa55oz2wbHhaQVn/MM+XhukiT7SYqp/7o00dg52Rj51Ny+Ecw4oyoygw==", + "dependencies": { + "@babel/helper-plugin-utils": "^7.18.6" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-spread": { + "version": "7.20.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-spread/-/plugin-transform-spread-7.20.7.tgz", + "integrity": "sha512-ewBbHQ+1U/VnH1fxltbJqDeWBU1oNLG8Dj11uIv3xVf7nrQu0bPGe5Rf716r7K5Qz+SqtAOVswoVunoiBtGhxw==", + "dependencies": { + "@babel/helper-plugin-utils": "^7.20.2", + "@babel/helper-skip-transparent-expression-wrappers": "^7.20.0" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-sticky-regex": { + "version": "7.18.6", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-sticky-regex/-/plugin-transform-sticky-regex-7.18.6.tgz", + "integrity": "sha512-kfiDrDQ+PBsQDO85yj1icueWMfGfJFKN1KCkndygtu/C9+XUfydLC8Iv5UYJqRwy4zk8EcplRxEOeLyjq1gm6Q==", + "dependencies": { + "@babel/helper-plugin-utils": "^7.18.6" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-template-literals": { + "version": "7.18.9", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-template-literals/-/plugin-transform-template-literals-7.18.9.tgz", + "integrity": "sha512-S8cOWfT82gTezpYOiVaGHrCbhlHgKhQt8XH5ES46P2XWmX92yisoZywf5km75wv5sYcXDUCLMmMxOLCtthDgMA==", + "dependencies": { + "@babel/helper-plugin-utils": "^7.18.9" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-typeof-symbol": { + "version": "7.18.9", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-typeof-symbol/-/plugin-transform-typeof-symbol-7.18.9.tgz", + "integrity": "sha512-SRfwTtF11G2aemAZWivL7PD+C9z52v9EvMqH9BuYbabyPuKUvSWks3oCg6041pT925L4zVFqaVBeECwsmlguEw==", + "dependencies": { + "@babel/helper-plugin-utils": "^7.18.9" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-typescript": { + "version": "7.21.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-typescript/-/plugin-transform-typescript-7.21.3.tgz", + "integrity": "sha512-RQxPz6Iqt8T0uw/WsJNReuBpWpBqs/n7mNo18sKLoTbMp+UrEekhH+pKSVC7gWz+DNjo9gryfV8YzCiT45RgMw==", + "dependencies": { + "@babel/helper-annotate-as-pure": "^7.18.6", + "@babel/helper-create-class-features-plugin": "^7.21.0", + "@babel/helper-plugin-utils": "^7.20.2", + "@babel/plugin-syntax-typescript": "^7.20.0" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-unicode-escapes": { + "version": "7.21.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-unicode-escapes/-/plugin-transform-unicode-escapes-7.21.5.tgz", + "integrity": "sha512-LYm/gTOwZqsYohlvFUe/8Tujz75LqqVC2w+2qPHLR+WyWHGCZPN1KBpJCJn+4Bk4gOkQy/IXKIge6az5MqwlOg==", + "dependencies": { + "@babel/helper-plugin-utils": "^7.21.5" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-unicode-regex": { + "version": "7.18.6", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-unicode-regex/-/plugin-transform-unicode-regex-7.18.6.tgz", + "integrity": "sha512-gE7A6Lt7YLnNOL3Pb9BNeZvi+d8l7tcRrG4+pwJjK9hD2xX4mEvjlQW60G9EEmfXVYRPv9VRQcyegIVHCql/AA==", + "dependencies": { + "@babel/helper-create-regexp-features-plugin": "^7.18.6", + "@babel/helper-plugin-utils": "^7.18.6" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/preset-env": { + "version": "7.21.5", + "resolved": "https://registry.npmjs.org/@babel/preset-env/-/preset-env-7.21.5.tgz", + "integrity": "sha512-wH00QnTTldTbf/IefEVyChtRdw5RJvODT/Vb4Vcxq1AZvtXj6T0YeX0cAcXhI6/BdGuiP3GcNIL4OQbI2DVNxg==", + "dependencies": { + "@babel/compat-data": "^7.21.5", + "@babel/helper-compilation-targets": "^7.21.5", + "@babel/helper-plugin-utils": "^7.21.5", + "@babel/helper-validator-option": "^7.21.0", + "@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression": "^7.18.6", + "@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining": "^7.20.7", + "@babel/plugin-proposal-async-generator-functions": "^7.20.7", + "@babel/plugin-proposal-class-properties": "^7.18.6", + "@babel/plugin-proposal-class-static-block": "^7.21.0", + "@babel/plugin-proposal-dynamic-import": "^7.18.6", + "@babel/plugin-proposal-export-namespace-from": "^7.18.9", + "@babel/plugin-proposal-json-strings": "^7.18.6", + "@babel/plugin-proposal-logical-assignment-operators": "^7.20.7", + "@babel/plugin-proposal-nullish-coalescing-operator": "^7.18.6", + "@babel/plugin-proposal-numeric-separator": "^7.18.6", + "@babel/plugin-proposal-object-rest-spread": "^7.20.7", + "@babel/plugin-proposal-optional-catch-binding": "^7.18.6", + "@babel/plugin-proposal-optional-chaining": "^7.21.0", + "@babel/plugin-proposal-private-methods": "^7.18.6", + "@babel/plugin-proposal-private-property-in-object": "^7.21.0", + "@babel/plugin-proposal-unicode-property-regex": "^7.18.6", + "@babel/plugin-syntax-async-generators": "^7.8.4", + "@babel/plugin-syntax-class-properties": "^7.12.13", + "@babel/plugin-syntax-class-static-block": "^7.14.5", + "@babel/plugin-syntax-dynamic-import": "^7.8.3", + "@babel/plugin-syntax-export-namespace-from": "^7.8.3", + "@babel/plugin-syntax-import-assertions": "^7.20.0", + "@babel/plugin-syntax-import-meta": "^7.10.4", + "@babel/plugin-syntax-json-strings": "^7.8.3", + "@babel/plugin-syntax-logical-assignment-operators": "^7.10.4", + "@babel/plugin-syntax-nullish-coalescing-operator": "^7.8.3", + "@babel/plugin-syntax-numeric-separator": "^7.10.4", + "@babel/plugin-syntax-object-rest-spread": "^7.8.3", + "@babel/plugin-syntax-optional-catch-binding": "^7.8.3", + "@babel/plugin-syntax-optional-chaining": "^7.8.3", + "@babel/plugin-syntax-private-property-in-object": "^7.14.5", + "@babel/plugin-syntax-top-level-await": "^7.14.5", + "@babel/plugin-transform-arrow-functions": "^7.21.5", + "@babel/plugin-transform-async-to-generator": "^7.20.7", + "@babel/plugin-transform-block-scoped-functions": "^7.18.6", + "@babel/plugin-transform-block-scoping": "^7.21.0", + "@babel/plugin-transform-classes": "^7.21.0", + "@babel/plugin-transform-computed-properties": "^7.21.5", + "@babel/plugin-transform-destructuring": "^7.21.3", + "@babel/plugin-transform-dotall-regex": "^7.18.6", + "@babel/plugin-transform-duplicate-keys": "^7.18.9", + "@babel/plugin-transform-exponentiation-operator": "^7.18.6", + "@babel/plugin-transform-for-of": "^7.21.5", + "@babel/plugin-transform-function-name": "^7.18.9", + "@babel/plugin-transform-literals": "^7.18.9", + "@babel/plugin-transform-member-expression-literals": "^7.18.6", + "@babel/plugin-transform-modules-amd": "^7.20.11", + "@babel/plugin-transform-modules-commonjs": "^7.21.5", + "@babel/plugin-transform-modules-systemjs": "^7.20.11", + "@babel/plugin-transform-modules-umd": "^7.18.6", + "@babel/plugin-transform-named-capturing-groups-regex": "^7.20.5", + "@babel/plugin-transform-new-target": "^7.18.6", + "@babel/plugin-transform-object-super": "^7.18.6", + "@babel/plugin-transform-parameters": "^7.21.3", + "@babel/plugin-transform-property-literals": "^7.18.6", + "@babel/plugin-transform-regenerator": "^7.21.5", + "@babel/plugin-transform-reserved-words": "^7.18.6", + "@babel/plugin-transform-shorthand-properties": "^7.18.6", + "@babel/plugin-transform-spread": "^7.20.7", + "@babel/plugin-transform-sticky-regex": "^7.18.6", + "@babel/plugin-transform-template-literals": "^7.18.9", + "@babel/plugin-transform-typeof-symbol": "^7.18.9", + "@babel/plugin-transform-unicode-escapes": "^7.21.5", + "@babel/plugin-transform-unicode-regex": "^7.18.6", + "@babel/preset-modules": "^0.1.5", + "@babel/types": "^7.21.5", + "babel-plugin-polyfill-corejs2": "^0.3.3", + "babel-plugin-polyfill-corejs3": "^0.6.0", + "babel-plugin-polyfill-regenerator": "^0.4.1", + "core-js-compat": "^3.25.1", + "semver": "^6.3.0" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/preset-flow": { + "version": "7.21.4", + "resolved": "https://registry.npmjs.org/@babel/preset-flow/-/preset-flow-7.21.4.tgz", + "integrity": "sha512-F24cSq4DIBmhq4OzK3dE63NHagb27OPE3eWR+HLekt4Z3Y5MzIIUGF3LlLgV0gN8vzbDViSY7HnrReNVCJXTeA==", + "dependencies": { + "@babel/helper-plugin-utils": "^7.20.2", + "@babel/helper-validator-option": "^7.21.0", + "@babel/plugin-transform-flow-strip-types": "^7.21.0" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/preset-modules": { + "version": "0.1.5", + "resolved": "https://registry.npmjs.org/@babel/preset-modules/-/preset-modules-0.1.5.tgz", + "integrity": "sha512-A57th6YRG7oR3cq/yt/Y84MvGgE0eJG2F1JLhKuyG+jFxEgrd/HAMJatiFtmOiZurz+0DkrvbheCLaV5f2JfjA==", + "dependencies": { + "@babel/helper-plugin-utils": "^7.0.0", + "@babel/plugin-proposal-unicode-property-regex": "^7.4.4", + "@babel/plugin-transform-dotall-regex": "^7.4.4", + "@babel/types": "^7.4.4", + "esutils": "^2.0.2" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/preset-react": { + "version": "7.18.6", + "resolved": "https://registry.npmjs.org/@babel/preset-react/-/preset-react-7.18.6.tgz", + "integrity": "sha512-zXr6atUmyYdiWRVLOZahakYmOBHtWc2WGCkP8PYTgZi0iJXDY2CN180TdrIW4OGOAdLc7TifzDIvtx6izaRIzg==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.18.6", + "@babel/helper-validator-option": "^7.18.6", + "@babel/plugin-transform-react-display-name": "^7.18.6", + "@babel/plugin-transform-react-jsx": "^7.18.6", + "@babel/plugin-transform-react-jsx-development": "^7.18.6", + "@babel/plugin-transform-react-pure-annotations": "^7.18.6" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/preset-typescript": { + "version": "7.21.5", + "resolved": "https://registry.npmjs.org/@babel/preset-typescript/-/preset-typescript-7.21.5.tgz", + "integrity": "sha512-iqe3sETat5EOrORXiQ6rWfoOg2y68Cs75B9wNxdPW4kixJxh7aXQE1KPdWLDniC24T/6dSnguF33W9j/ZZQcmA==", + "dependencies": { + "@babel/helper-plugin-utils": "^7.21.5", + "@babel/helper-validator-option": "^7.21.0", + "@babel/plugin-syntax-jsx": "^7.21.4", + "@babel/plugin-transform-modules-commonjs": "^7.21.5", + "@babel/plugin-transform-typescript": "^7.21.3" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/register": { + "version": "7.23.7", + "resolved": "https://registry.npmjs.org/@babel/register/-/register-7.23.7.tgz", + "integrity": "sha512-EjJeB6+kvpk+Y5DAkEAmbOBEFkh9OASx0huoEkqYTFxAZHzOAX2Oh5uwAUuL2rUddqfM0SA+KPXV2TbzoZ2kvQ==", + "peer": true, + "dependencies": { + "clone-deep": "^4.0.1", + "find-cache-dir": "^2.0.0", + "make-dir": "^2.1.0", + "pirates": "^4.0.6", + "source-map-support": "^0.5.16" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/regjsgen": { + "version": "0.8.0", + "resolved": "https://registry.npmjs.org/@babel/regjsgen/-/regjsgen-0.8.0.tgz", + "integrity": "sha512-x/rqGMdzj+fWZvCOYForTghzbtqPDZ5gPwaoNGHdgDfF2QA/XZbCBp4Moo5scrkAMPhB7z26XM/AaHuIJdgauA==" + }, + "node_modules/@babel/runtime": { + "version": "7.21.5", + "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.21.5.tgz", + "integrity": "sha512-8jI69toZqqcsnqGGqwGS4Qb1VwLOEp4hz+CXPywcvjs60u3B4Pom/U/7rm4W8tMOYEB+E9wgD0mW1l3r8qlI9Q==", + "dependencies": { + "regenerator-runtime": "^0.13.11" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/template": { + "version": "7.20.7", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.20.7.tgz", + "integrity": "sha512-8SegXApWe6VoNw0r9JHpSteLKTpTiLZ4rMlGIm9JQ18KiCtyQiAMEazujAHrUS5flrcqYZa75ukev3P6QmUwUw==", + "dependencies": { + "@babel/code-frame": "^7.18.6", + "@babel/parser": "^7.20.7", + "@babel/types": "^7.20.7" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/traverse": { + "version": "7.21.5", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.21.5.tgz", + "integrity": "sha512-AhQoI3YjWi6u/y/ntv7k48mcrCXmus0t79J9qPNlk/lAsFlCiJ047RmbfMOawySTHtywXhbXgpx/8nXMYd+oFw==", + "dependencies": { + "@babel/code-frame": "^7.21.4", + "@babel/generator": "^7.21.5", + "@babel/helper-environment-visitor": "^7.21.5", + "@babel/helper-function-name": "^7.21.0", + "@babel/helper-hoist-variables": "^7.18.6", + "@babel/helper-split-export-declaration": "^7.18.6", + "@babel/parser": "^7.21.5", + "@babel/types": "^7.21.5", + "debug": "^4.1.0", + "globals": "^11.1.0" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/traverse/node_modules/debug": { + "version": "4.3.4", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", + "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", + "dependencies": { + "ms": "2.1.2" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/@babel/traverse/node_modules/ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" + }, + "node_modules/@babel/types": { + "version": "7.21.5", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.21.5.tgz", + "integrity": "sha512-m4AfNvVF2mVC/F7fDEdH2El3HzUg9It/XsCxZiOTTA3m3qYfcSVSbTfM6Q9xG+hYDniZssYhlXKKUMD5m8tF4Q==", + "dependencies": { + "@babel/helper-string-parser": "^7.21.5", + "@babel/helper-validator-identifier": "^7.19.1", + "to-fast-properties": "^2.0.0" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@hapi/hoek": { + "version": "9.3.0", + "resolved": "https://registry.npmjs.org/@hapi/hoek/-/hoek-9.3.0.tgz", + "integrity": "sha512-/c6rf4UJlmHlC9b5BaNvzAcFv7HZ2QHaV0D4/HNlBdvFnvQq8RI4kYdhyPCl7Xj+oWvTWQ8ujhqS53LIgAe6KQ==", + "peer": true + }, + "node_modules/@hapi/topo": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/@hapi/topo/-/topo-5.1.0.tgz", + "integrity": "sha512-foQZKJig7Ob0BMAYBfcJk8d77QtOe7Wo4ox7ff1lQYoNNAb6jwcY1ncdoy2e9wQZzvNy7ODZCYJkK8kzmcAnAg==", + "peer": true, + "dependencies": { + "@hapi/hoek": "^9.0.0" + } + }, + "node_modules/@jest/create-cache-key-function": { + "version": "29.5.0", + "resolved": "https://registry.npmjs.org/@jest/create-cache-key-function/-/create-cache-key-function-29.5.0.tgz", + "integrity": "sha512-LIDZyZgnZss7uikvBKBB/USWwG+GO8+GnwRWT+YkCGDGsqLQlhm9BC3z6+7+eMs1kUlvXQIWEzBR8Q2Pnvx6lg==", + "peer": true, + "dependencies": { + "@jest/types": "^29.5.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/@jest/environment": { + "version": "29.5.0", + "resolved": "https://registry.npmjs.org/@jest/environment/-/environment-29.5.0.tgz", + "integrity": "sha512-5FXw2+wD29YU1d4I2htpRX7jYnAyTRjP2CsXQdo9SAM8g3ifxWPSV0HnClSn71xwctr0U3oZIIH+dtbfmnbXVQ==", + "peer": true, + "dependencies": { + "@jest/fake-timers": "^29.5.0", + "@jest/types": "^29.5.0", + "@types/node": "*", + "jest-mock": "^29.5.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/@jest/expect-utils": { + "version": "29.5.0", + "resolved": "https://registry.npmjs.org/@jest/expect-utils/-/expect-utils-29.5.0.tgz", + "integrity": "sha512-fmKzsidoXQT2KwnrwE0SQq3uj8Z763vzR8LnLBwC2qYWEFpjX8daRsk6rHUM1QvNlEW/UJXNXm59ztmJJWs2Mg==", + "dev": true, + "dependencies": { + "jest-get-type": "^29.4.3" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/@jest/fake-timers": { + "version": "29.5.0", + "resolved": "https://registry.npmjs.org/@jest/fake-timers/-/fake-timers-29.5.0.tgz", + "integrity": "sha512-9ARvuAAQcBwDAqOnglWq2zwNIRUDtk/SCkp/ToGEhFv5r86K21l+VEs0qNTaXtyiY0lEePl3kylijSYJQqdbDg==", + "peer": true, + "dependencies": { + "@jest/types": "^29.5.0", + "@sinonjs/fake-timers": "^10.0.2", + "@types/node": "*", + "jest-message-util": "^29.5.0", + "jest-mock": "^29.5.0", + "jest-util": "^29.5.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/@jest/schemas": { + "version": "29.6.3", + "resolved": "https://registry.npmjs.org/@jest/schemas/-/schemas-29.6.3.tgz", + "integrity": "sha512-mo5j5X+jIZmJQveBKeS/clAueipV7KgiX1vMgCxam1RNYiqE1w62n0/tJJnHtjW8ZHcQco5gY85jA3mi0L+nSA==", + "dependencies": { + "@sinclair/typebox": "^0.27.8" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/@jest/types": { + "version": "29.5.0", + "resolved": "https://registry.npmjs.org/@jest/types/-/types-29.5.0.tgz", + "integrity": "sha512-qbu7kN6czmVRc3xWFQcAN03RAUamgppVUdXrvl1Wr3jlNF93o9mJbGcDWrwGB6ht44u7efB1qCFgVQmca24Uog==", + "dependencies": { + "@jest/schemas": "^29.4.3", + "@types/istanbul-lib-coverage": "^2.0.0", + "@types/istanbul-reports": "^3.0.0", + "@types/node": "*", + "@types/yargs": "^17.0.8", + "chalk": "^4.0.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/@jridgewell/gen-mapping": { + "version": "0.3.3", + "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.3.tgz", + "integrity": "sha512-HLhSWOLRi875zjjMG/r+Nv0oCW8umGb0BgEhyX3dDX3egwZtB8PqLnjz3yedt8R5StBrzcg4aBpnh8UA9D1BoQ==", + "dependencies": { + "@jridgewell/set-array": "^1.0.1", + "@jridgewell/sourcemap-codec": "^1.4.10", + "@jridgewell/trace-mapping": "^0.3.9" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@jridgewell/resolve-uri": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.0.tgz", + "integrity": "sha512-F2msla3tad+Mfht5cJq7LSXcdudKTWCVYUgw6pLFOOHSTtZlj6SWNYAp+AhuqLmWdBO2X5hPrLcu8cVP8fy28w==", + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@jridgewell/set-array": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@jridgewell/set-array/-/set-array-1.1.2.tgz", + "integrity": "sha512-xnkseuNADM0gt2bs+BvhO0p78Mk762YnZdsuzFV018NoG1Sj1SCQvpSqa7XUaTam5vAGasABV9qXASMKnFMwMw==", + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@jridgewell/source-map": { + "version": "0.3.3", + "resolved": "https://registry.npmjs.org/@jridgewell/source-map/-/source-map-0.3.3.tgz", + "integrity": "sha512-b+fsZXeLYi9fEULmfBrhxn4IrPlINf8fiNarzTof004v3lFdntdwa9PF7vFJqm3mg7s+ScJMxXaE3Acp1irZcg==", + "peer": true, + "dependencies": { + "@jridgewell/gen-mapping": "^0.3.0", + "@jridgewell/trace-mapping": "^0.3.9" + } + }, + "node_modules/@jridgewell/sourcemap-codec": { + "version": "1.4.15", + "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.15.tgz", + "integrity": "sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg==" + }, + "node_modules/@jridgewell/trace-mapping": { + "version": "0.3.18", + "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.18.tgz", + "integrity": "sha512-w+niJYzMHdd7USdiH2U6869nqhD2nbfZXND5Yp93qIbEmnDNk7PD48o+YchRVpzMU7M6jVCbenTR7PA1FLQ9pA==", + "dependencies": { + "@jridgewell/resolve-uri": "3.1.0", + "@jridgewell/sourcemap-codec": "1.4.14" + } + }, + "node_modules/@jridgewell/trace-mapping/node_modules/@jridgewell/sourcemap-codec": { + "version": "1.4.14", + "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.14.tgz", + "integrity": "sha512-XPSJHWmi394fuUuzDnGz1wiKqWfo1yXecHQMRf2l6hztTO+nPru658AyDngaBe7isIxEkRsPR3FZh+s7iVa4Uw==" + }, + "node_modules/@nodelib/fs.scandir": { + "version": "2.1.5", + "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", + "integrity": "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==", + "dev": true, + "dependencies": { + "@nodelib/fs.stat": "2.0.5", + "run-parallel": "^1.1.9" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/@nodelib/fs.stat": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz", + "integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==", + "dev": true, + "engines": { + "node": ">= 8" + } + }, + "node_modules/@nodelib/fs.walk": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz", + "integrity": "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==", + "dev": true, + "dependencies": { + "@nodelib/fs.scandir": "2.1.5", + "fastq": "^1.6.0" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/@react-native-community/cli": { + "version": "11.3.7", + "resolved": "https://registry.npmjs.org/@react-native-community/cli/-/cli-11.3.7.tgz", + "integrity": "sha512-Ou8eDlF+yh2rzXeCTpMPYJ2fuqsusNOhmpYPYNQJQ2h6PvaF30kPomflgRILems+EBBuggRtcT+I+1YH4o/q6w==", + "peer": true, + "dependencies": { + "@react-native-community/cli-clean": "11.3.7", + "@react-native-community/cli-config": "11.3.7", + "@react-native-community/cli-debugger-ui": "11.3.7", + "@react-native-community/cli-doctor": "11.3.7", + "@react-native-community/cli-hermes": "11.3.7", + "@react-native-community/cli-plugin-metro": "11.3.7", + "@react-native-community/cli-server-api": "11.3.7", + "@react-native-community/cli-tools": "11.3.7", + "@react-native-community/cli-types": "11.3.7", + "chalk": "^4.1.2", + "commander": "^9.4.1", + "execa": "^5.0.0", + "find-up": "^4.1.0", + "fs-extra": "^8.1.0", + "graceful-fs": "^4.1.3", + "prompts": "^2.4.0", + "semver": "^7.5.2" + }, + "bin": { + "react-native": "build/bin.js" + }, + "engines": { + "node": ">=16" + } + }, + "node_modules/@react-native-community/cli-clean": { + "version": "11.3.7", + "resolved": "https://registry.npmjs.org/@react-native-community/cli-clean/-/cli-clean-11.3.7.tgz", + "integrity": "sha512-twtsv54ohcRyWVzPXL3F9VHGb4Qhn3slqqRs3wEuRzjR7cTmV2TIO2b1VhaqF4HlCgNd+cGuirvLtK2JJyaxMg==", + "peer": true, + "dependencies": { + "@react-native-community/cli-tools": "11.3.7", + "chalk": "^4.1.2", + "execa": "^5.0.0", + "prompts": "^2.4.0" + } + }, + "node_modules/@react-native-community/cli-config": { + "version": "11.3.7", + "resolved": "https://registry.npmjs.org/@react-native-community/cli-config/-/cli-config-11.3.7.tgz", + "integrity": "sha512-FDBLku9xskS+bx0YFJFLCmUJhEZ4/MMSC9qPYOGBollWYdgE7k/TWI0IeYFmMALAnbCdKQAYP5N29N55Tad8lg==", + "peer": true, + "dependencies": { + "@react-native-community/cli-tools": "11.3.7", + "chalk": "^4.1.2", + "cosmiconfig": "^5.1.0", + "deepmerge": "^4.3.0", + "glob": "^7.1.3", + "joi": "^17.2.1" + } + }, + "node_modules/@react-native-community/cli-debugger-ui": { + "version": "11.3.7", + "resolved": "https://registry.npmjs.org/@react-native-community/cli-debugger-ui/-/cli-debugger-ui-11.3.7.tgz", + "integrity": "sha512-aVmKuPKHZENR8SrflkMurZqeyLwbKieHdOvaZCh1Nn/0UC5CxWcyST2DB2XQboZwsvr3/WXKJkSUO+SZ1J9qTQ==", + "peer": true, + "dependencies": { + "serve-static": "^1.13.1" + } + }, + "node_modules/@react-native-community/cli-doctor": { + "version": "11.3.7", + "resolved": "https://registry.npmjs.org/@react-native-community/cli-doctor/-/cli-doctor-11.3.7.tgz", + "integrity": "sha512-YEHUqWISOHnsl5+NM14KHelKh68Sr5/HeEZvvNdIcvcKtZic3FU7Xd1WcbNdo3gCq5JvzGFfufx02Tabh5zmrg==", + "peer": true, + "dependencies": { + "@react-native-community/cli-config": "11.3.7", + "@react-native-community/cli-platform-android": "11.3.7", + "@react-native-community/cli-platform-ios": "11.3.7", + "@react-native-community/cli-tools": "11.3.7", + "chalk": "^4.1.2", + "command-exists": "^1.2.8", + "envinfo": "^7.7.2", + "execa": "^5.0.0", + "hermes-profile-transformer": "^0.0.6", + "ip": "^1.1.5", + "node-stream-zip": "^1.9.1", + "ora": "^5.4.1", + "prompts": "^2.4.0", + "semver": "^7.5.2", + "strip-ansi": "^5.2.0", + "sudo-prompt": "^9.0.0", + "wcwidth": "^1.0.1", + "yaml": "^2.2.1" + } + }, + "node_modules/@react-native-community/cli-doctor/node_modules/lru-cache": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", + "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", + "peer": true, + "dependencies": { + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/@react-native-community/cli-doctor/node_modules/semver": { + "version": "7.6.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.0.tgz", + "integrity": "sha512-EnwXhrlwXMk9gKu5/flx5sv/an57AkRplG3hTK68W7FRDN+k+OWBj65M7719OkA82XLBxrcX0KSHj+X5COhOVg==", + "peer": true, + "dependencies": { + "lru-cache": "^6.0.0" + }, + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/@react-native-community/cli-doctor/node_modules/yallist": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", + "peer": true + }, + "node_modules/@react-native-community/cli-doctor/node_modules/yaml": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.4.2.tgz", + "integrity": "sha512-B3VqDZ+JAg1nZpaEmWtTXUlBneoGx6CPM9b0TENK6aoSu5t73dItudwdgmi6tHlIZZId4dZ9skcAQ2UbcyAeVA==", + "peer": true, + "bin": { + "yaml": "bin.mjs" + }, + "engines": { + "node": ">= 14" + } + }, + "node_modules/@react-native-community/cli-hermes": { + "version": "11.3.7", + "resolved": "https://registry.npmjs.org/@react-native-community/cli-hermes/-/cli-hermes-11.3.7.tgz", + "integrity": "sha512-chkKd8n/xeZkinRvtH6QcYA8rjNOKU3S3Lw/3Psxgx+hAYV0Gyk95qJHTalx7iu+PwjOOqqvCkJo5jCkYLkoqw==", + "peer": true, + "dependencies": { + "@react-native-community/cli-platform-android": "11.3.7", + "@react-native-community/cli-tools": "11.3.7", + "chalk": "^4.1.2", + "hermes-profile-transformer": "^0.0.6", + "ip": "^1.1.5" + } + }, + "node_modules/@react-native-community/cli-platform-android": { + "version": "11.3.7", + "resolved": "https://registry.npmjs.org/@react-native-community/cli-platform-android/-/cli-platform-android-11.3.7.tgz", + "integrity": "sha512-WGtXI/Rm178UQb8bu1TAeFC/RJvYGnbHpULXvE20GkmeJ1HIrMjkagyk6kkY3Ej25JAP2R878gv+TJ/XiRhaEg==", + "peer": true, + "dependencies": { + "@react-native-community/cli-tools": "11.3.7", + "chalk": "^4.1.2", + "execa": "^5.0.0", + "glob": "^7.1.3", + "logkitty": "^0.7.1" + } + }, + "node_modules/@react-native-community/cli-platform-ios": { + "version": "11.3.7", + "resolved": "https://registry.npmjs.org/@react-native-community/cli-platform-ios/-/cli-platform-ios-11.3.7.tgz", + "integrity": "sha512-Z/8rseBput49EldX7MogvN6zJlWzZ/4M97s2P+zjS09ZoBU7I0eOKLi0N9wx+95FNBvGQQ/0P62bB9UaFQH2jw==", + "peer": true, + "dependencies": { + "@react-native-community/cli-tools": "11.3.7", + "chalk": "^4.1.2", + "execa": "^5.0.0", + "fast-xml-parser": "^4.0.12", + "glob": "^7.1.3", + "ora": "^5.4.1" + } + }, + "node_modules/@react-native-community/cli-plugin-metro": { + "version": "11.3.7", + "resolved": "https://registry.npmjs.org/@react-native-community/cli-plugin-metro/-/cli-plugin-metro-11.3.7.tgz", + "integrity": "sha512-0WhgoBVGF1f9jXcuagQmtxpwpfP+2LbLZH4qMyo6OtYLWLG13n2uRep+8tdGzfNzl1bIuUTeE9yZSAdnf9LfYQ==", + "peer": true, + "dependencies": { + "@react-native-community/cli-server-api": "11.3.7", + "@react-native-community/cli-tools": "11.3.7", + "chalk": "^4.1.2", + "execa": "^5.0.0", + "metro": "0.76.8", + "metro-config": "0.76.8", + "metro-core": "0.76.8", + "metro-react-native-babel-transformer": "0.76.8", + "metro-resolver": "0.76.8", + "metro-runtime": "0.76.8", + "readline": "^1.3.0" + } + }, + "node_modules/@react-native-community/cli-server-api": { + "version": "11.3.7", + "resolved": "https://registry.npmjs.org/@react-native-community/cli-server-api/-/cli-server-api-11.3.7.tgz", + "integrity": "sha512-yoFyGdvR3HxCnU6i9vFqKmmSqFzCbnFSnJ29a+5dppgPRetN+d//O8ard/YHqHzToFnXutAFf2neONn23qcJAg==", + "peer": true, + "dependencies": { + "@react-native-community/cli-debugger-ui": "11.3.7", + "@react-native-community/cli-tools": "11.3.7", + "compression": "^1.7.1", + "connect": "^3.6.5", + "errorhandler": "^1.5.1", + "nocache": "^3.0.1", + "pretty-format": "^26.6.2", + "serve-static": "^1.13.1", + "ws": "^7.5.1" + } + }, + "node_modules/@react-native-community/cli-server-api/node_modules/@jest/types": { + "version": "26.6.2", + "resolved": "https://registry.npmjs.org/@jest/types/-/types-26.6.2.tgz", + "integrity": "sha512-fC6QCp7Sc5sX6g8Tvbmj4XUTbyrik0akgRy03yjXbQaBWWNWGE7SGtJk98m0N8nzegD/7SggrUlivxo5ax4KWQ==", + "peer": true, + "dependencies": { + "@types/istanbul-lib-coverage": "^2.0.0", + "@types/istanbul-reports": "^3.0.0", + "@types/node": "*", + "@types/yargs": "^15.0.0", + "chalk": "^4.0.0" + }, + "engines": { + "node": ">= 10.14.2" + } + }, + "node_modules/@react-native-community/cli-server-api/node_modules/@types/yargs": { + "version": "15.0.19", + "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-15.0.19.tgz", + "integrity": "sha512-2XUaGVmyQjgyAZldf0D0c14vvo/yv0MhQBSTJcejMMaitsn3nxCB6TmH4G0ZQf+uxROOa9mpanoSm8h6SG/1ZA==", + "peer": true, + "dependencies": { + "@types/yargs-parser": "*" + } + }, + "node_modules/@react-native-community/cli-server-api/node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "peer": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/@react-native-community/cli-server-api/node_modules/pretty-format": { + "version": "26.6.2", + "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-26.6.2.tgz", + "integrity": "sha512-7AeGuCYNGmycyQbCqd/3PWH4eOoX/OiCa0uphp57NVTeAGdJGaAliecxwBDHYQCIvrW7aDBZCYeNTP/WX69mkg==", + "peer": true, + "dependencies": { + "@jest/types": "^26.6.2", + "ansi-regex": "^5.0.0", + "ansi-styles": "^4.0.0", + "react-is": "^17.0.1" + }, + "engines": { + "node": ">= 10" + } + }, + "node_modules/@react-native-community/cli-server-api/node_modules/react-is": { + "version": "17.0.2", + "resolved": "https://registry.npmjs.org/react-is/-/react-is-17.0.2.tgz", + "integrity": "sha512-w2GsyukL62IJnlaff/nRegPQR94C/XXamvMWmSHRJ4y7Ts/4ocGRmTHvOs8PSE6pB3dWOrD/nueuU5sduBsQ4w==", + "peer": true + }, + "node_modules/@react-native-community/cli-server-api/node_modules/ws": { + "version": "7.5.9", + "resolved": "https://registry.npmjs.org/ws/-/ws-7.5.9.tgz", + "integrity": "sha512-F+P9Jil7UiSKSkppIiD94dN07AwvFixvLIj1Og1Rl9GGMuNipJnV9JzjD6XuqmAeiswGvUmNLjr5cFuXwNS77Q==", + "peer": true, + "engines": { + "node": ">=8.3.0" + }, + "peerDependencies": { + "bufferutil": "^4.0.1", + "utf-8-validate": "^5.0.2" + }, + "peerDependenciesMeta": { + "bufferutil": { + "optional": true + }, + "utf-8-validate": { + "optional": true + } + } + }, + "node_modules/@react-native-community/cli-tools": { + "version": "11.3.7", + "resolved": "https://registry.npmjs.org/@react-native-community/cli-tools/-/cli-tools-11.3.7.tgz", + "integrity": "sha512-peyhP4TV6Ps1hk+MBHTFaIR1eI3u+OfGBvr5r0wPwo3FAJvldRinMgcB/TcCcOBXVORu7ba1XYjkubPeYcqAyA==", + "peer": true, + "dependencies": { + "appdirsjs": "^1.2.4", + "chalk": "^4.1.2", + "find-up": "^5.0.0", + "mime": "^2.4.1", + "node-fetch": "^2.6.0", + "open": "^6.2.0", + "ora": "^5.4.1", + "semver": "^7.5.2", + "shell-quote": "^1.7.3" + } + }, + "node_modules/@react-native-community/cli-tools/node_modules/find-up": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", + "integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==", + "peer": true, + "dependencies": { + "locate-path": "^6.0.0", + "path-exists": "^4.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/@react-native-community/cli-tools/node_modules/locate-path": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", + "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==", + "peer": true, + "dependencies": { + "p-locate": "^5.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/@react-native-community/cli-tools/node_modules/lru-cache": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", + "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", + "peer": true, + "dependencies": { + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/@react-native-community/cli-tools/node_modules/p-limit": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", + "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", + "peer": true, + "dependencies": { + "yocto-queue": "^0.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/@react-native-community/cli-tools/node_modules/p-locate": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz", + "integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==", + "peer": true, + "dependencies": { + "p-limit": "^3.0.2" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/@react-native-community/cli-tools/node_modules/semver": { + "version": "7.6.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.0.tgz", + "integrity": "sha512-EnwXhrlwXMk9gKu5/flx5sv/an57AkRplG3hTK68W7FRDN+k+OWBj65M7719OkA82XLBxrcX0KSHj+X5COhOVg==", + "peer": true, + "dependencies": { + "lru-cache": "^6.0.0" + }, + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/@react-native-community/cli-tools/node_modules/yallist": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", + "peer": true + }, + "node_modules/@react-native-community/cli-types": { + "version": "11.3.7", + "resolved": "https://registry.npmjs.org/@react-native-community/cli-types/-/cli-types-11.3.7.tgz", + "integrity": "sha512-OhSr/TiDQkXjL5YOs8+hvGSB+HltLn5ZI0+A3DCiMsjUgTTsYh+Z63OtyMpNjrdCEFcg0MpfdU2uxstCS6Dc5g==", + "peer": true, + "dependencies": { + "joi": "^17.2.1" + } + }, + "node_modules/@react-native-community/cli/node_modules/lru-cache": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", + "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", + "peer": true, + "dependencies": { + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/@react-native-community/cli/node_modules/semver": { + "version": "7.6.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.0.tgz", + "integrity": "sha512-EnwXhrlwXMk9gKu5/flx5sv/an57AkRplG3hTK68W7FRDN+k+OWBj65M7719OkA82XLBxrcX0KSHj+X5COhOVg==", + "peer": true, + "dependencies": { + "lru-cache": "^6.0.0" + }, + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/@react-native-community/cli/node_modules/yallist": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", + "peer": true + }, + "node_modules/@react-native/assets-registry": { + "version": "0.72.0", + "resolved": "https://registry.npmjs.org/@react-native/assets-registry/-/assets-registry-0.72.0.tgz", + "integrity": "sha512-Im93xRJuHHxb1wniGhBMsxLwcfzdYreSZVQGDoMJgkd6+Iky61LInGEHnQCTN0fKNYF1Dvcofb4uMmE1RQHXHQ==", + "peer": true + }, + "node_modules/@react-native/gradle-plugin": { + "version": "0.72.11", + "resolved": "https://registry.npmjs.org/@react-native/gradle-plugin/-/gradle-plugin-0.72.11.tgz", + "integrity": "sha512-P9iRnxiR2w7EHcZ0mJ+fmbPzMby77ZzV6y9sJI3lVLJzF7TLSdbwcQyD3lwMsiL+q5lKUHoZJS4sYmih+P2HXw==", + "peer": true + }, + "node_modules/@react-native/js-polyfills": { + "version": "0.72.1", + "resolved": "https://registry.npmjs.org/@react-native/js-polyfills/-/js-polyfills-0.72.1.tgz", + "integrity": "sha512-cRPZh2rBswFnGt5X5EUEPs0r+pAsXxYsifv/fgy9ZLQokuT52bPH+9xjDR+7TafRua5CttGW83wP4TntRcWNDA==", + "peer": true + }, + "node_modules/@react-native/normalize-colors": { + "version": "0.72.0", + "resolved": "https://registry.npmjs.org/@react-native/normalize-colors/-/normalize-colors-0.72.0.tgz", + "integrity": "sha512-285lfdqSXaqKuBbbtP9qL2tDrfxdOFtIMvkKadtleRQkdOxx+uzGvFr82KHmc/sSiMtfXGp7JnFYWVh4sFl7Yw==", + "peer": true + }, + "node_modules/@react-native/virtualized-lists": { + "version": "0.72.8", + "resolved": "https://registry.npmjs.org/@react-native/virtualized-lists/-/virtualized-lists-0.72.8.tgz", + "integrity": "sha512-J3Q4Bkuo99k7mu+jPS9gSUSgq+lLRSI/+ahXNwV92XgJ/8UgOTxu2LPwhJnBk/sQKxq7E8WkZBnBiozukQMqrw==", + "peer": true, + "dependencies": { + "invariant": "^2.2.4", + "nullthrows": "^1.1.1" + }, + "peerDependencies": { + "react-native": "*" + } + }, + "node_modules/@sideway/address": { + "version": "4.1.5", + "resolved": "https://registry.npmjs.org/@sideway/address/-/address-4.1.5.tgz", + "integrity": "sha512-IqO/DUQHUkPeixNQ8n0JA6102hT9CmaljNTPmQ1u8MEhBo/R4Q8eKLN/vGZxuebwOroDB4cbpjheD4+/sKFK4Q==", + "peer": true, + "dependencies": { + "@hapi/hoek": "^9.0.0" + } + }, + "node_modules/@sideway/formula": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/@sideway/formula/-/formula-3.0.1.tgz", + "integrity": "sha512-/poHZJJVjx3L+zVD6g9KgHfYnb443oi7wLu/XKojDviHy6HOEOA6z1Trk5aR1dGcmPenJEgb2sK2I80LeS3MIg==", + "peer": true + }, + "node_modules/@sideway/pinpoint": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@sideway/pinpoint/-/pinpoint-2.0.0.tgz", + "integrity": "sha512-RNiOoTPkptFtSVzQevY/yWtZwf/RxyVnPy/OcA9HBM3MlGDnBEYL5B41H0MTn0Uec8Hi+2qUtTfG2WWZBmMejQ==", + "peer": true + }, + "node_modules/@sinclair/typebox": { + "version": "0.27.8", + "resolved": "https://registry.npmjs.org/@sinclair/typebox/-/typebox-0.27.8.tgz", + "integrity": "sha512-+Fj43pSMwJs4KRrH/938Uf+uAELIgVBmQzg/q1YG10djyfA3TnrU8N8XzqCh/okZdszqBQTZf96idMfE5lnwTA==" + }, + "node_modules/@sinonjs/commons": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@sinonjs/commons/-/commons-2.0.0.tgz", + "integrity": "sha512-uLa0j859mMrg2slwQYdO/AkrOfmH+X6LTVmNTS9CqexuE2IvVORIkSpJLqePAbEnKJ77aMmCwr1NUZ57120Xcg==", + "peer": true, + "dependencies": { + "type-detect": "4.0.8" + } + }, + "node_modules/@sinonjs/fake-timers": { + "version": "10.0.2", + "resolved": "https://registry.npmjs.org/@sinonjs/fake-timers/-/fake-timers-10.0.2.tgz", + "integrity": "sha512-SwUDyjWnah1AaNl7kxsa7cfLhlTYoiyhDAIgyh+El30YvXs/o7OLXpYH88Zdhyx9JExKrmHDJ+10bwIcY80Jmw==", + "peer": true, + "dependencies": { + "@sinonjs/commons": "^2.0.0" + } + }, + "node_modules/@tsconfig/react-native": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@tsconfig/react-native/-/react-native-3.0.0.tgz", + "integrity": "sha512-4NapbL5hywv83w0K7psaQnD15f7vOwrUkKZUxKYExqmkSPOg56+LkVbpCBuHYHJFoX3wyuau/tFxo1XFYogeUw==", + "dev": true + }, + "node_modules/@types/istanbul-lib-coverage": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/@types/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.4.tgz", + "integrity": "sha512-z/QT1XN4K4KYuslS23k62yDIDLwLFkzxOuMplDtObz0+y7VqJCaO2o+SPwHCvLFZh7xazvvoor2tA/hPz9ee7g==" + }, + "node_modules/@types/istanbul-lib-report": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@types/istanbul-lib-report/-/istanbul-lib-report-3.0.0.tgz", + "integrity": "sha512-plGgXAPfVKFoYfa9NpYDAkseG+g6Jr294RqeqcqDixSbU34MZVJRi/P+7Y8GDpzkEwLaGZZOpKIEmeVZNtKsrg==", + "dependencies": { + "@types/istanbul-lib-coverage": "*" + } + }, + "node_modules/@types/istanbul-reports": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/@types/istanbul-reports/-/istanbul-reports-3.0.1.tgz", + "integrity": "sha512-c3mAZEuK0lvBp8tmuL74XRKn1+y2dcwOUpH7x4WrF6gk1GIgiluDRgMYQtw2OFcBvAJWlt6ASU3tSqxp0Uu0Aw==", + "dependencies": { + "@types/istanbul-lib-report": "*" + } + }, + "node_modules/@types/jest": { + "version": "29.5.1", + "resolved": "https://registry.npmjs.org/@types/jest/-/jest-29.5.1.tgz", + "integrity": "sha512-tEuVcHrpaixS36w7hpsfLBLpjtMRJUE09/MHXn923LOVojDwyC14cWcfc0rDs0VEfUyYmt/+iX1kxxp+gZMcaQ==", + "dev": true, + "dependencies": { + "expect": "^29.0.0", + "pretty-format": "^29.0.0" + } + }, + "node_modules/@types/node": { + "version": "20.1.2", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.1.2.tgz", + "integrity": "sha512-CTO/wa8x+rZU626cL2BlbCDzydgnFNgc19h4YvizpTO88MFQxab8wqisxaofQJ/9bLGugRdWIuX/TbIs6VVF6g==" + }, + "node_modules/@types/parse-json": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/@types/parse-json/-/parse-json-4.0.0.tgz", + "integrity": "sha512-//oorEZjL6sbPcKUaCdIGlIUeH26mgzimjBB77G6XRgnDl/L5wOnpyBGRe/Mmf5CVW3PwEBE1NjiMZ/ssFh4wA==", + "dev": true + }, + "node_modules/@types/prop-types": { + "version": "15.7.5", + "resolved": "https://registry.npmjs.org/@types/prop-types/-/prop-types-15.7.5.tgz", + "integrity": "sha512-JCB8C6SnDoQf0cNycqd/35A7MjcnK+ZTqE7judS6o7utxUCg6imJg3QK2qzHKszlTjcj2cn+NwMB2i96ubpj7w==", + "dev": true + }, + "node_modules/@types/react": { + "version": "18.2.6", + "resolved": "https://registry.npmjs.org/@types/react/-/react-18.2.6.tgz", + "integrity": "sha512-wRZClXn//zxCFW+ye/D2qY65UsYP1Fpex2YXorHc8awoNamkMZSvBxwxdYVInsHOZZd2Ppq8isnSzJL5Mpf8OA==", + "dev": true, + "dependencies": { + "@types/prop-types": "*", + "@types/scheduler": "*", + "csstype": "^3.0.2" + } + }, + "node_modules/@types/react-native": { + "version": "0.71.7", + "resolved": "https://registry.npmjs.org/@types/react-native/-/react-native-0.71.7.tgz", + "integrity": "sha512-SYlf5Vw2qX4qDQfdcCEdfskoMG6yn0T/jWwvBNR1xZJ3qEobcGNHuOTZQdfu4TNK+VFkH5rSXZraRlio1/bvcA==", + "dev": true, + "dependencies": { + "@types/react": "*" + } + }, + "node_modules/@types/scheduler": { + "version": "0.16.3", + "resolved": "https://registry.npmjs.org/@types/scheduler/-/scheduler-0.16.3.tgz", + "integrity": "sha512-5cJ8CB4yAx7BH1oMvdU0Jh9lrEXyPkar6F9G/ERswkCuvP4KQZfZkSjcMbAICCpQTN4OuZn8tz0HiKv9TGZgrQ==", + "dev": true + }, + "node_modules/@types/stack-utils": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/@types/stack-utils/-/stack-utils-2.0.1.tgz", + "integrity": "sha512-Hl219/BT5fLAaz6NDkSuhzasy49dwQS/DSdu4MdggFB8zcXv7vflBI3xp7FEmkmdDkBUI2bPUNeMttp2knYdxw==" + }, + "node_modules/@types/yargs": { + "version": "17.0.24", + "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-17.0.24.tgz", + "integrity": "sha512-6i0aC7jV6QzQB8ne1joVZ0eSFIstHsCrobmOtghM11yGlH0j43FKL2UhWdELkyps0zuf7qVTUVCCR+tgSlyLLw==", + "dependencies": { + "@types/yargs-parser": "*" + } + }, + "node_modules/@types/yargs-parser": { + "version": "21.0.0", + "resolved": "https://registry.npmjs.org/@types/yargs-parser/-/yargs-parser-21.0.0.tgz", + "integrity": "sha512-iO9ZQHkZxHn4mSakYV0vFHAVDyEOIJQrV2uZ06HxEPcx+mt8swXoZHIbaaJ2crJYFfErySgktuTZ3BeLz+XmFA==" + }, + "node_modules/abort-controller": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/abort-controller/-/abort-controller-3.0.0.tgz", + "integrity": "sha512-h8lQ8tacZYnR3vNQTgibj+tODHI5/+l06Au2Pcriv/Gmet0eaj4TwWH41sO9wnHDiQsEj19q0drzdWdeAHtweg==", + "peer": true, + "dependencies": { + "event-target-shim": "^5.0.0" + }, + "engines": { + "node": ">=6.5" + } + }, + "node_modules/accepts": { + "version": "1.3.8", + "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.8.tgz", + "integrity": "sha512-PYAthTa2m2VKxuvSD3DPC/Gy+U+sOA1LAuT8mkmRuvw+NACSaeXEQ+NHcVF7rONl6qcaxV3Uuemwawk+7+SJLw==", + "peer": true, + "dependencies": { + "mime-types": "~2.1.34", + "negotiator": "0.6.3" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/acorn": { + "version": "8.8.2", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.8.2.tgz", + "integrity": "sha512-xjIYgE8HBrkpd/sJqOGNspf8uHG+NOHGOw6a/Urj8taM2EXfdNAH2oFcPeIFfsv3+kz/mJrS5VuMqbNLjCa2vw==", + "peer": true, + "bin": { + "acorn": "bin/acorn" + }, + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/aggregate-error": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/aggregate-error/-/aggregate-error-3.1.0.tgz", + "integrity": "sha512-4I7Td01quW/RpocfNayFdFVk1qSuoh0E7JrbRJ16nH01HhKFQ88INq9Sd+nd72zqRySlr9BmDA8xlEJ6vJMrYA==", + "dev": true, + "dependencies": { + "clean-stack": "^2.0.0", + "indent-string": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/anser": { + "version": "1.4.10", + "resolved": "https://registry.npmjs.org/anser/-/anser-1.4.10.tgz", + "integrity": "sha512-hCv9AqTQ8ycjpSd3upOJd7vFwW1JaoYQ7tpham03GJ1ca8/65rqn0RpaWpItOAd6ylW9wAw6luXYPJIyPFVOww==", + "peer": true + }, + "node_modules/ansi-fragments": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/ansi-fragments/-/ansi-fragments-0.2.1.tgz", + "integrity": "sha512-DykbNHxuXQwUDRv5ibc2b0x7uw7wmwOGLBUd5RmaQ5z8Lhx19vwvKV+FAsM5rEA6dEcHxX+/Ad5s9eF2k2bB+w==", + "peer": true, + "dependencies": { + "colorette": "^1.0.7", + "slice-ansi": "^2.0.0", + "strip-ansi": "^5.0.0" + } + }, + "node_modules/ansi-regex": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.1.tgz", + "integrity": "sha512-ILlv4k/3f6vfQ4OoP2AGvirOktlQ98ZEL1k9FaQjxa3L1abBgbuTDAdPOpvbGncC0BTVQrl+OM8xZGK6tWXt7g==", + "peer": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/anymatch": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.3.tgz", + "integrity": "sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw==", + "peer": true, + "dependencies": { + "normalize-path": "^3.0.0", + "picomatch": "^2.0.4" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/appdirsjs": { + "version": "1.2.7", + "resolved": "https://registry.npmjs.org/appdirsjs/-/appdirsjs-1.2.7.tgz", + "integrity": "sha512-Quji6+8kLBC3NnBeo14nPDq0+2jUs5s3/xEye+udFHumHhRk4M7aAMXp/PBJqkKYGuuyR9M/6Dq7d2AViiGmhw==", + "peer": true + }, + "node_modules/argparse": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", + "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", + "peer": true, + "dependencies": { + "sprintf-js": "~1.0.2" + } + }, + "node_modules/array-union": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/array-union/-/array-union-2.1.0.tgz", + "integrity": "sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/asap": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/asap/-/asap-2.0.6.tgz", + "integrity": "sha512-BSHWgDSAiKs50o2Re8ppvp3seVHXSRM44cdSsT9FfNEUUZLOGWVCsiWaRPWM1Znn+mqZ1OfVZ3z3DWEzSp7hRA==", + "peer": true + }, + "node_modules/ast-types": { + "version": "0.15.2", + "resolved": "https://registry.npmjs.org/ast-types/-/ast-types-0.15.2.tgz", + "integrity": "sha512-c27loCv9QkZinsa5ProX751khO9DJl/AcB5c2KNtA6NRvHKS0PgLfcftz72KVq504vB0Gku5s2kUZzDBvQWvHg==", + "peer": true, + "dependencies": { + "tslib": "^2.0.1" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/astral-regex": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/astral-regex/-/astral-regex-1.0.0.tgz", + "integrity": "sha512-+Ryf6g3BKoRc7jfp7ad8tM4TtMiaWvbF/1/sQcZPkkS7ag3D5nMBCe2UfOTONtAkaG0tO0ij3C5Lwmf1EiyjHg==", + "peer": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/async": { + "version": "3.2.4", + "resolved": "https://registry.npmjs.org/async/-/async-3.2.4.tgz", + "integrity": "sha512-iAB+JbDEGXhyIUavoDl9WP/Jj106Kz9DEn1DPgYw5ruDn0e3Wgi3sKFm55sASdGBNOQB8F59d9qQ7deqrHA8wQ==", + "peer": true + }, + "node_modules/async-limiter": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/async-limiter/-/async-limiter-1.0.1.tgz", + "integrity": "sha512-csOlWGAcRFJaI6m+F2WKdnMKr4HhdhFVBk0H/QbJFMCr+uO2kwohwXQPxw/9OCxp05r5ghVBFSyioixx3gfkNQ==", + "peer": true + }, + "node_modules/babel-core": { + "version": "7.0.0-bridge.0", + "resolved": "https://registry.npmjs.org/babel-core/-/babel-core-7.0.0-bridge.0.tgz", + "integrity": "sha512-poPX9mZH/5CSanm50Q+1toVci6pv5KSRv/5TWCwtzQS5XEwn40BcCrgIeMFWP9CKKIniKXNxoIOnOq4VVlGXhg==", + "peer": true, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/babel-plugin-polyfill-corejs2": { + "version": "0.3.3", + "resolved": "https://registry.npmjs.org/babel-plugin-polyfill-corejs2/-/babel-plugin-polyfill-corejs2-0.3.3.tgz", + "integrity": "sha512-8hOdmFYFSZhqg2C/JgLUQ+t52o5nirNwaWM2B9LWteozwIvM14VSwdsCAUET10qT+kmySAlseadmfeeSWFCy+Q==", + "dependencies": { + "@babel/compat-data": "^7.17.7", + "@babel/helper-define-polyfill-provider": "^0.3.3", + "semver": "^6.1.1" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/babel-plugin-polyfill-corejs3": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/babel-plugin-polyfill-corejs3/-/babel-plugin-polyfill-corejs3-0.6.0.tgz", + "integrity": "sha512-+eHqR6OPcBhJOGgsIar7xoAB1GcSwVUA3XjAd7HJNzOXT4wv6/H7KIdA/Nc60cvUlDbKApmqNvD1B1bzOt4nyA==", + "dependencies": { + "@babel/helper-define-polyfill-provider": "^0.3.3", + "core-js-compat": "^3.25.1" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/babel-plugin-polyfill-regenerator": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/babel-plugin-polyfill-regenerator/-/babel-plugin-polyfill-regenerator-0.4.1.tgz", + "integrity": "sha512-NtQGmyQDXjQqQ+IzRkBVwEOz9lQ4zxAQZgoAYEtU9dJjnl1Oc98qnN7jcp+bE7O7aYzVpavXE3/VKXNzUbh7aw==", + "dependencies": { + "@babel/helper-define-polyfill-provider": "^0.3.3" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/babel-plugin-syntax-trailing-function-commas": { + "version": "7.0.0-beta.0", + "resolved": "https://registry.npmjs.org/babel-plugin-syntax-trailing-function-commas/-/babel-plugin-syntax-trailing-function-commas-7.0.0-beta.0.tgz", + "integrity": "sha512-Xj9XuRuz3nTSbaTXWv3itLOcxyF4oPD8douBBmj7U9BBC6nEBYfyOJYQMf/8PJAFotC62UY5dFfIGEPr7WswzQ==", + "peer": true + }, + "node_modules/babel-plugin-transform-flow-enums": { + "version": "0.0.2", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-flow-enums/-/babel-plugin-transform-flow-enums-0.0.2.tgz", + "integrity": "sha512-g4aaCrDDOsWjbm0PUUeVnkcVd6AKJsVc/MbnPhEotEpkeJQP6b8nzewohQi7+QS8UyPehOhGWn0nOwjvWpmMvQ==", + "peer": true, + "dependencies": { + "@babel/plugin-syntax-flow": "^7.12.1" + } + }, + "node_modules/babel-preset-fbjs": { + "version": "3.4.0", + "resolved": "https://registry.npmjs.org/babel-preset-fbjs/-/babel-preset-fbjs-3.4.0.tgz", + "integrity": "sha512-9ywCsCvo1ojrw0b+XYk7aFvTH6D9064t0RIL1rtMf3nsa02Xw41MS7sZw216Im35xj/UY0PDBQsa1brUDDF1Ow==", + "peer": true, + "dependencies": { + "@babel/plugin-proposal-class-properties": "^7.0.0", + "@babel/plugin-proposal-object-rest-spread": "^7.0.0", + "@babel/plugin-syntax-class-properties": "^7.0.0", + "@babel/plugin-syntax-flow": "^7.0.0", + "@babel/plugin-syntax-jsx": "^7.0.0", + "@babel/plugin-syntax-object-rest-spread": "^7.0.0", + "@babel/plugin-transform-arrow-functions": "^7.0.0", + "@babel/plugin-transform-block-scoped-functions": "^7.0.0", + "@babel/plugin-transform-block-scoping": "^7.0.0", + "@babel/plugin-transform-classes": "^7.0.0", + "@babel/plugin-transform-computed-properties": "^7.0.0", + "@babel/plugin-transform-destructuring": "^7.0.0", + "@babel/plugin-transform-flow-strip-types": "^7.0.0", + "@babel/plugin-transform-for-of": "^7.0.0", + "@babel/plugin-transform-function-name": "^7.0.0", + "@babel/plugin-transform-literals": "^7.0.0", + "@babel/plugin-transform-member-expression-literals": "^7.0.0", + "@babel/plugin-transform-modules-commonjs": "^7.0.0", + "@babel/plugin-transform-object-super": "^7.0.0", + "@babel/plugin-transform-parameters": "^7.0.0", + "@babel/plugin-transform-property-literals": "^7.0.0", + "@babel/plugin-transform-react-display-name": "^7.0.0", + "@babel/plugin-transform-react-jsx": "^7.0.0", + "@babel/plugin-transform-shorthand-properties": "^7.0.0", + "@babel/plugin-transform-spread": "^7.0.0", + "@babel/plugin-transform-template-literals": "^7.0.0", + "babel-plugin-syntax-trailing-function-commas": "^7.0.0-beta.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0" + } + }, + "node_modules/balanced-match": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", + "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==" + }, + "node_modules/base64-js": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz", + "integrity": "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "peer": true + }, + "node_modules/bl": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/bl/-/bl-4.1.0.tgz", + "integrity": "sha512-1W07cM9gS6DcLperZfFSj+bWLtaPGSOHWhPiGzXmvVJbRLdG82sH/Kn8EtW1VqWVA54AKf2h5k5BbnIbwF3h6w==", + "peer": true, + "dependencies": { + "buffer": "^5.5.0", + "inherits": "^2.0.4", + "readable-stream": "^3.4.0" + } + }, + "node_modules/boolbase": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/boolbase/-/boolbase-1.0.0.tgz", + "integrity": "sha512-JZOSA7Mo9sNGB8+UjSgzdLtokWAky1zbztM3WRLCbZ70/3cTANmQmOdR7y2g+J0e2WXywy1yS468tY+IruqEww==", + "peer": true + }, + "node_modules/brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "node_modules/braces": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", + "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", + "dependencies": { + "fill-range": "^7.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/browserslist": { + "version": "4.21.5", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.21.5.tgz", + "integrity": "sha512-tUkiguQGW7S3IhB7N+c2MV/HZPSCPAAiYBZXLsBhFB/PCy6ZKKsZrmBayHV9fdGV/ARIfJ14NkxKzRDjvp7L6w==", + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/browserslist" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/browserslist" + } + ], + "dependencies": { + "caniuse-lite": "^1.0.30001449", + "electron-to-chromium": "^1.4.284", + "node-releases": "^2.0.8", + "update-browserslist-db": "^1.0.10" + }, + "bin": { + "browserslist": "cli.js" + }, + "engines": { + "node": "^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7" + } + }, + "node_modules/bser": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/bser/-/bser-2.1.1.tgz", + "integrity": "sha512-gQxTNE/GAfIIrmHLUE3oJyp5FO6HRBfhjnw4/wMmA63ZGDJnWBmgY/lyQBpnDUkGmAhbSe39tx2d/iTOAfglwQ==", + "peer": true, + "dependencies": { + "node-int64": "^0.4.0" + } + }, + "node_modules/buffer": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/buffer/-/buffer-5.7.1.tgz", + "integrity": "sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "peer": true, + "dependencies": { + "base64-js": "^1.3.1", + "ieee754": "^1.1.13" + } + }, + "node_modules/buffer-from": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.2.tgz", + "integrity": "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==", + "peer": true + }, + "node_modules/bytes": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.0.0.tgz", + "integrity": "sha512-pMhOfFDPiv9t5jjIXkHosWmkSyQbvsgEVNkz0ERHbuLh2T/7j4Mqqpz523Fe8MVY89KC6Sh/QfS2sM+SjgFDcw==", + "peer": true, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/caller-callsite": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/caller-callsite/-/caller-callsite-2.0.0.tgz", + "integrity": "sha512-JuG3qI4QOftFsZyOn1qq87fq5grLIyk1JYd5lJmdA+fG7aQ9pA/i3JIJGcO3q0MrRcHlOt1U+ZeHW8Dq9axALQ==", + "peer": true, + "dependencies": { + "callsites": "^2.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/caller-path": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/caller-path/-/caller-path-2.0.0.tgz", + "integrity": "sha512-MCL3sf6nCSXOwCTzvPKhN18TU7AHTvdtam8DAogxcrJ8Rjfbbg7Lgng64H9Iy+vUV6VGFClN/TyxBkAebLRR4A==", + "peer": true, + "dependencies": { + "caller-callsite": "^2.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/callsites": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/callsites/-/callsites-2.0.0.tgz", + "integrity": "sha512-ksWePWBloaWPxJYQ8TL0JHvtci6G5QTKwQ95RcWAa/lzoAKuAOflGdAK92hpHXjkwb8zLxoLNUoNYZgVsaJzvQ==", + "peer": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/camelcase": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-6.3.0.tgz", + "integrity": "sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA==", + "peer": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/caniuse-lite": { + "version": "1.0.30001486", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001486.tgz", + "integrity": "sha512-uv7/gXuHi10Whlj0pp5q/tsK/32J2QSqVRKQhs2j8VsDCjgyruAh/eEXHF822VqO9yT6iZKw3nRwZRSPBE9OQg==", + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/browserslist" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/caniuse-lite" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ] + }, + "node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/ci-info": { + "version": "3.8.0", + "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-3.8.0.tgz", + "integrity": "sha512-eXTggHWSooYhq49F2opQhuHWgzucfF2YgODK4e1566GQs5BIfP30B0oenwBJHfWxAs2fyPB1s7Mg949zLf61Yw==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/sibiraj-s" + } + ], + "engines": { + "node": ">=8" + } + }, + "node_modules/clean-stack": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/clean-stack/-/clean-stack-2.2.0.tgz", + "integrity": "sha512-4diC9HaTE+KRAMWhDhrGOECgWZxoevMc5TlkObMqNSsVU62PYzXZ/SMTjzyGAFF1YusgxGcSWTEXBhp0CPwQ1A==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/cli-cursor": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-3.1.0.tgz", + "integrity": "sha512-I/zHAwsKf9FqGoXM4WWRACob9+SNukZTd94DWF57E4toouRulbCxcUh6RKUEOQlYTHJnzkPMySvPNaaSLNfLZw==", + "peer": true, + "dependencies": { + "restore-cursor": "^3.1.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/cli-spinners": { + "version": "2.9.2", + "resolved": "https://registry.npmjs.org/cli-spinners/-/cli-spinners-2.9.2.tgz", + "integrity": "sha512-ywqV+5MmyL4E7ybXgKys4DugZbX0FC6LnwrhjuykIjnK9k8OQacQ7axGKnjDXWNhns0xot3bZI5h55H8yo9cJg==", + "peer": true, + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/cliui": { + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-8.0.1.tgz", + "integrity": "sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==", + "dependencies": { + "string-width": "^4.2.0", + "strip-ansi": "^6.0.1", + "wrap-ansi": "^7.0.0" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/cliui/node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "engines": { + "node": ">=8" + } + }, + "node_modules/cliui/node_modules/strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/clone": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/clone/-/clone-1.0.4.tgz", + "integrity": "sha512-JQHZ2QMW6l3aH/j6xCqQThY/9OH4D/9ls34cgkUBiEeocRTU04tHfKPBsUK1PqZCUQM7GiA0IIXJSuXHI64Kbg==", + "peer": true, + "engines": { + "node": ">=0.8" + } + }, + "node_modules/clone-deep": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/clone-deep/-/clone-deep-4.0.1.tgz", + "integrity": "sha512-neHB9xuzh/wk0dIHweyAXv2aPGZIVk3pLMe+/RNzINf17fe0OG96QroktYAUm7SM1PBnzTabaLboqqxDyMU+SQ==", + "peer": true, + "dependencies": { + "is-plain-object": "^2.0.4", + "kind-of": "^6.0.2", + "shallow-clone": "^3.0.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==" + }, + "node_modules/colorette": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/colorette/-/colorette-1.4.0.tgz", + "integrity": "sha512-Y2oEozpomLn7Q3HFP7dpww7AtMJplbM9lGZP6RDfHqmbeRjiwRg4n6VM6j4KLmRke85uWEI7JqF17f3pqdRA0g==", + "peer": true + }, + "node_modules/command-exists": { + "version": "1.2.9", + "resolved": "https://registry.npmjs.org/command-exists/-/command-exists-1.2.9.tgz", + "integrity": "sha512-LTQ/SGc+s0Xc0Fu5WaKnR0YiygZkm9eKFvyS+fRsU7/ZWFF8ykFM6Pc9aCVf1+xasOOZpO3BAVgVrKvsqKHV7w==", + "peer": true + }, + "node_modules/commander": { + "version": "9.5.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-9.5.0.tgz", + "integrity": "sha512-KRs7WVDKg86PWiuAqhDrAQnTXZKraVcCc6vFdL14qrZ/DcWwuRo7VoiYXalXO7S5GKpqYiVEwCbgFDfxNHKJBQ==", + "peer": true, + "engines": { + "node": "^12.20.0 || >=14" + } + }, + "node_modules/commondir": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/commondir/-/commondir-1.0.1.tgz", + "integrity": "sha512-W9pAhw0ja1Edb5GVdIF1mjZw/ASI0AlShXM83UUGe2DVr5TdAPEA1OA8m/g8zWp9x6On7gqufY+FatDbC3MDQg==", + "peer": true + }, + "node_modules/compressible": { + "version": "2.0.18", + "resolved": "https://registry.npmjs.org/compressible/-/compressible-2.0.18.tgz", + "integrity": "sha512-AF3r7P5dWxL8MxyITRMlORQNaOA2IkAFaTr4k7BUumjPtRpGDTZpl0Pb1XCO6JeDCBdp126Cgs9sMxqSjgYyRg==", + "peer": true, + "dependencies": { + "mime-db": ">= 1.43.0 < 2" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/compression": { + "version": "1.7.4", + "resolved": "https://registry.npmjs.org/compression/-/compression-1.7.4.tgz", + "integrity": "sha512-jaSIDzP9pZVS4ZfQ+TzvtiWhdpFhE2RDHz8QJkpX9SIpLq88VueF5jJw6t+6CUQcAoA6t+x89MLrWAqpfDE8iQ==", + "peer": true, + "dependencies": { + "accepts": "~1.3.5", + "bytes": "3.0.0", + "compressible": "~2.0.16", + "debug": "2.6.9", + "on-headers": "~1.0.2", + "safe-buffer": "5.1.2", + "vary": "~1.1.2" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/concat-map": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==" + }, + "node_modules/connect": { + "version": "3.7.0", + "resolved": "https://registry.npmjs.org/connect/-/connect-3.7.0.tgz", + "integrity": "sha512-ZqRXc+tZukToSNmh5C2iWMSoV3X1YUcPbqEM4DkEG5tNQXrQUZCNVGGv3IuicnkMtPfGf3Xtp8WCXs295iQ1pQ==", + "peer": true, + "dependencies": { + "debug": "2.6.9", + "finalhandler": "1.1.2", + "parseurl": "~1.3.3", + "utils-merge": "1.0.1" + }, + "engines": { + "node": ">= 0.10.0" + } + }, + "node_modules/convert-source-map": { + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.9.0.tgz", + "integrity": "sha512-ASFBup0Mz1uyiIjANan1jzLQami9z1PoYSZCiiYW2FczPbenXc45FZdBZLzOT+r6+iciuEModtmCti+hjaAk0A==" + }, + "node_modules/core-js-compat": { + "version": "3.30.2", + "resolved": "https://registry.npmjs.org/core-js-compat/-/core-js-compat-3.30.2.tgz", + "integrity": "sha512-nriW1nuJjUgvkEjIot1Spwakz52V9YkYHZAQG6A1eCgC8AA1p0zngrQEP9R0+V6hji5XilWKG1Bd0YRppmGimA==", + "dependencies": { + "browserslist": "^4.21.5" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/core-js" + } + }, + "node_modules/core-util-is": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.3.tgz", + "integrity": "sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==", + "peer": true + }, + "node_modules/cosmiconfig": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-5.2.1.tgz", + "integrity": "sha512-H65gsXo1SKjf8zmrJ67eJk8aIRKV5ff2D4uKZIBZShbhGSpEmsQOPW/SKMKYhSTrqR7ufy6RP69rPogdaPh/kA==", + "peer": true, + "dependencies": { + "import-fresh": "^2.0.0", + "is-directory": "^0.3.1", + "js-yaml": "^3.13.1", + "parse-json": "^4.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/cross-spawn": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", + "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", + "dependencies": { + "path-key": "^3.1.0", + "shebang-command": "^2.0.0", + "which": "^2.0.1" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/css-select": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/css-select/-/css-select-5.1.0.tgz", + "integrity": "sha512-nwoRF1rvRRnnCqqY7updORDsuqKzqYJ28+oSMaJMMgOauh3fvwHqMS7EZpIPqK8GL+g9mKxF1vP/ZjSeNjEVHg==", + "peer": true, + "dependencies": { + "boolbase": "^1.0.0", + "css-what": "^6.1.0", + "domhandler": "^5.0.2", + "domutils": "^3.0.1", + "nth-check": "^2.0.1" + }, + "funding": { + "url": "https://github.com/sponsors/fb55" + } + }, + "node_modules/css-tree": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/css-tree/-/css-tree-1.1.3.tgz", + "integrity": "sha512-tRpdppF7TRazZrjJ6v3stzv93qxRcSsFmW6cX0Zm2NVKpxE1WV1HblnghVv9TreireHkqI/VDEsfolRF1p6y7Q==", + "peer": true, + "dependencies": { + "mdn-data": "2.0.14", + "source-map": "^0.6.1" + }, + "engines": { + "node": ">=8.0.0" + } + }, + "node_modules/css-tree/node_modules/source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "peer": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/css-what": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/css-what/-/css-what-6.1.0.tgz", + "integrity": "sha512-HTUrgRJ7r4dsZKU6GjmpfRK1O76h97Z8MfS1G0FozR+oF2kG6Vfe8JE6zwrkbxigziPHinCJ+gCPjA9EaBDtRw==", + "peer": true, + "engines": { + "node": ">= 6" + }, + "funding": { + "url": "https://github.com/sponsors/fb55" + } + }, + "node_modules/csstype": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/csstype/-/csstype-3.1.2.tgz", + "integrity": "sha512-I7K1Uu0MBPzaFKg4nI5Q7Vs2t+3gWWW648spaF+Rg7pI9ds18Ugn+lvg4SHczUdKlHI5LWBXyqfS8+DufyBsgQ==", + "dev": true + }, + "node_modules/dayjs": { + "version": "1.11.11", + "resolved": "https://registry.npmjs.org/dayjs/-/dayjs-1.11.11.tgz", + "integrity": "sha512-okzr3f11N6WuqYtZSvm+F776mB41wRZMhKP+hc34YdW+KmtYYK9iqvHSwo2k9FEH3fhGXvOPV6yz2IcSrfRUDg==", + "peer": true + }, + "node_modules/debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "peer": true, + "dependencies": { + "ms": "2.0.0" + } + }, + "node_modules/decamelize": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz", + "integrity": "sha512-z2S+W9X73hAUUki+N+9Za2lBlun89zigOyGrsax+KUQ6wKW4ZoWpEYBkGhQjwAjjDCkWxhY0VKEhk8wzY7F5cA==", + "peer": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/dedent": { + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/dedent/-/dedent-0.7.0.tgz", + "integrity": "sha512-Q6fKUPqnAHAyhiUgFU7BUzLiv0kd8saH9al7tnu5Q/okj6dnupxyTgFIBjVzJATdfIAm9NAsvXNzjaKa+bxVyA==", + "dev": true + }, + "node_modules/deepmerge": { + "version": "4.3.1", + "resolved": "https://registry.npmjs.org/deepmerge/-/deepmerge-4.3.1.tgz", + "integrity": "sha512-3sUqbMEc77XqpdNO7FRyRog+eW3ph+GYCbj+rK+uYyRMuwsVy0rMiVtPn+QJlKFvWP/1PYpapqYn0Me2knFn+A==", + "peer": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/defaults": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/defaults/-/defaults-1.0.4.tgz", + "integrity": "sha512-eFuaLoy/Rxalv2kr+lqMlUnrDWV+3j4pljOIJgLIhI058IQfWJ7vXhyEIHu+HtC738klGALYxOKDO0bQP3tg8A==", + "peer": true, + "dependencies": { + "clone": "^1.0.2" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/del": { + "version": "6.1.1", + "resolved": "https://registry.npmjs.org/del/-/del-6.1.1.tgz", + "integrity": "sha512-ua8BhapfP0JUJKC/zV9yHHDW/rDoDxP4Zhn3AkA6/xT6gY7jYXJiaeyBZznYVujhZZET+UgcbZiQ7sN3WqcImg==", + "dev": true, + "dependencies": { + "globby": "^11.0.1", + "graceful-fs": "^4.2.4", + "is-glob": "^4.0.1", + "is-path-cwd": "^2.2.0", + "is-path-inside": "^3.0.2", + "p-map": "^4.0.0", + "rimraf": "^3.0.2", + "slash": "^3.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/denodeify": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/denodeify/-/denodeify-1.2.1.tgz", + "integrity": "sha512-KNTihKNmQENUZeKu5fzfpzRqR5S2VMp4gl9RFHiWzj9DfvYQPMJ6XHKNaQxaGCXwPk6y9yme3aUoaiAe+KX+vg==", + "peer": true + }, + "node_modules/depd": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz", + "integrity": "sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==", + "peer": true, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/deprecated-react-native-prop-types": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/deprecated-react-native-prop-types/-/deprecated-react-native-prop-types-4.1.0.tgz", + "integrity": "sha512-WfepZHmRbbdTvhcolb8aOKEvQdcmTMn5tKLbqbXmkBvjFjRVWAYqsXk/DBsV8TZxws8SdGHLuHaJrHSQUPRdfw==", + "peer": true, + "dependencies": { + "@react-native/normalize-colors": "*", + "invariant": "*", + "prop-types": "*" + } + }, + "node_modules/destroy": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/destroy/-/destroy-1.2.0.tgz", + "integrity": "sha512-2sJGJTaXIIaR1w4iJSNoN0hnMY7Gpc/n8D4qSCJw8QqFWXf7cuAgnEHxBpweaVcPevC2l3KpjYCx3NypQQgaJg==", + "peer": true, + "engines": { + "node": ">= 0.8", + "npm": "1.2.8000 || >= 1.4.16" + } + }, + "node_modules/diff-sequences": { + "version": "29.4.3", + "resolved": "https://registry.npmjs.org/diff-sequences/-/diff-sequences-29.4.3.tgz", + "integrity": "sha512-ofrBgwpPhCD85kMKtE9RYFFq6OC1A89oW2vvgWZNCwxrUpRUILopY7lsYyMDSjc8g6U6aiO0Qubg6r4Wgt5ZnA==", + "dev": true, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/dir-glob": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-3.0.1.tgz", + "integrity": "sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==", + "dev": true, + "dependencies": { + "path-type": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/dom-serializer": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/dom-serializer/-/dom-serializer-2.0.0.tgz", + "integrity": "sha512-wIkAryiqt/nV5EQKqQpo3SToSOV9J0DnbJqwK7Wv/Trc92zIAYZ4FlMu+JPFW1DfGFt81ZTCGgDEabffXeLyJg==", + "peer": true, + "dependencies": { + "domelementtype": "^2.3.0", + "domhandler": "^5.0.2", + "entities": "^4.2.0" + }, + "funding": { + "url": "https://github.com/cheeriojs/dom-serializer?sponsor=1" + } + }, + "node_modules/domelementtype": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/domelementtype/-/domelementtype-2.3.0.tgz", + "integrity": "sha512-OLETBj6w0OsagBwdXnPdN0cnMfF9opN69co+7ZrbfPGrdpPVNBUj02spi6B1N7wChLQiPn4CSH/zJvXw56gmHw==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/fb55" + } + ], + "peer": true + }, + "node_modules/domhandler": { + "version": "5.0.3", + "resolved": "https://registry.npmjs.org/domhandler/-/domhandler-5.0.3.tgz", + "integrity": "sha512-cgwlv/1iFQiFnU96XXgROh8xTeetsnJiDsTc7TYCLFd9+/WNkIqPTxiM/8pSd8VIrhXGTf1Ny1q1hquVqDJB5w==", + "peer": true, + "dependencies": { + "domelementtype": "^2.3.0" + }, + "engines": { + "node": ">= 4" + }, + "funding": { + "url": "https://github.com/fb55/domhandler?sponsor=1" + } + }, + "node_modules/domutils": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/domutils/-/domutils-3.1.0.tgz", + "integrity": "sha512-H78uMmQtI2AhgDJjWeQmHwJJ2bLPD3GMmO7Zja/ZZh84wkm+4ut+IUnUdRa8uCGX88DiVx1j6FRe1XfxEgjEZA==", + "peer": true, + "dependencies": { + "dom-serializer": "^2.0.0", + "domelementtype": "^2.3.0", + "domhandler": "^5.0.3" + }, + "funding": { + "url": "https://github.com/fb55/domutils?sponsor=1" + } + }, + "node_modules/ee-first": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz", + "integrity": "sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow==", + "peer": true + }, + "node_modules/electron-to-chromium": { + "version": "1.4.389", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.389.tgz", + "integrity": "sha512-WDgWUOK8ROR7sDFyYmxCUOoDc50lPgYAHAHwnnD1iN3SKO/mpqftb9iIPiEkMKmqYdkrR0j3N/O+YB/U7lSxwg==" + }, + "node_modules/emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==" + }, + "node_modules/encodeurl": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz", + "integrity": "sha512-TPJXq8JqFaVYm2CWmPvnP2Iyo4ZSM7/QKcSmuMLDObfpH5fi7RUGmd/rTDf+rut/saiDiQEeVTNgAmJEdAOx0w==", + "peer": true, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/end-of-stream": { + "version": "1.4.4", + "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.4.tgz", + "integrity": "sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q==", + "dev": true, + "dependencies": { + "once": "^1.4.0" + } + }, + "node_modules/entities": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/entities/-/entities-4.5.0.tgz", + "integrity": "sha512-V0hjH4dGPh9Ao5p0MoRY6BVqtwCjhz6vI5LT8AJ55H+4g9/4vbHx1I54fS0XuclLhDHArPQCiMjDxjaL8fPxhw==", + "peer": true, + "engines": { + "node": ">=0.12" + }, + "funding": { + "url": "https://github.com/fb55/entities?sponsor=1" + } + }, + "node_modules/envinfo": { + "version": "7.13.0", + "resolved": "https://registry.npmjs.org/envinfo/-/envinfo-7.13.0.tgz", + "integrity": "sha512-cvcaMr7KqXVh4nyzGTVqTum+gAiL265x5jUWQIDLq//zOGbW+gSW/C+OWLleY/rs9Qole6AZLMXPbtIFQbqu+Q==", + "peer": true, + "bin": { + "envinfo": "dist/cli.js" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/error-ex": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz", + "integrity": "sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==", + "dependencies": { + "is-arrayish": "^0.2.1" + } + }, + "node_modules/error-stack-parser": { + "version": "2.1.4", + "resolved": "https://registry.npmjs.org/error-stack-parser/-/error-stack-parser-2.1.4.tgz", + "integrity": "sha512-Sk5V6wVazPhq5MhpO+AUxJn5x7XSXGl1R93Vn7i+zS15KDVxQijejNCrz8340/2bgLBjR9GtEG8ZVKONDjcqGQ==", + "peer": true, + "dependencies": { + "stackframe": "^1.3.4" + } + }, + "node_modules/errorhandler": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/errorhandler/-/errorhandler-1.5.1.tgz", + "integrity": "sha512-rcOwbfvP1WTViVoUjcfZicVzjhjTuhSMntHh6mW3IrEiyE6mJyXvsToJUJGlGlw/2xU9P5whlWNGlIDVeCiT4A==", + "peer": true, + "dependencies": { + "accepts": "~1.3.7", + "escape-html": "~1.0.3" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/escalade": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.1.tgz", + "integrity": "sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==", + "engines": { + "node": ">=6" + } + }, + "node_modules/escape-html": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz", + "integrity": "sha512-NiSupZ4OeuGwr68lGIeym/ksIZMJodUGOSCZ/FSnTxcrekbvqrgdUxlJOMpijaKZVjAJrWrGs/6Jy8OMuyj9ow==", + "peer": true + }, + "node_modules/escape-string-regexp": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-2.0.0.tgz", + "integrity": "sha512-UpzcLCXolUWcNu5HtVMHYdXJjArjsF9C0aNnquZYY4uW/Vu0miy5YoWvbV345HauVvcAUnpRuhMMcqTcGOY2+w==", + "engines": { + "node": ">=8" + } + }, + "node_modules/esprima": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", + "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", + "peer": true, + "bin": { + "esparse": "bin/esparse.js", + "esvalidate": "bin/esvalidate.js" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/esutils": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", + "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/etag": { + "version": "1.8.1", + "resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz", + "integrity": "sha512-aIL5Fx7mawVa300al2BnEE4iNvo1qETxLrPI/o05L7z6go7fCw1J6EQmbK4FmJ2AS7kgVF/KEZWufBfdClMcPg==", + "peer": true, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/event-target-shim": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/event-target-shim/-/event-target-shim-5.0.1.tgz", + "integrity": "sha512-i/2XbnSz/uxRCU6+NdVJgKWDTM427+MqYbkQzD321DuCQJUqOuJKIA0IM2+W2xtYHdKOmZ4dR6fExsd4SXL+WQ==", + "peer": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/execa": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/execa/-/execa-5.1.1.tgz", + "integrity": "sha512-8uSpZZocAZRBAPIEINJj3Lo9HyGitllczc27Eh5YYojjMFMn8yHMDMaUHE2Jqfq05D/wucwI4JGURyXt1vchyg==", + "peer": true, + "dependencies": { + "cross-spawn": "^7.0.3", + "get-stream": "^6.0.0", + "human-signals": "^2.1.0", + "is-stream": "^2.0.0", + "merge-stream": "^2.0.0", + "npm-run-path": "^4.0.1", + "onetime": "^5.1.2", + "signal-exit": "^3.0.3", + "strip-final-newline": "^2.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sindresorhus/execa?sponsor=1" + } + }, + "node_modules/execa/node_modules/human-signals": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-2.1.0.tgz", + "integrity": "sha512-B4FFZ6q/T2jhhksgkbEW3HBvWIfDW85snkQgawt07S7J5QXTk6BkNV+0yAeZrM5QpMAdYlocGoljn0sJ/WQkFw==", + "peer": true, + "engines": { + "node": ">=10.17.0" + } + }, + "node_modules/expect": { + "version": "29.5.0", + "resolved": "https://registry.npmjs.org/expect/-/expect-29.5.0.tgz", + "integrity": "sha512-yM7xqUrCO2JdpFo4XpM82t+PJBFybdqoQuJLDGeDX2ij8NZzqRHyu3Hp188/JX7SWqud+7t4MUdvcgGBICMHZg==", + "dev": true, + "dependencies": { + "@jest/expect-utils": "^29.5.0", + "jest-get-type": "^29.4.3", + "jest-matcher-utils": "^29.5.0", + "jest-message-util": "^29.5.0", + "jest-util": "^29.5.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/fast-glob": { + "version": "3.2.12", + "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.2.12.tgz", + "integrity": "sha512-DVj4CQIYYow0BlaelwK1pHl5n5cRSJfM60UA0zK891sVInoPri2Ekj7+e1CT3/3qxXenpI+nBBmQAcJPJgaj4w==", + "dev": true, + "dependencies": { + "@nodelib/fs.stat": "^2.0.2", + "@nodelib/fs.walk": "^1.2.3", + "glob-parent": "^5.1.2", + "merge2": "^1.3.0", + "micromatch": "^4.0.4" + }, + "engines": { + "node": ">=8.6.0" + } + }, + "node_modules/fast-xml-parser": { + "version": "4.3.6", + "resolved": "https://registry.npmjs.org/fast-xml-parser/-/fast-xml-parser-4.3.6.tgz", + "integrity": "sha512-M2SovcRxD4+vC493Uc2GZVcZaj66CCJhWurC4viynVSTvrpErCShNcDz1lAho6n9REQKvL/ll4A4/fw6Y9z8nw==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/NaturalIntelligence" + }, + { + "type": "paypal", + "url": "https://paypal.me/naturalintelligence" + } + ], + "peer": true, + "dependencies": { + "strnum": "^1.0.5" + }, + "bin": { + "fxparser": "src/cli/cli.js" + } + }, + "node_modules/fastq": { + "version": "1.15.0", + "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.15.0.tgz", + "integrity": "sha512-wBrocU2LCXXa+lWBt8RoIRD89Fi8OdABODa/kEnyeyjS5aZO5/GNvI5sEINADqP/h8M29UHTHUb53sUu5Ihqdw==", + "dev": true, + "dependencies": { + "reusify": "^1.0.4" + } + }, + "node_modules/fb-watchman": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/fb-watchman/-/fb-watchman-2.0.2.tgz", + "integrity": "sha512-p5161BqbuCaSnB8jIbzQHOlpgsPmK5rJVDfDKO91Axs5NC1uu3HRQm6wt9cd9/+GtQQIO53JdGXXoyDpTAsgYA==", + "peer": true, + "dependencies": { + "bser": "2.1.1" + } + }, + "node_modules/fill-range": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", + "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", + "dependencies": { + "to-regex-range": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/finalhandler": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.1.2.tgz", + "integrity": "sha512-aAWcW57uxVNrQZqFXjITpW3sIUQmHGG3qSb9mUah9MgMC4NeWhNOlNjXEYq3HjRAvL6arUviZGGJsBg6z0zsWA==", + "peer": true, + "dependencies": { + "debug": "2.6.9", + "encodeurl": "~1.0.2", + "escape-html": "~1.0.3", + "on-finished": "~2.3.0", + "parseurl": "~1.3.3", + "statuses": "~1.5.0", + "unpipe": "~1.0.0" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/find-cache-dir": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/find-cache-dir/-/find-cache-dir-2.1.0.tgz", + "integrity": "sha512-Tq6PixE0w/VMFfCgbONnkiQIVol/JJL7nRMi20fqzA4NRs9AfeqMGeRdPi3wIhYkxjeBaWh2rxwapn5Tu3IqOQ==", + "peer": true, + "dependencies": { + "commondir": "^1.0.1", + "make-dir": "^2.0.0", + "pkg-dir": "^3.0.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/find-up": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", + "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", + "peer": true, + "dependencies": { + "locate-path": "^5.0.0", + "path-exists": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/flow-enums-runtime": { + "version": "0.0.5", + "resolved": "https://registry.npmjs.org/flow-enums-runtime/-/flow-enums-runtime-0.0.5.tgz", + "integrity": "sha512-PSZF9ZuaZD03sT9YaIs0FrGJ7lSUw7rHZIex+73UYVXg46eL/wxN5PaVcPJFudE2cJu5f0fezitV5aBkLHPUOQ==", + "peer": true + }, + "node_modules/flow-parser": { + "version": "0.206.0", + "resolved": "https://registry.npmjs.org/flow-parser/-/flow-parser-0.206.0.tgz", + "integrity": "sha512-HVzoK3r6Vsg+lKvlIZzaWNBVai+FXTX1wdYhz/wVlH13tb/gOdLXmlTqy6odmTBhT5UoWUbq0k8263Qhr9d88w==", + "peer": true, + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/fresh": { + "version": "0.5.2", + "resolved": "https://registry.npmjs.org/fresh/-/fresh-0.5.2.tgz", + "integrity": "sha512-zJ2mQYM18rEFOudeV4GShTGIQ7RbzA7ozbU9I/XBpm7kqgMywgmylMwXHxZJmkVoYkna9d2pVXVXPdYTP9ej8Q==", + "peer": true, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/fs-extra": { + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-8.1.0.tgz", + "integrity": "sha512-yhlQgA6mnOJUKOsRUFsgJdQCvkKhcz8tlZG5HBQfReYZy46OwLcY+Zia0mtdHsOo9y/hP+CxMN0TU9QxoOtG4g==", + "peer": true, + "dependencies": { + "graceful-fs": "^4.2.0", + "jsonfile": "^4.0.0", + "universalify": "^0.1.0" + }, + "engines": { + "node": ">=6 <7 || >=8" + } + }, + "node_modules/fs.realpath": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", + "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==" + }, + "node_modules/fsevents": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.2.tgz", + "integrity": "sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==", + "hasInstallScript": true, + "optional": true, + "os": [ + "darwin" + ], + "peer": true, + "engines": { + "node": "^8.16.0 || ^10.6.0 || >=11.0.0" + } + }, + "node_modules/function-bind": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", + "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==" + }, + "node_modules/gensync": { + "version": "1.0.0-beta.2", + "resolved": "https://registry.npmjs.org/gensync/-/gensync-1.0.0-beta.2.tgz", + "integrity": "sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg==", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/get-caller-file": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", + "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", + "engines": { + "node": "6.* || 8.* || >= 10.*" + } + }, + "node_modules/get-stream": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-6.0.1.tgz", + "integrity": "sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg==", + "peer": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/glob": { + "version": "7.2.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", + "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", + "dependencies": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.1.1", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + }, + "engines": { + "node": "*" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/glob-parent": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", + "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", + "dev": true, + "dependencies": { + "is-glob": "^4.0.1" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/globals": { + "version": "11.12.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-11.12.0.tgz", + "integrity": "sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==", + "engines": { + "node": ">=4" + } + }, + "node_modules/globby": { + "version": "11.1.0", + "resolved": "https://registry.npmjs.org/globby/-/globby-11.1.0.tgz", + "integrity": "sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g==", + "dev": true, + "dependencies": { + "array-union": "^2.1.0", + "dir-glob": "^3.0.1", + "fast-glob": "^3.2.9", + "ignore": "^5.2.0", + "merge2": "^1.4.1", + "slash": "^3.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/graceful-fs": { + "version": "4.2.11", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz", + "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==" + }, + "node_modules/has": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", + "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", + "dependencies": { + "function-bind": "^1.1.1" + }, + "engines": { + "node": ">= 0.4.0" + } + }, + "node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "engines": { + "node": ">=8" + } + }, + "node_modules/hermes-profile-transformer": { + "version": "0.0.6", + "resolved": "https://registry.npmjs.org/hermes-profile-transformer/-/hermes-profile-transformer-0.0.6.tgz", + "integrity": "sha512-cnN7bQUm65UWOy6cbGcCcZ3rpwW8Q/j4OP5aWRhEry4Z2t2aR1cjrbp0BS+KiBN0smvP1caBgAuxutvyvJILzQ==", + "peer": true, + "dependencies": { + "source-map": "^0.7.3" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/http-errors": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-2.0.0.tgz", + "integrity": "sha512-FtwrG/euBzaEjYeRqOgly7G0qviiXoJWnvEH2Z1plBdXgbyjv34pHTSb9zoeHMyDy33+DWy5Wt9Wo+TURtOYSQ==", + "peer": true, + "dependencies": { + "depd": "2.0.0", + "inherits": "2.0.4", + "setprototypeof": "1.2.0", + "statuses": "2.0.1", + "toidentifier": "1.0.1" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/http-errors/node_modules/statuses": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/statuses/-/statuses-2.0.1.tgz", + "integrity": "sha512-RwNA9Z/7PrK06rYLIzFMlaF+l73iwpzsqRIFgbMLbTcLD6cOao82TaWefPXQvB2fOC4AjuYSEndS7N/mTCbkdQ==", + "peer": true, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/human-signals": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-1.1.1.tgz", + "integrity": "sha512-SEQu7vl8KjNL2eoGBLF3+wAjpsNfA9XMlXAYj/3EdaNfAlxKthD1xjEQfGOUhllCGGJVNY34bRr6lPINhNjyZw==", + "dev": true, + "engines": { + "node": ">=8.12.0" + } + }, + "node_modules/ieee754": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz", + "integrity": "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "peer": true + }, + "node_modules/ignore": { + "version": "5.2.4", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.2.4.tgz", + "integrity": "sha512-MAb38BcSbH0eHNBxn7ql2NH/kX33OkB3lZ1BNdh7ENeRChHTYsTvWrMubiIAMNS2llXEEgZ1MUOBtXChP3kaFQ==", + "dev": true, + "engines": { + "node": ">= 4" + } + }, + "node_modules/import-fresh": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-2.0.0.tgz", + "integrity": "sha512-eZ5H8rcgYazHbKC3PG4ClHNykCSxtAhxSSEM+2mb+7evD2CKF5V7c0dNum7AdpDh0ZdICwZY9sRSn8f+KH96sg==", + "peer": true, + "dependencies": { + "caller-path": "^2.0.0", + "resolve-from": "^3.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/imurmurhash": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", + "integrity": "sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==", + "peer": true, + "engines": { + "node": ">=0.8.19" + } + }, + "node_modules/indent-string": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-4.0.0.tgz", + "integrity": "sha512-EdDDZu4A2OyIK7Lr/2zG+w5jmbuk1DVBnEwREQvBzspBJkCEbRa8GxU1lghYcaGJCnRWibjDXlq779X1/y5xwg==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/inflight": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", + "integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==", + "dependencies": { + "once": "^1.3.0", + "wrappy": "1" + } + }, + "node_modules/inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" + }, + "node_modules/invariant": { + "version": "2.2.4", + "resolved": "https://registry.npmjs.org/invariant/-/invariant-2.2.4.tgz", + "integrity": "sha512-phJfQVBuaJM5raOpJjSfkiD6BpbCE4Ns//LaXl6wGYtUBY83nWS6Rf9tXm2e8VaK60JEjYldbPif/A2B1C2gNA==", + "peer": true, + "dependencies": { + "loose-envify": "^1.0.0" + } + }, + "node_modules/ip": { + "version": "1.1.9", + "resolved": "https://registry.npmjs.org/ip/-/ip-1.1.9.tgz", + "integrity": "sha512-cyRxvOEpNHNtchU3Ln9KC/auJgup87llfQpQ+t5ghoC/UhL16SWzbueiCsdTnWmqAWl7LadfuwhlqmtOaqMHdQ==", + "peer": true + }, + "node_modules/is-absolute": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-absolute/-/is-absolute-1.0.0.tgz", + "integrity": "sha512-dOWoqflvcydARa360Gvv18DZ/gRuHKi2NU/wU5X1ZFzdYfH29nkiNZsF3mp4OJ3H4yo9Mx8A/uAGNzpzPN3yBA==", + "dev": true, + "dependencies": { + "is-relative": "^1.0.0", + "is-windows": "^1.0.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-arrayish": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", + "integrity": "sha512-zz06S8t0ozoDXMG+ube26zeCTNXcKIPJZJi8hBrF4idCLms4CG9QtK7qBl1boi5ODzFpjswb5JPmHCbMpjaYzg==" + }, + "node_modules/is-core-module": { + "version": "2.12.0", + "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.12.0.tgz", + "integrity": "sha512-RECHCBCd/viahWmwj6enj19sKbHfJrddi/6cBDsNTKbNq0f7VeaUkBo60BqzvPqo/W54ChS62Z5qyun7cfOMqQ==", + "dependencies": { + "has": "^1.0.3" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-directory": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/is-directory/-/is-directory-0.3.1.tgz", + "integrity": "sha512-yVChGzahRFvbkscn2MlwGismPO12i9+znNruC5gVEntG3qu0xQMzsGg/JFbrsqDOHtHFPci+V5aP5T9I+yeKqw==", + "peer": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-extglob": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", + "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-fullwidth-code-point": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", + "integrity": "sha512-VHskAKYM8RfSFXwee5t5cbN5PZeq1Wrh6qd5bkyiXIf6UQcN6w/A0eXM9r6t8d+GYOh+o6ZhiEnb88LN/Y8m2w==", + "peer": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/is-git-dirty": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/is-git-dirty/-/is-git-dirty-2.0.2.tgz", + "integrity": "sha512-U3YCo+GKR/rDsY7r0v/LBICbQwsx859tDQnAT+v0E/zCDeWbQ1TUt1FtyExeyik7VIJlYOLHCIifLdz71HDalg==", + "dev": true, + "dependencies": { + "execa": "^4.0.3", + "is-git-repository": "^2.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/is-git-dirty/node_modules/execa": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/execa/-/execa-4.1.0.tgz", + "integrity": "sha512-j5W0//W7f8UxAn8hXVnwG8tLwdiUy4FJLcSupCg6maBYZDpyBvTApK7KyuI4bKj8KOh1r2YH+6ucuYtJv1bTZA==", + "dev": true, + "dependencies": { + "cross-spawn": "^7.0.0", + "get-stream": "^5.0.0", + "human-signals": "^1.1.1", + "is-stream": "^2.0.0", + "merge-stream": "^2.0.0", + "npm-run-path": "^4.0.0", + "onetime": "^5.1.0", + "signal-exit": "^3.0.2", + "strip-final-newline": "^2.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sindresorhus/execa?sponsor=1" + } + }, + "node_modules/is-git-dirty/node_modules/get-stream": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-5.2.0.tgz", + "integrity": "sha512-nBF+F1rAZVCu/p7rjzgA+Yb4lfYXrpl7a6VmJrU8wF9I1CKvP/QwPNZHnOlwbTkY6dvtFIzFMSyQXbLoTQPRpA==", + "dev": true, + "dependencies": { + "pump": "^3.0.0" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/is-git-repository": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-git-repository/-/is-git-repository-2.0.0.tgz", + "integrity": "sha512-HDO50CG5suIAcmqG4F1buqVXEZRPn+RaXIn9pFKq/947FBo2bCRwK7ZluEVZOy99a4IQyqsjbKEpAiOXCccOHQ==", + "dev": true, + "dependencies": { + "execa": "^4.0.3", + "is-absolute": "^1.0.0" + } + }, + "node_modules/is-git-repository/node_modules/execa": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/execa/-/execa-4.1.0.tgz", + "integrity": "sha512-j5W0//W7f8UxAn8hXVnwG8tLwdiUy4FJLcSupCg6maBYZDpyBvTApK7KyuI4bKj8KOh1r2YH+6ucuYtJv1bTZA==", + "dev": true, + "dependencies": { + "cross-spawn": "^7.0.0", + "get-stream": "^5.0.0", + "human-signals": "^1.1.1", + "is-stream": "^2.0.0", + "merge-stream": "^2.0.0", + "npm-run-path": "^4.0.0", + "onetime": "^5.1.0", + "signal-exit": "^3.0.2", + "strip-final-newline": "^2.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sindresorhus/execa?sponsor=1" + } + }, + "node_modules/is-git-repository/node_modules/get-stream": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-5.2.0.tgz", + "integrity": "sha512-nBF+F1rAZVCu/p7rjzgA+Yb4lfYXrpl7a6VmJrU8wF9I1CKvP/QwPNZHnOlwbTkY6dvtFIzFMSyQXbLoTQPRpA==", + "dev": true, + "dependencies": { + "pump": "^3.0.0" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/is-glob": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", + "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", + "dev": true, + "dependencies": { + "is-extglob": "^2.1.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-interactive": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-interactive/-/is-interactive-1.0.0.tgz", + "integrity": "sha512-2HvIEKRoqS62guEC+qBjpvRubdX910WCMuJTZ+I9yvqKU2/12eSL549HMwtabb4oupdj2sMP50k+XJfB/8JE6w==", + "peer": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/is-number": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", + "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", + "engines": { + "node": ">=0.12.0" + } + }, + "node_modules/is-path-cwd": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/is-path-cwd/-/is-path-cwd-2.2.0.tgz", + "integrity": "sha512-w942bTcih8fdJPJmQHFzkS76NEP8Kzzvmw92cXsazb8intwLqPibPPdXf4ANdKV3rYMuuQYGIWtvz9JilB3NFQ==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/is-path-inside": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-3.0.3.tgz", + "integrity": "sha512-Fd4gABb+ycGAmKou8eMftCupSir5lRxqf4aD/vd0cD2qc4HL07OjCeuHMr8Ro4CoMaeCKDB0/ECBOVWjTwUvPQ==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/is-plain-object": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-2.0.4.tgz", + "integrity": "sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og==", + "peer": true, + "dependencies": { + "isobject": "^3.0.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-relative": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-relative/-/is-relative-1.0.0.tgz", + "integrity": "sha512-Kw/ReK0iqwKeu0MITLFuj0jbPAmEiOsIwyIXvvbfa6QfmN9pkD1M+8pdk7Rl/dTKbH34/XBFMbgD4iMJhLQbGA==", + "dev": true, + "dependencies": { + "is-unc-path": "^1.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-stream": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.1.tgz", + "integrity": "sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg==", + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/is-unc-path": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-unc-path/-/is-unc-path-1.0.0.tgz", + "integrity": "sha512-mrGpVd0fs7WWLfVsStvgF6iEJnbjDFZh9/emhRDcGWTduTfNHd9CHeUwH3gYIjdbwo4On6hunkztwOaAw0yllQ==", + "dev": true, + "dependencies": { + "unc-path-regex": "^0.1.2" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-unicode-supported": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/is-unicode-supported/-/is-unicode-supported-0.1.0.tgz", + "integrity": "sha512-knxG2q4UC3u8stRGyAVJCOdxFmv5DZiRcdlIaAQXAbSfJya+OhopNotLQrstBhququ4ZpuKbDc/8S6mgXgPFPw==", + "peer": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/is-windows": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-windows/-/is-windows-1.0.2.tgz", + "integrity": "sha512-eXK1UInq2bPmjyX6e3VHIzMLobc4J94i4AWn+Hpq3OU5KkrRC96OAcR3PRJ/pGu6m8TRnBHP9dkXQVsT/COVIA==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-wsl": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-wsl/-/is-wsl-1.1.0.tgz", + "integrity": "sha512-gfygJYZ2gLTDlmbWMI0CE2MwnFzSN/2SZfkMlItC4K/JBlsWVDB0bO6XhqcY13YXE7iMcAJnzTCJjPiTeJJ0Mw==", + "peer": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/isarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ==", + "peer": true + }, + "node_modules/isexe": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==" + }, + "node_modules/isobject": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", + "integrity": "sha512-WhB9zCku7EGTj/HQQRz5aUQEUeoQZH2bWcltRErOpymJ4boYE6wL9Tbr23krRPSZ+C5zqNSrSw+Cc7sZZ4b7vg==", + "peer": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/jest-diff": { + "version": "29.5.0", + "resolved": "https://registry.npmjs.org/jest-diff/-/jest-diff-29.5.0.tgz", + "integrity": "sha512-LtxijLLZBduXnHSniy0WMdaHjmQnt3g5sa16W4p0HqukYTTsyTW3GD1q41TyGl5YFXj/5B2U6dlh5FM1LIMgxw==", + "dev": true, + "dependencies": { + "chalk": "^4.0.0", + "diff-sequences": "^29.4.3", + "jest-get-type": "^29.4.3", + "pretty-format": "^29.5.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-environment-node": { + "version": "29.5.0", + "resolved": "https://registry.npmjs.org/jest-environment-node/-/jest-environment-node-29.5.0.tgz", + "integrity": "sha512-ExxuIK/+yQ+6PRGaHkKewYtg6hto2uGCgvKdb2nfJfKXgZ17DfXjvbZ+jA1Qt9A8EQSfPnt5FKIfnOO3u1h9qw==", + "peer": true, + "dependencies": { + "@jest/environment": "^29.5.0", + "@jest/fake-timers": "^29.5.0", + "@jest/types": "^29.5.0", + "@types/node": "*", + "jest-mock": "^29.5.0", + "jest-util": "^29.5.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-get-type": { + "version": "29.6.3", + "resolved": "https://registry.npmjs.org/jest-get-type/-/jest-get-type-29.6.3.tgz", + "integrity": "sha512-zrteXnqYxfQh7l5FHyL38jL39di8H8rHoecLH3JNxH3BwOrBsNeabdap5e0I23lD4HHI8W5VFBZqG4Eaq5LNcw==", + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-matcher-utils": { + "version": "29.5.0", + "resolved": "https://registry.npmjs.org/jest-matcher-utils/-/jest-matcher-utils-29.5.0.tgz", + "integrity": "sha512-lecRtgm/rjIK0CQ7LPQwzCs2VwW6WAahA55YBuI+xqmhm7LAaxokSB8C97yJeYyT+HvQkH741StzpU41wohhWw==", + "dev": true, + "dependencies": { + "chalk": "^4.0.0", + "jest-diff": "^29.5.0", + "jest-get-type": "^29.4.3", + "pretty-format": "^29.5.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-message-util": { + "version": "29.5.0", + "resolved": "https://registry.npmjs.org/jest-message-util/-/jest-message-util-29.5.0.tgz", + "integrity": "sha512-Kijeg9Dag6CKtIDA7O21zNTACqD5MD/8HfIV8pdD94vFyFuer52SigdC3IQMhab3vACxXMiFk+yMHNdbqtyTGA==", + "dependencies": { + "@babel/code-frame": "^7.12.13", + "@jest/types": "^29.5.0", + "@types/stack-utils": "^2.0.0", + "chalk": "^4.0.0", + "graceful-fs": "^4.2.9", + "micromatch": "^4.0.4", + "pretty-format": "^29.5.0", + "slash": "^3.0.0", + "stack-utils": "^2.0.3" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-mock": { + "version": "29.5.0", + "resolved": "https://registry.npmjs.org/jest-mock/-/jest-mock-29.5.0.tgz", + "integrity": "sha512-GqOzvdWDE4fAV2bWQLQCkujxYWL7RxjCnj71b5VhDAGOevB3qj3Ovg26A5NI84ZpODxyzaozXLOh2NCgkbvyaw==", + "peer": true, + "dependencies": { + "@jest/types": "^29.5.0", + "@types/node": "*", + "jest-util": "^29.5.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-regex-util": { + "version": "27.5.1", + "resolved": "https://registry.npmjs.org/jest-regex-util/-/jest-regex-util-27.5.1.tgz", + "integrity": "sha512-4bfKq2zie+x16okqDXjXn9ql2B0dScQu+vcwe4TvFVhkVyuWLqpZrZtXxLLWoXYgn0E87I6r6GRYHF7wFZBUvg==", + "peer": true, + "engines": { + "node": "^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0" + } + }, + "node_modules/jest-util": { + "version": "29.5.0", + "resolved": "https://registry.npmjs.org/jest-util/-/jest-util-29.5.0.tgz", + "integrity": "sha512-RYMgG/MTadOr5t8KdhejfvUU82MxsCu5MF6KuDUHl+NuwzUt+Sm6jJWxTJVrDR1j5M/gJVCPKQEpWXY+yIQ6lQ==", + "dependencies": { + "@jest/types": "^29.5.0", + "@types/node": "*", + "chalk": "^4.0.0", + "ci-info": "^3.2.0", + "graceful-fs": "^4.2.9", + "picomatch": "^2.2.3" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-worker": { + "version": "27.5.1", + "resolved": "https://registry.npmjs.org/jest-worker/-/jest-worker-27.5.1.tgz", + "integrity": "sha512-7vuh85V5cdDofPyxn58nrPjBktZo0u9x1g8WtjQol+jZDaE+fhN+cIvTj11GndBnMnyfrUOG1sZQxCdjKh+DKg==", + "peer": true, + "dependencies": { + "@types/node": "*", + "merge-stream": "^2.0.0", + "supports-color": "^8.0.0" + }, + "engines": { + "node": ">= 10.13.0" + } + }, + "node_modules/jest-worker/node_modules/supports-color": { + "version": "8.1.1", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz", + "integrity": "sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==", + "peer": true, + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/supports-color?sponsor=1" + } + }, + "node_modules/jetifier": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/jetifier/-/jetifier-2.0.0.tgz", + "integrity": "sha512-J4Au9KuT74te+PCCCHKgAjyLlEa+2VyIAEPNCdE5aNkAJ6FAJcAqcdzEkSnzNksIa9NkGmC4tPiClk2e7tCJuQ==", + "dev": true, + "optional": true, + "bin": { + "jetifier": "bin/jetify", + "jetifier-standalone": "bin/jetifier-standalone", + "jetify": "bin/jetify" + } + }, + "node_modules/joi": { + "version": "17.13.1", + "resolved": "https://registry.npmjs.org/joi/-/joi-17.13.1.tgz", + "integrity": "sha512-vaBlIKCyo4FCUtCm7Eu4QZd/q02bWcxfUO6YSXAZOWF6gzcLBeba8kwotUdYJjDLW8Cz8RywsSOqiNJZW0mNvg==", + "peer": true, + "dependencies": { + "@hapi/hoek": "^9.3.0", + "@hapi/topo": "^5.1.0", + "@sideway/address": "^4.1.5", + "@sideway/formula": "^3.0.1", + "@sideway/pinpoint": "^2.0.0" + } + }, + "node_modules/js-tokens": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", + "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==" + }, + "node_modules/js-yaml": { + "version": "3.14.1", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.1.tgz", + "integrity": "sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g==", + "peer": true, + "dependencies": { + "argparse": "^1.0.7", + "esprima": "^4.0.0" + }, + "bin": { + "js-yaml": "bin/js-yaml.js" + } + }, + "node_modules/jsc-android": { + "version": "250231.0.0", + "resolved": "https://registry.npmjs.org/jsc-android/-/jsc-android-250231.0.0.tgz", + "integrity": "sha512-rS46PvsjYmdmuz1OAWXY/1kCYG7pnf1TBqeTiOJr1iDz7s5DLxxC9n/ZMknLDxzYzNVfI7R95MH10emSSG1Wuw==", + "peer": true + }, + "node_modules/jsc-safe-url": { + "version": "0.2.4", + "resolved": "https://registry.npmjs.org/jsc-safe-url/-/jsc-safe-url-0.2.4.tgz", + "integrity": "sha512-0wM3YBWtYePOjfyXQH5MWQ8H7sdk5EXSwZvmSLKk2RboVQ2Bu239jycHDz5J/8Blf3K0Qnoy2b6xD+z10MFB+Q==", + "peer": true + }, + "node_modules/jscodeshift": { + "version": "0.14.0", + "resolved": "https://registry.npmjs.org/jscodeshift/-/jscodeshift-0.14.0.tgz", + "integrity": "sha512-7eCC1knD7bLUPuSCwXsMZUH51O8jIcoVyKtI6P0XM0IVzlGjckPy3FIwQlorzbN0Sg79oK+RlohN32Mqf/lrYA==", + "peer": true, + "dependencies": { + "@babel/core": "^7.13.16", + "@babel/parser": "^7.13.16", + "@babel/plugin-proposal-class-properties": "^7.13.0", + "@babel/plugin-proposal-nullish-coalescing-operator": "^7.13.8", + "@babel/plugin-proposal-optional-chaining": "^7.13.12", + "@babel/plugin-transform-modules-commonjs": "^7.13.8", + "@babel/preset-flow": "^7.13.13", + "@babel/preset-typescript": "^7.13.0", + "@babel/register": "^7.13.16", + "babel-core": "^7.0.0-bridge.0", + "chalk": "^4.1.2", + "flow-parser": "0.*", + "graceful-fs": "^4.2.4", + "micromatch": "^4.0.4", + "neo-async": "^2.5.0", + "node-dir": "^0.1.17", + "recast": "^0.21.0", + "temp": "^0.8.4", + "write-file-atomic": "^2.3.0" + }, + "bin": { + "jscodeshift": "bin/jscodeshift.js" + }, + "peerDependencies": { + "@babel/preset-env": "^7.1.6" + } + }, + "node_modules/jsesc": { + "version": "2.5.2", + "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-2.5.2.tgz", + "integrity": "sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA==", + "bin": { + "jsesc": "bin/jsesc" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/json-parse-better-errors": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/json-parse-better-errors/-/json-parse-better-errors-1.0.2.tgz", + "integrity": "sha512-mrqyZKfX5EhL7hvqcV6WG1yYjnjeuYDzDhhcAAUrq8Po85NBQBJP+ZDUT75qZQ98IkUoBqdkExkukOU7Ts2wrw==", + "peer": true + }, + "node_modules/json-parse-even-better-errors": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/json-parse-even-better-errors/-/json-parse-even-better-errors-2.3.1.tgz", + "integrity": "sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w==", + "dev": true + }, + "node_modules/json5": { + "version": "2.2.3", + "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.3.tgz", + "integrity": "sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg==", + "bin": { + "json5": "lib/cli.js" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/jsonfile": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz", + "integrity": "sha512-m6F1R3z8jjlf2imQHS2Qez5sjKWQzbuuhuJ/FKYFRZvPE3PuHcSMVZzfsLhGVOkfd20obL5SWEBew5ShlquNxg==", + "peer": true, + "optionalDependencies": { + "graceful-fs": "^4.1.6" + } + }, + "node_modules/kind-of": { + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz", + "integrity": "sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==", + "peer": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/kleur": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/kleur/-/kleur-3.0.3.tgz", + "integrity": "sha512-eTIzlVOSUR+JxdDFepEYcBMtZ9Qqdef+rnzWdRZuMbOywu5tO2w2N7rqjoANZ5k9vywhL6Br1VRjUIgTQx4E8w==", + "engines": { + "node": ">=6" + } + }, + "node_modules/leven": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/leven/-/leven-3.1.0.tgz", + "integrity": "sha512-qsda+H8jTaUaN/x5vzW2rzc+8Rw4TAQ/4KjB46IwK5VH+IlVeeeje/EoZRpiXvIqjFgK84QffqPztGI3VBLG1A==", + "peer": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/lines-and-columns": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/lines-and-columns/-/lines-and-columns-1.2.4.tgz", + "integrity": "sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg==", + "dev": true + }, + "node_modules/locate-path": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", + "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", + "peer": true, + "dependencies": { + "p-locate": "^4.1.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/lodash.debounce": { + "version": "4.0.8", + "resolved": "https://registry.npmjs.org/lodash.debounce/-/lodash.debounce-4.0.8.tgz", + "integrity": "sha512-FT1yDzDYEoYWhnSGnpE/4Kj1fLZkDFyqRb7fNt6FdYOSxlUWAtp42Eh6Wb0rGIv/m9Bgo7x4GhQbm5Ys4SG5ow==" + }, + "node_modules/lodash.throttle": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/lodash.throttle/-/lodash.throttle-4.1.1.tgz", + "integrity": "sha512-wIkUCfVKpVsWo3JSZlc+8MB5it+2AN5W8J7YVMST30UrvcQNZ1Okbj+rbVniijTWE6FGYy4XJq/rHkas8qJMLQ==", + "peer": true + }, + "node_modules/log-symbols": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-4.1.0.tgz", + "integrity": "sha512-8XPvpAA8uyhfteu8pIvQxpJZ7SYYdpUivZpGy6sFsBuKRY/7rQGavedeB8aK+Zkyq6upMFVL/9AW6vOYzfRyLg==", + "peer": true, + "dependencies": { + "chalk": "^4.1.0", + "is-unicode-supported": "^0.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/logkitty": { + "version": "0.7.1", + "resolved": "https://registry.npmjs.org/logkitty/-/logkitty-0.7.1.tgz", + "integrity": "sha512-/3ER20CTTbahrCrpYfPn7Xavv9diBROZpoXGVZDWMw4b/X4uuUwAC0ki85tgsdMRONURyIJbcOvS94QsUBYPbQ==", + "peer": true, + "dependencies": { + "ansi-fragments": "^0.2.1", + "dayjs": "^1.8.15", + "yargs": "^15.1.0" + }, + "bin": { + "logkitty": "bin/logkitty.js" + } + }, + "node_modules/logkitty/node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "peer": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/logkitty/node_modules/camelcase": { + "version": "5.3.1", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", + "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", + "peer": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/logkitty/node_modules/cliui": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-6.0.0.tgz", + "integrity": "sha512-t6wbgtoCXvAzst7QgXxJYqPt0usEfbgQdftEPbLL/cvv6HPE5VgvqCuAIDR0NgU52ds6rFwqrgakNLrHEjCbrQ==", + "peer": true, + "dependencies": { + "string-width": "^4.2.0", + "strip-ansi": "^6.0.0", + "wrap-ansi": "^6.2.0" + } + }, + "node_modules/logkitty/node_modules/strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "peer": true, + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/logkitty/node_modules/wrap-ansi": { + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-6.2.0.tgz", + "integrity": "sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==", + "peer": true, + "dependencies": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/logkitty/node_modules/y18n": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.3.tgz", + "integrity": "sha512-JKhqTOwSrqNA1NY5lSztJ1GrBiUodLMmIZuLiDaMRJ+itFd+ABVE8XBjOvIWL+rSqNDC74LCSFmlb/U4UZ4hJQ==", + "peer": true + }, + "node_modules/logkitty/node_modules/yargs": { + "version": "15.4.1", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-15.4.1.tgz", + "integrity": "sha512-aePbxDmcYW++PaqBsJ+HYUFwCdv4LVvdnhBy78E57PIor8/OVvhMrADFFEDh8DHDFRv/O9i3lPhsENjO7QX0+A==", + "peer": true, + "dependencies": { + "cliui": "^6.0.0", + "decamelize": "^1.2.0", + "find-up": "^4.1.0", + "get-caller-file": "^2.0.1", + "require-directory": "^2.1.1", + "require-main-filename": "^2.0.0", + "set-blocking": "^2.0.0", + "string-width": "^4.2.0", + "which-module": "^2.0.0", + "y18n": "^4.0.0", + "yargs-parser": "^18.1.2" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/logkitty/node_modules/yargs-parser": { + "version": "18.1.3", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-18.1.3.tgz", + "integrity": "sha512-o50j0JeToy/4K6OZcaQmW6lyXXKhq7csREXcDwk2omFPJEwUNOVtJKvmDr9EI1fAJZUyZcRF7kxGBWmRXudrCQ==", + "peer": true, + "dependencies": { + "camelcase": "^5.0.0", + "decamelize": "^1.2.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/loose-envify": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/loose-envify/-/loose-envify-1.4.0.tgz", + "integrity": "sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==", + "peer": true, + "dependencies": { + "js-tokens": "^3.0.0 || ^4.0.0" + }, + "bin": { + "loose-envify": "cli.js" + } + }, + "node_modules/lru-cache": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-5.1.1.tgz", + "integrity": "sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==", + "dependencies": { + "yallist": "^3.0.2" + } + }, + "node_modules/make-dir": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-2.1.0.tgz", + "integrity": "sha512-LS9X+dc8KLxXCb8dni79fLIIUA5VyZoyjSMCwTluaXA0o27cCK0bhXkpgw+sTXVpPy/lSO57ilRixqk0vDmtRA==", + "peer": true, + "dependencies": { + "pify": "^4.0.1", + "semver": "^5.6.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/make-dir/node_modules/semver": { + "version": "5.7.2", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.2.tgz", + "integrity": "sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g==", + "peer": true, + "bin": { + "semver": "bin/semver" + } + }, + "node_modules/makeerror": { + "version": "1.0.12", + "resolved": "https://registry.npmjs.org/makeerror/-/makeerror-1.0.12.tgz", + "integrity": "sha512-JmqCvUhmt43madlpFzG4BQzG2Z3m6tvQDNKdClZnO3VbIudJYmxsT0FNJMeiB2+JTSlTQTSbU8QdesVmwJcmLg==", + "peer": true, + "dependencies": { + "tmpl": "1.0.5" + } + }, + "node_modules/mdn-data": { + "version": "2.0.14", + "resolved": "https://registry.npmjs.org/mdn-data/-/mdn-data-2.0.14.tgz", + "integrity": "sha512-dn6wd0uw5GsdswPFfsgMp5NSB0/aDe6fK94YJV/AJDYXL6HVLWBsxeq7js7Ad+mU2K9LAlwpk6kN2D5mwCPVow==", + "peer": true + }, + "node_modules/memoize-one": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/memoize-one/-/memoize-one-5.2.1.tgz", + "integrity": "sha512-zYiwtZUcYyXKo/np96AGZAckk+FWWsUdJ3cHGGmld7+AhvcWmQyGCYUh1hc4Q/pkOhb65dQR/pqCyK0cOaHz4Q==", + "peer": true + }, + "node_modules/merge-stream": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-2.0.0.tgz", + "integrity": "sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==" + }, + "node_modules/merge2": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", + "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==", + "dev": true, + "engines": { + "node": ">= 8" + } + }, + "node_modules/metro": { + "version": "0.76.8", + "resolved": "https://registry.npmjs.org/metro/-/metro-0.76.8.tgz", + "integrity": "sha512-oQA3gLzrrYv3qKtuWArMgHPbHu8odZOD9AoavrqSFllkPgOtmkBvNNDLCELqv5SjBfqjISNffypg+5UGG3y0pg==", + "peer": true, + "dependencies": { + "@babel/code-frame": "^7.0.0", + "@babel/core": "^7.20.0", + "@babel/generator": "^7.20.0", + "@babel/parser": "^7.20.0", + "@babel/template": "^7.0.0", + "@babel/traverse": "^7.20.0", + "@babel/types": "^7.20.0", + "accepts": "^1.3.7", + "async": "^3.2.2", + "chalk": "^4.0.0", + "ci-info": "^2.0.0", + "connect": "^3.6.5", + "debug": "^2.2.0", + "denodeify": "^1.2.1", + "error-stack-parser": "^2.0.6", + "graceful-fs": "^4.2.4", + "hermes-parser": "0.12.0", + "image-size": "^1.0.2", + "invariant": "^2.2.4", + "jest-worker": "^27.2.0", + "jsc-safe-url": "^0.2.2", + "lodash.throttle": "^4.1.1", + "metro-babel-transformer": "0.76.8", + "metro-cache": "0.76.8", + "metro-cache-key": "0.76.8", + "metro-config": "0.76.8", + "metro-core": "0.76.8", + "metro-file-map": "0.76.8", + "metro-inspector-proxy": "0.76.8", + "metro-minify-terser": "0.76.8", + "metro-minify-uglify": "0.76.8", + "metro-react-native-babel-preset": "0.76.8", + "metro-resolver": "0.76.8", + "metro-runtime": "0.76.8", + "metro-source-map": "0.76.8", + "metro-symbolicate": "0.76.8", + "metro-transform-plugins": "0.76.8", + "metro-transform-worker": "0.76.8", + "mime-types": "^2.1.27", + "node-fetch": "^2.2.0", + "nullthrows": "^1.1.1", + "rimraf": "^3.0.2", + "serialize-error": "^2.1.0", + "source-map": "^0.5.6", + "strip-ansi": "^6.0.0", + "throat": "^5.0.0", + "ws": "^7.5.1", + "yargs": "^17.6.2" + }, + "bin": { + "metro": "src/cli.js" + }, + "engines": { + "node": ">=16" + } + }, + "node_modules/metro-babel-transformer": { + "version": "0.76.8", + "resolved": "https://registry.npmjs.org/metro-babel-transformer/-/metro-babel-transformer-0.76.8.tgz", + "integrity": "sha512-Hh6PW34Ug/nShlBGxkwQJSgPGAzSJ9FwQXhUImkzdsDgVu6zj5bx258J8cJVSandjNoQ8nbaHK6CaHlnbZKbyA==", + "peer": true, + "dependencies": { + "@babel/core": "^7.20.0", + "hermes-parser": "0.12.0", + "nullthrows": "^1.1.1" + }, + "engines": { + "node": ">=16" + } + }, + "node_modules/metro-babel-transformer/node_modules/hermes-estree": { + "version": "0.12.0", + "resolved": "https://registry.npmjs.org/hermes-estree/-/hermes-estree-0.12.0.tgz", + "integrity": "sha512-+e8xR6SCen0wyAKrMT3UD0ZCCLymKhRgjEB5sS28rKiFir/fXgLoeRilRUssFCILmGHb+OvHDUlhxs0+IEyvQw==", + "peer": true + }, + "node_modules/metro-babel-transformer/node_modules/hermes-parser": { + "version": "0.12.0", + "resolved": "https://registry.npmjs.org/hermes-parser/-/hermes-parser-0.12.0.tgz", + "integrity": "sha512-d4PHnwq6SnDLhYl3LHNHvOg7nQ6rcI7QVil418REYksv0Mh3cEkHDcuhGxNQ3vgnLSLl4QSvDrFCwQNYdpWlzw==", + "peer": true, + "dependencies": { + "hermes-estree": "0.12.0" + } + }, + "node_modules/metro-cache": { + "version": "0.76.8", + "resolved": "https://registry.npmjs.org/metro-cache/-/metro-cache-0.76.8.tgz", + "integrity": "sha512-QBJSJIVNH7Hc/Yo6br/U/qQDUpiUdRgZ2ZBJmvAbmAKp2XDzsapnMwK/3BGj8JNWJF7OLrqrYHsRsukSbUBpvQ==", + "peer": true, + "dependencies": { + "metro-core": "0.76.8", + "rimraf": "^3.0.2" + }, + "engines": { + "node": ">=16" + } + }, + "node_modules/metro-cache-key": { + "version": "0.76.8", + "resolved": "https://registry.npmjs.org/metro-cache-key/-/metro-cache-key-0.76.8.tgz", + "integrity": "sha512-buKQ5xentPig9G6T37Ww/R/bC+/V1MA5xU/D8zjnhlelsrPG6w6LtHUS61ID3zZcMZqYaELWk5UIadIdDsaaLw==", + "peer": true, + "engines": { + "node": ">=16" + } + }, + "node_modules/metro-config": { + "version": "0.76.8", + "resolved": "https://registry.npmjs.org/metro-config/-/metro-config-0.76.8.tgz", + "integrity": "sha512-SL1lfKB0qGHALcAk2zBqVgQZpazDYvYFGwCK1ikz0S6Y/CM2i2/HwuZN31kpX6z3mqjv/6KvlzaKoTb1otuSAA==", + "peer": true, + "dependencies": { + "connect": "^3.6.5", + "cosmiconfig": "^5.0.5", + "jest-validate": "^29.2.1", + "metro": "0.76.8", + "metro-cache": "0.76.8", + "metro-core": "0.76.8", + "metro-runtime": "0.76.8" + }, + "engines": { + "node": ">=16" + } + }, + "node_modules/metro-config/node_modules/@jest/types": { + "version": "29.6.3", + "resolved": "https://registry.npmjs.org/@jest/types/-/types-29.6.3.tgz", + "integrity": "sha512-u3UPsIilWKOM3F9CXtrG8LEJmNxwoCQC/XVj4IKYXvvpx7QIi/Kg1LI5uDmDpKlac62NUtX7eLjRh+jVZcLOzw==", + "peer": true, + "dependencies": { + "@jest/schemas": "^29.6.3", + "@types/istanbul-lib-coverage": "^2.0.0", + "@types/istanbul-reports": "^3.0.0", + "@types/node": "*", + "@types/yargs": "^17.0.8", + "chalk": "^4.0.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/metro-config/node_modules/jest-validate": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-validate/-/jest-validate-29.7.0.tgz", + "integrity": "sha512-ZB7wHqaRGVw/9hST/OuFUReG7M8vKeq0/J2egIGLdvjHCmYqGARhzXmtgi+gVeZ5uXFF219aOc3Ls2yLg27tkw==", + "peer": true, + "dependencies": { + "@jest/types": "^29.6.3", + "camelcase": "^6.2.0", + "chalk": "^4.0.0", + "jest-get-type": "^29.6.3", + "leven": "^3.1.0", + "pretty-format": "^29.7.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/metro-core": { + "version": "0.76.8", + "resolved": "https://registry.npmjs.org/metro-core/-/metro-core-0.76.8.tgz", + "integrity": "sha512-sl2QLFI3d1b1XUUGxwzw/KbaXXU/bvFYrSKz6Sg19AdYGWFyzsgZ1VISRIDf+HWm4R/TJXluhWMEkEtZuqi3qA==", + "peer": true, + "dependencies": { + "lodash.throttle": "^4.1.1", + "metro-resolver": "0.76.8" + }, + "engines": { + "node": ">=16" + } + }, + "node_modules/metro-file-map": { + "version": "0.76.8", + "resolved": "https://registry.npmjs.org/metro-file-map/-/metro-file-map-0.76.8.tgz", + "integrity": "sha512-A/xP1YNEVwO1SUV9/YYo6/Y1MmzhL4ZnVgcJC3VmHp/BYVOXVStzgVbWv2wILe56IIMkfXU+jpXrGKKYhFyHVw==", + "peer": true, + "dependencies": { + "anymatch": "^3.0.3", + "debug": "^2.2.0", + "fb-watchman": "^2.0.0", + "graceful-fs": "^4.2.4", + "invariant": "^2.2.4", + "jest-regex-util": "^27.0.6", + "jest-util": "^27.2.0", + "jest-worker": "^27.2.0", + "micromatch": "^4.0.4", + "node-abort-controller": "^3.1.1", + "nullthrows": "^1.1.1", + "walker": "^1.0.7" + }, + "engines": { + "node": ">=16" + }, + "optionalDependencies": { + "fsevents": "^2.3.2" + } + }, + "node_modules/metro-file-map/node_modules/@jest/types": { + "version": "27.5.1", + "resolved": "https://registry.npmjs.org/@jest/types/-/types-27.5.1.tgz", + "integrity": "sha512-Cx46iJ9QpwQTjIdq5VJu2QTMMs3QlEjI0x1QbBP5W1+nMzyc2XmimiRR/CbX9TO0cPTeUlxWMOu8mslYsJ8DEw==", + "peer": true, + "dependencies": { + "@types/istanbul-lib-coverage": "^2.0.0", + "@types/istanbul-reports": "^3.0.0", + "@types/node": "*", + "@types/yargs": "^16.0.0", + "chalk": "^4.0.0" + }, + "engines": { + "node": "^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0" + } + }, + "node_modules/metro-file-map/node_modules/@types/yargs": { + "version": "16.0.9", + "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-16.0.9.tgz", + "integrity": "sha512-tHhzvkFXZQeTECenFoRljLBYPZJ7jAVxqqtEI0qTLOmuultnFp4I9yKE17vTuhf7BkhCu7I4XuemPgikDVuYqA==", + "peer": true, + "dependencies": { + "@types/yargs-parser": "*" + } + }, + "node_modules/metro-file-map/node_modules/jest-util": { + "version": "27.5.1", + "resolved": "https://registry.npmjs.org/jest-util/-/jest-util-27.5.1.tgz", + "integrity": "sha512-Kv2o/8jNvX1MQ0KGtw480E/w4fBCDOnH6+6DmeKi6LZUIlKA5kwY0YNdlzaWTiVgxqAqik11QyxDOKk543aKXw==", + "peer": true, + "dependencies": { + "@jest/types": "^27.5.1", + "@types/node": "*", + "chalk": "^4.0.0", + "ci-info": "^3.2.0", + "graceful-fs": "^4.2.9", + "picomatch": "^2.2.3" + }, + "engines": { + "node": "^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0" + } + }, + "node_modules/metro-inspector-proxy": { + "version": "0.76.8", + "resolved": "https://registry.npmjs.org/metro-inspector-proxy/-/metro-inspector-proxy-0.76.8.tgz", + "integrity": "sha512-Us5o5UEd4Smgn1+TfHX4LvVPoWVo9VsVMn4Ldbk0g5CQx3Gu0ygc/ei2AKPGTwsOZmKxJeACj7yMH2kgxQP/iw==", + "peer": true, + "dependencies": { + "connect": "^3.6.5", + "debug": "^2.2.0", + "node-fetch": "^2.2.0", + "ws": "^7.5.1", + "yargs": "^17.6.2" + }, + "bin": { + "metro-inspector-proxy": "src/cli.js" + }, + "engines": { + "node": ">=16" + } + }, + "node_modules/metro-inspector-proxy/node_modules/ws": { + "version": "7.5.9", + "resolved": "https://registry.npmjs.org/ws/-/ws-7.5.9.tgz", + "integrity": "sha512-F+P9Jil7UiSKSkppIiD94dN07AwvFixvLIj1Og1Rl9GGMuNipJnV9JzjD6XuqmAeiswGvUmNLjr5cFuXwNS77Q==", + "peer": true, + "engines": { + "node": ">=8.3.0" + }, + "peerDependencies": { + "bufferutil": "^4.0.1", + "utf-8-validate": "^5.0.2" + }, + "peerDependenciesMeta": { + "bufferutil": { + "optional": true + }, + "utf-8-validate": { + "optional": true + } + } + }, + "node_modules/metro-minify-terser": { + "version": "0.76.8", + "resolved": "https://registry.npmjs.org/metro-minify-terser/-/metro-minify-terser-0.76.8.tgz", + "integrity": "sha512-Orbvg18qXHCrSj1KbaeSDVYRy/gkro2PC7Fy2tDSH1c9RB4aH8tuMOIXnKJE+1SXxBtjWmQ5Yirwkth2DyyEZA==", + "peer": true, + "dependencies": { + "terser": "^5.15.0" + }, + "engines": { + "node": ">=16" + } + }, + "node_modules/metro-minify-uglify": { + "version": "0.76.8", + "resolved": "https://registry.npmjs.org/metro-minify-uglify/-/metro-minify-uglify-0.76.8.tgz", + "integrity": "sha512-6l8/bEvtVaTSuhG1FqS0+Mc8lZ3Bl4RI8SeRIifVLC21eeSDp4CEBUWSGjpFyUDfi6R5dXzYaFnSgMNyfxADiQ==", + "peer": true, + "dependencies": { + "uglify-es": "^3.1.9" + }, + "engines": { + "node": ">=16" + } + }, + "node_modules/metro-react-native-babel-preset": { + "version": "0.76.8", + "resolved": "https://registry.npmjs.org/metro-react-native-babel-preset/-/metro-react-native-babel-preset-0.76.8.tgz", + "integrity": "sha512-Ptza08GgqzxEdK8apYsjTx2S8WDUlS2ilBlu9DR1CUcHmg4g3kOkFylZroogVAUKtpYQNYwAvdsjmrSdDNtiAg==", + "peer": true, + "dependencies": { + "@babel/core": "^7.20.0", + "@babel/plugin-proposal-async-generator-functions": "^7.0.0", + "@babel/plugin-proposal-class-properties": "^7.18.0", + "@babel/plugin-proposal-export-default-from": "^7.0.0", + "@babel/plugin-proposal-nullish-coalescing-operator": "^7.18.0", + "@babel/plugin-proposal-numeric-separator": "^7.0.0", + "@babel/plugin-proposal-object-rest-spread": "^7.20.0", + "@babel/plugin-proposal-optional-catch-binding": "^7.0.0", + "@babel/plugin-proposal-optional-chaining": "^7.20.0", + "@babel/plugin-syntax-dynamic-import": "^7.8.0", + "@babel/plugin-syntax-export-default-from": "^7.0.0", + "@babel/plugin-syntax-flow": "^7.18.0", + "@babel/plugin-syntax-nullish-coalescing-operator": "^7.0.0", + "@babel/plugin-syntax-optional-chaining": "^7.0.0", + "@babel/plugin-transform-arrow-functions": "^7.0.0", + "@babel/plugin-transform-async-to-generator": "^7.20.0", + "@babel/plugin-transform-block-scoping": "^7.0.0", + "@babel/plugin-transform-classes": "^7.0.0", + "@babel/plugin-transform-computed-properties": "^7.0.0", + "@babel/plugin-transform-destructuring": "^7.20.0", + "@babel/plugin-transform-flow-strip-types": "^7.20.0", + "@babel/plugin-transform-function-name": "^7.0.0", + "@babel/plugin-transform-literals": "^7.0.0", + "@babel/plugin-transform-modules-commonjs": "^7.0.0", + "@babel/plugin-transform-named-capturing-groups-regex": "^7.0.0", + "@babel/plugin-transform-parameters": "^7.0.0", + "@babel/plugin-transform-react-display-name": "^7.0.0", + "@babel/plugin-transform-react-jsx": "^7.0.0", + "@babel/plugin-transform-react-jsx-self": "^7.0.0", + "@babel/plugin-transform-react-jsx-source": "^7.0.0", + "@babel/plugin-transform-runtime": "^7.0.0", + "@babel/plugin-transform-shorthand-properties": "^7.0.0", + "@babel/plugin-transform-spread": "^7.0.0", + "@babel/plugin-transform-sticky-regex": "^7.0.0", + "@babel/plugin-transform-typescript": "^7.5.0", + "@babel/plugin-transform-unicode-regex": "^7.0.0", + "@babel/template": "^7.0.0", + "babel-plugin-transform-flow-enums": "^0.0.2", + "react-refresh": "^0.4.0" + }, + "engines": { + "node": ">=16" + }, + "peerDependencies": { + "@babel/core": "*" + } + }, + "node_modules/metro-react-native-babel-transformer": { + "version": "0.76.8", + "resolved": "https://registry.npmjs.org/metro-react-native-babel-transformer/-/metro-react-native-babel-transformer-0.76.8.tgz", + "integrity": "sha512-3h+LfS1WG1PAzhq8QF0kfXjxuXetbY/lgz8vYMQhgrMMp17WM1DNJD0gjx8tOGYbpbBC1qesJ45KMS4o5TA73A==", + "peer": true, + "dependencies": { + "@babel/core": "^7.20.0", + "babel-preset-fbjs": "^3.4.0", + "hermes-parser": "0.12.0", + "metro-react-native-babel-preset": "0.76.8", + "nullthrows": "^1.1.1" + }, + "engines": { + "node": ">=16" + }, + "peerDependencies": { + "@babel/core": "*" + } + }, + "node_modules/metro-react-native-babel-transformer/node_modules/hermes-estree": { + "version": "0.12.0", + "resolved": "https://registry.npmjs.org/hermes-estree/-/hermes-estree-0.12.0.tgz", + "integrity": "sha512-+e8xR6SCen0wyAKrMT3UD0ZCCLymKhRgjEB5sS28rKiFir/fXgLoeRilRUssFCILmGHb+OvHDUlhxs0+IEyvQw==", + "peer": true + }, + "node_modules/metro-react-native-babel-transformer/node_modules/hermes-parser": { + "version": "0.12.0", + "resolved": "https://registry.npmjs.org/hermes-parser/-/hermes-parser-0.12.0.tgz", + "integrity": "sha512-d4PHnwq6SnDLhYl3LHNHvOg7nQ6rcI7QVil418REYksv0Mh3cEkHDcuhGxNQ3vgnLSLl4QSvDrFCwQNYdpWlzw==", + "peer": true, + "dependencies": { + "hermes-estree": "0.12.0" + } + }, + "node_modules/metro-resolver": { + "version": "0.76.8", + "resolved": "https://registry.npmjs.org/metro-resolver/-/metro-resolver-0.76.8.tgz", + "integrity": "sha512-KccOqc10vrzS7ZhG2NSnL2dh3uVydarB7nOhjreQ7C4zyWuiW9XpLC4h47KtGQv3Rnv/NDLJYeDqaJ4/+140HQ==", + "peer": true, + "engines": { + "node": ">=16" + } + }, + "node_modules/metro-runtime": { + "version": "0.76.8", + "resolved": "https://registry.npmjs.org/metro-runtime/-/metro-runtime-0.76.8.tgz", + "integrity": "sha512-XKahvB+iuYJSCr3QqCpROli4B4zASAYpkK+j3a0CJmokxCDNbgyI4Fp88uIL6rNaZfN0Mv35S0b99SdFXIfHjg==", + "peer": true, + "dependencies": { + "@babel/runtime": "^7.0.0", + "react-refresh": "^0.4.0" + }, + "engines": { + "node": ">=16" + } + }, + "node_modules/metro-source-map": { + "version": "0.76.8", + "resolved": "https://registry.npmjs.org/metro-source-map/-/metro-source-map-0.76.8.tgz", + "integrity": "sha512-Hh0ncPsHPVf6wXQSqJqB3K9Zbudht4aUtNpNXYXSxH+pteWqGAXnjtPsRAnCsCWl38wL0jYF0rJDdMajUI3BDw==", + "peer": true, + "dependencies": { + "@babel/traverse": "^7.20.0", + "@babel/types": "^7.20.0", + "invariant": "^2.2.4", + "metro-symbolicate": "0.76.8", + "nullthrows": "^1.1.1", + "ob1": "0.76.8", + "source-map": "^0.5.6", + "vlq": "^1.0.0" + }, + "engines": { + "node": ">=16" + } + }, + "node_modules/metro-source-map/node_modules/source-map": { + "version": "0.5.7", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", + "integrity": "sha512-LbrmJOMUSdEVxIKvdcJzQC+nQhe8FUZQTXQy6+I75skNgn3OoQ0DZA8YnFa7gp8tqtL3KPf1kmo0R5DoApeSGQ==", + "peer": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/metro-symbolicate": { + "version": "0.76.8", + "resolved": "https://registry.npmjs.org/metro-symbolicate/-/metro-symbolicate-0.76.8.tgz", + "integrity": "sha512-LrRL3uy2VkzrIXVlxoPtqb40J6Bf1mlPNmUQewipc3qfKKFgtPHBackqDy1YL0njDsWopCKcfGtFYLn0PTUn3w==", + "peer": true, + "dependencies": { + "invariant": "^2.2.4", + "metro-source-map": "0.76.8", + "nullthrows": "^1.1.1", + "source-map": "^0.5.6", + "through2": "^2.0.1", + "vlq": "^1.0.0" + }, + "bin": { + "metro-symbolicate": "src/index.js" + }, + "engines": { + "node": ">=16" + } + }, + "node_modules/metro-symbolicate/node_modules/source-map": { + "version": "0.5.7", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", + "integrity": "sha512-LbrmJOMUSdEVxIKvdcJzQC+nQhe8FUZQTXQy6+I75skNgn3OoQ0DZA8YnFa7gp8tqtL3KPf1kmo0R5DoApeSGQ==", + "peer": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/metro-transform-plugins": { + "version": "0.76.8", + "resolved": "https://registry.npmjs.org/metro-transform-plugins/-/metro-transform-plugins-0.76.8.tgz", + "integrity": "sha512-PlkGTQNqS51Bx4vuufSQCdSn2R2rt7korzngo+b5GCkeX5pjinPjnO2kNhQ8l+5bO0iUD/WZ9nsM2PGGKIkWFA==", + "peer": true, + "dependencies": { + "@babel/core": "^7.20.0", + "@babel/generator": "^7.20.0", + "@babel/template": "^7.0.0", + "@babel/traverse": "^7.20.0", + "nullthrows": "^1.1.1" + }, + "engines": { + "node": ">=16" + } + }, + "node_modules/metro-transform-worker": { + "version": "0.76.8", + "resolved": "https://registry.npmjs.org/metro-transform-worker/-/metro-transform-worker-0.76.8.tgz", + "integrity": "sha512-mE1fxVAnJKmwwJyDtThildxxos9+DGs9+vTrx2ktSFMEVTtXS/bIv2W6hux1pqivqAfyJpTeACXHk5u2DgGvIQ==", + "peer": true, + "dependencies": { + "@babel/core": "^7.20.0", + "@babel/generator": "^7.20.0", + "@babel/parser": "^7.20.0", + "@babel/types": "^7.20.0", + "babel-preset-fbjs": "^3.4.0", + "metro": "0.76.8", + "metro-babel-transformer": "0.76.8", + "metro-cache": "0.76.8", + "metro-cache-key": "0.76.8", + "metro-source-map": "0.76.8", + "metro-transform-plugins": "0.76.8", + "nullthrows": "^1.1.1" + }, + "engines": { + "node": ">=16" + } + }, + "node_modules/metro/node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "peer": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/metro/node_modules/ci-info": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-2.0.0.tgz", + "integrity": "sha512-5tK7EtrZ0N+OLFMthtqOj4fI2Jeb88C4CAZPu25LDVUgXJ0A3Js4PMGqrn0JU1W0Mh1/Z8wZzYPxqUrXeBboCQ==", + "peer": true + }, + "node_modules/metro/node_modules/hermes-estree": { + "version": "0.12.0", + "resolved": "https://registry.npmjs.org/hermes-estree/-/hermes-estree-0.12.0.tgz", + "integrity": "sha512-+e8xR6SCen0wyAKrMT3UD0ZCCLymKhRgjEB5sS28rKiFir/fXgLoeRilRUssFCILmGHb+OvHDUlhxs0+IEyvQw==", + "peer": true + }, + "node_modules/metro/node_modules/hermes-parser": { + "version": "0.12.0", + "resolved": "https://registry.npmjs.org/hermes-parser/-/hermes-parser-0.12.0.tgz", + "integrity": "sha512-d4PHnwq6SnDLhYl3LHNHvOg7nQ6rcI7QVil418REYksv0Mh3cEkHDcuhGxNQ3vgnLSLl4QSvDrFCwQNYdpWlzw==", + "peer": true, + "dependencies": { + "hermes-estree": "0.12.0" + } + }, + "node_modules/metro/node_modules/image-size": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/image-size/-/image-size-1.1.1.tgz", + "integrity": "sha512-541xKlUw6jr/6gGuk92F+mYM5zaFAc5ahphvkqvNe2bQ6gVBkd6bfrmVJ2t4KDAfikAYZyIqTnktX3i6/aQDrQ==", + "peer": true, + "dependencies": { + "queue": "6.0.2" + }, + "bin": { + "image-size": "bin/image-size.js" + }, + "engines": { + "node": ">=16.x" + } + }, + "node_modules/metro/node_modules/source-map": { + "version": "0.5.7", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", + "integrity": "sha512-LbrmJOMUSdEVxIKvdcJzQC+nQhe8FUZQTXQy6+I75skNgn3OoQ0DZA8YnFa7gp8tqtL3KPf1kmo0R5DoApeSGQ==", + "peer": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/metro/node_modules/strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "peer": true, + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/metro/node_modules/ws": { + "version": "7.5.9", + "resolved": "https://registry.npmjs.org/ws/-/ws-7.5.9.tgz", + "integrity": "sha512-F+P9Jil7UiSKSkppIiD94dN07AwvFixvLIj1Og1Rl9GGMuNipJnV9JzjD6XuqmAeiswGvUmNLjr5cFuXwNS77Q==", + "peer": true, + "engines": { + "node": ">=8.3.0" + }, + "peerDependencies": { + "bufferutil": "^4.0.1", + "utf-8-validate": "^5.0.2" + }, + "peerDependenciesMeta": { + "bufferutil": { + "optional": true + }, + "utf-8-validate": { + "optional": true + } + } + }, + "node_modules/micromatch": { + "version": "4.0.5", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.5.tgz", + "integrity": "sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA==", + "dependencies": { + "braces": "^3.0.2", + "picomatch": "^2.3.1" + }, + "engines": { + "node": ">=8.6" + } + }, + "node_modules/mime": { + "version": "2.6.0", + "resolved": "https://registry.npmjs.org/mime/-/mime-2.6.0.tgz", + "integrity": "sha512-USPkMeET31rOMiarsBNIHZKLGgvKc/LrjofAnBlOttf5ajRvqiRA8QsenbcooctK6d6Ts6aqZXBA+XbkKthiQg==", + "peer": true, + "bin": { + "mime": "cli.js" + }, + "engines": { + "node": ">=4.0.0" + } + }, + "node_modules/mime-db": { + "version": "1.52.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", + "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==", + "peer": true, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/mime-types": { + "version": "2.1.35", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz", + "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==", + "peer": true, + "dependencies": { + "mime-db": "1.52.0" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/mimic-fn": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz", + "integrity": "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==", + "engines": { + "node": ">=6" + } + }, + "node_modules/minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, + "node_modules/minimist": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.8.tgz", + "integrity": "sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==", + "peer": true, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/mkdirp": { + "version": "0.5.6", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.6.tgz", + "integrity": "sha512-FP+p8RB8OWpF3YZBCrP5gtADmtXApB5AMLn+vdyA+PyxCjrCs00mjyUozssO33cwDeT3wNGdLxJ5M//YqtHAJw==", + "peer": true, + "dependencies": { + "minimist": "^1.2.6" + }, + "bin": { + "mkdirp": "bin/cmd.js" + } + }, + "node_modules/ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==", + "peer": true + }, + "node_modules/negotiator": { + "version": "0.6.3", + "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.3.tgz", + "integrity": "sha512-+EUsqGPLsM+j/zdChZjsnX51g4XrHFOIXwfnCVPGlQk/k5giakcKsuxCObBRu6DSm9opw/O6slWbJdghQM4bBg==", + "peer": true, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/neo-async": { + "version": "2.6.2", + "resolved": "https://registry.npmjs.org/neo-async/-/neo-async-2.6.2.tgz", + "integrity": "sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw==", + "peer": true + }, + "node_modules/nocache": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/nocache/-/nocache-3.0.4.tgz", + "integrity": "sha512-WDD0bdg9mbq6F4mRxEYcPWwfA1vxd0mrvKOyxI7Xj/atfRHVeutzuWByG//jfm4uPzp0y4Kj051EORCBSQMycw==", + "peer": true, + "engines": { + "node": ">=12.0.0" + } + }, + "node_modules/node-abort-controller": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/node-abort-controller/-/node-abort-controller-3.1.1.tgz", + "integrity": "sha512-AGK2yQKIjRuqnc6VkX2Xj5d+QW8xZ87pa1UK6yA6ouUyuxfHuMP6umE5QK7UmTeOAymo+Zx1Fxiuw9rVx8taHQ==", + "peer": true + }, + "node_modules/node-dir": { + "version": "0.1.17", + "resolved": "https://registry.npmjs.org/node-dir/-/node-dir-0.1.17.tgz", + "integrity": "sha512-tmPX422rYgofd4epzrNoOXiE8XFZYOcCq1vD7MAXCDO+O+zndlA2ztdKKMa+EeuBG5tHETpr4ml4RGgpqDCCAg==", + "peer": true, + "dependencies": { + "minimatch": "^3.0.2" + }, + "engines": { + "node": ">= 0.10.5" + } + }, + "node_modules/node-fetch": { + "version": "2.6.11", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.11.tgz", + "integrity": "sha512-4I6pdBY1EthSqDmJkiNk3JIT8cswwR9nfeW/cPdUagJYEQG7R95WRH74wpz7ma8Gh/9dI9FP+OU+0E4FvtA55w==", + "peer": true, + "dependencies": { + "whatwg-url": "^5.0.0" + }, + "engines": { + "node": "4.x || >=6.0.0" + }, + "peerDependencies": { + "encoding": "^0.1.0" + }, + "peerDependenciesMeta": { + "encoding": { + "optional": true + } + } + }, + "node_modules/node-int64": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/node-int64/-/node-int64-0.4.0.tgz", + "integrity": "sha512-O5lz91xSOeoXP6DulyHfllpq+Eg00MWitZIbtPfoSEvqIHdl5gfcY6hYzDWnj0qD5tz52PI08u9qUvSVeUBeHw==", + "peer": true + }, + "node_modules/node-releases": { + "version": "2.0.10", + "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.10.tgz", + "integrity": "sha512-5GFldHPXVG/YZmFzJvKK2zDSzPKhEp0+ZR5SVaoSag9fsL5YgHbUHDfnG5494ISANDcK4KwPXAx2xqVEydmd7w==" + }, + "node_modules/node-stream-zip": { + "version": "1.15.0", + "resolved": "https://registry.npmjs.org/node-stream-zip/-/node-stream-zip-1.15.0.tgz", + "integrity": "sha512-LN4fydt9TqhZhThkZIVQnF9cwjU3qmUH9h78Mx/K7d3VvfRqqwthLwJEUOEL0QPZ0XQmNN7be5Ggit5+4dq3Bw==", + "peer": true, + "engines": { + "node": ">=0.12.0" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/antelle" + } + }, + "node_modules/normalize-path": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", + "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", + "peer": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/npm-run-path": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-4.0.1.tgz", + "integrity": "sha512-S48WzZW777zhNIrn7gxOlISNAqi9ZC/uQFnRdbeIHhZhCA6UqpkOT8T1G7BvfdgP4Er8gF4sUbaS0i7QvIfCWw==", + "dependencies": { + "path-key": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/nth-check": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/nth-check/-/nth-check-2.1.1.tgz", + "integrity": "sha512-lqjrjmaOoAnWfMmBPL+XNnynZh2+swxiX3WUE0s4yEHI6m+AwrK2UZOimIRl3X/4QctVqS8AiZjFqyOGrMXb/w==", + "peer": true, + "dependencies": { + "boolbase": "^1.0.0" + }, + "funding": { + "url": "https://github.com/fb55/nth-check?sponsor=1" + } + }, + "node_modules/nullthrows": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/nullthrows/-/nullthrows-1.1.1.tgz", + "integrity": "sha512-2vPPEi+Z7WqML2jZYddDIfy5Dqb0r2fze2zTxNNknZaFpVHU3mFB3R+DWeJWGVx0ecvttSGlJTI+WG+8Z4cDWw==", + "peer": true + }, + "node_modules/ob1": { + "version": "0.76.8", + "resolved": "https://registry.npmjs.org/ob1/-/ob1-0.76.8.tgz", + "integrity": "sha512-dlBkJJV5M/msj9KYA9upc+nUWVwuOFFTbu28X6kZeGwcuW+JxaHSBZ70SYQnk5M+j5JbNLR6yKHmgW4M5E7X5g==", + "peer": true, + "engines": { + "node": ">=16" + } + }, + "node_modules/object-assign": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", + "integrity": "sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==", + "peer": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/on-finished": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.3.0.tgz", + "integrity": "sha512-ikqdkGAAyf/X/gPhXGvfgAytDZtDbr+bkNUJ0N9h5MI/dmdgCs3l6hoHrcUv41sRKew3jIwrp4qQDXiK99Utww==", + "peer": true, + "dependencies": { + "ee-first": "1.1.1" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/on-headers": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/on-headers/-/on-headers-1.0.2.tgz", + "integrity": "sha512-pZAE+FJLoyITytdqK0U5s+FIpjN0JP3OzFi/u8Rx+EV5/W+JTWGXG8xFzevE7AjBfDqHv/8vL8qQsIhHnqRkrA==", + "peer": true, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/once": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", + "dependencies": { + "wrappy": "1" + } + }, + "node_modules/onetime": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/onetime/-/onetime-5.1.2.tgz", + "integrity": "sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg==", + "dependencies": { + "mimic-fn": "^2.1.0" + }, + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/open": { + "version": "6.4.0", + "resolved": "https://registry.npmjs.org/open/-/open-6.4.0.tgz", + "integrity": "sha512-IFenVPgF70fSm1keSd2iDBIDIBZkroLeuffXq+wKTzTJlBpesFWojV9lb8mzOfaAzM1sr7HQHuO0vtV0zYekGg==", + "peer": true, + "dependencies": { + "is-wsl": "^1.1.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/ora": { + "version": "5.4.1", + "resolved": "https://registry.npmjs.org/ora/-/ora-5.4.1.tgz", + "integrity": "sha512-5b6Y85tPxZZ7QytO+BQzysW31HJku27cRIlkbAXaNx+BdcVi+LlRFmVXzeF6a7JCwJpyw5c4b+YSVImQIrBpuQ==", + "peer": true, + "dependencies": { + "bl": "^4.1.0", + "chalk": "^4.1.0", + "cli-cursor": "^3.1.0", + "cli-spinners": "^2.5.0", + "is-interactive": "^1.0.0", + "is-unicode-supported": "^0.1.0", + "log-symbols": "^4.1.0", + "strip-ansi": "^6.0.0", + "wcwidth": "^1.0.1" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/ora/node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "peer": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/ora/node_modules/strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "peer": true, + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/p-limit": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", + "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", + "peer": true, + "dependencies": { + "p-try": "^2.0.0" + }, + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/p-locate": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", + "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", + "peer": true, + "dependencies": { + "p-limit": "^2.2.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/p-map": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/p-map/-/p-map-4.0.0.tgz", + "integrity": "sha512-/bjOqmgETBYB5BoEeGVea8dmvHb2m9GLy1E9W43yeyfP6QQCZGFNa+XRceJEuDB6zqr+gKpIAmlLebMpykw/MQ==", + "dev": true, + "dependencies": { + "aggregate-error": "^3.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/p-try": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", + "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", + "peer": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/parent-module": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", + "integrity": "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==", + "dev": true, + "dependencies": { + "callsites": "^3.0.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/parent-module/node_modules/callsites": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", + "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/parse-json": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-4.0.0.tgz", + "integrity": "sha512-aOIos8bujGN93/8Ox/jPLh7RwVnPEysynVFE+fQZyg6jKELEHwzgKdLRFHUgXJL6kylijVSBC4BvN9OmsB48Rw==", + "peer": true, + "dependencies": { + "error-ex": "^1.3.1", + "json-parse-better-errors": "^1.0.1" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/parseurl": { + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz", + "integrity": "sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==", + "peer": true, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/path-exists": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", + "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", + "peer": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/path-is-absolute": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", + "integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/path-key": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", + "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", + "engines": { + "node": ">=8" + } + }, + "node_modules/path-parse": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz", + "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==" + }, + "node_modules/path-type": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz", + "integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/picocolors": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.0.0.tgz", + "integrity": "sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==" + }, + "node_modules/picomatch": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", + "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", + "engines": { + "node": ">=8.6" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, + "node_modules/pify": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/pify/-/pify-4.0.1.tgz", + "integrity": "sha512-uB80kBFb/tfd68bVleG9T5GGsGPjJrLAUpR5PZIrhBnIaRTQRjqdJSsIKkOP6OAIFbj7GOrcudc5pNjZ+geV2g==", + "peer": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/pirates": { + "version": "4.0.6", + "resolved": "https://registry.npmjs.org/pirates/-/pirates-4.0.6.tgz", + "integrity": "sha512-saLsH7WeYYPiD25LDuLRRY/i+6HaPYr6G1OUlN39otzkSTxKnubR9RTxS3/Kk50s1g2JTgFwWQDQyplC5/SHZg==", + "peer": true, + "engines": { + "node": ">= 6" + } + }, + "node_modules/pkg-dir": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-3.0.0.tgz", + "integrity": "sha512-/E57AYkoeQ25qkxMj5PBOVgF8Kiu/h7cYS30Z5+R7WaiCCBfLq58ZI/dSeaEKb9WVJV5n/03QwrN3IeWIFllvw==", + "peer": true, + "dependencies": { + "find-up": "^3.0.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/pkg-dir/node_modules/find-up": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-3.0.0.tgz", + "integrity": "sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg==", + "peer": true, + "dependencies": { + "locate-path": "^3.0.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/pkg-dir/node_modules/locate-path": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-3.0.0.tgz", + "integrity": "sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A==", + "peer": true, + "dependencies": { + "p-locate": "^3.0.0", + "path-exists": "^3.0.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/pkg-dir/node_modules/p-locate": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-3.0.0.tgz", + "integrity": "sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ==", + "peer": true, + "dependencies": { + "p-limit": "^2.0.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/pkg-dir/node_modules/path-exists": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", + "integrity": "sha512-bpC7GYwiDYQ4wYLe+FA8lhRjhQCMcQGuSgGGqDkg/QerRWw9CmGRT0iSOVRSZJ29NMLZgIzqaljJ63oaL4NIJQ==", + "peer": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/pretty-format": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-29.7.0.tgz", + "integrity": "sha512-Pdlw/oPxN+aXdmM9R00JVC9WVFoCLTKJvDVLgmJ+qAffBMxsV85l/Lu7sNx4zSzPyoL2euImuEwHhOXdEgNFZQ==", + "dependencies": { + "@jest/schemas": "^29.6.3", + "ansi-styles": "^5.0.0", + "react-is": "^18.0.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/pretty-format/node_modules/ansi-styles": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-5.2.0.tgz", + "integrity": "sha512-Cxwpt2SfTzTtXcfOlzGEee8O+c+MmUgGrNiBcXnuWxuFJHe6a5Hz7qwhwe5OgaSYI0IJvkLqWX1ASG+cJOkEiA==", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/process-nextick-args": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", + "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==", + "peer": true + }, + "node_modules/promise": { + "version": "8.3.0", + "resolved": "https://registry.npmjs.org/promise/-/promise-8.3.0.tgz", + "integrity": "sha512-rZPNPKTOYVNEEKFaq1HqTgOwZD+4/YHS5ukLzQCypkj+OkYx7iv0mA91lJlpPPZ8vMau3IIGj5Qlwrx+8iiSmg==", + "peer": true, + "dependencies": { + "asap": "~2.0.6" + } + }, + "node_modules/prompts": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/prompts/-/prompts-2.4.2.tgz", + "integrity": "sha512-NxNv/kLguCA7p3jE8oL2aEBsrJWgAakBpgmgK6lpPWV+WuOmY6r2/zbAVnP+T8bQlA0nzHXSJSJW0Hq7ylaD2Q==", + "dependencies": { + "kleur": "^3.0.3", + "sisteransi": "^1.0.5" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/prop-types": { + "version": "15.8.1", + "resolved": "https://registry.npmjs.org/prop-types/-/prop-types-15.8.1.tgz", + "integrity": "sha512-oj87CgZICdulUohogVAR7AjlC0327U4el4L6eAvOqCeudMDVU0NThNaV+b9Df4dXgSP1gXMTnPdhfe/2qDH5cg==", + "peer": true, + "dependencies": { + "loose-envify": "^1.4.0", + "object-assign": "^4.1.1", + "react-is": "^16.13.1" + } + }, + "node_modules/prop-types/node_modules/react-is": { + "version": "16.13.1", + "resolved": "https://registry.npmjs.org/react-is/-/react-is-16.13.1.tgz", + "integrity": "sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==", + "peer": true + }, + "node_modules/pump": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.0.tgz", + "integrity": "sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww==", + "dev": true, + "dependencies": { + "end-of-stream": "^1.1.0", + "once": "^1.3.1" + } + }, + "node_modules/queue": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/queue/-/queue-6.0.2.tgz", + "integrity": "sha512-iHZWu+q3IdFZFX36ro/lKBkSvfkztY5Y7HMiPlOUjhupPcG2JMfst2KKEpu5XndviX/3UhFbRngUPNKtgvtZiA==", + "peer": true, + "dependencies": { + "inherits": "~2.0.3" + } + }, + "node_modules/queue-microtask": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", + "integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] + }, + "node_modules/range-parser": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.1.tgz", + "integrity": "sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg==", + "peer": true, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/react": { + "version": "18.2.0", + "resolved": "https://registry.npmjs.org/react/-/react-18.2.0.tgz", + "integrity": "sha512-/3IjMdb2L9QbBdWiW5e3P2/npwMBaU9mHCSCUzNln0ZCYbcfTsGbTJrU/kGemdH2IWmB2ioZ+zkxtmq6g09fGQ==", + "peer": true, + "dependencies": { + "loose-envify": "^1.1.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/react-devtools-core": { + "version": "4.27.7", + "resolved": "https://registry.npmjs.org/react-devtools-core/-/react-devtools-core-4.27.7.tgz", + "integrity": "sha512-12N0HrhCPbD76Z7SkyJdGdXdPGouUsgV6tlEsbSpAnLDO06tjXZP+irht4wPdYwJAJRQ85DxL48eQoz7UmrSuQ==", + "peer": true, + "dependencies": { + "shell-quote": "^1.6.1", + "ws": "^7" + } + }, + "node_modules/react-devtools-core/node_modules/ws": { + "version": "7.5.9", + "resolved": "https://registry.npmjs.org/ws/-/ws-7.5.9.tgz", + "integrity": "sha512-F+P9Jil7UiSKSkppIiD94dN07AwvFixvLIj1Og1Rl9GGMuNipJnV9JzjD6XuqmAeiswGvUmNLjr5cFuXwNS77Q==", + "peer": true, + "engines": { + "node": ">=8.3.0" + }, + "peerDependencies": { + "bufferutil": "^4.0.1", + "utf-8-validate": "^5.0.2" + }, + "peerDependenciesMeta": { + "bufferutil": { + "optional": true + }, + "utf-8-validate": { + "optional": true + } + } + }, + "node_modules/react-is": { + "version": "18.2.0", + "resolved": "https://registry.npmjs.org/react-is/-/react-is-18.2.0.tgz", + "integrity": "sha512-xWGDIW6x921xtzPkhiULtthJHoJvBbF3q26fzloPCK0hsvxtPVelvftw3zjbHWSkR2km9Z+4uxbDDK/6Zw9B8w==" + }, + "node_modules/react-native": { + "version": "0.72.5", + "resolved": "https://registry.npmjs.org/react-native/-/react-native-0.72.5.tgz", + "integrity": "sha512-oIewslu5DBwOmo7x5rdzZlZXCqDIna0R4dUwVpfmVteORYLr4yaZo5wQnMeR+H7x54GaMhmgeqp0ZpULtulJFg==", + "peer": true, + "dependencies": { + "@jest/create-cache-key-function": "^29.2.1", + "@react-native-community/cli": "11.3.7", + "@react-native-community/cli-platform-android": "11.3.7", + "@react-native-community/cli-platform-ios": "11.3.7", + "@react-native/assets-registry": "^0.72.0", + "@react-native/codegen": "^0.72.7", + "@react-native/gradle-plugin": "^0.72.11", + "@react-native/js-polyfills": "^0.72.1", + "@react-native/normalize-colors": "^0.72.0", + "@react-native/virtualized-lists": "^0.72.8", + "abort-controller": "^3.0.0", + "anser": "^1.4.9", + "base64-js": "^1.1.2", + "deprecated-react-native-prop-types": "4.1.0", + "event-target-shim": "^5.0.1", + "flow-enums-runtime": "^0.0.5", + "invariant": "^2.2.4", + "jest-environment-node": "^29.2.1", + "jsc-android": "^250231.0.0", + "memoize-one": "^5.0.0", + "metro-runtime": "0.76.8", + "metro-source-map": "0.76.8", + "mkdirp": "^0.5.1", + "nullthrows": "^1.1.1", + "pretty-format": "^26.5.2", + "promise": "^8.3.0", + "react-devtools-core": "^4.27.2", + "react-refresh": "^0.4.0", + "react-shallow-renderer": "^16.15.0", + "regenerator-runtime": "^0.13.2", + "scheduler": "0.24.0-canary-efb381bbf-20230505", + "stacktrace-parser": "^0.1.10", + "use-sync-external-store": "^1.0.0", + "whatwg-fetch": "^3.0.0", + "ws": "^6.2.2", + "yargs": "^17.6.2" + }, + "bin": { + "react-native": "cli.js" + }, + "engines": { + "node": ">=16" + }, + "peerDependencies": { + "react": "18.2.0" + } + }, + "node_modules/react-native-builder-bob": { + "version": "0.20.4", + "resolved": "https://registry.npmjs.org/react-native-builder-bob/-/react-native-builder-bob-0.20.4.tgz", + "integrity": "sha512-3ZmYP8H7Fg2D8/JAPvxT78I4VWzf5DNMUf69cxWPw7Pukt+hHp1PSQ303af63uv1QXxWMJtrQ11+nuUfVqQf0Q==", + "dev": true, + "dependencies": { + "@babel/core": "^7.18.5", + "@babel/plugin-proposal-class-properties": "^7.17.12", + "@babel/preset-env": "^7.18.2", + "@babel/preset-flow": "^7.17.12", + "@babel/preset-react": "^7.17.12", + "@babel/preset-typescript": "^7.17.12", + "browserslist": "^4.20.4", + "cosmiconfig": "^7.0.1", + "cross-spawn": "^7.0.3", + "dedent": "^0.7.0", + "del": "^6.1.1", + "fs-extra": "^10.1.0", + "glob": "^8.0.3", + "is-git-dirty": "^2.0.1", + "json5": "^2.2.1", + "kleur": "^4.1.4", + "prompts": "^2.4.2", + "which": "^2.0.2", + "yargs": "^17.5.1" + }, + "bin": { + "bob": "bin/bob" + }, + "engines": { + "node": ">= 16.0.0" + }, + "optionalDependencies": { + "jetifier": "^2.0.0" + } + }, + "node_modules/react-native-builder-bob/node_modules/brace-expansion": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", + "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", + "dev": true, + "dependencies": { + "balanced-match": "^1.0.0" + } + }, + "node_modules/react-native-builder-bob/node_modules/cosmiconfig": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-7.1.0.tgz", + "integrity": "sha512-AdmX6xUzdNASswsFtmwSt7Vj8po9IuqXm0UXz7QKPuEUmPB4XyjGfaAr2PSuELMwkRMVH1EpIkX5bTZGRB3eCA==", + "dev": true, + "dependencies": { + "@types/parse-json": "^4.0.0", + "import-fresh": "^3.2.1", + "parse-json": "^5.0.0", + "path-type": "^4.0.0", + "yaml": "^1.10.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/react-native-builder-bob/node_modules/fs-extra": { + "version": "10.1.0", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-10.1.0.tgz", + "integrity": "sha512-oRXApq54ETRj4eMiFzGnHWGy+zo5raudjuxN0b8H7s/RU2oW0Wvsx9O0ACRN/kRq9E8Vu/ReskGB5o3ji+FzHQ==", + "dev": true, + "dependencies": { + "graceful-fs": "^4.2.0", + "jsonfile": "^6.0.1", + "universalify": "^2.0.0" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/react-native-builder-bob/node_modules/glob": { + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/glob/-/glob-8.1.0.tgz", + "integrity": "sha512-r8hpEjiQEYlF2QU0df3dS+nxxSIreXQS1qRhMJM0Q5NDdR386C7jb7Hwwod8Fgiuex+k0GFjgft18yvxm5XoCQ==", + "dev": true, + "dependencies": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^5.0.1", + "once": "^1.3.0" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/react-native-builder-bob/node_modules/import-fresh": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.0.tgz", + "integrity": "sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==", + "dev": true, + "dependencies": { + "parent-module": "^1.0.0", + "resolve-from": "^4.0.0" + }, + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/react-native-builder-bob/node_modules/jsonfile": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-6.1.0.tgz", + "integrity": "sha512-5dgndWOriYSm5cnYaJNhalLNDKOqFwyDB/rr1E9ZsGciGvKPs8R2xYGCacuf3z6K1YKDz182fd+fY3cn3pMqXQ==", + "dev": true, + "dependencies": { + "universalify": "^2.0.0" + }, + "optionalDependencies": { + "graceful-fs": "^4.1.6" + } + }, + "node_modules/react-native-builder-bob/node_modules/kleur": { + "version": "4.1.5", + "resolved": "https://registry.npmjs.org/kleur/-/kleur-4.1.5.tgz", + "integrity": "sha512-o+NO+8WrRiQEE4/7nwRJhN1HWpVmJm511pBHUxPLtp0BUISzlBplORYSmTclCnJvQq2tKu/sgl3xVpkc7ZWuQQ==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/react-native-builder-bob/node_modules/minimatch": { + "version": "5.1.6", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.6.tgz", + "integrity": "sha512-lKwV/1brpG6mBUFHtb7NUmtABCb2WZZmm2wNiOA5hAb8VdCS4B3dtMWyvcoViccwAW/COERjXLt0zP1zXUN26g==", + "dev": true, + "dependencies": { + "brace-expansion": "^2.0.1" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/react-native-builder-bob/node_modules/parse-json": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-5.2.0.tgz", + "integrity": "sha512-ayCKvm/phCGxOkYRSCM82iDwct8/EonSEgCSxWxD7ve6jHggsFl4fZVQBPRNgQoKiuV/odhFrGzQXZwbifC8Rg==", + "dev": true, + "dependencies": { + "@babel/code-frame": "^7.0.0", + "error-ex": "^1.3.1", + "json-parse-even-better-errors": "^2.3.0", + "lines-and-columns": "^1.1.6" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/react-native-builder-bob/node_modules/resolve-from": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", + "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/react-native-builder-bob/node_modules/universalify": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.0.tgz", + "integrity": "sha512-hAZsKq7Yy11Zu1DE0OzWjw7nnLZmJZYTDZZyEFHZdUhV8FkH5MCfoU1XMaxXovpyW5nq5scPqq0ZDP9Zyl04oQ==", + "dev": true, + "engines": { + "node": ">= 10.0.0" + } + }, + "node_modules/react-native-svg": { + "version": "15.0.0", + "resolved": "https://registry.npmjs.org/react-native-svg/-/react-native-svg-15.0.0.tgz", + "integrity": "sha512-ZUEXlzdU3cHjhOuc4BP7fbvabmz8yIuH4ocKSEr5V3P5skk2wnbEyZd3p7dzV9IoODgguCe7tcrNRGwr9pLRig==", + "peer": true, + "dependencies": { + "css-select": "^5.1.0", + "css-tree": "^1.1.3" + }, + "peerDependencies": { + "react": "*", + "react-native": "*" + } + }, + "node_modules/react-native/node_modules/@jest/types": { + "version": "26.6.2", + "resolved": "https://registry.npmjs.org/@jest/types/-/types-26.6.2.tgz", + "integrity": "sha512-fC6QCp7Sc5sX6g8Tvbmj4XUTbyrik0akgRy03yjXbQaBWWNWGE7SGtJk98m0N8nzegD/7SggrUlivxo5ax4KWQ==", + "peer": true, + "dependencies": { + "@types/istanbul-lib-coverage": "^2.0.0", + "@types/istanbul-reports": "^3.0.0", + "@types/node": "*", + "@types/yargs": "^15.0.0", + "chalk": "^4.0.0" + }, + "engines": { + "node": ">= 10.14.2" + } + }, + "node_modules/react-native/node_modules/@react-native/codegen": { + "version": "0.72.8", + "resolved": "https://registry.npmjs.org/@react-native/codegen/-/codegen-0.72.8.tgz", + "integrity": "sha512-jQCcBlXV7B7ap5VlHhwIPieYz89yiRgwd2FPUBu+unz+kcJ6pAiB2U8RdLDmyIs8fiWd+Vq1xxaWs4TR329/ng==", + "peer": true, + "dependencies": { + "@babel/parser": "^7.20.0", + "flow-parser": "^0.206.0", + "glob": "^7.1.1", + "invariant": "^2.2.4", + "jscodeshift": "^0.14.0", + "mkdirp": "^0.5.1", + "nullthrows": "^1.1.1" + }, + "peerDependencies": { + "@babel/preset-env": "^7.1.6" + } + }, + "node_modules/react-native/node_modules/@types/yargs": { + "version": "15.0.15", + "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-15.0.15.tgz", + "integrity": "sha512-IziEYMU9XoVj8hWg7k+UJrXALkGFjWJhn5QFEv9q4p+v40oZhSuC135M38st8XPjICL7Ey4TV64ferBGUoJhBg==", + "peer": true, + "dependencies": { + "@types/yargs-parser": "*" + } + }, + "node_modules/react-native/node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "peer": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/react-native/node_modules/pretty-format": { + "version": "26.6.2", + "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-26.6.2.tgz", + "integrity": "sha512-7AeGuCYNGmycyQbCqd/3PWH4eOoX/OiCa0uphp57NVTeAGdJGaAliecxwBDHYQCIvrW7aDBZCYeNTP/WX69mkg==", + "peer": true, + "dependencies": { + "@jest/types": "^26.6.2", + "ansi-regex": "^5.0.0", + "ansi-styles": "^4.0.0", + "react-is": "^17.0.1" + }, + "engines": { + "node": ">= 10" + } + }, + "node_modules/react-native/node_modules/react-is": { + "version": "17.0.2", + "resolved": "https://registry.npmjs.org/react-is/-/react-is-17.0.2.tgz", + "integrity": "sha512-w2GsyukL62IJnlaff/nRegPQR94C/XXamvMWmSHRJ4y7Ts/4ocGRmTHvOs8PSE6pB3dWOrD/nueuU5sduBsQ4w==", + "peer": true + }, + "node_modules/react-refresh": { + "version": "0.4.3", + "resolved": "https://registry.npmjs.org/react-refresh/-/react-refresh-0.4.3.tgz", + "integrity": "sha512-Hwln1VNuGl/6bVwnd0Xdn1e84gT/8T9aYNL+HAKDArLCS7LWjwr7StE30IEYbIkx0Vi3vs+coQxe+SQDbGbbpA==", + "peer": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/react-shallow-renderer": { + "version": "16.15.0", + "resolved": "https://registry.npmjs.org/react-shallow-renderer/-/react-shallow-renderer-16.15.0.tgz", + "integrity": "sha512-oScf2FqQ9LFVQgA73vr86xl2NaOIX73rh+YFqcOp68CWj56tSfgtGKrEbyhCj0rSijyG9M1CYprTh39fBi5hzA==", + "peer": true, + "dependencies": { + "object-assign": "^4.1.1", + "react-is": "^16.12.0 || ^17.0.0 || ^18.0.0" + }, + "peerDependencies": { + "react": "^16.0.0 || ^17.0.0 || ^18.0.0" + } + }, + "node_modules/readable-stream": { + "version": "3.6.2", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz", + "integrity": "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==", + "peer": true, + "dependencies": { + "inherits": "^2.0.3", + "string_decoder": "^1.1.1", + "util-deprecate": "^1.0.1" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/readline": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/readline/-/readline-1.3.0.tgz", + "integrity": "sha512-k2d6ACCkiNYz222Fs/iNze30rRJ1iIicW7JuX/7/cozvih6YCkFZH+J6mAFDVgv0dRBaAyr4jDqC95R2y4IADg==", + "peer": true + }, + "node_modules/recast": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/recast/-/recast-0.21.5.tgz", + "integrity": "sha512-hjMmLaUXAm1hIuTqOdeYObMslq/q+Xff6QE3Y2P+uoHAg2nmVlLBps2hzh1UJDdMtDTMXOFewK6ky51JQIeECg==", + "peer": true, + "dependencies": { + "ast-types": "0.15.2", + "esprima": "~4.0.0", + "source-map": "~0.6.1", + "tslib": "^2.0.1" + }, + "engines": { + "node": ">= 4" + } + }, + "node_modules/recast/node_modules/source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "peer": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/regenerate": { + "version": "1.4.2", + "resolved": "https://registry.npmjs.org/regenerate/-/regenerate-1.4.2.tgz", + "integrity": "sha512-zrceR/XhGYU/d/opr2EKO7aRHUeiBI8qjtfHqADTwZd6Szfy16la6kqD0MIUs5z5hx6AaKa+PixpPrR289+I0A==" + }, + "node_modules/regenerate-unicode-properties": { + "version": "10.1.0", + "resolved": "https://registry.npmjs.org/regenerate-unicode-properties/-/regenerate-unicode-properties-10.1.0.tgz", + "integrity": "sha512-d1VudCLoIGitcU/hEg2QqvyGZQmdC0Lf8BqdOMXGFSvJP4bNV1+XqbPQeHHLD51Jh4QJJ225dlIFvY4Ly6MXmQ==", + "dependencies": { + "regenerate": "^1.4.2" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/regenerator-runtime": { + "version": "0.13.11", + "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.13.11.tgz", + "integrity": "sha512-kY1AZVr2Ra+t+piVaJ4gxaFaReZVH40AKNo7UCX6W+dEwBo/2oZJzqfuN1qLq1oL45o56cPaTXELwrTh8Fpggg==" + }, + "node_modules/regenerator-transform": { + "version": "0.15.1", + "resolved": "https://registry.npmjs.org/regenerator-transform/-/regenerator-transform-0.15.1.tgz", + "integrity": "sha512-knzmNAcuyxV+gQCufkYcvOqX/qIIfHLv0u5x79kRxuGojfYVky1f15TzZEu2Avte8QGepvUNTnLskf8E6X6Vyg==", + "dependencies": { + "@babel/runtime": "^7.8.4" + } + }, + "node_modules/regexpu-core": { + "version": "5.3.2", + "resolved": "https://registry.npmjs.org/regexpu-core/-/regexpu-core-5.3.2.tgz", + "integrity": "sha512-RAM5FlZz+Lhmo7db9L298p2vHP5ZywrVXmVXpmAD9GuL5MPH6t9ROw1iA/wfHkQ76Qe7AaPF0nGuim96/IrQMQ==", + "dependencies": { + "@babel/regjsgen": "^0.8.0", + "regenerate": "^1.4.2", + "regenerate-unicode-properties": "^10.1.0", + "regjsparser": "^0.9.1", + "unicode-match-property-ecmascript": "^2.0.0", + "unicode-match-property-value-ecmascript": "^2.1.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/regjsparser": { + "version": "0.9.1", + "resolved": "https://registry.npmjs.org/regjsparser/-/regjsparser-0.9.1.tgz", + "integrity": "sha512-dQUtn90WanSNl+7mQKcXAgZxvUe7Z0SqXlgzv0za4LwiUhyzBC58yQO3liFoUgu8GiJVInAhJjkj1N0EtQ5nkQ==", + "dependencies": { + "jsesc": "~0.5.0" + }, + "bin": { + "regjsparser": "bin/parser" + } + }, + "node_modules/regjsparser/node_modules/jsesc": { + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-0.5.0.tgz", + "integrity": "sha512-uZz5UnB7u4T9LvwmFqXii7pZSouaRPorGs5who1Ip7VO0wxanFvBL7GkM6dTHlgX+jhBApRetaWpnDabOeTcnA==", + "bin": { + "jsesc": "bin/jsesc" + } + }, + "node_modules/require-directory": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", + "integrity": "sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/require-main-filename": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-2.0.0.tgz", + "integrity": "sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg==", + "peer": true + }, + "node_modules/resolve": { + "version": "1.22.2", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.2.tgz", + "integrity": "sha512-Sb+mjNHOULsBv818T40qSPeRiuWLyaGMa5ewydRLFimneixmVy2zdivRl+AF6jaYPC8ERxGDmFSiqui6SfPd+g==", + "dependencies": { + "is-core-module": "^2.11.0", + "path-parse": "^1.0.7", + "supports-preserve-symlinks-flag": "^1.0.0" + }, + "bin": { + "resolve": "bin/resolve" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/resolve-from": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-3.0.0.tgz", + "integrity": "sha512-GnlH6vxLymXJNMBo7XP1fJIzBFbdYt49CuTwmB/6N53t+kMPRMFKz783LlQ4tv28XoQfMWinAJX6WCGf2IlaIw==", + "peer": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/restore-cursor": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-3.1.0.tgz", + "integrity": "sha512-l+sSefzHpj5qimhFSE5a8nufZYAM3sBSVMAPtYkmC+4EH2anSGaEMXSD0izRQbu9nfyQ9y5JrVmp7E8oZrUjvA==", + "peer": true, + "dependencies": { + "onetime": "^5.1.0", + "signal-exit": "^3.0.2" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/reusify": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz", + "integrity": "sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==", + "dev": true, + "engines": { + "iojs": ">=1.0.0", + "node": ">=0.10.0" + } + }, + "node_modules/rimraf": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", + "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", + "dependencies": { + "glob": "^7.1.3" + }, + "bin": { + "rimraf": "bin.js" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/run-parallel": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", + "integrity": "sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "dependencies": { + "queue-microtask": "^1.2.2" + } + }, + "node_modules/safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", + "peer": true + }, + "node_modules/scheduler": { + "version": "0.24.0-canary-efb381bbf-20230505", + "resolved": "https://registry.npmjs.org/scheduler/-/scheduler-0.24.0-canary-efb381bbf-20230505.tgz", + "integrity": "sha512-ABvovCDe/k9IluqSh4/ISoq8tIJnW8euVAWYt5j/bg6dRnqwQwiGO1F/V4AyK96NGF/FB04FhOUDuWj8IKfABA==", + "peer": true, + "dependencies": { + "loose-envify": "^1.1.0" + } + }, + "node_modules/semver": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "bin": { + "semver": "bin/semver.js" + } + }, + "node_modules/send": { + "version": "0.18.0", + "resolved": "https://registry.npmjs.org/send/-/send-0.18.0.tgz", + "integrity": "sha512-qqWzuOjSFOuqPjFe4NOsMLafToQQwBSOEpS+FwEt3A2V3vKubTquT3vmLTQpFgMXp8AlFWFuP1qKaJZOtPpVXg==", + "peer": true, + "dependencies": { + "debug": "2.6.9", + "depd": "2.0.0", + "destroy": "1.2.0", + "encodeurl": "~1.0.2", + "escape-html": "~1.0.3", + "etag": "~1.8.1", + "fresh": "0.5.2", + "http-errors": "2.0.0", + "mime": "1.6.0", + "ms": "2.1.3", + "on-finished": "2.4.1", + "range-parser": "~1.2.1", + "statuses": "2.0.1" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/send/node_modules/mime": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/mime/-/mime-1.6.0.tgz", + "integrity": "sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==", + "peer": true, + "bin": { + "mime": "cli.js" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/send/node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "peer": true + }, + "node_modules/send/node_modules/on-finished": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.4.1.tgz", + "integrity": "sha512-oVlzkg3ENAhCk2zdv7IJwd/QUD4z2RxRwpkcGY8psCVcCYZNq4wYnVWALHM+brtuJjePWiYF/ClmuDr8Ch5+kg==", + "peer": true, + "dependencies": { + "ee-first": "1.1.1" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/send/node_modules/statuses": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/statuses/-/statuses-2.0.1.tgz", + "integrity": "sha512-RwNA9Z/7PrK06rYLIzFMlaF+l73iwpzsqRIFgbMLbTcLD6cOao82TaWefPXQvB2fOC4AjuYSEndS7N/mTCbkdQ==", + "peer": true, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/serialize-error": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/serialize-error/-/serialize-error-2.1.0.tgz", + "integrity": "sha512-ghgmKt5o4Tly5yEG/UJp8qTd0AN7Xalw4XBtDEKP655B699qMEtra1WlXeE6WIvdEG481JvRxULKsInq/iNysw==", + "peer": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/serve-static": { + "version": "1.15.0", + "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.15.0.tgz", + "integrity": "sha512-XGuRDNjXUijsUL0vl6nSD7cwURuzEgglbOaFuZM9g3kwDXOWVTck0jLzjPzGD+TazWbboZYu52/9/XPdUgne9g==", + "peer": true, + "dependencies": { + "encodeurl": "~1.0.2", + "escape-html": "~1.0.3", + "parseurl": "~1.3.3", + "send": "0.18.0" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/set-blocking": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz", + "integrity": "sha512-KiKBS8AnWGEyLzofFfmvKwpdPzqiy16LvQfK3yv/fVH7Bj13/wl3JSR1J+rfgRE9q7xUJK4qvgS8raSOeLUehw==", + "peer": true + }, + "node_modules/setprototypeof": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.2.0.tgz", + "integrity": "sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw==", + "peer": true + }, + "node_modules/shallow-clone": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/shallow-clone/-/shallow-clone-3.0.1.tgz", + "integrity": "sha512-/6KqX+GVUdqPuPPd2LxDDxzX6CAbjJehAAOKlNpqqUpAqPM6HeL8f+o3a+JsyGjn2lv0WY8UsTgUJjU9Ok55NA==", + "peer": true, + "dependencies": { + "kind-of": "^6.0.2" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/shebang-command": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", + "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", + "dependencies": { + "shebang-regex": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/shebang-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", + "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", + "engines": { + "node": ">=8" + } + }, + "node_modules/shell-quote": { + "version": "1.8.1", + "resolved": "https://registry.npmjs.org/shell-quote/-/shell-quote-1.8.1.tgz", + "integrity": "sha512-6j1W9l1iAs/4xYBI1SYOVZyFcCis9b4KCLQ8fgAGG07QvzaRLVVRQvAy85yNmmZSjYjg4MWh4gNvlPujU/5LpA==", + "peer": true, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/signal-exit": { + "version": "3.0.7", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz", + "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==" + }, + "node_modules/sisteransi": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/sisteransi/-/sisteransi-1.0.5.tgz", + "integrity": "sha512-bLGGlR1QxBcynn2d5YmDX4MGjlZvy2MRBDRNHLJ8VI6l6+9FUiyTFNJ0IveOSP0bcXgVDPRcfGqA0pjaqUpfVg==" + }, + "node_modules/slash": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", + "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==", + "engines": { + "node": ">=8" + } + }, + "node_modules/slice-ansi": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-2.1.0.tgz", + "integrity": "sha512-Qu+VC3EwYLldKa1fCxuuvULvSJOKEgk9pi8dZeCVK7TqBfUNTH4sFkk4joj8afVSfAYgJoSOetjx9QWOJ5mYoQ==", + "peer": true, + "dependencies": { + "ansi-styles": "^3.2.0", + "astral-regex": "^1.0.0", + "is-fullwidth-code-point": "^2.0.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/slice-ansi/node_modules/ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "peer": true, + "dependencies": { + "color-convert": "^1.9.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/slice-ansi/node_modules/color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "peer": true, + "dependencies": { + "color-name": "1.1.3" + } + }, + "node_modules/slice-ansi/node_modules/color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==", + "peer": true + }, + "node_modules/source-map": { + "version": "0.7.4", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.7.4.tgz", + "integrity": "sha512-l3BikUxvPOcn5E74dZiq5BGsTb5yEwhaTSzccU6t4sDOH8NWJCstKO5QT2CvtFoK6F0saL7p9xHAqHOlCPJygA==", + "peer": true, + "engines": { + "node": ">= 8" + } + }, + "node_modules/source-map-support": { + "version": "0.5.21", + "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.21.tgz", + "integrity": "sha512-uBHU3L3czsIyYXKX88fdrGovxdSCoTGDRZ6SYXtSRxLZUzHg5P/66Ht6uoUlHu9EZod+inXhKo3qQgwXUT/y1w==", + "peer": true, + "dependencies": { + "buffer-from": "^1.0.0", + "source-map": "^0.6.0" + } + }, + "node_modules/source-map-support/node_modules/source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "peer": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/sprintf-js": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", + "integrity": "sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g==", + "peer": true + }, + "node_modules/stack-utils": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/stack-utils/-/stack-utils-2.0.6.tgz", + "integrity": "sha512-XlkWvfIm6RmsWtNJx+uqtKLS8eqFbxUg0ZzLXqY0caEy9l7hruX8IpiDnjsLavoBgqCCR71TqWO8MaXYheJ3RQ==", + "dependencies": { + "escape-string-regexp": "^2.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/stackframe": { + "version": "1.3.4", + "resolved": "https://registry.npmjs.org/stackframe/-/stackframe-1.3.4.tgz", + "integrity": "sha512-oeVtt7eWQS+Na6F//S4kJ2K2VbRlS9D43mAlMyVpVWovy9o+jfgH8O9agzANzaiLjclA0oYzUXEM4PurhSUChw==", + "peer": true + }, + "node_modules/stacktrace-parser": { + "version": "0.1.10", + "resolved": "https://registry.npmjs.org/stacktrace-parser/-/stacktrace-parser-0.1.10.tgz", + "integrity": "sha512-KJP1OCML99+8fhOHxwwzyWrlUuVX5GQ0ZpJTd1DFXhdkrvg1szxfHhawXUZ3g9TkXORQd4/WG68jMlQZ2p8wlg==", + "peer": true, + "dependencies": { + "type-fest": "^0.7.1" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/statuses": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/statuses/-/statuses-1.5.0.tgz", + "integrity": "sha512-OpZ3zP+jT1PI7I8nemJX4AKmAX070ZkYPVWV/AaKTJl+tXCTGyVdC1a4SL8RUQYEwk/f34ZX8UTykN68FwrqAA==", + "peer": true, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/string_decoder": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", + "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", + "peer": true, + "dependencies": { + "safe-buffer": "~5.2.0" + } + }, + "node_modules/string_decoder/node_modules/safe-buffer": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", + "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "peer": true + }, + "node_modules/string-width": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/string-width/node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "engines": { + "node": ">=8" + } + }, + "node_modules/string-width/node_modules/is-fullwidth-code-point": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + "engines": { + "node": ">=8" + } + }, + "node_modules/string-width/node_modules/strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/strip-ansi": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", + "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", + "peer": true, + "dependencies": { + "ansi-regex": "^4.1.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/strip-final-newline": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-2.0.0.tgz", + "integrity": "sha512-BrpvfNAE3dcvq7ll3xVumzjKjZQ5tI1sEUIKr3Uoks0XUl45St3FlatVqef9prk4jRDzhW6WZg+3bk93y6pLjA==", + "engines": { + "node": ">=6" + } + }, + "node_modules/strnum": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/strnum/-/strnum-1.0.5.tgz", + "integrity": "sha512-J8bbNyKKXl5qYcR36TIO8W3mVGVHrmmxsd5PAItGkmyzwJvybiw2IVq5nqd0i4LSNSkB/sx9VHllbfFdr9k1JA==", + "peer": true + }, + "node_modules/sudo-prompt": { + "version": "9.2.1", + "resolved": "https://registry.npmjs.org/sudo-prompt/-/sudo-prompt-9.2.1.tgz", + "integrity": "sha512-Mu7R0g4ig9TUuGSxJavny5Rv0egCEtpZRNMrZaYS1vxkiIxGiGUwoezU3LazIQ+KE04hTrTfNPgxU5gzi7F5Pw==", + "peer": true + }, + "node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/supports-preserve-symlinks-flag": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz", + "integrity": "sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/temp": { + "version": "0.8.4", + "resolved": "https://registry.npmjs.org/temp/-/temp-0.8.4.tgz", + "integrity": "sha512-s0ZZzd0BzYv5tLSptZooSjK8oj6C+c19p7Vqta9+6NPOf7r+fxq0cJe6/oN4LTC79sy5NY8ucOJNgwsKCSbfqg==", + "peer": true, + "dependencies": { + "rimraf": "~2.6.2" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/temp/node_modules/rimraf": { + "version": "2.6.3", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.3.tgz", + "integrity": "sha512-mwqeW5XsA2qAejG46gYdENaxXjx9onRNCfn7L0duuP4hCuTIi/QO7PDK07KJfp1d+izWPrzEJDcSqBa0OZQriA==", + "peer": true, + "dependencies": { + "glob": "^7.1.3" + }, + "bin": { + "rimraf": "bin.js" + } + }, + "node_modules/terser": { + "version": "5.17.3", + "resolved": "https://registry.npmjs.org/terser/-/terser-5.17.3.tgz", + "integrity": "sha512-AudpAZKmZHkG9jueayypz4duuCFJMMNGRMwaPvQKWfxKedh8Z2x3OCoDqIIi1xx5+iwx1u6Au8XQcc9Lke65Yg==", + "peer": true, + "dependencies": { + "@jridgewell/source-map": "^0.3.2", + "acorn": "^8.5.0", + "commander": "^2.20.0", + "source-map-support": "~0.5.20" + }, + "bin": { + "terser": "bin/terser" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/terser/node_modules/commander": { + "version": "2.20.3", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", + "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==", + "peer": true + }, + "node_modules/throat": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/throat/-/throat-5.0.0.tgz", + "integrity": "sha512-fcwX4mndzpLQKBS1DVYhGAcYaYt7vsHNIvQV+WXMvnow5cgjPphq5CaayLaGsjRdSCKZFNGt7/GYAuXaNOiYCA==", + "peer": true + }, + "node_modules/through2": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/through2/-/through2-2.0.5.tgz", + "integrity": "sha512-/mrRod8xqpA+IHSLyGCQ2s8SPHiCDEeQJSep1jqLYeEUClOFG2Qsh+4FU6G9VeqpZnGW/Su8LQGc4YKni5rYSQ==", + "peer": true, + "dependencies": { + "readable-stream": "~2.3.6", + "xtend": "~4.0.1" + } + }, + "node_modules/through2/node_modules/readable-stream": { + "version": "2.3.8", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.8.tgz", + "integrity": "sha512-8p0AUk4XODgIewSi0l8Epjs+EVnWiK7NoDIEGU0HhE7+ZyY8D1IMY7odu5lRrFXGg71L15KG8QrPmum45RTtdA==", + "peer": true, + "dependencies": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + }, + "node_modules/through2/node_modules/string_decoder": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "peer": true, + "dependencies": { + "safe-buffer": "~5.1.0" + } + }, + "node_modules/tmpl": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/tmpl/-/tmpl-1.0.5.tgz", + "integrity": "sha512-3f0uOEAQwIqGuWW2MVzYg8fV/QNnc/IpuJNG837rLuczAaLVHslWHZQj4IGiEl5Hs3kkbhwL9Ab7Hrsmuj+Smw==", + "peer": true + }, + "node_modules/to-fast-properties": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-2.0.0.tgz", + "integrity": "sha512-/OaKK0xYrs3DmxRYqL/yDc+FxFUVYhDlXMhRmv3z915w2HF1tnN1omB354j8VUGO/hbRzyD6Y3sA7v7GS/ceog==", + "engines": { + "node": ">=4" + } + }, + "node_modules/to-regex-range": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", + "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", + "dependencies": { + "is-number": "^7.0.0" + }, + "engines": { + "node": ">=8.0" + } + }, + "node_modules/toidentifier": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.1.tgz", + "integrity": "sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA==", + "peer": true, + "engines": { + "node": ">=0.6" + } + }, + "node_modules/tr46": { + "version": "0.0.3", + "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz", + "integrity": "sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==", + "peer": true + }, + "node_modules/tslib": { + "version": "2.6.2", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.6.2.tgz", + "integrity": "sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==", + "peer": true + }, + "node_modules/type-detect": { + "version": "4.0.8", + "resolved": "https://registry.npmjs.org/type-detect/-/type-detect-4.0.8.tgz", + "integrity": "sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g==", + "peer": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/type-fest": { + "version": "0.7.1", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.7.1.tgz", + "integrity": "sha512-Ne2YiiGN8bmrmJJEuTWTLJR32nh/JdL1+PSicowtNb0WFpn59GK8/lfD61bVtzguz7b3PBt74nxpv/Pw5po5Rg==", + "peer": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/typescript": { + "version": "5.0.4", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.0.4.tgz", + "integrity": "sha512-cW9T5W9xY37cc+jfEnaUvX91foxtHkza3Nw3wkoF4sSlKn0MONdkdEndig/qPBWXNkmplh3NzayQzCiHM4/hqw==", + "dev": true, + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" + }, + "engines": { + "node": ">=12.20" + } + }, + "node_modules/uglify-es": { + "version": "3.3.9", + "resolved": "https://registry.npmjs.org/uglify-es/-/uglify-es-3.3.9.tgz", + "integrity": "sha512-r+MU0rfv4L/0eeW3xZrd16t4NZfK8Ld4SWVglYBb7ez5uXFWHuVRs6xCTrf1yirs9a4j4Y27nn7SRfO6v67XsQ==", + "deprecated": "support for ECMAScript is superseded by `uglify-js` as of v3.13.0", + "peer": true, + "dependencies": { + "commander": "~2.13.0", + "source-map": "~0.6.1" + }, + "bin": { + "uglifyjs": "bin/uglifyjs" + }, + "engines": { + "node": ">=0.8.0" + } + }, + "node_modules/uglify-es/node_modules/commander": { + "version": "2.13.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.13.0.tgz", + "integrity": "sha512-MVuS359B+YzaWqjCL/c+22gfryv+mCBPHAv3zyVI2GN8EY6IRP8VwtasXn8jyyhvvq84R4ImN1OKRtcbIasjYA==", + "peer": true + }, + "node_modules/uglify-es/node_modules/source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "peer": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/unc-path-regex": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/unc-path-regex/-/unc-path-regex-0.1.2.tgz", + "integrity": "sha512-eXL4nmJT7oCpkZsHZUOJo8hcX3GbsiDOa0Qu9F646fi8dT3XuSVopVqAcEiVzSKKH7UoDti23wNX3qGFxcW5Qg==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/unicode-canonical-property-names-ecmascript": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/unicode-canonical-property-names-ecmascript/-/unicode-canonical-property-names-ecmascript-2.0.0.tgz", + "integrity": "sha512-yY5PpDlfVIU5+y/BSCxAJRBIS1Zc2dDG3Ujq+sR0U+JjUevW2JhocOF+soROYDSaAezOzOKuyyixhD6mBknSmQ==", + "engines": { + "node": ">=4" + } + }, + "node_modules/unicode-match-property-ecmascript": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/unicode-match-property-ecmascript/-/unicode-match-property-ecmascript-2.0.0.tgz", + "integrity": "sha512-5kaZCrbp5mmbz5ulBkDkbY0SsPOjKqVS35VpL9ulMPfSl0J0Xsm+9Evphv9CoIZFwre7aJoa94AY6seMKGVN5Q==", + "dependencies": { + "unicode-canonical-property-names-ecmascript": "^2.0.0", + "unicode-property-aliases-ecmascript": "^2.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/unicode-match-property-value-ecmascript": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/unicode-match-property-value-ecmascript/-/unicode-match-property-value-ecmascript-2.1.0.tgz", + "integrity": "sha512-qxkjQt6qjg/mYscYMC0XKRn3Rh0wFPlfxB0xkt9CfyTvpX1Ra0+rAmdX2QyAobptSEvuy4RtpPRui6XkV+8wjA==", + "engines": { + "node": ">=4" + } + }, + "node_modules/unicode-property-aliases-ecmascript": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/unicode-property-aliases-ecmascript/-/unicode-property-aliases-ecmascript-2.1.0.tgz", + "integrity": "sha512-6t3foTQI9qne+OZoVQB/8x8rk2k1eVy1gRXhV3oFQ5T6R1dqQ1xtin3XqSlx3+ATBkliTaR/hHyJBm+LVPNM8w==", + "engines": { + "node": ">=4" + } + }, + "node_modules/universalify": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz", + "integrity": "sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==", + "peer": true, + "engines": { + "node": ">= 4.0.0" + } + }, + "node_modules/unpipe": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz", + "integrity": "sha512-pjy2bYhSsufwWlKwPc+l3cN7+wuJlK6uz0YdJEOlQDbl6jo/YlPi4mb8agUkVC8BF7V8NuzeyPNqRksA3hztKQ==", + "peer": true, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/update-browserslist-db": { + "version": "1.0.11", + "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.0.11.tgz", + "integrity": "sha512-dCwEFf0/oT85M1fHBg4F0jtLwJrutGoHSQXCh7u4o2t1drG+c0a9Flnqww6XUKSfQMPpJBRjU8d4RXB09qtvaA==", + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/browserslist" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/browserslist" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "dependencies": { + "escalade": "^3.1.1", + "picocolors": "^1.0.0" + }, + "bin": { + "update-browserslist-db": "cli.js" + }, + "peerDependencies": { + "browserslist": ">= 4.21.0" + } + }, + "node_modules/use-sync-external-store": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/use-sync-external-store/-/use-sync-external-store-1.2.0.tgz", + "integrity": "sha512-eEgnFxGQ1Ife9bzYs6VLi8/4X6CObHMw9Qr9tPY43iKwsPw8xE8+EFsf/2cFZ5S3esXgpWgtSCtLNS41F+sKPA==", + "peer": true, + "peerDependencies": { + "react": "^16.8.0 || ^17.0.0 || ^18.0.0" + } + }, + "node_modules/util-deprecate": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", + "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==", + "peer": true + }, + "node_modules/utils-merge": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.1.tgz", + "integrity": "sha512-pMZTvIkT1d+TFGvDOqodOclx0QWkkgi6Tdoa8gC8ffGAAqz9pzPTZWAybbsHHoED/ztMtkv/VoYTYyShUn81hA==", + "peer": true, + "engines": { + "node": ">= 0.4.0" + } + }, + "node_modules/vary": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz", + "integrity": "sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg==", + "peer": true, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/vlq": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/vlq/-/vlq-1.0.1.tgz", + "integrity": "sha512-gQpnTgkubC6hQgdIcRdYGDSDc+SaujOdyesZQMv6JlfQee/9Mp0Qhnys6WxDWvQnL5WZdT7o2Ul187aSt0Rq+w==", + "peer": true + }, + "node_modules/walker": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/walker/-/walker-1.0.8.tgz", + "integrity": "sha512-ts/8E8l5b7kY0vlWLewOkDXMmPdLcVV4GmOQLyxuSswIJsweeFZtAsMF7k1Nszz+TYBQrlYRmzOnr398y1JemQ==", + "peer": true, + "dependencies": { + "makeerror": "1.0.12" + } + }, + "node_modules/wcwidth": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/wcwidth/-/wcwidth-1.0.1.tgz", + "integrity": "sha512-XHPEwS0q6TaxcvG85+8EYkbiCux2XtWG2mkc47Ng2A77BQu9+DqIOJldST4HgPkuea7dvKSj5VgX3P1d4rW8Tg==", + "peer": true, + "dependencies": { + "defaults": "^1.0.3" + } + }, + "node_modules/webidl-conversions": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz", + "integrity": "sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==", + "peer": true + }, + "node_modules/whatwg-fetch": { + "version": "3.6.2", + "resolved": "https://registry.npmjs.org/whatwg-fetch/-/whatwg-fetch-3.6.2.tgz", + "integrity": "sha512-bJlen0FcuU/0EMLrdbJ7zOnW6ITZLrZMIarMUVmdKtsGvZna8vxKYaexICWPfZ8qwf9fzNq+UEIZrnSaApt6RA==", + "peer": true + }, + "node_modules/whatwg-url": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz", + "integrity": "sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==", + "peer": true, + "dependencies": { + "tr46": "~0.0.3", + "webidl-conversions": "^3.0.0" + } + }, + "node_modules/which": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", + "dependencies": { + "isexe": "^2.0.0" + }, + "bin": { + "node-which": "bin/node-which" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/which-module": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/which-module/-/which-module-2.0.1.tgz", + "integrity": "sha512-iBdZ57RDvnOR9AGBhML2vFZf7h8vmBjhoaZqODJBFWHVtKkDmKuHai3cx5PgVMrX5YDNp27AofYbAwctSS+vhQ==", + "peer": true + }, + "node_modules/wrap-ansi": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", + "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", + "dependencies": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" + } + }, + "node_modules/wrap-ansi/node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "engines": { + "node": ">=8" + } + }, + "node_modules/wrap-ansi/node_modules/strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/wrappy": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==" + }, + "node_modules/write-file-atomic": { + "version": "2.4.3", + "resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-2.4.3.tgz", + "integrity": "sha512-GaETH5wwsX+GcnzhPgKcKjJ6M2Cq3/iZp1WyY/X1CSqrW+jVNM9Y7D8EC2sM4ZG/V8wZlSniJnCKWPmBYAucRQ==", + "peer": true, + "dependencies": { + "graceful-fs": "^4.1.11", + "imurmurhash": "^0.1.4", + "signal-exit": "^3.0.2" + } + }, + "node_modules/ws": { + "version": "6.2.2", + "resolved": "https://registry.npmjs.org/ws/-/ws-6.2.2.tgz", + "integrity": "sha512-zmhltoSR8u1cnDsD43TX59mzoMZsLKqUweyYBAIvTngR3shc0W6aOZylZmq/7hqyVxPdi+5Ud2QInblgyE72fw==", + "peer": true, + "dependencies": { + "async-limiter": "~1.0.0" + } + }, + "node_modules/xtend": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", + "integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==", + "peer": true, + "engines": { + "node": ">=0.4" + } + }, + "node_modules/y18n": { + "version": "5.0.8", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", + "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==", + "engines": { + "node": ">=10" + } + }, + "node_modules/yallist": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.1.1.tgz", + "integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==" + }, + "node_modules/yaml": { + "version": "1.10.2", + "resolved": "https://registry.npmjs.org/yaml/-/yaml-1.10.2.tgz", + "integrity": "sha512-r3vXyErRCYJ7wg28yvBY5VSoAF8ZvlcW9/BwUzEtUsjvX/DKs24dIkuwjtuprwJJHsbyUbLApepYTR1BN4uHrg==", + "dev": true, + "engines": { + "node": ">= 6" + } + }, + "node_modules/yargs": { + "version": "17.7.2", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.7.2.tgz", + "integrity": "sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w==", + "dependencies": { + "cliui": "^8.0.1", + "escalade": "^3.1.1", + "get-caller-file": "^2.0.5", + "require-directory": "^2.1.1", + "string-width": "^4.2.3", + "y18n": "^5.0.5", + "yargs-parser": "^21.1.1" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/yargs-parser": { + "version": "21.1.1", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.1.1.tgz", + "integrity": "sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==", + "engines": { + "node": ">=12" + } + }, + "node_modules/yocto-queue": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", + "integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==", + "peer": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + } + } +} diff --git a/react-native-harmony-svg/package.json b/react-native-harmony-svg/package.json new file mode 100644 index 0000000000000000000000000000000000000000..999a6645fe403090165a3d70a89f6c4c3fbe8fbd --- /dev/null +++ b/react-native-harmony-svg/package.json @@ -0,0 +1,50 @@ +{ + "name": "@react-native-oh-tpl/react-native-svg", + "version": "15.0.0-0.5.8", + "description": "", + "react-native": "src/index", + "main": "lib/commonjs/index", + "module": "lib/module/index", + "types": "lib/typescript/index.d.ts", + "scripts": { + "prepack": "bob build", + "prepublishOnly": "npm run prepack && react-native verify-package-harmony --package-path . --skip-checks oh_package_name_is_derived_from_npm_package_name", + "update_version": "node ./scripts/update-version.js", + "deploy": "node ./scripts/deploy.js" + }, + "author": "", + "license": "ISC", + "peerDependencies": { + "react": "*", + "react-native": "*", + "react-native-svg": "15.0.0" + }, + "devDependencies": { + "@tsconfig/react-native": "^3.0.0", + "@types/react": "^18.2.0", + "@types/react-native": "^0.71.6", + "@types/jest": "^29.5.1", + "react-native-builder-bob": "^0.20.4", + "typescript": "^5.0.4" + }, + "harmony": { + "alias": "react-native-svg", + "redirectInternalImports": true + }, + "files": [ + "harmony", + "src", + "lib", + "css", + "./*.json" + ], + "react-native-builder-bob": { + "source": "src", + "output": "lib", + "targets": [ + "commonjs", + "module", + "typescript" + ] + } +} diff --git a/react-native-harmony-svg/rnoh-react-native-harmony-svg-0.0.4.tgz b/react-native-harmony-svg/rnoh-react-native-harmony-svg-0.0.4.tgz new file mode 100644 index 0000000000000000000000000000000000000000..43e228a54437a40a74f51a6b5d47af923d10d42e Binary files /dev/null and b/react-native-harmony-svg/rnoh-react-native-harmony-svg-0.0.4.tgz differ diff --git a/react-native-harmony-svg/src/css/index.tsx b/react-native-harmony-svg/src/css/index.tsx new file mode 100644 index 0000000000000000000000000000000000000000..be27eb08e222a07d1216c31544c69e2dbb9b0dda --- /dev/null +++ b/react-native-harmony-svg/src/css/index.tsx @@ -0,0 +1,20 @@ +import { + SvgCss, + SvgCssUri, + SvgWithCss, + SvgWithCssUri, + inlineStyles, + } from 'react-native-svg/css'; + + import { LocalSvg, WithLocalSvg, loadLocalRawResource } from 'react-native-svg/css'; + + export { + SvgCss, + SvgCssUri, + SvgWithCss, + SvgWithCssUri, + inlineStyles, + LocalSvg, + WithLocalSvg, + loadLocalRawResource, + }; \ No newline at end of file diff --git a/react-native-harmony-svg/src/elements/Image.tsx b/react-native-harmony-svg/src/elements/Image.tsx new file mode 100644 index 0000000000000000000000000000000000000000..e58b9bacebfa6d3c087b080cbbb86dd499480be3 --- /dev/null +++ b/react-native-harmony-svg/src/elements/Image.tsx @@ -0,0 +1,118 @@ +import * as React from 'react'; +import type { ImageProps as RNImageProps, NativeMethods, ImageResolvedAssetSource } from 'react-native'; +import { Image } from 'react-native'; +import { alignEnum, meetOrSliceTypes } from 'react-native-svg/src/lib/extract/extractViewBox'; +import { + stringifyPropsForFabric, + withoutXY, +} from 'react-native-svg/src/lib/extract/extractProps'; +import type { CommonPathProps, NumberProp } from 'react-native-svg/src/lib/extract/types'; +import Shape from './Shape'; +import RNSVGImage from 'react-native-svg/src/fabric/ImageNativeComponent'; +import RNSVGImageModule from '../fabric/NativeSvgImageModule'; + +const spacesRegExp = /\s+/; + +export interface ImageProps extends CommonPathProps { + x?: NumberProp; + y?: NumberProp; + width?: NumberProp; + height?: NumberProp; + xlinkHref?: RNImageProps['source'] | string; + href?: RNImageProps['source'] | string; + preserveAspectRatio?: string; + opacity?: NumberProp; +} + +export default class SvgImage extends Shape { + static displayName = 'Image'; + + static defaultProps = { + x: 0, + y: 0, + width: 0, + height: 0, + preserveAspectRatio: 'xMidYMid meet', + }; + + constructor(props: ImageProps) { + super(props); + this.state = { + href: props.href || props.xlinkHref, + }; + if (this.state.href && typeof this.state.href === 'string' && this.state.href.startsWith('http')) { + this.fetchBase64String(this.state.href); + } + } + + fetchBase64String = (href: string) => { + const src = !href + ? null + : Image.resolveAssetSource( + typeof href === 'string' ? { uri: href } : href + ) + if (src) { + RNSVGImageModule.getBase64String(src.uri).then((res) => { + this.setState({ href: res }); + } + ).catch((error) => { + console.error(`getBase64String error: ${error.message}`); + }); + } + + }; + + componentDidUpdate(prevProps: ImageProps) { + if (prevProps.href !== this.props.href) { + const href = this.props.href || this.props.xlinkHref; + if (href && typeof href === 'string' && href.startsWith('http')) { + this.fetchBase64String(href); + } else { + this.setState({ href: href }) + } + } + } + + render() { + const { props } = this; + const { + preserveAspectRatio, + x, + y, + width, + height, + xlinkHref, + href = xlinkHref, + } = props; + const modes = preserveAspectRatio + ? preserveAspectRatio.trim().split(spacesRegExp) + : []; + const align = modes[0]; + const meetOrSlice: 'meet' | 'slice' | 'none' | string | undefined = + modes[1]; + const stringifiedImageProps = stringifyPropsForFabric({ + x, + y, + width, + height, + }); + const imageProps = { + ...stringifiedImageProps, + meetOrSlice: meetOrSliceTypes[meetOrSlice] || 0, + align: alignEnum[align] || 'xMidYMid', + src: !this.state.href + ? null + : Image.resolveAssetSource( + typeof this.state.href === 'string' ? { uri: this.state.href } : this.state.href + ), + }; + + return ( + this.refMethod(ref as (SvgImage & NativeMethods) | null)} + {...withoutXY(this, props)} + {...imageProps} + /> + ); + } +} diff --git a/react-native-harmony-svg/src/elements/Shape.tsx b/react-native-harmony-svg/src/elements/Shape.tsx new file mode 100644 index 0000000000000000000000000000000000000000..c62e0c08ce26b4e0fbd066de64e37ca78a5734ff --- /dev/null +++ b/react-native-harmony-svg/src/elements/Shape.tsx @@ -0,0 +1,345 @@ +/* eslint-disable @typescript-eslint/no-var-requires */ +import { Component } from 'react'; +import SvgTouchableMixin from 'react-native-svg/src/lib/SvgTouchableMixin'; +import extractBrush from 'react-native-svg/src/lib/extract/extractBrush'; +import type { ColorValue, NativeMethods } from 'react-native'; +import { findNodeHandle } from 'react-native'; +import type { + ColumnMajorTransformMatrix, + TransformProps, +} from 'react-native-svg/src/lib/extract/types'; +import type { Spec } from 'react-native-svg/src/fabric/NativeSvgRenderableModule'; + +export interface SVGBoundingBoxOptions { + fill?: boolean; + stroke?: boolean; + markers?: boolean; + clipped?: boolean; +} + +export interface DOMPointInit { + x?: number; + y?: number; + z?: number; + w?: number; +} + +export interface Point { + x: number; + y: number; +} + +export interface SVGPoint extends Point { + matrixTransform(matrix: Matrix): SVGPoint; +} + +export interface Rect { + x: number; + y: number; + width: number; + height: number; +} +export type SVGRect = Rect; + +export interface Matrix { + a: number; + b: number; + c: number; + d: number; + e: number; + f: number; +} + +export interface SVGMatrix extends Matrix { + multiply(secondMatrix: Matrix): SVGMatrix; + inverse(): SVGMatrix; + translate(x: number, y: number): SVGMatrix; + scale(scaleFactor: number): SVGMatrix; + scaleNonUniform(scaleFactorX: number, scaleFactorY: number): SVGMatrix; + rotate(angle: number): SVGMatrix; + rotateFromVector(x: number, y: number): SVGMatrix; + flipX(): SVGMatrix; + flipY(): SVGMatrix; + skewX(angle: number): SVGMatrix; + skewY(angle: number): SVGMatrix; +} + +export function multiplyMatrices(l: Matrix, r: Matrix): Matrix { + const { a: al, b: bl, c: cl, d: dl, e: el, f: fl } = l; + const { a: ar, b: br, c: cr, d: dr, e: er, f: fr } = r; + + const a = al * ar + cl * br; + const c = al * cr + cl * dr; + const e = al * er + cl * fr + el; + const b = bl * ar + dl * br; + const d = bl * cr + dl * dr; + const f = bl * er + dl * fr + fl; + + return { a, c, e, b, d, f }; +} + +export function invert({ a, b, c, d, e, f }: Matrix): Matrix { + const n = a * d - b * c; + return { + a: d / n, + b: -b / n, + c: -c / n, + d: a / n, + e: (c * f - d * e) / n, + f: -(a * f - b * e) / n, + }; +} + +const deg2rad = Math.PI / 180; + +export class SVGMatrix implements SVGMatrix { + constructor(matrix?: Matrix) { + if (matrix) { + const { a, b, c, d, e, f } = matrix; + this.a = a; + this.b = b; + this.c = c; + this.d = d; + this.e = e; + this.f = f; + } else { + this.a = 1; + this.b = 0; + this.c = 0; + this.d = 1; + this.e = 0; + this.f = 0; + } + } + + multiply(secondMatrix: Matrix): SVGMatrix { + return new SVGMatrix(multiplyMatrices(this, secondMatrix)); + } + + inverse(): SVGMatrix { + return new SVGMatrix(invert(this)); + } + + translate(x: number, y: number): SVGMatrix { + return new SVGMatrix( + multiplyMatrices(this, { a: 1, b: 0, c: 0, d: 1, e: x, f: y }) + ); + } + + scale(scaleFactor: number): SVGMatrix { + return new SVGMatrix( + multiplyMatrices(this, { + a: scaleFactor, + b: 0, + c: 0, + d: scaleFactor, + e: 0, + f: 0, + }) + ); + } + + scaleNonUniform(scaleFactorX: number, scaleFactorY: number): SVGMatrix { + return new SVGMatrix( + multiplyMatrices(this, { + a: scaleFactorX, + b: 0, + c: 0, + d: scaleFactorY, + e: 0, + f: 0, + }) + ); + } + + rotate(angle: number): SVGMatrix { + const cos = Math.cos(deg2rad * angle); + const sin = Math.sin(deg2rad * angle); + return new SVGMatrix( + multiplyMatrices(this, { a: cos, b: sin, c: -sin, d: cos, e: 0, f: 0 }) + ); + } + + rotateFromVector(x: number, y: number): SVGMatrix { + const angle = Math.atan2(y, x); + const cos = Math.cos(deg2rad * angle); + const sin = Math.sin(deg2rad * angle); + return new SVGMatrix( + multiplyMatrices(this, { a: cos, b: sin, c: -sin, d: cos, e: 0, f: 0 }) + ); + } + + flipX(): SVGMatrix { + return new SVGMatrix( + multiplyMatrices(this, { a: -1, b: 0, c: 0, d: 1, e: 0, f: 0 }) + ); + } + + flipY(): SVGMatrix { + return new SVGMatrix( + multiplyMatrices(this, { a: 1, b: 0, c: 0, d: -1, e: 0, f: 0 }) + ); + } + + skewX(angle: number): SVGMatrix { + return new SVGMatrix( + multiplyMatrices(this, { + a: 1, + b: 0, + c: Math.tan(deg2rad * angle), + d: 1, + e: 0, + f: 0, + }) + ); + } + + skewY(angle: number): SVGMatrix { + return new SVGMatrix( + multiplyMatrices(this, { + a: 1, + b: Math.tan(deg2rad * angle), + c: 0, + d: 1, + e: 0, + f: 0, + }) + ); + } +} + +export function matrixTransform(matrix: Matrix, point: Point): Point { + const { a, b, c, d, e, f } = matrix; + const { x, y } = point; + return { + x: a * x + c * y + e, + y: b * x + d * y + f, + }; +} + +export class SVGPoint implements SVGPoint { + constructor(point?: Point) { + if (point) { + const { x, y } = point; + this.x = x; + this.y = y; + } else { + this.x = 0; + this.y = 0; + } + } + + matrixTransform(matrix: Matrix): SVGPoint { + return new SVGPoint(matrixTransform(matrix, this)); + } +} + +export const ownerSVGElement = { + createSVGPoint(): SVGPoint { + return new SVGPoint(); + }, + createSVGMatrix(): SVGMatrix { + return new SVGMatrix(); + }, +}; + +export default class Shape

extends Component { + [x: string]: unknown; + root: (Shape

& NativeMethods) | null = null; + constructor(props: Readonly

| P) { + super(props); + SvgTouchableMixin(this); + } + + refMethod: (instance: (Shape

& NativeMethods) | null) => void = ( + instance: (Shape

& NativeMethods) | null + ) => { + this.root = instance; + }; + + // Hack to make Animated work with Shape components. + getNativeScrollRef(): (Shape

& NativeMethods) | null { + return this.root; + } + + setNativeProps = ( + props: P & { + matrix?: ColumnMajorTransformMatrix; + fill?: ColorValue; + } & TransformProps + ) => { + if (props.fill) { + // @ts-ignore TODO: native `fill` prop differs from the one passed in props + props.fill = extractBrush(props.fill); + } + this.root?.setNativeProps(props); + }; + + /* + * The following native methods are experimental and likely broken in some + * ways. If you have a use case for these, please open an issue with a + * representative example / reproduction. + * */ + getBBox = (options?: SVGBoundingBoxOptions): SVGRect | undefined => { + const { + fill = true, + stroke = true, + markers = true, + clipped = true, + } = options || {}; + const handle = findNodeHandle(this.root); + const RNSVGRenderableModule = + require('react-native-svg/src/fabric/NativeSvgRenderableModule').default; + return RNSVGRenderableModule.getBBox(handle, { + fill, + stroke, + markers, + clipped, + }); + }; + + getCTM = (): SVGMatrix => { + const handle = findNodeHandle(this.root); + const RNSVGRenderableModule: Spec = + require('react-native-svg/src/fabric/NativeSvgRenderableModule').default; + return new SVGMatrix(RNSVGRenderableModule.getCTM(handle)); + }; + + getScreenCTM = (): SVGMatrix => { + const handle = findNodeHandle(this.root); + const RNSVGRenderableModule: Spec = + require('react-native-svg/src/fabric/NativeSvgRenderableModule').default; + return new SVGMatrix(RNSVGRenderableModule.getScreenCTM(handle)); + }; + + isPointInFill = (options: DOMPointInit): boolean | undefined => { + const handle = findNodeHandle(this.root); + const RNSVGRenderableModule: Spec = + require('react-native-svg/src/fabric/NativeSvgRenderableModule').default; + return RNSVGRenderableModule.isPointInFill(handle, options); + }; + + isPointInStroke = (options: DOMPointInit): boolean | undefined => { + const handle = findNodeHandle(this.root); + const RNSVGRenderableModule: Spec = + require('react-native-svg/src/fabric/NativeSvgRenderableModule').default; + return RNSVGRenderableModule.isPointInStroke(handle, options); + }; + + getTotalLength = (): number | undefined => { + const handle = findNodeHandle(this.root); + const RNSVGRenderableModule: Spec = + require('react-native-svg/src/fabric/NativeSvgRenderableModule').default; + return RNSVGRenderableModule.getTotalLength(handle); + }; + + getPointAtLength = (length: number): SVGPoint => { + const handle = findNodeHandle(this.root); + const RNSVGRenderableModule: Spec = + require('react-native-svg/src/fabric/NativeSvgRenderableModule').default; + return new SVGPoint( + RNSVGRenderableModule.getPointAtLength(handle, { length }) + ); + }; +} +Shape.prototype.ownerSVGElement = ownerSVGElement; diff --git a/react-native-harmony-svg/src/fabric/NativeSvgImageModule.ts b/react-native-harmony-svg/src/fabric/NativeSvgImageModule.ts new file mode 100644 index 0000000000000000000000000000000000000000..026b0fcba132cf6115c2e9e7ac6679eed2dd3037 --- /dev/null +++ b/react-native-harmony-svg/src/fabric/NativeSvgImageModule.ts @@ -0,0 +1,10 @@ +/* eslint-disable @typescript-eslint/ban-types */ +// its needed for codegen to work +import type { TurboModule } from 'react-native'; +import { TurboModuleRegistry } from 'react-native'; + +export interface Spec extends TurboModule { + getBase64String(uri: string): Promise; +} + +export default TurboModuleRegistry.get('RNSVGImageModule')!; diff --git a/react-native-harmony-svg/src/index.tsx b/react-native-harmony-svg/src/index.tsx new file mode 100644 index 0000000000000000000000000000000000000000..ac9266a84f94cbb668d133ff6e28bd137f333a63 --- /dev/null +++ b/react-native-harmony-svg/src/index.tsx @@ -0,0 +1,3 @@ +export * from 'react-native-svg/src/ReactNativeSVG'; + +export { default } from 'react-native-svg/src/ReactNativeSVG'; \ No newline at end of file diff --git a/react-native-harmony-svg/tsconfig.json b/react-native-harmony-svg/tsconfig.json new file mode 100644 index 0000000000000000000000000000000000000000..0696798728e88a9938a2539d0616406861e734a0 --- /dev/null +++ b/react-native-harmony-svg/tsconfig.json @@ -0,0 +1,12 @@ +{ + "extends": [ + "@tsconfig/react-native/tsconfig.json", + ], + "compilerOptions": { + "noEmit": false + }, + "exclude": [ + "lib", + "harmony" + ] +} \ No newline at end of file diff --git a/tester/.eslintrc.js b/tester/.eslintrc.js new file mode 100644 index 0000000000000000000000000000000000000000..40c6dcd05f3100109c83d8e5946ae1e99b25162b --- /dev/null +++ b/tester/.eslintrc.js @@ -0,0 +1,4 @@ +module.exports = { + root: true, + extends: '@react-native-community', +}; diff --git a/tester/.gitignore b/tester/.gitignore new file mode 100644 index 0000000000000000000000000000000000000000..16f8c30773d3440e3153d95a90c4a0c0979b8e13 --- /dev/null +++ b/tester/.gitignore @@ -0,0 +1,63 @@ +# OSX +# +.DS_Store + +# Xcode +# +build/ +*.pbxuser +!default.pbxuser +*.mode1v3 +!default.mode1v3 +*.mode2v3 +!default.mode2v3 +*.perspectivev3 +!default.perspectivev3 +xcuserdata +*.xccheckout +*.moved-aside +DerivedData +*.hmap +*.ipa +*.xcuserstate +ios/.xcode.env.local + +# Android/IntelliJ +# +build/ +.idea +.gradle +local.properties +*.iml +*.hprof +.cxx/ +*.keystore +!debug.keystore + +# node.js +# +node_modules/ +npm-debug.log +yarn-error.log + +# fastlane +# +# It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the +# screenshots whenever they are needed. +# For more information about the recommended setup visit: +# https://docs.fastlane.tools/best-practices/source-control/ + +**/fastlane/report.xml +**/fastlane/Preview.html +**/fastlane/screenshots +**/fastlane/test_output + +# Bundle artifact +*.jsbundle + +# Ruby / CocoaPods +/ios/Pods/ +/vendor/bundle/ + +# Temporary files created by Metro to check the health of the file watcher +.metro-health-check* diff --git a/tester/.node-version b/tester/.node-version new file mode 100644 index 0000000000000000000000000000000000000000..3c032078a4a21c5c51d3c93d91717c1dabbb8cd0 --- /dev/null +++ b/tester/.node-version @@ -0,0 +1 @@ +18 diff --git a/tester/.npmrc b/tester/.npmrc new file mode 100644 index 0000000000000000000000000000000000000000..d69bbd79812b022f8baaa223039bf8cb6671d895 --- /dev/null +++ b/tester/.npmrc @@ -0,0 +1,2 @@ +@rnoh:registry=https://gl.swmansion.com/api/v4/projects/458/packages/npm/ +//gl.swmansion.com/api/v4/projects/458/packages/npm/:_authToken="${RNOH_NPM_TOKEN}" diff --git a/tester/.prettierrc.js b/tester/.prettierrc.js new file mode 100644 index 0000000000000000000000000000000000000000..2b540746a7575ead7fe308f2c78e38ca316b2382 --- /dev/null +++ b/tester/.prettierrc.js @@ -0,0 +1,7 @@ +module.exports = { + arrowParens: 'avoid', + bracketSameLine: true, + bracketSpacing: false, + singleQuote: true, + trailingComma: 'all', +}; diff --git a/tester/.watchmanconfig b/tester/.watchmanconfig new file mode 100644 index 0000000000000000000000000000000000000000..9e26dfeeb6e641a33dae4961196235bdb965b21b --- /dev/null +++ b/tester/.watchmanconfig @@ -0,0 +1 @@ +{} \ No newline at end of file diff --git a/tester/App.tsx b/tester/App.tsx new file mode 100644 index 0000000000000000000000000000000000000000..c9e6e7f156c75e37d100c163428ae9067cf31f79 --- /dev/null +++ b/tester/App.tsx @@ -0,0 +1,181 @@ +/* eslint-disable react-native/no-inline-styles */ +import React, {useEffect, useState} from 'react'; +import {ScrollView, StyleSheet, View} from 'react-native'; +import Svg, { + Path, + G, + Rect, + Circle, + ClipPath, + Defs, + Image, + LinearGradient, + Stop, +} from 'react-native-svg'; +import {Tester, TestSuite, TestCase} from '@rnoh/testerino'; +import QRCode from 'react-native-qrcode-svg'; + +const TRIANGLE_PATH_DATA = 'M64 0 L0 128 L128 128 Z'; + +function App({}): JSX.Element { + return ( + + + + + + + + + + + + + + + { + return ( + + + + ); + }} + /> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + {/* Path to the image must be transformed to make this component work. */} + { + expect(Image).not.to.be.undefined; + }} + /> + + {/* props may yet need to be transformed e.g. supporting various fill's ColorStruct types. */} + + + + + + + + + + + + + + + + + + + ); +} + +function Blinker(props: {renderContent: (refreshKey: number) => any}) { + const [refreshKey, setRefreshKey] = useState(0); + + useEffect(() => { + const id = setInterval(() => { + setRefreshKey(prev => prev + 1); + }, 1000); + return () => { + clearInterval(id); + }; + }, []); + + return <>{props.renderContent(refreshKey)}; +} + +const styles = StyleSheet.create({ + container: { + width: '100%', + height: '100%', + }, + svgContainer: { + width: '100%', + height: 128, + }, +}); + +export default App; diff --git a/tester/Gemfile b/tester/Gemfile new file mode 100644 index 0000000000000000000000000000000000000000..1142b1b209ae3aa6451c2bd1cc20961eb7b230e7 --- /dev/null +++ b/tester/Gemfile @@ -0,0 +1,6 @@ +source 'https://rubygems.org' + +# You may use http://rbenv.org/ or https://rvm.io/ to install and use this version +ruby '>= 2.6.10' + +gem 'cocoapods', '>= 1.11.3' diff --git a/tester/SVGDemo/SVGViewDemo.tsx b/tester/SVGDemo/SVGViewDemo.tsx new file mode 100644 index 0000000000000000000000000000000000000000..15f9887592aa647527f3ab5ff12c51f4c1f5d322 --- /dev/null +++ b/tester/SVGDemo/SVGViewDemo.tsx @@ -0,0 +1,75 @@ +import React, {Component} from 'react'; +import { + Animated, + PanResponder, + TouchableWithoutFeedback, + View, +} from 'react-native'; +import {G, Line, Path, Image, Svg, Circle} from 'react-native-svg'; + +export default class SvgNativeMethods extends Component { + static title = + 'Tap the shapes to render the Image below based on the base64-data of the Svg'; + state = { + base64: null, + }; + alert = () => { + console.log('PRESSED'); + this.root?.toDataURL((base64: string) => { + console.log('back'); + console.log(base64); + + this.setState({ + base64, + }); + },new Object()); + + console.log(this.circle?.isPointInFill({x: 100, y: 100})); + console.log(this.circle?.isPointInStroke({x: 200, y: 100})); + console.log(this.circle?.getTotalLength()); + console.log(this.circle?.getPointAtLength(25)); + console.log(this.circle?.getBBox({fill: true})); + console.log(this.circle?.getCTM()); + console.log(this.circle?.getScreenCTM()); + }; + root?: Svg | null; + circle?: Circle | null; + + render() { + return ( + + { + this.root = ele; + }}> + + { + this.circle = ele; + }} + /> + + + + + {/* {this.state.base64 && ( + + )} */} + + + ); + } +} \ No newline at end of file diff --git a/tester/android/.gitignore b/tester/android/.gitignore new file mode 100644 index 0000000000000000000000000000000000000000..260f2ce008c90bdfee614f609278da3b92a19be5 --- /dev/null +++ b/tester/android/.gitignore @@ -0,0 +1,3 @@ +.gradle +app/.cxx +app/build diff --git a/tester/android/app/build.gradle b/tester/android/app/build.gradle new file mode 100644 index 0000000000000000000000000000000000000000..4867a64f95b38bcf0298220abe04c025df10ed89 --- /dev/null +++ b/tester/android/app/build.gradle @@ -0,0 +1,170 @@ +apply plugin: "com.android.application" +apply plugin: "com.facebook.react" + +import com.android.build.OutputFile + +/** + * This is the configuration block to customize your React Native Android app. + * By default you don't need to apply any configuration, just uncomment the lines you need. + */ +react { + /* Folders */ + // The root of your project, i.e. where "package.json" lives. Default is '..' + // root = file("../") + // The folder where the react-native NPM package is. Default is ../node_modules/react-native + // reactNativeDir = file("../node_modules/react-native") + // The folder where the react-native Codegen package is. Default is ../node_modules/react-native-codegen + // codegenDir = file("../node_modules/react-native-codegen") + // The cli.js file which is the React Native CLI entrypoint. Default is ../node_modules/react-native/cli.js + // cliFile = file("../node_modules/react-native/cli.js") + + /* Variants */ + // The list of variants to that are debuggable. For those we're going to + // skip the bundling of the JS bundle and the assets. By default is just 'debug'. + // If you add flavors like lite, prod, etc. you'll have to list your debuggableVariants. + // debuggableVariants = ["liteDebug", "prodDebug"] + + /* Bundling */ + // A list containing the node command and its flags. Default is just 'node'. + // nodeExecutableAndArgs = ["node"] + // + // The command to run when bundling. By default is 'bundle' + // bundleCommand = "ram-bundle" + // + // The path to the CLI configuration file. Default is empty. + // bundleConfig = file(../rn-cli.config.js) + // + // The name of the generated asset file containing your JS bundle + // bundleAssetName = "MyApplication.android.bundle" + // + // The entry file for bundle generation. Default is 'index.android.js' or 'index.js' + // entryFile = file("../js/MyApplication.android.js") + // + // A list of extra flags to pass to the 'bundle' commands. + // See https://github.com/react-native-community/cli/blob/main/docs/commands.md#bundle + // extraPackagerArgs = [] + + /* Hermes Commands */ + // The hermes compiler command to run. By default it is 'hermesc' + // hermesCommand = "$rootDir/my-custom-hermesc/bin/hermesc" + // + // The list of flags to pass to the Hermes compiler. By default is "-O", "-output-source-map" + // hermesFlags = ["-O", "-output-source-map"] +} + +/** + * Set this to true to create four separate APKs instead of one, + * one for each native architecture. This is useful if you don't + * use App Bundles (https://developer.android.com/guide/app-bundle/) + * and want to have separate APKs to upload to the Play Store. + */ +def enableSeparateBuildPerCPUArchitecture = false + +/** + * Set this to true to Run Proguard on Release builds to minify the Java bytecode. + */ +def enableProguardInReleaseBuilds = false + +/** + * The preferred build flavor of JavaScriptCore (JSC) + * + * For example, to use the international variant, you can use: + * `def jscFlavor = 'org.webkit:android-jsc-intl:+'` + * + * The international variant includes ICU i18n library and necessary data + * allowing to use e.g. `Date.toLocaleString` and `String.localeCompare` that + * give correct results when using with locales other than en-US. Note that + * this variant is about 6MiB larger per architecture than default. + */ +def jscFlavor = 'org.webkit:android-jsc:+' + +/** + * Private function to get the list of Native Architectures you want to build. + * This reads the value from reactNativeArchitectures in your gradle.properties + * file and works together with the --active-arch-only flag of react-native run-android. + */ +def reactNativeArchitectures() { + def value = project.getProperties().get("reactNativeArchitectures") + return value ? value.split(",") : ["armeabi-v7a", "x86", "x86_64", "arm64-v8a"] +} + +android { + ndkVersion rootProject.ext.ndkVersion + + compileSdkVersion rootProject.ext.compileSdkVersion + + namespace "com.rnandroidplayground" + defaultConfig { + applicationId "com.rnandroidplayground" + minSdkVersion rootProject.ext.minSdkVersion + targetSdkVersion rootProject.ext.targetSdkVersion + versionCode 1 + versionName "1.0" + } + + splits { + abi { + reset() + enable enableSeparateBuildPerCPUArchitecture + universalApk false // If true, also generate a universal APK + include (*reactNativeArchitectures()) + } + } + signingConfigs { + debug { + storeFile file('debug.keystore') + storePassword 'android' + keyAlias 'androiddebugkey' + keyPassword 'android' + } + } + buildTypes { + debug { + signingConfig signingConfigs.debug + } + release { + // Caution! In production, you need to generate your own keystore file. + // see https://reactnative.dev/docs/signed-apk-android. + signingConfig signingConfigs.debug + minifyEnabled enableProguardInReleaseBuilds + proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro" + } + } + + // applicationVariants are e.g. debug, release + applicationVariants.all { variant -> + variant.outputs.each { output -> + // For each separate APK per architecture, set a unique version code as described here: + // https://developer.android.com/studio/build/configure-apk-splits.html + // Example: versionCode 1 will generate 1001 for armeabi-v7a, 1002 for x86, etc. + def versionCodes = ["armeabi-v7a": 1, "x86": 2, "arm64-v8a": 3, "x86_64": 4] + def abi = output.getFilter(OutputFile.ABI) + if (abi != null) { // null for the universal-debug, universal-release variants + output.versionCodeOverride = + defaultConfig.versionCode * 1000 + versionCodes.get(abi) + } + + } + } +} + +dependencies { + // The version of react-native is set by the React Native Gradle Plugin + implementation("com.facebook.react:react-android") + + implementation("androidx.swiperefreshlayout:swiperefreshlayout:1.0.0") + + debugImplementation("com.facebook.flipper:flipper:${FLIPPER_VERSION}") + debugImplementation("com.facebook.flipper:flipper-network-plugin:${FLIPPER_VERSION}") { + exclude group:'com.squareup.okhttp3', module:'okhttp' + } + + debugImplementation("com.facebook.flipper:flipper-fresco-plugin:${FLIPPER_VERSION}") + if (hermesEnabled.toBoolean()) { + implementation("com.facebook.react:hermes-android") + } else { + implementation jscFlavor + } +} + +apply from: file("../../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesAppBuildGradle(project) diff --git a/tester/android/app/debug.keystore b/tester/android/app/debug.keystore new file mode 100644 index 0000000000000000000000000000000000000000..364e105ed39fbfd62001429a68140672b06ec0de Binary files /dev/null and b/tester/android/app/debug.keystore differ diff --git a/tester/android/app/proguard-rules.pro b/tester/android/app/proguard-rules.pro new file mode 100644 index 0000000000000000000000000000000000000000..11b025724a3f7a4a3685bbcd27da16440749f5e8 --- /dev/null +++ b/tester/android/app/proguard-rules.pro @@ -0,0 +1,10 @@ +# Add project specific ProGuard rules here. +# By default, the flags in this file are appended to flags specified +# in /usr/local/Cellar/android-sdk/24.3.3/tools/proguard/proguard-android.txt +# You can edit the include path and order by changing the proguardFiles +# directive in build.gradle. +# +# For more details, see +# http://developer.android.com/guide/developing/tools/proguard.html + +# Add any project specific keep options here: diff --git a/tester/android/app/src/debug/AndroidManifest.xml b/tester/android/app/src/debug/AndroidManifest.xml new file mode 100644 index 0000000000000000000000000000000000000000..4b185bc1597eb762051660198c02074bf82ab974 --- /dev/null +++ b/tester/android/app/src/debug/AndroidManifest.xml @@ -0,0 +1,13 @@ + + + + + + + + + diff --git a/tester/android/app/src/debug/java/com/rnandroidplayground/ReactNativeFlipper.java b/tester/android/app/src/debug/java/com/rnandroidplayground/ReactNativeFlipper.java new file mode 100644 index 0000000000000000000000000000000000000000..feb409ae02b47d06d4609cc8e2dc8c913d39fedf --- /dev/null +++ b/tester/android/app/src/debug/java/com/rnandroidplayground/ReactNativeFlipper.java @@ -0,0 +1,75 @@ +/** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + *

This source code is licensed under the MIT license found in the LICENSE file in the root + * directory of this source tree. + */ +package com.rnandroidplayground; + +import android.content.Context; +import com.facebook.flipper.android.AndroidFlipperClient; +import com.facebook.flipper.android.utils.FlipperUtils; +import com.facebook.flipper.core.FlipperClient; +import com.facebook.flipper.plugins.crashreporter.CrashReporterPlugin; +import com.facebook.flipper.plugins.databases.DatabasesFlipperPlugin; +import com.facebook.flipper.plugins.fresco.FrescoFlipperPlugin; +import com.facebook.flipper.plugins.inspector.DescriptorMapping; +import com.facebook.flipper.plugins.inspector.InspectorFlipperPlugin; +import com.facebook.flipper.plugins.network.FlipperOkhttpInterceptor; +import com.facebook.flipper.plugins.network.NetworkFlipperPlugin; +import com.facebook.flipper.plugins.sharedpreferences.SharedPreferencesFlipperPlugin; +import com.facebook.react.ReactInstanceEventListener; +import com.facebook.react.ReactInstanceManager; +import com.facebook.react.bridge.ReactContext; +import com.facebook.react.modules.network.NetworkingModule; +import okhttp3.OkHttpClient; + +/** + * Class responsible of loading Flipper inside your React Native application. This is the debug + * flavor of it. Here you can add your own plugins and customize the Flipper setup. + */ +public class ReactNativeFlipper { + public static void initializeFlipper(Context context, ReactInstanceManager reactInstanceManager) { + if (FlipperUtils.shouldEnableFlipper(context)) { + final FlipperClient client = AndroidFlipperClient.getInstance(context); + + client.addPlugin(new InspectorFlipperPlugin(context, DescriptorMapping.withDefaults())); + client.addPlugin(new DatabasesFlipperPlugin(context)); + client.addPlugin(new SharedPreferencesFlipperPlugin(context)); + client.addPlugin(CrashReporterPlugin.getInstance()); + + NetworkFlipperPlugin networkFlipperPlugin = new NetworkFlipperPlugin(); + NetworkingModule.setCustomClientBuilder( + new NetworkingModule.CustomClientBuilder() { + @Override + public void apply(OkHttpClient.Builder builder) { + builder.addNetworkInterceptor(new FlipperOkhttpInterceptor(networkFlipperPlugin)); + } + }); + client.addPlugin(networkFlipperPlugin); + client.start(); + + // Fresco Plugin needs to ensure that ImagePipelineFactory is initialized + // Hence we run if after all native modules have been initialized + ReactContext reactContext = reactInstanceManager.getCurrentReactContext(); + if (reactContext == null) { + reactInstanceManager.addReactInstanceEventListener( + new ReactInstanceEventListener() { + @Override + public void onReactContextInitialized(ReactContext reactContext) { + reactInstanceManager.removeReactInstanceEventListener(this); + reactContext.runOnNativeModulesQueueThread( + new Runnable() { + @Override + public void run() { + client.addPlugin(new FrescoFlipperPlugin()); + } + }); + } + }); + } else { + client.addPlugin(new FrescoFlipperPlugin()); + } + } + } +} diff --git a/tester/android/app/src/main/AndroidManifest.xml b/tester/android/app/src/main/AndroidManifest.xml new file mode 100644 index 0000000000000000000000000000000000000000..4122f36a590a440a5068314b0b003df4f319574a --- /dev/null +++ b/tester/android/app/src/main/AndroidManifest.xml @@ -0,0 +1,25 @@ + + + + + + + + + + + + + diff --git a/tester/android/app/src/main/java/com/rnandroidplayground/MainActivity.java b/tester/android/app/src/main/java/com/rnandroidplayground/MainActivity.java new file mode 100644 index 0000000000000000000000000000000000000000..d95392d5b73c9768ef937f553b10588d045c2381 --- /dev/null +++ b/tester/android/app/src/main/java/com/rnandroidplayground/MainActivity.java @@ -0,0 +1,35 @@ +package com.rnandroidplayground; + +import com.facebook.react.ReactActivity; +import com.facebook.react.ReactActivityDelegate; +import com.facebook.react.defaults.DefaultNewArchitectureEntryPoint; +import com.facebook.react.defaults.DefaultReactActivityDelegate; + +public class MainActivity extends ReactActivity { + + /** + * Returns the name of the main component registered from JavaScript. This is used to schedule + * rendering of the component. + */ + @Override + protected String getMainComponentName() { + return "app_name"; + } + + /** + * Returns the instance of the {@link ReactActivityDelegate}. Here we use a util class {@link + * DefaultReactActivityDelegate} which allows you to easily enable Fabric and Concurrent React + * (aka React 18) with two boolean flags. + */ + @Override + protected ReactActivityDelegate createReactActivityDelegate() { + return new DefaultReactActivityDelegate( + this, + getMainComponentName(), + // If you opted-in for the New Architecture, we enable the Fabric Renderer. + DefaultNewArchitectureEntryPoint.getFabricEnabled(), // fabricEnabled + // If you opted-in for the New Architecture, we enable Concurrent React (i.e. React 18). + DefaultNewArchitectureEntryPoint.getConcurrentReactEnabled() // concurrentRootEnabled + ); + } +} diff --git a/tester/android/app/src/main/java/com/rnandroidplayground/MainApplication.java b/tester/android/app/src/main/java/com/rnandroidplayground/MainApplication.java new file mode 100644 index 0000000000000000000000000000000000000000..b6fd1b0425986bec954486af018d8fb83e09a422 --- /dev/null +++ b/tester/android/app/src/main/java/com/rnandroidplayground/MainApplication.java @@ -0,0 +1,62 @@ +package com.rnandroidplayground; + +import android.app.Application; +import com.facebook.react.PackageList; +import com.facebook.react.ReactApplication; +import com.facebook.react.ReactNativeHost; +import com.facebook.react.ReactPackage; +import com.facebook.react.defaults.DefaultNewArchitectureEntryPoint; +import com.facebook.react.defaults.DefaultReactNativeHost; +import com.facebook.soloader.SoLoader; +import java.util.List; + +public class MainApplication extends Application implements ReactApplication { + + private final ReactNativeHost mReactNativeHost = + new DefaultReactNativeHost(this) { + @Override + public boolean getUseDeveloperSupport() { + return BuildConfig.DEBUG; + } + + @Override + protected List getPackages() { + @SuppressWarnings("UnnecessaryLocalVariable") + List packages = new PackageList(this).getPackages(); + // Packages that cannot be autolinked yet can be added manually here, for example: + // packages.add(new MyReactNativePackage()); + return packages; + } + + @Override + protected String getJSMainModuleName() { + return "index"; + } + + @Override + protected boolean isNewArchEnabled() { + return BuildConfig.IS_NEW_ARCHITECTURE_ENABLED; + } + + @Override + protected Boolean isHermesEnabled() { + return BuildConfig.IS_HERMES_ENABLED; + } + }; + + @Override + public ReactNativeHost getReactNativeHost() { + return mReactNativeHost; + } + + @Override + public void onCreate() { + super.onCreate(); + SoLoader.init(this, /* native exopackage */ false); + if (BuildConfig.IS_NEW_ARCHITECTURE_ENABLED) { + // If you opted-in for the New Architecture, we load the native entry point for this app. + DefaultNewArchitectureEntryPoint.load(); + } + ReactNativeFlipper.initializeFlipper(this, getReactNativeHost().getReactInstanceManager()); + } +} diff --git a/tester/android/app/src/main/res/drawable/rn_edit_text_material.xml b/tester/android/app/src/main/res/drawable/rn_edit_text_material.xml new file mode 100644 index 0000000000000000000000000000000000000000..f35d9962026a854a166779fd2a3850d05ce315c6 --- /dev/null +++ b/tester/android/app/src/main/res/drawable/rn_edit_text_material.xml @@ -0,0 +1,36 @@ + + + + + + + + + + + diff --git a/tester/android/app/src/main/res/mipmap-hdpi/ic_launcher.png b/tester/android/app/src/main/res/mipmap-hdpi/ic_launcher.png new file mode 100644 index 0000000000000000000000000000000000000000..a2f5908281d070150700378b64a84c7db1f97aa1 Binary files /dev/null and b/tester/android/app/src/main/res/mipmap-hdpi/ic_launcher.png differ diff --git a/tester/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png b/tester/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png new file mode 100644 index 0000000000000000000000000000000000000000..1b523998081149a985cef0cdf89045b9ed29964a Binary files /dev/null and b/tester/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png differ diff --git a/tester/android/app/src/main/res/mipmap-mdpi/ic_launcher.png b/tester/android/app/src/main/res/mipmap-mdpi/ic_launcher.png new file mode 100644 index 0000000000000000000000000000000000000000..ff10afd6e182edb2b1a63c8f984e9070d9f950ba Binary files /dev/null and b/tester/android/app/src/main/res/mipmap-mdpi/ic_launcher.png differ diff --git a/tester/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png b/tester/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png new file mode 100644 index 0000000000000000000000000000000000000000..115a4c768a20c9e13185c17043f4c4d12dd4632a Binary files /dev/null and b/tester/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png differ diff --git a/tester/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png b/tester/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png new file mode 100644 index 0000000000000000000000000000000000000000..dcd3cd8083358269d6ed7894726283bb9bcbbfea Binary files /dev/null and b/tester/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png differ diff --git a/tester/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png b/tester/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png new file mode 100644 index 0000000000000000000000000000000000000000..459ca609d3ae0d3943ab44cdc27feef9256dc6d7 Binary files /dev/null and b/tester/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png differ diff --git a/tester/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png b/tester/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png new file mode 100644 index 0000000000000000000000000000000000000000..8ca12fe024be86e868d14e91120a6902f8e88ac6 Binary files /dev/null and b/tester/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png differ diff --git a/tester/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png b/tester/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png new file mode 100644 index 0000000000000000000000000000000000000000..8e19b410a1b15ff180f3dacac19395fe3046cdec Binary files /dev/null and b/tester/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png differ diff --git a/tester/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png b/tester/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png new file mode 100644 index 0000000000000000000000000000000000000000..b824ebdd48db917eea2e67a82260a100371f8a24 Binary files /dev/null and b/tester/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png differ diff --git a/tester/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png b/tester/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png new file mode 100644 index 0000000000000000000000000000000000000000..4c19a13c239cb67b8a2134ddd5f325db1d2d5bee Binary files /dev/null and b/tester/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png differ diff --git a/tester/android/app/src/main/res/values/strings.xml b/tester/android/app/src/main/res/values/strings.xml new file mode 100644 index 0000000000000000000000000000000000000000..a659a562723063850f6f20fa26af283a2770043e --- /dev/null +++ b/tester/android/app/src/main/res/values/strings.xml @@ -0,0 +1,3 @@ + + SVG Android Tester + \ No newline at end of file diff --git a/tester/android/app/src/main/res/values/styles.xml b/tester/android/app/src/main/res/values/styles.xml new file mode 100644 index 0000000000000000000000000000000000000000..7ba83a2ad5a2c9be2d9eb2a4211590336f28209b --- /dev/null +++ b/tester/android/app/src/main/res/values/styles.xml @@ -0,0 +1,9 @@ + + + + + + diff --git a/tester/android/app/src/release/java/com/rnandroidplayground/ReactNativeFlipper.java b/tester/android/app/src/release/java/com/rnandroidplayground/ReactNativeFlipper.java new file mode 100644 index 0000000000000000000000000000000000000000..0b35712f8f2872eaf868f5cfcc9de92ca61c75be --- /dev/null +++ b/tester/android/app/src/release/java/com/rnandroidplayground/ReactNativeFlipper.java @@ -0,0 +1,20 @@ +/** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + *

This source code is licensed under the MIT license found in the LICENSE file in the root + * directory of this source tree. + */ +package com.rnandroidplayground; + +import android.content.Context; +import com.facebook.react.ReactInstanceManager; + +/** + * Class responsible of loading Flipper inside your React Native application. This is the release + * flavor of it so it's empty as we don't want to load Flipper. + */ +public class ReactNativeFlipper { + public static void initializeFlipper(Context context, ReactInstanceManager reactInstanceManager) { + // Do nothing as we don't want to initialize Flipper on Release. + } +} diff --git a/tester/android/build.gradle b/tester/android/build.gradle new file mode 100644 index 0000000000000000000000000000000000000000..67d887b03078b68519c2238825016be80e284d22 --- /dev/null +++ b/tester/android/build.gradle @@ -0,0 +1,21 @@ +// Top-level build file where you can add configuration options common to all sub-projects/modules. + +buildscript { + ext { + buildToolsVersion = "33.0.0" + minSdkVersion = 21 + compileSdkVersion = 33 + targetSdkVersion = 33 + + // We use NDK 23 which has both M1 support and is the side-by-side NDK version from AGP. + ndkVersion = "23.1.7779620" + } + repositories { + google() + mavenCentral() + } + dependencies { + classpath("com.android.tools.build:gradle:7.3.1") + classpath("com.facebook.react:react-native-gradle-plugin") + } +} diff --git a/tester/android/gradle.properties b/tester/android/gradle.properties new file mode 100644 index 0000000000000000000000000000000000000000..e1ddc51c7753d89d6ce5fe1312c565db58dda4e5 --- /dev/null +++ b/tester/android/gradle.properties @@ -0,0 +1,44 @@ +# Project-wide Gradle settings. + +# IDE (e.g. Android Studio) users: +# Gradle settings configured through the IDE *will override* +# any settings specified in this file. + +# For more details on how to configure your build environment visit +# http://www.gradle.org/docs/current/userguide/build_environment.html + +# Specifies the JVM arguments used for the daemon process. +# The setting is particularly useful for tweaking memory settings. +# Default value: -Xmx512m -XX:MaxMetaspaceSize=256m +org.gradle.jvmargs=-Xmx2048m -XX:MaxMetaspaceSize=512m + +# When configured, Gradle will run in incubating parallel mode. +# This option should only be used with decoupled projects. More details, visit +# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects +# org.gradle.parallel=true + +# AndroidX package structure to make it clearer which packages are bundled with the +# Android operating system, and which are packaged with your app's APK +# https://developer.android.com/topic/libraries/support-library/androidx-rn +android.useAndroidX=true +# Automatically convert third-party libraries to use AndroidX +android.enableJetifier=true + +# Version of flipper SDK to use with React Native +FLIPPER_VERSION=0.125.0 + +# Use this property to specify which architecture you want to build. +# You can also override it from the CLI using +# ./gradlew -PreactNativeArchitectures=x86_64 +reactNativeArchitectures=armeabi-v7a,arm64-v8a,x86,x86_64 + +# Use this property to enable support to the new architecture. +# This will allow you to use TurboModules and the Fabric render in +# your application. You should enable this flag either if you want +# to write custom TurboModules/Fabric components OR use libraries that +# are providing them. +newArchEnabled=true + +# Use this property to enable or disable the Hermes JS engine. +# If set to false, you will be using JSC instead. +hermesEnabled=true diff --git a/tester/android/gradle/wrapper/gradle-wrapper.jar b/tester/android/gradle/wrapper/gradle-wrapper.jar new file mode 100644 index 0000000000000000000000000000000000000000..41d9927a4d4fb3f96a785543079b8df6723c946b Binary files /dev/null and b/tester/android/gradle/wrapper/gradle-wrapper.jar differ diff --git a/tester/android/gradle/wrapper/gradle-wrapper.properties b/tester/android/gradle/wrapper/gradle-wrapper.properties new file mode 100644 index 0000000000000000000000000000000000000000..8fad3f5a98bf4a104de5df8345c1f59f984cba8a --- /dev/null +++ b/tester/android/gradle/wrapper/gradle-wrapper.properties @@ -0,0 +1,5 @@ +distributionBase=GRADLE_USER_HOME +distributionPath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-7.5.1-all.zip +zipStoreBase=GRADLE_USER_HOME +zipStorePath=wrapper/dists diff --git a/tester/android/gradlew b/tester/android/gradlew new file mode 100644 index 0000000000000000000000000000000000000000..1b6c787337ffb79f0e3cf8b1e9f00f680a959de1 --- /dev/null +++ b/tester/android/gradlew @@ -0,0 +1,234 @@ +#!/bin/sh + +# +# Copyright © 2015-2021 the original authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +############################################################################## +# +# Gradle start up script for POSIX generated by Gradle. +# +# Important for running: +# +# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is +# noncompliant, but you have some other compliant shell such as ksh or +# bash, then to run this script, type that shell name before the whole +# command line, like: +# +# ksh Gradle +# +# Busybox and similar reduced shells will NOT work, because this script +# requires all of these POSIX shell features: +# * functions; +# * expansions «$var», «${var}», «${var:-default}», «${var+SET}», +# «${var#prefix}», «${var%suffix}», and «$( cmd )»; +# * compound commands having a testable exit status, especially «case»; +# * various built-in commands including «command», «set», and «ulimit». +# +# Important for patching: +# +# (2) This script targets any POSIX shell, so it avoids extensions provided +# by Bash, Ksh, etc; in particular arrays are avoided. +# +# The "traditional" practice of packing multiple parameters into a +# space-separated string is a well documented source of bugs and security +# problems, so this is (mostly) avoided, by progressively accumulating +# options in "$@", and eventually passing that to Java. +# +# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS, +# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly; +# see the in-line comments for details. +# +# There are tweaks for specific operating systems such as AIX, CygWin, +# Darwin, MinGW, and NonStop. +# +# (3) This script is generated from the Groovy template +# https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# within the Gradle project. +# +# You can find Gradle at https://github.com/gradle/gradle/. +# +############################################################################## + +# Attempt to set APP_HOME + +# Resolve links: $0 may be a link +app_path=$0 + +# Need this for daisy-chained symlinks. +while + APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path + [ -h "$app_path" ] +do + ls=$( ls -ld "$app_path" ) + link=${ls#*' -> '} + case $link in #( + /*) app_path=$link ;; #( + *) app_path=$APP_HOME$link ;; + esac +done + +APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit + +APP_NAME="Gradle" +APP_BASE_NAME=${0##*/} + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' + +# Use the maximum available, or set MAX_FD != -1 to use that value. +MAX_FD=maximum + +warn () { + echo "$*" +} >&2 + +die () { + echo + echo "$*" + echo + exit 1 +} >&2 + +# OS specific support (must be 'true' or 'false'). +cygwin=false +msys=false +darwin=false +nonstop=false +case "$( uname )" in #( + CYGWIN* ) cygwin=true ;; #( + Darwin* ) darwin=true ;; #( + MSYS* | MINGW* ) msys=true ;; #( + NONSTOP* ) nonstop=true ;; +esac + +CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar + + +# Determine the Java command to use to start the JVM. +if [ -n "$JAVA_HOME" ] ; then + if [ -x "$JAVA_HOME/jre/sh/java" ] ; then + # IBM's JDK on AIX uses strange locations for the executables + JAVACMD=$JAVA_HOME/jre/sh/java + else + JAVACMD=$JAVA_HOME/bin/java + fi + if [ ! -x "$JAVACMD" ] ; then + die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." + fi +else + JAVACMD=java + which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi + +# Increase the maximum file descriptors if we can. +if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then + case $MAX_FD in #( + max*) + MAX_FD=$( ulimit -H -n ) || + warn "Could not query maximum file descriptor limit" + esac + case $MAX_FD in #( + '' | soft) :;; #( + *) + ulimit -n "$MAX_FD" || + warn "Could not set maximum file descriptor limit to $MAX_FD" + esac +fi + +# Collect all arguments for the java command, stacking in reverse order: +# * args from the command line +# * the main class name +# * -classpath +# * -D...appname settings +# * --module-path (only if needed) +# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables. + +# For Cygwin or MSYS, switch paths to Windows format before running java +if "$cygwin" || "$msys" ; then + APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) + CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) + + JAVACMD=$( cygpath --unix "$JAVACMD" ) + + # Now convert the arguments - kludge to limit ourselves to /bin/sh + for arg do + if + case $arg in #( + -*) false ;; # don't mess with options #( + /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath + [ -e "$t" ] ;; #( + *) false ;; + esac + then + arg=$( cygpath --path --ignore --mixed "$arg" ) + fi + # Roll the args list around exactly as many times as the number of + # args, so each arg winds up back in the position where it started, but + # possibly modified. + # + # NB: a `for` loop captures its iteration list before it begins, so + # changing the positional parameters here affects neither the number of + # iterations, nor the values presented in `arg`. + shift # remove old arg + set -- "$@" "$arg" # push replacement arg + done +fi + +# Collect all arguments for the java command; +# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of +# shell script including quotes and variable substitutions, so put them in +# double quotes to make sure that they get re-expanded; and +# * put everything else in single quotes, so that it's not re-expanded. + +set -- \ + "-Dorg.gradle.appname=$APP_BASE_NAME" \ + -classpath "$CLASSPATH" \ + org.gradle.wrapper.GradleWrapperMain \ + "$@" + +# Use "xargs" to parse quoted args. +# +# With -n1 it outputs one arg per line, with the quotes and backslashes removed. +# +# In Bash we could simply go: +# +# readarray ARGS < <( xargs -n1 <<<"$var" ) && +# set -- "${ARGS[@]}" "$@" +# +# but POSIX shell has neither arrays nor command substitution, so instead we +# post-process each arg (as a line of input to sed) to backslash-escape any +# character that might be a shell metacharacter, then use eval to reverse +# that process (while maintaining the separation between arguments), and wrap +# the whole thing up as a single "set" statement. +# +# This will of course break if any of these variables contains a newline or +# an unmatched quote. +# + +eval "set -- $( + printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | + xargs -n1 | + sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | + tr '\n' ' ' + )" '"$@"' + +exec "$JAVACMD" "$@" diff --git a/tester/android/gradlew.bat b/tester/android/gradlew.bat new file mode 100644 index 0000000000000000000000000000000000000000..107acd32c4e687021ef32db511e8a206129b88ec --- /dev/null +++ b/tester/android/gradlew.bat @@ -0,0 +1,89 @@ +@rem +@rem Copyright 2015 the original author or authors. +@rem +@rem Licensed under the Apache License, Version 2.0 (the "License"); +@rem you may not use this file except in compliance with the License. +@rem You may obtain a copy of the License at +@rem +@rem https://www.apache.org/licenses/LICENSE-2.0 +@rem +@rem Unless required by applicable law or agreed to in writing, software +@rem distributed under the License is distributed on an "AS IS" BASIS, +@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +@rem See the License for the specific language governing permissions and +@rem limitations under the License. +@rem + +@if "%DEBUG%" == "" @echo off +@rem ########################################################################## +@rem +@rem Gradle startup script for Windows +@rem +@rem ########################################################################## + +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal + +set DIRNAME=%~dp0 +if "%DIRNAME%" == "" set DIRNAME=. +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% + +@rem Resolve any "." and ".." in APP_HOME to make it shorter. +for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi + +@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" + +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome + +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if "%ERRORLEVEL%" == "0" goto execute + +echo. +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe + +if exist "%JAVA_EXE%" goto execute + +echo. +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:execute +@rem Setup the command line + +set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar + + +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* + +:end +@rem End local scope for the variables with windows NT shell +if "%ERRORLEVEL%"=="0" goto mainEnd + +:fail +rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of +rem the _cmd.exe /c_ return code! +if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 +exit /b 1 + +:mainEnd +if "%OS%"=="Windows_NT" endlocal + +:omega diff --git a/tester/android/settings.gradle b/tester/android/settings.gradle new file mode 100644 index 0000000000000000000000000000000000000000..02c48b6d622577f1f60fc9689a1992a66c6a8101 --- /dev/null +++ b/tester/android/settings.gradle @@ -0,0 +1,4 @@ +rootProject.name = 'app_name' +apply from: file("../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesSettingsGradle(settings) +include ':app' +includeBuild('../node_modules/@react-native/gradle-plugin') diff --git a/tester/app.json b/tester/app.json new file mode 100644 index 0000000000000000000000000000000000000000..efe8dd7c42c2a1e5180ca89e9b78db07e27abe0c --- /dev/null +++ b/tester/app.json @@ -0,0 +1,4 @@ +{ + "name": "svg", + "displayName": "tester" +} \ No newline at end of file diff --git a/tester/assets/pic.webp b/tester/assets/pic.webp new file mode 100644 index 0000000000000000000000000000000000000000..6c7d026316f24b64b55e199915c2482bb5dfce6b Binary files /dev/null and b/tester/assets/pic.webp differ diff --git a/tester/assets/react-native-logo.png b/tester/assets/react-native-logo.png new file mode 100644 index 0000000000000000000000000000000000000000..4a01fe312c5bf69e8f4cdd5ef1b77f4f23b7d289 Binary files /dev/null and b/tester/assets/react-native-logo.png differ diff --git a/tester/assets/star.jpg b/tester/assets/star.jpg new file mode 100644 index 0000000000000000000000000000000000000000..0f24277e1a98b3a8b6da02033fd4f0d264dc826f Binary files /dev/null and b/tester/assets/star.jpg differ diff --git a/tester/babel.config.js b/tester/babel.config.js new file mode 100644 index 0000000000000000000000000000000000000000..f842b77fcfb8b74016365099d8c5fe54cf3269e2 --- /dev/null +++ b/tester/babel.config.js @@ -0,0 +1,3 @@ +module.exports = { + presets: ['module:metro-react-native-babel-preset'], +}; diff --git a/tester/harmony/.clang-format b/tester/harmony/.clang-format new file mode 100644 index 0000000000000000000000000000000000000000..31a096cf405efb5c6391be3d902432a0cc38ed2e --- /dev/null +++ b/tester/harmony/.clang-format @@ -0,0 +1,62 @@ +Language: Cpp +# BasedOnStyle: LLVM +ColumnLimit: 120 +SortIncludes: false +TabWidth: 4 +IndentWidth: 4 +UseTab: Never +AccessModifierOffset: -4 +ContinuationIndentWidth: 4 +IndentCaseBlocks: false +IndentCaseLabels: false +IndentGotoLabels: true +IndentWrappedFunctionNames: false +SortUsingDeclarations: false +NamespaceIndentation: None +SpaceAfterCStyleCast: false +SpaceAfterLogicalNot: false +SpaceAfterTemplateKeyword: true +SpaceBeforeAssignmentOperators: true +SpaceBeforeCaseColon: false +SpaceBeforeCpp11BracedList: false +SpaceBeforeCtorInitializerColon: true +SpaceBeforeInheritanceColon: true +SpaceBeforeRangeBasedForLoopColon: true +SpaceBeforeSquareBrackets: false +SpaceInEmptyBlock: false +SpaceInEmptyParentheses: false +SpacesInAngles: false +SpacesInCStyleCastParentheses: false +SpacesInConditionalStatement: false +SpacesInParentheses: false +SpacesInSquareBrackets: false +AllowShortCaseLabelsOnASingleLine: false +AllowShortEnumsOnASingleLine: true +AllowShortFunctionsOnASingleLine: All +AllowShortIfStatementsOnASingleLine: Never +AllowShortLambdasOnASingleLine: All +AllowShortLoopsOnASingleLine: false +AlwaysBreakTemplateDeclarations: MultiLine +BinPackArguments: true +BinPackParameters: true +BreakBeforeTernaryOperators: true +BreakConstructorInitializers: BeforeColon +BreakInheritanceList: BeforeColon +BreakStringLiterals: true +InsertBraces: false +IndentExternBlock: NoIndent +BreakBeforeBraces: Custom +BraceWrapping: + AfterCaseLabel: false + AfterClass: false + AfterControlStatement: Never + AfterEnum: false + AfterFunction: false + AfterNamespace: false + AfterStruct: false + AfterUnion: false + AfterExternBlock: false + BeforeCatch: false + BeforeElse: false +ReflowComments: true +MaxEmptyLinesToKeep: 2 \ No newline at end of file diff --git a/tester/harmony/.gitignore b/tester/harmony/.gitignore new file mode 100644 index 0000000000000000000000000000000000000000..20514fc90f10dc9d49106467dd12f03698819ca4 --- /dev/null +++ b/tester/harmony/.gitignore @@ -0,0 +1,16 @@ +# it may cause some issues when building the project when switching branches +package-lock.json +react_native_modules/ +oh_modules/ + +# --- + +/node_modules +/local.properties +/.idea +**/build +/.hvigor +.cxx +/.clangd +/.clang-tidy +build-profile.json5 diff --git a/tester/harmony/AppScope/app.json5 b/tester/harmony/AppScope/app.json5 new file mode 100644 index 0000000000000000000000000000000000000000..5880bc03a0ac1bc084a75b7b7969faf5b4407361 --- /dev/null +++ b/tester/harmony/AppScope/app.json5 @@ -0,0 +1,11 @@ +{ + "app": { + "bundleName": "com.rnoh.svg", + "vendor": "example", + "versionCode": 1000000, + "versionName": "1.0.0", + "icon": "$media:app_icon", + "label": "$string:app_name", + "distributedNotificationEnabled": true + } +} diff --git a/tester/harmony/AppScope/resources/base/element/string.json b/tester/harmony/AppScope/resources/base/element/string.json new file mode 100644 index 0000000000000000000000000000000000000000..ccafa600a7e6e3f6b03b674f799ed727b91fca76 --- /dev/null +++ b/tester/harmony/AppScope/resources/base/element/string.json @@ -0,0 +1,8 @@ +{ + "string": [ + { + "name": "app_name", + "value": "rnoh" + } + ] +} diff --git a/tester/harmony/AppScope/resources/base/media/app_icon.png b/tester/harmony/AppScope/resources/base/media/app_icon.png new file mode 100644 index 0000000000000000000000000000000000000000..ce307a8827bd75456441ceb57d530e4c8d45d36c Binary files /dev/null and b/tester/harmony/AppScope/resources/base/media/app_icon.png differ diff --git a/tester/harmony/build-profile.template.json5 b/tester/harmony/build-profile.template.json5 new file mode 100644 index 0000000000000000000000000000000000000000..0a68e0492ab1885f16b3d193dc4dd78507deb3a3 --- /dev/null +++ b/tester/harmony/build-profile.template.json5 @@ -0,0 +1,39 @@ +{ + app: { + products: [ + { + name: 'default', + signingConfig: 'default', + compatibleSdkVersion: "5.0.0(12)", + runtimeOS: 'HarmonyOS' + }, + ], + buildModeSet: [ + { + name: 'debug', + }, + { + name: 'release', + }, + ], + "signingConfigs": [] + }, + modules: [ + { + name: 'entry', + srcPath: './entry', + targets: [ + { + name: 'default', + applyToProducts: [ + 'default' + ], + }, + ], + }, + { + name: 'svg', + srcPath: './svg', + } + ], +} \ No newline at end of file diff --git a/tester/harmony/dependencies/hvigor-4.3.0.tgz b/tester/harmony/dependencies/hvigor-4.3.0.tgz new file mode 100644 index 0000000000000000000000000000000000000000..4331aad9655febd81e50650043a8c35768b37d99 Binary files /dev/null and b/tester/harmony/dependencies/hvigor-4.3.0.tgz differ diff --git a/tester/harmony/dependencies/hvigor-ohos-arkui-x-plugin-3.3.0.tgz b/tester/harmony/dependencies/hvigor-ohos-arkui-x-plugin-3.3.0.tgz new file mode 100644 index 0000000000000000000000000000000000000000..5b496f7dae4637aca0f286932202b543c2d21540 Binary files /dev/null and b/tester/harmony/dependencies/hvigor-ohos-arkui-x-plugin-3.3.0.tgz differ diff --git a/tester/harmony/dependencies/hvigor-ohos-plugin-4.3.0.tgz b/tester/harmony/dependencies/hvigor-ohos-plugin-4.3.0.tgz new file mode 100644 index 0000000000000000000000000000000000000000..6fb89f742046445191bf6616c572f40c1793b12f Binary files /dev/null and b/tester/harmony/dependencies/hvigor-ohos-plugin-4.3.0.tgz differ diff --git a/tester/harmony/entry/.gitignore b/tester/harmony/entry/.gitignore new file mode 100644 index 0000000000000000000000000000000000000000..fb89079c4093681c687b5aa7622528139232f87c --- /dev/null +++ b/tester/harmony/entry/.gitignore @@ -0,0 +1,5 @@ +/oh_modules +/.preview +/build +/.cxx +package-lock.json diff --git a/tester/harmony/entry/build-profile.json5 b/tester/harmony/entry/build-profile.json5 new file mode 100644 index 0000000000000000000000000000000000000000..6f2e56988dbd729f98b983526b1dcd2727218d93 --- /dev/null +++ b/tester/harmony/entry/build-profile.json5 @@ -0,0 +1,19 @@ +{ + "apiType": 'stageMode', + "buildOption": { + "externalNativeOptions": { + "path": "./src/main/cpp/CMakeLists.txt", + "arguments": "", + "cppFlags": "", + } + }, + "targets": [ + { + "name": "default", + "runtimeOS": "HarmonyOS" + }, + { + "name": "ohosTest", + } + ] +} \ No newline at end of file diff --git a/tester/harmony/entry/hvigorfile.ts b/tester/harmony/entry/hvigorfile.ts new file mode 100644 index 0000000000000000000000000000000000000000..80e4ec5b81689f238c34614b167a0b9e9c83e8d9 --- /dev/null +++ b/tester/harmony/entry/hvigorfile.ts @@ -0,0 +1,2 @@ +// Script for compiling build behavior. It is built in the build plug-in and cannot be modified currently. +export { hapTasks } from '@ohos/hvigor-ohos-plugin'; diff --git a/tester/harmony/entry/oh-package-lock.json5 b/tester/harmony/entry/oh-package-lock.json5 new file mode 100644 index 0000000000000000000000000000000000000000..666b0a5987d32a5b9adba2b82f2adf17ca116c32 --- /dev/null +++ b/tester/harmony/entry/oh-package-lock.json5 @@ -0,0 +1,28 @@ +{ + "meta": { + "stableOrder": true + }, + "lockfileVersion": 3, + "ATTENTION": "THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.", + "specifiers": { + "@rnoh/react-native-openharmony-svg@../svg": "@rnoh/react-native-openharmony-svg@../svg", + "@rnoh/react-native-openharmony@../react_native_openharmony.har": "@rnoh/react-native-openharmony@../react_native_openharmony.har" + }, + "packages": { + "@rnoh/react-native-openharmony-svg@../svg": { + "name": "@react-native-oh-tpl/react-native-svg", + "version": "15.0.0-0.5.8", + "resolved": "../svg", + "registryType": "local", + "dependencies": { + "@rnoh/react-native-openharmony": "file:../react_native_openharmony" + } + }, + "@rnoh/react-native-openharmony@../react_native_openharmony.har": { + "name": "@rnoh/react-native-openharmony", + "version": "0.72.27", + "resolved": "../react_native_openharmony.har", + "registryType": "local" + } + } +} \ No newline at end of file diff --git a/tester/harmony/entry/oh-package.json5 b/tester/harmony/entry/oh-package.json5 new file mode 100644 index 0000000000000000000000000000000000000000..e87b9c2717ac2697d68c948cd28cc46d7f689de0 --- /dev/null +++ b/tester/harmony/entry/oh-package.json5 @@ -0,0 +1,11 @@ +{ + "license": "ISC", + "devDependencies": {}, + "name": "entry", + "description": "example description", + "repository": '', + "version": "1.0.0", + "dependencies": { + "@rnoh/react-native-openharmony-svg": "file:../svg" + } +} diff --git a/tester/harmony/entry/src/main/cpp/.gitignore b/tester/harmony/entry/src/main/cpp/.gitignore new file mode 100644 index 0000000000000000000000000000000000000000..de140dae4a8ffa828077372ecc776ecaf2e2143d --- /dev/null +++ b/tester/harmony/entry/src/main/cpp/.gitignore @@ -0,0 +1 @@ +jsbundle.h \ No newline at end of file diff --git a/tester/harmony/entry/src/main/cpp/CMakeLists.txt b/tester/harmony/entry/src/main/cpp/CMakeLists.txt new file mode 100644 index 0000000000000000000000000000000000000000..665a92a2f71513a4cbf6be93cf42fd7bcd22c77b --- /dev/null +++ b/tester/harmony/entry/src/main/cpp/CMakeLists.txt @@ -0,0 +1,16 @@ +project(rnapp) +cmake_minimum_required(VERSION 3.4.1) +set(OH_MODULES_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../../../oh_modules") +set(RNOH_APP_DIR "${CMAKE_CURRENT_SOURCE_DIR}") +set(RNOH_CPP_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../../../../oh_modules/@rnoh/react-native-openharmony/src/main/cpp") +set(WITH_HITRACE_SYSTRACE 1) +add_compile_definitions(WITH_HITRACE_SYSTRACE) + +add_subdirectory("${RNOH_CPP_DIR}" ./rn) +add_subdirectory("${OH_MODULES_DIR}/@rnoh/react-native-openharmony-svg/src/main/cpp" ./svg) +add_library(rnoh_app SHARED + "./PackageProvider.cpp" + "${RNOH_CPP_DIR}/RNOHAppNapiBridge.cpp" +) +target_link_libraries(rnoh_app PUBLIC rnoh) +target_link_libraries(rnoh_app PUBLIC rnoh_svg) diff --git a/tester/harmony/entry/src/main/cpp/PackageProvider.cpp b/tester/harmony/entry/src/main/cpp/PackageProvider.cpp new file mode 100644 index 0000000000000000000000000000000000000000..fd847f5d6bcf1ae38b899029f55681700f0339f0 --- /dev/null +++ b/tester/harmony/entry/src/main/cpp/PackageProvider.cpp @@ -0,0 +1,8 @@ +#include "RNOH/PackageProvider.h" +#include "SVGPackage.h" + +using namespace rnoh; + +std::vector> PackageProvider::getPackages(Package::Context ctx) { + return {std::make_shared(ctx)}; +} \ No newline at end of file diff --git a/tester/harmony/entry/src/main/ets/RNPackagesFactory.ts b/tester/harmony/entry/src/main/ets/RNPackagesFactory.ts new file mode 100644 index 0000000000000000000000000000000000000000..7010404aa60dc84d3e49faa6d3768c77ca78eddf --- /dev/null +++ b/tester/harmony/entry/src/main/ets/RNPackagesFactory.ts @@ -0,0 +1,6 @@ +import type {RNPackageContext, RNPackage} from '@rnoh/react-native-openharmony/ts'; +import {SvgPackage} from '@rnoh/react-native-openharmony-svg/ts'; + +export function createRNPackages(ctx: RNPackageContext): RNPackage[] { + return [new SvgPackage(ctx)]; +} \ No newline at end of file diff --git a/tester/harmony/entry/src/main/ets/entryability/EntryAbility.ets b/tester/harmony/entry/src/main/ets/entryability/EntryAbility.ets new file mode 100644 index 0000000000000000000000000000000000000000..cf622c57b89f5f05d5b40731d8259b4d158b7888 --- /dev/null +++ b/tester/harmony/entry/src/main/ets/entryability/EntryAbility.ets @@ -0,0 +1,7 @@ +import { RNAbility } from "@rnoh/react-native-openharmony"; + +export default class EntryAbility extends RNAbility { + getPagePath() { + return "pages/Index" + } +}; diff --git a/tester/harmony/entry/src/main/ets/pages/Index.ets b/tester/harmony/entry/src/main/ets/pages/Index.ets new file mode 100644 index 0000000000000000000000000000000000000000..9a6efff967e7362da414d5ca6f392a742f6ff947 --- /dev/null +++ b/tester/harmony/entry/src/main/ets/pages/Index.ets @@ -0,0 +1,107 @@ +import { + AnyJSBundleProvider, + ComponentBuilderContext, + FileJSBundleProvider, + MetroJSBundleProvider, + ResourceJSBundleProvider, + RNApp, + RNOHErrorDialog, + RNOHLogger, + TraceJSBundleProviderDecorator, + RNOHCoreContext +} from '@rnoh/react-native-openharmony'; +import font from '@ohos.font'; +import { createRNPackages } from '../RNPackagesFactory'; + +const arkTsComponentNames: Array = ["SampleView", "GeneratedSampleView", "PropsDisplayer"]; +@Builder +export function buildCustomRNComponent(ctx: ComponentBuilderContext) { + // There seems to be a problem with the placement of ArkTS components in mixed mode. Nested Stack temporarily avoided. + Stack(){ + } + .position({x:0, y: 0}) + +} + +const wrappedCustomRNComponentBuilder = wrapBuilder(buildCustomRNComponent) + +/** + * If you want to use custom fonts, you need to register them here. + * We should support react-native-asset to handle registering fonts automatically. + */ +const fonts: font.FontOptions[] = [ + { + familyName: 'Pacifico-Regular', + familySrc: '/assets/fonts/Pacifico-Regular.ttf' + }, + { + familyName: 'StintUltraCondensed-Regular', + familySrc: '/assets/fonts/StintUltraCondensed-Regular.ttf' + } +] + +@Entry +@Component +struct Index { + @StorageLink('RNOHCoreContext') private rnohCoreContext: RNOHCoreContext | undefined = undefined + @State shouldShow: boolean = false + private logger!: RNOHLogger + + + aboutToAppear() { + this.logger = this.rnohCoreContext!.logger.clone("Index") + const stopTracing = this.logger.clone("aboutToAppear").startTracing() + for (const customFont of fonts) { + font.registerFont(customFont) + } + + this.shouldShow = true + stopTracing() + } + + onBackPress(): boolean | undefined { + // NOTE: this is required since `Ability`'s `onBackPressed` function always + // terminates or puts the app in the background, but we want Ark to ignore it completely + // when handled by RN + this.rnohCoreContext!.dispatchBackPress() + return true + } + + build() { + Column() { + if (this.rnohCoreContext && this.shouldShow) { + if (this.rnohCoreContext?.isDebugModeEnabled) { + RNOHErrorDialog({ ctx: this.rnohCoreContext }) + } + RNApp({ + rnInstanceConfig: { + createRNPackages, + enableNDKTextMeasuring: true, + enableBackgroundExecutor: false, + enableCAPIArchitecture: true, + arkTsComponentNames: arkTsComponentNames, + }, + initialProps: { "foo": "bar" } as Record, + appKey: "svg", + wrappedCustomRNComponentBuilder: wrappedCustomRNComponentBuilder, + onSetUp: (rnInstance) => { + rnInstance.enableFeatureFlag("ENABLE_RN_INSTANCE_CLEAN_UP") + }, + jsBundleProvider: new TraceJSBundleProviderDecorator( + new AnyJSBundleProvider([ + new MetroJSBundleProvider(), + // NOTE: to load the bundle from file, place it in + // `/data/app/el2/100/base/com.rnoh.tester/files/bundle.harmony.js` + // on your device. The path mismatch is due to app sandboxing on HarmonyOS + new FileJSBundleProvider('/data/storage/el2/base/files/bundle.harmony.js'), + new ResourceJSBundleProvider(this.rnohCoreContext.uiAbilityContext.resourceManager, 'hermes_bundle.hbc'), + new ResourceJSBundleProvider(this.rnohCoreContext.uiAbilityContext.resourceManager, 'bundle.harmony.js') + ]), + this.rnohCoreContext.logger), + }) + } + } + .height('100%') + .width('100%') + } +} \ No newline at end of file diff --git a/tester/harmony/entry/src/main/module.json5 b/tester/harmony/entry/src/main/module.json5 new file mode 100644 index 0000000000000000000000000000000000000000..1bbe6303ea7ce3c87477c75f92ca876d4fe83796 --- /dev/null +++ b/tester/harmony/entry/src/main/module.json5 @@ -0,0 +1,39 @@ +{ + "module": { + "name": "entry", + "type": "entry", + "description": "$string:module_desc", + "mainElement": "EntryAbility", + "deviceTypes": [ + "default" + ], + "deliveryWithInstall": true, + "installationFree": false, + "pages": "$profile:main_pages", + "requestPermissions": [ + {"name": "ohos.permission.INTERNET"} + ], + "abilities": [ + { + "name": "EntryAbility", + "description": "$string:EntryAbility_desc", + "icon": "$media:icon", + "label": "$string:EntryAbility_label", + "startWindowIcon": "$media:icon", + "startWindowBackground": "$color:start_window_background", + "visible": true, + "skills": [ + { + "entities": [ + "entity.system.home" + ], + "actions": [ + "action.system.home" + ] + } + ], + "srcEntry": "./ets/entryability/EntryAbility.ets" + } + ] + } +} \ No newline at end of file diff --git a/tester/harmony/entry/src/main/resources/base/element/color.json b/tester/harmony/entry/src/main/resources/base/element/color.json new file mode 100644 index 0000000000000000000000000000000000000000..3c712962da3c2751c2b9ddb53559afcbd2b54a02 --- /dev/null +++ b/tester/harmony/entry/src/main/resources/base/element/color.json @@ -0,0 +1,8 @@ +{ + "color": [ + { + "name": "start_window_background", + "value": "#FFFFFF" + } + ] +} \ No newline at end of file diff --git a/tester/harmony/entry/src/main/resources/base/element/string.json b/tester/harmony/entry/src/main/resources/base/element/string.json new file mode 100644 index 0000000000000000000000000000000000000000..acfc0846e8c5074e3de335a414cf23e700edfe01 --- /dev/null +++ b/tester/harmony/entry/src/main/resources/base/element/string.json @@ -0,0 +1,16 @@ +{ + "string": [ + { + "name": "module_desc", + "value": "module description" + }, + { + "name": "EntryAbility_desc", + "value": "description" + }, + { + "name": "EntryAbility_label", + "value": "SVG Tester" + } + ] +} diff --git a/tester/harmony/entry/src/main/resources/base/media/icon.png b/tester/harmony/entry/src/main/resources/base/media/icon.png new file mode 100644 index 0000000000000000000000000000000000000000..ce307a8827bd75456441ceb57d530e4c8d45d36c Binary files /dev/null and b/tester/harmony/entry/src/main/resources/base/media/icon.png differ diff --git a/tester/harmony/entry/src/main/resources/base/profile/main_pages.json b/tester/harmony/entry/src/main/resources/base/profile/main_pages.json new file mode 100644 index 0000000000000000000000000000000000000000..1898d94f58d6128ab712be2c68acc7c98e9ab9ce --- /dev/null +++ b/tester/harmony/entry/src/main/resources/base/profile/main_pages.json @@ -0,0 +1,5 @@ +{ + "src": [ + "pages/Index" + ] +} diff --git a/tester/harmony/entry/src/main/resources/en_US/element/string.json b/tester/harmony/entry/src/main/resources/en_US/element/string.json new file mode 100644 index 0000000000000000000000000000000000000000..acfc0846e8c5074e3de335a414cf23e700edfe01 --- /dev/null +++ b/tester/harmony/entry/src/main/resources/en_US/element/string.json @@ -0,0 +1,16 @@ +{ + "string": [ + { + "name": "module_desc", + "value": "module description" + }, + { + "name": "EntryAbility_desc", + "value": "description" + }, + { + "name": "EntryAbility_label", + "value": "SVG Tester" + } + ] +} diff --git a/tester/harmony/entry/src/main/resources/zh_CN/element/string.json b/tester/harmony/entry/src/main/resources/zh_CN/element/string.json new file mode 100644 index 0000000000000000000000000000000000000000..575a953f7a27aaf95651d077e363984ef3035d53 --- /dev/null +++ b/tester/harmony/entry/src/main/resources/zh_CN/element/string.json @@ -0,0 +1,16 @@ +{ + "string": [ + { + "name": "module_desc", + "value": "模块描述" + }, + { + "name": "EntryAbility_desc", + "value": "description" + }, + { + "name": "EntryAbility_label", + "value": "SVG Tester" + } + ] +} diff --git a/tester/harmony/hvigor/hvigor-config.json5 b/tester/harmony/hvigor/hvigor-config.json5 new file mode 100644 index 0000000000000000000000000000000000000000..e6b49609f33995682620f7d83d56fb2f3f12b60f --- /dev/null +++ b/tester/harmony/hvigor/hvigor-config.json5 @@ -0,0 +1,5 @@ +{ + "modelVersion": "5.0.0", + "dependencies": { + }, +} \ No newline at end of file diff --git a/tester/harmony/hvigorfile.ts b/tester/harmony/hvigorfile.ts new file mode 100644 index 0000000000000000000000000000000000000000..6478186902c0c1ad7c966a929c7d6b7d8ae7a9f3 --- /dev/null +++ b/tester/harmony/hvigorfile.ts @@ -0,0 +1,2 @@ +// Script for compiling build behavior. It is built in the build plug-in and cannot be modified currently. +export { appTasks } from '@ohos/hvigor-ohos-plugin'; \ No newline at end of file diff --git a/tester/harmony/oh-package-lock.json5 b/tester/harmony/oh-package-lock.json5 new file mode 100644 index 0000000000000000000000000000000000000000..d47df6ed214dc2ace570c7757ce7957867f01ff1 --- /dev/null +++ b/tester/harmony/oh-package-lock.json5 @@ -0,0 +1,27 @@ +{ + "meta": { + "stableOrder": true + }, + "lockfileVersion": 3, + "ATTENTION": "THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.", + "specifiers": { + "@ohos/hypium@1.0.6": "@ohos/hypium@1.0.6", + "@rnoh/react-native-openharmony@react_native_openharmony.har": "@rnoh/react-native-openharmony@react_native_openharmony.har" + }, + "packages": { + "@ohos/hypium@1.0.6": { + "name": "@ohos/hypium", + "version": "1.0.6", + "integrity": "sha512-bb3DWeWhYrFqj9mPFV3yZQpkm36kbcK+YYaeY9g292QKSjOdmhEIQR2ULPvyMsgSR4usOBf5nnYrDmaCCXirgQ==", + "resolved": "https://repo.harmonyos.com/ohpm/@ohos/hypium/-/hypium-1.0.6.tgz", + "shasum": "3f5fed65372633233264b3447705b0831dfe7ea1", + "registryType": "ohpm" + }, + "@rnoh/react-native-openharmony@react_native_openharmony.har": { + "name": "@rnoh/react-native-openharmony", + "version": "0.72.27", + "resolved": "react_native_openharmony.har", + "registryType": "local" + } + } +} \ No newline at end of file diff --git a/tester/harmony/oh-package.json5 b/tester/harmony/oh-package.json5 new file mode 100644 index 0000000000000000000000000000000000000000..ce85025d388968d47709b846e5b025622b3a7cd5 --- /dev/null +++ b/tester/harmony/oh-package.json5 @@ -0,0 +1,17 @@ +{ + "modelVersion": "5.0.0", + "license": "ISC", + "devDependencies": { + "@ohos/hypium": "1.0.6" + }, + "name": "rnoh", + "description": "example description", + "repository": '', + "version": "1.0.0", + "dependencies": { + "@rnoh/react-native-openharmony": "file:./react_native_openharmony.har" + }, + "overrides": { + "@rnoh/react-native-openharmony": "file:./react_native_openharmony.har" + } +} diff --git a/tester/harmony/svg.har b/tester/harmony/svg.har new file mode 100644 index 0000000000000000000000000000000000000000..4db30c37c9885600d60c51c15ec3072f46979242 Binary files /dev/null and b/tester/harmony/svg.har differ diff --git a/tester/harmony/svg/.gitignore b/tester/harmony/svg/.gitignore new file mode 100644 index 0000000000000000000000000000000000000000..164db8b269c37bcedc218c1ee6914dd23b665c9e --- /dev/null +++ b/tester/harmony/svg/.gitignore @@ -0,0 +1,5 @@ +/oh_modules +/.preview +/build +/.cxx +BuildProfile.ets \ No newline at end of file diff --git a/tester/harmony/svg/build-profile.json5 b/tester/harmony/svg/build-profile.json5 new file mode 100644 index 0000000000000000000000000000000000000000..bf5dbfd0c800f72bf74160a99c0b292abe0279f7 --- /dev/null +++ b/tester/harmony/svg/build-profile.json5 @@ -0,0 +1,9 @@ +{ + "apiType": "stageMode", + "targets": [ + { + "name": "default", + "runtimeOS": "HarmonyOS" + } + ] +} diff --git a/tester/harmony/svg/hvigorfile.ts b/tester/harmony/svg/hvigorfile.ts new file mode 100644 index 0000000000000000000000000000000000000000..47e6e1f81d365872f101585f5dbf816bcad65864 --- /dev/null +++ b/tester/harmony/svg/hvigorfile.ts @@ -0,0 +1,2 @@ +// Script for compiling build behavior. It is built in the build plug-in and cannot be modified currently. +export { harTasks } from '@ohos/hvigor-ohos-plugin'; \ No newline at end of file diff --git a/tester/harmony/svg/index.ets b/tester/harmony/svg/index.ets new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/tester/harmony/svg/oh-package-lock.json5 b/tester/harmony/svg/oh-package-lock.json5 new file mode 100644 index 0000000000000000000000000000000000000000..b7c943c434ce63c9f28fcd53898b973a1757848e --- /dev/null +++ b/tester/harmony/svg/oh-package-lock.json5 @@ -0,0 +1,18 @@ +{ + "meta": { + "stableOrder": true + }, + "lockfileVersion": 3, + "ATTENTION": "THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.", + "specifiers": { + "@rnoh/react-native-openharmony@../react_native_openharmony.har": "@rnoh/react-native-openharmony@../react_native_openharmony.har" + }, + "packages": { + "@rnoh/react-native-openharmony@../react_native_openharmony.har": { + "name": "@rnoh/react-native-openharmony", + "version": "0.72.27", + "resolved": "../react_native_openharmony.har", + "registryType": "local" + } + } +} \ No newline at end of file diff --git a/tester/harmony/svg/oh-package.json5 b/tester/harmony/svg/oh-package.json5 new file mode 100644 index 0000000000000000000000000000000000000000..bca3e5d28b95c812abf49c041e2f8ac72a543028 --- /dev/null +++ b/tester/harmony/svg/oh-package.json5 @@ -0,0 +1,13 @@ +{ + license: '', + devDependencies: {}, + author: '', + description: "", + name: '@react-native-oh-tpl/react-native-svg', + type: 'module', + main: 'index.ets', + version: '15.0.0-0.5.8', + dependencies: { + "@rnoh/react-native-openharmony": "file:../react_native_openharmony" + }, +} diff --git a/tester/harmony/svg/src/main/.gitignore b/tester/harmony/svg/src/main/.gitignore new file mode 100644 index 0000000000000000000000000000000000000000..1d74e21965c4f858f5f818a270e64e1bfad7d843 --- /dev/null +++ b/tester/harmony/svg/src/main/.gitignore @@ -0,0 +1 @@ +.vscode/ diff --git a/tester/harmony/svg/src/main/cpp/Attribute.h b/tester/harmony/svg/src/main/cpp/Attribute.h new file mode 100644 index 0000000000000000000000000000000000000000..14a152d85263609d56525398c8eb3dedc6b3b352 --- /dev/null +++ b/tester/harmony/svg/src/main/cpp/Attribute.h @@ -0,0 +1,31 @@ +// from ArkUI "frameworks/core/components/declaration/common/attribute.h" +#pragma once + +namespace rnoh { +namespace svg { + +enum class AttributeTag { + COMMON_ATTR = 0, + COMMON_DISABLED_ATTR, + COMMON_FOCUSABLE_ATTR, + COMMON_TOUCHABLE_ATTR, + COMMON_DATA_ATTR, + COMMON_CLICK_EFFECT_ATTR, + COMMON_RENDER_ATTR, + COMMON_MULTIMODAL_ATTR, + SPECIALIZED_ATTR, + UNKNOWN, + DEFAULT, +}; + +struct Attribute { + bool IsValid() const { return tag != AttributeTag::UNKNOWN; } + + bool IsShared() const { return isShared; } + + bool isShared = true; + AttributeTag tag = AttributeTag::DEFAULT; +}; + +} // namespace svg +} // namespace rnoh \ No newline at end of file diff --git a/tester/harmony/svg/src/main/cpp/CMakeLists.txt b/tester/harmony/svg/src/main/cpp/CMakeLists.txt new file mode 100644 index 0000000000000000000000000000000000000000..9d6f696b2d7805ff8757613430f6bf1dc3634db8 --- /dev/null +++ b/tester/harmony/svg/src/main/cpp/CMakeLists.txt @@ -0,0 +1,21 @@ +cmake_minimum_required(VERSION 3.13) +set(CMAKE_VERBOSE_MAKEFILE on) + +file(GLOB rnoh_svg_SRC CONFIGURE_DEPENDS + *.cpp + componentInstances/*.cpp + componentBinders/*.cpp + drawing/*.cpp + napiBinders/*.cpp + properties/*.cpp + turboModules/*.cpp + utils/*.cpp + svgImage/*.cpp + ) +add_library(rnoh_svg SHARED ${rnoh_svg_SRC}) +target_include_directories(rnoh_svg PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}) +target_link_libraries(rnoh_svg PUBLIC rnoh) +target_link_libraries(rnoh_svg PUBLIC libimage_source.so) +target_link_libraries(rnoh_svg PUBLIC libpixelmap.so) +target_link_libraries(rnoh_svg PUBLIC libimage_packer.so) +target_link_libraries(rnoh_svg PUBLIC librawfile.z.so) diff --git a/tester/harmony/svg/src/main/cpp/ComponentDescriptors.h b/tester/harmony/svg/src/main/cpp/ComponentDescriptors.h new file mode 100644 index 0000000000000000000000000000000000000000..2f564754a6748eae5d4e221bca1f06c983c5bb08 --- /dev/null +++ b/tester/harmony/svg/src/main/cpp/ComponentDescriptors.h @@ -0,0 +1,42 @@ + +/** + * This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen). + * + * Do not edit this file as changes may cause incorrect behavior and will be lost + * once the code is regenerated. + * + * @generated by codegen project: GenerateComponentDescriptorH.js + */ + +#pragma once + +#include "SvgShadowNodes.h" +#include + +namespace facebook { +namespace react { + +// using RNSVGSvgViewAndroidComponentDescriptor = ConcreteComponentDescriptor; +using RNSVGCircleComponentDescriptor = ConcreteComponentDescriptor; +using RNSVGClipPathComponentDescriptor = ConcreteComponentDescriptor; +using RNSVGDefsComponentDescriptor = ConcreteComponentDescriptor; +using RNSVGEllipseComponentDescriptor = ConcreteComponentDescriptor; +using RNSVGForeignObjectComponentDescriptor = ConcreteComponentDescriptor; +using RNSVGGroupComponentDescriptor = ConcreteComponentDescriptor; +using RNSVGSvgViewComponentDescriptor = ConcreteComponentDescriptor; +using RNSVGLinearGradientComponentDescriptor = ConcreteComponentDescriptor; +using RNSVGLineComponentDescriptor = ConcreteComponentDescriptor; +using RNSVGMarkerComponentDescriptor = ConcreteComponentDescriptor; +using RNSVGMaskComponentDescriptor = ConcreteComponentDescriptor; +using RNSVGPathComponentDescriptor = ConcreteComponentDescriptor; +using RNSVGPatternComponentDescriptor = ConcreteComponentDescriptor; +using RNSVGRadialGradientComponentDescriptor = ConcreteComponentDescriptor; +using RNSVGRectComponentDescriptor = ConcreteComponentDescriptor; +using RNSVGSymbolComponentDescriptor = ConcreteComponentDescriptor; +using RNSVGTextComponentDescriptor = ConcreteComponentDescriptor; +using RNSVGTextPathComponentDescriptor = ConcreteComponentDescriptor; +using RNSVGTSpanComponentDescriptor = ConcreteComponentDescriptor; +using RNSVGUseComponentDescriptor = ConcreteComponentDescriptor; + +} // namespace react +} // namespace facebook diff --git a/tester/harmony/svg/src/main/cpp/EventEmitters.cpp b/tester/harmony/svg/src/main/cpp/EventEmitters.cpp new file mode 100644 index 0000000000000000000000000000000000000000..c3e0219f674dc72ca1d74157788a5e3ccf7bbccc --- /dev/null +++ b/tester/harmony/svg/src/main/cpp/EventEmitters.cpp @@ -0,0 +1,20 @@ + +/** + * This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen). + * + * Do not edit this file as changes may cause incorrect behavior and will be lost + * once the code is regenerated. + * + * @generated by codegen project: GenerateEventEmitterCpp.js + */ + +#include "EventEmitters.h" + +namespace facebook { +namespace react { + + + + +} // namespace react +} // namespace facebook diff --git a/tester/harmony/svg/src/main/cpp/EventEmitters.h b/tester/harmony/svg/src/main/cpp/EventEmitters.h new file mode 100644 index 0000000000000000000000000000000000000000..a26b9c41f37a88751ac3dc4effc2a5465087236a --- /dev/null +++ b/tester/harmony/svg/src/main/cpp/EventEmitters.h @@ -0,0 +1,196 @@ + +/** + * This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen). + * + * Do not edit this file as changes may cause incorrect behavior and will be lost + * once the code is regenerated. + * + * @generated by codegen project: GenerateEventEmitterH.js + */ +#pragma once + +#include +#include + +namespace facebook { +namespace react { + +class JSI_EXPORT RNSVGSvgViewAndroidEventEmitter : public ViewEventEmitter { + public: + using ViewEventEmitter::ViewEventEmitter; + + + + +}; +class JSI_EXPORT RNSVGCircleEventEmitter : public ViewEventEmitter { + public: + using ViewEventEmitter::ViewEventEmitter; + + + + +}; +class JSI_EXPORT RNSVGClipPathEventEmitter : public ViewEventEmitter { + public: + using ViewEventEmitter::ViewEventEmitter; + + + + +}; +class JSI_EXPORT RNSVGDefsEventEmitter : public ViewEventEmitter { + public: + using ViewEventEmitter::ViewEventEmitter; + + + + +}; +class JSI_EXPORT RNSVGEllipseEventEmitter : public ViewEventEmitter { + public: + using ViewEventEmitter::ViewEventEmitter; + + + + +}; +class JSI_EXPORT RNSVGForeignObjectEventEmitter : public ViewEventEmitter { + public: + using ViewEventEmitter::ViewEventEmitter; + + + + +}; +class JSI_EXPORT RNSVGGroupEventEmitter : public ViewEventEmitter { + public: + using ViewEventEmitter::ViewEventEmitter; + + + + +}; +class JSI_EXPORT RNSVGImageEventEmitter : public ViewEventEmitter { + public: + using ViewEventEmitter::ViewEventEmitter; + + + + +}; +class JSI_EXPORT RNSVGSvgViewEventEmitter : public ViewEventEmitter { + public: + using ViewEventEmitter::ViewEventEmitter; + + + + +}; +class JSI_EXPORT RNSVGLinearGradientEventEmitter : public ViewEventEmitter { + public: + using ViewEventEmitter::ViewEventEmitter; + + + + +}; +class JSI_EXPORT RNSVGLineEventEmitter : public ViewEventEmitter { + public: + using ViewEventEmitter::ViewEventEmitter; + + + + +}; +class JSI_EXPORT RNSVGMarkerEventEmitter : public ViewEventEmitter { + public: + using ViewEventEmitter::ViewEventEmitter; + + + + +}; +class JSI_EXPORT RNSVGMaskEventEmitter : public ViewEventEmitter { + public: + using ViewEventEmitter::ViewEventEmitter; + + + + +}; +class JSI_EXPORT RNSVGPathEventEmitter : public ViewEventEmitter { + public: + using ViewEventEmitter::ViewEventEmitter; + + + + +}; +class JSI_EXPORT RNSVGPatternEventEmitter : public ViewEventEmitter { + public: + using ViewEventEmitter::ViewEventEmitter; + + + + +}; +class JSI_EXPORT RNSVGRadialGradientEventEmitter : public ViewEventEmitter { + public: + using ViewEventEmitter::ViewEventEmitter; + + + + +}; +class JSI_EXPORT RNSVGRectEventEmitter : public ViewEventEmitter { + public: + using ViewEventEmitter::ViewEventEmitter; + + + + +}; +class JSI_EXPORT RNSVGSymbolEventEmitter : public ViewEventEmitter { + public: + using ViewEventEmitter::ViewEventEmitter; + + + + +}; +class JSI_EXPORT RNSVGTextEventEmitter : public ViewEventEmitter { + public: + using ViewEventEmitter::ViewEventEmitter; + + + + +}; +class JSI_EXPORT RNSVGTextPathEventEmitter : public ViewEventEmitter { + public: + using ViewEventEmitter::ViewEventEmitter; + + + + +}; +class JSI_EXPORT RNSVGTSpanEventEmitter : public ViewEventEmitter { + public: + using ViewEventEmitter::ViewEventEmitter; + + + + +}; +class JSI_EXPORT RNSVGUseEventEmitter : public ViewEventEmitter { + public: + using ViewEventEmitter::ViewEventEmitter; + + + + +}; + +} // namespace react +} // namespace facebook diff --git a/tester/harmony/svg/src/main/cpp/FontHolderBase.cpp b/tester/harmony/svg/src/main/cpp/FontHolderBase.cpp new file mode 100644 index 0000000000000000000000000000000000000000..6f59f4b57dbb702b18c05a6ad45fc168e1a44d30 --- /dev/null +++ b/tester/harmony/svg/src/main/cpp/FontHolderBase.cpp @@ -0,0 +1,15 @@ +#include "FontHolderBase.h" +namespace rnoh { +namespace svg { + +void FontHolderBase::InheritFont(const std::shared_ptr &parent, double scale) { + if (fp_.Empty()) { + // share parent font to save memory + font_ = parent; + } else { + font_ = std::make_shared(fp_, *parent, scale); + } +} + +} // namespace svg +} // namespace rnoh \ No newline at end of file diff --git a/tester/harmony/svg/src/main/cpp/FontHolderBase.h b/tester/harmony/svg/src/main/cpp/FontHolderBase.h new file mode 100644 index 0000000000000000000000000000000000000000..58b3babede043152f1e54aecdd319c18ea4f4a63 --- /dev/null +++ b/tester/harmony/svg/src/main/cpp/FontHolderBase.h @@ -0,0 +1,40 @@ +#pragma once +#include +#include "properties/Font.h" + +namespace rnoh { +namespace svg { + +class FontHolderBase { +public: + template void UpdateFontProps(const std::shared_ptr &props) { + fp_.fontStyle = props->font.fontStyle; + fp_.fontVariant = props->font.fontVariant; + fp_.fontWeight = props->font.fontWeight; + fp_.fontStretch = props->font.fontStretch; + fp_.fontSize = props->font.fontSize; + fp_.fontFamily = props->font.fontFamily; + fp_.textAnchor = props->font.textAnchor; + fp_.textDecoration = props->font.textDecoration; + fp_.letterSpacing = props->font.letterSpacing; + fp_.wordSpacing = props->font.wordSpacing; + fp_.kerning = props->font.kerning; + fp_.fontFeatureSettings = props->font.fontFeatureSettings; + fp_.fontVariantLigatures = props->font.fontVariantLigatures; + fp_.fontVariationSettings = props->font.fontVariationSettings; + } + + void InheritFont(const std::shared_ptr &parent, double scale); + + // init when font parent is not present + void InitFont(double scale) { font_ = std::make_shared(fp_, FontData{}, scale); } + +protected: + std::shared_ptr font_; + +private: + FontProps fp_; // save intermediate font properties here because tree is not ready during onPropsChanged +}; + +} // namespace svg +} // namespace rnoh \ No newline at end of file diff --git a/tester/harmony/svg/src/main/cpp/Props.cpp b/tester/harmony/svg/src/main/cpp/Props.cpp new file mode 100644 index 0000000000000000000000000000000000000000..296e59fac227474919ab4ab7844689ee2b88a952 --- /dev/null +++ b/tester/harmony/svg/src/main/cpp/Props.cpp @@ -0,0 +1,797 @@ + +/** + * This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen). + * + * Do not edit this file as changes may cause incorrect behavior and will be lost + * once the code is regenerated. + * + * @generated by codegen project: GeneratePropsCpp.js + */ + +#include "Props.h" +#include +#include +#include + +namespace facebook { +namespace react { + +RNSVGSvgViewAndroidProps::RNSVGSvgViewAndroidProps(const PropsParserContext &context, + const RNSVGSvgViewAndroidProps &sourceProps, + const RawProps &rawProps) + : ViewProps(context, sourceProps, rawProps), + + bbWidth(convertRawProp(context, rawProps, "bbWidth", sourceProps.bbWidth, {})), + bbHeight(convertRawProp(context, rawProps, "bbHeight", sourceProps.bbHeight, {})), + minX(convertRawProp(context, rawProps, "minX", sourceProps.minX, {0.0})), + minY(convertRawProp(context, rawProps, "minY", sourceProps.minY, {0.0})), + vbWidth(convertRawProp(context, rawProps, "vbWidth", sourceProps.vbWidth, {0.0})), + vbHeight(convertRawProp(context, rawProps, "vbHeight", sourceProps.vbHeight, {0.0})), + align(convertRawProp(context, rawProps, "align", sourceProps.align, {})), + meetOrSlice(convertRawProp(context, rawProps, "meetOrSlice", sourceProps.meetOrSlice, {0})), + tintColor(convertRawProp(context, rawProps, "tintColor", sourceProps.tintColor, {})), + color(convertRawProp(context, rawProps, "color", sourceProps.color, {})), + pointerEvents(convertRawProp(context, rawProps, "pointerEvents", sourceProps.pointerEvents, {})), + hasTVPreferredFocus( + convertRawProp(context, rawProps, "hasTVPreferredFocus", sourceProps.hasTVPreferredFocus, {false})), + borderTopEndRadius( + convertRawProp(context, rawProps, "borderTopEndRadius", sourceProps.borderTopEndRadius, {0.0})), + borderBottomStartRadius( + convertRawProp(context, rawProps, "borderBottomStartRadius", sourceProps.borderBottomStartRadius, {0.0})), + borderBottomColor(convertRawProp(context, rawProps, "borderBottomColor", sourceProps.borderBottomColor, {})), + nextFocusDown(convertRawProp(context, rawProps, "nextFocusDown", sourceProps.nextFocusDown, {0})), + borderRightColor(convertRawProp(context, rawProps, "borderRightColor", sourceProps.borderRightColor, {})), + nextFocusRight(convertRawProp(context, rawProps, "nextFocusRight", sourceProps.nextFocusRight, {0})), + borderLeftColor(convertRawProp(context, rawProps, "borderLeftColor", sourceProps.borderLeftColor, {})), + borderColor(convertRawProp(context, rawProps, "borderColor", sourceProps.borderColor, {})), + removeClippedSubviews( + convertRawProp(context, rawProps, "removeClippedSubviews", sourceProps.removeClippedSubviews, {false})), + nextFocusForward(convertRawProp(context, rawProps, "nextFocusForward", sourceProps.nextFocusForward, {0})), + nextFocusUp(convertRawProp(context, rawProps, "nextFocusUp", sourceProps.nextFocusUp, {0})), + accessible(convertRawProp(context, rawProps, "accessible", sourceProps.accessible, {false})), + borderStartColor(convertRawProp(context, rawProps, "borderStartColor", sourceProps.borderStartColor, {})), + borderBottomEndRadius( + convertRawProp(context, rawProps, "borderBottomEndRadius", sourceProps.borderBottomEndRadius, {0.0})), + borderEndColor(convertRawProp(context, rawProps, "borderEndColor", sourceProps.borderEndColor, {})), + focusable(convertRawProp(context, rawProps, "focusable", sourceProps.focusable, {false})), + nativeBackgroundAndroid( + convertRawProp(context, rawProps, "nativeBackgroundAndroid", sourceProps.nativeBackgroundAndroid, {})), + borderTopStartRadius( + convertRawProp(context, rawProps, "borderTopStartRadius", sourceProps.borderTopStartRadius, {0.0})), + nativeForegroundAndroid( + convertRawProp(context, rawProps, "nativeForegroundAndroid", sourceProps.nativeForegroundAndroid, {})), + backfaceVisibility(convertRawProp(context, rawProps, "backfaceVisibility", sourceProps.backfaceVisibility, {})), + borderStyle(convertRawProp(context, rawProps, "borderStyle", sourceProps.borderStyle, {})), + needsOffscreenAlphaCompositing(convertRawProp(context, rawProps, "needsOffscreenAlphaCompositing", + sourceProps.needsOffscreenAlphaCompositing, {false})), + hitSlop(convertRawProp(context, rawProps, "hitSlop", sourceProps.hitSlop, {})), + borderTopColor(convertRawProp(context, rawProps, "borderTopColor", sourceProps.borderTopColor, {})), + nextFocusLeft(convertRawProp(context, rawProps, "nextFocusLeft", sourceProps.nextFocusLeft, {0})), + borderTopRightRadius( + convertRawProp(context, rawProps, "borderTopRightRadius", sourceProps.borderTopRightRadius, {0.0})), + borderBottomRightRadius( + convertRawProp(context, rawProps, "borderBottomRightRadius", sourceProps.borderBottomRightRadius, {0.0})), + borderRadius(convertRawProp(context, rawProps, "borderRadius", sourceProps.borderRadius, {0.0})), + borderBottomLeftRadius( + convertRawProp(context, rawProps, "borderBottomLeftRadius", sourceProps.borderBottomLeftRadius, {0.0})), + borderTopLeftRadius( + convertRawProp(context, rawProps, "borderTopLeftRadius", sourceProps.borderTopLeftRadius, {0.0})) {} +RNSVGCircleProps::RNSVGCircleProps(const PropsParserContext &context, const RNSVGCircleProps &sourceProps, + const RawProps &rawProps) + : ViewProps(context, sourceProps, rawProps), + + name(convertRawProp(context, rawProps, "name", sourceProps.name, {})), + opacity(convertRawProp(context, rawProps, "opacity", sourceProps.opacity, {1.0})), + matrix(convertRawProp(context, rawProps, "matrix", sourceProps.matrix, {})), + mask(convertRawProp(context, rawProps, "mask", sourceProps.mask, {})), + markerStart(convertRawProp(context, rawProps, "markerStart", sourceProps.markerStart, {})), + markerMid(convertRawProp(context, rawProps, "markerMid", sourceProps.markerMid, {})), + markerEnd(convertRawProp(context, rawProps, "markerEnd", sourceProps.markerEnd, {})), + clipPath(convertRawProp(context, rawProps, "clipPath", sourceProps.clipPath, {})), + clipRule(convertRawProp(context, rawProps, "clipRule", sourceProps.clipRule, {0})), + responsible(convertRawProp(context, rawProps, "responsible", sourceProps.responsible, {false})), + display(convertRawProp(context, rawProps, "display", sourceProps.display, {})), + pointerEvents(convertRawProp(context, rawProps, "pointerEvents", sourceProps.pointerEvents, {})), + fill(convertRawProp(context, rawProps, "fill", sourceProps.fill, {})), + fillOpacity(convertRawProp(context, rawProps, "fillOpacity", sourceProps.fillOpacity, {1.0})), + fillRule(convertRawProp(context, rawProps, "fillRule", sourceProps.fillRule, {1})), + stroke(convertRawProp(context, rawProps, "stroke", sourceProps.stroke, {})), + strokeOpacity(convertRawProp(context, rawProps, "strokeOpacity", sourceProps.strokeOpacity, {1.0})), + strokeWidth(convertRawProp(context, rawProps, "strokeWidth", sourceProps.strokeWidth, {"1"})), + strokeLinecap(convertRawProp(context, rawProps, "strokeLinecap", sourceProps.strokeLinecap, {0})), + strokeLinejoin(convertRawProp(context, rawProps, "strokeLinejoin", sourceProps.strokeLinejoin, {0})), + strokeDasharray(convertRawProp(context, rawProps, "strokeDasharray", sourceProps.strokeDasharray, {})), + strokeDashoffset(convertRawProp(context, rawProps, "strokeDashoffset", sourceProps.strokeDashoffset, {0.0})), + strokeMiterlimit(convertRawProp(context, rawProps, "strokeMiterlimit", sourceProps.strokeMiterlimit, {0.0})), + vectorEffect(convertRawProp(context, rawProps, "vectorEffect", sourceProps.vectorEffect, {0})), + propList(convertRawProp(context, rawProps, "propList", sourceProps.propList, {})), + cx(convertRawProp(context, rawProps, "cx", sourceProps.cx, {})), + cy(convertRawProp(context, rawProps, "cy", sourceProps.cy, {})), + r(convertRawProp(context, rawProps, "r", sourceProps.r, {})) {} +RNSVGClipPathProps::RNSVGClipPathProps(const PropsParserContext &context, const RNSVGClipPathProps &sourceProps, + const RawProps &rawProps) + : ViewProps(context, sourceProps, rawProps), + + name(convertRawProp(context, rawProps, "name", sourceProps.name, {})), + opacity(convertRawProp(context, rawProps, "opacity", sourceProps.opacity, {1.0})), + matrix(convertRawProp(context, rawProps, "matrix", sourceProps.matrix, {})), + mask(convertRawProp(context, rawProps, "mask", sourceProps.mask, {})), + markerStart(convertRawProp(context, rawProps, "markerStart", sourceProps.markerStart, {})), + markerMid(convertRawProp(context, rawProps, "markerMid", sourceProps.markerMid, {})), + markerEnd(convertRawProp(context, rawProps, "markerEnd", sourceProps.markerEnd, {})), + clipPath(convertRawProp(context, rawProps, "clipPath", sourceProps.clipPath, {})), + clipRule(convertRawProp(context, rawProps, "clipRule", sourceProps.clipRule, {0})), + responsible(convertRawProp(context, rawProps, "responsible", sourceProps.responsible, {false})), + display(convertRawProp(context, rawProps, "display", sourceProps.display, {})), + pointerEvents(convertRawProp(context, rawProps, "pointerEvents", sourceProps.pointerEvents, {})), + fill(convertRawProp(context, rawProps, "fill", sourceProps.fill, {})), + fillOpacity(convertRawProp(context, rawProps, "fillOpacity", sourceProps.fillOpacity, {1.0})), + fillRule(convertRawProp(context, rawProps, "fillRule", sourceProps.fillRule, {1})), + stroke(convertRawProp(context, rawProps, "stroke", sourceProps.stroke, {})), + strokeOpacity(convertRawProp(context, rawProps, "strokeOpacity", sourceProps.strokeOpacity, {1.0})), + strokeWidth(convertRawProp(context, rawProps, "strokeWidth", sourceProps.strokeWidth, {"1"})), + strokeLinecap(convertRawProp(context, rawProps, "strokeLinecap", sourceProps.strokeLinecap, {0})), + strokeLinejoin(convertRawProp(context, rawProps, "strokeLinejoin", sourceProps.strokeLinejoin, {0})), + strokeDasharray(convertRawProp(context, rawProps, "strokeDasharray", sourceProps.strokeDasharray, {})), + strokeDashoffset(convertRawProp(context, rawProps, "strokeDashoffset", sourceProps.strokeDashoffset, {0.0})), + strokeMiterlimit(convertRawProp(context, rawProps, "strokeMiterlimit", sourceProps.strokeMiterlimit, {0.0})), + vectorEffect(convertRawProp(context, rawProps, "vectorEffect", sourceProps.vectorEffect, {0})), + propList(convertRawProp(context, rawProps, "propList", sourceProps.propList, {})), + fontSize(convertRawProp(context, rawProps, "fontSize", sourceProps.fontSize, {})), + fontWeight(convertRawProp(context, rawProps, "fontWeight", sourceProps.fontWeight, {})), + font(convertRawProp(context, rawProps, "font", sourceProps.font, {})) {} +RNSVGDefsProps::RNSVGDefsProps(const PropsParserContext &context, const RNSVGDefsProps &sourceProps, + const RawProps &rawProps) + : ViewProps(context, sourceProps, rawProps), + + name(convertRawProp(context, rawProps, "name", sourceProps.name, {})), + opacity(convertRawProp(context, rawProps, "opacity", sourceProps.opacity, {1.0})), + matrix(convertRawProp(context, rawProps, "matrix", sourceProps.matrix, {})), + mask(convertRawProp(context, rawProps, "mask", sourceProps.mask, {})), + markerStart(convertRawProp(context, rawProps, "markerStart", sourceProps.markerStart, {})), + markerMid(convertRawProp(context, rawProps, "markerMid", sourceProps.markerMid, {})), + markerEnd(convertRawProp(context, rawProps, "markerEnd", sourceProps.markerEnd, {})), + clipPath(convertRawProp(context, rawProps, "clipPath", sourceProps.clipPath, {})), + clipRule(convertRawProp(context, rawProps, "clipRule", sourceProps.clipRule, {0})), + responsible(convertRawProp(context, rawProps, "responsible", sourceProps.responsible, {false})), + display(convertRawProp(context, rawProps, "display", sourceProps.display, {})), + pointerEvents(convertRawProp(context, rawProps, "pointerEvents", sourceProps.pointerEvents, {})) {} +RNSVGEllipseProps::RNSVGEllipseProps(const PropsParserContext &context, const RNSVGEllipseProps &sourceProps, + const RawProps &rawProps) + : ViewProps(context, sourceProps, rawProps), + + name(convertRawProp(context, rawProps, "name", sourceProps.name, {})), + opacity(convertRawProp(context, rawProps, "opacity", sourceProps.opacity, {1.0})), + matrix(convertRawProp(context, rawProps, "matrix", sourceProps.matrix, {})), + mask(convertRawProp(context, rawProps, "mask", sourceProps.mask, {})), + markerStart(convertRawProp(context, rawProps, "markerStart", sourceProps.markerStart, {})), + markerMid(convertRawProp(context, rawProps, "markerMid", sourceProps.markerMid, {})), + markerEnd(convertRawProp(context, rawProps, "markerEnd", sourceProps.markerEnd, {})), + clipPath(convertRawProp(context, rawProps, "clipPath", sourceProps.clipPath, {})), + clipRule(convertRawProp(context, rawProps, "clipRule", sourceProps.clipRule, {0})), + responsible(convertRawProp(context, rawProps, "responsible", sourceProps.responsible, {false})), + display(convertRawProp(context, rawProps, "display", sourceProps.display, {})), + pointerEvents(convertRawProp(context, rawProps, "pointerEvents", sourceProps.pointerEvents, {})), + fill(convertRawProp(context, rawProps, "fill", sourceProps.fill, {})), + fillOpacity(convertRawProp(context, rawProps, "fillOpacity", sourceProps.fillOpacity, {1.0})), + fillRule(convertRawProp(context, rawProps, "fillRule", sourceProps.fillRule, {1})), + stroke(convertRawProp(context, rawProps, "stroke", sourceProps.stroke, {})), + strokeOpacity(convertRawProp(context, rawProps, "strokeOpacity", sourceProps.strokeOpacity, {1.0})), + strokeWidth(convertRawProp(context, rawProps, "strokeWidth", sourceProps.strokeWidth, {"1"})), + strokeLinecap(convertRawProp(context, rawProps, "strokeLinecap", sourceProps.strokeLinecap, {0})), + strokeLinejoin(convertRawProp(context, rawProps, "strokeLinejoin", sourceProps.strokeLinejoin, {0})), + strokeDasharray(convertRawProp(context, rawProps, "strokeDasharray", sourceProps.strokeDasharray, {})), + strokeDashoffset(convertRawProp(context, rawProps, "strokeDashoffset", sourceProps.strokeDashoffset, {0.0})), + strokeMiterlimit(convertRawProp(context, rawProps, "strokeMiterlimit", sourceProps.strokeMiterlimit, {0.0})), + vectorEffect(convertRawProp(context, rawProps, "vectorEffect", sourceProps.vectorEffect, {0})), + propList(convertRawProp(context, rawProps, "propList", sourceProps.propList, {})), + cx(convertRawProp(context, rawProps, "cx", sourceProps.cx, {})), + cy(convertRawProp(context, rawProps, "cy", sourceProps.cy, {})), + rx(convertRawProp(context, rawProps, "rx", sourceProps.rx, {})), + ry(convertRawProp(context, rawProps, "ry", sourceProps.ry, {})) {} +RNSVGForeignObjectProps::RNSVGForeignObjectProps(const PropsParserContext &context, + const RNSVGForeignObjectProps &sourceProps, const RawProps &rawProps) + : ViewProps(context, sourceProps, rawProps), + + name(convertRawProp(context, rawProps, "name", sourceProps.name, {})), + opacity(convertRawProp(context, rawProps, "opacity", sourceProps.opacity, {1.0})), + matrix(convertRawProp(context, rawProps, "matrix", sourceProps.matrix, {})), + mask(convertRawProp(context, rawProps, "mask", sourceProps.mask, {})), + markerStart(convertRawProp(context, rawProps, "markerStart", sourceProps.markerStart, {})), + markerMid(convertRawProp(context, rawProps, "markerMid", sourceProps.markerMid, {})), + markerEnd(convertRawProp(context, rawProps, "markerEnd", sourceProps.markerEnd, {})), + clipPath(convertRawProp(context, rawProps, "clipPath", sourceProps.clipPath, {})), + clipRule(convertRawProp(context, rawProps, "clipRule", sourceProps.clipRule, {0})), + responsible(convertRawProp(context, rawProps, "responsible", sourceProps.responsible, {false})), + display(convertRawProp(context, rawProps, "display", sourceProps.display, {})), + pointerEvents(convertRawProp(context, rawProps, "pointerEvents", sourceProps.pointerEvents, {})), + fill(convertRawProp(context, rawProps, "fill", sourceProps.fill, {})), + fillOpacity(convertRawProp(context, rawProps, "fillOpacity", sourceProps.fillOpacity, {1.0})), + fillRule(convertRawProp(context, rawProps, "fillRule", sourceProps.fillRule, {1})), + stroke(convertRawProp(context, rawProps, "stroke", sourceProps.stroke, {})), + strokeOpacity(convertRawProp(context, rawProps, "strokeOpacity", sourceProps.strokeOpacity, {1.0})), + strokeWidth(convertRawProp(context, rawProps, "strokeWidth", sourceProps.strokeWidth, {"1"})), + strokeLinecap(convertRawProp(context, rawProps, "strokeLinecap", sourceProps.strokeLinecap, {0})), + strokeLinejoin(convertRawProp(context, rawProps, "strokeLinejoin", sourceProps.strokeLinejoin, {0})), + strokeDasharray(convertRawProp(context, rawProps, "strokeDasharray", sourceProps.strokeDasharray, {})), + strokeDashoffset(convertRawProp(context, rawProps, "strokeDashoffset", sourceProps.strokeDashoffset, {0.0})), + strokeMiterlimit(convertRawProp(context, rawProps, "strokeMiterlimit", sourceProps.strokeMiterlimit, {0.0})), + vectorEffect(convertRawProp(context, rawProps, "vectorEffect", sourceProps.vectorEffect, {0})), + propList(convertRawProp(context, rawProps, "propList", sourceProps.propList, {})), + fontSize(convertRawProp(context, rawProps, "fontSize", sourceProps.fontSize, {})), + fontWeight(convertRawProp(context, rawProps, "fontWeight", sourceProps.fontWeight, {})), + font(convertRawProp(context, rawProps, "font", sourceProps.font, {})), + x(convertRawProp(context, rawProps, "x", sourceProps.x, {})), + y(convertRawProp(context, rawProps, "y", sourceProps.y, {})), + height(convertRawProp(context, rawProps, "height", sourceProps.height, {})), + width(convertRawProp(context, rawProps, "width", sourceProps.width, {})) {} +RNSVGGroupProps::RNSVGGroupProps(const PropsParserContext &context, const RNSVGGroupProps &sourceProps, + const RawProps &rawProps) + : ViewProps(context, sourceProps, rawProps), + + name(convertRawProp(context, rawProps, "name", sourceProps.name, {})), + opacity(convertRawProp(context, rawProps, "opacity", sourceProps.opacity, {1.0})), + matrix(convertRawProp(context, rawProps, "matrix", sourceProps.matrix, {})), + mask(convertRawProp(context, rawProps, "mask", sourceProps.mask, {})), + markerStart(convertRawProp(context, rawProps, "markerStart", sourceProps.markerStart, {})), + markerMid(convertRawProp(context, rawProps, "markerMid", sourceProps.markerMid, {})), + markerEnd(convertRawProp(context, rawProps, "markerEnd", sourceProps.markerEnd, {})), + clipPath(convertRawProp(context, rawProps, "clipPath", sourceProps.clipPath, {})), + clipRule(convertRawProp(context, rawProps, "clipRule", sourceProps.clipRule, {0})), + responsible(convertRawProp(context, rawProps, "responsible", sourceProps.responsible, {false})), + display(convertRawProp(context, rawProps, "display", sourceProps.display, {})), + pointerEvents(convertRawProp(context, rawProps, "pointerEvents", sourceProps.pointerEvents, {})), + fill(convertRawProp(context, rawProps, "fill", sourceProps.fill, {})), + fillOpacity(convertRawProp(context, rawProps, "fillOpacity", sourceProps.fillOpacity, {1.0})), + fillRule(convertRawProp(context, rawProps, "fillRule", sourceProps.fillRule, {1})), + stroke(convertRawProp(context, rawProps, "stroke", sourceProps.stroke, {})), + strokeOpacity(convertRawProp(context, rawProps, "strokeOpacity", sourceProps.strokeOpacity, {1.0})), + strokeWidth(convertRawProp(context, rawProps, "strokeWidth", sourceProps.strokeWidth, {"1"})), + strokeLinecap(convertRawProp(context, rawProps, "strokeLinecap", sourceProps.strokeLinecap, {0})), + strokeLinejoin(convertRawProp(context, rawProps, "strokeLinejoin", sourceProps.strokeLinejoin, {0})), + strokeDasharray(convertRawProp(context, rawProps, "strokeDasharray", sourceProps.strokeDasharray, {})), + strokeDashoffset(convertRawProp(context, rawProps, "strokeDashoffset", sourceProps.strokeDashoffset, {0.0})), + strokeMiterlimit(convertRawProp(context, rawProps, "strokeMiterlimit", sourceProps.strokeMiterlimit, {0.0})), + vectorEffect(convertRawProp(context, rawProps, "vectorEffect", sourceProps.vectorEffect, {0})), + propList(convertRawProp(context, rawProps, "propList", sourceProps.propList, {})), + fontSize(convertRawProp(context, rawProps, "fontSize", sourceProps.fontSize, {})), + fontWeight(convertRawProp(context, rawProps, "fontWeight", sourceProps.fontWeight, {})), + font(convertRawProp(context, rawProps, "font", sourceProps.font, {})) {} +RNSVGImageProps::RNSVGImageProps(const PropsParserContext &context, const RNSVGImageProps &sourceProps, + const RawProps &rawProps) + : ViewProps(context, sourceProps, rawProps), + + name(convertRawProp(context, rawProps, "name", sourceProps.name, {})), + opacity(convertRawProp(context, rawProps, "opacity", sourceProps.opacity, {1.0})), + matrix(convertRawProp(context, rawProps, "matrix", sourceProps.matrix, {})), + mask(convertRawProp(context, rawProps, "mask", sourceProps.mask, {})), + markerStart(convertRawProp(context, rawProps, "markerStart", sourceProps.markerStart, {})), + markerMid(convertRawProp(context, rawProps, "markerMid", sourceProps.markerMid, {})), + markerEnd(convertRawProp(context, rawProps, "markerEnd", sourceProps.markerEnd, {})), + clipPath(convertRawProp(context, rawProps, "clipPath", sourceProps.clipPath, {})), + clipRule(convertRawProp(context, rawProps, "clipRule", sourceProps.clipRule, {0})), + responsible(convertRawProp(context, rawProps, "responsible", sourceProps.responsible, {false})), + display(convertRawProp(context, rawProps, "display", sourceProps.display, {})), + pointerEvents(convertRawProp(context, rawProps, "pointerEvents", sourceProps.pointerEvents, {})), + fill(convertRawProp(context, rawProps, "fill", sourceProps.fill, {})), + fillOpacity(convertRawProp(context, rawProps, "fillOpacity", sourceProps.fillOpacity, {1.0})), + fillRule(convertRawProp(context, rawProps, "fillRule", sourceProps.fillRule, {1})), + stroke(convertRawProp(context, rawProps, "stroke", sourceProps.stroke, {})), + strokeOpacity(convertRawProp(context, rawProps, "strokeOpacity", sourceProps.strokeOpacity, {1.0})), + strokeWidth(convertRawProp(context, rawProps, "strokeWidth", sourceProps.strokeWidth, {"1"})), + strokeLinecap(convertRawProp(context, rawProps, "strokeLinecap", sourceProps.strokeLinecap, {0})), + strokeLinejoin(convertRawProp(context, rawProps, "strokeLinejoin", sourceProps.strokeLinejoin, {0})), + strokeDasharray(convertRawProp(context, rawProps, "strokeDasharray", sourceProps.strokeDasharray, {})), + strokeDashoffset(convertRawProp(context, rawProps, "strokeDashoffset", sourceProps.strokeDashoffset, {0.0})), + strokeMiterlimit(convertRawProp(context, rawProps, "strokeMiterlimit", sourceProps.strokeMiterlimit, {0.0})), + vectorEffect(convertRawProp(context, rawProps, "vectorEffect", sourceProps.vectorEffect, {0})), + propList(convertRawProp(context, rawProps, "propList", sourceProps.propList, {})), + x(convertRawProp(context, rawProps, "x", sourceProps.x, {})), + y(convertRawProp(context, rawProps, "y", sourceProps.y, {})), + width(convertRawProp(context, rawProps, "width", sourceProps.width, {})), + height(convertRawProp(context, rawProps, "height", sourceProps.height, {})), + src(convertRawProp(context, rawProps, "src", sourceProps.src, {})), + align(convertRawProp(context, rawProps, "align", sourceProps.align, {})), + meetOrSlice(convertRawProp(context, rawProps, "meetOrSlice", sourceProps.meetOrSlice, {0})) {} +RNSVGSvgViewProps::RNSVGSvgViewProps(const PropsParserContext &context, const RNSVGSvgViewProps &sourceProps, + const RawProps &rawProps) + : ViewProps(context, sourceProps, rawProps), + + bbWidth(convertRawProp(context, rawProps, "bbWidth", sourceProps.bbWidth, {})), + bbHeight(convertRawProp(context, rawProps, "bbHeight", sourceProps.bbHeight, {})), + minX(convertRawProp(context, rawProps, "minX", sourceProps.minX, {0.0})), + minY(convertRawProp(context, rawProps, "minY", sourceProps.minY, {0.0})), + vbWidth(convertRawProp(context, rawProps, "vbWidth", sourceProps.vbWidth, {0.0})), + vbHeight(convertRawProp(context, rawProps, "vbHeight", sourceProps.vbHeight, {0.0})), + align(convertRawProp(context, rawProps, "align", sourceProps.align, {})), + meetOrSlice(convertRawProp(context, rawProps, "meetOrSlice", sourceProps.meetOrSlice, {0})), + tintColor(convertRawProp(context, rawProps, "tintColor", sourceProps.tintColor, {})), + color(convertRawProp(context, rawProps, "color", sourceProps.color, {})), + pointerEvents(convertRawProp(context, rawProps, "pointerEvents", sourceProps.pointerEvents, {})) {} +RNSVGLinearGradientProps::RNSVGLinearGradientProps(const PropsParserContext &context, + const RNSVGLinearGradientProps &sourceProps, + const RawProps &rawProps) + : ViewProps(context, sourceProps, rawProps), + + name(convertRawProp(context, rawProps, "name", sourceProps.name, {})), + opacity(convertRawProp(context, rawProps, "opacity", sourceProps.opacity, {1.0})), + matrix(convertRawProp(context, rawProps, "matrix", sourceProps.matrix, {})), + mask(convertRawProp(context, rawProps, "mask", sourceProps.mask, {})), + markerStart(convertRawProp(context, rawProps, "markerStart", sourceProps.markerStart, {})), + markerMid(convertRawProp(context, rawProps, "markerMid", sourceProps.markerMid, {})), + markerEnd(convertRawProp(context, rawProps, "markerEnd", sourceProps.markerEnd, {})), + clipPath(convertRawProp(context, rawProps, "clipPath", sourceProps.clipPath, {})), + clipRule(convertRawProp(context, rawProps, "clipRule", sourceProps.clipRule, {0})), + responsible(convertRawProp(context, rawProps, "responsible", sourceProps.responsible, {false})), + display(convertRawProp(context, rawProps, "display", sourceProps.display, {})), + pointerEvents(convertRawProp(context, rawProps, "pointerEvents", sourceProps.pointerEvents, {})), + x1(convertRawProp(context, rawProps, "x1", sourceProps.x1, {})), + y1(convertRawProp(context, rawProps, "y1", sourceProps.y1, {})), + x2(convertRawProp(context, rawProps, "x2", sourceProps.x2, {})), + y2(convertRawProp(context, rawProps, "y2", sourceProps.y2, {})), + gradient(convertRawProp(context, rawProps, "gradient", sourceProps.gradient, {})), + gradientUnits(convertRawProp(context, rawProps, "gradientUnits", sourceProps.gradientUnits, {0})), + gradientTransform(convertRawProp(context, rawProps, "gradientTransform", sourceProps.gradientTransform, {})) {} +RNSVGLineProps::RNSVGLineProps(const PropsParserContext &context, const RNSVGLineProps &sourceProps, + const RawProps &rawProps) + : ViewProps(context, sourceProps, rawProps), + + name(convertRawProp(context, rawProps, "name", sourceProps.name, {})), + opacity(convertRawProp(context, rawProps, "opacity", sourceProps.opacity, {1.0})), + matrix(convertRawProp(context, rawProps, "matrix", sourceProps.matrix, {})), + mask(convertRawProp(context, rawProps, "mask", sourceProps.mask, {})), + markerStart(convertRawProp(context, rawProps, "markerStart", sourceProps.markerStart, {})), + markerMid(convertRawProp(context, rawProps, "markerMid", sourceProps.markerMid, {})), + markerEnd(convertRawProp(context, rawProps, "markerEnd", sourceProps.markerEnd, {})), + clipPath(convertRawProp(context, rawProps, "clipPath", sourceProps.clipPath, {})), + clipRule(convertRawProp(context, rawProps, "clipRule", sourceProps.clipRule, {0})), + responsible(convertRawProp(context, rawProps, "responsible", sourceProps.responsible, {false})), + display(convertRawProp(context, rawProps, "display", sourceProps.display, {})), + pointerEvents(convertRawProp(context, rawProps, "pointerEvents", sourceProps.pointerEvents, {})), + fill(convertRawProp(context, rawProps, "fill", sourceProps.fill, {})), + fillOpacity(convertRawProp(context, rawProps, "fillOpacity", sourceProps.fillOpacity, {1.0})), + fillRule(convertRawProp(context, rawProps, "fillRule", sourceProps.fillRule, {1})), + stroke(convertRawProp(context, rawProps, "stroke", sourceProps.stroke, {})), + strokeOpacity(convertRawProp(context, rawProps, "strokeOpacity", sourceProps.strokeOpacity, {1.0})), + strokeWidth(convertRawProp(context, rawProps, "strokeWidth", sourceProps.strokeWidth, {"1"})), + strokeLinecap(convertRawProp(context, rawProps, "strokeLinecap", sourceProps.strokeLinecap, {0})), + strokeLinejoin(convertRawProp(context, rawProps, "strokeLinejoin", sourceProps.strokeLinejoin, {0})), + strokeDasharray(convertRawProp(context, rawProps, "strokeDasharray", sourceProps.strokeDasharray, {})), + strokeDashoffset(convertRawProp(context, rawProps, "strokeDashoffset", sourceProps.strokeDashoffset, {0.0})), + strokeMiterlimit(convertRawProp(context, rawProps, "strokeMiterlimit", sourceProps.strokeMiterlimit, {0.0})), + vectorEffect(convertRawProp(context, rawProps, "vectorEffect", sourceProps.vectorEffect, {0})), + propList(convertRawProp(context, rawProps, "propList", sourceProps.propList, {})), + x1(convertRawProp(context, rawProps, "x1", sourceProps.x1, {})), + y1(convertRawProp(context, rawProps, "y1", sourceProps.y1, {})), + x2(convertRawProp(context, rawProps, "x2", sourceProps.x2, {})), + y2(convertRawProp(context, rawProps, "y2", sourceProps.y2, {})) {} +RNSVGMarkerProps::RNSVGMarkerProps(const PropsParserContext &context, const RNSVGMarkerProps &sourceProps, + const RawProps &rawProps) + : ViewProps(context, sourceProps, rawProps), + + name(convertRawProp(context, rawProps, "name", sourceProps.name, {})), + opacity(convertRawProp(context, rawProps, "opacity", sourceProps.opacity, {1.0})), + matrix(convertRawProp(context, rawProps, "matrix", sourceProps.matrix, {})), + mask(convertRawProp(context, rawProps, "mask", sourceProps.mask, {})), + markerStart(convertRawProp(context, rawProps, "markerStart", sourceProps.markerStart, {})), + markerMid(convertRawProp(context, rawProps, "markerMid", sourceProps.markerMid, {})), + markerEnd(convertRawProp(context, rawProps, "markerEnd", sourceProps.markerEnd, {})), + clipPath(convertRawProp(context, rawProps, "clipPath", sourceProps.clipPath, {})), + clipRule(convertRawProp(context, rawProps, "clipRule", sourceProps.clipRule, {0})), + responsible(convertRawProp(context, rawProps, "responsible", sourceProps.responsible, {false})), + display(convertRawProp(context, rawProps, "display", sourceProps.display, {})), + pointerEvents(convertRawProp(context, rawProps, "pointerEvents", sourceProps.pointerEvents, {})), + fill(convertRawProp(context, rawProps, "fill", sourceProps.fill, {})), + fillOpacity(convertRawProp(context, rawProps, "fillOpacity", sourceProps.fillOpacity, {1.0})), + fillRule(convertRawProp(context, rawProps, "fillRule", sourceProps.fillRule, {1})), + stroke(convertRawProp(context, rawProps, "stroke", sourceProps.stroke, {})), + strokeOpacity(convertRawProp(context, rawProps, "strokeOpacity", sourceProps.strokeOpacity, {1.0})), + strokeWidth(convertRawProp(context, rawProps, "strokeWidth", sourceProps.strokeWidth, {"1"})), + strokeLinecap(convertRawProp(context, rawProps, "strokeLinecap", sourceProps.strokeLinecap, {0})), + strokeLinejoin(convertRawProp(context, rawProps, "strokeLinejoin", sourceProps.strokeLinejoin, {0})), + strokeDasharray(convertRawProp(context, rawProps, "strokeDasharray", sourceProps.strokeDasharray, {})), + strokeDashoffset(convertRawProp(context, rawProps, "strokeDashoffset", sourceProps.strokeDashoffset, {0.0})), + strokeMiterlimit(convertRawProp(context, rawProps, "strokeMiterlimit", sourceProps.strokeMiterlimit, {0.0})), + vectorEffect(convertRawProp(context, rawProps, "vectorEffect", sourceProps.vectorEffect, {0})), + propList(convertRawProp(context, rawProps, "propList", sourceProps.propList, {})), + fontSize(convertRawProp(context, rawProps, "fontSize", sourceProps.fontSize, {})), + fontWeight(convertRawProp(context, rawProps, "fontWeight", sourceProps.fontWeight, {})), + font(convertRawProp(context, rawProps, "font", sourceProps.font, {})), + refX(convertRawProp(context, rawProps, "refX", sourceProps.refX, {})), + refY(convertRawProp(context, rawProps, "refY", sourceProps.refY, {})), + markerHeight(convertRawProp(context, rawProps, "markerHeight", sourceProps.markerHeight, {})), + markerWidth(convertRawProp(context, rawProps, "markerWidth", sourceProps.markerWidth, {})), + markerUnits(convertRawProp(context, rawProps, "markerUnits", sourceProps.markerUnits, {})), + orient(convertRawProp(context, rawProps, "orient", sourceProps.orient, {})), + minX(convertRawProp(context, rawProps, "minX", sourceProps.minX, {0.0})), + minY(convertRawProp(context, rawProps, "minY", sourceProps.minY, {0.0})), + vbWidth(convertRawProp(context, rawProps, "vbWidth", sourceProps.vbWidth, {0.0})), + vbHeight(convertRawProp(context, rawProps, "vbHeight", sourceProps.vbHeight, {0.0})), + align(convertRawProp(context, rawProps, "align", sourceProps.align, {})), + meetOrSlice(convertRawProp(context, rawProps, "meetOrSlice", sourceProps.meetOrSlice, {0})) {} +RNSVGMaskProps::RNSVGMaskProps(const PropsParserContext &context, const RNSVGMaskProps &sourceProps, + const RawProps &rawProps) + : ViewProps(context, sourceProps, rawProps), + + name(convertRawProp(context, rawProps, "name", sourceProps.name, {})), + opacity(convertRawProp(context, rawProps, "opacity", sourceProps.opacity, {1.0})), + matrix(convertRawProp(context, rawProps, "matrix", sourceProps.matrix, {})), + mask(convertRawProp(context, rawProps, "mask", sourceProps.mask, {})), + markerStart(convertRawProp(context, rawProps, "markerStart", sourceProps.markerStart, {})), + markerMid(convertRawProp(context, rawProps, "markerMid", sourceProps.markerMid, {})), + markerEnd(convertRawProp(context, rawProps, "markerEnd", sourceProps.markerEnd, {})), + clipPath(convertRawProp(context, rawProps, "clipPath", sourceProps.clipPath, {})), + clipRule(convertRawProp(context, rawProps, "clipRule", sourceProps.clipRule, {0})), + responsible(convertRawProp(context, rawProps, "responsible", sourceProps.responsible, {false})), + display(convertRawProp(context, rawProps, "display", sourceProps.display, {})), + pointerEvents(convertRawProp(context, rawProps, "pointerEvents", sourceProps.pointerEvents, {})), + fill(convertRawProp(context, rawProps, "fill", sourceProps.fill, {})), + fillOpacity(convertRawProp(context, rawProps, "fillOpacity", sourceProps.fillOpacity, {1.0})), + fillRule(convertRawProp(context, rawProps, "fillRule", sourceProps.fillRule, {1})), + stroke(convertRawProp(context, rawProps, "stroke", sourceProps.stroke, {})), + strokeOpacity(convertRawProp(context, rawProps, "strokeOpacity", sourceProps.strokeOpacity, {1.0})), + strokeWidth(convertRawProp(context, rawProps, "strokeWidth", sourceProps.strokeWidth, {"1"})), + strokeLinecap(convertRawProp(context, rawProps, "strokeLinecap", sourceProps.strokeLinecap, {0})), + strokeLinejoin(convertRawProp(context, rawProps, "strokeLinejoin", sourceProps.strokeLinejoin, {0})), + strokeDasharray(convertRawProp(context, rawProps, "strokeDasharray", sourceProps.strokeDasharray, {})), + strokeDashoffset(convertRawProp(context, rawProps, "strokeDashoffset", sourceProps.strokeDashoffset, {0.0})), + strokeMiterlimit(convertRawProp(context, rawProps, "strokeMiterlimit", sourceProps.strokeMiterlimit, {0.0})), + vectorEffect(convertRawProp(context, rawProps, "vectorEffect", sourceProps.vectorEffect, {0})), + propList(convertRawProp(context, rawProps, "propList", sourceProps.propList, {})), + fontSize(convertRawProp(context, rawProps, "fontSize", sourceProps.fontSize, {})), + fontWeight(convertRawProp(context, rawProps, "fontWeight", sourceProps.fontWeight, {})), + font(convertRawProp(context, rawProps, "font", sourceProps.font, {})), + x(convertRawProp(context, rawProps, "x", sourceProps.x, {})), + y(convertRawProp(context, rawProps, "y", sourceProps.y, {})), + height(convertRawProp(context, rawProps, "height", sourceProps.height, {})), + width(convertRawProp(context, rawProps, "width", sourceProps.width, {})), + maskUnits(convertRawProp(context, rawProps, "maskUnits", sourceProps.maskUnits, {0})), + maskContentUnits(convertRawProp(context, rawProps, "maskContentUnits", sourceProps.maskContentUnits, {0})) {} +RNSVGPathProps::RNSVGPathProps(const PropsParserContext &context, const RNSVGPathProps &sourceProps, + const RawProps &rawProps) + : ViewProps(context, sourceProps, rawProps), + + name(convertRawProp(context, rawProps, "name", sourceProps.name, {})), + opacity(convertRawProp(context, rawProps, "opacity", sourceProps.opacity, {1.0})), + matrix(convertRawProp(context, rawProps, "matrix", sourceProps.matrix, {})), + mask(convertRawProp(context, rawProps, "mask", sourceProps.mask, {})), + markerStart(convertRawProp(context, rawProps, "markerStart", sourceProps.markerStart, {})), + markerMid(convertRawProp(context, rawProps, "markerMid", sourceProps.markerMid, {})), + markerEnd(convertRawProp(context, rawProps, "markerEnd", sourceProps.markerEnd, {})), + clipPath(convertRawProp(context, rawProps, "clipPath", sourceProps.clipPath, {})), + clipRule(convertRawProp(context, rawProps, "clipRule", sourceProps.clipRule, {0})), + responsible(convertRawProp(context, rawProps, "responsible", sourceProps.responsible, {false})), + display(convertRawProp(context, rawProps, "display", sourceProps.display, {})), + pointerEvents(convertRawProp(context, rawProps, "pointerEvents", sourceProps.pointerEvents, {})), + fill(convertRawProp(context, rawProps, "fill", sourceProps.fill, {})), + fillOpacity(convertRawProp(context, rawProps, "fillOpacity", sourceProps.fillOpacity, {1.0})), + fillRule(convertRawProp(context, rawProps, "fillRule", sourceProps.fillRule, {1})), + stroke(convertRawProp(context, rawProps, "stroke", sourceProps.stroke, {})), + strokeOpacity(convertRawProp(context, rawProps, "strokeOpacity", sourceProps.strokeOpacity, {1.0})), + strokeWidth(convertRawProp(context, rawProps, "strokeWidth", sourceProps.strokeWidth, {"1"})), + strokeLinecap(convertRawProp(context, rawProps, "strokeLinecap", sourceProps.strokeLinecap, {0})), + strokeLinejoin(convertRawProp(context, rawProps, "strokeLinejoin", sourceProps.strokeLinejoin, {0})), + strokeDasharray(convertRawProp(context, rawProps, "strokeDasharray", sourceProps.strokeDasharray, {})), + strokeDashoffset(convertRawProp(context, rawProps, "strokeDashoffset", sourceProps.strokeDashoffset, {0.0})), + strokeMiterlimit(convertRawProp(context, rawProps, "strokeMiterlimit", sourceProps.strokeMiterlimit, {0.0})), + vectorEffect(convertRawProp(context, rawProps, "vectorEffect", sourceProps.vectorEffect, {0})), + propList(convertRawProp(context, rawProps, "propList", sourceProps.propList, {})), + d(convertRawProp(context, rawProps, "d", sourceProps.d, {})) {} +RNSVGPatternProps::RNSVGPatternProps(const PropsParserContext &context, const RNSVGPatternProps &sourceProps, + const RawProps &rawProps) + : ViewProps(context, sourceProps, rawProps), + + name(convertRawProp(context, rawProps, "name", sourceProps.name, {})), + opacity(convertRawProp(context, rawProps, "opacity", sourceProps.opacity, {1.0})), + matrix(convertRawProp(context, rawProps, "matrix", sourceProps.matrix, {})), + mask(convertRawProp(context, rawProps, "mask", sourceProps.mask, {})), + markerStart(convertRawProp(context, rawProps, "markerStart", sourceProps.markerStart, {})), + markerMid(convertRawProp(context, rawProps, "markerMid", sourceProps.markerMid, {})), + markerEnd(convertRawProp(context, rawProps, "markerEnd", sourceProps.markerEnd, {})), + clipPath(convertRawProp(context, rawProps, "clipPath", sourceProps.clipPath, {})), + clipRule(convertRawProp(context, rawProps, "clipRule", sourceProps.clipRule, {0})), + responsible(convertRawProp(context, rawProps, "responsible", sourceProps.responsible, {false})), + display(convertRawProp(context, rawProps, "display", sourceProps.display, {})), + pointerEvents(convertRawProp(context, rawProps, "pointerEvents", sourceProps.pointerEvents, {})), + fill(convertRawProp(context, rawProps, "fill", sourceProps.fill, {})), + fillOpacity(convertRawProp(context, rawProps, "fillOpacity", sourceProps.fillOpacity, {1.0})), + fillRule(convertRawProp(context, rawProps, "fillRule", sourceProps.fillRule, {1})), + stroke(convertRawProp(context, rawProps, "stroke", sourceProps.stroke, {})), + strokeOpacity(convertRawProp(context, rawProps, "strokeOpacity", sourceProps.strokeOpacity, {1.0})), + strokeWidth(convertRawProp(context, rawProps, "strokeWidth", sourceProps.strokeWidth, {"1"})), + strokeLinecap(convertRawProp(context, rawProps, "strokeLinecap", sourceProps.strokeLinecap, {0})), + strokeLinejoin(convertRawProp(context, rawProps, "strokeLinejoin", sourceProps.strokeLinejoin, {0})), + strokeDasharray(convertRawProp(context, rawProps, "strokeDasharray", sourceProps.strokeDasharray, {})), + strokeDashoffset(convertRawProp(context, rawProps, "strokeDashoffset", sourceProps.strokeDashoffset, {0.0})), + strokeMiterlimit(convertRawProp(context, rawProps, "strokeMiterlimit", sourceProps.strokeMiterlimit, {0.0})), + vectorEffect(convertRawProp(context, rawProps, "vectorEffect", sourceProps.vectorEffect, {0})), + propList(convertRawProp(context, rawProps, "propList", sourceProps.propList, {})), + fontSize(convertRawProp(context, rawProps, "fontSize", sourceProps.fontSize, {})), + fontWeight(convertRawProp(context, rawProps, "fontWeight", sourceProps.fontWeight, {})), + font(convertRawProp(context, rawProps, "font", sourceProps.font, {})), + x(convertRawProp(context, rawProps, "x", sourceProps.x, {})), + y(convertRawProp(context, rawProps, "y", sourceProps.y, {})), + height(convertRawProp(context, rawProps, "height", sourceProps.height, {})), + width(convertRawProp(context, rawProps, "width", sourceProps.width, {})), + patternUnits(convertRawProp(context, rawProps, "patternUnits", sourceProps.patternUnits, {0})), + patternContentUnits( + convertRawProp(context, rawProps, "patternContentUnits", sourceProps.patternContentUnits, {0})), + patternTransform(convertRawProp(context, rawProps, "patternTransform", sourceProps.patternTransform, {})), + minX(convertRawProp(context, rawProps, "minX", sourceProps.minX, {0.0})), + minY(convertRawProp(context, rawProps, "minY", sourceProps.minY, {0.0})), + vbWidth(convertRawProp(context, rawProps, "vbWidth", sourceProps.vbWidth, {0.0})), + vbHeight(convertRawProp(context, rawProps, "vbHeight", sourceProps.vbHeight, {0.0})), + align(convertRawProp(context, rawProps, "align", sourceProps.align, {})), + meetOrSlice(convertRawProp(context, rawProps, "meetOrSlice", sourceProps.meetOrSlice, {0})) {} +RNSVGRadialGradientProps::RNSVGRadialGradientProps(const PropsParserContext &context, + const RNSVGRadialGradientProps &sourceProps, + const RawProps &rawProps) + : ViewProps(context, sourceProps, rawProps), + + name(convertRawProp(context, rawProps, "name", sourceProps.name, {})), + opacity(convertRawProp(context, rawProps, "opacity", sourceProps.opacity, {1.0})), + matrix(convertRawProp(context, rawProps, "matrix", sourceProps.matrix, {})), + mask(convertRawProp(context, rawProps, "mask", sourceProps.mask, {})), + markerStart(convertRawProp(context, rawProps, "markerStart", sourceProps.markerStart, {})), + markerMid(convertRawProp(context, rawProps, "markerMid", sourceProps.markerMid, {})), + markerEnd(convertRawProp(context, rawProps, "markerEnd", sourceProps.markerEnd, {})), + clipPath(convertRawProp(context, rawProps, "clipPath", sourceProps.clipPath, {})), + clipRule(convertRawProp(context, rawProps, "clipRule", sourceProps.clipRule, {0})), + responsible(convertRawProp(context, rawProps, "responsible", sourceProps.responsible, {false})), + display(convertRawProp(context, rawProps, "display", sourceProps.display, {})), + pointerEvents(convertRawProp(context, rawProps, "pointerEvents", sourceProps.pointerEvents, {})), + fx(convertRawProp(context, rawProps, "fx", sourceProps.fx, {})), + fy(convertRawProp(context, rawProps, "fy", sourceProps.fy, {})), + cx(convertRawProp(context, rawProps, "cx", sourceProps.cx, {})), + cy(convertRawProp(context, rawProps, "cy", sourceProps.cy, {})), + rx(convertRawProp(context, rawProps, "rx", sourceProps.rx, {})), + ry(convertRawProp(context, rawProps, "ry", sourceProps.ry, {})), + gradient(convertRawProp(context, rawProps, "gradient", sourceProps.gradient, {})), + gradientUnits(convertRawProp(context, rawProps, "gradientUnits", sourceProps.gradientUnits, {0})), + gradientTransform(convertRawProp(context, rawProps, "gradientTransform", sourceProps.gradientTransform, {})) {} +RNSVGRectProps::RNSVGRectProps(const PropsParserContext &context, const RNSVGRectProps &sourceProps, + const RawProps &rawProps) + : ViewProps(context, sourceProps, rawProps), + + name(convertRawProp(context, rawProps, "name", sourceProps.name, {})), + opacity(convertRawProp(context, rawProps, "opacity", sourceProps.opacity, {1.0})), + matrix(convertRawProp(context, rawProps, "matrix", sourceProps.matrix, {})), + mask(convertRawProp(context, rawProps, "mask", sourceProps.mask, {})), + markerStart(convertRawProp(context, rawProps, "markerStart", sourceProps.markerStart, {})), + markerMid(convertRawProp(context, rawProps, "markerMid", sourceProps.markerMid, {})), + markerEnd(convertRawProp(context, rawProps, "markerEnd", sourceProps.markerEnd, {})), + clipPath(convertRawProp(context, rawProps, "clipPath", sourceProps.clipPath, {})), + clipRule(convertRawProp(context, rawProps, "clipRule", sourceProps.clipRule, {0})), + responsible(convertRawProp(context, rawProps, "responsible", sourceProps.responsible, {false})), + display(convertRawProp(context, rawProps, "display", sourceProps.display, {})), + pointerEvents(convertRawProp(context, rawProps, "pointerEvents", sourceProps.pointerEvents, {})), + fill(convertRawProp(context, rawProps, "fill", sourceProps.fill, {})), + fillOpacity(convertRawProp(context, rawProps, "fillOpacity", sourceProps.fillOpacity, {1.0})), + fillRule(convertRawProp(context, rawProps, "fillRule", sourceProps.fillRule, {1})), + stroke(convertRawProp(context, rawProps, "stroke", sourceProps.stroke, {})), + strokeOpacity(convertRawProp(context, rawProps, "strokeOpacity", sourceProps.strokeOpacity, {1.0})), + strokeWidth(convertRawProp(context, rawProps, "strokeWidth", sourceProps.strokeWidth, {"1"})), + strokeLinecap(convertRawProp(context, rawProps, "strokeLinecap", sourceProps.strokeLinecap, {0})), + strokeLinejoin(convertRawProp(context, rawProps, "strokeLinejoin", sourceProps.strokeLinejoin, {0})), + strokeDasharray(convertRawProp(context, rawProps, "strokeDasharray", sourceProps.strokeDasharray, {})), + strokeDashoffset(convertRawProp(context, rawProps, "strokeDashoffset", sourceProps.strokeDashoffset, {0.0})), + strokeMiterlimit(convertRawProp(context, rawProps, "strokeMiterlimit", sourceProps.strokeMiterlimit, {0.0})), + vectorEffect(convertRawProp(context, rawProps, "vectorEffect", sourceProps.vectorEffect, {0})), + propList(convertRawProp(context, rawProps, "propList", sourceProps.propList, {})), + x(convertRawProp(context, rawProps, "x", sourceProps.x, {})), + y(convertRawProp(context, rawProps, "y", sourceProps.y, {})), + height(convertRawProp(context, rawProps, "height", sourceProps.height, {})), + width(convertRawProp(context, rawProps, "width", sourceProps.width, {})), + rx(convertRawProp(context, rawProps, "rx", sourceProps.rx, {})), + ry(convertRawProp(context, rawProps, "ry", sourceProps.ry, {})) {} +RNSVGSymbolProps::RNSVGSymbolProps(const PropsParserContext &context, const RNSVGSymbolProps &sourceProps, + const RawProps &rawProps) + : ViewProps(context, sourceProps, rawProps), + + name(convertRawProp(context, rawProps, "name", sourceProps.name, {})), + opacity(convertRawProp(context, rawProps, "opacity", sourceProps.opacity, {1.0})), + matrix(convertRawProp(context, rawProps, "matrix", sourceProps.matrix, {})), + mask(convertRawProp(context, rawProps, "mask", sourceProps.mask, {})), + markerStart(convertRawProp(context, rawProps, "markerStart", sourceProps.markerStart, {})), + markerMid(convertRawProp(context, rawProps, "markerMid", sourceProps.markerMid, {})), + markerEnd(convertRawProp(context, rawProps, "markerEnd", sourceProps.markerEnd, {})), + clipPath(convertRawProp(context, rawProps, "clipPath", sourceProps.clipPath, {})), + clipRule(convertRawProp(context, rawProps, "clipRule", sourceProps.clipRule, {0})), + responsible(convertRawProp(context, rawProps, "responsible", sourceProps.responsible, {false})), + display(convertRawProp(context, rawProps, "display", sourceProps.display, {})), + pointerEvents(convertRawProp(context, rawProps, "pointerEvents", sourceProps.pointerEvents, {})), + fill(convertRawProp(context, rawProps, "fill", sourceProps.fill, {})), + fillOpacity(convertRawProp(context, rawProps, "fillOpacity", sourceProps.fillOpacity, {1.0})), + fillRule(convertRawProp(context, rawProps, "fillRule", sourceProps.fillRule, {1})), + stroke(convertRawProp(context, rawProps, "stroke", sourceProps.stroke, {})), + strokeOpacity(convertRawProp(context, rawProps, "strokeOpacity", sourceProps.strokeOpacity, {1.0})), + strokeWidth(convertRawProp(context, rawProps, "strokeWidth", sourceProps.strokeWidth, {"1"})), + strokeLinecap(convertRawProp(context, rawProps, "strokeLinecap", sourceProps.strokeLinecap, {0})), + strokeLinejoin(convertRawProp(context, rawProps, "strokeLinejoin", sourceProps.strokeLinejoin, {0})), + strokeDasharray(convertRawProp(context, rawProps, "strokeDasharray", sourceProps.strokeDasharray, {})), + strokeDashoffset(convertRawProp(context, rawProps, "strokeDashoffset", sourceProps.strokeDashoffset, {0.0})), + strokeMiterlimit(convertRawProp(context, rawProps, "strokeMiterlimit", sourceProps.strokeMiterlimit, {0.0})), + vectorEffect(convertRawProp(context, rawProps, "vectorEffect", sourceProps.vectorEffect, {0})), + propList(convertRawProp(context, rawProps, "propList", sourceProps.propList, {})), + fontSize(convertRawProp(context, rawProps, "fontSize", sourceProps.fontSize, {})), + fontWeight(convertRawProp(context, rawProps, "fontWeight", sourceProps.fontWeight, {})), + font(convertRawProp(context, rawProps, "font", sourceProps.font, {})), + minX(convertRawProp(context, rawProps, "minX", sourceProps.minX, {0.0})), + minY(convertRawProp(context, rawProps, "minY", sourceProps.minY, {0.0})), + vbWidth(convertRawProp(context, rawProps, "vbWidth", sourceProps.vbWidth, {0.0})), + vbHeight(convertRawProp(context, rawProps, "vbHeight", sourceProps.vbHeight, {0.0})), + align(convertRawProp(context, rawProps, "align", sourceProps.align, {})), + meetOrSlice(convertRawProp(context, rawProps, "meetOrSlice", sourceProps.meetOrSlice, {0})) {} +RNSVGTextProps::RNSVGTextProps(const PropsParserContext &context, const RNSVGTextProps &sourceProps, + const RawProps &rawProps) + : ViewProps(context, sourceProps, rawProps), + + name(convertRawProp(context, rawProps, "name", sourceProps.name, {})), + opacity(convertRawProp(context, rawProps, "opacity", sourceProps.opacity, {1.0})), + matrix(convertRawProp(context, rawProps, "matrix", sourceProps.matrix, {})), + mask(convertRawProp(context, rawProps, "mask", sourceProps.mask, {})), + markerStart(convertRawProp(context, rawProps, "markerStart", sourceProps.markerStart, {})), + markerMid(convertRawProp(context, rawProps, "markerMid", sourceProps.markerMid, {})), + markerEnd(convertRawProp(context, rawProps, "markerEnd", sourceProps.markerEnd, {})), + clipPath(convertRawProp(context, rawProps, "clipPath", sourceProps.clipPath, {})), + clipRule(convertRawProp(context, rawProps, "clipRule", sourceProps.clipRule, {0})), + responsible(convertRawProp(context, rawProps, "responsible", sourceProps.responsible, {false})), + display(convertRawProp(context, rawProps, "display", sourceProps.display, {})), + pointerEvents(convertRawProp(context, rawProps, "pointerEvents", sourceProps.pointerEvents, {})), + fill(convertRawProp(context, rawProps, "fill", sourceProps.fill, {})), + fillOpacity(convertRawProp(context, rawProps, "fillOpacity", sourceProps.fillOpacity, {1.0})), + fillRule(convertRawProp(context, rawProps, "fillRule", sourceProps.fillRule, {1})), + stroke(convertRawProp(context, rawProps, "stroke", sourceProps.stroke, {})), + strokeOpacity(convertRawProp(context, rawProps, "strokeOpacity", sourceProps.strokeOpacity, {1.0})), + strokeWidth(convertRawProp(context, rawProps, "strokeWidth", sourceProps.strokeWidth, {"1"})), + strokeLinecap(convertRawProp(context, rawProps, "strokeLinecap", sourceProps.strokeLinecap, {0})), + strokeLinejoin(convertRawProp(context, rawProps, "strokeLinejoin", sourceProps.strokeLinejoin, {0})), + strokeDasharray(convertRawProp(context, rawProps, "strokeDasharray", sourceProps.strokeDasharray, {})), + strokeDashoffset(convertRawProp(context, rawProps, "strokeDashoffset", sourceProps.strokeDashoffset, {0.0})), + strokeMiterlimit(convertRawProp(context, rawProps, "strokeMiterlimit", sourceProps.strokeMiterlimit, {0.0})), + vectorEffect(convertRawProp(context, rawProps, "vectorEffect", sourceProps.vectorEffect, {0})), + propList(convertRawProp(context, rawProps, "propList", sourceProps.propList, {})), + fontSize(convertRawProp(context, rawProps, "fontSize", sourceProps.fontSize, {})), + fontWeight(convertRawProp(context, rawProps, "fontWeight", sourceProps.fontWeight, {})), + font(convertRawProp(context, rawProps, "font", sourceProps.font, {})), + dx(convertRawProp(context, rawProps, "dx", sourceProps.dx, {})), + dy(convertRawProp(context, rawProps, "dy", sourceProps.dy, {})), + x(convertRawProp(context, rawProps, "x", sourceProps.x, {})), + y(convertRawProp(context, rawProps, "y", sourceProps.y, {})), + rotate(convertRawProp(context, rawProps, "rotate", sourceProps.rotate, {})), + inlineSize(convertRawProp(context, rawProps, "inlineSize", sourceProps.inlineSize, {})), + textLength(convertRawProp(context, rawProps, "textLength", sourceProps.textLength, {})), + baselineShift(convertRawProp(context, rawProps, "baselineShift", sourceProps.baselineShift, {})), + lengthAdjust(convertRawProp(context, rawProps, "lengthAdjust", sourceProps.lengthAdjust, {})), + alignmentBaseline(convertRawProp(context, rawProps, "alignmentBaseline", sourceProps.alignmentBaseline, {})), + verticalAlign(convertRawProp(context, rawProps, "verticalAlign", sourceProps.verticalAlign, {})) {} +RNSVGTextPathProps::RNSVGTextPathProps(const PropsParserContext &context, const RNSVGTextPathProps &sourceProps, + const RawProps &rawProps) + : ViewProps(context, sourceProps, rawProps), + + name(convertRawProp(context, rawProps, "name", sourceProps.name, {})), + opacity(convertRawProp(context, rawProps, "opacity", sourceProps.opacity, {1.0})), + matrix(convertRawProp(context, rawProps, "matrix", sourceProps.matrix, {})), + mask(convertRawProp(context, rawProps, "mask", sourceProps.mask, {})), + markerStart(convertRawProp(context, rawProps, "markerStart", sourceProps.markerStart, {})), + markerMid(convertRawProp(context, rawProps, "markerMid", sourceProps.markerMid, {})), + markerEnd(convertRawProp(context, rawProps, "markerEnd", sourceProps.markerEnd, {})), + clipPath(convertRawProp(context, rawProps, "clipPath", sourceProps.clipPath, {})), + clipRule(convertRawProp(context, rawProps, "clipRule", sourceProps.clipRule, {0})), + responsible(convertRawProp(context, rawProps, "responsible", sourceProps.responsible, {false})), + display(convertRawProp(context, rawProps, "display", sourceProps.display, {})), + pointerEvents(convertRawProp(context, rawProps, "pointerEvents", sourceProps.pointerEvents, {})), + fill(convertRawProp(context, rawProps, "fill", sourceProps.fill, {})), + fillOpacity(convertRawProp(context, rawProps, "fillOpacity", sourceProps.fillOpacity, {1.0})), + fillRule(convertRawProp(context, rawProps, "fillRule", sourceProps.fillRule, {1})), + stroke(convertRawProp(context, rawProps, "stroke", sourceProps.stroke, {})), + strokeOpacity(convertRawProp(context, rawProps, "strokeOpacity", sourceProps.strokeOpacity, {1.0})), + strokeWidth(convertRawProp(context, rawProps, "strokeWidth", sourceProps.strokeWidth, {"1"})), + strokeLinecap(convertRawProp(context, rawProps, "strokeLinecap", sourceProps.strokeLinecap, {0})), + strokeLinejoin(convertRawProp(context, rawProps, "strokeLinejoin", sourceProps.strokeLinejoin, {0})), + strokeDasharray(convertRawProp(context, rawProps, "strokeDasharray", sourceProps.strokeDasharray, {})), + strokeDashoffset(convertRawProp(context, rawProps, "strokeDashoffset", sourceProps.strokeDashoffset, {0.0})), + strokeMiterlimit(convertRawProp(context, rawProps, "strokeMiterlimit", sourceProps.strokeMiterlimit, {0.0})), + vectorEffect(convertRawProp(context, rawProps, "vectorEffect", sourceProps.vectorEffect, {0})), + propList(convertRawProp(context, rawProps, "propList", sourceProps.propList, {})), + fontSize(convertRawProp(context, rawProps, "fontSize", sourceProps.fontSize, {})), + fontWeight(convertRawProp(context, rawProps, "fontWeight", sourceProps.fontWeight, {})), + font(convertRawProp(context, rawProps, "font", sourceProps.font, {})), + dx(convertRawProp(context, rawProps, "dx", sourceProps.dx, {})), + dy(convertRawProp(context, rawProps, "dy", sourceProps.dy, {})), + x(convertRawProp(context, rawProps, "x", sourceProps.x, {})), + y(convertRawProp(context, rawProps, "y", sourceProps.y, {})), + rotate(convertRawProp(context, rawProps, "rotate", sourceProps.rotate, {})), + inlineSize(convertRawProp(context, rawProps, "inlineSize", sourceProps.inlineSize, {})), + textLength(convertRawProp(context, rawProps, "textLength", sourceProps.textLength, {})), + baselineShift(convertRawProp(context, rawProps, "baselineShift", sourceProps.baselineShift, {})), + lengthAdjust(convertRawProp(context, rawProps, "lengthAdjust", sourceProps.lengthAdjust, {})), + alignmentBaseline(convertRawProp(context, rawProps, "alignmentBaseline", sourceProps.alignmentBaseline, {})), + verticalAlign(convertRawProp(context, rawProps, "verticalAlign", sourceProps.verticalAlign, {})), + href(convertRawProp(context, rawProps, "href", sourceProps.href, {})), + side(convertRawProp(context, rawProps, "side", sourceProps.side, {})), + method(convertRawProp(context, rawProps, "method", sourceProps.method, {})), + midLine(convertRawProp(context, rawProps, "midLine", sourceProps.midLine, {})), + spacing(convertRawProp(context, rawProps, "spacing", sourceProps.spacing, {})), + startOffset(convertRawProp(context, rawProps, "startOffset", sourceProps.startOffset, {})) {} +RNSVGTSpanProps::RNSVGTSpanProps(const PropsParserContext &context, const RNSVGTSpanProps &sourceProps, + const RawProps &rawProps) + : ViewProps(context, sourceProps, rawProps), + + name(convertRawProp(context, rawProps, "name", sourceProps.name, {})), + opacity(convertRawProp(context, rawProps, "opacity", sourceProps.opacity, {1.0})), + matrix(convertRawProp(context, rawProps, "matrix", sourceProps.matrix, {})), + mask(convertRawProp(context, rawProps, "mask", sourceProps.mask, {})), + markerStart(convertRawProp(context, rawProps, "markerStart", sourceProps.markerStart, {})), + markerMid(convertRawProp(context, rawProps, "markerMid", sourceProps.markerMid, {})), + markerEnd(convertRawProp(context, rawProps, "markerEnd", sourceProps.markerEnd, {})), + clipPath(convertRawProp(context, rawProps, "clipPath", sourceProps.clipPath, {})), + clipRule(convertRawProp(context, rawProps, "clipRule", sourceProps.clipRule, {0})), + responsible(convertRawProp(context, rawProps, "responsible", sourceProps.responsible, {false})), + display(convertRawProp(context, rawProps, "display", sourceProps.display, {})), + pointerEvents(convertRawProp(context, rawProps, "pointerEvents", sourceProps.pointerEvents, {})), + fill(convertRawProp(context, rawProps, "fill", sourceProps.fill, {})), + fillOpacity(convertRawProp(context, rawProps, "fillOpacity", sourceProps.fillOpacity, {1.0})), + fillRule(convertRawProp(context, rawProps, "fillRule", sourceProps.fillRule, {1})), + stroke(convertRawProp(context, rawProps, "stroke", sourceProps.stroke, {})), + strokeOpacity(convertRawProp(context, rawProps, "strokeOpacity", sourceProps.strokeOpacity, {1.0})), + strokeWidth(convertRawProp(context, rawProps, "strokeWidth", sourceProps.strokeWidth, {"1"})), + strokeLinecap(convertRawProp(context, rawProps, "strokeLinecap", sourceProps.strokeLinecap, {0})), + strokeLinejoin(convertRawProp(context, rawProps, "strokeLinejoin", sourceProps.strokeLinejoin, {0})), + strokeDasharray(convertRawProp(context, rawProps, "strokeDasharray", sourceProps.strokeDasharray, {})), + strokeDashoffset(convertRawProp(context, rawProps, "strokeDashoffset", sourceProps.strokeDashoffset, {0.0})), + strokeMiterlimit(convertRawProp(context, rawProps, "strokeMiterlimit", sourceProps.strokeMiterlimit, {0.0})), + vectorEffect(convertRawProp(context, rawProps, "vectorEffect", sourceProps.vectorEffect, {0})), + propList(convertRawProp(context, rawProps, "propList", sourceProps.propList, {})), + fontSize(convertRawProp(context, rawProps, "fontSize", sourceProps.fontSize, {})), + fontWeight(convertRawProp(context, rawProps, "fontWeight", sourceProps.fontWeight, {})), + font(convertRawProp(context, rawProps, "font", sourceProps.font, {})), + dx(convertRawProp(context, rawProps, "dx", sourceProps.dx, {})), + dy(convertRawProp(context, rawProps, "dy", sourceProps.dy, {})), + x(convertRawProp(context, rawProps, "x", sourceProps.x, {})), + y(convertRawProp(context, rawProps, "y", sourceProps.y, {})), + rotate(convertRawProp(context, rawProps, "rotate", sourceProps.rotate, {})), + inlineSize(convertRawProp(context, rawProps, "inlineSize", sourceProps.inlineSize, {})), + textLength(convertRawProp(context, rawProps, "textLength", sourceProps.textLength, {})), + baselineShift(convertRawProp(context, rawProps, "baselineShift", sourceProps.baselineShift, {})), + lengthAdjust(convertRawProp(context, rawProps, "lengthAdjust", sourceProps.lengthAdjust, {})), + alignmentBaseline(convertRawProp(context, rawProps, "alignmentBaseline", sourceProps.alignmentBaseline, {})), + verticalAlign(convertRawProp(context, rawProps, "verticalAlign", sourceProps.verticalAlign, {})), + content(convertRawProp(context, rawProps, "content", sourceProps.content, {})) {} +RNSVGUseProps::RNSVGUseProps(const PropsParserContext &context, const RNSVGUseProps &sourceProps, + const RawProps &rawProps) + : ViewProps(context, sourceProps, rawProps), + + name(convertRawProp(context, rawProps, "name", sourceProps.name, {})), + opacity(convertRawProp(context, rawProps, "opacity", sourceProps.opacity, {1.0})), + matrix(convertRawProp(context, rawProps, "matrix", sourceProps.matrix, {})), + mask(convertRawProp(context, rawProps, "mask", sourceProps.mask, {})), + markerStart(convertRawProp(context, rawProps, "markerStart", sourceProps.markerStart, {})), + markerMid(convertRawProp(context, rawProps, "markerMid", sourceProps.markerMid, {})), + markerEnd(convertRawProp(context, rawProps, "markerEnd", sourceProps.markerEnd, {})), + clipPath(convertRawProp(context, rawProps, "clipPath", sourceProps.clipPath, {})), + clipRule(convertRawProp(context, rawProps, "clipRule", sourceProps.clipRule, {0})), + responsible(convertRawProp(context, rawProps, "responsible", sourceProps.responsible, {false})), + display(convertRawProp(context, rawProps, "display", sourceProps.display, {})), + pointerEvents(convertRawProp(context, rawProps, "pointerEvents", sourceProps.pointerEvents, {})), + fill(convertRawProp(context, rawProps, "fill", sourceProps.fill, {})), + fillOpacity(convertRawProp(context, rawProps, "fillOpacity", sourceProps.fillOpacity, {1.0})), + fillRule(convertRawProp(context, rawProps, "fillRule", sourceProps.fillRule, {1})), + stroke(convertRawProp(context, rawProps, "stroke", sourceProps.stroke, {})), + strokeOpacity(convertRawProp(context, rawProps, "strokeOpacity", sourceProps.strokeOpacity, {1.0})), + strokeWidth(convertRawProp(context, rawProps, "strokeWidth", sourceProps.strokeWidth, {"1"})), + strokeLinecap(convertRawProp(context, rawProps, "strokeLinecap", sourceProps.strokeLinecap, {0})), + strokeLinejoin(convertRawProp(context, rawProps, "strokeLinejoin", sourceProps.strokeLinejoin, {0})), + strokeDasharray(convertRawProp(context, rawProps, "strokeDasharray", sourceProps.strokeDasharray, {})), + strokeDashoffset(convertRawProp(context, rawProps, "strokeDashoffset", sourceProps.strokeDashoffset, {0.0})), + strokeMiterlimit(convertRawProp(context, rawProps, "strokeMiterlimit", sourceProps.strokeMiterlimit, {0.0})), + vectorEffect(convertRawProp(context, rawProps, "vectorEffect", sourceProps.vectorEffect, {0})), + propList(convertRawProp(context, rawProps, "propList", sourceProps.propList, {})), + href(convertRawProp(context, rawProps, "href", sourceProps.href, {})), + x(convertRawProp(context, rawProps, "x", sourceProps.x, {})), + y(convertRawProp(context, rawProps, "y", sourceProps.y, {})), + height(convertRawProp(context, rawProps, "height", sourceProps.height, {})), + width(convertRawProp(context, rawProps, "width", sourceProps.width, {})) {} + +} // namespace react +} // namespace facebook \ No newline at end of file diff --git a/tester/harmony/svg/src/main/cpp/Props.h b/tester/harmony/svg/src/main/cpp/Props.h new file mode 100644 index 0000000000000000000000000000000000000000..42a7a703f4c3c9b74c15d870508fe8010604a8f6 --- /dev/null +++ b/tester/harmony/svg/src/main/cpp/Props.h @@ -0,0 +1,2683 @@ + +/** + * This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen). + * + * Do not edit this file as changes may cause incorrect behavior and will be lost + * once the code is regenerated. + * + * @generated by codegen project: GeneratePropsH.js + */ +#pragma once + +#include +#include +#include +#include +#include +#include +#include + +namespace facebook { +namespace react { + +struct RNSVGSvgViewAndroidNativeBackgroundAndroidStruct { + std::string type; + Float color; + bool borderless; + Float rippleRadius; +}; + +static inline void fromRawValue(const PropsParserContext &context, const RawValue &value, + RNSVGSvgViewAndroidNativeBackgroundAndroidStruct &result) { + auto map = (butter::map)value; + + auto tmp_type = map.find("type"); + if (tmp_type != map.end()) { + fromRawValue(context, tmp_type->second, result.type); + } + auto tmp_color = map.find("color"); + if (tmp_color != map.end()) { + fromRawValue(context, tmp_color->second, result.color); + } + auto tmp_borderless = map.find("borderless"); + if (tmp_borderless != map.end()) { + fromRawValue(context, tmp_borderless->second, result.borderless); + } + auto tmp_rippleRadius = map.find("rippleRadius"); + if (tmp_rippleRadius != map.end()) { + fromRawValue(context, tmp_rippleRadius->second, result.rippleRadius); + } +} + +static inline std::string toString(const RNSVGSvgViewAndroidNativeBackgroundAndroidStruct &value) { + return "[Object RNSVGSvgViewAndroidNativeBackgroundAndroidStruct]"; +} + +struct RNSVGSvgViewAndroidNativeForegroundAndroidStruct { + std::string type; + Float color; + bool borderless; + Float rippleRadius; +}; + +static inline void fromRawValue(const PropsParserContext &context, const RawValue &value, + RNSVGSvgViewAndroidNativeForegroundAndroidStruct &result) { + auto map = (butter::map)value; + + auto tmp_type = map.find("type"); + if (tmp_type != map.end()) { + fromRawValue(context, tmp_type->second, result.type); + } + auto tmp_color = map.find("color"); + if (tmp_color != map.end()) { + fromRawValue(context, tmp_color->second, result.color); + } + auto tmp_borderless = map.find("borderless"); + if (tmp_borderless != map.end()) { + fromRawValue(context, tmp_borderless->second, result.borderless); + } + auto tmp_rippleRadius = map.find("rippleRadius"); + if (tmp_rippleRadius != map.end()) { + fromRawValue(context, tmp_rippleRadius->second, result.rippleRadius); + } +} + +static inline std::string toString(const RNSVGSvgViewAndroidNativeForegroundAndroidStruct &value) { + return "[Object RNSVGSvgViewAndroidNativeForegroundAndroidStruct]"; +} + +struct RNSVGSvgViewAndroidHitSlopStruct { + Float left; + Float top; + Float right; + Float bottom; +}; + +static inline void fromRawValue(const PropsParserContext &context, const RawValue &value, + RNSVGSvgViewAndroidHitSlopStruct &result) { + auto map = (butter::map)value; + + auto tmp_left = map.find("left"); + if (tmp_left != map.end()) { + fromRawValue(context, tmp_left->second, result.left); + } + auto tmp_top = map.find("top"); + if (tmp_top != map.end()) { + fromRawValue(context, tmp_top->second, result.top); + } + auto tmp_right = map.find("right"); + if (tmp_right != map.end()) { + fromRawValue(context, tmp_right->second, result.right); + } + auto tmp_bottom = map.find("bottom"); + if (tmp_bottom != map.end()) { + fromRawValue(context, tmp_bottom->second, result.bottom); + } +} + +static inline std::string toString(const RNSVGSvgViewAndroidHitSlopStruct &value) { + return "[Object RNSVGSvgViewAndroidHitSlopStruct]"; +} +class JSI_EXPORT RNSVGSvgViewAndroidProps final : public ViewProps { +public: + RNSVGSvgViewAndroidProps() = default; + RNSVGSvgViewAndroidProps(const PropsParserContext &context, const RNSVGSvgViewAndroidProps &sourceProps, + const RawProps &rawProps); + +#pragma mark - Props + + std::string bbWidth{}; + std::string bbHeight{}; + Float minX{0.0}; + Float minY{0.0}; + Float vbWidth{0.0}; + Float vbHeight{0.0}; + std::string align{}; + int meetOrSlice{0}; + SharedColor tintColor{}; + SharedColor color{}; + std::string pointerEvents{}; + bool hasTVPreferredFocus{false}; + Float borderTopEndRadius{0.0}; + Float borderBottomStartRadius{0.0}; + SharedColor borderBottomColor{}; + int nextFocusDown{0}; + SharedColor borderRightColor{}; + int nextFocusRight{0}; + SharedColor borderLeftColor{}; + SharedColor borderColor{}; + bool removeClippedSubviews{false}; + int nextFocusForward{0}; + int nextFocusUp{0}; + bool accessible{false}; + SharedColor borderStartColor{}; + Float borderBottomEndRadius{0.0}; + SharedColor borderEndColor{}; + bool focusable{false}; + RNSVGSvgViewAndroidNativeBackgroundAndroidStruct nativeBackgroundAndroid{}; + Float borderTopStartRadius{0.0}; + RNSVGSvgViewAndroidNativeForegroundAndroidStruct nativeForegroundAndroid{}; + std::string backfaceVisibility{}; + std::string borderStyle{}; + bool needsOffscreenAlphaCompositing{false}; + RNSVGSvgViewAndroidHitSlopStruct hitSlop{}; + SharedColor borderTopColor{}; + int nextFocusLeft{0}; + double borderTopRightRadius{0.0}; + double borderBottomRightRadius{0.0}; + double borderRadius{0.0}; + double borderBottomLeftRadius{0.0}; + double borderTopLeftRadius{0.0}; +}; + +struct RNSVGCircleFillStruct { + int type; + SharedColor payload; + std::string brushRef; +}; + +static inline void fromRawValue(const PropsParserContext &context, const RawValue &value, + RNSVGCircleFillStruct &result) { + auto map = (butter::map)value; + + auto tmp_type = map.find("type"); + if (tmp_type != map.end()) { + fromRawValue(context, tmp_type->second, result.type); + } + auto tmp_payload = map.find("payload"); + if (tmp_payload != map.end()) { + fromRawValue(context, tmp_payload->second, result.payload); + } + auto tmp_brushRef = map.find("brushRef"); + if (tmp_brushRef != map.end()) { + fromRawValue(context, tmp_brushRef->second, result.brushRef); + } +} + +static inline std::string toString(const RNSVGCircleFillStruct &value) { return "[Object RNSVGCircleFillStruct]"; } + +struct RNSVGCircleStrokeStruct { + int type; + SharedColor payload; + std::string brushRef; +}; + +static inline void fromRawValue(const PropsParserContext &context, const RawValue &value, + RNSVGCircleStrokeStruct &result) { + auto map = (butter::map)value; + + auto tmp_type = map.find("type"); + if (tmp_type != map.end()) { + fromRawValue(context, tmp_type->second, result.type); + } + auto tmp_payload = map.find("payload"); + if (tmp_payload != map.end()) { + fromRawValue(context, tmp_payload->second, result.payload); + } + auto tmp_brushRef = map.find("brushRef"); + if (tmp_brushRef != map.end()) { + fromRawValue(context, tmp_brushRef->second, result.brushRef); + } +} + +static inline std::string toString(const RNSVGCircleStrokeStruct &value) { return "[Object RNSVGCircleStrokeStruct]"; } +class JSI_EXPORT RNSVGCircleProps final : public ViewProps { +public: + RNSVGCircleProps() = default; + RNSVGCircleProps(const PropsParserContext &context, const RNSVGCircleProps &sourceProps, const RawProps &rawProps); + +#pragma mark - Props + + std::string name{}; + Float opacity{1.0}; + std::vector matrix{}; + std::string mask{}; + std::string markerStart{}; + std::string markerMid{}; + std::string markerEnd{}; + std::string clipPath{}; + int clipRule{0}; + bool responsible{false}; + std::string display{}; + std::string pointerEvents{}; + RNSVGCircleFillStruct fill{}; + Float fillOpacity{1.0}; + int fillRule{1}; + RNSVGCircleStrokeStruct stroke{}; + Float strokeOpacity{1.0}; + std::string strokeWidth{"1"}; + int strokeLinecap{0}; + int strokeLinejoin{0}; + std::vector strokeDasharray{}; + Float strokeDashoffset{0.0}; + Float strokeMiterlimit{0.0}; + int vectorEffect{0}; + std::vector propList{}; + std::string cx{}; + std::string cy{}; + std::string r{}; +}; + +struct RNSVGClipPathFillStruct { + int type; + SharedColor payload; + std::string brushRef; +}; + +static inline void fromRawValue(const PropsParserContext &context, const RawValue &value, + RNSVGClipPathFillStruct &result) { + auto map = (butter::map)value; + + auto tmp_type = map.find("type"); + if (tmp_type != map.end()) { + fromRawValue(context, tmp_type->second, result.type); + } + auto tmp_payload = map.find("payload"); + if (tmp_payload != map.end()) { + fromRawValue(context, tmp_payload->second, result.payload); + } + auto tmp_brushRef = map.find("brushRef"); + if (tmp_brushRef != map.end()) { + fromRawValue(context, tmp_brushRef->second, result.brushRef); + } +} + +static inline std::string toString(const RNSVGClipPathFillStruct &value) { return "[Object RNSVGClipPathFillStruct]"; } + +struct RNSVGClipPathStrokeStruct { + int type; + SharedColor payload; + std::string brushRef; +}; + +static inline void fromRawValue(const PropsParserContext &context, const RawValue &value, + RNSVGClipPathStrokeStruct &result) { + auto map = (butter::map)value; + + auto tmp_type = map.find("type"); + if (tmp_type != map.end()) { + fromRawValue(context, tmp_type->second, result.type); + } + auto tmp_payload = map.find("payload"); + if (tmp_payload != map.end()) { + fromRawValue(context, tmp_payload->second, result.payload); + } + auto tmp_brushRef = map.find("brushRef"); + if (tmp_brushRef != map.end()) { + fromRawValue(context, tmp_brushRef->second, result.brushRef); + } +} + +static inline std::string toString(const RNSVGClipPathStrokeStruct &value) { + return "[Object RNSVGClipPathStrokeStruct]"; +} + +struct RNSVGClipPathFontStruct { + std::string fontStyle; + std::string fontVariant; + std::string fontWeight; + std::string fontStretch; + std::string fontSize; + std::string fontFamily; + std::string textAnchor; + std::string textDecoration; + std::string letterSpacing; + std::string wordSpacing; + std::string kerning; + std::string fontFeatureSettings; + std::string fontVariantLigatures; + std::string fontVariationSettings; +}; + +static inline void fromRawValue(const PropsParserContext &context, const RawValue &value, + RNSVGClipPathFontStruct &result) { + auto map = (butter::map)value; + + auto tmp_fontStyle = map.find("fontStyle"); + if (tmp_fontStyle != map.end()) { + fromRawValue(context, tmp_fontStyle->second, result.fontStyle); + } + auto tmp_fontVariant = map.find("fontVariant"); + if (tmp_fontVariant != map.end()) { + fromRawValue(context, tmp_fontVariant->second, result.fontVariant); + } + auto tmp_fontWeight = map.find("fontWeight"); + if (tmp_fontWeight != map.end()) { + fromRawValue(context, tmp_fontWeight->second, result.fontWeight); + } + auto tmp_fontStretch = map.find("fontStretch"); + if (tmp_fontStretch != map.end()) { + fromRawValue(context, tmp_fontStretch->second, result.fontStretch); + } + auto tmp_fontSize = map.find("fontSize"); + if (tmp_fontSize != map.end()) { + fromRawValue(context, tmp_fontSize->second, result.fontSize); + } + auto tmp_fontFamily = map.find("fontFamily"); + if (tmp_fontFamily != map.end()) { + fromRawValue(context, tmp_fontFamily->second, result.fontFamily); + } + auto tmp_textAnchor = map.find("textAnchor"); + if (tmp_textAnchor != map.end()) { + fromRawValue(context, tmp_textAnchor->second, result.textAnchor); + } + auto tmp_textDecoration = map.find("textDecoration"); + if (tmp_textDecoration != map.end()) { + fromRawValue(context, tmp_textDecoration->second, result.textDecoration); + } + auto tmp_letterSpacing = map.find("letterSpacing"); + if (tmp_letterSpacing != map.end()) { + fromRawValue(context, tmp_letterSpacing->second, result.letterSpacing); + } + auto tmp_wordSpacing = map.find("wordSpacing"); + if (tmp_wordSpacing != map.end()) { + fromRawValue(context, tmp_wordSpacing->second, result.wordSpacing); + } + auto tmp_kerning = map.find("kerning"); + if (tmp_kerning != map.end()) { + fromRawValue(context, tmp_kerning->second, result.kerning); + } + auto tmp_fontFeatureSettings = map.find("fontFeatureSettings"); + if (tmp_fontFeatureSettings != map.end()) { + fromRawValue(context, tmp_fontFeatureSettings->second, result.fontFeatureSettings); + } + auto tmp_fontVariantLigatures = map.find("fontVariantLigatures"); + if (tmp_fontVariantLigatures != map.end()) { + fromRawValue(context, tmp_fontVariantLigatures->second, result.fontVariantLigatures); + } + auto tmp_fontVariationSettings = map.find("fontVariationSettings"); + if (tmp_fontVariationSettings != map.end()) { + fromRawValue(context, tmp_fontVariationSettings->second, result.fontVariationSettings); + } +} + +static inline std::string toString(const RNSVGClipPathFontStruct &value) { return "[Object RNSVGClipPathFontStruct]"; } +class JSI_EXPORT RNSVGClipPathProps final : public ViewProps { +public: + RNSVGClipPathProps() = default; + RNSVGClipPathProps(const PropsParserContext &context, const RNSVGClipPathProps &sourceProps, + const RawProps &rawProps); + +#pragma mark - Props + + std::string name{}; + Float opacity{1.0}; + std::vector matrix{}; + std::string mask{}; + std::string markerStart{}; + std::string markerMid{}; + std::string markerEnd{}; + std::string clipPath{}; + int clipRule{0}; + bool responsible{false}; + std::string display{}; + std::string pointerEvents{}; + RNSVGClipPathFillStruct fill{}; + Float fillOpacity{1.0}; + int fillRule{1}; + RNSVGClipPathStrokeStruct stroke{}; + Float strokeOpacity{1.0}; + std::string strokeWidth{"1"}; + int strokeLinecap{0}; + int strokeLinejoin{0}; + std::vector strokeDasharray{}; + Float strokeDashoffset{0.0}; + Float strokeMiterlimit{0.0}; + int vectorEffect{0}; + std::vector propList{}; + std::string fontSize{}; + std::string fontWeight{}; + RNSVGClipPathFontStruct font{}; +}; + +class JSI_EXPORT RNSVGDefsProps final : public ViewProps { +public: + RNSVGDefsProps() = default; + RNSVGDefsProps(const PropsParserContext &context, const RNSVGDefsProps &sourceProps, const RawProps &rawProps); + +#pragma mark - Props + + std::string name{}; + Float opacity{1.0}; + std::vector matrix{}; + std::string mask{}; + std::string markerStart{}; + std::string markerMid{}; + std::string markerEnd{}; + std::string clipPath{}; + int clipRule{0}; + bool responsible{false}; + std::string display{}; + std::string pointerEvents{}; +}; + +struct RNSVGEllipseFillStruct { + int type; + SharedColor payload; + std::string brushRef; +}; + +static inline void fromRawValue(const PropsParserContext &context, const RawValue &value, + RNSVGEllipseFillStruct &result) { + auto map = (butter::map)value; + + auto tmp_type = map.find("type"); + if (tmp_type != map.end()) { + fromRawValue(context, tmp_type->second, result.type); + } + auto tmp_payload = map.find("payload"); + if (tmp_payload != map.end()) { + fromRawValue(context, tmp_payload->second, result.payload); + } + auto tmp_brushRef = map.find("brushRef"); + if (tmp_brushRef != map.end()) { + fromRawValue(context, tmp_brushRef->second, result.brushRef); + } +} + +static inline std::string toString(const RNSVGEllipseFillStruct &value) { return "[Object RNSVGEllipseFillStruct]"; } + +struct RNSVGEllipseStrokeStruct { + int type; + SharedColor payload; + std::string brushRef; +}; + +static inline void fromRawValue(const PropsParserContext &context, const RawValue &value, + RNSVGEllipseStrokeStruct &result) { + auto map = (butter::map)value; + + auto tmp_type = map.find("type"); + if (tmp_type != map.end()) { + fromRawValue(context, tmp_type->second, result.type); + } + auto tmp_payload = map.find("payload"); + if (tmp_payload != map.end()) { + fromRawValue(context, tmp_payload->second, result.payload); + } + auto tmp_brushRef = map.find("brushRef"); + if (tmp_brushRef != map.end()) { + fromRawValue(context, tmp_brushRef->second, result.brushRef); + } +} + +static inline std::string toString(const RNSVGEllipseStrokeStruct &value) { + return "[Object RNSVGEllipseStrokeStruct]"; +} +class JSI_EXPORT RNSVGEllipseProps final : public ViewProps { +public: + RNSVGEllipseProps() = default; + RNSVGEllipseProps(const PropsParserContext &context, const RNSVGEllipseProps &sourceProps, + const RawProps &rawProps); + +#pragma mark - Props + + std::string name{}; + Float opacity{1.0}; + std::vector matrix{}; + std::string mask{}; + std::string markerStart{}; + std::string markerMid{}; + std::string markerEnd{}; + std::string clipPath{}; + int clipRule{0}; + bool responsible{false}; + std::string display{}; + std::string pointerEvents{}; + RNSVGEllipseFillStruct fill{}; + Float fillOpacity{1.0}; + int fillRule{1}; + RNSVGEllipseStrokeStruct stroke{}; + Float strokeOpacity{1.0}; + std::string strokeWidth{"1"}; + int strokeLinecap{0}; + int strokeLinejoin{0}; + std::vector strokeDasharray{}; + Float strokeDashoffset{0.0}; + Float strokeMiterlimit{0.0}; + int vectorEffect{0}; + std::vector propList{}; + std::string cx{}; + std::string cy{}; + std::string rx{}; + std::string ry{}; +}; + +struct RNSVGForeignObjectFillStruct { + int type; + SharedColor payload; + std::string brushRef; +}; + +static inline void fromRawValue(const PropsParserContext &context, const RawValue &value, + RNSVGForeignObjectFillStruct &result) { + auto map = (butter::map)value; + + auto tmp_type = map.find("type"); + if (tmp_type != map.end()) { + fromRawValue(context, tmp_type->second, result.type); + } + auto tmp_payload = map.find("payload"); + if (tmp_payload != map.end()) { + fromRawValue(context, tmp_payload->second, result.payload); + } + auto tmp_brushRef = map.find("brushRef"); + if (tmp_brushRef != map.end()) { + fromRawValue(context, tmp_brushRef->second, result.brushRef); + } +} + +static inline std::string toString(const RNSVGForeignObjectFillStruct &value) { + return "[Object RNSVGForeignObjectFillStruct]"; +} + +struct RNSVGForeignObjectStrokeStruct { + int type; + SharedColor payload; + std::string brushRef; +}; + +static inline void fromRawValue(const PropsParserContext &context, const RawValue &value, + RNSVGForeignObjectStrokeStruct &result) { + auto map = (butter::map)value; + + auto tmp_type = map.find("type"); + if (tmp_type != map.end()) { + fromRawValue(context, tmp_type->second, result.type); + } + auto tmp_payload = map.find("payload"); + if (tmp_payload != map.end()) { + fromRawValue(context, tmp_payload->second, result.payload); + } + auto tmp_brushRef = map.find("brushRef"); + if (tmp_brushRef != map.end()) { + fromRawValue(context, tmp_brushRef->second, result.brushRef); + } +} + +static inline std::string toString(const RNSVGForeignObjectStrokeStruct &value) { + return "[Object RNSVGForeignObjectStrokeStruct]"; +} + +struct RNSVGForeignObjectFontStruct { + std::string fontStyle; + std::string fontVariant; + std::string fontWeight; + std::string fontStretch; + std::string fontSize; + std::string fontFamily; + std::string textAnchor; + std::string textDecoration; + std::string letterSpacing; + std::string wordSpacing; + std::string kerning; + std::string fontFeatureSettings; + std::string fontVariantLigatures; + std::string fontVariationSettings; +}; + +static inline void fromRawValue(const PropsParserContext &context, const RawValue &value, + RNSVGForeignObjectFontStruct &result) { + auto map = (butter::map)value; + + auto tmp_fontStyle = map.find("fontStyle"); + if (tmp_fontStyle != map.end()) { + fromRawValue(context, tmp_fontStyle->second, result.fontStyle); + } + auto tmp_fontVariant = map.find("fontVariant"); + if (tmp_fontVariant != map.end()) { + fromRawValue(context, tmp_fontVariant->second, result.fontVariant); + } + auto tmp_fontWeight = map.find("fontWeight"); + if (tmp_fontWeight != map.end()) { + fromRawValue(context, tmp_fontWeight->second, result.fontWeight); + } + auto tmp_fontStretch = map.find("fontStretch"); + if (tmp_fontStretch != map.end()) { + fromRawValue(context, tmp_fontStretch->second, result.fontStretch); + } + auto tmp_fontSize = map.find("fontSize"); + if (tmp_fontSize != map.end()) { + fromRawValue(context, tmp_fontSize->second, result.fontSize); + } + auto tmp_fontFamily = map.find("fontFamily"); + if (tmp_fontFamily != map.end()) { + fromRawValue(context, tmp_fontFamily->second, result.fontFamily); + } + auto tmp_textAnchor = map.find("textAnchor"); + if (tmp_textAnchor != map.end()) { + fromRawValue(context, tmp_textAnchor->second, result.textAnchor); + } + auto tmp_textDecoration = map.find("textDecoration"); + if (tmp_textDecoration != map.end()) { + fromRawValue(context, tmp_textDecoration->second, result.textDecoration); + } + auto tmp_letterSpacing = map.find("letterSpacing"); + if (tmp_letterSpacing != map.end()) { + fromRawValue(context, tmp_letterSpacing->second, result.letterSpacing); + } + auto tmp_wordSpacing = map.find("wordSpacing"); + if (tmp_wordSpacing != map.end()) { + fromRawValue(context, tmp_wordSpacing->second, result.wordSpacing); + } + auto tmp_kerning = map.find("kerning"); + if (tmp_kerning != map.end()) { + fromRawValue(context, tmp_kerning->second, result.kerning); + } + auto tmp_fontFeatureSettings = map.find("fontFeatureSettings"); + if (tmp_fontFeatureSettings != map.end()) { + fromRawValue(context, tmp_fontFeatureSettings->second, result.fontFeatureSettings); + } + auto tmp_fontVariantLigatures = map.find("fontVariantLigatures"); + if (tmp_fontVariantLigatures != map.end()) { + fromRawValue(context, tmp_fontVariantLigatures->second, result.fontVariantLigatures); + } + auto tmp_fontVariationSettings = map.find("fontVariationSettings"); + if (tmp_fontVariationSettings != map.end()) { + fromRawValue(context, tmp_fontVariationSettings->second, result.fontVariationSettings); + } +} + +static inline std::string toString(const RNSVGForeignObjectFontStruct &value) { + return "[Object RNSVGForeignObjectFontStruct]"; +} +class JSI_EXPORT RNSVGForeignObjectProps final : public ViewProps { +public: + RNSVGForeignObjectProps() = default; + RNSVGForeignObjectProps(const PropsParserContext &context, const RNSVGForeignObjectProps &sourceProps, + const RawProps &rawProps); + +#pragma mark - Props + + std::string name{}; + Float opacity{1.0}; + std::vector matrix{}; + std::string mask{}; + std::string markerStart{}; + std::string markerMid{}; + std::string markerEnd{}; + std::string clipPath{}; + int clipRule{0}; + bool responsible{false}; + std::string display{}; + std::string pointerEvents{}; + RNSVGForeignObjectFillStruct fill{}; + Float fillOpacity{1.0}; + int fillRule{1}; + RNSVGForeignObjectStrokeStruct stroke{}; + Float strokeOpacity{1.0}; + std::string strokeWidth{"1"}; + int strokeLinecap{0}; + int strokeLinejoin{0}; + std::vector strokeDasharray{}; + Float strokeDashoffset{0.0}; + Float strokeMiterlimit{0.0}; + int vectorEffect{0}; + std::vector propList{}; + std::string fontSize{}; + std::string fontWeight{}; + RNSVGForeignObjectFontStruct font{}; + std::string x{}; + std::string y{}; + std::string height{}; + std::string width{}; +}; + +struct RNSVGGroupFillStruct { + int type; + SharedColor payload; + std::string brushRef; +}; + +static inline void fromRawValue(const PropsParserContext &context, const RawValue &value, + RNSVGGroupFillStruct &result) { + auto map = (butter::map)value; + + auto tmp_type = map.find("type"); + if (tmp_type != map.end()) { + fromRawValue(context, tmp_type->second, result.type); + } + auto tmp_payload = map.find("payload"); + if (tmp_payload != map.end()) { + fromRawValue(context, tmp_payload->second, result.payload); + } + auto tmp_brushRef = map.find("brushRef"); + if (tmp_brushRef != map.end()) { + fromRawValue(context, tmp_brushRef->second, result.brushRef); + } +} + +static inline std::string toString(const RNSVGGroupFillStruct &value) { return "[Object RNSVGGroupFillStruct]"; } + +struct RNSVGGroupStrokeStruct { + int type; + SharedColor payload; + std::string brushRef; +}; + +static inline void fromRawValue(const PropsParserContext &context, const RawValue &value, + RNSVGGroupStrokeStruct &result) { + auto map = (butter::map)value; + + auto tmp_type = map.find("type"); + if (tmp_type != map.end()) { + fromRawValue(context, tmp_type->second, result.type); + } + auto tmp_payload = map.find("payload"); + if (tmp_payload != map.end()) { + fromRawValue(context, tmp_payload->second, result.payload); + } + auto tmp_brushRef = map.find("brushRef"); + if (tmp_brushRef != map.end()) { + fromRawValue(context, tmp_brushRef->second, result.brushRef); + } +} + +static inline std::string toString(const RNSVGGroupStrokeStruct &value) { return "[Object RNSVGGroupStrokeStruct]"; } + +struct RNSVGGroupFontStruct { + std::string fontStyle; + std::string fontVariant; + std::string fontWeight; + std::string fontStretch; + std::string fontSize; + std::string fontFamily; + std::string textAnchor; + std::string textDecoration; + std::string letterSpacing; + std::string wordSpacing; + std::string kerning; + std::string fontFeatureSettings; + std::string fontVariantLigatures; + std::string fontVariationSettings; +}; + +static inline void fromRawValue(const PropsParserContext &context, const RawValue &value, + RNSVGGroupFontStruct &result) { + auto map = (butter::map)value; + + auto tmp_fontStyle = map.find("fontStyle"); + if (tmp_fontStyle != map.end()) { + fromRawValue(context, tmp_fontStyle->second, result.fontStyle); + } + auto tmp_fontVariant = map.find("fontVariant"); + if (tmp_fontVariant != map.end()) { + fromRawValue(context, tmp_fontVariant->second, result.fontVariant); + } + auto tmp_fontWeight = map.find("fontWeight"); + if (tmp_fontWeight != map.end()) { + fromRawValue(context, tmp_fontWeight->second, result.fontWeight); + } + auto tmp_fontStretch = map.find("fontStretch"); + if (tmp_fontStretch != map.end()) { + fromRawValue(context, tmp_fontStretch->second, result.fontStretch); + } + auto tmp_fontSize = map.find("fontSize"); + if (tmp_fontSize != map.end()) { + fromRawValue(context, tmp_fontSize->second, result.fontSize); + } + auto tmp_fontFamily = map.find("fontFamily"); + if (tmp_fontFamily != map.end()) { + fromRawValue(context, tmp_fontFamily->second, result.fontFamily); + } + auto tmp_textAnchor = map.find("textAnchor"); + if (tmp_textAnchor != map.end()) { + fromRawValue(context, tmp_textAnchor->second, result.textAnchor); + } + auto tmp_textDecoration = map.find("textDecoration"); + if (tmp_textDecoration != map.end()) { + fromRawValue(context, tmp_textDecoration->second, result.textDecoration); + } + auto tmp_letterSpacing = map.find("letterSpacing"); + if (tmp_letterSpacing != map.end()) { + fromRawValue(context, tmp_letterSpacing->second, result.letterSpacing); + } + auto tmp_wordSpacing = map.find("wordSpacing"); + if (tmp_wordSpacing != map.end()) { + fromRawValue(context, tmp_wordSpacing->second, result.wordSpacing); + } + auto tmp_kerning = map.find("kerning"); + if (tmp_kerning != map.end()) { + fromRawValue(context, tmp_kerning->second, result.kerning); + } + auto tmp_fontFeatureSettings = map.find("fontFeatureSettings"); + if (tmp_fontFeatureSettings != map.end()) { + fromRawValue(context, tmp_fontFeatureSettings->second, result.fontFeatureSettings); + } + auto tmp_fontVariantLigatures = map.find("fontVariantLigatures"); + if (tmp_fontVariantLigatures != map.end()) { + fromRawValue(context, tmp_fontVariantLigatures->second, result.fontVariantLigatures); + } + auto tmp_fontVariationSettings = map.find("fontVariationSettings"); + if (tmp_fontVariationSettings != map.end()) { + fromRawValue(context, tmp_fontVariationSettings->second, result.fontVariationSettings); + } +} + +static inline std::string toString(const RNSVGGroupFontStruct &value) { return "[Object RNSVGGroupFontStruct]"; } +class JSI_EXPORT RNSVGGroupProps final : public ViewProps { +public: + RNSVGGroupProps() = default; + RNSVGGroupProps(const PropsParserContext &context, const RNSVGGroupProps &sourceProps, const RawProps &rawProps); + +#pragma mark - Props + + std::string name{}; + Float opacity{1.0}; + std::vector matrix{}; + std::string mask{}; + std::string markerStart{}; + std::string markerMid{}; + std::string markerEnd{}; + std::string clipPath{}; + int clipRule{0}; + bool responsible{false}; + std::string display{}; + std::string pointerEvents{}; + RNSVGGroupFillStruct fill{}; + Float fillOpacity{1.0}; + int fillRule{1}; + RNSVGGroupStrokeStruct stroke{}; + Float strokeOpacity{1.0}; + std::string strokeWidth{"1"}; + int strokeLinecap{0}; + int strokeLinejoin{0}; + std::vector strokeDasharray{}; + Float strokeDashoffset{0.0}; + Float strokeMiterlimit{0.0}; + int vectorEffect{0}; + std::vector propList{}; + std::string fontSize{}; + std::string fontWeight{}; + RNSVGGroupFontStruct font{}; +}; + +struct RNSVGImageFillStruct { + int type; + SharedColor payload; + std::string brushRef; +}; + +static inline void fromRawValue(const PropsParserContext &context, const RawValue &value, + RNSVGImageFillStruct &result) { + auto map = (butter::map)value; + + auto tmp_type = map.find("type"); + if (tmp_type != map.end()) { + fromRawValue(context, tmp_type->second, result.type); + } + auto tmp_payload = map.find("payload"); + if (tmp_payload != map.end()) { + fromRawValue(context, tmp_payload->second, result.payload); + } + auto tmp_brushRef = map.find("brushRef"); + if (tmp_brushRef != map.end()) { + fromRawValue(context, tmp_brushRef->second, result.brushRef); + } +} + +static inline std::string toString(const RNSVGImageFillStruct &value) { return "[Object RNSVGImageFillStruct]"; } + +struct RNSVGImageStrokeStruct { + int type; + SharedColor payload; + std::string brushRef; +}; + +static inline void fromRawValue(const PropsParserContext &context, const RawValue &value, + RNSVGImageStrokeStruct &result) { + auto map = (butter::map)value; + + auto tmp_type = map.find("type"); + if (tmp_type != map.end()) { + fromRawValue(context, tmp_type->second, result.type); + } + auto tmp_payload = map.find("payload"); + if (tmp_payload != map.end()) { + fromRawValue(context, tmp_payload->second, result.payload); + } + auto tmp_brushRef = map.find("brushRef"); + if (tmp_brushRef != map.end()) { + fromRawValue(context, tmp_brushRef->second, result.brushRef); + } +} + +static inline std::string toString(const RNSVGImageStrokeStruct &value) { return "[Object RNSVGImageStrokeStruct]"; } +class JSI_EXPORT RNSVGImageProps final : public ViewProps { +public: + RNSVGImageProps() = default; + RNSVGImageProps(const PropsParserContext &context, const RNSVGImageProps &sourceProps, const RawProps &rawProps); + +#pragma mark - Props + + std::string name{}; + Float opacity{1.0}; + std::vector matrix{}; + std::string mask{}; + std::string markerStart{}; + std::string markerMid{}; + std::string markerEnd{}; + std::string clipPath{}; + int clipRule{0}; + bool responsible{false}; + std::string display{}; + std::string pointerEvents{}; + RNSVGImageFillStruct fill{}; + Float fillOpacity{1.0}; + int fillRule{1}; + RNSVGImageStrokeStruct stroke{}; + Float strokeOpacity{1.0}; + std::string strokeWidth{"1"}; + int strokeLinecap{0}; + int strokeLinejoin{0}; + std::vector strokeDasharray{}; + Float strokeDashoffset{0.0}; + Float strokeMiterlimit{0.0}; + int vectorEffect{0}; + std::vector propList{}; + std::string x{}; + std::string y{}; + std::string width{}; + std::string height{}; + ImageSource src{}; + std::string align{}; + int meetOrSlice{0}; +}; + +class JSI_EXPORT RNSVGSvgViewProps final : public ViewProps { +public: + RNSVGSvgViewProps() = default; + RNSVGSvgViewProps(const PropsParserContext &context, const RNSVGSvgViewProps &sourceProps, + const RawProps &rawProps); + +#pragma mark - Props + + std::string bbWidth{}; + std::string bbHeight{}; + Float minX{0.0}; + Float minY{0.0}; + Float vbWidth{0.0}; + Float vbHeight{0.0}; + std::string align{}; + int meetOrSlice{0}; + SharedColor tintColor{}; + SharedColor color{}; + std::string pointerEvents{}; +}; + +class JSI_EXPORT RNSVGLinearGradientProps final : public ViewProps { +public: + RNSVGLinearGradientProps() = default; + RNSVGLinearGradientProps(const PropsParserContext &context, const RNSVGLinearGradientProps &sourceProps, + const RawProps &rawProps); + +#pragma mark - Props + + std::string name{}; + Float opacity{1.0}; + std::vector matrix{}; + std::string mask{}; + std::string markerStart{}; + std::string markerMid{}; + std::string markerEnd{}; + std::string clipPath{}; + int clipRule{0}; + bool responsible{false}; + std::string display{}; + std::string pointerEvents{}; + std::string x1{}; + std::string y1{}; + std::string x2{}; + std::string y2{}; + std::vector gradient{}; + int gradientUnits{0}; + std::vector gradientTransform{}; +}; + +struct RNSVGLineFillStruct { + int type; + SharedColor payload; + std::string brushRef; +}; + +static inline void fromRawValue(const PropsParserContext &context, const RawValue &value, RNSVGLineFillStruct &result) { + auto map = (butter::map)value; + + auto tmp_type = map.find("type"); + if (tmp_type != map.end()) { + fromRawValue(context, tmp_type->second, result.type); + } + auto tmp_payload = map.find("payload"); + if (tmp_payload != map.end()) { + fromRawValue(context, tmp_payload->second, result.payload); + } + auto tmp_brushRef = map.find("brushRef"); + if (tmp_brushRef != map.end()) { + fromRawValue(context, tmp_brushRef->second, result.brushRef); + } +} + +static inline std::string toString(const RNSVGLineFillStruct &value) { return "[Object RNSVGLineFillStruct]"; } + +struct RNSVGLineStrokeStruct { + int type; + SharedColor payload; + std::string brushRef; +}; + +static inline void fromRawValue(const PropsParserContext &context, const RawValue &value, + RNSVGLineStrokeStruct &result) { + auto map = (butter::map)value; + + auto tmp_type = map.find("type"); + if (tmp_type != map.end()) { + fromRawValue(context, tmp_type->second, result.type); + } + auto tmp_payload = map.find("payload"); + if (tmp_payload != map.end()) { + fromRawValue(context, tmp_payload->second, result.payload); + } + auto tmp_brushRef = map.find("brushRef"); + if (tmp_brushRef != map.end()) { + fromRawValue(context, tmp_brushRef->second, result.brushRef); + } +} + +static inline std::string toString(const RNSVGLineStrokeStruct &value) { return "[Object RNSVGLineStrokeStruct]"; } +class JSI_EXPORT RNSVGLineProps final : public ViewProps { +public: + RNSVGLineProps() = default; + RNSVGLineProps(const PropsParserContext &context, const RNSVGLineProps &sourceProps, const RawProps &rawProps); + +#pragma mark - Props + + std::string name{}; + Float opacity{1.0}; + std::vector matrix{}; + std::string mask{}; + std::string markerStart{}; + std::string markerMid{}; + std::string markerEnd{}; + std::string clipPath{}; + int clipRule{0}; + bool responsible{false}; + std::string display{}; + std::string pointerEvents{}; + RNSVGLineFillStruct fill{}; + Float fillOpacity{1.0}; + int fillRule{1}; + RNSVGLineStrokeStruct stroke{}; + Float strokeOpacity{1.0}; + std::string strokeWidth{"1"}; + int strokeLinecap{0}; + int strokeLinejoin{0}; + std::vector strokeDasharray{}; + Float strokeDashoffset{0.0}; + Float strokeMiterlimit{0.0}; + int vectorEffect{0}; + std::vector propList{}; + std::string x1{}; + std::string y1{}; + std::string x2{}; + std::string y2{}; +}; + +struct RNSVGMarkerFillStruct { + int type; + SharedColor payload; + std::string brushRef; +}; + +static inline void fromRawValue(const PropsParserContext &context, const RawValue &value, + RNSVGMarkerFillStruct &result) { + auto map = (butter::map)value; + + auto tmp_type = map.find("type"); + if (tmp_type != map.end()) { + fromRawValue(context, tmp_type->second, result.type); + } + auto tmp_payload = map.find("payload"); + if (tmp_payload != map.end()) { + fromRawValue(context, tmp_payload->second, result.payload); + } + auto tmp_brushRef = map.find("brushRef"); + if (tmp_brushRef != map.end()) { + fromRawValue(context, tmp_brushRef->second, result.brushRef); + } +} + +static inline std::string toString(const RNSVGMarkerFillStruct &value) { return "[Object RNSVGMarkerFillStruct]"; } + +struct RNSVGMarkerStrokeStruct { + int type; + SharedColor payload; + std::string brushRef; +}; + +static inline void fromRawValue(const PropsParserContext &context, const RawValue &value, + RNSVGMarkerStrokeStruct &result) { + auto map = (butter::map)value; + + auto tmp_type = map.find("type"); + if (tmp_type != map.end()) { + fromRawValue(context, tmp_type->second, result.type); + } + auto tmp_payload = map.find("payload"); + if (tmp_payload != map.end()) { + fromRawValue(context, tmp_payload->second, result.payload); + } + auto tmp_brushRef = map.find("brushRef"); + if (tmp_brushRef != map.end()) { + fromRawValue(context, tmp_brushRef->second, result.brushRef); + } +} + +static inline std::string toString(const RNSVGMarkerStrokeStruct &value) { return "[Object RNSVGMarkerStrokeStruct]"; } + +struct RNSVGMarkerFontStruct { + std::string fontStyle; + std::string fontVariant; + std::string fontWeight; + std::string fontStretch; + std::string fontSize; + std::string fontFamily; + std::string textAnchor; + std::string textDecoration; + std::string letterSpacing; + std::string wordSpacing; + std::string kerning; + std::string fontFeatureSettings; + std::string fontVariantLigatures; + std::string fontVariationSettings; +}; + +static inline void fromRawValue(const PropsParserContext &context, const RawValue &value, + RNSVGMarkerFontStruct &result) { + auto map = (butter::map)value; + + auto tmp_fontStyle = map.find("fontStyle"); + if (tmp_fontStyle != map.end()) { + fromRawValue(context, tmp_fontStyle->second, result.fontStyle); + } + auto tmp_fontVariant = map.find("fontVariant"); + if (tmp_fontVariant != map.end()) { + fromRawValue(context, tmp_fontVariant->second, result.fontVariant); + } + auto tmp_fontWeight = map.find("fontWeight"); + if (tmp_fontWeight != map.end()) { + fromRawValue(context, tmp_fontWeight->second, result.fontWeight); + } + auto tmp_fontStretch = map.find("fontStretch"); + if (tmp_fontStretch != map.end()) { + fromRawValue(context, tmp_fontStretch->second, result.fontStretch); + } + auto tmp_fontSize = map.find("fontSize"); + if (tmp_fontSize != map.end()) { + fromRawValue(context, tmp_fontSize->second, result.fontSize); + } + auto tmp_fontFamily = map.find("fontFamily"); + if (tmp_fontFamily != map.end()) { + fromRawValue(context, tmp_fontFamily->second, result.fontFamily); + } + auto tmp_textAnchor = map.find("textAnchor"); + if (tmp_textAnchor != map.end()) { + fromRawValue(context, tmp_textAnchor->second, result.textAnchor); + } + auto tmp_textDecoration = map.find("textDecoration"); + if (tmp_textDecoration != map.end()) { + fromRawValue(context, tmp_textDecoration->second, result.textDecoration); + } + auto tmp_letterSpacing = map.find("letterSpacing"); + if (tmp_letterSpacing != map.end()) { + fromRawValue(context, tmp_letterSpacing->second, result.letterSpacing); + } + auto tmp_wordSpacing = map.find("wordSpacing"); + if (tmp_wordSpacing != map.end()) { + fromRawValue(context, tmp_wordSpacing->second, result.wordSpacing); + } + auto tmp_kerning = map.find("kerning"); + if (tmp_kerning != map.end()) { + fromRawValue(context, tmp_kerning->second, result.kerning); + } + auto tmp_fontFeatureSettings = map.find("fontFeatureSettings"); + if (tmp_fontFeatureSettings != map.end()) { + fromRawValue(context, tmp_fontFeatureSettings->second, result.fontFeatureSettings); + } + auto tmp_fontVariantLigatures = map.find("fontVariantLigatures"); + if (tmp_fontVariantLigatures != map.end()) { + fromRawValue(context, tmp_fontVariantLigatures->second, result.fontVariantLigatures); + } + auto tmp_fontVariationSettings = map.find("fontVariationSettings"); + if (tmp_fontVariationSettings != map.end()) { + fromRawValue(context, tmp_fontVariationSettings->second, result.fontVariationSettings); + } +} + +static inline std::string toString(const RNSVGMarkerFontStruct &value) { return "[Object RNSVGMarkerFontStruct]"; } +class JSI_EXPORT RNSVGMarkerProps final : public ViewProps { +public: + RNSVGMarkerProps() = default; + RNSVGMarkerProps(const PropsParserContext &context, const RNSVGMarkerProps &sourceProps, const RawProps &rawProps); + +#pragma mark - Props + + std::string name{}; + Float opacity{1.0}; + std::vector matrix{}; + std::string mask{}; + std::string markerStart{}; + std::string markerMid{}; + std::string markerEnd{}; + std::string clipPath{}; + int clipRule{0}; + bool responsible{false}; + std::string display{}; + std::string pointerEvents{}; + RNSVGMarkerFillStruct fill{}; + Float fillOpacity{1.0}; + int fillRule{1}; + RNSVGMarkerStrokeStruct stroke{}; + Float strokeOpacity{1.0}; + std::string strokeWidth{"1"}; + int strokeLinecap{0}; + int strokeLinejoin{0}; + std::vector strokeDasharray{}; + Float strokeDashoffset{0.0}; + Float strokeMiterlimit{0.0}; + int vectorEffect{0}; + std::vector propList{}; + std::string fontSize{}; + std::string fontWeight{}; + RNSVGMarkerFontStruct font{}; + std::string refX{}; + std::string refY{}; + std::string markerHeight{}; + std::string markerWidth{}; + std::string markerUnits{}; + std::string orient{}; + Float minX{0.0}; + Float minY{0.0}; + Float vbWidth{0.0}; + Float vbHeight{0.0}; + std::string align{}; + int meetOrSlice{0}; +}; + +struct RNSVGMaskFillStruct { + int type; + SharedColor payload; + std::string brushRef; +}; + +static inline void fromRawValue(const PropsParserContext &context, const RawValue &value, RNSVGMaskFillStruct &result) { + auto map = (butter::map)value; + + auto tmp_type = map.find("type"); + if (tmp_type != map.end()) { + fromRawValue(context, tmp_type->second, result.type); + } + auto tmp_payload = map.find("payload"); + if (tmp_payload != map.end()) { + fromRawValue(context, tmp_payload->second, result.payload); + } + auto tmp_brushRef = map.find("brushRef"); + if (tmp_brushRef != map.end()) { + fromRawValue(context, tmp_brushRef->second, result.brushRef); + } +} + +static inline std::string toString(const RNSVGMaskFillStruct &value) { return "[Object RNSVGMaskFillStruct]"; } + +struct RNSVGMaskStrokeStruct { + int type; + SharedColor payload; + std::string brushRef; +}; + +static inline void fromRawValue(const PropsParserContext &context, const RawValue &value, + RNSVGMaskStrokeStruct &result) { + auto map = (butter::map)value; + + auto tmp_type = map.find("type"); + if (tmp_type != map.end()) { + fromRawValue(context, tmp_type->second, result.type); + } + auto tmp_payload = map.find("payload"); + if (tmp_payload != map.end()) { + fromRawValue(context, tmp_payload->second, result.payload); + } + auto tmp_brushRef = map.find("brushRef"); + if (tmp_brushRef != map.end()) { + fromRawValue(context, tmp_brushRef->second, result.brushRef); + } +} + +static inline std::string toString(const RNSVGMaskStrokeStruct &value) { return "[Object RNSVGMaskStrokeStruct]"; } + +struct RNSVGMaskFontStruct { + std::string fontStyle; + std::string fontVariant; + std::string fontWeight; + std::string fontStretch; + std::string fontSize; + std::string fontFamily; + std::string textAnchor; + std::string textDecoration; + std::string letterSpacing; + std::string wordSpacing; + std::string kerning; + std::string fontFeatureSettings; + std::string fontVariantLigatures; + std::string fontVariationSettings; +}; + +static inline void fromRawValue(const PropsParserContext &context, const RawValue &value, RNSVGMaskFontStruct &result) { + auto map = (butter::map)value; + + auto tmp_fontStyle = map.find("fontStyle"); + if (tmp_fontStyle != map.end()) { + fromRawValue(context, tmp_fontStyle->second, result.fontStyle); + } + auto tmp_fontVariant = map.find("fontVariant"); + if (tmp_fontVariant != map.end()) { + fromRawValue(context, tmp_fontVariant->second, result.fontVariant); + } + auto tmp_fontWeight = map.find("fontWeight"); + if (tmp_fontWeight != map.end()) { + fromRawValue(context, tmp_fontWeight->second, result.fontWeight); + } + auto tmp_fontStretch = map.find("fontStretch"); + if (tmp_fontStretch != map.end()) { + fromRawValue(context, tmp_fontStretch->second, result.fontStretch); + } + auto tmp_fontSize = map.find("fontSize"); + if (tmp_fontSize != map.end()) { + fromRawValue(context, tmp_fontSize->second, result.fontSize); + } + auto tmp_fontFamily = map.find("fontFamily"); + if (tmp_fontFamily != map.end()) { + fromRawValue(context, tmp_fontFamily->second, result.fontFamily); + } + auto tmp_textAnchor = map.find("textAnchor"); + if (tmp_textAnchor != map.end()) { + fromRawValue(context, tmp_textAnchor->second, result.textAnchor); + } + auto tmp_textDecoration = map.find("textDecoration"); + if (tmp_textDecoration != map.end()) { + fromRawValue(context, tmp_textDecoration->second, result.textDecoration); + } + auto tmp_letterSpacing = map.find("letterSpacing"); + if (tmp_letterSpacing != map.end()) { + fromRawValue(context, tmp_letterSpacing->second, result.letterSpacing); + } + auto tmp_wordSpacing = map.find("wordSpacing"); + if (tmp_wordSpacing != map.end()) { + fromRawValue(context, tmp_wordSpacing->second, result.wordSpacing); + } + auto tmp_kerning = map.find("kerning"); + if (tmp_kerning != map.end()) { + fromRawValue(context, tmp_kerning->second, result.kerning); + } + auto tmp_fontFeatureSettings = map.find("fontFeatureSettings"); + if (tmp_fontFeatureSettings != map.end()) { + fromRawValue(context, tmp_fontFeatureSettings->second, result.fontFeatureSettings); + } + auto tmp_fontVariantLigatures = map.find("fontVariantLigatures"); + if (tmp_fontVariantLigatures != map.end()) { + fromRawValue(context, tmp_fontVariantLigatures->second, result.fontVariantLigatures); + } + auto tmp_fontVariationSettings = map.find("fontVariationSettings"); + if (tmp_fontVariationSettings != map.end()) { + fromRawValue(context, tmp_fontVariationSettings->second, result.fontVariationSettings); + } +} + +static inline std::string toString(const RNSVGMaskFontStruct &value) { return "[Object RNSVGMaskFontStruct]"; } +class JSI_EXPORT RNSVGMaskProps final : public ViewProps { +public: + RNSVGMaskProps() = default; + RNSVGMaskProps(const PropsParserContext &context, const RNSVGMaskProps &sourceProps, const RawProps &rawProps); + +#pragma mark - Props + + std::string name{}; + Float opacity{1.0}; + std::vector matrix{}; + std::string mask{}; + std::string markerStart{}; + std::string markerMid{}; + std::string markerEnd{}; + std::string clipPath{}; + int clipRule{0}; + bool responsible{false}; + std::string display{}; + std::string pointerEvents{}; + RNSVGMaskFillStruct fill{}; + Float fillOpacity{1.0}; + int fillRule{1}; + RNSVGMaskStrokeStruct stroke{}; + Float strokeOpacity{1.0}; + std::string strokeWidth{"1"}; + int strokeLinecap{0}; + int strokeLinejoin{0}; + std::vector strokeDasharray{}; + Float strokeDashoffset{0.0}; + Float strokeMiterlimit{0.0}; + int vectorEffect{0}; + std::vector propList{}; + std::string fontSize{}; + std::string fontWeight{}; + RNSVGMaskFontStruct font{}; + std::string x{}; + std::string y{}; + std::string height{}; + std::string width{}; + int maskUnits{0}; + int maskContentUnits{0}; +}; + +struct RNSVGPathFillStruct { + int type; + SharedColor payload; + std::string brushRef; +}; + +static inline void fromRawValue(const PropsParserContext &context, const RawValue &value, RNSVGPathFillStruct &result) { + auto map = (butter::map)value; + + auto tmp_type = map.find("type"); + if (tmp_type != map.end()) { + fromRawValue(context, tmp_type->second, result.type); + } + auto tmp_payload = map.find("payload"); + if (tmp_payload != map.end()) { + fromRawValue(context, tmp_payload->second, result.payload); + } + auto tmp_brushRef = map.find("brushRef"); + if (tmp_brushRef != map.end()) { + fromRawValue(context, tmp_brushRef->second, result.brushRef); + } +} + +static inline std::string toString(const RNSVGPathFillStruct &value) { return "[Object RNSVGPathFillStruct]"; } + +struct RNSVGPathStrokeStruct { + int type; + SharedColor payload; + std::string brushRef; +}; + +static inline void fromRawValue(const PropsParserContext &context, const RawValue &value, + RNSVGPathStrokeStruct &result) { + auto map = (butter::map)value; + + auto tmp_type = map.find("type"); + if (tmp_type != map.end()) { + fromRawValue(context, tmp_type->second, result.type); + } + auto tmp_payload = map.find("payload"); + if (tmp_payload != map.end()) { + fromRawValue(context, tmp_payload->second, result.payload); + } + auto tmp_brushRef = map.find("brushRef"); + if (tmp_brushRef != map.end()) { + fromRawValue(context, tmp_brushRef->second, result.brushRef); + } +} + +static inline std::string toString(const RNSVGPathStrokeStruct &value) { return "[Object RNSVGPathStrokeStruct]"; } +class JSI_EXPORT RNSVGPathProps final : public ViewProps { +public: + RNSVGPathProps() = default; + RNSVGPathProps(const PropsParserContext &context, const RNSVGPathProps &sourceProps, const RawProps &rawProps); + +#pragma mark - Props + + std::string name{}; + Float opacity{1.0}; + std::vector matrix{}; + std::string mask{}; + std::string markerStart{}; + std::string markerMid{}; + std::string markerEnd{}; + std::string clipPath{}; + int clipRule{0}; + bool responsible{false}; + std::string display{}; + std::string pointerEvents{}; + RNSVGPathFillStruct fill{}; + Float fillOpacity{1.0}; + int fillRule{1}; + RNSVGPathStrokeStruct stroke{}; + Float strokeOpacity{1.0}; + std::string strokeWidth{"1"}; + int strokeLinecap{0}; + int strokeLinejoin{0}; + std::vector strokeDasharray{}; + Float strokeDashoffset{0.0}; + Float strokeMiterlimit{0.0}; + int vectorEffect{0}; + std::vector propList{}; + std::string d{}; +}; + +struct RNSVGPatternFillStruct { + int type; + SharedColor payload; + std::string brushRef; +}; + +static inline void fromRawValue(const PropsParserContext &context, const RawValue &value, + RNSVGPatternFillStruct &result) { + auto map = (butter::map)value; + + auto tmp_type = map.find("type"); + if (tmp_type != map.end()) { + fromRawValue(context, tmp_type->second, result.type); + } + auto tmp_payload = map.find("payload"); + if (tmp_payload != map.end()) { + fromRawValue(context, tmp_payload->second, result.payload); + } + auto tmp_brushRef = map.find("brushRef"); + if (tmp_brushRef != map.end()) { + fromRawValue(context, tmp_brushRef->second, result.brushRef); + } +} + +static inline std::string toString(const RNSVGPatternFillStruct &value) { return "[Object RNSVGPatternFillStruct]"; } + +struct RNSVGPatternStrokeStruct { + int type; + SharedColor payload; + std::string brushRef; +}; + +static inline void fromRawValue(const PropsParserContext &context, const RawValue &value, + RNSVGPatternStrokeStruct &result) { + auto map = (butter::map)value; + + auto tmp_type = map.find("type"); + if (tmp_type != map.end()) { + fromRawValue(context, tmp_type->second, result.type); + } + auto tmp_payload = map.find("payload"); + if (tmp_payload != map.end()) { + fromRawValue(context, tmp_payload->second, result.payload); + } + auto tmp_brushRef = map.find("brushRef"); + if (tmp_brushRef != map.end()) { + fromRawValue(context, tmp_brushRef->second, result.brushRef); + } +} + +static inline std::string toString(const RNSVGPatternStrokeStruct &value) { + return "[Object RNSVGPatternStrokeStruct]"; +} + +struct RNSVGPatternFontStruct { + std::string fontStyle; + std::string fontVariant; + std::string fontWeight; + std::string fontStretch; + std::string fontSize; + std::string fontFamily; + std::string textAnchor; + std::string textDecoration; + std::string letterSpacing; + std::string wordSpacing; + std::string kerning; + std::string fontFeatureSettings; + std::string fontVariantLigatures; + std::string fontVariationSettings; +}; + +static inline void fromRawValue(const PropsParserContext &context, const RawValue &value, + RNSVGPatternFontStruct &result) { + auto map = (butter::map)value; + + auto tmp_fontStyle = map.find("fontStyle"); + if (tmp_fontStyle != map.end()) { + fromRawValue(context, tmp_fontStyle->second, result.fontStyle); + } + auto tmp_fontVariant = map.find("fontVariant"); + if (tmp_fontVariant != map.end()) { + fromRawValue(context, tmp_fontVariant->second, result.fontVariant); + } + auto tmp_fontWeight = map.find("fontWeight"); + if (tmp_fontWeight != map.end()) { + fromRawValue(context, tmp_fontWeight->second, result.fontWeight); + } + auto tmp_fontStretch = map.find("fontStretch"); + if (tmp_fontStretch != map.end()) { + fromRawValue(context, tmp_fontStretch->second, result.fontStretch); + } + auto tmp_fontSize = map.find("fontSize"); + if (tmp_fontSize != map.end()) { + fromRawValue(context, tmp_fontSize->second, result.fontSize); + } + auto tmp_fontFamily = map.find("fontFamily"); + if (tmp_fontFamily != map.end()) { + fromRawValue(context, tmp_fontFamily->second, result.fontFamily); + } + auto tmp_textAnchor = map.find("textAnchor"); + if (tmp_textAnchor != map.end()) { + fromRawValue(context, tmp_textAnchor->second, result.textAnchor); + } + auto tmp_textDecoration = map.find("textDecoration"); + if (tmp_textDecoration != map.end()) { + fromRawValue(context, tmp_textDecoration->second, result.textDecoration); + } + auto tmp_letterSpacing = map.find("letterSpacing"); + if (tmp_letterSpacing != map.end()) { + fromRawValue(context, tmp_letterSpacing->second, result.letterSpacing); + } + auto tmp_wordSpacing = map.find("wordSpacing"); + if (tmp_wordSpacing != map.end()) { + fromRawValue(context, tmp_wordSpacing->second, result.wordSpacing); + } + auto tmp_kerning = map.find("kerning"); + if (tmp_kerning != map.end()) { + fromRawValue(context, tmp_kerning->second, result.kerning); + } + auto tmp_fontFeatureSettings = map.find("fontFeatureSettings"); + if (tmp_fontFeatureSettings != map.end()) { + fromRawValue(context, tmp_fontFeatureSettings->second, result.fontFeatureSettings); + } + auto tmp_fontVariantLigatures = map.find("fontVariantLigatures"); + if (tmp_fontVariantLigatures != map.end()) { + fromRawValue(context, tmp_fontVariantLigatures->second, result.fontVariantLigatures); + } + auto tmp_fontVariationSettings = map.find("fontVariationSettings"); + if (tmp_fontVariationSettings != map.end()) { + fromRawValue(context, tmp_fontVariationSettings->second, result.fontVariationSettings); + } +} + +static inline std::string toString(const RNSVGPatternFontStruct &value) { return "[Object RNSVGPatternFontStruct]"; } +class JSI_EXPORT RNSVGPatternProps final : public ViewProps { +public: + RNSVGPatternProps() = default; + RNSVGPatternProps(const PropsParserContext &context, const RNSVGPatternProps &sourceProps, + const RawProps &rawProps); + +#pragma mark - Props + + std::string name{}; + Float opacity{1.0}; + std::vector matrix{}; + std::string mask{}; + std::string markerStart{}; + std::string markerMid{}; + std::string markerEnd{}; + std::string clipPath{}; + int clipRule{0}; + bool responsible{false}; + std::string display{}; + std::string pointerEvents{}; + RNSVGPatternFillStruct fill{}; + Float fillOpacity{1.0}; + int fillRule{1}; + RNSVGPatternStrokeStruct stroke{}; + Float strokeOpacity{1.0}; + std::string strokeWidth{"1"}; + int strokeLinecap{0}; + int strokeLinejoin{0}; + std::vector strokeDasharray{}; + Float strokeDashoffset{0.0}; + Float strokeMiterlimit{0.0}; + int vectorEffect{0}; + std::vector propList{}; + std::string fontSize{}; + std::string fontWeight{}; + RNSVGPatternFontStruct font{}; + std::string x{}; + std::string y{}; + std::string height{}; + std::string width{}; + int patternUnits{0}; + int patternContentUnits{0}; + std::vector patternTransform{}; + Float minX{0.0}; + Float minY{0.0}; + Float vbWidth{0.0}; + Float vbHeight{0.0}; + std::string align{}; + int meetOrSlice{0}; +}; + +class JSI_EXPORT RNSVGRadialGradientProps final : public ViewProps { +public: + RNSVGRadialGradientProps() = default; + RNSVGRadialGradientProps(const PropsParserContext &context, const RNSVGRadialGradientProps &sourceProps, + const RawProps &rawProps); + +#pragma mark - Props + + std::string name{}; + Float opacity{1.0}; + std::vector matrix{}; + std::string mask{}; + std::string markerStart{}; + std::string markerMid{}; + std::string markerEnd{}; + std::string clipPath{}; + int clipRule{0}; + bool responsible{false}; + std::string display{}; + std::string pointerEvents{}; + std::string fx{}; + std::string fy{}; + std::string cx{}; + std::string cy{}; + std::string rx{}; + std::string ry{}; + std::vector gradient{}; + int gradientUnits{0}; + std::vector gradientTransform{}; +}; + +struct RNSVGRectFillStruct { + int type; + SharedColor payload; + std::string brushRef; +}; + +static inline void fromRawValue(const PropsParserContext &context, const RawValue &value, RNSVGRectFillStruct &result) { + auto map = (butter::map)value; + + auto tmp_type = map.find("type"); + if (tmp_type != map.end()) { + fromRawValue(context, tmp_type->second, result.type); + } + auto tmp_payload = map.find("payload"); + if (tmp_payload != map.end()) { + fromRawValue(context, tmp_payload->second, result.payload); + } + auto tmp_brushRef = map.find("brushRef"); + if (tmp_brushRef != map.end()) { + fromRawValue(context, tmp_brushRef->second, result.brushRef); + } +} + +static inline std::string toString(const RNSVGRectFillStruct &value) { return "[Object RNSVGRectFillStruct]"; } + +struct RNSVGRectStrokeStruct { + int type; + SharedColor payload; + std::string brushRef; +}; + +static inline void fromRawValue(const PropsParserContext &context, const RawValue &value, + RNSVGRectStrokeStruct &result) { + auto map = (butter::map)value; + + auto tmp_type = map.find("type"); + if (tmp_type != map.end()) { + fromRawValue(context, tmp_type->second, result.type); + } + auto tmp_payload = map.find("payload"); + if (tmp_payload != map.end()) { + fromRawValue(context, tmp_payload->second, result.payload); + } + auto tmp_brushRef = map.find("brushRef"); + if (tmp_brushRef != map.end()) { + fromRawValue(context, tmp_brushRef->second, result.brushRef); + } +} + +static inline std::string toString(const RNSVGRectStrokeStruct &value) { return "[Object RNSVGRectStrokeStruct]"; } +class JSI_EXPORT RNSVGRectProps final : public ViewProps { +public: + RNSVGRectProps() = default; + RNSVGRectProps(const PropsParserContext &context, const RNSVGRectProps &sourceProps, const RawProps &rawProps); + +#pragma mark - Props + + std::string name{}; + Float opacity{1.0}; + std::vector matrix{}; + std::string mask{}; + std::string markerStart{}; + std::string markerMid{}; + std::string markerEnd{}; + std::string clipPath{}; + int clipRule{0}; + bool responsible{false}; + std::string display{}; + std::string pointerEvents{}; + RNSVGRectFillStruct fill{}; + Float fillOpacity{1.0}; + int fillRule{1}; + RNSVGRectStrokeStruct stroke{}; + Float strokeOpacity{1.0}; + std::string strokeWidth{"1"}; + int strokeLinecap{0}; + int strokeLinejoin{0}; + std::vector strokeDasharray{}; + Float strokeDashoffset{0.0}; + Float strokeMiterlimit{0.0}; + int vectorEffect{0}; + std::vector propList{}; + std::string x{}; + std::string y{}; + std::string height{}; + std::string width{}; + std::string rx{}; + std::string ry{}; +}; + +struct RNSVGSymbolFillStruct { + int type; + SharedColor payload; + std::string brushRef; +}; + +static inline void fromRawValue(const PropsParserContext &context, const RawValue &value, + RNSVGSymbolFillStruct &result) { + auto map = (butter::map)value; + + auto tmp_type = map.find("type"); + if (tmp_type != map.end()) { + fromRawValue(context, tmp_type->second, result.type); + } + auto tmp_payload = map.find("payload"); + if (tmp_payload != map.end()) { + fromRawValue(context, tmp_payload->second, result.payload); + } + auto tmp_brushRef = map.find("brushRef"); + if (tmp_brushRef != map.end()) { + fromRawValue(context, tmp_brushRef->second, result.brushRef); + } +} + +static inline std::string toString(const RNSVGSymbolFillStruct &value) { return "[Object RNSVGSymbolFillStruct]"; } + +struct RNSVGSymbolStrokeStruct { + int type; + SharedColor payload; + std::string brushRef; +}; + +static inline void fromRawValue(const PropsParserContext &context, const RawValue &value, + RNSVGSymbolStrokeStruct &result) { + auto map = (butter::map)value; + + auto tmp_type = map.find("type"); + if (tmp_type != map.end()) { + fromRawValue(context, tmp_type->second, result.type); + } + auto tmp_payload = map.find("payload"); + if (tmp_payload != map.end()) { + fromRawValue(context, tmp_payload->second, result.payload); + } + auto tmp_brushRef = map.find("brushRef"); + if (tmp_brushRef != map.end()) { + fromRawValue(context, tmp_brushRef->second, result.brushRef); + } +} + +static inline std::string toString(const RNSVGSymbolStrokeStruct &value) { return "[Object RNSVGSymbolStrokeStruct]"; } + +struct RNSVGSymbolFontStruct { + std::string fontStyle; + std::string fontVariant; + std::string fontWeight; + std::string fontStretch; + std::string fontSize; + std::string fontFamily; + std::string textAnchor; + std::string textDecoration; + std::string letterSpacing; + std::string wordSpacing; + std::string kerning; + std::string fontFeatureSettings; + std::string fontVariantLigatures; + std::string fontVariationSettings; +}; + +static inline void fromRawValue(const PropsParserContext &context, const RawValue &value, + RNSVGSymbolFontStruct &result) { + auto map = (butter::map)value; + + auto tmp_fontStyle = map.find("fontStyle"); + if (tmp_fontStyle != map.end()) { + fromRawValue(context, tmp_fontStyle->second, result.fontStyle); + } + auto tmp_fontVariant = map.find("fontVariant"); + if (tmp_fontVariant != map.end()) { + fromRawValue(context, tmp_fontVariant->second, result.fontVariant); + } + auto tmp_fontWeight = map.find("fontWeight"); + if (tmp_fontWeight != map.end()) { + fromRawValue(context, tmp_fontWeight->second, result.fontWeight); + } + auto tmp_fontStretch = map.find("fontStretch"); + if (tmp_fontStretch != map.end()) { + fromRawValue(context, tmp_fontStretch->second, result.fontStretch); + } + auto tmp_fontSize = map.find("fontSize"); + if (tmp_fontSize != map.end()) { + fromRawValue(context, tmp_fontSize->second, result.fontSize); + } + auto tmp_fontFamily = map.find("fontFamily"); + if (tmp_fontFamily != map.end()) { + fromRawValue(context, tmp_fontFamily->second, result.fontFamily); + } + auto tmp_textAnchor = map.find("textAnchor"); + if (tmp_textAnchor != map.end()) { + fromRawValue(context, tmp_textAnchor->second, result.textAnchor); + } + auto tmp_textDecoration = map.find("textDecoration"); + if (tmp_textDecoration != map.end()) { + fromRawValue(context, tmp_textDecoration->second, result.textDecoration); + } + auto tmp_letterSpacing = map.find("letterSpacing"); + if (tmp_letterSpacing != map.end()) { + fromRawValue(context, tmp_letterSpacing->second, result.letterSpacing); + } + auto tmp_wordSpacing = map.find("wordSpacing"); + if (tmp_wordSpacing != map.end()) { + fromRawValue(context, tmp_wordSpacing->second, result.wordSpacing); + } + auto tmp_kerning = map.find("kerning"); + if (tmp_kerning != map.end()) { + fromRawValue(context, tmp_kerning->second, result.kerning); + } + auto tmp_fontFeatureSettings = map.find("fontFeatureSettings"); + if (tmp_fontFeatureSettings != map.end()) { + fromRawValue(context, tmp_fontFeatureSettings->second, result.fontFeatureSettings); + } + auto tmp_fontVariantLigatures = map.find("fontVariantLigatures"); + if (tmp_fontVariantLigatures != map.end()) { + fromRawValue(context, tmp_fontVariantLigatures->second, result.fontVariantLigatures); + } + auto tmp_fontVariationSettings = map.find("fontVariationSettings"); + if (tmp_fontVariationSettings != map.end()) { + fromRawValue(context, tmp_fontVariationSettings->second, result.fontVariationSettings); + } +} + +static inline std::string toString(const RNSVGSymbolFontStruct &value) { return "[Object RNSVGSymbolFontStruct]"; } +class JSI_EXPORT RNSVGSymbolProps final : public ViewProps { +public: + RNSVGSymbolProps() = default; + RNSVGSymbolProps(const PropsParserContext &context, const RNSVGSymbolProps &sourceProps, const RawProps &rawProps); + +#pragma mark - Props + + std::string name{}; + Float opacity{1.0}; + std::vector matrix{}; + std::string mask{}; + std::string markerStart{}; + std::string markerMid{}; + std::string markerEnd{}; + std::string clipPath{}; + int clipRule{0}; + bool responsible{false}; + std::string display{}; + std::string pointerEvents{}; + RNSVGSymbolFillStruct fill{}; + Float fillOpacity{1.0}; + int fillRule{1}; + RNSVGSymbolStrokeStruct stroke{}; + Float strokeOpacity{1.0}; + std::string strokeWidth{"1"}; + int strokeLinecap{0}; + int strokeLinejoin{0}; + std::vector strokeDasharray{}; + Float strokeDashoffset{0.0}; + Float strokeMiterlimit{0.0}; + int vectorEffect{0}; + std::vector propList{}; + std::string fontSize{}; + std::string fontWeight{}; + RNSVGSymbolFontStruct font{}; + Float minX{0.0}; + Float minY{0.0}; + Float vbWidth{0.0}; + Float vbHeight{0.0}; + std::string align{}; + int meetOrSlice{0}; +}; + +struct RNSVGTextFillStruct { + int type; + SharedColor payload; + std::string brushRef; +}; + +static inline void fromRawValue(const PropsParserContext &context, const RawValue &value, RNSVGTextFillStruct &result) { + auto map = (butter::map)value; + + auto tmp_type = map.find("type"); + if (tmp_type != map.end()) { + fromRawValue(context, tmp_type->second, result.type); + } + auto tmp_payload = map.find("payload"); + if (tmp_payload != map.end()) { + fromRawValue(context, tmp_payload->second, result.payload); + } + auto tmp_brushRef = map.find("brushRef"); + if (tmp_brushRef != map.end()) { + fromRawValue(context, tmp_brushRef->second, result.brushRef); + } +} + +static inline std::string toString(const RNSVGTextFillStruct &value) { return "[Object RNSVGTextFillStruct]"; } + +struct RNSVGTextStrokeStruct { + int type; + SharedColor payload; + std::string brushRef; +}; + +static inline void fromRawValue(const PropsParserContext &context, const RawValue &value, + RNSVGTextStrokeStruct &result) { + auto map = (butter::map)value; + + auto tmp_type = map.find("type"); + if (tmp_type != map.end()) { + fromRawValue(context, tmp_type->second, result.type); + } + auto tmp_payload = map.find("payload"); + if (tmp_payload != map.end()) { + fromRawValue(context, tmp_payload->second, result.payload); + } + auto tmp_brushRef = map.find("brushRef"); + if (tmp_brushRef != map.end()) { + fromRawValue(context, tmp_brushRef->second, result.brushRef); + } +} + +static inline std::string toString(const RNSVGTextStrokeStruct &value) { return "[Object RNSVGTextStrokeStruct]"; } + +struct RNSVGTextFontStruct { + std::string fontStyle; + std::string fontVariant; + std::string fontWeight; + std::string fontStretch; + std::string fontSize; + std::string fontFamily; + std::string textAnchor; + std::string textDecoration; + std::string letterSpacing; + std::string wordSpacing; + std::string kerning; + std::string fontFeatureSettings; + std::string fontVariantLigatures; + std::string fontVariationSettings; +}; + +static inline void fromRawValue(const PropsParserContext &context, const RawValue &value, RNSVGTextFontStruct &result) { + auto map = (butter::map)value; + + auto tmp_fontStyle = map.find("fontStyle"); + if (tmp_fontStyle != map.end()) { + fromRawValue(context, tmp_fontStyle->second, result.fontStyle); + } + auto tmp_fontVariant = map.find("fontVariant"); + if (tmp_fontVariant != map.end()) { + fromRawValue(context, tmp_fontVariant->second, result.fontVariant); + } + auto tmp_fontWeight = map.find("fontWeight"); + if (tmp_fontWeight != map.end()) { + fromRawValue(context, tmp_fontWeight->second, result.fontWeight); + } + auto tmp_fontStretch = map.find("fontStretch"); + if (tmp_fontStretch != map.end()) { + fromRawValue(context, tmp_fontStretch->second, result.fontStretch); + } + auto tmp_fontSize = map.find("fontSize"); + if (tmp_fontSize != map.end()) { + fromRawValue(context, tmp_fontSize->second, result.fontSize); + } + auto tmp_fontFamily = map.find("fontFamily"); + if (tmp_fontFamily != map.end()) { + fromRawValue(context, tmp_fontFamily->second, result.fontFamily); + } + auto tmp_textAnchor = map.find("textAnchor"); + if (tmp_textAnchor != map.end()) { + fromRawValue(context, tmp_textAnchor->second, result.textAnchor); + } + auto tmp_textDecoration = map.find("textDecoration"); + if (tmp_textDecoration != map.end()) { + fromRawValue(context, tmp_textDecoration->second, result.textDecoration); + } + auto tmp_letterSpacing = map.find("letterSpacing"); + if (tmp_letterSpacing != map.end()) { + fromRawValue(context, tmp_letterSpacing->second, result.letterSpacing); + } + auto tmp_wordSpacing = map.find("wordSpacing"); + if (tmp_wordSpacing != map.end()) { + fromRawValue(context, tmp_wordSpacing->second, result.wordSpacing); + } + auto tmp_kerning = map.find("kerning"); + if (tmp_kerning != map.end()) { + fromRawValue(context, tmp_kerning->second, result.kerning); + } + auto tmp_fontFeatureSettings = map.find("fontFeatureSettings"); + if (tmp_fontFeatureSettings != map.end()) { + fromRawValue(context, tmp_fontFeatureSettings->second, result.fontFeatureSettings); + } + auto tmp_fontVariantLigatures = map.find("fontVariantLigatures"); + if (tmp_fontVariantLigatures != map.end()) { + fromRawValue(context, tmp_fontVariantLigatures->second, result.fontVariantLigatures); + } + auto tmp_fontVariationSettings = map.find("fontVariationSettings"); + if (tmp_fontVariationSettings != map.end()) { + fromRawValue(context, tmp_fontVariationSettings->second, result.fontVariationSettings); + } +} + +static inline std::string toString(const RNSVGTextFontStruct &value) { return "[Object RNSVGTextFontStruct]"; } +class JSI_EXPORT RNSVGTextProps final : public ViewProps { +public: + RNSVGTextProps() = default; + RNSVGTextProps(const PropsParserContext &context, const RNSVGTextProps &sourceProps, const RawProps &rawProps); + +#pragma mark - Props + + std::string name{}; + Float opacity{1.0}; + std::vector matrix{}; + std::string mask{}; + std::string markerStart{}; + std::string markerMid{}; + std::string markerEnd{}; + std::string clipPath{}; + int clipRule{0}; + bool responsible{false}; + std::string display{}; + std::string pointerEvents{}; + RNSVGTextFillStruct fill{}; + Float fillOpacity{1.0}; + int fillRule{1}; + RNSVGTextStrokeStruct stroke{}; + Float strokeOpacity{1.0}; + std::string strokeWidth{"1"}; + int strokeLinecap{0}; + int strokeLinejoin{0}; + std::vector strokeDasharray{}; + Float strokeDashoffset{0.0}; + Float strokeMiterlimit{0.0}; + int vectorEffect{0}; + std::vector propList{}; + std::string fontSize{}; + std::string fontWeight{}; + RNSVGTextFontStruct font{}; + std::vector dx{}; + std::vector dy{}; + std::vector x{}; + std::vector y{}; + std::vector rotate{}; + std::string inlineSize{}; + std::string textLength{}; + std::string baselineShift{}; + std::string lengthAdjust{}; + std::string alignmentBaseline{}; + std::string verticalAlign{}; +}; + +struct RNSVGTextPathFillStruct { + int type; + SharedColor payload; + std::string brushRef; +}; + +static inline void fromRawValue(const PropsParserContext &context, const RawValue &value, + RNSVGTextPathFillStruct &result) { + auto map = (butter::map)value; + + auto tmp_type = map.find("type"); + if (tmp_type != map.end()) { + fromRawValue(context, tmp_type->second, result.type); + } + auto tmp_payload = map.find("payload"); + if (tmp_payload != map.end()) { + fromRawValue(context, tmp_payload->second, result.payload); + } + auto tmp_brushRef = map.find("brushRef"); + if (tmp_brushRef != map.end()) { + fromRawValue(context, tmp_brushRef->second, result.brushRef); + } +} + +static inline std::string toString(const RNSVGTextPathFillStruct &value) { return "[Object RNSVGTextPathFillStruct]"; } + +struct RNSVGTextPathStrokeStruct { + int type; + SharedColor payload; + std::string brushRef; +}; + +static inline void fromRawValue(const PropsParserContext &context, const RawValue &value, + RNSVGTextPathStrokeStruct &result) { + auto map = (butter::map)value; + + auto tmp_type = map.find("type"); + if (tmp_type != map.end()) { + fromRawValue(context, tmp_type->second, result.type); + } + auto tmp_payload = map.find("payload"); + if (tmp_payload != map.end()) { + fromRawValue(context, tmp_payload->second, result.payload); + } + auto tmp_brushRef = map.find("brushRef"); + if (tmp_brushRef != map.end()) { + fromRawValue(context, tmp_brushRef->second, result.brushRef); + } +} + +static inline std::string toString(const RNSVGTextPathStrokeStruct &value) { + return "[Object RNSVGTextPathStrokeStruct]"; +} + +struct RNSVGTextPathFontStruct { + std::string fontStyle; + std::string fontVariant; + std::string fontWeight; + std::string fontStretch; + std::string fontSize; + std::string fontFamily; + std::string textAnchor; + std::string textDecoration; + std::string letterSpacing; + std::string wordSpacing; + std::string kerning; + std::string fontFeatureSettings; + std::string fontVariantLigatures; + std::string fontVariationSettings; +}; + +static inline void fromRawValue(const PropsParserContext &context, const RawValue &value, + RNSVGTextPathFontStruct &result) { + auto map = (butter::map)value; + + auto tmp_fontStyle = map.find("fontStyle"); + if (tmp_fontStyle != map.end()) { + fromRawValue(context, tmp_fontStyle->second, result.fontStyle); + } + auto tmp_fontVariant = map.find("fontVariant"); + if (tmp_fontVariant != map.end()) { + fromRawValue(context, tmp_fontVariant->second, result.fontVariant); + } + auto tmp_fontWeight = map.find("fontWeight"); + if (tmp_fontWeight != map.end()) { + fromRawValue(context, tmp_fontWeight->second, result.fontWeight); + } + auto tmp_fontStretch = map.find("fontStretch"); + if (tmp_fontStretch != map.end()) { + fromRawValue(context, tmp_fontStretch->second, result.fontStretch); + } + auto tmp_fontSize = map.find("fontSize"); + if (tmp_fontSize != map.end()) { + fromRawValue(context, tmp_fontSize->second, result.fontSize); + } + auto tmp_fontFamily = map.find("fontFamily"); + if (tmp_fontFamily != map.end()) { + fromRawValue(context, tmp_fontFamily->second, result.fontFamily); + } + auto tmp_textAnchor = map.find("textAnchor"); + if (tmp_textAnchor != map.end()) { + fromRawValue(context, tmp_textAnchor->second, result.textAnchor); + } + auto tmp_textDecoration = map.find("textDecoration"); + if (tmp_textDecoration != map.end()) { + fromRawValue(context, tmp_textDecoration->second, result.textDecoration); + } + auto tmp_letterSpacing = map.find("letterSpacing"); + if (tmp_letterSpacing != map.end()) { + fromRawValue(context, tmp_letterSpacing->second, result.letterSpacing); + } + auto tmp_wordSpacing = map.find("wordSpacing"); + if (tmp_wordSpacing != map.end()) { + fromRawValue(context, tmp_wordSpacing->second, result.wordSpacing); + } + auto tmp_kerning = map.find("kerning"); + if (tmp_kerning != map.end()) { + fromRawValue(context, tmp_kerning->second, result.kerning); + } + auto tmp_fontFeatureSettings = map.find("fontFeatureSettings"); + if (tmp_fontFeatureSettings != map.end()) { + fromRawValue(context, tmp_fontFeatureSettings->second, result.fontFeatureSettings); + } + auto tmp_fontVariantLigatures = map.find("fontVariantLigatures"); + if (tmp_fontVariantLigatures != map.end()) { + fromRawValue(context, tmp_fontVariantLigatures->second, result.fontVariantLigatures); + } + auto tmp_fontVariationSettings = map.find("fontVariationSettings"); + if (tmp_fontVariationSettings != map.end()) { + fromRawValue(context, tmp_fontVariationSettings->second, result.fontVariationSettings); + } +} + +static inline std::string toString(const RNSVGTextPathFontStruct &value) { return "[Object RNSVGTextPathFontStruct]"; } +class JSI_EXPORT RNSVGTextPathProps final : public ViewProps { +public: + RNSVGTextPathProps() = default; + RNSVGTextPathProps(const PropsParserContext &context, const RNSVGTextPathProps &sourceProps, + const RawProps &rawProps); + +#pragma mark - Props + + std::string name{}; + Float opacity{1.0}; + std::vector matrix{}; + std::string mask{}; + std::string markerStart{}; + std::string markerMid{}; + std::string markerEnd{}; + std::string clipPath{}; + int clipRule{0}; + bool responsible{false}; + std::string display{}; + std::string pointerEvents{}; + RNSVGTextPathFillStruct fill{}; + Float fillOpacity{1.0}; + int fillRule{1}; + RNSVGTextPathStrokeStruct stroke{}; + Float strokeOpacity{1.0}; + std::string strokeWidth{"1"}; + int strokeLinecap{0}; + int strokeLinejoin{0}; + std::vector strokeDasharray{}; + Float strokeDashoffset{0.0}; + Float strokeMiterlimit{0.0}; + int vectorEffect{0}; + std::vector propList{}; + std::string fontSize{}; + std::string fontWeight{}; + RNSVGTextPathFontStruct font{}; + std::vector dx{}; + std::vector dy{}; + std::vector x{}; + std::vector y{}; + std::vector rotate{}; + std::string inlineSize{}; + std::string textLength{}; + std::string baselineShift{}; + std::string lengthAdjust{}; + std::string alignmentBaseline{}; + std::string verticalAlign{}; + std::string href{}; + std::string side{}; + std::string method{}; + std::string midLine{}; + std::string spacing{}; + std::string startOffset{}; +}; + +struct RNSVGTSpanFillStruct { + int type; + SharedColor payload; + std::string brushRef; +}; + +static inline void fromRawValue(const PropsParserContext &context, const RawValue &value, + RNSVGTSpanFillStruct &result) { + auto map = (butter::map)value; + + auto tmp_type = map.find("type"); + if (tmp_type != map.end()) { + fromRawValue(context, tmp_type->second, result.type); + } + auto tmp_payload = map.find("payload"); + if (tmp_payload != map.end()) { + fromRawValue(context, tmp_payload->second, result.payload); + } + auto tmp_brushRef = map.find("brushRef"); + if (tmp_brushRef != map.end()) { + fromRawValue(context, tmp_brushRef->second, result.brushRef); + } +} + +static inline std::string toString(const RNSVGTSpanFillStruct &value) { return "[Object RNSVGTSpanFillStruct]"; } + +struct RNSVGTSpanStrokeStruct { + int type; + SharedColor payload; + std::string brushRef; +}; + +static inline void fromRawValue(const PropsParserContext &context, const RawValue &value, + RNSVGTSpanStrokeStruct &result) { + auto map = (butter::map)value; + + auto tmp_type = map.find("type"); + if (tmp_type != map.end()) { + fromRawValue(context, tmp_type->second, result.type); + } + auto tmp_payload = map.find("payload"); + if (tmp_payload != map.end()) { + fromRawValue(context, tmp_payload->second, result.payload); + } + auto tmp_brushRef = map.find("brushRef"); + if (tmp_brushRef != map.end()) { + fromRawValue(context, tmp_brushRef->second, result.brushRef); + } +} + +static inline std::string toString(const RNSVGTSpanStrokeStruct &value) { return "[Object RNSVGTSpanStrokeStruct]"; } + +struct RNSVGTSpanFontStruct { + std::string fontStyle; + std::string fontVariant; + std::string fontWeight; + std::string fontStretch; + std::string fontSize; + std::string fontFamily; + std::string textAnchor; + std::string textDecoration; + std::string letterSpacing; + std::string wordSpacing; + std::string kerning; + std::string fontFeatureSettings; + std::string fontVariantLigatures; + std::string fontVariationSettings; +}; + +static inline void fromRawValue(const PropsParserContext &context, const RawValue &value, + RNSVGTSpanFontStruct &result) { + auto map = (butter::map)value; + + auto tmp_fontStyle = map.find("fontStyle"); + if (tmp_fontStyle != map.end()) { + fromRawValue(context, tmp_fontStyle->second, result.fontStyle); + } + auto tmp_fontVariant = map.find("fontVariant"); + if (tmp_fontVariant != map.end()) { + fromRawValue(context, tmp_fontVariant->second, result.fontVariant); + } + auto tmp_fontWeight = map.find("fontWeight"); + if (tmp_fontWeight != map.end()) { + fromRawValue(context, tmp_fontWeight->second, result.fontWeight); + } + auto tmp_fontStretch = map.find("fontStretch"); + if (tmp_fontStretch != map.end()) { + fromRawValue(context, tmp_fontStretch->second, result.fontStretch); + } + auto tmp_fontSize = map.find("fontSize"); + if (tmp_fontSize != map.end()) { + fromRawValue(context, tmp_fontSize->second, result.fontSize); + } + auto tmp_fontFamily = map.find("fontFamily"); + if (tmp_fontFamily != map.end()) { + fromRawValue(context, tmp_fontFamily->second, result.fontFamily); + } + auto tmp_textAnchor = map.find("textAnchor"); + if (tmp_textAnchor != map.end()) { + fromRawValue(context, tmp_textAnchor->second, result.textAnchor); + } + auto tmp_textDecoration = map.find("textDecoration"); + if (tmp_textDecoration != map.end()) { + fromRawValue(context, tmp_textDecoration->second, result.textDecoration); + } + auto tmp_letterSpacing = map.find("letterSpacing"); + if (tmp_letterSpacing != map.end()) { + fromRawValue(context, tmp_letterSpacing->second, result.letterSpacing); + } + auto tmp_wordSpacing = map.find("wordSpacing"); + if (tmp_wordSpacing != map.end()) { + fromRawValue(context, tmp_wordSpacing->second, result.wordSpacing); + } + auto tmp_kerning = map.find("kerning"); + if (tmp_kerning != map.end()) { + fromRawValue(context, tmp_kerning->second, result.kerning); + } + auto tmp_fontFeatureSettings = map.find("fontFeatureSettings"); + if (tmp_fontFeatureSettings != map.end()) { + fromRawValue(context, tmp_fontFeatureSettings->second, result.fontFeatureSettings); + } + auto tmp_fontVariantLigatures = map.find("fontVariantLigatures"); + if (tmp_fontVariantLigatures != map.end()) { + fromRawValue(context, tmp_fontVariantLigatures->second, result.fontVariantLigatures); + } + auto tmp_fontVariationSettings = map.find("fontVariationSettings"); + if (tmp_fontVariationSettings != map.end()) { + fromRawValue(context, tmp_fontVariationSettings->second, result.fontVariationSettings); + } +} + +static inline std::string toString(const RNSVGTSpanFontStruct &value) { return "[Object RNSVGTSpanFontStruct]"; } +class JSI_EXPORT RNSVGTSpanProps final : public ViewProps { +public: + RNSVGTSpanProps() = default; + RNSVGTSpanProps(const PropsParserContext &context, const RNSVGTSpanProps &sourceProps, const RawProps &rawProps); + +#pragma mark - Props + + std::string name{}; + Float opacity{1.0}; + std::vector matrix{}; + std::string mask{}; + std::string markerStart{}; + std::string markerMid{}; + std::string markerEnd{}; + std::string clipPath{}; + int clipRule{0}; + bool responsible{false}; + std::string display{}; + std::string pointerEvents{}; + RNSVGTSpanFillStruct fill{}; + Float fillOpacity{1.0}; + int fillRule{1}; + RNSVGTSpanStrokeStruct stroke{}; + Float strokeOpacity{1.0}; + std::string strokeWidth{"1"}; + int strokeLinecap{0}; + int strokeLinejoin{0}; + std::vector strokeDasharray{}; + Float strokeDashoffset{0.0}; + Float strokeMiterlimit{0.0}; + int vectorEffect{0}; + std::vector propList{}; + std::string fontSize{}; + std::string fontWeight{}; + RNSVGTSpanFontStruct font{}; + std::vector dx{}; + std::vector dy{}; + std::vector x{}; + std::vector y{}; + std::vector rotate{}; + std::string inlineSize{}; + std::string textLength{}; + std::string baselineShift{}; + std::string lengthAdjust{}; + std::string alignmentBaseline{}; + std::string verticalAlign{}; + std::string content{}; +}; + +struct RNSVGUseFillStruct { + int type; + SharedColor payload; + std::string brushRef; +}; + +static inline void fromRawValue(const PropsParserContext &context, const RawValue &value, RNSVGUseFillStruct &result) { + auto map = (butter::map)value; + + auto tmp_type = map.find("type"); + if (tmp_type != map.end()) { + fromRawValue(context, tmp_type->second, result.type); + } + auto tmp_payload = map.find("payload"); + if (tmp_payload != map.end()) { + fromRawValue(context, tmp_payload->second, result.payload); + } + auto tmp_brushRef = map.find("brushRef"); + if (tmp_brushRef != map.end()) { + fromRawValue(context, tmp_brushRef->second, result.brushRef); + } +} + +static inline std::string toString(const RNSVGUseFillStruct &value) { return "[Object RNSVGUseFillStruct]"; } + +struct RNSVGUseStrokeStruct { + int type; + SharedColor payload; + std::string brushRef; +}; + +static inline void fromRawValue(const PropsParserContext &context, const RawValue &value, + RNSVGUseStrokeStruct &result) { + auto map = (butter::map)value; + + auto tmp_type = map.find("type"); + if (tmp_type != map.end()) { + fromRawValue(context, tmp_type->second, result.type); + } + auto tmp_payload = map.find("payload"); + if (tmp_payload != map.end()) { + fromRawValue(context, tmp_payload->second, result.payload); + } + auto tmp_brushRef = map.find("brushRef"); + if (tmp_brushRef != map.end()) { + fromRawValue(context, tmp_brushRef->second, result.brushRef); + } +} + +static inline std::string toString(const RNSVGUseStrokeStruct &value) { return "[Object RNSVGUseStrokeStruct]"; } +class JSI_EXPORT RNSVGUseProps final : public ViewProps { +public: + RNSVGUseProps() = default; + RNSVGUseProps(const PropsParserContext &context, const RNSVGUseProps &sourceProps, const RawProps &rawProps); + +#pragma mark - Props + + std::string name{}; + Float opacity{1.0}; + std::vector matrix{}; + std::string mask{}; + std::string markerStart{}; + std::string markerMid{}; + std::string markerEnd{}; + std::string clipPath{}; + int clipRule{0}; + bool responsible{false}; + std::string display{}; + std::string pointerEvents{}; + RNSVGUseFillStruct fill{}; + Float fillOpacity{1.0}; + int fillRule{1}; + RNSVGUseStrokeStruct stroke{}; + Float strokeOpacity{1.0}; + std::string strokeWidth{"1"}; + int strokeLinecap{0}; + int strokeLinejoin{0}; + std::vector strokeDasharray{}; + Float strokeDashoffset{0.0}; + Float strokeMiterlimit{0.0}; + int vectorEffect{0}; + std::vector propList{}; + std::string href{}; + std::string x{}; + std::string y{}; + std::string height{}; + std::string width{}; +}; + +} // namespace react +} // namespace facebook \ No newline at end of file diff --git a/tester/harmony/svg/src/main/cpp/SVGPackage.cpp b/tester/harmony/svg/src/main/cpp/SVGPackage.cpp new file mode 100644 index 0000000000000000000000000000000000000000..0a6d4c5beed1657a54da1a5b49de72524289246e --- /dev/null +++ b/tester/harmony/svg/src/main/cpp/SVGPackage.cpp @@ -0,0 +1,136 @@ +/** + * MIT License + * + * Copyright (C) 2023 Huawei Device Co., Ltd. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +#pragma once + +#include "SVGPackage.h" + +#include "componentBinders/RNSVGGroupJSIBinder.h" +#include "componentBinders/RNSVGSvgViewJSIBinder.h" +#include "componentBinders/RNSVGPathJSIBinder.h" +#include "componentBinders/RNSVGRectJSIBinder.h" +#include "componentBinders/RNSVGImageJSIBinder.h" +#include "componentBinders/RNSVGCircleJSIBinder.h" +#include "componentBinders/RNSVGEllipseJSIBinder.h" +#include "componentBinders/RNSVGLinearGradientJSIBinder.h" +#include "componentBinders/RNSVGDefsJSIBinder.h" +#include "componentBinders/RNSVGTextJSIBinder.h" +#include "componentBinders/RNSVGTSpanJSIBinder.h" +#include "componentBinders/RNSVGClipPathJSIBinder.h" +#include "componentBinders/RNSVGMaskJSIBinder.h" +#include "componentBinders/RNSVGMarkerJSIBinder.h" +#include "componentBinders/RNSVGUseJSIBinder.h" +#include "componentBinders/RNSVGForeignObjectJSIBinder.h" +#include "componentBinders/RNSVGLineJSIBinder.h" +#include "componentBinders/RNSVGPatternJSIBinder.h" +#include "componentBinders/RNSVGRadialGradientJSIBinder.h" +#include "componentBinders/RNSVGSymbolJSIBinder.h" +#include "componentBinders/RNSVGTextPathJSIBinder.h" +#include "turboModules/RNSVGSvgViewModule.h" +#include "turboModules/RNSVGRenderableModule.h" +#include "turboModules/RNSVGImageModule.h" +#include "ComponentDescriptors.h" +#include "svgImage/RNSVGImageComponentDescriptor.h" + +using namespace rnoh; +using namespace facebook; +using namespace svg; + +std::vector SVGPackage::createComponentDescriptorProviders() { + return { + facebook::react::concreteComponentDescriptorProvider(), + facebook::react::concreteComponentDescriptorProvider(), + facebook::react::concreteComponentDescriptorProvider(), + facebook::react::concreteComponentDescriptorProvider(), + facebook::react::concreteComponentDescriptorProvider(), + facebook::react::concreteComponentDescriptorProvider(), + facebook::react::concreteComponentDescriptorProvider(), + facebook::react::concreteComponentDescriptorProvider(), + facebook::react::concreteComponentDescriptorProvider(), + facebook::react::concreteComponentDescriptorProvider(), + facebook::react::concreteComponentDescriptorProvider(), + facebook::react::concreteComponentDescriptorProvider(), + facebook::react::concreteComponentDescriptorProvider(), + facebook::react::concreteComponentDescriptorProvider(), + facebook::react::concreteComponentDescriptorProvider(), + facebook::react::concreteComponentDescriptorProvider(), + facebook::react::concreteComponentDescriptorProvider(), + facebook::react::concreteComponentDescriptorProvider(), + facebook::react::concreteComponentDescriptorProvider(), + facebook::react::concreteComponentDescriptorProvider(), + facebook::react::concreteComponentDescriptorProvider(), + }; +} + +ComponentNapiBinderByString SVGPackage::createComponentNapiBinderByName() +{ + return {}; +} + +ComponentJSIBinderByString SVGPackage::createComponentJSIBinderByName() { + return { + {"RNSVGCircle", std::make_shared()}, + {"RNSVGClipPath", std::make_shared()}, + {"RNSVGDefs", std::make_shared()}, + {"RNSVGEllipse", std::make_shared()}, + {"RNSVGForeignObject", std::make_shared()}, + {"RNSVGGroup", std::make_shared()}, + {"RNSVGSvgView", std::make_shared()}, + {"RNSVGImage", std::make_shared()}, + {"RNSVGLine", std::make_shared()}, + {"RNSVGLinearGradient", std::make_shared()}, + {"RNSVGRadialGradient", std::make_shared()}, + {"RNSVGMarker", std::make_shared()}, + {"RNSVGMask", std::make_shared()}, + {"RNSVGPath", std::make_shared()}, + {"RNSVGPattern", std::make_shared()}, + {"RNSVGRadialGradient", std::make_shared()}, + {"RNSVGRect", std::make_shared()}, + {"RNSVGSymbol", std::make_shared()}, + {"RNSVGTSpan", std::make_shared()}, + {"RNSVGText", std::make_shared()}, + {"RNSVGTextPath", std::make_shared()}, + {"RNSVGUse", std::make_shared()}, + }; +}; + +class SvgTurboModuleFactoryDelegate : public TurboModuleFactoryDelegate { +public: + SharedTurboModule createTurboModule(Context ctx, const std::string &name) const override { + if (name == "RNSVGSvgViewModule") { + return std::make_shared(ctx, name); + } + if (name == "RNSVGRenderableModule") { + return std::make_shared(ctx, name); + } + if (name == "RNSVGImageModule") { + return std::make_shared(ctx, name); + } + return nullptr; + }; +}; + +std::unique_ptr SVGPackage::createTurboModuleFactoryDelegate() { + return std::make_unique(); +} \ No newline at end of file diff --git a/tester/harmony/svg/src/main/cpp/SVGPackage.h b/tester/harmony/svg/src/main/cpp/SVGPackage.h new file mode 100644 index 0000000000000000000000000000000000000000..f362566f4114a0645f9d48861b5cbf97037539dc --- /dev/null +++ b/tester/harmony/svg/src/main/cpp/SVGPackage.h @@ -0,0 +1,144 @@ +/** + * MIT License + * + * Copyright (C) 2023 Huawei Device Co., Ltd. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +#pragma once +#include "RNOH/Package.h" +#include +#include "componentInstances/RNSVGSvgViewComponentInstance.h" +#include "componentInstances/RNSVGCircleComponentInstance.h" +#include "componentInstances/RNSVGGroupComponentInstance.h" +#include "componentInstances/RNSVGPathComponentInstance.h" +#include "componentInstances/RNSVGRectComponentInstance.h" +#include "componentInstances/RNSVGImageComponentInstance.h" +#include "componentInstances/RNSVGEllipseComponentInstance.h" +#include "componentInstances/RNSVGLinearGradientComponentInstance.h" +#include "componentInstances/RNSVGRadialGradientComponentInstance.h" +#include "componentInstances/RNSVGLineComponentInstance.h" +#include "componentInstances/RNSVGDefsComponentInstance.h" +#include "componentInstances/RNSVGTextComponentInstance.h" +#include "componentInstances/RNSVGTextPathComponentInstance.h" +#include "componentInstances/RNSVGTSpanComponentInstance.h" +#include "componentInstances/RNSVGClipPathComponentInstance.h" +#include "componentInstances/RNSVGMaskComponentInstance.h" +#include "componentInstances/RNSVGUseComponentInstance.h" +#include "componentInstances/RNSVGMarkerComponentInstance.h" +#include "componentInstances/RNSVGPatternComponentInstance.h" +#include "componentInstances/RNSVGSymbolComponentInstance.h" + + +using namespace rnoh; +using namespace facebook; +using namespace svg; + +namespace rnoh { + +class SVGPackageComponentInstanceFactoryDelegate : public ComponentInstanceFactoryDelegate { +public: + using ComponentInstanceFactoryDelegate::ComponentInstanceFactoryDelegate; + + ComponentInstance::Shared create(ComponentInstance::Context ctx) override { + DLOG(INFO) << "[SVGPackageComponentInstanceFactoryDelegate] create componentName= " << ctx.componentName; + if (ctx.componentName == "RNSVGSvgView") { + return std::make_shared(std::move(ctx)); + } + if (ctx.componentName == "RNSVGCircle") { + return std::make_shared(std::move(ctx)); + } + if (ctx.componentName == "RNSVGGroup") { + return std::make_shared(std::move(ctx)); + } + if (ctx.componentName == "RNSVGPath") { + return std::make_shared(std::move(ctx)); + } + if (ctx.componentName == "RNSVGRect") { + return std::make_shared(std::move(ctx)); + } + if (ctx.componentName == "RNSVGImage") { + return std::make_shared(std::move(ctx)); + } + if (ctx.componentName == "RNSVGEllipse") { + return std::make_shared(std::move(ctx)); + } + if (ctx.componentName == "RNSVGLinearGradient") { + return std::make_shared(std::move(ctx)); + } + if (ctx.componentName == "RNSVGRadialGradient") { + return std::make_shared(std::move(ctx)); + } + if (ctx.componentName == "RNSVGLine") { + return std::make_shared(std::move(ctx)); + } + if (ctx.componentName == "RNSVGDefs") { + return std::make_shared(std::move(ctx)); + } + if (ctx.componentName == "RNSVGText") { + return std::make_shared(std::move(ctx)); + } + if (ctx.componentName == "RNSVGTSpan") { + return std::make_shared(std::move(ctx)); + } + if (ctx.componentName == "RNSVGTextPath") { + return std::make_shared(std::move(ctx)); + } + if (ctx.componentName == "RNSVGClipPath") { + return std::make_shared(std::move(ctx)); + } + if (ctx.componentName == "RNSVGMask") { + return std::make_shared(std::move(ctx)); + } + if (ctx.componentName == "RNSVGUse") { + return std::make_shared(std::move(ctx)); + } + if (ctx.componentName == "RNSVGMarker") { + return std::make_shared(std::move(ctx)); + } + if (ctx.componentName == "RNSVGPattern") { + return std::make_shared(std::move(ctx)); + } + if (ctx.componentName == "RNSVGSymbol") { + return std::make_shared(std::move(ctx)); + } + return nullptr; + } +}; + +class SVGPackage : public Package { +public: + explicit SVGPackage(Package::Context ctx) : Package(ctx) {} + + std::unique_ptr createTurboModuleFactoryDelegate() + override; + + ComponentInstanceFactoryDelegate::Shared createComponentInstanceFactoryDelegate() override { + return std::make_shared(); + } + + std::vector createComponentDescriptorProviders() override; + + ComponentNapiBinderByString createComponentNapiBinderByName() override; + + ComponentJSIBinderByString createComponentJSIBinderByName() override; +}; + +} // namespace rnoh \ No newline at end of file diff --git a/tester/harmony/svg/src/main/cpp/States.cpp b/tester/harmony/svg/src/main/cpp/States.cpp new file mode 100644 index 0000000000000000000000000000000000000000..62a093d3f94cdfe0753cc58da8a4439a119ae4f9 --- /dev/null +++ b/tester/harmony/svg/src/main/cpp/States.cpp @@ -0,0 +1,18 @@ + +/** + * This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen). + * + * Do not edit this file as changes may cause incorrect behavior and will be lost + * once the code is regenerated. + * + * @generated by codegen project: GenerateStateCpp.js + */ +#include "States.h" + +namespace facebook { +namespace react { + + + +} // namespace react +} // namespace facebook diff --git a/tester/harmony/svg/src/main/cpp/States.h b/tester/harmony/svg/src/main/cpp/States.h new file mode 100644 index 0000000000000000000000000000000000000000..ed0f9a484b7721081d611e102cc5d19894b0cdab --- /dev/null +++ b/tester/harmony/svg/src/main/cpp/States.h @@ -0,0 +1,337 @@ +/** + * This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen). + * + * Do not edit this file as changes may cause incorrect behavior and will be lost + * once the code is regenerated. + * + * @generated by codegen project: GenerateStateH.js + */ +#pragma once + +#ifdef ANDROID +#include +#include +#include +#endif + +namespace facebook { +namespace react { + +class RNSVGSvgViewAndroidState { +public: + RNSVGSvgViewAndroidState() = default; + +#ifdef ANDROID + RNSVGSvgViewAndroidState(RNSVGSvgViewAndroidState const &previousState, folly::dynamic data){}; + folly::dynamic getDynamic() const { + return {}; + }; + MapBuffer getMapBuffer() const { + return MapBufferBuilder::EMPTY(); + }; +#endif +}; + +class RNSVGCircleState { +public: + RNSVGCircleState() = default; + +#ifdef ANDROID + RNSVGCircleState(RNSVGCircleState const &previousState, folly::dynamic data){}; + folly::dynamic getDynamic() const { + return {}; + }; + MapBuffer getMapBuffer() const { + return MapBufferBuilder::EMPTY(); + }; +#endif +}; + +class RNSVGClipPathState { +public: + RNSVGClipPathState() = default; + +#ifdef ANDROID + RNSVGClipPathState(RNSVGClipPathState const &previousState, folly::dynamic data){}; + folly::dynamic getDynamic() const { + return {}; + }; + MapBuffer getMapBuffer() const { + return MapBufferBuilder::EMPTY(); + }; +#endif +}; + +class RNSVGDefsState { +public: + RNSVGDefsState() = default; + +#ifdef ANDROID + RNSVGDefsState(RNSVGDefsState const &previousState, folly::dynamic data){}; + folly::dynamic getDynamic() const { + return {}; + }; + MapBuffer getMapBuffer() const { + return MapBufferBuilder::EMPTY(); + }; +#endif +}; + +class RNSVGEllipseState { +public: + RNSVGEllipseState() = default; + +#ifdef ANDROID + RNSVGEllipseState(RNSVGEllipseState const &previousState, folly::dynamic data){}; + folly::dynamic getDynamic() const { + return {}; + }; + MapBuffer getMapBuffer() const { + return MapBufferBuilder::EMPTY(); + }; +#endif +}; + +class RNSVGForeignObjectState { +public: + RNSVGForeignObjectState() = default; + +#ifdef ANDROID + RNSVGForeignObjectState(RNSVGForeignObjectState const &previousState, folly::dynamic data){}; + folly::dynamic getDynamic() const { + return {}; + }; + MapBuffer getMapBuffer() const { + return MapBufferBuilder::EMPTY(); + }; +#endif +}; + +class RNSVGGroupState { +public: + RNSVGGroupState() = default; + +#ifdef ANDROID + RNSVGGroupState(RNSVGGroupState const &previousState, folly::dynamic data){}; + folly::dynamic getDynamic() const { + return {}; + }; + MapBuffer getMapBuffer() const { + return MapBufferBuilder::EMPTY(); + }; +#endif +}; + +class RNSVGSvgViewState { +public: + RNSVGSvgViewState() = default; + +#ifdef ANDROID + RNSVGSvgViewState(RNSVGSvgViewState const &previousState, folly::dynamic data){}; + folly::dynamic getDynamic() const { + return {}; + }; + MapBuffer getMapBuffer() const { + return MapBufferBuilder::EMPTY(); + }; +#endif +}; + +class RNSVGLinearGradientState { +public: + RNSVGLinearGradientState() = default; + +#ifdef ANDROID + RNSVGLinearGradientState(RNSVGLinearGradientState const &previousState, folly::dynamic data){}; + folly::dynamic getDynamic() const { + return {}; + }; + MapBuffer getMapBuffer() const { + return MapBufferBuilder::EMPTY(); + }; +#endif +}; + +class RNSVGLineState { +public: + RNSVGLineState() = default; + +#ifdef ANDROID + RNSVGLineState(RNSVGLineState const &previousState, folly::dynamic data){}; + folly::dynamic getDynamic() const { + return {}; + }; + MapBuffer getMapBuffer() const { + return MapBufferBuilder::EMPTY(); + }; +#endif +}; + +class RNSVGMarkerState { +public: + RNSVGMarkerState() = default; + +#ifdef ANDROID + RNSVGMarkerState(RNSVGMarkerState const &previousState, folly::dynamic data){}; + folly::dynamic getDynamic() const { + return {}; + }; + MapBuffer getMapBuffer() const { + return MapBufferBuilder::EMPTY(); + }; +#endif +}; + +class RNSVGMaskState { +public: + RNSVGMaskState() = default; + +#ifdef ANDROID + RNSVGMaskState(RNSVGMaskState const &previousState, folly::dynamic data){}; + folly::dynamic getDynamic() const { + return {}; + }; + MapBuffer getMapBuffer() const { + return MapBufferBuilder::EMPTY(); + }; +#endif +}; + +class RNSVGPathState { +public: + RNSVGPathState() = default; + +#ifdef ANDROID + RNSVGPathState(RNSVGPathState const &previousState, folly::dynamic data){}; + folly::dynamic getDynamic() const { + return {}; + }; + MapBuffer getMapBuffer() const { + return MapBufferBuilder::EMPTY(); + }; +#endif +}; + +class RNSVGPatternState { +public: + RNSVGPatternState() = default; + +#ifdef ANDROID + RNSVGPatternState(RNSVGPatternState const &previousState, folly::dynamic data){}; + folly::dynamic getDynamic() const { + return {}; + }; + MapBuffer getMapBuffer() const { + return MapBufferBuilder::EMPTY(); + }; +#endif +}; + +class RNSVGRadialGradientState { +public: + RNSVGRadialGradientState() = default; + +#ifdef ANDROID + RNSVGRadialGradientState(RNSVGRadialGradientState const &previousState, folly::dynamic data){}; + folly::dynamic getDynamic() const { + return {}; + }; + MapBuffer getMapBuffer() const { + return MapBufferBuilder::EMPTY(); + }; +#endif +}; + +class RNSVGRectState { +public: + RNSVGRectState() = default; + +#ifdef ANDROID + RNSVGRectState(RNSVGRectState const &previousState, folly::dynamic data){}; + folly::dynamic getDynamic() const { + return {}; + }; + MapBuffer getMapBuffer() const { + return MapBufferBuilder::EMPTY(); + }; +#endif +}; + +class RNSVGSymbolState { +public: + RNSVGSymbolState() = default; + +#ifdef ANDROID + RNSVGSymbolState(RNSVGSymbolState const &previousState, folly::dynamic data){}; + folly::dynamic getDynamic() const { + return {}; + }; + MapBuffer getMapBuffer() const { + return MapBufferBuilder::EMPTY(); + }; +#endif +}; + +class RNSVGTextState { +public: + RNSVGTextState() = default; + +#ifdef ANDROID + RNSVGTextState(RNSVGTextState const &previousState, folly::dynamic data){}; + folly::dynamic getDynamic() const { + return {}; + }; + MapBuffer getMapBuffer() const { + return MapBufferBuilder::EMPTY(); + }; +#endif +}; + +class RNSVGTextPathState { +public: + RNSVGTextPathState() = default; + +#ifdef ANDROID + RNSVGTextPathState(RNSVGTextPathState const &previousState, folly::dynamic data){}; + folly::dynamic getDynamic() const { + return {}; + }; + MapBuffer getMapBuffer() const { + return MapBufferBuilder::EMPTY(); + }; +#endif +}; + +class RNSVGTSpanState { +public: + RNSVGTSpanState() = default; + +#ifdef ANDROID + RNSVGTSpanState(RNSVGTSpanState const &previousState, folly::dynamic data){}; + folly::dynamic getDynamic() const { + return {}; + }; + MapBuffer getMapBuffer() const { + return MapBufferBuilder::EMPTY(); + }; +#endif +}; + +class RNSVGUseState { +public: + RNSVGUseState() = default; + +#ifdef ANDROID + RNSVGUseState(RNSVGUseState const &previousState, folly::dynamic data){}; + folly::dynamic getDynamic() const { + return {}; + }; + MapBuffer getMapBuffer() const { + return MapBufferBuilder::EMPTY(); + }; +#endif +}; + + +} // namespace react +} // namespace facebook \ No newline at end of file diff --git a/tester/harmony/svg/src/main/cpp/SvgArkUINode.cpp b/tester/harmony/svg/src/main/cpp/SvgArkUINode.cpp new file mode 100644 index 0000000000000000000000000000000000000000..bb84e4bdcf85f7ce0f80c08d2aac0c12adacbcfa --- /dev/null +++ b/tester/harmony/svg/src/main/cpp/SvgArkUINode.cpp @@ -0,0 +1,68 @@ +#include "arkui/native_interface.h" +#include "arkui/native_node.h" +#include "arkui/native_type.h" +#include "RNOH/arkui/NativeNodeApi.h" +#include "SvgArkUINode.h" +#include +#include +#include +#include +#include +#include +#include "SvgViewManager.h" + +namespace rnoh { +namespace svg { + +// 对应SVGArkUINode +SvgArkUINode::SvgArkUINode() : ArkUINode(NativeNodeApi::getInstance()->createNode(ArkUI_NodeType::ARKUI_NODE_CUSTOM)) { + userCallback_ = new UserCallback(); + // 设置自定义回调。注册onDraw + userCallback_->callback = [this](ArkUI_NodeCustomEvent *event) { + auto type = OH_ArkUI_NodeCustomEvent_GetEventType(event); + switch (type) { + case ARKUI_NODE_CUSTOM_EVENT_ON_DRAW: + OnDraw(event); + break; + default: + break; + } + }; + eventReceiver = [](ArkUI_NodeCustomEvent *event) { + if (OH_ArkUI_NodeCustomEvent_GetEventTargetId(event) == 77) { + auto *userData = reinterpret_cast(OH_ArkUI_NodeCustomEvent_GetUserData(event)); + if (userData != nullptr && userData->callback != nullptr) { + userData->callback(event); + } + } + }; + maybeThrow(NativeNodeApi::getInstance()->addNodeCustomEventReceiver(m_nodeHandle, eventReceiver)); + maybeThrow(NativeNodeApi::getInstance()->registerNodeCustomEvent(m_nodeHandle, ARKUI_NODE_CUSTOM_EVENT_ON_DRAW, 77, + userCallback_)); +} + +SvgArkUINode::~SvgArkUINode() { + NativeNodeApi::getInstance()->removeNodeCustomEventReceiver(m_nodeHandle, eventReceiver); + NativeNodeApi::getInstance()->unregisterNodeCustomEvent(m_nodeHandle, ARKUI_NODE_CUSTOM_EVENT_ON_DRAW); + delete userCallback_; + userCallback_ = nullptr; +} + +void SvgArkUINode::OnDraw(ArkUI_NodeCustomEvent *event) { + auto *drawContext = OH_ArkUI_NodeCustomEvent_GetDrawContextInDraw(event); + auto *drawingHandle = reinterpret_cast(OH_ArkUI_DrawContext_GetCanvas(drawContext)); + DLOG(INFO) << "[svg] CanvasGetHeight: " << OH_Drawing_CanvasGetHeight(drawingHandle); + DLOG(INFO) << "[svg] CanvasGetWidth: " << OH_Drawing_CanvasGetWidth(drawingHandle); + auto root = root_.lock(); + CHECK_NULL_VOID(root); + if (root->GetContext()) { + // reset the idMap + root->GetContext()->ClearIdMap(); + } + root->ContextTraversal(); + root->InitStyle({}); + root->Draw(drawingHandle); +} + +} // namespace svg +} // namespace rnoh diff --git a/tester/harmony/svg/src/main/cpp/SvgArkUINode.h b/tester/harmony/svg/src/main/cpp/SvgArkUINode.h new file mode 100644 index 0000000000000000000000000000000000000000..305fee11cf8a7b46dbf013d7ac3d64babf67355f --- /dev/null +++ b/tester/harmony/svg/src/main/cpp/SvgArkUINode.h @@ -0,0 +1,38 @@ +#pragma once +#include "SvgNode.h" +#include "SvgHost.h" +#include "RNOH/arkui/ArkUINode.h" +#include "arkui/native_node.h" + +namespace rnoh { +namespace svg { + +struct UserCallback { + std::function callback; +}; + +// ArkUINode +class SvgArkUINode : public ArkUINode { +private: + void OnDraw(ArkUI_NodeCustomEvent *event); + + std::weak_ptr root_; + ArkUI_NativeNodeAPI_1 *nativeModule_ = nullptr; + UserCallback *userCallback_ = nullptr; + void (*eventReceiver)(ArkUI_NodeCustomEvent *event); + +public: + SvgArkUINode(); + ~SvgArkUINode() override; + + void SetSvgNode(const std::weak_ptr& node) + { + root_ = node; + } + void ResetNodeHandle() { + + } +}; + +} // namespace svg +} // namespace rnoh \ No newline at end of file diff --git a/tester/harmony/svg/src/main/cpp/SvgBaseAttribute.h b/tester/harmony/svg/src/main/cpp/SvgBaseAttribute.h new file mode 100644 index 0000000000000000000000000000000000000000..ed428ec9a8937d5e28a1620071d75b7c92720f6f --- /dev/null +++ b/tester/harmony/svg/src/main/cpp/SvgBaseAttribute.h @@ -0,0 +1,152 @@ +// from ArkUI "frameworks/core/components/declaration/svg/svg_base_declaration.h" +#pragma once + +#include "Attribute.h" +#include "properties/SvgPaintState.h" +#include +#include + +namespace rnoh { +namespace svg { + +const char VALUE_NONE[] = "none"; + +struct SvgBaseAttribute : Attribute { + double selfOpacity = 1.0; // opacity declared in tag attribute + double opacity = 1.0; // multiplied with parent opacity. The actual opacity to be drawn + float smoothEdge = 0.0f; + FillState fillState; + StrokeState strokeState; +// SvgTextStyle textStyle; + std::vector transform; // transform matrix + std::string transformOrigin; + std::string filterId; + std::string maskId; + std::string id; + std::string markerStart; + std::string markerMid; + std::string markerEnd; + std::string clipPath; + ClipState clipState; + + void InheritFromUse(const SvgBaseAttribute& parent) + { + opacity = selfOpacity * parent.opacity; + fillState.Inherit(parent.fillState); + strokeState.Inherit(parent.strokeState); + clipState.Inherit(parent.clipState); + } + + void Inherit(const SvgBaseAttribute& parent) + { + opacity = selfOpacity * parent.opacity; + fillState.Inherit(parent.fillState); + strokeState.Inherit(parent.strokeState); + clipState.Inherit(parent.clipState); + } +}; + +// class SvgBaseDeclaration : public Declaration { +// DECLARE_ACE_TYPE(SvgBaseDeclaration, Declaration); +// +// public: +// SvgBaseDeclaration() = default; +// ~SvgBaseDeclaration() override = default; +// +// const FillState& GetFillState() const +// { +// auto& attribute = static_cast(GetAttribute(AttributeTag::SPECIALIZED_ATTR)); +// return attribute.fillState; +// } +// +// const StrokeState& GetStrokeState() const +// { +// auto& attribute = static_cast(GetAttribute(AttributeTag::SPECIALIZED_ATTR)); +// return attribute.strokeState; +// } +// +// const SvgTextStyle& GetSvgTextStyle() const +// { +// auto& attribute = static_cast(GetAttribute(AttributeTag::SPECIALIZED_ATTR)); +// return attribute.textStyle; +// } +// +// const std::string& GetTransform() const +// { +// auto& attribute = static_cast(GetAttribute(AttributeTag::SPECIALIZED_ATTR)); +// return attribute.transform; +// } +// +// const std::string& GetMaskId() const +// { +// auto& attribute = static_cast(GetAttribute(AttributeTag::SPECIALIZED_ATTR)); +// return attribute.maskId; +// } +// +// const std::string& GetFilterId() const +// { +// auto& attribute = static_cast(GetAttribute(AttributeTag::SPECIALIZED_ATTR)); +// return attribute.filterId; +// } +// +// const std::string& GetTransformOrigin() const +// { +// auto& attribute = static_cast(GetAttribute(AttributeTag::SPECIALIZED_ATTR)); +// return attribute.transformOrigin; +// } +// +// bool HasOpacity() const +// { +// auto& attribute = static_cast(GetAttribute(AttributeTag::SPECIALIZED_ATTR)); +// return attribute.hasOpacity; +// } +// +// double GetOpacity() const +// { +// auto& attribute = static_cast(GetAttribute(AttributeTag::SPECIALIZED_ATTR)); +// return attribute.opacity; +// } +// +// void Inherit(const RefPtr& parent); +// +// void SetGradient(const Gradient& gradient) +// { +// auto& attribute = static_cast(GetAttribute(AttributeTag::SPECIALIZED_ATTR)); +// attribute.fillState.SetGradient(gradient); +// } +// +// const std::string& GetClipPathHref() const +// { +// auto& attribute = static_cast(GetAttribute(AttributeTag::SPECIALIZED_ATTR)); +// return attribute.clipState.GetHref(); +// } +// +// +// const ClipState& GetClipState() const +// { +// auto& attribute = static_cast(GetAttribute(AttributeTag::SPECIALIZED_ATTR)); +// return attribute.clipState; +// } +// +// const std::string& GetId() +// { +// auto& commonAttr = MaybeResetAttribute(AttributeTag::COMMON_ATTR); +// return commonAttr.id; +// } +// +// LineCapStyle GetLineCapStyle(const std::string& val) const; +// LineJoinStyle GetLineJoinStyle(const std::string& val) const; +// Color GetColor(const std::string& value) const; +// +// bool SetSpecializedAttr(const std::pair& attr) override; +// +// void ReplaceAttributes(const SvgBaseAttribute& attr); +// +// protected: +// void InitSpecialized() override; +// bool SetSpecializedStyle(const std::pair& style) override; +// bool SetPresentationAttr(const std::pair& attr); +// }; + +} // namespace svg +} // namespace rnoh diff --git a/tester/harmony/svg/src/main/cpp/SvgCircle.cpp b/tester/harmony/svg/src/main/cpp/SvgCircle.cpp new file mode 100644 index 0000000000000000000000000000000000000000..e55979b39d1791ca94446b911103291df560d6cc --- /dev/null +++ b/tester/harmony/svg/src/main/cpp/SvgCircle.cpp @@ -0,0 +1,38 @@ +/* + * Copyright (c) 2022-2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "SvgCircle.h" + +namespace rnoh { +namespace svg { + +drawing::Path SvgCircle::AsPath() { + drawing::Path path; + double x = relativeOnWidth(circleAttribute_.cx); + double y = relativeOnHeight(circleAttribute_.cy); + double r = relativeOnOther(circleAttribute_.r); + + path.AddCircle(x, y, r, PATH_DIRECTION_CW); + + elements_ = {PathElement(ElementType::kCGPathElementMoveToPoint, {Point(x, y - r)}), + PathElement(ElementType::kCGPathElementAddLineToPoint, {Point(x, y - r), Point(x + r, y)}), + PathElement(ElementType::kCGPathElementAddLineToPoint, {Point(x + r, y), Point(x, y + r)}), + PathElement(ElementType::kCGPathElementAddLineToPoint, {Point(x, y + r), Point(x - r, y)}), + PathElement(ElementType::kCGPathElementAddLineToPoint, {Point(x - r, y), Point(x, y - r)})}; + return path; +} + +} // namespace svg +} // namespace rnoh diff --git a/tester/harmony/svg/src/main/cpp/SvgCircle.h b/tester/harmony/svg/src/main/cpp/SvgCircle.h new file mode 100644 index 0000000000000000000000000000000000000000..3a3b3de09fc6abc6cc58de53394a9ade81a7cba1 --- /dev/null +++ b/tester/harmony/svg/src/main/cpp/SvgCircle.h @@ -0,0 +1,38 @@ +/* + * Copyright (c) 2022-2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +#include "SvgGraphic.h" +#include "utils/SvgAttributesParser.h" + +namespace rnoh { +namespace svg { + +class SvgCircle : public SvgGraphic { +public: + SvgCircle() = default; + ~SvgCircle() override = default; + + void SetX(const std::string &x) { circleAttribute_.cx = SvgAttributesParser::ParseDimension(x, true); } + void SetY(const std::string &y) { circleAttribute_.cy = SvgAttributesParser::ParseDimension(y, true); } + void SetR(const std::string &r) { circleAttribute_.r = SvgAttributesParser::ParseDimension(r, true); } + drawing::Path AsPath() override; +private: + SvgCircleAttribute circleAttribute_; +}; + +} // namespace svg +} // namespace rnoh diff --git a/tester/harmony/svg/src/main/cpp/SvgClipPath.h b/tester/harmony/svg/src/main/cpp/SvgClipPath.h new file mode 100644 index 0000000000000000000000000000000000000000..4096303f199b725dde0d6038c3f8084f9475aa7a --- /dev/null +++ b/tester/harmony/svg/src/main/cpp/SvgClipPath.h @@ -0,0 +1,16 @@ +#pragma once + +#include "SvgQuote.h" + +namespace rnoh { +namespace svg { + + class SvgClipPath : public SvgQuote { + + public: + SvgClipPath() = default; + ~SvgClipPath() override = default; + }; + +} // namespace svg +} // namespace rnoh \ No newline at end of file diff --git a/tester/harmony/svg/src/main/cpp/SvgContext.cpp b/tester/harmony/svg/src/main/cpp/SvgContext.cpp new file mode 100644 index 0000000000000000000000000000000000000000..6734754295dec4386ee46c38fcc808fa6844af79 --- /dev/null +++ b/tester/harmony/svg/src/main/cpp/SvgContext.cpp @@ -0,0 +1,47 @@ + +#include "SvgNode.h" + +namespace rnoh { +namespace svg { +std::shared_ptr SvgContext::GetSvgNodeById(const std::string &id) const { + auto item = idMapper_.find(id); + if (item != idMapper_.end()) { + return item->second.lock(); + } + return nullptr; +} + +void SvgContext::PushStyle(const std::string &styleName, const std::pair &attrPair) { + const auto &arrMapIter = styleMap_.find(styleName); + if (arrMapIter == styleMap_.end()) { + AttrMap attrMap; + attrMap.emplace(attrPair); + styleMap_.emplace(std::make_pair(styleName, attrMap)); + } else { + if (arrMapIter->second.find(attrPair.first) != arrMapIter->second.end()) { + arrMapIter->second.erase(attrPair.first); + } + arrMapIter->second.emplace(attrPair); + } +} + +const AttrMap &SvgContext::GetAttrMap(const std::string &key) const { + auto styleClassIter = styleMap_.find(key); + if (styleClassIter != styleMap_.end()) { + return styleClassIter->second; + } + static AttrMap emptyMap; + return emptyMap; +} + +const Rect &SvgContext::GetRootViewBox() const { + if (!rootViewBox_.IsValid()) { + static Rect rect; + rect = Rect(0, 0, svgSize_.Width(), svgSize_.Height()); + return rect; + } + return rootViewBox_; +} + +} // namespace svg +} // namespace rnoh diff --git a/tester/harmony/svg/src/main/cpp/SvgContext.h b/tester/harmony/svg/src/main/cpp/SvgContext.h new file mode 100644 index 0000000000000000000000000000000000000000..6ff4dbe15c01f6ea70bbd32bb47d1a6afe50444c --- /dev/null +++ b/tester/harmony/svg/src/main/cpp/SvgContext.h @@ -0,0 +1,64 @@ +#pragma once + +#include +#include +#include +#include "properties/Rect.h" +#include "properties/Size.h" +#include "properties/Color.h" + +namespace rnoh { +namespace svg { +using AttrMap = std::unordered_map; +using ClassStyleMap = std::unordered_map; +class SvgNode; +class SvgContext { +public: + void Push(const std::string &value, const std::shared_ptr &svgNode) { idMapper_.emplace(value, svgNode); } + + std::shared_ptr GetSvgNodeById(const std::string &id) const; + + void PushStyle(const std::string &styleName, const std::pair &attrPair); + + const AttrMap &GetAttrMap(const std::string &key) const; + + void SetRootViewBox(const Rect &viewBox) { rootViewBox_ = viewBox; } + + const Rect &GetRootViewBox() const; + + void SetSvgSize(const Size &size) { svgSize_ = size; } + + const Size &GetSvgSize() const { return svgSize_; } + + void SetSvgColor(const Color &svgColor) { svgColor_ = svgColor; } + + const Color &GetSvgColor() { return svgColor_; } + + void SetCanvasBounds(const Rect &canvasClipBounds) { canvasClipBounds_ = canvasClipBounds; } + + const Rect getCanvasBounds() { return canvasClipBounds_; } + + void SetCanvasScale(const double &canvasScaleX, const double &canvasScaleY) { + canvasScaleX_ = canvasScaleX; + canvasScaleY_ = canvasScaleY; + } + + const double getCanvasScaleX() { return canvasScaleX_; } + + const double getCanvasScaleY() { return canvasScaleY_; } + + void ClearIdMap() { idMapper_.clear(); } + +private: + std::unordered_map> idMapper_; + ClassStyleMap styleMap_; + Rect rootViewBox_; + Size svgSize_; + Color svgColor_; + Rect canvasClipBounds_; + double canvasScaleX_ = 1; + double canvasScaleY_ = 1; +}; + +} // namespace svg +} // namespace rnoh \ No newline at end of file diff --git a/tester/harmony/svg/src/main/cpp/SvgDefs.h b/tester/harmony/svg/src/main/cpp/SvgDefs.h new file mode 100644 index 0000000000000000000000000000000000000000..97b6f022c752503a5764cd44de91004b3aad07b4 --- /dev/null +++ b/tester/harmony/svg/src/main/cpp/SvgDefs.h @@ -0,0 +1,41 @@ +#pragma once + +#include +#include "SvgNode.h" +#include "SvgGraphic.h" + +namespace rnoh { +namespace svg { + +class SvgDefs : public SvgNode { + +public: + SvgDefs() : SvgNode() { InitDefsFlag(); } + + ~SvgDefs() override = default; + + void InitDefsFlag() { + hrefFill_ = false; + hrefRender_ = false; + inheritStyle_ = false; + drawTraversed_ = false; + } + + drawing::Path AsPath() override { + drawing::Path path; + DLOG(INFO) << "[SvgDfes:AsPath] : arrived Defs AsPath"; + for (auto child : children_) { + if (!child) { + DLOG(INFO) << "[SvgDfes:AsPath] : childnode is a null ptr"; + } else { + DLOG(INFO) << "[SvgDfes:AsPath] : get child path:"; + } + auto childPath = child->AsPath(); + path.Union(childPath); + } + return path; + } +}; + +} // namespace svg +} // namespace rnoh diff --git a/tester/harmony/svg/src/main/cpp/SvgEllipse.cpp b/tester/harmony/svg/src/main/cpp/SvgEllipse.cpp new file mode 100644 index 0000000000000000000000000000000000000000..aeff06831f63936479eff0e39c2b507f3e317bf6 --- /dev/null +++ b/tester/harmony/svg/src/main/cpp/SvgEllipse.cpp @@ -0,0 +1,41 @@ +/* + * Copyright (c) 2022-2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "SvgEllipse.h" +#include "drawing/Rect.h" + +namespace rnoh { +namespace svg { + +drawing::Path SvgEllipse::AsPath() { + drawing::Path path; + double cx = relativeOnWidth(ellipseAttribute_.cx); + double cy = relativeOnHeight(ellipseAttribute_.cy); + double rx = relativeOnWidth(ellipseAttribute_.rx); + double ry = relativeOnHeight(ellipseAttribute_.ry); + + drawing::Rect rect(cx - rx, cy - ry, cx + rx, cy + ry); + path.AddOval(rect, PATH_DIRECTION_CW); + + elements_ = {PathElement(ElementType::kCGPathElementMoveToPoint, {Point(cx, cy - ry)}), + PathElement(ElementType::kCGPathElementAddLineToPoint, {Point(cx, cy - ry), Point(cx + rx, cy)}), + PathElement(ElementType::kCGPathElementAddLineToPoint, {Point(cx + rx, cy), Point(cx, cy + ry)}), + PathElement(ElementType::kCGPathElementAddLineToPoint, {Point(cx, cy + ry), Point(cx - rx, cy)}), + PathElement(ElementType::kCGPathElementAddLineToPoint, {Point(cx - rx, cy), Point(cx, cy - ry)})}; + return path; +}; + +} // namespace svg +} // namespace rnoh \ No newline at end of file diff --git a/tester/harmony/svg/src/main/cpp/SvgEllipse.h b/tester/harmony/svg/src/main/cpp/SvgEllipse.h new file mode 100644 index 0000000000000000000000000000000000000000..d0ffb2aa468537b1eda9367e044eb902b5d92258 --- /dev/null +++ b/tester/harmony/svg/src/main/cpp/SvgEllipse.h @@ -0,0 +1,28 @@ +#pragma once + +#include "SvgGraphic.h" +#include "utils/SvgAttributesParser.h" + +namespace rnoh { +namespace svg { + +class SvgEllipse : public SvgGraphic { +public: + using Float = facebook::react::Float; + SvgEllipse() = default; + ~SvgEllipse() override = default; + + drawing::Path AsPath() override; + void SetCX(const std::string &cx) { ellipseAttribute_.cx = SvgAttributesParser::ParseDimension(cx, true); } + void SetCY(const std::string &cy) { ellipseAttribute_.cy = SvgAttributesParser::ParseDimension(cy, true); } + void SetRX(const std::string &rx) { ellipseAttribute_.rx = SvgAttributesParser::ParseDimension(rx, true); } + void SetRY(const std::string &ry) { ellipseAttribute_.ry = SvgAttributesParser::ParseDimension(ry, true); } + +private: + SvgEllipseAttribute ellipseAttribute_; +}; + +} // namespace svg +} // namespace rnoh + + diff --git a/tester/harmony/svg/src/main/cpp/SvgGradient.cpp b/tester/harmony/svg/src/main/cpp/SvgGradient.cpp new file mode 100644 index 0000000000000000000000000000000000000000..00f84a152da03740d82c6d2d15bf229a0e2c93fb --- /dev/null +++ b/tester/harmony/svg/src/main/cpp/SvgGradient.cpp @@ -0,0 +1,117 @@ +/* + * Copyright (c) 2022-2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "SvgGradient.h" +#include +#include "properties/Decoration.h" + +namespace rnoh { +namespace svg { + +SvgGradient::SvgGradient(GradientType gradientType) +{ + gradientAttr_.gradient.SetType(gradientType); + InitNoneFlag(); +} + +void SvgGradient::OnDraw(OH_Drawing_Canvas *canvas) { +} + +void SvgGradient::SetAttrX1(const std::string& x1) { + gradientAttr_.gradient.GetLinearGradient().x1 = StringUtils::StringToDimensionWithUnit(x1, defaultUnit_); +} + +void SvgGradient::SetAttrY1(const std::string& y1) { + gradientAttr_.gradient.GetLinearGradient().y1 = StringUtils::StringToDimensionWithUnit(y1, defaultUnit_); +} + +void SvgGradient::SetAttrX2(const std::string& x2) { + gradientAttr_.gradient.GetLinearGradient().x2 = StringUtils::StringToDimensionWithUnit(x2, defaultUnit_); +} + +void SvgGradient::SetAttrY2(const std::string& y2) { + gradientAttr_.gradient.GetLinearGradient().y2 = StringUtils::StringToDimensionWithUnit(y2, defaultUnit_); +} + +void SvgGradient::SetAttrFx(const std::string& fx) { + gradientAttr_.gradient.GetRadialGradient().fRadialCenterX = StringUtils::StringToDimensionWithUnit(fx, defaultUnit_); +} + +void SvgGradient::SetAttrFy(const std::string& fy) { + gradientAttr_.gradient.GetRadialGradient().fRadialCenterY = StringUtils::StringToDimensionWithUnit(fy, defaultUnit_); +} + +void SvgGradient::SetAttrCx(const std::string& cx) { + gradientAttr_.gradient.GetRadialGradient().radialCenterX = StringUtils::StringToDimensionWithUnit(cx, defaultUnit_); +} + +void SvgGradient::SetAttrCy(const std::string& cy) { + gradientAttr_.gradient.GetRadialGradient().radialCenterY = StringUtils::StringToDimensionWithUnit(cy, defaultUnit_); +} + +void SvgGradient::SetAttrRx(const std::string& rx) { + gradientAttr_.gradient.GetRadialGradient().radialHorizontalSize = StringUtils::StringToDimensionWithUnit(rx, defaultUnit_); +} + +void SvgGradient::SetAttrRy(const std::string& ry) { + gradientAttr_.gradient.GetRadialGradient().radialVerticalSize = StringUtils::StringToDimensionWithUnit(ry, defaultUnit_); +} + +void SvgGradient::SetAttrGradient(std::vector gradient) { + auto stopCount = gradient.size() / 2; + for (auto i = 0; i < stopCount; i++) { + auto stopIndex = i * 2; + GradientColor gradientColor; + gradientColor.SetDimension(Dimension(gradient[stopIndex])); + gradientColor.SetColor(Color((int32_t)gradient[stopIndex + 1])); + gradientAttr_.gradient.AddColor(gradientColor); + } +} + +void SvgGradient::SetAttrGradientUnits(int gradientUnits) { + auto unit = static_cast(gradientUnits); + if (unit < Unit::objectBoundingBox || unit > Unit::userSpaceOnUse) { + unit = Unit::objectBoundingBox; + } + gradientAttr_.gradient.SetGradientUnits(ToUnit(gradientUnits)); + defaultUnit_ = (gradientAttr_.gradient.GetGradientUnits() == Unit::objectBoundingBox) + ? DimensionUnit::PERCENT + : DimensionUnit::VP; +} + +void SvgGradient::SetAttrGradientTransforms(std::vector gradientTransforms) { + std::vector newMatrix { + 1, 0, 0, + 0, 1, 0, + 0, 0, 1, + }; + if (gradientTransforms.size() == 6) { + newMatrix[0] = (Float) gradientTransforms[0]; + newMatrix[1] = (Float) gradientTransforms[2]; + newMatrix[2] = (Float) gradientTransforms[4] * scale_; + newMatrix[3] = (Float) gradientTransforms[1]; + newMatrix[4] = (Float) gradientTransforms[3]; + newMatrix[5] = (Float) gradientTransforms[5] * scale_; + gradientAttr_.gradient.SetGradientTransform(std::move(newMatrix)); + } +} + +const Gradient& SvgGradient::GetGradient() const +{ + return gradientAttr_.gradient; +} + +} // namespace svg +} // namespace rnoh diff --git a/tester/harmony/svg/src/main/cpp/SvgGradient.h b/tester/harmony/svg/src/main/cpp/SvgGradient.h new file mode 100644 index 0000000000000000000000000000000000000000..254afad92f19830f068438cd1341f84b364c6bfe --- /dev/null +++ b/tester/harmony/svg/src/main/cpp/SvgGradient.h @@ -0,0 +1,58 @@ +/* + * Copyright (c) 2022-2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +#include "SvgGraphic.h" +#include +#include "utils/SvgAttributesParser.h" + +namespace rnoh { +namespace svg { + +class SvgGradient : public SvgNode { +public: + using Float = facebook::react::Float; + explicit SvgGradient(GradientType gradientType); + ~SvgGradient() override = default; + + void OnDraw(OH_Drawing_Canvas *canvas) override; + + void SetAttrX1(const std::string& x1); + void SetAttrY1(const std::string& y1); + void SetAttrX2(const std::string& x2); + void SetAttrY2(const std::string& y2); + + void SetAttrFx(const std::string& fx); + void SetAttrFy(const std::string& fy); + void SetAttrCx(const std::string& cx); + void SetAttrCy(const std::string& cy); + void SetAttrRx(const std::string& rx); + void SetAttrRy(const std::string& ry); + + void SetAttrGradient(std::vector gradient); + void SetAttrGradientUnits(int gradientUnits); + void SetAttrGradientTransforms(std::vector gradientTransforms); + + const Gradient& GetGradient() const; + +private: + SvgGradientAttribute gradientAttr_; + double scale_ = 3.25; + DimensionUnit defaultUnit_ = DimensionUnit::VP; +}; + +} // namespace svg +} // namespace rnoh diff --git a/tester/harmony/svg/src/main/cpp/SvgGraphic.cpp b/tester/harmony/svg/src/main/cpp/SvgGraphic.cpp new file mode 100644 index 0000000000000000000000000000000000000000..459a29b1eff8e0c6cb9ed0a210649be5b51aee22 --- /dev/null +++ b/tester/harmony/svg/src/main/cpp/SvgGraphic.cpp @@ -0,0 +1,510 @@ +/* + * Copyright (c) 2022-2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "utils/SvgMarkerPositionUtils.h" +#include "SvgMarker.h" +#include "properties/ViewBox.h" +#include "drawing/Rect.h" +#include "SvgGraphic.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace rnoh { +namespace svg { + +void SvgGraphic::OnDraw(OH_Drawing_Canvas *canvas) { + DLOG(INFO) << "[SVGGraphic] onDraw marker = " << attributes_.markerStart << " " << attributes_.markerMid << " " + << attributes_.markerEnd; + fillBrush_.Reset(); + strokePen_.Reset(); + path_.Reset(); + // 获取子类的绘制路径。 + path_ = AsPath(); + UpdateGradient(attributes_.fillState.GetGradient()); + UpdateGradient(attributes_.strokeState.GetGradient()); + if (UpdateFillStyle()) { + OnGraphicFill(canvas); + } + if (UpdateStrokeStyle()) { + OnGraphicStroke(canvas); + } + if (!attributes_.markerStart.empty() || !attributes_.markerMid.empty() || !attributes_.markerEnd.empty()) { + DrawMarker(canvas); + } +} + +void SvgGraphic::OnGraphicFill(OH_Drawing_Canvas *canvas) { + auto smoothEdge = GetSmoothEdge(); + if (GreatNotEqual(smoothEdge, 0.0f)) { + auto *filter = OH_Drawing_FilterCreate(); + auto *maskFilter = + OH_Drawing_MaskFilterCreateBlur(OH_Drawing_BlurType::NORMAL, static_cast(smoothEdge), false); + OH_Drawing_FilterSetMaskFilter(filter, maskFilter); + + auto tmpFillBrush = fillBrush_; + OH_Drawing_BrushSetFilter(tmpFillBrush.get(), filter); + OH_Drawing_CanvasAttachBrush(canvas, tmpFillBrush.get()); + OH_Drawing_CanvasDrawPath(canvas, path_.get()); + OH_Drawing_CanvasDetachBrush(canvas); + + OH_Drawing_FilterDestroy(filter); + OH_Drawing_MaskFilterDestroy(maskFilter); + } else { + OH_Drawing_CanvasAttachBrush(canvas, fillBrush_.get()); + OH_Drawing_CanvasDrawPath(canvas, path_.get()); + OH_Drawing_CanvasDetachBrush(canvas); + } +} + +// Use Pen to draw stroke +void SvgGraphic::OnGraphicStroke(OH_Drawing_Canvas *canvas) { + auto smoothEdge = GetSmoothEdge(); + if (GreatNotEqual(smoothEdge, 0.0f)) { + auto *filter = OH_Drawing_FilterCreate(); + auto *maskFilter = + OH_Drawing_MaskFilterCreateBlur(OH_Drawing_BlurType::NORMAL, static_cast(smoothEdge), false); + OH_Drawing_FilterSetMaskFilter(filter, maskFilter); + + auto tmpStrokePen = strokePen_; + OH_Drawing_PenSetFilter(tmpStrokePen.get(), filter); + OH_Drawing_CanvasAttachPen(canvas, tmpStrokePen.get()); + OH_Drawing_CanvasDrawPath(canvas, path_.get()); + OH_Drawing_CanvasDetachPen(canvas); + + OH_Drawing_FilterDestroy(filter); + OH_Drawing_MaskFilterDestroy(maskFilter); + } else { + const auto &transform = attributes_.transform; + if (attributes_.strokeState.GetVectorEffect() && transform.size() > 5) { + auto matrix = drawing::Matrix(); + matrix.SetMatrix(transform[0], transform[2], transform[4] * scale_, transform[1], transform[3], + transform[5] * scale_, 0, 0, 1.0); + path_.Transform(matrix); + } + OH_Drawing_CanvasAttachPen(canvas, strokePen_.get()); + OH_Drawing_CanvasDrawPath(canvas, path_.get()); + OH_Drawing_CanvasDetachPen(canvas); + } +} + +// todo implement bounds +void SvgGraphic::UpdateGradient(std::optional &gradient) { + CHECK_NULL_VOID(gradient); + // objectBoundingBox - 0(DEFAULT), userSpaceOnUse - 1 + auto nodeBounds = (gradient->GetGradientUnits() == Unit::objectBoundingBox) + ? AsBounds() + : Rect(0, 0, context_->GetSvgSize().Width(), context_->GetSvgSize().Height()); + if (gradient->GetType() == GradientType::LINEAR) { + const auto &linearGradient = gradient->GetLinearGradient(); + auto gradientInfo = LinearGradientInfo(); + if (linearGradient.x1.value().Unit() == DimensionUnit::PERCENT) { + gradientInfo.x1 = nodeBounds.Left() + linearGradient.x1->RelativeConvertToPx(nodeBounds.Width(), scale_); + } else { + gradientInfo.x1 = linearGradient.x1->RelativeConvertToPx(nodeBounds.Width(), scale_); + } + if (linearGradient.y1.value().Unit() == DimensionUnit::PERCENT) { + gradientInfo.y1 = nodeBounds.Top() + linearGradient.y1->RelativeConvertToPx(nodeBounds.Height(), scale_); + } else { + gradientInfo.y1 = linearGradient.y1->RelativeConvertToPx(nodeBounds.Height(), scale_); + } + if (linearGradient.x2.value().Unit() == DimensionUnit::PERCENT) { + gradientInfo.x2 = nodeBounds.Left() + linearGradient.x2->RelativeConvertToPx(nodeBounds.Width(), scale_); + } else { + gradientInfo.x2 = linearGradient.x2->RelativeConvertToPx(nodeBounds.Width(), scale_); + } + if (linearGradient.y2.value().Unit() == DimensionUnit::PERCENT) { + gradientInfo.y2 = nodeBounds.Top() + linearGradient.y2->RelativeConvertToPx(nodeBounds.Height(), scale_); + } else { + gradientInfo.y2 = linearGradient.y2->RelativeConvertToPx(nodeBounds.Height(), scale_); + } + gradient->SetLinearGradientInfo(gradientInfo); + } + if (gradient->GetType() == GradientType::RADIAL) { + const auto &radialGradient = gradient->GetRadialGradient(); + auto gradientInfo = RadialGradientInfo(); + if (radialGradient.radialCenterX.value().Unit() == DimensionUnit::PERCENT) { + gradientInfo.cx = + nodeBounds.Left() + radialGradient.radialCenterX->RelativeConvertToPx(nodeBounds.Width(), scale_); + } else { + gradientInfo.cx = radialGradient.radialCenterX->RelativeConvertToPx(nodeBounds.Width(), scale_); + } + if (radialGradient.radialCenterY.value().Unit() == DimensionUnit::PERCENT) { + gradientInfo.cy = + nodeBounds.Top() + radialGradient.radialCenterY->RelativeConvertToPx(nodeBounds.Height(), scale_); + } else { + gradientInfo.cy = radialGradient.radialCenterY->RelativeConvertToPx(nodeBounds.Height(), scale_); + } + if (radialGradient.fRadialCenterX.value().Unit() == DimensionUnit::PERCENT) { + gradientInfo.fx = + nodeBounds.Left() + radialGradient.fRadialCenterX->RelativeConvertToPx(nodeBounds.Width(), scale_); + } else { + gradientInfo.fx = radialGradient.fRadialCenterX->RelativeConvertToPx(nodeBounds.Width(), scale_); + } + if (radialGradient.fRadialCenterY.value().Unit() == DimensionUnit::PERCENT) { + gradientInfo.fy = + nodeBounds.Top() + radialGradient.fRadialCenterY->RelativeConvertToPx(nodeBounds.Height(), scale_); + } else { + gradientInfo.fy = radialGradient.fRadialCenterY->RelativeConvertToPx(nodeBounds.Height(), scale_); + } + gradientInfo.rx = radialGradient.radialHorizontalSize->RelativeConvertToPx(nodeBounds.Width(), scale_); + gradientInfo.ry = radialGradient.radialVerticalSize->RelativeConvertToPx(nodeBounds.Height(), scale_); + gradient->SetRadialGradientInfo(gradientInfo); + } +} + +bool SvgGraphic::UpdateFillStyle(bool antiAlias) { + const auto &fillState_ = attributes_.fillState; + if (fillState_.GetColor() == Color::TRANSPARENT && !fillState_.GetGradient() && !fillState_.GetPatternAttr()) { + return false; + } + double curOpacity = fillState_.GetOpacity() * attributes_.opacity; + fillBrush_.SetAntiAlias(antiAlias); + if (fillState_.GetGradient().has_value()) { + SetFillGradientStyle(curOpacity); + } else if (fillState_.GetPatternAttr()) { + return SetPatternStyle(); + } else { + fillBrush_.SetColor(fillState_.GetColor().BlendOpacity(curOpacity).GetValue()); + } + path_.SetFillType(fillState_.GetFillRuleForDraw()); + return true; +} +void SvgGraphic::SetFillGradientStyle(double opacity) { + const auto &fillState_ = attributes_.fillState; + auto gradient = fillState_.GetGradient(); + CHECK_NULL_VOID(gradient); + auto gradientColors = gradient->GetColors(); + if (gradientColors.empty()) { + return; + } + std::vector pos; + std::vector colors; + for (const auto &gradientColor : gradientColors) { + pos.push_back(static_cast(gradientColor.GetDimension().Value())); + colors.push_back( + gradientColor.GetColor().BlendOpacity(gradientColor.GetOpacity()).BlendOpacity(opacity).GetValue()); + } + drawing::Matrix transMatrix; + if (gradient->GetGradientTransform().size() == 9) { + transMatrix.SetMatrix(gradient->GetGradientTransform()[0], gradient->GetGradientTransform()[1], + gradient->GetGradientTransform()[2], gradient->GetGradientTransform()[3], + gradient->GetGradientTransform()[4], gradient->GetGradientTransform()[5], + gradient->GetGradientTransform()[6], gradient->GetGradientTransform()[7], + gradient->GetGradientTransform()[8]); + } + if (gradient->GetType() == GradientType::LINEAR && gradient->IsValid()) { + auto info = gradient->GetLinearGradientInfo(); + OH_Drawing_Point2D ptsPoint2D[2] = { + {static_cast(info.x1), static_cast(info.y1)}, + {static_cast(info.x2), static_cast(info.y2)}, + }; + fillBrush_.SetLinearShaderEffect(&ptsPoint2D[0], &ptsPoint2D[1], colors.data(), pos.data(), colors.size(), + static_cast(gradient->GetSpreadMethod()), + transMatrix.get()); + } + if (gradient->GetType() == GradientType::RADIAL && gradient->IsValid()) { + auto info = gradient->GetRadialGradientInfo(); + drawing::Matrix scaleMatrix; + if (info.ry < info.rx) { + scaleMatrix = drawing::Matrix::CreateScale(1, info.ry / info.rx, info.cx, info.cy); + } else { + scaleMatrix = drawing::Matrix::CreateScale(info.rx / info.ry, 1, info.cx, info.cy); + } + OH_Drawing_Point2D focal = {static_cast(info.fx), static_cast(info.fy)}; + OH_Drawing_Point2D center = {static_cast(info.cx), static_cast(info.cy)}; + drawing::Matrix concatMatrix; + concatMatrix = scaleMatrix.Concat(transMatrix); + fillBrush_.SetRadialShaderEffect( + &focal, 0, ¢er, info.rx > info.ry ? info.rx : info.ry, colors.data(), pos.data(), colors.size(), + static_cast(gradient->GetSpreadMethod()), concatMatrix.get()); + } +} + +void SvgGraphic::SetStrokeGradientStyle(double opacity) { + const auto &strokeState_ = attributes_.strokeState; + auto gradient = strokeState_.GetGradient(); + CHECK_NULL_VOID(gradient); + auto gradientColors = gradient->GetColors(); + if (gradientColors.empty()) { + return; + } + std::vector pos; + std::vector colors; + for (const auto &gradientColor : gradientColors) { + pos.push_back(static_cast(gradientColor.GetDimension().Value())); + colors.push_back( + gradientColor.GetColor().BlendOpacity(gradientColor.GetOpacity()).BlendOpacity(opacity).GetValue()); + } + drawing::Matrix transMatrix; + if (gradient->GetGradientTransform().size() == 9) { + transMatrix.SetMatrix(gradient->GetGradientTransform()[0], gradient->GetGradientTransform()[1], + gradient->GetGradientTransform()[2], gradient->GetGradientTransform()[3], + gradient->GetGradientTransform()[4], gradient->GetGradientTransform()[5], + gradient->GetGradientTransform()[6], gradient->GetGradientTransform()[7], + gradient->GetGradientTransform()[8]); + } + if (gradient->GetType() == GradientType::LINEAR && gradient->IsValid()) { + auto info = gradient->GetLinearGradientInfo(); + OH_Drawing_Point2D ptsPoint2D[2] = { + {static_cast(info.x1), static_cast(info.y1)}, + {static_cast(info.x2), static_cast(info.y2)}, + }; + strokePen_.SetLinearShaderEffect(&ptsPoint2D[0], &ptsPoint2D[1], colors.data(), pos.data(), colors.size(), + static_cast(gradient->GetSpreadMethod()), + transMatrix.get()); + } + if (gradient->GetType() == GradientType::RADIAL && gradient->IsValid()) { + auto info = gradient->GetRadialGradientInfo(); + drawing::Matrix scaleMatrix; + if (info.ry < info.rx) { + scaleMatrix = drawing::Matrix::CreateScale(1, info.ry / info.rx, info.cx, info.cy); + } else { + scaleMatrix = drawing::Matrix::CreateScale(info.rx / info.ry, 1, info.cx, info.cy); + } + OH_Drawing_Point2D focal = {static_cast(info.fx), static_cast(info.fy)}; + OH_Drawing_Point2D center = {static_cast(info.cx), static_cast(info.cy)}; + drawing::Matrix concatMatrix; + concatMatrix = scaleMatrix.Concat(transMatrix); + strokePen_.SetRadialShaderEffect( + &focal, 0, ¢er, info.rx > info.ry ? info.rx : info.ry, colors.data(), pos.data(), colors.size(), + static_cast(gradient->GetSpreadMethod()), concatMatrix.get()); + } +} + +bool SvgGraphic::SetPatternStyle() { + DLOG(INFO) << "[SVGGraphic pattern] SetPatternStyle"; + const auto &fillState_ = attributes_.fillState; + auto pattern = fillState_.GetPatternAttr(); + if (pattern == nullptr) { + return false; + } + Unit patternUnits = pattern->getPatternUnits(); + Unit patternContentUnits = pattern->getPatternContentUnits(); + + OH_Drawing_Canvas *canvas = OH_Drawing_CanvasCreate(); + + Dimension x_ = pattern->getX(); + Dimension y_ = pattern->getY(); + Dimension width_ = pattern->getWidth(); + Dimension height_ = pattern->getHeight(); + float mMinX = pattern->getmMinX(); + float mMinY = pattern->getmMinY(); + float mVbWidth = pattern->getmVbWidth(); + float mVbHeight = pattern->getmVbHeight(); + std::string mAlign = pattern->getmAlign(); + int mMeetOrSlice = pattern->getmMeetOrSlice(); + + Rect nodeBounds; + float left = 0; + float top = 0; + float width; + float height; + if (patternUnits == Unit::objectBoundingBox) { + nodeBounds = AsBounds(); + left = nodeBounds.Left(); + top = nodeBounds.Top(); + } else { + nodeBounds = GetRootViewBox(); + } + + width = nodeBounds.Width(); + height = nodeBounds.Height(); + + + drawing::Rect Bounds_(left, top, width + left, height + top); + + float offsetwidth = Bounds_.GetWidth(); + float offsetheight = Bounds_.GetHeight(); + + bool isObjectBox = patternUnits == Unit::objectBoundingBox; + double x = x_.FromRelative(isObjectBox, offsetwidth, scale_); + double y = y_.FromRelative(isObjectBox, offsetheight, scale_); + double w = width_.FromRelative(isObjectBox, offsetwidth, scale_); + double h = height_.FromRelative(isObjectBox, offsetheight, scale_); + if (!(w > 1 && h > 1)) { + return false; + } + + OH_Drawing_Bitmap *bitmap = OH_Drawing_BitmapCreate(); + OH_Drawing_BitmapFormat format = {COLOR_FORMAT_RGBA_8888, ALPHA_FORMAT_OPAQUE}; + + OH_Drawing_BitmapBuild(bitmap, int(w), int(h), &format); + if (OH_Drawing_BitmapGetPixels(bitmap) == nullptr) { + OH_Drawing_CanvasDestroy(canvas); + OH_Drawing_BitmapDestroy(bitmap); + return false; + } + OH_Drawing_CanvasBind(canvas, bitmap); + + // set background color to white + drawing::Brush brush; + brush.SetColor(0xffffffff); + OH_Drawing_CanvasDrawBackground(canvas, brush.get()); + + Rect vbRect(mMinX * scale_, mMinY * scale_, (mMinX + mVbWidth) * scale_, (mMinY + mVbHeight) * scale_); + Rect eRect = Rect(x, y, w, h); + if (vbRect.IsValid()) { + drawing::Matrix viewBoxMatrix = ViewBox::getTransform(vbRect, eRect, mAlign, mMeetOrSlice); + OH_Drawing_CanvasConcatMatrix(canvas, viewBoxMatrix.get()); + } + + if (patternContentUnits == Unit::objectBoundingBox) { + OH_Drawing_CanvasScale(canvas, offsetwidth / scale_, offsetheight / scale_); + } + + // draw child node + if (!fillState_.GetHref().empty()) { + auto svgContext = GetContext(); + auto refSvgNode = svgContext->GetSvgNodeById(fillState_.GetHref()); + if (refSvgNode == nullptr) { + OH_Drawing_CanvasDestroy(canvas); + OH_Drawing_BitmapDestroy(bitmap); + return false; + } + refSvgNode->Draw(canvas); + } + + drawing::Matrix matrix; + if (pattern->GetPatternTransform().size() == 9) { + OH_Drawing_MatrixSetMatrix(matrix.get(), pattern->GetPatternTransform()[0], pattern->GetPatternTransform()[1], + pattern->GetPatternTransform()[2], pattern->GetPatternTransform()[3], + pattern->GetPatternTransform()[4], pattern->GetPatternTransform()[5], + pattern->GetPatternTransform()[6], pattern->GetPatternTransform()[7], + pattern->GetPatternTransform()[8]); + } + + // set repeat shader + OH_Drawing_Image *image = OH_Drawing_ImageCreate(); + OH_Drawing_ImageBuildFromBitmap(image, bitmap); + + OH_Drawing_SamplingOptions *opt = OH_Drawing_SamplingOptionsCreate(OH_Drawing_FilterMode::FILTER_MODE_LINEAR, + OH_Drawing_MipmapMode::MIPMAP_MODE_NONE); + OH_Drawing_BrushReset(fillBrush_.get()); + fillBrush_.SetImageShaderEffect(image, OH_Drawing_TileMode::REPEAT, OH_Drawing_TileMode::REPEAT, opt, matrix.get()); + + OH_Drawing_CanvasDestroy(canvas); + OH_Drawing_BitmapDestroy(bitmap); + OH_Drawing_ImageDestroy(image); + OH_Drawing_SamplingOptionsDestroy(opt); + + return true; +} + +bool SvgGraphic::UpdateStrokeStyle(bool antiAlias) { + const auto &strokeState = attributes_.strokeState; + // auto colorFilter = GetColorFilter(); + // if (!colorFilter.has_value() && strokeState.GetColor() == Color::TRANSPARENT) { + // return false; + // } + if (!GreatNotEqual(strokeState.GetLineWidth(), 0.0)) { + return false; + } + + double curOpacity = strokeState.GetOpacity() * attributes_.opacity; + if (strokeState.GetGradient()) { + SetStrokeGradientStyle(curOpacity); + } else { + strokePen_.SetColor(strokeState.GetColor().BlendOpacity(curOpacity).GetValue()); + } + DLOG(INFO) << "[svg] strokeState.GetLineCap(): " << static_cast(strokeState.GetLineCap()); + if (strokeState.GetLineCap() == LineCapStyle::ROUND) { + strokePen_.SetLineCap(LINE_ROUND_CAP); + } else if (strokeState.GetLineCap() == LineCapStyle::SQUARE) { + strokePen_.SetLineCap(LINE_SQUARE_CAP); + } else { + strokePen_.SetLineCap(LINE_FLAT_CAP); + } + DLOG(INFO) << "[svg] strokeState.GetLineJoin(): " << static_cast(strokeState.GetLineJoin()); + if (strokeState.GetLineJoin() == LineJoinStyle::ROUND) { + strokePen_.SetLineJoin(LINE_ROUND_JOIN); + } else if (strokeState.GetLineJoin() == LineJoinStyle::BEVEL) { + strokePen_.SetLineJoin(LINE_BEVEL_JOIN); + } else { + strokePen_.SetLineJoin(LINE_MITER_JOIN); + } + DLOG(INFO) << "[SvgRect] OH_Drawing_PenSetWidth: " << strokeState.GetLineWidth(); + strokePen_.SetWidth(strokeState.GetLineWidth()); + strokePen_.SetMiterLimit(strokeState.GetMiterLimit()); + strokePen_.SetAntiAlias(antiAlias); + // auto filter = strokePen_.GetFilter(); + // UpdateColorFilter(filter); + // strokePen_.SetFilter(filter); + UpdateLineDash(); + return true; +} +void SvgGraphic::UpdateLineDash() { + const auto &strokeState = attributes_.strokeState; + if (!strokeState.GetStrokeDashArray().empty()) { + auto lineDashState = strokeState.GetStrokeDashArray(); + float intervals[lineDashState.size()]; + for (size_t i = 0; i < lineDashState.size(); ++i) { + intervals[i] = static_cast(lineDashState[i]); + } + float phase = static_cast(strokeState.GetStrokeDashOffset()); + auto *DashPathEffect = OH_Drawing_CreateDashPathEffect(intervals, lineDashState.size(), phase); + OH_Drawing_PenSetPathEffect(strokePen_.get(), DashPathEffect); + } +} + +void SvgGraphic::DrawMarker(OH_Drawing_Canvas *canvas) { + auto markerStart = std::dynamic_pointer_cast(context_->GetSvgNodeById(attributes_.markerStart)); + auto markerMid = std::dynamic_pointer_cast(context_->GetSvgNodeById(attributes_.markerMid)); + auto markerEnd = std::dynamic_pointer_cast(context_->GetSvgNodeById(attributes_.markerEnd)); + if (!markerStart && !markerMid && !markerEnd) { + DLOG(WARNING) << "NO MARKER"; + return; + } + if (elements_.empty()) { + DLOG(WARNING) << "NO path"; + return; + } + std::vector positions = SvgMarkerPositionUtils::fromPath(elements_); + for (const auto &position : positions) { + RNSVGMarkerType type = position.type; + std::shared_ptr marker; + switch (type) { + case RNSVGMarkerType::kStartMarker: + marker = markerStart; + break; + + case RNSVGMarkerType::kMidMarker: + marker = markerMid; + break; + + case RNSVGMarkerType::kEndMarker: + marker = markerEnd; + break; + default: + break; + } + if (!marker) { + continue; + } + DLOG(INFO) << "DRAW MARKER at " << position.origin.x << " " << position.origin.y + << "] type: " << static_cast(type); + marker->renderMarker(canvas, position, attributes_.strokeState.GetLineWidth()); + } +} + +} // namespace svg +} // namespace rnoh \ No newline at end of file diff --git a/tester/harmony/svg/src/main/cpp/SvgGraphic.h b/tester/harmony/svg/src/main/cpp/SvgGraphic.h new file mode 100644 index 0000000000000000000000000000000000000000..ea3ad6dd6032b2fcdfadde00451ff6d0a322eb2c --- /dev/null +++ b/tester/harmony/svg/src/main/cpp/SvgGraphic.h @@ -0,0 +1,53 @@ +// from ArkUI "frameworks/core/components_ng/svg/parse/svg_graphic.h" + +#pragma once + +#include "SvgNode.h" +#include "RNOH/CppComponentInstance.h" +#include "utils/StringUtils.h" +#include "utils/SvgMarkerPositionUtils.h" +#include "drawing/Brush.h" +#include "drawing/Path.h" +#include "drawing/Pen.h" +#include +#include +#include + + +namespace rnoh { +namespace svg { + +class SvgGraphic : virtual public SvgNode { +public: + SvgGraphic() : SvgNode() {} + ~SvgGraphic() noexcept override = default; + + + void OnDraw(OH_Drawing_Canvas *canvas) override; +protected: + drawing::Path path_ {}; + drawing::Brush fillBrush_ {}; + drawing::Pen strokePen_ {}; + + // Use Brush to draw fill + void OnGraphicFill(OH_Drawing_Canvas *canvas); + // Use Pen to draw stroke + void OnGraphicStroke(OH_Drawing_Canvas *canvas); + + bool UpdateFillStyle(bool antiAlias = true); + bool UpdateStrokeStyle(bool antiAlias = true); + void UpdateGradient(std::optional &gradient); + void SetFillGradientStyle(double opacity); + void SetStrokeGradientStyle(double opacity); + bool SetPatternStyle(); + void UpdateLineDash(); + + std::vector elements_; + +private: + void DrawMarker(OH_Drawing_Canvas *canvas); + // TODO void UpdateColorFilter(OH_Drawing_Filter *filter); +}; + +} // namespace svg +} // namespace rnoh \ No newline at end of file diff --git a/tester/harmony/svg/src/main/cpp/SvgGroup.cpp b/tester/harmony/svg/src/main/cpp/SvgGroup.cpp new file mode 100644 index 0000000000000000000000000000000000000000..bb768c7abeedcff4cd620a7238244bcbf94c6ad9 --- /dev/null +++ b/tester/harmony/svg/src/main/cpp/SvgGroup.cpp @@ -0,0 +1,26 @@ +#include "SvgGroup.h" + +namespace rnoh { +namespace svg { + +void SvgGroup::InitGroupFlag() { + hrefFill_ = true; + hrefRender_ = true; + passStyle_ = true; + inheritStyle_ = true; + drawTraversed_ = true; +} + +void SvgGroup::OnInitStyle() { + if (!font_) { + InitFont(GetScale()); + } + for (auto &child : children_) { + if (auto childG = std::dynamic_pointer_cast(child)) { + childG->InheritFont(font_, child->GetScale()); + } + } +} + +} // namespace svg +} // namespace rnoh \ No newline at end of file diff --git a/tester/harmony/svg/src/main/cpp/SvgGroup.h b/tester/harmony/svg/src/main/cpp/SvgGroup.h new file mode 100644 index 0000000000000000000000000000000000000000..f56ce20d319729c3a7ed9290f6f9defec73de6f7 --- /dev/null +++ b/tester/harmony/svg/src/main/cpp/SvgGroup.h @@ -0,0 +1,23 @@ +#pragma once +#include "SvgNode.h" +#include "properties/Font.h" +#include "FontHolderBase.h" + +namespace rnoh { +namespace svg { + +class SvgGroup : public SvgNode, public FontHolderBase { + +public: + SvgGroup() : SvgNode() { InitGroupFlag(); } + ~SvgGroup() override = default; + +private: + // svg g, use + void InitGroupFlag(); + + void OnInitStyle() override; +}; + +} // namespace svg +} // namespace rnoh diff --git a/tester/harmony/svg/src/main/cpp/SvgHost.cpp b/tester/harmony/svg/src/main/cpp/SvgHost.cpp new file mode 100644 index 0000000000000000000000000000000000000000..5e9da518d3b97d9a29855af658f9c9a6b7ee08e3 --- /dev/null +++ b/tester/harmony/svg/src/main/cpp/SvgHost.cpp @@ -0,0 +1,20 @@ +#include "SvgHost.h" +namespace rnoh { +namespace svg { + +void SvgHost::OnChildInsertCommon(const std::shared_ptr &childSvgHost) { + if (!childSvgHost) { + return; + } + GetSvgNode()->AppendChild(childSvgHost->GetSvgNode()); +} + +void SvgHost::OnChildRemoveCommon(const std::shared_ptr &childSvgHost) { + if (!childSvgHost) { + return; + } + GetSvgNode()->removeChild(childSvgHost->GetSvgNode()); +} + +} // namespace svg +} // namespace rnoh \ No newline at end of file diff --git a/tester/harmony/svg/src/main/cpp/SvgHost.h b/tester/harmony/svg/src/main/cpp/SvgHost.h new file mode 100644 index 0000000000000000000000000000000000000000..d75ca16a3ef4bb9f52579823e3ffab9095ea9bdd --- /dev/null +++ b/tester/harmony/svg/src/main/cpp/SvgHost.h @@ -0,0 +1,31 @@ +#pragma once + +#include +#include "SvgNode.h" +namespace rnoh { +namespace svg { + +class SvgHost { + public: + SvgHost() = default; + virtual ~SvgHost() = default; + void SetSvgNode(const std::shared_ptr &svgNode) { + std::lock_guard lock(mtx); + m_svgNode = svgNode; + }; + const std::shared_ptr &GetSvgNode() const { + std::lock_guard lock(mtx); + return m_svgNode; + }; + + void OnChildInsertCommon(const std::shared_ptr &childSvgHost); + + void OnChildRemoveCommon(const std::shared_ptr &childSvgHost); + + private: + std::shared_ptr m_svgNode{nullptr}; + mutable std::mutex mtx; +}; + +} // namespace svg +} // namespace rnoh \ No newline at end of file diff --git a/tester/harmony/svg/src/main/cpp/SvgImage.cpp b/tester/harmony/svg/src/main/cpp/SvgImage.cpp new file mode 100644 index 0000000000000000000000000000000000000000..3b93df187273539a35af5e951a8004eb4a38642f --- /dev/null +++ b/tester/harmony/svg/src/main/cpp/SvgImage.cpp @@ -0,0 +1,153 @@ +/* + * Copyright (c) 2022-2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "SvgImage.h" +#include "utils/StringUtils.h" +#include "properties/ViewBox.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include + +const char * ASSET_PREFIX = "asset://"; +const char * RAWFILE_PREFIX = "assets/"; + +namespace rnoh { +namespace svg { + +void SvgImage::OnDraw(OH_Drawing_Canvas *canvas) { + auto uriString = imageAttribute_.src.uri; + + if (uriString.empty()) { + DLOG(WARNING) << "[SvgImage] imageAttribute_.src.uri is empty!"; + return; + } + + double width = + imageAttribute_.width.Value() == 0 ? imageAttribute_.src.size.width : relativeOnWidth(imageAttribute_.width); + double height = imageAttribute_.height.Value() == 0 ? imageAttribute_.src.size.height + : relativeOnHeight(imageAttribute_.height); + double x = relativeOnWidth(imageAttribute_.x); + double y = relativeOnHeight(imageAttribute_.y); + + if (!uriString.empty() && uriString.find("http", 0) != 0) { + OH_ImageSourceNative *res; + OH_PixelmapNative *pixelMap; + OH_DecodingOptions *options; + + char *srcUri = const_cast(uriString.c_str()); + + OH_DecodingOptions_Create(&options); + + Image_ErrorCode createFromUriStatus; + if (uriString.find(ASSET_PREFIX, 0) == 0) { + auto file = uriString.replace(0, 8, RAWFILE_PREFIX); + DLOG(INFO) << "[SvgImage] file: " << file; + auto rawFile = OH_ResourceManager_OpenRawFile(mgr_, file.c_str()); + if (rawFile == nullptr) { + LOG(ERROR) << "[SvgImage] get rawfile fail"; + return; + } + RawFileDescriptor descriptor; + auto getRawFileStatus = OH_ResourceManager_GetRawFileDescriptor(rawFile, descriptor); + if (!getRawFileStatus) { + LOG(ERROR) << "[SvgImage] get rawfile descriptor fail"; + return; + } + createFromUriStatus = OH_ImageSourceNative_CreateFromRawFile(&descriptor, &res); + } else { + createFromUriStatus = OH_ImageSourceNative_CreateFromUri(srcUri, uriString.size(), &res); + } + auto createPixelmapStatus = OH_ImageSourceNative_CreatePixelmap(res, options, &pixelMap); + DLOG(INFO) << "[SvgImage] code: " << createPixelmapStatus; + + if (createPixelmapStatus == IMAGE_SUCCESS) { + /* Temporarily disable the feature to set opacity. + * Currently, there is an issue where setting opacity on + * transparent pixels results in them turning black. + */ + if (LessNotEqual(attributes_.opacity, 1.0f)) { + OH_PixelmapNative_Opacity(pixelMap, attributes_.opacity); + } + + // get the real width and height from pixelmap(OH_PixelmapNative *). + OH_Pixelmap_ImageInfo *info; + OH_PixelmapImageInfo_Create(&info); + OH_PixelmapNative_GetImageInfo(pixelMap, info); + + // get the resource properties: width and height + uint32_t *imageWidth_ = new uint32_t; + uint32_t *imageHeight_ = new uint32_t; + OH_PixelmapImageInfo_GetWidth(info, imageWidth_); + OH_PixelmapImageInfo_GetHeight(info, imageHeight_); + + auto imageWidth = (double)*imageWidth_; + auto imageHeight = (double)*imageHeight_; + delete imageWidth_; + delete imageHeight_; + + const auto vbRect = Rect(0, 0, imageWidth, imageHeight); + const auto renderRect = Rect(x, y, width, height); + + drawing::Matrix transformMatrix; + if (vbRect.IsValid()) { + transformMatrix = + ViewBox::getTransform(vbRect, renderRect, imageAttribute_.align, imageAttribute_.meetOrSlice); + } + + // set source Rect and destination Rect + OH_Drawing_PixelMap *ohPixelMap = OH_Drawing_PixelMapGetFromOhPixelMapNative(pixelMap); + drawing::Rect srcPixelMap(0, 0, imageWidth, imageHeight); + auto dstPixelMap = transformMatrix.MapRect(srcPixelMap); + + // draw the border of the area for debug + // OH_Drawing_CanvasDrawLine(canvas, x, y, x + width, y); + // OH_Drawing_CanvasDrawLine(canvas, x + width, y, x + width, y + height); + // OH_Drawing_CanvasDrawLine(canvas, x + width, y + height, x, y + height); + // OH_Drawing_CanvasDrawLine(canvas, x, y + height, x, y); + + // set SamplingOptions + OH_Drawing_FilterMode filterMode = FILTER_MODE_NEAREST; + OH_Drawing_MipmapMode mipMapMode = MIPMAP_MODE_NONE; + OH_Drawing_SamplingOptions *samplingOptions = OH_Drawing_SamplingOptionsCreate(filterMode, mipMapMode); + + // Draw picture by type OH_Drawing_PixelMap + OH_Drawing_CanvasSave(canvas); + drawing::Rect clipRect(x, y, x + width, y + height); + OH_Drawing_CanvasClipRect(canvas, clipRect.get(), OH_Drawing_CanvasClipOp::INTERSECT, true); + OH_Drawing_CanvasDrawPixelMapRect(canvas, ohPixelMap, srcPixelMap.get(), dstPixelMap.get(), + samplingOptions); + OH_Drawing_CanvasRestore(canvas); + + // clear data + OH_PixelmapImageInfo_Release(info); + OH_Drawing_SamplingOptionsDestroy(samplingOptions); + OH_Drawing_PixelMapDissolve(ohPixelMap); + OH_PixelmapNative_Release(pixelMap); + } + if (createFromUriStatus == IMAGE_SUCCESS) { + OH_ImageSourceNative_Release(res); + } + OH_DecodingOptions_Release(options); + } +} + +} // namespace svg +} // namespace rnoh diff --git a/tester/harmony/svg/src/main/cpp/SvgImage.h b/tester/harmony/svg/src/main/cpp/SvgImage.h new file mode 100644 index 0000000000000000000000000000000000000000..b82adca7adcecc3a07301791811849adb19fb1c6 --- /dev/null +++ b/tester/harmony/svg/src/main/cpp/SvgImage.h @@ -0,0 +1,42 @@ +#pragma once + +#include +#include "SvgGraphic.h" +#include + +namespace rnoh { +namespace svg { + +class SvgImage : public svg::SvgGraphic { +public: + SvgImage() = default; + ~SvgImage() override = default; + + using SvgNode::relativeOnWidth; + using SvgNode::relativeOnHeight; + + void SetX(const std::string &x) { imageAttribute_.x = SvgAttributesParser::ParseDimension(x, true); } + + void SetY(const std::string &y) { imageAttribute_.y = SvgAttributesParser::ParseDimension(y, true); } + + void SetHeight(const std::string &height) { imageAttribute_.height = SvgAttributesParser::ParseDimension(height, true); } + + void SetWidth(const std::string &width) { imageAttribute_.width = SvgAttributesParser::ParseDimension(width, true); } + + void SetAlign(const std::string &align) { imageAttribute_.align = align; } + + void SetMeetOrSlice(const int &meetOrSlice) { imageAttribute_.meetOrSlice = meetOrSlice; } + + void SetImageSource(const facebook::react::ImageSource &src ) { imageAttribute_.src = src; } + + void setNativeResourceManager(const NativeResourceManager* mgr) { mgr_ = mgr; } + + void OnDraw(OH_Drawing_Canvas *canvas) override; + +private: + SvgImageAttribute imageAttribute_; + const NativeResourceManager* mgr_; +}; + +} // namespace svg +} // namespace rnoh diff --git a/tester/harmony/svg/src/main/cpp/SvgLine.cpp b/tester/harmony/svg/src/main/cpp/SvgLine.cpp new file mode 100644 index 0000000000000000000000000000000000000000..cbfdde44309f6beab6932e15a943d7ed0ec09f51 --- /dev/null +++ b/tester/harmony/svg/src/main/cpp/SvgLine.cpp @@ -0,0 +1,22 @@ +#include "SvgLine.h" + +namespace rnoh { +namespace svg { + +drawing::Path SvgLine::AsPath() { + drawing::Path path; + double x1 = relativeOnWidth(lineAttribute_.x1); + double y1 = relativeOnHeight(lineAttribute_.y1); + double x2 = relativeOnWidth(lineAttribute_.x2); + double y2 = relativeOnHeight(lineAttribute_.y2); + + path.MoveTo(x1, y1); + path.LineTo(x2, y2); + + elements_ = {PathElement(ElementType::kCGPathElementMoveToPoint, {Point(x1, y1)}), + PathElement(ElementType::kCGPathElementAddLineToPoint, {Point(x2, y2)})}; + return path; +}; + +} // namespace svg +} // namespace rnoh \ No newline at end of file diff --git a/tester/harmony/svg/src/main/cpp/SvgLine.h b/tester/harmony/svg/src/main/cpp/SvgLine.h new file mode 100644 index 0000000000000000000000000000000000000000..5aee56f17334616789a10e6aa90108da437b6347 --- /dev/null +++ b/tester/harmony/svg/src/main/cpp/SvgLine.h @@ -0,0 +1,26 @@ +#pragma once + +#include "SvgGraphic.h" +#include "utils/SvgAttributesParser.h" + +namespace rnoh { +namespace svg { + +class SvgLine : public SvgGraphic { +public: + using Float = facebook::react::Float; + SvgLine() = default; + ~SvgLine() override = default; + + drawing::Path AsPath() override; + void SetX1(const std::string &x1) { lineAttribute_.x1 = SvgAttributesParser::ParseDimension(x1, true); } + void SetY1(const std::string &y1) { lineAttribute_.y1 = SvgAttributesParser::ParseDimension(y1, true); } + void SetX2(const std::string &x2) { lineAttribute_.x2 = SvgAttributesParser::ParseDimension(x2, true); } + void SetY2(const std::string &y2) { lineAttribute_.y2 = SvgAttributesParser::ParseDimension(y2, true); } + +private: + SvgLineAttribute lineAttribute_; +}; + +} // namespace svg +} // namespace rnoh \ No newline at end of file diff --git a/tester/harmony/svg/src/main/cpp/SvgMarker.cpp b/tester/harmony/svg/src/main/cpp/SvgMarker.cpp new file mode 100644 index 0000000000000000000000000000000000000000..b08fe5171dc95d5d7cfc63e2452651eb8fb37fae --- /dev/null +++ b/tester/harmony/svg/src/main/cpp/SvgMarker.cpp @@ -0,0 +1,55 @@ +#include "SvgMarker.h" +#include "properties/Rect.h" +#include "properties/ViewBox.h" +#include +#include +#include + +namespace rnoh { +namespace svg { + + void SvgMarker::renderMarker(OH_Drawing_Canvas *canvas, const SvgMarkerPosition& position, float strokeWidth){ + const auto count = OH_Drawing_CanvasGetSaveCount(canvas); + saveAndSetupCanvas(canvas, cTM_); + + if(markerTransform.get() != nullptr) { + markerTransform.Reset(); + } + Point origin = position.origin; + markerTransform.Translate(origin.x, origin.y); + double markerAngle = (markerAttribute_.orient == "auto") ? -1 : std::atof(markerAttribute_.orient.c_str()); + float degrees = 180 + (markerAngle == -1 ? position.angle : static_cast(markerAngle)); + //fix me? float rad = deg2rad(angle); this code only in ios +// degrees = SvgMarkerPositionUtils::deg2rad(degrees); + markerTransform.PreRotate( degrees, 0, 0); + + if (markerAttribute_.markerUnits == "strokeWidth"){ + markerTransform.PreScale(strokeWidth / scale_, strokeWidth / scale_, 0, 0); + } + if (!markerAttribute_.align.empty()){ + double width = relativeOnWidth(markerAttribute_.markerWidth) / scale_; + double height = relativeOnHeight(markerAttribute_.markerHeight) / scale_; + Rect eRect(0, 0, width, height); + Rect vbRect(markerAttribute_.minX.ConvertToPx(scale_), markerAttribute_.minY.ConvertToPx(scale_), + markerAttribute_.minX.ConvertToPx(scale_) + markerAttribute_.vbWidth.ConvertToPx(scale_), + markerAttribute_.minY.ConvertToPx(scale_) + markerAttribute_.vbHeight.ConvertToPx(scale_)); + if (vbRect.IsValid()) { + drawing::Matrix viewBoxMatrix = ViewBox::getTransform(vbRect, eRect, markerAttribute_.align, markerAttribute_.meetOrSlice); + float sx = viewBoxMatrix.GetValue(0); + float sy = viewBoxMatrix.GetValue(4); + markerTransform.PreScale(sx, sy, 0, 0); + } + } + + double x = relativeOnWidth(markerAttribute_.refX); + double y = relativeOnHeight(markerAttribute_.refY); + markerTransform.PreTranslate(-x, -y); + OH_Drawing_CanvasConcatMatrix(canvas, markerTransform.get()); + + OnDrawTraversed(canvas); + + OH_Drawing_CanvasRestoreToCount(canvas, count); + } + +} // namespace svg +} // namespace rnoh \ No newline at end of file diff --git a/tester/harmony/svg/src/main/cpp/SvgMarker.h b/tester/harmony/svg/src/main/cpp/SvgMarker.h new file mode 100644 index 0000000000000000000000000000000000000000..304da39fa5e70dec82d86cf66468a864f4a7627d --- /dev/null +++ b/tester/harmony/svg/src/main/cpp/SvgMarker.h @@ -0,0 +1,97 @@ +// +// Created on 2024/5/8. +// +// Node APIs are not fully supported. To solve the compilation error of the interface cannot be found, +// please include "napi/native_api.h". + +#ifndef HARMONY_SVGMARKER_H +#define HARMONY_SVGMARKER_H + +#include "SvgQuote.h" +#include "properties/Dimension.h" +#include "utils/SvgAttributesParser.h" +#include "utils/SvgMarkerPositionUtils.h" +#include +#include +#include +#include +#include + +namespace rnoh { +namespace svg { + +class SvgMarker : public SvgQuote { +public: + SvgMarker() = default; + ~SvgMarker() override = default; + + void setRefX(const std::string &refX) { + markerAttribute_.refX = SvgAttributesParser::ParseDimension(refX, true); + } + + void setRefY(const std::string &refY) { + markerAttribute_.refY = SvgAttributesParser::ParseDimension(refY, true); + } + + void setMarkerWidth(const std::string &markerWidth) { + markerAttribute_.markerWidth = SvgAttributesParser::ParseDimension(markerWidth, true); + } + + void setMarkerHeight(const std::string &markerHeight) { + markerAttribute_.markerHeight = SvgAttributesParser::ParseDimension(markerHeight, true); + } + + void setMarkerUnits(const std::string &markerUnits) { + markerAttribute_.markerUnits = markerUnits; + } + + void setOrient(const std::string &orient) { + markerAttribute_.orient = orient; + } + + void setMinX(double minX) { markerAttribute_.minX = Dimension(minX, DimensionUnit::VP); } + + void setMinY(double minY) { markerAttribute_.minY = Dimension(minY, DimensionUnit::VP); } + + void setVbWidth(double vbWidth) { markerAttribute_.vbWidth = Dimension(vbWidth, DimensionUnit::VP); } + + void setVbHeight(double vbHeight) { markerAttribute_.vbHeight = Dimension(vbHeight, DimensionUnit::VP); } + + void setAlign(std::string align) { markerAttribute_.align = align; } + + void setMeetOrSlice(int meetOrSlice) { markerAttribute_.meetOrSlice = meetOrSlice; } + + void renderMarker(OH_Drawing_Canvas *canvas, const SvgMarkerPosition &position, float strokeWidth); + + /** + * from VirtualView.saveAndSetupCanvas + * + * Sets up the transform matrix on the canvas before an element is drawn. + * + *

NB: for perf reasons this does not apply opacity, as that would mean creating a new canvas + * layer (which allocates an offscreen bitmap) and having it composited afterwards. Instead, the + * drawing code should apply opacity recursively. + * + * @param canvas the canvas to set up + * @param ctm current transformation matrix + */ + void saveAndSetupCanvas(OH_Drawing_Canvas *canvas, drawing::Matrix ctm) { + OH_Drawing_CanvasSave(canvas); + cTM_ = mMatrix.Concat(mTransform); + OH_Drawing_CanvasConcatMatrix(canvas, cTM_.get()); + cTM_ = cTM_.Concat(ctm); + mInvCTM = cTM_.Invert(); + } + +private: + SvgMarkerAttribute markerAttribute_; + drawing::Matrix markerTransform; + drawing::Matrix mMatrix; + drawing::Matrix mTransform; + std::optional mInvCTM; +}; + +} // namespace svg +} // namespace rnoh + +#endif // HARMONY_SVGMARKER_H diff --git a/tester/harmony/svg/src/main/cpp/SvgMask.cpp b/tester/harmony/svg/src/main/cpp/SvgMask.cpp new file mode 100644 index 0000000000000000000000000000000000000000..51d761d8fb7591079ad086dc99450cd38b0c0d2b --- /dev/null +++ b/tester/harmony/svg/src/main/cpp/SvgMask.cpp @@ -0,0 +1,81 @@ +/* + * Copyright (c) 2022-2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "SvgMask.h" +#include "drawing/Brush.h" +#include +#include +#include +#include + +namespace rnoh { +namespace svg { + +void SvgMask::OnDrawTraversedBefore(OH_Drawing_Canvas *canvas) { + DLOG(INFO) << "[RNSVGMask] OnDrawTraversedBefore"; + // TODO implement proper support for units + auto nodeBounds = AsBounds(); + DLOG(INFO) << "[RNSVGMask] Left0: " << nodeBounds.Left(); + DLOG(INFO) << "[RNSVGMask] Top0: " << nodeBounds.Top(); + DLOG(INFO) << "[RNSVGMask] Width0: " << nodeBounds.Width(); + DLOG(INFO) << "[RNSVGMask] Height0: " << nodeBounds.Height(); + auto left = static_cast(ParseUnitsAttr(maskAttribute_.x, nodeBounds.Width())); + auto top = static_cast(ParseUnitsAttr(maskAttribute_.y, nodeBounds.Height())); + auto width = static_cast(ParseUnitsAttr(maskAttribute_.width, nodeBounds.Width())); + auto height = static_cast(ParseUnitsAttr(maskAttribute_.height, nodeBounds.Height())); + drawing::Rect maskBounds(left, top, width + left, height + top); + maskBounds_ = maskBounds; + + // create mask layer + OH_Drawing_CanvasSaveLayer(canvas, maskBounds_.get(), nullptr); + // ready to render mask content + canvasLayerCount_ = OH_Drawing_CanvasGetSaveCount(canvas); + + // set mask + auto outerFilter = OH_Drawing_ColorFilterCreateLuma(); + auto innerFilter = OH_Drawing_ColorFilterCreateSrgbGammaToLinear(); + auto colorFilter = OH_Drawing_ColorFilterCreateCompose(outerFilter, innerFilter); + auto *filter = OH_Drawing_FilterCreate(); + OH_Drawing_FilterSetColorFilter(filter, colorFilter); + + drawing::Brush maskFilter; + OH_Drawing_BrushSetFilter(maskFilter.get(), filter); + OH_Drawing_CanvasSaveLayer(canvas, nullptr, maskFilter.get()); +} + +void SvgMask::OnDrawTraversedAfter(OH_Drawing_Canvas *canvas) { + DLOG(INFO) << "[RNSVGMask] OnDrawTraversedAfter"; + OH_Drawing_CanvasRestoreToCount(canvas, canvasLayerCount_); + // create content layer and render content + drawing::Brush maskBrush; + OH_Drawing_BrushSetBlendMode(maskBrush.get(), BLEND_MODE_SRC_IN); + + OH_Drawing_CanvasSaveLayer(canvas, maskBounds_.get(), maskBrush.get()); + OH_Drawing_CanvasClipRect(canvas, maskBounds_.get(), INTERSECT, true); +} + + +void SvgMask::OnInitStyle() { DLOG(INFO) << "[RNSVGMask] OnInitStyle"; } + +double SvgMask::ParseUnitsAttr(const Dimension &attr, double value) { + // percent and px + if (attr.Unit() == DimensionUnit::PERCENT) { + return value * attr.Value(); + } + return attr.ConvertToPx(scale_); +} + +} // namespace svg +} // namespace rnoh diff --git a/tester/harmony/svg/src/main/cpp/SvgMask.h b/tester/harmony/svg/src/main/cpp/SvgMask.h new file mode 100644 index 0000000000000000000000000000000000000000..228d6dfa823bbd2c9a3c193c3bb762ec13c60f02 --- /dev/null +++ b/tester/harmony/svg/src/main/cpp/SvgMask.h @@ -0,0 +1,78 @@ +/* + * Copyright (c) 2022-2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "drawing/Rect.h" +#include "properties/Dimension.h" +#include "SvgQuote.h" + +namespace rnoh { +namespace svg { + +class SvgMask : public SvgQuote { +public: + SvgMask() = default; + ~SvgMask() override = default; + + void setMaskX(const std::string &x) { + maskAttribute_.x = StringUtils::StringToDimensionWithUnit(x, defaultDimensionUnit_); + } + + void setMaskY(const std::string &y) { + maskAttribute_.y = StringUtils::StringToDimensionWithUnit(y, defaultDimensionUnit_); + } + + void setMaskHeight(const std::string &height) { + maskAttribute_.height = StringUtils::StringToDimensionWithUnit(height, defaultDimensionUnit_); + } + + void setMaskWidth(const std::string &width) { + maskAttribute_.width = StringUtils::StringToDimensionWithUnit(width, defaultDimensionUnit_); + } + + void isDefaultMaskUnits(bool isDefaultMaskUnits) { isDefaultMaskUnits_ = isDefaultMaskUnits; } + + void isDefaultMaskContentUnits(bool isDefaultMaskContentUnits) { + isDefaultMaskContentUnits_ = isDefaultMaskContentUnits; + } + + void setMaskUnits(const int &maskUnits) { + maskAttribute_.maskUnits = ToUnit(maskUnits); + isDefaultMaskUnits(maskAttribute_.maskUnits == Unit::objectBoundingBox); + } + + void setMaskContentUnits(const int &maskContentUnits) { + maskAttribute_.maskContentUnits = ToUnit(maskContentUnits); + isDefaultMaskContentUnits(maskAttribute_.maskContentUnits == Unit::userSpaceOnUse); + } + + +protected: + void OnInitStyle() override; + void OnDrawTraversedBefore(OH_Drawing_Canvas *canvas) override; + void OnDrawTraversedAfter(OH_Drawing_Canvas *canvas) override; + double ParseUnitsAttr(const Dimension &attr, double value); + +private: + bool isDefaultMaskUnits_ = true; + bool isDefaultMaskContentUnits_ = true; + SvgMaskAttribute maskAttribute_; + + drawing::Rect maskBounds_; + int canvasLayerCount_ = -1; + DimensionUnit defaultDimensionUnit_ = DimensionUnit::VP; +}; + +} // namespace svg +} // namespace rnoh \ No newline at end of file diff --git a/tester/harmony/svg/src/main/cpp/SvgNode.cpp b/tester/harmony/svg/src/main/cpp/SvgNode.cpp new file mode 100644 index 0000000000000000000000000000000000000000..17c247dd05c5e941ae98b70efcfebc0da50e11e7 --- /dev/null +++ b/tester/harmony/svg/src/main/cpp/SvgNode.cpp @@ -0,0 +1,238 @@ +#include "SvgNode.h" +#include "utils/SvgUtils.h" +#include "SvgGradient.h" +#include "SvgPattern.h" +#include +#include +#include +#include + +namespace rnoh { +namespace svg { + +void SvgNode::InitStyle(const SvgBaseAttribute &attr) { + // reset gradient to null + attributes_.fillState.SetGradient(std::nullopt, false); + attributes_.strokeState.SetGradient(std::nullopt, false); + InheritAttr(attr); + if (hrefFill_) { + auto fillHref = attributes_.fillState.GetHref(); + if (!fillHref.empty()) { + auto gradient = GetGradient(fillHref); + if (gradient) { + attributes_.fillState.SetGradient(gradient.value(), true); + } + auto pattern = GetPatternAttr(fillHref); + if (pattern) { + attributes_.fillState.SetPattern(pattern); + } + } + auto strokeHref = attributes_.strokeState.GetHref(); + if (!strokeHref.empty()) { + auto gradient = GetGradient(strokeHref); + if (gradient) { + attributes_.strokeState.SetGradient(gradient.value(), true); + } + } + } + OnInitStyle(); + if (passStyle_) { + for (auto &node : children_) { + // pass down style only if child inheritStyle_ is true + node->InitStyle((node->inheritStyle_) ? attributes_ : SvgBaseAttribute()); + } + } +} + +void SvgNode::OnDrawTraversed(OH_Drawing_Canvas *canvas) { + auto smoothEdge = GetSmoothEdge(); + for (auto &node : children_) { + if (node && node->drawTraversed_) { + if (GreatNotEqual(smoothEdge, 0.0f)) { + node->SetSmoothEdge(smoothEdge); + } + node->Draw(canvas); + } + } +} + +const Rect &SvgNode::GetRootViewBox() const { + if (!context_) { + // DLOGE("Gradient failed, svgContext is null"); + static Rect empty; + return empty; + } + return context_->GetRootViewBox(); +} + +void SvgNode::OnClipPath(OH_Drawing_Canvas *canvas) { + DLOG(INFO) << "[SvgNode] Draw OnClipPath enter"; + if (!context_) { + DLOG(WARNING) << "[SvgNode] OnClipPath: Context is null!"; + return; + } + auto refSvgNode = context_->GetSvgNodeById(hrefClipPath_); + if (!refSvgNode) { + DLOG(WARNING) << "[SvgNode] OnClipPath: SvgNode is null!"; + return; + }; + auto clipPath = refSvgNode->AsPath(); + + // TODO: maybe return optional from AsPath? + // if (!clipPath) { + // DLOG(WARNING) << "[SvgNode] OnClipPath: Path is null!"; + // return; + // }; + + // Set clipRule through Drawing API + clipPath.SetFillType(attributes_.clipState.GetClipRuleForDraw()); + OH_Drawing_CanvasClipPath(canvas, clipPath.get(), OH_Drawing_CanvasClipOp::INTERSECT, true); +} + +void SvgNode::OnMask(OH_Drawing_Canvas *canvas) { + if (!context_) { + DLOG(INFO) << "NO CONTEXT"; + return; + } + auto refMask = context_->GetSvgNodeById(attributes_.maskId); + if (!refMask) { + return; + }; + refMask->Draw(canvas); +} + +void SvgNode::OnTransform(OH_Drawing_Canvas *canvas) { + // input transfrom: (float scaleX, float skewY, float skewX, float scaleY, float transX, float transY) + const auto &transform = attributes_.transform; + /* + /* (OH_Drawing_Matrix* , float scaleX, float skewX, float transX, float skewY, float scaleY, float transY, float + persp0, float persp1, float persp2 ) + */ + if (!attributes_.strokeState.GetVectorEffect() && transform.size() > 5) { + cTM_.SetMatrix(transform[0], transform[2], transform[4] * scale_, transform[1], transform[3], + transform[5] * scale_, 0, 0, 1.0); + OH_Drawing_CanvasConcatMatrix(canvas, cTM_.get()); + } +} + +std::optional SvgNode::GetGradient(const std::string &href) { + if (!context_) { + DLOG(INFO) << "NO CONTEXT"; + return std::nullopt; + } + auto refSvgNode = context_->GetSvgNodeById(href); + CHECK_NULL_RETURN(refSvgNode, std::nullopt); + auto svgGradient = std::dynamic_pointer_cast(refSvgNode); + if (svgGradient) { + return std::make_optional(svgGradient->GetGradient()); + } + return std::nullopt; +} + +std::shared_ptr SvgNode::GetPatternAttr(const std::string &href) { + if (!context_) { + DLOG(INFO) << "NO CONTEXT"; + return nullptr; + } + auto refSvgNode = context_->GetSvgNodeById(href); + CHECK_NULL_RETURN(refSvgNode, nullptr); + auto svgPattern = std::dynamic_pointer_cast(refSvgNode); + if (svgPattern) { + return svgPattern->GetPatternAttr(); + } + return nullptr; +} + +void SvgNode::Draw(OH_Drawing_Canvas *canvas) { + if (!display_) { + return; + } + // mask and filter create extra layers, need to record initial layer count + const auto count = OH_Drawing_CanvasGetSaveCount(canvas); + OH_Drawing_CanvasSave(canvas); + if (!hrefClipPath_.empty()) { + OnClipPath(canvas); + } + if (!attributes_.transform.empty()) { + OnTransform(canvas); + } + if (!attributes_.maskId.empty()) { + OnMask(canvas); + } + + OH_Drawing_CanvasGetTotalMatrix(canvas, lastCanvasMatrix_.get()); + + OnDraw(canvas); + // on marker + + OnDrawTraversed(canvas); + OH_Drawing_CanvasRestoreToCount(canvas, count); +} + +Rect SvgNode::AsBounds() { + auto path = AsPath(); + auto ohRect = path.GetBounds(); + float x = ohRect.GetLeft(); + float y = ohRect.GetTop(); + float width = ohRect.GetWidth(); + float height = ohRect.GetHeight(); + auto rect = Rect(x, y, width, height); + return rect; +} + +void SvgNode::ContextTraversal() { + if (!context_) { + DLOG(INFO) << "NO CONTEXT"; + return; + } + if (!attributes_.id.empty()) { + context_->Push(attributes_.id, shared_from_this()); + } + for (const auto &child : children_) { + child->SetContext(context_); + child->ContextTraversal(); + } +} + +double SvgNode::relativeOnWidth(Dimension length) { return length.RelativeConvertToPx(getCanvasWidth(), scale_); } + +double SvgNode::relativeOnHeight(Dimension length) { return length.RelativeConvertToPx(getCanvasHeight(), scale_); } + +double SvgNode::relativeOnOther(Dimension length) { return length.RelativeConvertToPx(getCanvasDiagonal(), scale_); } + +double SvgNode::getCanvasWidth() { + if (canvasWidth_ != -1) { + return canvasWidth_; + } + // TODO if root is text root + if (context_) { + canvasWidth_ = context_->getCanvasBounds().Width() / context_->getCanvasScaleX(); + return canvasWidth_; + } + return 0; +} + +double SvgNode::getCanvasHeight() { + if (canvasHeight_ != -1) { + return canvasHeight_; + } + // TODO if root is text root + if (context_) { + canvasHeight_ = context_->getCanvasBounds().Height() / context_->getCanvasScaleY(); + return canvasHeight_; + } + return 0; +} + +double SvgNode::getCanvasDiagonal() { + if (canvasDiagonal_ != -1) { + return canvasDiagonal_; + } + double powX = pow((getCanvasWidth()), 2); + double powY = pow((getCanvasHeight()), 2); + canvasDiagonal_ = sqrt(powX + powY) * M_SQRT1_2l; + return canvasDiagonal_; +} + +} // namespace svg +} // namespace rnoh \ No newline at end of file diff --git a/tester/harmony/svg/src/main/cpp/SvgNode.h b/tester/harmony/svg/src/main/cpp/SvgNode.h new file mode 100644 index 0000000000000000000000000000000000000000..4c93dc83319af3126c24b926f3476cb006341891 --- /dev/null +++ b/tester/harmony/svg/src/main/cpp/SvgNode.h @@ -0,0 +1,219 @@ +// from ArkUI "frameworks/core/components_ng/svg/parse/svg_node.h" +#pragma once + +#include +#include +#include "SvgBaseAttribute.h" +#include "SvgContext.h" +#include "properties/Decoration.h" +#include "properties/Dimension.h" +#include "properties/Size.h" +#include "Props.h" +#include "drawing/Path.h" +#include "utils/StringUtils.h" +#include "utils/SvgAttributesParser.h" +#include +#include +#include + +namespace rnoh { +namespace svg { + +class SvgNode : public std::enable_shared_from_this { +public: + SvgNode() = default; + virtual ~SvgNode() = default; + + std::shared_ptr GetContext() { return context_; } + void SetContext(std::shared_ptr context) { context_ = context; } + + void ContextTraversal(); + void InitStyle(const SvgBaseAttribute &attr); + + virtual void Draw(OH_Drawing_Canvas *canvas); + + virtual drawing::Path AsPath() { + DLOG(INFO) << "[SVGNode] AsPath"; + return drawing::Path(); + }; + + SvgBaseAttribute GetBaseAttributes() const { return attributes_; } + + void SetBaseAttributes(const SvgBaseAttribute &attr) { attributes_ = attr; } + + virtual void AppendChild(const std::shared_ptr &child) { children_.emplace_back(child); } + + virtual void removeChild(const std::shared_ptr &child) { + auto it = std::find(children_.begin(), children_.end(), child); + if (it != children_.end()) { + children_.erase(it); + } + } + + template void UpdateHrefRenderProps(const std::shared_ptr &props) { + attributes_.id = props->name; + display_ = props->display != "none"; + + if (hrefRender_) { + attributes_.transform = props->matrix; + attributes_.maskId = props->mask; + attributes_.selfOpacity = props->opacity; + attributes_.markerStart = props->markerStart; + attributes_.markerMid = props->markerMid; + attributes_.markerEnd = props->markerEnd; + // clipPath + attributes_.clipPath = props->clipPath; + hrefClipPath_ = props->clipPath; + } + } + + template void UpdateCommonProps(const std::shared_ptr &props) { + UpdateHrefRenderProps(props); + std::unordered_set set; + for (const auto &prop : props->propList) { + set.insert(prop); + } + + if (props->fill.type == 2) { + Color color = Color((uint32_t)*props->fill.payload); + color.SetUseCurrentColor(true); + attributes_.fillState.SetColor(color, true); + } else if (facebook::react::isColorMeaningful(props->fill.payload)) { + attributes_.fillState.SetColor(Color((uint32_t)*props->fill.payload), set.count("fill")); + } else { + attributes_.fillState.SetColor(Color::TRANSPARENT, set.count("fill")); + } + attributes_.fillState.SetHref(props->fill.brushRef); + + if (props->stroke.type == 2) { + Color color = Color((uint32_t)*props->stroke.payload); + color.SetUseCurrentColor(true); + attributes_.strokeState.SetColor(color, true); + } else if (facebook::react::isColorMeaningful(props->stroke.payload)) { + attributes_.strokeState.SetColor(Color((uint32_t)*props->stroke.payload), set.count("stroke")); + } else { + attributes_.strokeState.SetColor(Color::TRANSPARENT, set.count("stroke")); + } + attributes_.strokeState.SetHref(props->stroke.brushRef); + + attributes_.fillState.SetOpacity(std::clamp(props->fillOpacity, 0.0, 1.0), set.count("fillOpacity")); + // todo Inheritance situation + attributes_.fillState.SetFillRule(static_cast(props->fillRule), true); + attributes_.strokeState.SetLineWidth(vpToPx(StringUtils::StringToDouble(props->strokeWidth)), + set.count("strokeWidth")); + attributes_.strokeState.SetStrokeDashArray(StringUtils::stringVectorToDoubleVector(props->strokeDasharray), + set.count("strokeDasharray")); + attributes_.strokeState.SetStrokeDashOffset(vpToPx(props->strokeDashoffset), set.count("strokeDashoffset")); + attributes_.strokeState.SetLineCap(SvgAttributesParser::GetLineCapStyle(std::to_string(props->strokeLinecap)), + set.count("strokeLinecap")); + attributes_.strokeState.SetLineJoin( + SvgAttributesParser::GetLineJoinStyle(std::to_string(props->strokeLinejoin)), set.count("strokeLinejoin")); + attributes_.strokeState.SetVectorEffect(props->vectorEffect); + auto limit = vpToPx(props->strokeMiterlimit); + if (GreatOrEqual(limit, 1.0)) { + attributes_.strokeState.SetMiterLimit(limit, set.count("strokeMiterlimit")); + } + attributes_.strokeState.SetOpacity(std::clamp(props->strokeOpacity, 0.0, 1.0), set.count("strokeOpacity")); + attributes_.clipState.SetClipRule(static_cast(props->clipRule), true); + } + + virtual Rect AsBounds(); + + void SetScale(const double &scale) { scale_ = scale; } + + double GetScale() const { return scale_; } + + void InheritAttr(const SvgBaseAttribute &parent) { + attributes_.Inherit(parent); + // svg color -> current color + if (attributes_.strokeState.GetColor().IsUseCurrentColor()) { + attributes_.strokeState.SetColor(context_->GetSvgColor(), true); + } + if (attributes_.fillState.GetColor().IsUseCurrentColor()) { + attributes_.fillState.SetColor(context_->GetSvgColor(), true); + } + } + + void InheritUseAttr(const SvgBaseAttribute &parent) { attributes_.InheritFromUse(parent); } + + drawing::Matrix lastCanvasMatrix_; + + double relativeOnWidth(Dimension length); + double relativeOnHeight(Dimension length); + double relativeOnOther(Dimension length); + + double getCanvasWidth(); + double getCanvasHeight(); + double getCanvasDiagonal(); + +protected: + // override as need by derived class + // called by function AppendChild + virtual void OnAppendChild(const std::shared_ptr &child) {} + // called by function InitStyle + virtual void OnInitStyle() {} + + virtual void OnDraw(OH_Drawing_Canvas *canvas) {} + virtual void OnDrawTraversed(OH_Drawing_Canvas *canvas); + void OnClipPath(OH_Drawing_Canvas *canvas); + void OnMask(OH_Drawing_Canvas *canvas); + void OnTransform(OH_Drawing_Canvas *canvas); + + const Rect &GetRootViewBox() const; + + void SetSmoothEdge(float edge) { attributes_.smoothEdge = edge; } + float GetSmoothEdge() const { return attributes_.smoothEdge; } + + std::optional GetGradient(const std::string &href); + + std::shared_ptr GetPatternAttr(const std::string &href); + + void InitNoneFlag() { + hrefFill_ = false; + hrefRender_ = false; + passStyle_ = false; + inheritStyle_ = false; + drawTraversed_ = false; + } + + SvgBaseAttribute attributes_; + + std::shared_ptr context_; + + std::vector> children_; + + std::string hrefClipPath_; + std::string imagePath_; + + // TODO get densityPixels in CAPI + double scale_ = 3.25; + + drawing::Matrix cTM_; + + bool display_ = true; + + bool hrefFill_ = true; // get fill attributes from reference + bool hrefRender_ = true; // get render attr (mask, filter, transform, opacity, + // clip path) from reference + bool passStyle_ = true; // pass style attributes to child node, TAGS + // circle/path/line/... = false + bool inheritStyle_ = true; // inherit style attributes from parent node, TAGS + // mask/defs/pattern/filter = false + bool drawTraversed_ = true; // enable OnDraw, TAGS mask/defs/pattern/filter = false + + double canvasHeight_ = -1; + + double canvasWidth_ = -1; + + double canvasDiagonal_ = -1; + + /* + N[1/Sqrt[2], 36] + The inverse of the square root of 2. + Provide enough digits for the 128-bit IEEE quad (36 significant digits). + */ + const double M_SQRT1_2l = 0.707106781186547524400844362104849039; +}; + +} // namespace svg +} // namespace rnoh diff --git a/tester/harmony/svg/src/main/cpp/SvgPath.cpp b/tester/harmony/svg/src/main/cpp/SvgPath.cpp new file mode 100644 index 0000000000000000000000000000000000000000..ec3bfa5dda691a6753418e2a6512d11a4a76962b --- /dev/null +++ b/tester/harmony/svg/src/main/cpp/SvgPath.cpp @@ -0,0 +1,46 @@ +/* + * Copyright (c) 2022-2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "SvgPath.h" +#include "utils/PathParserUtils.h" +#include +#include "utils/PathParserUtils.h" + +namespace rnoh { +namespace svg { + +void SvgPath::setD(const std::string &d) { + d_ = d; + PathParserUtils parser; + parser.mScale = scale_; + path_ = std::move(parser.parse(d.c_str())); + elements_ = parser.elements; + for (PathElement &elem : elements_) { + for (Point &point : elem.points) { + point.x *= scale_; + point.y *= scale_; + } + } +} + +drawing::Path SvgPath::AsPath() { + if (path_.get()) { + return path_; + } + return drawing::Path(); +} + +} // namespace svg +} // namespace rnoh diff --git a/tester/harmony/svg/src/main/cpp/SvgPath.h b/tester/harmony/svg/src/main/cpp/SvgPath.h new file mode 100644 index 0000000000000000000000000000000000000000..adda7d6a4b27f9d5b8f478d9ecbe6084226c391f --- /dev/null +++ b/tester/harmony/svg/src/main/cpp/SvgPath.h @@ -0,0 +1,22 @@ +#pragma once +#include "SvgGraphic.h" + +namespace rnoh { +namespace svg { + +class SvgPath : public SvgGraphic { +private: + std::string d_; + drawing::Path path_{}; + +public: + SvgPath() = default; + ~SvgPath() override = default; + + void setD(const std::string &d); + + drawing::Path AsPath() override; +}; + +} // namespace svg +} // namespace rnoh \ No newline at end of file diff --git a/tester/harmony/svg/src/main/cpp/SvgPattern.cpp b/tester/harmony/svg/src/main/cpp/SvgPattern.cpp new file mode 100644 index 0000000000000000000000000000000000000000..8fbce0926af754984cdec7f272ede45b5dbee807 --- /dev/null +++ b/tester/harmony/svg/src/main/cpp/SvgPattern.cpp @@ -0,0 +1,79 @@ +/* + * Copyright (c) 2022-2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + +#include "SvgPattern.h" + +namespace rnoh { +namespace svg { + +SvgPattern::SvgPattern() { DLOG(INFO) << "[SvgPattern] init"; } + +void SvgPattern::OnDrawTraversedBefore(OH_Drawing_Canvas *canvas) { + DLOG(INFO) << "[pattern] OnDrawTraversedBefore"; +} + +void SvgPattern::OnDrawTraversedAfter(OH_Drawing_Canvas *canvas) { DLOG(INFO) << "[pattern] OnDrawTraversedAfter"; } + +std::shared_ptr SvgPattern::GetPatternAttr() { return patternAttr; } + +void SvgPattern::setPatternX(Dimension x) { patternAttr->setPatternX(x); } + +void SvgPattern::setPatternY(Dimension y) { patternAttr->setPatternY(y); } + +void SvgPattern::setHeight(Dimension height) { patternAttr->setHeight(height); } + +void SvgPattern::setWidth(Dimension width) { patternAttr->setWidth(width); } + +void SvgPattern::setPatternContentUnits(int patternContentUnits) { + patternAttr->setPatternContentUnits(patternContentUnits); +} + +void SvgPattern::setPatternUnits(int patternUnits) { patternAttr->setPatternUnits(patternUnits); } + + +void SvgPattern::setViewBox(Rect viewBox) { patternAttr->setViewBox(viewBox); } + +void SvgPattern::setmMinX(float mMinX) { patternAttr->setmMinX(mMinX); } + +void SvgPattern::setmMinY(float mMinY) { patternAttr->setmMinY(mMinY); } + +void SvgPattern::setmVbWidth(float mVbWidth) { patternAttr->setmVbWidth(mVbWidth); } + +void SvgPattern::setmVbHeight(float mVbHeight) { patternAttr->setmVbHeight(mVbHeight); } + +void SvgPattern::setmAlign(std::string mAlign) { patternAttr->setmAlign(mAlign); } + +void SvgPattern::setmMeetOrSlice(int mMeetOrSlice) { patternAttr->setmMeetOrSlice(mMeetOrSlice); } + +void SvgPattern::setPatternTransforms(std::vector patternTransforms) { + std::vector newMatrix{ + 1, 0, 0, 0, 1, 0, 0, 0, 1, + }; + if (patternTransforms.size() == 6) { + newMatrix[0] = (Float)patternTransforms[0]; + newMatrix[1] = (Float)patternTransforms[2]; + newMatrix[2] = (Float)patternTransforms[4] * scale_; + newMatrix[3] = (Float)patternTransforms[1]; + newMatrix[4] = (Float)patternTransforms[3]; + newMatrix[5] = (Float)patternTransforms[5] * scale_; + patternAttr->setPatternTransform(std::move(newMatrix)); + } +} + +void SvgPattern::setImage(OH_Drawing_Image *image) { patternAttr->setImage(image); } + +} // namespace svg +} // namespace rnoh \ No newline at end of file diff --git a/tester/harmony/svg/src/main/cpp/SvgPattern.h b/tester/harmony/svg/src/main/cpp/SvgPattern.h new file mode 100644 index 0000000000000000000000000000000000000000..4c88f52d55c9d14b5e4b8ba700eb63fd25484af3 --- /dev/null +++ b/tester/harmony/svg/src/main/cpp/SvgPattern.h @@ -0,0 +1,58 @@ +#pragma once + +#include +#include "SvgQuote.h" +#include "utils/SvgAttributesParser.h" + +namespace rnoh { +namespace svg { + +class SvgPattern : public SvgQuote { + +public: + using Float = facebook::react::Float; + SvgPattern(); + ~SvgPattern() = default; + + virtual void OnDrawTraversedBefore(OH_Drawing_Canvas *canvas) override; + virtual void OnDrawTraversedAfter(OH_Drawing_Canvas *canvas) override; + void SaveDefinition(OH_Drawing_Canvas *canvas); + void ConcatMatrix(OH_Drawing_Canvas *canvas); + std::shared_ptr GetPatternAttr(); + + void setPatternX(Dimension x); + + void setPatternY(Dimension y); + + void setHeight(Dimension height); + + void setWidth(Dimension width); + + void setPatternUnits(int patternUnits); + + void setPatternContentUnits(int patternContentUnits); + + void setViewBox(Rect viewBox); + + void setImage(OH_Drawing_Image *image); + + void setmMinX(float mMinX); + + void setmMinY(float mMinUY); + + void setmVbWidth(float mVbWidth); + + void setmVbHeight(float mVbHeight); + + void setmAlign(std::string mAlign); + + void setmMeetOrSlice(int mMeetOrSlice); + + void setPatternTransforms(std::vector gradientTransforms); +private: + std::shared_ptr patternAttr = std::make_shared(); + double scale_ = 3.25010318; + }; + +} // namespace svg +} // namespace rnoh \ No newline at end of file diff --git a/tester/harmony/svg/src/main/cpp/SvgQuote.h b/tester/harmony/svg/src/main/cpp/SvgQuote.h new file mode 100644 index 0000000000000000000000000000000000000000..6e3dfd289b025f9846c198092cb92333f95c52f5 --- /dev/null +++ b/tester/harmony/svg/src/main/cpp/SvgQuote.h @@ -0,0 +1,65 @@ +#pragma once +#include "SvgNode.h" +#include + +namespace rnoh { +namespace svg { + +class SvgQuote : public SvgNode { +public: + SvgQuote() : SvgNode() { InitHrefFlag(); } + ~SvgQuote() override = default; + + drawing::Path getClipPath(drawing::Path path) { + DLOG(INFO) << "[SvgQuote] getClipPath"; + for (const auto &child : children_) { + auto childPath = child->AsPath(); + path.AddPath(childPath); + } + return path; + } + + drawing::Path getClipPath(drawing::Path path, drawing::Path::OpMode op) { + DLOG(INFO) << "[SvgQuote] getClipPath with op, op = " << op; + for (const auto &child : children_) { + auto childPath = child->AsPath(); + path.Op(childPath, op); + } + return path; + } + + drawing::Path AsPath() override { + DLOG(INFO) << "[SvgQuote] AsPath"; + drawing::Path path; + + if (attributes_.clipState.IsEvenodd()) { + return getClipPath(path); + } else { + return getClipPath(path, drawing::Path::OpMode::PATH_OP_MODE_UNION); + } + } + + void Draw(OH_Drawing_Canvas *canvas) override { + // render composition on other svg tags + DLOG(INFO) << "[SvgQuote] Draw"; + OnDrawTraversedBefore(canvas); + OnDrawTraversed(canvas); + OnDrawTraversedAfter(canvas); + } + +protected: + virtual void OnDrawTraversedBefore(OH_Drawing_Canvas *canvas) {} + virtual void OnDrawTraversedAfter(OH_Drawing_Canvas *canvas) {} + + // mask/pattern/filter/clipPath + void InitHrefFlag() { + hrefFill_ = true; + hrefRender_ = false; + passStyle_ = true; + inheritStyle_ = false; + drawTraversed_ = false; + } +}; + +} // namespace svg +} // namespace rnoh diff --git a/tester/harmony/svg/src/main/cpp/SvgRect.cpp b/tester/harmony/svg/src/main/cpp/SvgRect.cpp new file mode 100644 index 0000000000000000000000000000000000000000..99566191198b1c10d3a4dfebdef40ec6a038f8d5 --- /dev/null +++ b/tester/harmony/svg/src/main/cpp/SvgRect.cpp @@ -0,0 +1,52 @@ +#include "SvgRect.h" +#include "drawing/Rect.h" + +namespace rnoh { +namespace svg { + +drawing::Path SvgRect::AsPath() { + drawing::Path path; + double x = relativeOnWidth(rectAttribute_.x); + double y = relativeOnHeight(rectAttribute_.y); + double width = relativeOnWidth(rectAttribute_.width); + double height = relativeOnHeight(rectAttribute_.height); + + if (rectAttribute_.rx != Dimension(-1.0, DimensionUnit::PX) || + rectAttribute_.ry != Dimension(-1.0, DimensionUnit::PX)) { + double rx; + double ry; + if (rectAttribute_.rx == Dimension(-1.0, DimensionUnit::PX)) { + ry = relativeOnHeight(rectAttribute_.ry); + rx = ry; + } else if (rectAttribute_.ry == Dimension(-1.0, DimensionUnit::PX)) { + rx = relativeOnWidth(rectAttribute_.rx); + ry = rx; + } else { + rx = relativeOnWidth(rectAttribute_.rx); + ry = relativeOnHeight(rectAttribute_.ry); + } + + if (rx > width / 2.0) { + rx = width / 2.0; + } + + if (ry > height / 2.0) { + ry = height / 2.0; + } + drawing::Rect rect(x, y, x + width, y + height); + drawing::RoundRect roundRect(std::move(rect), rx, ry); + path.AddRoundRect(roundRect, PATH_DIRECTION_CW); + } else { + path.AddRect(x, y, x + width, y + height, PATH_DIRECTION_CW); + } + + elements_ = {PathElement(ElementType::kCGPathElementMoveToPoint, {Point(x, y)}), + PathElement(ElementType::kCGPathElementAddLineToPoint, {Point(x + width, y)}), + PathElement(ElementType::kCGPathElementAddLineToPoint, {Point(x + width, y + height)}), + PathElement(ElementType::kCGPathElementAddLineToPoint, {Point(x, y + height)}), + PathElement(ElementType::kCGPathElementAddLineToPoint, {Point(x, y)})}; + return path; +}; + +} // namespace svg +} // namespace rnoh diff --git a/tester/harmony/svg/src/main/cpp/SvgRect.h b/tester/harmony/svg/src/main/cpp/SvgRect.h new file mode 100644 index 0000000000000000000000000000000000000000..64ec91e2ffe8d72d43ffc727b7f8f215858c3b61 --- /dev/null +++ b/tester/harmony/svg/src/main/cpp/SvgRect.h @@ -0,0 +1,27 @@ +#pragma once + +#include "SvgGraphic.h" +#include "utils/SvgAttributesParser.h" + +namespace rnoh { +namespace svg { + +class SvgRect : public SvgGraphic { +public: + using Float = facebook::react::Float; + SvgRect() = default; + ~SvgRect() override = default; + + void SetX(const std::string &x) { rectAttribute_.x = SvgAttributesParser::ParseDimension(x, true); } + void SetY(const std::string &y) { rectAttribute_.y = SvgAttributesParser::ParseDimension(y, true); } + void SetRX(const std::string &rx) { rectAttribute_.rx = SvgAttributesParser::ParseDimension(rx, true); } + void SetRY(const std::string &ry) { rectAttribute_.ry = SvgAttributesParser::ParseDimension(ry, true); } + void SetWidth(const std::string &width) { rectAttribute_.width = SvgAttributesParser::ParseDimension(width, true); } + void SetHeight(const std::string &height) { rectAttribute_.height = SvgAttributesParser::ParseDimension(height, true); } + drawing::Path AsPath() override; +private: + SvgRectAttribute rectAttribute_; +}; + +} // namespace svg +} // namespace rnoh \ No newline at end of file diff --git a/tester/harmony/svg/src/main/cpp/SvgShadowNodes.cpp b/tester/harmony/svg/src/main/cpp/SvgShadowNodes.cpp new file mode 100644 index 0000000000000000000000000000000000000000..410b7b4993f2cac31c3c27bd3f63c9a78f9cb70c --- /dev/null +++ b/tester/harmony/svg/src/main/cpp/SvgShadowNodes.cpp @@ -0,0 +1,39 @@ + +/** + * This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen). + * + * Do not edit this file as changes may cause incorrect behavior and will be lost + * once the code is regenerated. + * + * @generated by codegen project: GenerateShadowNodeCpp.js + */ + +#include "SvgShadowNodes.h" + +namespace facebook { +namespace react { + +extern const char RNSVGSvgViewAndroidComponentName[] = "RNSVGSvgViewAndroid"; +extern const char RNSVGCircleComponentName[] = "RNSVGCircle"; +extern const char RNSVGClipPathComponentName[] = "RNSVGClipPath"; +extern const char RNSVGDefsComponentName[] = "RNSVGDefs"; +extern const char RNSVGEllipseComponentName[] = "RNSVGEllipse"; +extern const char RNSVGForeignObjectComponentName[] = "RNSVGForeignObject"; +extern const char RNSVGGroupComponentName[] = "RNSVGGroup"; +extern const char RNSVGSvgViewComponentName[] = "RNSVGSvgView"; +extern const char RNSVGLinearGradientComponentName[] = "RNSVGLinearGradient"; +extern const char RNSVGLineComponentName[] = "RNSVGLine"; +extern const char RNSVGMarkerComponentName[] = "RNSVGMarker"; +extern const char RNSVGMaskComponentName[] = "RNSVGMask"; +extern const char RNSVGPathComponentName[] = "RNSVGPath"; +extern const char RNSVGPatternComponentName[] = "RNSVGPattern"; +extern const char RNSVGRadialGradientComponentName[] = "RNSVGRadialGradient"; +extern const char RNSVGRectComponentName[] = "RNSVGRect"; +extern const char RNSVGSymbolComponentName[] = "RNSVGSymbol"; +extern const char RNSVGTextComponentName[] = "RNSVGText"; +extern const char RNSVGTextPathComponentName[] = "RNSVGTextPath"; +extern const char RNSVGTSpanComponentName[] = "RNSVGTSpan"; +extern const char RNSVGUseComponentName[] = "RNSVGUse"; + +} // namespace react +} // namespace facebook diff --git a/tester/harmony/svg/src/main/cpp/SvgShadowNodes.h b/tester/harmony/svg/src/main/cpp/SvgShadowNodes.h new file mode 100644 index 0000000000000000000000000000000000000000..39d12a14aa9c6f88f56c65f6c93ab90e969075ee --- /dev/null +++ b/tester/harmony/svg/src/main/cpp/SvgShadowNodes.h @@ -0,0 +1,256 @@ + +/** + * This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen). + * + * Do not edit this file as changes may cause incorrect behavior and will be lost + * once the code is regenerated. + * + * @generated by codegen project: GenerateShadowNodeH.js + */ + +#pragma once + +#include "EventEmitters.h" +#include "Props.h" +#include "States.h" +#include +#include + +namespace facebook { +namespace react { + +JSI_EXPORT extern const char RNSVGSvgViewAndroidComponentName[]; + +/* + * `ShadowNode` for component. + */ +using RNSVGSvgViewAndroidShadowNode = ConcreteViewShadowNode< + RNSVGSvgViewAndroidComponentName, + RNSVGSvgViewAndroidProps, + RNSVGSvgViewAndroidEventEmitter, + RNSVGSvgViewAndroidState>; + +JSI_EXPORT extern const char RNSVGCircleComponentName[]; + +/* + * `ShadowNode` for component. + */ +using RNSVGCircleShadowNode = ConcreteViewShadowNode< + RNSVGCircleComponentName, + RNSVGCircleProps, + RNSVGCircleEventEmitter, + RNSVGCircleState>; + +JSI_EXPORT extern const char RNSVGClipPathComponentName[]; + +/* + * `ShadowNode` for component. + */ +using RNSVGClipPathShadowNode = ConcreteViewShadowNode< + RNSVGClipPathComponentName, + RNSVGClipPathProps, + RNSVGClipPathEventEmitter, + RNSVGClipPathState>; + +JSI_EXPORT extern const char RNSVGDefsComponentName[]; + +/* + * `ShadowNode` for component. + */ +using RNSVGDefsShadowNode = ConcreteViewShadowNode< + RNSVGDefsComponentName, + RNSVGDefsProps, + RNSVGDefsEventEmitter, + RNSVGDefsState>; + +JSI_EXPORT extern const char RNSVGEllipseComponentName[]; + +/* + * `ShadowNode` for component. + */ +using RNSVGEllipseShadowNode = ConcreteViewShadowNode< + RNSVGEllipseComponentName, + RNSVGEllipseProps, + RNSVGEllipseEventEmitter, + RNSVGEllipseState>; + +JSI_EXPORT extern const char RNSVGForeignObjectComponentName[]; + +/* + * `ShadowNode` for component. + */ +using RNSVGForeignObjectShadowNode = ConcreteViewShadowNode< + RNSVGForeignObjectComponentName, + RNSVGForeignObjectProps, + RNSVGForeignObjectEventEmitter, + RNSVGForeignObjectState>; + +JSI_EXPORT extern const char RNSVGGroupComponentName[]; + +/* + * `ShadowNode` for component. + */ +using RNSVGGroupShadowNode = ConcreteViewShadowNode< + RNSVGGroupComponentName, + RNSVGGroupProps, + RNSVGGroupEventEmitter, + RNSVGGroupState>; + +JSI_EXPORT extern const char RNSVGSvgViewComponentName[]; + +/* + * `ShadowNode` for component. + */ +using RNSVGSvgViewShadowNode = ConcreteViewShadowNode< + RNSVGSvgViewComponentName, + RNSVGSvgViewProps, + RNSVGSvgViewEventEmitter, + RNSVGSvgViewState>; + +JSI_EXPORT extern const char RNSVGLinearGradientComponentName[]; + +/* + * `ShadowNode` for component. + */ +using RNSVGLinearGradientShadowNode = ConcreteViewShadowNode< + RNSVGLinearGradientComponentName, + RNSVGLinearGradientProps, + RNSVGLinearGradientEventEmitter, + RNSVGLinearGradientState>; + +JSI_EXPORT extern const char RNSVGLineComponentName[]; + +/* + * `ShadowNode` for component. + */ +using RNSVGLineShadowNode = ConcreteViewShadowNode< + RNSVGLineComponentName, + RNSVGLineProps, + RNSVGLineEventEmitter, + RNSVGLineState>; + +JSI_EXPORT extern const char RNSVGMarkerComponentName[]; + +/* + * `ShadowNode` for component. + */ +using RNSVGMarkerShadowNode = ConcreteViewShadowNode< + RNSVGMarkerComponentName, + RNSVGMarkerProps, + RNSVGMarkerEventEmitter, + RNSVGMarkerState>; + +JSI_EXPORT extern const char RNSVGMaskComponentName[]; + +/* + * `ShadowNode` for component. + */ +using RNSVGMaskShadowNode = ConcreteViewShadowNode< + RNSVGMaskComponentName, + RNSVGMaskProps, + RNSVGMaskEventEmitter, + RNSVGMaskState>; + +JSI_EXPORT extern const char RNSVGPathComponentName[]; + +/* + * `ShadowNode` for component. + */ +using RNSVGPathShadowNode = ConcreteViewShadowNode< + RNSVGPathComponentName, + RNSVGPathProps, + RNSVGPathEventEmitter, + RNSVGPathState>; + +JSI_EXPORT extern const char RNSVGPatternComponentName[]; + +/* + * `ShadowNode` for component. + */ +using RNSVGPatternShadowNode = ConcreteViewShadowNode< + RNSVGPatternComponentName, + RNSVGPatternProps, + RNSVGPatternEventEmitter, + RNSVGPatternState>; + +JSI_EXPORT extern const char RNSVGRadialGradientComponentName[]; + +/* + * `ShadowNode` for component. + */ +using RNSVGRadialGradientShadowNode = ConcreteViewShadowNode< + RNSVGRadialGradientComponentName, + RNSVGRadialGradientProps, + RNSVGRadialGradientEventEmitter, + RNSVGRadialGradientState>; + +JSI_EXPORT extern const char RNSVGRectComponentName[]; + +/* + * `ShadowNode` for component. + */ +using RNSVGRectShadowNode = ConcreteViewShadowNode< + RNSVGRectComponentName, + RNSVGRectProps, + RNSVGRectEventEmitter, + RNSVGRectState>; + +JSI_EXPORT extern const char RNSVGSymbolComponentName[]; + +/* + * `ShadowNode` for component. + */ +using RNSVGSymbolShadowNode = ConcreteViewShadowNode< + RNSVGSymbolComponentName, + RNSVGSymbolProps, + RNSVGSymbolEventEmitter, + RNSVGSymbolState>; + +JSI_EXPORT extern const char RNSVGTextComponentName[]; + +/* + * `ShadowNode` for component. + */ +using RNSVGTextShadowNode = ConcreteViewShadowNode< + RNSVGTextComponentName, + RNSVGTextProps, + RNSVGTextEventEmitter, + RNSVGTextState>; + +JSI_EXPORT extern const char RNSVGTextPathComponentName[]; + +/* + * `ShadowNode` for component. + */ +using RNSVGTextPathShadowNode = ConcreteViewShadowNode< + RNSVGTextPathComponentName, + RNSVGTextPathProps, + RNSVGTextPathEventEmitter, + RNSVGTextPathState>; + +JSI_EXPORT extern const char RNSVGTSpanComponentName[]; + +/* + * `ShadowNode` for component. + */ +using RNSVGTSpanShadowNode = ConcreteViewShadowNode< + RNSVGTSpanComponentName, + RNSVGTSpanProps, + RNSVGTSpanEventEmitter, + RNSVGTSpanState>; + +JSI_EXPORT extern const char RNSVGUseComponentName[]; + +/* + * `ShadowNode` for component. + */ +using RNSVGUseShadowNode = ConcreteViewShadowNode< + RNSVGUseComponentName, + RNSVGUseProps, + RNSVGUseEventEmitter, + RNSVGUseState>; + + + +} // namespace react +} // namespace facebook diff --git a/tester/harmony/svg/src/main/cpp/SvgSvg.cpp b/tester/harmony/svg/src/main/cpp/SvgSvg.cpp new file mode 100644 index 0000000000000000000000000000000000000000..bce0e570881482fbb130d2f0661116bb98eeb899 --- /dev/null +++ b/tester/harmony/svg/src/main/cpp/SvgSvg.cpp @@ -0,0 +1,82 @@ +#include "SvgSvg.h" +#include "properties/Size.h" +#include "utils/LinearMap.h" +#include "utils/StringUtils.h" +#include "utils/SvgUtils.h" +#include "properties/ViewBox.h" +#include +#include +#include + +namespace rnoh { +namespace svg { + +namespace { +const int MOS_MEET = 0; +const int MOS_SLICE = 1; +const int MOS_NONE = 2; +} // namespace + +SvgSvg::SvgSvg() : SvgGroup() {} + +drawing::Path SvgSvg::AsPath() { + drawing::Path path; + for (const auto &child : children_) { + auto childPath = child->AsPath(); + path.Union(childPath); + } + return path; +} + +Size SvgSvg::GetSize() const { return {width_, height_}; } + +Rect SvgSvg::GetViewBox() const { + return Rect(svgAttribute_.vbX.ConvertToPx(scale_), svgAttribute_.vbY.ConvertToPx(scale_), + svgAttribute_.vbWidth.ConvertToPx(scale_), svgAttribute_.vbHeight.ConvertToPx(scale_)); +} + +drawing::Matrix SvgSvg::FitCanvas(OH_Drawing_Canvas *canvas) { + const auto svgSize = GetSize(); + // TODO Since OH_Drawing API return px and RN pass vp + const auto vbRect = GetViewBox(); // should be viewBox attribute + const auto eRect = Rect(svgAttribute_.x.ConvertToPx(scale_), svgAttribute_.y.ConvertToPx(scale_), svgSize.Width(), + svgSize.Height()); + DLOG(INFO) << "[FitCanvas] viewBox = " << vbRect.ToString() << " svgSize = " << svgSize.ToString() + << " canvas = " << OH_Drawing_CanvasGetWidth(canvas) << ", " << OH_Drawing_CanvasGetHeight(canvas); + drawing::Rect clipRect(0.0f, 0.0f, svgSize.Width(), svgSize.Height()); + OH_Drawing_CanvasClipRect(canvas, clipRect.get(), OH_Drawing_CanvasClipOp::INTERSECT, true); + drawing::Matrix transformMatrix; + if (vbRect.IsValid()) { + transformMatrix = ViewBox::getTransform(vbRect, eRect, svgAttribute_.align, svgAttribute_.meetOrSlice); + OH_Drawing_CanvasConcatMatrix(canvas, transformMatrix.get()); + } + return transformMatrix; +} + +void SvgSvg::Draw(OH_Drawing_Canvas *canvas) { + float width = OH_Drawing_CanvasGetWidth(canvas); + float height = OH_Drawing_CanvasGetHeight(canvas); + context_->SetCanvasBounds(Rect(0.0f, 0.0f, width, height)); + context_->SetRootViewBox(GetViewBox()); + + // width_ = relativeOnWidth(svgAttribute_.width); + // height_ = relativeOnHeight(svgAttribute_.height); + width_ = width; + height_ = height; + DLOG(INFO) << "[svgView] bbHeight: " << svgAttribute_.height.Value(); + DLOG(INFO) << "[svgView] bbWidth: " << svgAttribute_.height.Value(); + DLOG(INFO) << "[svgView] svg Height: " << height_; + DLOG(INFO) << "[svgView] svg Width: " << width_; + DLOG(INFO) << "[svgView] canvas Height: " << height; + DLOG(INFO) << "[svgView] canvas Width: " << width; + context_->SetSvgSize(Size(width_, height_)); + // apply scale + OH_Drawing_CanvasSave(canvas); + auto canvasTransformMatrix = FitCanvas(canvas); + context_->SetCanvasScale(canvasTransformMatrix.GetValue(0), canvasTransformMatrix.GetValue(4)); + SvgNode::Draw(canvas); + OH_Drawing_CanvasRestore(canvas); +}; + +} // namespace svg +} // namespace rnoh diff --git a/tester/harmony/svg/src/main/cpp/SvgSvg.h b/tester/harmony/svg/src/main/cpp/SvgSvg.h new file mode 100644 index 0000000000000000000000000000000000000000..9499a90c7aedfa6414f84ef70f80ee5f55d02740 --- /dev/null +++ b/tester/harmony/svg/src/main/cpp/SvgSvg.h @@ -0,0 +1,46 @@ +#pragma once + +#include +#include +#include "SvgGroup.h" +#include "utils/SvgAttributesParser.h" + +namespace rnoh { +namespace svg { + +class SvgSvg : public SvgGroup { +public: + SvgSvg(); + ~SvgSvg() override = default; + + drawing::Path AsPath() override; + + Size GetSize() const; + + Rect GetViewBox() const; + + void Draw(OH_Drawing_Canvas *canvas) override; + + void SetVbX(const double &vbX) { svgAttribute_.vbX = Dimension(vbX, DimensionUnit::VP); } + void SetVbY(const double &vbY) { svgAttribute_.vbY = Dimension(vbY, DimensionUnit::VP); } + void SetVbWidth(const double &vbWidth) { svgAttribute_.vbWidth = Dimension(vbWidth, DimensionUnit::VP); } + void SetVbHeight(const double &vbHeight) { svgAttribute_.vbHeight = Dimension(vbHeight, DimensionUnit::VP); } + void SetX(const double &x) { svgAttribute_.x = Dimension(x, DimensionUnit::VP); } + void SetY(const double &y) { svgAttribute_.y = Dimension(y, DimensionUnit::VP); } + void SetWidth(const std::string &width) { svgAttribute_.width = SvgAttributesParser::ParseDimension(width, true); } + void SetHeight(const std::string &height) { svgAttribute_.height = SvgAttributesParser::ParseDimension(height, true); } + void SetAlign(const std::string &align) { svgAttribute_.align = align; } + void SetMeetOrSlice(const int &meetOrSlice) { svgAttribute_.meetOrSlice = meetOrSlice; } + +private: + SvgAttribute svgAttribute_; + + float width_ = 0; + + float height_ = 0; + + drawing::Matrix FitCanvas(OH_Drawing_Canvas *canvas); +}; + +} // namespace svg +} // namespace rnoh diff --git a/tester/harmony/svg/src/main/cpp/SvgSymbol.cpp b/tester/harmony/svg/src/main/cpp/SvgSymbol.cpp new file mode 100644 index 0000000000000000000000000000000000000000..b2fea7ce915e772b04cf7623982d2df36a889eb3 --- /dev/null +++ b/tester/harmony/svg/src/main/cpp/SvgSymbol.cpp @@ -0,0 +1,19 @@ +#include "SvgSymbol.h" + +namespace rnoh { +namespace svg { + +void SvgSymbol::drawSymbol(OH_Drawing_Canvas *canvas, float width, float height) { + if (!mAlign.empty()) { + Rect vbRect(vpToPx(mMinX), vpToPx(mMinY), vpToPx(mMinX + mVbWidth), vpToPx(mMinY + mVbHeight)); + Rect eRect(0, 0, vpToPx(width), vpToPx(height)); + if (vbRect.IsValid()) { + drawing::Matrix viewBoxMatrix = ViewBox::getTransform(vbRect, eRect, mAlign, mMeetOrSlice); + OH_Drawing_CanvasConcatMatrix(canvas, viewBoxMatrix.get()); + } + Draw(canvas); + } +} + +} // namespace svg +} // namespace rnoh \ No newline at end of file diff --git a/tester/harmony/svg/src/main/cpp/SvgSymbol.h b/tester/harmony/svg/src/main/cpp/SvgSymbol.h new file mode 100644 index 0000000000000000000000000000000000000000..5d1717785cf73e1de060306bed42d0ebc915dec8 --- /dev/null +++ b/tester/harmony/svg/src/main/cpp/SvgSymbol.h @@ -0,0 +1,39 @@ +#pragma once + +// +// Created on 2024/5/12. +// +// Node APIs are not fully supported. To solve the compilation error of the interface cannot be found, +// please include "napi/native_api.h". + +#ifndef HARMONY_SVGSYMBOL_H +#define HARMONY_SVGSYMBOL_H +#include "SvgGraphic.h" +#include "properties/ViewBox.h" +namespace rnoh { +namespace svg { + +class SvgSymbol : public SvgGraphic { +public: + SvgSymbol() : SvgGraphic() { InitSymbolFlag(); } + ~SvgSymbol() override = default; + + void InitSymbolFlag() { + hrefFill_ = false; + hrefRender_ = false; + inheritStyle_ = false; + drawTraversed_ = false; + } + float mMinX = 0.0f; + float mMinY = 0.0f; + float mVbWidth = 0.0f; + float mVbHeight = 0.0f; + std::string mAlign; + int mMeetOrSlice = -1; + void InitDefsFlag(); + void drawSymbol(OH_Drawing_Canvas *canvas, float width, float height); +}; + +} // namespace svg +} // namespace rnoh +#endif // HARMONY_SVGSYMBOL_H diff --git a/tester/harmony/svg/src/main/cpp/SvgTSpan.cpp b/tester/harmony/svg/src/main/cpp/SvgTSpan.cpp new file mode 100644 index 0000000000000000000000000000000000000000..9dca76a93af1ab3133b744d476e80cb20e00413b --- /dev/null +++ b/tester/harmony/svg/src/main/cpp/SvgTSpan.cpp @@ -0,0 +1,377 @@ +#include +#include +#include +#include +#include "SvgTSpan.h" +#include "drawing/TextStyle.h" +#include "drawing/Typography.h" +#include "drawing/Matrix.h" +#include "utils/TextPathHelper.h" + +namespace rnoh { +namespace svg { + +void SvgTSpan::OnDraw(OH_Drawing_Canvas *canvas) { + if (!glyphCtx_) { + InitGlyph(canvas, scale_); + } + if (!font_) { + InitFont(scale_); + } + if (content_.empty()) { + for (const auto &child : children_) { + if (auto tSpan = std::dynamic_pointer_cast(child); tSpan) { + tSpan->SetGlyphContext(glyphCtx_); + } + } + return; + } + + + glyphCtx_->pushContext(false, shared_from_this(), x_, y_, dx_, dy_, rotate_); + if (!textPath_) { + DrawText(canvas); + } else { + DrawTextPath(canvas); + } + glyphCtx_->popContext(); +} + +void SvgTSpan::DrawText(OH_Drawing_Canvas *canvas) { + drawing::TextStyle textStyle; + textStyle.Update(font_); + drawing::TypographyStyle ts; + ts.Update(font_); + + // create a typography to measure metrics for linear gradient + auto *fontCollection = OH_Drawing_CreateFontCollection(); + auto *typographyHandler = OH_Drawing_CreateTypographyHandler(ts.typographyStyle_.get(), fontCollection); + OH_Drawing_TypographyHandlerPushTextStyle(typographyHandler, textStyle.textStyle_.get()); + OH_Drawing_TypographyHandlerAddText(typographyHandler, content_.c_str()); + auto *typographyForMetrics = OH_Drawing_CreateTypography(typographyHandler); + double maxWidth = + inlineSize_.value_or(Infinity()).RelativeConvertToPx(OH_Drawing_CanvasGetWidth(canvas), scale_); + OH_Drawing_TypographyLayout(typographyForMetrics, maxWidth); + double actualWidth = OH_Drawing_TypographyGetLongestLine(typographyForMetrics); + + double scaleSpacingAndGlyphs = 1.0; + if (AdjustSpacing(canvas, actualWidth, scaleSpacingAndGlyphs)) { + OH_Drawing_SetTextStyleLetterSpacing(textStyle.textStyle_.get(), font_->letterSpacing); + } + + OH_Drawing_Font_Metrics fm; + OH_Drawing_TextStyleGetFontMetrics(typographyForMetrics, textStyle.textStyle_.get(), &fm); + double dx = glyphCtx_->nextX(actualWidth) - actualWidth + glyphCtx_->nextDeltaX() + + getTextAnchorOffset(font_->textAnchor, actualWidth); + // the position of typography is on the left-top + double dy = glyphCtx_->nextY() + glyphCtx_->nextDeltaY() + + CalcBaselineShift(typographyHandler, ts.textStyle_.get(), fm) - + OH_Drawing_TypographyGetAlphabeticBaseline(typographyForMetrics); + DLOG(INFO) << "TEXT GLYPH next X = " << dx << " next dy = " << dy; + + boundsWidth_ = actualWidth; + boundsHeight_ = fm.capHeight; + boundsX_ = dx; + boundsY_ = dy + (OH_Drawing_TypographyGetIdeographicBaseline(typographyForMetrics) - fm.descent - fm.capHeight); + + // draw the border of the area for debug + bool drawBounds = false; + if (drawBounds) { + OH_Drawing_CanvasDrawLine(canvas, boundsX_, boundsY_, boundsX_ + boundsWidth_, boundsY_); + OH_Drawing_CanvasDrawLine(canvas, boundsX_ + boundsWidth_, boundsY_, boundsX_ + boundsWidth_, + boundsY_ + boundsHeight_); + OH_Drawing_CanvasDrawLine(canvas, boundsX_ + boundsWidth_, boundsY_ + boundsHeight_, boundsX_, + boundsY_ + boundsHeight_); + OH_Drawing_CanvasDrawLine(canvas, boundsX_, boundsY_ + boundsHeight_, boundsX_, boundsY_); + } + + UpdateGradient(attributes_.strokeState.GetGradient()); + UpdateGradient(attributes_.fillState.GetGradient()); + UpdateStrokeStyle(); + auto fillOpaque = UpdateFillStyle(); + if (!fillOpaque) { + fillBrush_.SetColor(Color::TRANSPARENT.GetValue()); + } + textStyle.SetForegroundBrush(fillBrush_.get()); + textStyle.SetForegroundPen(strokePen_.get()); + ts.SetTextStyle(std::move(textStyle)); + + // create the typography for drawing + OH_Drawing_TypographyHandlerPopTextStyle(typographyHandler); + OH_Drawing_TypographyHandlerPushTextStyle(typographyHandler, ts.textStyle_.get()); + OH_Drawing_TypographyHandlerAddText(typographyHandler, content_.c_str()); + auto *typography = OH_Drawing_CreateTypography(typographyHandler); + OH_Drawing_TypographyLayout(typography, maxWidth); + + double r = glyphCtx_->nextRotation(); + drawing::Matrix mat; + mat.PreRotate(r, dx, dy); + + OH_Drawing_CanvasSave(canvas); + OH_Drawing_CanvasConcatMatrix(canvas, mat.get()); + OH_Drawing_TypographyPaint(typography, canvas, dx, dy); + OH_Drawing_CanvasRestore(canvas); + + OH_Drawing_DestroyTypography(typographyForMetrics); + OH_Drawing_DestroyTypography(typography); + OH_Drawing_DestroyTypographyHandler(typographyHandler); + OH_Drawing_DestroyFontCollection(fontCollection); +} + +double SvgTSpan::getTextAnchorOffset(TextAnchor textAnchor, const double &textMeasure) { + switch (textAnchor) { + default: + case TextAnchor::start: + return 0; + + case TextAnchor::middle: + return -textMeasure / 2; + + case TextAnchor::end: + return -textMeasure; + } +} + +drawing::TypographyStyle SvgTSpan::PrepareTypoStyle() { + UpdateStrokeStyle(); + auto fillOpaque = UpdateFillStyle(); + if (!fillOpaque) { + fillBrush_.SetColor(Color::TRANSPARENT.GetValue()); + } + + drawing::TextStyle textStyle; + textStyle.SetForegroundBrush(fillBrush_.get()); + textStyle.SetForegroundPen(strokePen_.get()); + textStyle.Update(font_); + drawing::TypographyStyle ts; + ts.SetTextStyle(std::move(textStyle)); + ts.Update(font_); + return std::move(ts); +} + +bool SvgTSpan::AdjustSpacing(OH_Drawing_Canvas *canvas, double textMeasure, double &scaleSpacingAndGlyphs) { + if (textLength_) { + double author = textLength_->RelativeConvertToPx(OH_Drawing_CanvasGetWidth(canvas), scale_); + switch (lengthAdjust_) { + default: + case TextLengthAdjust::spacing: + font_->letterSpacing += (author - textMeasure) / (content_.size() - 1); + return true; + case TextLengthAdjust::spacingAndGlyphs: + scaleSpacingAndGlyphs = author / textMeasure; + break; + } + } + return false; +} + +void SvgTSpan::DrawTextPath(OH_Drawing_Canvas *canvas) { + if (content_.empty()) { + return; + } + + TextPathHelper ph(textPath_, font_->textAnchor); + if (!ph.Valid()) { + return; + } + + drawing::TypographyStyle ts = PrepareTypoStyle(); + auto *fontCollection = OH_Drawing_CreateFontCollection(); + auto *typographyHandler = OH_Drawing_CreateTypographyHandler(ts.typographyStyle_.get(), fontCollection); + + OH_Drawing_TypographyHandlerAddText(typographyHandler, content_.c_str()); + auto *typography = OH_Drawing_CreateTypography(typographyHandler); + OH_Drawing_TypographyLayout(typography, 1e9); + double textMeasure = OH_Drawing_TypographyGetLineWidth(typography, 0); + double offset = getTextAnchorOffset(font_->textAnchor, textMeasure); + + offset += ph.GetStartOffset(); + + double scaleSpacingAndGlyphs = 1.0; + if (AdjustSpacing(canvas, textMeasure, scaleSpacingAndGlyphs)) { + DLOG(INFO) << "adjust spacing to " << font_->letterSpacing; + OH_Drawing_SetTextStyleLetterSpacing(ts.textStyle_.get(), font_->letterSpacing); + } + ph.SetScaleSpacingAndGlyphs(scaleSpacingAndGlyphs); + + std::vector ligature(content_.size(), false); + + OH_Drawing_Font_Metrics fm; + OH_Drawing_TextStyleGetFontMetrics(typography, ts.textStyle_.get(), &fm); + double baselineShift = CalcBaselineShift(typographyHandler, ts.textStyle_.get(), fm); + + for (int i = 0; i < content_.size(); i++) { + std::string current = content_.substr(i, 1); + + auto *fontCollection = OH_Drawing_CreateFontCollection(); + auto *typographyHandler = OH_Drawing_CreateTypographyHandler(ts.typographyStyle_.get(), fontCollection); + OH_Drawing_TypographyHandlerAddText(typographyHandler, current.c_str()); + drawing::Typography typography(typographyHandler); + OH_Drawing_TypographyLayout(&typography, 1e9); + double charWidth = OH_Drawing_TypographyGetLineWidth(&typography, 0); + + bool alreadyRenderedGraphemeCluster = false; + bool hasLigature = false; + + if (alreadyRenderedGraphemeCluster) { + current = ""; + } else { + int nextIndex = i; + while (++nextIndex < content_.size()) { + float nextWidth = charWidth; + if (nextWidth > 0) { + break; + } + std::string nextLigature = current + current[nextIndex]; + ligature[nextIndex] = true; + current = nextLigature; + hasLigature = true; + } + } + bool autoKerning = !font_->manualKerning; + double kerning = font_->kerning; + if (autoKerning) { + double kerned = charWidth * scaleSpacingAndGlyphs; + kerning = kerned - charWidth; + } + + bool isWordSeparator = current[0] == ' '; + double wordSpace = isWordSeparator ? font_->wordSpacing : 0; + double spacing = wordSpace + font_->letterSpacing; + double advance = charWidth + spacing; + + double x = glyphCtx_->nextX(alreadyRenderedGraphemeCluster ? 0 : kerning + advance); + double y = glyphCtx_->nextY(); + double dx = glyphCtx_->nextDeltaX(); + double dy = glyphCtx_->nextDeltaY(); + double r = glyphCtx_->nextRotation(); + + if (alreadyRenderedGraphemeCluster || isWordSeparator) { + // Skip rendering other grapheme clusters of ligatures (already rendered), + // But, make sure to increment index positions by making gc.next() calls. + OH_Drawing_DestroyFontCollection(fontCollection); + OH_Drawing_DestroyTypographyHandler(typographyHandler); + continue; + } + int side = ph.GetSide(); + advance *= side; + charWidth *= side; + double cursor = offset + (x + dx) * side; + double startPoint = cursor - advance; + + drawing::Matrix mid; + if (!ph.GetMatrixOnPath({charWidth, startPoint, y, dy + baselineShift}, mid)) { + OH_Drawing_DestroyFontCollection(fontCollection); + OH_Drawing_DestroyTypographyHandler(typographyHandler); + continue; + } + mid.PreRotate(r, 0, 0); + + OH_Drawing_CanvasSave(canvas); + OH_Drawing_CanvasConcatMatrix(canvas, mid.get()); + OH_Drawing_TypographyPaint(&typography, canvas, 0, 0); + OH_Drawing_CanvasRestore(canvas); + + OH_Drawing_DestroyFontCollection(fontCollection); + OH_Drawing_DestroyTypographyHandler(typographyHandler); + } + OH_Drawing_DestroyFontCollection(fontCollection); + OH_Drawing_DestroyTypographyHandler(typographyHandler); +} + +double SvgTSpan::CalcBaselineShift(OH_Drawing_TypographyCreate *handler, OH_Drawing_TextStyle *style, + const OH_Drawing_Font_Metrics &fm) { + const double descenderDepth = fm.descent; + const double bottom = descenderDepth + fm.leading; + const double ascenderHeight = -fm.ascent + fm.leading; + const double top = -fm.top; + const double totalHeight = top + bottom; + double baselineShift = 0.0; + switch (align_) { + // https://wiki.apache.org/xmlgraphics-fop/LineLayout/AlignmentHandling + default: + case AlignmentBaseline::baseline: + // Use the dominant baseline choice of the parent. + // Match the box’s corresponding baseline to that of its parent. + baselineShift = 0; + break; + + case AlignmentBaseline::textBottom: + case AlignmentBaseline::afterEdge: + case AlignmentBaseline::textAfterEdge: + // Match the bottom of the box to the bottom of the parent’s content area. + // text-after-edge = text-bottom + // text-after-edge = descender depth + baselineShift = -descenderDepth; + break; + + case AlignmentBaseline::alphabetic: + // Match the box’s alphabetic baseline to that of its parent. + // alphabetic = 0 + baselineShift = 0; + break; + + case AlignmentBaseline::ideographic: + baselineShift = -descenderDepth; + break; + + case AlignmentBaseline::middle: { + baselineShift = fm.xHeight / 2.0; + break; + } + case AlignmentBaseline::central: + baselineShift = (ascenderHeight - descenderDepth) / 2; + break; + + case AlignmentBaseline::mathematical: + baselineShift = 0.5 * ascenderHeight; + break; + + case AlignmentBaseline::hanging: + baselineShift = 0.8 * ascenderHeight; + break; + + case AlignmentBaseline::textTop: + case AlignmentBaseline::beforeEdge: + case AlignmentBaseline::textBeforeEdge: + baselineShift = ascenderHeight; + break; + + case AlignmentBaseline::bottom: + baselineShift = bottom; + break; + + case AlignmentBaseline::center: + baselineShift = totalHeight / 2; + break; + + case AlignmentBaseline::top: + baselineShift = top; + break; + } + + if (!baselineShift_.empty()) { + switch (align_) { + case AlignmentBaseline::top: + case AlignmentBaseline::bottom: + break; + + default: { + if (baselineShift_ == "sub") { + } else if (baselineShift_ == "super") { + } else if (baselineShift_ == "baseline") { + } else { + baselineShift -= + StringUtils::FromString(baselineShift_).RelativeConvertToPx(scale_ * font_->fontSize, scale_); + } + break; + } + } + } + return baselineShift; +} + +Rect SvgTSpan::AsBounds() { return Rect(boundsX_, boundsY_, boundsWidth_, boundsHeight_); } + +} // namespace svg +} // namespace rnoh \ No newline at end of file diff --git a/tester/harmony/svg/src/main/cpp/SvgTSpan.h b/tester/harmony/svg/src/main/cpp/SvgTSpan.h new file mode 100644 index 0000000000000000000000000000000000000000..a85f17e8af6c8bdcb8714ec39f83f680f4045e95 --- /dev/null +++ b/tester/harmony/svg/src/main/cpp/SvgTSpan.h @@ -0,0 +1,58 @@ +#pragma once +#include +#include "SvgGraphic.h" +#include "SvgText.h" +#include +#include "SvgTextPath.h" +#include "utils/GlyphContext.h" +#include "drawing/TypographyStyle.h" +#include "TextBase.h" +#include "FontHolderBase.h" + +namespace rnoh { +namespace svg { + +class SvgTSpan : public SvgGraphic, public TextBase, public FontHolderBase { +public: + SvgTSpan() { + hrefFill_ = true; + hrefRender_ = true; + passStyle_ = true; + inheritStyle_ = true; + drawTraversed_ = true; + } + ~SvgTSpan() override = default; + + void OnDraw(OH_Drawing_Canvas *canvas) override; + + void SetTextPathRef(std::shared_ptr textPath) { textPath_ = textPath; } + + double getTextAnchorOffset(TextAnchor textAnchor, const double &textMeasure); + + std::string content_; + + Rect AsBounds() override; + +private: + void DrawTextPath(OH_Drawing_Canvas* canvas); + void DrawText(OH_Drawing_Canvas* canvas); + + drawing::TypographyStyle PrepareTypoStyle(); + + /** + * @return true if spacing needs to be adjusted. + */ + bool AdjustSpacing(OH_Drawing_Canvas *canvas, double textMeasure, double& scaleSpacingAndGlyphs); + + double CalcBaselineShift(OH_Drawing_TypographyCreate* handler, OH_Drawing_TextStyle* style, const OH_Drawing_Font_Metrics& fm); + + std::shared_ptr textPath_; + + double boundsWidth_ = 0; + double boundsHeight_ = 0; + double boundsX_ = 0; + double boundsY_ = 0; +}; + +} // namespace svg +} // namespace rnoh \ No newline at end of file diff --git a/tester/harmony/svg/src/main/cpp/SvgText.cpp b/tester/harmony/svg/src/main/cpp/SvgText.cpp new file mode 100644 index 0000000000000000000000000000000000000000..cf23f176c3da3bf8b9f5d712f6cf14decc655807 --- /dev/null +++ b/tester/harmony/svg/src/main/cpp/SvgText.cpp @@ -0,0 +1,34 @@ +#include "SvgText.h" +#include +#include + +#include "drawing/TextStyle.h" +#include "drawing/TypographyStyle.h" +#include "SvgTSpan.h" + +namespace rnoh { +namespace svg { + +void SvgText::GlyphTraversal(OH_Drawing_Canvas *canvas) { + if (!glyphCtx_) { + InitGlyph(canvas, scale_); + } + for (auto const &child : children_) { + if (auto span = std::dynamic_pointer_cast(child)) { + span->SetGlyphContext(glyphCtx_); + if (!span->hasAlignmentBaseline()) { + span->setAlignmentBaseline(align_); + } + if (!span->hasBaselineShift()) { + span->setBaselineShift(baselineShift_); + } + } + } +} +void SvgText::OnDraw(OH_Drawing_Canvas *canvas) { + GlyphTraversal(canvas); + glyphCtx_->pushContext(true, shared_from_this(), x_, y_, dx_, dy_, rotate_); +} + +} // namespace svg +} // namespace rnoh \ No newline at end of file diff --git a/tester/harmony/svg/src/main/cpp/SvgText.h b/tester/harmony/svg/src/main/cpp/SvgText.h new file mode 100644 index 0000000000000000000000000000000000000000..1fd5d6932c17a98bfcc605660edf530feaa882db --- /dev/null +++ b/tester/harmony/svg/src/main/cpp/SvgText.h @@ -0,0 +1,21 @@ +#pragma once + +#include "SvgGroup.h" +#include "TextBase.h" + +namespace rnoh { +namespace svg { + +class SvgText : public SvgGroup, public TextBase { +public: + SvgText() = default; + ~SvgText() override = default; + + void OnDraw(OH_Drawing_Canvas *canvas) override; + +private: + void GlyphTraversal(OH_Drawing_Canvas *canvas); +}; + +} // namespace svg +} // namespace rnoh \ No newline at end of file diff --git a/tester/harmony/svg/src/main/cpp/SvgTextPath.cpp b/tester/harmony/svg/src/main/cpp/SvgTextPath.cpp new file mode 100644 index 0000000000000000000000000000000000000000..2ddc041d2d4ee7f0079b21b08f80b60372123f1d --- /dev/null +++ b/tester/harmony/svg/src/main/cpp/SvgTextPath.cpp @@ -0,0 +1,29 @@ +#include "SvgTextPath.h" +#include "SvgTSpan.h" + +namespace rnoh { +namespace svg { + +void SvgTextPath::OnDraw(OH_Drawing_Canvas *canvas) { + if (!glyphCtx_) { + InitGlyph(canvas, scale_); + } + for (auto const &child : children_) { + if (auto tSpan = std::dynamic_pointer_cast(child)) { + tSpan->SetGlyphContext(glyphCtx_); + tSpan->SetTextPathRef(std::dynamic_pointer_cast(shared_from_this())); + } + } +} + +drawing::Path SvgTextPath::getTextPath() { + auto node = context_->GetSvgNodeById(href_); + if (node) { + return node->AsPath(); + } + DLOG(INFO) << "TEXT_PATH ref node missing, href = " << href_; + return drawing::Path(); +} + +} // namespace svg +} // namespace rnoh \ No newline at end of file diff --git a/tester/harmony/svg/src/main/cpp/SvgTextPath.h b/tester/harmony/svg/src/main/cpp/SvgTextPath.h new file mode 100644 index 0000000000000000000000000000000000000000..bca555b2fd46e80355c91e6b44ae3cb44926ac20 --- /dev/null +++ b/tester/harmony/svg/src/main/cpp/SvgTextPath.h @@ -0,0 +1,45 @@ +#pragma once + +#include "SvgGroup.h" +#include "SvgText.h" +#include +#include "utils/GlyphContext.h" +#include "properties/Font.h" +#include "TextBase.h" + +namespace rnoh { +namespace svg { + +class SvgTextPath : public SvgGroup, public TextBase { +public: + SvgTextPath() { + hrefFill_ = true; + hrefRender_ = true; + passStyle_ = true; + inheritStyle_ = true; + drawTraversed_ = true; + } + ~SvgTextPath() override = default; + + void OnDraw(OH_Drawing_Canvas *canvas) override; + + void SetContext(std::shared_ptr context) { glyphCtx_ = context; } + + drawing::Path getTextPath(); + + TextPathMidLine getMidLine() const { return midLine_; } + + TextPathSide getSide() const { return side_; } + + double getStartOffset() const { return startOffset_; } + + TextPathSide side_{TextPathSide::left}; + TextPathMidLine midLine_{TextPathMidLine::sharp}; + TextPathMethod method_{TextPathMethod::align}; + TextPathSpacing spacing_{TextPathSpacing::Exact}; + double startOffset_; + std::string href_; +}; + +} // namespace svg +} // namespace rnoh \ No newline at end of file diff --git a/tester/harmony/svg/src/main/cpp/SvgUse.cpp b/tester/harmony/svg/src/main/cpp/SvgUse.cpp new file mode 100644 index 0000000000000000000000000000000000000000..9734ba5320545555156f3db39c2eda5324d68057 --- /dev/null +++ b/tester/harmony/svg/src/main/cpp/SvgUse.cpp @@ -0,0 +1,63 @@ +#include "SvgUse.h" + +namespace rnoh { +namespace svg { + +void SvgUse::OnDraw(OH_Drawing_Canvas *canvas) { + DLOG(INFO) << "[SvgUse::OnDraw] : start"; + auto svgContext = GetContext(); + if (!svgContext) { + DLOG(INFO) << "[SvgUse::OnDraw] : svgContext is a null ptr"; + return; + } + + auto refSvgNode = svgContext->GetSvgNodeById(href); + if (!refSvgNode) { + DLOG(INFO) << "[SvgUse::OnDraw] : refSvgNode is a null ptr"; + return; + } + + if (x != 0 || y != 0) { + OH_Drawing_CanvasTranslate(canvas, vpToPx(x), vpToPx(y)); + } + + AttributeScope scope(refSvgNode); + std::shared_ptr svgSymbol = std::dynamic_pointer_cast(refSvgNode); + + refSvgNode->InheritUseAttr(attributes_); + if (svgSymbol != nullptr) { + svgSymbol->drawSymbol(canvas, width, height); + } else { + DLOG(INFO) << "[SvgUse::OnDraw] : normal component"; + refSvgNode->Draw(canvas); + } + + return; +} + +drawing::Path SvgUse::AsPath() { + drawing::Path path; + auto svgContext = GetContext(); + if (!svgContext) { + return path; + } + auto refSvgNode = svgContext->GetSvgNodeById(href); + if (!refSvgNode) { + return path; + } + path = refSvgNode->AsPath(); + return path; +} + +SvgUse::AttributeScope::AttributeScope(const std::shared_ptr &node) : node_(node) { + auto nodeAttr = node->GetBaseAttributes(); + attributes_ = nodeAttr; +} + +SvgUse::AttributeScope::~AttributeScope() { + // TODO : check null ptr + node_->SetBaseAttributes(attributes_); +} + +} // namespace svg +} // namespace rnoh \ No newline at end of file diff --git a/tester/harmony/svg/src/main/cpp/SvgUse.h b/tester/harmony/svg/src/main/cpp/SvgUse.h new file mode 100644 index 0000000000000000000000000000000000000000..d2932ca6ca9280c55fd09e03162b9ee8128d57cc --- /dev/null +++ b/tester/harmony/svg/src/main/cpp/SvgUse.h @@ -0,0 +1,40 @@ +#pragma once + +#include "SvgGraphic.h" +#include +#include +#include +#include "SvgSymbol.h" + +namespace rnoh { +namespace svg { + + class SvgUse : public SvgGraphic { + public: + SvgUse() = default; + ~SvgUse() override = default; + float x; + float y; + float width; + float height; + float opacity; + std::string href; + + void OnDraw(OH_Drawing_Canvas *canvas) override; + + drawing::Path AsPath() override; + private: + class AttributeScope { + public: + explicit AttributeScope(const std::shared_ptr& node); + ~AttributeScope(); + + private: + SvgBaseAttribute attributes_; + std::shared_ptr node_; + }; + // SvgAttributes useAttr_; + }; + +} // namespace svg +} // namespace rnoh \ No newline at end of file diff --git a/tester/harmony/svg/src/main/cpp/SvgViewManager.cpp b/tester/harmony/svg/src/main/cpp/SvgViewManager.cpp new file mode 100644 index 0000000000000000000000000000000000000000..bca06e47444f1d304f5e894a7776ba5020b54f60 --- /dev/null +++ b/tester/harmony/svg/src/main/cpp/SvgViewManager.cpp @@ -0,0 +1,30 @@ +#include "SvgViewManager.h" + +namespace rnoh { +namespace svg { +void SvgViewManager::setSvgView(int tag, std::weak_ptr svg) { + mTagToSvgViewMap.insert(std::make_pair(tag, svg)); +} + +std::weak_ptr SvgViewManager::getSvgViewByTag(int tag) { + std::weak_ptr svgSvg; + auto it = mTagToSvgViewMap.find(tag); + if (it != mTagToSvgViewMap.end()) { + svgSvg = it->second; + } + return svgSvg; +} + +void SvgViewManager::onDropView(int tag) { + // 将svgview从容器中删除 + mTagToSvgViewMap.erase(tag); +} + +SvgViewManager::~SvgViewManager() { + if (mTagToSvgViewMap.empty() == false) { + mTagToSvgViewMap.clear(); + } +} + +} // namespace svg +} // namespace rnoh \ No newline at end of file diff --git a/tester/harmony/svg/src/main/cpp/SvgViewManager.h b/tester/harmony/svg/src/main/cpp/SvgViewManager.h new file mode 100644 index 0000000000000000000000000000000000000000..4a756e59dc521bfbc019640f5b6d20dc19f77c05 --- /dev/null +++ b/tester/harmony/svg/src/main/cpp/SvgViewManager.h @@ -0,0 +1,30 @@ +#pragma once +#include +#include "SvgSvg.h" +#include + +namespace rnoh { +namespace svg { + +class SvgViewManager { +public: + static SvgViewManager &getInstance() { + // 单例模式 + static SvgViewManager instance; + return instance; + } + void setSvgView(int tag, std::weak_ptr svg); + + std::weak_ptr getSvgViewByTag(int tag); + + void onDropView(int tag); + +private: + SvgViewManager() {} + SvgViewManager(const SvgViewManager &) = delete; + SvgViewManager &operator=(const SvgViewManager &) = delete; + ~SvgViewManager(); + std::map> mTagToSvgViewMap; +}; +} // namespace svg +} // namespace rnoh diff --git a/tester/harmony/svg/src/main/cpp/TextBase.cpp b/tester/harmony/svg/src/main/cpp/TextBase.cpp new file mode 100644 index 0000000000000000000000000000000000000000..bc376c0a7b8f43487486b0734358f9399d5cc06f --- /dev/null +++ b/tester/harmony/svg/src/main/cpp/TextBase.cpp @@ -0,0 +1,14 @@ +#include "TextBase.h" +#include "drawing/Rect.h" + +namespace rnoh { +namespace svg { + +void TextBase::InitGlyph(OH_Drawing_Canvas *canvas, double scale) { + drawing::Rect rect; + OH_Drawing_CanvasGetLocalClipBounds(canvas, rect.get()); + glyphCtx_ = std::make_shared(scale, rect.GetWidth(), rect.GetHeight()); +} + +} // namespace svg +} // namespace rnoh \ No newline at end of file diff --git a/tester/harmony/svg/src/main/cpp/TextBase.h b/tester/harmony/svg/src/main/cpp/TextBase.h new file mode 100644 index 0000000000000000000000000000000000000000..df5a582f1cbb23e59d4cb4c0d14af64cf30696f0 --- /dev/null +++ b/tester/harmony/svg/src/main/cpp/TextBase.h @@ -0,0 +1,107 @@ +#pragma once +#include "utils/StringUtils.h" +#include "utils/GlyphContext.h" +#include "properties/TextProperties.h" +#include +#include + +namespace rnoh { +namespace svg { + +class TextBase { +public: + template void UpdateTextProps(const std::shared_ptr &props) { + x_.clear(); + for (auto const &value : props->x) { + x_.push_back(StringUtils::FromString(value)); + } + y_.clear(); + for (auto const &value : props->y) { + y_.push_back(StringUtils::FromString(value)); + } + dx_.clear(); + for (auto const &value : props->dx) { + dx_.push_back(StringUtils::FromString(value)); + } + dy_.clear(); + for (auto const &value : props->dy) { + dy_.push_back(StringUtils::FromString(value)); + } + rotate_.clear(); + for (auto const &value : props->rotate) { + rotate_.push_back(StringUtils::FromString(value)); + } + if (props->inlineSize.empty()) { + inlineSize_.reset(); + } else { + inlineSize_ = StringUtils::FromString(props->inlineSize); + } + + if (props->textLength.empty()) { + textLength_.reset(); + } else { + textLength_ = StringUtils::FromString(props->textLength); + } + + hasBaselineShift_ = false; + hasAlign_ = false; + if (!props->verticalAlign.empty()) { + auto align = props->verticalAlign; + align.erase(0, align.find_first_not_of(" \t\r\n")); + align.erase(align.find_last_not_of(" \t\r\n") + 1); + size_t i = align.find_last_of(' '); + align_ = alignmentBaselineFromStr(align.substr(i)); + baselineShift_ = align.substr(0, i); + hasAlign_ = true; + hasBaselineShift_ = true; + } else { + align_ = AlignmentBaseline::baseline; + baselineShift_.clear(); + hasAlign_ = false; + hasBaselineShift_ = false; + } + + if (!props->baselineShift.empty()) { + baselineShift_ = props->baselineShift; + hasBaselineShift_ = true; + } + if (!props->alignmentBaseline.empty()) { + align_ = alignmentBaselineFromStr(props->alignmentBaseline); + hasAlign_ = true; + } + + lengthAdjust_ = textLengthAdjustFromStr(props->lengthAdjust); + } + + void SetGlyphContext(const std::shared_ptr &ctx) { glyphCtx_ = ctx; } + + void setAlignmentBaseline(const AlignmentBaseline &alignmentBaseline) { align_ = alignmentBaseline; } + + bool hasAlignmentBaseline() { return hasAlign_; } + + void setBaselineShift(const std::string &baselineShift) { baselineShift_ = baselineShift; } + + bool hasBaselineShift() { return hasBaselineShift_; } + +protected: + void InitGlyph(OH_Drawing_Canvas *canvas, double scale); + + std::vector x_; + std::vector y_; + std::vector dx_; + std::vector dy_; + std::vector rotate_; + std::optional inlineSize_; + std::optional textLength_; + + std::string baselineShift_; + bool hasBaselineShift_ = false; + TextLengthAdjust lengthAdjust_ = TextLengthAdjust::spacing; + AlignmentBaseline align_ = AlignmentBaseline::baseline; + bool hasAlign_ = false; + + std::shared_ptr glyphCtx_; +}; + +} // namespace svg +} // namespace rnoh \ No newline at end of file diff --git a/tester/harmony/svg/src/main/cpp/componentBinders/RNSVGCircleJSIBinder.h b/tester/harmony/svg/src/main/cpp/componentBinders/RNSVGCircleJSIBinder.h new file mode 100644 index 0000000000000000000000000000000000000000..4c2fa36339a245e694ef992a7e13a74c2f71dd9f --- /dev/null +++ b/tester/harmony/svg/src/main/cpp/componentBinders/RNSVGCircleJSIBinder.h @@ -0,0 +1,53 @@ +#pragma once + +// This file was generated. + +#include "RNOHCorePackage/ComponentBinders/ViewComponentJSIBinder.h" + +namespace rnoh { +class RNSVGCircleJSIBinder : public ViewComponentJSIBinder { + protected: + facebook::jsi::Object createNativeProps(facebook::jsi::Runtime &rt) override { + auto object = ViewComponentJSIBinder::createNativeProps(rt); + object.setProperty(rt, "name", true); + object.setProperty(rt, "opacity", true); + object.setProperty(rt, "matrix", true); + object.setProperty(rt, "mask", true); + object.setProperty(rt, "markerStart", true); + object.setProperty(rt, "markerMid", true); + object.setProperty(rt, "markerEnd", true); + object.setProperty(rt, "clipPath", true); + object.setProperty(rt, "clipRule", true); + object.setProperty(rt, "responsible", true); + object.setProperty(rt, "display", true); + object.setProperty(rt, "pointerEvents", true); + object.setProperty(rt, "fill", "Object"); + object.setProperty(rt, "fillOpacity", true); + object.setProperty(rt, "fillRule", true); + object.setProperty(rt, "stroke", "Object"); + object.setProperty(rt, "strokeOpacity", true); + object.setProperty(rt, "strokeWidth", true); + object.setProperty(rt, "strokeLinecap", true); + object.setProperty(rt, "strokeLinejoin", true); + object.setProperty(rt, "strokeDasharray", true); + object.setProperty(rt, "strokeDashoffset", true); + object.setProperty(rt, "strokeMiterlimit", true); + object.setProperty(rt, "vectorEffect", true); + object.setProperty(rt, "propList", true); + object.setProperty(rt, "cx", true); + object.setProperty(rt, "cy", true); + object.setProperty(rt, "r", true); + return object; + } + + facebook::jsi::Object createBubblingEventTypes(facebook::jsi::Runtime &rt) override { + facebook::jsi::Object events(rt); + return events; + } + + facebook::jsi::Object createDirectEventTypes(facebook::jsi::Runtime &rt) override { + facebook::jsi::Object events(rt); + return events; + } +}; +} // namespace rnoh diff --git a/tester/harmony/svg/src/main/cpp/componentBinders/RNSVGClipPathJSIBinder.h b/tester/harmony/svg/src/main/cpp/componentBinders/RNSVGClipPathJSIBinder.h new file mode 100644 index 0000000000000000000000000000000000000000..5e6817027e42f7d51cdf9b80342d32404d0dd617 --- /dev/null +++ b/tester/harmony/svg/src/main/cpp/componentBinders/RNSVGClipPathJSIBinder.h @@ -0,0 +1,53 @@ +#pragma once + +// This file was generated. + +#include "RNOHCorePackage/ComponentBinders/ViewComponentJSIBinder.h" + +namespace rnoh { +class RNSVGClipPathJSIBinder : public ViewComponentJSIBinder { + protected: + facebook::jsi::Object createNativeProps(facebook::jsi::Runtime &rt) override { + auto object = ViewComponentJSIBinder::createNativeProps(rt); + object.setProperty(rt, "name", true); + object.setProperty(rt, "opacity", true); + object.setProperty(rt, "matrix", true); + object.setProperty(rt, "mask", true); + object.setProperty(rt, "markerStart", true); + object.setProperty(rt, "markerMid", true); + object.setProperty(rt, "markerEnd", true); + object.setProperty(rt, "clipPath", true); + object.setProperty(rt, "clipRule", true); + object.setProperty(rt, "responsible", true); + object.setProperty(rt, "display", true); + object.setProperty(rt, "pointerEvents", true); + object.setProperty(rt, "fill", "Object"); + object.setProperty(rt, "fillOpacity", true); + object.setProperty(rt, "fillRule", true); + object.setProperty(rt, "stroke", "Object"); + object.setProperty(rt, "strokeOpacity", true); + object.setProperty(rt, "strokeWidth", true); + object.setProperty(rt, "strokeLinecap", true); + object.setProperty(rt, "strokeLinejoin", true); + object.setProperty(rt, "strokeDasharray", true); + object.setProperty(rt, "strokeDashoffset", true); + object.setProperty(rt, "strokeMiterlimit", true); + object.setProperty(rt, "vectorEffect", true); + object.setProperty(rt, "propList", true); + object.setProperty(rt, "fontSize", true); + object.setProperty(rt, "fontWeight", true); + object.setProperty(rt, "font", "Object"); + return object; + } + + facebook::jsi::Object createBubblingEventTypes(facebook::jsi::Runtime &rt) override { + facebook::jsi::Object events(rt); + return events; + } + + facebook::jsi::Object createDirectEventTypes(facebook::jsi::Runtime &rt) override { + facebook::jsi::Object events(rt); + return events; + } +}; +} // namespace rnoh diff --git a/tester/harmony/svg/src/main/cpp/componentBinders/RNSVGDefsJSIBinder.h b/tester/harmony/svg/src/main/cpp/componentBinders/RNSVGDefsJSIBinder.h new file mode 100644 index 0000000000000000000000000000000000000000..32073968a91276fb6da0a7b94669a26df3fc2112 --- /dev/null +++ b/tester/harmony/svg/src/main/cpp/componentBinders/RNSVGDefsJSIBinder.h @@ -0,0 +1,37 @@ +#pragma once + +// This file was generated. + +#include "RNOHCorePackage/ComponentBinders/ViewComponentJSIBinder.h" + +namespace rnoh { +class RNSVGDefsJSIBinder : public ViewComponentJSIBinder { + protected: + facebook::jsi::Object createNativeProps(facebook::jsi::Runtime &rt) override { + auto object = ViewComponentJSIBinder::createNativeProps(rt); + object.setProperty(rt, "name", true); + object.setProperty(rt, "opacity", true); + object.setProperty(rt, "matrix", true); + object.setProperty(rt, "mask", true); + object.setProperty(rt, "markerStart", true); + object.setProperty(rt, "markerMid", true); + object.setProperty(rt, "markerEnd", true); + object.setProperty(rt, "clipPath", true); + object.setProperty(rt, "clipRule", true); + object.setProperty(rt, "responsible", true); + object.setProperty(rt, "display", true); + object.setProperty(rt, "pointerEvents", true); + return object; + } + + facebook::jsi::Object createBubblingEventTypes(facebook::jsi::Runtime &rt) override { + facebook::jsi::Object events(rt); + return events; + } + + facebook::jsi::Object createDirectEventTypes(facebook::jsi::Runtime &rt) override { + facebook::jsi::Object events(rt); + return events; + } +}; +} // namespace rnoh diff --git a/tester/harmony/svg/src/main/cpp/componentBinders/RNSVGEllipseJSIBinder.h b/tester/harmony/svg/src/main/cpp/componentBinders/RNSVGEllipseJSIBinder.h new file mode 100644 index 0000000000000000000000000000000000000000..88a4021227cf69610daa0e079ceeb57a42497165 --- /dev/null +++ b/tester/harmony/svg/src/main/cpp/componentBinders/RNSVGEllipseJSIBinder.h @@ -0,0 +1,54 @@ +#pragma once + +// This file was generated. + +#include "RNOHCorePackage/ComponentBinders/ViewComponentJSIBinder.h" + +namespace rnoh { +class RNSVGEllipseJSIBinder : public ViewComponentJSIBinder { + protected: + facebook::jsi::Object createNativeProps(facebook::jsi::Runtime &rt) override { + auto object = ViewComponentJSIBinder::createNativeProps(rt); + object.setProperty(rt, "name", true); + object.setProperty(rt, "opacity", true); + object.setProperty(rt, "matrix", true); + object.setProperty(rt, "mask", true); + object.setProperty(rt, "markerStart", true); + object.setProperty(rt, "markerMid", true); + object.setProperty(rt, "markerEnd", true); + object.setProperty(rt, "clipPath", true); + object.setProperty(rt, "clipRule", true); + object.setProperty(rt, "responsible", true); + object.setProperty(rt, "display", true); + object.setProperty(rt, "pointerEvents", true); + object.setProperty(rt, "fill", "Object"); + object.setProperty(rt, "fillOpacity", true); + object.setProperty(rt, "fillRule", true); + object.setProperty(rt, "stroke", "Object"); + object.setProperty(rt, "strokeOpacity", true); + object.setProperty(rt, "strokeWidth", true); + object.setProperty(rt, "strokeLinecap", true); + object.setProperty(rt, "strokeLinejoin", true); + object.setProperty(rt, "strokeDasharray", true); + object.setProperty(rt, "strokeDashoffset", true); + object.setProperty(rt, "strokeMiterlimit", true); + object.setProperty(rt, "vectorEffect", true); + object.setProperty(rt, "propList", true); + object.setProperty(rt, "cx", true); + object.setProperty(rt, "cy", true); + object.setProperty(rt, "rx", true); + object.setProperty(rt, "ry", true); + return object; + } + + facebook::jsi::Object createBubblingEventTypes(facebook::jsi::Runtime &rt) override { + facebook::jsi::Object events(rt); + return events; + } + + facebook::jsi::Object createDirectEventTypes(facebook::jsi::Runtime &rt) override { + facebook::jsi::Object events(rt); + return events; + } +}; +} // namespace rnoh diff --git a/tester/harmony/svg/src/main/cpp/componentBinders/RNSVGForeignObjectJSIBinder.h b/tester/harmony/svg/src/main/cpp/componentBinders/RNSVGForeignObjectJSIBinder.h new file mode 100644 index 0000000000000000000000000000000000000000..6615431d7cc9976eaa32c49127dad324e8de3402 --- /dev/null +++ b/tester/harmony/svg/src/main/cpp/componentBinders/RNSVGForeignObjectJSIBinder.h @@ -0,0 +1,57 @@ +#pragma once + +// This file was generated. + +#include "RNOHCorePackage/ComponentBinders/ViewComponentJSIBinder.h" + +namespace rnoh { +class RNSVGForeignObjectJSIBinder : public ViewComponentJSIBinder { + protected: + facebook::jsi::Object createNativeProps(facebook::jsi::Runtime &rt) override { + auto object = ViewComponentJSIBinder::createNativeProps(rt); + object.setProperty(rt, "name", true); + object.setProperty(rt, "opacity", true); + object.setProperty(rt, "matrix", true); + object.setProperty(rt, "mask", true); + object.setProperty(rt, "markerStart", true); + object.setProperty(rt, "markerMid", true); + object.setProperty(rt, "markerEnd", true); + object.setProperty(rt, "clipPath", true); + object.setProperty(rt, "clipRule", true); + object.setProperty(rt, "responsible", true); + object.setProperty(rt, "display", true); + object.setProperty(rt, "pointerEvents", true); + object.setProperty(rt, "fill", "Object"); + object.setProperty(rt, "fillOpacity", true); + object.setProperty(rt, "fillRule", true); + object.setProperty(rt, "stroke", "Object"); + object.setProperty(rt, "strokeOpacity", true); + object.setProperty(rt, "strokeWidth", true); + object.setProperty(rt, "strokeLinecap", true); + object.setProperty(rt, "strokeLinejoin", true); + object.setProperty(rt, "strokeDasharray", true); + object.setProperty(rt, "strokeDashoffset", true); + object.setProperty(rt, "strokeMiterlimit", true); + object.setProperty(rt, "vectorEffect", true); + object.setProperty(rt, "propList", true); + object.setProperty(rt, "fontSize", true); + object.setProperty(rt, "fontWeight", true); + object.setProperty(rt, "font", "Object"); + object.setProperty(rt, "x", true); + object.setProperty(rt, "y", true); + object.setProperty(rt, "height", true); + object.setProperty(rt, "width", true); + return object; + } + + facebook::jsi::Object createBubblingEventTypes(facebook::jsi::Runtime &rt) override { + facebook::jsi::Object events(rt); + return events; + } + + facebook::jsi::Object createDirectEventTypes(facebook::jsi::Runtime &rt) override { + facebook::jsi::Object events(rt); + return events; + } +}; +} // namespace rnoh diff --git a/tester/harmony/svg/src/main/cpp/componentBinders/RNSVGGroupJSIBinder.h b/tester/harmony/svg/src/main/cpp/componentBinders/RNSVGGroupJSIBinder.h new file mode 100644 index 0000000000000000000000000000000000000000..872defabf6d285c7235d51c27f0318ebf78fe444 --- /dev/null +++ b/tester/harmony/svg/src/main/cpp/componentBinders/RNSVGGroupJSIBinder.h @@ -0,0 +1,53 @@ +#pragma once + +// This file was generated. + +#include "RNOHCorePackage/ComponentBinders/ViewComponentJSIBinder.h" + +namespace rnoh { +class RNSVGGroupJSIBinder : public ViewComponentJSIBinder { + protected: + facebook::jsi::Object createNativeProps(facebook::jsi::Runtime &rt) override { + auto object = ViewComponentJSIBinder::createNativeProps(rt); + object.setProperty(rt, "name", true); + object.setProperty(rt, "opacity", true); + object.setProperty(rt, "matrix", true); + object.setProperty(rt, "mask", true); + object.setProperty(rt, "markerStart", true); + object.setProperty(rt, "markerMid", true); + object.setProperty(rt, "markerEnd", true); + object.setProperty(rt, "clipPath", true); + object.setProperty(rt, "clipRule", true); + object.setProperty(rt, "responsible", true); + object.setProperty(rt, "display", true); + object.setProperty(rt, "pointerEvents", true); + object.setProperty(rt, "fill", "Object"); + object.setProperty(rt, "fillOpacity", true); + object.setProperty(rt, "fillRule", true); + object.setProperty(rt, "stroke", "Object"); + object.setProperty(rt, "strokeOpacity", true); + object.setProperty(rt, "strokeWidth", true); + object.setProperty(rt, "strokeLinecap", true); + object.setProperty(rt, "strokeLinejoin", true); + object.setProperty(rt, "strokeDasharray", true); + object.setProperty(rt, "strokeDashoffset", true); + object.setProperty(rt, "strokeMiterlimit", true); + object.setProperty(rt, "vectorEffect", true); + object.setProperty(rt, "propList", true); + object.setProperty(rt, "fontSize", true); + object.setProperty(rt, "fontWeight", true); + object.setProperty(rt, "font", "Object"); + return object; + } + + facebook::jsi::Object createBubblingEventTypes(facebook::jsi::Runtime &rt) override { + facebook::jsi::Object events(rt); + return events; + } + + facebook::jsi::Object createDirectEventTypes(facebook::jsi::Runtime &rt) override { + facebook::jsi::Object events(rt); + return events; + } +}; +} // namespace rnoh diff --git a/tester/harmony/svg/src/main/cpp/componentBinders/RNSVGImageJSIBinder.h b/tester/harmony/svg/src/main/cpp/componentBinders/RNSVGImageJSIBinder.h new file mode 100644 index 0000000000000000000000000000000000000000..192b67c202119aacd1c91a36b07d5216c7611b1c --- /dev/null +++ b/tester/harmony/svg/src/main/cpp/componentBinders/RNSVGImageJSIBinder.h @@ -0,0 +1,57 @@ +#pragma once + +// This file was generated. + +#include "RNOHCorePackage/ComponentBinders/ViewComponentJSIBinder.h" + +namespace rnoh { +class RNSVGImageJSIBinder : public ViewComponentJSIBinder { + protected: + facebook::jsi::Object createNativeProps(facebook::jsi::Runtime &rt) override { + auto object = ViewComponentJSIBinder::createNativeProps(rt); + object.setProperty(rt, "name", true); + object.setProperty(rt, "opacity", true); + object.setProperty(rt, "matrix", true); + object.setProperty(rt, "mask", true); + object.setProperty(rt, "markerStart", true); + object.setProperty(rt, "markerMid", true); + object.setProperty(rt, "markerEnd", true); + object.setProperty(rt, "clipPath", true); + object.setProperty(rt, "clipRule", true); + object.setProperty(rt, "responsible", true); + object.setProperty(rt, "display", true); + object.setProperty(rt, "pointerEvents", true); + object.setProperty(rt, "fill", "Object"); + object.setProperty(rt, "fillOpacity", true); + object.setProperty(rt, "fillRule", true); + object.setProperty(rt, "stroke", "Object"); + object.setProperty(rt, "strokeOpacity", true); + object.setProperty(rt, "strokeWidth", true); + object.setProperty(rt, "strokeLinecap", true); + object.setProperty(rt, "strokeLinejoin", true); + object.setProperty(rt, "strokeDasharray", true); + object.setProperty(rt, "strokeDashoffset", true); + object.setProperty(rt, "strokeMiterlimit", true); + object.setProperty(rt, "vectorEffect", true); + object.setProperty(rt, "propList", true); + object.setProperty(rt, "x", true); + object.setProperty(rt, "y", true); + object.setProperty(rt, "width", true); + object.setProperty(rt, "height", true); + object.setProperty(rt, "src", true); + object.setProperty(rt, "align", true); + object.setProperty(rt, "meetOrSlice", true); + return object; + } + + facebook::jsi::Object createBubblingEventTypes(facebook::jsi::Runtime &rt) override { + facebook::jsi::Object events(rt); + return events; + } + + facebook::jsi::Object createDirectEventTypes(facebook::jsi::Runtime &rt) override { + facebook::jsi::Object events(rt); + return events; + } +}; +} // namespace rnoh diff --git a/tester/harmony/svg/src/main/cpp/componentBinders/RNSVGLineJSIBinder.h b/tester/harmony/svg/src/main/cpp/componentBinders/RNSVGLineJSIBinder.h new file mode 100644 index 0000000000000000000000000000000000000000..76eb5b3647633a088f76f5cfc54bc335a8efcb8f --- /dev/null +++ b/tester/harmony/svg/src/main/cpp/componentBinders/RNSVGLineJSIBinder.h @@ -0,0 +1,54 @@ +#pragma once + +// This file was generated. + +#include "RNOHCorePackage/ComponentBinders/ViewComponentJSIBinder.h" + +namespace rnoh { +class RNSVGLineJSIBinder : public ViewComponentJSIBinder { + protected: + facebook::jsi::Object createNativeProps(facebook::jsi::Runtime &rt) override { + auto object = ViewComponentJSIBinder::createNativeProps(rt); + object.setProperty(rt, "name", true); + object.setProperty(rt, "opacity", true); + object.setProperty(rt, "matrix", true); + object.setProperty(rt, "mask", true); + object.setProperty(rt, "markerStart", true); + object.setProperty(rt, "markerMid", true); + object.setProperty(rt, "markerEnd", true); + object.setProperty(rt, "clipPath", true); + object.setProperty(rt, "clipRule", true); + object.setProperty(rt, "responsible", true); + object.setProperty(rt, "display", true); + object.setProperty(rt, "pointerEvents", true); + object.setProperty(rt, "fill", "Object"); + object.setProperty(rt, "fillOpacity", true); + object.setProperty(rt, "fillRule", true); + object.setProperty(rt, "stroke", "Object"); + object.setProperty(rt, "strokeOpacity", true); + object.setProperty(rt, "strokeWidth", true); + object.setProperty(rt, "strokeLinecap", true); + object.setProperty(rt, "strokeLinejoin", true); + object.setProperty(rt, "strokeDasharray", true); + object.setProperty(rt, "strokeDashoffset", true); + object.setProperty(rt, "strokeMiterlimit", true); + object.setProperty(rt, "vectorEffect", true); + object.setProperty(rt, "propList", true); + object.setProperty(rt, "x1", true); + object.setProperty(rt, "y1", true); + object.setProperty(rt, "x2", true); + object.setProperty(rt, "y2", true); + return object; + } + + facebook::jsi::Object createBubblingEventTypes(facebook::jsi::Runtime &rt) override { + facebook::jsi::Object events(rt); + return events; + } + + facebook::jsi::Object createDirectEventTypes(facebook::jsi::Runtime &rt) override { + facebook::jsi::Object events(rt); + return events; + } +}; +} // namespace rnoh diff --git a/tester/harmony/svg/src/main/cpp/componentBinders/RNSVGLinearGradientJSIBinder.h b/tester/harmony/svg/src/main/cpp/componentBinders/RNSVGLinearGradientJSIBinder.h new file mode 100644 index 0000000000000000000000000000000000000000..6ee69d805a9e856a35d831b75d339e2528a287ca --- /dev/null +++ b/tester/harmony/svg/src/main/cpp/componentBinders/RNSVGLinearGradientJSIBinder.h @@ -0,0 +1,44 @@ +#pragma once + +// This file was generated. + +#include "RNOHCorePackage/ComponentBinders/ViewComponentJSIBinder.h" + +namespace rnoh { +class RNSVGLinearGradientJSIBinder : public ViewComponentJSIBinder { + protected: + facebook::jsi::Object createNativeProps(facebook::jsi::Runtime &rt) override { + auto object = ViewComponentJSIBinder::createNativeProps(rt); + object.setProperty(rt, "name", true); + object.setProperty(rt, "opacity", true); + object.setProperty(rt, "matrix", true); + object.setProperty(rt, "mask", true); + object.setProperty(rt, "markerStart", true); + object.setProperty(rt, "markerMid", true); + object.setProperty(rt, "markerEnd", true); + object.setProperty(rt, "clipPath", true); + object.setProperty(rt, "clipRule", true); + object.setProperty(rt, "responsible", true); + object.setProperty(rt, "display", true); + object.setProperty(rt, "pointerEvents", true); + object.setProperty(rt, "x1", true); + object.setProperty(rt, "y1", true); + object.setProperty(rt, "x2", true); + object.setProperty(rt, "y2", true); + object.setProperty(rt, "gradient", true); + object.setProperty(rt, "gradientUnits", true); + object.setProperty(rt, "gradientTransform", true); + return object; + } + + facebook::jsi::Object createBubblingEventTypes(facebook::jsi::Runtime &rt) override { + facebook::jsi::Object events(rt); + return events; + } + + facebook::jsi::Object createDirectEventTypes(facebook::jsi::Runtime &rt) override { + facebook::jsi::Object events(rt); + return events; + } +}; +} // namespace rnoh diff --git a/tester/harmony/svg/src/main/cpp/componentBinders/RNSVGMarkerJSIBinder.h b/tester/harmony/svg/src/main/cpp/componentBinders/RNSVGMarkerJSIBinder.h new file mode 100644 index 0000000000000000000000000000000000000000..0ccc7f547c584c3d206c95b955f0c760636359f5 --- /dev/null +++ b/tester/harmony/svg/src/main/cpp/componentBinders/RNSVGMarkerJSIBinder.h @@ -0,0 +1,65 @@ +#pragma once + +// This file was generated. + +#include "RNOHCorePackage/ComponentBinders/ViewComponentJSIBinder.h" + +namespace rnoh { +class RNSVGMarkerJSIBinder : public ViewComponentJSIBinder { + protected: + facebook::jsi::Object createNativeProps(facebook::jsi::Runtime &rt) override { + auto object = ViewComponentJSIBinder::createNativeProps(rt); + object.setProperty(rt, "name", true); + object.setProperty(rt, "opacity", true); + object.setProperty(rt, "matrix", true); + object.setProperty(rt, "mask", true); + object.setProperty(rt, "markerStart", true); + object.setProperty(rt, "markerMid", true); + object.setProperty(rt, "markerEnd", true); + object.setProperty(rt, "clipPath", true); + object.setProperty(rt, "clipRule", true); + object.setProperty(rt, "responsible", true); + object.setProperty(rt, "display", true); + object.setProperty(rt, "pointerEvents", true); + object.setProperty(rt, "fill", "Object"); + object.setProperty(rt, "fillOpacity", true); + object.setProperty(rt, "fillRule", true); + object.setProperty(rt, "stroke", "Object"); + object.setProperty(rt, "strokeOpacity", true); + object.setProperty(rt, "strokeWidth", true); + object.setProperty(rt, "strokeLinecap", true); + object.setProperty(rt, "strokeLinejoin", true); + object.setProperty(rt, "strokeDasharray", true); + object.setProperty(rt, "strokeDashoffset", true); + object.setProperty(rt, "strokeMiterlimit", true); + object.setProperty(rt, "vectorEffect", true); + object.setProperty(rt, "propList", true); + object.setProperty(rt, "fontSize", true); + object.setProperty(rt, "fontWeight", true); + object.setProperty(rt, "font", "Object"); + object.setProperty(rt, "refX", true); + object.setProperty(rt, "refY", true); + object.setProperty(rt, "markerHeight", true); + object.setProperty(rt, "markerWidth", true); + object.setProperty(rt, "markerUnits", true); + object.setProperty(rt, "orient", true); + object.setProperty(rt, "minX", true); + object.setProperty(rt, "minY", true); + object.setProperty(rt, "vbWidth", true); + object.setProperty(rt, "vbHeight", true); + object.setProperty(rt, "align", true); + object.setProperty(rt, "meetOrSlice", true); + return object; + } + + facebook::jsi::Object createBubblingEventTypes(facebook::jsi::Runtime &rt) override { + facebook::jsi::Object events(rt); + return events; + } + + facebook::jsi::Object createDirectEventTypes(facebook::jsi::Runtime &rt) override { + facebook::jsi::Object events(rt); + return events; + } +}; +} // namespace rnoh diff --git a/tester/harmony/svg/src/main/cpp/componentBinders/RNSVGMaskJSIBinder.h b/tester/harmony/svg/src/main/cpp/componentBinders/RNSVGMaskJSIBinder.h new file mode 100644 index 0000000000000000000000000000000000000000..6ee9bade03b81bfe077d7235f4dbb13546452b26 --- /dev/null +++ b/tester/harmony/svg/src/main/cpp/componentBinders/RNSVGMaskJSIBinder.h @@ -0,0 +1,59 @@ +#pragma once + +// This file was generated. + +#include "RNOHCorePackage/ComponentBinders/ViewComponentJSIBinder.h" + +namespace rnoh { +class RNSVGMaskJSIBinder : public ViewComponentJSIBinder { + protected: + facebook::jsi::Object createNativeProps(facebook::jsi::Runtime &rt) override { + auto object = ViewComponentJSIBinder::createNativeProps(rt); + object.setProperty(rt, "name", true); + object.setProperty(rt, "opacity", true); + object.setProperty(rt, "matrix", true); + object.setProperty(rt, "mask", true); + object.setProperty(rt, "markerStart", true); + object.setProperty(rt, "markerMid", true); + object.setProperty(rt, "markerEnd", true); + object.setProperty(rt, "clipPath", true); + object.setProperty(rt, "clipRule", true); + object.setProperty(rt, "responsible", true); + object.setProperty(rt, "display", true); + object.setProperty(rt, "pointerEvents", true); + object.setProperty(rt, "fill", "Object"); + object.setProperty(rt, "fillOpacity", true); + object.setProperty(rt, "fillRule", true); + object.setProperty(rt, "stroke", "Object"); + object.setProperty(rt, "strokeOpacity", true); + object.setProperty(rt, "strokeWidth", true); + object.setProperty(rt, "strokeLinecap", true); + object.setProperty(rt, "strokeLinejoin", true); + object.setProperty(rt, "strokeDasharray", true); + object.setProperty(rt, "strokeDashoffset", true); + object.setProperty(rt, "strokeMiterlimit", true); + object.setProperty(rt, "vectorEffect", true); + object.setProperty(rt, "propList", true); + object.setProperty(rt, "fontSize", true); + object.setProperty(rt, "fontWeight", true); + object.setProperty(rt, "font", "Object"); + object.setProperty(rt, "x", true); + object.setProperty(rt, "y", true); + object.setProperty(rt, "height", true); + object.setProperty(rt, "width", true); + object.setProperty(rt, "maskUnits", true); + object.setProperty(rt, "maskContentUnits", true); + return object; + } + + facebook::jsi::Object createBubblingEventTypes(facebook::jsi::Runtime &rt) override { + facebook::jsi::Object events(rt); + return events; + } + + facebook::jsi::Object createDirectEventTypes(facebook::jsi::Runtime &rt) override { + facebook::jsi::Object events(rt); + return events; + } +}; +} // namespace rnoh diff --git a/tester/harmony/svg/src/main/cpp/componentBinders/RNSVGPathJSIBinder.h b/tester/harmony/svg/src/main/cpp/componentBinders/RNSVGPathJSIBinder.h new file mode 100644 index 0000000000000000000000000000000000000000..7b4a7f4e03ad8b5133e1212274817bf16bb4c4e2 --- /dev/null +++ b/tester/harmony/svg/src/main/cpp/componentBinders/RNSVGPathJSIBinder.h @@ -0,0 +1,51 @@ +#pragma once + +// This file was generated. + +#include "RNOHCorePackage/ComponentBinders/ViewComponentJSIBinder.h" + +namespace rnoh { +class RNSVGPathJSIBinder : public ViewComponentJSIBinder { + protected: + facebook::jsi::Object createNativeProps(facebook::jsi::Runtime &rt) override { + auto object = ViewComponentJSIBinder::createNativeProps(rt); + object.setProperty(rt, "name", true); + object.setProperty(rt, "opacity", true); + object.setProperty(rt, "matrix", true); + object.setProperty(rt, "mask", true); + object.setProperty(rt, "markerStart", true); + object.setProperty(rt, "markerMid", true); + object.setProperty(rt, "markerEnd", true); + object.setProperty(rt, "clipPath", true); + object.setProperty(rt, "clipRule", true); + object.setProperty(rt, "responsible", true); + object.setProperty(rt, "display", true); + object.setProperty(rt, "pointerEvents", true); + object.setProperty(rt, "fill", "Object"); + object.setProperty(rt, "fillOpacity", true); + object.setProperty(rt, "fillRule", true); + object.setProperty(rt, "stroke", "Object"); + object.setProperty(rt, "strokeOpacity", true); + object.setProperty(rt, "strokeWidth", true); + object.setProperty(rt, "strokeLinecap", true); + object.setProperty(rt, "strokeLinejoin", true); + object.setProperty(rt, "strokeDasharray", true); + object.setProperty(rt, "strokeDashoffset", true); + object.setProperty(rt, "strokeMiterlimit", true); + object.setProperty(rt, "vectorEffect", true); + object.setProperty(rt, "propList", true); + object.setProperty(rt, "d", true); + return object; + } + + facebook::jsi::Object createBubblingEventTypes(facebook::jsi::Runtime &rt) override { + facebook::jsi::Object events(rt); + return events; + } + + facebook::jsi::Object createDirectEventTypes(facebook::jsi::Runtime &rt) override { + facebook::jsi::Object events(rt); + return events; + } +}; +} // namespace rnoh diff --git a/tester/harmony/svg/src/main/cpp/componentBinders/RNSVGPatternJSIBinder.h b/tester/harmony/svg/src/main/cpp/componentBinders/RNSVGPatternJSIBinder.h new file mode 100644 index 0000000000000000000000000000000000000000..3384123da815739dcfe9ee13df9b99a72dac0c39 --- /dev/null +++ b/tester/harmony/svg/src/main/cpp/componentBinders/RNSVGPatternJSIBinder.h @@ -0,0 +1,66 @@ +#pragma once + +// This file was generated. + +#include "RNOHCorePackage/ComponentBinders/ViewComponentJSIBinder.h" + +namespace rnoh { +class RNSVGPatternJSIBinder : public ViewComponentJSIBinder { + protected: + facebook::jsi::Object createNativeProps(facebook::jsi::Runtime &rt) override { + auto object = ViewComponentJSIBinder::createNativeProps(rt); + object.setProperty(rt, "name", true); + object.setProperty(rt, "opacity", true); + object.setProperty(rt, "matrix", true); + object.setProperty(rt, "mask", true); + object.setProperty(rt, "markerStart", true); + object.setProperty(rt, "markerMid", true); + object.setProperty(rt, "markerEnd", true); + object.setProperty(rt, "clipPath", true); + object.setProperty(rt, "clipRule", true); + object.setProperty(rt, "responsible", true); + object.setProperty(rt, "display", true); + object.setProperty(rt, "pointerEvents", true); + object.setProperty(rt, "fill", "Object"); + object.setProperty(rt, "fillOpacity", true); + object.setProperty(rt, "fillRule", true); + object.setProperty(rt, "stroke", "Object"); + object.setProperty(rt, "strokeOpacity", true); + object.setProperty(rt, "strokeWidth", true); + object.setProperty(rt, "strokeLinecap", true); + object.setProperty(rt, "strokeLinejoin", true); + object.setProperty(rt, "strokeDasharray", true); + object.setProperty(rt, "strokeDashoffset", true); + object.setProperty(rt, "strokeMiterlimit", true); + object.setProperty(rt, "vectorEffect", true); + object.setProperty(rt, "propList", true); + object.setProperty(rt, "fontSize", true); + object.setProperty(rt, "fontWeight", true); + object.setProperty(rt, "font", "Object"); + object.setProperty(rt, "x", true); + object.setProperty(rt, "y", true); + object.setProperty(rt, "height", true); + object.setProperty(rt, "width", true); + object.setProperty(rt, "patternUnits", true); + object.setProperty(rt, "patternContentUnits", true); + object.setProperty(rt, "patternTransform", true); + object.setProperty(rt, "minX", true); + object.setProperty(rt, "minY", true); + object.setProperty(rt, "vbWidth", true); + object.setProperty(rt, "vbHeight", true); + object.setProperty(rt, "align", true); + object.setProperty(rt, "meetOrSlice", true); + return object; + } + + facebook::jsi::Object createBubblingEventTypes(facebook::jsi::Runtime &rt) override { + facebook::jsi::Object events(rt); + return events; + } + + facebook::jsi::Object createDirectEventTypes(facebook::jsi::Runtime &rt) override { + facebook::jsi::Object events(rt); + return events; + } +}; +} // namespace rnoh diff --git a/tester/harmony/svg/src/main/cpp/componentBinders/RNSVGRadialGradientJSIBinder.h b/tester/harmony/svg/src/main/cpp/componentBinders/RNSVGRadialGradientJSIBinder.h new file mode 100644 index 0000000000000000000000000000000000000000..e641f440f54810e1b285b732b609eb812b44c0cd --- /dev/null +++ b/tester/harmony/svg/src/main/cpp/componentBinders/RNSVGRadialGradientJSIBinder.h @@ -0,0 +1,46 @@ +#pragma once + +// This file was generated. + +#include "RNOHCorePackage/ComponentBinders/ViewComponentJSIBinder.h" + +namespace rnoh { +class RNSVGRadialGradientJSIBinder : public ViewComponentJSIBinder { + protected: + facebook::jsi::Object createNativeProps(facebook::jsi::Runtime &rt) override { + auto object = ViewComponentJSIBinder::createNativeProps(rt); + object.setProperty(rt, "name", true); + object.setProperty(rt, "opacity", true); + object.setProperty(rt, "matrix", true); + object.setProperty(rt, "mask", true); + object.setProperty(rt, "markerStart", true); + object.setProperty(rt, "markerMid", true); + object.setProperty(rt, "markerEnd", true); + object.setProperty(rt, "clipPath", true); + object.setProperty(rt, "clipRule", true); + object.setProperty(rt, "responsible", true); + object.setProperty(rt, "display", true); + object.setProperty(rt, "pointerEvents", true); + object.setProperty(rt, "fx", true); + object.setProperty(rt, "fy", true); + object.setProperty(rt, "cx", true); + object.setProperty(rt, "cy", true); + object.setProperty(rt, "rx", true); + object.setProperty(rt, "ry", true); + object.setProperty(rt, "gradient", true); + object.setProperty(rt, "gradientUnits", true); + object.setProperty(rt, "gradientTransform", true); + return object; + } + + facebook::jsi::Object createBubblingEventTypes(facebook::jsi::Runtime &rt) override { + facebook::jsi::Object events(rt); + return events; + } + + facebook::jsi::Object createDirectEventTypes(facebook::jsi::Runtime &rt) override { + facebook::jsi::Object events(rt); + return events; + } +}; +} // namespace rnoh diff --git a/tester/harmony/svg/src/main/cpp/componentBinders/RNSVGRectJSIBinder.h b/tester/harmony/svg/src/main/cpp/componentBinders/RNSVGRectJSIBinder.h new file mode 100644 index 0000000000000000000000000000000000000000..a1ddeb1aa3dee4686b7c56aaa350643acd408e75 --- /dev/null +++ b/tester/harmony/svg/src/main/cpp/componentBinders/RNSVGRectJSIBinder.h @@ -0,0 +1,56 @@ +#pragma once + +// This file was generated. + +#include "RNOHCorePackage/ComponentBinders/ViewComponentJSIBinder.h" + +namespace rnoh { +class RNSVGRectJSIBinder : public ViewComponentJSIBinder { + protected: + facebook::jsi::Object createNativeProps(facebook::jsi::Runtime &rt) override { + auto object = ViewComponentJSIBinder::createNativeProps(rt); + object.setProperty(rt, "name", true); + object.setProperty(rt, "opacity", true); + object.setProperty(rt, "matrix", true); + object.setProperty(rt, "mask", true); + object.setProperty(rt, "markerStart", true); + object.setProperty(rt, "markerMid", true); + object.setProperty(rt, "markerEnd", true); + object.setProperty(rt, "clipPath", true); + object.setProperty(rt, "clipRule", true); + object.setProperty(rt, "responsible", true); + object.setProperty(rt, "display", true); + object.setProperty(rt, "pointerEvents", true); + object.setProperty(rt, "fill", "Object"); + object.setProperty(rt, "fillOpacity", true); + object.setProperty(rt, "fillRule", true); + object.setProperty(rt, "stroke", "Object"); + object.setProperty(rt, "strokeOpacity", true); + object.setProperty(rt, "strokeWidth", true); + object.setProperty(rt, "strokeLinecap", true); + object.setProperty(rt, "strokeLinejoin", true); + object.setProperty(rt, "strokeDasharray", true); + object.setProperty(rt, "strokeDashoffset", true); + object.setProperty(rt, "strokeMiterlimit", true); + object.setProperty(rt, "vectorEffect", true); + object.setProperty(rt, "propList", true); + object.setProperty(rt, "x", true); + object.setProperty(rt, "y", true); + object.setProperty(rt, "height", true); + object.setProperty(rt, "width", true); + object.setProperty(rt, "rx", true); + object.setProperty(rt, "ry", true); + return object; + } + + facebook::jsi::Object createBubblingEventTypes(facebook::jsi::Runtime &rt) override { + facebook::jsi::Object events(rt); + return events; + } + + facebook::jsi::Object createDirectEventTypes(facebook::jsi::Runtime &rt) override { + facebook::jsi::Object events(rt); + return events; + } +}; +} // namespace rnoh diff --git a/tester/harmony/svg/src/main/cpp/componentBinders/RNSVGSvgViewAndroidJSIBinder.h b/tester/harmony/svg/src/main/cpp/componentBinders/RNSVGSvgViewAndroidJSIBinder.h new file mode 100644 index 0000000000000000000000000000000000000000..a2bf46a50a11f49baa0d24785f8789b24c252b98 --- /dev/null +++ b/tester/harmony/svg/src/main/cpp/componentBinders/RNSVGSvgViewAndroidJSIBinder.h @@ -0,0 +1,67 @@ +#pragma once + +// This file was generated. + +#include "RNOHCorePackage/ComponentBinders/ViewComponentJSIBinder.h" + +namespace rnoh { +class RNSVGSvgViewAndroidJSIBinder : public ViewComponentJSIBinder { + protected: + facebook::jsi::Object createNativeProps(facebook::jsi::Runtime &rt) override { + auto object = ViewComponentJSIBinder::createNativeProps(rt); + object.setProperty(rt, "bbWidth", true); + object.setProperty(rt, "bbHeight", true); + object.setProperty(rt, "minX", true); + object.setProperty(rt, "minY", true); + object.setProperty(rt, "vbWidth", true); + object.setProperty(rt, "vbHeight", true); + object.setProperty(rt, "align", true); + object.setProperty(rt, "meetOrSlice", true); + object.setProperty(rt, "tintColor", true); + object.setProperty(rt, "color", true); + object.setProperty(rt, "pointerEvents", true); + object.setProperty(rt, "hasTVPreferredFocus", true); + object.setProperty(rt, "borderTopEndRadius", true); + object.setProperty(rt, "borderBottomStartRadius", true); + object.setProperty(rt, "borderBottomColor", true); + object.setProperty(rt, "nextFocusDown", true); + object.setProperty(rt, "borderRightColor", true); + object.setProperty(rt, "nextFocusRight", true); + object.setProperty(rt, "borderLeftColor", true); + object.setProperty(rt, "borderColor", true); + object.setProperty(rt, "removeClippedSubviews", true); + object.setProperty(rt, "nextFocusForward", true); + object.setProperty(rt, "nextFocusUp", true); + object.setProperty(rt, "accessible", true); + object.setProperty(rt, "borderStartColor", true); + object.setProperty(rt, "borderBottomEndRadius", true); + object.setProperty(rt, "borderEndColor", true); + object.setProperty(rt, "focusable", true); + object.setProperty(rt, "nativeBackgroundAndroid", "Object"); + object.setProperty(rt, "borderTopStartRadius", true); + object.setProperty(rt, "nativeForegroundAndroid", "Object"); + object.setProperty(rt, "backfaceVisibility", true); + object.setProperty(rt, "borderStyle", true); + object.setProperty(rt, "needsOffscreenAlphaCompositing", true); + object.setProperty(rt, "hitSlop", "Object"); + object.setProperty(rt, "borderTopColor", true); + object.setProperty(rt, "nextFocusLeft", true); + object.setProperty(rt, "borderTopRightRadius", true); + object.setProperty(rt, "borderBottomRightRadius", true); + object.setProperty(rt, "borderRadius", true); + object.setProperty(rt, "borderBottomLeftRadius", true); + object.setProperty(rt, "borderTopLeftRadius", true); + return object; + } + + facebook::jsi::Object createBubblingEventTypes(facebook::jsi::Runtime &rt) override { + facebook::jsi::Object events(rt); + return events; + } + + facebook::jsi::Object createDirectEventTypes(facebook::jsi::Runtime &rt) override { + facebook::jsi::Object events(rt); + return events; + } +}; +} // namespace rnoh diff --git a/tester/harmony/svg/src/main/cpp/componentBinders/RNSVGSvgViewJSIBinder.h b/tester/harmony/svg/src/main/cpp/componentBinders/RNSVGSvgViewJSIBinder.h new file mode 100644 index 0000000000000000000000000000000000000000..74b91d5f89809f08d11bd55454f3055676ea8810 --- /dev/null +++ b/tester/harmony/svg/src/main/cpp/componentBinders/RNSVGSvgViewJSIBinder.h @@ -0,0 +1,36 @@ +#pragma once + +// This file was generated. + +#include "RNOHCorePackage/ComponentBinders/ViewComponentJSIBinder.h" + +namespace rnoh { +class RNSVGSvgViewJSIBinder : public ViewComponentJSIBinder { + protected: + facebook::jsi::Object createNativeProps(facebook::jsi::Runtime &rt) override { + auto object = ViewComponentJSIBinder::createNativeProps(rt); + object.setProperty(rt, "bbWidth", true); + object.setProperty(rt, "bbHeight", true); + object.setProperty(rt, "minX", true); + object.setProperty(rt, "minY", true); + object.setProperty(rt, "vbWidth", true); + object.setProperty(rt, "vbHeight", true); + object.setProperty(rt, "align", true); + object.setProperty(rt, "meetOrSlice", true); + object.setProperty(rt, "tintColor", true); + object.setProperty(rt, "color", true); + object.setProperty(rt, "pointerEvents", true); + return object; + } + + facebook::jsi::Object createBubblingEventTypes(facebook::jsi::Runtime &rt) override { + facebook::jsi::Object events(rt); + return events; + } + + facebook::jsi::Object createDirectEventTypes(facebook::jsi::Runtime &rt) override { + facebook::jsi::Object events(rt); + return events; + } +}; +} // namespace rnoh diff --git a/tester/harmony/svg/src/main/cpp/componentBinders/RNSVGSymbolJSIBinder.h b/tester/harmony/svg/src/main/cpp/componentBinders/RNSVGSymbolJSIBinder.h new file mode 100644 index 0000000000000000000000000000000000000000..b04b72c2beb8c3d19d66c5c5c9e5a57baab46e1c --- /dev/null +++ b/tester/harmony/svg/src/main/cpp/componentBinders/RNSVGSymbolJSIBinder.h @@ -0,0 +1,59 @@ +#pragma once + +// This file was generated. + +#include "RNOHCorePackage/ComponentBinders/ViewComponentJSIBinder.h" + +namespace rnoh { +class RNSVGSymbolJSIBinder : public ViewComponentJSIBinder { + protected: + facebook::jsi::Object createNativeProps(facebook::jsi::Runtime &rt) override { + auto object = ViewComponentJSIBinder::createNativeProps(rt); + object.setProperty(rt, "name", true); + object.setProperty(rt, "opacity", true); + object.setProperty(rt, "matrix", true); + object.setProperty(rt, "mask", true); + object.setProperty(rt, "markerStart", true); + object.setProperty(rt, "markerMid", true); + object.setProperty(rt, "markerEnd", true); + object.setProperty(rt, "clipPath", true); + object.setProperty(rt, "clipRule", true); + object.setProperty(rt, "responsible", true); + object.setProperty(rt, "display", true); + object.setProperty(rt, "pointerEvents", true); + object.setProperty(rt, "fill", "Object"); + object.setProperty(rt, "fillOpacity", true); + object.setProperty(rt, "fillRule", true); + object.setProperty(rt, "stroke", "Object"); + object.setProperty(rt, "strokeOpacity", true); + object.setProperty(rt, "strokeWidth", true); + object.setProperty(rt, "strokeLinecap", true); + object.setProperty(rt, "strokeLinejoin", true); + object.setProperty(rt, "strokeDasharray", true); + object.setProperty(rt, "strokeDashoffset", true); + object.setProperty(rt, "strokeMiterlimit", true); + object.setProperty(rt, "vectorEffect", true); + object.setProperty(rt, "propList", true); + object.setProperty(rt, "fontSize", true); + object.setProperty(rt, "fontWeight", true); + object.setProperty(rt, "font", "Object"); + object.setProperty(rt, "minX", true); + object.setProperty(rt, "minY", true); + object.setProperty(rt, "vbWidth", true); + object.setProperty(rt, "vbHeight", true); + object.setProperty(rt, "align", true); + object.setProperty(rt, "meetOrSlice", true); + return object; + } + + facebook::jsi::Object createBubblingEventTypes(facebook::jsi::Runtime &rt) override { + facebook::jsi::Object events(rt); + return events; + } + + facebook::jsi::Object createDirectEventTypes(facebook::jsi::Runtime &rt) override { + facebook::jsi::Object events(rt); + return events; + } +}; +} // namespace rnoh diff --git a/tester/harmony/svg/src/main/cpp/componentBinders/RNSVGTSpanJSIBinder.h b/tester/harmony/svg/src/main/cpp/componentBinders/RNSVGTSpanJSIBinder.h new file mode 100644 index 0000000000000000000000000000000000000000..e5952099edad76626c9dd96347a9893d82e41b72 --- /dev/null +++ b/tester/harmony/svg/src/main/cpp/componentBinders/RNSVGTSpanJSIBinder.h @@ -0,0 +1,65 @@ +#pragma once + +// This file was generated. + +#include "RNOHCorePackage/ComponentBinders/ViewComponentJSIBinder.h" + +namespace rnoh { +class RNSVGTSpanJSIBinder : public ViewComponentJSIBinder { + protected: + facebook::jsi::Object createNativeProps(facebook::jsi::Runtime &rt) override { + auto object = ViewComponentJSIBinder::createNativeProps(rt); + object.setProperty(rt, "name", true); + object.setProperty(rt, "opacity", true); + object.setProperty(rt, "matrix", true); + object.setProperty(rt, "mask", true); + object.setProperty(rt, "markerStart", true); + object.setProperty(rt, "markerMid", true); + object.setProperty(rt, "markerEnd", true); + object.setProperty(rt, "clipPath", true); + object.setProperty(rt, "clipRule", true); + object.setProperty(rt, "responsible", true); + object.setProperty(rt, "display", true); + object.setProperty(rt, "pointerEvents", true); + object.setProperty(rt, "fill", "Object"); + object.setProperty(rt, "fillOpacity", true); + object.setProperty(rt, "fillRule", true); + object.setProperty(rt, "stroke", "Object"); + object.setProperty(rt, "strokeOpacity", true); + object.setProperty(rt, "strokeWidth", true); + object.setProperty(rt, "strokeLinecap", true); + object.setProperty(rt, "strokeLinejoin", true); + object.setProperty(rt, "strokeDasharray", true); + object.setProperty(rt, "strokeDashoffset", true); + object.setProperty(rt, "strokeMiterlimit", true); + object.setProperty(rt, "vectorEffect", true); + object.setProperty(rt, "propList", true); + object.setProperty(rt, "fontSize", true); + object.setProperty(rt, "fontWeight", true); + object.setProperty(rt, "font", "Object"); + object.setProperty(rt, "dx", true); + object.setProperty(rt, "dy", true); + object.setProperty(rt, "x", true); + object.setProperty(rt, "y", true); + object.setProperty(rt, "rotate", true); + object.setProperty(rt, "inlineSize", true); + object.setProperty(rt, "textLength", true); + object.setProperty(rt, "baselineShift", true); + object.setProperty(rt, "lengthAdjust", true); + object.setProperty(rt, "alignmentBaseline", true); + object.setProperty(rt, "verticalAlign", true); + object.setProperty(rt, "content", true); + return object; + } + + facebook::jsi::Object createBubblingEventTypes(facebook::jsi::Runtime &rt) override { + facebook::jsi::Object events(rt); + return events; + } + + facebook::jsi::Object createDirectEventTypes(facebook::jsi::Runtime &rt) override { + facebook::jsi::Object events(rt); + return events; + } +}; +} // namespace rnoh diff --git a/tester/harmony/svg/src/main/cpp/componentBinders/RNSVGTextJSIBinder.h b/tester/harmony/svg/src/main/cpp/componentBinders/RNSVGTextJSIBinder.h new file mode 100644 index 0000000000000000000000000000000000000000..fa6825443e2e2c929700fab5c2aef4c90e65260d --- /dev/null +++ b/tester/harmony/svg/src/main/cpp/componentBinders/RNSVGTextJSIBinder.h @@ -0,0 +1,64 @@ +#pragma once + +// This file was generated. + +#include "RNOHCorePackage/ComponentBinders/ViewComponentJSIBinder.h" + +namespace rnoh { +class RNSVGTextJSIBinder : public ViewComponentJSIBinder { + protected: + facebook::jsi::Object createNativeProps(facebook::jsi::Runtime &rt) override { + auto object = ViewComponentJSIBinder::createNativeProps(rt); + object.setProperty(rt, "name", true); + object.setProperty(rt, "opacity", true); + object.setProperty(rt, "matrix", true); + object.setProperty(rt, "mask", true); + object.setProperty(rt, "markerStart", true); + object.setProperty(rt, "markerMid", true); + object.setProperty(rt, "markerEnd", true); + object.setProperty(rt, "clipPath", true); + object.setProperty(rt, "clipRule", true); + object.setProperty(rt, "responsible", true); + object.setProperty(rt, "display", true); + object.setProperty(rt, "pointerEvents", true); + object.setProperty(rt, "fill", "Object"); + object.setProperty(rt, "fillOpacity", true); + object.setProperty(rt, "fillRule", true); + object.setProperty(rt, "stroke", "Object"); + object.setProperty(rt, "strokeOpacity", true); + object.setProperty(rt, "strokeWidth", true); + object.setProperty(rt, "strokeLinecap", true); + object.setProperty(rt, "strokeLinejoin", true); + object.setProperty(rt, "strokeDasharray", true); + object.setProperty(rt, "strokeDashoffset", true); + object.setProperty(rt, "strokeMiterlimit", true); + object.setProperty(rt, "vectorEffect", true); + object.setProperty(rt, "propList", true); + object.setProperty(rt, "fontSize", true); + object.setProperty(rt, "fontWeight", true); + object.setProperty(rt, "font", "Object"); + object.setProperty(rt, "dx", true); + object.setProperty(rt, "dy", true); + object.setProperty(rt, "x", true); + object.setProperty(rt, "y", true); + object.setProperty(rt, "rotate", true); + object.setProperty(rt, "inlineSize", true); + object.setProperty(rt, "textLength", true); + object.setProperty(rt, "baselineShift", true); + object.setProperty(rt, "lengthAdjust", true); + object.setProperty(rt, "alignmentBaseline", true); + object.setProperty(rt, "verticalAlign", true); + return object; + } + + facebook::jsi::Object createBubblingEventTypes(facebook::jsi::Runtime &rt) override { + facebook::jsi::Object events(rt); + return events; + } + + facebook::jsi::Object createDirectEventTypes(facebook::jsi::Runtime &rt) override { + facebook::jsi::Object events(rt); + return events; + } +}; +} // namespace rnoh diff --git a/tester/harmony/svg/src/main/cpp/componentBinders/RNSVGTextPathJSIBinder.h b/tester/harmony/svg/src/main/cpp/componentBinders/RNSVGTextPathJSIBinder.h new file mode 100644 index 0000000000000000000000000000000000000000..9e1d309be18135fd3c9dfd327a5ee29d48fa3373 --- /dev/null +++ b/tester/harmony/svg/src/main/cpp/componentBinders/RNSVGTextPathJSIBinder.h @@ -0,0 +1,70 @@ +#pragma once + +// This file was generated. + +#include "RNOHCorePackage/ComponentBinders/ViewComponentJSIBinder.h" + +namespace rnoh { +class RNSVGTextPathJSIBinder : public ViewComponentJSIBinder { + protected: + facebook::jsi::Object createNativeProps(facebook::jsi::Runtime &rt) override { + auto object = ViewComponentJSIBinder::createNativeProps(rt); + object.setProperty(rt, "name", true); + object.setProperty(rt, "opacity", true); + object.setProperty(rt, "matrix", true); + object.setProperty(rt, "mask", true); + object.setProperty(rt, "markerStart", true); + object.setProperty(rt, "markerMid", true); + object.setProperty(rt, "markerEnd", true); + object.setProperty(rt, "clipPath", true); + object.setProperty(rt, "clipRule", true); + object.setProperty(rt, "responsible", true); + object.setProperty(rt, "display", true); + object.setProperty(rt, "pointerEvents", true); + object.setProperty(rt, "fill", "Object"); + object.setProperty(rt, "fillOpacity", true); + object.setProperty(rt, "fillRule", true); + object.setProperty(rt, "stroke", "Object"); + object.setProperty(rt, "strokeOpacity", true); + object.setProperty(rt, "strokeWidth", true); + object.setProperty(rt, "strokeLinecap", true); + object.setProperty(rt, "strokeLinejoin", true); + object.setProperty(rt, "strokeDasharray", true); + object.setProperty(rt, "strokeDashoffset", true); + object.setProperty(rt, "strokeMiterlimit", true); + object.setProperty(rt, "vectorEffect", true); + object.setProperty(rt, "propList", true); + object.setProperty(rt, "fontSize", true); + object.setProperty(rt, "fontWeight", true); + object.setProperty(rt, "font", "Object"); + object.setProperty(rt, "dx", true); + object.setProperty(rt, "dy", true); + object.setProperty(rt, "x", true); + object.setProperty(rt, "y", true); + object.setProperty(rt, "rotate", true); + object.setProperty(rt, "inlineSize", true); + object.setProperty(rt, "textLength", true); + object.setProperty(rt, "baselineShift", true); + object.setProperty(rt, "lengthAdjust", true); + object.setProperty(rt, "alignmentBaseline", true); + object.setProperty(rt, "verticalAlign", true); + object.setProperty(rt, "href", true); + object.setProperty(rt, "side", true); + object.setProperty(rt, "method", true); + object.setProperty(rt, "midLine", true); + object.setProperty(rt, "spacing", true); + object.setProperty(rt, "startOffset", true); + return object; + } + + facebook::jsi::Object createBubblingEventTypes(facebook::jsi::Runtime &rt) override { + facebook::jsi::Object events(rt); + return events; + } + + facebook::jsi::Object createDirectEventTypes(facebook::jsi::Runtime &rt) override { + facebook::jsi::Object events(rt); + return events; + } +}; +} // namespace rnoh diff --git a/tester/harmony/svg/src/main/cpp/componentBinders/RNSVGUseJSIBinder.h b/tester/harmony/svg/src/main/cpp/componentBinders/RNSVGUseJSIBinder.h new file mode 100644 index 0000000000000000000000000000000000000000..0ec02572a146a39b92b2373de71fb25a5a6ffda8 --- /dev/null +++ b/tester/harmony/svg/src/main/cpp/componentBinders/RNSVGUseJSIBinder.h @@ -0,0 +1,55 @@ +#pragma once + +// This file was generated. + +#include "RNOHCorePackage/ComponentBinders/ViewComponentJSIBinder.h" + +namespace rnoh { +class RNSVGUseJSIBinder : public ViewComponentJSIBinder { + protected: + facebook::jsi::Object createNativeProps(facebook::jsi::Runtime &rt) override { + auto object = ViewComponentJSIBinder::createNativeProps(rt); + object.setProperty(rt, "name", true); + object.setProperty(rt, "opacity", true); + object.setProperty(rt, "matrix", true); + object.setProperty(rt, "mask", true); + object.setProperty(rt, "markerStart", true); + object.setProperty(rt, "markerMid", true); + object.setProperty(rt, "markerEnd", true); + object.setProperty(rt, "clipPath", true); + object.setProperty(rt, "clipRule", true); + object.setProperty(rt, "responsible", true); + object.setProperty(rt, "display", true); + object.setProperty(rt, "pointerEvents", true); + object.setProperty(rt, "fill", "Object"); + object.setProperty(rt, "fillOpacity", true); + object.setProperty(rt, "fillRule", true); + object.setProperty(rt, "stroke", "Object"); + object.setProperty(rt, "strokeOpacity", true); + object.setProperty(rt, "strokeWidth", true); + object.setProperty(rt, "strokeLinecap", true); + object.setProperty(rt, "strokeLinejoin", true); + object.setProperty(rt, "strokeDasharray", true); + object.setProperty(rt, "strokeDashoffset", true); + object.setProperty(rt, "strokeMiterlimit", true); + object.setProperty(rt, "vectorEffect", true); + object.setProperty(rt, "propList", true); + object.setProperty(rt, "href", true); + object.setProperty(rt, "x", true); + object.setProperty(rt, "y", true); + object.setProperty(rt, "height", true); + object.setProperty(rt, "width", true); + return object; + } + + facebook::jsi::Object createBubblingEventTypes(facebook::jsi::Runtime &rt) override { + facebook::jsi::Object events(rt); + return events; + } + + facebook::jsi::Object createDirectEventTypes(facebook::jsi::Runtime &rt) override { + facebook::jsi::Object events(rt); + return events; + } +}; +} // namespace rnoh diff --git a/tester/harmony/svg/src/main/cpp/componentInstances/RNSVGBaseComponentInstance.h b/tester/harmony/svg/src/main/cpp/componentInstances/RNSVGBaseComponentInstance.h new file mode 100644 index 0000000000000000000000000000000000000000..15451bb95d75c8de7985119d3e94b07241af966b --- /dev/null +++ b/tester/harmony/svg/src/main/cpp/componentInstances/RNSVGBaseComponentInstance.h @@ -0,0 +1,173 @@ +#pragma once + +#include "RNOH/CppComponentInstance.h" +#include "SvgArkUINode.h" +#include "SvgHost.h" +#include "RNSVGSvgViewComponentInstance.h" +#include "utils/StringUtils.h" + +namespace rnoh { +namespace svg { + +template class RNSVGBaseComponentInstance : public CppComponentInstance, public SvgHost { +public: + RNSVGBaseComponentInstance(ComponentInstance::Context context) : CppComponentInstance(std::move(context)) {} + + void onPropsChanged(typename CppComponentInstance::SharedConcreteProps const &props) override { + GetSvgNode()->SetScale(CppComponentInstance::m_layoutMetrics.pointScaleFactor); + pointerEvents_ = props->pointerEvents.size() == 0 ? "auto" : props->pointerEvents; + UpdateElementProps(props); + svgMarkDirty(); + } + void onChildRemoved(ComponentInstance::Shared const &childComponentInstance) override { + svgMarkDirty(); + } + + void onChildInserted(ComponentInstance::Shared const &childComponentInstance, std::size_t index) override { + OnChildInsertCommon(std::dynamic_pointer_cast(childComponentInstance)); + svgMarkDirty(); + } + + void setLayout(facebook::react::LayoutMetrics layoutMetrics) override { + CppComponentInstance::m_layoutMetrics = layoutMetrics; + }; + + std::shared_ptr getParentSvgView() const { + auto parent = CppComponentInstance::getParent().lock(); + while (parent) { + auto svgView = std::dynamic_pointer_cast(parent); + if (svgView) { + return svgView; + } + parent = parent->getParent().lock(); + } + return nullptr; + } + + void svgMarkDirty() { + auto svgView = m_svgViewComponentInstance.lock(); + if (svgView == nullptr) { + svgView = getParentSvgView(); + } + if (svgView != nullptr) { + m_svgViewComponentInstance = svgView; + svgView->getLocalRootArkUINode().markDirty(); + } + } + + /* + check if it can handle the touch itself. + */ + bool containsPoint(facebook::react::Point const &point) const override { + if (isInvisible(CppComponentInstance::getComponentName())) { + return false; + } + auto const &node = SvgHost::GetSvgNode(); + if (node == nullptr) { + return false; + } + DLOG(INFO) << "[SvgTouch] name: " << CppComponentInstance::getComponentName(); + DLOG(INFO) << "[SvgTouch] point x: " << point.x << ", y: " << point.y; + DLOG(INFO) << "[SvgTouch] point PX x1: " << vpToPx(point.x) << ", PX y1: " << vpToPx(point.y); + DLOG(INFO) << "[SvgTouch] containsPoint1: " << node->AsPath().Contains(vpToPx(point.x), vpToPx(point.y)); + // For debug + auto rect = node->AsBounds(); + DLOG(INFO) << "[SvgTouch] asBound x: " << rect.Left() << ", y: " << rect.Top() << ", width: " << rect.Width() + << ", height: " << rect.Height(); + + auto invertedTransform = node->lastCanvasMatrix_.Invert(); + if (!invertedTransform.has_value()) { + return false; + } + auto transformed = invertedTransform.value().MapPoint({float(vpToPx(point.x)), float(vpToPx(point.y))}); + return node->AsPath().Contains(transformed.x, transformed.y); + } + + /* + check if any of its children can potentially handle the touch (the "bounding box" is a rectangle which contains the + component and all of its children -- if overflow is visible, they can extend beyond the View, so this is an + optimization to avoid walking the whole component tree). It also calls canChildrenHandleTouch to check for other + reasons why it shouldn't check its children (such as pointer events). + Can just return true from it since it's only used as an optimization to avoid walking the whole tree. + */ + bool containsPointInBoundingBox(facebook::react::Point const &point) override { + if (isInvisible(CppComponentInstance::getComponentName())) { + return false; + } + return true; + } + + std::vector getTouchTargetChildren() override { + auto children = CppComponentInstance::getChildren(); + return std::vector(children.begin(), children.end()); + } + + facebook::react::Transform getTransform() const override { return facebook::react::Transform::Identity(); } + + facebook::react::Point computeChildPoint(facebook::react::Point const &point, + TouchTarget::Shared const &child) const override { + return point; + } + + bool canHandleTouch() const override { + if (isInvisible(CppComponentInstance::getComponentName())) { + return false; + } + if (CppComponentInstance::m_props != nullptr) { + return pointerEvents_ == "auto" || pointerEvents_ == "box-only" || pointerEvents_ == "box-none"; + } + return true; + }; + + bool canChildrenHandleTouch() const override { + if (isInvisible(CppComponentInstance::getComponentName())) { + return false; + } + if (CppComponentInstance::m_props != nullptr) { + return pointerEvents_ == "auto" || pointerEvents_ == "box-none"; + } + return true; + }; + + bool isInvisible(const std::string &name) const { + if (name == "RNSVGLinearGradient") { + return true; + } + if (name == "RNSVGRadialGradient") { + return true; + } + if (name == "RNSVGDefs") { + return true; + } + if (name == "RNSVGClipPath") { + return true; + } + if (name == "RNSVGMask") { + return true; + } + if (name == "RNSVGUse") { + return true; + } + if (name == "RNSVGMarker") { + return true; + } + if (name == "RNSVGPattern") { + return true; + } + if (name == "RNSVGSymbol") { + return true; + } + return false; + } + +protected: + virtual void UpdateElementProps(typename CppComponentInstance::SharedConcreteProps const &props) = 0; + SvgArkUINode &getLocalRootArkUINode() override { return getParentSvgView()->getLocalRootArkUINode(); } + +private: + std::weak_ptr m_svgViewComponentInstance; + std::string pointerEvents_ = "auto"; +}; + +} // namespace svg +} // namespace rnoh \ No newline at end of file diff --git a/tester/harmony/svg/src/main/cpp/componentInstances/RNSVGCircleComponentInstance.cpp b/tester/harmony/svg/src/main/cpp/componentInstances/RNSVGCircleComponentInstance.cpp new file mode 100644 index 0000000000000000000000000000000000000000..06873a108a86bf046a0814026feb32513fa8ff3f --- /dev/null +++ b/tester/harmony/svg/src/main/cpp/componentInstances/RNSVGCircleComponentInstance.cpp @@ -0,0 +1,35 @@ +#include "RNSVGCircleComponentInstance.h" +#include "Props.h" +#include "SvgCircle.h" +#include +#include + +namespace rnoh { +namespace svg { + +RNSVGCircleComponentInstance::RNSVGCircleComponentInstance(Context context) + : RNSVGBaseComponentInstance(std::move(context)) { + SetSvgNode(std::make_shared()); +} + +void RNSVGCircleComponentInstance::UpdateElementProps(SharedConcreteProps const &props) { + DLOG(INFO) << "[RNSVGCircleComponentInstance] cx: " << props->cx; + DLOG(INFO) << "[RNSVGCircleComponentInstance] cy: " << props->cy; + DLOG(INFO) << "[RNSVGCircleComponentInstance] r: " << props->r; + DLOG(INFO) << "[RNSVGCircleComponentInstance] opacity: " << props->opacity; + DLOG(INFO) << "[RNSVGCircleComponentInstance] fill.payload: " << (uint32_t)*props->fill.payload; + DLOG(INFO) << "[RNSVGCircleComponentInstance] mask: " << props->mask; + DLOG(INFO) << "[SVG] propList size = " << props->propList.size(); + for (auto prop : props->propList) { + DLOG(INFO) << "[SVG] prop: " << prop; + } + + // set attribute to svgCircle. + auto svgCircle = std::dynamic_pointer_cast(GetSvgNode()); + svgCircle->UpdateCommonProps(props); + svgCircle->SetX(props->cx); + svgCircle->SetY(props->cy); + svgCircle->SetR(props->r); +} +} // namespace svg +} // namespace rnoh diff --git a/tester/harmony/svg/src/main/cpp/componentInstances/RNSVGCircleComponentInstance.h b/tester/harmony/svg/src/main/cpp/componentInstances/RNSVGCircleComponentInstance.h new file mode 100644 index 0000000000000000000000000000000000000000..2a17fd5a32f8f1ea4ad39f231ad14a95a1564894 --- /dev/null +++ b/tester/harmony/svg/src/main/cpp/componentInstances/RNSVGCircleComponentInstance.h @@ -0,0 +1,17 @@ +#pragma once + +#include "RNSVGBaseComponentInstance.h" +#include "SvgShadowNodes.h" + +namespace rnoh { +namespace svg { + +class RNSVGCircleComponentInstance : public RNSVGBaseComponentInstance { + +public: + RNSVGCircleComponentInstance(Context context); + void UpdateElementProps(SharedConcreteProps const &props) override; +}; + +} // namespace svg +} // namespace rnoh \ No newline at end of file diff --git a/tester/harmony/svg/src/main/cpp/componentInstances/RNSVGClipPathComponentInstance.cpp b/tester/harmony/svg/src/main/cpp/componentInstances/RNSVGClipPathComponentInstance.cpp new file mode 100644 index 0000000000000000000000000000000000000000..d0abce866102294cdd62f448e0bd15ad09ea62c9 --- /dev/null +++ b/tester/harmony/svg/src/main/cpp/componentInstances/RNSVGClipPathComponentInstance.cpp @@ -0,0 +1,19 @@ +#include "RNSVGClipPathComponentInstance.h" +#include "SvgClipPath.h" +#include + +namespace rnoh { +namespace svg { + +RNSVGClipPathComponentInstance::RNSVGClipPathComponentInstance(Context context) + : RNSVGBaseComponentInstance(std::move(context)) { + SetSvgNode(std::make_shared()); +} + +void RNSVGClipPathComponentInstance::UpdateElementProps(SharedConcreteProps const &props) { + auto svgClipPath = std::dynamic_pointer_cast(GetSvgNode()); + svgClipPath->UpdateCommonProps(props); +} + +} // namespace svg +} // namespace rnoh diff --git a/tester/harmony/svg/src/main/cpp/componentInstances/RNSVGClipPathComponentInstance.h b/tester/harmony/svg/src/main/cpp/componentInstances/RNSVGClipPathComponentInstance.h new file mode 100644 index 0000000000000000000000000000000000000000..0ba53460e0a1e4042bbfc57dbdd98b413aa1782f --- /dev/null +++ b/tester/harmony/svg/src/main/cpp/componentInstances/RNSVGClipPathComponentInstance.h @@ -0,0 +1,21 @@ +#pragma once + +#include "RNSVGBaseComponentInstance.h" +#include "SvgShadowNodes.h" + +namespace rnoh { +namespace svg { + +class RNSVGClipPathComponentInstance : public RNSVGBaseComponentInstance { +public: + RNSVGClipPathComponentInstance(Context context); + + void UpdateElementProps(SharedConcreteProps const &props) override; + + void onChildRemoved(ComponentInstance::Shared const &childComponentInstance) override { + OnChildRemoveCommon(std::dynamic_pointer_cast(childComponentInstance)); + } +}; + +} // namespace svg +} // namespace rnoh \ No newline at end of file diff --git a/tester/harmony/svg/src/main/cpp/componentInstances/RNSVGDefsComponentInstance.h b/tester/harmony/svg/src/main/cpp/componentInstances/RNSVGDefsComponentInstance.h new file mode 100644 index 0000000000000000000000000000000000000000..7b6016d9ebd318f1a5c1cb3821736e0ba6fb495a --- /dev/null +++ b/tester/harmony/svg/src/main/cpp/componentInstances/RNSVGDefsComponentInstance.h @@ -0,0 +1,28 @@ +#pragma once + +#include "RNSVGBaseComponentInstance.h" +#include "SvgShadowNodes.h" +#include "SvgDefs.h" + +namespace rnoh { +namespace svg { + +class RNSVGDefsComponentInstance : public RNSVGBaseComponentInstance { + +public: + RNSVGDefsComponentInstance(Context context) : RNSVGBaseComponentInstance(std::move(context)) { + SetSvgNode(std::make_shared()); + } + + void onChildRemoved(ComponentInstance::Shared const &childComponentInstance) override { + OnChildRemoveCommon(std::dynamic_pointer_cast(childComponentInstance)); + } + + void UpdateElementProps(SharedConcreteProps const &props) override { + auto svgDefs = std::dynamic_pointer_cast(GetSvgNode()); + svgDefs->UpdateHrefRenderProps(props); + } +}; + +} // namespace svg +} // namespace rnoh \ No newline at end of file diff --git a/tester/harmony/svg/src/main/cpp/componentInstances/RNSVGEllipseComponentInstance.cpp b/tester/harmony/svg/src/main/cpp/componentInstances/RNSVGEllipseComponentInstance.cpp new file mode 100644 index 0000000000000000000000000000000000000000..b7d18d10f9bd0e6ba8a4aa75a39cbb4989e06c11 --- /dev/null +++ b/tester/harmony/svg/src/main/cpp/componentInstances/RNSVGEllipseComponentInstance.cpp @@ -0,0 +1,26 @@ +#include "RNSVGEllipseComponentInstance.h" +#include "SvgEllipse.h" + +namespace rnoh { +namespace svg { + +RNSVGEllipseComponentInstance::RNSVGEllipseComponentInstance(Context context) + : RNSVGBaseComponentInstance(std::move(context)) { + SetSvgNode(std::make_shared()); +} + +void RNSVGEllipseComponentInstance::UpdateElementProps(SharedConcreteProps const &props) { + DLOG(INFO) << "[SvgEllipse] cx: " << props->cx; + DLOG(INFO) << "[SvgEllipse] cy: " << props->cy; + DLOG(INFO) << "[SvgEllipse] rx: " << props->rx; + DLOG(INFO) << "[SvgEllipse] ry: " << props->ry; + auto svgEllipse = std::dynamic_pointer_cast(GetSvgNode()); + svgEllipse->UpdateCommonProps(props); + svgEllipse->SetCX(props->cx); + svgEllipse->SetCY(props->cy); + svgEllipse->SetRX(props->rx); + svgEllipse->SetRY(props->ry); +} + +} // namespace svg +} // namespace rnoh diff --git a/tester/harmony/svg/src/main/cpp/componentInstances/RNSVGEllipseComponentInstance.h b/tester/harmony/svg/src/main/cpp/componentInstances/RNSVGEllipseComponentInstance.h new file mode 100644 index 0000000000000000000000000000000000000000..3fdd4193446df32d906573dfd528c69753033180 --- /dev/null +++ b/tester/harmony/svg/src/main/cpp/componentInstances/RNSVGEllipseComponentInstance.h @@ -0,0 +1,16 @@ +#pragma once + +#include "RNSVGBaseComponentInstance.h" + +namespace rnoh { +namespace svg { + +class RNSVGEllipseComponentInstance : public RNSVGBaseComponentInstance { +public: + RNSVGEllipseComponentInstance(Context context); + + void UpdateElementProps(SharedConcreteProps const &props) override; +}; + +} // namespace svg +} // namespace rnoh \ No newline at end of file diff --git a/tester/harmony/svg/src/main/cpp/componentInstances/RNSVGGroupComponentInstance.cpp b/tester/harmony/svg/src/main/cpp/componentInstances/RNSVGGroupComponentInstance.cpp new file mode 100644 index 0000000000000000000000000000000000000000..b196519cf3e9e729c1e4526e96b914c60cce5478 --- /dev/null +++ b/tester/harmony/svg/src/main/cpp/componentInstances/RNSVGGroupComponentInstance.cpp @@ -0,0 +1,20 @@ +#include "RNSVGGroupComponentInstance.h" +#include "SvgGroup.h" + +namespace rnoh { +namespace svg { + +RNSVGGroupComponentInstance::RNSVGGroupComponentInstance(Context context) + : RNSVGBaseComponentInstance(std::move(context)) { + SetSvgNode(std::make_shared()); +} + +void RNSVGGroupComponentInstance::UpdateElementProps(SharedConcreteProps const &props) { + DLOG(INFO) << "[RNSVGGroupComponentInstance] props->fill.payload: " << (uint32_t)*props->fill.payload; + + auto group = std::dynamic_pointer_cast(GetSvgNode()); + group->UpdateCommonProps(props); + group->UpdateFontProps(props); +} +} // namespace svg +} // namespace rnoh \ No newline at end of file diff --git a/tester/harmony/svg/src/main/cpp/componentInstances/RNSVGGroupComponentInstance.h b/tester/harmony/svg/src/main/cpp/componentInstances/RNSVGGroupComponentInstance.h new file mode 100644 index 0000000000000000000000000000000000000000..b2a30b024773534dc2a7d46bd605b152db2f1fc5 --- /dev/null +++ b/tester/harmony/svg/src/main/cpp/componentInstances/RNSVGGroupComponentInstance.h @@ -0,0 +1,21 @@ +#pragma once + +#include "RNSVGBaseComponentInstance.h" + +namespace rnoh { +namespace svg { +class RNSVGGroupComponentInstance : public RNSVGBaseComponentInstance { + + +public: + RNSVGGroupComponentInstance(Context context); + + void UpdateElementProps(SharedConcreteProps const &props) override; + + void onChildRemoved(ComponentInstance::Shared const &childComponentInstance) override { + OnChildRemoveCommon(std::dynamic_pointer_cast(childComponentInstance)); + } +}; + +} // namespace svg +} // namespace rnoh \ No newline at end of file diff --git a/tester/harmony/svg/src/main/cpp/componentInstances/RNSVGImageComponentInstance.cpp b/tester/harmony/svg/src/main/cpp/componentInstances/RNSVGImageComponentInstance.cpp new file mode 100644 index 0000000000000000000000000000000000000000..9320a2487e013fcdd881ebccf351d03ad65f2791 --- /dev/null +++ b/tester/harmony/svg/src/main/cpp/componentInstances/RNSVGImageComponentInstance.cpp @@ -0,0 +1,32 @@ +#include "RNSVGImageComponentInstance.h" +#include "SvgImage.h" + +namespace rnoh { +namespace svg { + +RNSVGImageComponentInstance::RNSVGImageComponentInstance(Context context) + : RNSVGBaseComponentInstance(std::move(context)) { + SetSvgNode(std::make_shared()); +} + +void RNSVGImageComponentInstance::UpdateElementProps(SharedConcreteProps const &props) { + auto svgImage = std::dynamic_pointer_cast(GetSvgNode()); + if (m_deps != nullptr && !m_deps->rnInstance.expired()) { + auto rnInstance = m_deps->rnInstance.lock(); + if (rnInstance != nullptr) { + auto nativeResourceManager = rnInstance->getNativeResourceManager(); + svgImage->setNativeResourceManager(nativeResourceManager); + } + } + svgImage->UpdateCommonProps(props); + svgImage->SetX(props->x); + svgImage->SetY(props->y); + svgImage->SetWidth(props->width); + svgImage->SetHeight(props->height); + svgImage->SetAlign(props->align); + svgImage->SetMeetOrSlice(props->meetOrSlice); + svgImage->SetImageSource(props->src); +} + +} // namespace svg +} // namespace rnoh diff --git a/tester/harmony/svg/src/main/cpp/componentInstances/RNSVGImageComponentInstance.h b/tester/harmony/svg/src/main/cpp/componentInstances/RNSVGImageComponentInstance.h new file mode 100644 index 0000000000000000000000000000000000000000..f64823b4a9f8cc4bae724ccfbc8db537ad83320b --- /dev/null +++ b/tester/harmony/svg/src/main/cpp/componentInstances/RNSVGImageComponentInstance.h @@ -0,0 +1,18 @@ +#pragma once + +#include "RNSVGBaseComponentInstance.h" +#include "svgImage/RNSVGImageShadowNode.h" + +namespace rnoh { +namespace svg { + +class RNSVGImageComponentInstance : public RNSVGBaseComponentInstance { + +public: + RNSVGImageComponentInstance(Context context); + + void UpdateElementProps(SharedConcreteProps const &props) override; +}; + +} // namespace svg +} // namespace rnoh \ No newline at end of file diff --git a/tester/harmony/svg/src/main/cpp/componentInstances/RNSVGLineComponentInstance.cpp b/tester/harmony/svg/src/main/cpp/componentInstances/RNSVGLineComponentInstance.cpp new file mode 100644 index 0000000000000000000000000000000000000000..a39442b1b1cab91ae4b8328b7e854ba46973c69d --- /dev/null +++ b/tester/harmony/svg/src/main/cpp/componentInstances/RNSVGLineComponentInstance.cpp @@ -0,0 +1,32 @@ +#include "RNSVGLineComponentInstance.h" +#include "SvgLine.h" + +namespace rnoh { +namespace svg { + +RNSVGLineComponentInstance::RNSVGLineComponentInstance(Context context) + : RNSVGBaseComponentInstance(std::move(context)) { + SetSvgNode(std::make_shared()); +} + +void RNSVGLineComponentInstance::UpdateElementProps(SharedConcreteProps const &props) { + DLOG(INFO) << "[RNSVGLineComponentInstance] Props->fill.payload: " + << Color((uint32_t)*props->fill.payload).ToString(); + DLOG(INFO) << "[RNSVGLineComponentInstance] Props->stroke.payload: " + << Color((uint32_t)*props->stroke.payload).ToString(); + DLOG(INFO) << "[RNSVGLineComponentInstance] props->strokeLinecap: " << props->strokeLinecap; + DLOG(INFO) << "[RNSVGLineComponentInstance] props->strokeLinejoin: " << props->strokeLinejoin; + DLOG(INFO) << "[SVG] propList size = " << props->propList.size(); + for (auto prop : props->propList) { + DLOG(INFO) << "[SVG] prop: " << prop; + } + auto svgLine = std::dynamic_pointer_cast(GetSvgNode()); + svgLine->UpdateCommonProps(props); + svgLine->SetX1(props->x1); + svgLine->SetY1(props->y1); + svgLine->SetX2(props->x2); + svgLine->SetY2(props->y2); +} + +} // namespace svg +} // namespace rnoh diff --git a/tester/harmony/svg/src/main/cpp/componentInstances/RNSVGLineComponentInstance.h b/tester/harmony/svg/src/main/cpp/componentInstances/RNSVGLineComponentInstance.h new file mode 100644 index 0000000000000000000000000000000000000000..48ff4d83dba959299bf34b7054303c40cd8b0736 --- /dev/null +++ b/tester/harmony/svg/src/main/cpp/componentInstances/RNSVGLineComponentInstance.h @@ -0,0 +1,17 @@ +#pragma once + +#include "RNSVGBaseComponentInstance.h" + +namespace rnoh { +namespace svg { + +class RNSVGLineComponentInstance : public RNSVGBaseComponentInstance { + +public: + RNSVGLineComponentInstance(Context context); + + void UpdateElementProps(SharedConcreteProps const &props) override; +}; + +} // namespace svg +} // namespace rnoh \ No newline at end of file diff --git a/tester/harmony/svg/src/main/cpp/componentInstances/RNSVGLinearGradientComponentInstance.cpp b/tester/harmony/svg/src/main/cpp/componentInstances/RNSVGLinearGradientComponentInstance.cpp new file mode 100644 index 0000000000000000000000000000000000000000..d508b98d2305879dffe72596315fa11082691f4e --- /dev/null +++ b/tester/harmony/svg/src/main/cpp/componentInstances/RNSVGLinearGradientComponentInstance.cpp @@ -0,0 +1,25 @@ +#include "RNSVGLinearGradientComponentInstance.h" +#include "SvgGradient.h" + +namespace rnoh { +namespace svg { + +RNSVGLinearGradientComponentInstance::RNSVGLinearGradientComponentInstance(Context context) + : RNSVGBaseComponentInstance(std::move(context)) { + SetSvgNode(std::make_shared(GradientType::LINEAR)); +} + +void RNSVGLinearGradientComponentInstance::UpdateElementProps(SharedConcreteProps const &props) { + auto svgGradient = std::dynamic_pointer_cast(GetSvgNode()); + svgGradient->UpdateHrefRenderProps(props); + svgGradient->SetAttrGradientUnits(props->gradientUnits); // first set attr gradientUnits + svgGradient->SetAttrX1(props->x1); + svgGradient->SetAttrY1(props->y1); + svgGradient->SetAttrX2(props->x2); + svgGradient->SetAttrY2(props->y2); + svgGradient->SetAttrGradient(props->gradient); + svgGradient->SetAttrGradientTransforms(props->gradientTransform); +} + +} // namespace svg +} // namespace rnoh diff --git a/tester/harmony/svg/src/main/cpp/componentInstances/RNSVGLinearGradientComponentInstance.h b/tester/harmony/svg/src/main/cpp/componentInstances/RNSVGLinearGradientComponentInstance.h new file mode 100644 index 0000000000000000000000000000000000000000..e82f9aaa4f2400be3fce3e843e25ff890b72005d --- /dev/null +++ b/tester/harmony/svg/src/main/cpp/componentInstances/RNSVGLinearGradientComponentInstance.h @@ -0,0 +1,21 @@ +#pragma once + +#include "RNSVGBaseComponentInstance.h" + +namespace rnoh { +namespace svg { +class RNSVGLinearGradientComponentInstance + : public RNSVGBaseComponentInstance { + +public: + RNSVGLinearGradientComponentInstance(Context context); + + void UpdateElementProps(SharedConcreteProps const &props) override; + + void onChildRemoved(ComponentInstance::Shared const &childComponentInstance) override { + OnChildRemoveCommon(std::dynamic_pointer_cast(childComponentInstance)); + } +}; + +} // namespace svg +} // namespace rnoh \ No newline at end of file diff --git a/tester/harmony/svg/src/main/cpp/componentInstances/RNSVGMarkerComponentInstance.cpp b/tester/harmony/svg/src/main/cpp/componentInstances/RNSVGMarkerComponentInstance.cpp new file mode 100644 index 0000000000000000000000000000000000000000..a9d61192dd2ba619739cb3eabccb477504739e61 --- /dev/null +++ b/tester/harmony/svg/src/main/cpp/componentInstances/RNSVGMarkerComponentInstance.cpp @@ -0,0 +1,43 @@ +#include "RNSVGMarkerComponentInstance.h" +#include "SvgMarker.h" + + +namespace rnoh { +namespace svg { + +RNSVGMarkerComponentInstance::RNSVGMarkerComponentInstance(Context context) + : RNSVGBaseComponentInstance(std::move(context)) { + SetSvgNode(std::make_shared()); +} + +void RNSVGMarkerComponentInstance::UpdateElementProps(SharedConcreteProps const &props) { + + + DLOG(INFO) << "[RNSVGMarkerComponentInstance] onPropsChanged markerWidth=" << props->markerWidth + << " markerHeight=" << props->markerHeight; + DLOG(INFO) << "[RNSVGMarkerComponentInstance] onPropsChanged refX=" << props->refX << " refY=" << props->refY; + DLOG(INFO) << "[RNSVGMarkerComponentInstance] onPropsChanged markerUnits=" << props->markerUnits + << " orient=" << props->orient; + DLOG(INFO) << "[RNSVGMarkerComponentInstance] onPropsChanged minX=" << props->minX << " minY=" << props->minY; + DLOG(INFO) << "[RNSVGMarkerComponentInstance] onPropsChanged vbWidth=" << props->vbWidth + << " vbHeight=" << props->vbHeight; + DLOG(INFO) << "[RNSVGMarkerComponentInstance] onPropsChanged align=" << props->align + << " meetOrSlice=" << props->meetOrSlice; + auto svgMarker = std::dynamic_pointer_cast(GetSvgNode()); + svgMarker->UpdateCommonProps(props); + svgMarker->setRefX(props->refX); + svgMarker->setRefY(props->refY); + svgMarker->setMarkerWidth(props->markerWidth); + svgMarker->setMarkerHeight(props->markerHeight); + svgMarker->setMarkerUnits(props->markerUnits); + svgMarker->setOrient(props->orient); + svgMarker->setMinX(props->minX); + svgMarker->setMinY(props->minY); + svgMarker->setVbWidth(props->vbWidth); + svgMarker->setVbHeight(props->vbHeight); + svgMarker->setAlign(props->align); + svgMarker->setMeetOrSlice(props->meetOrSlice); +} + +} // namespace svg +} // namespace rnoh diff --git a/tester/harmony/svg/src/main/cpp/componentInstances/RNSVGMarkerComponentInstance.h b/tester/harmony/svg/src/main/cpp/componentInstances/RNSVGMarkerComponentInstance.h new file mode 100644 index 0000000000000000000000000000000000000000..60ca6e7981a77b62eb41a284a27aaa8d9fe0691c --- /dev/null +++ b/tester/harmony/svg/src/main/cpp/componentInstances/RNSVGMarkerComponentInstance.h @@ -0,0 +1,16 @@ +#pragma once + +#include "RNSVGBaseComponentInstance.h" + +namespace rnoh { +namespace svg { + +class RNSVGMarkerComponentInstance : public RNSVGBaseComponentInstance { + +public: + RNSVGMarkerComponentInstance(Context context); + void UpdateElementProps(SharedConcreteProps const &props) override; +}; + +} // namespace svg +} // namespace rnoh \ No newline at end of file diff --git a/tester/harmony/svg/src/main/cpp/componentInstances/RNSVGMaskComponentInstance.cpp b/tester/harmony/svg/src/main/cpp/componentInstances/RNSVGMaskComponentInstance.cpp new file mode 100644 index 0000000000000000000000000000000000000000..fa2782bc1f574f20330647b3a9834c2461231226 --- /dev/null +++ b/tester/harmony/svg/src/main/cpp/componentInstances/RNSVGMaskComponentInstance.cpp @@ -0,0 +1,32 @@ +#include "RNSVGMaskComponentInstance.h" +#include "SvgMask.h" + +namespace rnoh { +namespace svg { + +RNSVGMaskComponentInstance::RNSVGMaskComponentInstance(Context context) + : RNSVGBaseComponentInstance(std::move(context)) { + DLOG(INFO) << "[RNSVGMaskComponentInstance] RNSVGMaskComponentInstance: "; + SetSvgNode(std::make_shared()); +} + +void RNSVGMaskComponentInstance::UpdateElementProps(SharedConcreteProps const &props) { + DLOG(INFO) << "[RNSVGMaskComponentInstance] onPropsChanged x: " << props->x; + DLOG(INFO) << "[RNSVGMaskComponentInstance] onPropsChanged y: " << props->y; + DLOG(INFO) << "[RNSVGMaskComponentInstance] onPropsChanged height: " << props->height; + DLOG(INFO) << "[RNSVGMaskComponentInstance] onPropsChanged width: " << props->width; + DLOG(INFO) << "[RNSVGMaskComponentInstance] onPropsChanged maskUnits: " << props->maskUnits; + DLOG(INFO) << "[RNSVGMaskComponentInstance] onPropsChanged maskContentUnits: " << props->maskContentUnits; + auto svgMask = std::dynamic_pointer_cast(GetSvgNode()); + svgMask->UpdateCommonProps(props); + // set attribute to svgMask. + svgMask->setMaskUnits(props->maskUnits); + svgMask->setMaskContentUnits(props->maskContentUnits); + svgMask->setMaskX(props->x); + svgMask->setMaskY(props->y); + svgMask->setMaskHeight(props->height); + svgMask->setMaskWidth(props->width); +} + +} // namespace svg +} // namespace rnoh diff --git a/tester/harmony/svg/src/main/cpp/componentInstances/RNSVGMaskComponentInstance.h b/tester/harmony/svg/src/main/cpp/componentInstances/RNSVGMaskComponentInstance.h new file mode 100644 index 0000000000000000000000000000000000000000..0752d0cd7923389f077db359c896ac1dbb8e750a --- /dev/null +++ b/tester/harmony/svg/src/main/cpp/componentInstances/RNSVGMaskComponentInstance.h @@ -0,0 +1,18 @@ +#pragma once +#include "RNSVGBaseComponentInstance.h" + +namespace rnoh { +namespace svg { + +class RNSVGMaskComponentInstance : public RNSVGBaseComponentInstance { + +public: + RNSVGMaskComponentInstance(Context context); + void UpdateElementProps(SharedConcreteProps const &props) override; + void onChildRemoved(ComponentInstance::Shared const &childComponentInstance) override { + OnChildRemoveCommon(std::dynamic_pointer_cast(childComponentInstance)); + } +}; + +} // namespace svg +} // namespace rnoh \ No newline at end of file diff --git a/tester/harmony/svg/src/main/cpp/componentInstances/RNSVGPathComponentInstance.cpp b/tester/harmony/svg/src/main/cpp/componentInstances/RNSVGPathComponentInstance.cpp new file mode 100644 index 0000000000000000000000000000000000000000..ee0c88df0d4aa0fe1840367e32ac12023f405ca1 --- /dev/null +++ b/tester/harmony/svg/src/main/cpp/componentInstances/RNSVGPathComponentInstance.cpp @@ -0,0 +1,22 @@ +#include "RNSVGPathComponentInstance.h" +#include "SvgPath.h" + +namespace rnoh { +namespace svg { + +RNSVGPathComponentInstance::RNSVGPathComponentInstance(Context context) + : RNSVGBaseComponentInstance(std::move(context)) { + SetSvgNode(std::make_shared()); +} + +void RNSVGPathComponentInstance::UpdateElementProps(SharedConcreteProps const &props) { + DLOG(INFO) << "[RNSVGPathComponentInstance] d: " << props->d; + auto svgPath = std::dynamic_pointer_cast(GetSvgNode()); + svgPath->UpdateCommonProps(props); + if (!m_props || props->d != m_props->d) { + svgPath->setD(props->d); + } +} + +} // namespace svg +} // namespace rnoh diff --git a/tester/harmony/svg/src/main/cpp/componentInstances/RNSVGPathComponentInstance.h b/tester/harmony/svg/src/main/cpp/componentInstances/RNSVGPathComponentInstance.h new file mode 100644 index 0000000000000000000000000000000000000000..5c7d01fbd3044e1e1fdd09971068450883ed1706 --- /dev/null +++ b/tester/harmony/svg/src/main/cpp/componentInstances/RNSVGPathComponentInstance.h @@ -0,0 +1,16 @@ +#pragma once +#include "RNSVGBaseComponentInstance.h" + +namespace rnoh { +namespace svg { + +class RNSVGPathComponentInstance : public RNSVGBaseComponentInstance { + +public: + RNSVGPathComponentInstance(Context context); + + void UpdateElementProps(SharedConcreteProps const &props) override; +}; + +} // namespace svg +} // namespace rnoh \ No newline at end of file diff --git a/tester/harmony/svg/src/main/cpp/componentInstances/RNSVGPatternComponentInstance.cpp b/tester/harmony/svg/src/main/cpp/componentInstances/RNSVGPatternComponentInstance.cpp new file mode 100644 index 0000000000000000000000000000000000000000..5dd183fc1fc8aed67b2e6fdb53d685644d42cbba --- /dev/null +++ b/tester/harmony/svg/src/main/cpp/componentInstances/RNSVGPatternComponentInstance.cpp @@ -0,0 +1,46 @@ +#include "RNSVGPatternComponentInstance.h" +#include "SvgPattern.h" + +namespace rnoh { +namespace svg { + +RNSVGPatternComponentInstance::RNSVGPatternComponentInstance(Context context) + : RNSVGBaseComponentInstance(std::move(context)) { + DLOG(INFO) << "[RNSVGPatternComponentInstance] init"; + SetSvgNode(std::make_shared()); +} + +void RNSVGPatternComponentInstance::UpdateElementProps(SharedConcreteProps const &props) { + + DLOG(INFO) << "[RNSVGPatternComponentInstance] x: " << props->x; + DLOG(INFO) << "[RNSVGPatternComponentInstance] y: " << props->y; + DLOG(INFO) << "[RNSVGPatternComponentInstance] width: " << props->width; + DLOG(INFO) << "[RNSVGPatternComponentInstance] height: " << props->height; + DLOG(INFO) << "[RNSVGPatternComponentInstance] patternUnits: " << props->patternUnits; + DLOG(INFO) << "[RNSVGPatternComponentInstance] patternContentUnits: " << props->patternContentUnits; + DLOG(INFO) << "[RNSVGPatternComponentInstance] minX: " << props->minX; + DLOG(INFO) << "[RNSVGPatternComponentInstance] minY: " << props->minY; + DLOG(INFO) << "[RNSVGPatternComponentInstance] vbWidth: " << props->vbWidth; + DLOG(INFO) << "[RNSVGPatternComponentInstance] vbHeight: " << props->vbHeight; + // set attribute to svgPattern + auto svgPattern = std::dynamic_pointer_cast(GetSvgNode()); + svgPattern->UpdateCommonProps(props); + svgPattern->setPatternX(StringUtils::FromString(props->x)); + svgPattern->setPatternY(StringUtils::FromString(props->y)); + svgPattern->setWidth(StringUtils::FromString(props->width)); + svgPattern->setHeight(StringUtils::FromString(props->height)); + svgPattern->setPatternUnits(props->patternUnits); + svgPattern->setPatternContentUnits(props->patternContentUnits); + svgPattern->setViewBox(Rect(props->minX, props->minY, props->vbWidth, props->vbHeight)); + svgPattern->setmMinX(props->minX); + svgPattern->setmMinY(props->minY); + svgPattern->setmVbWidth(props->vbWidth); + svgPattern->setmVbHeight(props->vbHeight); + svgPattern->setmAlign(props->align); + svgPattern->setmMeetOrSlice(props->meetOrSlice); + svgPattern->setPatternTransforms(props->patternTransform); +} + + +} // namespace svg +} // namespace rnoh diff --git a/tester/harmony/svg/src/main/cpp/componentInstances/RNSVGPatternComponentInstance.h b/tester/harmony/svg/src/main/cpp/componentInstances/RNSVGPatternComponentInstance.h new file mode 100644 index 0000000000000000000000000000000000000000..8360ff81e4c052cf3d8089039a9ecaf4fca69d1f --- /dev/null +++ b/tester/harmony/svg/src/main/cpp/componentInstances/RNSVGPatternComponentInstance.h @@ -0,0 +1,16 @@ +#pragma once + +#include "RNSVGBaseComponentInstance.h" + +namespace rnoh { +namespace svg { +class RNSVGPatternComponentInstance : public RNSVGBaseComponentInstance { + +public: + RNSVGPatternComponentInstance(Context context); + + void UpdateElementProps(SharedConcreteProps const &props) override; +}; + +} // namespace svg +} // namespace rnoh \ No newline at end of file diff --git a/tester/harmony/svg/src/main/cpp/componentInstances/RNSVGRadialGradientComponentInstance.cpp b/tester/harmony/svg/src/main/cpp/componentInstances/RNSVGRadialGradientComponentInstance.cpp new file mode 100644 index 0000000000000000000000000000000000000000..4ea5bc65353ee08ea8d30f67852cb0919bc0f4b0 --- /dev/null +++ b/tester/harmony/svg/src/main/cpp/componentInstances/RNSVGRadialGradientComponentInstance.cpp @@ -0,0 +1,28 @@ +#include "RNSVGRadialGradientComponentInstance.h" +#include "SvgGradient.h" + +namespace rnoh { +namespace svg { + +RNSVGRadialGradientComponentInstance::RNSVGRadialGradientComponentInstance(Context context) + : RNSVGBaseComponentInstance(std::move(context)) { + SetSvgNode(std::make_shared(GradientType::RADIAL)); +} + +void RNSVGRadialGradientComponentInstance::UpdateElementProps(SharedConcreteProps const &props) { + + auto svgGradient = std::dynamic_pointer_cast(GetSvgNode()); + svgGradient->UpdateHrefRenderProps(props); + svgGradient->SetAttrGradientUnits(props->gradientUnits); // first set attr gradientUnits + svgGradient->SetAttrFx(props->fx); + svgGradient->SetAttrFy(props->fy); + svgGradient->SetAttrCx(props->cx); + svgGradient->SetAttrCy(props->cy); + svgGradient->SetAttrRx(props->rx); + svgGradient->SetAttrRy(props->ry); + svgGradient->SetAttrGradient(props->gradient); + svgGradient->SetAttrGradientTransforms(props->gradientTransform); +} + +} // namespace svg +} // namespace rnoh diff --git a/tester/harmony/svg/src/main/cpp/componentInstances/RNSVGRadialGradientComponentInstance.h b/tester/harmony/svg/src/main/cpp/componentInstances/RNSVGRadialGradientComponentInstance.h new file mode 100644 index 0000000000000000000000000000000000000000..c05be26958f626da737aff2a9d8c4d6c6df8767e --- /dev/null +++ b/tester/harmony/svg/src/main/cpp/componentInstances/RNSVGRadialGradientComponentInstance.h @@ -0,0 +1,16 @@ +#pragma once +#include "RNSVGBaseComponentInstance.h" + +namespace rnoh { +namespace svg { +class RNSVGRadialGradientComponentInstance + : public RNSVGBaseComponentInstance { + +public: + RNSVGRadialGradientComponentInstance(Context context); + + void UpdateElementProps(SharedConcreteProps const &props) override; +}; + +} // namespace svg +} // namespace rnoh \ No newline at end of file diff --git a/tester/harmony/svg/src/main/cpp/componentInstances/RNSVGRectComponentInstance.cpp b/tester/harmony/svg/src/main/cpp/componentInstances/RNSVGRectComponentInstance.cpp new file mode 100644 index 0000000000000000000000000000000000000000..d0dff8d322a8dbe9f6ce8921b40cd0d67c8ce8ee --- /dev/null +++ b/tester/harmony/svg/src/main/cpp/componentInstances/RNSVGRectComponentInstance.cpp @@ -0,0 +1,39 @@ +#include "RNSVGRectComponentInstance.h" +#include "SvgRect.h" + +namespace rnoh { +namespace svg { + +RNSVGRectComponentInstance::RNSVGRectComponentInstance(Context context) + : RNSVGBaseComponentInstance(std::move(context)) { + SetSvgNode(std::make_shared()); +} + +void RNSVGRectComponentInstance::UpdateElementProps(SharedConcreteProps const &props) { + DLOG(INFO) << "[RNSVGRectComponentInstance] Props->fill.payload: " << (uint32_t)*props->fill.payload; + DLOG(INFO) << "[RNSVGRectComponentInstance] Props->stroke.payload: " << (uint32_t)*props->stroke.payload; + DLOG(INFO) << "[RNSVGRectComponentInstance] Props->stroke.payload meaningful: " + << facebook::react::isColorMeaningful(props->stroke.payload); + DLOG(INFO) << "[RNSVGRectComponentInstance] Props->stroke.type: " << props->stroke.type; + DLOG(INFO) << "[RNSVGRectComponentInstance] Props->stroke.brushRef: " << props->stroke.brushRef; + DLOG(INFO) << "[RNSVGRectComponentInstance] Props->strokeWidth: " << props->strokeWidth; + DLOG(INFO) << "[RNSVGRectComponentInstance] Props->propList size: " << props->propList.size(); + for (auto &prop : props->propList) { + DLOG(INFO) << "[RNSVGRectComponentInstance] Props->propList: " << prop; + } + auto svgRect = std::dynamic_pointer_cast(GetSvgNode()); + svgRect->UpdateCommonProps(props); + svgRect->SetX(props->x); + svgRect->SetY(props->y); + svgRect->SetWidth(props->width); + svgRect->SetHeight(props->height); + if (props->rx.size() != 0) { + svgRect->SetRX(props->rx); + } + if (props->ry.size() != 0) { + svgRect->SetRY(props->ry); + } +} + +} // namespace svg +} // namespace rnoh diff --git a/tester/harmony/svg/src/main/cpp/componentInstances/RNSVGRectComponentInstance.h b/tester/harmony/svg/src/main/cpp/componentInstances/RNSVGRectComponentInstance.h new file mode 100644 index 0000000000000000000000000000000000000000..d709e0e2268cf81936454ef3230f482182268361 --- /dev/null +++ b/tester/harmony/svg/src/main/cpp/componentInstances/RNSVGRectComponentInstance.h @@ -0,0 +1,17 @@ +#pragma once + +#include "RNSVGBaseComponentInstance.h" + +namespace rnoh { +namespace svg { + +class RNSVGRectComponentInstance : public RNSVGBaseComponentInstance { + +public: + RNSVGRectComponentInstance(Context context); + + void UpdateElementProps(SharedConcreteProps const &props) override; +}; + +} // namespace svg +} // namespace rnoh \ No newline at end of file diff --git a/tester/harmony/svg/src/main/cpp/componentInstances/RNSVGSvgViewComponentInstance.cpp b/tester/harmony/svg/src/main/cpp/componentInstances/RNSVGSvgViewComponentInstance.cpp new file mode 100644 index 0000000000000000000000000000000000000000..88474c3db15f7add558f07bee153266bdfc1a628 --- /dev/null +++ b/tester/harmony/svg/src/main/cpp/componentInstances/RNSVGSvgViewComponentInstance.cpp @@ -0,0 +1,61 @@ +#include "RNSVGSvgViewComponentInstance.h" +#include "SvgSvg.h" + +namespace rnoh { +namespace svg { + +RNSVGSvgViewComponentInstance::RNSVGSvgViewComponentInstance(Context context) + : CppComponentInstance(std::move(context)) { + SetSvgNode(std::make_shared()); + getLocalRootArkUINode().SetSvgNode(GetSvgNode()); + GetSvgNode()->SetContext(std::make_shared()); + SvgViewManager::getInstance().setSvgView(CppComponentInstance::getTag(), dynamic_pointer_cast(GetSvgNode())); +} + +RNSVGSvgViewComponentInstance::~RNSVGSvgViewComponentInstance() { + SvgViewManager::getInstance().onDropView(CppComponentInstance::getTag()); +} + +void RNSVGSvgViewComponentInstance::onPropsChanged(SharedConcreteProps const &props) { + CppComponentInstance::onPropsChanged(props); + DLOG(INFO) << "[SVG] props->width: " << m_layoutMetrics.frame.size.width; + DLOG(INFO) << "[SVG] props->height: " << m_layoutMetrics.frame.size.height; + DLOG(INFO) << "[SVG] props->bbHeight: " << props->bbHeight; + DLOG(INFO) << "[SVG] props->bbWidth: " << props->bbWidth; + DLOG(INFO) << "[SVG] props->bbHeight: " << props->bbHeight; + DLOG(INFO) << "[SVG] props->minX: " << props->minX; + DLOG(INFO) << "[SVG] props->minY: " << props->minY; + DLOG(INFO) << "[SVG] props->vbWidth: " << props->vbWidth; + DLOG(INFO) << "[SVG] props->vbHeight: " << props->vbHeight; + DLOG(INFO) << "[SVG] props->align: " << props->align; + DLOG(INFO) << "[SVG] props->meetOrSlice: " << props->meetOrSlice; + DLOG(INFO) << "[SVG] props->testId: " << props->testId; + DLOG(INFO) << "[SVG] props->pointScaleFactor: " << m_layoutMetrics.pointScaleFactor; + + auto svg = dynamic_pointer_cast(GetSvgNode()); + svg->SetScale(m_layoutMetrics.pointScaleFactor); + auto tintColor = getColorFromDynamic(props->rawProps); + if (tintColor.has_value()) { + svg->GetContext()->SetSvgColor(Color::FromString(tintColor.value())); + } + svg->SetVbX(props->minX); + svg->SetVbY(props->minY); + svg->SetVbWidth(props->vbWidth); + svg->SetVbHeight(props->vbHeight); + svg->SetX(0); + svg->SetY(0); + svg->SetWidth(props->bbWidth); + svg->SetHeight(props->bbHeight); + svg->SetAlign(props->align); + svg->SetMeetOrSlice(props->meetOrSlice); +} + +SvgArkUINode &RNSVGSvgViewComponentInstance::getLocalRootArkUINode() { return m_svgArkUINode; } + +std::optional RNSVGSvgViewComponentInstance::getColorFromDynamic(folly::dynamic value) { + auto rawPropsColor = (value.count("color") > 0) ? std::optional(value["color"].asString()) : std::nullopt; + return rawPropsColor; +} + +} // namespace svg +} // namespace rnoh diff --git a/tester/harmony/svg/src/main/cpp/componentInstances/RNSVGSvgViewComponentInstance.h b/tester/harmony/svg/src/main/cpp/componentInstances/RNSVGSvgViewComponentInstance.h new file mode 100644 index 0000000000000000000000000000000000000000..a5f8712e848181e68e6e719c65e2d35b8ad2ab0a --- /dev/null +++ b/tester/harmony/svg/src/main/cpp/componentInstances/RNSVGSvgViewComponentInstance.h @@ -0,0 +1,60 @@ +#pragma once + +#include "RNOH/CppComponentInstance.h" +#include +#include "SvgArkUINode.h" +#include "SvgShadowNodes.h" +#include "SvgViewManager.h" + +namespace rnoh { +namespace svg { + +class RNSVGSvgViewComponentInstance : public CppComponentInstance, + public SvgHost { +private: + SvgArkUINode m_svgArkUINode; + +public: + RNSVGSvgViewComponentInstance(Context context); + ~RNSVGSvgViewComponentInstance(); + + // get SvgNode from childComponentInstance and set it to root_ + void onChildInserted(ComponentInstance::Shared const &childComponentInstance, std::size_t index) override { + OnChildInsertCommon(std::dynamic_pointer_cast(childComponentInstance)); + getLocalRootArkUINode().markDirty(); + } + + // TODO get SvgNode and delete it from svg tree + void onChildRemoved(ComponentInstance::Shared const &childComponentInstance) override { + OnChildRemoveCommon(std::dynamic_pointer_cast(childComponentInstance)); + getLocalRootArkUINode().markDirty(); + } + + SvgArkUINode &getLocalRootArkUINode() override; + + void onPropsChanged(SharedConcreteProps const &props) override; + + // since we can't get color correctly from props + std::optional getColorFromDynamic(folly::dynamic value); + + bool canHandleTouch() const override { + if (m_props != nullptr) { + auto props = std::dynamic_pointer_cast(m_props); + return props->pointerEvents == "auto" || props->pointerEvents == "box-only" || + props->pointerEvents.size() == 0; + } + return true; + }; + + bool canChildrenHandleTouch() const override { + if (m_props != nullptr) { + auto props = std::dynamic_pointer_cast(m_props); + return props->pointerEvents == "auto" || props->pointerEvents == "box-none" || + props->pointerEvents.size() == 0; + } + return true; + }; +}; + +} // namespace svg +} // namespace rnoh \ No newline at end of file diff --git a/tester/harmony/svg/src/main/cpp/componentInstances/RNSVGSymbolComponentInstance.cpp b/tester/harmony/svg/src/main/cpp/componentInstances/RNSVGSymbolComponentInstance.cpp new file mode 100644 index 0000000000000000000000000000000000000000..d447ce4ef2e4bb4e9247ecaecf68a6cd31c50ba2 --- /dev/null +++ b/tester/harmony/svg/src/main/cpp/componentInstances/RNSVGSymbolComponentInstance.cpp @@ -0,0 +1,34 @@ +#include "RNSVGSymbolComponentInstance.h" +#include "SvgSymbol.h" + +namespace rnoh { +namespace svg { + +RNSVGSymbolComponentInstance::RNSVGSymbolComponentInstance(Context context) + : RNSVGBaseComponentInstance(std::move(context)) { + DLOG(INFO) << "[RNSVGSymbolComponentInstance] init"; + SetSvgNode(std::make_shared()); +} + +void RNSVGSymbolComponentInstance::UpdateElementProps(SharedConcreteProps const &props) { + auto svgSymbol = std::dynamic_pointer_cast(GetSvgNode()); + svgSymbol->UpdateCommonProps(props); + // set attribute to svgSymbol. + svgSymbol->mMinX = props->minX; + svgSymbol->mMinY = props->minY; + svgSymbol->mVbWidth = props->vbWidth; + svgSymbol->mVbHeight = props->vbHeight; + svgSymbol->mMeetOrSlice = props->meetOrSlice; + svgSymbol->mAlign = props->align; + + DLOG(INFO) << "[SvgSymbol RNSVGSymbolComponentInstance] minX: " << props->minX; + DLOG(INFO) << "[SvgSymbol RNSVGSymbolComponentInstance] minY: " << props->minY; + DLOG(INFO) << "[SvgSymbol RNSVGSymbolComponentInstance] vbWidth: " << props->vbWidth; + DLOG(INFO) << "[SvgSymbol RNSVGSymbolComponentInstance] vbHeight: " << props->vbHeight; + DLOG(INFO) << "[SvgSymbol RNSVGSymbolComponentInstance] mMeetOrSlice: " << props->meetOrSlice; + DLOG(INFO) << "[SvgSymbol RNSVGSymbolComponentInstance] mAlign: " << props->align; + DLOG(INFO) << "[SvgSymbol RNSVGSymbolComponentInstance] opacity: " << props->opacity; +} + +} // namespace svg +} // namespace rnoh diff --git a/tester/harmony/svg/src/main/cpp/componentInstances/RNSVGSymbolComponentInstance.h b/tester/harmony/svg/src/main/cpp/componentInstances/RNSVGSymbolComponentInstance.h new file mode 100644 index 0000000000000000000000000000000000000000..9f33fa75ba9c070f27d4cb6ae65e6e29b109da34 --- /dev/null +++ b/tester/harmony/svg/src/main/cpp/componentInstances/RNSVGSymbolComponentInstance.h @@ -0,0 +1,16 @@ +#pragma once + +#include "RNSVGBaseComponentInstance.h" + +namespace rnoh { +namespace svg { +class RNSVGSymbolComponentInstance : public RNSVGBaseComponentInstance { + +public: + RNSVGSymbolComponentInstance(Context context); + + void UpdateElementProps(SharedConcreteProps const &props) override; +}; + +} // namespace svg +} // namespace rnoh \ No newline at end of file diff --git a/tester/harmony/svg/src/main/cpp/componentInstances/RNSVGTSpanComponentInstance.cpp b/tester/harmony/svg/src/main/cpp/componentInstances/RNSVGTSpanComponentInstance.cpp new file mode 100644 index 0000000000000000000000000000000000000000..f0982392aa4efa3537d550c7603a2a0d9439818b --- /dev/null +++ b/tester/harmony/svg/src/main/cpp/componentInstances/RNSVGTSpanComponentInstance.cpp @@ -0,0 +1,20 @@ +#include "RNSVGTSpanComponentInstance.h" +#include "SvgTSpan.h" + +namespace rnoh { +namespace svg { + +RNSVGTSpanComponentInstance::RNSVGTSpanComponentInstance(Context context) + : RNSVGBaseComponentInstance(std::move(context)) { + SetSvgNode(m_svgTSpan); +} + +void RNSVGTSpanComponentInstance::UpdateElementProps(SharedConcreteProps const &props) { + m_svgTSpan->UpdateCommonProps(props); + m_svgTSpan->content_ = props->content; + m_svgTSpan->UpdateFontProps(props); + m_svgTSpan->UpdateTextProps(props); +} + +} // namespace svg +} // namespace rnoh diff --git a/tester/harmony/svg/src/main/cpp/componentInstances/RNSVGTSpanComponentInstance.h b/tester/harmony/svg/src/main/cpp/componentInstances/RNSVGTSpanComponentInstance.h new file mode 100644 index 0000000000000000000000000000000000000000..4397eb63c66df366c13efda25952e95651661137 --- /dev/null +++ b/tester/harmony/svg/src/main/cpp/componentInstances/RNSVGTSpanComponentInstance.h @@ -0,0 +1,20 @@ +#pragma once + +#include "RNSVGBaseComponentInstance.h" +#include "SvgTSpan.h" + +namespace rnoh { +namespace svg { + +class RNSVGTSpanComponentInstance : public RNSVGBaseComponentInstance { + + std::shared_ptr m_svgTSpan = std::make_shared(); + +public: + RNSVGTSpanComponentInstance(Context context); + + void UpdateElementProps(SharedConcreteProps const &props) override; +}; + +} // namespace svg +} // namespace rnoh \ No newline at end of file diff --git a/tester/harmony/svg/src/main/cpp/componentInstances/RNSVGTextComponentInstance.cpp b/tester/harmony/svg/src/main/cpp/componentInstances/RNSVGTextComponentInstance.cpp new file mode 100644 index 0000000000000000000000000000000000000000..65f05de1696efdacce4a5fa8fdd6f83f043ae665 --- /dev/null +++ b/tester/harmony/svg/src/main/cpp/componentInstances/RNSVGTextComponentInstance.cpp @@ -0,0 +1,17 @@ +#include "RNSVGTextComponentInstance.h" + +namespace rnoh { +namespace svg { + +RNSVGTextComponentInstance::RNSVGTextComponentInstance(Context context) : RNSVGBaseComponentInstance(std::move(context)) { + SetSvgNode(m_svgText); +} + +void RNSVGTextComponentInstance::UpdateElementProps(SharedConcreteProps const &props) { + m_svgText->UpdateCommonProps(props); + m_svgText->UpdateFontProps(props); + m_svgText->UpdateTextProps(props); +} + +} // namespace svg +} // namespace rnoh diff --git a/tester/harmony/svg/src/main/cpp/componentInstances/RNSVGTextComponentInstance.h b/tester/harmony/svg/src/main/cpp/componentInstances/RNSVGTextComponentInstance.h new file mode 100644 index 0000000000000000000000000000000000000000..3da77b1ea382e1febf93c376bbac3efbbb523fc8 --- /dev/null +++ b/tester/harmony/svg/src/main/cpp/componentInstances/RNSVGTextComponentInstance.h @@ -0,0 +1,20 @@ +#pragma once +#include "RNSVGBaseComponentInstance.h" +#include "SvgText.h" + +namespace rnoh { +namespace svg { + +class RNSVGTextComponentInstance : public RNSVGBaseComponentInstance { + + + std::shared_ptr m_svgText = std::make_shared(); + +public: + RNSVGTextComponentInstance(Context context); + + void UpdateElementProps(SharedConcreteProps const &props) override; +}; + +} // namespace svg +} // namespace rnoh \ No newline at end of file diff --git a/tester/harmony/svg/src/main/cpp/componentInstances/RNSVGTextPathComponentInstance.cpp b/tester/harmony/svg/src/main/cpp/componentInstances/RNSVGTextPathComponentInstance.cpp new file mode 100644 index 0000000000000000000000000000000000000000..01e970c24912b1717f8b819b087b1580f4ea83b8 --- /dev/null +++ b/tester/harmony/svg/src/main/cpp/componentInstances/RNSVGTextPathComponentInstance.cpp @@ -0,0 +1,24 @@ +#include "RNSVGTextPathComponentInstance.h" +#include "SvgTSpan.h" + +namespace rnoh { +namespace svg { + +RNSVGTextPathComponentInstance::RNSVGTextPathComponentInstance(Context context) + : RNSVGBaseComponentInstance(std::move(context)) { + SetSvgNode(m_svgTP); +} + +void RNSVGTextPathComponentInstance::UpdateElementProps(SharedConcreteProps const &props) { + m_svgTP->UpdateCommonProps(props); + m_svgTP->UpdateFontProps(props); + m_svgTP->UpdateTextProps(props); + m_svgTP->href_ = props->href; + m_svgTP->startOffset_ = StringUtils::FromString(props->startOffset).ConvertToPx(m_layoutMetrics.pointScaleFactor); + m_svgTP->spacing_ = textPathSpacingFromStr(props->spacing); + m_svgTP->midLine_ = textPathMidLineFromStr(props->midLine); + m_svgTP->side_ = textPathSideFromStr(props->side); + m_svgTP->method_ = textPathMethodFromStr(props->method); +} +} // namespace svg +} // namespace rnoh diff --git a/tester/harmony/svg/src/main/cpp/componentInstances/RNSVGTextPathComponentInstance.h b/tester/harmony/svg/src/main/cpp/componentInstances/RNSVGTextPathComponentInstance.h new file mode 100644 index 0000000000000000000000000000000000000000..1ad6630bd566ec225757ec0f18f93c6e470caaa5 --- /dev/null +++ b/tester/harmony/svg/src/main/cpp/componentInstances/RNSVGTextPathComponentInstance.h @@ -0,0 +1,21 @@ +#pragma once + +#include "RNSVGBaseComponentInstance.h" +#include "SvgTextPath.h" + +namespace rnoh { +namespace svg { + +class RNSVGTextPathComponentInstance : public RNSVGBaseComponentInstance { + +private: + std::shared_ptr m_svgTP = std::make_shared(); + +public: + RNSVGTextPathComponentInstance(Context context); + + void UpdateElementProps(SharedConcreteProps const &props) override; +}; + +} // namespace svg +} // namespace rnoh \ No newline at end of file diff --git a/tester/harmony/svg/src/main/cpp/componentInstances/RNSVGUseComponentInstance.cpp b/tester/harmony/svg/src/main/cpp/componentInstances/RNSVGUseComponentInstance.cpp new file mode 100644 index 0000000000000000000000000000000000000000..ab7690e0432c7d03e30a5fe84440c562a2130f7b --- /dev/null +++ b/tester/harmony/svg/src/main/cpp/componentInstances/RNSVGUseComponentInstance.cpp @@ -0,0 +1,30 @@ +#include "RNSVGUseComponentInstance.h" +#include "SvgUse.h" + +namespace rnoh { +namespace svg { + +RNSVGUseComponentInstance::RNSVGUseComponentInstance(Context context) : RNSVGBaseComponentInstance(std::move(context)) { + SetSvgNode(std::make_shared()); +} + +void RNSVGUseComponentInstance::UpdateElementProps(SharedConcreteProps const &props) { + DLOG(INFO) << "[RNSvgUseComponentInstance] Props: "; + DLOG(INFO) << "[RNSvgUseComponentInstance] x: " << props->x; + DLOG(INFO) << "[RNSvgUseComponentInstance] y: " << props->y; + DLOG(INFO) << "[RNSvgUseComponentInstance] width: " << props->width; + DLOG(INFO) << "[RNSvgUseComponentInstance] height: " << props->height; + // DLOG(INFO) << "[RNSvgUseComponentInstance] opacity: " << props->opacity; + DLOG(INFO) << "[RNSvgUseComponentInstance] href: " << props->href; + + auto svgUse = std::dynamic_pointer_cast(GetSvgNode()); + svgUse->UpdateCommonProps(props); + svgUse->x = std::stof(props->x); + svgUse->y = std::stof(props->y); + svgUse->width = std::stof(props->width); + svgUse->height = std::stof(props->height); + svgUse->href = props->href; +} + +} // namespace svg +} // namespace rnoh diff --git a/tester/harmony/svg/src/main/cpp/componentInstances/RNSVGUseComponentInstance.h b/tester/harmony/svg/src/main/cpp/componentInstances/RNSVGUseComponentInstance.h new file mode 100644 index 0000000000000000000000000000000000000000..ddd0198cfc54a04a33070da7d09315d571db3a8c --- /dev/null +++ b/tester/harmony/svg/src/main/cpp/componentInstances/RNSVGUseComponentInstance.h @@ -0,0 +1,18 @@ +#pragma once + +#include "RNSVGBaseComponentInstance.h" + +namespace rnoh { +namespace svg { + +class RNSVGUseComponentInstance : public RNSVGBaseComponentInstance { +public: + RNSVGUseComponentInstance(Context context); + void UpdateElementProps(SharedConcreteProps const &props) override; + void onChildInserted(ComponentInstance::Shared const &childComponentInstance, std::size_t index) override { + DLOG(INFO) << "[RNSvgUseComponentInstance] onChildInserted"; + } +}; + +} // namespace svg +} // namespace rnoh \ No newline at end of file diff --git a/tester/harmony/svg/src/main/cpp/drawing/Brush.cpp b/tester/harmony/svg/src/main/cpp/drawing/Brush.cpp new file mode 100644 index 0000000000000000000000000000000000000000..de2a89dc46da0da75f350fb48f316529dbf1fb67 --- /dev/null +++ b/tester/harmony/svg/src/main/cpp/drawing/Brush.cpp @@ -0,0 +1,42 @@ +#include "Brush.h" + +namespace rnoh::drawing { + +Brush::Brush() : brush_(UniqueNativeBrush(OH_Drawing_BrushCreate(), &OH_Drawing_BrushDestroy)) {} + +Brush::Brush(Brush const &other) : brush_(UniqueNativeBrush(OH_Drawing_BrushCopy(other.brush_.get()), &OH_Drawing_BrushDestroy)) {} + +Brush &Brush::operator=(Brush const &) { + brush_ = UniqueNativeBrush(OH_Drawing_BrushCopy(brush_.get()), &OH_Drawing_BrushDestroy); + return *this; +} + +void Brush::SetAntiAlias(bool antiAlias) { OH_Drawing_BrushSetAntiAlias(brush_.get(), antiAlias); } + +void Brush::SetColor(uint32_t color) { OH_Drawing_BrushSetColor(brush_.get(), color); } + +void Brush::SetAlpha(uint8_t alpha) { OH_Drawing_BrushSetAlpha(brush_.get(), alpha); } + +void Brush::SetLinearShaderEffect(const OH_Drawing_Point2D* startPt, const OH_Drawing_Point2D* endPt, + const uint32_t* colors, const float* pos, uint32_t size, OH_Drawing_TileMode mode, const OH_Drawing_Matrix* mat) { + brushShaderEffect_.ShaderEffectCreateLinearGradient(startPt, endPt, colors, pos, size, mode, mat); + OH_Drawing_BrushSetShaderEffect(brush_.get(), brushShaderEffect_.get()); +} + +void Brush::SetRadialShaderEffect(const OH_Drawing_Point2D* startPt, float startRadius, + const OH_Drawing_Point2D* endPt, float endRadius, const uint32_t* colors, const float* pos, uint32_t size, + OH_Drawing_TileMode mode, const OH_Drawing_Matrix* mat) { + brushShaderEffect_.ShaderEffectCreateRadialGradient( + startPt, startRadius, endPt,endRadius, colors, pos, size, mode, mat); + OH_Drawing_BrushSetShaderEffect(brush_.get(), brushShaderEffect_.get()); +} + +void Brush::SetImageShaderEffect(OH_Drawing_Image* image, OH_Drawing_TileMode tileX, + OH_Drawing_TileMode tileY, const OH_Drawing_SamplingOptions* opt, const OH_Drawing_Matrix* mat) { + brushShaderEffect_.ShaderEffectCreateImageShader(image, tileX, tileY, opt, mat); + OH_Drawing_BrushSetShaderEffect(brush_.get(), brushShaderEffect_.get()); +} + +void Brush::Reset() { OH_Drawing_BrushReset(brush_.get()); } + +} // namespace rnoh::drawing diff --git a/tester/harmony/svg/src/main/cpp/drawing/Brush.h b/tester/harmony/svg/src/main/cpp/drawing/Brush.h new file mode 100644 index 0000000000000000000000000000000000000000..02deb31b8b8397332c6b2b5df8f7c69f3434984c --- /dev/null +++ b/tester/harmony/svg/src/main/cpp/drawing/Brush.h @@ -0,0 +1,46 @@ +#pragma once + +#include +#include +#include "ShaderEffect.h" + +namespace rnoh::drawing { + +class Brush final { + + using UniqueNativeBrush = std::unique_ptr; + +public: + Brush(); + + Brush(Brush const &); + Brush &operator=(Brush const &); + + Brush(Brush &&) = default; + Brush &operator=(Brush &&) = default; + + ~Brush() noexcept = default; + + void SetAntiAlias(bool antiAlias); + void SetColor(uint32_t color); + void SetAlpha(uint8_t alpha); + + void SetLinearShaderEffect( + const OH_Drawing_Point2D* startPt, const OH_Drawing_Point2D* endPt, const uint32_t* colors, const float* pos, + uint32_t size, OH_Drawing_TileMode mode, const OH_Drawing_Matrix* mat); + void SetRadialShaderEffect( + const OH_Drawing_Point2D* startPt, float startRadius, const OH_Drawing_Point2D* endPt, float endRadius, + const uint32_t* colors, const float* pos, uint32_t size, OH_Drawing_TileMode mode, const OH_Drawing_Matrix* mat); + void SetImageShaderEffect(OH_Drawing_Image* image, OH_Drawing_TileMode tileX, OH_Drawing_TileMode tileY, + const OH_Drawing_SamplingOptions* opt, const OH_Drawing_Matrix* mat); + + void Reset(); + + OH_Drawing_Brush *get() const { return brush_.get(); } + +private: + UniqueNativeBrush brush_; + ShaderEffect brushShaderEffect_; +}; + +} // namespace rnoh::drawing \ No newline at end of file diff --git a/tester/harmony/svg/src/main/cpp/drawing/GlyPathBag.cpp b/tester/harmony/svg/src/main/cpp/drawing/GlyPathBag.cpp new file mode 100644 index 0000000000000000000000000000000000000000..5b1fc7a48a03c324e9cdfd6a9536d1a18c6bca4d --- /dev/null +++ b/tester/harmony/svg/src/main/cpp/drawing/GlyPathBag.cpp @@ -0,0 +1,16 @@ +#include "GlyPathBag.h" +#include "Path.h" + +namespace rnoh::drawing { + + +int GlyPathBag::getIndex(char ch) { + auto it = data.find(ch); + return it == data.end() ? 0 : it->second; +} + +drawing::Path GlyPathBag::getOrCreateAndCache(const char &ch, const std::string ¤t) { + return drawing::Path(); +} + +} // namespace rnoh::drawing \ No newline at end of file diff --git a/tester/harmony/svg/src/main/cpp/drawing/GlyPathBag.h b/tester/harmony/svg/src/main/cpp/drawing/GlyPathBag.h new file mode 100644 index 0000000000000000000000000000000000000000..ecd77075f6b7e160b1839b858dbd6d97632be572 --- /dev/null +++ b/tester/harmony/svg/src/main/cpp/drawing/GlyPathBag.h @@ -0,0 +1,24 @@ +#pragma once +#include +#include +#include "drawing/Path.h" +#include "drawing/Pen.h" +namespace rnoh::drawing { + +class GlyPathBag { + private: + int getIndex(char ch); + std::vector paths; + std::unordered_map data; + drawing::Pen paint; + public: + GlyPathBag(drawing::Pen const &paint) { + // Make indexed-by-one, to allow zero to represent non-cached + paths.push_back(drawing::Path()); + } + drawing::Path getOrCreateAndCache(const char &ch, const std::string ¤t); + +}; + +} // namespace rnoh::drawing + diff --git a/tester/harmony/svg/src/main/cpp/drawing/Matrix.cpp b/tester/harmony/svg/src/main/cpp/drawing/Matrix.cpp new file mode 100644 index 0000000000000000000000000000000000000000..d0153e7af92e198f082349ee4397d834feee15c2 --- /dev/null +++ b/tester/harmony/svg/src/main/cpp/drawing/Matrix.cpp @@ -0,0 +1,94 @@ +#include "Matrix.h" + +namespace rnoh::drawing { + +Matrix::Matrix() : matrix_(UniqueNativeMatrix(OH_Drawing_MatrixCreate(), &OH_Drawing_MatrixDestroy)) {} + +Matrix::Matrix(Matrix const &other) : Matrix() { *this = other; } + +Matrix &Matrix::operator=(Matrix const &other) { + if (this != &other) { + auto scaleX = OH_Drawing_MatrixGetValue(other.matrix_.get(), 0); + auto skewX = OH_Drawing_MatrixGetValue(other.matrix_.get(), 1); + auto transX = OH_Drawing_MatrixGetValue(other.matrix_.get(), 2); + auto skewY = OH_Drawing_MatrixGetValue(other.matrix_.get(), 3); + auto scaleY = OH_Drawing_MatrixGetValue(other.matrix_.get(), 4); + auto transY = OH_Drawing_MatrixGetValue(other.matrix_.get(), 5); + auto persp0 = OH_Drawing_MatrixGetValue(other.matrix_.get(), 6); + auto persp1 = OH_Drawing_MatrixGetValue(other.matrix_.get(), 7); + auto persp2 = OH_Drawing_MatrixGetValue(other.matrix_.get(), 8); + OH_Drawing_MatrixSetMatrix(matrix_.get(), scaleX, skewX, transX, skewY, scaleY, transY, persp0, persp1, persp2); + } + return *this; +} + + +Matrix Matrix::CreateRotation(float deg, float x, float y) { + return Matrix(OH_Drawing_MatrixCreateRotation(deg, x, y)); +} +Matrix Matrix::CreateScale(float sx, float sy, float px, float py) { + return Matrix(OH_Drawing_MatrixCreateScale(sx, sy, px, py)); +} +Matrix Matrix::CreateTranslation(float dx, float dy) { return Matrix(OH_Drawing_MatrixCreateTranslation(dx, dy)); } + +void Matrix::PreRotate(float degree, float px, float py) { OH_Drawing_MatrixPreRotate(matrix_.get(), degree, px, py); } +void Matrix::PreScale(float sx, float sy, float px, float py) { + OH_Drawing_MatrixPreScale(matrix_.get(), sx, sy, px, py); +} +void Matrix::PreTranslate(float dx, float dy) { OH_Drawing_MatrixPreTranslate(matrix_.get(), dx, dy); } + +void Matrix::PostRotate(float degree, float px, float py) { + OH_Drawing_MatrixPostRotate(matrix_.get(), degree, px, py); +} +void Matrix::PostScale(float sx, float sy, float px, float py) { + OH_Drawing_MatrixPostScale(matrix_.get(), sx, sy, px, py); +} +void Matrix::PostTranslate(float dx, float dy) { OH_Drawing_MatrixPostTranslate(matrix_.get(), dx, dy); } + +void Matrix::Rotate(float degree, float px, float py) { OH_Drawing_MatrixRotate(matrix_.get(), degree, px, py); } +void Matrix::Translate(float dx, float dy) { OH_Drawing_MatrixTranslate(matrix_.get(), dx, dy); } +void Matrix::Scale(float sx, float sy, float px, float py) { OH_Drawing_MatrixScale(matrix_.get(), sx, sy, px, py); } + +Matrix Matrix::Concat(const Matrix &other) const { + Matrix result; + OH_Drawing_MatrixConcat(result.matrix_.get(), matrix_.get(), other.matrix_.get()); + return result; +} + +std::optional Matrix::Invert() const { + Matrix result; + if (OH_Drawing_MatrixInvert(matrix_.get(), result.matrix_.get())) { + return result; + } + return std::nullopt; +} + +float Matrix::GetValue(int index) const { return OH_Drawing_MatrixGetValue(matrix_.get(), index); } + +void Matrix::SetMatrix(float scaleX, float skewX, float transX, float skewY, float scaleY, float transY, float persp0, + float persp1, float persp2) { + OH_Drawing_MatrixSetMatrix(matrix_.get(), scaleX, skewX, transX, skewY, scaleY, transY, persp0, persp1, persp2); +} + +Matrix::Point drawing::Matrix::MapPoint(const Matrix::Point &point) const { + Point result; + OH_Drawing_MatrixMapPoints(matrix_.get(), &point, &result, 1); + return result; +} + +std::vector drawing::Matrix::MapPoints(const std::vector &points) const { + std::vector result(points.size()); + OH_Drawing_MatrixMapPoints(matrix_.get(), points.data(), result.data(), points.size()); + return result; +} + +drawing::Rect drawing::Matrix::MapRect(const drawing::Rect &rect) const { + Rect result; + OH_Drawing_MatrixMapRect(matrix_.get(), rect.get(), result.get()); + return result; +} + +void Matrix::Reset() { OH_Drawing_MatrixReset(matrix_.get()); } + + +} // namespace rnoh::drawing \ No newline at end of file diff --git a/tester/harmony/svg/src/main/cpp/drawing/Matrix.h b/tester/harmony/svg/src/main/cpp/drawing/Matrix.h new file mode 100644 index 0000000000000000000000000000000000000000..626637649344e11837de2787de0efbab38cf27c0 --- /dev/null +++ b/tester/harmony/svg/src/main/cpp/drawing/Matrix.h @@ -0,0 +1,62 @@ +#pragma once + +#include "Rect.h" +#include +#include +#include +#include + +namespace rnoh::drawing { + +class Matrix final { + using UniqueNativeMatrix = std::unique_ptr; + using Point = OH_Drawing_Point2D; + +public: + Matrix(); + + Matrix(Matrix const &); + Matrix &operator=(Matrix const &); + + Matrix(Matrix &&) = default; + Matrix &operator=(Matrix &&) = default; + + ~Matrix() noexcept = default; + + static Matrix CreateRotation(float deg, float x, float y); + static Matrix CreateScale(float sx, float sy, float px, float py); + static Matrix CreateTranslation(float dx, float dy); + void PreRotate(float degree, float px, float py); + void PreScale(float sx, float sy, float px, float py); + void PreTranslate(float dx, float dy); + void PostRotate(float degree, float px, float py); + void PostScale(float sx, float sy, float px, float py); + void PostTranslate(float dx, float dy); + void Rotate(float degree, float px, float py); + void Translate(float dx, float dy); + void Scale(float sx, float sy, float px, float py); + + Matrix Concat(const Matrix &other) const; + std::optional Invert() const; + + float GetValue(int index) const; + + void SetMatrix(float scaleX, float skewX, float transX, float skewY, float scaleY, float transY, float persp0, + float persp1, float persp2); + + Point MapPoint(const Point &point) const; + std::vector MapPoints(const std::vector &points) const; + + drawing::Rect MapRect(const drawing::Rect &rect) const; + + void Reset(); + + OH_Drawing_Matrix *get() const { return matrix_.get(); } + +private: + Matrix(OH_Drawing_Matrix *rawMatrix) : matrix_(UniqueNativeMatrix(rawMatrix, &OH_Drawing_MatrixDestroy)) {} + + UniqueNativeMatrix matrix_; +}; + +} // namespace rnoh::drawing \ No newline at end of file diff --git a/tester/harmony/svg/src/main/cpp/drawing/Path.cpp b/tester/harmony/svg/src/main/cpp/drawing/Path.cpp new file mode 100644 index 0000000000000000000000000000000000000000..6b87584d0f212e4f26804e542b16ad33852d937b --- /dev/null +++ b/tester/harmony/svg/src/main/cpp/drawing/Path.cpp @@ -0,0 +1,171 @@ +#include "Path.h" +#include + +namespace rnoh { +namespace drawing { + +Path::Path() : path_(UniqueNativePath(OH_Drawing_PathCreate(), &OH_Drawing_PathDestroy)) {} + +Path::Path(Path const &other) + : path_(UniqueNativePath(OH_Drawing_PathCopy(other.path_.get()), &OH_Drawing_PathDestroy)) {} + +Path &Path::operator=(Path const &other) { + if (this != &other) { + path_ = UniqueNativePath(OH_Drawing_PathCopy(other.path_.get()), &OH_Drawing_PathDestroy); + } + return *this; +} + +void Path::Reset() { OH_Drawing_PathReset(path_.get()); } + +void Path::MoveTo(float x, float y) { OH_Drawing_PathMoveTo(get(), x, y); } + +void Path::LineTo(float x, float y) { OH_Drawing_PathLineTo(get(), x, y); } + +void Path::ArcTo(float x1, float y1, float x2, float y2, float startDeg, float sweepDeg) { + OH_Drawing_PathArcTo(get(), x1, y1, x2, y2, startDeg, sweepDeg); +} + +void Path::QuadTo(float ctrlX, float ctrlY, float endX, float endY) { + OH_Drawing_PathQuadTo(get(), ctrlX, ctrlY, endX, endY); +} + +void Path::ConicTo(float ctrlX, float ctrlY, float endX, float endY, float weight) { + OH_Drawing_PathConicTo(get(), ctrlX, ctrlY, endX, endY, weight); +} + +void Path::CubicTo(float ctrlX1, float ctrlY1, float ctrlX2, float ctrlY2, float endX, float endY) { + OH_Drawing_PathCubicTo(get(), ctrlX1, ctrlY1, ctrlX2, ctrlY2, endX, endY); +} + +void Path::RMoveTo(float x, float y) { OH_Drawing_PathRMoveTo(get(), x, y); } + +void Path::RLineTo(float x, float y) { OH_Drawing_PathRLineTo(get(), x, y); } + +void Path::RQuadTo(float ctrlX, float ctrlY, float endX, float endY) { + OH_Drawing_PathRQuadTo(get(), ctrlX, ctrlY, endX, endY); +} + +void Path::RConicTo(float ctrlX, float ctrlY, float endX, float endY, float weight) { + OH_Drawing_PathRConicTo(get(), ctrlX, ctrlY, endX, endY, weight); +} + +void Path::RCubicTo(float ctrlX1, float ctrlY1, float ctrlX2, float ctrlY2, float endX, float endY) { + OH_Drawing_PathRCubicTo(get(), ctrlX1, ctrlY1, ctrlX2, ctrlY2, endX, endY); +} + +void Path::AddRect(float left, float top, float right, float bottom, Direction direction) { + OH_Drawing_PathAddRect(get(), left, top, right, bottom, direction); +} + +void Path::AddRectWithInitialCorner(const Rect &rect, Direction direction, uint32_t start) { + OH_Drawing_PathAddRectWithInitialCorner(get(), rect.get(), direction, start); +} + +void Path::AddRoundRect(const RoundRect &roundRect, Direction direction) { + OH_Drawing_PathAddRoundRect(get(), roundRect.get(), direction); +} + +void Path::AddOvalWithInitialPoint(const Rect &rect, uint32_t start, Direction direction) { + OH_Drawing_PathAddOvalWithInitialPoint(get(), rect.get(), start, direction); +} + +void Path::AddOval(const Rect &rect, Direction direction) { OH_Drawing_PathAddOval(get(), rect.get(), direction); } + +void Path::AddArc(const Rect &rect, float startAngle, float sweepAngle) { + OH_Drawing_PathAddArc(get(), rect.get(), startAngle, sweepAngle); +} + +void Path::AddPath(const Path &src) { + OH_Drawing_PathAddPath(get(), src.get(), nullptr); +} + +void Path::AddPath(const Path &src, const Matrix &matrix) { OH_Drawing_PathAddPath(get(), src.get(), matrix.get()); } + +void Path::AddPathWithMatrixAndMode(const Path &src, const Matrix &matrix, AddMode mode) { + OH_Drawing_PathAddPathWithMatrixAndMode(get(), src.get(), matrix.get(), mode); +} + +void Path::AddPathWithMode(const Path &src, AddMode mode) { OH_Drawing_PathAddPathWithMode(get(), src.get(), mode); } + +void Path::AddPathWithOffsetAndMode(const Path &src, float dx, float dy, AddMode mode) { + OH_Drawing_PathAddPathWithOffsetAndMode(get(), src.get(), dx, dy, mode); +} + +void Path::AddPolygon(const OH_Drawing_Point2D *points, uint32_t count, bool isClosed) { + OH_Drawing_PathAddPolygon(get(), points, count, isClosed); +} + +void Path::AddCircle(float x, float y, float radius, Direction direction) { + OH_Drawing_PathAddCircle(get(), x, y, radius, direction); +} + +std::optional Path::BuildFromSvgString(const char *str) { + Path path; + if (OH_Drawing_PathBuildFromSvgString(path.get(), str)) { + return path; + } else { + return std::nullopt; + } + } + +bool Path::Contains(float x, float y) { return OH_Drawing_PathContains(get(), x, y); } + +void Path::Transform(const Matrix &matrix) { OH_Drawing_PathTransform(get(), matrix.get()); } + +Path Path::TransformWithPerspectiveClip(const Matrix &matrix, bool applyPerspectiveClip) { + Path path; + OH_Drawing_PathTransformWithPerspectiveClip(get(), matrix.get(), path.get(), applyPerspectiveClip); + return path; +} + +void Path::SetFillType(FillType fillType) { OH_Drawing_PathSetFillType(get(), fillType); } + +float Path::GetLength(bool forceClosed) { return OH_Drawing_PathGetLength(get(), forceClosed); } + +Rect Path::GetBounds() { + Rect bounds; + OH_Drawing_PathGetBounds(get(), bounds.get()); + return bounds; +} + +void Path::Close() { OH_Drawing_PathClose(get()); } + +Path Path::Offset(float dx, float dy) { + Path path; + OH_Drawing_PathOffset(get(), path.get(), dx, dy); + return path; +} + +bool Path::IsClosed(bool forceClosed) { return OH_Drawing_PathIsClosed(get(), forceClosed); } + +bool Path::GetPositionTangent(bool forceClosed, float distance, OH_Drawing_Point2D *position, + OH_Drawing_Point2D *tangent) { + return OH_Drawing_PathGetPositionTangent(get(), forceClosed, distance, position, tangent); +} + +bool Path::Op(Path &source, OpMode mode) { return OH_Drawing_PathOp(get(), source.get(), mode); } + +bool Path::Difference(Path &source) { return Op(source, PATH_OP_MODE_DIFFERENCE); } + +bool Path::Intersect(Path &source) { return Op(source, PATH_OP_MODE_INTERSECT); } + +bool Path::Union(Path &source) { return Op(source, PATH_OP_MODE_UNION); } + +bool Path::Xor(Path &source) { return Op(source, PATH_OP_MODE_XOR); } + +bool Path::ReverseDifference(Path &source) { + return Op(source, PATH_OP_MODE_REVERSE_DIFFERENCE); +} + +std::optional Path::GetMatrix(bool forceClosed, float distance, MeasureMatrixFlags flag) { + Matrix matrix; + if (OH_Drawing_PathGetMatrix(get(), forceClosed, distance, matrix.get(), flag)) { + return matrix; + } else { + return std::nullopt; + } +} + +} // namespace drawing +} // namespace rnoh \ No newline at end of file diff --git a/tester/harmony/svg/src/main/cpp/drawing/Path.h b/tester/harmony/svg/src/main/cpp/drawing/Path.h new file mode 100644 index 0000000000000000000000000000000000000000..c60f2c81908cfb4e5a64b515019a8c0923e5c301 --- /dev/null +++ b/tester/harmony/svg/src/main/cpp/drawing/Path.h @@ -0,0 +1,121 @@ +#pragma once + +#include +#include +#include "Matrix.h" +#include "Rect.h" +#include "RoundRect.h" + +namespace rnoh::drawing { + +class Path final { + using UniqueNativePath = std::unique_ptr; + +public: + using Direction = OH_Drawing_PathDirection; + using AddMode = OH_Drawing_PathAddMode; + using FillType = OH_Drawing_PathFillType; + using MeasureMatrixFlags = OH_Drawing_PathMeasureMatrixFlags; + using OpMode = OH_Drawing_PathOpMode; + + Path(); + + Path(Path const &); + Path &operator=(Path const &); + + Path(Path &&) = default; + Path &operator=(Path &&) = default; + + ~Path() noexcept = default; + + void Reset(); + + void MoveTo(float x, float y); + + void LineTo(float x, float y); + + void ArcTo(float x1, float y1, float x2, float y2, float startDeg, float sweepDeg); + + void QuadTo(float ctrlX, float ctrlY, float endX, float endY); + + void ConicTo(float ctrlX, float ctrlY, float endX, float endY, float weight); + + void CubicTo(float ctrlX1, float ctrlY1, float ctrlX2, float ctrlY2, float endX, float endY); + + void RMoveTo(float x, float y); + + void RLineTo(float x, float y); + + void RQuadTo(float ctrlX, float ctrlY, float endX, float endY); + + void RConicTo(float ctrlX, float ctrlY, float endX, float endY, float weight); + + void RCubicTo(float ctrlX1, float ctrlY1, float ctrlX2, float ctrlY2, float endX, float endY); + + void AddRect(float left, float top, float right, float bottom, Direction); + void AddRectWithInitialCorner(const Rect &, Direction, uint32_t start); + void AddRoundRect(const RoundRect &roundRect, Direction); + + void AddOvalWithInitialPoint(const Rect &, uint32_t start, Direction); + void AddOval(const Rect &, Direction); + + void AddArc(const Rect &, float startAngle, float sweepAngle); + + void AddPath(const Path &src); + void AddPath(const Path &src, const Matrix &); + + void AddPathWithMatrixAndMode(const Path &src, const Matrix &, AddMode); + void AddPathWithMode(const Path &src, AddMode); + + void AddPathWithOffsetAndMode(const Path &src, float dx, float dy, AddMode); + void AddPolygon(const OH_Drawing_Point2D *points, uint32_t count, bool isClosed); + + void AddCircle(float x, float y, float radius, Direction); + + static std::optional BuildFromSvgString(const char *str); + + bool Contains(float x, float y); + + + void Transform(const Matrix &); + + + Path TransformWithPerspectiveClip(const Matrix &, bool applyPerspectiveClip); + + + void SetFillType(FillType); + + float GetLength(bool forceClosed); + + Rect GetBounds(); + + void Close(); + + Path Offset(float dx, float dy); + + bool IsClosed(bool forceClosed); + + bool GetPositionTangent(bool forceClosed, float distance, OH_Drawing_Point2D *position, + OH_Drawing_Point2D *tangent); + + bool Op(Path &source, OpMode mode); + + bool Difference(Path &source); + + bool Intersect(Path &source); + + bool Union(Path &source); + + bool Xor(Path &source); + + bool ReverseDifference(Path &source); + + std::optional GetMatrix(bool forceClosed, float distance, MeasureMatrixFlags flag); + + OH_Drawing_Path *get() const { return path_.get(); } + +private: + UniqueNativePath path_; +}; + +} // namespace rnoh::drawing \ No newline at end of file diff --git a/tester/harmony/svg/src/main/cpp/drawing/Pen.cpp b/tester/harmony/svg/src/main/cpp/drawing/Pen.cpp new file mode 100644 index 0000000000000000000000000000000000000000..bcd1379c6f6ab053b8b542513cd38d3322310dbc --- /dev/null +++ b/tester/harmony/svg/src/main/cpp/drawing/Pen.cpp @@ -0,0 +1,51 @@ +#include "Pen.h" + +namespace rnoh::drawing { + +Pen::Pen() : pen_(UniqueNativePen(OH_Drawing_PenCreate(), &OH_Drawing_PenDestroy)) {} + +Pen::Pen(Pen const &other) : pen_(UniqueNativePen(OH_Drawing_PenCopy(other.pen_.get()), &OH_Drawing_PenDestroy)) {} + +Pen &Pen::operator=(Pen const &) { + pen_ = UniqueNativePen(OH_Drawing_PenCopy(pen_.get()), &OH_Drawing_PenDestroy); + return *this; +} + +void Pen::SetAntiAlias(bool antiAlias) { OH_Drawing_PenSetAntiAlias(pen_.get(), antiAlias); } + +void Pen::SetColor(uint32_t color) { OH_Drawing_PenSetColor(pen_.get(), color); } + +void Pen::SetAlpha(uint8_t alpha) { OH_Drawing_PenSetAlpha(pen_.get(), alpha); } + +void Pen::SetWidth(double width) { OH_Drawing_PenSetWidth(pen_.get(), width); } + +void Pen::SetMiterLimit(float miterLimit) { OH_Drawing_PenSetMiterLimit(pen_.get(), miterLimit); } + +void Pen::SetLineCap(LineCapStyle lineCap) { OH_Drawing_PenSetCap(pen_.get(), lineCap); } + +void Pen::SetLineJoin(LineJoinStyle lineJoin) { OH_Drawing_PenSetJoin(pen_.get(), lineJoin); } + +void Pen::SetLinearShaderEffect(const OH_Drawing_Point2D *startPt, const OH_Drawing_Point2D *endPt, + const uint32_t *colors, const float *pos, uint32_t size, OH_Drawing_TileMode mode, + const OH_Drawing_Matrix *mat) { + penShaderEffect_.ShaderEffectCreateLinearGradient(startPt, endPt, colors, pos, size, mode, mat); + OH_Drawing_PenSetShaderEffect(pen_.get(), penShaderEffect_.get()); +} + +void Pen::SetRadialShaderEffect(const OH_Drawing_Point2D *startPt, float startRadius, const OH_Drawing_Point2D *endPt, + float endRadius, const uint32_t *colors, const float *pos, uint32_t size, + OH_Drawing_TileMode mode, const OH_Drawing_Matrix *mat) { + penShaderEffect_.ShaderEffectCreateRadialGradient(startPt, startRadius, endPt, endRadius, colors, pos, size, mode, + mat); + OH_Drawing_PenSetShaderEffect(pen_.get(), penShaderEffect_.get()); +} + +void Pen::SetImageShaderEffect(OH_Drawing_Image *image, OH_Drawing_TileMode tileX, OH_Drawing_TileMode tileY, + const OH_Drawing_SamplingOptions *opt, const OH_Drawing_Matrix *mat) { + penShaderEffect_.ShaderEffectCreateImageShader(image, tileX, tileY, opt, mat); + OH_Drawing_PenSetShaderEffect(pen_.get(), penShaderEffect_.get()); +} + +void Pen::Reset() {} + +} // namespace rnoh::drawing \ No newline at end of file diff --git a/tester/harmony/svg/src/main/cpp/drawing/Pen.h b/tester/harmony/svg/src/main/cpp/drawing/Pen.h new file mode 100644 index 0000000000000000000000000000000000000000..fc168e6b41e82d0eb94a8c28fc7375b5ac4daf70 --- /dev/null +++ b/tester/harmony/svg/src/main/cpp/drawing/Pen.h @@ -0,0 +1,53 @@ +#pragma once + +#include "ShaderEffect.h" +#include +#include +#include + +namespace rnoh::drawing { + +class Pen final { + + using UniqueNativePen = std::unique_ptr; + +public: + using LineCapStyle = OH_Drawing_PenLineCapStyle; + using LineJoinStyle = OH_Drawing_PenLineJoinStyle; + + Pen(); + + Pen(Pen const &); + Pen &operator=(Pen const &); + + Pen(Pen &&) = default; + Pen &operator=(Pen &&) = default; + + ~Pen() noexcept = default; + + void SetAntiAlias(bool antiAlias); + void SetColor(uint32_t color); + void SetAlpha(uint8_t alpha); + void SetWidth(double width); + void SetMiterLimit(float miterLimit); + void SetLineCap(LineCapStyle lineCap); + void SetLineJoin(LineJoinStyle lineJoin); + void SetLinearShaderEffect(const OH_Drawing_Point2D *startPt, const OH_Drawing_Point2D *endPt, + const uint32_t *colors, const float *pos, uint32_t size, OH_Drawing_TileMode mode, + const OH_Drawing_Matrix *mat); + void SetRadialShaderEffect(const OH_Drawing_Point2D *startPt, float startRadius, const OH_Drawing_Point2D *endPt, + float endRadius, const uint32_t *colors, const float *pos, uint32_t size, + OH_Drawing_TileMode mode, const OH_Drawing_Matrix *mat); + void SetImageShaderEffect(OH_Drawing_Image *image, OH_Drawing_TileMode tileX, OH_Drawing_TileMode tileY, + const OH_Drawing_SamplingOptions *opt, const OH_Drawing_Matrix *mat); + + void Reset(); + + OH_Drawing_Pen *get() const { return pen_.get(); } + +private: + UniqueNativePen pen_; + ShaderEffect penShaderEffect_; +}; + +} // namespace rnoh::drawing \ No newline at end of file diff --git a/tester/harmony/svg/src/main/cpp/drawing/Rect.cpp b/tester/harmony/svg/src/main/cpp/drawing/Rect.cpp new file mode 100644 index 0000000000000000000000000000000000000000..b33b5c7a21db9d8e7d32f367655737971a5034c7 --- /dev/null +++ b/tester/harmony/svg/src/main/cpp/drawing/Rect.cpp @@ -0,0 +1,66 @@ +#include "Rect.h" + +namespace rnoh { +namespace drawing { +Rect::Rect() : Rect(0, 0, 0, 0) {} + +Rect::Rect(float left, float top, float right, float bottom) : rect_(UniqueNativeRect(OH_Drawing_RectCreate(left, top, right, bottom), &OH_Drawing_RectDestroy)) {} + +Rect::Rect(Rect const &other) : Rect() { + *this = other; +} +Rect &Rect::operator=(Rect const &other) { + OH_Drawing_RectCopy(other.get(), get()); + return *this; +} + +bool Rect::Intersect(const Rect &other) { + return OH_Drawing_RectIntersect(get(), other.get()); +} + +bool Rect::Join(const Rect &other) { + return OH_Drawing_RectJoin(get(), other.get()); +} + +void Rect::SetLeft(float left) { + OH_Drawing_RectSetLeft(get(), left); +} + +void Rect::SetTop(float top) { + OH_Drawing_RectSetTop(get(), top); +} + +void Rect::SetRight(float right) { + OH_Drawing_RectSetRight(get(), right); +} + +void Rect::SetBottom(float bottom) { + OH_Drawing_RectSetBottom(get(), bottom); +} + +float Rect::GetLeft() { + return OH_Drawing_RectGetLeft(get()); +} + +float Rect::GetTop() { + return OH_Drawing_RectGetTop(get()); +} + +float Rect::GetRight() { + return OH_Drawing_RectGetRight(get()); +} + +float Rect::GetBottom() { + return OH_Drawing_RectGetBottom(get()); +} + +float Rect::GetHeight() { + return OH_Drawing_RectGetHeight(get()); +} + +float Rect::GetWidth() { + return OH_Drawing_RectGetWidth(get()); +} + +} // namespace drawing +} // namespace rnoh \ No newline at end of file diff --git a/tester/harmony/svg/src/main/cpp/drawing/Rect.h b/tester/harmony/svg/src/main/cpp/drawing/Rect.h new file mode 100644 index 0000000000000000000000000000000000000000..5126c202af6205697bdec8935dd270d99b8cc30e --- /dev/null +++ b/tester/harmony/svg/src/main/cpp/drawing/Rect.h @@ -0,0 +1,50 @@ +#pragma once + +#include +#include + +namespace rnoh { +namespace drawing { +class Rect final { + using UniqueNativeRect = std::unique_ptr; + +public: + Rect(); + Rect(float left, float top, float right, float bottom); + Rect(Rect const &); + Rect &operator=(Rect const &); + Rect(Rect &&) = default; + Rect &operator=(Rect &&) = default; + ~Rect() noexcept = default; + + bool Intersect(const Rect &other); + + bool Join(const Rect &other); + + void SetLeft(float left); + + void SetTop(float top); + + void SetRight(float right); + + void SetBottom(float bottom); + + float GetLeft(); + + float GetTop(); + + float GetRight(); + + float GetBottom(); + + float GetHeight(); + + float GetWidth(); + + OH_Drawing_Rect *get() const { return rect_.get(); } + +private: + UniqueNativeRect rect_; +}; +} // namespace drawing +} // namespace rnoh \ No newline at end of file diff --git a/tester/harmony/svg/src/main/cpp/drawing/RoundRect.cpp b/tester/harmony/svg/src/main/cpp/drawing/RoundRect.cpp new file mode 100644 index 0000000000000000000000000000000000000000..39a8203274f40183a3dbb0fc00fff90cd8e41267 --- /dev/null +++ b/tester/harmony/svg/src/main/cpp/drawing/RoundRect.cpp @@ -0,0 +1,18 @@ +#include "RoundRect.h" + +namespace rnoh { +namespace drawing { + +RoundRect::RoundRect(Rect rect, float rx, float ry) + : rect_(std::move(rect)), + roundRect_(UniqueNativeRoundRect(OH_Drawing_RoundRectCreate(rect_.get(), rx, ry), &OH_Drawing_RoundRectDestroy)) { +} +void RoundRect::SetCorner(CornerPos pos, CornerRadii radii) { + OH_Drawing_RoundRectSetCorner(roundRect_.get(), pos, radii); +} +RoundRect::CornerRadii RoundRect::GetCorner(CornerPos pos) { + return OH_Drawing_RoundRectGetCorner(roundRect_.get(), pos); +} + +} // namespace drawing +} // namespace rnoh \ No newline at end of file diff --git a/tester/harmony/svg/src/main/cpp/drawing/RoundRect.h b/tester/harmony/svg/src/main/cpp/drawing/RoundRect.h new file mode 100644 index 0000000000000000000000000000000000000000..104a537940e762579a9c477eb2925aea908f7000 --- /dev/null +++ b/tester/harmony/svg/src/main/cpp/drawing/RoundRect.h @@ -0,0 +1,33 @@ +#pragma once + +#include +#include +#include "Rect.h" + +namespace rnoh { +namespace drawing { +class RoundRect final { + using UniqueNativeRoundRect = std::unique_ptr; + + using CornerPos = OH_Drawing_CornerPos; + using CornerRadii = OH_Drawing_Corner_Radii; + +public: + RoundRect(Rect rect, float rx, float ry); + RoundRect(RoundRect const &) = delete; + RoundRect &operator=(RoundRect const &) = delete; + RoundRect(RoundRect &&) = default; + RoundRect &operator=(RoundRect &&) = default; + ~RoundRect() noexcept = default; + + void SetCorner(CornerPos pos, CornerRadii radii); + CornerRadii GetCorner(CornerPos pos); + + OH_Drawing_RoundRect *get() const { return roundRect_.get(); } + +private: + Rect rect_; + UniqueNativeRoundRect roundRect_; +}; +} // namespace drawing +} // namespace rnoh \ No newline at end of file diff --git a/tester/harmony/svg/src/main/cpp/drawing/ShaderEffect.cpp b/tester/harmony/svg/src/main/cpp/drawing/ShaderEffect.cpp new file mode 100644 index 0000000000000000000000000000000000000000..f286dee9f18fd1b29a678e9e0ee0d9c9e5b02713 --- /dev/null +++ b/tester/harmony/svg/src/main/cpp/drawing/ShaderEffect.cpp @@ -0,0 +1,28 @@ +#include "ShaderEffect.h" + +namespace rnoh::drawing { + +ShaderEffect::ShaderEffect() : shaderEffect_(UniqueNativeShaderEffect(nullptr, &OH_Drawing_ShaderEffectDestroy)) {} + +void ShaderEffect::ShaderEffectCreateLinearGradient(const OH_Drawing_Point2D* startPt, const OH_Drawing_Point2D* endPt, + const uint32_t* colors, const float* pos, uint32_t size, OH_Drawing_TileMode mode, const OH_Drawing_Matrix* mat) { + shaderEffect_ = UniqueNativeShaderEffect( + OH_Drawing_ShaderEffectCreateLinearGradientWithLocalMatrix(startPt, endPt, colors, pos, size, mode, mat), + &OH_Drawing_ShaderEffectDestroy); +} + +void ShaderEffect::ShaderEffectCreateRadialGradient(const OH_Drawing_Point2D* startPt, float startRadius, + const OH_Drawing_Point2D* endPt, float endRadius, const uint32_t* colors, const float* pos, uint32_t size, + OH_Drawing_TileMode mode, const OH_Drawing_Matrix* mat) { + shaderEffect_ = UniqueNativeShaderEffect( + OH_Drawing_ShaderEffectCreateTwoPointConicalGradient(startPt, startRadius, endPt, endRadius, colors, pos, size, + mode, mat), &OH_Drawing_ShaderEffectDestroy); +} + +void ShaderEffect::ShaderEffectCreateImageShader(OH_Drawing_Image* image, OH_Drawing_TileMode tileX, + OH_Drawing_TileMode tileY, const OH_Drawing_SamplingOptions* opt, const OH_Drawing_Matrix* mat) { + shaderEffect_ = UniqueNativeShaderEffect( + OH_Drawing_ShaderEffectCreateImageShader(image, tileX, tileY, opt, mat), &OH_Drawing_ShaderEffectDestroy); +} + +} // namespace rnoh::drawing diff --git a/tester/harmony/svg/src/main/cpp/drawing/ShaderEffect.h b/tester/harmony/svg/src/main/cpp/drawing/ShaderEffect.h new file mode 100644 index 0000000000000000000000000000000000000000..6e205b172d4812cc0ee3928a823b97d6c7594947 --- /dev/null +++ b/tester/harmony/svg/src/main/cpp/drawing/ShaderEffect.h @@ -0,0 +1,43 @@ +#pragma once + +#include +#include +#include +#include +#include + +namespace rnoh::drawing { + +class ShaderEffect final { + + using UniqueNativeShaderEffect = std::unique_ptr; + +public: + ShaderEffect(); + + ShaderEffect(ShaderEffect const &other) = delete; + ShaderEffect &operator=(ShaderEffect const &other) = delete; + + ShaderEffect(ShaderEffect &&other) = default; + ShaderEffect &operator=(ShaderEffect &&other) = default; + + void ShaderEffectCreateLinearGradient( + const OH_Drawing_Point2D* startPt, const OH_Drawing_Point2D* endPt, const uint32_t* colors, const float* pos, + uint32_t size, OH_Drawing_TileMode mode, const OH_Drawing_Matrix* mat); + + void ShaderEffectCreateRadialGradient( + const OH_Drawing_Point2D* startPt, float startRadius, const OH_Drawing_Point2D* endPt, float endRadius, + const uint32_t* colors, const float* pos, uint32_t size, OH_Drawing_TileMode mode, const OH_Drawing_Matrix* mat); + + void ShaderEffectCreateImageShader(OH_Drawing_Image* image, OH_Drawing_TileMode tileX, OH_Drawing_TileMode tileY, + const OH_Drawing_SamplingOptions* opt, const OH_Drawing_Matrix* mat); + + ~ShaderEffect() noexcept = default; + + OH_Drawing_ShaderEffect *get() const { return shaderEffect_.get(); } + +private: + UniqueNativeShaderEffect shaderEffect_; +}; + +} // namespace rnoh::drawing \ No newline at end of file diff --git a/tester/harmony/svg/src/main/cpp/drawing/TextStyle.cpp b/tester/harmony/svg/src/main/cpp/drawing/TextStyle.cpp new file mode 100644 index 0000000000000000000000000000000000000000..9164e22edb4791d93ee2a546daae61bda2159fb4 --- /dev/null +++ b/tester/harmony/svg/src/main/cpp/drawing/TextStyle.cpp @@ -0,0 +1,44 @@ +#include "TextStyle.h" +#include + +namespace rnoh::drawing { +static std::vector disableDiscretionaryLigatures = {"liga", "clig", "dlig", "hlig", "cala"}; +static std::vector defaultFeatures = {"rlig", "liga", "clig", "calt", "locl", + "ccmp", "mark", "mkmk", "kern"}; +static std::vector additionalLigatures = {"hlig", "cala"}; +static std::string fontWeightTag = "wght"; + +TextStyle::TextStyle() : textStyle_(UniqueTextStyle(OH_Drawing_CreateTextStyle(), OH_Drawing_DestroyTextStyle)) {} + +void TextStyle::Update(const std::shared_ptr &style) { + auto *ts = textStyle_.get(); + OH_Drawing_SetTextStyleFontSize(ts, style->fontSize); + OH_Drawing_SetTextStyleFontWeight(ts, static_cast(style->fontWeight)); + OH_Drawing_SetTextStyleFontStyle(ts, static_cast(style->fontStyle)); + if (!style->fontFamily.empty()) { + std::vector ff{style->fontFamily.c_str()}; + OH_Drawing_SetTextStyleFontFamilies(ts, 1, ff.data()); + } + OH_Drawing_SetTextStyleDecoration(ts, static_cast(style->textDecoration)); + OH_Drawing_SetTextStyleLetterSpacing(ts, style->letterSpacing); + OH_Drawing_SetTextStyleWordSpacing(ts, style->wordSpacing); + + for (const auto &key : defaultFeatures) { + OH_Drawing_TextStyleAddFontFeature(ts, key.c_str(), 1); + } + OH_Drawing_TextStyleAddFontFeature(ts, style->fontFeatureSettings.c_str(), 1); + + const bool allowOptionalLigatures = + style->letterSpacing == 0 && style->fontVariantLigatures == svg::FontVariantLigatures::normal; + if (allowOptionalLigatures) { + for (const auto &key : additionalLigatures) { + OH_Drawing_TextStyleAddFontFeature(ts, key.c_str(), 1); + } + } else { + for (const auto &key : disableDiscretionaryLigatures) { + OH_Drawing_TextStyleAddFontFeature(ts, key.c_str(), 0); + } + } +} + +} // namespace rnoh::drawing \ No newline at end of file diff --git a/tester/harmony/svg/src/main/cpp/drawing/TextStyle.h b/tester/harmony/svg/src/main/cpp/drawing/TextStyle.h new file mode 100644 index 0000000000000000000000000000000000000000..5dda99278a04fbd69566d94424a0bf83214ae18d --- /dev/null +++ b/tester/harmony/svg/src/main/cpp/drawing/TextStyle.h @@ -0,0 +1,36 @@ +#pragma once + +#include +#include +#include "properties/Font.h" + +namespace rnoh::drawing { + +class TextStyle final { + +using UniqueTextStyle = std::unique_ptr; +public: + TextStyle(); + ~TextStyle() noexcept = default; + + TextStyle(const TextStyle &) = delete; + TextStyle &operator=(const TextStyle &) = delete; + + TextStyle(TextStyle &&) = default; + TextStyle &operator=(TextStyle &&) = default; + + void SetForegroundPen(OH_Drawing_Pen *pen) { + OH_Drawing_SetTextStyleForegroundPen(textStyle_.get(), pen); + } + + void SetForegroundBrush(OH_Drawing_Brush *brush) { + OH_Drawing_SetTextStyleForegroundBrush(textStyle_.get(), brush); + } + + void Update(const std::shared_ptr& style); +// private: + UniqueTextStyle textStyle_; + friend class TypographyStyle; +}; + +} // namespace rnoh::drawing \ No newline at end of file diff --git a/tester/harmony/svg/src/main/cpp/drawing/Typography.cpp b/tester/harmony/svg/src/main/cpp/drawing/Typography.cpp new file mode 100644 index 0000000000000000000000000000000000000000..ef44e2acacff4f09bc0f33be2db0287cb4961119 --- /dev/null +++ b/tester/harmony/svg/src/main/cpp/drawing/Typography.cpp @@ -0,0 +1 @@ +#include "Typography.h" \ No newline at end of file diff --git a/tester/harmony/svg/src/main/cpp/drawing/Typography.h b/tester/harmony/svg/src/main/cpp/drawing/Typography.h new file mode 100644 index 0000000000000000000000000000000000000000..2f764da80efa0d4a3324f64df696f688b7a94a33 --- /dev/null +++ b/tester/harmony/svg/src/main/cpp/drawing/Typography.h @@ -0,0 +1,18 @@ +#pragma once + +#include +#include "TypographyStyle.h" + +namespace rnoh::drawing { + +class Typography { +public: + Typography(OH_Drawing_TypographyCreate* handler) : typ_(TypUPtr(OH_Drawing_CreateTypography(handler), OH_Drawing_DestroyTypography)) {} + OH_Drawing_Typography *operator&() { return typ_.get(); } + +private: + using TypUPtr = std::unique_ptr; + TypUPtr typ_; +}; + +} // namespace rnoh \ No newline at end of file diff --git a/tester/harmony/svg/src/main/cpp/drawing/TypographyBuilder.cpp b/tester/harmony/svg/src/main/cpp/drawing/TypographyBuilder.cpp new file mode 100644 index 0000000000000000000000000000000000000000..ec497e2ceca518556184dc8c244eff89319df2b9 --- /dev/null +++ b/tester/harmony/svg/src/main/cpp/drawing/TypographyBuilder.cpp @@ -0,0 +1,3 @@ +#include "TypographyBuilder.h" + +namespace drawing {} // namespace drawing \ No newline at end of file diff --git a/tester/harmony/svg/src/main/cpp/drawing/TypographyBuilder.h b/tester/harmony/svg/src/main/cpp/drawing/TypographyBuilder.h new file mode 100644 index 0000000000000000000000000000000000000000..63cd7b608d0bc2bae6d41c0995e8362791813d6d --- /dev/null +++ b/tester/harmony/svg/src/main/cpp/drawing/TypographyBuilder.h @@ -0,0 +1,5 @@ +#pragma once + +namespace drawing { +class TypographyBuilder {}; +} // namespace drawing \ No newline at end of file diff --git a/tester/harmony/svg/src/main/cpp/drawing/TypographyStyle.cpp b/tester/harmony/svg/src/main/cpp/drawing/TypographyStyle.cpp new file mode 100644 index 0000000000000000000000000000000000000000..2e811908c28a6fada87ff02807f96fd1666cbc16 --- /dev/null +++ b/tester/harmony/svg/src/main/cpp/drawing/TypographyStyle.cpp @@ -0,0 +1,25 @@ +#include "TypographyStyle.h" +#include + +namespace rnoh::drawing { + +TypographyStyle::TypographyStyle() + : typographyStyle_(UniqueTypographyStyle(OH_Drawing_CreateTypographyStyle(), OH_Drawing_DestroyTypographyStyle)) {} + +TypographyStyle::~TypographyStyle() noexcept {} + +void TypographyStyle::SetTextStyle(TextStyle textStyle) { + textStyle_ = std::move(textStyle.textStyle_); + OH_Drawing_SetTypographyTextStyle(typographyStyle_.get(), textStyle_.get()); +} + +void TypographyStyle::Update(const std::shared_ptr &style) { + auto* ts = typographyStyle_.get(); + OH_Drawing_SetTypographyTextFontWeight(ts, style->absoluteFontWeight); + OH_Drawing_SetTypographyTextFontStyle(ts, static_cast(style->fontStyle)); + OH_Drawing_SetTypographyTextFontFamily(ts, style->fontFamily.c_str()); + OH_Drawing_SetTypographyTextFontSize(ts, style->fontSize); + // OH_Drawing_SetTypographyTextAlign(ts, static_cast(style->textAnchor)); +} + +} // namespace rnoh::drawing diff --git a/tester/harmony/svg/src/main/cpp/drawing/TypographyStyle.h b/tester/harmony/svg/src/main/cpp/drawing/TypographyStyle.h new file mode 100644 index 0000000000000000000000000000000000000000..bad72cdf888bbe98f057c9c9a77e9fd48e9bf784 --- /dev/null +++ b/tester/harmony/svg/src/main/cpp/drawing/TypographyStyle.h @@ -0,0 +1,36 @@ +#pragma once + +#include +#include +#include + +#include "TextStyle.h" +#include "properties/Font.h" + +namespace rnoh::drawing { + +class TypographyStyle final { + + using UniqueTypographyStyle = + std::unique_ptr; + +public: + TypographyStyle(); + ~TypographyStyle() noexcept; + + TypographyStyle(const TypographyStyle &) = delete; + TypographyStyle &operator=(const TypographyStyle &) = delete; + + TypographyStyle(TypographyStyle &&other) = default; + TypographyStyle &operator=(TypographyStyle && other) = default; + + void SetTextStyle(TextStyle textStyle); + + void Update(const std::shared_ptr &style); + + // private: + UniqueTypographyStyle typographyStyle_; + TextStyle::UniqueTextStyle textStyle_ = {nullptr, OH_Drawing_DestroyTextStyle}; +}; + +} // namespace rnoh::drawing \ No newline at end of file diff --git a/tester/harmony/svg/src/main/cpp/properties/Color.cpp b/tester/harmony/svg/src/main/cpp/properties/Color.cpp new file mode 100644 index 0000000000000000000000000000000000000000..bbdf3bfa616d8ca1467bdd24287980f1f2dcede2 --- /dev/null +++ b/tester/harmony/svg/src/main/cpp/properties/Color.cpp @@ -0,0 +1,455 @@ +#pragma once +#include +#include +#include "Color.h" +#include "utils/SvgUtils.h" +#include "utils/StringUtils.h" +#include "utils/LinearMap.h" +namespace rnoh { +namespace svg { + +namespace { + +constexpr uint32_t COLOR_ALPHA_OFFSET = 24; +constexpr uint32_t COLOR_STRING_SIZE_STANDARD = 8; +constexpr uint32_t COLOR_STRING_BASE = 16; +constexpr uint32_t RGB_SUB_MATCH_SIZE = 4; +constexpr uint32_t RGBA_SUB_MATCH_SIZE = 5; + +const std::regex COLOR_WITH_MAGIC("#[0-9A-Fa-f]{6,8}"); +const std::regex COLOR_WITH_MAGIC_MINI("#[0-9A-Fa-f]{3,4}"); +const std::regex COLOR_WITH_RGB(R"(rgb\(([0-9]{1,3})\,([0-9]{1,3})\,([0-9]{1,3})\))", std::regex::icase); +const std::regex COLOR_WITH_RGBA(R"(rgba\(([0-9]{1,3})\,([0-9]{1,3})\,([0-9]{1,3})\,(\d+\.?\d*)\))", std::regex::icase); +constexpr double GAMMA_FACTOR = 2.2; +constexpr float MAX_ALPHA = 255.0f; +constexpr char HEX[] = "0123456789ABCDEF"; +constexpr uint8_t BIT_LENGTH_INT32 = 8; +constexpr uint8_t MIN_RGB_VALUE = 0; +constexpr uint8_t MAX_RGB_VALUE = 255; +constexpr double MIN_RGBA_OPACITY = 0.0; +constexpr double MAX_RGBA_OPACITY = 1.0; + +} // namespace + +const Color Color::TRANSPARENT = Color(0x00000000); +const Color Color::WHITE = Color(0xffffffff); +const Color Color::BLACK = Color(0xff000000); +const Color Color::RED = Color(0xffff0000); +const Color Color::GREEN = Color(0xff00ff00); +const Color Color::BLUE = Color(0xff0000ff); +const Color Color::GRAY = Color(0xffc0c0c0); +const Color Color::FOREGROUND = Color(0x00000001); // foreground color and foreground color strategy identification + +Color Color::FromString(std::string colorStr, uint32_t maskAlpha, Color defaultColor) { + if (colorStr.empty()) { + // empty string, return transparent + return Color::TRANSPARENT; + } + + // Remove all " ". + colorStr.erase(std::remove(colorStr.begin(), colorStr.end(), ' '), colorStr.end()); + + std::smatch matches; + // Regex match for #909090 or #90909090. + if (std::regex_match(colorStr, matches, COLOR_WITH_MAGIC)) { + colorStr.erase(0, 1); + auto value = stoul(colorStr, nullptr, COLOR_STRING_BASE); + if (colorStr.length() < COLOR_STRING_SIZE_STANDARD) { + // no alpha specified, set alpha to 0xff + value |= maskAlpha; + } + return Color(value); + } + // Regex match for #rgb or #rgba. + if (std::regex_match(colorStr, matches, COLOR_WITH_MAGIC_MINI)) { + colorStr.erase(0, 1); + std::string newColorStr; + // translate #rgb or #rgba to #rrggbb or #rrggbbaa + for (auto &c : colorStr) { + newColorStr += c; + newColorStr += c; + } + auto value = stoul(newColorStr, nullptr, COLOR_STRING_BASE); + if (newColorStr.length() < COLOR_STRING_SIZE_STANDARD) { + // no alpha specified, set alpha to 0xff + value |= maskAlpha; + } + return Color(value); + } + // Regex match for rgb(90,254,180). + if (std::regex_match(colorStr, matches, COLOR_WITH_RGB)) { + if (matches.size() == RGB_SUB_MATCH_SIZE) { + auto red = static_cast(std::stoi(matches[1])); // red value. + auto green = static_cast(std::stoi(matches[2])); // green value. + auto blue = static_cast(std::stoi(matches[3])); // blue value. + return FromRGB(red, green, blue); + } + } + // Regex match for rgba(90,254,180,0.5). + if (std::regex_match(colorStr, matches, COLOR_WITH_RGBA)) { + if (matches.size() == RGBA_SUB_MATCH_SIZE) { + auto red = static_cast(std::stoi(matches[1])); + auto green = static_cast(std::stoi(matches[2])); + auto blue = static_cast(std::stoi(matches[3])); + auto opacity = static_cast(std::stod(matches[4])); + return FromRGBO(red, green, blue, opacity); + } + } + // match for special string + static const LinearMapNode colorTable[] = { + {"black", Color(0xff000000)}, {"blue", Color(0xff0000ff)}, {"gray", Color(0xffc0c0c0)}, + {"green", Color(0xff00ff00)}, {"red", Color(0xffff0000)}, {"white", Color(0xffffffff)}, + }; + int64_t colorIndex = BinarySearchFindIndex(colorTable, ArraySize(colorTable), colorStr.c_str()); + if (colorIndex != -1) { + return colorTable[colorIndex].value; + } + + // parse uint32_t color string. + auto uint32Color = StringUtils::StringToUint(colorStr); + if (uint32Color > 0) { + Color value; + if (uint32Color >> COLOR_ALPHA_OFFSET == 0) { + value = Color(uint32Color).ChangeAlpha(MAX_ALPHA); + } else { + value = Color(uint32Color); + } + return value; + } + + // Default color. + return defaultColor; +} + +Color Color::FromARGB(uint8_t alpha, uint8_t red, uint8_t green, uint8_t blue) +{ + ColorParam colorValue { +#if BIG_ENDIANNESS + .argb = { .alpha = alpha, .red = red, .green = green, .blue = blue } +#else + .argb = { .blue = blue, .green = green, .red = red, .alpha = alpha } +#endif + }; + return Color(colorValue); +} + +Color Color::FromRGBO(uint8_t red, uint8_t green, uint8_t blue, double opacity) +{ + return FromARGB(static_cast(round(opacity * 0xff)) & 0xff, red, green, blue); +} + +Color Color::FromRGB(uint8_t red, uint8_t green, uint8_t blue) +{ + return FromARGB(0xff, red, green, blue); +} + +Color Color::BlendColor(const Color& overlayColor) const +{ + if (GetValue() == Color::TRANSPARENT.GetValue()) { + return overlayColor; + } + if (GetAlpha() < static_cast(MAX_ALPHA)) { + return BlendColorWithAlpha(overlayColor); + } + auto alphaRate = static_cast(overlayColor.GetAlpha()) / MAX_ALPHA; + auto newRed = static_cast(GetRed() * (1.0f - alphaRate) + overlayColor.GetRed() * alphaRate); + auto newGreen = static_cast(GetGreen() * (1.0f - alphaRate) + overlayColor.GetGreen() * alphaRate); + auto newBlue = static_cast(GetBlue() * (1.0f - alphaRate) + overlayColor.GetBlue() * alphaRate); + return Color::FromRGB(newRed, newGreen, newBlue); +} + +float Color::CalculateBlend(float alphaLeft, float alphaRight, float valueLeft, float valueRight) const +{ + return (valueLeft * alphaLeft * (1.0 - alphaRight) + valueRight * alphaRight) / + (alphaLeft + alphaRight - alphaLeft * alphaRight); +} + +Color Color::BlendColorWithAlpha(const Color& overlayColor) const +{ + float alphaA = GetAlpha() / 255.0; + float alphaB = overlayColor.GetAlpha() / 255.0; + float blendAlpha = alphaA + alphaB - alphaA * alphaB; + float blendRed = CalculateBlend(alphaA, alphaB, GetRed() / 255.0, overlayColor.GetRed() / 255.0); + float blendGreen = CalculateBlend(alphaA, alphaB, GetGreen() / 255.0, overlayColor.GetGreen() / 255.0); + float blendBlue = CalculateBlend(alphaA, alphaB, GetBlue() / 255.0, overlayColor.GetBlue() / 255.0); + + return Color::FromARGB(blendAlpha * 255, blendRed * 255, blendGreen * 255, blendBlue * 255); +} + +const Color Color::LineColorTransition(const Color& startColor, const Color& endColor, double percent) +{ + uint8_t red = 0; + uint8_t green = 0; + uint8_t blue = 0; + uint8_t alpha = 0; + + red = static_cast((endColor.GetRed()- startColor.GetRed()) * percent) + startColor.GetRed(); + green = static_cast((endColor.GetGreen() - startColor.GetGreen()) * percent) + startColor.GetGreen(); + blue = static_cast((endColor.GetBlue() - startColor.GetBlue()) * percent) + startColor.GetBlue(); + alpha = static_cast((endColor.GetAlpha() - startColor.GetAlpha()) * percent) + startColor.GetAlpha(); + + return Color::FromARGB(alpha, red, green, blue); +} + +Color Color::BlendOpacity(double opacityRatio) const +{ + int32_t alpha = static_cast(GetAlpha() * opacityRatio); + alpha = std::clamp(alpha, 0, UINT8_MAX); + return Color::FromARGB(alpha, GetRed(), GetGreen(), GetBlue()); +} + +Color Color::ChangeOpacity(double opacity) const +{ + return Color::FromRGBO(GetRed(), GetGreen(), GetBlue(), opacity); +} + +Color Color::ChangeAlpha(uint8_t alpha) const +{ + return Color::FromARGB(alpha, GetRed(), GetGreen(), GetBlue()); +} + +Color Color::operator+(const Color& color) const +{ + // convert first color from ARGB to linear + double firstLinearRed = 0.0; + double firstLinearGreen = 0.0; + double firstLinearBlue = 0.0; + ConvertGammaToLinear(*this, firstLinearRed, firstLinearGreen, firstLinearBlue); + + // convert second color from ARGB to linear + double secondLinearRed = 0.0; + double secondLinearGreen = 0.0; + double secondLinearBlue = 0.0; + ConvertGammaToLinear(color, secondLinearRed, secondLinearGreen, secondLinearBlue); + + // get linear result and convert to gamma + return ConvertLinearToGamma(GetAlpha() + color.GetAlpha(), firstLinearRed + secondLinearRed, + firstLinearGreen + secondLinearGreen, firstLinearBlue + secondLinearBlue); +} + +Color Color::operator-(const Color& color) const +{ + // convert first color from ARGB to linear + double firstLinearRed = 0.0; + double firstLinearGreen = 0.0; + double firstLinearBlue = 0.0; + ConvertGammaToLinear(*this, firstLinearRed, firstLinearGreen, firstLinearBlue); + + // convert second color from ARGB to linear + double secondLinearRed = 0.0; + double secondLinearGreen = 0.0; + double secondLinearBlue = 0.0; + ConvertGammaToLinear(color, secondLinearRed, secondLinearGreen, secondLinearBlue); + + // get linear result and convert to gamma + return ConvertLinearToGamma(GetAlpha() - color.GetAlpha(), firstLinearRed - secondLinearRed, + firstLinearGreen - secondLinearGreen, firstLinearBlue - secondLinearBlue); +} + +Color Color::operator*(double value) const +{ + // convert color from ARGB to linear + double linearRed = 0.0; + double linearGreen = 0.0; + double linearBlue = 0.0; + ConvertGammaToLinear(*this, linearRed, linearGreen, linearBlue); + + // get linear result and convert to gamma + return ConvertLinearToGamma(GetAlpha() * value, linearRed * value, linearGreen * value, linearBlue * value); +} + +Color Color::operator/(double value) const +{ + if (NearZero(value)) { + return *this; + } + // convert color from ARGB to linear + double linearRed = 0.0; + double linearGreen = 0.0; + double LinearBlue = 0.0; + ConvertGammaToLinear(*this, linearRed, linearGreen, LinearBlue); + + // get linear result and convert to gamma + return ConvertLinearToGamma(GetAlpha() / value, linearRed / value, linearGreen / value, LinearBlue / value); +} + +double Color::ConvertGammaToLinear(uint8_t value) +{ + return std::pow(value, GAMMA_FACTOR); +} + +uint8_t Color::ConvertLinearToGamma(double value) +{ + return std::clamp(static_cast(round(std::pow(value, 1.0 / GAMMA_FACTOR))), 0, UINT8_MAX); +} + +void Color::ConvertGammaToLinear(const Color& gammaColor, double& linearRed, double& linearGreen, double& linearBlue) +{ + linearRed = ConvertGammaToLinear(gammaColor.GetRed()); + linearGreen = ConvertGammaToLinear(gammaColor.GetGreen()); + linearBlue = ConvertGammaToLinear(gammaColor.GetBlue()); +} + +Color Color::ConvertLinearToGamma(double alpha, double linearRed, double linearGreen, double linearBlue) +{ + uint8_t gammaRed = ConvertLinearToGamma(linearRed); + uint8_t gammaGreen = ConvertLinearToGamma(linearGreen); + uint8_t gammaBlue = ConvertLinearToGamma(linearBlue); + uint8_t gammaAlpha = std::clamp(static_cast(round(alpha)), 0, UINT8_MAX); + + return FromARGB(gammaAlpha, gammaRed, gammaGreen, gammaBlue); +} + +bool Color::MatchColorWithMagic(std::string& colorStr, uint32_t maskAlpha, Color& color) +{ + std::smatch matches; + // Regex match for #909090 or #90909090. + if (std::regex_match(colorStr, matches, COLOR_WITH_MAGIC)) { + colorStr.erase(0, 1); + auto value = stoul(colorStr, nullptr, COLOR_STRING_BASE); + if (colorStr.length() < COLOR_STRING_SIZE_STANDARD) { + // no alpha specified, set alpha to 0xff + value |= maskAlpha; + } + color = Color(value); + return true; + } + + return false; +} + +bool Color::MatchColorWithMagicMini(std::string& colorStr, uint32_t maskAlpha, Color& color) +{ + std::smatch matches; + if (std::regex_match(colorStr, matches, COLOR_WITH_MAGIC_MINI)) { + colorStr.erase(0, 1); + std::string newColorStr; + // translate #rgb or #rgba to #rrggbb or #rrggbbaa + for (auto& c : colorStr) { + newColorStr += c; + newColorStr += c; + } + auto value = stoul(newColorStr, nullptr, COLOR_STRING_BASE); + if (newColorStr.length() < COLOR_STRING_SIZE_STANDARD) { + // no alpha specified, set alpha to 0xff + value |= maskAlpha; + } + color = Color(value); + return true; + } + + return false; +} + +bool Color::MatchColorWithRGB(const std::string& colorStr, Color& color) +{ + std::smatch matches; + if (std::regex_match(colorStr, matches, COLOR_WITH_RGB)) { + if (matches.size() == RGB_SUB_MATCH_SIZE) { + auto redInt = std::stoi(matches[1]); + auto greenInt = std::stoi(matches[2]); + auto blueInt = std::stoi(matches[3]); + if (!IsRGBValid(redInt) || !IsRGBValid(greenInt) || !IsRGBValid(blueInt)) { + return false; + } + + auto red = static_cast(redInt); + auto green = static_cast(greenInt); + auto blue = static_cast(blueInt); + color = FromRGB(red, green, blue); + return true; + } + } + return false; +} + +bool Color::MatchColorWithRGBA(const std::string& colorStr, Color& color) +{ + std::smatch matches; + if (std::regex_match(colorStr, matches, COLOR_WITH_RGBA)) { + if (matches.size() == RGBA_SUB_MATCH_SIZE) { + auto redInt = std::stoi(matches[1]); + auto greenInt = std::stoi(matches[2]); + auto blueInt = std::stoi(matches[3]); + auto opacityDouble = std::stod(matches[4]); + if (!IsRGBValid(redInt) || !IsRGBValid(greenInt) || !IsRGBValid(blueInt) || + !IsOpacityValid(opacityDouble)) { + return false; + } + + auto red = static_cast(redInt); + auto green = static_cast(greenInt); + auto blue = static_cast(blueInt); + auto opacity = static_cast(opacityDouble); + + color = FromRGBO(red, green, blue, opacity); + return true; + } + } + + return false; +} + +// bool Color::MatchColorSpecialString(const std::string& colorStr, Color& color) +// { +// static const LinearMapNode colorTable[] = { +// { "black", Color(0xff000000) }, +// { "blue", Color(0xff0000ff) }, +// { "gray", Color(0xffc0c0c0) }, +// { "green", Color(0xff00ff00) }, +// { "red", Color(0xffff0000) }, +// { "transparent", Color(0x00000000) }, +// { "white", Color(0xffffffff) }, +// }; +// +// int64_t colorIndex = BinarySearchFindIndex(colorTable, ArraySize(colorTable), colorStr.c_str()); +// if (colorIndex != -1) { +// color = colorTable[colorIndex].value; +// return true; +// } +// +// return false; +// } + +bool Color::ParseUintColorString(const std::string& colorStr, Color& color, const Color& defaultColor) +{ + auto uint32Color = StringUtils::StringToUintCheck(colorStr, defaultColor.GetValue()); + if (uint32Color > 0) { + if (uint32Color >> COLOR_ALPHA_OFFSET == 0) { + color = Color(uint32Color).ChangeAlpha(MAX_ALPHA); + } else { + color = Color(uint32Color); + } + return true; + } + + return false; +} + +bool Color::ParseUintColorString(const std::string& colorStr, Color& color) +{ + auto uint32Color = StringUtils::StringToUint(colorStr); + if (uint32Color > 0) { + if (uint32Color >> COLOR_ALPHA_OFFSET == 0) { + color = Color(uint32Color).ChangeAlpha(MAX_ALPHA); + } else { + color = Color(uint32Color); + } + return true; + } + + return false; +} + +bool Color::IsRGBValid(int value) +{ + return value >= MIN_RGB_VALUE && value <= MAX_RGB_VALUE; +} + +bool Color::IsOpacityValid(double value) +{ + return value >= MIN_RGBA_OPACITY && value <= MAX_RGBA_OPACITY; +} + +} // namespace svg +} // namespace rnoh \ No newline at end of file diff --git a/tester/harmony/svg/src/main/cpp/properties/Color.h b/tester/harmony/svg/src/main/cpp/properties/Color.h new file mode 100644 index 0000000000000000000000000000000000000000..87a97ee0217bccaa89e6aa38bbb0d2868a419d4f --- /dev/null +++ b/tester/harmony/svg/src/main/cpp/properties/Color.h @@ -0,0 +1,123 @@ +// from ArkUI "frameworks/core/components/common/properties/color.h" + +#pragma once +#include +#include +namespace rnoh { +namespace svg { + +constexpr uint32_t COLOR_ALPHA_MASK = 0xff000000; + +union ColorParam { +#if BIG_ENDIANNESS + struct { + uint8_t alpha; + uint8_t red; + uint8_t green; + uint8_t blue; + } argb; +#else + struct { + uint8_t blue; + uint8_t green; + uint8_t red; + uint8_t alpha; + } argb; +#endif + uint32_t value; +}; + +enum class ForegroundColorStrategy : char { + NONE, + INVERT, +}; + +class Color { +public: + Color() = default; + constexpr explicit Color(uint32_t value) : colorValue_(ColorParam{.value = value}) {} + ~Color() = default; + + static Color FromARGB(uint8_t alpha, uint8_t red, uint8_t green, uint8_t blue); + static Color FromRGBO(uint8_t red, uint8_t green, uint8_t blue, double opacity); + static Color FromRGB(uint8_t red, uint8_t green, uint8_t blue); + // Need to change the input parameters, it is more appropriate to use the passed value here. + static Color FromString(std::string colorStr, uint32_t maskAlpha = COLOR_ALPHA_MASK, + Color defaultColor = Color::BLACK); + // Return the linear transition color from startColor to endColor. + static const Color LineColorTransition(const Color &startColor, const Color &endColor, double percent); + + static const Color TRANSPARENT; + static const Color WHITE; + static const Color BLACK; + static const Color RED; + static const Color GREEN; + static const Color BLUE; + static const Color GRAY; + static const Color FOREGROUND; + + Color BlendColor(const Color &overlayColor) const; + + Color BlendColorWithAlpha(const Color &overlayColor) const; + Color BlendOpacity(double opacityRatio) const; + Color ChangeOpacity(double opacity) const; + Color ChangeAlpha(uint8_t alpha) const; + + void SetValue(uint32_t value) { colorValue_.value = value; } + + uint32_t GetValue() const { return colorValue_.value; } + + uint8_t GetAlpha() const { return colorValue_.argb.alpha; } + + uint8_t GetRed() const { return colorValue_.argb.red; } + + uint8_t GetGreen() const { return colorValue_.argb.green; } + + uint8_t GetBlue() const { return colorValue_.argb.blue; } + + bool operator==(const Color &color) const { return colorValue_.value == color.GetValue(); } + + bool operator!=(const Color &color) const { return !operator==(color); } + + Color operator+(const Color &color) const; + + Color operator-(const Color &color) const; + + Color operator*(double value) const; + + Color operator/(double value) const; + + std::string ToString() const { + return "[ARGB](" + std::to_string(colorValue_.argb.alpha) + ", " + std::to_string(colorValue_.argb.red) + ", " + + std::to_string(colorValue_.argb.green) + ", " + std::to_string(colorValue_.argb.blue) + ")"; + } + + void SetUseCurrentColor(const bool& useCurrentColor) { UseCurrentColor = useCurrentColor; } + + bool IsUseCurrentColor() const { return UseCurrentColor; } + +private: + constexpr explicit Color(ColorParam colorValue) : colorValue_(colorValue) {} + + static double ConvertGammaToLinear(uint8_t value); + static void ConvertGammaToLinear(const Color &gammaColor, double &linearRed, double &linearGreen, + double &linearBlue); + static uint8_t ConvertLinearToGamma(double value); + static Color ConvertLinearToGamma(double alpha, double linearRed, double linearGreen, double linearBlue); + static bool MatchColorWithMagic(std::string &colorStr, uint32_t maskAlpha, Color &color); + static bool MatchColorWithMagicMini(std::string &colorStr, uint32_t maskAlpha, Color &color); + static bool MatchColorWithRGB(const std::string &colorStr, Color &color); + static bool MatchColorWithRGBA(const std::string &colorStr, Color &color); + static bool MatchColorSpecialString(const std::string &colorStr, Color &color); + static bool ParseUintColorString(const std::string &colorStr, Color &color); + static bool ParseUintColorString(const std::string &colorStr, Color &color, const Color &defaultColor); + static bool IsRGBValid(int value); + static bool IsOpacityValid(double value); + + float CalculateBlend(float alphaLeft, float alphaRight, float valueLeft, float valueRight) const; + ColorParam colorValue_{.value = 0xff000000}; + bool UseCurrentColor{false}; +}; + +} // namespace svg +} // namespace rnoh \ No newline at end of file diff --git a/tester/harmony/svg/src/main/cpp/properties/Decoration.cpp b/tester/harmony/svg/src/main/cpp/properties/Decoration.cpp new file mode 100755 index 0000000000000000000000000000000000000000..ed1afbd5cfb8848298e62341f16e5b0d9cabcb46 --- /dev/null +++ b/tester/harmony/svg/src/main/cpp/properties/Decoration.cpp @@ -0,0 +1,555 @@ +// from ArkUI "frameworks/core/components/common/properties/decoration.cpp" +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +#pragma once +#include "Decoration.h" + +namespace rnoh { +namespace svg { + +// void Decoration::SetContextAndCallback( +// const WeakPtr& context, const RenderNodeAnimationCallback& callback) +// { +// backgroundColor_.SetContextAndCallback(context, callback); +// border_.SetContextAndCallback(context, callback); +// blurRadius_.SetContextAndCallback(context, callback); +// } + +// void Decoration::AddShadow(const Shadow& shadow) +// { +// shadows_.push_back(shadow); +// } + +// void Decoration::ClearAllShadow() +// { +// shadows_.clear(); +// } +// +// Size Decoration::GetOccupiedSize(double dipScale) const +// { +// return border_.GetLayoutSize(dipScale) + padding_.GetLayoutSizeInPx(dipScale); +// } +// +// Offset Decoration::GetOffset(double dipScale) const +// { +// return border_.GetOffset(dipScale) + padding_.GetOffsetInPx(dipScale); +// } +// +// double Decoration::VerticalSpaceOccupied(double dipScale) const +// { +// return border_.VerticalWidth(dipScale) + padding_.VerticalInPx(dipScale); +// } +// +// double Decoration::HorizontalSpaceOccupied(double dipScale) const +// { +// return border_.HorizontalWidth(dipScale) + padding_.HorizontalInPx(dipScale); +// } + +void Gradient::AddColor(const GradientColor& color) +{ + colors_.push_back(color); +} + +void Gradient::ClearColors() +{ + colors_.clear(); +} + +// void BackgroundImageSize::SetSizeTypeX(BackgroundImageSizeType type) +// { +// typeX_ = type; +// } +// +// void BackgroundImageSize::SetSizeTypeY(BackgroundImageSizeType type) +// { +// if (type == BackgroundImageSizeType::CONTAIN || type == BackgroundImageSizeType::COVER) { +// return; +// } +// typeY_ = type; +// } +// +// void BackgroundImageSize::SetSizeValueX(double value) +// { +// if (value < -0.0) { +// return; +// } +// valueX_ = value; +// } +// +// void BackgroundImageSize::SetSizeValueY(double value) +// { +// if (value < -0.0) { +// return; +// } +// valueY_ = value; +// } +// +// bool BackgroundImageSize::IsValid() const +// { +// if (typeY_ == BackgroundImageSizeType::CONTAIN || typeY_ == BackgroundImageSizeType::COVER) { +// return false; +// } +// +// if ((typeX_ == BackgroundImageSizeType::LENGTH || typeX_ == BackgroundImageSizeType::PERCENT) && +// LessOrEqual(valueX_, 0.0)) { +// return false; +// } +// +// if ((typeY_ == BackgroundImageSizeType::LENGTH || typeY_ == BackgroundImageSizeType::PERCENT) && +// LessOrEqual(valueY_, 0.0)) { +// return false; +// } +// +// return true; +// } +// +// BackgroundImageSizeType BackgroundImageSize::GetSizeTypeX() const +// { +// return typeX_; +// } +// +// BackgroundImageSizeType BackgroundImageSize::GetSizeTypeY() const +// { +// return typeY_; +// } +// +// double BackgroundImageSize::GetSizeValueX() const +// { +// return valueX_; +// } +// +// double BackgroundImageSize::GetSizeValueY() const +// { +// return valueY_; +// } +// +// BackgroundImageSize BackgroundImageSize::operator+(const BackgroundImageSize& rhs) const +// { +// if ((rhs.GetSizeTypeX() != GetSizeTypeX()) || (rhs.GetSizeTypeY() != GetSizeTypeY())) { +// // error: unit not same, just return lhs value +// return *this; +// } +// auto rhsX = rhs.GetSizeValueX(); +// auto rhsY = rhs.GetSizeValueY(); +// auto lhsX = GetSizeValueX(); +// auto lhsY = GetSizeValueY(); +// BackgroundImageSize size; +// size.SetSizeValueX(rhsX + lhsX); +// size.SetSizeTypeX(GetSizeTypeX()); +// size.SetSizeValueY(rhsY + lhsY); +// size.SetSizeTypeY(GetSizeTypeY()); +// return size; +// } +// +// BackgroundImageSize BackgroundImageSize::operator-(const BackgroundImageSize& rhs) const +// { +// auto rhsX = rhs.GetSizeValueX(); +// auto rhsY = rhs.GetSizeValueY(); +// auto lhsX = GetSizeValueX(); +// auto lhsY = GetSizeValueY(); +// if ((rhs.GetSizeTypeX() != GetSizeTypeX()) || (rhs.GetSizeTypeY() != GetSizeTypeY())) { +// // error: unit not same, just return lhs value +// return *this; +// } +// BackgroundImageSize size; +// size.SetSizeValueX(lhsX - rhsX); +// size.SetSizeTypeX(GetSizeTypeX()); +// size.SetSizeValueY(lhsY - rhsY); +// size.SetSizeTypeY(GetSizeTypeY()); +// return size; +// } +// +// BackgroundImageSize BackgroundImageSize::operator*(double value) const +// { +// BackgroundImageSize size; +// size.SetSizeValueX(GetSizeValueX() * value); +// size.SetSizeTypeX(GetSizeTypeX()); +// size.SetSizeValueY(GetSizeValueY() * value); +// size.SetSizeTypeY(GetSizeTypeY()); +// return size; +// } +// +// bool BackgroundImageSize::operator==(const BackgroundImageSize& size) const +// { +// return typeX_ == size.GetSizeTypeX() && NearEqual(valueX_, size.GetSizeValueX()) && typeY_ == size.GetSizeTypeY() && +// NearEqual(valueY_, size.GetSizeValueY()); +// } +// +// bool BackgroundImageSize::operator!=(const BackgroundImageSize& size) const +// { +// return !operator==(size); +// } +// +// std::string BackgroundImageSize::ToString() const +// { +// auto widthType = GetSizeTypeX(); +// if (widthType == BackgroundImageSizeType::CONTAIN) { +// return "ImageSize.Contain"; +// } +// if (widthType == BackgroundImageSizeType::COVER) { +// return "ImageSize.Cover"; +// } +// if (widthType == BackgroundImageSizeType::AUTO) { +// return "ImageSize.Auto"; +// } +// auto jsonValue = JsonUtil::Create(true); +// Dimension width = Dimension((GetSizeValueX()), DimensionUnit::PX); +// Dimension height = Dimension((GetSizeValueY()), DimensionUnit::PX); +// jsonValue->Put("width", width.ToString().c_str()); +// jsonValue->Put("height", height.ToString().c_str()); +// return jsonValue->ToString(); +// } +// +// BackgroundImagePosition BackgroundImagePosition::operator+(const BackgroundImagePosition& rhs) const +// { +// auto rhsX = rhs.GetSizeValueX(); +// auto rhsY = rhs.GetSizeValueY(); +// auto lhsX = GetSizeValueX(); +// auto lhsY = GetSizeValueY(); +// if ((rhs.GetSizeTypeX() != GetSizeTypeX()) || (rhs.GetSizeTypeY() != GetSizeTypeY())) { +// // error: unit not same, just return lhs value +// return *this; +// } +// BackgroundImagePosition position; +// position.SetSizeValueX(lhsX + rhsX); +// position.SetSizeTypeX(GetSizeTypeX()); +// position.SetSizeValueY(lhsY + rhsY); +// position.SetSizeTypeY(GetSizeTypeY()); +// return position; +// } +// +// BackgroundImagePosition BackgroundImagePosition::operator-(const BackgroundImagePosition& rhs) const +// { +// auto rhsX = rhs.GetSizeValueX(); +// auto rhsY = rhs.GetSizeValueY(); +// auto lhsX = GetSizeValueX(); +// auto lhsY = GetSizeValueY(); +// if ((rhs.GetSizeTypeX() != GetSizeTypeX()) || (rhs.GetSizeTypeY() != GetSizeTypeY())) { +// // error: unit not same, just return lhs value +// return *this; +// } +// BackgroundImagePosition position; +// position.SetSizeValueX(lhsX - rhsX); +// position.SetSizeTypeX(GetSizeTypeX()); +// position.SetSizeValueY(lhsY - rhsY); +// position.SetSizeTypeY(GetSizeTypeY()); +// return position; +// } +// +// BackgroundImagePosition BackgroundImagePosition::operator*(double value) const +// { +// BackgroundImagePosition position; +// position.SetSizeValueX(GetSizeValueX() * value); +// position.SetSizeTypeX(GetSizeTypeX()); +// position.SetSizeValueY(GetSizeValueY() * value); +// position.SetSizeTypeY(GetSizeTypeY()); +// return position; +// } +// +// bool BackgroundImagePosition::operator==(const BackgroundImagePosition& backgroundImagePosition) const +// { +// bool isXAxisEqual = (GetSizeX() == backgroundImagePosition.GetSizeX()) && +// GetSizeTypeX() == backgroundImagePosition.GetSizeTypeX(); +// bool isYAxisEqual = (GetSizeY() == backgroundImagePosition.GetSizeY()) && +// GetSizeTypeY() == backgroundImagePosition.GetSizeTypeY(); +// return isXAxisEqual && isYAxisEqual; +// } +// +// bool BackgroundImagePosition::operator!=(const BackgroundImagePosition& backgroundImagePosition) const +// { +// return !operator==(backgroundImagePosition); +// } +// +// static std::string GetAlignmentType(double width, double height) +// { +// const double halfDimension = 50.0; +// auto jsonValue = JsonUtil::Create(true); +// if (NearZero(width)) { +// if (NearZero(height)) { +// return "Alignment.TopStart"; +// } +// if (NearEqual(height, halfDimension)) { // Determine whether the vertical element is centered +// return "Alignment.Start"; +// } +// return "Alignment.BottomStart"; +// } else if (NearEqual(width, halfDimension)) { // Judge whether the horizontal element is centered +// if (NearZero(height)) { +// return "Alignment.Top"; +// } +// if (NearEqual(height, halfDimension)) { +// return "Alignment.Center"; +// } +// return "Alignment.Bottom"; +// } else { +// if (NearZero(height)) { +// return "Alignment.TopEnd"; +// } +// if (NearEqual(height, halfDimension)) { +// return "Alignment.End"; +// } +// return "Alignment.BottomEnd"; +// } +// } +// +// std::string BackgroundImagePosition::ToString() const +// { +// if (GetSizeTypeX() == BackgroundImagePositionType::PX) { +// auto width = GetSizeValueX(); +// auto height = GetSizeValueY(); +// auto jsonValue = JsonUtil::Create(true); +// jsonValue->Put("x", width); +// jsonValue->Put("y", height); +// return jsonValue->ToString(); +// } +// auto width = GetSizeValueX(); +// auto height = GetSizeValueY(); +// return GetAlignmentType(width, height); +// } +// +// CanvasPath2D::CanvasPath2D(const std::string& cmds) +// { +// PathArgs args; +// args.cmds = cmds; +// caches_.emplace_back(PathCmd::CMDS, args); +// } +// +// CanvasPath2D::CanvasPath2D(const RefPtr& path) +// { +// if (path != nullptr) { +// auto caches = path->GetCaches(); +// caches_.swap(caches); +// } +// } +// +// void CanvasPath2D::AddPath(const RefPtr& path) +// { +// if (path != nullptr) { +// auto caches = path->GetCaches(); +// caches_.insert(caches_.end(), caches.begin(), caches.end()); +// } +// } +// +// void CanvasPath2D::SetTransform(double a, double b, double c, double d, double e, double f) +// { +// PathArgs args; +// args.para1 = a; +// args.para2 = b; +// args.para3 = c; +// args.para4 = d; +// args.para5 = e; +// args.para6 = f; +// caches_.emplace_back(PathCmd::TRANSFORM, args); +// } +// +// void CanvasPath2D::MoveTo(double x, double y) +// { +// PathArgs args; +// args.para1 = x; +// args.para2 = y; +// caches_.emplace_back(PathCmd::MOVE_TO, args); +// } +// +// void CanvasPath2D::LineTo(double x, double y) +// { +// PathArgs args; +// args.para1 = x; +// args.para2 = y; +// caches_.emplace_back(PathCmd::LINE_TO, args); +// } +// +// void CanvasPath2D::Arc(double x, double y, double radius, double startAngle, double endAngle, double ccw) +// { +// PathArgs args; +// args.para1 = x; +// args.para2 = y; +// args.para3 = radius; +// args.para4 = startAngle; +// args.para5 = endAngle; +// args.para6 = ccw; +// caches_.emplace_back(PathCmd::ARC, args); +// } +// +// void CanvasPath2D::ArcTo(double x1, double y1, double x2, double y2, double radius) +// { +// PathArgs args; +// args.para1 = x1; +// args.para2 = y1; +// args.para3 = x2; +// args.para4 = y2; +// args.para5 = radius; +// caches_.emplace_back(PathCmd::ARC_TO, args); +// } +// +// void CanvasPath2D::QuadraticCurveTo(double cpx, double cpy, double x, double y) +// { +// PathArgs args; +// args.para1 = cpx; +// args.para2 = cpy; +// args.para3 = x; +// args.para4 = y; +// caches_.emplace_back(PathCmd::QUADRATIC_CURVE_TO, args); +// } +// +// void CanvasPath2D::BezierCurveTo(double cp1x, double cp1y, double cp2x, double cp2y, double x, double y) +// { +// PathArgs args; +// args.para1 = cp1x; +// args.para2 = cp1y; +// args.para3 = cp2x; +// args.para4 = cp2y; +// args.para5 = x; +// args.para6 = y; +// caches_.emplace_back(PathCmd::BEZIER_CURVE_TO, args); +// } +// +// void CanvasPath2D::Ellipse( +// double x, double y, double radiusX, double radiusY, double rotation, double startAngle, double endAngle, double ccw) +// { +// PathArgs args; +// args.para1 = x; +// args.para2 = y; +// args.para3 = radiusX; +// args.para4 = radiusY; +// args.para5 = rotation; +// args.para6 = startAngle; +// args.para7 = endAngle; +// args.para8 = ccw; +// caches_.emplace_back(PathCmd::ELLIPSE, args); +// } +// +// void CanvasPath2D::Rect(double x, double y, double width, double height) +// { +// PathArgs args; +// args.para1 = x; +// args.para2 = y; +// args.para3 = width; +// args.para4 = height; +// caches_.emplace_back(PathCmd::RECT, args); +// } +// +// void CanvasPath2D::ClosePath() +// { +// PathArgs args; +// caches_.emplace_back(PathCmd::CLOSE_PATH, args); +// } +// +// const std::vector>& CanvasPath2D::GetCaches() const +// { +// return caches_; +// } +// +// std::string CanvasPath2D::ToString() const +// { +// std::string str; +// for (const auto& cache : caches_) { +// switch (cache.first) { +// case PathCmd::CMDS: { +// str.append("CMDS:"); +// str.append(cache.second.cmds).append(" "); +// break; +// } +// case PathCmd::TRANSFORM: { +// str.append("TRANSFORM:"); +// str.append(std::to_string(cache.second.para1)).append(","); +// str.append(std::to_string(cache.second.para2)).append(","); +// str.append(std::to_string(cache.second.para3)).append(","); +// str.append(std::to_string(cache.second.para4)).append(","); +// str.append(std::to_string(cache.second.para5)).append(","); +// str.append(std::to_string(cache.second.para6)).append(" "); +// break; +// } +// case PathCmd::MOVE_TO: { +// str.append("MOVE_TO:"); +// str.append(std::to_string(cache.second.para1)).append(","); +// str.append(std::to_string(cache.second.para2)).append(" "); +// break; +// } +// case PathCmd::LINE_TO: { +// str.append("LINE_TO:"); +// str.append(std::to_string(cache.second.para1)).append(","); +// str.append(std::to_string(cache.second.para2)).append(" "); +// break; +// } +// case PathCmd::ARC: { +// str.append("ARC:"); +// str.append(std::to_string(cache.second.para1)).append(","); +// str.append(std::to_string(cache.second.para2)).append(","); +// str.append(std::to_string(cache.second.para3)).append(","); +// str.append(std::to_string(cache.second.para4)).append(","); +// str.append(std::to_string(cache.second.para5)).append(","); +// str.append(std::to_string(cache.second.para6)).append(" "); +// break; +// } +// case PathCmd::ARC_TO: { +// str.append("ARC_TO:"); +// str.append(std::to_string(cache.second.para1)).append(","); +// str.append(std::to_string(cache.second.para2)).append(","); +// str.append(std::to_string(cache.second.para3)).append(","); +// str.append(std::to_string(cache.second.para4)).append(","); +// str.append(std::to_string(cache.second.para5)).append(" "); +// break; +// } +// case PathCmd::QUADRATIC_CURVE_TO: { +// str.append("QUADRATIC_CURVE_TO:"); +// str.append(std::to_string(cache.second.para1)).append(","); +// str.append(std::to_string(cache.second.para2)).append(","); +// str.append(std::to_string(cache.second.para3)).append(","); +// str.append(std::to_string(cache.second.para4)).append(" "); +// break; +// } +// case PathCmd::BEZIER_CURVE_TO: { +// str.append("BEZIER_CURVE_TO:"); +// str.append(std::to_string(cache.second.para1)).append(","); +// str.append(std::to_string(cache.second.para2)).append(","); +// str.append(std::to_string(cache.second.para3)).append(","); +// str.append(std::to_string(cache.second.para4)).append(","); +// str.append(std::to_string(cache.second.para5)).append(","); +// str.append(std::to_string(cache.second.para6)).append(" "); +// break; +// } +// case PathCmd::ELLIPSE: { +// str.append("ELLIPSE:"); +// str.append(std::to_string(cache.second.para1)).append(","); +// str.append(std::to_string(cache.second.para2)).append(","); +// str.append(std::to_string(cache.second.para3)).append(","); +// str.append(std::to_string(cache.second.para4)).append(","); +// str.append(std::to_string(cache.second.para5)).append(","); +// str.append(std::to_string(cache.second.para6)).append(","); +// str.append(std::to_string(cache.second.para7)).append(","); +// str.append(std::to_string(cache.second.para8)).append(" "); +// break; +// } +// case PathCmd::RECT: { +// str.append("RECT:"); +// str.append(std::to_string(cache.second.para1)).append(","); +// str.append(std::to_string(cache.second.para2)).append(","); +// str.append(std::to_string(cache.second.para3)).append(","); +// str.append(std::to_string(cache.second.para4)).append(" "); +// break; +// } +// case PathCmd::CLOSE_PATH: { +// str.append("CLOSE_PATH").append(" "); +// break; +// } +// default: { +// break; +// } +// } +// } +// return str; +// } + +} // namespace svg +} // namespace rnoh diff --git a/tester/harmony/svg/src/main/cpp/properties/Decoration.h b/tester/harmony/svg/src/main/cpp/properties/Decoration.h new file mode 100755 index 0000000000000000000000000000000000000000..e72b9f1b84b7658bcc3b9ddfe1fcb418d6347c0c --- /dev/null +++ b/tester/harmony/svg/src/main/cpp/properties/Decoration.h @@ -0,0 +1,482 @@ +// from ArkUI "frameworks/core/components/common/properties/decoration.h" +/* + * Copyright (c) 2021-2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once +#include "Rect.h" +#include +#ifndef FOUNDATION_ACE_FRAMEWORKS_CORE_COMPONENTS_BASE_PROPERTIES_DECORATION_H +#define FOUNDATION_ACE_FRAMEWORKS_CORE_COMPONENTS_BASE_PROPERTIES_DECORATION_H + +#include +#include +#include +#include +#include +#include "properties/Color.h" +#include "properties/Dimension.h" +#include "properties/Offset.h" + +namespace rnoh { +namespace svg { + +constexpr double CENTER_OFFSET = 50.0; +constexpr double FULL_IMG_SIZE = 100.0; +constexpr double BOX_BEGIN_SIZE = 0.0; +constexpr double BOX_END_SIZE = 100.0; +constexpr double PERCENT_TRANSLATE = 100.0; + +enum class GradientDirection { + LEFT = 0, + TOP, + RIGHT, + BOTTOM, + LEFT_TOP, + LEFT_BOTTOM, + RIGHT_TOP, + RIGHT_BOTTOM, + NONE, + START_TO_END, + END_TO_START, +}; + +enum class GradientType { + LINEAR, + RADIAL, + SWEEP, + CONIC, +}; + +enum class RadialSizeType { + CLOSEST_SIDE, + CLOSEST_CORNER, + FARTHEST_SIDE, + FARTHEST_CORNER, + NONE, +}; + +enum class RadialShapeType { + CIRCLE, + ELLIPSE, + NONE, +}; + +enum class SpreadMethod { + PAD, + REFLECT, + REPEAT, +}; + +enum class BlurStyle { + NO_MATERIAL = 0, + THIN, + REGULAR, + THICK, + BACKGROUND_THIN, + BACKGROUND_REGULAR, + BACKGROUND_THICK, + BACKGROUND_ULTRA_THICK, + COMPONENT_ULTRA_THIN, + COMPONENT_THIN, + COMPONENT_REGULAR, + COMPONENT_THICK, + COMPONENT_ULTRA_THICK, +}; + +enum class ThemeColorMode { + SYSTEM = 0, + LIGHT, + DARK, +}; + +enum class AdaptiveColor { + DEFAULT = 0, + AVERAGE, +}; + +struct BlurOption { + std::vector grayscale; +}; + + +struct LinearGradientInfo { + double x1 = 0.0; + double x2 = 0.0; + double y1 = 0.0; + double y2 = 0.0; +}; + +struct RadialGradientInfo { + double rx = 0.0; + double ry = 0.0; + double cx = 0.0; + double cy = 0.0; + double fx = 0.0; + double fy = 0.0; +}; + +// indicates which coordinate system to use +enum class Unit { + objectBoundingBox = 0, // use current node's boundary box + userSpaceOnUse = 1, // use rootViewBox +}; + +inline Unit ToUnit(int value) { + auto unit = static_cast(value); + if (unit < Unit::objectBoundingBox || unit > Unit::userSpaceOnUse) { + unit = Unit::objectBoundingBox; + } + return unit; +} + +class GradientColor final { +public: + GradientColor() = default; + ~GradientColor() = default; + + explicit GradientColor(const Color &color) { color_ = color; } + + void SetDimension(double value, DimensionUnit unit = DimensionUnit::PERCENT) { + if (value < 0.0) { + return; + } + if (unit == DimensionUnit::PERCENT && value > BOX_END_SIZE) { + return; + } + dimension_ = Dimension(value, unit); + } + + void SetDimension(const Dimension &dimension) { + if (dimension.Value() < 0.0) { + return; + } + if (dimension.Unit() == DimensionUnit::PERCENT && dimension.Value() > BOX_END_SIZE) { + return; + } + dimension_ = dimension; + } + + void SetHasValue(bool hasValue) { hasValue_ = hasValue; } + + void SetColor(const Color &color) { color_ = color; } + + const Color &GetColor() const { return color_; } + + const Dimension &GetDimension() const { return dimension_; } + + bool GetHasValue() const { return hasValue_; } + + void SetOpacity(double opacity) { opacity_ = opacity; } + + double GetOpacity() const { return opacity_; } + +private: + bool hasValue_ = true; + Color color_{Color::TRANSPARENT}; + Dimension dimension_{BOX_END_SIZE, DimensionUnit::PERCENT}; + double opacity_ = 1.0; +}; + +struct SweepGradient { + // center of x-axis + std::optional centerX; + // center of y-axis + std::optional centerY; + // startAngle in degree + std::optional startAngle; + // endAngle in degree + std::optional endAngle; + // rotation in degree + std::optional rotation; +}; + +struct ConicGradient { + // center of x-axis + std::optional centerX; + // center of y-axis + std::optional centerY; + // startAngle in radian + std::optional startAngle; +}; + +struct RadialGradient { + // size type + std::optional radialSizeType; + // shape circle or ellipse + std::optional radialShape; + // size in x-axis + std::optional radialHorizontalSize; + // size in y-axis + std::optional radialVerticalSize; + // center of shape + std::optional radialCenterX; + std::optional radialCenterY; + + std::optional fRadialCenterX; + std::optional fRadialCenterY; +}; + +struct LinearGradient { + // direction in x-axis + std::optional linearX; + // direction in y-axis + std::optional linearY; + // angle of gradient line in bearing angle + std::optional angle; + + std::optional x1; + std::optional y1; + std::optional x2; + std::optional y2; + + // is direction in x-axis + static bool IsXAxis(GradientDirection direction) { + return (direction == GradientDirection::LEFT || direction == GradientDirection::RIGHT || + direction == GradientDirection::START_TO_END || direction == GradientDirection::END_TO_START); + } +}; + +class Gradient final { +public: + void AddColor(const GradientColor &color); + + void ClearColors(); + + bool IsSweepGradientValid() const { + if (sweepGradient_.startAngle.has_value() && sweepGradient_.endAngle.has_value()) { + return LessOrEqual(sweepGradient_.startAngle.value().Value(), sweepGradient_.endAngle.value().Value()); + } + if (sweepGradient_.startAngle.has_value() && !sweepGradient_.endAngle.has_value()) { + return LessOrEqual(sweepGradient_.startAngle.value().Value(), 0.0); + } + if (!sweepGradient_.startAngle.has_value() && sweepGradient_.endAngle.has_value()) { + return LessOrEqual(0.0, sweepGradient_.endAngle.value().Value()); + } + return true; + } + + bool IsValid() const { + if (GetType() == GradientType::SWEEP) { + return IsSweepGradientValid() && colors_.size() > 1; + } + return colors_.size() > 1; + } + + void SetRepeat(bool repeat) { repeat_ = repeat; } + + bool GetRepeat() const { return repeat_; } + + const std::vector &GetColors() const { return colors_; } + + const Offset &GetBeginOffset() const { return beginOffset_; } + + void SetBeginOffset(const Offset &beginOffset) { beginOffset_ = beginOffset; } + + const Offset &GetEndOffset() const { return endOffset_; } + + void SetEndOffset(const Offset &endOffset) { endOffset_ = endOffset; } + + double GetInnerRadius() const { return innerRadius_; } + + void SetInnerRadius(double innerRadius) { innerRadius_ = innerRadius; } + + double GetOuterRadius() const { return outerRadius_; } + + void SetOuterRadius(double outerRadius) { outerRadius_ = outerRadius; } + + GradientType GetType() const { return type_; } + + void SetType(GradientType type) { type_ = type; } + + std::string ToString() const { + return std::string("Gradient (") + .append(beginOffset_.ToString()) + .append(",") + .append(std::to_string(innerRadius_)) + .append(" --- ") + .append(endOffset_.ToString()) + .append(",") + .append(std::to_string(outerRadius_)) + .append(")"); + } + + SweepGradient &GetSweepGradient() { return sweepGradient_; } + + const SweepGradient &GetSweepGradient() const { return sweepGradient_; } + + void SetSweepGradient(const SweepGradient &sweepGradient) { sweepGradient_ = sweepGradient; } + + ConicGradient &GetConicGradient() { return conicGradient_; } + + const ConicGradient &GetConicGradient() const { return conicGradient_; } + + void SetConicGradient(const ConicGradient &conicGradient) { conicGradient_ = conicGradient; } + + RadialGradient &GetRadialGradient() { return radialGradient_; } + + const RadialGradient &GetRadialGradient() const { return radialGradient_; } + + void SetRadialGradient(const RadialGradient &radialGradient) { radialGradient_ = radialGradient; } + + LinearGradient &GetLinearGradient() { return linearGradient_; } + + const LinearGradient &GetLinearGradient() const { return linearGradient_; } + + void SetLinearGradient(const LinearGradient &linearGradient) { linearGradient_ = linearGradient; } + + void SetDirection(const GradientDirection &direction) { + if (LinearGradient::IsXAxis(direction)) { + linearGradient_.linearX = direction; + } else { + linearGradient_.linearY = direction; + } + } + + void SetSpreadMethod(SpreadMethod spreadMethod) { spreadMethod_ = spreadMethod; } + + void SetGradientTransform(const std::vector &gradientTransform) { + gradientTransform_ = gradientTransform; + } + + SpreadMethod GetSpreadMethod() const { return spreadMethod_; } + + const std::vector &GetGradientTransform() const { return gradientTransform_; } + + const RadialGradientInfo &GetRadialGradientInfo() const { return radialGradientInfo_; } + + void SetRadialGradientInfo(const RadialGradientInfo &radialGradientInfo) { + radialGradientInfo_ = radialGradientInfo; + } + + const LinearGradientInfo &GetLinearGradientInfo() const { return linearGradientInfo_; } + + void SetLinearGradientInfo(const LinearGradientInfo &linearGradientInfo) { + linearGradientInfo_ = linearGradientInfo; + } + + Unit GetGradientUnits() const { return gradientUnits_; } + + void SetGradientUnits(Unit gradientUnits) { gradientUnits_ = gradientUnits; } + +private: + GradientType type_ = GradientType::LINEAR; + bool repeat_ = false; + std::vector colors_; + // for RadialGradient + RadialGradient radialGradient_; + // for LinearGradient + LinearGradient linearGradient_; + // for SweepGradient + SweepGradient sweepGradient_; + // for ConicGradient + ConicGradient conicGradient_; + // used for CanvasLinearGradient + Offset beginOffset_; + Offset endOffset_; + // used for CanvasRadialGradient + double innerRadius_ = 0.0; + double outerRadius_ = 0.0; + SpreadMethod spreadMethod_ = SpreadMethod::PAD; + Unit gradientUnits_ = Unit::objectBoundingBox; + std::vector gradientTransform_; + LinearGradientInfo linearGradientInfo_; + RadialGradientInfo radialGradientInfo_; +}; + + +class PatternAttr final { +public: + void setPatternX(Dimension x) { x_ = x; } + + Dimension getX() { return x_; } + + void setPatternY(Dimension y) { y_ = y; } + + Dimension getY() { return y_; } + + void setHeight(Dimension height) { height_ = height; } + + Dimension getHeight() { return height_; } + + void setWidth(Dimension width) { width_ = width; } + + Dimension getWidth() { return width_; } + + void setPatternUnits(int patternUnits) { patternUnits_ = Unit(patternUnits); } + + void setPatternContentUnits(int patternContentUnits) { patternContentUnits_ = Unit(patternContentUnits); } + + void setViewBox(Rect viewBox) { viewBox_ = viewBox; } + + void setImage(OH_Drawing_Image* image) { image_ = image; } + + Unit getPatternUnits() { return patternUnits_; } + + Unit getPatternContentUnits() { return patternContentUnits_; } + + Rect getViewBox() { return viewBox_; } + + OH_Drawing_Image* getImage() { return image_ ; } + + void setmMinX(float mMinX) { mMinX_ = mMinX; } + + float getmMinX() { return mMinX_; } + + void setmMinY(float mMinY) { mMinY_ = mMinY; } + + float getmMinY() { return mMinY_; } + + void setmVbWidth(float mVbWidth) { mVbWidth_ = mVbWidth; } + + float getmVbWidth() { return mVbWidth_; } + + void setmVbHeight(float mVbHeight) { mVbHeight_ = mVbHeight; } + + float getmVbHeight() { return mVbHeight_; } + + void setmAlign(std::string mAlign) { mAlign_ = mAlign; } + + std::string getmAlign() { return mAlign_; } + + void setmMeetOrSlice(int mMeetOrSlice) { mMeetOrSlice_ = mMeetOrSlice; } + + int getmMeetOrSlice() { return mMeetOrSlice_; } + + void setPatternTransform(const std::vector &patternTransform) { + patternTransform_ = patternTransform; + } + + const std::vector &GetPatternTransform() const { return patternTransform_; } +private: + Dimension x_; // x-axis default value + Dimension y_; // y-axis default value + Dimension width_; // pattern area width default value + Dimension height_; // pattern area height default value + Unit patternUnits_; + Unit patternContentUnits_; + Rect viewBox_; + float mMinX_; + float mMinY_; + float mVbWidth_; + float mVbHeight_; + std::string mAlign_; + int mMeetOrSlice_; + std::vector patternTransform_; + OH_Drawing_Image* image_; +}; + +} // namespace svg +} // namespace rnoh +#endif // FOUNDATION_ACE_FRAMEWORKS_CORE_COMPONENTS_BASE_PROPERTIES_DECORATION_H diff --git a/tester/harmony/svg/src/main/cpp/properties/Dimension.cpp b/tester/harmony/svg/src/main/cpp/properties/Dimension.cpp new file mode 100644 index 0000000000000000000000000000000000000000..5af971e61ab615d4740b24c9560e098905c76af6 --- /dev/null +++ b/tester/harmony/svg/src/main/cpp/properties/Dimension.cpp @@ -0,0 +1,42 @@ +#include "Dimension.h" +#include "Size.h" +namespace rnoh { +namespace svg { + +double Dimension::RelativeConvertToPx(double baseLen, double scale) const { + switch (Unit()) { + case DimensionUnit::PERCENT: { + return Value() * baseLen; + } + case DimensionUnit::PX: + return Value(); + case DimensionUnit::VP: + return ConvertToPx(scale); + default: + return ConvertToPx(scale); + } +} + +double Dimension::ConvertToPx(const Size &viewPort, SvgLengthType type, double scale) const { + switch (type) { + case SvgLengthType::HORIZONTAL: { + return RelativeConvertToPx(viewPort.Width(), scale); + } + case SvgLengthType::VERTICAL: + return RelativeConvertToPx(viewPort.Height(), scale); + case SvgLengthType::OTHER: + return RelativeConvertToPx(sqrt(viewPort.Width() * viewPort.Height()), scale); + default: + return 0.0; + } +} + +double Dimension::FromRelative(bool isObjectBoundingBoxUnit, double relative, double scale) { + if (Unit() == DimensionUnit::PERCENT) { + return Value() * relative; + } + double baseLen = isObjectBoundingBoxUnit ? relative : scale; + return Value() * baseLen; +} +} // namespace svg +} // namespace rnoh \ No newline at end of file diff --git a/tester/harmony/svg/src/main/cpp/properties/Dimension.h b/tester/harmony/svg/src/main/cpp/properties/Dimension.h new file mode 100644 index 0000000000000000000000000000000000000000..946907d3bb3f164edc1146fa5318a6329a66fe2a --- /dev/null +++ b/tester/harmony/svg/src/main/cpp/properties/Dimension.h @@ -0,0 +1,240 @@ +// from ArkUI "frameworks/base/geometry/dimension.h" +#pragma once +#include +#include +#include "Size.h" + +#define NEAR_ZERO(value) ((value > 0.0) ? ((value - 0.0) <= 0.000001f) : ((0.0 - value) <= 0.000001f)) + +namespace rnoh { +namespace svg { + +enum class DimensionUnit { + /* + * Unit is invalid. + */ + INVALID = -2, + /* + * Unit is empty. + */ + NONE = -1, + /* + * Logical pixel used in Ace1.0. It's based on frontend design width. + * For example, when a frontend with 750px design width running on a + * device with 1080 pixels width, 1px represents 1.44 pixels. + */ + PX = 0, + /* + * Density independent pixels, one vp is one pixel on a 160 dpi screen. + */ + VP, + /* + * Scale independent pixels. This is like VP but will be scaled by + * user's font size preference. + */ + FP, + /* + * The percentage of either a value from the element's parent or from + * another property of the element itself. + */ + PERCENT, + /* + * logic pixels used in ACE2.0 instead of PX, and PX is the physical pixels in ACE2.0 + */ + LPX, + /* + * The value is calculated from the element's parent and another property of the element itself. + */ + AUTO, + /* + * The value is expression. + */ + CALC, +}; + +enum class SvgLengthType { + HORIZONTAL, + VERTICAL, + OTHER, +}; + +/* + * Dimension contains a value and an unit to represent different + * scales in one class. + */ +class Dimension { +public: + constexpr Dimension() = default; + ~Dimension() = default; + constexpr explicit Dimension(double value, DimensionUnit unit = DimensionUnit::PX) : value_(value), unit_(unit) {} + + void Reset() { + value_ = 0.0; + unit_ = DimensionUnit::PX; + } + + void ResetInvalidValue() { + if (std::isnan(value_)) { + Reset(); + } + } + + constexpr double Value() const { return value_; } + + void SetValue(double value) { value_ = value; } + + constexpr DimensionUnit Unit() const { return unit_; } + + void SetUnit(DimensionUnit unit) { unit_ = unit; } + + double RelativeConvertToPx(double baseLen, double scale) const; + + double ConvertToPx(const Size &viewPort, SvgLengthType type, double scale) const; + + // Percentage unit conversion is not supported. + double ConvertToVp(double scale) const { + if (unit_ == DimensionUnit::VP) { + return value_; + } + +// auto pipeline = PipelineBase::GetCurrentContextSafely(); +// CHECK_NULL_RETURN(pipeline, 0.0); +// if (unit_ == DimensionUnit::NONE) { +// return value_ / pipeline->GetDipScale(); +// } + if (unit_ == DimensionUnit::PX) { + return value_ / scale; + } +// if (unit_ == DimensionUnit::FP) { +// return value_ * pipeline->GetFontScale(); +// } +// if (unit_ == DimensionUnit::LPX) { +// return value_ * pipeline->GetLogicScale() / pipeline->GetDipScale(); +// } + return 0.0; + }; + + // Percentage unit conversion is not supported. + double ConvertToPx(double scale) const { + if (unit_ == DimensionUnit::NONE) { + return value_; + } + if (unit_ == DimensionUnit::PX) { + return value_; + } + +// auto pipeline = PipelineBase::GetCurrentContextSafely(); +// CHECK_NULL_RETURN(pipeline, 0.0); + if (unit_ == DimensionUnit::VP) { + return value_ * scale; + } + if (unit_ == DimensionUnit::FP) { +// return value_ * pipeline->GetDipScale() * pipeline->GetFontScale(); + return value_ * scale; + } +// if (unit_ == DimensionUnit::LPX) { +// return value_ * pipeline->GetLogicScale(); +// } + return 0.0; + }; + + double GetNativeValue(DimensionUnit unit, double scale) const { + if (unit_ == unit) { + return value_; + } else if (unit == DimensionUnit::PX) { + return ConvertToPx(scale); + } else { + return ConvertToVp(scale); + } + } + + double FromRelative(bool isObjectBoundingBoxUnit, double relative, double scale); + + bool NormalizeToPx(double vpScale, double fpScale, double lpxScale, double parentLength, double &result) const; + + constexpr Dimension operator*(double value) const { return Dimension(value_ * value, unit_); } + + constexpr Dimension operator/(double value) const { + // NearZero cannot be used in a constant expression + if (NEAR_ZERO(value)) { + return {}; + } + return Dimension(value_ / value, unit_); + } + + bool operator==(const Dimension &dimension) const { + return (unit_ == dimension.unit_) && value_ == dimension.value_; + } + + bool operator!=(const Dimension &dimension) const { return !operator==(dimension); } + + /* + * Add two dimensions using the same unit. + */ + constexpr Dimension operator+(const Dimension &dimension) const { + if (NEAR_ZERO(dimension.Value())) { + return *this; + } + return Dimension(value_ + dimension.value_, unit_); + } + + /* + * Add a new dimension to itself using same unit. + */ + Dimension &operator+=(const Dimension &dimension) { + value_ += dimension.value_; + return *this; + } + + /* + * Minus a dimension using the same unit. + */ + constexpr Dimension operator-(const Dimension &dimension) const { + if (NEAR_ZERO(dimension.Value())) { + return *this; + } + return Dimension(value_ - dimension.value_, unit_); + } + + /* + * The opposite of dimension. + */ + constexpr Dimension operator-() const { return Dimension(-value_, unit_); } + + /* + * Minus a dimension to itself using the same unit. + */ + Dimension &operator-=(const Dimension &dimension) { + value_ -= dimension.value_; + return *this; + } + + bool operator>(const Dimension &dimension) const { return (value_ > dimension.value_); } + + bool operator<(const Dimension &dimension) const { return (value_ < dimension.value_); } + + std::string ToString() const; + +private: + double value_ = 0.0; + DimensionUnit unit_ = DimensionUnit::PX; +}; + +// literal operators for dimension +inline constexpr Dimension operator""_vp(long double value) { + return Dimension(static_cast(value), DimensionUnit::VP); +} + +inline constexpr Dimension operator""_px(long double value) { + return Dimension(static_cast(value), DimensionUnit::PX); +} + +inline constexpr Dimension operator""_fp(long double value) { + return Dimension(static_cast(value), DimensionUnit::FP); +} + +inline constexpr Dimension operator""_pct(long double value) { + return Dimension(static_cast(value), DimensionUnit::PERCENT); +} +} // namespace svg +} // namespace rnoh \ No newline at end of file diff --git a/tester/harmony/svg/src/main/cpp/properties/Font.cpp b/tester/harmony/svg/src/main/cpp/properties/Font.cpp new file mode 100644 index 0000000000000000000000000000000000000000..5d8c382e4ea706bd1ef55bc7cf67d8d4d575e868 --- /dev/null +++ b/tester/harmony/svg/src/main/cpp/properties/Font.cpp @@ -0,0 +1,160 @@ +#include "Font.h" +#include "utils/StringUtils.h" +#include +namespace rnoh { +namespace svg { + +double FontData::toAbsolute(const std::string &value, double scale, double fontSize, double relative) { + auto val = StringUtils::FromString(value); + return val.RelativeConvertToPx(fontSize, scale); +} + +void FontData::setInheritedWeight(const FontData &parent) { + absoluteFontWeight = parent.absoluteFontWeight; + fontWeight = parent.fontWeight; +} + +void FontData::handleNumericWeight(const FontData &parent, double number) { + long weight = static_cast(number); + if (weight >= 1 && weight <= 1000) { + absoluteFontWeight = static_cast(weight); + fontWeight = nearestFontWeight(absoluteFontWeight); + } else { + setInheritedWeight(parent); + } +} + +FontData::FontData(const FontProps &props, const FontData &parent, double scale) { + double parentFontSize = parent.fontSize; + + if (!props.fontSize.empty()) { + fontSize = toAbsolute(props.fontSize, scale, parentFontSize, parentFontSize); + } else { + fontSize = parentFontSize; + } + + if (!props.fontWeight.empty()) { + fontWeight = fontWeightFromStr(props.fontWeight); + if (fontWeight != FontWeight::unknown) { + absoluteFontWeight = from(fontWeight, parent); + fontWeight = nearestFontWeight(absoluteFontWeight); + } else { + handleNumericWeight(parent, StringUtils::FromString(props.fontWeight).Value()); + } + } else { + setInheritedWeight(parent); + } + + fontFamily = !props.fontFamily.empty() ? props.fontFamily : parent.fontFamily; + fontStyle = !props.fontStyle.empty() ? fontStyleFromStr(props.fontStyle) : parent.fontStyle; + fontFeatureSettings = !props.fontFeatureSettings.empty() ? props.fontFeatureSettings : parent.fontFeatureSettings; + fontVariationSettings = + !props.fontVariationSettings.empty() ? props.fontVariationSettings : parent.fontVariationSettings; + fontVariantLigatures = !props.fontVariantLigatures.empty() ? fontVariantFromStr(props.fontVariantLigatures) + : parent.fontVariantLigatures; + + textAnchor = !props.textAnchor.empty() ? textAnchorFromStr(props.textAnchor) : parent.textAnchor; + textDecoration = + !props.textDecoration.empty() ? textDecorationFromStr(props.textDecoration) : parent.textDecoration; + + bool hasKerning = !props.kerning.empty(); + manualKerning = hasKerning || parent.manualKerning; + + kerning = hasKerning ? toAbsolute(props.kerning, scale, fontSize, 0) : parent.kerning; + wordSpacing = !props.wordSpacing.empty() ? toAbsolute(props.wordSpacing, scale, fontSize, 0) : parent.wordSpacing; + letterSpacing = + !props.letterSpacing.empty() ? toAbsolute(props.letterSpacing, scale, fontSize, 0) : parent.letterSpacing; +} + +const double FontData::DEFAULT_FONT_SIZE = vpToPx(12.0); +const double FontData::DEFAULT_KERNING = 0.0; +const double FontData::DEFAULT_WORD_SPACING = 0.0; +const double FontData::DEFAULT_LETTER_SPACING = 0.0; + +const FontWeight FontData::WEIGHTS[] = {FontWeight::w100, FontWeight::w200, FontWeight::w300, + FontWeight::normal, FontWeight::w500, FontWeight::w600, + FontWeight::bold, FontWeight::w800, FontWeight::w900}; + +const int FontData::absoluteFontWeights[] = {400, 700, 100, 200, 300, 400, 500, 600, 700, 800, 900}; + +FontStyle fontStyleFromStr(const std::string &str) { + if (str == "normal") { + return FontStyle::normal; + } else if (str == "italic") { + return FontStyle::italic; + } else if (str == "oblique") { + return FontStyle::oblique; + } else { + // Default case + return FontStyle::normal; + } +} + +FontWeight fontWeightFromStr(const std::string &str) { + if (str == "w100") { + return FontWeight::w100; + } else if (str == "w200") { + return FontWeight::w200; + } else if (str == "w300") { + return FontWeight::w300; + } else if (str == "normal") { + return FontWeight::normal; + } else if (str == "w500") { + return FontWeight::w500; + } else if (str == "w600") { + return FontWeight::w600; + } else if (str == "bold") { + return FontWeight::bold; + } else if (str == "w800") { + return FontWeight::w800; + } else if (str == "w900") { + return FontWeight::w900; + } else if (str == "lighter") { + return FontWeight::lighter; + } else if (str == "bolder") { + return FontWeight::bolder; + } + return FontWeight::unknown; +} + +TextAnchor textAnchorFromStr(const std::string &str) { + if (str == "start") { + return TextAnchor::start; + } else if (str == "middle") { + return TextAnchor::middle; + } else if (str == "end") { + return TextAnchor::end; + } else { + // Default case + return TextAnchor::start; + } +} + +TextDecoration textDecorationFromStr(const std::string &str) { + if (str == "None") { + return TextDecoration::None; + } else if (str == "Underline") { + return TextDecoration::Underline; + } else if (str == "Overline") { + return TextDecoration::Overline; + } else if (str == "LineThrough") { + return TextDecoration::LineThrough; + } else { + // Default case + return TextDecoration::None; + } +} + +FontVariantLigatures fontVariantFromStr(const std::string &str) { + if (str == "normal") { + return FontVariantLigatures::normal; + } else if (str == "none") { + return FontVariantLigatures::none; + } else { + // Default case + return FontVariantLigatures::normal; + } +} + +} // namespace svg +} // namespace rnoh diff --git a/tester/harmony/svg/src/main/cpp/properties/Font.h b/tester/harmony/svg/src/main/cpp/properties/Font.h new file mode 100644 index 0000000000000000000000000000000000000000..049ee28265110cddd6dc4c5c55ffeeddc440f8a6 --- /dev/null +++ b/tester/harmony/svg/src/main/cpp/properties/Font.h @@ -0,0 +1,148 @@ +#pragma once + +#include +#include +namespace rnoh { +namespace svg { + +enum class FontStyle { normal, italic, oblique }; + +enum class FontWeight { + w100, + w200, + w300, + normal, + w500, + w600, + bold, + w800, + w900, + bolder, + lighter, + unknown, +}; + +// match with +enum class TextAnchor { start = 4, middle = 2, end = 5 }; + +// match with +enum class TextDecoration { None = 0x0, Underline = 0x1, Overline = 0x2, LineThrough = 0x4 }; + +enum class FontVariantLigatures { normal, none }; + +FontStyle fontStyleFromStr(const std::string &str); +FontWeight fontWeightFromStr(const std::string &str); +TextAnchor textAnchorFromStr(const std::string &str); +TextDecoration textDecorationFromStr(const std::string &str); +FontVariantLigatures fontVariantFromStr(const std::string &str); + + +// intermediate data to store in Svg nodes +struct FontProps { + std::string fontStyle; + std::string fontVariant; + std::string fontWeight; + std::string fontStretch; + std::string fontSize; + std::string fontFamily; + std::string textAnchor; + std::string textDecoration; + std::string letterSpacing; + std::string wordSpacing; + std::string kerning; + std::string fontFeatureSettings; + std::string fontVariantLigatures; + std::string fontVariationSettings; + + inline bool Empty() const { + return fontStyle.empty() && fontVariant.empty() && fontWeight.empty() && fontStretch.empty() && + fontSize.empty() && fontFamily.empty() && textAnchor.empty() && textDecoration.empty() && + letterSpacing.empty() && wordSpacing.empty() && kerning.empty() && fontFeatureSettings.empty() && + fontVariantLigatures.empty() && fontVariationSettings.empty(); + } +}; + +class FontData { +public: + FontData() = default; + FontData(const FontProps &props, const FontData &parent, double scale); + + static const double DEFAULT_FONT_SIZE; + static const double DEFAULT_KERNING; + static const double DEFAULT_WORD_SPACING; + static const double DEFAULT_LETTER_SPACING; + + /* ------- Props -------- */ + double fontSize = DEFAULT_FONT_SIZE; + std::string fontFamily; + FontStyle fontStyle = FontStyle::normal; + FontWeight fontWeight = FontWeight::normal; + int absoluteFontWeight = 400; + std::string fontFeatureSettings; + std::string fontVariationSettings; + FontVariantLigatures fontVariantLigatures = FontVariantLigatures::normal; + TextAnchor textAnchor = TextAnchor::start; + TextDecoration textDecoration = TextDecoration::None; + + double kerning = DEFAULT_KERNING; + double wordSpacing = DEFAULT_WORD_SPACING; + double letterSpacing = DEFAULT_LETTER_SPACING; + + bool manualKerning = false; + /* -------------------- */ + + double toAbsolute(const std::string &value, double scale, double fontSize, double relative); + + void setInheritedWeight(const FontData &parent); + + void handleNumericWeight(const FontData &parent, double number); + + +private: + static const int normal = 400; + + static const FontWeight WEIGHTS[]; + + static FontWeight nearestFontWeight(int absoluteFontWeight) { + return WEIGHTS[static_cast(absoluteFontWeight / 100.0f)]; + } + + static const int absoluteFontWeights[]; + + static int from(FontWeight fontWeight, const FontData &parent) { + if (fontWeight == FontWeight::bolder) { + return WeightToBolder(parent.absoluteFontWeight); + } else if (fontWeight == FontWeight::lighter) { + return lighter(parent.absoluteFontWeight); + } else { + return absoluteFontWeights[static_cast(fontWeight)]; + } + } + + static int WeightToBolder(int inherited) { + if (inherited < 350) { + return 400; + } else if (inherited < 550) { + return 700; + } else if (inherited < 900) { + return 900; + } else { + return inherited; + } + } + + static int lighter(int inherited) { + if (inherited < 100) { + return inherited; + } else if (inherited < 550) { + return 100; + } else if (inherited < 750) { + return 400; + } else { + return 700; + } + } +}; + +} // namespace svg +} // namespace rnoh \ No newline at end of file diff --git a/tester/harmony/svg/src/main/cpp/properties/Offset.h b/tester/harmony/svg/src/main/cpp/properties/Offset.h new file mode 100755 index 0000000000000000000000000000000000000000..6ce3f2e5161293d2ec047c0e5a42723a31d8ccad --- /dev/null +++ b/tester/harmony/svg/src/main/cpp/properties/Offset.h @@ -0,0 +1,176 @@ +// from ArkUI "frameworks/base/geometry/offset.h" +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +#pragma once +#ifndef FOUNDATION_ACE_FRAMEWORKS_BASE_GEOMETRY_OFFSET_H +#define FOUNDATION_ACE_FRAMEWORKS_BASE_GEOMETRY_OFFSET_H + +#include +#include + +#include "properties/Size.h" +#include "utils/SvgUtils.h" + +namespace rnoh { +namespace svg { + +class Offset { +public: + Offset() = default; + ~Offset() = default; + Offset(double deltaX, double deltaY) : deltaX_(deltaX), deltaY_(deltaY) {} + + void Reset() + { + deltaX_ = 0.0; + deltaY_ = 0.0; +// deltaXAnimationOption_ = AnimationOption(); +// deltaYAnimationOption_ = AnimationOption(); + } + + static Offset Zero() + { + return Offset(); + } + + static Offset ErrorOffset() + { + return Offset((std::numeric_limits::max)(), (std::numeric_limits::max)()); + } + + bool IsZero() const + { + return operator==(Offset()); + } + + bool IsErrorOffset() const + { + return operator==(ErrorOffset()); + } + + double GetX() const + { + return deltaX_; + } + + double GetY() const + { + return deltaY_; + } + + void SetX(double x) + { + deltaX_ = x; + } + + void SetY(double y) + { + deltaY_ = y; + } + + void AddX(double x) + { + deltaX_ += x; + } + + void AddY(double y) + { + deltaY_ += y; + } + + double GetDistance() const + { + return std::sqrt((deltaX_ * deltaX_) + (deltaY_ * deltaY_)); + } + + Offset operator+(const Offset& offset) const + { + return Offset(deltaX_ + offset.deltaX_, deltaY_ + offset.deltaY_); + } + + Offset operator+(const Size& size) const + { + return Offset(deltaX_ + size.Width(), deltaY_ + size.Height()); + } + + Offset operator-(const Offset& offset) const + { + return Offset(deltaX_ - offset.deltaX_, deltaY_ - offset.deltaY_); + } + + Offset operator-(const Size& size) const + { + return Offset(deltaX_ - size.Width(), deltaY_ - size.Height()); + } + + Offset operator*(double value) const + { + return Offset(deltaX_ * value, deltaY_ * value); + } + + Offset operator/(double value) const + { + if (NearZero(value)) { + return ErrorOffset(); + } + return Offset(deltaX_ / value, deltaY_ / value); + } + + Offset& operator+=(const Offset& offset) + { + deltaX_ += offset.deltaX_; + deltaY_ += offset.deltaY_; + return *this; + } + + Offset& operator-=(const Offset& offset) + { + deltaX_ -= offset.deltaX_; + deltaY_ -= offset.deltaY_; + return *this; + } + + bool operator==(const Offset& offset) const + { + return NearEqual(deltaX_, offset.deltaX_) && NearEqual(deltaY_, offset.deltaY_); + } + + bool operator!=(const Offset& offset) const + { + return !operator==(offset); + } + + std::string ToString() const + { + std::stringstream ss; + ss << "Offset (" << std::fixed << std::setprecision(2) << deltaX_ << ", " << deltaY_ << ")"; + std::string output = ss.str(); + return output; + } + + bool IsPositiveOffset() const + { + return deltaX_ >= 0 && deltaY_ >= 0; + } + +private: + double deltaX_ = 0.0; + double deltaY_ = 0.0; +}; + +} // namespace svg +} // namespace rnoh + +#endif // FOUNDATION_ACE_FRAMEWORKS_BASE_GEOMETRY_OFFSET_H diff --git a/tester/harmony/svg/src/main/cpp/properties/PaintState.h b/tester/harmony/svg/src/main/cpp/properties/PaintState.h new file mode 100644 index 0000000000000000000000000000000000000000..591a76ae9e162bf0990f2ed0f1178b1a49ae8f51 --- /dev/null +++ b/tester/harmony/svg/src/main/cpp/properties/PaintState.h @@ -0,0 +1,422 @@ +// from ArkUI "frameworks/core/components/common/properties/paint_state.h" + +#pragma once +// #include "base/memory/ace_type.h" +// #include "core/components/common/layout/constants.h" +// #include "core/components/common/properties/Color.h" +// #include "core/components/common/properties/decoration.h" +// #include "core/components/common/properties/text_style.h" +#include "properties/Color.h" +#include "utils/SvgUtils.h" + + +namespace rnoh { +namespace svg { + +struct BezierCurveParam { + double cp1x = 0.0; // first bezier point x + double cp1y = 0.0; // first bezier point y + double cp2x = 0.0; // second bezier point x + double cp2y = 0.0; // second bezier point y + double x = 0.0; // end point x + double y = 0.0; // end point y +}; + +struct QuadraticCurveParam { + double cpx = 0.0; // bezier point x + double cpy = 0.0; // bezier point y + double x = 0.0; // end point x + double y = 0.0; // end point y +}; + +struct ArcParam { + double x = 0.0; // point x of the circle + double y = 0.0; // point y of the circle + double radius = 0.0; // radius of the circle + double startAngle = 0.0; // start angle of the circle + double endAngle = 0.0; // end angle of the circle + bool anticlockwise = false; // is draw clock wise or not +}; + +struct ArcToParam { + double x1 = 0.0; // start point x + double y1 = 0.0; // start point y + double x2 = 0.0; // end point x + double y2 = 0.0; // end point y + double radius = 0.0; // radius of the circle +}; + +struct EllipseParam { + double x = 0.0; // point x of the ellipse + double y = 0.0; // point y of the ellipse + double radiusX = 0.0; // x axis radius of the ellipse + double radiusY = 0.0; // y axis radius of the ellipse + double rotation = 0.0; // rotation angle of the ellipse + double startAngle = 0.0; // start angle of the ellipse + double endAngle = 0.0; // end angle of the ellipse + bool anticlockwise = false; // is draw clock wise or not +}; + +struct TransformParam { + double scaleX = 0.0; + double skewX = 0.0; + double skewY = 0.0; + double scaleY = 0.0; + double translateX = 0.0; + double translateY = 0.0; +}; + +struct LineDashParam { + std::vector lineDash; + double dashOffset = 0.0; +}; + +struct CanvasImage { + int32_t flag = 0; + double sx = 0.0; + double sy = 0.0; + double sWidth = 0.0; + double sHeight = 0.0; + double dx = 0.0; + double dy = 0.0; + double dWidth = 0.0; + double dHeight = 0.0; + std::string src; + int32_t instanceId = 0; +}; + +// struct ImageData { +// RefPtr pixelMap; +// int32_t x = 0; +// int32_t y = 0; +// int32_t dirtyX = 0; +// int32_t dirtyY = 0; +// int32_t dirtyWidth = 0; +// int32_t dirtyHeight = 0; +// std::vector data; +// }; + +struct TextMetrics { + double width = 0; + double height = 0; + double actualBoundingBoxLeft = 0; + double actualBoundingBoxRight = 0; + double actualBoundingBoxAscent = 0; + double actualBoundingBoxDescent = 0; + double alphabeticBaseline = 0; + double emHeightAscent = 0; + double emHeightDescent = 0; + double fontBoundingBoxAscent = 0; + double fontBoundingBoxDescent = 0; + double hangingBaseline = 0; + double ideographicBaseline = 0; +}; + +enum class ContextType { + RENDER_2D, + RENDER_3D, +}; + +enum class CanvasUnit { + DEFAULT = 0, + PX, +}; + +// following the definition of FillType in skPath +enum class CanvasFillRule { + NONZERO = 0, + EVENODD, +}; + +// following the definition in skPaint +enum class LineCapStyle { + BUTT = 0, + ROUND, + SQUARE, +}; + +enum class LineJoinStyle { + MITER = 0, + ROUND, + BEVEL, +}; + +enum class CompositeOperation { + SOURCE_OVER = 0, + SOURCE_ATOP, + SOURCE_IN, + SOURCE_OUT, + DESTINATION_OVER, + DESTINATION_ATOP, + DESTINATION_IN, + DESTINATION_OUT, + LIGHTER, + COPY, + XOR, +}; + +enum class PaintStyle { + NONE = 0, + Color, + Gradient, + ImagePattern +}; + +class PaintState { +public: + const Color& GetColor() const + { + return color_; + } + + void SetColor(const Color& color) + { + paintStyle_ = PaintStyle::Color; + color_ = color; + } + +// const Gradient& GetGradient() const +// { +// return gradient_; +// } +// +// void SetGradient(const Gradient& gradient) +// { +// paintStyle_ = PaintStyle::Gradient; +// gradient_ = gradient; +// } + +// const TextStyle& GetTextStyle() const +// { +// return textStyle_; +// } +// +// void SetTextStyle(const TextStyle& textStyle) +// { +// textStyle_ = textStyle; +// } +// +// TextAlign GetTextAlign() const +// { +// return textAlign_; +// } +// +// void SetTextAlign(TextAlign textAlign) +// { +// textAlign_ = textAlign; +// } +// +// TextDirection GetOffTextDirection() const +// { +// return textDirection_; +// } +// +// void SetOffTextDirection(TextDirection textDirection) +// { +// textDirection_ = textDirection; +// } +// +// void SetTextColor(const Color& color) +// { +// textStyle_.SetTextColor(color); +// } +// +// void SetFontSize(const Dimension& size) +// { +// textStyle_.SetFontSize(size); +// } +// +// void SetFontStyle(FontStyle style) +// { +// textStyle_.SetFontStyle(style); +// } +// +// void SetFontWeight(FontWeight weight) +// { +// textStyle_.SetFontWeight(weight); +// } +// +// void SetFontFamilies(const std::vector& fontFamilies) +// { +// textStyle_.SetFontFamilies(fontFamilies); +// } +// +// void SetTextBaseline(TextBaseline baseline) +// { +// textStyle_.SetTextBaseline(baseline); +// } +// +// const Pattern& GetPattern() const +// { +// return pattern_; +// } +// +// void SetPattern(const Pattern& pattern) +// { +// paintStyle_ = PaintStyle::ImagePattern; +// pattern_ = pattern; +// } +// +// std::weak_ptr GetPatternNG() const +// { +// return patternNG_; +// } +// +// Ace::Pattern GetPatternValue() const +// { +// Pattern pattern; +// if (!patternNG_.expired()) { +// auto value = patternNG_.lock(); +// if (value) { +// pattern = *value; +// } +// } +// return pattern; +// } +// +// void SetPatternNG(const std::weak_ptr& pattern) +// { +// paintStyle_ = PaintStyle::ImagePattern; +// patternNG_ = pattern; +// } + + int32_t GetId() const + { + return id_; + } + + void SetId(int32_t id) + { + id_ = id; + } + + PaintStyle GetPaintStyle() const + { + return paintStyle_; + } + +protected: + Color color_ = Color::BLACK; +// Gradient gradient_; +// TextStyle textStyle_; +// TextAlign textAlign_ = TextAlign::LEFT; +// TextDirection textDirection_ = TextDirection::LTR; + int32_t id_ = 0; + PaintStyle paintStyle_ = PaintStyle::Color; +// Pattern pattern_; +// std::weak_ptr patternNG_; +}; + +class StrokePaintState : public PaintState { +public: + LineCapStyle GetLineCap() const + { + return lineCap_; + } + + void SetLineCap(LineCapStyle lineCap) + { + lineCap_ = lineCap; + } + + LineJoinStyle GetLineJoin() const + { + return lineJoin_; + } + + void SetLineJoin(LineJoinStyle lineJoin) + { + lineJoin_ = lineJoin; + } + + double GetLineWidth() const + { + return lineWidth_; + } + + void SetLineWidth(double lineWidth) + { + lineWidth_ = lineWidth; + } + + double GetMiterLimit() const + { + return miterLimit_; + } + + void SetMiterLimit(double miterLimit) + { + miterLimit_ = miterLimit; + } + + LineDashParam GetLineDash() const + { + return lineDash_; + } + + void SetLineDash(const LineDashParam& lineDash) + { + lineDash_ = lineDash; + } + + void SetLineDashOffset(double offset) + { + lineDash_.dashOffset = offset; + } + + void SetLineDash(const std::vector& segments) + { + lineDash_.lineDash = segments; + } + +private: + LineCapStyle lineCap_ = LineCapStyle::BUTT; + LineJoinStyle lineJoin_ = LineJoinStyle::MITER; + + double lineWidth_ = 1.0; // default lineWidth + + double miterLimit_ = 10.0; // default miterLimit + LineDashParam lineDash_; +}; + +class GlobalPaintState { +public: + double GetAlpha() const + { + return alpha_; + } + + void SetAlpha(double alpha) + { + alpha_ = alpha; + } + + CompositeOperation GetType() const + { + return type_; + } + + void SetType(CompositeOperation type) + { + type_ = type; + } + + bool HasGlobalAlpha() const + { + return !NearEqual(alpha_, -1.0); + } + +private: + double alpha_ = -1.0; + CompositeOperation type_ = CompositeOperation::SOURCE_OVER; +}; + +// struct PaintHolder { +// PaintState fillState; +// StrokePaintState strokeState; +// GlobalPaintState globalState; +// Shadow shadow; +// }; + +} // namespace svg +} // namespace rnoh diff --git a/tester/harmony/svg/src/main/cpp/properties/Rect.h b/tester/harmony/svg/src/main/cpp/properties/Rect.h new file mode 100644 index 0000000000000000000000000000000000000000..5f801dae50bb1fb216c861d32dc9c0cfbfe05c1a --- /dev/null +++ b/tester/harmony/svg/src/main/cpp/properties/Rect.h @@ -0,0 +1,403 @@ +// from ArkUI "frameworks/base/geometry/rect.h" + +#pragma once + +#include +#include "properties/Size.h" +#include "utils/SvgUtils.h" +#include "properties/Offset.h" + +namespace rnoh { +namespace svg { + +class Rect { +public: + Rect() = default; + ~Rect() = default; + + Rect(double x, double y, double width, double height) + { + SetRect(x, y, width, height); + } + + Rect(const Offset& offset, const Size& size) + { + SetOffset(offset); + SetSize(size); + } + + void SetRect(double x, double y, double width, double height) + { + x_ = x; + y_ = y; + width_ = width; + height_ = height; + } + + void SetRect(const Offset& offset, const Size& size) + { + SetOffset(offset); + SetSize(size); + } + + void ApplyScale(double scale) + { + x_ *= scale; + y_ *= scale; + width_ *= scale; + height_ *= scale; + } + + void ApplyScaleAndRound(const Size& scale) + { + x_ = round(x_ * scale.Width()); + y_ = round(y_ * scale.Height()); + width_ = round(width_ * scale.Width()); + height_ = round(height_ * scale.Height()); + } + + double Left() const + { + return GreatNotEqual(width_, 0.0) ? x_ : x_ + width_; + } + + double Top() const + { + return GreatNotEqual(height_, 0.0) ? y_ : y_ + height_; + } + + double Right() const + { + return GreatNotEqual(width_, 0.0) ? x_ + width_ : x_; + } + + double Bottom() const + { + return GreatNotEqual(height_, 0.0) ? y_ + height_ : y_; + } + + double Width() const + { + return width_; + } + + double Height() const + { + return height_; + } + + void SetSize(const Size& size) + { + width_ = size.Width(); + height_ = size.Height(); + } + + Size GetSize() const + { + return Size(width_, height_); + } + + void SetOffset(const Offset& offset) + { + x_ = offset.GetX(); + y_ = offset.GetY(); + } + + Offset GetOffset() const + { + return Offset(x_, y_); + } + + void SetLeft(double left) + { + x_ = left; + } + + void SetTop(double top) + { + y_ = top; + } + + void SetWidth(double width) + { + width_ = width; + } + + void SetHeight(double height) + { + height_ = height; + } + +// bool IsInRegion(const Point& point) const +// { +// return (point.GetX() >= x_) && (point.GetX() < (x_ + width_)) && (point.GetY() >= y_) && +// (point.GetY() < (y_ + height_)); +// } + + bool IsWrappedBy(const Rect& other) const + { + return (Left() >= other.Left()) && (Right() <= other.Right()) && (Top() >= other.Top()) && + (Bottom() <= other.Bottom()); + } + + bool IsValid() const + { + return width_ > 0.0 && height_ > 0.0; + } + + Rect Constrain(const Rect& other) + { + double right = Right(); + double bottom = Bottom(); + double left = std::clamp(x_, other.Left(), other.Right()); + double top = std::clamp(y_, other.Top(), other.Bottom()); + right = std::clamp(right, other.Left(), other.Right()) - left; + bottom = std::clamp(bottom, other.Top(), other.Bottom()) - top; + return Rect(left, top, right, bottom); + } + + Rect& operator+=(const Offset& offset) + { + x_ += offset.GetX(); + y_ += offset.GetY(); + return *this; + } + + Rect& operator-=(const Offset& offset) + { + x_ -= offset.GetX(); + y_ -= offset.GetY(); + return *this; + } + + Rect& operator+=(const Size& size) + { + width_ += size.Width(); + height_ += size.Height(); + return *this; + } + + Rect& operator-=(const Size& size) + { + width_ -= size.Width(); + height_ -= size.Height(); + return *this; + } + + Rect operator+(const Offset& offset) const + { + return Rect(x_ + offset.GetX(), y_ + offset.GetY(), width_, height_); + } + + Rect operator-(const Offset& offset) const + { + return Rect(x_ - offset.GetX(), y_ - offset.GetY(), width_, height_); + } + + Rect operator+(const Size& size) const + { + return Rect(x_, y_, width_ + size.Width(), height_ + size.Height()); + } + + Rect operator-(const Size& size) const + { + return Rect(x_, y_, width_ - size.Width(), height_ - size.Height()); + } + + Rect operator*(double scale) const + { + return Rect(x_ * scale, y_ * scale, width_ * scale, height_ * scale); + } + + bool operator==(const Rect& rect) const + { + return (GetOffset() == rect.GetOffset()) && (GetSize() == rect.GetSize()); + } + + bool operator!=(const Rect& rect) const + { + return !operator==(rect); + } + + bool IsIntersectWith(const Rect& other) const + { + return !(other.Right() < Left() || other.Left() > Right() || other.Bottom() < Top() || other.Top() > Bottom()); + } + + bool IsIntersectByCommonSideWith(const Rect& other) const + { + return !( + other.Right() <= Left() || other.Left() >= Right() || other.Bottom() <= Top() || other.Top() >= Bottom()); + } + + Rect IntersectRect(const Rect& other) const + { + double left = std::max(Left(), other.Left()); + double right = std::min(Right(), other.Right()); + double top = std::max(Top(), other.Top()); + double bottom = std::min(Bottom(), other.Bottom()); + return Rect(left, top, right - left, bottom - top); + } + + Rect CombineRect(const Rect& other) const + { + double left = std::min(Left(), other.Left()); + double right = std::max(Right(), other.Right()); + double top = std::min(Top(), other.Top()); + double bottom = std::max(Bottom(), other.Bottom()); + return Rect(left, top, right - left, bottom - top); + } + + /** + * @brief Magnetically attracted to a "magnetic" rect. + * + * Let's show some cases to illustrate how this method works: + * + * Case 1 : Inside. Rect won't be move because it is already attracted by magnet. + * Result: Offset(0, 0) + * + * +-----------------------------+ + * | | + * | Magnetical Rect | + * | | + * | +-------+ | + * | | R | | + * | | | | + * | +-------+ | + * +-----------------------------+ + * + * Case 2: Outside. R will be attracted to position R' + * Result: Offset(-12, -3) + * + * +-----------------------+ + * | | + * | Magnetical Rect +--+ + * | | | + * | |R'| +--+ + * +-----------------------+ |R | + * | | + * +--+ + * + * Case 3: Half Inside. R will be moved totally into magnet. + * Result: Offset(-8, 0) + * + * +-----------------------------+ +-----------------------------+ + * | | | | + * | Magnetical Rect | +----------> | Magnetical Rect | + * | | | | + * | +----------+ | +----------+ + * | | | R | | | R' | + * | +----------+ | +----------+ + * | | | | + * +-----------------------------+ +-----------------------------+ + * + * Case 4: Outside or Half Outside but space not enough. R will be moved into magnet as more as possible. + * Result: Offset(0, 1) + * + * +--+ + * | | +--+ + * |R | | | + * | | |R'| + * +---------------------------+ +---------------------------+ + * | | | | | | | | + * | Magnetical Rect | | | +-----> | Magnetical Rect | | | + * | +--+ | | | | | + * +---------------------------+ +------------------+--+-----+ + * + * Case 5: Totally Across magnet. Nothing should happen. + * Result: Offset(0, 0) + * + * +--+ + * | | + * |R | + * | | + * +---------------------------+ + * | | | | + * | Magnetical Rect | | | + * | | | | + * +---------------------------+ + * | | + * +--+ + * + * @param[in] magnet The magnetical rectangle. + * + * @return The offset that this rect need to moving into magnet. + */ + Offset MagneticAttractedBy(const Rect& magnet) + { + Offset offset = Offset::Zero(); + if (IsWrappedBy(magnet)) { + return Offset::Zero(); + } + + if (Left() < magnet.Left()) { + offset.SetX(std::max(0.0, std::min(magnet.Left() - Left(), magnet.Right() - Right()))); + } else if (Right() > magnet.Right()) { + offset.SetX(std::min(0.0, std::max(magnet.Left() - Left(), magnet.Right() - Right()))); + } + + if (Top() < magnet.Top()) { + offset.SetY(std::max(0.0, std::min(magnet.Top() - Top(), magnet.Bottom() - Bottom()))); + } else if (Bottom() > magnet.Bottom()) { + offset.SetY(std::min(0.0, std::max(magnet.Top() - Top(), magnet.Bottom() - Bottom()))); + } + + *this += offset; + + return offset; + } + + std::string ToString() const + { + std::stringstream ss; + ss << "Rect (" << std::fixed << std::setprecision(2) << x_ << ", " << y_ << ") - ["; + if (NearEqual(width_, Size::INFINITE_SIZE)) { + ss << "INFINITE"; + } else { + ss << width_; + } + ss << " x "; + if (NearEqual(height_, Size::INFINITE_SIZE)) { + ss << "INFINITE"; + } else { + ss << height_; + } + ss << "]"; + std::string output = ss.str(); + return output; + } + + std::string ToBounds() const + { + std::stringstream ss; + ss << "[" << std::fixed << std::setprecision(2) << x_ << ", " << y_ << "]["; + if (NearEqual(width_, Size::INFINITE_SIZE)) { + ss << "INFINITE"; + } else { + ss << (x_ + width_); + } + ss << ","; + if (NearEqual(height_, Size::INFINITE_SIZE)) { + ss << "INFINITE"; + } else { + ss << (y_ + height_); + } + ss << "]"; + std::string output = ss.str(); + return output; + } + + Offset Center() const + { + return Offset(width_ / 2.0 + x_, height_ / 2.0 + y_); + } + +private: + double x_ = 0.0; + double y_ = 0.0; + double width_ = 0.0; + double height_ = 0.0; +}; + +} // namespace svg +} // namespace rnoh diff --git a/tester/harmony/svg/src/main/cpp/properties/Size.h b/tester/harmony/svg/src/main/cpp/properties/Size.h new file mode 100644 index 0000000000000000000000000000000000000000..32da1f0e50ff3a677f7b80127956ca2a692e506a --- /dev/null +++ b/tester/harmony/svg/src/main/cpp/properties/Size.h @@ -0,0 +1,225 @@ +// from ArkUI "frameworks/base/geometry/size.h" +#pragma once + +#include +#include +#include +#include + +#include "utils/SvgUtils.h" + +namespace rnoh { +namespace svg { + +class Size { +public: + static constexpr double INFINITE_SIZE = std::numeric_limits::max(); + Size() = default; + ~Size() = default; + Size(double width, double height) : width_(width), height_(height) {} + + inline static bool IsValueInfinite(double inputValue) + { + return NearEqual(inputValue, INFINITE_SIZE); + } + + static Size ErrorSize() + { + return Size((std::numeric_limits::max)(), (std::numeric_limits::max)()); + } + + bool IsErrorSize() const + { + return operator==(ErrorSize()); + } + + double Width() const + { + return width_; + } + + double Height() const + { + return height_; + } + + void SetWidth(double width) + { + width_ = width; + } + + void SetHeight(double height) + { + height_ = height; + } + + void SetSize(const Size& size) + { + width_ = size.Width(); + height_ = size.Height(); + } + + bool IsWidthInfinite() const + { + return NearEqual(width_, INFINITE_SIZE); + } + + bool IsHeightInfinite() const + { + return NearEqual(height_, INFINITE_SIZE); + } + + bool IsInfinite() const + { + return NearEqual(width_, INFINITE_SIZE) || NearEqual(height_, INFINITE_SIZE); + } + + bool IsEmpty() const + { + return NearEqual(width_, 0.0) || NearEqual(height_, 0.0); + } + + Size& AddHeight(double height) + { + height_ += height; + return *this; + } + + Size& AddWidth(double value) + { + width_ += value; + return *this; + } + + Size& MinusHeight(double height) + { + height_ -= height; + return *this; + } + + Size& MinusWidth(double width) + { + width_ -= width; + return *this; + } + + bool IsValid() const + { + return width_ > 0.0 && height_ > 0.0; + } + + Size operator+(const Size& size) const + { + return Size(width_ + size.Width(), height_ + size.Height()); + } + + Size operator-(const Size& size) const + { + return Size(width_ - size.Width(), height_ - size.Height()); + } + + Size operator*(double value) const + { + return Size(width_ * value, height_ * value); + } + + Size operator/(double value) const + { + if (NearZero(value)) { + return ErrorSize(); + } + return Size(width_ / value, height_ / value); + } + + bool operator==(const Size& size) const + { + return NearEqual(width_, size.width_) && NearEqual(height_, size.height_); + } + + bool operator!=(const Size& size) const + { + return !operator==(size); + } + + Size operator+=(const Size& size) + { + width_ += size.Width(); + height_ += size.Height(); + return *this; + } + + Size operator-=(const Size& size) + { + width_ -= size.Width(); + height_ -= size.Height(); + return *this; + } + + void ApplyScale(double scale) + { + width_ *= scale; + height_ *= scale; + } + + /* + * Please make sure that two sizes are both valid. + * You can use IsValid() to see if a size is valid. + */ + bool operator>(const Size& size) const + { + if (IsValid() && size.IsValid()) { + return GreatOrEqual(width_, size.width_) && GreatOrEqual(height_, size.height_); + } else { + return false; + } + } + + /* + * Please make sure that two sizes are both valid. + * You can use IsValid() to see if a size is valid. + */ + bool operator<(const Size& size) const + { + if (IsValid() && size.IsValid()) { + return LessOrEqual(width_, size.width_) && LessOrEqual(height_, size.height_); + } else { + return false; + } + } + + template + static double CalcRatio(const T& rectangle) + { + if (NearZero(static_cast(rectangle.Height()))) { + return INFINITE_SIZE; + } + return static_cast(rectangle.Width()) / static_cast(rectangle.Height()); + } + + std::string ToString() const + { + std::stringstream ss; + ss << "[" << std::fixed << std::setprecision(2); + if (NearEqual(width_, INFINITE_SIZE)) { + ss << "INFINITE"; + } else { + ss << width_; + } + ss << " x "; + if (NearEqual(height_, INFINITE_SIZE)) { + ss << "INFINITE"; + } else { + ss << height_; + } + ss << "]"; + std::string output = ss.str(); + return output; + } + +private: + double width_ = 0.0; + double height_ = 0.0; +}; + +} // namespace svg +} // namespace rnoh diff --git a/tester/harmony/svg/src/main/cpp/properties/SvgDomType.h b/tester/harmony/svg/src/main/cpp/properties/SvgDomType.h new file mode 100644 index 0000000000000000000000000000000000000000..7afe63f82b49ab0c21311d3cf9959bb2ed395b69 --- /dev/null +++ b/tester/harmony/svg/src/main/cpp/properties/SvgDomType.h @@ -0,0 +1,114 @@ + +namespace rnoh { +namespace svg { + +const char DOM_CLIP_PATH[] = "clipPath"; +// svg +const char DOM_SVG_ID[] = "svgId"; +const char DOM_SVG_ANIMATION_BEGIN[] = "begin"; +const char DOM_SVG_ANIMATION_DUR[] = "dur"; +const char DOM_SVG_ANIMATION_END[] = "end"; +const char DOM_SVG_ANIMATION_MIN[] = "min"; +const char DOM_SVG_ANIMATION_MAX[] = "max"; +const char DOM_SVG_ANIMATION_RESTART[] = "restart"; +const char DOM_SVG_ANIMATION_REPEAT_COUNT[] = "repeatcount"; +const char DOM_SVG_ANIMATION_REPEAT_DUR[] = "repeatdur"; +const char DOM_SVG_ANIMATION_FILL[] = "fill"; +const char DOM_SVG_ANIMATION_CALC_MODE[] = "calcmode"; +const char DOM_SVG_ANIMATION_VALUES[] = "values"; +const char DOM_SVG_ANIMATION_KEY_TIMES[] = "keytimes"; +const char DOM_SVG_ANIMATION_KEY_SPLINES[] = "keysplines"; +const char DOM_SVG_ANIMATION_FROM[] = "from"; +const char DOM_SVG_ANIMATION_TO[] = "to"; +const char DOM_SVG_ANIMATION_BY[] = "by"; +const char DOM_SVG_ANIMATION_ATTRIBUTE_NAME[] = "attributename"; +const char DOM_SVG_ANIMATION_ADDITIVE[] = "additive"; +const char DOM_SVG_ANIMATION_ACCUMULATE[] = "accumulate"; +const char DOM_SVG_ANIMATION_TYPE[] = "type"; +const char DOM_SVG_ANIMATION_KEY_POINTS[] = "keypoints"; +const char DOM_SVG_ANIMATION_PATH[] = "path"; +const char DOM_SVG_ANIMATION_ROTATE[] = "rotate"; +const char DOM_SVG_ATTR_PATH[] = "path"; +const char DOM_SVG_START_OFFSET[] = "startoffset"; +const char DOM_SVG_FILL[] = "fill"; +const char DOM_SVG_FILL_OPACITY[] = "fillOpacity"; +const char DOM_SVG_FILL_RULE[] = "fillRule"; +const char DOM_SVG_FILTER[] = "filter"; +const char DOM_SVG_FONT_FAMILY[] = "fontFamily"; +const char DOM_SVG_FONT_SIZE[] = "fontSize"; +const char DOM_SVG_FONT_STYLE[] = "fontStyle"; +const char DOM_SVG_FONT_WEIGHT[] = "fontWeight"; +const char DOM_SVG_LETTER_SPACING[] = "letterSpacing"; +const char DOM_SVG_TEXT_DECORATION[] = "textDecoration"; +const char DOM_SVG_TEXT_LENGTH[] = "textlength"; +const char DOM_SVG_MASK[] = "mask"; +const char DOM_SVG_STROKE[] = "stroke"; +const char DOM_SVG_STROKE_DASHARRAY[] = "strokeDasharray"; +const char DOM_SVG_STROKE_DASHOFFSET[] = "strokeDashoffset"; +const char DOM_SVG_STROKE_LINECAP[] = "strokeLinecap"; +const char DOM_SVG_STROKE_LINEJOIN[] = "strokeLinejoin"; +const char DOM_SVG_STROKE_MITERLIMIT[] = "strokeMiterlimit"; +const char DOM_SVG_STROKE_OPACITY[] = "strokeOpacity"; +const char DOM_SVG_STROKE_WIDTH[] = "strokeWidth"; +const char DOM_SVG_OPACITY[] = "opacity"; +const char DOM_SVG_VIEW_BOX[] = "viewbox"; +const char DOM_SVG_X[] = "x"; +const char DOM_SVG_Y[] = "y"; +const char DOM_SVG_WIDTH[] = "width"; +const char DOM_SVG_HEIGHT[] = "height"; +const char DOM_SVG_DX[] = "dx"; +const char DOM_SVG_DY[] = "dy"; +const char DOM_SVG_RX[] = "rx"; +const char DOM_SVG_RY[] = "ry"; +const char DOM_SVG_D[] = "d"; +const char DOM_SVG_X1[] = "x1"; +const char DOM_SVG_X2[] = "x2"; +const char DOM_SVG_Y1[] = "y1"; +const char DOM_SVG_Y2[] = "y2"; +const char DOM_SVG_POINTS[] = "points"; +const char DOM_SVG_CX[] = "cx"; +const char DOM_SVG_CY[] = "cy"; +const char DOM_SVG_R[] = "r"; +const char DOM_SVG_ROTATE[] = "rotate"; +const char DOM_SVG_LENGTH_ADJUST[] = "lengthadjust"; +const char DOM_SVG_MIRROR[] = "automirror"; +const char DOM_SVG_MASK_CONTENT_UNITS[] = "maskcontentunits"; +const char DOM_SVG_MASK_UNITS[] = "maskunits"; +const char DOM_SVG_PATTERN_CONTENT_UNITS[] = "patterncontentunits"; +const char DOM_SVG_PATTERN_UNITS[] = "patternunits"; +const char DOM_SVG_PATTERN_TRANSFORM[] = "patterntransform"; +const char DOM_SVG_OFFSET[] = "offset"; +const char DOM_SVG_STOP_COLOR[] = "stopColor"; +const char DOM_SVG_STOP_OPACITY[] = "stopOpacity"; +const char DOM_SVG_GRADIENT_TRANSFORM[] = "gradienttransform"; +const char DOM_SVG_SPREAD_METHOD[] = "spreadmethod"; +const char DOM_SVG_FX[] = "fx"; +const char DOM_SVG_FY[] = "fy"; +const char DOM_SVG_FR[] = "fr"; +const char DOM_SVG_HREF[] = "href"; +const char DOM_SVG_XLINK_HREF[] = "xlink:href"; +const char DOM_SVG_CLIP_RULE[] = "clipRule"; +const char DOM_SVG_FE_IN[] = "in"; +const char DOM_SVG_FE_IN2[] = "in2"; +const char DOM_SVG_FE_MODE[] = "mode"; +const char DOM_SVG_FE_RESULT[] = "result"; +const char DOM_SVG_FE_COLOR_INTERPOLATION_FILTERS[] = "color-interpolation-filters"; +const char DOM_SVG_FE_TYPE[] = "type"; +const char DOM_SVG_FE_VALUES[] = "values"; +const char DOM_SVG_FE_FLOOD_COLOR[] = "flood-color"; +const char DOM_SVG_FE_FLOOD_OPACITY[] = "flood-opacity"; +const char DOM_SVG_FE_EDGE_MODE[] = "edgemode"; +const char DOM_SVG_FE_STD_DEVIATION[] = "stddeviation"; +const char DOM_SVG_FE_AMPLITUDE[] = "amplitude"; +const char DOM_SVG_FE_EXPONENT[] = "exponent"; +const char DOM_SVG_FE_INTERCEPT[] = "intercept"; +const char DOM_SVG_FE_SLOPE[] = "slope"; +const char DOM_SVG_FE_TABLE_VALUES[] = "tablevalues"; +const char DOM_SVG_FE_K1[] = "k1"; +const char DOM_SVG_FE_K2[] = "k2"; +const char DOM_SVG_FE_K3[] = "k3"; +const char DOM_SVG_FE_K4[] = "k4"; +const char DOM_SVG_FE_OPERATOR_TYPE[] = "operator"; + +} // namespace svg +} // namespace rnoh \ No newline at end of file diff --git a/tester/harmony/svg/src/main/cpp/properties/SvgPaintState.h b/tester/harmony/svg/src/main/cpp/properties/SvgPaintState.h new file mode 100644 index 0000000000000000000000000000000000000000..00046619d28b4bc4b333bba31450a5ccac52dc24 --- /dev/null +++ b/tester/harmony/svg/src/main/cpp/properties/SvgPaintState.h @@ -0,0 +1,444 @@ +// from ArkUI "frameworks/core/components/common/properties/svg_paint_state.h" +#pragma once + +#include "Decoration.h" +#include "properties/Color.h" +#include "properties/PaintState.h" +#include "properties/Decoration.h" +#include +#include + +namespace rnoh { +namespace svg { + +const char ATTR_NAME_FILL[] = "fill"; +const char ATTR_NAME_STROKE[] = "stroke"; +const char ATTR_NAME_STROKE_WIDTH[] = "stroke-width"; +const char ATTR_NAME_MITER_LIMIT[] = "stroke-miterlimit"; +const char ATTR_NAME_STROKE_DASH_OFFSET[] = "stroke-dashoffset"; +const char ATTR_NAME_FONT_SIZE[] = "font-size"; +const char ATTR_NAME_FILL_OPACITY[] = "fill-opacity"; +const char ATTR_NAME_STROKE_OPACITY[] = "stroke-opacity"; +const char ATTR_NAME_LETTER_SPACING[] = "letter-spacing"; +const char ANIMATOR_TYPE_MOTION[] = "motion"; +const char ATTR_NAME_FILL_RULE_EVENODD[] = "evenodd"; + +class FillState { +public: +// void SetContextAndCallback(const WeakPtr &context, const RenderNodeAnimationCallback &callback) { +// color_.SetContextAndCallback(context, callback); +// opacity_.SetContextAndCallback(context, callback); +// } +// + enum class FillRule { + FILL_RULE_EVEN_ODD = 0, + FILL_RULE_NONZERO = 1 + }; + + const Color &GetColor() const { return color_; } + + /** + * set fill color + * @param color + * @param isSelf if false the color value inherited from the parent node, otherwise the value is setted by self + */ + void SetColor(const Color &color, bool isSelf) { + color_ = Color(color); + hasColor_ = isSelf; + } + + std::optional &GetGradient() { return gradient_; } + + const std::optional &GetGradient() const { return gradient_; } + + void SetGradient(const Gradient &gradient, bool isSelf) { + gradient_ = std::make_optional(gradient); + hasGradient_ = isSelf; + } + + void SetGradient(const std::optional &gradient, bool isSelf) { + gradient_ = gradient; + hasGradient_ = isSelf; + } + + std::shared_ptr &GetPatternAttr() { return patternAttr_; } + + const std::shared_ptr &GetPatternAttr() const { return patternAttr_; } + + void SetPattern(std::shared_ptr patternAttr) { + patternAttr_ = patternAttr; + } + + void SetOpacity(double opacity, bool isSelf) { + opacity_ = opacity; + hasOpacity_ = isSelf; + } + + double GetOpacity() const { return opacity_; } + + void SetFillRule(const FillState::FillRule fillRule , bool isSelf) { + fillRule_ = fillRule; + hasFillRule_ = isSelf; + } + + const FillState::FillRule &GetFillRule() const { return fillRule_; } + + OH_Drawing_PathFillType GetFillRuleForDraw() const{ + if (IsEvenodd()) { + return OH_Drawing_PathFillType::PATH_FILL_TYPE_EVEN_ODD; + } else { + return OH_Drawing_PathFillType::PATH_FILL_TYPE_WINDING; + } + } + + bool IsEvenodd() const { return fillRule_ == FillRule::FILL_RULE_EVEN_ODD; } + // + void Inherit(const FillState &parent) { + if (!hasColor_) { + color_ = parent.GetColor(); + } + if (!hasOpacity_) { + opacity_ = parent.GetOpacity(); + } + if (!hasFillRule_) { + fillRule_ = parent.GetFillRule(); + } + if (!hasGradient_) { + gradient_ = parent.GetGradient(); + } + } + + bool HasColor() const { return hasColor_; } + + bool HasOpacity() const { return hasOpacity_; } + + void SetHref(const std::string &href) { href_ = href; } + + const std::string &GetHref() const { return href_; } + +protected: + Color color_ = Color(Color::BLACK); + double opacity_ = double(1.0); + FillState::FillRule fillRule_; + std::optional gradient_; + std::shared_ptr patternAttr_; + bool hasColor_ = false; + bool hasOpacity_ = false; + bool hasFillRule_ = false; + bool hasGradient_ = false; + std::string href_; +}; + +class StrokeState { +public: +// void SetContextAndCallback(const WeakPtr& context, const RenderNodeAnimationCallback& callback) +// { +// lineWidth_.SetContextAndCallback(context, callback); +// color_.SetContextAndCallback(context, callback); +// opacity_.SetContextAndCallback(context, callback); +// strokeDashOffset_.SetContextAndCallback(context, callback); +// } +// + const Color& GetColor() const + { + return color_; + } + + void SetColor(const Color& color, bool isSelf) + { + color_ = color; + hasColor_ = isSelf; + } + + std::optional &GetGradient() { return gradient_; } + + const std::optional &GetGradient() const { return gradient_; } + + void SetGradient(const Gradient &gradient, bool isSelf) { + gradient_ = std::make_optional(gradient); + hasGradient_ = isSelf; + } + + void SetGradient(const std::optional &gradient, bool isSelf) { + gradient_ = gradient; + hasGradient_ = isSelf; + } + + void SetOpacity(double opacity, bool isSelf) + { + opacity_ = opacity; + hasOpacity_ = isSelf; + } + + double GetOpacity() const + { + return opacity_; + } + + LineCapStyle GetLineCap() const + { + return lineCap_; + } + + void SetLineCap(LineCapStyle lineCap, bool isSelf) + { + lineCap_ = lineCap; + hasLineCap_ = isSelf; + } + + LineJoinStyle GetLineJoin() const + { + return lineJoin_; + } + + void SetLineJoin(LineJoinStyle lineJoin, bool isSelf) + { + lineJoin_ = lineJoin; + hasLineJoin_ = isSelf; + } + + const double& GetLineWidth() const + { + return lineWidth_; + } + + void SetLineWidth(double lineWidth, bool isSelf) + { + lineWidth_ = lineWidth; + hasLineWidth_ = isSelf; + } + + double GetMiterLimit() const + { + return miterLimit_; + } + + void SetMiterLimit(double miterLimit, bool isSelf) + { + miterLimit_ = miterLimit; + hasMiterLimit_ = isSelf; + } + + const LineDashParam& GetLineDash() const + { + return lineDash_; + } + + void SetLineDash(const LineDashParam& lineDash, bool isSelf) + { + lineDash_ = lineDash; + hasLineDash_ = isSelf; + } + + void SetLineDashOffset(double offset, bool isSelf) + { + lineDash_.dashOffset = offset; + hasDashOffset_ = isSelf; + } + + void SetLineDash(const std::vector& segments, bool isSelf) + { + lineDash_.lineDash = segments; + hasLineDash_ = isSelf; + } + + void SetStrokeDashOffset(const double& offset, bool isSelf) + { + strokeDashOffset_ = offset; + hasStrokeDashOffset_ = isSelf; + } + + void SetStrokeDashArray(const std::vector& segments, bool isSelf) + { + strokeDashArray_ = segments; + hasStrokeDashArray_ = isSelf; + } + + const double& GetStrokeDashOffset() const + { + return strokeDashOffset_; + } + + const std::vector& GetStrokeDashArray() const + { + return strokeDashArray_; + } + + bool HasStroke() const + { + // The text outline is drawn only when stroke is set + return color_ != Color::TRANSPARENT; + } + + void SetVectorEffect(int VectorEffect) + { + vectorEffect_ = VectorEffect; + } + + const int GetVectorEffect() const + { + return vectorEffect_; + } + + void Inherit(const StrokeState& strokeState) + { + if (!hasColor_) { + color_ = strokeState.GetColor(); + } + if (!hasOpacity_) { + opacity_ = strokeState.GetOpacity(); + } + if (!hasLineCap_) { + lineCap_ = strokeState.GetLineCap(); + } + if (!hasLineJoin_) { + lineJoin_ = strokeState.GetLineJoin(); + } + DLOG(INFO) << "hasLineWIdth = " << hasLineWidth_ << " to inherit : " << strokeState.GetLineWidth(); + if (!hasLineWidth_) { + lineWidth_ = strokeState.GetLineWidth(); + } + if (!hasMiterLimit_) { + miterLimit_ = strokeState.GetMiterLimit(); + } + if (!hasLineDash_) { + lineDash_.lineDash = strokeState.GetLineDash().lineDash; + } + if (!hasDashOffset_) { + lineDash_.dashOffset = strokeState.GetLineDash().dashOffset; + } + if (!hasStrokeDashArray_) { + strokeDashArray_ = strokeState.GetStrokeDashArray(); + } + if (!hasStrokeDashOffset_) { + strokeDashOffset_ = strokeState.GetStrokeDashOffset(); + } + if (!hasGradient_) { + gradient_ = strokeState.GetGradient(); + } + } + + bool HasColor() const + { + return hasColor_; + } + + bool HasOpacity() const + { + return hasOpacity_; + } + + bool HasLineWidth() const + { + return hasLineWidth_; + } + + bool HasMiterLimit() const + { + return hasMiterLimit_; + } + + bool HasDashOffset() const + { + return hasDashOffset_; + } + + void SetHref(const std::string& href) + { + href_ = href; + } + + const std::string& GetHref() const + { + return href_; + } + +private: + Color color_ = Color::TRANSPARENT; + double opacity_ = 1.0; + LineCapStyle lineCap_ = LineCapStyle::BUTT; + LineJoinStyle lineJoin_ = LineJoinStyle::MITER; + double lineWidth_ = 1.0; + double miterLimit_ = 4.0; + LineDashParam lineDash_; + std::vector strokeDashArray_; + double strokeDashOffset_; + std::string href_; + int vectorEffect_ = 0; + std::optional gradient_; + + bool hasColor_ = false; + bool hasOpacity_ = false; + bool hasLineCap_ = false; + bool hasLineJoin_ = false; + bool hasLineWidth_ = false; + bool hasMiterLimit_ = false; + bool hasLineDash_ = false; + bool hasDashOffset_ = false; + bool hasStrokeDashArray_ = false; + bool hasStrokeDashOffset_ = false; + bool hasGradient_ = false; +}; + +class ClipState { +public: + enum class ClipRule { + CLIP_RULE_EVENODD = 0, + CLIP_RULE_NONZERO + }; + + void SetClipRule(const ClipState::ClipRule clipRule, bool isSelf) + { + clipRule_ = clipRule; + hasClipRule_ = isSelf; + } + + const ClipState::ClipRule GetClipRule() const + { + return clipRule_; + } + + // Convert different interface values (FILL_RULE_NONZERO <===> PATH_FILL_TYPE_WINDING) + OH_Drawing_PathFillType GetClipRuleForDraw() { + if (IsEvenodd()) { + return OH_Drawing_PathFillType::PATH_FILL_TYPE_EVEN_ODD; + } else { + return OH_Drawing_PathFillType::PATH_FILL_TYPE_WINDING; + } + } + + bool IsEvenodd() const + { + return clipRule_ == ClipRule::CLIP_RULE_EVENODD; + } + + void SetHref(const std::string& href, bool isSelf) + { + href_ = href; + hasHref_ = isSelf; + } + + const std::string& GetHref() const + { + return href_; + } + + void Inherit(const ClipState& clipState) + { + if (!hasClipRule_) { + clipRule_ = clipState.GetClipRule(); + } + if (!hasHref_) { + href_ = clipState.GetHref(); + } + } + +private: + ClipState::ClipRule clipRule_ = ClipState::ClipRule::CLIP_RULE_NONZERO; + std::string href_; + bool hasClipRule_ = false; + bool hasHref_ = false; +}; + +} // namespace svg +} // namespace rnoh diff --git a/tester/harmony/svg/src/main/cpp/properties/TextProperties.cpp b/tester/harmony/svg/src/main/cpp/properties/TextProperties.cpp new file mode 100644 index 0000000000000000000000000000000000000000..c846a0f32a567a71fce7e7930c33876572b1d545 --- /dev/null +++ b/tester/harmony/svg/src/main/cpp/properties/TextProperties.cpp @@ -0,0 +1,85 @@ +#include "TextProperties.h" +namespace rnoh { +namespace svg { + +TextPathMethod textPathMethodFromStr(const std::string &str) { + if (str == "stretch") { + return TextPathMethod::stretch; + } else { + return TextPathMethod::align; + } +} + +TextPathSide textPathSideFromStr(const std::string &str) { + if (str == "right") { + return TextPathSide::right; + } else { + return TextPathSide::left; + } +} + +TextPathMidLine textPathMidLineFromStr(const std::string &str) { + if (str == "sharp") { + return TextPathMidLine::sharp; + } else { + return TextPathMidLine::smooth; + } +} + +TextPathSpacing textPathSpacingFromStr(const std::string &str) { + if (str == "auto") { + return TextPathSpacing::Auto; + } else { + return TextPathSpacing::Exact; + } +} + +TextLengthAdjust textLengthAdjustFromStr(const std::string &str) { + if (str == "spacing") { + return TextLengthAdjust::spacing; + } else { + return TextLengthAdjust::spacingAndGlyphs; + } + +} + +AlignmentBaseline alignmentBaselineFromStr(const std::string &str) { + if (str == "baseline") { + return AlignmentBaseline::baseline; + } else if (str == "text-bottom") { + return AlignmentBaseline::textBottom; + } else if (str == "alphabetic") { + return AlignmentBaseline::alphabetic; + } else if (str == "ideographic") { + return AlignmentBaseline::ideographic; + } else if (str == "middle") { + return AlignmentBaseline::middle; + } else if (str == "central") { + return AlignmentBaseline::central; + } else if (str == "mathematical") { + return AlignmentBaseline::mathematical; + } else if (str == "text-top") { + return AlignmentBaseline::textTop; + } else if (str == "bottom") { + return AlignmentBaseline::bottom; + } else if (str == "center") { + return AlignmentBaseline::center; + } else if (str == "top") { + return AlignmentBaseline::top; + } else if (str == "text-before-edge") { + return AlignmentBaseline::textBeforeEdge; + } else if (str == "text-after-edge") { + return AlignmentBaseline::textAfterEdge; + } else if (str == "before-edge") { + return AlignmentBaseline::beforeEdge; + } else if (str == "after-edge") { + return AlignmentBaseline::afterEdge; + } else if (str == "hanging") { + return AlignmentBaseline::hanging; + } else { + return AlignmentBaseline::baseline; + } +} + +} // namespace svg +} // namespace rnoh \ No newline at end of file diff --git a/tester/harmony/svg/src/main/cpp/properties/TextProperties.h b/tester/harmony/svg/src/main/cpp/properties/TextProperties.h new file mode 100644 index 0000000000000000000000000000000000000000..2d707668ee3e66e16c24edf933a712e88840c799 --- /dev/null +++ b/tester/harmony/svg/src/main/cpp/properties/TextProperties.h @@ -0,0 +1,47 @@ +#include +namespace rnoh { +namespace svg { + +enum class AlignmentBaseline { + baseline, + textBottom, + alphabetic, + ideographic, + middle, + central, + mathematical, + textTop, + bottom, + center, + top, + /* + SVG implementations may support the following aliases in order to support legacy content: + + text-before-edge = text-top + text-after-edge = text-bottom + */ + textBeforeEdge, + textAfterEdge, + // SVG 1.1 + beforeEdge, + afterEdge, + hanging, +}; + +enum class TextLengthAdjust { spacing, spacingAndGlyphs }; + +enum class TextPathMethod { align, stretch }; +enum class TextPathMidLine { sharp, smooth }; +enum class TextPathSide { left, right }; +enum class TextPathSpacing { Auto, Exact }; + +AlignmentBaseline alignmentBaselineFromStr(const std::string &str); +TextLengthAdjust textLengthAdjustFromStr(const std::string &str); + +TextPathMethod textPathMethodFromStr(const std::string &str); +TextPathSide textPathSideFromStr(const std::string &str); +TextPathMidLine textPathMidLineFromStr(const std::string &str); +TextPathSpacing textPathSpacingFromStr(const std::string &str); + +} // namespace svg +} // namespace rnoh \ No newline at end of file diff --git a/tester/harmony/svg/src/main/cpp/properties/ViewBox.h b/tester/harmony/svg/src/main/cpp/properties/ViewBox.h new file mode 100644 index 0000000000000000000000000000000000000000..15321b4d5854a242738aa74d1340e7007bdf149a --- /dev/null +++ b/tester/harmony/svg/src/main/cpp/properties/ViewBox.h @@ -0,0 +1,111 @@ +// +// Created on 2024/5/9. +// +// Node APIs are not fully supported. To solve the compilation error of the interface cannot be found, +// please include "napi/native_api.h". + +#ifndef HARMONY_VIEWBOX_H +#define HARMONY_VIEWBOX_H + +#include "Rect.h" +#include "drawing/Matrix.h" +#include +#include + +namespace rnoh { +namespace svg { + +class ViewBox { +private: + static const int MOS_MEET = 0; + static const int MOS_SLICE = 1; + static const int MOS_NONE = 2; + +public: + static drawing::Matrix getTransform(const Rect &vbRect, const Rect &eRect, const std::string &align, const int &meetOrSlice) { + // based on https://svgwg.org/svg2-draft/coords.html#ComputingAViewportsTransform + + // Let vb-x, vb-y, vb-width, vb-height be the min-x, min-y, width and height values of the + // viewBox attribute respectively. + double vbX = vbRect.Left(); + double vbY = vbRect.Top(); + double vbWidth = vbRect.Width(); + double vbHeight = vbRect.Height(); + + // Let e-x, e-y, e-width, e-height be the position and size of the element respectively. + double eX = eRect.Left(); + double eY = eRect.Top(); + double eWidth = eRect.Width(); + double eHeight = eRect.Height(); + + // Initialize scale-x to e-width/vb-width. + double scaleX = eWidth / vbWidth; + + // Initialize scale-y to e-height/vb-height. + double scaleY = eHeight / vbHeight; + + // Initialize translate-x to e-x - (vb-x * scale-x). + // Initialize translate-y to e-y - (vb-y * scale-y). + double translateX = eX - (vbX * scaleX); + double translateY = eY - (vbY * scaleY); + + // If meetOrSlice is 'none' + if (meetOrSlice == MOS_NONE) { + // Let scale be set the smaller value of scale-x and scale-y. + // Assign scale-x and scale-y to scale. + double scale = scaleX = scaleY = std::min(scaleX, scaleY); + + // If scale is greater than 1 + if (scale > 1) { + // Minus translateX by (eWidth / scale - vbWidth) / 2 + // Minus translateY by (eHeight / scale - vbHeight) / 2 + translateX -= (eWidth / scale - vbWidth) / 2; + translateY -= (eHeight / scale - vbHeight) / 2; + } else { + translateX -= (eWidth - vbWidth * scale) / 2; + translateY -= (eHeight - vbHeight * scale) / 2; + } + } else { + // If align is not 'none' and meetOrSlice is 'meet', set the larger of scale-x and scale-y to + // the smaller. + // Otherwise, if align is not 'none' and meetOrSlice is 'slice', set the smaller of scale-x + // and scale-y to the larger. + if (align != "none" && meetOrSlice == MOS_MEET) { + scaleX = scaleY = std::min(scaleX, scaleY); + } else if (align != "none" && meetOrSlice == MOS_SLICE) { + scaleX = scaleY = std::max(scaleX, scaleY); + } + + // If align contains 'xMid', add (e-width - vb-width * scale-x) / 2 to translate-x. + if (align.find("xMid") != std::string::npos) { + translateX += (eWidth - vbWidth * scaleX) / 2.0; + } + + // If align contains 'xMax', add (e-width - vb-width * scale-x) to translate-x. + if (align.find("xMax") != std::string::npos) { + translateX += (eWidth - vbWidth * scaleX); + } + + // If align contains 'yMid', add (e-height - vb-height * scale-y) / 2 to translate-y. + if (align.find("YMid") != std::string::npos) { + translateY += (eHeight - vbHeight * scaleY) / 2.0; + } + + // If align contains 'yMax', add (e-height - vb-height * scale-y) to translate-y. + if (align.find("YMax") != std::string::npos) { + translateY += (eHeight - vbHeight * scaleY); + } + } + + // The transform applied to content contained by the element is given by + // translate(translate-x, translate-y) scale(scale-x, scale-y). + drawing::Matrix transform; + transform.PostTranslate(static_cast(translateX), static_cast(translateY)); + transform.PreScale(static_cast(scaleX), static_cast(scaleY), 0, 0); + return transform; + } +}; + +} // namespace svg +} // namespace rnoh +#endif // HARMONY_VIEWBOX_H diff --git a/tester/harmony/svg/src/main/cpp/svgImage/RNSVGImageComponentDescriptor.h b/tester/harmony/svg/src/main/cpp/svgImage/RNSVGImageComponentDescriptor.h new file mode 100644 index 0000000000000000000000000000000000000000..87a29e392600c8d7b1c857efd89f5f5465344f44 --- /dev/null +++ b/tester/harmony/svg/src/main/cpp/svgImage/RNSVGImageComponentDescriptor.h @@ -0,0 +1,45 @@ +/* + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#pragma once + +#include +#include +#include + +#include "RNSVGImageShadowNode.h" + +namespace facebook { +namespace react { + +/* + * Descriptor for component. + */ +class RNSVGImageComponentDescriptor final + : public ConcreteComponentDescriptor { + public: + RNSVGImageComponentDescriptor(ComponentDescriptorParameters const ¶meters) + : ConcreteComponentDescriptor(parameters), + imageManager_(std::make_shared(contextContainer_)){}; + + void adopt(ShadowNode::Unshared const &shadowNode) const override { + ConcreteComponentDescriptor::adopt(shadowNode); + + auto imageShadowNode = + std::static_pointer_cast(shadowNode); + + // `RNSVGImageShadowNode` uses `ImageManager` to initiate image loading and + // communicate the loading state and results to mounting layer. + imageShadowNode->setImageManager(imageManager_); + } + + private: + const SharedImageManager imageManager_; +}; + +} // namespace react +} // namespace facebook diff --git a/tester/harmony/svg/src/main/cpp/svgImage/RNSVGImageShadowNode.cpp b/tester/harmony/svg/src/main/cpp/svgImage/RNSVGImageShadowNode.cpp new file mode 100644 index 0000000000000000000000000000000000000000..22d5f9c2ecf6368f903d85979a4fcf677354b868 --- /dev/null +++ b/tester/harmony/svg/src/main/cpp/svgImage/RNSVGImageShadowNode.cpp @@ -0,0 +1,63 @@ +/* + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#include +#include + +#include + +#include "RNSVGImageShadowNode.h" + +namespace facebook { +namespace react { + +const char RNSVGImageComponentName[] = "RNSVGImage"; + +void RNSVGImageShadowNode::setImageManager( + const SharedImageManager &imageManager) { + ensureUnsealed(); + imageManager_ = imageManager; +} + +ImageSource RNSVGImageShadowNode::getImageSource() const { + auto source = getConcreteProps().src; + + auto layoutMetrics = getLayoutMetrics(); + auto size = layoutMetrics.getContentFrame().size; + auto scale = layoutMetrics.pointScaleFactor; + source.size = size; + source.scale = scale; + return source; +} + +void RNSVGImageShadowNode::updateStateIfNeeded() { + ensureUnsealed(); + + auto imageSource = getImageSource(); + auto const ¤tState = getStateData(); + bool hasSameImageSource = currentState.getImageSource() == imageSource; + + if (hasSameImageSource) { + return; + } + + auto state = RNSVGImageState{ + imageSource, + imageManager_->requestImage(imageSource, getSurfaceId()), + }; + setStateData(std::move(state)); +} + +#pragma mark - LayoutableShadowNode + +void RNSVGImageShadowNode::layout(LayoutContext layoutContext) { + updateStateIfNeeded(); + ConcreteViewShadowNode::layout(layoutContext); +} + +} // namespace react +} // namespace facebook diff --git a/tester/harmony/svg/src/main/cpp/svgImage/RNSVGImageShadowNode.h b/tester/harmony/svg/src/main/cpp/svgImage/RNSVGImageShadowNode.h new file mode 100644 index 0000000000000000000000000000000000000000..770349b1be3e1e78370e3801629f12b4b83d38af --- /dev/null +++ b/tester/harmony/svg/src/main/cpp/svgImage/RNSVGImageShadowNode.h @@ -0,0 +1,67 @@ +/* + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#pragma once + +#include +#include +#include +#include +#include +#include + +#include "RNSVGImageState.h" + +namespace facebook { +namespace react { + +JSI_EXPORT extern const char RNSVGImageComponentName[]; + +/* + * `ShadowNode` for component. + */ +class JSI_EXPORT RNSVGImageShadowNode final : public ConcreteViewShadowNode< + RNSVGImageComponentName, + RNSVGImageProps, + ViewEventEmitter, + RNSVGImageState> { + public: + using ConcreteViewShadowNode::ConcreteViewShadowNode; + + static ShadowNodeTraits BaseTraits() { + auto traits = ConcreteViewShadowNode::BaseTraits(); + traits.set(ShadowNodeTraits::Trait::LeafYogaNode); + return traits; + } + + /* + * Associates a shared `ImageManager` with the node. + */ + void setImageManager(const SharedImageManager &imageManager); + + static RNSVGImageState initialStateData( + ShadowNodeFragment const &fragment, + ShadowNodeFamilyFragment const &familyFragment, + ComponentDescriptor const &componentDescriptor) { + auto imageSource = ImageSource{ImageSource::Type::Invalid}; + return {imageSource, {imageSource, nullptr, {}}}; + } + +#pragma mark - LayoutableShadowNode + + void layout(LayoutContext layoutContext) override; + + private: + ImageSource getImageSource() const; + + SharedImageManager imageManager_; + + void updateStateIfNeeded(); +}; + +} // namespace react +} // namespace facebook diff --git a/tester/harmony/svg/src/main/cpp/svgImage/RNSVGImageState.cpp b/tester/harmony/svg/src/main/cpp/svgImage/RNSVGImageState.cpp new file mode 100644 index 0000000000000000000000000000000000000000..ee42a2d444fc124a9607f6de60efeb6de856d1a5 --- /dev/null +++ b/tester/harmony/svg/src/main/cpp/svgImage/RNSVGImageState.cpp @@ -0,0 +1,21 @@ +/* + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#include "RNSVGImageState.h" + +namespace facebook { +namespace react { + +ImageSource RNSVGImageState::getImageSource() const { + return imageSource_; +} + +ImageRequest const &RNSVGImageState::getImageRequest() const { + return *imageRequest_; +} +} // namespace react +} // namespace facebook diff --git a/tester/harmony/svg/src/main/cpp/svgImage/RNSVGImageState.h b/tester/harmony/svg/src/main/cpp/svgImage/RNSVGImageState.h new file mode 100644 index 0000000000000000000000000000000000000000..746b801093ac595defd9f12d230b00c2b2116e8a --- /dev/null +++ b/tester/harmony/svg/src/main/cpp/svgImage/RNSVGImageState.h @@ -0,0 +1,64 @@ +/* + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#pragma once + +#include +#include +#include + +#ifdef ANDROID +#include +#include +#endif + +namespace facebook { +namespace react { + +/* + * State for component. + */ +class JSI_EXPORT RNSVGImageState final { + public: + RNSVGImageState(ImageSource const &imageSource, ImageRequest imageRequest) + : imageSource_(imageSource), + imageRequest_( + std::make_shared(std::move(imageRequest))){}; + + /* + * Returns stored ImageSource object. + */ + ImageSource getImageSource() const; + + /* + * Exposes for reading stored `ImageRequest` object. + * `ImageRequest` object cannot be copied or moved from `ImageLocalData`. + */ + ImageRequest const &getImageRequest() const; + +#ifdef ANDROID + RNSVGImageState(RNSVGImageState const &previousState, folly::dynamic data){}; + + /* + * Empty implementation for Android because it doesn't use this class. + */ + folly::dynamic getDynamic() const { + return {}; + }; + + MapBuffer getMapBuffer() const { + return MapBufferBuilder::EMPTY(); + }; +#endif + + private: + ImageSource imageSource_; + std::shared_ptr imageRequest_; +}; + +} // namespace react +} // namespace facebook diff --git a/tester/harmony/svg/src/main/cpp/turboModules/RNSVGImageModule.cpp b/tester/harmony/svg/src/main/cpp/turboModules/RNSVGImageModule.cpp new file mode 100644 index 0000000000000000000000000000000000000000..700b6a79d78533198f5b207f176c3e22752ec2b4 --- /dev/null +++ b/tester/harmony/svg/src/main/cpp/turboModules/RNSVGImageModule.cpp @@ -0,0 +1,13 @@ +#include "RNSVGImageModule.h" + +using namespace rnoh; +using namespace facebook; + +RNSVGImageModule::RNSVGImageModule( + const ArkTSTurboModule::Context ctx, + const std::string name) + : ArkTSTurboModule(ctx, name) { + methodMap_ = { + ARK_ASYNC_METHOD_METADATA(getBase64String, 1), + }; +} \ No newline at end of file diff --git a/tester/harmony/svg/src/main/cpp/turboModules/RNSVGImageModule.h b/tester/harmony/svg/src/main/cpp/turboModules/RNSVGImageModule.h new file mode 100644 index 0000000000000000000000000000000000000000..a77427705c82d78c79a256a4e1b3e319ab2077a9 --- /dev/null +++ b/tester/harmony/svg/src/main/cpp/turboModules/RNSVGImageModule.h @@ -0,0 +1,13 @@ +#pragma once + +#include +#include "RNOH/ArkTSTurboModule.h" + +namespace rnoh { + +class JSI_EXPORT RNSVGImageModule : public ArkTSTurboModule { +public: + RNSVGImageModule(const ArkTSTurboModule::Context ctx, const std::string name); +}; + +} // namespace rnoh diff --git a/tester/harmony/svg/src/main/cpp/turboModules/RNSVGRenderableModule.cpp b/tester/harmony/svg/src/main/cpp/turboModules/RNSVGRenderableModule.cpp new file mode 100644 index 0000000000000000000000000000000000000000..0329af7f5419b010b4917e0b5f9c0e6489404a80 --- /dev/null +++ b/tester/harmony/svg/src/main/cpp/turboModules/RNSVGRenderableModule.cpp @@ -0,0 +1,105 @@ +/** + * This code was generated by + * [react-native-codegen](https://www.npmjs.com/package/react-native-codegen). + * + * Do not edit this file as changes may cause incorrect behavior and will be + * lost once this code is regenerated. + * + * @generated by codegen project: GenerateModuleH.js + */ + +#include "RNSVGRenderableModule.h" + +using namespace facebook; +using namespace react; + +namespace rnoh { +namespace svg { + +bool RNSVGRenderableModule::isPointInFill(facebook::jsi::Runtime &rt, int32_t tag, std::optional options) { return false; } +bool RNSVGRenderableModule::isPointInStroke(facebook::jsi::Runtime &rt, int32_t tag, std::optional options) { return false; } +double RNSVGRenderableModule::getTotalLength(jsi::Runtime &rt, int32_t tag){return 0;} +jsi::Object RNSVGRenderableModule::getPointAtLength(jsi::Runtime &rt, int32_t tag, std::optional options){return jsi::Object(rt);}; +jsi::Object RNSVGRenderableModule::getBBox(jsi::Runtime &rt, int32_t tag, std::optional options){return jsi::Object(rt);}; +jsi::Object RNSVGRenderableModule::getCTM(jsi::Runtime &rt, int32_t tag){return jsi::Object(rt);}; +jsi::Object RNSVGRenderableModule::getScreenCTM(jsi::Runtime &rt, int32_t tag){return jsi::Object(rt);}; +jsi::Value RNSVGRenderableModule::getRawResource(jsi::Runtime &rt, jsi::String name){return jsi::Object(rt);}; + +static jsi::Value __hostFunction_RNSVGRenderableModule_isPointInFill(jsi::Runtime &rt,react::TurboModule &turboModule,const jsi::Value *args,size_t count) { + return static_cast(&turboModule) + ->isPointInFill( + rt, args[0].isNull() || args[0].isUndefined() ? 0 : std::make_optional(args[0].asNumber()).value(), + count <= 1 || args[1].isNull() || args[1].isUndefined() ? std::nullopt + : std::make_optional(args[1].asObject(rt))); +} + +static jsi::Value __hostFunction_RNSVGRenderableModule_isPointInStroke(jsi::Runtime &rt, + react::TurboModule &turboModule, + const jsi::Value *args, + size_t count) { + return static_cast(&turboModule) + ->isPointInStroke( + rt, args[0].isNull() || args[0].isUndefined() ? 0 : std::make_optional(args[0].asNumber()).value(), + count <= 1 || args[1].isNull() || args[1].isUndefined() ? std::nullopt + : std::make_optional(args[1].asObject(rt))); +} +static jsi::Value __hostFunction_RNSVGRenderableModule_getTotalLength(jsi::Runtime &rt, + react::TurboModule &turboModule, + const jsi::Value *args, + size_t count) { + return static_cast(&turboModule) + ->getTotalLength(rt, args[0].isNull() || args[0].isUndefined() ? 0 + : std::make_optional(args[0].asNumber()).value()); +} +static jsi::Value __hostFunction_RNSVGRenderableModule_getPointAtLength(jsi::Runtime &rt, + react::TurboModule &turboModule, + const jsi::Value *args, + size_t count) { + return static_cast(&turboModule) + ->getPointAtLength( + rt, args[0].isNull() || args[0].isUndefined() ? 0 : std::make_optional(args[0].asNumber()).value(), + count <= 1 || args[1].isNull() || args[1].isUndefined() ? std::nullopt + : std::make_optional(args[1].asObject(rt))); +} +static jsi::Value __hostFunction_RNSVGRenderableModule_getBBox(jsi::Runtime &rt, + react::TurboModule &turboModule, + const jsi::Value *args, size_t count) { + return static_cast(&turboModule) + ->getBBox(rt, args[0].isNull() || args[0].isUndefined() ? 0 : std::make_optional(args[0].asNumber()).value(), + count <= 1 || args[1].isNull() || args[1].isUndefined() ? std::nullopt + : std::make_optional(args[1].asObject(rt))); +} +static jsi::Value __hostFunction_RNSVGRenderableModule_getCTM(jsi::Runtime &rt, + react::TurboModule &turboModule, + const jsi::Value *args, size_t count) { + return static_cast(&turboModule) + ->getCTM(rt, args[0].isNull() || args[0].isUndefined() ? 0 : std::make_optional(args[0].asNumber()).value()); +} +static jsi::Value __hostFunction_RNSVGRenderableModule_getScreenCTM(jsi::Runtime &rt, + react::TurboModule &turboModule, + const jsi::Value *args, + size_t count) { + return static_cast(&turboModule) + ->getScreenCTM(rt, args[0].isNull() || args[0].isUndefined() ? 0 + : std::make_optional(args[0].asNumber()).value()); +} +static jsi::Value __hostFunction_RNSVGRenderableModule_getRawResource(jsi::Runtime &rt, + react::TurboModule &turboModule, + const jsi::Value *args, + size_t count) { + return static_cast(&turboModule)->getRawResource(rt, args[0].asString(rt)); +} + +RNSVGRenderableModule::RNSVGRenderableModule(const ArkTSTurboModule::Context ctx, const std::string name) + : ArkTSTurboModule(ctx, name) { + methodMap_["isPointInFill"] = MethodMetadata{2, __hostFunction_RNSVGRenderableModule_isPointInFill}; + methodMap_["isPointInStroke"] = MethodMetadata{2, __hostFunction_RNSVGRenderableModule_isPointInStroke}; + methodMap_["getTotalLength"] = MethodMetadata{1, __hostFunction_RNSVGRenderableModule_getTotalLength}; + methodMap_["getPointAtLength"] = MethodMetadata{2, __hostFunction_RNSVGRenderableModule_getPointAtLength}; + methodMap_["getBBox"] = MethodMetadata{2, __hostFunction_RNSVGRenderableModule_getBBox}; + methodMap_["getCTM"] = MethodMetadata{1, __hostFunction_RNSVGRenderableModule_getCTM}; + methodMap_["getScreenCTM"] = MethodMetadata{1, __hostFunction_RNSVGRenderableModule_getScreenCTM}; + methodMap_["getRawResource"] = MethodMetadata{1, __hostFunction_RNSVGRenderableModule_getRawResource}; +} +} // namespace svg +} // namespace rnoh \ No newline at end of file diff --git a/tester/harmony/svg/src/main/cpp/turboModules/RNSVGRenderableModule.h b/tester/harmony/svg/src/main/cpp/turboModules/RNSVGRenderableModule.h new file mode 100644 index 0000000000000000000000000000000000000000..ae798bf5951dd19c368fd74499c307ac2a7edb7d --- /dev/null +++ b/tester/harmony/svg/src/main/cpp/turboModules/RNSVGRenderableModule.h @@ -0,0 +1,29 @@ + +#pragma once + +// This file was generated. +#pragma once + +#include +#include +#include "RNOH/ArkTSTurboModule.h" +using namespace facebook; + +namespace rnoh { +namespace svg { + +class JSI_EXPORT RNSVGRenderableModule : public ArkTSTurboModule { +public: + RNSVGRenderableModule(const ArkTSTurboModule::Context ctx, const std::string name); + bool isPointInFill(jsi::Runtime &rt, int32_t tag, std::optional options); + bool isPointInStroke(jsi::Runtime &rt, int32_t tag, std::optional options); + double getTotalLength(jsi::Runtime &rt, int32_t tag); + jsi::Object getPointAtLength(jsi::Runtime &rt, int32_t tag,std::optional options); + jsi::Object getBBox(jsi::Runtime &rt, int32_t tag, std::optional options); + jsi::Object getCTM(jsi::Runtime &rt, int32_t tag); + jsi::Object getScreenCTM(jsi::Runtime &rt, int32_t tag); + jsi::Value getRawResource(jsi::Runtime &rt, jsi::String name); +}; + +} // namespace svg +} // namespace rnoh diff --git a/tester/harmony/svg/src/main/cpp/turboModules/RNSVGSvgViewModule.cpp b/tester/harmony/svg/src/main/cpp/turboModules/RNSVGSvgViewModule.cpp new file mode 100644 index 0000000000000000000000000000000000000000..2d69164922999c74b849f6e488603a34b4dfe653 --- /dev/null +++ b/tester/harmony/svg/src/main/cpp/turboModules/RNSVGSvgViewModule.cpp @@ -0,0 +1,66 @@ + +#include "RNSVGSvgViewModule.h" + +using namespace facebook; +using namespace react; + +namespace rnoh { +namespace svg { + +using Object = std::optional; + +void RNSVGSvgViewModule::toDataURL(jsi::Runtime &rt, Int32_t tag, Object object, Callback &&callback) { + // 获取图片的bitmap并将其转化为base64 + std::string base64; + auto weakSvgNode = SvgViewManager::getInstance().getSvgViewByTag(*tag); + if (weakSvgNode.lock()) { + auto svgRootNode = weakSvgNode.lock(); + OH_Drawing_Bitmap *bitmap = OH_Drawing_BitmapCreate(); + OH_Drawing_BitmapFormat format = {COLOR_FORMAT_BGRA_8888, ALPHA_FORMAT_OPAQUE}; + auto size = svgRootNode->GetSize(); + OH_Drawing_BitmapBuild(bitmap, size.Width(), size.Height(), &format); + OH_Drawing_Canvas *canvas = OH_Drawing_CanvasCreate(); + OH_Drawing_CanvasBind(canvas, bitmap); + // 设置SvgNode节点相关信息 + if (svgRootNode->GetContext()) { + svgRootNode->GetContext()->ClearIdMap(); + } + svgRootNode->ContextTraversal(); + svgRootNode->InitStyle({}); + svgRootNode->Draw(canvas); + base64 = StringUtils::bitmapToBase64(bitmap); + // 销毁bitmap和canvas + OH_Drawing_CanvasDestroy(canvas); + // 销毁bitmap对象 + OH_Drawing_BitmapDestroy(bitmap); + } + jsInvoker_->invokeAsync([base64, endCallback = std::move(*callback)] { endCallback(base64); }); + return; +} + +static jsi::Value __hostFunction_RNSVGSvgViewModule_toDataURL(jsi::Runtime &rt, react::TurboModule &turboModule, + const jsi::Value *args, size_t count) { + auto tag = args[0].isNull() || args[0].isUndefined() ? std::nullopt : std::make_optional(args[0].asNumber()); + auto options = args[1].isNull() || args[1].isUndefined() ? std::nullopt : std::make_optional(args[1].asObject(rt)); + auto self = static_cast(&turboModule); + if (args[2].isObject()) { + auto callback = std::make_shared(std::move(args[2].getObject(rt).getFunction(rt))); + auto endCallback = [&rt, callback = std::move(callback)](std::string base64) { + auto base64Value = jsi::String::createFromUtf8(rt, base64); + callback->call(rt, {std::move(base64Value)}); + }; + static_cast(&turboModule)->toDataURL(rt, tag, std::move(options), std::move(endCallback)); + return jsi::Value::undefined(); + } + static_cast(&turboModule) + ->toDataURL(rt, tag, std::move(options), [self, &rt](std::string base64) {}); + return jsi::Value::undefined(); +} + +RNSVGSvgViewModule::RNSVGSvgViewModule(const ArkTSTurboModule::Context ctx, const std::string name) + : ArkTSTurboModule(ctx, name) { + { methodMap_["toDataURL"] = MethodMetadata{1, __hostFunction_RNSVGSvgViewModule_toDataURL}; }; +} + +} // namespace svg +} // namespace rnoh diff --git a/tester/harmony/svg/src/main/cpp/turboModules/RNSVGSvgViewModule.h b/tester/harmony/svg/src/main/cpp/turboModules/RNSVGSvgViewModule.h new file mode 100644 index 0000000000000000000000000000000000000000..cbd03d2d297f14123adbe726919dc13c5832bd73 --- /dev/null +++ b/tester/harmony/svg/src/main/cpp/turboModules/RNSVGSvgViewModule.h @@ -0,0 +1,29 @@ + +#pragma once + +#include +#include +#include "RNOH/ArkTSTurboModule.h" +#include "SvgViewManager.h" +#include "utils/StringUtils.h" +#include "native_drawing/drawing_canvas.h" +#include + +using namespace facebook; + +namespace rnoh { +namespace svg { + +class JSI_EXPORT RNSVGSvgViewModule : public ArkTSTurboModule { + using Object = std::optional; + using Int32_t = std::optional; + using Callback = std::optional>; + +public: + RNSVGSvgViewModule(const ArkTSTurboModule::Context ctx, const std::string name); + + void toDataURL(jsi::Runtime &rt, Int32_t tag, Object object, Callback &&callback); +}; + +} // namespace svg +} // namespace rnoh diff --git a/tester/harmony/svg/src/main/cpp/utils/GlyphContext.cpp b/tester/harmony/svg/src/main/cpp/utils/GlyphContext.cpp new file mode 100644 index 0000000000000000000000000000000000000000..c4be121c8e7e864587dcef0d3ab7a17eac8f4ed7 --- /dev/null +++ b/tester/harmony/svg/src/main/cpp/utils/GlyphContext.cpp @@ -0,0 +1,209 @@ +#include "GlyphContext.h" +namespace rnoh { +namespace svg { + +void GlyphContext::pushContext(bool reset, const std::shared_ptr& node, DimensionArray x, DimensionArray y, + DimensionArray deltaX, DimensionArray deltaY, DimensionArray rotate) { + if (reset) { + this->reset(); + } + + DLOG(INFO) << "GLYPH PUSHING" << " mTop = " << mTop << " node = " << node; + pushNode(node); + + if (!x.empty()) { + mXsIndex++; + mXIndex = -1; + mXIndices.push_back(mXIndex); + mXs = x; + mXsContext.push_back(mXs); + } + + if (!y.empty()) { + mYsIndex++; + mYIndex = -1; + mYIndices.push_back(mYIndex); + mYs = y; + mYsContext.push_back(mYs); + } + + if (!deltaX.empty()) { + mDXsIndex++; + mDXIndex = -1; + mDXIndices.push_back(mDXIndex); + mDXs = deltaX; + mDXsContext.push_back(mDXs); + } + + if (!deltaY.empty()) { + mDYsIndex++; + mDYIndex = -1; + mDYIndices.push_back(mDYIndex); + mDYs = deltaY; + mDYsContext.push_back(mDYs); + } + + if (!rotate.empty()) { + mRsIndex++; + mRIndex = -1; + mRIndices.push_back(mRIndex); + // convert Dimension vector to double + mRs.clear(); + for (const auto &ro : rotate) { + mRs.emplace_back(ro.Value()); + } + mRsContext.push_back(mRs); + } + + pushIndices(); +} +void GlyphContext::popContext() { + mXsIndices.pop_back(); + mYsIndices.pop_back(); + mDXsIndices.pop_back(); + mDYsIndices.pop_back(); + mRsIndices.pop_back(); + + mTop--; + + int x = mXsIndex; + int y = mYsIndex; + int dx = mDXsIndex; + int dy = mDYsIndex; + int r = mRsIndex; + + DLOG(INFO) << "GLYPH mTop = " << mTop << " mXsIndices size = " << mXsIndices.size(); + mXsIndex = mXsIndices[mTop]; + mYsIndex = mYsIndices[mTop]; + mDXsIndex = mDXsIndices[mTop]; + mDYsIndex = mDYsIndices[mTop]; + mRsIndex = mRsIndices[mTop]; + + if (x != mXsIndex) { + mXsContext.erase(mXsContext.begin() + x); + mXs = mXsContext[mXsIndex]; + mXIndex = mXIndices[mXsIndex]; + } + if (y != mYsIndex) { + mYsContext.erase(mYsContext.begin() + y); + mYs = mYsContext[mYsIndex]; + mYIndex = mYIndices[mYsIndex]; + } + if (dx != mDXsIndex) { + mDXsContext.erase(mDXsContext.begin() + dx); + mDXs = mDXsContext[mDXsIndex]; + mDXIndex = mDXIndices[mDXsIndex]; + } + if (dy != mDYsIndex) { + mDYsContext.erase(mDYsContext.begin() + dy); + mDYs = mDYsContext[mDYsIndex]; + mDYIndex = mDYIndices[mDYsIndex]; + } + if (r != mRsIndex) { + mRsContext.erase(mRsContext.begin() + r); + mRs = mRsContext[mRsIndex]; + mRIndex = mRIndices[mRsIndex]; + } +} +double GlyphContext::nextX(double advance) { + incrementIndices(mXIndices, mXsIndex); + + int nextIndex = mXIndex + 1; + if (nextIndex < mXs.size()) { + mDX = 0; + mXIndex = nextIndex; + Dimension string = mXs[nextIndex]; + mX = string.RelativeConvertToPx(mWidth, mScale); + } + + mX += advance; + + return mX; +} +double GlyphContext::nextDeltaX() { + incrementIndices(mDXIndices, mDXsIndex); + + int nextIndex = mDXIndex + 1; + if (nextIndex < mDXs.size()) { + mDXIndex = nextIndex; + Dimension string = mDXs[nextIndex]; + double val = string.RelativeConvertToPx(mWidth, mScale); + mDX += val; + } + + return mDX; +} +double GlyphContext::nextDeltaY() { + incrementIndices(mDYIndices, mDYsIndex); + + int nextIndex = mDYIndex + 1; + if (nextIndex < mDYs.size()) { + mDYIndex = nextIndex; + Dimension string = mDYs[nextIndex]; + double val = string.RelativeConvertToPx(mHeight, mScale); + mDY += val; + } + + return mDY; +} + +double GlyphContext::nextRotation() { + incrementIndices(mRIndices, mRsIndex); + + mRIndex = std::min(mRIndex + 1, static_cast(mRs.size()) - 1); + + if (mRIndex < 0) { + // DLOG(INF0) << "ROTATION IS NULL"; + return 0.0; + } + return mRs[mRIndex]; +} +double GlyphContext::nextY() { + incrementIndices(mYIndices, mYsIndex); + + int nextIndex = mYIndex + 1; + if (nextIndex < mYs.size()) { + mDY = 0; + mYIndex = nextIndex; + Dimension string = mYs[nextIndex]; + mY = string.RelativeConvertToPx(mHeight, mScale); + } + + return mY; +} +void GlyphContext::incrementIndices(std::vector &indices, int topIndex) { + for (int index = topIndex; index >= 0; index--) { + int xIndex = indices[index]; + indices[index] = xIndex + 1; + } +} +GlyphContext::GlyphContext(float scale, float width, float height) : mScale(scale), mWidth(width), mHeight(height) { + mXsContext.push_back(mXs); + mYsContext.push_back(mYs); + mDXsContext.push_back(mDXs); + mDYsContext.push_back(mDYs); + mRsContext.push_back(mRs); + + mXIndices.push_back(mXIndex); + mYIndices.push_back(mYIndex); + mDXIndices.push_back(mDXIndex); + mDYIndices.push_back(mDYIndex); + mRIndices.push_back(mRIndex); + + pushIndices(); +} +void GlyphContext::pushIndices() { + mXsIndices.push_back(mXsIndex); + mYsIndices.push_back(mYsIndex); + mDXsIndices.push_back(mDXsIndex); + mDYsIndices.push_back(mDYsIndex); + mRsIndices.push_back(mRsIndex); +} +void GlyphContext::reset() { + mXsIndex = mYsIndex = mDXsIndex = mDYsIndex = mRsIndex = 0; + mXIndex = mYIndex = mDXIndex = mDYIndex = mRIndex = -1; + mX = mY = mDX = mDY = 0; +} + +} // namespace svg +} // namespace rnoh \ No newline at end of file diff --git a/tester/harmony/svg/src/main/cpp/utils/GlyphContext.h b/tester/harmony/svg/src/main/cpp/utils/GlyphContext.h new file mode 100644 index 0000000000000000000000000000000000000000..4a0e8de5eb25ecd5d249d214e70973b0aab68b90 --- /dev/null +++ b/tester/harmony/svg/src/main/cpp/utils/GlyphContext.h @@ -0,0 +1,101 @@ +#pragma once + +#include +#include +#include +#include +#include "properties/Dimension.h" +#include "utils/SvgUtils.h" +#include "SvgNode.h" + +namespace rnoh { +namespace svg { + +class GlyphContext { + +private: + std::vector mXs; + std::vector mYs; + std::vector mDXs; + std::vector mDYs; + std::vector mRs; + int mXsIndex = 0; + int mYsIndex = 0; + int mDXsIndex = 0; + int mDYsIndex = 0; + int mRsIndex = 0; + int mXIndex = 0; + int mYIndex = 0; + int mDXIndex = 0; + int mDYIndex = 0; + int mRIndex = 0; + int mTop = 0; + float mScale = 0.0f; + float mWidth = 0.0f; + float mHeight = 0.0f; + std::vector mXsIndices; + std::vector mYsIndices; + std::vector mDXsIndices; + std::vector mDYsIndices; + std::vector mRsIndices; + std::vector> mXsContext; + std::vector> mYsContext; + std::vector> mDXsContext; + std::vector> mDYsContext; + std::vector> mRsContext; + std::vector mXIndices; + std::vector mYIndices; + std::vector mDXIndices; + std::vector mDYIndices; + std::vector mRIndices; + double mX = 0.0; + double mY = 0.0; + double mDX = 0.0; + double mDY = 0.0; + + void pushIndices(); + + void reset(); + + void pushNode(const std::shared_ptr &node) { + mTop++; + } + +public: + GlyphContext(float scale, float width, float height); + + void pushContext(const std::shared_ptr& node) { + pushNode(node); + pushIndices(); + } + + using DimensionArray = const std::vector &; + void pushContext(bool reset, const std::shared_ptr& node, DimensionArray x, DimensionArray y, DimensionArray deltaX, + DimensionArray deltaY, DimensionArray rotate); + + void popContext(); + + static void incrementIndices(std::vector &indices, int topIndex); + + /** + * @param advance in x position by the next span. + * @return x position for this next span. + */ + double nextX(double advance); + + double nextY(); + + double nextDeltaX(); + + double nextDeltaY(); + + double nextRotation(); + + float getWidth() { return mWidth; } + + + float getHeight() { return mHeight; } +}; + +} // namespace svg +} // namespace rnoh \ No newline at end of file diff --git a/tester/harmony/svg/src/main/cpp/utils/LinearMap.h b/tester/harmony/svg/src/main/cpp/utils/LinearMap.h new file mode 100644 index 0000000000000000000000000000000000000000..9756ec38cdfd7d96ac7245f74047b583ab5004b6 --- /dev/null +++ b/tester/harmony/svg/src/main/cpp/utils/LinearMap.h @@ -0,0 +1,48 @@ +// from ArkUI "frameworks/base/utils/linear_map.h" +#pragma once + +#include +#include + +namespace rnoh { +namespace svg { + +template +struct LinearMapNode { + const char* key; + T value; +}; + +// the key type K must can be compared. +template +struct LinearEnumMapNode { + K key; + V value; +}; + +// these binary search functions in linear map, so the map must be sorted by key. +template +int64_t BinarySearchFindIndex(const LinearMapNode* vec, size_t length, const char* key) +{ + auto it = std::lower_bound( + vec, vec + length, key, [](LinearMapNode lhs, const char* key) { return strcmp(lhs.key, key) < 0; }); + if (it == vec + length || strcmp(it->key, key) != 0) { + return -1; + } else { + return it - vec; + } +} + +template +int64_t BinarySearchFindIndex(const LinearEnumMapNode* vec, size_t length, K key) +{ + auto it = + std::lower_bound(vec, vec + length, key, [](LinearEnumMapNode lhs, K key) { return lhs.key < key; }); + if (it == vec + length || it->key != key) { + return -1; + } else { + return it - vec; + } +} +} // namespace svg +} // namespace rnoh diff --git a/tester/harmony/svg/src/main/cpp/utils/PathParserUtils.cpp b/tester/harmony/svg/src/main/cpp/utils/PathParserUtils.cpp new file mode 100644 index 0000000000000000000000000000000000000000..4175f27155fd5c195c0166e8f1585d2b5fdb9bc8 --- /dev/null +++ b/tester/harmony/svg/src/main/cpp/utils/PathParserUtils.cpp @@ -0,0 +1,578 @@ +#include "PathParserUtils.h" +#include +#include +#include +#include + +namespace rnoh { +namespace svg { + +drawing::Path PathParserUtils::parse(std::string d) { + mPath = drawing::Path(); + elements.clear(); + if (d.empty()) { + return mPath; + } + char prev_cmd = ' '; + l = d.length(); + s = d; + i = 0; + + mPenX = 0.0; + mPenY = 0.0; + mPivotX = 0.0; + mPivotY = 0.0; + mPenDownX = 0.0; + mPenDownY = 0.0; + mPenDown = false; + + while (i < l) { + skip_spaces(); + + if (i >= l) { + break; + } + + bool has_prev_cmd = prev_cmd != ' '; + char first_char = s[i]; + + if (!has_prev_cmd && first_char != 'M' && first_char != 'm') { + // The first segment must be a MoveTo. + throw std::runtime_error("Unexpected character '" + std::string(1, first_char) + + "' (i=" + std::to_string(i) + ", s=" + s + ")"); + } + + // TODO: simplify + bool is_implicit_move_to; + char cmd; + if (is_cmd(first_char)) { + is_implicit_move_to = false; + cmd = first_char; + i += 1; + } else if (is_number_start(first_char) && has_prev_cmd) { + if (prev_cmd == 'Z' || prev_cmd == 'z') { + // ClosePath cannot be followed by a number. + throw std::runtime_error("Unexpected number after 'z' (s=" + s + ")"); + } + + if (prev_cmd == 'M' || prev_cmd == 'm') { + // 'If a moveto is followed by multiple pairs of coordinates, + // the subsequent pairs are treated as implicit lineto commands.' + // So we parse them as LineTo. + is_implicit_move_to = true; + cmd = is_absolute(prev_cmd) ? 'L' : 'l'; + } else { + is_implicit_move_to = false; + cmd = prev_cmd; + } + } else { + throw std::runtime_error("Unexpected character '" + std::string(1, first_char) + + "' (i=" + std::to_string(i) + ", s=" + s + ")"); + } + + bool absolute = is_absolute(cmd); + switch (cmd) { + case 'm': { + move(parse_list_number(), parse_list_number()); + break; + } + case 'M': { + moveTo(parse_list_number(), parse_list_number()); + break; + } + case 'l': { + line(parse_list_number(), parse_list_number()); + break; + } + case 'L': { + lineTo(parse_list_number(), parse_list_number()); + break; + } + case 'h': { + line(parse_list_number(), 0); + break; + } + case 'H': { + lineTo(parse_list_number(), mPenY); + break; + } + case 'v': { + line(0, parse_list_number()); + break; + } + case 'V': { + lineTo(mPenX, parse_list_number()); + break; + } + case 'c': { + curve(parse_list_number(), parse_list_number(), parse_list_number(), parse_list_number(), + parse_list_number(), parse_list_number()); + break; + } + case 'C': { + curveTo(parse_list_number(), parse_list_number(), parse_list_number(), parse_list_number(), + parse_list_number(), parse_list_number()); + break; + } + case 's': { + smoothCurve(parse_list_number(), parse_list_number(), parse_list_number(), parse_list_number()); + break; + } + case 'S': { + smoothCurveTo(parse_list_number(), parse_list_number(), parse_list_number(), parse_list_number()); + break; + } + case 'q': { + quadraticBezierCurve(parse_list_number(), parse_list_number(), parse_list_number(), parse_list_number()); + break; + } + case 'Q': { + quadraticBezierCurveTo(parse_list_number(), parse_list_number(), parse_list_number(), parse_list_number()); + break; + } + case 't': { + smoothQuadraticBezierCurve(parse_list_number(), parse_list_number()); + break; + } + case 'T': { + smoothQuadraticBezierCurveTo(parse_list_number(), parse_list_number()); + break; + } + case 'a': { + arc(parse_list_number(), parse_list_number(), parse_list_number(), parse_flag(), parse_flag(), + parse_list_number(), parse_list_number()); + break; + } + case 'A': { + arcTo(parse_list_number(), parse_list_number(), parse_list_number(), parse_flag(), parse_flag(), + parse_list_number(), parse_list_number()); + break; + } + case 'z': + case 'Z': { + close(); + break; + } + default: { + throw std::runtime_error("Unexpected command '" + std::string(1, cmd) + "' (s=" + s + ")"); + } + } + + + if (is_implicit_move_to) { + if (absolute) { + prev_cmd = 'M'; + } else { + prev_cmd = 'm'; + } + } else { + prev_cmd = cmd; + } + } + return mPath; +} + +void PathParserUtils::move(float x, float y) { moveTo(x + mPenX, y + mPenY); } + +void PathParserUtils::moveTo(float x, float y) { + // LOG(INFO) << "[Svg PathParserUtils] move x: " << x << " y: " << y; + mPenDownX = mPivotX = mPenX = x; + mPenDownY = mPivotY = mPenY = y; + mPath.MoveTo(x * mScale, y * mScale); + elements.push_back(PathElement(ElementType::kCGPathElementMoveToPoint, {Point(x, y)})); +} + +void PathParserUtils::line(float x, float y) { lineTo(x + mPenX, y + mPenY); } + +void PathParserUtils::lineTo(float x, float y) { + // LOG(INFO) << "[Svg PathParserUtils] line x: " << x << " y: " << y; + setPenDown(); + mPivotX = mPenX = x; + mPivotY = mPenY = y; + mPath.LineTo(x * mScale, y * mScale); + elements.push_back(PathElement(ElementType::kCGPathElementAddLineToPoint, {Point(x, y)})); +} + +void PathParserUtils::curve(float c1x, float c1y, float c2x, float c2y, float ex, float ey) { + curveTo(c1x + mPenX, c1y + mPenY, c2x + mPenX, c2y + mPenY, ex + mPenX, ey + mPenY); +} + +void PathParserUtils::curveTo(float c1x, float c1y, float c2x, float c2y, float ex, float ey) { + // LOG(INFO) << "[Svg PathParserUtils] curve c1x: " << c1x << " c1y: " << c1y << "ex: " << ex << " ey: " << ey; + mPivotX = c2x; + mPivotY = c2y; + cubicTo(c1x, c1y, c2x, c2y, ex, ey); +} + +void PathParserUtils::cubicTo(float c1x, float c1y, float c2x, float c2y, float ex, float ey) { + setPenDown(); + mPenX = ex; + mPenY = ey; + mPath.CubicTo(c1x * mScale, c1y * mScale, c2x * mScale, c2y * mScale, ex * mScale, ey * mScale); + elements.push_back( + PathElement(ElementType::kCGPathElementAddCurveToPoint, {Point(c1x, c1y), Point(c2x, c2y), Point(ex, ey)})); +} + +void PathParserUtils::smoothCurve(float c1x, float c1y, float ex, float ey) { + smoothCurveTo(c1x + mPenX, c1y + mPenY, ex + mPenX, ey + mPenY); +} + +void PathParserUtils::smoothCurveTo(float c1x, float c1y, float ex, float ey) { + float c2x = c1x; + float c2y = c1y; + c1x = (mPenX * 2) - mPivotX; + c1y = (mPenY * 2) - mPivotY; + mPivotX = c2x; + mPivotY = c2y; + cubicTo(c1x, c1y, c2x, c2y, ex, ey); +} + +void PathParserUtils::quadraticBezierCurve(float c1x, float c1y, float c2x, float c2y) { + quadraticBezierCurveTo(c1x + mPenX, c1y + mPenY, c2x + mPenX, c2y + mPenY); +} + +void PathParserUtils::quadraticBezierCurveTo(float c1x, float c1y, float c2x, float c2y) { + mPivotX = c1x; + mPivotY = c1y; + float ex = c2x; + float ey = c2y; + c2x = (ex + c1x * 2) / 3; + c2y = (ey + c1y * 2) / 3; + c1x = (mPenX + c1x * 2) / 3; + c1y = (mPenY + c1y * 2) / 3; + cubicTo(c1x, c1y, c2x, c2y, ex, ey); +} + +void PathParserUtils::smoothQuadraticBezierCurve(float c1x, float c1y) { + smoothQuadraticBezierCurveTo(c1x + mPenX, c1y + mPenY); +} + +void PathParserUtils::smoothQuadraticBezierCurveTo(float c1x, float c1y) { + // FLog.w(ReactConstants.TAG, "smoothquad c1x: " + c1x + " c1y: " + c1y); + float c2x = c1x; + float c2y = c1y; + c1x = (mPenX * 2) - mPivotX; + c1y = (mPenY * 2) - mPivotY; + quadraticBezierCurveTo(c1x, c1y, c2x, c2y); +} + +void PathParserUtils::arc(float rx, float ry, float rotation, bool outer, bool clockwise, float x, float y) { + arcTo(rx, ry, rotation, outer, clockwise, x + mPenX, y + mPenY); +} + +void PathParserUtils::arcTo(float rx, float ry, float rotation, bool outer, bool clockwise, float x, float y) { + float tX = mPenX; + float tY = mPenY; + + ry = std::abs(ry == 0 ? (rx == 0 ? (y - tY) : rx) : ry); + rx = std::abs(rx == 0 ? (x - tX) : rx); + + if (rx == 0 || ry == 0 || (x == tX && y == tY)) { + lineTo(x, y); + return; + } + + float rad = static_cast(std::atan2(y - tY, x - tX)); + float cos = std::cos(rad); + float sin = std::sin(rad); + x -= tX; + y -= tY; + + // Ellipse Center + float cx = cos * x / 2 + sin * y / 2; + float cy = -sin * x / 2 + cos * y / 2; + float rxry = rx * rx * ry * ry; + float rycx = ry * ry * cx * cx; + float rxcy = rx * rx * cy * cy; + float a = rxry - rxcy - rycx; + + if (a < 0) { + a = static_cast(std::sqrt(1 - a / rxry)); + rx *= a; + ry *= a; + cx = x / 2; + cy = y / 2; + } else { + a = static_cast(std::sqrt(a / (rxcy + rycx))); + + if (outer == clockwise) { + a = -a; + } + float cxd = -a * cy * rx / ry; + float cyd = a * cx * ry / rx; + cx = cos * cxd - sin * cyd + x / 2; + cy = sin * cxd + cos * cyd + y / 2; + } + + // Rotation + Scale Transform + float xx = cos / rx; + float yx = sin / rx; + float xy = -sin / ry; + float yy = cos / ry; + + // Start and End Angle + float sa = static_cast(std::atan2(xy * -cx + yy * -cy, xx * -cx + yx * -cy)); + float ea = static_cast(std::atan2(xy * (x - cx) + yy * (y - cy), xx * (x - cx) + yx * (y - cy))); + + cx += tX; + cy += tY; + x += tX; + y += tY; + + setPenDown(); + + mPenX = mPivotX = x; + mPenY = mPivotY = y; + + if (rx != ry || rad != 0.0f) { + arcToBezier(cx, cy, rx, ry, sa, ea, clockwise, rad); + } else { + float start = static_cast(sa * 180.0 / M_PI); + float end = static_cast(ea * 180.0 / M_PI); + float sweep = std::fabs(std::fmod((start - end), 360.0f)); + + if (outer) { + if (sweep < 180) { + sweep = 360 - sweep; + } + } else { + if (sweep > 180) { + sweep = 360 - sweep; + } + } + + if (!clockwise) { + sweep = -sweep; + } + + mPath.ArcTo((cx - rx) * mScale, (cy - rx) * mScale, (cx + rx) * mScale, (cy + rx) * mScale, start, sweep); + elements.push_back(PathElement(ElementType::kCGPathElementAddQuadCurveToPoint, {Point(x, y)})); + } +} + +void PathParserUtils::close() { + if (mPenDown) { + mPenX = mPenDownX; + mPenY = mPenDownY; + mPenDown = false; + mPath.Close(); + elements.push_back(PathElement(ElementType::kCGPathElementCloseSubpath, {{mPenX, mPenY}})); + } +} + +void PathParserUtils::arcToBezier(float cx, float cy, float rx, float ry, float sa, float ea, bool clockwise, + float rad) { + // Inverse Rotation + Scale Transform + float cos = std::cos(rad); + float sin = std::sin(rad); + float xx = cos * rx; + float yx = -sin * ry; + float xy = sin * rx; + float yy = cos * ry; + + // Bezier Curve Approximation + float arc = ea - sa; + if (arc < 0 && clockwise) { + arc += M_PI * 2; + } else if (arc > 0 && !clockwise) { + arc -= M_PI * 2; + } + + int n = static_cast(std::ceil(std::abs(roundVal(arc / (M_PI / 2))))); + + float step = arc / n; + float k = (4.0f / 3.0f) * std::tan(step / 4); + + float x = std::cos(sa); + float y = std::sin(sa); + + for (int i = 0; i < n; i++) { + float cp1x = x - k * y; + float cp1y = y + k * x; + + sa += step; + x = std::cos(sa); + y = std::sin(sa); + + float cp2x = x + k * y; + float cp2y = y - k * x; + + float c1x = (cx + xx * cp1x + yx * cp1y); + float c1y = (cy + xy * cp1x + yy * cp1y); + float c2x = (cx + xx * cp2x + yx * cp2y); + float c2y = (cy + xy * cp2x + yy * cp2y); + float ex = (cx + xx * x + yx * y); + float ey = (cy + xy * x + yy * y); + + mPath.CubicTo(c1x * mScale, c1y * mScale, c2x * mScale, c2y * mScale, ex * mScale, ey * mScale); + elements.push_back( + PathElement(ElementType::kCGPathElementMoveToPoint, {Point(c1x, c1y), Point(c2x, c2y), Point(ex, ey)})); + } +} + +void PathParserUtils::setPenDown() { + if (!mPenDown) { + mPenDownX = mPenX; + mPenDownY = mPenY; + mPenDown = true; + } +} + +double PathParserUtils::roundVal(double val) { + double multiplier = pow(10, 4); + return round(val * multiplier) / multiplier; +} + +void PathParserUtils::skip_spaces() { + while (i < l && std::isspace(s[i])) + i++; +} + +bool PathParserUtils::is_cmd(char c) { + switch (c) { + case 'M': + case 'm': + case 'Z': + case 'z': + case 'L': + case 'l': + case 'H': + case 'h': + case 'V': + case 'v': + case 'C': + case 'c': + case 'S': + case 's': + case 'Q': + case 'q': + case 'T': + case 't': + case 'A': + case 'a': + return true; + } + return false; +} + +bool PathParserUtils::is_number_start(char c) { return (c >= '0' && c <= '9') || c == '.' || c == '-' || c == '+'; } + +bool PathParserUtils::is_absolute(char c) { return std::isupper(c); } + +bool PathParserUtils::parse_flag() { + skip_spaces(); + + char c = s[i]; + switch (c) { + case '0': + case '1': { + i += 1; + if (i < l && s[i] == ',') { + i += 1; + } + skip_spaces(); + break; + } + default: + throw std::runtime_error("Unexpected flag '" + std::string(1, c) + "' (i=" + std::to_string(i) + ", s=" + s + + ")"); + } + + return c == '1'; +} + +float PathParserUtils::parse_list_number() { + if (i == l) { + throw std::runtime_error("Unexpected end s=(" + s + ")"); + } + + float n = parse_number(); + skip_spaces(); + parse_list_separator(); + + return n; +} + +float PathParserUtils::parse_number() { + // Strip off leading whitespaces. + skip_spaces(); + + if (i == l) { + throw std::runtime_error("Unexpected end (s=" + s + ")"); + } + + int start = i; + + char c = s[i]; + + // Consume sign. + if (c == '-' || c == '+') { + i += 1; + c = s[i]; + } + + // Consume integer. + if (c >= '0' && c <= '9') { + skip_digits(); + if (i < l) { + c = s[i]; + } + } else if (c != '.') { + throw std::runtime_error("Invalid number formatting character '" + std::string(1, c) + + "' (i=" + std::to_string(i) + ", s=" + s + ")"); + } + + // Consume fraction. + if (c == '.') { + i += 1; + skip_digits(); + if (i < l) { + c = s[i]; + } + } + + if ((c == 'e' || c == 'E') && i + 1 < l) { + char c2 = s[i + 1]; + // Check for `em`/`ex`. + if (c2 != 'm' && c2 != 'x') { + i += 1; + c = s[i]; + + if (c == '+' || c == '-') { + i += 1; + skip_digits(); + } else if (c >= '0' && c <= '9') { + skip_digits(); + } else { + throw std::runtime_error("Invalid number formatting character '" + std::string(1, c) + + "' (i=" + std::to_string(i) + ", s=" + s + ")"); + } + } + } + + std::string num = s.substr(start, i - start); + float n = std::stof(num); + + // inf, nan, etc. are an error. + if (std::isinf(n) || std::isnan(n)) { + throw std::runtime_error("Invalid number '" + num + "' (start=" + std::to_string(start) + + ", i=" + std::to_string(i) + ", s=" + s + ")"); + } + + return n; +} + +void PathParserUtils::parse_list_separator() { + if (i < l && s[i] == ',') { + i += 1; + } +} + +void PathParserUtils::skip_digits() { + while (i < l && std::isdigit(s[i])) { + i++; + } +} + +} // namespace svg +} // namespace rnoh \ No newline at end of file diff --git a/tester/harmony/svg/src/main/cpp/utils/PathParserUtils.h b/tester/harmony/svg/src/main/cpp/utils/PathParserUtils.h new file mode 100644 index 0000000000000000000000000000000000000000..6b063bd6ef29e439da1689b9afd8f48598881c22 --- /dev/null +++ b/tester/harmony/svg/src/main/cpp/utils/PathParserUtils.h @@ -0,0 +1,84 @@ +#pragma once +#include "SvgMarkerPositionUtils.h" +#include "drawing/Path.h" +#include +#include +#include +#include + +namespace rnoh { +namespace svg { +class PathParserUtils { + +public: + float mScale; + std::vector elements; + + drawing::Path parse(std::string d); + +private: + int i; + int l; + std::string s; + drawing::Path mPath; + float mPenX, mPenY, mPenDownX, mPenDownY, mPivotX, mPivotY; + bool mPenDown; + + void parse_list_separator(); + + void skip_digits(); + + void close(); + + void setPenDown(); + + void moveTo(float x, float y); + + void move(float x, float y); + + void lineTo(float x, float y); + + void line(float x, float y); + + void cubicTo(float c1x, float c1y, float c2x, float c2y, float ex, float ey); + + void curveTo(float c1x, float c1y, float c2x, float c2y, float ex, float ey); + + void curve(float c1x, float c1y, float c2x, float c2y, float ex, float ey); + + void smoothCurveTo(float c1x, float c1y, float ex, float ey); + + void smoothCurve(float c1x, float c1y, float ex, float ey); + + void quadraticBezierCurveTo(float c1x, float c1y, float c2x, float c2y); + + void quadraticBezierCurve(float c1x, float c1y, float c2x, float c2y); + + void smoothQuadraticBezierCurveTo(float c1x, float c1y); + + void smoothQuadraticBezierCurve(float c1x, float c1y); + + void arcToBezier(float cx, float cy, float rx, float ry, float sa, float ea, bool clockwise, float rad); + + void arcTo(float rx, float ry, float rotation, bool outer, bool clockwise, float x, float y); + + void arc(float rx, float ry, float rotation, bool outer, bool clockwise, float x, float y); + + double roundVal(double val); + + void skip_spaces(); + + bool is_cmd(char c); + + bool is_number_start(char c); + + bool is_absolute(char c); + + bool parse_flag(); + + float parse_number(); + + float parse_list_number(); +}; +} // namespace svg +} // namespace rnoh diff --git a/tester/harmony/svg/src/main/cpp/utils/StringUtils.cpp b/tester/harmony/svg/src/main/cpp/utils/StringUtils.cpp new file mode 100644 index 0000000000000000000000000000000000000000..68cb77dd73896ac33ca5c2b14bdc464aa4aac171 --- /dev/null +++ b/tester/harmony/svg/src/main/cpp/utils/StringUtils.cpp @@ -0,0 +1,111 @@ +#include "StringUtils.h" + + +namespace rnoh { +namespace svg { +namespace StringUtils { +const char *base64_chars[2] = {"ABCDEFGHIJKLMNOPQRSTUVWXYZ" + "abcdefghijklmnopqrstuvwxyz" + "0123456789" + "+/", + + "ABCDEFGHIJKLMNOPQRSTUVWXYZ" + "abcdefghijklmnopqrstuvwxyz" + "0123456789" + "-_"}; + +std::string base64_encode(unsigned char const *bytes_to_encode, size_t in_len, bool url) { + // 这里的in_len 是bytes_to_encode数组的长度,也就是要处理多少数量的单位数据(unsigned char) + size_t len_encoded = (in_len + 2) / 3 * 4; // 这里经过了转化,len_encoded长度变为了像素总数 + + unsigned char trailing_char = url ? '.' : '='; + + const char *base64_chars_ = base64_chars[url]; + + std::string ret; + ret.reserve(len_encoded); + + unsigned int pos = 0; + + while (pos < in_len) { + ret.push_back(base64_chars_[(bytes_to_encode[pos + 0] & 0xfc) >> 2]); + + if (pos + 1 < in_len) { + ret.push_back( + base64_chars_[((bytes_to_encode[pos + 0] & 0x03) << 4) + ((bytes_to_encode[pos + 1] & 0xf0) >> 4)]); + + if (pos + 2 < in_len) { + ret.push_back( + base64_chars_[((bytes_to_encode[pos + 1] & 0x0f) << 2) + ((bytes_to_encode[pos + 2] & 0xc0) >> 6)]); + ret.push_back(base64_chars_[bytes_to_encode[pos + 2] & 0x3f]); + } else { + ret.push_back(base64_chars_[(bytes_to_encode[pos + 1] & 0x0f) << 2]); + ret.push_back(trailing_char); + } + } else { + + ret.push_back(base64_chars_[(bytes_to_encode[pos + 0] & 0x03) << 4]); + ret.push_back(trailing_char); + ret.push_back(trailing_char); + } + pos += 3; + } + return ret; +} +std::string bitmapToBase64(OH_Drawing_Bitmap *bitmap) { + auto width = OH_Drawing_BitmapGetWidth(bitmap); + auto height = OH_Drawing_BitmapGetHeight(bitmap); + auto bitmapAddr = OH_Drawing_BitmapGetPixels(bitmap); + // 设置pixelmap编码格式 + OH_Pixelmap_InitializationOptions *createOption = nullptr; + OH_PixelmapInitializationOptions_Create(&createOption); + OH_PixelmapInitializationOptions_SetWidth(createOption, width); + OH_PixelmapInitializationOptions_SetHeight(createOption, height); + OH_PixelmapInitializationOptions_SetPixelFormat(createOption, PIXEL_FORMAT_BGRA_8888); + OH_PixelmapInitializationOptions_SetAlphaType(createOption, PIXELMAP_ALPHA_TYPE_UNKNOWN); + + // 创建pixelmap实例 + OH_PixelmapNative *pixelMap = nullptr; + Image_ErrorCode errCode = OH_PixelmapNative_CreatePixelmap(reinterpret_cast(bitmapAddr), + width * height * 4, createOption, &pixelMap); + + // 读取图像数据 + size_t destinationSize = width * height * 4; + uint8_t *destination = (uint8_t *)malloc(destinationSize); + errCode = OH_PixelmapNative_ReadPixels(pixelMap, destination, &destinationSize); + + // 设置pixelmap图像信息 + OH_Pixelmap_ImageInfo *imageInfo = nullptr; + OH_PixelmapImageInfo_Create(&imageInfo); + errCode = OH_PixelmapNative_GetImageInfo(pixelMap, imageInfo); + + OH_ImagePackerNative *packer = nullptr; + errCode = OH_ImagePackerNative_Create(&packer); + + // 图片压缩options设置 + OH_PackingOptions *option = nullptr; + OH_PackingOptions_Create(&option); + char type[] = "image/png"; + Image_MimeType imageMimeType = {type, strlen(type)}; + OH_PackingOptions_SetMimeType(option, &imageMimeType); + size_t bufferSize = width * height * 4; + uint8_t *outData = (uint8_t *)malloc(bufferSize); + errCode = OH_ImagePackerNative_PackToDataFromPixelmap(packer, option, pixelMap, outData, &bufferSize); + + std::string base64str = StringUtils::base64_encode(reinterpret_cast(outData), bufferSize); + + // 释放内存 + free(destination); + free(outData); + OH_PixelmapInitializationOptions_Release(createOption); + OH_PixelmapNative_Release(pixelMap); + OH_PixelmapImageInfo_Release(imageInfo); + OH_ImagePackerNative_Release(packer); + OH_PackingOptions_Release(option); + + return base64str; +} + +} // namespace StringUtils +} // namespace svg +} // namespace rnoh \ No newline at end of file diff --git a/tester/harmony/svg/src/main/cpp/utils/StringUtils.h b/tester/harmony/svg/src/main/cpp/utils/StringUtils.h new file mode 100644 index 0000000000000000000000000000000000000000..1cb39f35e15dcc7890141c9aa9359b3b49e56333 --- /dev/null +++ b/tester/harmony/svg/src/main/cpp/utils/StringUtils.h @@ -0,0 +1,677 @@ +// from ArkUI "frameworks/base/utils/string_utils.h" +#pragma once + +#include +#include +#include +#include +#include +#include +#include +#include +#include "properties/Dimension.h" +#include "utils/SvgUtils.h" +#include "native_drawing/drawing_bitmap.h" +#include "multimedia/image_framework/image/image_packer_native.h" +#include "multimedia/image_framework/image/image_source_native.h" +#include "multimedia/image_framework/image/pixelmap_native.h" + +namespace rnoh { +namespace svg { + +namespace StringUtils { +extern const char DEFAULT_STRING[]; +extern const std::wstring DEFAULT_WSTRING; +extern const std::u16string DEFAULT_USTRING; +extern const std::u32string DEFAULT_U32STRING; +constexpr int32_t TEXT_CASE_LOWERCASE = 1; +constexpr int32_t TEXT_CASE_UPPERCASE = 2; +constexpr double PERCENT_VALUE = 100.0; +constexpr double DEGREES_VALUE = 360.0; // one turn means 360 deg +constexpr double GRADIANS_VALUE = 400.0; // one turn means 400 grad +constexpr double RADIANS_VALUE = 2 * M_PI; // one turn means 2*pi rad +const char ELLIPSIS[] = "..."; + + +inline bool NotInUtf16Bmp(char16_t c) +{ + return (c & 0xF800) == 0xD800; +} + +inline bool NotInBmp(wchar_t ch) +{ + return ch >= 0xD800 && ch <= 0xDBFF; +} + +inline bool IsNumber(const std::string& value) +{ + if (value.empty()) { + return false; + } + return std::all_of(value.begin(), value.end(), [](char i) { return isdigit(i); }); +} + +inline void ReplaceSpace(std::string& data) +{ + bool isFirstSpace = true; + auto iter = data.begin(); + while (iter != data.end()) { + if (*iter == ' ') { + if (isFirstSpace) { + iter++; + isFirstSpace = false; + } else { + iter = data.erase(iter); + } + } else if (*iter == '\t') { + *iter = ' '; + } else { + isFirstSpace = true; + iter++; + } + } +} + +inline void ReplaceTabAndNewLine(std::string& data) +{ + for (auto& i : data) { + if (i == '\r' || i == '\n') { + i = ' '; + } + } + ReplaceSpace(data); +} + +inline std::string RestoreEscape(const std::string& src) +{ + std::string res; + for (auto &c : src) { + switch (c) { + case '\n': + res += "\\n"; + break; + case '\r': + res += "\\r"; + break; + case '\t': + res += "\\t"; + break; + default: + res.push_back(c); + break; + } + } + return res; +} + +inline int32_t StringToInt(const std::string& value) +{ + errno = 0; + char* pEnd = nullptr; + int64_t result = std::strtol(value.c_str(), &pEnd, 10); + if (pEnd == value.c_str() || (result < INT_MIN || result > INT_MAX) || errno == ERANGE) { + return 0; + } else { + return result; + } +} + +inline int64_t StringToLongInt(const std::string& value, int64_t defaultErr = 0) +{ + errno = 0; + char* pEnd = nullptr; + int64_t result = std::strtoll(value.c_str(), &pEnd, 10); + if (pEnd == value.c_str() || errno == ERANGE) { + return defaultErr; + } else { + return result; + } +} + +inline uint64_t StringToLongUint(const std::string& value, uint64_t defaultErr = 0) +{ + errno = 0; + char* pEnd = nullptr; + uint64_t result = std::strtoull(value.c_str(), &pEnd, 10); + if (pEnd == value.c_str() || errno == ERANGE) { + return defaultErr; + } else { + return result; + } +} + +inline uint32_t StringToUintCheck(const std::string& value, uint32_t defaultErr = 0) +{ + errno = 0; + char* pEnd = nullptr; + uint64_t result = std::strtoull(value.c_str(), &pEnd, 10); + if ((pEnd == value.c_str()) || ((pEnd != nullptr) && (*pEnd != '\0')) || result > UINT32_MAX || errno == ERANGE) { + return defaultErr; + } else { + return result; + } +} + +inline uint32_t StringToUint(const std::string& value, uint32_t defaultErr = 0) +{ + errno = 0; + char* pEnd = nullptr; + uint64_t result = std::strtoull(value.c_str(), &pEnd, 10); + if (pEnd == value.c_str() || result > UINT32_MAX || errno == ERANGE) { + return defaultErr; + } else { + return result; + } +} + +// generic string to double value method without success check +inline double StringToDouble(const std::string& value) +{ + char* pEnd = nullptr; + errno = 0; + double result = std::strtod(value.c_str(), &pEnd); + if (pEnd == value.c_str() || errno == ERANGE) { + return 0.0; + } else { + return result; + } +} +// string to double method with success check, and support for parsing number string with percentage case +inline bool StringToDouble(const std::string& value, double& result) +{ + errno = 0; + char* pEnd = nullptr; + double res = std::strtod(value.c_str(), &pEnd); + if (pEnd == value.c_str() || errno == ERANGE) { + return false; + } else if (pEnd != nullptr) { + if (std::strcmp(pEnd, "%") == 0) { + result = res / PERCENT_VALUE; + return true; + } else if (std::strcmp(pEnd, "") == 0) { + result = res; + return true; + } + } + return false; +} + +inline float StringToFloat(const std::string& value) +{ + errno = 0; + char* pEnd = nullptr; + float result = std::strtof(value.c_str(), &pEnd); + if (pEnd == value.c_str() || errno == ERANGE) { + return 0.0f; + } else { + return result; + } +} + +static Dimension FromString(const std::string &str) { + static const int32_t percentUnit = 100; + static const std::unordered_map uMap{ + {"px", DimensionUnit::PX}, {"vp", DimensionUnit::VP}, {"fp", DimensionUnit::FP}, + {"%", DimensionUnit::PERCENT}, {"lpx", DimensionUnit::LPX}, {"auto", DimensionUnit::AUTO}, + }; + + double value = 0.0; + DimensionUnit unit = DimensionUnit::FP; + + if (str.empty()) { + return Dimension(value, unit); + } + + for (int32_t i = str.length() - 1; i >= 0; --i) { + if (str[i] >= '0' && str[i] <= '9') { + value = StringUtils::StringToDouble(str.substr(0, i + 1)); + auto subStr = str.substr(i + 1); + unit = uMap.count(subStr) ? uMap.at(subStr) : unit; + value = unit == DimensionUnit::PERCENT ? value / percentUnit : value; + break; + } + } + return Dimension(value, unit); +}; + +static Dimension StringToDimensionWithUnit(const std::string& value, DimensionUnit defaultUnit = DimensionUnit::PX, + float defaultValue = 0.0f, bool isCalc = false) +{ + errno = 0; + if (std::strcmp(value.c_str(), "auto") == 0) { + return Dimension(defaultValue, DimensionUnit::AUTO); + } + char* pEnd = nullptr; + double result = std::strtod(value.c_str(), &pEnd); + if (pEnd == value.c_str() || errno == ERANGE) { + return Dimension(defaultValue, defaultUnit); + } + if (pEnd != nullptr) { + if (std::strcmp(pEnd, "%") == 0) { + // Parse percent, transfer from [0, 100] to [0, 1] + return Dimension(result / 100.0, DimensionUnit::PERCENT); + } + if (std::strcmp(pEnd, "px") == 0) { + return Dimension(result, DimensionUnit::PX); + } + if (std::strcmp(pEnd, "vp") == 0) { + return Dimension(result, DimensionUnit::VP); + } + if (std::strcmp(pEnd, "fp") == 0) { + return Dimension(result, DimensionUnit::FP); + } + if (std::strcmp(pEnd, "lpx") == 0) { + return Dimension(result, DimensionUnit::LPX); + } + if ((std::strcmp(pEnd, "\0") == 0) && isCalc) { + return Dimension(result, DimensionUnit::NONE); + } + if (isCalc) { + return Dimension(result, DimensionUnit::INVALID); + } + } + return Dimension(result, defaultUnit); +} + +// inline CalcDimension StringToCalcDimension( +// const std::string& value, bool useVp = false, DimensionUnit defaultUnit = DimensionUnit::PX) +// { +// if (value.find("calc") != std::string::npos) { +// return CalcDimension(value, DimensionUnit::CALC); +// } else { +// if (useVp) { +// return StringToDimensionWithUnit(value, DimensionUnit::VP); +// } +// return StringToDimensionWithUnit(value, defaultUnit); +// } +// } + +inline Dimension StringToDimension(const std::string& value, bool useVp = false) +{ + return StringToDimensionWithUnit(value, useVp ? DimensionUnit::VP : DimensionUnit::PX); +} + +// inline Dimension StringToDimensionWithThemeValue(const std::string& value, bool useVp, const Dimension& themeValue) +// { +// errno = 0; +// char* pEnd = nullptr; +// std::strtod(value.c_str(), &pEnd); +// if (pEnd == value.c_str() || errno == ERANGE) { +// return themeValue; +// } +// +// return StringToDimensionWithUnit(value, useVp ? DimensionUnit::VP : DimensionUnit::PX); +// } + +static bool StringToDimensionWithUnitNG(const std::string& value, Dimension& dimensionResult, + DimensionUnit defaultUnit = DimensionUnit::PX, float defaultValue = 0.0f, bool isCalc = false) +{ + errno = 0; + if (std::strcmp(value.c_str(), "auto") == 0) { + dimensionResult = Dimension(defaultValue, DimensionUnit::AUTO); + return true; + } + char* pEnd = nullptr; + double result = std::strtod(value.c_str(), &pEnd); + if (pEnd == value.c_str() || errno == ERANGE) { + dimensionResult = Dimension(defaultValue, defaultUnit); + return false; + } + if (pEnd != nullptr) { + if (std::strcmp(pEnd, "%") == 0) { + // Parse percent, transfer from [0, 100] to [0, 1] + dimensionResult = Dimension(result / 100.0, DimensionUnit::PERCENT); + return true; + } + if (std::strcmp(pEnd, "px") == 0) { + dimensionResult = Dimension(result, DimensionUnit::PX); + return true; + } + if (std::strcmp(pEnd, "vp") == 0) { + dimensionResult = Dimension(result, DimensionUnit::VP); + return true; + } + if (std::strcmp(pEnd, "fp") == 0) { + dimensionResult = Dimension(result, DimensionUnit::FP); + return true; + } + if (std::strcmp(pEnd, "lpx") == 0) { + dimensionResult = Dimension(result, DimensionUnit::LPX); + return true; + } + if ((std::strcmp(pEnd, "\0") == 0) && isCalc) { + dimensionResult = Dimension(result, DimensionUnit::NONE); + return true; + } + if (isCalc) { + dimensionResult = Dimension(result, DimensionUnit::INVALID); + return true; + } + if ((std::strcmp(pEnd, "\0") != 0)) { + dimensionResult = Dimension(result, DimensionUnit::NONE); + return false; + } + } + dimensionResult = Dimension(result, defaultUnit); + return true; +} + +// inline bool StringToCalcDimensionNG( +// const std::string& value, CalcDimension& result, bool useVp = false, +// DimensionUnit defaultUnit = DimensionUnit::PX) +// { +// if (value.find("calc") != std::string::npos) { +// result = CalcDimension(value, DimensionUnit::CALC); +// return true; +// } else { +// return StringToDimensionWithUnitNG(value, result, useVp ? DimensionUnit::VP : defaultUnit); +// } +// } + +inline std::string ReplaceChar(std::string str, char old_char, char new_char) +{ + for (char& it : str) { + if (it == old_char) { + it = new_char; + } + } + return str; +} + +inline double StringToDegree(const std::string& value) +{ + // https://developer.mozilla.org/zh-CN/docs/Web/CSS/angle + + errno = 0; + char* pEnd = nullptr; + double result = std::strtod(value.c_str(), &pEnd); + if (pEnd == value.c_str() || errno == ERANGE) { + return 0.0; + } else if (pEnd) { + if ((std::strcmp(pEnd, "deg")) == 0) { + return result; + } else if (std::strcmp(pEnd, "grad") == 0) { + return result / GRADIANS_VALUE * DEGREES_VALUE; + } else if (std::strcmp(pEnd, "rad") == 0) { + return result / RADIANS_VALUE * DEGREES_VALUE; + } else if (std::strcmp(pEnd, "turn") == 0) { + return result * DEGREES_VALUE; + } + } + return StringToDouble(value); +} + +// StringToDegree with check. If the string is valid, change result and return true, otherwise return false. +inline bool StringToDegree(const std::string& value, double& result) +{ + errno = 0; + char* pEnd = nullptr; + double temp = std::strtod(value.c_str(), &pEnd); + if (pEnd == value.c_str() || errno == ERANGE) { + return false; + } else if (pEnd) { + if (*pEnd == '\0') { + result = temp; + return true; + } + if (std::strcmp(pEnd, "deg") == 0) { + result = temp; + return true; + } + if (std::strcmp(pEnd, "grad") == 0) { + result = temp / GRADIANS_VALUE * DEGREES_VALUE; + return true; + } + if (std::strcmp(pEnd, "rad") == 0) { + result = temp / RADIANS_VALUE * DEGREES_VALUE; + return true; + } + if (std::strcmp(pEnd, "turn") == 0) { + result = temp * DEGREES_VALUE; + return true; + } + } + return false; +} + +template +inline void StringSplitter( + const std::string& source, char delimiter, T (*func)(const std::string&), std::vector& out) +{ + out.erase(out.begin(), out.end()); + + if (source.empty()) { + return; + } + + std::size_t startIndex = 0; + for (std::size_t index = 0; index < source.size(); index++) { + if (source[index] != delimiter) { + continue; + } + + if (index > startIndex) { + out.emplace_back(func(source.substr(startIndex, index - startIndex))); + } + startIndex = index + 1; + } + + if (startIndex < source.size()) { + out.emplace_back(func(source.substr(startIndex))); + } +} + +inline bool ParseStringToArray(const std::string& input, std::vector& output) +{ + std::istringstream iss(StringUtils::ReplaceChar(input, ',', ' ')); + std::string token; + + while (iss >> token) { + double value; + if (!StringToDouble(token, value)) { + return false; + } + output.emplace_back(value); + } + + return true; +} + +inline void StringSplitter(const std::string& source, char delimiter, std::vector& out) +{ + using Func = std::string (*)(const std::string&); + Func func = [](const std::string& value) { return value; }; + StringSplitter(source, delimiter, func, out); +} + +inline void StringSplitter(const std::string& source, char delimiter, std::vector& out) +{ + using Func = double (*)(const std::string&); + Func func = [](const std::string& value) { return StringToDouble(value); }; + StringSplitter(source, delimiter, func, out); +} + +inline void StringSplitter(const std::string& source, char delimiter, std::vector& out) +{ + using Func = float (*)(const std::string&); + Func func = [](const std::string& value) { return StringToFloat(value); }; + StringSplitter(source, delimiter, func, out); +} + +inline void StringSplitter(const std::string& source, char delimiter, std::vector& out) +{ + using Func = int32_t (*)(const std::string&); + Func func = [](const std::string& value) { return StringToInt(value); }; + StringSplitter(source, delimiter, func, out); +} + +inline void StringSplitter(const std::string& source, char delimiter, std::vector& out) +{ + using Func = Dimension (*)(const std::string&); + Func func = [](const std::string& value) { return StringToDimension(value); }; + StringSplitter(source, delimiter, func, out); +} + +inline std::string DoubleToString(double value, int32_t precision = 2) +{ + std::ostringstream result; + result.precision(precision); + if (NearEqual(value, Infinity())) { + result << "Infinity"; + } else { + result << std::fixed << value; + } + return result.str(); +} + +inline void DeleteAllMark(std::string& str, const char mark) +{ + str.erase(std::remove(str.begin(), str.end(), mark), str.end()); +} + +inline std::string TrimStr(const std::string& str, char cTrim = ' ') +{ + auto firstPos = str.find_first_not_of(cTrim); + if (firstPos == std::string::npos) { + return str; + } + auto endPos = str.find_last_not_of(cTrim); + return str.substr(firstPos, endPos - firstPos + 1); +} + +inline void TrimStrLeadingAndTrailing(std::string& str, char cTrim = ' ') +{ + auto firstIndexNotOfSpace = str.find_first_not_of(" "); + if (firstIndexNotOfSpace == std::string::npos) { + str = ""; + return; + } + str.erase(0, firstIndexNotOfSpace); + auto lastIndexNotOfSpace = str.find_last_not_of(" "); + if (lastIndexNotOfSpace == std::string::npos) { + str = ""; + return; + } + str.erase(lastIndexNotOfSpace + 1); +} + +inline void SplitStr( + const std::string& str, const std::string& sep, std::vector& out, bool needTrim = true) +{ + out.erase(out.begin(), out.end()); + + if (str.empty() || sep.empty()) { + return; + } + + std::string strPart; + std::string::size_type startPos = 0; + std::string::size_type pos = str.find_first_of(sep, startPos); + while (pos != std::string::npos) { + if (pos > startPos) { + strPart = needTrim ? TrimStr(str.substr(startPos, pos - startPos)) : str.substr(startPos, pos - startPos); + out.emplace_back(std::move(strPart)); + } + startPos = pos + sep.size(); + pos = str.find_first_of(sep, startPos); + } + + if (startPos < str.size()) { + strPart = needTrim ? TrimStr(str.substr(startPos)) : str.substr(startPos); + out.emplace_back(std::move(strPart)); + } +} + +inline void SplitStr(const std::string& str, const std::string& sep, std::vector& out, bool needTrim = true) +{ + out.erase(out.begin(), out.end()); + if (str.empty() || sep.empty()) { + return; + } + std::string strPart; + std::string::size_type startPos = 0; + std::string::size_type pos = str.find_first_of(sep, startPos); + while (pos != std::string::npos) { + if (pos > startPos) { + strPart = needTrim ? TrimStr(str.substr(startPos, pos - startPos)) : str.substr(startPos, pos - startPos); + if (!strPart.empty()) { + out.emplace_back(StringToDimension(std::move(strPart))); + } + } + startPos = pos + sep.size(); + pos = str.find_first_of(sep, startPos); + } + if (startPos < str.size()) { + strPart = needTrim ? TrimStr(str.substr(startPos)) : str.substr(startPos); + if (!strPart.empty()) { + out.emplace_back(StringToDimension(std::move(strPart))); + } + } +} + +// const std::string ACE_EXPORT FormatString(const char* fmt, ...); + +inline bool StartWith(const std::string& dst, const std::string& prefix) +{ + return dst.compare(0, prefix.size(), prefix) == 0; +} + +inline bool StartWith(const std::string& str, const char* prefix, size_t prefixLen) +{ + return ((str.length() >= prefixLen) && (str.compare(0, prefixLen, prefix) == 0)); +} + +inline bool EndWith(const std::string& dst, const std::string& suffix) +{ + return (dst.size() >= suffix.size()) && dst.compare(dst.size() - suffix.size(), suffix.size(), suffix) == 0; +} + +inline bool EndWith(const std::string& str, const char* suffix, size_t suffixLen) +{ + size_t len = str.length(); + return ((len >= suffixLen) && (str.compare(len - suffixLen, suffixLen, suffix) == 0)); +} + +inline void TransformStrCase(std::string& str, int32_t textCase) +{ + if (str.empty()) { + return; + } + + switch (textCase) { + case TEXT_CASE_LOWERCASE: + transform(str.begin(), str.end(), str.begin(), ::tolower); + break; + case TEXT_CASE_UPPERCASE: + transform(str.begin(), str.end(), str.begin(), ::toupper); + break; + default: + break; + } +} + +bool IsAscii(const std::string& str); + +inline std::vector stringVectorToDoubleVector(const std::vector &stringVec) { + std::vector doubleVec; + doubleVec.reserve(stringVec.size()); // 预分配内存以提高效率 + for (const std::string &str : stringVec) { + auto value = StringToDouble(str); + doubleVec.push_back(vpToPx(value)); + } + return doubleVec; +} + +inline std::string doubleVectorToString(const std::vector& doubleVec) { + std::ostringstream oss; + for (const double &num : doubleVec) { + oss << num << ", "; // 将每个元素转换为字符串并拼接到流中 + } + return oss.str(); // 将流中的内容转换为字符串并返回 +} +std::string base64_encode(unsigned char const* bytes_to_encode, size_t in_len, bool url = false) ; +std::string bitmapToBase64(OH_Drawing_Bitmap *bitmap); +} + +} // namespace svg +} // namespace rnoh diff --git a/tester/harmony/svg/src/main/cpp/utils/SvgAttributesParser.cpp b/tester/harmony/svg/src/main/cpp/utils/SvgAttributesParser.cpp new file mode 100644 index 0000000000000000000000000000000000000000..62ba345a7ed1448f798ff7b2cbdf8368dcdc0437 --- /dev/null +++ b/tester/harmony/svg/src/main/cpp/utils/SvgAttributesParser.cpp @@ -0,0 +1,219 @@ +// from ArkUI "frameworks/core/components_ng/svg/parse/svg_attributes_parser.cpp" + +#include "utils/SvgAttributesParser.h" + +#include "utils/SvgUtils.h" +#include "utils/StringUtils.h" +#include "properties/Color.h" +#include "utils/LinearMap.h" + +namespace rnoh { +namespace svg { + +namespace { +const char LINECAP_ROUND[] = "round"; +const char LINECAP_SQUARE[] = "square"; +const char LINEJOIN_BEVEL[] = "bevel"; +const char LINEJOIN_ROUND[] = "round"; +} + +namespace { +const char LINECAP_ROUND_RN[] = "1"; +const char LINECAP_SQUARE_RN[] = "2"; +const char LINEJOIN_BEVEL_RN[] = "2"; +const char LINEJOIN_ROUND_RN[] = "1"; +} // namespace + +LineCapStyle SvgAttributesParser::GetLineCapStyle(const std::string& val) +{ + if (val == LINECAP_ROUND || val == LINECAP_ROUND_RN) { + return LineCapStyle::ROUND; + } else if (val == LINECAP_SQUARE || val == LINECAP_SQUARE_RN) { + return LineCapStyle::SQUARE; + } else { + return LineCapStyle::BUTT; + } +} + +LineJoinStyle SvgAttributesParser::GetLineJoinStyle(const std::string& val) +{ + if (val == LINEJOIN_BEVEL || val == LINEJOIN_BEVEL_RN) { + return LineJoinStyle::BEVEL; + } else if (val == LINEJOIN_ROUND || val == LINEJOIN_ROUND_RN) { + return LineJoinStyle::ROUND; + } else { + return LineJoinStyle::MITER; + } +} + +Color SvgAttributesParser::GetColor(const std::string& value) +{ + static const LinearMapNode COLOR_TABLE[] = { + { "aliceblue", Color(0xfff0f8ff) }, + { "antiquewhite", Color(0xfffaebd7) }, + { "aqua", Color(0xff00ffff) }, + { "aquamarine", Color(0xff7fffd4) }, + { "azure", Color(0xfff0ffff) }, + { "beige", Color(0xfff5f5dc) }, + { "bisque", Color(0xffffe4c4) }, + { "black", Color(0XFF000000) }, + { "blanchedalmond", Color(0xffffebcd) }, + { "blue", Color(0xff0000ff) }, + { "blueviolet", Color(0xff8a2be2) }, + { "brown", Color(0xffa52a2a) }, + { "burlywood", Color(0xffdeb887) }, + { "cadetblue", Color(0xff5f9ea0) }, + { "chartreuse", Color(0xff7fff00) }, + { "chocolate", Color(0xffd2691e) }, + { "coral", Color(0xffff7f50) }, + { "cornflowerblue", Color(0xff6495ed) }, + { "cornsilk", Color(0xfffff8dc) }, + { "crimson", Color(0xffdc143c) }, + { "cyan", Color(0xff00ffff) }, + { "darkblue", Color(0xff00008b) }, + { "darkcyan", Color(0xff008b8b) }, + { "darkgoldenrod", Color(0xffb8860b) }, + { "darkgray", Color(0xffa9a9a9) }, + { "darkgreen", Color(0xff006400) }, + { "darkgrey", Color(0xffa9a9a9) }, + { "darkkhaki", Color(0xffbdb76b) }, + { "darkmagenta", Color(0xff8b008b) }, + { "darkolivegreen", Color(0xff556b2f) }, + { "darkorange", Color(0xffff8c00) }, + { "darkorchid", Color(0xff9932cc) }, + { "darkred", Color(0xff8b0000) }, + { "darksalmon", Color(0xffe9967a) }, + { "darkseagreen", Color(0xff8fbc8f) }, + { "darkslateblue", Color(0xff483d8b) }, + { "darkslategray", Color(0xff2f4f4f) }, + { "darkslategrey", Color(0xff2f4f4f) }, + { "darkturquoise", Color(0xff00ced1) }, + { "darkviolet", Color(0xff9400D3) }, + { "deeppink", Color(0xffff1493) }, + { "deepskyblue", Color(0xff00bfff) }, + { "dimgray", Color(0xff696969) }, + { "dimgrey", Color(0xff696969) }, + { "dodgerblue", Color(0xff1e90ff) }, + { "firebrick", Color(0xffb22222) }, + { "floralwhite", Color(0xfffffaf0) }, + { "forestgreen", Color(0xff228b22) }, + { "fuchsia", Color(0xffff00ff) }, + { "gainsboro", Color(0xffdcdcdc) }, + { "ghostwhite", Color(0xfff8f8ff) }, + { "gold", Color(0xffffd700) }, + { "goldenrod", Color(0xffdaa520) }, + { "gray", Color(0xff808080) }, + { "green", Color(0xff008000) }, + { "greenyellow", Color(0xffadff2f) }, + { "grey", Color(0xff808080) }, + { "honeydew", Color(0xfff0fff0) }, + { "hotpink", Color(0xffff69b4) }, + { "indianred", Color(0xffcd5c5c) }, + { "indigo", Color(0xff4b0082) }, + { "ivory", Color(0xfffffff0) }, + { "khaki", Color(0xfff0e68c) }, + { "lavender", Color(0xffe6e6fa) }, + { "lavenderblush", Color(0xfffff0f5) }, + { "lawngreen", Color(0xff7cfc00) }, + { "lemonchiffon", Color(0xfffffacd) }, + { "lightblue", Color(0xffadd8e6) }, + { "lightcoral", Color(0xfff08080) }, + { "lightcyan", Color(0xffe0ffff) }, + { "lightgoldenrodyellow", Color(0xfffafad2) }, + { "lightgray", Color(0xffd3d3d3) }, + { "lightgreen", Color(0xff90ee90) }, + { "lightgrey", Color(0xffd3d3d3) }, + { "lightpink", Color(0xffffb6c1) }, + { "lightsalmon", Color(0xffffa07a) }, + { "lightseagreen", Color(0xff20b2aa) }, + { "lightskyblue", Color(0xff87cefa) }, + { "lightslategray", Color(0xff778899) }, + { "lightslategrey", Color(0xff778899) }, + { "lightsteelblue", Color(0xffb0c4de) }, + { "lightyellow", Color(0xffffffe0) }, + { "lime", Color(0xff00ff00) }, + { "limegreen", Color(0xff32cd32) }, + { "linen", Color(0xfffaf0e6) }, + { "magenta", Color(0xffff00ff) }, + { "maroon", Color(0xff800000) }, + { "mediumaquamarine", Color(0xff66cdaa) }, + { "mediumblue", Color(0xff0000cd) }, + { "mediumorchid", Color(0xffba55d3) }, + { "mediumpurple", Color(0xff9370db) }, + { "mediumseagreen", Color(0xff3cb371) }, + { "mediumslateblue", Color(0xff7b68ee) }, + { "mediumspringgreen", Color(0xff00fa9a) }, + { "mediumturquoise", Color(0xff48d1cc) }, + { "mediumvioletred", Color(0xffc71585) }, + { "midnightblue", Color(0xff191970) }, + { "mintcream", Color(0xfff5fffa) }, + { "mistyrose", Color(0xffffe4e1) }, + { "moccasin", Color(0xffffe4b5) }, + { "navajowhite", Color(0xffffdead) }, + { "navy", Color(0xff000080) }, + { "oldlace", Color(0xfffdf5e6) }, + { "olive", Color(0xff808000) }, + { "olivedrab", Color(0xff6b8e23) }, + { "orange", Color(0xffffa500) }, + { "orangered", Color(0xffff4500) }, + { "orchid", Color(0xffda70d6) }, + { "palegoldenrod", Color(0xffeee8aa) }, + { "palegreen", Color(0xff98fb98) }, + { "paleturquoise", Color(0xffafeeee) }, + { "palevioletred", Color(0xffdb7093) }, + { "papayawhip", Color(0xffffefd5) }, + { "peachpuff", Color(0xffffdab9) }, + { "peru", Color(0xffcd853f) }, + { "pink", Color(0xffffc0cb) }, + { "plum", Color(0xffdda0dd) }, + { "powderblue", Color(0xffb0e0e6) }, + { "purple", Color(0xff800080) }, + { "red", Color(0xffff0000) }, + { "rosybrown", Color(0xffbc8f8f) }, + { "royalblue", Color(0xff4169e1) }, + { "rebeccapurple", Color(0xff663399) }, + { "saddlebrown", Color(0xff8b4513) }, + { "salmon", Color(0xfffa8072) }, + { "sandybrown", Color(0xfff4a460) }, + { "seagreen", Color(0xff2e8b57) }, + { "seashell", Color(0xfffff5ee) }, + { "sienna", Color(0xffa0522d) }, + { "silver", Color(0xffc0c0c0) }, + { "skyblue", Color(0xff87ceeb) }, + { "slateblue", Color(0xff6a5acd) }, + { "slategray", Color(0xff708090) }, + { "slategrey", Color(0xff708090) }, + { "snow", Color(0xfffffafa) }, + { "springgreen", Color(0xff00ff7f) }, + { "steelblue", Color(0xff4682b4) }, + { "tan", Color(0xffd2b48c) }, + { "teal", Color(0xff008080) }, + { "thistle", Color(0xffd8bfd8) }, + { "tomato", Color(0xffff6347) }, + { "turquoise", Color(0xff40e0d0) }, + { "violet", Color(0xffee82ee) }, + { "wheat", Color(0xfff5deb3) }, + { "white", Color(0xffffffff) }, + { "whitesmoke", Color(0xfff5f5f5) }, + { "yellow", Color(0xffffff00) }, + { "yellowgreen", Color(0xff9acd32) }, + }; + int64_t colorIndex = BinarySearchFindIndex(COLOR_TABLE, ArraySize(COLOR_TABLE), value.c_str()); + if (colorIndex != -1) { + return COLOR_TABLE[colorIndex].value; + } + return Color::FromString(value); +} + +Dimension SvgAttributesParser::ParseDimension(const std::string& value, bool useVp) +{ + return StringUtils::StringToDimension(value, useVp); +} + +double SvgAttributesParser::ParseDouble(const std::string& value) +{ + return StringUtils::StringToDouble(value); +} + +} // namespace svg +} // namespace rnoh diff --git a/tester/harmony/svg/src/main/cpp/utils/SvgAttributesParser.h b/tester/harmony/svg/src/main/cpp/utils/SvgAttributesParser.h new file mode 100644 index 0000000000000000000000000000000000000000..4829f2ea5fc9dcc964175e3c8dfafacf6ac6611d --- /dev/null +++ b/tester/harmony/svg/src/main/cpp/utils/SvgAttributesParser.h @@ -0,0 +1,257 @@ +// from ArkUI "frameworks/core/components_ng/svg/parse/svg_attributes_parser.h" + +#pragma once +#include +#include "properties/Color.h" +#include "properties/PaintState.h" +#include "properties/Dimension.h" +#include "properties/Rect.h" +#include "properties/Decoration.h" +#include + +namespace rnoh { +namespace svg { + +class SvgAttributesParser { +public: + static Color GetColor(const std::string& str); + static LineCapStyle GetLineCapStyle(const std::string& val); + static LineJoinStyle GetLineJoinStyle(const std::string& val); + static Dimension ParseDimension(const std::string& value, bool useVp = false); + static double ParseDouble(const std::string& value); +}; + +enum class SvgFeColorMatrixType { + MATRIX, + SATURATE, + HUE_ROTATE, + LUMINACE_TO_ALPHA, +}; + +enum class SvgColorInterpolationType { + LINEAR_RGB, + SRGB, + AUTO +}; + +enum class SvgFeInType { + SOURCE_GRAPHIC, + SOURCE_ALPHA, + BACKGROUND_IMAGE, + BACKGROUND_ALPHA, + FILL_PAINT, + STROKE_PAINT, + PRIMITIVE +}; + +enum class SvgFeEdgeMode { + EDGE_DUPLICATE, + EDGE_WRAP, + EDGE_NONE +}; + +enum class SvgFeOperatorType { + FE_ARITHMETIC, + FE_ATOP, + FE_IN, + FE_LIGHTER, + FE_OUT, + FE_OVER, + FE_XOR +}; + +enum class SvgFeBlendMode { + NORMAL, + MULTIPLY, + SCREEN, + DARKEN, + LIGHTEN +}; + +struct SvgFeIn { + SvgFeInType in = SvgFeInType::PRIMITIVE; + std::string id; +}; + +struct SvgAttribute { + Dimension vbX; + Dimension vbY; + Dimension vbWidth; + Dimension vbHeight; + Dimension x; + Dimension y; + Dimension width = -1.0_px; + Dimension height = -1.0_px; + bool autoMirror = false; + std::string align; + int meetOrSlice; +}; + +struct SvgAnimateAttribute { + std::string attributeName; + int32_t begin = 0; + int32_t dur = 0; + int32_t end = 0; + int32_t repeatCount = 1; + std::string fillMode; + std::string calcMode; + std::vector values; + std::vector keyTimes; + std::vector keySplines; + std::string from; + std::string to; + std::vector keyPoints; + std::string path; + std::string rotate; + std::string transformType; +}; + +// struct SvgStopAttribute { +// GradientColor gradientColor; +// }; + +struct SvgRectAttribute { + Dimension x; + Dimension y; + Dimension rx = -1.0_px; + Dimension ry = -1.0_px; + Dimension width; + Dimension height; +}; + +struct SvgMaskAttribute { + Dimension x = Dimension(-0.1, DimensionUnit::PERCENT); // x-axis default value + Dimension y = Dimension(-0.1, DimensionUnit::PERCENT); // y-axis default value + Dimension width = Dimension(1.2, DimensionUnit::PERCENT); // masking area width default value + Dimension height = Dimension(1.2, DimensionUnit::PERCENT); // masking area height default value + Unit maskContentUnits = Unit::userSpaceOnUse; + Unit maskUnits = Unit::objectBoundingBox; +}; + +struct SvgCircleAttribute { + Dimension cx; + Dimension cy; + Dimension r; +}; + +struct SvgPolygonAttribute { + std::string points; +}; + +struct SvgEllipseAttribute { + Dimension cx; + Dimension cy; + Dimension rx = -1.0_px; + Dimension ry = -1.0_px; +}; + +struct SvgLineAttribute { + Dimension x1; + Dimension y1; + Dimension x2; + Dimension y2; +}; + +struct SvgPatternAttribute { + Dimension x; // x-axis default value + Dimension y; // y-axis default value + Dimension width; // pattern area width default value + Dimension height; // pattern area height default value + int patternUnits; + int patternContentUnits; + std::string patternTransform; + Rect viewBox; +}; + +struct SvgImageAttribute { + Dimension x = Dimension(0, DimensionUnit::PX); // x-axis default value + Dimension y = Dimension(0, DimensionUnit::PX); // y-axis default value + Dimension width = Dimension(0.0, DimensionUnit::PX); // image width default value + Dimension height = Dimension(0.0, DimensionUnit::PX); // image height default value + facebook::react::ImageSource src; + std::string align; + int meetOrSlice = 0; +}; + +struct SvgSymbolAttribute { + Dimension minX; + Dimension minY; + Dimension vbWidth; + Dimension vbHeight; + std::string align; + int meetOrSlice; +}; + +struct SvgFilterAttribute { + Dimension x = Dimension(-0.1, DimensionUnit::PERCENT); // x-axis default value + Dimension y = Dimension(-0.1, DimensionUnit::PERCENT); // y-axis default value + Dimension width = Dimension(1.2, DimensionUnit::PERCENT); // masking area width default value + Dimension height = Dimension(1.2, DimensionUnit::PERCENT); // masking area height default value +}; + +struct SvgFeCommonAttribute { + Dimension x = Dimension(0.0, DimensionUnit::PERCENT); + Dimension y = Dimension(0.0, DimensionUnit::PERCENT); + Dimension height = Dimension(1.0, DimensionUnit::PERCENT); + Dimension width = Dimension(1.0, DimensionUnit::PERCENT); + std::string result; + SvgFeIn in; + SvgColorInterpolationType colorInterpolationType = SvgColorInterpolationType::SRGB; +}; + +struct SvgFeFloodAttribute { + Color floodColor = Color::BLACK; + double floodOpacity = 1.0; +}; + +struct SvgFeGaussianBlurAttribute { + float stdDeviationX = 0.0f; + float stdDeviationY = 0.0f; + SvgFeEdgeMode edgeMode = SvgFeEdgeMode::EDGE_DUPLICATE; +}; + +struct SvgFeOffsetAttribute { + Dimension dx; + Dimension dy; +}; + +struct SvgFeCompositeAttribute { + SvgFeIn in2; + SvgFeOperatorType operatorType = SvgFeOperatorType::FE_OVER; + float k1 = 0.0f; + float k2 = 0.0f; + float k3 = 0.0f; + float k4 = 0.0f; +}; + +struct SvgFeBlendAttribute { + SvgFeIn in2; + SvgFeBlendMode blendMode = SvgFeBlendMode::NORMAL; +}; + +struct SvgFeColorMatrixAttribute { + SvgFeColorMatrixType type = SvgFeColorMatrixType::MATRIX; + std::string values; +}; + +struct SvgGradientAttribute { + Gradient gradient = Gradient(); +}; + +struct SvgMarkerAttribute { + Dimension refX; + Dimension refY; + Dimension markerWidth; + Dimension markerHeight; + Dimension minX; + Dimension minY; + Dimension vbWidth; + Dimension vbHeight; + std::string markerUnits; + std::string orient; + std::string align; + int meetOrSlice; +}; + +} // namespace svg +} // namespace rnoh \ No newline at end of file diff --git a/tester/harmony/svg/src/main/cpp/utils/SvgMarkerPositionUtils.h b/tester/harmony/svg/src/main/cpp/utils/SvgMarkerPositionUtils.h new file mode 100644 index 0000000000000000000000000000000000000000..fb59d572dc3b53179626125abf150477686fa6f4 --- /dev/null +++ b/tester/harmony/svg/src/main/cpp/utils/SvgMarkerPositionUtils.h @@ -0,0 +1,197 @@ +// +// Created on 2024/5/9. +// +// Node APIs are not fully supported. To solve the compilation error of the interface cannot be found, +// please include "napi/native_api.h". + +#ifndef HARMONY_SVGMARKERPOSITIONUTIL_H +#define HARMONY_SVGMARKERPOSITIONUTIL_H + +#include +#include + +namespace rnoh { +namespace svg { + +enum class RNSVGMarkerType { + kStartMarker, + kMidMarker, + kEndMarker +}; + +enum class ElementType { + kCGPathElementAddCurveToPoint, + kCGPathElementAddQuadCurveToPoint, + kCGPathElementMoveToPoint, + kCGPathElementAddLineToPoint, + kCGPathElementCloseSubpath +}; + +class Point { +public: + double x; + double y; + +public: + Point(double x_val, double y_val) : x(x_val), y(y_val) {} +}; + +class SegmentData { +public: + Point start_tangent; + Point end_tangent; + Point position; + + SegmentData(const Point& _start_tangent, const Point& _end_tangent, const Point& _position) + : start_tangent(_start_tangent), end_tangent(_end_tangent), position(_position) {} +}; + +class PathElement { +public: + ElementType type; + std::vector points; + +public: + PathElement(ElementType _type, std::vector _points) + : type(_type), points(_points) {} +}; + +class SvgMarkerPosition { +public: + RNSVGMarkerType type; + Point origin = {0.0, 0.0}; + double angle; + + SvgMarkerPosition(RNSVGMarkerType _type, Point _origin, double _angle): type(_type), origin(_origin), angle(_angle) {} +}; + +namespace SvgMarkerPositionUtils{ + static std::vector positions_; + static int element_index_; + static Point origin_ = {0, 0}; + static Point subpath_start_ = {0, 0}; + static Point in_slope_ = {0, 0}; + static Point out_slope_ = {0, 0}; + + static bool auto_start_reverse_; // TODO + + //ios only, use in renderMarker. + inline double deg2rad(double deg) { + const double RNSVG_degToRad = M_PI / 180.0; + return deg * RNSVG_degToRad; + } + + inline double rad2deg(double rad) { + const double RNSVG_radToDeg = 180.0 / M_PI; + return rad * RNSVG_radToDeg; + } + + inline double SlopeAngleRadians(Point p) { + return std::atan2(p.y, p.x); + } + + inline double BisectingAngle(double in_angle, double out_angle) { + if (std::abs(in_angle - out_angle) > 180) in_angle += 360; + return (in_angle + out_angle) / 2.0; + } + + inline Point subtract(Point p1, Point p2) { + return {p2.x - p1.x, p2.y - p1.y}; + } + + inline bool isZero(Point p) { + return p.x == 0 && p.y == 0; + } + + inline double CurrentAngle(RNSVGMarkerType type) { + double in_angle = rad2deg(SlopeAngleRadians(in_slope_)); + double out_angle = rad2deg(SlopeAngleRadians(out_slope_)); + switch (type) { + case RNSVGMarkerType::kStartMarker: + if (auto_start_reverse_) out_angle += 180; + return out_angle; + case RNSVGMarkerType::kMidMarker: + return BisectingAngle(in_angle, out_angle); + case RNSVGMarkerType::kEndMarker: + return in_angle; + } + return 0; + } + + inline void ComputeQuadTangents(SegmentData& data, Point start, Point control, Point end) { + data.start_tangent = subtract(control, start); + data.end_tangent = subtract(end, control); + if (isZero(data.start_tangent)) data.start_tangent = data.end_tangent; + else if (isZero(data.end_tangent)) data.end_tangent = data.start_tangent; + } + + inline SegmentData ExtractPathElementFeatures(PathElement element) { + SegmentData data = {{0,0}, {0,0}, {0,0}}; + std::vector points = element.points; + switch (element.type) { + case ElementType::kCGPathElementAddCurveToPoint: + data.position = points[2]; + data.start_tangent = subtract(points[0], origin_); + data.end_tangent = subtract(points[2], points[1]); + if (isZero(data.start_tangent)) ComputeQuadTangents(data, points[0], points[1], points[2]); + else if (isZero(data.end_tangent)) ComputeQuadTangents(data, origin_, points[0], points[1]); + break; + case ElementType::kCGPathElementAddQuadCurveToPoint: + data.position = points[1]; + ComputeQuadTangents(data, origin_, points[0], points[1]); + break; + case ElementType::kCGPathElementMoveToPoint: + case ElementType::kCGPathElementAddLineToPoint: + data.position = points[0]; + data.start_tangent = subtract(data.position, origin_); + data.end_tangent = subtract(data.position, origin_); + break; + case ElementType::kCGPathElementCloseSubpath: + data.position = subpath_start_; + data.start_tangent = subtract(data.position, origin_); + data.end_tangent = subtract(data.position, origin_); + break; + } + return data; + } + + inline void UpdateFromPathElement(PathElement element) { + SegmentData segment_data = ExtractPathElementFeatures(element); + out_slope_ = segment_data.start_tangent; + if (element_index_ > 0) { + RNSVGMarkerType marker_type = element_index_ == 1 ? RNSVGMarkerType::kStartMarker : RNSVGMarkerType::kMidMarker; + double angle = CurrentAngle(marker_type); + positions_.push_back({marker_type, origin_, angle}); + } + in_slope_ = segment_data.end_tangent; + origin_ = segment_data.position; + if (element.type == ElementType::kCGPathElementMoveToPoint){ + subpath_start_ = element.points[0]; + }else if (element.type == ElementType::kCGPathElementCloseSubpath) { + subpath_start_ = {0, 0}; + } + ++element_index_; + } + + inline void PathIsDone() { + double angle = CurrentAngle(RNSVGMarkerType::kEndMarker); + positions_.push_back(SvgMarkerPosition(RNSVGMarkerType::kEndMarker, origin_, angle)); + } + + inline std::vector fromPath(const std::vector& elements) { + positions_.clear(); + element_index_ = 0; + origin_ = {0, 0}; + subpath_start_ = {0, 0}; + for (const PathElement& e : elements) { + UpdateFromPathElement(e); + } + PathIsDone(); + return positions_; + } +} + +} // namespace svg +} // namespace rnoh + +#endif //HARMONY_SVGMARKERPOSITIONUTIL_H diff --git a/tester/harmony/svg/src/main/cpp/utils/SvgUtils.h b/tester/harmony/svg/src/main/cpp/utils/SvgUtils.h new file mode 100644 index 0000000000000000000000000000000000000000..3711c4581a9614ab6d271bd4d3be04c3d3d73c95 --- /dev/null +++ b/tester/harmony/svg/src/main/cpp/utils/SvgUtils.h @@ -0,0 +1,212 @@ +#pragma once +#include +#include +#include + +#define CHECK_NULL_VOID(ptr) \ + do { \ + if (!(ptr)) { \ + return; \ + } \ + } while (0) + +#define CHECK_NULL_RETURN(ptr, ret) \ + do { \ + if (!(ptr)) { \ + return ret; \ + } \ + } while (0) + +#define CHECK_ERROR_CODE_RETURN(code) \ + do { \ + if ((code) > 0) { \ + return code; \ + } \ + } while (0) + +#define CHECK_EQUAL_VOID(var, value) \ + do { \ + if ((var) == (value)) { \ + return; \ + } \ + } while (0) + +namespace rnoh { +namespace svg { + +inline double vpToPx(double vp) { + //TODO get densityPixels in CAPI + return vp * 3.25; +} + +template +constexpr std::size_t ArraySize(T (&)[N]) noexcept +{ + return N; +} + +template +T ConvertIntToEnum(int32_t index, const T (&values)[N], T defaultValue) +{ + if (index >= 0 && index < N) { + return values[index]; + } + return defaultValue; +} + +template +constexpr T Infinity() +{ + return static_cast(1000000.0); +} + +inline bool NearEqual(const double left, const double right, const double epsilon) +{ + return (std::abs(left - right) <= epsilon); +} + +template +constexpr bool NearEqual(const T& left, const T& right); + +template<> +inline bool NearEqual(const float& left, const float& right) +{ + constexpr double epsilon = 0.001f; + return NearEqual(left, right, epsilon); +} + +template<> +inline bool NearEqual(const double& left, const double& right) +{ + constexpr double epsilon = 0.00001f; + return NearEqual(left, right, epsilon); +} + +template +constexpr bool NearEqual(const T& left, const T& right) +{ + return left == right; +} + +inline bool NearZero(const double value, const double epsilon) +{ + return NearEqual(value, 0.0, epsilon); +} + +inline bool NearEqual(const double left, const double right) +{ + constexpr double epsilon = 0.001f; + return NearEqual(left, right, epsilon); +} + +inline bool NearZero(const double left) +{ + constexpr double epsilon = 0.001f; + return NearZero(left, epsilon); +} + +inline bool LessOrEqual(double left, double right) +{ + constexpr double epsilon = 0.001f; + return (left - right) < epsilon; +} + +inline bool LessOrEqualCustomPrecision(double left, double right, double epsilon = 0.000001f) +{ + return (left - right) < epsilon; +} + +inline bool LessNotEqual(double left, double right) +{ + constexpr double epsilon = -0.001f; + return (left - right) < epsilon; +} + +inline bool LessNotEqualCustomPrecision(double left, double right, double epsilon = -0.000001f) +{ + return (left - right) < epsilon; +} + +inline bool GreatOrEqual(double left, double right) +{ + constexpr double epsilon = -0.001f; + return (left - right) > epsilon; +} + +inline bool GreatOrEqualCustomPrecision(double left, double right, double epsilon = -0.000001f) +{ + return (left - right) > epsilon; +} + +inline bool GreatNotEqual(double left, double right) +{ + constexpr double epsilon = 0.001f; + return (left - right) > epsilon; +} + +inline bool GreatNotEqualCustomPrecision(double left, double right, double epsilon = 0.000001f) +{ + return (left - right) > epsilon; +} + +inline double Round(double rawNum) +{ + constexpr double epsilon = 0.001f; + return std::round(rawNum + epsilon); +} + +inline bool Negative(double value) +{ + return LessNotEqual(value, 0); +} + +inline bool NonNegative(double value) +{ + return GreatOrEqual(value, 0); +} + +inline bool Positive(double value) +{ + return GreatNotEqual(value, 0); +} + +inline bool NonPositive(double value) +{ + return LessOrEqual(value, 0); +} + +inline bool InRegion(double lowerBound, double upperBound, double destNum) +{ + return LessOrEqual(lowerBound, destNum) && LessOrEqual(destNum, upperBound); +} + +inline bool GreaterOrEqualToInfinity(float num) +{ + return GreatOrEqual(num, Infinity() / 2.0f); +} + +inline uint64_t GetMilliseconds() +{ + auto now = std::chrono::system_clock::now(); + auto millisecs = std::chrono::duration_cast(now.time_since_epoch()); + return millisecs.count(); +} + +inline uint64_t GetNanoseconds() +{ + auto now = std::chrono::system_clock::now(); + auto nanoseconds = std::chrono::duration_cast(now.time_since_epoch()); + return nanoseconds.count(); +} + +inline float CalculateFriction(float gamma) +{ + constexpr float SCROLL_RATIO = 0.72f; + if (GreatOrEqual(gamma, 1.0)) { + gamma = 1.0; + } + return SCROLL_RATIO * static_cast(std::pow(1.0 - gamma, 2)); +} + +} // namespace svg +} // namespace rnoh \ No newline at end of file diff --git a/tester/harmony/svg/src/main/cpp/utils/TextPathHelper.cpp b/tester/harmony/svg/src/main/cpp/utils/TextPathHelper.cpp new file mode 100644 index 0000000000000000000000000000000000000000..2c8feba1840871f5391b1fa18fc16483bd176d03 --- /dev/null +++ b/tester/harmony/svg/src/main/cpp/utils/TextPathHelper.cpp @@ -0,0 +1,88 @@ +#include "TextPathHelper.h" +#include +#include +namespace rnoh { +namespace svg { + +namespace { +constexpr int MSCALE_X = 0; //!< use with getValues/setValues +constexpr int MSKEW_X = 1; //!< use with getValues/setValues +constexpr int MTRANS_X = 2; //!< use with getValues/setValues +constexpr int MSKEW_Y = 3; //!< use with getValues/setValues +constexpr int MSCALE_Y = 4; //!< use with getValues/setValues +constexpr int MTRANS_Y = 5; //!< use with getValues/setValues +constexpr int MPERSP_0 = 6; //!< use with getValues/setValues +constexpr int MPERSP_1 = 7; //!< use with getValues/setValues +constexpr int MPERSP_2 = 8; //!< use with getValues/setValues + +constexpr double tau = 2.0 * M_PI; +constexpr double radToDeg = 360.0 / tau; +} // namespace + +TextPathHelper::TextPathHelper(const std::shared_ptr &textPath, TextAnchor anchor) { + if (!textPath) { + return; + } + path_ = textPath->getTextPath(), sharpMidLine_ = textPath->getMidLine() == TextPathMidLine::sharp; + pathLength_ = path_.GetLength(false); + + endOfRendering_ = pathLength_; + side_ = textPath->getSide() == TextPathSide::right ? -1 : 1; + absoluteStartOffset_ = textPath->getStartOffset(); + isClosed_ = path_.IsClosed(false); + if (isClosed_) { + startOfRendering_ = absoluteStartOffset_ + (anchor == TextAnchor::middle ? -pathLength_ / 2.0 : 0); + endOfRendering_ = startOfRendering_ + pathLength_; + } +} + +bool TextPathHelper::GetMatrixOnPath(const Params &p, drawing::Matrix &mid) { + const double endPoint = p.startPoint + p.charWidth; + const double halfWay = p.charWidth / 2; + const double midPoint = p.startPoint + halfWay; + if (midPoint > endOfRendering_) { + return false; + } else if (midPoint < startOfRendering_) { + return false; + } + if (sharpMidLine_) { + mid = path_.GetMatrix(false, midPoint, GET_POSITION_AND_TANGENT_MATRIX).value_or(drawing::Matrix()); + } else { + drawing::Matrix start; + drawing::Matrix end; + if (p.startPoint < 0) { + start = path_.GetMatrix(false, p.startPoint, GET_POSITION_AND_TANGENT_MATRIX).value_or(drawing::Matrix()); + start.PreTranslate(p.startPoint, 0); + } else { + start = path_.GetMatrix(false, p.startPoint, GET_POSITION_MATRIX).value_or(drawing::Matrix()); + } + mid = path_.GetMatrix(true, midPoint, GET_POSITION_MATRIX).value_or(drawing::Matrix()); + + if (endPoint > pathLength_) { + end = path_.GetMatrix(false, pathLength_, GET_POSITION_AND_TANGENT_MATRIX).value_or(drawing::Matrix()); + end.PreTranslate((endPoint - pathLength_), 0); + } else { + end = path_.GetMatrix(false, pathLength_, GET_POSITION_MATRIX).value_or(drawing::Matrix()); + } + + double startX = start.GetValue(MTRANS_X); + double startY = start.GetValue(MTRANS_Y); + + double endX = end.GetValue(MTRANS_X); + double endY = end.GetValue(MTRANS_Y); + + double lineX = endX - startX; + double lineY = endY - startY; + + double glyphMidlineAngle = std::atan2(lineY, lineX); + mid.PreRotate((glyphMidlineAngle * radToDeg * side_), 0, 0); + } + + mid.PreTranslate(-halfWay, p.dy); + mid.PreScale(scaleDirection_, side_, 0, 0); + mid.PostTranslate(0, p.y); + return true; +} + +} // namespace svg +} // namespace rnoh \ No newline at end of file diff --git a/tester/harmony/svg/src/main/cpp/utils/TextPathHelper.h b/tester/harmony/svg/src/main/cpp/utils/TextPathHelper.h new file mode 100644 index 0000000000000000000000000000000000000000..556e59c36b1a3911fdd9b5a08e5285af1b18c3a4 --- /dev/null +++ b/tester/harmony/svg/src/main/cpp/utils/TextPathHelper.h @@ -0,0 +1,54 @@ +#pragma once +#include "drawing/Matrix.h" +#include +#include "SvgTextPath.h" +namespace rnoh { +namespace svg { + +class TextPathHelper { + public: + TextPathHelper(const std::shared_ptr& textPath, svg::TextAnchor anchor); + + double GetStartOffset() const { + return absoluteStartOffset_; + } + + int GetSide() const { + return side_; + } + + bool Valid() const { + return pathLength_ > 0.0; + } + + void SetScaleSpacingAndGlyphs(double value) { + scaleDirection_ = value * side_; + } + + struct Params { + double charWidth = 0.0; + double startPoint = 0.0; + double y = 0.0; + double dy = 0.0; + }; + /** + * @brief Set transform matrix to paint the character at the given position on the path. + * + * @return true if this character can be skipped + */ + bool GetMatrixOnPath(const Params& p, drawing::Matrix &mat); + +private: + drawing::Path path_ = drawing::Path(); + int side_ = 0; + double pathLength_ = 0.0; + double startOfRendering_ = 0.0; + double endOfRendering_ = 0.0; + double absoluteStartOffset_ = 0.0; + double scaleDirection_ = 1.0; + bool sharpMidLine_ = false; + bool isClosed_ = false; +}; + +} // namespace svg +} // namespace rnoh \ No newline at end of file diff --git a/tester/harmony/svg/src/main/ets/Logger.ts b/tester/harmony/svg/src/main/ets/Logger.ts new file mode 100644 index 0000000000000000000000000000000000000000..7b1a85f1f39a1d6e6f43d9c2e3e5434493d989e7 --- /dev/null +++ b/tester/harmony/svg/src/main/ets/Logger.ts @@ -0,0 +1,40 @@ +import hilog from '@ohos.hilog'; + +class Logger { + private domain: number; + private prefix: string; + private format: string = '%{public}s, %{public}s'; + private isDebug: boolean; + + /** + * constructor. + * + * @param Prefix Identifies the log tag. + * @param domain Domain Indicates the service domain, which is a hexadecimal integer ranging from 0x0 to 0xFFFFF. + */ + constructor(prefix: string = 'MyApp', domain: number = 0xFF00, isDebug = false) { + this.prefix = prefix; + this.domain = domain; + this.isDebug = isDebug; + } + + debug(...args: string[]): void { + if(this.isDebug) { + hilog.debug(this.domain, this.prefix, this.format, args); + } + } + + info(...args: string[]): void { + hilog.info(this.domain, this.prefix, this.format, args); + } + + warn(...args: string[]): void { + hilog.warn(this.domain, this.prefix, this.format, args); + } + + error(...args: string[]): void { + hilog.error(this.domain, this.prefix, this.format, args); + } +} + +export default new Logger('RNSVG', 0xFF00, false) \ No newline at end of file diff --git a/tester/harmony/svg/src/main/ets/RNSVGImageModule.ts b/tester/harmony/svg/src/main/ets/RNSVGImageModule.ts new file mode 100644 index 0000000000000000000000000000000000000000..90fcd11ce33d5b84a66601f29f9f22f1c0cb5443 --- /dev/null +++ b/tester/harmony/svg/src/main/ets/RNSVGImageModule.ts @@ -0,0 +1,82 @@ +import { TurboModule } from "@rnoh/react-native-openharmony/ts"; +import { BusinessError } from '@ohos.base'; +import image from '@ohos.multimedia.image'; +import http from '@ohos.net.http'; +import ResponseCode from '@ohos.net.http'; +import buffer from '@ohos.buffer'; +import Logger from './Logger' + +export class RNSVGImageModule extends TurboModule { + pixelMap: image.PixelMap | undefined = undefined + sourceType: string = 'image/png' + formatList: Map = new Map([ + ['image/jpeg', 'image/jpeg'], + ['image/png', 'image/png'], + ['image/webp', 'image/webp'], + ]) + + public static readonly NAME = 'RNSVGImageModule'; + + async getBase64String(uri: string): Promise { + if (uri.startsWith('data:')) { + return Promise.resolve(uri); + } + let image: image.PixelMap | undefined = undefined; + try { + if (uri.includes('http')) { + image = await this.getPixelMapFromURL(uri); + } else { + //TODO get pixelMap from local uri + } + if (image === undefined) { + let message = "Error! Failed to decode Bitmap, uri: " + uri; + Logger.warn(message); + return Promise.reject(message); + } else { + return Promise.resolve(this.pixelMapToBase64(image)); + } + } catch (error) { + let message = "Error! Failed to decode pixelMap: " + error.message; + Logger.warn(message); + Promise.reject(message); + } + } + + async getPixelMapFromURL(src: string): Promise { + let pixelMap: image.PixelMap | undefined = undefined; + let data = await http.createHttp().request(src); + if (data.responseCode == ResponseCode.ResponseCode.OK && data.result instanceof ArrayBuffer) { + let imageData: ArrayBuffer = data.result; + if (data.header.hasOwnProperty('content-type')) { + this.sourceType = data.header['content-type']; + } + let imageSource: image.ImageSource = image.createImageSource(imageData); + let imageInfo = await imageSource.getImageInfo(); + let imageWidth = Math.round(imageInfo.size.width); + let imageHeight = Math.round(imageInfo.size.height); + let options: image.InitializationOptions = { + alphaType: 1, + editable: false, + pixelFormat: 3, + scaleMode: 1, + size: { width: imageWidth, height: imageHeight } + }; + pixelMap = await imageSource.createPixelMap(options); + } + return pixelMap; + } + + async pixelMapToBase64(pixelMap: image.PixelMap): Promise { + let base64Url: string = ''; + let imagePacker = image.createImagePacker(); + let packFormat: string = this.formatList.get(this.sourceType) ?? 'image/png'; + let packOptions: image.PackingOption = { format: packFormat, quality: 100 }; + let data: ArrayBuffer = await imagePacker.packing(pixelMap, packOptions); + if (data) { + let buf: buffer.Buffer = buffer.from(data); + base64Url = buf.toString('base64', 0, buf.length); + Logger.debug(`svgImage base64: data:${packFormat};base64,${base64Url}`); + } + return "data:" + packFormat + ";base64," + base64Url; + } +} \ No newline at end of file diff --git a/tester/harmony/svg/src/main/ets/RNSVGRenderableModule.ts b/tester/harmony/svg/src/main/ets/RNSVGRenderableModule.ts new file mode 100644 index 0000000000000000000000000000000000000000..d83856a3fe38f79f380f70720788f687c34a7c9e --- /dev/null +++ b/tester/harmony/svg/src/main/ets/RNSVGRenderableModule.ts @@ -0,0 +1,5 @@ +import { TurboModule } from '@rnoh/react-native-openharmony/ts'; + +export class RNSVGRenderableModule extends TurboModule { + public static readonly NAME = 'RNSVGRenderableModule'; +} diff --git a/tester/harmony/svg/src/main/ets/RNSVGSvgViewModule.ts b/tester/harmony/svg/src/main/ets/RNSVGSvgViewModule.ts new file mode 100644 index 0000000000000000000000000000000000000000..2a926fb7acaf34d2ec7f9107a8d64fccba7812fc --- /dev/null +++ b/tester/harmony/svg/src/main/ets/RNSVGSvgViewModule.ts @@ -0,0 +1,6 @@ +import { TurboModule } from '@rnoh/react-native-openharmony/ts'; + +export class RNSVGSvgViewModule extends TurboModule { + public static readonly NAME = 'RNSVGSvgViewModule'; + +} diff --git a/tester/harmony/svg/src/main/ets/SvgPackage.ts b/tester/harmony/svg/src/main/ets/SvgPackage.ts new file mode 100644 index 0000000000000000000000000000000000000000..b73a55083109b972e36820d0fc2b3bcfbc1bb0b8 --- /dev/null +++ b/tester/harmony/svg/src/main/ets/SvgPackage.ts @@ -0,0 +1,30 @@ +import { RNPackage, TurboModulesFactory } from '@rnoh/react-native-openharmony/ts'; +import type { TurboModule, TurboModuleContext } from '@rnoh/react-native-openharmony/ts'; +import { RNSVGSvgViewModule } from './RNSVGSvgViewModule'; +import { RNSVGRenderableModule } from './RNSVGRenderableModule'; +import { RNSVGImageModule } from './RNSVGImageModule'; + +class SvgTurboModulesFactory extends TurboModulesFactory { + createTurboModule(name: string): TurboModule | null { + if (name === 'RNSVGSvgViewModule') { + return new RNSVGSvgViewModule(this.ctx); + } + if (name === 'RNSVGRenderableModule') { + return new RNSVGRenderableModule(this.ctx); + } + if (name === 'RNSVGImageModule') { + return new RNSVGImageModule(this.ctx); + } + return null; + } + + hasTurboModule(name: string): boolean { + return name === 'RNSVGSvgViewModule' || name === 'RNSVGRenderableModule' || name === 'RNSVGImageModule'; + } +} + +export class SvgPackage extends RNPackage { + createTurboModulesFactory(ctx: TurboModuleContext): TurboModulesFactory { + return new SvgTurboModulesFactory(ctx); + } +} \ No newline at end of file diff --git a/tester/harmony/svg/src/main/module.json5 b/tester/harmony/svg/src/main/module.json5 new file mode 100644 index 0000000000000000000000000000000000000000..f6d073dd1ae1e20b7e9d44285b8233a7ebab7f3c --- /dev/null +++ b/tester/harmony/svg/src/main/module.json5 @@ -0,0 +1,7 @@ +{ + module: { + name: 'svg', + type: 'har', + deviceTypes: ['default'], + }, +} diff --git a/tester/harmony/svg/src/main/resources/base/element/string.json b/tester/harmony/svg/src/main/resources/base/element/string.json new file mode 100644 index 0000000000000000000000000000000000000000..1e76de0c66777cfe83568615c5c2e68c61d23fed --- /dev/null +++ b/tester/harmony/svg/src/main/resources/base/element/string.json @@ -0,0 +1,8 @@ +{ + "string": [ + { + "name": "page_show", + "value": "page from npm package" + } + ] +} diff --git a/tester/harmony/svg/src/main/resources/en_US/element/string.json b/tester/harmony/svg/src/main/resources/en_US/element/string.json new file mode 100644 index 0000000000000000000000000000000000000000..1e76de0c66777cfe83568615c5c2e68c61d23fed --- /dev/null +++ b/tester/harmony/svg/src/main/resources/en_US/element/string.json @@ -0,0 +1,8 @@ +{ + "string": [ + { + "name": "page_show", + "value": "page from npm package" + } + ] +} diff --git a/tester/harmony/svg/src/main/resources/zh_CN/element/string.json b/tester/harmony/svg/src/main/resources/zh_CN/element/string.json new file mode 100644 index 0000000000000000000000000000000000000000..1e76de0c66777cfe83568615c5c2e68c61d23fed --- /dev/null +++ b/tester/harmony/svg/src/main/resources/zh_CN/element/string.json @@ -0,0 +1,8 @@ +{ + "string": [ + { + "name": "page_show", + "value": "page from npm package" + } + ] +} diff --git a/tester/harmony/svg/ts.ts b/tester/harmony/svg/ts.ts new file mode 100644 index 0000000000000000000000000000000000000000..d42137da186303ec5ce467561db0cea299b99c0e --- /dev/null +++ b/tester/harmony/svg/ts.ts @@ -0,0 +1,2 @@ +export * from './src/main/ets/SvgPackage' +export * from './src/main/ets/RNSVGSvgViewModule' \ No newline at end of file diff --git a/tester/index.js b/tester/index.js new file mode 100644 index 0000000000000000000000000000000000000000..273b29f5497d8543349112a6a98bcf5fbbae7916 --- /dev/null +++ b/tester/index.js @@ -0,0 +1,12 @@ +/** + * @format + */ + +import {AppRegistry} from 'react-native'; +import App from './App'; +import SVGDemo from './SVGDemo/SVGViewDemo'; +import {name as appName} from './app.json'; +import SvgDemoCases from './svgDemoCases/App' +// AppRegistry.registerComponent(appName, () => App); +AppRegistry.registerComponent(appName, () => SVGDemo); +AppRegistry.registerComponent(appName, () => SvgDemoCases); \ No newline at end of file diff --git a/tester/metro.config.js b/tester/metro.config.js new file mode 100644 index 0000000000000000000000000000000000000000..f33c325ac1fad6c7733a76bfe002d136fb442c8f --- /dev/null +++ b/tester/metro.config.js @@ -0,0 +1,24 @@ +const {mergeConfig, getDefaultConfig} = require('@react-native/metro-config'); +const {createHarmonyMetroConfig} = require('react-native-harmony/metro.config'); + +/** + * @type {import("metro-config").ConfigT} + */ +const config = { + transformer: { + getTransformOptions: async () => ({ + transform: { + experimentalImportSupport: false, + inlineRequires: true, + }, + }), + }, +}; + +module.exports = mergeConfig( + getDefaultConfig(__dirname), + createHarmonyMetroConfig({ + reactNativeHarmonyPackageName: 'react-native-harmony', + }), + config, +); diff --git a/tester/package.json b/tester/package.json new file mode 100644 index 0000000000000000000000000000000000000000..e4a269c1f5d63d92eff4e3739e3faf96f2ee775a --- /dev/null +++ b/tester/package.json @@ -0,0 +1,50 @@ +{ + "name": "tester", + "version": "0.0.1", + "private": true, + "scripts": { + "start": "hdc rport tcp:8081 tcp:8081 && react-native start", + "install:dev": "npm run pack:pkg && npm uninstall react-native-harmony-svg && npm i", + "pack:pkg": "cd ../react-native-harmony-svg && npm pack && cd ../tester", + "install:pkg": "npm run pack:pkg && npm i @react-native-oh-tpl/react-native-svg@file:../react-native-harmony-svg/react-native-oh-tpl-react-native-svg-15.0.0-0.5.8.tgz", + "dev": "npm uninstall react-native-harmony-svg && npm run install:pkg && react-native bundle-harmony --dev --minify=false", + "postinstall": "node ./scripts/create-build-profile", + "android": "react-native run-android" + }, + "dependencies": { + "@gorhom/portal": "^1.0.14", + "@react-native-oh-tpl/react-native-svg": "file:../react-native-harmony-svg/react-native-oh-tpl-react-native-svg-15.0.0-0.5.8.tgz", + "react": "18.2.0", + "react-native": "0.72.5", + "react-native-harmony": "file:rnoh_package/react-native-harmony/rnoh-react-native-harmony-0.72.27.tgz", + "react-native-qrcode-svg": "^6.2.0", + "react-native-svg": "15.0.0" + }, + "devDependencies": { + "@babel/core": "^7.20.0", + "@babel/preset-env": "^7.20.0", + "@babel/runtime": "^7.20.0", + "@react-native-community/eslint-config": "^3.2.0", + "@react-native/metro-config": "^0.72.9", + "@rnoh/testerino": "file:rnoh_package/testerino/rnoh-testerino-0.0.9.tgz", + "@tsconfig/react-native": "^2.0.2", + "@types/jest": "^29.2.1", + "@types/react": "^18.0.24", + "@types/react-test-renderer": "^18.0.0", + "babel-jest": "^29.2.1", + "eslint": "^8.19.0", + "jest": "^29.2.1", + "metro-config": "^0.76.3", + "metro-react-native-babel-preset": "0.73.9", + "prettier": "^2.4.1", + "react-test-renderer": "18.2.0", + "typescript": "4.8.4" + }, + "jest": { + "preset": "react-native" + }, + "overrides": { + "@rnoh/react-native-harmony-cli": "file:rnoh_package/react-native-harmony-cli/rnoh-react-native-harmony-cli-0.0.26.tgz", + "@react-native/codegen": "0.74.0" + } +} diff --git a/tester/rnoh_package/react-native-harmony-cli/rnoh-react-native-harmony-cli-0.0.26.tgz b/tester/rnoh_package/react-native-harmony-cli/rnoh-react-native-harmony-cli-0.0.26.tgz new file mode 100644 index 0000000000000000000000000000000000000000..d0cbf3304861d333420f78ce1c91eea9e9faae2f Binary files /dev/null and b/tester/rnoh_package/react-native-harmony-cli/rnoh-react-native-harmony-cli-0.0.26.tgz differ diff --git a/tester/rnoh_package/react-native-harmony/rnoh-react-native-harmony-0.72.27.tgz b/tester/rnoh_package/react-native-harmony/rnoh-react-native-harmony-0.72.27.tgz new file mode 100644 index 0000000000000000000000000000000000000000..907345d6e90f4f5be70284c5b462d17e159f72b0 Binary files /dev/null and b/tester/rnoh_package/react-native-harmony/rnoh-react-native-harmony-0.72.27.tgz differ diff --git a/tester/rnoh_package/testerino/rnoh-testerino-0.0.9.tgz b/tester/rnoh_package/testerino/rnoh-testerino-0.0.9.tgz new file mode 100644 index 0000000000000000000000000000000000000000..fb8420f7f1278b7479c552697157efde0aa8e5cd Binary files /dev/null and b/tester/rnoh_package/testerino/rnoh-testerino-0.0.9.tgz differ diff --git a/tester/scripts/create-build-profile.js b/tester/scripts/create-build-profile.js new file mode 100644 index 0000000000000000000000000000000000000000..d7c07647540341bc67b69e46a5063744a3697ae4 --- /dev/null +++ b/tester/scripts/create-build-profile.js @@ -0,0 +1,39 @@ +const fs = require('fs'); +const JSON5 = require('json5'); +const path = require('path'); + +const templatePath = path.join( + __dirname, + '..', + 'harmony', + 'build-profile.template.json5', +); +const existingProfilePath = path.join( + __dirname, + '..', + 'harmony', + 'build-profile.json5', +); + +if (fs.existsSync(existingProfilePath)) { + let existingProfile = JSON5.parse( + fs.readFileSync(existingProfilePath, 'utf-8'), + ); + let template = JSON5.parse(fs.readFileSync(templatePath, 'utf-8')); + let signingConfigs = + existingProfile.app && existingProfile.app.signingConfigs; + + existingProfile = {...template}; + + if (signingConfigs) { + existingProfile.app.signingConfigs = signingConfigs; + } + + fs.writeFileSync( + existingProfilePath, + JSON5.stringify(existingProfile, null, 2), + ); +} else { + // File doesn't exist, create a copy from the template + fs.copyFileSync(templatePath, existingProfilePath); +} diff --git a/tester/svgDemoCases/App.tsx b/tester/svgDemoCases/App.tsx new file mode 100644 index 0000000000000000000000000000000000000000..767ad2222b2b24dfe95d1fd6578e36fcb905e1e6 --- /dev/null +++ b/tester/svgDemoCases/App.tsx @@ -0,0 +1,50 @@ + +import React from 'react'; +import { + SafeAreaView, + ScrollView, + StatusBar, + StyleSheet, + View, +} from 'react-native'; +import {NavigationContainer, Page} from './Navigation'; +import {PortalProvider} from '@gorhom/portal'; +import testSuiteByName from './components'; + + +const comList = Object.keys(testSuiteByName).map(testSuiteName => { + return { + name: testSuiteName, + com: testSuiteByName[testSuiteName as keyof typeof testSuiteByName] + } +}) +// @ts-ignore +comList.sort((a, b) => { + return a.name.localeCompare(b.name) +}) + +function App() { + return ( + + + + + + {comList.map(com => { + const TestSuite = com.com + return ( + + + + ); + })} + + + + + + ); + } + export default App \ No newline at end of file diff --git a/tester/svgDemoCases/Navigation.tsx b/tester/svgDemoCases/Navigation.tsx new file mode 100644 index 0000000000000000000000000000000000000000..c4701d41b5a0ff0fce6c1d8730a48a2a5f0d868d --- /dev/null +++ b/tester/svgDemoCases/Navigation.tsx @@ -0,0 +1,164 @@ +import React, {useEffect} from 'react'; +import { + FlatList, + Image, + Platform, + StyleSheet, + Text, + TouchableOpacity, + View, +} from 'react-native'; +import {PALETTE} from './Palette'; + +const NavigationContext = React.createContext< + | { + currentPageName: string; + navigateTo: (pageName: string) => void; + registerPageName: (pageName: string) => void; + registeredPageNames: string[]; + } + | undefined +>(undefined); + +export function NavigationContainer({ + initialPage = 'INDEX', + hasHeader = true, + children, +}: { + initialPage?: string; + children: any; + hasHeader?: boolean +}) { + const [currentPageName, setCurrentPageName] = React.useState(initialPage); + const [registeredPageNames, setRegisteredPageNames] = React.useState< + string[] + >([]); + + return ( + { + setRegisteredPageNames(pageNames => { + if (pageNames.includes(pageName)) { + return pageNames; + } + return [...pageNames, pageName]; + }); + }, + registeredPageNames, + }}> + + + + + {children} + + + ); +} + +export function useNavigation() { + return React.useContext(NavigationContext)!; +} + +export function Page({name, children}: {name: string; children: any}) { + const {currentPageName, navigateTo, registerPageName} = useNavigation(); + + useEffect(() => { + if (name !== 'INDEX') { + registerPageName(name); + } + }, [name]); + + return name === currentPageName ? ( + + {name !== 'INDEX' && ( + + { + navigateTo('INDEX'); + }}> + + {'‹ Back'} + + + + )} + {children} + + ) : null; +} + +export function IndexPage({ hasHeader }: { hasHeader: boolean }) { + const {navigateTo, registeredPageNames} = useNavigation(); + + return ( + + + + RN Svg Capi Tester + {'rnohArchitecture' in Platform.constants + ? (` (${Platform.constants.rnohArchitecture})` as string) + : ''} + + + : null + } + renderItem={({item}) => { + return ( + + { + navigateTo(item); + }}> + {item} + + + ); + }} + ItemSeparatorComponent={() => ( + + )} + /> + ); +} + +const styles = StyleSheet.create({ + container: { + width: '100%', + height: '100%', + backgroundColor: '#888', + }, + buttonText: { + width: '100%', + fontWeight: 'bold', + paddingHorizontal: 16, + paddingVertical: 24, + color: 'white', + backgroundColor: 'black', + }, +}); diff --git a/tester/svgDemoCases/Palette.ts b/tester/svgDemoCases/Palette.ts new file mode 100644 index 0000000000000000000000000000000000000000..0531aef8bd0fd570d953acd75b24abd2620def4f --- /dev/null +++ b/tester/svgDemoCases/Palette.ts @@ -0,0 +1,4 @@ +export const PALETTE = { + REACT_CYAN_LIGHT: 'hsl(193, 95%, 68%)', + REACT_CYAN_DARK: 'hsl(193, 95%, 30%)', +}; diff --git a/tester/svgDemoCases/components/Circle.tsx b/tester/svgDemoCases/components/Circle.tsx new file mode 100644 index 0000000000000000000000000000000000000000..2ef87cc4f4a493aaa9ca81549c91cc687435e76a --- /dev/null +++ b/tester/svgDemoCases/components/Circle.tsx @@ -0,0 +1,94 @@ +import React, {Component} from 'react'; +import {Svg, Circle} from 'react-native-svg'; +import { View } from 'react-native' + class CircleExample extends Component { + static title = 'Circle'; + render() { + return ( + + + + ); + } +} + +class StrokeCircle extends Component { + static title = 'Stroke Circle'; + render() { + return ( + + + + ); + } +} + +class StrokeOpacityCircle extends Component { + static title = 'Circle with strokeOpacity'; + render() { + return ( + + + + ); + } +} + +class PieCircle extends Component { + static title = 'Draw a Pie shape with circle'; + render() { + return ( + + + + + ); + } +} + +const icon = ( + + + +); + +const samples = [CircleExample, StrokeCircle, StrokeOpacityCircle, PieCircle]; +export {icon, samples}; + + +export default function () { + return ( + + + + + + + + ) +} diff --git a/tester/svgDemoCases/components/ClipPath.tsx b/tester/svgDemoCases/components/ClipPath.tsx new file mode 100644 index 0000000000000000000000000000000000000000..b54fe601504f22e0b123e8a80a91de196ee5c0e4 --- /dev/null +++ b/tester/svgDemoCases/components/ClipPath.tsx @@ -0,0 +1,187 @@ +import React from "react"; +import { Svg, Circle, ClipPath, Rect, Path, Use, Defs, G, RNSVGClipPath, } from 'react-native-svg' +import { ScrollView, View, Text } from 'react-native' +import { Tester, Filter, TestCase, TestSuite } from '@rnoh/testerino'; +export default function () { + return ( + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ) +} \ No newline at end of file diff --git a/tester/svgDemoCases/components/ComplexDemo.tsx b/tester/svgDemoCases/components/ComplexDemo.tsx new file mode 100644 index 0000000000000000000000000000000000000000..f38bca6b5029e8f9cca81a186bd428fb83ec29b6 --- /dev/null +++ b/tester/svgDemoCases/components/ComplexDemo.tsx @@ -0,0 +1,555 @@ +import React, {Component} from 'react'; +import Svg, { + Circle, + Ellipse, + G, + Text, + TSpan, + TextPath, + Path, + Polygon, + Polyline, + Line, + Rect, + Use, + Image, + Symbol, + Defs, + SvgXml, + LinearGradient, + Stop, + ClipPath, +} from 'react-native-svg'; +import {SvgCssUri} from 'react-native-svg/css'; +import { + View, + StyleSheet, + ScrollView, + Alert, + Button, + Text as RNText, +} from 'react-native'; +import {Tester, Filter, TestCase, TestSuite} from '@rnoh/testerino'; +import {TestItem} from './gen'; + +const dataUriExample = + 'data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD/2wCEAAkGBxMTEhUTExMWFhQWFhgXGRgXGB0gGBgaIBseGhsbHRoeHSggGh0lGx8aITIhJSorLi4uHR8zODMuNygtLisBCgoKDg0OGxAQGysmICYwLS42Ni0tLTItLy0vLy0tMjA1LS0tLS0tLzUtLTUvLS0tLS0tKy8tLS0tLy0tLzUvLf/AABEIAOkA2AMBIgACEQEDEQH/xAAcAAACAwEBAQEAAAAAAAAAAAAABgQFBwMCAQj/xABLEAACAQIEBAQCBgcECAMJAAABAgMAEQQSITEFBkFREyJhcTKBBxQjQpGhUmJyscHR8CQzU+FDgpKissLT8RVEZEVjc4OTo7PD0v/EABoBAAIDAQEAAAAAAAAAAAAAAAADAgQFAQb/xAAzEQACAgEDAQQKAgICAwAAAAABAgADEQQSITETQVGhBSIyYXGBkcHR8LHhFDMjUhUk8f/aAAwDAQACEQMRAD8A3GiiiiEKKKKIQqBx3iS4aCSdyAqC5J6agfPU7VPrJPpr5lDKOHxG9yGnI7DVI/xsx7WXuahY2FMfpqGusCLKvGfSdC0ly8rC/wB1Rb82Bpr4Bzasq5sPMHtqY2v+BB1X9oae9YXHhh0Gg/rWvcTSQOssTFHU3BH9aishtPzuRyG95mzb6McJkc/KfqfhPFEnUldGXR0PxKfX0PQ7Gp1YzyrzYZ7SoRHiYxZl+646gjqhPzU/K+qcD4zHiUzLoy6Oh+JD2PcHodjV3S6rtPUfhx+5ExLKyvwllRRRV2KhRRRRCFFFFEIUUVyxOIVBdjXCQBkwn2eYKLmk7mnmqKAXlmEYI0UaufZR09Tp6iqnnnncQrljs07/AAJ0H67enYdfxNZTieC4jEFpXZnlJuQ5Hm06G/lPSx006Cs5i+p9k4TzMmx7MdMmOZ+kiDZJJoz0cqNOx0Y39rVqvJ3F2xeCgxDWzOnmsCAWBKsQDqASCQOxr8yRwgggja++hBG4I3BG1j1rXfoX5lAT6jJ5d2gJO99Xj/G7D3bsK7pNtbFcnnxMrDV9odrDE1eiiitGOhRRRRCFFFFEIUUUUQhRULH8RWPTc9qWuOPJionhMjxq43jbKw+Y/MbGqd+uqpODyfdGJWWlbz/9JMeHDQYVhJiDcFxqkXc9mcdth12scVZ2YlmJLEliSbsSdSSTubm96mcxcvy4GTK3mjb4ZAN/Q9jUbD+4/r1pTW9p6w6T1noyqlU/4/n4zlfp2r04013PT+VfJiLXO+w7ntbqfbvVdxTFzQNkeLI5AYZmBNjfWw266XriKW6R+p1dVHtmSYHkicSxmzqb+/8AMGnzgHNudlkiPhYhdCL/ABDS9x99D23Hodazw49fDvnIc28hUkEnY/CMv4t6VInw4vrmRxYgEFWN9iAwBt62rltG7BPBHQzIYU6kk1HnwPfP0fwbnKGQWmtFIN+qH1B6A/rW+dMMGLjf4HVv2WB/dX5Xi4tiUFmIkXs2/wCO/wCN6lYfmeRfiWQfsm4/hTFuuUYYA/CZ76IjuI+U/UlFfnDh/N8hkR4pHEkTCRVc2DW0ZTa91Kkqe2a41Fbtw3mWCbCjFK1kI1U2zK43RuzA/K2u2tWKrw+cjBEqWVFJc1zeZRuwHuRWD8z89g4hjnex6J26bkW9u1qqH586KsrftPYflekHVsfZTM6a0X2mAm88V5mghB8wLdAP5dazTm7n3IuYkGQ/DFfbsWtsPT/M0iScQxOJ1zeGpVmUINTbdcx3I62qPNwMFM6XZwSCBrmFrnKdmYam25BO9gKi9VtwzZ08B+ZxrFRfUGTIacQkaQzSgO7Nmvcg+w6ewt26U28PnYtGUkur5dwbWLEMDdiQQFcbizAXvShGQw0PtrpV5wSQ+DZTeTxmyhdbL5L39Q6lh872Usabp7CTt8JQpuZ2IaeeZZFGJzqLZrgnozJZcwPc6qQf8P1qrw8rKwObK2jKwJBBBuCCOul71cc1qB4ZKhZH8zgG/wAIt7buBf09KpYpAR6+vQdqRqRh8iV9QMPxNv5E+keOcLBi2WPEbK50SXoPRXPbYnbew0OvzRyxypNj2vfwsOps8rC9z1WNfvN+Q69juHB0OHhSGOSRlQWDSsXc+5PTsBYAaCpjWLWALOsvacWMvrRnoqpwXGVLCOSys2in7rHt6N6fherarldi2LuU8RpBHWFFFFTnIVC4vjPCiLddh7/9r1Nqg51OXDh/upIhb0U3Qn2GYE+gNJ1DMtTFeuJJMbhmZ3zZz6uEOQr4kx1AvZV9zub9vz7qeH+lzEZrvDGV7KGB/HMR+VRvpa4Q64hcQASkihSR0YAC3poAfnSAPn/Xz96oaTSU20hm5J6/GMd2DYm5JxjD8TgZQdLaqfiQ9/b1rMJ4WhlaJt1OnqOhqs4JxWTDyrIh2NiL6Feot2P9bU0c1IJY0xCa2sfXKe/sf40sUHTWbM+q3T3GX9FqSp3fWK3MTHyHXW/XtbW3zqUFjZVEIyGaWRYg40CufCync+VMtm1FzJ1GtJxBmzeZrjUj0BN6aOBKZ4YIY4fFkRpCSt1MQJjyEMd5c4JtqLED9nQI2oIjVWdrqGOP3iN3LXMOHV1iWGNY/GSJoyyCONk83jZsl5DdRZnYE2sLm9W2N49Ciu04fEJIxYKoRleMs8cYUNoQURnYhlFyunmpOg4Xh+HYnEeO0igeGkbC5RmIzvmVbZ1BCDIdSGDW7RxzThpAIZY5ZsjERuj5HZdbI5Pb9MWJG4FqomkMcoCRxJ1uMgP5dZxaGPMxhR1iB8iubuF28xvudTb1t0r40YOtesG3kHmzEWB9W2OvvXpyu5On777C3U36U3nM9SiIlYA6Y75WTwspDpoVO/r/ACtVlHzI6YdgLgOwuvQsBbU7kWH5V25p4ZPhY43doUzqGMTP9qAx08gN9BvpptrVHOn2aX2zn+NSKhgCZ5/WWVes1XdCOIsczEljqa6+Df8AyqXDFYfl/wB6+Rs2ayjMx2UddQN+mpA+dK3FjhZ5Euzt4mWnBZ0UCOSTwxctHIdoyLki23mPf1HUU1rlc5JV8OUWBAtZtjYH7w1BtuPzpZxnLMgRWzxPmUkKCwNrdCRbt8WUVw4Fi5SxhK+Iig3Vr5ka1hlNiQ9hYDa17W63amcAK4lypnGFcS44vyojuDEXQvoSDmJNv0WOpt5txpGR1qVhskJyBBG4X/SsyxhBlF0YjzDMRpvc66Za6YWYkAFs0TOFUyWzRSXGSKS975xYXtdcw3uDXrjfD9PDkJACNkkF7Rs5y2BAGnlUFRuHYAWNg7AEdgDmJ3GuIfWJBKLhcqhB6WuTb1JPyAr5yzwY4zECMtliUB5XG4S+w/WY6D5nW1RsTJZcxsDbbsex9v4U28OIweEs2jW8WU9S5HlT/VFh7k1l2WkAtjnoPjEaSo32Fm6CN/GeZsPgoUWwVFGWOJN7D9w7sdz3NJUv0v4i9kgiy9jmLfiGH7qQeMcTkxErSOdSdugHQD0FQCL02j0egG6zljLz2dy9JufLPN0XElaJkKSBblQdNPvK26sDY/uJ1rSOS+JvPhQZdZY2eGQ/pMhtm9My5Xt+tWR/QnwBvClxb6LJaOK/UKTnYel7L8mrUPo9S8Esw+CfEySJ6oMsSsPRhHmHowqOlTs9Q6J7OPODnKgnrGmiiitOKhXLE4dZEaN1DI6lWU7FSLEH3FdaKITLuIcOEd+H4sZ43B+ryt/pFA0Un/GQaEffGo6gZDzfyjLhSXS7w75huv7Q/j/3r9R8X4XFiYmhmQOjdOoI2ZSNVYHUEaist5k4ViMGVSS88DHLHORqL7JMANG6Bxo3Wx0rNep9Mxer2e8fiPTD+q3WYP8A1vTly84kw2RthdD7H+PX51C5v4EIT4qABGNiP0T6DambhnK82DwsTzjK+IzS+GRZkRcoF/1iCCRuOut7S1LrbRvX3SVIKW7TM04lCVOu4JU+4p65W4ymCLeFGrSR4ZzNMFAQMVDRJmuc15MqEm1yRlG5ZY5lw6+LNbcMGB9Gsf41Qa29Dr/X508KLaxmdtyj58f/AJNb4hxCNpTiQViDi2J6xsLSaZWBXxRZJAg1PiWZb3zJ+BYTDxkwLWCss7wxlo0PRwjBox5dWQi2l1K7h75E5fwmMwZmxBVnYMoUWP1eEEoFRDcITlJz2zakgg3amSDmjhsAOHw13toYsPE7nYJ90WvYAb3qmbAmVVSSJIKWwScTIuWIJ8SzrFGoIAZmNkgiW2jMQNNPcta+utN+aHhJV2/teOkH2KZciQr1exJIvr5jYkAgWBJP3ifHsNhWIw2EmklDooOKzrFA+X7MCI/eVFFrKDlAOalmwLvLM+eaQ3ZybfIdgP4VIkuckYHh4/19JpaWu7UKE3eqv78z9QJL5m47isblM7IqqcwSNAMpta2c3Y+ovY9tKrMdFbCwuOsh/wCeu0+E8SCWUrN4QGRJIyuTxjsHJuxW5A8ulzYkVL4lhcvCcKx+IzEE/OShuAo9/wBjE641BWSscDv8TIMMgIt1A3/hV5yjh1vJM2Wy+QBj8ThS1gDvofXbbeqDh0BY7+RFzObgWX5+x1sbAGmfB8ShjijcXSNiUS4J0A88mTWw8uUddbm96dp6tp3meaorwd5lTDzFK9vFbxEJBPlF18p1Ww21vY3029bqBFzrLD5msrHLrmW4cPlHxMga2W/mU+U3Fqp+aZQ0qsHDjJ8emoNiuqixt5qOX+LLCTnLFQDkN9AbaI2hIW+ug0PcbNV9rFWMYtm1ijGXzYqPwpE8RDIySKAHu7MScpKkBolFhc6ZdzYC9MeJxSBLs65SNSSLEEfmP51RJjDOAcylGJtlJNitzclXXS40N+2g3qixvGVAbKxMhASMrcLHl+I32JBIATW2UX3LM4kAZMeSAMmVMUaSYpUX+78diOxUMW/AgafKpvO+OOQLf43Ykeg6fifyqFwWO0wA1yo1rfJf41bYzlmbGriHw4zNhY45PDAu0gdnDBf1gEuB11G9qzRh71+ZjtNgUMw7zEEC1O3JHIr4krNibx4XcdJJx2QdE7v66X3Hzk7gSKq4qdA5J+xiYeXQ/wB446i98o6+1aBwDAYriLtkdooASsuIt5mI0McI2uNi9rL0BNPuvYt2dQ58e4SS1gLubpLkZsW/1DCjJCgCTyJosEVv7lD/AIrLp+qCSdbVomGw6xosaKFRFCqo2CgWAHoBUfg/CocNEsMCBI12A3J6kk6sxOpJ1NTadRQKlx1PeYtmyYUUUU+RhRRRRCFI/wBJXF54lVEglaNhdpUQuqm50YLdl6EEi2u9xTxRULE3qVMkrbTmYrytw2XGYuE+DIsEUqzSSOjKnk8yImYDOTIF20ABvTB9MbWOF9pvlrH/ABrSqyr6aXzPCnZGOn6zAf8ALVS2laqCq/vMsVOXuBMyLiJVsSx7hb/gAa443g3jFBHYE2RAPvMzABbdB6+tc3k+2ct92w9dh+daryTweOF18Vc2LMfiEbjDodFBOwdr27mzW0BJS1ppUEeE2V7L/HKvyTn+f34y7wcWD4akUPkjDgRmUqBndV8viOB8TDNa+mhHa/zmrheGxMTLiEUgjR7DOvZlbcfuNVnNTlpSrCSLSyyCAz4eaM2LRzRgaENmte1gbg6kVB5fwSSS5IwvgxWaUxNIIS+6xrGzEKxOpA2A13FUwmR2hJz1lBm2+rjiKfN/EoL4KCUidMJCPHVZMplcqqAA/ET5b9wDUSbmVPL4PB8Ii3/0iB3PsWA19SprTsbyNgsSS7xCOQ388Nla51JIsVJv1Iqlxf0TTbwYpGHRZVKn5sua/wCAqxRqanUAef8AXEiiVZPaMR8B94iY3i+JlQLIyRxKbrh4EVIVPsBrrc6k61b8ZF+CYU9fHP75al476NeJL9yJ/wBmVdf9rLU3i/K+LPC8NhhDedZSzKHTyi8huWzZdiOvUV21lBTke19jHaw0mnbT/cSMBiyisAqkNobi4y5bWy6A636jRmFEmIaTKWKjKoUKNEUaXt0W9gbWt8rAXMXIeOIAIhT9qZf+TNUheQbaz4pfVYULE/6zZQPexprXDbgsMTAXT3ONvQRUTEkgLa9rKO5Fz+G4+d6u+F8HEoF3N+qKLBRqNWNs2otYW96vYsDh4ARDCCxFvElOd9NrCwRD7CqLhOM+rlo3cIBezkXYjdQq9Tv310t2ZRZVY3HWWbdKQe0cdZcYnCqALxgItlvoGC9FVRmLHew1JvbS1VHHm1jTqAXZSfh2RFIGgZVQ3toS3tXWfjQv9lmLWW80upuDclE2W+g6bbVVTjUtf4rkk7k31J9Tvep33LjaJSuuXG0STwU/av8AsgDtvWp/Qqbz479jC/vnrJeGyMs2mvl/jf8AjWpfQ1iLYzEqdDJBGwH7DsD/APkFV6Bi4H3TQo50gx+8yHzfwmXD42YvHKYJGMkciIzIA3mZGKg5CHLWBsLWt1pm+iyacNLGIpBhMudWkQoBKW8wQNZmVrliQLAg63atEoq2umVbDYCftBriy7TCiiirEVCiiiiEKKKKIQoooohCsb+krErJjmDHyxIBcW6W79cxI/GtexmIEcbO2yqT+HSvzdzTxVn8d2OrkgepJ3/MmqWsJICDvlrSjkt4Sl5aAkx8JJ0eZit9swDGO/fz5a27gvDkw8YVf2pHY+eR7eZ3PUn8hYDQVhHAYicfgkXcTRMfbxF/gK3jjnChiEWJjaMupkF7F0W7ZPYsFB9L1Q1w9ZRniXxwSO8Y/j8xH+kHHy44rgsAQ6tG00rq3lKglVUNsQWB23OXpepX0U8T8TD/AFUqEaAkFQuU9mLDq+bc+orrg+MYeLH4mO6qfFihK6BUjEKCI+iiXOh7GRO9esXCMJxKHErosx8KXsbjysf3f7Paouu6rssY4yP5lZupeaHhMP1ql49zimDkEc0ZGYFkbN5XAIBscuhFxcHXUb0woKzP6aV8+CPpiPX/AAvQ1HRVqXCkRFhPWW0/0mQGwWMuzEKqhtWZiFVRdQLkm2pFWfFIpGHlYI9r2+Jb9tgbX6j86xTBNaeA/wDqID/9xb/wrcOI4gC5+VT9IUpWylRO0EnMzCLnNnUEqwJtpdbD55da6YDjrzIXbRWuFUWuLEi7NbUkjYDT16KMHwL10/Df/P8Ao1d8soDAv7Un/G1WtbTWleVUDnwktKxZ/WMl4ibXU1Q8fkuVVRqPMTb4R/K/7qYsTg9DeqLgWLVpJHB+0LeVT95R0XXe2vfek6OsO2fCP1bgV48eJDiF6++FfQm1hpr1q1x+FCWkUBVY2KjZTa4I/VYbdARbrpVNL270x1ZWxPLOjKxE+YOQCaMnqbfKtG5Gm8HiWGY7SeJh27DOudfxeNR86zbF2IuPiGtNGExjSQq8f96uWRL/AOIhDp/vAVAttZX+U2PR7b6Wrn6QoqHwbiKYmCKeP4ZUVx3Fxex9RsfaplbEjCiiiiEKKKKIQoooohCiiuGNxSxIXbYD8a4SAMmESfpV4+IoRAp877j0/rX/AGawfjuMBZY7iyasfW1h+At+JrQOd8TnLzvrtlHck2AHqfyHtVBgIcQPhwsfm11yk6jfzRE1k9uHc2d3d0+80UxWoHzilwXiQglGKtfLKjBeuVWBI9yK03Ec+L4UuLIKIEKYdGtnkY6l2AJsLhQB2DHqKqnmxINjhIRY7WT/AKVWUfFplK58Dh2JvYMUu3e32Xtt6dxRaVsIJXzHT6wa49x7vPJOfOZZxMuztiFfzPcsCRcA9P1hbS1WnD+ZpBhCkrmVUdMgb443BzpZvvIcpH6th0NadFx2VdDwuA9Pu+/+DRiOaCnx8KwwG+6/9Kmi8MMFfMfmIsKk5QYj4vFIkhjklkVAyra+5JsNBudSNu4rPPpfxKyDBuoa15x51ZD/AKPo6g2+VMvMvBJsdhcLPGww2LhyzRgG8YJscjEAaaIb5dLbUi89Y/EypCuNh8GZGcKVN45bhQSCCcoFgbE9elK06qLFweec8/uflFt0MUkezxnoJou+v2imtR45jzmsugv/AJ1lEz6KTuGQ33Gjg20F7+16f5MXJKfJA2tzeU+EnzuDK3yVfemekKS5U5AHPUxmmcLmIMA8q9rfy7+vtVzy/i0jh1zkhn0SJ3+8TqQAoPzqraXP58gW+uVAcqjsASf6FWPAGIh9nf8A4zVjWFRX6wzzI6YEtgHHEsJOJs+FlmyhUysIyfibdcxXXKL7a/IaXSsJIq7n89vb+dPmPxIjheRkDhcpym1jdgOoPvUfh30hqnxYCF/kg/8A11T0qs4Y1pxnu/uR1qA4DNIP1yJsNnYgsUF++fMBf8QDbpftVBNiFvoRT0/0lRHQcMh/3P8Ap1Gk+kND/wCz4R8k/wCnVyyu5iD2Z+o/MpulbnJcRRWcdSLW6VP5Ux9i0Z/aX+v62q3fnXxBZMFCDZiTZPKF3Y/Z7VBn5nmGUfV41MighVVA2X1IS4BtffYHsarNWxBXb5j8yxpqVpbfu8jNY+iri4R5MCx8rZp4PYm8sfyY+IP22/RrS6/NeF4m/wBniIWCyRtnQ9mF9D3U6qe4av0By1xuPGYaPER6Bh5lO6ONGQ+oNx679as6Swsm1uojtRXtbcOhlpRRRVuV4UUUUQhRRRRCFZ5zxxvxG8FCMoBJ13/r93uavecePCFPDUjOwPy/r/Lrpj3G8W7uIomvLJqxH3F6t+0dh86zNZduPZJ85apTA3tOSg4nEgC5iiOnXM+xI722HzpzxChIrM3hlSgMpFxEpYB5CoNjlUlr7aa6A1y5f4QkcSRjMHAOw3Ft7W3HberLh3BDxK4LsuCF1kK6NO4Jui/oxI2jHW5FhaxqnXX2tioo4H75zrNgEmUGN5iwwiMckuWaFkIbCymVMRHYAqJniskgF7kKouNDYkC74NxDg0isy4mSKWWNoy+IkbxEDW0DSZo9CARa4vfuatZPom4cRYLKvqJST/vXFV2I+iGPXwcXIl1ZfPGj6EFT+iNidRYjpatwVoOgH0lXJkrGYdoXRJyJI5j9lKgsrG2YKQD5WygtoSGCki1stUvM0OVGQHcZQCDrfYa9zpTHwrgWMwkC4b+z4zDodAzNFKmt/KfONDqNVI76CyzgsRLiuIeFJF4aQS5srOGcZBm82UWsTkt3DA3N6ytRotj9ons+EetuRgx+eyIqj7oC/gLVln0sOL4b9qX9y1pGLmAB1Hv0rKvpCxSyMmUSExl/hR2vew0IWwta+p9utVdIS+pDdwz/ABJsMIYk4k6Dp5k/4hp71oZck721IrOsUWtpHLcFTbw21sQeopyTGB/OpIB11BBHoQdb1c9JAnaR7/tJ6TvEUMOBkW47a/17b1a8vC8ZHTxZP+KqqNSFF9CBrcbemvX/ACq95TjujX28V/x0P8as6/8A1fOK0n+z5SXxQZsPKv6hIHt5v4Um4YeX36+1aO2GBBvsdLVnPhFHaM38rEH5Hf1pnoG0bnT5xPpVMqGEkLHfb+v51Kw3DfFkWNLlmNrjoN2PyUGueEiZ2EcaM7nUKv3e7MdlHqSBVtJh1jEJ8NZFaYDxVfyOuSxQEj4CxNwpuVBLC1gNnW61KVKr7Z8vfMrS6Z7GDH2R5zlHgFiYiKJpVnCrlBsHa4KWY6CMlWY6EnUHQ17ggOWSxUyNcS4hv7uMaApGTudAN7jS5UkKtpzCBJG8rFykYYmxyKzZdmkGljcLZCR9258pTzHgInVGllOJCqAkeHTLAlhYANcLf1Z1PcHavMpbxlj9/wB+eB456TcZe4RZ4XLHHKYM32bfCT+lte3QHb8DYbDQ+Q+O/UJvO39mlYLKP8N9lm9tlb0sfu0h8x4VgwXwkjFjZFPmT3sBcnvbL+j1q55Xx4nXw3/vFFiD95dr+42Pyp+pVqwNTX0PXv8AP8cZkaLQ+aX6ifpEGikbkLjZS2CmbYfYMTuoH90T+ko27r+ybvNW6rFsUMsSylTgwooopkjCofE8aIlJ69BXbEzhFuaz3mrjyxq00pso0UdSegHqfyHtVDWavssIvLGNrTdyekXuc+KZAXbzSOSqL1J/kNyf51A5P4QyHxXsZHNyTt7e3QWqLy8wxc31iR1Zz5Vj1AUb5VvbMe9tetaBDhVjHiEWA6liALWub36679hWY4NQ2n2j1ljdu+Erub8cR4OGiOWbElUU9Y1JAZ+19bD5npatE4CiLhoREmSPwkyL+iuUZQfW2/rWLcb42H4hFKDmWMKBp1zEkgdtd+vtY1oXCeZD9XUDyiONUJNr+VRmIuQL+p0UZdywWtfRU9nUMjk9ZWsbLRsx2PSIakliDZVVmY+uVAWttc2sL1hkX0i8SklQfWAgdkBCRR2FyAbZlY9epNW/MfGWxAN1JU3IBdrOehfLlzWGw0UXOmpvT/R1Cn1+KRwMisdxoCVYL+ZUfOrR6RcdZeFwZzL4Mfi3uZMgDX7lgB+XrUbgGPhGImDSKszEIkZ0OUeZiNLEsbab2W9OWP4IwBEYBF79M40tbUgNppqQR60h808utILvGyOLWexFiOuYeW43rDOntGRZn49ZZ3L3S0x+NF7VWY3FBhf+u1LqjiMwCZUW2hkIuWt13AB/GvsfL05ID4l9r+XKPyAvVNdMV9phLHaL3ZkfiV9x+NVTMWP/AHpgxXJjAXaWVx0PiNY6ejUucU4SyQRsHcK02UnMb7PpmPTSrVaAYwZPtwQQRPH/AIajElvEJO58SS5/3qt+C8HRCTHmFzc+ckE9yCTrVHhOFyHFeB48gBjDjzNqSSN7A9OgI9a84jG4nDmPJM3miWQhgDoxIG4vYgdR7E1Z7G649mrZzENdUg3FcRrfCHNc3NKHNkaDEBkYFmAzgbhhpr8rV2k5uxJQoVXMRYMosR62va9UscYGrHU9Se9XPRno6+u7e/GPOVNbra3r2rzmNHK3nTE4cBQ0sJKsctrqMpFiPMBctY3AJvpvUnFnNicG0TEuwzWIe4j8Mk3LMzgAka31uNrLaPyZAxxkJspy573AuFykXF7WsSNRrbvrf66uZMLFnIBxDyAIMhADyEEeSP4hm+F2Y2sDqLc9I1hNW2O8Z+oP4kdG+6hfdx9DPPMWFabw1C5isqWHiDz2uWCiRnVdL/GEF9PN8NMPFsCxXOz4pCRopMYY+l0mVT+NqruKzkz4eJ1kaJ5tmgYqTlbUocuax1IN2sNNRV4+GyiykJ3COIT7lTHcf7RrNZ2XbiXAAczNcRFllKEOgtmIfLcg/euqga9gT7mvELPGwlj0dTceo7VI41F/anytnUjUrIJLH9dt82m3avKnS3T8P+9eu04F+mG/nI/fGYF7Gm4lO6aXy/i48XEGBIIIvlPmjcagg+h1B/zFaVyzxkzKY5bCeMea20i7CRfQ9R0OnYn838L4nJhJfFjNxs630Zf61v0/Gtg4RjFxMceIw72ZdVbqrW1Vx1B2I6jUdDXmbkf0ddzyhmvXcupTPfNMoqv4LxQTobjLIukiX+E+ndTuD19wQCtNWDDI6RZGIq43i0rYlsNiFEbi7R2N0mjv8aGw1GgZN1PcEEofPfBJXmzySfZtZYja6x6C4I/WNzffbtati5i4HHi4sjEq6nPHIvxxONnX9xGxBIOhpUwg8US4TFqBOgAcD4XU/DNHf7rW91IIO1Y+o07UXdsvIPlHqwZdpmcLwXEoqpHhs6nqCuQ9QRrp10IBrjNh8WGtJh5Rk8wJR2Gn62oHyPSmnAYg4SdsPN5stmjP6S9LetMeG4uS1zqDpa342/rrXX9IWKeVBE6KgR1mTObnN946mrfC8Qzgqb7fDf2ufa/7hWh8ewUMiESKMmUa9hqbqx0Fh12FZPHlhLFnzDMyqbasl7Breosau6TVi8HjGIt69ssppgNNu1zXfh+IKkldCQynTowIP5H91UfGJfgHuf3V34XiCwvcafvHX8KuRc2HBc5K3nOmU2kTqV/TTuVJsRuRr0tTMuNidM6uGW2a666d/l/A1ggxLXte1+3epeB4jJGR4cjLqDodjtf3t+I0ohHjm/Ew6NCfDxAPlNgY5QRfw5O2YAFW03BViC1onAsYJ4QwRRc2cZtVcaWOl9ihGmx6dFzGYxpl84UEE2sLWve4HQAnWw0Bva1zfzydihFiXjf4Z1AB6ZlvcemZbf7NutUNdQGQuByP4jam5xHnikahMq5bqLXHSs55nlX6jApNrYo3P/1O9vStF4k6xw6LY2I9h/Ksp5jjEmHhjb72Ia4G/wB/uRWXRyV+P2MeR1+E7YZ1+vAEh82HS2q2aztt9plNu1zvt2ssbwATxGIDJPh1+zzeVGiJJAI1W3xLddiouQDaqLDYQ6FFh+tYcHIgAySxtsV8zEuDcXAIBzL6i34XxW7RSSKYru8UiELZsqOwVrLZ/tIyLqF6jXU1bLOjB6zyP36ESGFYbWHWQ+XuTnlxDLOCkcY8yhhmkY7WZSSo+9fQkFbb0/YHg0SBUWBUVdQqH0t5rWzG1tDcepsDVbgBIsrgspxC3LBhupXySeUnynKAT7iruUlwrRyZToQNCr373sSLbWI6Gk6zVW3vlz/OBO0UJUuFETIcTCs7yR4MpKLiPIM8UiE/EHHliuoJOToDqbFar8HGYZF8aNh4UAIICDMWJSUHOlnABQlVNhqRckCu/G55ZGfwZpEOcpfOrm7BnLKblkUBTddACpGay6VrPJLAPHnBw7BoyZCc4A8mdGUqJULBrMWYfBmJsTTva5Pu8SZLCgSby5EZZ2xBFlAMcIvIBlve6qOpABzC6lSLgUwYnEGIWDMVF7iMoUX2kSJSPmK+YLAkxogJKqgCkLoU30te4OmkeZQNjULmDj0cELoJmz2sY42iXLcaXEiB19rG/Y0r/Y2AMznsiJGIxPj4iSU7LdAS4Zha5AuqhTc+51rjbbt+6ueBYiMX81+mlhfta2UdtNNq6Kf5f517bT1iupVHhPM3OXsZjOcn9fuv+FaH9EvL86q2LdjHA4skfWb9f0UdDudenxUXIPLX16ctIP7LCQZP/eNusY99z2X9oGtb4zxBwyYbDKpxMo8ikeSGMaGVwNkXYD7xsBWJ6W1Af/10GSfKaWhpKjeZFlxsjYuKLCLfELYysf7uKAnXxbb5vupuTroATRTVy7wOPCRZEJZmOeSRvjlkO7se/YbAWA2r5SdNR2NYXOZbZsnMtaouaeBmdVlhIXFQ3aJzsb/FG/eNwLHsbEagVe0U9lDDBkZlXMEAx2GEsalMRCW8jfGrjSSJvXT2+EjQ1nMPMMzyPaZ1CW8oIUj8NT8yd62fm3A/V5fryD7N8qYodvupP7rorH9Gx+5SDzXwZIcQJREskU58wKBssm5sLG4bf3vWOoGntKOMjqPx+/ePzuGRFfivNjyKFklaQC1lawX0uFUZv9a+3euPDuFYvEt4iIbdXbyovbfcewNPY4ZkAkkjCBVtHDlA3HxyKAANNl39qrMBjWwkwOZvBbT9n0/lTP8ANC+pWoB/fDHM72JI3Eyj5p4DNBkZm8SMqAZFFgrdQwvtfQN120OhpMFijHe2oYfge/tW04WcSIwGVkK7MBZwbi1ttvSl3i30cwOpkw7tGw1KZbp3sB8S/In2rlHpEezb18Zxqe9YoxYsFQRb130PWpPDZA2vW+3a1q5PyfjYyVjQSXNmEbaDe1w2UjbauEGAxOGYmSGQKCM10Ngfe1uvfW4rRW6tvZYfWKKkd0u5B2uL9648Gw74jEoEBASSN7/oAMGJProQB1JtXaGXML9N6ZOUgohkAuJPFckC/vqOvly/lUNVYa6yR8J1Bky24vJdCrDKwvvroe+utZPxqf7OG/SY9L/p6269K1zjlxGASSwXYjf5206dfesZ5rF41uR/ff8A9HprWNpF3MB7/wAy0xwCfdLvH4Vpo1dXJmQEAs5WMKfivla6KQL3Lr8OgOtL8sRTEh3VrxunlVgWdQpYuSbHyRgnzjTS5tvZ8uYhpRZ7jLlAAsC7G5VIkFwoGUm+trX0BNo3MXDi2ebXxGPhpZiEyAMJdb6x6lSx3IJ18QVaXdXYa34/uQ4Zdyx4x0rNCkkrFZB4ZHhTao1mUkSHyvc28r+UlTc2qLJLlLtK+IRWChhJ4QWVyWtGj3JFwxBKgCwuCNapuCFV8AqSB5XzRyARqrIfK6kZr2WQ5fbXS4suI4u7St4rCQraFWUiwzMCEW2YufOoJBsQNGGlVDkHb+/eOxxmQ+YHRbymQMQsLKiebKFZWZBqLpora5SWAOlr1DwbPnhw0bDLEFaSNbq2ZLEhAUYq1/Mcp81mZRc3NZxriueK10yhXIANtGBUkXclzaxAbQgLrqAfXKeNKx5lUOXbzqWIDj4iq/oSqRnRlIDAON00shCtef39+8VkFsR3fFBBnRyq76SZFtfqw8gX2ux9KROaMSjYoGJjovnBkJUX6qNxfchtb2OxFXPG+MRqpbMyubjOo84a1xnUaMSotewJGxUEFvHIvKisi4jFi6v5oobWDjo722j7KPi9qdoWWn/nsOAPOK1KGwdmvfFwPe1t/wChX3C4d5nSKIXkkcIo9T1PYAa+gBpm5o5RmVnmgXMrEsUUWK3/AEVHTpYVffRby6Y0ONlUq8gKRKwsUjBszkHYsRYX6D9atmz0vUdMbVPPh75lpoGFu09I04WOPhuESKNS5UhUUfFPOx6erN+CjsKaeVeBHDq0kxD4qazTONh+jGnaNBoB11O5ql5OwX1mX6+4+yXMmEU/o7PPbu/wr+qP1qd6zNHSwBss9puZouR0HSFFFFXZCFFFFEJ4miV1ZGAZWBUg7EEWII7EVnWHw7YaV8IxP2VmhYk3eE3CG/Vk1Q+wP3q0iqTmblxMZ4d5HieMm0kdg+RhZ0uQbBrKb7gqCKp63S/5Fe0dR0k632mI7pLi5/q2GsWUgzSsLpAu9jqM0jdEv6mwqq4vwqWGU4XFZSWUskiAhJkGjEKSSrrcXW5tcEE1rfCOFQ4aJYYECIvQbkncknVmPUnU1E5p4CuMgMZOSRTniktcxyDZrdQdQR1BIquPRiLVtHtePv8AxGi87s90ybgvEThpFhkGZb3Rj1H86eBKGUOjnzaaWIt1HqPSlObDrKHgnTJiIzZ0/RPR1P3kbcN8jqDbhhMfJhlySDMt9HtpY9+3vWYwLHB4YdY7HeOkaOJLKYpPAfLKUbITsjZcoFyNBcb69u9IuNwuNRMuIEjEWuDKDGTf4tXy2vqNAb+tOmExa2z3UgaD2I7adf31y5n4YmKCMHICMHBW1x5StiCb2sdgOwpmlu7J8EDB7yOki67hEfh8hOZiMt/0tbkXFx30sPlVnwTiBixCKtys7CNgdrn4HA7g2+VWuF5LhAzTzSaDyomVQfU2LMfxG9WnD+UoIysyJc5SQWdmI9gSQLi+taF+upZCvJiVrbOZI4h5ULs17i2ttT/X8axXmNwQBaw8U7fOtm4zleLykE6ggaXv1FyPTvWM8yoci/8AxT+Pmqp6O/2DPiI6z2G+BkWLQhlJUgWBXRgCCp82+xa/vXWbFSkx3IZY1RQhFkypaykb2NgW/SNugAEaFh1NulSI1L2VbFiQq3Nhc9yfhFe0uppZd9gHA6zz1dtqnahM8wY9jPmcAgMrMHYZLsSZDZtMpYs2UFQLkdCTKlx4IIJGkYUqwVVaxFs5sDmLRISbkZjYhbkVX4iPVlFgpIa+bMGXuDYKVtbzGw0G2gaqnne5GYltANx6eXY9fW4tfsPOtWjtlRgTbDMFw3WWGNOZVtmKg3K5mIsddbWCr4fl8oJujjQAVInxMrXuQLlSdBfTq2lixIB2tcA2B1qtwoIUqTbOCwD2I8pFtG00GYXt0YbE2d+VuTJMUqSuGiwp1F753F9owdwRY5zprp2D6TQmTaOBE3dqcdmZE5L5X+tSePMCYI21zEkzOALICdbCwzegA66ah4cuIxAw+HCeIFDyyOCUgQ6KMoIzObHKlxoCTUXEXi8PD4eMGVhkw8C/CoG7seiDdnO/ua0DlbgK4OHw755GJeWQjWSQ/E3oNgB0AAqkCdbZvYYQdBGgdiu0Hnvif54J/q+JADsT4MiiyTrvYanLIB8SX9RcV64ij4qVMCrH7QZp2BN0w4NmAPRnPkHpmPSnri3C4sTEYpkDodbHcEbMpGqsDqGFiKr+WeW0wfikSPK8rAmSSxfKosiXAFwuvuWJ61z/AMaouDj2fD3zvbHbiXMMSooVQFVQFAGwAFgAOwFe6KK04mFFFFEIUUUUQhRRRRCFFFFEJRc0crxYwK1zFOl/DmQDMvdSDo6Hqp+VjrSJj4psLpjIsqj/AMxGC0DDux+KH2cW/WNaxQRVXUaSu8et18R1jEsZOkyWLg8bgSQtlvrmiIKN6kbH3FeDh8TEbhRKoN/IbN/st69iaesfyVhHYvGrYeQ6l8O2S57sn925/aU1T4nl3Hxao8WKTs32UtvcXjc/JBWe+huQcesPP9+caLVPulPw3jUeazAqwHwvdTptoR+dTIeIF/PcXGnyOpt0tpt71U43FrmEWJjaF2PlTEKACf1JLlG/1WNcMTwhovNBdtNUbUH9m/z3vVIkBtrAqffGY4yOYw8XTNHntbTWx0vbtWSc2xgYdD18Y/ub/KtHwvFBMhLAAgWy9V9KRedU/sMbf+oPv9+rOkUpYmf+w+8g7ZVvgYrYQAkC6j1YgD19evQE+9N0WFgXDmMWbxFBZiLlx91hqcqDQgddNTe5S8NC8jpHGheRjlVQLkn0Ht19zWlcv/R4iDNjpDNJbWJWtGosBZnGrEAWstgNRcit30zZgKGfA8O/P3+0o6BQMnbz4xQfCePI6QlnIJfIguXOYEAZMttiMxBsHsLWpki5OxExR51iw+Vr2azuVykZciGwF2a1yLC3a1NmGx0YPg4KJpSuhiwiDIp/Xk0RT+216t8PyzjpTd2iwiHon2stvc2jQ/J6x1N1n+tePE8S+xUdTF7B8tYLDASOolZdfFxGXKhAAuqfCuwOt9as8LisRiz/AGOMuDviZbrAvqv3pvQIMv6wpo4fyRhI2DyK2IlGofENnIPdUPkQ/sqKZAKsJoSxzc2fcOkUbf8AqJR8tctR4QM+Yy4iS3iTPbM3ZQBoiDog09zrV5RRWgAAMCJhRRRXYQoooohCiiiiEKKKKIQoooohCiiiiEKKKKIQoooohOOLwqSoUkRXRhYq4BUj1B0NJnFeUpMODJgCWQanCu11I6+C7G8bdkJynby7080Uu2pLV2uMidDEdJivF8MJojisNcML50sQ1xoysp1V1O4P/dd5lRn4XhsqlnfEWVRuWJkAFupJrVOcOG/V5RjIxaOQqmJUbXNljm9wbIx6gqfu1CjcApZV+z+Dyjy6EaaaGxOvrXn7WbR2qpGQCCPh4SyB2imL/AODRcLgMkpzYlwFdlGZrt8MEQ3JJ0NtWPoBZr4XyjJiQJMfdUOq4RGsoHTxnGsjd1Byj9avHJPDvrMxx8gvHGWjwoO2nlkn92N1U9FBP3qfa1NPQ1h7e/lj5RLMFG1ek44TCpEgSNFRFFgqABQPQDQV2oorQi4UUUUQhRRRRCFFFFEIUUUUQhRRRRCFFFFEIUUUUQhRRRRCFFFFEIUUUUQhRRRRCcMbhUljeKQZkdSjDuCLEfhWPSQYo4j/AML831g+Uy20+r9cTfa+Ty2/xNOlbRVf/wCa/wDkf89Iu06W43DpJq5XOJJwOESGNIo1ypGqooHRQLAfhXeiinyEKKKKIQoooohCiiiiEKKKKIQoooohCiiiiE//2Q=='; + +class LinearGradientExample extends Component { + static title = 'SVG with LinearGradient'; + render() { + return ( + + + + + + + + + + + SVG Circle + + + + + + ); + } +} + +class HuaweiPathExample extends Component { + static title = 'Huawei SVG icon'; + render() { + return ( + + + + + + + + + + + + ); + } +} + +class ApplePathExample extends Component { + static title = 'Apple SVG icon'; + render() { + return ( + + + + + + + + + ); + } +} + +class SvgXmlExample extends Component { + static title = 'SVG Xml'; + render() { + return ( + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + `} + /> + ); + } +} + +class SvgLayoutExample extends Component { + static title = 'SVG with flex layout'; + render() { + return ( + + + + + + + + ); + } +} + +class CircleRectPathExample extends Component { + static title = 'Path shaped marker on line'; + render() { + return ( + + + + + + + + ); + } +} + +class CurrentColorExample extends Component { + static title = 'Line Path use currentColor'; + render() { + return ( + + + + + ); + } +} + +class SvgG extends Component { + static title = 'Line Path use currentColor'; + render() { + return ( + + + + + + Text grouped with shapes + + + + ); + } +} + +class GExample extends Component { + static title = 'G children props inherit and dynamic props change'; + state = { + fill: 'purple', + }; + componentDidMount = () => { + setTimeout(() => { + if (!this._unmounted) { + this.setState({ + fill: '#856', + }); + } + }, 2000); + }; + componentWillUnmount = () => { + this._unmounted = true; + }; + private _unmounted: any; + render() { + return ( + + + + + + + + + + ); + } +} + +class ImageExample extends Component { + static title = 'Draw Image with preserveAspectRatio prop'; + render() { + return ( + + + + + + + + + + + HOGWARTS + + + ); + } +} + +class ClipImage extends Component { + static title = 'Clip Image'; + render() { + return ( + + + + + + + Alert.alert('press on Image')} + x="5%" + y="5%" + width="90%" + height="90%" + href={{uri: dataUriExample}} + opacity="0.6" + clipPath="url(#clip-image)" + /> + + HOGWARTS + + + ); + } +} + +const URIs = { + invalid: 'https://en.wikipedia.org/wiki/File:Vector-based_example.svg', + valid: + 'https://pixabay.com/get/g9bea6c6d0895a4b46db7e4627b0deb1d799a786a9f14ed733bb254dac4f069edad2b4b4c1a9e8c4b70d6e15b6e0e2da0.svg', +}; + +class SvgCssExample extends Component { + constructor(props) { + super(props); + this.state = { + uri: URIs.invalid, + }; + } + + handlePress = () => { + const {uri} = this.state; + const newUri = uri === URIs.valid ? URIs.invalid : URIs.valid; + this.setState({uri: newUri}); + }; + + render() { + const {uri} = this.state; + const title = + uri === URIs.invalid + ? 'Render fallback due to invalid SVG' + : 'Render Valid SVG'; + + const buttonTitle = `Switch to ${ + uri === URIs.invalid ? 'valid' : 'invalid' + } SVG`; + + return ( + + {title} + + {}} uri={uri} width={200} height={200} /> + + + + ); + } +} + +export function Issue203Extend() { + const [dataX, setDataX] = useState(25); + return ( + + + + + +