@edifice.io/react 2.6.12 → 2.6.13-develop-integration-demo.20261108143606
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/Checkbox/Checkbox.js +1 -1
- package/dist/components/Dropdown/Dropdown.js +19 -14
- package/dist/components/Dropdown/DropdownContext.d.ts +8 -0
- package/dist/components/Dropdown/DropdownItem.js +17 -1
- package/dist/components/Dropdown/DropdownMenuGroup.js +24 -6
- package/dist/components/Dropdown/DropdownSearchInput.js +16 -8
- package/dist/components/Dropdown/DropdownTrigger.js +24 -8
- package/dist/components/Dropdown/useDropdownItemFilter.js +5 -7
- package/dist/components/Dropdown/useMatchRegistry.d.ts +5 -0
- package/dist/components/Dropdown/useMatchRegistry.js +20 -0
- package/dist/components/Layout/Layout.js +12 -4
- package/dist/components/Masonry/Masonry.d.ts +40 -0
- package/dist/components/Masonry/Masonry.js +50 -0
- package/dist/components/Masonry/index.d.ts +2 -0
- package/dist/components/SearchBar/SearchBar.js +17 -26
- package/dist/components/Select/Select.d.ts +14 -1
- package/dist/components/Select/Select.js +11 -5
- package/dist/components/Tree/components/Tree.d.ts +2 -5
- package/dist/components/Tree/components/Tree.js +10 -7
- package/dist/components/Tree/hooks/useTree.d.ts +1 -0
- package/dist/components/Tree/hooks/useTree.js +6 -2
- package/dist/components/Tree/types/index.d.ts +7 -0
- package/dist/components/index.d.ts +1 -0
- package/dist/homepage.js +114 -24
- package/dist/hooks/useDropdown/useDropdown.d.ts +1 -0
- package/dist/hooks/useDropdown/useDropdown.js +27 -9
- package/dist/hooks/useNextcloudSearch/useNextcloudSearch.d.ts +1 -1
- package/dist/hooks/useNextcloudSearch/useNextcloudSearch.js +2 -2
- package/dist/hooks/useUpload/useUpload.js +1 -1
- package/dist/hooks/useZendeskGuide/useZendeskGuide.d.ts +2 -6
- package/dist/hooks/useZendeskGuide/useZendeskGuide.js +11 -8
- package/dist/icons-apps.js +256 -254
- package/dist/icons.js +406 -404
- package/dist/index.js +160 -156
- package/dist/modules/HelpZone/HelpZone.js +6 -8
- package/dist/modules/HelpZone/HelpZoneContainer.js +2 -5
- package/dist/modules/editor/components/Editor/Editor.d.ts +5 -0
- package/dist/modules/editor/components/Editor/Editor.js +3 -0
- package/dist/modules/homepage/components/Agenda/Agenda.d.ts +10 -0
- package/dist/modules/homepage/components/Agenda/Agenda.js +54 -0
- package/dist/modules/homepage/components/Agenda/AgendaContainer.d.ts +1 -0
- package/dist/modules/homepage/components/Agenda/AgendaContainer.js +14 -0
- package/dist/modules/homepage/components/Agenda/AgendaEventCard.d.ts +10 -0
- package/dist/modules/homepage/components/Agenda/AgendaEventCard.js +30 -0
- package/dist/modules/homepage/components/Agenda/hooks/useAgendaContainer.d.ts +14 -0
- package/dist/modules/homepage/components/Agenda/hooks/useAgendaContainer.js +27 -0
- package/dist/modules/homepage/components/Agenda/index.d.ts +3 -0
- package/dist/modules/homepage/components/Agenda/services/api/agendaService.d.ts +24 -0
- package/dist/modules/homepage/components/Agenda/services/api/agendaService.js +45 -0
- package/dist/modules/homepage/components/Agenda/services/api/index.d.ts +4 -0
- package/dist/modules/homepage/components/Agenda/services/api/index.js +5 -0
- package/dist/modules/homepage/components/Agenda/services/queries/agenda.d.ts +19 -0
- package/dist/modules/homepage/components/Agenda/services/queries/agenda.js +26 -0
- package/dist/modules/homepage/components/AlloRegion/AlloRegion.d.ts +11 -0
- package/dist/modules/homepage/components/AlloRegion/AlloRegion.js +32 -0
- package/dist/modules/homepage/components/AlloRegion/AlloRegionContainer.d.ts +4 -0
- package/dist/modules/homepage/components/AlloRegion/AlloRegionContainer.js +10 -0
- package/dist/modules/homepage/components/AlloRegion/index.d.ts +3 -0
- package/dist/modules/homepage/components/BriefMe/BriefMe.d.ts +9 -0
- package/dist/modules/homepage/components/BriefMe/BriefMe.js +59 -0
- package/dist/modules/homepage/components/BriefMe/BriefMeContainer.d.ts +4 -0
- package/dist/modules/homepage/components/BriefMe/BriefMeContainer.js +17 -0
- package/dist/modules/homepage/components/BriefMe/index.d.ts +4 -0
- package/dist/modules/homepage/components/BriefMe/types.d.ts +17 -0
- package/dist/modules/homepage/components/BriefMe/types.js +8 -0
- package/dist/modules/homepage/components/BriefMe/useBriefMe.d.ts +31 -0
- package/dist/modules/homepage/components/BriefMe/useBriefMe.js +51 -0
- package/dist/modules/homepage/components/Cantine/Cantine.d.ts +7 -0
- package/dist/modules/homepage/components/Cantine/Cantine.js +44 -0
- package/dist/modules/homepage/components/Cantine/CantineContainer.d.ts +4 -0
- package/dist/modules/homepage/components/Cantine/CantineContainer.js +18 -0
- package/dist/modules/homepage/components/Cantine/CantineModal.d.ts +24 -0
- package/dist/modules/homepage/components/Cantine/CantineModal.js +88 -0
- package/dist/modules/homepage/components/Cantine/CantineModalContainer.d.ts +7 -0
- package/dist/modules/homepage/components/Cantine/CantineModalContainer.js +12 -0
- package/dist/modules/homepage/components/Cantine/components/CantineLegend.d.ts +5 -0
- package/dist/modules/homepage/components/Cantine/components/CantineLegend.js +22 -0
- package/dist/modules/homepage/components/Cantine/components/CantineMenuSection.d.ts +6 -0
- package/dist/modules/homepage/components/Cantine/components/CantineMenuSection.js +28 -0
- package/dist/modules/homepage/components/Cantine/components/cantineLabels.d.ts +12 -0
- package/dist/modules/homepage/components/Cantine/components/cantineLabels.js +60 -0
- package/dist/modules/homepage/components/Cantine/hooks/useCantine.d.ts +11 -0
- package/dist/modules/homepage/components/Cantine/hooks/useCantine.js +20 -0
- package/dist/modules/homepage/components/Cantine/hooks/useCantineMenu.d.ts +24 -0
- package/dist/modules/homepage/components/Cantine/hooks/useCantineMenu.js +65 -0
- package/dist/modules/homepage/components/Cantine/hooks/useCantineModal.d.ts +23 -0
- package/dist/modules/homepage/components/Cantine/hooks/useCantineModal.js +43 -0
- package/dist/modules/homepage/components/Cantine/index.d.ts +7 -0
- package/dist/modules/homepage/components/Cantine/types.d.ts +42 -0
- package/dist/modules/homepage/components/Captation/CaptationAudio/CaptationAudio.d.ts +7 -0
- package/dist/modules/homepage/components/Captation/CaptationAudio/CaptationAudio.js +44 -0
- package/dist/modules/homepage/components/Captation/CaptationVideo/CaptationVideo.d.ts +9 -0
- package/dist/modules/homepage/components/Captation/CaptationVideo/CaptationVideo.js +44 -0
- package/dist/modules/homepage/components/Captation/index.d.ts +2 -0
- package/dist/modules/homepage/components/Edumalin/Edumalin.d.ts +9 -0
- package/dist/modules/homepage/components/Edumalin/Edumalin.js +65 -0
- package/dist/modules/homepage/components/Edumalin/EdumalinContainer.d.ts +4 -0
- package/dist/modules/homepage/components/Edumalin/EdumalinContainer.js +21 -0
- package/dist/modules/homepage/components/Edumalin/EdumalinModal.d.ts +8 -0
- package/dist/modules/homepage/components/Edumalin/EdumalinModal.js +62 -0
- package/dist/modules/homepage/components/Edumalin/components/EdumalinBadge.d.ts +5 -0
- package/dist/modules/homepage/components/Edumalin/components/EdumalinBadge.js +38 -0
- package/dist/modules/homepage/components/Edumalin/components/EdumalinPicture.d.ts +5 -0
- package/dist/modules/homepage/components/Edumalin/components/EdumalinPicture.js +12 -0
- package/dist/modules/homepage/components/Edumalin/index.d.ts +7 -0
- package/dist/modules/homepage/components/Edumalin/types.d.ts +24 -0
- package/dist/modules/homepage/components/Edumalin/types.js +4 -0
- package/dist/modules/homepage/components/Edumalin/useEdumalin.d.ts +16 -0
- package/dist/modules/homepage/components/Edumalin/useEdumalin.js +35 -0
- package/dist/modules/homepage/components/Edumalin/utils.d.ts +28 -0
- package/dist/modules/homepage/components/Edumalin/utils.js +56 -0
- package/dist/modules/homepage/components/Favorites/Favorites.js +1 -4
- package/dist/modules/homepage/components/GenerationHdf/GenerationHdf.d.ts +16 -0
- package/dist/modules/homepage/components/GenerationHdf/GenerationHdf.js +65 -0
- package/dist/modules/homepage/components/GenerationHdf/GenerationHdfContainer.d.ts +4 -0
- package/dist/modules/homepage/components/GenerationHdf/GenerationHdfContainer.js +12 -0
- package/dist/modules/homepage/components/GenerationHdf/formatSolde.d.ts +1 -0
- package/dist/modules/homepage/components/GenerationHdf/formatSolde.js +6 -0
- package/dist/modules/homepage/components/GenerationHdf/index.d.ts +3 -0
- package/dist/modules/homepage/components/GenerationHdf/useGenerationHdf.d.ts +10 -0
- package/dist/modules/homepage/components/GenerationHdf/useGenerationHdf.js +69 -0
- package/dist/modules/homepage/components/Header/Header.js +8 -20
- package/dist/modules/homepage/components/HomeCard/HomeCardHeader.d.ts +5 -1
- package/dist/modules/homepage/components/HomeCard/HomeCardHeader.js +1 -1
- package/dist/modules/homepage/components/Mediacentre/Mediacentre.d.ts +13 -0
- package/dist/modules/homepage/components/Mediacentre/Mediacentre.js +57 -0
- package/dist/modules/homepage/components/Mediacentre/MediacentreContainer.d.ts +4 -0
- package/dist/modules/homepage/components/Mediacentre/MediacentreContainer.js +12 -0
- package/dist/modules/homepage/components/Mediacentre/components/MediacentreUniversalisSearch.d.ts +6 -0
- package/dist/modules/homepage/components/Mediacentre/components/MediacentreUniversalisSearch.js +30 -0
- package/dist/modules/homepage/components/Mediacentre/hooks/useMediacentre.d.ts +17 -0
- package/dist/modules/homepage/components/Mediacentre/hooks/useMediacentre.js +32 -0
- package/dist/modules/homepage/components/Mediacentre/index.d.ts +5 -0
- package/dist/modules/homepage/components/Mediacentre/services/mediacentreService.d.ts +24 -0
- package/dist/modules/homepage/components/Mediacentre/services/mediacentreService.js +25 -0
- package/dist/modules/homepage/components/Mediacentre/types.d.ts +8 -0
- package/dist/modules/homepage/components/MessageFlashList/MessageFlash.js +0 -2
- package/dist/modules/homepage/components/Notifications/NotificationList.js +7 -8
- package/dist/modules/homepage/components/Notifications/NotificationListSkeleton.js +7 -12
- package/dist/modules/homepage/components/Notifications/NotificationSkeleton.js +7 -4
- package/dist/modules/homepage/components/Notifications/components/NotificationFilterModal.js +11 -13
- package/dist/modules/homepage/components/Notifications/components/ReportNotificationModal.js +6 -12
- package/dist/modules/homepage/components/Notifications/components/notificationAdapter.js +12 -10
- package/dist/modules/homepage/components/Notifications/hooks/useNotificationList.js +9 -10
- package/dist/modules/homepage/components/Qwant/Qwant.d.ts +4 -0
- package/dist/modules/homepage/components/Qwant/Qwant.js +41 -0
- package/dist/modules/homepage/components/Qwant/QwantContainer.d.ts +1 -0
- package/dist/modules/homepage/components/Qwant/QwantContainer.js +10 -0
- package/dist/modules/homepage/components/Qwant/index.d.ts +3 -0
- package/dist/modules/homepage/components/Rss/Rss.d.ts +11 -0
- package/dist/modules/homepage/components/Rss/Rss.js +64 -0
- package/dist/modules/homepage/components/Rss/RssContainer.d.ts +1 -0
- package/dist/modules/homepage/components/Rss/RssContainer.js +45 -0
- package/dist/modules/homepage/components/Rss/RssFeedForm.d.ts +13 -0
- package/dist/modules/homepage/components/Rss/RssFeedForm.js +69 -0
- package/dist/modules/homepage/components/Rss/RssFeedsModal.d.ts +11 -0
- package/dist/modules/homepage/components/Rss/RssFeedsModal.js +58 -0
- package/dist/modules/homepage/components/Rss/hooks/useRssContainer.d.ts +25 -0
- package/dist/modules/homepage/components/Rss/hooks/useRssContainer.js +43 -0
- package/dist/modules/homepage/components/Rss/index.d.ts +6 -0
- package/dist/modules/homepage/components/Rss/services/api/index.d.ts +5 -0
- package/dist/modules/homepage/components/Rss/services/api/index.js +5 -0
- package/dist/modules/homepage/components/Rss/services/api/rssService.d.ts +38 -0
- package/dist/modules/homepage/components/Rss/services/api/rssService.js +51 -0
- package/dist/modules/homepage/components/Rss/services/queries/rss.d.ts +28 -0
- package/dist/modules/homepage/components/Rss/services/queries/rss.js +71 -0
- package/dist/modules/homepage/components/Rss/types.d.ts +25 -0
- package/dist/modules/homepage/components/Rss/utils.d.ts +7 -0
- package/dist/modules/homepage/components/Rss/utils.js +19 -0
- package/dist/modules/homepage/components/SchoolSpace/SchoolSpaceContainer.js +1 -1
- package/dist/modules/homepage/components/ScreenTime/ScreenTime.d.ts +11 -0
- package/dist/modules/homepage/components/ScreenTime/ScreenTime.js +49 -0
- package/dist/modules/homepage/components/ScreenTime/ScreenTimeChart.d.ts +10 -0
- package/dist/modules/homepage/components/ScreenTime/ScreenTimeChart.js +115 -0
- package/dist/modules/homepage/components/ScreenTime/ScreenTimeContainer.d.ts +1 -0
- package/dist/modules/homepage/components/ScreenTime/ScreenTimeContainer.js +25 -0
- package/dist/modules/homepage/components/ScreenTime/ScreenTimeError.d.ts +5 -0
- package/dist/modules/homepage/components/ScreenTime/ScreenTimeError.js +22 -0
- package/dist/modules/homepage/components/ScreenTime/ScreenTimeModal.d.ts +22 -0
- package/dist/modules/homepage/components/ScreenTime/ScreenTimeModal.js +81 -0
- package/dist/modules/homepage/components/ScreenTime/hooks/useScreenTimeContainer.d.ts +14 -0
- package/dist/modules/homepage/components/ScreenTime/hooks/useScreenTimeContainer.js +22 -0
- package/dist/modules/homepage/components/ScreenTime/hooks/useScreenTimeKids.d.ts +6 -0
- package/dist/modules/homepage/components/ScreenTime/hooks/useScreenTimeKids.js +25 -0
- package/dist/modules/homepage/components/ScreenTime/hooks/useScreenTimeModal.d.ts +31 -0
- package/dist/modules/homepage/components/ScreenTime/hooks/useScreenTimeModal.js +34 -0
- package/dist/modules/homepage/components/ScreenTime/index.d.ts +6 -0
- package/dist/modules/homepage/components/ScreenTime/services/api/index.d.ts +4 -0
- package/dist/modules/homepage/components/ScreenTime/services/api/index.js +5 -0
- package/dist/modules/homepage/components/ScreenTime/services/api/screenTimeService.d.ts +28 -0
- package/dist/modules/homepage/components/ScreenTime/services/api/screenTimeService.js +39 -0
- package/dist/modules/homepage/components/ScreenTime/services/queries/screenTime.d.ts +23 -0
- package/dist/modules/homepage/components/ScreenTime/services/queries/screenTime.js +41 -0
- package/dist/modules/homepage/components/ScreenTime/types.d.ts +30 -0
- package/dist/modules/homepage/components/ScreenTime/utils.d.ts +50 -0
- package/dist/modules/homepage/components/ScreenTime/utils.js +115 -0
- package/dist/modules/homepage/components/TabsKids/components/TabsKids.d.ts +43 -0
- package/dist/modules/homepage/components/TabsKids/components/TabsKids.js +23 -0
- package/dist/modules/homepage/components/TabsKids/components/TabsKidsItem.d.ts +34 -0
- package/dist/modules/homepage/components/TabsKids/components/TabsKidsItem.js +26 -0
- package/dist/modules/homepage/components/TabsKids/components/TabsKidsList.d.ts +14 -0
- package/dist/modules/homepage/components/TabsKids/components/TabsKidsList.js +64 -0
- package/dist/modules/homepage/components/TabsKids/hooks/useTabsKidsOverflow.d.ts +20 -0
- package/dist/modules/homepage/components/TabsKids/hooks/useTabsKidsOverflow.js +43 -0
- package/dist/modules/homepage/components/TabsKids/index.d.ts +3 -0
- package/dist/modules/homepage/components/TabsKids/utils/visibleTabs.d.ts +15 -0
- package/dist/modules/homepage/components/TabsKids/utils/visibleTabs.js +21 -0
- package/dist/modules/homepage/components/Universalis/Universalis.d.ts +8 -0
- package/dist/modules/homepage/components/Universalis/Universalis.js +62 -0
- package/dist/modules/homepage/components/Universalis/UniversalisContainer.d.ts +1 -0
- package/dist/modules/homepage/components/Universalis/UniversalisContainer.js +16 -0
- package/dist/modules/homepage/components/Universalis/index.d.ts +3 -0
- package/dist/modules/homepage/components/UsefulLinks/UsefulLinks.js +2 -2
- package/dist/modules/homepage/components/UsefulLinks/UsefulLinksModal.js +2 -2
- package/dist/modules/homepage/components/UserSpace/UserSpace.d.ts +3 -1
- package/dist/modules/homepage/components/UserSpace/UserSpace.js +13 -7
- package/dist/modules/homepage/components/UserSpace/UserSpaceContainer.d.ts +4 -2
- package/dist/modules/homepage/components/UserSpace/UserSpaceContainer.js +3 -2
- package/dist/modules/homepage/components/WidgetsPersonalizationPanel/WidgetToggle.d.ts +16 -0
- package/dist/modules/homepage/components/WidgetsPersonalizationPanel/WidgetToggle.js +15 -0
- package/dist/modules/homepage/components/WidgetsPersonalizationPanel/WidgetsPersonalizationPanel.d.ts +21 -0
- package/dist/modules/homepage/components/WidgetsPersonalizationPanel/WidgetsPersonalizationPanel.js +47 -0
- package/dist/modules/homepage/components/WidgetsPersonalizationPanel/index.d.ts +2 -0
- package/dist/modules/homepage/components/index.d.ts +15 -0
- package/dist/modules/homepage/{components/SchoolSpace → hooks}/useUserSchools.d.ts +2 -2
- package/dist/modules/homepage/{components/SchoolSpace → hooks}/useUserSchools.js +4 -4
- package/dist/modules/icons/components/IconAddWidget.d.ts +7 -0
- package/dist/modules/icons/components/IconAddWidget.js +12 -0
- package/dist/modules/icons/components/apps/IconAlloregion.d.ts +7 -0
- package/dist/modules/icons/components/apps/IconAlloregion.js +17 -0
- package/dist/modules/icons/components/apps/index.d.ts +1 -0
- package/dist/modules/icons/components/index.d.ts +1 -0
- package/dist/modules/multimedia/AudioRecorder/AudioRecorder.d.ts +2 -0
- package/dist/modules/multimedia/AudioRecorder/AudioRecorder.js +24 -10
- package/dist/modules/multimedia/AudioRecorder/AudioRecorderTimer.js +1 -1
- package/dist/modules/multimedia/AudioRecorder/useAudioRecorder.d.ts +1 -0
- package/dist/modules/multimedia/AudioRecorder/useAudioRecorder.js +89 -50
- package/dist/modules/multimedia/Nextcloud/Nextcloud.js +7 -19
- package/dist/modules/multimedia/Nextcloud/NextcloudLogin.d.ts +12 -0
- package/dist/modules/multimedia/Nextcloud/NextcloudLogin.js +33 -0
- package/dist/modules/multimedia/NextcloudFolders/NextcloudFolders.d.ts +12 -0
- package/dist/modules/multimedia/NextcloudFolders/NextcloudFolders.js +51 -0
- package/dist/modules/multimedia/NextcloudFolders/components/NewFolderForm.d.ts +16 -0
- package/dist/modules/multimedia/NextcloudFolders/components/NewFolderForm.js +52 -0
- package/dist/modules/multimedia/NextcloudFolders/index.d.ts +1 -0
- package/dist/modules/multimedia/VideoRecorder/VideoRecorder.d.ts +6 -0
- package/dist/modules/multimedia/VideoRecorder/VideoRecorder.js +53 -19
- package/dist/modules/multimedia/VideoRecorder/VideoRecorderToolbar.js +27 -27
- package/dist/modules/multimedia/VideoRecorder/useCameras.d.ts +2 -0
- package/dist/modules/multimedia/VideoRecorder/useCameras.js +10 -4
- package/dist/modules/multimedia/Workspace/Workspace.js +1 -1
- package/dist/modules/multimedia/index.d.ts +1 -0
- package/dist/multimedia.js +14 -12
- package/package.json +7 -6
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
|
-
import { useReducer, useRef, useEffect, useCallback } from "react";
|
|
2
|
+
import { useReducer, useRef, useState, useEffect, useCallback } from "react";
|
|
3
3
|
import { useTranslation } from "react-i18next";
|
|
4
4
|
import SvgIconLoader from "../../icons/components/IconLoader.js";
|
|
5
5
|
import SvgIconPause from "../../icons/components/IconPause.js";
|
|
@@ -36,7 +36,7 @@ function useAudioRecorder(onSaveSuccess, onUpdateRecord, hideSaveAction = !1, vi
|
|
|
36
36
|
recordTime: 0,
|
|
37
37
|
maxDuration: 180
|
|
38
38
|
// max duration in s (3 minutes by default)
|
|
39
|
-
}), audioNameRef = useRef(null), audioRef = useRef(null), leftChannelRef = useRef(), rightChannelRef = useRef(), {
|
|
39
|
+
}), audioNameRef = useRef(null), audioRef = useRef(null), leftChannelRef = useRef(), rightChannelRef = useRef(), [micError, setMicError] = useState(), {
|
|
40
40
|
t
|
|
41
41
|
} = useTranslation(), {
|
|
42
42
|
create
|
|
@@ -51,6 +51,22 @@ function useAudioRecorder(onSaveSuccess, onUpdateRecord, hideSaveAction = !1, vi
|
|
|
51
51
|
}), encoderWorker2.postMessage(["init", (audioContext == null ? void 0 : audioContext.sampleRate) || DEFAULT_SAMPLE_RATE]), () => {
|
|
52
52
|
closeAudioStream(), encoderWorker2.terminate();
|
|
53
53
|
};
|
|
54
|
+
}, []), useEffect(() => {
|
|
55
|
+
let cancelled = !1;
|
|
56
|
+
return (async () => {
|
|
57
|
+
var _a2;
|
|
58
|
+
try {
|
|
59
|
+
if (!((_a2 = navigator.mediaDevices) != null && _a2.getUserMedia))
|
|
60
|
+
throw new Error("Media devices are not available");
|
|
61
|
+
(await navigator.mediaDevices.getUserMedia({
|
|
62
|
+
audio: !0
|
|
63
|
+
})).getTracks().forEach((track) => track.stop());
|
|
64
|
+
} catch (err) {
|
|
65
|
+
console.error(err), cancelled || setMicError(err);
|
|
66
|
+
}
|
|
67
|
+
})(), () => {
|
|
68
|
+
cancelled = !0;
|
|
69
|
+
};
|
|
54
70
|
}, []);
|
|
55
71
|
const handleAudioWorkletNodeMessage = (event) => {
|
|
56
72
|
var _a2, _b;
|
|
@@ -60,9 +76,19 @@ function useAudioRecorder(onSaveSuccess, onUpdateRecord, hideSaveAction = !1, vi
|
|
|
60
76
|
}, closeAudioStream = useCallback(() => {
|
|
61
77
|
micStream == null || micStream.getTracks().forEach((track) => track.stop()), micStreamAudioSourceNode == null || micStreamAudioSourceNode.disconnect(), audioWorkletNode == null || audioWorkletNode.port.removeEventListener("message", handleAudioWorkletNodeMessage), audioWorkletNode == null || audioWorkletNode.port.close(), audioWorkletNode == null || audioWorkletNode.disconnect(), audioContext == null || audioContext.close();
|
|
62
78
|
}, [audioContext, audioWorkletNode, micStream, micStreamAudioSourceNode]), initRecording = async () => {
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
79
|
+
let micStream2;
|
|
80
|
+
try {
|
|
81
|
+
micStream2 = await navigator.mediaDevices.getUserMedia({
|
|
82
|
+
audio: !0
|
|
83
|
+
});
|
|
84
|
+
} catch (err) {
|
|
85
|
+
console.error(err), setMicError(err);
|
|
86
|
+
return;
|
|
87
|
+
}
|
|
88
|
+
micStream2.getTracks().forEach((track) => {
|
|
89
|
+
track.onended = () => setMicError(new Error("Track ended"));
|
|
90
|
+
});
|
|
91
|
+
const audioContext2 = new AudioContext({
|
|
66
92
|
sampleRate: DEFAULT_SAMPLE_RATE
|
|
67
93
|
}), micStreamAudioSourceNode2 = audioContext2.createMediaStreamSource(micStream2);
|
|
68
94
|
try {
|
|
@@ -147,22 +173,33 @@ function useAudioRecorder(onSaveSuccess, onUpdateRecord, hideSaveAction = !1, vi
|
|
|
147
173
|
}
|
|
148
174
|
}), new Promise((resolve, reject) => {
|
|
149
175
|
try {
|
|
150
|
-
encoderWorker && leftChannelRef.current && rightChannelRef.current
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
176
|
+
if (encoderWorker && leftChannelRef.current && rightChannelRef.current)
|
|
177
|
+
encoderWorker.postMessage(["mp3", rightChannelRef.current, leftChannelRef.current, rightChannelRef.current.length * BUFFER_SIZE]), encoderWorker.onmessage = async (event) => {
|
|
178
|
+
if (event.data instanceof Blob)
|
|
179
|
+
try {
|
|
180
|
+
const file = new File([event.data], audioName, {
|
|
181
|
+
type: "audio/mp3"
|
|
182
|
+
}), resourceAudio = await create(file, {
|
|
183
|
+
application,
|
|
184
|
+
visibility
|
|
185
|
+
});
|
|
186
|
+
resourceAudio && onSaveSuccess && onSaveSuccess(resourceAudio), dispatch({
|
|
187
|
+
type: "update",
|
|
188
|
+
updatedState: {
|
|
189
|
+
recordState: "SAVED"
|
|
190
|
+
}
|
|
191
|
+
}), resolve(resourceAudio);
|
|
192
|
+
} catch (error) {
|
|
193
|
+
dispatch({
|
|
194
|
+
type: "update",
|
|
195
|
+
updatedState: {
|
|
196
|
+
recordState: "RECORDED"
|
|
197
|
+
}
|
|
198
|
+
}), console.error("Error while saving", error), reject(error);
|
|
162
199
|
}
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
200
|
+
};
|
|
201
|
+
else
|
|
202
|
+
throw new Error("Audio encoder is not ready");
|
|
166
203
|
} catch (error) {
|
|
167
204
|
dispatch({
|
|
168
205
|
type: "update",
|
|
@@ -205,32 +242,33 @@ function useAudioRecorder(onSaveSuccess, onUpdateRecord, hideSaveAction = !1, vi
|
|
|
205
242
|
return () => window.clearInterval(timer);
|
|
206
243
|
}
|
|
207
244
|
}, [audioContext, handleRecordPause, maxDuration, recordState]);
|
|
208
|
-
const recordText = t(recordState === "IDLE" ? "bbm.audio.record.start" : "bbm.audio.record.resume"),
|
|
209
|
-
|
|
245
|
+
const recordText = t(recordState === "IDLE" ? "bbm.audio.record.start" : "bbm.audio.record.resume"), renderLabel = (label, disabled) => disabled ? void 0 : (
|
|
246
|
+
// Wrapped so the label can be hidden in narrow containers (see SCSS).
|
|
247
|
+
/* @__PURE__ */ jsx("span", { className: "audio-recorder-toolbar-label", children: label })
|
|
248
|
+
), isRecordDisabled = recordState !== "IDLE" && recordState !== "PAUSED" || recordTime >= maxDuration, isRecordPauseDisabled = recordState !== "RECORDING", isPlayDisabled = recordState !== "RECORDED" && recordState !== "PAUSED" && recordState !== "SAVED", isStopDisabled = playState !== "PLAYING" && playState !== "PAUSED", isResetDisabled = recordState !== "RECORDED" && recordState !== "PAUSED" && playState !== "PLAYING" && playState !== "PAUSED", isSaveDisabled = isResetDisabled || recordState === "SAVED" || !((_a = audioNameRef.current) != null && _a.value), toolbarItems = [{
|
|
249
|
+
type: "button",
|
|
210
250
|
name: "record",
|
|
211
251
|
visibility: recordState === "RECORDING" ? "hide" : "show",
|
|
212
252
|
props: {
|
|
213
|
-
|
|
253
|
+
leftIcon: /* @__PURE__ */ jsx(SvgIconRecord, {}),
|
|
214
254
|
color: "danger",
|
|
215
|
-
disabled:
|
|
255
|
+
disabled: isRecordDisabled,
|
|
216
256
|
onClick: handleRecord,
|
|
217
|
-
|
|
257
|
+
children: renderLabel(recordText, isRecordDisabled)
|
|
218
258
|
},
|
|
219
259
|
tooltip: recordText
|
|
220
260
|
}, {
|
|
221
|
-
type: "
|
|
261
|
+
type: "button",
|
|
222
262
|
name: "recordPause",
|
|
223
263
|
visibility: recordState === "RECORDING" ? "show" : "hide",
|
|
224
264
|
props: {
|
|
225
|
-
|
|
265
|
+
leftIcon: /* @__PURE__ */ jsx(SvgIconRecordPause, {}),
|
|
226
266
|
color: "danger",
|
|
227
|
-
disabled:
|
|
267
|
+
disabled: isRecordPauseDisabled,
|
|
228
268
|
onClick: handleRecordPause,
|
|
229
|
-
|
|
269
|
+
children: renderLabel(t("bbm.audio.record.pause"), isRecordPauseDisabled)
|
|
230
270
|
},
|
|
231
271
|
tooltip: t("bbm.audio.record.pause")
|
|
232
|
-
}, {
|
|
233
|
-
type: "divider"
|
|
234
272
|
}, {
|
|
235
273
|
type: "icon",
|
|
236
274
|
name: "encoding",
|
|
@@ -242,57 +280,57 @@ function useAudioRecorder(onSaveSuccess, onUpdateRecord, hideSaveAction = !1, vi
|
|
|
242
280
|
disabled: !0
|
|
243
281
|
}
|
|
244
282
|
}, {
|
|
245
|
-
type: "
|
|
283
|
+
type: "button",
|
|
246
284
|
name: "play",
|
|
247
285
|
visibility: isEncoding || playState === "PLAYING" ? "hide" : "show",
|
|
248
286
|
props: {
|
|
249
|
-
|
|
250
|
-
disabled:
|
|
287
|
+
leftIcon: /* @__PURE__ */ jsx(SvgIconPlayFilled, {}),
|
|
288
|
+
disabled: isPlayDisabled,
|
|
251
289
|
onClick: handlePlay,
|
|
252
|
-
|
|
290
|
+
children: renderLabel(t("bbm.audio.play.start"), isPlayDisabled)
|
|
253
291
|
},
|
|
254
292
|
tooltip: t("bbm.audio.play.start")
|
|
255
293
|
}, {
|
|
256
|
-
type: "
|
|
294
|
+
type: "button",
|
|
257
295
|
name: "playPause",
|
|
258
296
|
visibility: !isEncoding && playState === "PLAYING" ? "show" : "hide",
|
|
259
297
|
props: {
|
|
260
|
-
|
|
298
|
+
leftIcon: /* @__PURE__ */ jsx(SvgIconPause, {}),
|
|
261
299
|
onClick: handlePlayPause,
|
|
262
|
-
|
|
300
|
+
children: renderLabel(t("bbm.audio.play.pause"), !1)
|
|
263
301
|
},
|
|
264
302
|
tooltip: t("bbm.audio.play.pause")
|
|
265
303
|
}, {
|
|
266
|
-
type: "
|
|
304
|
+
type: "button",
|
|
267
305
|
name: "stop",
|
|
268
306
|
props: {
|
|
269
|
-
|
|
270
|
-
disabled:
|
|
307
|
+
leftIcon: /* @__PURE__ */ jsx(SvgIconRestart, {}),
|
|
308
|
+
disabled: isStopDisabled,
|
|
271
309
|
onClick: handlePlayStop,
|
|
272
|
-
|
|
310
|
+
children: renderLabel(t("bbm.audio.play.stop"), isStopDisabled)
|
|
273
311
|
},
|
|
274
312
|
tooltip: t("bbm.audio.play.stop")
|
|
275
313
|
}, {
|
|
276
314
|
type: "divider"
|
|
277
315
|
}, {
|
|
278
|
-
type: "
|
|
316
|
+
type: "button",
|
|
279
317
|
name: "reset",
|
|
280
318
|
props: {
|
|
281
|
-
|
|
282
|
-
disabled:
|
|
319
|
+
leftIcon: /* @__PURE__ */ jsx(SvgIconRefresh, {}),
|
|
320
|
+
disabled: isResetDisabled,
|
|
283
321
|
onClick: handleReset,
|
|
284
|
-
|
|
322
|
+
children: renderLabel(t("bbm.audio.record.reset"), isResetDisabled)
|
|
285
323
|
},
|
|
286
324
|
tooltip: t("bbm.audio.record.reset")
|
|
287
325
|
}, {
|
|
288
|
-
type: "
|
|
326
|
+
type: "button",
|
|
289
327
|
name: "save",
|
|
290
328
|
visibility: hideSaveAction ? "hide" : "show",
|
|
291
329
|
props: {
|
|
292
|
-
|
|
293
|
-
disabled:
|
|
330
|
+
leftIcon: /* @__PURE__ */ jsx(SvgIconSave, {}),
|
|
331
|
+
disabled: isSaveDisabled,
|
|
294
332
|
onClick: handleSave,
|
|
295
|
-
|
|
333
|
+
children: renderLabel(t("bbm.audio.record.save"), isSaveDisabled)
|
|
296
334
|
},
|
|
297
335
|
tooltip: t("bbm.audio.record.save")
|
|
298
336
|
}];
|
|
@@ -305,6 +343,7 @@ function useAudioRecorder(onSaveSuccess, onUpdateRecord, hideSaveAction = !1, vi
|
|
|
305
343
|
audioRef,
|
|
306
344
|
audioNameRef,
|
|
307
345
|
toolbarItems,
|
|
346
|
+
micError,
|
|
308
347
|
handlePlayEnded,
|
|
309
348
|
handleSave
|
|
310
349
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
2
|
+
import { useState, useCallback, useEffect, useMemo } from "react";
|
|
3
3
|
import { DocumentHelper } from "@edifice.io/client";
|
|
4
4
|
import clsx from "clsx";
|
|
5
5
|
import { useTranslation } from "react-i18next";
|
|
@@ -7,11 +7,10 @@ import { findNodeById } from "../../../components/Tree/utilities/tree.js";
|
|
|
7
7
|
import SvgIconSortAscendingLetters from "../../icons/components/IconSortAscendingLetters.js";
|
|
8
8
|
import SvgIconSortDescendingLetters from "../../icons/components/IconSortDescendingLetters.js";
|
|
9
9
|
import SvgIconSortTime from "../../icons/components/IconSortTime.js";
|
|
10
|
+
import NextcloudLogin from "./NextcloudLogin.js";
|
|
10
11
|
import illuError from "@edifice.io/bootstrap/dist/images/emptyscreen/illu-error.svg";
|
|
11
|
-
import illuConnectionLost from "@edifice.io/bootstrap/dist/images/emptyscreen/illu-connection-lost.svg";
|
|
12
12
|
import illuTrash from "@edifice.io/bootstrap/dist/images/emptyscreen/illu-trash.svg";
|
|
13
13
|
import useUser from "../../../hooks/useUser/useUser.js";
|
|
14
|
-
import useToast from "../../../hooks/useToast/useToast.js";
|
|
15
14
|
import useNextcloudSearch from "../../../hooks/useNextcloudSearch/useNextcloudSearch.js";
|
|
16
15
|
import LoadingScreen from "../../../components/LoadingScreen/LoadingScreen.js";
|
|
17
16
|
import Flex from "../../../components/Flex/Flex.js";
|
|
@@ -36,7 +35,7 @@ const Nextcloud = ({
|
|
|
36
35
|
t
|
|
37
36
|
} = useTranslation(), {
|
|
38
37
|
user
|
|
39
|
-
} = useUser(),
|
|
38
|
+
} = useUser(), {
|
|
40
39
|
root,
|
|
41
40
|
needsAuth,
|
|
42
41
|
isCheckingAuth,
|
|
@@ -44,7 +43,7 @@ const Nextcloud = ({
|
|
|
44
43
|
refetchAuthStatus,
|
|
45
44
|
loadContent,
|
|
46
45
|
loadError
|
|
47
|
-
} = useNextcloudSearch(ROOT_ID, t("nextcloud"), user == null ? void 0 : user.userId),
|
|
46
|
+
} = useNextcloudSearch(ROOT_ID, t("nextcloud"), user == null ? void 0 : user.userId), [currentNodeId, setCurrentNodeId] = useState(ROOT_ID), currentNode = findNodeById(root, currentNodeId) ?? root, [searchTerm, setSearchTerm] = useState(void 0), [sortOrder, setSortOrder] = useState(["modified", "desc"]), [selectedDocuments, setSelectedDocuments] = useState([]), handleTreeItemChange = useCallback((nodeId) => {
|
|
48
47
|
setCurrentNodeId(nodeId), loadContent(nodeId);
|
|
49
48
|
}, [loadContent]);
|
|
50
49
|
useEffect(() => {
|
|
@@ -69,22 +68,11 @@ const Nextcloud = ({
|
|
|
69
68
|
let currentDocuments = [...selectedDocuments];
|
|
70
69
|
multiple ? currentDocuments.some((selectedDocument) => selectedDocument.path === doc.path) ? currentDocuments = currentDocuments.filter((selectedDocument) => selectedDocument.path !== doc.path) : currentDocuments = [...currentDocuments, doc] : currentDocuments = [doc], setSelectedDocuments(currentDocuments), onSelect(currentDocuments);
|
|
71
70
|
}
|
|
72
|
-
const nextcloud = clsx("workspace flex-grow-1 gap-0", className)
|
|
73
|
-
|
|
74
|
-
};
|
|
75
|
-
return useEffect(() => {
|
|
76
|
-
function handleMessage(event) {
|
|
77
|
-
var _a;
|
|
78
|
-
event.origin !== window.location.origin || ((_a = event.data) == null ? void 0 : _a.type) !== "nextcloud-connected" || (popupRef.current && !popupRef.current.closed && popupRef.current.close(), refetchAuthStatus());
|
|
79
|
-
}
|
|
80
|
-
return window.addEventListener("message", handleMessage), () => window.removeEventListener("message", handleMessage);
|
|
81
|
-
}, [refetchAuthStatus]), isCheckingAuth ? /* @__PURE__ */ jsx(LoadingScreen, {}) : isAuthError ? /* @__PURE__ */ jsxs(Flex, { direction: "column", gap: "12", className: "h-full w-100", justify: "center", align: "center", children: [
|
|
71
|
+
const nextcloud = clsx("workspace flex-grow-1 gap-0", className);
|
|
72
|
+
return isCheckingAuth ? /* @__PURE__ */ jsx(LoadingScreen, {}) : isAuthError ? /* @__PURE__ */ jsxs(Flex, { direction: "column", gap: "12", className: "h-full w-100", justify: "center", align: "center", children: [
|
|
82
73
|
/* @__PURE__ */ jsx(EmptyScreen, { imageSrc: illuError, title: t("nextcloud.error.title"), text: t("nextcloud.error.description") }),
|
|
83
74
|
/* @__PURE__ */ jsx(Button, { onClick: () => refetchAuthStatus(), children: t("retry") })
|
|
84
|
-
] }) : needsAuth ? /* @__PURE__ */
|
|
85
|
-
/* @__PURE__ */ jsx(EmptyScreen, { imageSrc: illuConnectionLost, title: t("nextcloud.auth.title"), text: t("nextcloud.auth.description") }),
|
|
86
|
-
/* @__PURE__ */ jsx(Button, { onClick: openLoginPopup, children: t("nextcloud.auth.connect") })
|
|
87
|
-
] }) : /* @__PURE__ */ jsxs(Grid, { className: nextcloud, children: [
|
|
75
|
+
] }) : needsAuth ? /* @__PURE__ */ jsx(NextcloudLogin, { onConnected: refetchAuthStatus }) : /* @__PURE__ */ jsxs(Grid, { className: nextcloud, children: [
|
|
88
76
|
/* @__PURE__ */ jsx(Grid.Col, { sm: "12", md: "3", xl: "4", className: "workspace-folders p-12 pt-0 gap-12", children: /* @__PURE__ */ jsx("div", { style: {
|
|
89
77
|
position: "sticky",
|
|
90
78
|
top: 0,
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export interface NextcloudLoginProps {
|
|
2
|
+
/**
|
|
3
|
+
* Called once the user is connected through the OAuth2 popup.
|
|
4
|
+
*/
|
|
5
|
+
onConnected: () => void;
|
|
6
|
+
/**
|
|
7
|
+
* Replaces the default description, which is about inserting Nextcloud files.
|
|
8
|
+
*/
|
|
9
|
+
description?: string;
|
|
10
|
+
}
|
|
11
|
+
declare const NextcloudLogin: ({ onConnected, description }: NextcloudLoginProps) => import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
export default NextcloudLogin;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useRef, useEffect } from "react";
|
|
3
|
+
import { useTranslation } from "react-i18next";
|
|
4
|
+
import illuConnectionLost from "@edifice.io/bootstrap/dist/images/emptyscreen/illu-connection-lost.svg";
|
|
5
|
+
import useToast from "../../../hooks/useToast/useToast.js";
|
|
6
|
+
import Flex from "../../../components/Flex/Flex.js";
|
|
7
|
+
import EmptyScreen from "../../../components/EmptyScreen/EmptyScreen.js";
|
|
8
|
+
import Button from "../../../components/Button/Button.js";
|
|
9
|
+
const NextcloudLogin = ({
|
|
10
|
+
onConnected,
|
|
11
|
+
description
|
|
12
|
+
}) => {
|
|
13
|
+
const {
|
|
14
|
+
t
|
|
15
|
+
} = useTranslation(), toast = useToast(), popupRef = useRef(null);
|
|
16
|
+
useEffect(() => {
|
|
17
|
+
function handleMessage(event) {
|
|
18
|
+
var _a;
|
|
19
|
+
event.origin !== window.location.origin || ((_a = event.data) == null ? void 0 : _a.type) !== "nextcloud-connected" || (popupRef.current && !popupRef.current.closed && popupRef.current.close(), onConnected());
|
|
20
|
+
}
|
|
21
|
+
return window.addEventListener("message", handleMessage), () => window.removeEventListener("message", handleMessage);
|
|
22
|
+
}, [onConnected]);
|
|
23
|
+
const openLoginPopup = () => {
|
|
24
|
+
popupRef.current = window.open(`${window.location.origin}/nextcloud/user/oauth2/init`, "", "popup, height=600, width=400"), popupRef.current || toast.error(t("nextcloud.auth.popupBlocked"));
|
|
25
|
+
};
|
|
26
|
+
return /* @__PURE__ */ jsxs(Flex, { direction: "column", gap: "12", className: "h-full w-100", justify: "center", align: "center", children: [
|
|
27
|
+
/* @__PURE__ */ jsx(EmptyScreen, { imageSrc: illuConnectionLost, title: t("nextcloud.auth.title"), text: description ?? t("nextcloud.auth.description") }),
|
|
28
|
+
/* @__PURE__ */ jsx(Button, { onClick: openLoginPopup, children: t("nextcloud.auth.connect") })
|
|
29
|
+
] });
|
|
30
|
+
};
|
|
31
|
+
export {
|
|
32
|
+
NextcloudLogin as default
|
|
33
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
interface NextcloudFoldersProps {
|
|
2
|
+
/**
|
|
3
|
+
* Function called with the path of the selected folder, relative to the user's Nextcloud root
|
|
4
|
+
*/
|
|
5
|
+
onFolderSelected: (path: string) => void;
|
|
6
|
+
/**
|
|
7
|
+
* Description of the login screen shown when the user is not connected to Nextcloud
|
|
8
|
+
*/
|
|
9
|
+
loginDescription?: string;
|
|
10
|
+
}
|
|
11
|
+
export default function NextcloudFolders({ onFolderSelected, loginDescription, }: NextcloudFoldersProps): import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
export {};
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useState, useEffect } from "react";
|
|
3
|
+
import { useTranslation } from "react-i18next";
|
|
4
|
+
import SvgIconFolderAdd from "../../icons/components/IconFolderAdd.js";
|
|
5
|
+
import NextcloudLogin from "../Nextcloud/NextcloudLogin.js";
|
|
6
|
+
import NewFolderForm from "./components/NewFolderForm.js";
|
|
7
|
+
import illuError from "@edifice.io/bootstrap/dist/images/emptyscreen/illu-error.svg";
|
|
8
|
+
import useUser from "../../../hooks/useUser/useUser.js";
|
|
9
|
+
import useNextcloudSearch from "../../../hooks/useNextcloudSearch/useNextcloudSearch.js";
|
|
10
|
+
import Loading from "../../../components/Loading/Loading.js";
|
|
11
|
+
import Flex from "../../../components/Flex/Flex.js";
|
|
12
|
+
import EmptyScreen from "../../../components/EmptyScreen/EmptyScreen.js";
|
|
13
|
+
import Button from "../../../components/Button/Button.js";
|
|
14
|
+
import Tree from "../../../components/Tree/components/Tree.js";
|
|
15
|
+
const ROOT_ID = "root", ROOT_PATH = "/";
|
|
16
|
+
function NextcloudFolders({
|
|
17
|
+
onFolderSelected,
|
|
18
|
+
loginDescription
|
|
19
|
+
}) {
|
|
20
|
+
const {
|
|
21
|
+
t
|
|
22
|
+
} = useTranslation(), {
|
|
23
|
+
user
|
|
24
|
+
} = useUser(), {
|
|
25
|
+
root,
|
|
26
|
+
needsAuth,
|
|
27
|
+
isCheckingAuth,
|
|
28
|
+
isAuthError,
|
|
29
|
+
refetchAuthStatus,
|
|
30
|
+
loadContent,
|
|
31
|
+
loadError
|
|
32
|
+
} = useNextcloudSearch(ROOT_ID, t("nextcloud"), user == null ? void 0 : user.userId), [selectedFolderId, setSelectedFolderId] = useState(), [showNewFolderForm, setShowNewFolderForm] = useState(!1), selectedPath = selectedFolderId === ROOT_ID ? ROOT_PATH : selectedFolderId;
|
|
33
|
+
useEffect(() => {
|
|
34
|
+
needsAuth || loadContent(ROOT_ID);
|
|
35
|
+
}, [loadContent, needsAuth]);
|
|
36
|
+
const handleFolderSelected = (folderId) => {
|
|
37
|
+
setShowNewFolderForm(!1), setSelectedFolderId(folderId), loadContent(folderId), onFolderSelected(folderId === ROOT_ID ? ROOT_PATH : folderId);
|
|
38
|
+
}, handleFolderCreated = async (path) => {
|
|
39
|
+
await loadContent(selectedFolderId, !0), setSelectedFolderId(path), onFolderSelected(path);
|
|
40
|
+
}, handleRetry = () => isAuthError ? refetchAuthStatus() : loadContent(selectedFolderId ?? ROOT_ID, !0);
|
|
41
|
+
return isCheckingAuth ? /* @__PURE__ */ jsx(Loading, { isLoading: !0, className: "justify-content-center" }) : isAuthError || loadError ? /* @__PURE__ */ jsxs(Flex, { direction: "column", gap: "12", align: "center", children: [
|
|
42
|
+
/* @__PURE__ */ jsx(EmptyScreen, { imageSrc: illuError, title: t("nextcloud.error.title"), text: t("nextcloud.error.description") }),
|
|
43
|
+
/* @__PURE__ */ jsx(Button, { onClick: handleRetry, children: t("retry") })
|
|
44
|
+
] }) : needsAuth ? /* @__PURE__ */ jsx(NextcloudLogin, { onConnected: refetchAuthStatus, description: loginDescription }) : /* @__PURE__ */ jsxs("div", { className: "border border-gray-400 rounded", children: [
|
|
45
|
+
/* @__PURE__ */ jsx("div", { className: "p-12", children: /* @__PURE__ */ jsx(Tree, { nodes: root, selectedNodeId: selectedFolderId, showIcon: !0, onTreeItemClick: handleFolderSelected, onTreeItemUnfold: (nodeId) => loadContent(nodeId) }) }),
|
|
46
|
+
/* @__PURE__ */ jsx("div", { className: "d-flex justify-content-end border-top border-gray-400 px-8 py-4", children: showNewFolderForm && selectedPath ? /* @__PURE__ */ jsx(NewFolderForm, { parentPath: selectedPath, onClose: () => setShowNewFolderForm(!1), onFolderCreated: handleFolderCreated }) : /* @__PURE__ */ jsx(Button, { color: "primary", variant: "ghost", leftIcon: /* @__PURE__ */ jsx(SvgIconFolderAdd, {}), onClick: () => setShowNewFolderForm(!0), disabled: !selectedPath, children: t("workspace.folder.create") }) })
|
|
47
|
+
] });
|
|
48
|
+
}
|
|
49
|
+
export {
|
|
50
|
+
NextcloudFolders as default
|
|
51
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
type Props = {
|
|
2
|
+
/**
|
|
3
|
+
* Path of the folder in which the new folder is created
|
|
4
|
+
*/
|
|
5
|
+
parentPath: string;
|
|
6
|
+
/**
|
|
7
|
+
* Function called when the form is closed
|
|
8
|
+
*/
|
|
9
|
+
onClose: () => void;
|
|
10
|
+
/**
|
|
11
|
+
* Function called with the path of the created folder
|
|
12
|
+
*/
|
|
13
|
+
onFolderCreated: (path: string) => void;
|
|
14
|
+
};
|
|
15
|
+
export default function NewFolderForm({ parentPath, onClose, onFolderCreated, }: Props): import("react/jsx-runtime").JSX.Element;
|
|
16
|
+
export {};
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useRef, useEffect } from "react";
|
|
3
|
+
import { odeServices } from "@edifice.io/client";
|
|
4
|
+
import { useMutation } from "@tanstack/react-query";
|
|
5
|
+
import { useTranslation } from "react-i18next";
|
|
6
|
+
import SvgIconSave from "../../../icons/components/IconSave.js";
|
|
7
|
+
import useUser from "../../../../hooks/useUser/useUser.js";
|
|
8
|
+
import useToast from "../../../../hooks/useToast/useToast.js";
|
|
9
|
+
import FormControl from "../../../../components/Form/FormControl.js";
|
|
10
|
+
import IconButton from "../../../../components/Button/IconButton.js";
|
|
11
|
+
function NewFolderForm({
|
|
12
|
+
parentPath,
|
|
13
|
+
onClose,
|
|
14
|
+
onFolderCreated
|
|
15
|
+
}) {
|
|
16
|
+
const {
|
|
17
|
+
t
|
|
18
|
+
} = useTranslation(), {
|
|
19
|
+
user
|
|
20
|
+
} = useUser(), toast = useToast(), refInputName = useRef(null), createFolderMutation = useMutation({
|
|
21
|
+
mutationFn: ({
|
|
22
|
+
userId,
|
|
23
|
+
path
|
|
24
|
+
}) => odeServices.nextcloud().createFolder(userId, path)
|
|
25
|
+
});
|
|
26
|
+
return useEffect(() => {
|
|
27
|
+
var _a;
|
|
28
|
+
(_a = refInputName.current) == null || _a.focus();
|
|
29
|
+
}, []), /* @__PURE__ */ jsx("form", { id: "modalNextcloudNewFolderForm", onSubmit: (event) => {
|
|
30
|
+
var _a;
|
|
31
|
+
event.preventDefault();
|
|
32
|
+
const folderName = (_a = refInputName.current) == null ? void 0 : _a.value.trim().replace(/[/\\]/g, "-");
|
|
33
|
+
if (!folderName || folderName === "." || folderName === ".." || !user)
|
|
34
|
+
return;
|
|
35
|
+
const path = `${parentPath.replace(/\/?$/, "/")}${folderName}/`;
|
|
36
|
+
createFolderMutation.mutate({
|
|
37
|
+
userId: user.userId,
|
|
38
|
+
path
|
|
39
|
+
}, {
|
|
40
|
+
onSuccess: () => {
|
|
41
|
+
onFolderCreated(path), onClose();
|
|
42
|
+
},
|
|
43
|
+
onError: () => toast.error(t("e400"))
|
|
44
|
+
});
|
|
45
|
+
}, children: /* @__PURE__ */ jsxs("div", { className: "d-flex gap-4 flex-row", children: [
|
|
46
|
+
/* @__PURE__ */ jsx(FormControl, { id: "modalNextcloudNewFolderForm", isRequired: !0, children: /* @__PURE__ */ jsx(FormControl.Input, { ref: refInputName, size: "md", type: "text", placeholder: t("workspace.folder.new.placeholder"), "aria-label": t("workspace.folder.new.placeholder") }) }),
|
|
47
|
+
/* @__PURE__ */ jsx(IconButton, { type: "submit", color: "primary", variant: "ghost", title: t("workspace.folder.new.create"), disabled: createFolderMutation.isPending, isLoading: createFolderMutation.isPending, icon: /* @__PURE__ */ jsx(SvgIconSave, {}) })
|
|
48
|
+
] }) });
|
|
49
|
+
}
|
|
50
|
+
export {
|
|
51
|
+
NewFolderForm as default
|
|
52
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as NextcloudFolders } from './NextcloudFolders';
|
|
@@ -1,11 +1,17 @@
|
|
|
1
1
|
import { WorkspaceElement } from '@edifice.io/client';
|
|
2
2
|
export interface VideoRecorderProps {
|
|
3
3
|
appCode: string;
|
|
4
|
+
/**
|
|
5
|
+
* @deprecated Not part of the recorder design anymore, will be removed in
|
|
6
|
+
* a future major version.
|
|
7
|
+
*/
|
|
4
8
|
caption?: string;
|
|
5
9
|
onSuccess?: (res: WorkspaceElement[]) => void;
|
|
6
10
|
onError: (error: string) => void;
|
|
7
11
|
onRecordUpdated?: (recordURL?: string) => void;
|
|
8
12
|
hideSaveAction?: boolean;
|
|
13
|
+
/** Called with the record name each time the user edits it. */
|
|
14
|
+
onNameChange?: (name: string) => void;
|
|
9
15
|
}
|
|
10
16
|
export interface VideoRecorderRef {
|
|
11
17
|
save: () => Promise<WorkspaceElement | undefined>;
|