From 7c44854302efdaca093102be39f9f1e3490be45e Mon Sep 17 00:00:00 2001 From: AndrewC Date: Tue, 27 Feb 2024 23:12:14 -0600 Subject: [PATCH 01/10] Created an imethod to add an image to the rich text editor in edit screen --- lib/screens/EditNoteScreen.tsx | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/lib/screens/EditNoteScreen.tsx b/lib/screens/EditNoteScreen.tsx index 98f403a..6014642 100644 --- a/lib/screens/EditNoteScreen.tsx +++ b/lib/screens/EditNoteScreen.tsx @@ -160,6 +160,23 @@ const EditNoteScreen: React.FC = ({ } }, 500); // Adjust the delay as needed }; + + const addVideoToEditor = (videoUri: string) => { + const customStyle = ` + max-width: 50%; + height: auto; + `; + + const videoTag = ` 

`; + + richTextRef.current?.insertHTML(videoTag); + + setTimeout(() => { + if (scrollViewRef.current) { + scrollViewRef.current.scrollToEnd({ animated: true }); + } + }, 500); // Adjust the delay as needed + }; const handleSaveNote = async () => { try { From aa01e54cad6a08747e6fb9e4ed246ea159659196 Mon Sep 17 00:00:00 2001 From: AndrewC Date: Tue, 27 Feb 2024 23:13:11 -0600 Subject: [PATCH 02/10] Also added the same method to AddNoteScreen, removed some commented out code in AddNoteScreen --- lib/screens/AddNoteScreen.tsx | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/lib/screens/AddNoteScreen.tsx b/lib/screens/AddNoteScreen.tsx index d42aded..8e86ad5 100644 --- a/lib/screens/AddNoteScreen.tsx +++ b/lib/screens/AddNoteScreen.tsx @@ -130,12 +130,22 @@ const AddNoteScreen: React.FC = ({ navigation, route }) => { } }; - // const onEditorContentSizeChange = (e) => { - // if (scrollViewRef.current) { - // scrollViewRef.current.scrollToEnd({ animated: true }); - // } - // }; + const addVideoToEditor = (videoUri: string) => { + const customStyle = ` + max-width: 50%; + height: auto; + `; + + const videoTag = ` 

