diff --git a/babel.config.js b/babel.config.js index f7b3da3..1be3da9 100644 --- a/babel.config.js +++ b/babel.config.js @@ -1,3 +1,4 @@ module.exports = { - presets: ['module:@react-native/babel-preset'], + presets: [['module:metro-react-native-babel-preset', {useTransformReactJSXExperimental:true}]], + plugins: [['@babel/plugin-transform-react-jsx', { runtime: 'classic' }]] }; diff --git a/package.json b/package.json index e930b69..5449aa4 100644 --- a/package.json +++ b/package.json @@ -22,6 +22,7 @@ "react-native": "0.73.0-rc.1", "react-native-content-dialog": "^0.2.0", "react-native-markdown-display-updated": "^7.0.0", + "react-native-svg": "^13.9.0", "react-native-syntax-highlighter": "^2.1.0", "react-native-windows": "0.73.10" }, diff --git a/src/Chat.tsx b/src/Chat.tsx index 4f52245..26ddf0c 100644 --- a/src/Chat.tsx +++ b/src/Chat.tsx @@ -1,6 +1,5 @@ import React from 'react'; import { - Button, ScrollView, TextInput, View, @@ -15,6 +14,7 @@ import { } from './Feedback'; import { PopupsContext } from './Popups'; import { HoverButton } from './Controls'; +import { ButtonV1 as Button } from '@fluentui/react-native'; enum ChatSource { Human, @@ -86,13 +86,15 @@ function ChatEntry({submit, defaultText, clearConversation}: ChatEntryProps): JS onSubmitEditing={submitValue} value={defaultText ?? value}/> ); } @@ -170,11 +172,10 @@ function Chat({entries, humanText, onPrompt, clearConversation}: ChatProps): JSX } diff --git a/src/Settings.tsx b/src/Settings.tsx index 0318dfa..16e028a 100644 --- a/src/Settings.tsx +++ b/src/Settings.tsx @@ -16,6 +16,7 @@ import {StylesContext} from './Styles'; import {Picker} from '@react-native-picker/picker'; import {ChatScriptNames} from './ChatScript'; import AsyncStorage from '@react-native-async-storage/async-storage'; +import { ButtonV1 as Button } from '@fluentui/react-native'; const settingsKey = 'settings'; diff --git a/windows/artificialChat.sln b/windows/artificialChat.sln index 776ba48..18d1a57 100644 --- a/windows/artificialChat.sln +++ b/windows/artificialChat.sln @@ -39,6 +39,8 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Clipboard", "..\node_module EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ReactNativeAsyncStorage", "..\node_modules\@react-native-async-storage\async-storage\windows\ReactNativeAsyncStorage\ReactNativeAsyncStorage.vcxproj", "{4855D892-E16C-404D-8286-0089E0F7F9C4}" EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "RNSVG", "..\node_modules\react-native-svg\windows\RNSVG\RNSVG.vcxproj", "{7ACF84EC-EFBA-4043-8E14-40B159508902}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|ARM64 = Debug|ARM64 @@ -165,6 +167,18 @@ Global {4855D892-E16C-404D-8286-0089E0F7F9C4}.Release|x64.Build.0 = Release|x64 {4855D892-E16C-404D-8286-0089E0F7F9C4}.Release|x86.ActiveCfg = Release|Win32 {4855D892-E16C-404D-8286-0089E0F7F9C4}.Release|x86.Build.0 = Release|Win32 + {7ACF84EC-EFBA-4043-8E14-40B159508902}.Debug|ARM64.ActiveCfg = Debug|ARM64 + {7ACF84EC-EFBA-4043-8E14-40B159508902}.Debug|ARM64.Build.0 = Debug|ARM64 + {7ACF84EC-EFBA-4043-8E14-40B159508902}.Debug|x64.ActiveCfg = Debug|x64 + {7ACF84EC-EFBA-4043-8E14-40B159508902}.Debug|x64.Build.0 = Debug|x64 + {7ACF84EC-EFBA-4043-8E14-40B159508902}.Debug|x86.ActiveCfg = Debug|Win32 + {7ACF84EC-EFBA-4043-8E14-40B159508902}.Debug|x86.Build.0 = Debug|Win32 + {7ACF84EC-EFBA-4043-8E14-40B159508902}.Release|ARM64.ActiveCfg = Release|ARM64 + {7ACF84EC-EFBA-4043-8E14-40B159508902}.Release|ARM64.Build.0 = Release|ARM64 + {7ACF84EC-EFBA-4043-8E14-40B159508902}.Release|x64.ActiveCfg = Release|x64 + {7ACF84EC-EFBA-4043-8E14-40B159508902}.Release|x64.Build.0 = Release|x64 + {7ACF84EC-EFBA-4043-8E14-40B159508902}.Release|x86.ActiveCfg = Release|Win32 + {7ACF84EC-EFBA-4043-8E14-40B159508902}.Release|x86.Build.0 = Release|Win32 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/windows/artificialChat/AutolinkedNativeModules.g.cpp b/windows/artificialChat/AutolinkedNativeModules.g.cpp index 0f05d01..b03fdb9 100644 --- a/windows/artificialChat/AutolinkedNativeModules.g.cpp +++ b/windows/artificialChat/AutolinkedNativeModules.g.cpp @@ -12,6 +12,9 @@ // Includes from @react-native-picker/picker #include +// Includes from react-native-svg +#include + namespace winrt::Microsoft::ReactNative { @@ -23,6 +26,8 @@ void RegisterAutolinkedNativeModulePackages(winrt::Windows::Foundation::Collecti packageProviders.Append(winrt::NativeClipboard::ReactPackageProvider()); // IReactPackageProviders from @react-native-picker/picker packageProviders.Append(winrt::ReactNativePicker::ReactPackageProvider()); + // IReactPackageProviders from react-native-svg + packageProviders.Append(winrt::RNSVG::ReactPackageProvider()); } } diff --git a/windows/artificialChat/AutolinkedNativeModules.g.targets b/windows/artificialChat/AutolinkedNativeModules.g.targets index 541176e..d8d3762 100644 --- a/windows/artificialChat/AutolinkedNativeModules.g.targets +++ b/windows/artificialChat/AutolinkedNativeModules.g.targets @@ -14,5 +14,9 @@ {bedcc600-4541-41f2-aa46-9e058202b6ad} + + + {7acf84ec-efba-4043-8e14-40b159508902} + diff --git a/windows/artificialChat/artificialChat.vcxproj b/windows/artificialChat/artificialChat.vcxproj index 6977dda..6175f27 100644 --- a/windows/artificialChat/artificialChat.vcxproj +++ b/windows/artificialChat/artificialChat.vcxproj @@ -203,6 +203,7 @@ + diff --git a/windows/artificialChat/packages.config b/windows/artificialChat/packages.config index 8d69906..686a712 100644 --- a/windows/artificialChat/packages.config +++ b/windows/artificialChat/packages.config @@ -2,4 +2,5 @@ + \ No newline at end of file diff --git a/windows/artificialChat/packages.lock.json b/windows/artificialChat/packages.lock.json index 4a89027..4a453d2 100644 --- a/windows/artificialChat/packages.lock.json +++ b/windows/artificialChat/packages.lock.json @@ -33,6 +33,11 @@ "resolved": "1.0.1264.42", "contentHash": "7OBUTkzQ5VI/3gb0ufi5U4zjuCowAJwQg2li0zXXzqkM+S1kmOlivTy1R4jAW+gY5Vyg510M+qMAESCQUjrfgA==" }, + "Win2D.uwp": { + "type": "Transitive", + "resolved": "1.26.0", + "contentHash": "smA/NJWM3ruhWeKPHmCyW8PX8w1ckD9SN7qWEOePe/iuFKvLyC8govCHq/F40hQCRs8zBqHWaWBpekTnQuXx6w==" + }, "clipboard": { "type": "Project", "dependencies": { @@ -87,6 +92,14 @@ "Microsoft.ReactNative": "[1.0.0, )", "Microsoft.UI.Xaml": "[2.8.0, )" } + }, + "rnsvg": { + "type": "Project", + "dependencies": { + "Microsoft.ReactNative": "[1.0.0, )", + "Microsoft.UI.Xaml": "[2.8.0, )", + "Win2D.uwp": "[1.26.0, )" + } } }, "native,Version=v0.0/win10-arm": { @@ -94,6 +107,11 @@ "type": "Transitive", "resolved": "1.0.1264.42", "contentHash": "7OBUTkzQ5VI/3gb0ufi5U4zjuCowAJwQg2li0zXXzqkM+S1kmOlivTy1R4jAW+gY5Vyg510M+qMAESCQUjrfgA==" + }, + "Win2D.uwp": { + "type": "Transitive", + "resolved": "1.26.0", + "contentHash": "smA/NJWM3ruhWeKPHmCyW8PX8w1ckD9SN7qWEOePe/iuFKvLyC8govCHq/F40hQCRs8zBqHWaWBpekTnQuXx6w==" } }, "native,Version=v0.0/win10-arm-aot": { @@ -101,6 +119,11 @@ "type": "Transitive", "resolved": "1.0.1264.42", "contentHash": "7OBUTkzQ5VI/3gb0ufi5U4zjuCowAJwQg2li0zXXzqkM+S1kmOlivTy1R4jAW+gY5Vyg510M+qMAESCQUjrfgA==" + }, + "Win2D.uwp": { + "type": "Transitive", + "resolved": "1.26.0", + "contentHash": "smA/NJWM3ruhWeKPHmCyW8PX8w1ckD9SN7qWEOePe/iuFKvLyC8govCHq/F40hQCRs8zBqHWaWBpekTnQuXx6w==" } }, "native,Version=v0.0/win10-arm64-aot": { @@ -108,6 +131,11 @@ "type": "Transitive", "resolved": "1.0.1264.42", "contentHash": "7OBUTkzQ5VI/3gb0ufi5U4zjuCowAJwQg2li0zXXzqkM+S1kmOlivTy1R4jAW+gY5Vyg510M+qMAESCQUjrfgA==" + }, + "Win2D.uwp": { + "type": "Transitive", + "resolved": "1.26.0", + "contentHash": "smA/NJWM3ruhWeKPHmCyW8PX8w1ckD9SN7qWEOePe/iuFKvLyC8govCHq/F40hQCRs8zBqHWaWBpekTnQuXx6w==" } }, "native,Version=v0.0/win10-x64": { @@ -115,6 +143,11 @@ "type": "Transitive", "resolved": "1.0.1264.42", "contentHash": "7OBUTkzQ5VI/3gb0ufi5U4zjuCowAJwQg2li0zXXzqkM+S1kmOlivTy1R4jAW+gY5Vyg510M+qMAESCQUjrfgA==" + }, + "Win2D.uwp": { + "type": "Transitive", + "resolved": "1.26.0", + "contentHash": "smA/NJWM3ruhWeKPHmCyW8PX8w1ckD9SN7qWEOePe/iuFKvLyC8govCHq/F40hQCRs8zBqHWaWBpekTnQuXx6w==" } }, "native,Version=v0.0/win10-x64-aot": { @@ -122,6 +155,11 @@ "type": "Transitive", "resolved": "1.0.1264.42", "contentHash": "7OBUTkzQ5VI/3gb0ufi5U4zjuCowAJwQg2li0zXXzqkM+S1kmOlivTy1R4jAW+gY5Vyg510M+qMAESCQUjrfgA==" + }, + "Win2D.uwp": { + "type": "Transitive", + "resolved": "1.26.0", + "contentHash": "smA/NJWM3ruhWeKPHmCyW8PX8w1ckD9SN7qWEOePe/iuFKvLyC8govCHq/F40hQCRs8zBqHWaWBpekTnQuXx6w==" } }, "native,Version=v0.0/win10-x86": { @@ -129,6 +167,11 @@ "type": "Transitive", "resolved": "1.0.1264.42", "contentHash": "7OBUTkzQ5VI/3gb0ufi5U4zjuCowAJwQg2li0zXXzqkM+S1kmOlivTy1R4jAW+gY5Vyg510M+qMAESCQUjrfgA==" + }, + "Win2D.uwp": { + "type": "Transitive", + "resolved": "1.26.0", + "contentHash": "smA/NJWM3ruhWeKPHmCyW8PX8w1ckD9SN7qWEOePe/iuFKvLyC8govCHq/F40hQCRs8zBqHWaWBpekTnQuXx6w==" } }, "native,Version=v0.0/win10-x86-aot": { @@ -136,6 +179,11 @@ "type": "Transitive", "resolved": "1.0.1264.42", "contentHash": "7OBUTkzQ5VI/3gb0ufi5U4zjuCowAJwQg2li0zXXzqkM+S1kmOlivTy1R4jAW+gY5Vyg510M+qMAESCQUjrfgA==" + }, + "Win2D.uwp": { + "type": "Transitive", + "resolved": "1.26.0", + "contentHash": "smA/NJWM3ruhWeKPHmCyW8PX8w1ckD9SN7qWEOePe/iuFKvLyC8govCHq/F40hQCRs8zBqHWaWBpekTnQuXx6w==" } } } diff --git a/yarn.lock b/yarn.lock index 27eb4b1..6a2d71c 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3654,6 +3654,11 @@ bl@^4.1.0: inherits "^2.0.4" readable-stream "^3.4.0" +boolbase@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/boolbase/-/boolbase-1.0.0.tgz#68dff5fbe60c51eb37725ea9e3ed310dcc1e776e" + integrity sha512-JZOSA7Mo9sNGB8+UjSgzdLtokWAky1zbztM3WRLCbZ70/3cTANmQmOdR7y2g+J0e2WXywy1yS468tY+IruqEww== + brace-expansion@^1.1.7: version "1.1.11" resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.11.tgz#3c7fcbf529d87226f3d2f52b966ff5271eb441dd" @@ -4093,6 +4098,17 @@ css-color-keywords@^1.0.0: resolved "https://registry.yarnpkg.com/css-color-keywords/-/css-color-keywords-1.0.0.tgz#fea2616dc676b2962686b3af8dbdbe180b244e05" integrity sha512-FyyrDHZKEjXDpNJYvVsV960FiqQyXc/LlYmsxl2BcdMb2WPx0OGRVgTg55rPSyLSNMqP52R9r8geSp7apN3Ofg== +css-select@^5.1.0: + version "5.1.0" + resolved "https://registry.yarnpkg.com/css-select/-/css-select-5.1.0.tgz#b8ebd6554c3637ccc76688804ad3f6a6fdaea8a6" + integrity sha512-nwoRF1rvRRnnCqqY7updORDsuqKzqYJ28+oSMaJMMgOauh3fvwHqMS7EZpIPqK8GL+g9mKxF1vP/ZjSeNjEVHg== + dependencies: + boolbase "^1.0.0" + css-what "^6.1.0" + domhandler "^5.0.2" + domutils "^3.0.1" + nth-check "^2.0.1" + css-to-react-native@^3.0.0: version "3.2.0" resolved "https://registry.yarnpkg.com/css-to-react-native/-/css-to-react-native-3.2.0.tgz#cdd8099f71024e149e4f6fe17a7d46ecd55f1e32" @@ -4102,6 +4118,19 @@ css-to-react-native@^3.0.0: css-color-keywords "^1.0.0" postcss-value-parser "^4.0.2" +css-tree@^1.1.3: + version "1.1.3" + resolved "https://registry.yarnpkg.com/css-tree/-/css-tree-1.1.3.tgz#eb4870fb6fd7707327ec95c2ff2ab09b5e8db91d" + integrity sha512-tRpdppF7TRazZrjJ6v3stzv93qxRcSsFmW6cX0Zm2NVKpxE1WV1HblnghVv9TreireHkqI/VDEsfolRF1p6y7Q== + dependencies: + mdn-data "2.0.14" + source-map "^0.6.1" + +css-what@^6.1.0: + version "6.1.0" + resolved "https://registry.yarnpkg.com/css-what/-/css-what-6.1.0.tgz#fb5effcf76f1ddea2c81bdfaa4de44e79bac70f4" + integrity sha512-HTUrgRJ7r4dsZKU6GjmpfRK1O76h97Z8MfS1G0FozR+oF2kG6Vfe8JE6zwrkbxigziPHinCJ+gCPjA9EaBDtRw== + csstype@^3.0.2: version "3.1.2" resolved "https://registry.yarnpkg.com/csstype/-/csstype-3.1.2.tgz#1d4bf9d572f11c14031f0436e1c10bc1f571f50b" @@ -4264,6 +4293,36 @@ doctrine@^3.0.0: dependencies: esutils "^2.0.2" +dom-serializer@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/dom-serializer/-/dom-serializer-2.0.0.tgz#e41b802e1eedf9f6cae183ce5e622d789d7d8e53" + integrity sha512-wIkAryiqt/nV5EQKqQpo3SToSOV9J0DnbJqwK7Wv/Trc92zIAYZ4FlMu+JPFW1DfGFt81ZTCGgDEabffXeLyJg== + dependencies: + domelementtype "^2.3.0" + domhandler "^5.0.2" + entities "^4.2.0" + +domelementtype@^2.3.0: + version "2.3.0" + resolved "https://registry.yarnpkg.com/domelementtype/-/domelementtype-2.3.0.tgz#5c45e8e869952626331d7aab326d01daf65d589d" + integrity sha512-OLETBj6w0OsagBwdXnPdN0cnMfF9opN69co+7ZrbfPGrdpPVNBUj02spi6B1N7wChLQiPn4CSH/zJvXw56gmHw== + +domhandler@^5.0.1, domhandler@^5.0.2: + version "5.0.3" + resolved "https://registry.yarnpkg.com/domhandler/-/domhandler-5.0.3.tgz#cc385f7f751f1d1fc650c21374804254538c7d31" + integrity sha512-cgwlv/1iFQiFnU96XXgROh8xTeetsnJiDsTc7TYCLFd9+/WNkIqPTxiM/8pSd8VIrhXGTf1Ny1q1hquVqDJB5w== + dependencies: + domelementtype "^2.3.0" + +domutils@^3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/domutils/-/domutils-3.0.1.tgz#696b3875238338cb186b6c0612bd4901c89a4f1c" + integrity sha512-z08c1l761iKhDFtfXO04C7kTdPBLi41zwOZl00WS8b5eiaebNpY00HKbztwBq+e3vyqWNwWF3mP9YLUeqIrF+Q== + dependencies: + dom-serializer "^2.0.0" + domelementtype "^2.3.0" + domhandler "^5.0.1" + ee-first@1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/ee-first/-/ee-first-1.1.1.tgz#590c61156b0ae2f4f0255732a158b266bc56b21d" @@ -4303,6 +4362,11 @@ end-of-stream@^1.1.0: dependencies: once "^1.4.0" +entities@^4.2.0: + version "4.4.0" + resolved "https://registry.yarnpkg.com/entities/-/entities-4.4.0.tgz#97bdaba170339446495e653cfd2db78962900174" + integrity sha512-oYp7156SP8LkeGD0GF85ad1X9Ai79WtRsZ2gxJqtBuzH+98YUV6jkHEKlZkMbcrjJjIVJNIDP/3WL9wQkoPbWA== + entities@~2.0.0: version "2.0.3" resolved "https://registry.yarnpkg.com/entities/-/entities-2.0.3.tgz#5c487e5742ab93c15abb5da22759b8590ec03b7f" @@ -6415,6 +6479,11 @@ marky@^1.2.2: resolved "https://registry.yarnpkg.com/marky/-/marky-1.2.5.tgz#55796b688cbd72390d2d399eaaf1832c9413e3c0" integrity sha512-q9JtQJKjpsVxCRVgQ+WapguSbKC3SQ5HEzFGPAJMStgh3QjCawp00UKv3MTTAArTmGmmPUvllHZoNbZ3gs0I+Q== +mdn-data@2.0.14: + version "2.0.14" + resolved "https://registry.yarnpkg.com/mdn-data/-/mdn-data-2.0.14.tgz#7113fc4281917d63ce29b43446f701e68c25ba50" + integrity sha512-dn6wd0uw5GsdswPFfsgMp5NSB0/aDe6fK94YJV/AJDYXL6HVLWBsxeq7js7Ad+mU2K9LAlwpk6kN2D5mwCPVow== + mdurl@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/mdurl/-/mdurl-1.0.1.tgz#fe85b2ec75a59037f2adfec100fd6c601761152e" @@ -7002,6 +7071,13 @@ npm-run-path@^4.0.0, npm-run-path@^4.0.1: dependencies: path-key "^3.0.0" +nth-check@^2.0.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/nth-check/-/nth-check-2.1.1.tgz#c9eab428effce36cd6b92c924bdb000ef1f1ed1d" + integrity sha512-lqjrjmaOoAnWfMmBPL+XNnynZh2+swxiX3WUE0s4yEHI6m+AwrK2UZOimIRl3X/4QctVqS8AiZjFqyOGrMXb/w== + dependencies: + boolbase "^1.0.0" + nullthrows@^1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/nullthrows/-/nullthrows-1.1.1.tgz#7818258843856ae971eae4208ad7d7eb19a431b1" @@ -7557,6 +7633,14 @@ react-native-markdown-display-updated@^7.0.0: prop-types "^15.7.2" react-native-fit-image "^1.5.5" +react-native-svg@^13.9.0: + version "13.9.0" + resolved "https://registry.yarnpkg.com/react-native-svg/-/react-native-svg-13.9.0.tgz#8df8a690dd00362601f074dec5d3a86dd0f99c7f" + integrity sha512-Ey18POH0dA0ob/QiwCBVrxIiwflhYuw0P0hBlOHeY4J5cdbs8ngdKHeWC/Kt9+ryP6fNoEQ1PUgPYw2Bs/rp5Q== + dependencies: + css-select "^5.1.0" + css-tree "^1.1.3" + react-native-syntax-highlighter@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/react-native-syntax-highlighter/-/react-native-syntax-highlighter-2.1.0.tgz#66bdb2cedbe938b291bfe415e5d72d0c275ce353"