diff --git a/babel.config.js b/babel.config.js index f842b77..1be3da9 100644 --- a/babel.config.js +++ b/babel.config.js @@ -1,3 +1,4 @@ module.exports = { - presets: ['module:metro-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 ac19ffa..f3c7bca 100644 --- a/package.json +++ b/package.json @@ -21,6 +21,7 @@ "react": "18.2.0", "react-native": "0.71.0", "react-native-markdown-display": "^7.0.0-alpha.2", + "react-native-svg": "^13.9.0", "react-native-syntax-highlighter": "^2.1.0", "react-native-windows": "0.71.1" }, 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/Popups.tsx b/src/Popups.tsx index 3500773..08de172 100644 --- a/src/Popups.tsx +++ b/src/Popups.tsx @@ -5,7 +5,7 @@ import { } from 'react-native'; import {Popup} from 'react-native-windows'; import {StylesContext} from './Styles'; -import { Button, IFocusable } from '@fluentui/react-native'; +import { ButtonV1 as Button } from '@fluentui/react-native'; type PopupsContextType = { showAbout: boolean, @@ -32,12 +32,12 @@ type DialogFrameType = PropsWithChildren<{ function DialogFrame({children, show, close, isLightDismissEnabled, titleIcon, titleIconStyle, title, buttons}: DialogFrameType) { const styles = React.useContext(StylesContext); - const populatedButtons = buttons ?? []; const buttonList = populatedButtons.map((button, index) => {button}); return ( diff --git a/src/Settings.tsx b/src/Settings.tsx index 728f515..faba8e4 100644 --- a/src/Settings.tsx +++ b/src/Settings.tsx @@ -1,7 +1,5 @@ import React from 'react'; import { - Button, - Switch, Text, TextInput, View, @@ -18,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'; @@ -162,17 +161,14 @@ function SettingsPopup({show, close}: SettingsPopupProps): JSX.Element { const buttons = [ , ]; return ( 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 f913507..ca203b4 100644 --- a/windows/artificialChat/artificialChat.vcxproj +++ b/windows/artificialChat/artificialChat.vcxproj @@ -202,6 +202,7 @@ + false @@ -217,6 +218,7 @@ + @@ -225,4 +227,10 @@ + + + This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. + + + \ No newline at end of file diff --git a/windows/artificialChat/packages.config b/windows/artificialChat/packages.config new file mode 100644 index 0000000..4dda557 --- /dev/null +++ b/windows/artificialChat/packages.config @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/yarn.lock b/yarn.lock index b9ada3f..063fb37 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3076,6 +3076,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" @@ -3548,6 +3553,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" @@ -3557,6 +3573,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.1" resolved "https://registry.yarnpkg.com/csstype/-/csstype-3.1.1.tgz#841b532c45c758ee546a11d5bd7b7b473c8c30b9" @@ -3732,6 +3761,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" @@ -3771,6 +3830,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" @@ -5975,6 +6039,11 @@ markdown-it@^10.0.0: mdurl "^1.0.1" uc.micro "^1.0.5" +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" @@ -6599,6 +6668,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" @@ -7185,6 +7261,14 @@ react-native-markdown-display@^7.0.0-alpha.2: 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"