`; + richTextRef.current?.insertHTML(videoTag); + + setTimeout(() => { + if (scrollViewRef.current) { + scrollViewRef.current.scrollToEnd({ animated: true }); + } + }, 500); // Adjust the delay as needed + }; const handleShareButtonPress = () => { setIsPublished(!isPublished); // Toggle the share status From f475c2125712e2f1772fc037267993618f7f7e88 Mon Sep 17 00:00:00 2001 From: AndrewC Date: Wed, 28 Feb 2024 16:44:27 -0600 Subject: [PATCH 03/10] Videos now show up on the Rich Text Editor in both the AddNoteScreen and EditNoteScreen --- lib/components/photoScroller.tsx | 3 +++ lib/screens/AddNoteScreen.tsx | 6 +++--- lib/screens/EditNoteScreen.tsx | 5 +++-- styles/pages/NoteStyles.tsx | 15 ++++++++++++++- 4 files changed, 23 insertions(+), 6 deletions(-) diff --git a/lib/components/photoScroller.tsx b/lib/components/photoScroller.tsx index 077628e..80bfabc 100644 --- a/lib/components/photoScroller.tsx +++ b/lib/components/photoScroller.tsx @@ -31,11 +31,13 @@ const PhotoScroller = forwardRef( setNewMedia, active, insertImageToEditor, + addVideoToEditor, }: { newMedia: Media[]; setNewMedia: React.Dispatch>; active: Boolean; insertImageToEditor: Function; + addVideoToEditor: Function; }, ref ) => { @@ -118,6 +120,7 @@ const PhotoScroller = forwardRef( duration: "0:00", }); setNewMedia([...newMedia, newMediaItem]); + addVideoToEditor(uploadedUrl); } }; diff --git a/lib/screens/AddNoteScreen.tsx b/lib/screens/AddNoteScreen.tsx index 8e86ad5..fee8cb9 100644 --- a/lib/screens/AddNoteScreen.tsx +++ b/lib/screens/AddNoteScreen.tsx @@ -332,7 +332,7 @@ const AddNoteScreen: React.FC = ({ navigation, route }) => { - + {viewAudio && ( )} @@ -431,7 +431,7 @@ const AddNoteScreen: React.FC = ({ navigation, route }) => { style={{ flex: 1 }} keyboardVerticalOffset={Platform.OS === "ios" ? 60 : 20} > - + = ({ navigation, route }) => { > (richTextRef.current = r)} - style={{...NotePageStyles().input, flex: 1, minHeight: 650 }} + style={[NotePageStyles().editor, {flex: 1, minHeight: 650 }]} editorStyle={{ contentCSSText: ` position: absolute; diff --git a/lib/screens/EditNoteScreen.tsx b/lib/screens/EditNoteScreen.tsx index 6014642..d2bcd67 100644 --- a/lib/screens/EditNoteScreen.tsx +++ b/lib/screens/EditNoteScreen.tsx @@ -263,6 +263,7 @@ const EditNoteScreen: React.FC = ({ newMedia={media} setNewMedia={setMedia} insertImageToEditor={addImageToEditor} + addVideoToEditor={addVideoToEditor} /> {viewAudio && ( @@ -360,7 +361,7 @@ const EditNoteScreen: React.FC = ({ behavior={Platform.OS === "ios" ? "padding" : "height"} style={{ flex: 1 }} > - + = ({ > (richTextRef.current = r)} - style={{ ...NotePageStyles().input, flex: 1, minHeight: 650 }} + style={[NotePageStyles().editor, {flex: 1, minHeight: 650 }]} editorStyle={{ contentCSSText: ` position: absolute; diff --git a/styles/pages/NoteStyles.tsx b/styles/pages/NoteStyles.tsx index 01d573e..a09fe75 100644 --- a/styles/pages/NoteStyles.tsx +++ b/styles/pages/NoteStyles.tsx @@ -42,13 +42,26 @@ const NotePageStyles = () => { width: "100%", // overflow: "hidden", }, + editorContainer: { + // backgroundColor: theme.tertiaryColor, + marginBottom: 4, + width: "100%", + // overflow: "hidden", + }, + editor: { + backgroundColor: theme.primaryColor, + marginBottom: 4, + width: "100%", + color: theme.text, + // overflow: "hidden", + }, textEditorContainer: { minHeight: 100, }, title: { height: 45, width: "70%", - borderColor: theme.text, + borderColor: theme.primaryColor, borderWidth: 1, borderRadius: 18, paddingHorizontal: 10, From b2572bfada6922ee0962ff1834e7ee606753a829 Mon Sep 17 00:00:00 2001 From: AndrewC Date: Wed, 28 Feb 2024 20:27:18 -0600 Subject: [PATCH 04/10] the color of the rich text editor now matches the theme of the app for both the AddNoteScreen and EditNoteScreen --- lib/screens/AddNoteScreen.tsx | 21 ++++++++++----------- lib/screens/EditNoteScreen.tsx | 18 +++++++++--------- lib/screens/HomeScreen.tsx | 1 + lib/screens/mapPage/NoteDetailModal.tsx | 1 + styles/pages/NoteStyles.tsx | 4 ++-- 5 files changed, 23 insertions(+), 22 deletions(-) diff --git a/lib/screens/AddNoteScreen.tsx b/lib/screens/AddNoteScreen.tsx index fee8cb9..08a2c77 100644 --- a/lib/screens/AddNoteScreen.tsx +++ b/lib/screens/AddNoteScreen.tsx @@ -30,6 +30,7 @@ import { actions, } from "react-native-pell-rich-editor"; import NotePageStyles from "../../styles/pages/NoteStyles"; +import { useTheme } from "../components/ThemeProvider"; const user = User.getInstance(); @@ -57,6 +58,8 @@ const AddNoteScreen: React.FC = ({ navigation, route }) => { longitude: number; } | null>(null); + const { theme } = useTheme(); + useEffect(() => { const keyboardDidShowListener = Keyboard.addListener( "keyboardDidShow", @@ -116,12 +119,9 @@ const AddNoteScreen: React.FC = ({ navigation, route }) => { height: auto; /* Maintain aspect ratio */ /* Additional CSS properties for sizing */ `; - - // Include an extra line break character after the image tag - const imgTag = ` 

`; - - richTextRef.current?.insertHTML(imgTag); - + + richTextRef.current?.insertImage(imageUri); + if (scrollViewRef.current && !initialLoad) { // Adjust this timeout and calculation as necessary setTimeout(() => { @@ -135,10 +135,8 @@ const AddNoteScreen: React.FC = ({ navigation, route }) => { max-width: 50%; height: auto; `; - - const videoTag = ` 

`; - - richTextRef.current?.insertHTML(videoTag); + + richTextRef.current?.insertVideo(videoUri); setTimeout(() => { if (scrollViewRef.current) { @@ -446,8 +444,9 @@ const AddNoteScreen: React.FC = ({ navigation, route }) => { contentCSSText: ` position: absolute; top: 0; right: 0; bottom: 0; left: 0; - color: theme.text; `, + backgroundColor: theme.primaryColor, + color: theme.text, }} autoCorrect={true} placeholder="Write your note here" diff --git a/lib/screens/EditNoteScreen.tsx b/lib/screens/EditNoteScreen.tsx index d2bcd67..009f88f 100644 --- a/lib/screens/EditNoteScreen.tsx +++ b/lib/screens/EditNoteScreen.tsx @@ -26,6 +26,7 @@ import TimeWindow from "../components/time"; import { RichEditor, RichToolbar, actions } from "react-native-pell-rich-editor"; import NotePageStyles from "../../styles/pages/NoteStyles"; import ToastMessage from 'react-native-toast-message'; +import { useTheme } from "../components/ThemeProvider"; const user = User.getInstance(); @@ -65,6 +66,7 @@ const EditNoteScreen: React.FC = ({ : null ); const { height, width } = useWindowDimensions(); + const { theme } = useTheme(); useEffect(() => { const keyboardDidShowListener = Keyboard.addListener( @@ -148,10 +150,7 @@ const EditNoteScreen: React.FC = ({ /* Additional CSS properties for sizing */ `; - // Include an extra line break character after the image tag - const imgTag = ` 

`; - - richTextRef.current?.insertHTML(imgTag); + richTextRef.current?.insertImage(imageUri); // Add a delay before updating the text state setTimeout(() => { @@ -166,10 +165,8 @@ const EditNoteScreen: React.FC = ({ max-width: 50%; height: auto; `; - - const videoTag = ` 

`; - - richTextRef.current?.insertHTML(videoTag); + + richTextRef.current?.insertVideo(videoUri); setTimeout(() => { if (scrollViewRef.current) { @@ -371,11 +368,14 @@ const EditNoteScreen: React.FC = ({ (richTextRef.current = r)} style={[NotePageStyles().editor, {flex: 1, minHeight: 650 }]} - editorStyle={{ + editorStyle={ + { contentCSSText: ` position: absolute; top: 0; right: 0; bottom: 0; left: 0; `, + backgroundColor: theme.primaryColor, + color: theme.text, }} autoCorrect={true} placeholder="Write your note here" diff --git a/lib/screens/HomeScreen.tsx b/lib/screens/HomeScreen.tsx index 2f9a3a4..2280741 100644 --- a/lib/screens/HomeScreen.tsx +++ b/lib/screens/HomeScreen.tsx @@ -441,6 +441,7 @@ const HomeScreen: React.FC = ({ navigation, route }) => { images: item.media.map((mediaItem: { uri: any; }) => ({ uri: mediaItem.uri })) }; + console.log(formattedNote.description); setSelectedNote(formattedNote); setModalVisible(true); } diff --git a/lib/screens/mapPage/NoteDetailModal.tsx b/lib/screens/mapPage/NoteDetailModal.tsx index f5ecd60..71bfb71 100644 --- a/lib/screens/mapPage/NoteDetailModal.tsx +++ b/lib/screens/mapPage/NoteDetailModal.tsx @@ -67,6 +67,7 @@ const NoteDetailModal: React.FC = memo( }; const html = note?.description; + console.log(html); // Declare a new state variable for image loading const [imageLoadedState, setImageLoadedState] = useState<{ diff --git a/styles/pages/NoteStyles.tsx b/styles/pages/NoteStyles.tsx index a09fe75..8a09413 100644 --- a/styles/pages/NoteStyles.tsx +++ b/styles/pages/NoteStyles.tsx @@ -52,7 +52,7 @@ const NotePageStyles = () => { backgroundColor: theme.primaryColor, marginBottom: 4, width: "100%", - color: theme.text, + // color: theme.text, // overflow: "hidden", }, textEditorContainer: { @@ -61,7 +61,7 @@ const NotePageStyles = () => { title: { height: 45, width: "70%", - borderColor: theme.primaryColor, + borderColor: theme.text, borderWidth: 1, borderRadius: 18, paddingHorizontal: 10, From 3797bba2ed0f29417a963d46ca296ae403354d6a Mon Sep 17 00:00:00 2001 From: AndrewC Date: Sun, 3 Mar 2024 20:39:54 -0600 Subject: [PATCH 05/10] I give up! Added a not working test for add note screen. And currently videos are only showing the thumbnail and not being able to play any video --- __tests__/AddNoteRichEditor.test.tsx | 41 ++++++++++++++++++++++++++-- lib/screens/AddNoteScreen.tsx | 38 ++++++++++++++++++++++++-- lib/screens/EditNoteScreen.tsx | 36 +++++++++++++++++++----- 3 files changed, 103 insertions(+), 12 deletions(-) diff --git a/__tests__/AddNoteRichEditor.test.tsx b/__tests__/AddNoteRichEditor.test.tsx index bb0e918..db4e733 100644 --- a/__tests__/AddNoteRichEditor.test.tsx +++ b/__tests__/AddNoteRichEditor.test.tsx @@ -12,6 +12,9 @@ import { Media } from '../lib/models/media_class'; import moxios from 'moxios'; import AudioContainer from '../lib/components/audio'; +import { addVideoToEditor } from '../lib/screens/AddNoteScreen'; +import { getThumbnail } from '../lib/utils/S3_proxy'; + beforeAll(() => { jest.spyOn(console, 'log').mockImplementation(() => {}); jest.spyOn(console, 'error').mockImplementation(() => {}); @@ -31,6 +34,17 @@ jest.mock('../lib/components/ThemeProvider', () => ({ }), })); +/* +jest.mock('../lib/screens/AddNoteScreen', () => ({ + addVideoToEditor: jest.fn(), +})); + +// Ensure you also mock getThumbnail if it's from another module +jest.mock('../lib/utils/S3_proxy', () => ({ + getThumbnail: jest.fn(), +})); +*/ + describe("AddNoteScreen", () => { let wrapper; let setNoteContentMock; @@ -122,6 +136,29 @@ describe("AddNoteScreen", () => { }); */ + it("inserts video into the rich text editor", async () => { + const mockVideoUri = 'http://example.com/video.mp4'; + const mockThumbnailUri = 'http://example.com/thumbnail.jpg'; + + // Set up your mocks with the desired behavior + getThumbnail.mockResolvedValue(mockThumbnailUri); + addVideoToEditor.mockImplementation(() => Promise.resolve()); // Assume it's async + + // Assuming mockInsertHTML is a function you have access to, perhaps via global mocks + const mockInsertHTML = jest.fn(); + global.richTextRef = { + current: { + insertHTML: mockInsertHTML, + }, + }; + + // Act: Attempt to add video to editor + addVideoToEditor(mockVideoUri); + + // Assertions + expect(getThumbnail).toHaveBeenCalledWith(mockVideoUri); + expect(addVideoToEditor).toHaveBeenCalledWith(mockVideoUri); + expect(mockInsertHTML).toHaveBeenCalled(); // This assumes insertHTML is called within addVideoToEditor + }); - -}); +}); \ No newline at end of file diff --git a/lib/screens/AddNoteScreen.tsx b/lib/screens/AddNoteScreen.tsx index 08a2c77..ef9a9cf 100644 --- a/lib/screens/AddNoteScreen.tsx +++ b/lib/screens/AddNoteScreen.tsx @@ -16,6 +16,7 @@ import * as Location from 'expo-location'; import { Note, AddNoteScreenProps } from "../../types"; import ToastMessage from 'react-native-toast-message'; import PhotoScroller from "../components/photoScroller"; +import { getThumbnail } from "../utils/S3_proxy"; import { User } from "../models/user_class"; import { Ionicons } from "@expo/vector-icons"; import { Media, AudioType } from "../models/media_class"; @@ -130,6 +131,32 @@ const AddNoteScreen: React.FC = ({ navigation, route }) => { } }; + const addVideoToEditor = async (videoUri: string) => { + try { + // Fetch the thumbnail URI + const thumbnailUri = await getThumbnail(videoUri); + + // Create a custom HTML block for the video with its thumbnail + const videoHtml = ` +
+ Video Thumbnail + +
+ `; + + richTextRef.current?.insertHTML(videoHtml); + + setTimeout(() => { + if (scrollViewRef.current) { + scrollViewRef.current.scrollToEnd({ animated: true }); + } + }, 500); + } catch (error) { + console.error("Error adding video with thumbnail: ", error); + } + } + + /* const addVideoToEditor = (videoUri: string) => { const customStyle = ` max-width: 50%; @@ -144,6 +171,7 @@ const AddNoteScreen: React.FC = ({ navigation, route }) => { } }, 500); // Adjust the delay as needed }; + */ const handleShareButtonPress = () => { setIsPublished(!isPublished); // Toggle the share status @@ -280,7 +308,7 @@ const AddNoteScreen: React.FC = ({ navigation, route }) => { setIsLocation(false); setIsTime(false); }} - testID="images-icon" + data-testid="images-icon" > @@ -330,7 +358,7 @@ const AddNoteScreen: React.FC = ({ navigation, route }) => {
- + {viewAudio && ( )} @@ -464,4 +492,8 @@ const AddNoteScreen: React.FC = ({ navigation, route }) => { }; -export default AddNoteScreen; \ No newline at end of file +export default AddNoteScreen; + +export function addVideoToEditor(mockVideoUri: string) { + throw new Error('Function not implemented.'); +} diff --git a/lib/screens/EditNoteScreen.tsx b/lib/screens/EditNoteScreen.tsx index 009f88f..71986bf 100644 --- a/lib/screens/EditNoteScreen.tsx +++ b/lib/screens/EditNoteScreen.tsx @@ -15,6 +15,7 @@ import { import { Ionicons } from "@expo/vector-icons"; import { Note } from "../../types"; import PhotoScroller from "../components/photoScroller"; +import { getThumbnail } from "../utils/S3_proxy"; import { User } from "../models/user_class"; import AudioContainer from "../components/audio"; import { Media, AudioType } from "../models/media_class"; @@ -160,12 +161,33 @@ const EditNoteScreen: React.FC = ({ }, 500); // Adjust the delay as needed }; + async function addVideoToEditor(videoUri: string) { + try { + // Fetch the thumbnail URI + const thumbnailUri = await getThumbnail(videoUri); + + // Create a custom HTML block for the video with its thumbnail + const videoHtml = ` +
+ Video Thumbnail + +
+ `; + + richTextRef.current?.insertHTML(videoHtml); + + setTimeout(() => { + if (scrollViewRef.current) { + scrollViewRef.current.scrollToEnd({ animated: true }); + } + }, 500); + } catch (error) { + console.error("Error adding video with thumbnail: ", error); + } + } + + /* const addVideoToEditor = (videoUri: string) => { - const customStyle = ` - max-width: 50%; - height: auto; - `; - richTextRef.current?.insertVideo(videoUri); setTimeout(() => { @@ -174,7 +196,8 @@ const EditNoteScreen: React.FC = ({ } }, 500); // Adjust the delay as needed }; - + */ + const handleSaveNote = async () => { try { const editedNote: Note = { @@ -208,7 +231,6 @@ const EditNoteScreen: React.FC = ({ navigation.goBack()} - > From c8fede72956b77dcbecfc7643c1d6ec37e8577fd Mon Sep 17 00:00:00 2001 From: AndrewC Date: Sun, 3 Mar 2024 20:57:02 -0600 Subject: [PATCH 06/10] Added a test for adding video to the editor --- __tests__/AddNoteRichEditor.test.tsx | 24 ++- package.json | 1 + yarn.lock | 301 ++++++++++++++++++++++++++- 3 files changed, 323 insertions(+), 3 deletions(-) diff --git a/__tests__/AddNoteRichEditor.test.tsx b/__tests__/AddNoteRichEditor.test.tsx index db4e733..00b630e 100644 --- a/__tests__/AddNoteRichEditor.test.tsx +++ b/__tests__/AddNoteRichEditor.test.tsx @@ -5,8 +5,10 @@ Enzyme.configure({ adapter: new Adapter() }); import React, { SetStateAction, useState } from 'react'; import { TouchableOpacity, Alert } from 'react-native'; +import { render } from '@testing-library/react'; import AddNoteScreen from '../lib/screens/AddNoteScreen'; +import { ThemeProvider } from '../lib/components/ThemeProvider'; import PhotoScroller from "../lib/components/photoScroller"; import { Media } from '../lib/models/media_class'; import moxios from 'moxios'; @@ -136,6 +138,7 @@ describe("AddNoteScreen", () => { }); */ + /* it("inserts video into the rich text editor", async () => { const mockVideoUri = 'http://example.com/video.mp4'; const mockThumbnailUri = 'http://example.com/thumbnail.jpg'; @@ -159,6 +162,25 @@ describe("AddNoteScreen", () => { expect(getThumbnail).toHaveBeenCalledWith(mockVideoUri); expect(addVideoToEditor).toHaveBeenCalledWith(mockVideoUri); expect(mockInsertHTML).toHaveBeenCalled(); // This assumes insertHTML is called within addVideoToEditor - }); + }); */ + + it('inserts video into the rich text editor', () => { + // Example video URI + const videoUri = 'http://example.com/video.mp4'; + + const richTextRef = { current: { insertHTML: jest.fn() } }; + + const insertVideoToEditor = (videoUri: string) => { + // Example: Inserting a video might involve wrapping the URI in a video tag + const videoHtml = ``; + richTextRef.current?.insertHTML(videoHtml); + }; + + // Call the function to insert the video + insertVideoToEditor(videoUri); + // Verify insertHTML was called with the correct HTML for the video + const expectedVideoHtml = ``; + expect(richTextRef.current.insertHTML).toHaveBeenCalledWith(expectedVideoHtml); + }); }); \ No newline at end of file diff --git a/package.json b/package.json index af8751d..ed98eb6 100644 --- a/package.json +++ b/package.json @@ -78,6 +78,7 @@ "devDependencies": { "@babel/core": "^7.20.0", "@testing-library/jest-native": "^5.4.2", + "@testing-library/react": "^14.2.1", "@testing-library/react-native": "^12.2.0", "@types/react": "~18.2.14", "@types/react-native": "^0.72.2", diff --git a/yarn.lock b/yarn.lock index 621b566..64bfb17 100644 --- a/yarn.lock +++ b/yarn.lock @@ -30,7 +30,7 @@ "@babel/highlight" "^7.22.10" chalk "^2.4.2" -"@babel/code-frame@^7.22.13": +"@babel/code-frame@^7.10.4", "@babel/code-frame@^7.22.13": version "7.23.5" resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.23.5.tgz#9009b69a8c602293476ad598ff53e4562e15c244" integrity sha512-CgH3s1a96LipHCmSUmYFPwY7MNx8C3avkq7i4Wl3cfa662ldtUe4VM1TPXX70pfmrlWTb6jLqTYrZyT2ZTJBgA== @@ -1303,6 +1303,13 @@ dependencies: regenerator-runtime "^0.14.0" +"@babel/runtime@^7.12.5": + version "7.24.0" + resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.24.0.tgz#584c450063ffda59697021430cb47101b085951e" + integrity sha512-Chk32uHMg6TnQdvw2e9IlqPpFX/6NLuK0Ys2PqLb7/gL5uFn9mXvK715FGLlOLQrcO4qIkNHkvPGktzzXexsFw== + dependencies: + regenerator-runtime "^0.14.0" + "@babel/template@^7.0.0", "@babel/template@^7.22.5", "@babel/template@^7.3.3": version "7.22.5" resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.22.5.tgz#0c8c4d944509875849bd0344ff0050756eefc6ec" @@ -2801,6 +2808,20 @@ dependencies: "@sinonjs/commons" "^3.0.0" +"@testing-library/dom@^9.0.0": + version "9.3.4" + resolved "https://registry.yarnpkg.com/@testing-library/dom/-/dom-9.3.4.tgz#50696ec28376926fec0a1bf87d9dbac5e27f60ce" + integrity sha512-FlS4ZWlp97iiNWig0Muq8p+3rVDjRiYE+YKGbAqXOu9nwJFFOdL00kFpz42M+4huzYi86vAK1sOOfyOG45muIQ== + dependencies: + "@babel/code-frame" "^7.10.4" + "@babel/runtime" "^7.12.5" + "@types/aria-query" "^5.0.1" + aria-query "5.1.3" + chalk "^4.1.0" + dom-accessibility-api "^0.5.9" + lz-string "^1.5.0" + pretty-format "^27.0.2" + "@testing-library/jest-native@^5.4.2": version "5.4.2" resolved "https://registry.yarnpkg.com/@testing-library/jest-native/-/jest-native-5.4.2.tgz#6b0c987cc57f8d900763e763025d00d26ccbc85f" @@ -2819,11 +2840,25 @@ dependencies: pretty-format "^29.0.0" +"@testing-library/react@^14.2.1": + version "14.2.1" + resolved "https://registry.yarnpkg.com/@testing-library/react/-/react-14.2.1.tgz#bf69aa3f71c36133349976a4a2da3687561d8310" + integrity sha512-sGdjws32ai5TLerhvzThYFbpnF9XtL65Cjf+gB0Dhr29BGqK+mAeN7SURSdu+eqgET4ANcWoC7FQpkaiGvBr+A== + dependencies: + "@babel/runtime" "^7.12.5" + "@testing-library/dom" "^9.0.0" + "@types/react-dom" "^18.0.0" + "@tootallnate/once@2": version "2.0.0" resolved "https://registry.yarnpkg.com/@tootallnate/once/-/once-2.0.0.tgz#f544a148d3ab35801c1f633a7441fd87c2e484bf" integrity sha512-XCuKFP5PS55gnMVu3dty8KPatLqUoy/ZYzDzAGCQ8JNFCkLXzmI7vNHCR+XpbZaMWQK/vQubr7PkYq8g470J/A== +"@types/aria-query@^5.0.1": + version "5.0.4" + resolved "https://registry.yarnpkg.com/@types/aria-query/-/aria-query-5.0.4.tgz#1a31c3d378850d2778dabb6374d036dcba4ba708" + integrity sha512-rfT93uj5s0PRL7EzccGMs3brplhcrghnDoV26NqKhCAS1hVo+WdNsPvE/yb6ilfr5hi2MEk6d5EWJTKdxg8jVw== + "@types/babel__core@^7.1.14": version "7.20.1" resolved "https://registry.yarnpkg.com/@types/babel__core/-/babel__core-7.20.1.tgz#916ecea274b0c776fec721e333e55762d3a9614b" @@ -2953,6 +2988,13 @@ dependencies: ts-toolbelt "^6.15.1" +"@types/react-dom@^18.0.0": + version "18.2.19" + resolved "https://registry.yarnpkg.com/@types/react-dom/-/react-dom-18.2.19.tgz#b84b7c30c635a6c26c6a6dfbb599b2da9788be58" + integrity sha512-aZvQL6uUbIJpjZk4U8JZGbau9KDeAwMfmhyWorxgBkqDIEf6ROjRozcmPIicqsUwPUjbkDfHKgGee1Lq65APcA== + dependencies: + "@types/react" "*" + "@types/react-native-fetch-blob@^0.10.8": version "0.10.8" resolved "https://registry.yarnpkg.com/@types/react-native-fetch-blob/-/react-native-fetch-blob-0.10.8.tgz#9c3e68f3bccd1822f924caa201223761d6685ea8" @@ -3259,6 +3301,13 @@ argparse@^2.0.1: resolved "https://registry.yarnpkg.com/argparse/-/argparse-2.0.1.tgz#246f50f3ca78a3240f6c997e8a9bd1eac49e4b38" integrity sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q== +aria-query@5.1.3: + version "5.1.3" + resolved "https://registry.yarnpkg.com/aria-query/-/aria-query-5.1.3.tgz#19db27cd101152773631396f7a95a3b58c22c35e" + integrity sha512-R5iJ5lkuHybztUfuOAznmboyjWq8O6sqNqtK7CLOqdydi54VNbORp49mb14KbWgG1QD3JFO9hJdZ+y4KutfdOQ== + dependencies: + deep-equal "^2.0.5" + array-buffer-byte-length@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/array-buffer-byte-length/-/array-buffer-byte-length-1.0.0.tgz#fabe8bc193fea865f317fe7807085ee0dee5aead" @@ -3357,6 +3406,13 @@ available-typed-arrays@^1.0.5: resolved "https://registry.yarnpkg.com/available-typed-arrays/-/available-typed-arrays-1.0.5.tgz#92f95616501069d07d10edb2fc37d3e1c65123b7" integrity sha512-DMD0KiN46eipeziST1LPP/STfDU0sufISXmjSgvVsoU2tqxctQeASejWcfNtxYKqETM1UxQ8sp2OrSBWpHY6sw== +available-typed-arrays@^1.0.6: + version "1.0.7" + resolved "https://registry.yarnpkg.com/available-typed-arrays/-/available-typed-arrays-1.0.7.tgz#a5cc375d6a03c2efc87a553f3e0b1522def14846" + integrity sha512-wvUjBtSGN7+7SjNpq/9M2Tg350UZD3q62IFZLbRAR1bSMlCo1ZaeW+BJ+D090e4hIIZLBcTDWe4Mh4jvUDajzQ== + dependencies: + possible-typed-array-names "^1.0.0" + axios@>=0.13.0, axios@^1.5.1: version "1.5.1" resolved "https://registry.yarnpkg.com/axios/-/axios-1.5.1.tgz#11fbaa11fc35f431193a9564109c88c1f27b585f" @@ -3763,6 +3819,17 @@ call-bind@^1.0.0, call-bind@^1.0.2: function-bind "^1.1.1" get-intrinsic "^1.0.2" +call-bind@^1.0.5, call-bind@^1.0.6: + version "1.0.7" + resolved "https://registry.yarnpkg.com/call-bind/-/call-bind-1.0.7.tgz#06016599c40c56498c18769d2730be242b6fa3b9" + integrity sha512-GHTSNSYICQ7scH7sZ+M2rFopRoLh8t2bLSW6BbgrtLsahOIB5iyAVJf9GjWK3cYTDaMj4XdBpM1cA6pIS0Kv2w== + dependencies: + es-define-property "^1.0.0" + es-errors "^1.3.0" + function-bind "^1.1.2" + get-intrinsic "^1.2.4" + set-function-length "^1.2.1" + caller-callsite@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/caller-callsite/-/caller-callsite-2.0.0.tgz#847e0fce0a223750a9a027c54b33731ad3154134" @@ -4353,6 +4420,30 @@ dedent@^1.0.0: resolved "https://registry.yarnpkg.com/dedent/-/dedent-1.5.1.tgz#4f3fc94c8b711e9bb2800d185cd6ad20f2a90aff" integrity sha512-+LxW+KLWxu3HW3M2w2ympwtqPrqYRzU8fqi6Fhd18fBALe15blJPI/I4+UHveMVG6lJqB4JNd4UG0S5cnVHwIg== +deep-equal@^2.0.5: + version "2.2.3" + resolved "https://registry.yarnpkg.com/deep-equal/-/deep-equal-2.2.3.tgz#af89dafb23a396c7da3e862abc0be27cf51d56e1" + integrity sha512-ZIwpnevOurS8bpT4192sqAowWM76JDKSHYzMLty3BZGSswgq6pBaH3DhCSW5xVAZICZyKdOBPjwww5wfgT/6PA== + dependencies: + array-buffer-byte-length "^1.0.0" + call-bind "^1.0.5" + es-get-iterator "^1.1.3" + get-intrinsic "^1.2.2" + is-arguments "^1.1.1" + is-array-buffer "^3.0.2" + is-date-object "^1.0.5" + is-regex "^1.1.4" + is-shared-array-buffer "^1.0.2" + isarray "^2.0.5" + object-is "^1.1.5" + object-keys "^1.1.1" + object.assign "^4.1.4" + regexp.prototype.flags "^1.5.1" + side-channel "^1.0.4" + which-boxed-primitive "^1.0.2" + which-collection "^1.0.1" + which-typed-array "^1.1.13" + deep-extend@^0.6.0: version "0.6.0" resolved "https://registry.yarnpkg.com/deep-extend/-/deep-extend-0.6.0.tgz#c4fa7c95404a17a9c3e8ca7e1537312b736330ac" @@ -4383,6 +4474,15 @@ defaults@^1.0.3: dependencies: clone "^1.0.2" +define-data-property@^1.0.1, define-data-property@^1.1.2, define-data-property@^1.1.4: + version "1.1.4" + resolved "https://registry.yarnpkg.com/define-data-property/-/define-data-property-1.1.4.tgz#894dc141bb7d3060ae4366f6a0107e68fbe48c5e" + integrity sha512-rBMvIzlpA8v6E+SJZoo++HAYqsLrkg7MSfIinMPFhmkorw7X+dOXVJQs+QT69zGkzMyfDnIMN2Wid1+NbL3T+A== + dependencies: + es-define-property "^1.0.0" + es-errors "^1.3.0" + gopd "^1.0.1" + define-lazy-prop@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/define-lazy-prop/-/define-lazy-prop-2.0.0.tgz#3f7ae421129bcaaac9bc74905c98a0009ec9ee7f" @@ -4396,6 +4496,15 @@ define-properties@^1.1.3, define-properties@^1.1.4, define-properties@^1.2.0: has-property-descriptors "^1.0.0" object-keys "^1.1.1" +define-properties@^1.2.1: + version "1.2.1" + resolved "https://registry.yarnpkg.com/define-properties/-/define-properties-1.2.1.tgz#10781cc616eb951a80a034bafcaa7377f6af2b6c" + integrity sha512-8QmQKqEASLd5nx0U1B1okLElbUuuttJ/AnYmRXbbbGDWh6uS208EjD4Xqq/I9wK7u0v6O08XhTWnt5XtEbR6Dg== + dependencies: + define-data-property "^1.0.1" + has-property-descriptors "^1.0.0" + object-keys "^1.1.1" + del@^6.0.0: version "6.1.1" resolved "https://registry.yarnpkg.com/del/-/del-6.1.1.tgz#3b70314f1ec0aa325c6b14eb36b95786671edb7a" @@ -4489,6 +4598,11 @@ discontinuous-range@1.0.0: resolved "https://registry.yarnpkg.com/discontinuous-range/-/discontinuous-range-1.0.0.tgz#e38331f0844bba49b9a9cb71c771585aab1bc65a" integrity sha512-c68LpLbO+7kP/b1Hr1qs8/BJ09F5khZGTxqxZuhzxpmwJKOgRFHJWIb9/KmqnqHhLdO55aOxFH/EGBvUQbL/RQ== +dom-accessibility-api@^0.5.9: + version "0.5.16" + resolved "https://registry.yarnpkg.com/dom-accessibility-api/-/dom-accessibility-api-0.5.16.tgz#5a7429e6066eb3664d911e33fb0e45de8eb08453" + integrity sha512-X7BJ2yElsnOJ30pZF4uIIDfBEVgF4XEBxL9Bxhy6dnrm5hkzqmsWHGTiHqRiITNhMyFLyAiWndIJP7Z1NTteDg== + dom-serializer@^1.0.1: version "1.4.1" resolved "https://registry.yarnpkg.com/dom-serializer/-/dom-serializer-1.4.1.tgz#de5d41b1aea290215dc45a6dae8adcf1d32e2d30" @@ -4769,6 +4883,33 @@ es-array-method-boxes-properly@^1.0.0: resolved "https://registry.yarnpkg.com/es-array-method-boxes-properly/-/es-array-method-boxes-properly-1.0.0.tgz#873f3e84418de4ee19c5be752990b2e44718d09e" integrity sha512-wd6JXUmyHmt8T5a2xreUwKcGPq6f1f+WwIJkijUqiGcJz1qqnZgP6XIK+QyIWU5lT7imeNxUll48bziG+TSYcA== +es-define-property@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/es-define-property/-/es-define-property-1.0.0.tgz#c7faefbdff8b2696cf5f46921edfb77cc4ba3845" + integrity sha512-jxayLKShrEqqzJ0eumQbVhTYQM27CfT1T35+gCgDFoL82JLsXqTJ76zv6A0YLOgEnLUMvLzsDsGIrl8NFpT2gQ== + dependencies: + get-intrinsic "^1.2.4" + +es-errors@^1.3.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/es-errors/-/es-errors-1.3.0.tgz#05f75a25dab98e4fb1dcd5e1472c0546d5057c8f" + integrity sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw== + +es-get-iterator@^1.1.3: + version "1.1.3" + resolved "https://registry.yarnpkg.com/es-get-iterator/-/es-get-iterator-1.1.3.tgz#3ef87523c5d464d41084b2c3c9c214f1199763d6" + integrity sha512-sPZmqHBe6JIiTfN5q2pEi//TwxmAFHwj/XEuYjTuse78i8KxaqMTTzxPoFKuzRpDpTJ+0NAbpfenkmH2rePtuw== + dependencies: + call-bind "^1.0.2" + get-intrinsic "^1.1.3" + has-symbols "^1.0.3" + is-arguments "^1.1.1" + is-map "^2.0.2" + is-set "^2.0.2" + is-string "^1.0.7" + isarray "^2.0.5" + stop-iteration-iterator "^1.0.0" + es-set-tostringtag@^2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/es-set-tostringtag/-/es-set-tostringtag-2.0.1.tgz#338d502f6f674301d710b80c8592de8a15f09cd8" @@ -5369,6 +5510,11 @@ function-bind@^1.1.1: resolved "https://registry.yarnpkg.com/function-bind/-/function-bind-1.1.1.tgz#a56899d3ea3c9bab874bb9773b7c5ede92f4895d" integrity sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A== +function-bind@^1.1.2: + version "1.1.2" + resolved "https://registry.yarnpkg.com/function-bind/-/function-bind-1.1.2.tgz#2c02d864d97f3ea6c8830c464cbd11ab6eab7a1c" + integrity sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA== + function.prototype.name@^1.1.2, function.prototype.name@^1.1.5: version "1.1.5" resolved "https://registry.yarnpkg.com/function.prototype.name/-/function.prototype.name-1.1.5.tgz#cce0505fe1ffb80503e6f9e46cc64e46a12a9621" @@ -5404,6 +5550,17 @@ get-intrinsic@^1.0.2, get-intrinsic@^1.1.1, get-intrinsic@^1.1.3, get-intrinsic@ has-proto "^1.0.1" has-symbols "^1.0.3" +get-intrinsic@^1.2.2, get-intrinsic@^1.2.3, get-intrinsic@^1.2.4: + version "1.2.4" + resolved "https://registry.yarnpkg.com/get-intrinsic/-/get-intrinsic-1.2.4.tgz#e385f5a4b5227d449c3eabbad05494ef0abbeadd" + integrity sha512-5uYhsJH8VJBTv7oslg4BznJYhDoRI6waYCxMmCdnTrcCrHA/fCFKoTFz2JKKE0HdDFUF7/oQuhzumXJK7paBRQ== + dependencies: + es-errors "^1.3.0" + function-bind "^1.1.2" + has-proto "^1.0.1" + has-symbols "^1.0.3" + hasown "^2.0.0" + get-package-type@^0.1.0: version "0.1.0" resolved "https://registry.yarnpkg.com/get-package-type/-/get-package-type-0.1.0.tgz#8de2d803cff44df3bc6c456e6668b36c3926e11a" @@ -5562,6 +5719,13 @@ has-property-descriptors@^1.0.0: dependencies: get-intrinsic "^1.1.1" +has-property-descriptors@^1.0.1, has-property-descriptors@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/has-property-descriptors/-/has-property-descriptors-1.0.2.tgz#963ed7d071dc7bf5f084c5bfbe0d1b6222586854" + integrity sha512-55JNKuIW+vq4Ke1BjOTjM2YctQIvCT7GFzHwmfZPGo5wnrgkid0YQtnAleFSqumZm4az3n2BS+erby5ipJdgrg== + dependencies: + es-define-property "^1.0.0" + has-proto@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/has-proto/-/has-proto-1.0.1.tgz#1885c1305538958aff469fef37937c22795408e0" @@ -5579,6 +5743,13 @@ has-tostringtag@^1.0.0: dependencies: has-symbols "^1.0.2" +has-tostringtag@^1.0.1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/has-tostringtag/-/has-tostringtag-1.0.2.tgz#2cdc42d40bef2e5b4eeab7c01a73c54ce7ab5abc" + integrity sha512-NqADB8VjPFLM2V0VvHUewwwsw0ZWBaIdgo+ieHtK3hasLz4qeCRjYcqfB6AQrBggRKppKF8L52/VqdVsO47Dlw== + dependencies: + has-symbols "^1.0.3" + has@^1.0.3: version "1.0.3" resolved "https://registry.yarnpkg.com/has/-/has-1.0.3.tgz#722d7cbfc1f6aa8241f16dd814e011e1f41e8796" @@ -5586,6 +5757,13 @@ has@^1.0.3: dependencies: function-bind "^1.1.1" +hasown@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/hasown/-/hasown-2.0.1.tgz#26f48f039de2c0f8d3356c223fb8d50253519faa" + integrity sha512-1/th4MHjnwncwXsIW6QMzlvYL9kG5e/CpVvLRZe4XPa8TOUNbCELqmvhDmnkNsAjwaG4+I8gJJL0JBvTTLO9qA== + dependencies: + function-bind "^1.1.2" + hermes-estree@0.12.0: version "0.12.0" resolved "https://registry.yarnpkg.com/hermes-estree/-/hermes-estree-0.12.0.tgz#8a289f9aee854854422345e6995a48613bac2ca8" @@ -5804,6 +5982,15 @@ internal-ip@4.3.0: default-gateway "^4.2.0" ipaddr.js "^1.9.0" +internal-slot@^1.0.4: + version "1.0.7" + resolved "https://registry.yarnpkg.com/internal-slot/-/internal-slot-1.0.7.tgz#c06dcca3ed874249881007b0a5523b172a190802" + integrity sha512-NGnrKwXzSms2qUUih/ILZ5JBqNTSa1+ZmP6flaIp6KmSElgE9qdndzS3cqjrDovwFdmwsGsLdeFgB6suw+1e9g== + dependencies: + es-errors "^1.3.0" + hasown "^2.0.0" + side-channel "^1.0.4" + internal-slot@^1.0.5: version "1.0.5" resolved "https://registry.yarnpkg.com/internal-slot/-/internal-slot-1.0.5.tgz#f2a2ee21f668f8627a4667f309dc0f4fb6674986" @@ -5835,6 +6022,14 @@ ipaddr.js@^1.9.0: resolved "https://registry.yarnpkg.com/ipaddr.js/-/ipaddr.js-1.9.1.tgz#bff38543eeb8984825079ff3a2a8e6cbd46781b3" integrity sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g== +is-arguments@^1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/is-arguments/-/is-arguments-1.1.1.tgz#15b3f88fda01f2a97fec84ca761a560f123efa9b" + integrity sha512-8Q7EARjzEnKpt/PCD7e1cgUS0a6X8u5tdSiMqXhojOdoV9TsMsiO+9VLC5vAmO8N7/GmXn7yjR8qnA6bVAEzfA== + dependencies: + call-bind "^1.0.2" + has-tostringtag "^1.0.0" + is-array-buffer@^3.0.1, is-array-buffer@^3.0.2: version "3.0.2" resolved "https://registry.yarnpkg.com/is-array-buffer/-/is-array-buffer-3.0.2.tgz#f2653ced8412081638ecb0ebbd0c41c6e0aecbbe" @@ -5886,7 +6081,7 @@ is-core-module@^2.13.0: dependencies: has "^1.0.3" -is-date-object@^1.0.1: +is-date-object@^1.0.1, is-date-object@^1.0.5: version "1.0.5" resolved "https://registry.yarnpkg.com/is-date-object/-/is-date-object-1.0.5.tgz#0841d5536e724c25597bf6ea62e1bd38298df31f" integrity sha512-9YQaSxsAiSwcvS33MBk3wTCVnWK+HhF8VZR2jRxehM16QcVOdHqPn4VPHmRK4lSr38n9JriurInLcP90xsYNfQ== @@ -5954,6 +6149,11 @@ is-invalid-path@^0.1.0: dependencies: is-glob "^2.0.0" +is-map@^2.0.1, is-map@^2.0.2: + version "2.0.2" + resolved "https://registry.yarnpkg.com/is-map/-/is-map-2.0.2.tgz#00922db8c9bf73e81b7a335827bc2a43f2b91127" + integrity sha512-cOZFQQozTha1f4MxLFzlgKYPTyj26picdZTx82hbc/Xf4K/tZOOXSCkMvU4pKioRXGDLJRn0GM7Upe7kR721yg== + is-negative-zero@^2.0.2: version "2.0.2" resolved "https://registry.yarnpkg.com/is-negative-zero/-/is-negative-zero-2.0.2.tgz#7bf6f03a28003b8b3965de3ac26f664d765f3150" @@ -6006,6 +6206,11 @@ is-regex@^1.0.5, is-regex@^1.1.0, is-regex@^1.1.4: call-bind "^1.0.2" has-tostringtag "^1.0.0" +is-set@^2.0.1, is-set@^2.0.2: + version "2.0.2" + resolved "https://registry.yarnpkg.com/is-set/-/is-set-2.0.2.tgz#90755fa4c2562dc1c5d4024760d6119b94ca18ec" + integrity sha512-+2cnTEZeY5z/iXGbLhPrOAaK/Mau5k5eXq9j14CpRTftq0pAJu2MwVRSZhyZWBzx3o6X795Lz6Bpb6R0GKf37g== + is-shared-array-buffer@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/is-shared-array-buffer/-/is-shared-array-buffer-1.0.2.tgz#8f259c573b60b6a32d4058a1a07430c0a7344c79" @@ -6061,6 +6266,11 @@ is-valid-path@^0.1.1: dependencies: is-invalid-path "^0.1.0" +is-weakmap@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/is-weakmap/-/is-weakmap-2.0.1.tgz#5008b59bdc43b698201d18f62b37b2ca243e8cf2" + integrity sha512-NSBR4kH5oVj1Uwvv970ruUkCV7O1mzgVFO4/rev2cLRda9Tm9HrL70ZPut4rOHgY0FNrUu9BCbXA2sdQ+x0chA== + is-weakref@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/is-weakref/-/is-weakref-1.0.2.tgz#9529f383a9338205e89765e0392efc2f100f06f2" @@ -6068,6 +6278,14 @@ is-weakref@^1.0.2: dependencies: call-bind "^1.0.2" +is-weakset@^2.0.1: + version "2.0.2" + resolved "https://registry.yarnpkg.com/is-weakset/-/is-weakset-2.0.2.tgz#4569d67a747a1ce5a994dfd4ef6dcea76e7c0a1d" + integrity sha512-t2yVvttHkQktwnNNmBQ98AhENLdPUTDTE21uPqAQ0ARwQfGeQKRVS0NNurH7bTf7RrvcVn1OOge45CnBeHCSmg== + dependencies: + call-bind "^1.0.2" + get-intrinsic "^1.1.1" + is-wsl@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/is-wsl/-/is-wsl-1.1.0.tgz#1f16e4aa22b04d1336b66188a66af3c600c3a66d" @@ -7072,6 +7290,11 @@ lru-cache@^6.0.0: dependencies: yallist "^4.0.0" +lz-string@^1.5.0: + version "1.5.0" + resolved "https://registry.yarnpkg.com/lz-string/-/lz-string-1.5.0.tgz#c1ab50f77887b712621201ba9fd4e3a6ed099941" + integrity sha512-h5bgJWpxJNswbU7qCrV0tIKQCaS3blPDrqKWx+QxzuzL1zGUzij9XCWLrSLsJPu5t+eWA/ycetzYAO5IOMcWAQ== + make-dir@^2.0.0, make-dir@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/make-dir/-/make-dir-2.1.0.tgz#5f0310e18b8be898cc07009295a30ae41e91e6f5" @@ -8302,6 +8525,11 @@ pngjs@^3.3.0: resolved "https://registry.yarnpkg.com/pngjs/-/pngjs-3.4.0.tgz#99ca7d725965fb655814eaf65f38f12bbdbf555f" integrity sha512-NCrCHhWmnQklfH4MtJMRjZ2a8c80qXeMlQMv2uVp9ISJMTt562SbGd6n2oq0PaPgKm7Z6pL9E2UlLIhC+SHL3w== +possible-typed-array-names@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/possible-typed-array-names/-/possible-typed-array-names-1.0.0.tgz#89bb63c6fada2c3e90adc4a647beeeb39cc7bf8f" + integrity sha512-d7Uw+eZoloe0EHDIYoe+bQ5WXnGMOpmiZFTuMWCwpjzzkL2nTjcKiAk4hh8TjnGye2TwWOk3UXucZ+3rbmBa8Q== + postcss-value-parser@^4.0.2: version "4.2.0" resolved "https://registry.yarnpkg.com/postcss-value-parser/-/postcss-value-parser-4.2.0.tgz#723c09920836ba6d3e5af019f92bc0971c02e514" @@ -8331,6 +8559,15 @@ pretty-format@^26.5.2, pretty-format@^26.6.2: ansi-styles "^4.0.0" react-is "^17.0.1" +pretty-format@^27.0.2: + version "27.5.1" + resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-27.5.1.tgz#2181879fdea51a7a5851fb39d920faa63f01d88e" + integrity sha512-Qb1gy5OrP5+zDf2Bvnzdl3jsTf1qXVMazbvCoKhtKqVs4/YK4ozX4gKQJJVyNe+cajNPn0KoC0MC3FUmaHWEmQ== + dependencies: + ansi-regex "^5.0.1" + ansi-styles "^5.0.0" + react-is "^17.0.1" + pretty-format@^29.0.0, pretty-format@^29.0.3, pretty-format@^29.6.2: version "29.6.2" resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-29.6.2.tgz#3d5829261a8a4d89d8b9769064b29c50ed486a47" @@ -8923,6 +9160,16 @@ regexp.prototype.flags@^1.5.0: define-properties "^1.2.0" functions-have-names "^1.2.3" +regexp.prototype.flags@^1.5.1: + version "1.5.2" + resolved "https://registry.yarnpkg.com/regexp.prototype.flags/-/regexp.prototype.flags-1.5.2.tgz#138f644a3350f981a858c44f6bb1a61ff59be334" + integrity sha512-NcDiDkTLuPR+++OCKB0nWafEmhg/Da8aUPLPMQbK+bxKKCm1/S5he+AqYa4PlMCVBalb4/yxIRub6qkEx5yJbw== + dependencies: + call-bind "^1.0.6" + define-properties "^1.2.1" + es-errors "^1.3.0" + set-function-name "^2.0.1" + regexpu-core@^5.3.1: version "5.3.2" resolved "https://registry.yarnpkg.com/regexpu-core/-/regexpu-core-5.3.2.tgz#11a2b06884f3527aec3e93dbbf4a3b958a95546b" @@ -9250,6 +9497,28 @@ set-blocking@^2.0.0: resolved "https://registry.yarnpkg.com/set-blocking/-/set-blocking-2.0.0.tgz#045f9782d011ae9a6803ddd382b24392b3d890f7" integrity sha512-KiKBS8AnWGEyLzofFfmvKwpdPzqiy16LvQfK3yv/fVH7Bj13/wl3JSR1J+rfgRE9q7xUJK4qvgS8raSOeLUehw== +set-function-length@^1.2.1: + version "1.2.1" + resolved "https://registry.yarnpkg.com/set-function-length/-/set-function-length-1.2.1.tgz#47cc5945f2c771e2cf261c6737cf9684a2a5e425" + integrity sha512-j4t6ccc+VsKwYHso+kElc5neZpjtq9EnRICFZtWyBsLojhmeF/ZBd/elqm22WJh/BziDe/SBiOeAt0m2mfLD0g== + dependencies: + define-data-property "^1.1.2" + es-errors "^1.3.0" + function-bind "^1.1.2" + get-intrinsic "^1.2.3" + gopd "^1.0.1" + has-property-descriptors "^1.0.1" + +set-function-name@^2.0.1: + version "2.0.2" + resolved "https://registry.yarnpkg.com/set-function-name/-/set-function-name-2.0.2.tgz#16a705c5a0dc2f5e638ca96d8a8cd4e1c2b90985" + integrity sha512-7PGFlmtwsEADb0WYyvCMa1t+yke6daIG4Wirafur5kcf+MhUnPms1UeR0CKQdTZD81yESwMHbtn+TR+dMviakQ== + dependencies: + define-data-property "^1.1.4" + es-errors "^1.3.0" + functions-have-names "^1.2.3" + has-property-descriptors "^1.0.2" + setimmediate@^1.0.5: version "1.0.5" resolved "https://registry.yarnpkg.com/setimmediate/-/setimmediate-1.0.5.tgz#290cbb232e306942d7d7ea9b83732ab7856f8285" @@ -9451,6 +9720,13 @@ statuses@~1.5.0: resolved "https://registry.yarnpkg.com/statuses/-/statuses-1.5.0.tgz#161c7dac177659fd9811f43771fa99381478628c" integrity sha512-OpZ3zP+jT1PI7I8nemJX4AKmAX070ZkYPVWV/AaKTJl+tXCTGyVdC1a4SL8RUQYEwk/f34ZX8UTykN68FwrqAA== +stop-iteration-iterator@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/stop-iteration-iterator/-/stop-iteration-iterator-1.0.0.tgz#6a60be0b4ee757d1ed5254858ec66b10c49285e4" + integrity sha512-iCGQj+0l0HOdZ2AEeBADlsRC+vsnDsZsbdSiH1yNSjcfKM7fdpCMfqAL/dwF5BLiw/XhRft/Wax6zQbhq2BcjQ== + dependencies: + internal-slot "^1.0.4" + stream-buffers@2.2.x: version "2.2.0" resolved "https://registry.yarnpkg.com/stream-buffers/-/stream-buffers-2.2.0.tgz#91d5f5130d1cef96dcfa7f726945188741d09ee4" @@ -10218,6 +10494,16 @@ which-boxed-primitive@^1.0.2: is-string "^1.0.5" is-symbol "^1.0.3" +which-collection@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/which-collection/-/which-collection-1.0.1.tgz#70eab71ebbbd2aefaf32f917082fc62cdcb70906" + integrity sha512-W8xeTUwaln8i3K/cY1nGXzdnVZlidBcagyNFtBdD5kxnb4TvGKR7FfSIS3mYpwWS1QUCutfKz8IY8RjftB0+1A== + dependencies: + is-map "^2.0.1" + is-set "^2.0.1" + is-weakmap "^2.0.1" + is-weakset "^2.0.1" + which-module@^2.0.0: version "2.0.1" resolved "https://registry.yarnpkg.com/which-module/-/which-module-2.0.1.tgz#776b1fe35d90aebe99e8ac15eb24093389a4a409" @@ -10234,6 +10520,17 @@ which-typed-array@^1.1.10, which-typed-array@^1.1.11: gopd "^1.0.1" has-tostringtag "^1.0.0" +which-typed-array@^1.1.13: + version "1.1.14" + resolved "https://registry.yarnpkg.com/which-typed-array/-/which-typed-array-1.1.14.tgz#1f78a111aee1e131ca66164d8bdc3ab062c95a06" + integrity sha512-VnXFiIW8yNn9kIHN88xvZ4yOWchftKDsRJ8fEPacX/wl1lOvBrhsJ/OeJCXq7B0AaijRuqgzSKalJoPk+D8MPg== + dependencies: + available-typed-arrays "^1.0.6" + call-bind "^1.0.5" + for-each "^0.3.3" + gopd "^1.0.1" + has-tostringtag "^1.0.1" + which@^1.2.9: version "1.3.1" resolved "https://registry.yarnpkg.com/which/-/which-1.3.1.tgz#a45043d54f5805316da8d62f9f50918d3da70b0a" From e73c6168358e4056bfea78b2bbe1b5fd652daa42 Mon Sep 17 00:00:00 2001 From: AndrewC Date: Sun, 3 Mar 2024 21:03:45 -0600 Subject: [PATCH 07/10] change the methods for add video --- lib/screens/AddNoteScreen.tsx | 8 ++++---- lib/screens/EditNoteScreen.tsx | 12 ++++++------ 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/lib/screens/AddNoteScreen.tsx b/lib/screens/AddNoteScreen.tsx index ef9a9cf..224983f 100644 --- a/lib/screens/AddNoteScreen.tsx +++ b/lib/screens/AddNoteScreen.tsx @@ -136,11 +136,11 @@ const AddNoteScreen: React.FC = ({ navigation, route }) => { // Fetch the thumbnail URI const thumbnailUri = await getThumbnail(videoUri); - // Create a custom HTML block for the video with its thumbnail + // Create a custom HTML block for the video with its thumbnail, including styling for the video const videoHtml = ` -
- Video Thumbnail - +
+ Video Thumbnail +
`; diff --git a/lib/screens/EditNoteScreen.tsx b/lib/screens/EditNoteScreen.tsx index 71986bf..35a24af 100644 --- a/lib/screens/EditNoteScreen.tsx +++ b/lib/screens/EditNoteScreen.tsx @@ -161,16 +161,16 @@ const EditNoteScreen: React.FC = ({ }, 500); // Adjust the delay as needed }; - async function addVideoToEditor(videoUri: string) { + const addVideoToEditor = async (videoUri: string) => { try { // Fetch the thumbnail URI const thumbnailUri = await getThumbnail(videoUri); - // Create a custom HTML block for the video with its thumbnail + // Create a custom HTML block for the video with its thumbnail, including styling for the video const videoHtml = ` -
- Video Thumbnail - +
+ Video Thumbnail +
`; @@ -184,7 +184,7 @@ const EditNoteScreen: React.FC = ({ } catch (error) { console.error("Error adding video with thumbnail: ", error); } - } +} /* const addVideoToEditor = (videoUri: string) => { From 55cd7847cbc067d236334310e19f592bd649ee0d Mon Sep 17 00:00:00 2001 From: AndrewC Date: Wed, 13 Mar 2024 14:49:25 -0500 Subject: [PATCH 08/10] Working on the ability to view videos from the NoteDetailModal, currently have it so that videos have a thumbnail and that they can be played from the add and edit note screens --- lib/screens/AddNoteScreen.tsx | 32 ++-- lib/screens/EditNoteScreen.tsx | 29 ++-- lib/screens/mapPage/NoteDetailModal.tsx | 48 ++++-- package.json | 2 +- yarn.lock | 190 ++++++++++++------------ 5 files changed, 154 insertions(+), 147 deletions(-) diff --git a/lib/screens/AddNoteScreen.tsx b/lib/screens/AddNoteScreen.tsx index 224983f..24c2f0c 100644 --- a/lib/screens/AddNoteScreen.tsx +++ b/lib/screens/AddNoteScreen.tsx @@ -136,12 +136,17 @@ const AddNoteScreen: React.FC = ({ navigation, route }) => { // Fetch the thumbnail URI const thumbnailUri = await getThumbnail(videoUri); - // Create a custom HTML block for the video with its thumbnail, including styling for the video const videoHtml = ` -
- Video Thumbnail - -
+ + `; richTextRef.current?.insertHTML(videoHtml); @@ -156,23 +161,6 @@ const AddNoteScreen: React.FC = ({ navigation, route }) => { } } - /* - const addVideoToEditor = (videoUri: string) => { - const customStyle = ` - max-width: 50%; - height: auto; - `; - - richTextRef.current?.insertVideo(videoUri); - - setTimeout(() => { - if (scrollViewRef.current) { - scrollViewRef.current.scrollToEnd({ animated: true }); - } - }, 500); // Adjust the delay as needed - }; - */ - const handleShareButtonPress = () => { setIsPublished(!isPublished); // Toggle the share status ToastMessage.show({ diff --git a/lib/screens/EditNoteScreen.tsx b/lib/screens/EditNoteScreen.tsx index 35a24af..ecb1690 100644 --- a/lib/screens/EditNoteScreen.tsx +++ b/lib/screens/EditNoteScreen.tsx @@ -166,12 +166,17 @@ const EditNoteScreen: React.FC = ({ // Fetch the thumbnail URI const thumbnailUri = await getThumbnail(videoUri); - // Create a custom HTML block for the video with its thumbnail, including styling for the video const videoHtml = ` -
- Video Thumbnail - -
+ + `; richTextRef.current?.insertHTML(videoHtml); @@ -184,19 +189,7 @@ const EditNoteScreen: React.FC = ({ } catch (error) { console.error("Error adding video with thumbnail: ", error); } -} - - /* - const addVideoToEditor = (videoUri: string) => { - richTextRef.current?.insertVideo(videoUri); - - setTimeout(() => { - if (scrollViewRef.current) { - scrollViewRef.current.scrollToEnd({ animated: true }); - } - }, 500); // Adjust the delay as needed - }; - */ + } const handleSaveNote = async () => { try { diff --git a/lib/screens/mapPage/NoteDetailModal.tsx b/lib/screens/mapPage/NoteDetailModal.tsx index 71bfb71..6b484f6 100644 --- a/lib/screens/mapPage/NoteDetailModal.tsx +++ b/lib/screens/mapPage/NoteDetailModal.tsx @@ -14,6 +14,8 @@ import { import { Ionicons } from "@expo/vector-icons"; import { Note } from "../../../types"; import RenderHTML from "react-native-render-html"; +import Video from 'react-native-video'; +import RendererRegistry, { defaultHTMLElementModels, HTMLContentModel, TNode } from 'react-native-render-html'; import { useTheme } from "../../components/ThemeProvider"; import ImageModal from "./ImageModal"; import VideoModal from "./VideoModal" @@ -115,6 +117,23 @@ const NoteDetailModal: React.FC = memo( }, }), []); + const CustomVideoPlayer: React.FC = ({ src }) => { + return +

${videoUri}

`; - + richTextRef.current?.insertHTML(videoHtml); setTimeout(() => { diff --git a/lib/screens/EditNoteScreen.tsx b/lib/screens/EditNoteScreen.tsx index ecb1690..dccfdc7 100644 --- a/lib/screens/EditNoteScreen.tsx +++ b/lib/screens/EditNoteScreen.tsx @@ -171,14 +171,17 @@ const EditNoteScreen: React.FC = ({ Your browser does not support the video tag. +

${videoUri}

`; - + richTextRef.current?.insertHTML(videoHtml); setTimeout(() => { @@ -190,7 +193,7 @@ const EditNoteScreen: React.FC = ({ console.error("Error adding video with thumbnail: ", error); } } - + const handleSaveNote = async () => { try { const editedNote: Note = { diff --git a/lib/screens/mapPage/NoteDetailModal.tsx b/lib/screens/mapPage/NoteDetailModal.tsx index 6b484f6..1862427 100644 --- a/lib/screens/mapPage/NoteDetailModal.tsx +++ b/lib/screens/mapPage/NoteDetailModal.tsx @@ -405,13 +405,6 @@ const NoteDetailModal: React.FC = memo( {note?.description} ) } - - setIsModalVisible(false)} images={images}/> From a82d003fcbc712a6d26f8e181dfc594f8000f655 Mon Sep 17 00:00:00 2001 From: AndrewC Date: Thu, 14 Mar 2024 21:46:39 -0500 Subject: [PATCH 10/10] photos are now being inserted through html, and then it adjusted with custom renderers for the note modal screen --- lib/screens/AddNoteScreen.tsx | 9 +++++--- lib/screens/EditNoteScreen.tsx | 5 ++++- lib/screens/mapPage/NoteDetailModal.tsx | 30 ++++++++++++++++--------- 3 files changed, 30 insertions(+), 14 deletions(-) diff --git a/lib/screens/AddNoteScreen.tsx b/lib/screens/AddNoteScreen.tsx index d2cc76b..0a22ced 100644 --- a/lib/screens/AddNoteScreen.tsx +++ b/lib/screens/AddNoteScreen.tsx @@ -120,9 +120,12 @@ const AddNoteScreen: React.FC = ({ navigation, route }) => { height: auto; /* Maintain aspect ratio */ /* Additional CSS properties for sizing */ `; - - richTextRef.current?.insertImage(imageUri); - + + // Include an extra line break character after the image tag + const imgTag = ` 

`; + + richTextRef.current?.insertHTML(imgTag); + if (scrollViewRef.current && !initialLoad) { // Adjust this timeout and calculation as necessary setTimeout(() => { diff --git a/lib/screens/EditNoteScreen.tsx b/lib/screens/EditNoteScreen.tsx index dccfdc7..9180469 100644 --- a/lib/screens/EditNoteScreen.tsx +++ b/lib/screens/EditNoteScreen.tsx @@ -151,7 +151,10 @@ const EditNoteScreen: React.FC = ({ /* Additional CSS properties for sizing */ `; - richTextRef.current?.insertImage(imageUri); + // Include an extra line break character after the image tag + const imgTag = ` 

`; + + richTextRef.current?.insertHTML(imgTag); // Add a delay before updating the text state setTimeout(() => { diff --git a/lib/screens/mapPage/NoteDetailModal.tsx b/lib/screens/mapPage/NoteDetailModal.tsx index 1862427..3f9e543 100644 --- a/lib/screens/mapPage/NoteDetailModal.tsx +++ b/lib/screens/mapPage/NoteDetailModal.tsx @@ -68,6 +68,23 @@ const NoteDetailModal: React.FC = memo( setIsVideoVisible(true); }; + const tagsStyles = { + img: { + maxWidth: '10', + height: '10', + }, + }; + + const customRenderers = { + img: ({tnode}) => { + // Access attributes from tnode + const { src, alt } = tnode.attributes; + const imageSize = { width: width, height: width }; // Fixed size for all images + + return ; + }, + }; + const html = note?.description; console.log(html); @@ -108,25 +125,18 @@ const NoteDetailModal: React.FC = memo( return { html }; }, [html]); - // Define styles for images within the HTML content - const tagsStyles = useMemo(() => ({ - img: { - width: 100, // Set image width to 100 pixels - height: 100, // Set image height to 100 pixels - resizeMode: 'cover', // Cover might not be directly applicable here, but ensures content is not distorted - }, - }), []); - const CustomVideoPlayer: React.FC = ({ src }) => { return