@edifice.io/react 2.6.12-develop-b2school.20261103144351 → 2.6.12-develop-integration-crna.20261104164618
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 +3 -0
- package/dist/components/Dropdown/DropdownItem.js +1 -17
- package/dist/components/Dropdown/DropdownMenuGroup.js +23 -6
- package/dist/components/Dropdown/DropdownSearchInput.js +16 -8
- package/dist/components/Dropdown/DropdownTrigger.js +24 -8
- package/dist/components/Dropdown/useDropdownItemFilter.js +2 -2
- package/dist/components/Dropdown/useMatchRegistry.d.ts +5 -0
- package/dist/components/Dropdown/useMatchRegistry.js +20 -0
- package/dist/components/Layout/Layout.js +4 -12
- package/dist/components/SearchBar/SearchBar.js +26 -17
- 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 +5 -2
- package/dist/components/Tree/components/Tree.js +7 -10
- package/dist/components/Tree/hooks/useTree.d.ts +0 -1
- package/dist/components/Tree/hooks/useTree.js +2 -6
- package/dist/components/Tree/types/index.d.ts +0 -7
- package/dist/components/index.d.ts +0 -1
- package/dist/homepage.js +24 -97
- package/dist/hooks/useDropdown/useDropdown.d.ts +1 -0
- package/dist/hooks/useDropdown/useDropdown.js +19 -8
- package/dist/hooks/useNextcloudSearch/useNextcloudSearch.d.ts +1 -1
- package/dist/hooks/useNextcloudSearch/useNextcloudSearch.js +2 -2
- package/dist/hooks/useZendeskGuide/useZendeskGuide.d.ts +6 -2
- package/dist/hooks/useZendeskGuide/useZendeskGuide.js +8 -11
- package/dist/icons.js +404 -406
- package/dist/index.js +158 -158
- package/dist/modules/HelpZone/HelpZone.js +8 -6
- package/dist/modules/HelpZone/HelpZoneContainer.js +5 -2
- package/dist/modules/editor/components/Editor/Editor.d.ts +0 -5
- package/dist/modules/editor/components/Editor/Editor.js +0 -3
- package/dist/modules/homepage/components/Favorites/Favorites.js +1 -4
- package/dist/modules/homepage/components/Header/Header.js +21 -9
- package/dist/modules/homepage/components/HomeCard/HomeCardHeader.d.ts +1 -5
- package/dist/modules/homepage/components/HomeCard/HomeCardHeader.js +1 -1
- package/dist/modules/homepage/components/Notifications/NotificationList.js +8 -7
- package/dist/modules/homepage/components/Notifications/NotificationListSkeleton.js +12 -7
- package/dist/modules/homepage/components/Notifications/NotificationSkeleton.js +4 -7
- package/dist/modules/homepage/components/Notifications/components/NotificationFilterModal.js +13 -11
- package/dist/modules/homepage/components/Notifications/components/ReportNotificationModal.js +12 -6
- package/dist/modules/homepage/components/Notifications/components/notificationAdapter.js +10 -12
- package/dist/modules/homepage/components/Notifications/hooks/useNotificationList.js +10 -9
- package/dist/modules/homepage/components/SchoolSpace/SchoolSpaceContainer.js +1 -1
- package/dist/modules/homepage/{hooks → components/SchoolSpace}/useUserSchools.d.ts +2 -2
- package/dist/modules/homepage/{hooks → components/SchoolSpace}/useUserSchools.js +4 -4
- 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 +1 -3
- package/dist/modules/homepage/components/UserSpace/UserSpace.js +7 -13
- package/dist/modules/homepage/components/UserSpace/UserSpaceContainer.d.ts +2 -4
- package/dist/modules/homepage/components/UserSpace/UserSpaceContainer.js +2 -3
- package/dist/modules/homepage/components/index.d.ts +1 -12
- package/dist/modules/icons/components/index.d.ts +0 -1
- package/dist/modules/icons/components/nav/IconCommunitiesBeta.js +7 -5
- package/dist/modules/icons/components/nav/IconHomeBeta.js +3 -6
- package/dist/modules/icons/components/nav/IconMessagesBeta.js +7 -7
- package/dist/modules/icons/components/nav/IconMyAppsBeta.js +3 -2
- package/dist/modules/icons/components/nav/IconNotificationBeta.js +4 -2
- 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 +51 -0
- package/dist/modules/multimedia/NextcloudFolders/index.d.ts +1 -0
- 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 +6 -7
- package/dist/components/Masonry/Masonry.d.ts +0 -40
- package/dist/components/Masonry/Masonry.js +0 -50
- package/dist/components/Masonry/index.d.ts +0 -2
- package/dist/modules/homepage/components/Agenda/Agenda.d.ts +0 -10
- package/dist/modules/homepage/components/Agenda/Agenda.js +0 -54
- package/dist/modules/homepage/components/Agenda/AgendaContainer.d.ts +0 -1
- package/dist/modules/homepage/components/Agenda/AgendaContainer.js +0 -14
- package/dist/modules/homepage/components/Agenda/AgendaEventCard.d.ts +0 -10
- package/dist/modules/homepage/components/Agenda/AgendaEventCard.js +0 -30
- package/dist/modules/homepage/components/Agenda/hooks/useAgendaContainer.d.ts +0 -14
- package/dist/modules/homepage/components/Agenda/hooks/useAgendaContainer.js +0 -27
- package/dist/modules/homepage/components/Agenda/index.d.ts +0 -3
- package/dist/modules/homepage/components/Agenda/services/api/agendaService.d.ts +0 -24
- package/dist/modules/homepage/components/Agenda/services/api/agendaService.js +0 -45
- package/dist/modules/homepage/components/Agenda/services/api/index.d.ts +0 -4
- package/dist/modules/homepage/components/Agenda/services/api/index.js +0 -5
- package/dist/modules/homepage/components/Agenda/services/queries/agenda.d.ts +0 -19
- package/dist/modules/homepage/components/Agenda/services/queries/agenda.js +0 -26
- package/dist/modules/homepage/components/BriefMe/BriefMe.d.ts +0 -9
- package/dist/modules/homepage/components/BriefMe/BriefMe.js +0 -59
- package/dist/modules/homepage/components/BriefMe/BriefMeContainer.d.ts +0 -4
- package/dist/modules/homepage/components/BriefMe/BriefMeContainer.js +0 -17
- package/dist/modules/homepage/components/BriefMe/index.d.ts +0 -4
- package/dist/modules/homepage/components/BriefMe/types.d.ts +0 -17
- package/dist/modules/homepage/components/BriefMe/types.js +0 -8
- package/dist/modules/homepage/components/BriefMe/useBriefMe.d.ts +0 -31
- package/dist/modules/homepage/components/BriefMe/useBriefMe.js +0 -51
- package/dist/modules/homepage/components/Cantine/Cantine.d.ts +0 -7
- package/dist/modules/homepage/components/Cantine/Cantine.js +0 -44
- package/dist/modules/homepage/components/Cantine/CantineContainer.d.ts +0 -4
- package/dist/modules/homepage/components/Cantine/CantineContainer.js +0 -18
- package/dist/modules/homepage/components/Cantine/CantineModal.d.ts +0 -24
- package/dist/modules/homepage/components/Cantine/CantineModal.js +0 -88
- package/dist/modules/homepage/components/Cantine/CantineModalContainer.d.ts +0 -7
- package/dist/modules/homepage/components/Cantine/CantineModalContainer.js +0 -12
- package/dist/modules/homepage/components/Cantine/components/CantineLegend.d.ts +0 -5
- package/dist/modules/homepage/components/Cantine/components/CantineLegend.js +0 -22
- package/dist/modules/homepage/components/Cantine/components/CantineMenuSection.d.ts +0 -6
- package/dist/modules/homepage/components/Cantine/components/CantineMenuSection.js +0 -28
- package/dist/modules/homepage/components/Cantine/components/cantineLabels.d.ts +0 -12
- package/dist/modules/homepage/components/Cantine/components/cantineLabels.js +0 -60
- package/dist/modules/homepage/components/Cantine/hooks/useCantine.d.ts +0 -11
- package/dist/modules/homepage/components/Cantine/hooks/useCantine.js +0 -20
- package/dist/modules/homepage/components/Cantine/hooks/useCantineMenu.d.ts +0 -24
- package/dist/modules/homepage/components/Cantine/hooks/useCantineMenu.js +0 -65
- package/dist/modules/homepage/components/Cantine/hooks/useCantineModal.d.ts +0 -23
- package/dist/modules/homepage/components/Cantine/hooks/useCantineModal.js +0 -43
- package/dist/modules/homepage/components/Cantine/index.d.ts +0 -7
- package/dist/modules/homepage/components/Cantine/types.d.ts +0 -42
- package/dist/modules/homepage/components/Edumalin/Edumalin.d.ts +0 -9
- package/dist/modules/homepage/components/Edumalin/Edumalin.js +0 -65
- package/dist/modules/homepage/components/Edumalin/EdumalinContainer.d.ts +0 -4
- package/dist/modules/homepage/components/Edumalin/EdumalinContainer.js +0 -21
- package/dist/modules/homepage/components/Edumalin/EdumalinModal.d.ts +0 -8
- package/dist/modules/homepage/components/Edumalin/EdumalinModal.js +0 -62
- package/dist/modules/homepage/components/Edumalin/components/EdumalinBadge.d.ts +0 -5
- package/dist/modules/homepage/components/Edumalin/components/EdumalinBadge.js +0 -38
- package/dist/modules/homepage/components/Edumalin/components/EdumalinPicture.d.ts +0 -5
- package/dist/modules/homepage/components/Edumalin/components/EdumalinPicture.js +0 -12
- package/dist/modules/homepage/components/Edumalin/index.d.ts +0 -7
- package/dist/modules/homepage/components/Edumalin/types.d.ts +0 -24
- package/dist/modules/homepage/components/Edumalin/types.js +0 -4
- package/dist/modules/homepage/components/Edumalin/useEdumalin.d.ts +0 -16
- package/dist/modules/homepage/components/Edumalin/useEdumalin.js +0 -35
- package/dist/modules/homepage/components/Edumalin/utils.d.ts +0 -28
- package/dist/modules/homepage/components/Edumalin/utils.js +0 -56
- package/dist/modules/homepage/components/GenerationHdf/GenerationHdf.d.ts +0 -16
- package/dist/modules/homepage/components/GenerationHdf/GenerationHdf.js +0 -65
- package/dist/modules/homepage/components/GenerationHdf/GenerationHdfContainer.d.ts +0 -4
- package/dist/modules/homepage/components/GenerationHdf/GenerationHdfContainer.js +0 -12
- package/dist/modules/homepage/components/GenerationHdf/formatSolde.d.ts +0 -1
- package/dist/modules/homepage/components/GenerationHdf/formatSolde.js +0 -6
- package/dist/modules/homepage/components/GenerationHdf/index.d.ts +0 -3
- package/dist/modules/homepage/components/GenerationHdf/useGenerationHdf.d.ts +0 -10
- package/dist/modules/homepage/components/GenerationHdf/useGenerationHdf.js +0 -69
- package/dist/modules/homepage/components/Qwant/Qwant.d.ts +0 -4
- package/dist/modules/homepage/components/Qwant/Qwant.js +0 -41
- package/dist/modules/homepage/components/Qwant/QwantContainer.d.ts +0 -1
- package/dist/modules/homepage/components/Qwant/QwantContainer.js +0 -10
- package/dist/modules/homepage/components/Qwant/index.d.ts +0 -3
- package/dist/modules/homepage/components/Rss/Rss.d.ts +0 -11
- package/dist/modules/homepage/components/Rss/Rss.js +0 -64
- package/dist/modules/homepage/components/Rss/RssContainer.d.ts +0 -1
- package/dist/modules/homepage/components/Rss/RssContainer.js +0 -45
- package/dist/modules/homepage/components/Rss/RssFeedForm.d.ts +0 -13
- package/dist/modules/homepage/components/Rss/RssFeedForm.js +0 -69
- package/dist/modules/homepage/components/Rss/RssFeedsModal.d.ts +0 -11
- package/dist/modules/homepage/components/Rss/RssFeedsModal.js +0 -58
- package/dist/modules/homepage/components/Rss/hooks/useRssContainer.d.ts +0 -25
- package/dist/modules/homepage/components/Rss/hooks/useRssContainer.js +0 -43
- package/dist/modules/homepage/components/Rss/index.d.ts +0 -6
- package/dist/modules/homepage/components/Rss/services/api/index.d.ts +0 -5
- package/dist/modules/homepage/components/Rss/services/api/index.js +0 -5
- package/dist/modules/homepage/components/Rss/services/api/rssService.d.ts +0 -38
- package/dist/modules/homepage/components/Rss/services/api/rssService.js +0 -51
- package/dist/modules/homepage/components/Rss/services/queries/rss.d.ts +0 -28
- package/dist/modules/homepage/components/Rss/services/queries/rss.js +0 -71
- package/dist/modules/homepage/components/Rss/types.d.ts +0 -25
- package/dist/modules/homepage/components/Rss/utils.d.ts +0 -7
- package/dist/modules/homepage/components/Rss/utils.js +0 -19
- package/dist/modules/homepage/components/ScreenTime/ScreenTime.d.ts +0 -11
- package/dist/modules/homepage/components/ScreenTime/ScreenTime.js +0 -49
- package/dist/modules/homepage/components/ScreenTime/ScreenTimeChart.d.ts +0 -10
- package/dist/modules/homepage/components/ScreenTime/ScreenTimeChart.js +0 -115
- package/dist/modules/homepage/components/ScreenTime/ScreenTimeContainer.d.ts +0 -1
- package/dist/modules/homepage/components/ScreenTime/ScreenTimeContainer.js +0 -25
- package/dist/modules/homepage/components/ScreenTime/ScreenTimeError.d.ts +0 -5
- package/dist/modules/homepage/components/ScreenTime/ScreenTimeError.js +0 -22
- package/dist/modules/homepage/components/ScreenTime/ScreenTimeModal.d.ts +0 -22
- package/dist/modules/homepage/components/ScreenTime/ScreenTimeModal.js +0 -81
- package/dist/modules/homepage/components/ScreenTime/hooks/useScreenTimeContainer.d.ts +0 -14
- package/dist/modules/homepage/components/ScreenTime/hooks/useScreenTimeContainer.js +0 -22
- package/dist/modules/homepage/components/ScreenTime/hooks/useScreenTimeKids.d.ts +0 -6
- package/dist/modules/homepage/components/ScreenTime/hooks/useScreenTimeKids.js +0 -25
- package/dist/modules/homepage/components/ScreenTime/hooks/useScreenTimeModal.d.ts +0 -31
- package/dist/modules/homepage/components/ScreenTime/hooks/useScreenTimeModal.js +0 -34
- package/dist/modules/homepage/components/ScreenTime/index.d.ts +0 -6
- package/dist/modules/homepage/components/ScreenTime/services/api/index.d.ts +0 -4
- package/dist/modules/homepage/components/ScreenTime/services/api/index.js +0 -5
- package/dist/modules/homepage/components/ScreenTime/services/api/screenTimeService.d.ts +0 -28
- package/dist/modules/homepage/components/ScreenTime/services/api/screenTimeService.js +0 -39
- package/dist/modules/homepage/components/ScreenTime/services/queries/screenTime.d.ts +0 -23
- package/dist/modules/homepage/components/ScreenTime/services/queries/screenTime.js +0 -41
- package/dist/modules/homepage/components/ScreenTime/types.d.ts +0 -30
- package/dist/modules/homepage/components/ScreenTime/utils.d.ts +0 -50
- package/dist/modules/homepage/components/ScreenTime/utils.js +0 -115
- package/dist/modules/homepage/components/TabsKids/components/TabsKids.d.ts +0 -43
- package/dist/modules/homepage/components/TabsKids/components/TabsKids.js +0 -23
- package/dist/modules/homepage/components/TabsKids/components/TabsKidsItem.d.ts +0 -34
- package/dist/modules/homepage/components/TabsKids/components/TabsKidsItem.js +0 -26
- package/dist/modules/homepage/components/TabsKids/components/TabsKidsList.d.ts +0 -14
- package/dist/modules/homepage/components/TabsKids/components/TabsKidsList.js +0 -64
- package/dist/modules/homepage/components/TabsKids/hooks/useTabsKidsOverflow.d.ts +0 -20
- package/dist/modules/homepage/components/TabsKids/hooks/useTabsKidsOverflow.js +0 -43
- package/dist/modules/homepage/components/TabsKids/index.d.ts +0 -3
- package/dist/modules/homepage/components/TabsKids/utils/visibleTabs.d.ts +0 -15
- package/dist/modules/homepage/components/TabsKids/utils/visibleTabs.js +0 -21
- package/dist/modules/homepage/components/Universalis/Universalis.d.ts +0 -8
- package/dist/modules/homepage/components/Universalis/Universalis.js +0 -62
- package/dist/modules/homepage/components/Universalis/UniversalisContainer.d.ts +0 -1
- package/dist/modules/homepage/components/Universalis/UniversalisContainer.js +0 -16
- package/dist/modules/homepage/components/Universalis/index.d.ts +0 -3
- package/dist/modules/homepage/components/WidgetsPersonalizationPanel/WidgetToggle.d.ts +0 -16
- package/dist/modules/homepage/components/WidgetsPersonalizationPanel/WidgetToggle.js +0 -15
- package/dist/modules/homepage/components/WidgetsPersonalizationPanel/WidgetsPersonalizationPanel.d.ts +0 -21
- package/dist/modules/homepage/components/WidgetsPersonalizationPanel/WidgetsPersonalizationPanel.js +0 -47
- package/dist/modules/homepage/components/WidgetsPersonalizationPanel/index.d.ts +0 -2
- package/dist/modules/icons/components/IconAddWidget.d.ts +0 -7
- package/dist/modules/icons/components/IconAddWidget.js +0 -12
|
@@ -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 = (path) => {
|
|
39
|
+
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,51 @@
|
|
|
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 || !user) return;
|
|
34
|
+
const path = `${parentPath.replace(/\/?$/, "/")}${folderName}/`;
|
|
35
|
+
createFolderMutation.mutate({
|
|
36
|
+
userId: user.userId,
|
|
37
|
+
path
|
|
38
|
+
}, {
|
|
39
|
+
onSuccess: () => {
|
|
40
|
+
onFolderCreated(path), onClose();
|
|
41
|
+
},
|
|
42
|
+
onError: () => toast.error(t("e400"))
|
|
43
|
+
});
|
|
44
|
+
}, children: /* @__PURE__ */ jsxs("div", { className: "d-flex gap-4 flex-row", children: [
|
|
45
|
+
/* @__PURE__ */ jsx(FormControl, { id: "modalNextcloudNewFolderForm", isRequired: !0, children: /* @__PURE__ */ jsx(FormControl.Input, { ref: refInputName, size: "md", type: "text", placeholder: t("workspace.folder.new.placeholder") }) }),
|
|
46
|
+
/* @__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, {}) })
|
|
47
|
+
] }) });
|
|
48
|
+
}
|
|
49
|
+
export {
|
|
50
|
+
NewFolderForm as default
|
|
51
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as NextcloudFolders } from './NextcloudFolders';
|
|
@@ -150,7 +150,7 @@ const WORKSPACE_VIEW_WORKFLOW = "org.entcore.workspace.controllers.WorkspaceCont
|
|
|
150
150
|
] }) }),
|
|
151
151
|
/* @__PURE__ */ jsx(Grid.Col, { sm: "12", md: "5", xl: "8", children: /* @__PURE__ */ jsxs(Grid, { className: "flex-grow-1 gap-0", children: [
|
|
152
152
|
/* @__PURE__ */ jsxs(Grid.Col, { sm: "4", md: "8", xl: "12", children: [
|
|
153
|
-
/* @__PURE__ */ jsx("div", { className: "workspace-search px-16 py-8 ", children: /* @__PURE__ */ jsx(SearchBar, { isVariant: !0, onChange: handleSearchChange }) }),
|
|
153
|
+
/* @__PURE__ */ jsx("div", { className: "workspace-search px-16 py-8 ", children: /* @__PURE__ */ jsx(SearchBar, { isVariant: !0, className: "gap-16", onChange: handleSearchChange }) }),
|
|
154
154
|
/* @__PURE__ */ jsxs("div", { className: "d-flex align-items-center justify-content-end px-8 py-4", children: [
|
|
155
155
|
/* @__PURE__ */ jsx("small", { className: "text-muted", children: t("workspace.search.order") }),
|
|
156
156
|
/* @__PURE__ */ jsxs(Dropdown, { children: [
|
package/dist/multimedia.js
CHANGED
|
@@ -6,12 +6,13 @@ import { default as default6 } from "./modules/multimedia/ImagePicker/ImagePicke
|
|
|
6
6
|
import { default as default7 } from "./modules/multimedia/MediaLibrary/MediaLibrary.js";
|
|
7
7
|
import { default as default8 } from "./modules/multimedia/Nextcloud/Nextcloud.js";
|
|
8
8
|
import { default as default9 } from "./modules/multimedia/FileCard/NextcloudFileCard.js";
|
|
9
|
-
import { default as default10 } from "./modules/multimedia/
|
|
10
|
-
import { default as default11 } from "./modules/multimedia/
|
|
11
|
-
import { default as default12 } from "./modules/multimedia/
|
|
12
|
-
import { default as default13 } from "./modules/multimedia/
|
|
13
|
-
import { default as default14 } from "./modules/multimedia/
|
|
14
|
-
import { default as default15 } from "./modules/multimedia/
|
|
9
|
+
import { default as default10 } from "./modules/multimedia/NextcloudFolders/NextcloudFolders.js";
|
|
10
|
+
import { default as default11 } from "./modules/multimedia/UploadCard/UploadCard.js";
|
|
11
|
+
import { default as default12 } from "./modules/multimedia/UploadFiles/UploadFiles.js";
|
|
12
|
+
import { default as default13 } from "./modules/multimedia/VideoEmbed/VideoEmbed.js";
|
|
13
|
+
import { default as default14 } from "./modules/multimedia/VideoRecorder/VideoRecorder.js";
|
|
14
|
+
import { default as default15 } from "./modules/multimedia/Workspace/Workspace.js";
|
|
15
|
+
import { default as default16 } from "./modules/multimedia/WorkspaceFolders/WorkspaceFolders.js";
|
|
15
16
|
import { ExternalLinker } from "./modules/multimedia/Linker/ExternalLinker/ExternalLinker.js";
|
|
16
17
|
import { InternalLinker } from "./modules/multimedia/Linker/InternalLinker/InternalLinker.js";
|
|
17
18
|
import { Upload } from "./modules/multimedia/MediaLibrary/innertabs/Upload.js";
|
|
@@ -26,11 +27,12 @@ export {
|
|
|
26
27
|
default7 as MediaLibrary,
|
|
27
28
|
default8 as Nextcloud,
|
|
28
29
|
default9 as NextcloudFileCard,
|
|
30
|
+
default10 as NextcloudFolders,
|
|
29
31
|
Upload,
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
32
|
+
default11 as UploadCard,
|
|
33
|
+
default12 as UploadFiles,
|
|
34
|
+
default13 as VideoEmbed,
|
|
35
|
+
default14 as VideoRecorder,
|
|
36
|
+
default15 as Workspace,
|
|
37
|
+
default16 as WorkspaceFolders
|
|
36
38
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@edifice.io/react",
|
|
3
|
-
"version": "2.6.12-develop-
|
|
3
|
+
"version": "2.6.12-develop-integration-crna.20261104164618",
|
|
4
4
|
"description": "Edifice React Library",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react",
|
|
@@ -124,7 +124,6 @@
|
|
|
124
124
|
"@tiptap/starter-kit": "2.11.0",
|
|
125
125
|
"@uidotdev/usehooks": "2.4.1",
|
|
126
126
|
"antd": "5.29.1",
|
|
127
|
-
"chart.js": "4.5.1",
|
|
128
127
|
"clsx": "2.1.1",
|
|
129
128
|
"dayjs": "1.11.19",
|
|
130
129
|
"emoji-picker-react": "4.17.4",
|
|
@@ -141,9 +140,9 @@
|
|
|
141
140
|
"swiper": "10.1.0",
|
|
142
141
|
"ua-parser-js": "1.0.36",
|
|
143
142
|
"zustand": "4.5.7",
|
|
144
|
-
"@edifice.io/
|
|
145
|
-
"@edifice.io/
|
|
146
|
-
"@edifice.io/
|
|
143
|
+
"@edifice.io/bootstrap": "2.6.12-develop-integration-crna.20261104164618",
|
|
144
|
+
"@edifice.io/tiptap-extensions": "2.6.12-develop-integration-crna.20261104164618",
|
|
145
|
+
"@edifice.io/utilities": "2.6.12-develop-integration-crna.20261104164618"
|
|
147
146
|
},
|
|
148
147
|
"devDependencies": {
|
|
149
148
|
"@babel/plugin-transform-react-pure-annotations": "7.27.1",
|
|
@@ -175,8 +174,8 @@
|
|
|
175
174
|
"vite": "5.4.14",
|
|
176
175
|
"vite-plugin-dts": "4.5.4",
|
|
177
176
|
"vite-tsconfig-paths": "5.1.4",
|
|
178
|
-
"@edifice.io/
|
|
179
|
-
"@edifice.io/
|
|
177
|
+
"@edifice.io/client": "2.6.12-develop-integration-crna.20261104164618",
|
|
178
|
+
"@edifice.io/config": "2.6.12-develop-integration-crna.20261104164618"
|
|
180
179
|
},
|
|
181
180
|
"peerDependencies": {
|
|
182
181
|
"@react-spring/web": "9.7.5",
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import { HTMLAttributes, ReactNode } from 'react';
|
|
2
|
-
export interface MasonryItemProps {
|
|
3
|
-
/**
|
|
4
|
-
* Number of columns the item spans (capped to the number of columns).
|
|
5
|
-
* @default 1
|
|
6
|
-
*/
|
|
7
|
-
span?: number;
|
|
8
|
-
children: ReactNode;
|
|
9
|
-
}
|
|
10
|
-
export interface MasonryProps extends HTMLAttributes<HTMLDivElement> {
|
|
11
|
-
/**
|
|
12
|
-
* Items to lay out. Each child is one masonry item, in reading order.
|
|
13
|
-
*/
|
|
14
|
-
children: ReactNode;
|
|
15
|
-
/**
|
|
16
|
-
* Number of columns. Each column takes an equal share of the available
|
|
17
|
-
* width, gap excluded.
|
|
18
|
-
* @default 2
|
|
19
|
-
*/
|
|
20
|
-
columns?: number;
|
|
21
|
-
/**
|
|
22
|
-
* Gap between columns and between items, as a spacing token (e.g. `16`).
|
|
23
|
-
* @default '16'
|
|
24
|
-
*/
|
|
25
|
-
gap?: string;
|
|
26
|
-
/**
|
|
27
|
-
* Optional class for styling purpose
|
|
28
|
-
*/
|
|
29
|
-
className?: string;
|
|
30
|
-
}
|
|
31
|
-
export declare const Masonry: {
|
|
32
|
-
({ children, columns, gap, className, style, ...restProps }: MasonryProps): import("react/jsx-runtime").JSX.Element;
|
|
33
|
-
displayName: string;
|
|
34
|
-
} & {
|
|
35
|
-
Item: {
|
|
36
|
-
({ children }: MasonryItemProps): import("react/jsx-runtime").JSX.Element;
|
|
37
|
-
displayName: string;
|
|
38
|
-
};
|
|
39
|
-
};
|
|
40
|
-
export default Masonry;
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
import { jsx, Fragment } from "react/jsx-runtime";
|
|
2
|
-
import { useRef, useState, Children, useCallback, useLayoutEffect, isValidElement } from "react";
|
|
3
|
-
import clsx from "clsx";
|
|
4
|
-
const MasonryItem = ({
|
|
5
|
-
children
|
|
6
|
-
}) => /* @__PURE__ */ jsx(Fragment, { children }), Root = ({
|
|
7
|
-
children,
|
|
8
|
-
columns = 2,
|
|
9
|
-
gap = "16",
|
|
10
|
-
className,
|
|
11
|
-
style,
|
|
12
|
-
...restProps
|
|
13
|
-
}) => {
|
|
14
|
-
const columnCount = Math.max(1, Math.floor(columns)), gridRef = useRef(null), itemRefs = useRef(/* @__PURE__ */ new Map()), [spans, setSpans] = useState({}), items = Children.toArray(children), measure = useCallback(() => {
|
|
15
|
-
const grid = gridRef.current;
|
|
16
|
-
if (!grid) return;
|
|
17
|
-
const rowGap = parseFloat(getComputedStyle(grid).columnGap) || 0, next = {};
|
|
18
|
-
itemRefs.current.forEach((el, key) => {
|
|
19
|
-
next[key] = Math.ceil(el.getBoundingClientRect().height + rowGap);
|
|
20
|
-
}), setSpans((prev) => {
|
|
21
|
-
const keys = Object.keys(next);
|
|
22
|
-
return keys.length === Object.keys(prev).length && keys.every((key) => prev[key] === next[key]) ? prev : next;
|
|
23
|
-
});
|
|
24
|
-
}, []);
|
|
25
|
-
return useLayoutEffect(() => {
|
|
26
|
-
if (measure(), typeof ResizeObserver > "u") return;
|
|
27
|
-
const observer = new ResizeObserver(measure);
|
|
28
|
-
return gridRef.current && observer.observe(gridRef.current), itemRefs.current.forEach((el) => observer.observe(el)), () => observer.disconnect();
|
|
29
|
-
}, [measure, columnCount, items.length]), /* @__PURE__ */ jsx("div", { ref: gridRef, className: clsx("masonry", `column-gap-${gap}`, className), style: {
|
|
30
|
-
display: "grid",
|
|
31
|
-
gridTemplateColumns: `repeat(${columnCount}, minmax(0, 1fr))`,
|
|
32
|
-
gridAutoRows: "1px",
|
|
33
|
-
alignItems: "start",
|
|
34
|
-
...style
|
|
35
|
-
}, ...restProps, children: items.map((item, index) => {
|
|
36
|
-
const key = String(item.key ?? index), span = /* @__PURE__ */ isValidElement(item) && item.type === MasonryItem ? Math.min(Math.max(1, Math.floor(item.props.span ?? 1)), columnCount) : 1;
|
|
37
|
-
return /* @__PURE__ */ jsx("div", { ref: (el) => {
|
|
38
|
-
el ? itemRefs.current.set(key, el) : itemRefs.current.delete(key);
|
|
39
|
-
}, className: "masonry__item", "data-testid": `masonry-item-${index}`, style: {
|
|
40
|
-
gridColumn: `span ${span}`,
|
|
41
|
-
gridRowEnd: `span ${spans[key] ?? 1}`
|
|
42
|
-
}, children: item }, key);
|
|
43
|
-
}) });
|
|
44
|
-
}, Masonry = Object.assign(Root, {
|
|
45
|
-
Item: MasonryItem
|
|
46
|
-
});
|
|
47
|
-
export {
|
|
48
|
-
Masonry,
|
|
49
|
-
Masonry as default
|
|
50
|
-
};
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { CalendarEvent } from '@edifice.io/client';
|
|
2
|
-
export interface AgendaProps {
|
|
3
|
-
events: CalendarEvent[];
|
|
4
|
-
onEventClick?: (event: CalendarEvent) => void;
|
|
5
|
-
onOpenAgendaClick?: () => void;
|
|
6
|
-
}
|
|
7
|
-
export declare const Agenda: {
|
|
8
|
-
({ events, onEventClick, onOpenAgendaClick, }: AgendaProps): import("react/jsx-runtime").JSX.Element;
|
|
9
|
-
displayName: string;
|
|
10
|
-
};
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
|
-
import { useMemo } from "react";
|
|
3
|
-
import { useTranslation } from "react-i18next";
|
|
4
|
-
import illuEmptyAgenda from "@edifice.io/bootstrap/dist/images/homepage/illu-empty-agenda.svg";
|
|
5
|
-
import SvgIconExternalLink from "../../../icons/components/IconExternalLink.js";
|
|
6
|
-
import HomeCard from "../HomeCard/HomeCard.js";
|
|
7
|
-
import { AgendaEventCard } from "./AgendaEventCard.js";
|
|
8
|
-
import useDate from "../../../../hooks/useDate/useDate.js";
|
|
9
|
-
import Flex from "../../../../components/Flex/Flex.js";
|
|
10
|
-
const capitalize = (value) => value.charAt(0).toUpperCase() + value.slice(1), Agenda = ({
|
|
11
|
-
events,
|
|
12
|
-
onEventClick,
|
|
13
|
-
onOpenAgendaClick = () => window.open("/calendar", "_self")
|
|
14
|
-
}) => {
|
|
15
|
-
const {
|
|
16
|
-
t
|
|
17
|
-
} = useTranslation(), {
|
|
18
|
-
formatDate,
|
|
19
|
-
dateIsSame
|
|
20
|
-
} = useDate(), dayGroups = useMemo(() => {
|
|
21
|
-
const now = (/* @__PURE__ */ new Date()).toISOString();
|
|
22
|
-
return events.reduce((groups, event) => {
|
|
23
|
-
const lastGroup = groups[groups.length - 1];
|
|
24
|
-
return lastGroup && dateIsSame(lastGroup.date, event.startMoment, "day") ? (lastGroup.events.push(event), groups) : (groups.push({
|
|
25
|
-
key: event.id,
|
|
26
|
-
date: event.startMoment,
|
|
27
|
-
weekday: capitalize(formatDate(event.startMoment, "ddd")),
|
|
28
|
-
day: formatDate(event.startMoment, "D"),
|
|
29
|
-
month: dateIsSame(event.startMoment, now, "month") ? void 0 : formatDate(event.startMoment, "MMM"),
|
|
30
|
-
events: [event]
|
|
31
|
-
}), groups);
|
|
32
|
-
}, []);
|
|
33
|
-
}, [events, dateIsSame, formatDate]);
|
|
34
|
-
return /* @__PURE__ */ jsxs(HomeCard, { variant: "primary", children: [
|
|
35
|
-
/* @__PURE__ */ jsx(HomeCard.Header, { title: t("homepage.agenda.title"), actionLeftIcon: /* @__PURE__ */ jsx(SvgIconExternalLink, { width: "20", height: "20" }), onActionClick: onOpenAgendaClick, actionProps: {
|
|
36
|
-
"aria-label": t("homepage.agenda.openAgenda"),
|
|
37
|
-
"data-testid": "agenda-button-open"
|
|
38
|
-
} }),
|
|
39
|
-
/* @__PURE__ */ jsx(HomeCard.Content, { children: dayGroups.length === 0 ? /* @__PURE__ */ jsxs(Flex, { direction: "column", align: "center", gap: "8", className: "agenda-empty", children: [
|
|
40
|
-
/* @__PURE__ */ jsx("img", { src: illuEmptyAgenda, alt: "", width: 64, height: 64 }),
|
|
41
|
-
/* @__PURE__ */ jsx("span", { className: "agenda-empty-text", children: t("homepage.agenda.empty") })
|
|
42
|
-
] }) : /* @__PURE__ */ jsx(Flex, { direction: "column", gap: "8", className: "agenda-content", children: dayGroups.map((group) => /* @__PURE__ */ jsxs(Flex, { gap: "4", className: "agenda-day-group", "data-testid": "agenda-day-group", children: [
|
|
43
|
-
/* @__PURE__ */ jsxs(Flex, { direction: "column", align: "center", className: "agenda-day-group-date", children: [
|
|
44
|
-
/* @__PURE__ */ jsx("span", { children: group.weekday }),
|
|
45
|
-
/* @__PURE__ */ jsx("span", { className: "agenda-day-group-date-number", children: group.day }),
|
|
46
|
-
group.month && /* @__PURE__ */ jsx("span", { children: group.month })
|
|
47
|
-
] }),
|
|
48
|
-
/* @__PURE__ */ jsx(Flex, { direction: "column", gap: "8", className: "agenda-day-group-events", children: group.events.map((event) => /* @__PURE__ */ jsx(AgendaEventCard, { event, onClick: () => onEventClick == null ? void 0 : onEventClick(event) }, event.id)) })
|
|
49
|
-
] }, group.key)) }) })
|
|
50
|
-
] });
|
|
51
|
-
};
|
|
52
|
-
export {
|
|
53
|
-
Agenda
|
|
54
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function AgendaContainer(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { jsx } from "react/jsx-runtime";
|
|
2
|
-
import { Agenda } from "./Agenda.js";
|
|
3
|
-
import { useAgendaContainer } from "./hooks/useAgendaContainer.js";
|
|
4
|
-
function AgendaContainer() {
|
|
5
|
-
const {
|
|
6
|
-
events
|
|
7
|
-
} = useAgendaContainer();
|
|
8
|
-
return /* @__PURE__ */ jsx(Agenda, { events, onEventClick: () => {
|
|
9
|
-
window.open("/calendar", "_self");
|
|
10
|
-
} });
|
|
11
|
-
}
|
|
12
|
-
export {
|
|
13
|
-
AgendaContainer
|
|
14
|
-
};
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { CalendarEvent } from '@edifice.io/client';
|
|
2
|
-
import { MouseEventHandler } from 'react';
|
|
3
|
-
export interface AgendaEventCardProps {
|
|
4
|
-
event: CalendarEvent;
|
|
5
|
-
onClick?: MouseEventHandler<HTMLButtonElement>;
|
|
6
|
-
}
|
|
7
|
-
export declare const AgendaEventCard: {
|
|
8
|
-
({ event, onClick }: AgendaEventCardProps): import("react/jsx-runtime").JSX.Element;
|
|
9
|
-
displayName: string;
|
|
10
|
-
};
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
|
-
import { useTranslation } from "react-i18next";
|
|
3
|
-
import SvgIconClock from "../../../icons/components/IconClock.js";
|
|
4
|
-
import useDate from "../../../../hooks/useDate/useDate.js";
|
|
5
|
-
import Flex from "../../../../components/Flex/Flex.js";
|
|
6
|
-
const capitalize = (value) => value.charAt(0).toUpperCase() + value.slice(1), AgendaEventCard = ({
|
|
7
|
-
event,
|
|
8
|
-
onClick
|
|
9
|
-
}) => {
|
|
10
|
-
const {
|
|
11
|
-
t
|
|
12
|
-
} = useTranslation(), {
|
|
13
|
-
formatDate,
|
|
14
|
-
dateIsSame
|
|
15
|
-
} = useDate(), formatTime = (date) => formatDate(date, "HH[h]mm"), timeLabel = event.allDay ? t("homepage.agenda.allDay") : dateIsSame(event.startMoment, event.endMoment, "day") ? `${formatTime(event.startMoment)} - ${formatTime(event.endMoment)}` : t("homepage.agenda.multiDayTime", {
|
|
16
|
-
startTime: formatTime(event.startMoment),
|
|
17
|
-
endDay: capitalize(formatDate(event.endMoment, "ddd D")),
|
|
18
|
-
endTime: formatTime(event.endMoment)
|
|
19
|
-
});
|
|
20
|
-
return /* @__PURE__ */ jsxs("button", { type: "button", className: "agenda-event-card", onClick, "data-testid": "agenda-event-card", children: [
|
|
21
|
-
/* @__PURE__ */ jsxs(Flex, { align: "center", gap: "8", className: "agenda-event-card-time", children: [
|
|
22
|
-
/* @__PURE__ */ jsx(SvgIconClock, { width: "20", height: "20" }),
|
|
23
|
-
/* @__PURE__ */ jsx("span", { children: timeLabel })
|
|
24
|
-
] }),
|
|
25
|
-
/* @__PURE__ */ jsx("p", { className: "agenda-event-card-title", children: event.title })
|
|
26
|
-
] });
|
|
27
|
-
};
|
|
28
|
-
export {
|
|
29
|
-
AgendaEventCard
|
|
30
|
-
};
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { CalendarEvent } from '@edifice.io/client';
|
|
2
|
-
/** Number of upcoming events shown by the widget. */
|
|
3
|
-
export declare const MAX_VISIBLE_EVENTS = 3;
|
|
4
|
-
export interface UseAgendaContainerReturn {
|
|
5
|
-
events: CalendarEvent[];
|
|
6
|
-
isLoading: boolean;
|
|
7
|
-
error: Error | null;
|
|
8
|
-
}
|
|
9
|
-
/**
|
|
10
|
-
* Loads the current user's calendars, then their events, and keeps only the
|
|
11
|
-
* next `MAX_VISIBLE_EVENTS` events that haven't fully elapsed yet — an event
|
|
12
|
-
* still in progress (end date in the future) counts as "upcoming" too.
|
|
13
|
-
*/
|
|
14
|
-
export declare const useAgendaContainer: () => UseAgendaContainerReturn;
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import dayjs from "dayjs";
|
|
2
|
-
import { useMemo } from "react";
|
|
3
|
-
import { useCalendars, useEvents } from "../services/queries/agenda.js";
|
|
4
|
-
const MAX_VISIBLE_EVENTS = 3, useAgendaContainer = () => {
|
|
5
|
-
const {
|
|
6
|
-
data: calendars,
|
|
7
|
-
isLoading: isLoadingCalendars,
|
|
8
|
-
error: calendarsError
|
|
9
|
-
} = useCalendars(), calendarIds = useMemo(() => (calendars == null ? void 0 : calendars.map((calendar) => calendar.id)) ?? [], [calendars]), {
|
|
10
|
-
data: rawEvents,
|
|
11
|
-
isLoading: isLoadingEvents,
|
|
12
|
-
error: eventsError
|
|
13
|
-
} = useEvents(calendarIds, MAX_VISIBLE_EVENTS);
|
|
14
|
-
return {
|
|
15
|
-
events: useMemo(() => {
|
|
16
|
-
if (!rawEvents) return [];
|
|
17
|
-
const now = dayjs();
|
|
18
|
-
return rawEvents.filter((event) => dayjs(event.endMoment).isAfter(now)).sort((a, b) => dayjs(a.startMoment).diff(dayjs(b.startMoment))).slice(0, MAX_VISIBLE_EVENTS);
|
|
19
|
-
}, [rawEvents]),
|
|
20
|
-
isLoading: isLoadingCalendars || isLoadingEvents,
|
|
21
|
-
error: calendarsError ?? eventsError
|
|
22
|
-
};
|
|
23
|
-
};
|
|
24
|
-
export {
|
|
25
|
-
MAX_VISIBLE_EVENTS,
|
|
26
|
-
useAgendaContainer
|
|
27
|
-
};
|