@edifice.io/react 2.6.12-develop-b2school.20261102112143 → 2.6.12-develop-integration.20261103121816
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/DropdownItem.js +1 -17
- package/dist/components/Layout/Layout.js +4 -12
- package/dist/components/SearchBar/SearchBar.js +26 -17
- 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 +28 -87
- package/dist/hooks/index.d.ts +1 -0
- package/dist/hooks/useDropdown/useDropdown.js +2 -2
- package/dist/hooks/useGoogleDriveSearch/index.d.ts +1 -0
- package/dist/hooks/useGoogleDriveSearch/useGoogleDriveSearch.d.ts +19 -0
- package/dist/hooks/useGoogleDriveSearch/useGoogleDriveSearch.js +60 -0
- package/dist/hooks/useZendeskGuide/useZendeskGuide.d.ts +6 -2
- package/dist/hooks/useZendeskGuide/useZendeskGuide.js +8 -11
- package/dist/icons-apps.js +184 -182
- package/dist/icons.js +404 -406
- package/dist/index.js +198 -194
- 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 +7 -5
- package/dist/modules/editor/components/Editor/Editor.js +3 -5
- package/dist/modules/editor/components/EditorToolbar/EditorToolbar.d.ts +3 -1
- package/dist/modules/editor/components/EditorToolbar/EditorToolbar.js +14 -8
- package/dist/modules/editor/components/NodeView/ImageNodeView.d.ts +1 -1
- package/dist/modules/editor/components/NodeView/ImageNodeView.js +14 -7
- package/dist/modules/editor/hooks/useActionOptions.d.ts +1 -1
- package/dist/modules/editor/hooks/useActionOptions.js +12 -12
- package/dist/modules/editor/hooks/useTipTapEditor.d.ts +2 -1
- package/dist/modules/editor/hooks/useTipTapEditor.js +2 -2
- package/dist/modules/homepage/components/AlloLycee/AlloLycee.d.ts +11 -0
- package/dist/modules/homepage/components/AlloLycee/AlloLycee.js +32 -0
- package/dist/modules/homepage/components/AlloLycee/AlloLyceeContainer.d.ts +4 -0
- package/dist/modules/homepage/components/AlloLycee/AlloLyceeContainer.js +10 -0
- package/dist/modules/homepage/components/AlloLycee/index.d.ts +3 -0
- 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/CommonNotificationItem.js +9 -9
- 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.d.ts +2 -1
- package/dist/modules/homepage/components/Notifications/components/notificationAdapter.js +12 -14
- 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 +2 -11
- package/dist/modules/icons/components/apps/IconElea.d.ts +7 -0
- package/dist/modules/icons/components/apps/IconElea.js +23 -0
- package/dist/modules/icons/components/apps/index.d.ts +1 -0
- 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/FileCard/GoogleDriveFileCard.d.ts +25 -0
- package/dist/modules/multimedia/FileCard/GoogleDriveFileCard.js +102 -0
- package/dist/modules/multimedia/FileCard/index.d.ts +2 -0
- package/dist/modules/multimedia/GoogleDrive/GoogleDrive.d.ts +24 -0
- package/dist/modules/multimedia/GoogleDrive/GoogleDrive.js +103 -0
- package/dist/modules/multimedia/GoogleDrive/index.d.ts +2 -0
- package/dist/modules/multimedia/Linker/InternalLinker/InternalLinker.d.ts +7 -1
- package/dist/modules/multimedia/Linker/InternalLinker/InternalLinker.js +2 -0
- package/dist/modules/multimedia/MediaLibrary/MediaLibrary.js +16 -5
- package/dist/modules/multimedia/MediaLibrary/innertabs/GoogleDrive.d.ts +1 -0
- package/dist/modules/multimedia/MediaLibrary/innertabs/GoogleDrive.js +61 -0
- package/dist/modules/multimedia/MediaLibrary/innertabs/index.d.ts +1 -0
- package/dist/modules/multimedia/MediaLibrary/innertabs/index.js +2 -0
- package/dist/modules/multimedia/Workspace/Workspace.js +1 -1
- package/dist/modules/multimedia/index.d.ts +1 -0
- package/dist/multimedia.js +26 -22
- package/package.json +6 -6
- 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/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
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { GoogleDriveDocument, Role } from '@edifice.io/client';
|
|
2
|
+
/**
|
|
3
|
+
* GoogleDrive component properties
|
|
4
|
+
*/
|
|
5
|
+
export interface GoogleDriveProps {
|
|
6
|
+
/**
|
|
7
|
+
* Notify parent when media elements are successfully selected.
|
|
8
|
+
*/
|
|
9
|
+
onSelect: (result: GoogleDriveDocument[]) => void;
|
|
10
|
+
/**
|
|
11
|
+
* Boolean to know if we can select 1 or many files.
|
|
12
|
+
*/
|
|
13
|
+
multiple?: boolean | undefined;
|
|
14
|
+
/**
|
|
15
|
+
* Document roles to filter files by; null (default) shows all roles.
|
|
16
|
+
*/
|
|
17
|
+
roles?: Role | Role[] | null;
|
|
18
|
+
/**
|
|
19
|
+
* Optional class for styling purpose
|
|
20
|
+
*/
|
|
21
|
+
className?: string;
|
|
22
|
+
}
|
|
23
|
+
declare const GoogleDrive: ({ onSelect, multiple, roles, className, }: GoogleDriveProps) => import("react/jsx-runtime").JSX.Element;
|
|
24
|
+
export default GoogleDrive;
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useState, useEffect, useMemo, useCallback } from "react";
|
|
3
|
+
import { DocumentHelper } from "@edifice.io/client";
|
|
4
|
+
import clsx from "clsx";
|
|
5
|
+
import { useTranslation } from "react-i18next";
|
|
6
|
+
import { findNodeById } from "../../../components/Tree/utilities/tree.js";
|
|
7
|
+
import SvgIconSortAscendingLetters from "../../icons/components/IconSortAscendingLetters.js";
|
|
8
|
+
import SvgIconSortDescendingLetters from "../../icons/components/IconSortDescendingLetters.js";
|
|
9
|
+
import SvgIconSortTime from "../../icons/components/IconSortTime.js";
|
|
10
|
+
import illuError from "@edifice.io/bootstrap/dist/images/emptyscreen/illu-error.svg";
|
|
11
|
+
import illuTrash from "@edifice.io/bootstrap/dist/images/emptyscreen/illu-trash.svg";
|
|
12
|
+
import useUser from "../../../hooks/useUser/useUser.js";
|
|
13
|
+
import useGoogleDriveSearch from "../../../hooks/useGoogleDriveSearch/useGoogleDriveSearch.js";
|
|
14
|
+
import { Grid } from "../../../components/Grid/Grid.js";
|
|
15
|
+
import Tree from "../../../components/Tree/components/Tree.js";
|
|
16
|
+
import SearchBar from "../../../components/SearchBar/SearchBar.js";
|
|
17
|
+
import Flex from "../../../components/Flex/Flex.js";
|
|
18
|
+
import Dropdown from "../../../components/Dropdown/Dropdown.js";
|
|
19
|
+
import EmptyScreen from "../../../components/EmptyScreen/EmptyScreen.js";
|
|
20
|
+
import Button from "../../../components/Button/Button.js";
|
|
21
|
+
import LoadingScreen from "../../../components/LoadingScreen/LoadingScreen.js";
|
|
22
|
+
import GoogleDriveFileCard from "../FileCard/GoogleDriveFileCard.js";
|
|
23
|
+
const ROOT_ID = "root", SHARED_ROOT_ID = "shared";
|
|
24
|
+
function compare(a, b) {
|
|
25
|
+
return a === b ? 0 : a === void 0 ? -1 : b === void 0 ? 1 : a.localeCompare(b);
|
|
26
|
+
}
|
|
27
|
+
const GoogleDrive = ({
|
|
28
|
+
onSelect,
|
|
29
|
+
multiple = !0,
|
|
30
|
+
roles,
|
|
31
|
+
className
|
|
32
|
+
}) => {
|
|
33
|
+
const {
|
|
34
|
+
t
|
|
35
|
+
} = useTranslation(), {
|
|
36
|
+
user
|
|
37
|
+
} = useUser(), myDrive = useGoogleDriveSearch(ROOT_ID, t("google-drive.mydrive"), user == null ? void 0 : user.userId), sharedWithMe = useGoogleDriveSearch(SHARED_ROOT_ID, t("workspace.tree.shared"), user == null ? void 0 : user.userId, "shared"), [currentNodeId, setCurrentNodeId] = useState(ROOT_ID), sectionOf = (nodeId) => findNodeById(sharedWithMe.root, nodeId) ? sharedWithMe : myDrive, {
|
|
38
|
+
root,
|
|
39
|
+
loadContent,
|
|
40
|
+
loadError
|
|
41
|
+
} = sectionOf(currentNodeId), currentNode = findNodeById(root, currentNodeId) ?? root, [searchTerm, setSearchTerm] = useState(void 0), [sortOrder, setSortOrder] = useState(["modified", "desc"]), [selectedDocuments, setSelectedDocuments] = useState([]), handleTreeItemChange = (nodeId) => {
|
|
42
|
+
setCurrentNodeId(nodeId), sectionOf(nodeId).loadContent(nodeId);
|
|
43
|
+
}, loadMyDrive = myDrive.loadContent;
|
|
44
|
+
useEffect(() => {
|
|
45
|
+
loadMyDrive(ROOT_ID);
|
|
46
|
+
}, [loadMyDrive]);
|
|
47
|
+
const documents = useMemo(() => {
|
|
48
|
+
if (!currentNode.files) return;
|
|
49
|
+
const matchesRole = (doc) => {
|
|
50
|
+
if (!roles) return !0;
|
|
51
|
+
const role = DocumentHelper.role(doc.contentType, !1);
|
|
52
|
+
return Array.isArray(roles) ? roles.includes(role) : roles === role;
|
|
53
|
+
}, normalizedSearchTerm = searchTerm == null ? void 0 : searchTerm.toLowerCase(), list = currentNode.files.filter((f) => (
|
|
54
|
+
// A document that can't leave Google Drive could never be added.
|
|
55
|
+
f.canCopyToWorkspace && (!normalizedSearchTerm || f.name.toLowerCase().includes(normalizedSearchTerm)) && matchesRole(f)
|
|
56
|
+
));
|
|
57
|
+
let sortFunction;
|
|
58
|
+
return sortOrder[0] === "name" ? sortFunction = sortOrder[1] === "asc" ? (a, b) => compare(a.name, b.name) : (a, b) => compare(b.name, a.name) : sortFunction = (a, b) => compare(b.lastModified, a.lastModified), list.sort(sortFunction);
|
|
59
|
+
}, [currentNode, searchTerm, sortOrder, roles]), selectedIds = useMemo(() => new Set(selectedDocuments.map((d) => d.id)), [selectedDocuments]), handleSearchChange = useCallback((e) => {
|
|
60
|
+
setSearchTerm(e.target.value);
|
|
61
|
+
}, [setSearchTerm]);
|
|
62
|
+
function getSortOrderLabel() {
|
|
63
|
+
return sortOrder[0] === "name" ? sortOrder[1] === "asc" ? t("sort.order.alpha.asc") : t("sort.order.alpha.desc") : t("sort.order.modify.desc");
|
|
64
|
+
}
|
|
65
|
+
function handleSelectDoc(doc) {
|
|
66
|
+
let currentDocuments = [...selectedDocuments];
|
|
67
|
+
multiple ? currentDocuments.some((selectedDocument) => selectedDocument.id === doc.id) ? currentDocuments = currentDocuments.filter((selectedDocument) => selectedDocument.id !== doc.id) : currentDocuments = [...currentDocuments, doc] : currentDocuments = [doc], setSelectedDocuments(currentDocuments), onSelect(currentDocuments);
|
|
68
|
+
}
|
|
69
|
+
const googleDrive = clsx("workspace flex-grow-1 gap-0", className);
|
|
70
|
+
return /* @__PURE__ */ jsxs(Grid, { className: googleDrive, children: [
|
|
71
|
+
/* @__PURE__ */ jsx(Grid.Col, { sm: "12", md: "3", xl: "4", className: "workspace-folders p-12 pt-0 gap-12", children: /* @__PURE__ */ jsx("div", { style: {
|
|
72
|
+
position: "sticky",
|
|
73
|
+
top: 0,
|
|
74
|
+
paddingTop: "1.2rem"
|
|
75
|
+
}, children: /* @__PURE__ */ jsx(Tree, { nodes: [myDrive.root, sharedWithMe.root], selectedNodeId: currentNodeId, showIcon: !0, onTreeItemClick: handleTreeItemChange, onTreeItemUnfold: handleTreeItemChange }) }) }),
|
|
76
|
+
/* @__PURE__ */ jsx(Grid.Col, { sm: "12", md: "5", xl: "8", children: /* @__PURE__ */ jsxs(Grid, { className: "flex-grow-1 gap-0", children: [
|
|
77
|
+
/* @__PURE__ */ jsxs(Grid.Col, { sm: "4", md: "8", xl: "12", children: [
|
|
78
|
+
/* @__PURE__ */ jsx("div", { className: "workspace-search px-16 py-8 ", children: /* @__PURE__ */ jsx(SearchBar, { isVariant: !0, className: "gap-16", onChange: handleSearchChange }) }),
|
|
79
|
+
/* @__PURE__ */ jsxs(Flex, { className: "px-8 py-4", align: "center", justify: "end", children: [
|
|
80
|
+
/* @__PURE__ */ jsx("small", { className: "text-muted", children: t("workspace.search.order") }),
|
|
81
|
+
/* @__PURE__ */ jsxs(Dropdown, { children: [
|
|
82
|
+
/* @__PURE__ */ jsx(Dropdown.Trigger, { size: "sm", label: getSortOrderLabel(), variant: "ghost" }),
|
|
83
|
+
/* @__PURE__ */ jsxs(Dropdown.Menu, { children: [
|
|
84
|
+
/* @__PURE__ */ jsx(Dropdown.Item, { icon: /* @__PURE__ */ jsx(SvgIconSortTime, {}), onClick: () => setSortOrder(["modified", "desc"]), children: t("sort.order.modify.desc") }),
|
|
85
|
+
/* @__PURE__ */ jsx(Dropdown.Item, { icon: /* @__PURE__ */ jsx(SvgIconSortAscendingLetters, {}), onClick: () => setSortOrder(["name", "asc"]), children: t("sort.order.alpha.asc") }),
|
|
86
|
+
/* @__PURE__ */ jsx(Dropdown.Item, { icon: /* @__PURE__ */ jsx(SvgIconSortDescendingLetters, {}), onClick: () => setSortOrder(["name", "desc"]), children: t("sort.order.alpha.desc") })
|
|
87
|
+
] })
|
|
88
|
+
] })
|
|
89
|
+
] })
|
|
90
|
+
] }),
|
|
91
|
+
/* @__PURE__ */ jsx(Grid.Col, { sm: "4", md: "8", xl: "12", className: "p-8 gap-8", children: loadError ? /* @__PURE__ */ jsxs(Flex, { direction: "column", gap: "12", className: "h-full w-100", justify: "center", align: "center", children: [
|
|
92
|
+
/* @__PURE__ */ jsx(EmptyScreen, { imageSrc: illuError, title: t("google-drive.error.title"), text: t("google-drive.error.description") }),
|
|
93
|
+
/* @__PURE__ */ jsx(Button, { onClick: () => loadContent(currentNodeId), children: t("retry") })
|
|
94
|
+
] }) : documents ? documents.length !== 0 ? /* @__PURE__ */ jsx("div", { className: "grid grid-workspace", children: documents.map((doc) => {
|
|
95
|
+
const isSelected = selectedIds.has(doc.id);
|
|
96
|
+
return /* @__PURE__ */ jsx(GoogleDriveFileCard, { doc, userId: user.userId, isSelected, onClick: () => handleSelectDoc(doc) }, doc.id);
|
|
97
|
+
}) }) : /* @__PURE__ */ jsx(EmptyScreen, { imageSrc: illuTrash, text: t("workspace.empty.docSpace"), title: t("explorer.emptyScreen.trash.title") }) : /* @__PURE__ */ jsx(LoadingScreen, {}) })
|
|
98
|
+
] }) })
|
|
99
|
+
] });
|
|
100
|
+
};
|
|
101
|
+
export {
|
|
102
|
+
GoogleDrive as default
|
|
103
|
+
};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
1
2
|
import { App, ILinkedResource } from '@edifice.io/client';
|
|
2
3
|
/**
|
|
3
4
|
* Definition of an internal link.
|
|
@@ -32,6 +33,11 @@ export interface InternalLinkerProps {
|
|
|
32
33
|
applicationList?: ApplicationOption[];
|
|
33
34
|
/** Whether to show the application selector */
|
|
34
35
|
showApplicationSelector?: boolean;
|
|
36
|
+
/**
|
|
37
|
+
* Rendered on the search row, where the application selector sits, for
|
|
38
|
+
* consumers that hide that selector but still need a filter of their own.
|
|
39
|
+
*/
|
|
40
|
+
searchFilter?: ReactNode;
|
|
35
41
|
/** Disable application selecetor */
|
|
36
42
|
disableApplicationSelector?: boolean;
|
|
37
43
|
/** Optional callback to filter resources after loading. Applied in addition to search filters. */
|
|
@@ -49,5 +55,5 @@ export interface InternalLinkerProps {
|
|
|
49
55
|
/** Label for the "load more" button. Defaults to the `bbm.linker.see.more` i18n key. */
|
|
50
56
|
loadMoreLabel?: string;
|
|
51
57
|
}
|
|
52
|
-
export declare const InternalLinker: ({ appCode, defaultAppCode, defaultResourceId, onChange, onSelect, multiple, resourceList, applicationList, showApplicationSelector, disableApplicationSelector, resourceFilter, onSearch, hasMoreResources, onLoadMore, loadMoreLabel, }: InternalLinkerProps) => import("react/jsx-runtime").JSX.Element;
|
|
58
|
+
export declare const InternalLinker: ({ appCode, defaultAppCode, defaultResourceId, onChange, onSelect, multiple, resourceList, applicationList, showApplicationSelector, searchFilter, disableApplicationSelector, resourceFilter, onSearch, hasMoreResources, onLoadMore, loadMoreLabel, }: InternalLinkerProps) => import("react/jsx-runtime").JSX.Element;
|
|
53
59
|
export default InternalLinker;
|
|
@@ -23,6 +23,7 @@ const InternalLinker = ({
|
|
|
23
23
|
resourceList,
|
|
24
24
|
applicationList,
|
|
25
25
|
showApplicationSelector = !0,
|
|
26
|
+
searchFilter,
|
|
26
27
|
disableApplicationSelector = !1,
|
|
27
28
|
resourceFilter,
|
|
28
29
|
onSearch,
|
|
@@ -131,6 +132,7 @@ const InternalLinker = ({
|
|
|
131
132
|
] }), variant: "ghost", size: "md", disabled: disableApplicationSelector }),
|
|
132
133
|
/* @__PURE__ */ jsx(Dropdown.Menu, { children: options == null ? void 0 : options.map((option) => /* @__PURE__ */ jsx(Dropdown.Item, { icon: option.icon, onClick: () => handleOptionClick(option), children: option.displayName }, option.application)) })
|
|
133
134
|
] }) }),
|
|
135
|
+
!showApplicationSelector && searchFilter && /* @__PURE__ */ jsx("div", { className: "flex-shrink-1 px-8 py-12 border-end align-self-center", children: searchFilter }),
|
|
134
136
|
/* @__PURE__ */ jsx("div", { className: "flex-grow-1 align-self-center", children: /* @__PURE__ */ jsx("form", { className: "gap-16 d-flex w-100 align-items-center px-16 py-8", onSubmit: handleSubmit, children: /* @__PURE__ */ jsx(SearchBar, { isVariant: !0, placeholder: t("search"), size: "lg", className: "w-100", disabled: !selectedApplication, onChange: handleSearchChange }) }) })
|
|
135
137
|
] }),
|
|
136
138
|
/* @__PURE__ */ jsxs("div", { className: "internal-linker flex-grow-1 w-100 rounded-bottom border gap-0 overflow-auto", children: [
|
|
@@ -33,9 +33,11 @@ const orderedTabs = [
|
|
|
33
33
|
// Media browser
|
|
34
34
|
"nextcloud",
|
|
35
35
|
// Nextcloud media browser
|
|
36
|
+
"google-drive",
|
|
37
|
+
// Google Drive media browser
|
|
36
38
|
"video-embedder"
|
|
37
39
|
// Link to a hosted video
|
|
38
|
-
], mediaLibraryTypes = {
|
|
40
|
+
], GOOGLE_DRIVE_VIEW_WORKFLOW = "io.edifice.google.drive.controller.GoogleDriveController|view", mediaLibraryTypes = {
|
|
39
41
|
none: null,
|
|
40
42
|
audio: {
|
|
41
43
|
title: "bbm.audio.modal.title",
|
|
@@ -74,7 +76,7 @@ const orderedTabs = [
|
|
|
74
76
|
onCancel,
|
|
75
77
|
onTabChange
|
|
76
78
|
}, ref) => {
|
|
77
|
-
var _a, _b;
|
|
79
|
+
var _a, _b, _c;
|
|
78
80
|
const linkTabProps = useRef(), refModal = useRef(null);
|
|
79
81
|
useImperativeHandle(ref, () => ({
|
|
80
82
|
show,
|
|
@@ -85,9 +87,9 @@ const orderedTabs = [
|
|
|
85
87
|
}));
|
|
86
88
|
const {
|
|
87
89
|
t
|
|
88
|
-
} = useTranslation(), workspaceCreateWorkflow = useHasWorkflow("org.entcore.workspace.controllers.WorkspaceController|addDocument"), videoCaptureWorkflow = useHasWorkflow("com.opendigitaleducation.video.controllers.VideoController|capture"), nextcloudViewWorkflow = useHasWorkflow("fr.openent.nextcloud.controller.NextcloudController|view"), {
|
|
90
|
+
} = useTranslation(), workspaceCreateWorkflow = useHasWorkflow("org.entcore.workspace.controllers.WorkspaceController|addDocument"), videoCaptureWorkflow = useHasWorkflow("com.opendigitaleducation.video.controllers.VideoController|capture"), nextcloudViewWorkflow = useHasWorkflow("fr.openent.nextcloud.controller.NextcloudController|view"), googleDriveViewWorkflow = useHasWorkflow(GOOGLE_DRIVE_VIEW_WORKFLOW), {
|
|
89
91
|
data: workspacePublicConf
|
|
90
|
-
} = usePublicConf("workspace"), enableNextcloudTab = ((_a = workspacePublicConf == null ? void 0 : workspacePublicConf["folder-service"]) == null ? void 0 : _a.includes("nextcloud")) && nextcloudViewWorkflow, [type, setType] = useState(null);
|
|
92
|
+
} = usePublicConf("workspace"), enableNextcloudTab = ((_a = workspacePublicConf == null ? void 0 : workspacePublicConf["folder-service"]) == null ? void 0 : _a.includes("nextcloud")) && nextcloudViewWorkflow, enableGoogleDriveTab = ((_b = workspacePublicConf == null ? void 0 : workspacePublicConf["folder-service"]) == null ? void 0 : _b.includes("google-drive")) && googleDriveViewWorkflow, [type, setType] = useState(null);
|
|
91
93
|
useHttpErrorToast({
|
|
92
94
|
active: !!type,
|
|
93
95
|
isDismissible: !0,
|
|
@@ -110,6 +112,15 @@ const orderedTabs = [
|
|
|
110
112
|
availableFor: ["audio", "video", "image", "attachment"],
|
|
111
113
|
isEnable: () => !!enableNextcloudTab
|
|
112
114
|
},
|
|
115
|
+
"google-drive": {
|
|
116
|
+
id: "google-drive",
|
|
117
|
+
// FIXME No Google Drive icon in the pack yet; reusing the generic one.
|
|
118
|
+
icon: /* @__PURE__ */ jsx(SvgIconGlobe2, {}),
|
|
119
|
+
label: t("bbm.google-drive"),
|
|
120
|
+
content: /* @__PURE__ */ jsx(InnerTabs.GoogleDrive, {}),
|
|
121
|
+
availableFor: ["audio", "video", "image", "attachment"],
|
|
122
|
+
isEnable: () => !!enableGoogleDriveTab
|
|
123
|
+
},
|
|
113
124
|
upload: {
|
|
114
125
|
id: "upload",
|
|
115
126
|
icon: /* @__PURE__ */ jsx(SvgIconSmartphone, {}),
|
|
@@ -195,7 +206,7 @@ const orderedTabs = [
|
|
|
195
206
|
const typeKey = type || "none";
|
|
196
207
|
!defaultTabId && typeof ((_a2 = mediaLibraryTypes[typeKey]) == null ? void 0 : _a2.defaultTab) == "string" && setDefaultTabId((_b2 = mediaLibraryTypes[typeKey]) == null ? void 0 : _b2.defaultTab);
|
|
197
208
|
}, [defaultTabId, type]);
|
|
198
|
-
const modalHeader = t(((
|
|
209
|
+
const modalHeader = t(((_c = mediaLibraryTypes[type ?? "none"]) == null ? void 0 : _c.title) ?? "bbm"), resetState = () => {
|
|
199
210
|
linkTabProps.current = void 0, setResult(void 0), setResultCounter(void 0), setDefaultTabId(void 0), setPreSuccess(void 0), setDeletionsOnCancel([]);
|
|
200
211
|
}, handleTabChange = (tab) => {
|
|
201
212
|
onTabChange == null || onTabChange(tab, deletionsOnCancel), resetState();
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const GoogleDrive: () => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { odeServices, GoogleDriveCopyError } from "@edifice.io/client";
|
|
3
|
+
import { useTranslation } from "react-i18next";
|
|
4
|
+
import { useMediaLibraryContext } from "../MediaLibraryContext.js";
|
|
5
|
+
import useUser from "../../../../hooks/useUser/useUser.js";
|
|
6
|
+
import useToast from "../../../../hooks/useToast/useToast.js";
|
|
7
|
+
import GoogleDrive$1 from "../../GoogleDrive/GoogleDrive.js";
|
|
8
|
+
const GoogleDrive = () => {
|
|
9
|
+
const {
|
|
10
|
+
appCode,
|
|
11
|
+
visibility,
|
|
12
|
+
type,
|
|
13
|
+
setResultCounter,
|
|
14
|
+
setResult,
|
|
15
|
+
setPreSuccess,
|
|
16
|
+
multiple
|
|
17
|
+
} = useMediaLibraryContext(), {
|
|
18
|
+
user
|
|
19
|
+
} = useUser(), {
|
|
20
|
+
t
|
|
21
|
+
} = useTranslation(), toast = useToast();
|
|
22
|
+
function getDocumentRoleFilter() {
|
|
23
|
+
switch (type) {
|
|
24
|
+
case "image":
|
|
25
|
+
return "img";
|
|
26
|
+
case "audio":
|
|
27
|
+
return "audio";
|
|
28
|
+
case "video":
|
|
29
|
+
return "video";
|
|
30
|
+
default:
|
|
31
|
+
return null;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
async function copyToWorkspace(userId, ids) {
|
|
35
|
+
try {
|
|
36
|
+
return await odeServices.googledrive().copyDocumentToWorkspace(
|
|
37
|
+
userId,
|
|
38
|
+
ids,
|
|
39
|
+
void 0,
|
|
40
|
+
// Copy the documents straight to their final place, the way an upload
|
|
41
|
+
// does, instead of leaving a copy in the user's own documents for the
|
|
42
|
+
// modal to transfer afterwards.
|
|
43
|
+
{
|
|
44
|
+
application: appCode,
|
|
45
|
+
visibility
|
|
46
|
+
}
|
|
47
|
+
);
|
|
48
|
+
} catch (error) {
|
|
49
|
+
if (error instanceof GoogleDriveCopyError && error.copied.length > 0)
|
|
50
|
+
return toast.warning(t("google-drive.transfer.error")), error.copied;
|
|
51
|
+
throw error;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
function handleSelect(result) {
|
|
55
|
+
setResultCounter(result.length), result.length ? (setResult(result), setPreSuccess(() => () => user != null && user.userId ? copyToWorkspace(user.userId, result.map((doc) => doc.id)) : Promise.resolve([]))) : (setResult(), setPreSuccess(void 0));
|
|
56
|
+
}
|
|
57
|
+
return /* @__PURE__ */ jsx(GoogleDrive$1, { roles: getDocumentRoleFilter(), onSelect: handleSelect, multiple, className: "border rounded overflow-y-auto" });
|
|
58
|
+
};
|
|
59
|
+
export {
|
|
60
|
+
GoogleDrive
|
|
61
|
+
};
|
|
@@ -5,6 +5,7 @@ export declare const InnerTabs: {
|
|
|
5
5
|
ExternalLink: ({ link, multiNodeSelected, }: import('./ExternalLink').ExternalLinkTabProps) => import("react/jsx-runtime").JSX.Element;
|
|
6
6
|
Workspace: () => import("react/jsx-runtime").JSX.Element;
|
|
7
7
|
Nextcloud: () => import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
GoogleDrive: () => import("react/jsx-runtime").JSX.Element;
|
|
8
9
|
InternalLink: ({ target, resourceId, appPrefix, }: import('./InternalLink').InternalLinkTabProps) => import("react/jsx-runtime").JSX.Element;
|
|
9
10
|
Iframe: () => import("react/jsx-runtime").JSX.Element;
|
|
10
11
|
VideoEmbedder: () => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Audio } from "./Audio.js";
|
|
2
2
|
import { ExternalLink } from "./ExternalLink.js";
|
|
3
|
+
import { GoogleDrive } from "./GoogleDrive.js";
|
|
3
4
|
import { Iframe } from "./Iframe.js";
|
|
4
5
|
import { InternalLink } from "./InternalLink.js";
|
|
5
6
|
import { Nextcloud } from "./Nextcloud.js";
|
|
@@ -14,6 +15,7 @@ const InnerTabs = {
|
|
|
14
15
|
ExternalLink,
|
|
15
16
|
Workspace,
|
|
16
17
|
Nextcloud,
|
|
18
|
+
GoogleDrive,
|
|
17
19
|
InternalLink,
|
|
18
20
|
Iframe,
|
|
19
21
|
VideoEmbedder
|
|
@@ -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
|
@@ -1,17 +1,19 @@
|
|
|
1
1
|
import { default as default2 } from "./modules/multimedia/AudioRecorder/AudioRecorder.js";
|
|
2
2
|
import { default as default3 } from "./modules/multimedia/Embed/Embed.js";
|
|
3
3
|
import { default as default4 } from "./modules/multimedia/FileCard/FileCard.js";
|
|
4
|
-
import { default as default5 } from "./modules/multimedia/
|
|
5
|
-
import { default as default6 } from "./modules/multimedia/
|
|
6
|
-
import { default as default7 } from "./modules/multimedia/
|
|
7
|
-
import { default as default8 } from "./modules/multimedia/
|
|
8
|
-
import { default as default9 } from "./modules/multimedia/
|
|
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/
|
|
4
|
+
import { default as default5 } from "./modules/multimedia/GoogleDrive/GoogleDrive.js";
|
|
5
|
+
import { default as default6 } from "./modules/multimedia/FileCard/GoogleDriveFileCard.js";
|
|
6
|
+
import { default as default7 } from "./modules/multimedia/ImageEditor/components/ImageEditor.js";
|
|
7
|
+
import { default as default8 } from "./modules/multimedia/ImagePicker/ImagePicker.js";
|
|
8
|
+
import { default as default9 } from "./modules/multimedia/MediaLibrary/MediaLibrary.js";
|
|
9
|
+
import { default as default10 } from "./modules/multimedia/Nextcloud/Nextcloud.js";
|
|
10
|
+
import { default as default11 } from "./modules/multimedia/FileCard/NextcloudFileCard.js";
|
|
11
|
+
import { default as default12 } from "./modules/multimedia/UploadCard/UploadCard.js";
|
|
12
|
+
import { default as default13 } from "./modules/multimedia/UploadFiles/UploadFiles.js";
|
|
13
|
+
import { default as default14 } from "./modules/multimedia/VideoEmbed/VideoEmbed.js";
|
|
14
|
+
import { default as default15 } from "./modules/multimedia/VideoRecorder/VideoRecorder.js";
|
|
15
|
+
import { default as default16 } from "./modules/multimedia/Workspace/Workspace.js";
|
|
16
|
+
import { default as default17 } from "./modules/multimedia/WorkspaceFolders/WorkspaceFolders.js";
|
|
15
17
|
import { ExternalLinker } from "./modules/multimedia/Linker/ExternalLinker/ExternalLinker.js";
|
|
16
18
|
import { InternalLinker } from "./modules/multimedia/Linker/InternalLinker/InternalLinker.js";
|
|
17
19
|
import { Upload } from "./modules/multimedia/MediaLibrary/innertabs/Upload.js";
|
|
@@ -20,17 +22,19 @@ export {
|
|
|
20
22
|
default3 as Embed,
|
|
21
23
|
ExternalLinker,
|
|
22
24
|
default4 as FileCard,
|
|
23
|
-
default5 as
|
|
24
|
-
default6 as
|
|
25
|
+
default5 as GoogleDrive,
|
|
26
|
+
default6 as GoogleDriveFileCard,
|
|
27
|
+
default7 as ImageEditor,
|
|
28
|
+
default8 as ImagePicker,
|
|
25
29
|
InternalLinker,
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
30
|
+
default9 as MediaLibrary,
|
|
31
|
+
default10 as Nextcloud,
|
|
32
|
+
default11 as NextcloudFileCard,
|
|
29
33
|
Upload,
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
34
|
+
default12 as UploadCard,
|
|
35
|
+
default13 as UploadFiles,
|
|
36
|
+
default14 as VideoEmbed,
|
|
37
|
+
default15 as VideoRecorder,
|
|
38
|
+
default16 as Workspace,
|
|
39
|
+
default17 as WorkspaceFolders
|
|
36
40
|
};
|
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.20261103121816",
|
|
4
4
|
"description": "Edifice React Library",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react",
|
|
@@ -140,9 +140,9 @@
|
|
|
140
140
|
"swiper": "10.1.0",
|
|
141
141
|
"ua-parser-js": "1.0.36",
|
|
142
142
|
"zustand": "4.5.7",
|
|
143
|
-
"@edifice.io/
|
|
144
|
-
"@edifice.io/
|
|
145
|
-
"@edifice.io/
|
|
143
|
+
"@edifice.io/tiptap-extensions": "2.6.12-develop-integration.20261103121816",
|
|
144
|
+
"@edifice.io/utilities": "2.6.12-develop-integration.20261103121816",
|
|
145
|
+
"@edifice.io/bootstrap": "2.6.12-develop-integration.20261103121816"
|
|
146
146
|
},
|
|
147
147
|
"devDependencies": {
|
|
148
148
|
"@babel/plugin-transform-react-pure-annotations": "7.27.1",
|
|
@@ -174,8 +174,8 @@
|
|
|
174
174
|
"vite": "5.4.14",
|
|
175
175
|
"vite-plugin-dts": "4.5.4",
|
|
176
176
|
"vite-tsconfig-paths": "5.1.4",
|
|
177
|
-
"@edifice.io/
|
|
178
|
-
"@edifice.io/
|
|
177
|
+
"@edifice.io/config": "2.6.12-develop-integration.20261103121816",
|
|
178
|
+
"@edifice.io/client": "2.6.12-develop-integration.20261103121816"
|
|
179
179
|
},
|
|
180
180
|
"peerDependencies": {
|
|
181
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
|
-
};
|