@edifice.io/react 2.6.6 → 2.6.7-feat-INTEG-1924-port-react-nextcloud-filetree.20260928093800

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.
Files changed (34) hide show
  1. package/dist/components/Tree/utilities/tree.js +21 -1
  2. package/dist/homepage.js +29 -19
  3. package/dist/hooks/index.d.ts +1 -0
  4. package/dist/hooks/useNextcloudSearch/index.d.ts +1 -0
  5. package/dist/hooks/useNextcloudSearch/useNextcloudSearch.d.ts +14 -0
  6. package/dist/hooks/useNextcloudSearch/useNextcloudSearch.js +64 -0
  7. package/dist/index.js +152 -146
  8. package/dist/modules/homepage/components/Communities/Communities.js +35 -0
  9. package/dist/modules/homepage/components/Communities/CommunitiesContainer.d.ts +4 -2
  10. package/dist/modules/homepage/components/Communities/CommunitiesContainer.js +31 -0
  11. package/dist/modules/homepage/components/Communities/CommunitiesSkeleton.js +32 -0
  12. package/dist/modules/homepage/components/Communities/CommunityItem.d.ts +2 -1
  13. package/dist/modules/homepage/components/Communities/CommunityItem.js +28 -0
  14. package/dist/modules/homepage/components/Communities/useCommunities.d.ts +1 -4
  15. package/dist/modules/homepage/components/Communities/useCommunities.js +25 -0
  16. package/dist/modules/homepage/components/index.d.ts +1 -0
  17. package/dist/modules/multimedia/FileCard/NextcloudFileCard.d.ts +25 -0
  18. package/dist/modules/multimedia/FileCard/NextcloudFileCard.js +102 -0
  19. package/dist/modules/multimedia/FileCard/index.d.ts +2 -0
  20. package/dist/modules/multimedia/Linker/InternalLinker/InternalLinker.d.ts +7 -1
  21. package/dist/modules/multimedia/Linker/InternalLinker/InternalLinker.js +2 -0
  22. package/dist/modules/multimedia/MediaLibrary/MediaLibrary.d.ts +2 -2
  23. package/dist/modules/multimedia/MediaLibrary/MediaLibrary.js +36 -11
  24. package/dist/modules/multimedia/MediaLibrary/innertabs/Nextcloud.d.ts +1 -0
  25. package/dist/modules/multimedia/MediaLibrary/innertabs/Nextcloud.js +48 -0
  26. package/dist/modules/multimedia/MediaLibrary/innertabs/index.d.ts +1 -0
  27. package/dist/modules/multimedia/MediaLibrary/innertabs/index.js +2 -0
  28. package/dist/modules/multimedia/Nextcloud/Nextcloud.d.ts +24 -0
  29. package/dist/modules/multimedia/Nextcloud/Nextcloud.js +124 -0
  30. package/dist/modules/multimedia/Nextcloud/index.d.ts +2 -0
  31. package/dist/modules/multimedia/Workspace/Workspace.js +8 -5
  32. package/dist/modules/multimedia/index.d.ts +1 -0
  33. package/dist/multimedia.js +16 -12
  34. package/package.json +6 -6
@@ -16,6 +16,25 @@ function findNodeById(data, id) {
16
16
  }
17
17
  }
18
18
  }
19
+ function modifyNode(data, callback) {
20
+ return doModify(data, callback) || data;
21
+ }
22
+ function doModify(current, callback, parent) {
23
+ var _a;
24
+ const result = callback(current, parent);
25
+ if ((_a = result == null ? void 0 : result.children) != null && _a.length) {
26
+ const children = [];
27
+ for (const child of (result == null ? void 0 : result.children) || []) {
28
+ const res = doModify(child, callback, result);
29
+ res && children.push(res);
30
+ }
31
+ return {
32
+ ...result,
33
+ children
34
+ };
35
+ }
36
+ return result;
37
+ }
19
38
  function findPathById(tree, nodeId) {
20
39
  let path = [];
21
40
  function traverse(node, currentPath) {
@@ -40,5 +59,6 @@ function findPathById(tree, nodeId) {
40
59
  }
41
60
  export {
42
61
  findNodeById,
43
- findPathById
62
+ findPathById,
63
+ modifyNode
44
64
  };
package/dist/homepage.js CHANGED
@@ -1,13 +1,17 @@
1
- import { default as default2 } from "./modules/homepage/components/Header/Header.js";
2
- import { default as default3 } from "./modules/homepage/components/HomeCard/HomeCard.js";
3
- import { default as default4 } from "./modules/homepage/components/LastInfos/LastInfos.js";
4
- import { default as default5 } from "./modules/homepage/components/MessageFlashList/MessageFlash.js";
5
- import { default as default6 } from "./modules/homepage/components/MessageFlashList/MessageFlashList.js";
6
- import { default as default7 } from "./modules/homepage/components/Notifications/NotificationItem.js";
7
- import { default as default8 } from "./modules/homepage/components/Notifications/NotificationList.js";
1
+ import { default as default2 } from "./modules/homepage/components/Communities/Communities.js";
2
+ import { default as default3 } from "./modules/homepage/components/Communities/CommunityItem.js";
3
+ import { default as default4 } from "./modules/homepage/components/Communities/CommunitiesSkeleton.js";
4
+ import { default as default5 } from "./modules/homepage/components/Header/Header.js";
5
+ import { default as default6 } from "./modules/homepage/components/HomeCard/HomeCard.js";
6
+ import { default as default7 } from "./modules/homepage/components/LastInfos/LastInfos.js";
7
+ import { default as default8 } from "./modules/homepage/components/MessageFlashList/MessageFlash.js";
8
+ import { default as default9 } from "./modules/homepage/components/MessageFlashList/MessageFlashList.js";
9
+ import { default as default10 } from "./modules/homepage/components/Notifications/NotificationItem.js";
10
+ import { default as default11 } from "./modules/homepage/components/Notifications/NotificationList.js";
8
11
  import { NotificationListContainer } from "./modules/homepage/components/Notifications/NotificationListContainer.js";
9
- import { default as default9 } from "./modules/homepage/components/SchoolSpace/SchoolSpace.js";
10
- import { default as default10 } from "./modules/homepage/components/UserSpace/UserSpace.js";
12
+ import { default as default12 } from "./modules/homepage/components/SchoolSpace/SchoolSpace.js";
13
+ import { default as default13 } from "./modules/homepage/components/UserSpace/UserSpace.js";
14
+ import { CommunitiesContainer } from "./modules/homepage/components/Communities/CommunitiesContainer.js";
11
15
  import { Favorites } from "./modules/homepage/components/Favorites/Favorites.js";
12
16
  import { FavoritesContainer } from "./modules/homepage/components/Favorites/FavoritesContainer.js";
13
17
  import { LastInfosContainer } from "./modules/homepage/components/LastInfos/LastInfosContainer.js";
@@ -15,22 +19,28 @@ import { LastInfosList } from "./modules/homepage/components/LastInfos/LastInfos
15
19
  import { MessageFlashListContainer } from "./modules/homepage/components/MessageFlashList/MessageFlashListContainer.js";
16
20
  import { SchoolSpaceContainer } from "./modules/homepage/components/SchoolSpace/SchoolSpaceContainer.js";
17
21
  import { UserSpaceContainer } from "./modules/homepage/components/UserSpace/UserSpaceContainer.js";
22
+ import { useCommunities } from "./modules/homepage/components/Communities/useCommunities.js";
18
23
  export {
24
+ default2 as Communities,
25
+ CommunitiesContainer,
26
+ default3 as CommunitiesItem,
27
+ default4 as CommunitiesSkeleton,
19
28
  Favorites,
20
29
  FavoritesContainer,
21
- default2 as Header,
22
- default3 as HomeCard,
23
- default4 as LastInfos,
30
+ default5 as Header,
31
+ default6 as HomeCard,
32
+ default7 as LastInfos,
24
33
  LastInfosContainer,
25
34
  LastInfosList,
26
- default5 as MessageFlash,
27
- default6 as MessageFlashList,
35
+ default8 as MessageFlash,
36
+ default9 as MessageFlashList,
28
37
  MessageFlashListContainer,
29
- default7 as NotificationItem,
30
- default8 as NotificationList,
38
+ default10 as NotificationItem,
39
+ default11 as NotificationList,
31
40
  NotificationListContainer,
32
- default9 as SchoolSpace,
41
+ default12 as SchoolSpace,
33
42
  SchoolSpaceContainer,
34
- default10 as UserSpace,
35
- UserSpaceContainer
43
+ default13 as UserSpace,
44
+ UserSpaceContainer,
45
+ useCommunities
36
46
  };
@@ -22,6 +22,7 @@ export * from './useIsAdmlcOrAdmc';
22
22
  export * from './useKeyPress';
23
23
  export * from './useLibraryUrl';
24
24
  export * from './useMediaLibrary';
25
+ export * from './useNextcloudSearch';
25
26
  export * from './usePublicConf';
26
27
  export * from './useScreeb';
27
28
  export * from './useScrollToTop';
@@ -0,0 +1 @@
1
+ export { default as useNextcloudSearch } from './useNextcloudSearch';
@@ -0,0 +1,14 @@
1
+ import { ID, NextcloudDocument } from '@edifice.io/client';
2
+ import { TreeItem } from '../../components/Tree/types';
3
+ export type NextcloudFolderNode = TreeItem & {
4
+ files?: NextcloudDocument[];
5
+ };
6
+ export default function useNextcloudSearch(rootId: string, rootName: string, userId?: string): {
7
+ root: NextcloudFolderNode;
8
+ needsAuth: boolean;
9
+ isCheckingAuth: boolean;
10
+ isAuthError: boolean;
11
+ refetchAuthStatus: () => void;
12
+ loadContent: (folderId?: ID) => void;
13
+ loadError: unknown;
14
+ };
@@ -0,0 +1,64 @@
1
+ import { useState, useCallback } from "react";
2
+ import { odeServices } from "@edifice.io/client";
3
+ import { useQueryClient, useQuery } from "@tanstack/react-query";
4
+ import { findNodeById, modifyNode } from "../../components/Tree/utilities/tree.js";
5
+ function useNextcloudSearch(rootId, rootName, userId) {
6
+ var _a;
7
+ const [root, setRoot] = useState({
8
+ id: rootId,
9
+ name: rootName,
10
+ section: !0
11
+ }), updateFolder = useCallback((folderId, subfolders, files) => {
12
+ setRoot((prev) => {
13
+ const node = findNodeById(prev, folderId);
14
+ if (!node) return prev;
15
+ const children = subfolders.map((f) => {
16
+ var _a2;
17
+ const existing = (_a2 = node.children) == null ? void 0 : _a2.find((c) => c.id === f.path);
18
+ return existing ? {
19
+ ...existing,
20
+ name: f.name
21
+ } : {
22
+ id: f.path,
23
+ name: f.name
24
+ };
25
+ });
26
+ return modifyNode(prev, (n) => n.id === node.id ? {
27
+ ...n,
28
+ children,
29
+ files
30
+ } : n);
31
+ });
32
+ }, []), queryClient = useQueryClient(), oauth2StatusQuery = useQuery({
33
+ queryKey: ["nextcloud", "oauth2-status", userId],
34
+ queryFn: () => odeServices.nextcloud().getOauth2Status(userId),
35
+ enabled: !!userId
36
+ }), needsAuth = !((_a = oauth2StatusQuery.data) != null && _a.connected), [loadError, setLoadError] = useState(null), loadContent = useCallback(async (folderId) => {
37
+ if (!userId) return;
38
+ const path = folderId === rootId ? void 0 : folderId;
39
+ try {
40
+ const payload = await queryClient.fetchQuery({
41
+ queryKey: ["nextcloud", "documents", userId, path ?? "/"],
42
+ queryFn: () => odeServices.nextcloud().listDocuments(userId, path),
43
+ staleTime: 6e4
44
+ }), subfolders = [], files = [], currentPath = path ?? "/";
45
+ payload.filter((doc) => doc.path !== currentPath).forEach((doc) => {
46
+ doc.isFolder ? subfolders.push(doc) : files.push(doc);
47
+ }), setLoadError(null), updateFolder(folderId, subfolders, files);
48
+ } catch (error) {
49
+ setLoadError(error);
50
+ }
51
+ }, [rootId, userId, queryClient, updateFolder]);
52
+ return {
53
+ root,
54
+ needsAuth,
55
+ isCheckingAuth: oauth2StatusQuery.isLoading,
56
+ isAuthError: oauth2StatusQuery.isError,
57
+ refetchAuthStatus: oauth2StatusQuery.refetch,
58
+ loadContent,
59
+ loadError
60
+ };
61
+ }
62
+ export {
63
+ useNextcloudSearch as default
64
+ };
package/dist/index.js CHANGED
@@ -44,79 +44,82 @@ import { default as default42 } from "./components/LogoBeta/LogoBeta.js";
44
44
  import { default as default43 } from "./modules/multimedia/MediaLibrary/MediaLibrary.js";
45
45
  import { default as default44 } from "./components/MediaViewer/MediaViewer.js";
46
46
  import { default as default45 } from "./components/Modal/Modal.js";
47
- import { default as default46 } from "./modules/modals/OnboardingModal/OnboardingModal.js";
48
- import { default as default47 } from "./components/PageLayout/PageLayout.js";
49
- import { default as default48 } from "./components/PreventPropagation/PreventPropagation.js";
50
- import { default as default49, Root } from "./components/PromotionCard/PromotionCard.js";
51
- import { default as default50 } from "./modules/modals/PublishModal/PublishModal.js";
52
- import { default as default51 } from "./components/Radio/Radio.js";
53
- import { default as default52 } from "./components/RadioCard/RadioCard.js";
54
- import { default as default53 } from "./components/SearchBar/SearchBar.js";
55
- import { default as default54 } from "./components/Button/SearchButton.js";
56
- import { default as default55 } from "./components/SegmentedControl/SegmentedControl.js";
57
- import { default as default56 } from "./components/Select/Select.js";
58
- import { default as default57 } from "./modules/modals/ShareModal/apps/ShareBlog.js";
59
- import { default as default58 } from "./modules/modals/ShareModal/ShareModal.js";
60
- import { default as default59 } from "./modules/modals/ShareModal/ShareResources.js";
61
- import { default as default60 } from "./components/Tree/components/SortableTree.js";
62
- import { default as default61 } from "./components/StackedGroup/StackedGroup.js";
63
- import { default as default62 } from "./components/Stepper/Stepper.js";
64
- import { default as default63 } from "./components/Switch/Switch.js";
65
- import { default as default64 } from "./components/Table/components/Table.js";
66
- import { default as default65 } from "./components/TextArea/TextArea.js";
67
- import { default as default66 } from "./components/Skeleton/TextSkeleton.js";
68
- import { default as default67 } from "./components/Tooltip/Tooltip.js";
69
- import { default as default68 } from "./components/Tree/components/Tree.js";
70
- import { default as default69 } from "./components/TreeView/TreeView.js";
71
- import { default as default70 } from "./modules/multimedia/UploadCard/UploadCard.js";
72
- import { default as default71 } from "./modules/multimedia/UploadFiles/UploadFiles.js";
73
- import { default as default72 } from "./modules/multimedia/VideoEmbed/VideoEmbed.js";
74
- import { default as default73 } from "./modules/multimedia/VideoRecorder/VideoRecorder.js";
75
- import { default as default74 } from "./components/VisuallyHidden/VisuallyHidden.js";
76
- import { default as default75 } from "./modules/multimedia/Workspace/Workspace.js";
77
- import { default as default76 } from "./modules/multimedia/WorkspaceFolders/WorkspaceFolders.js";
78
- import { default as default77 } from "./hooks/useBookmark/useBookmark.js";
79
- import { default as default78 } from "./hooks/useBreakpoint/useBreakpoint.js";
80
- import { default as default79 } from "./hooks/useBrowserInfo/useBrowserInfo.js";
81
- import { default as default80 } from "./hooks/useCantoo/useCantoo.js";
82
- import { default as default81 } from "./hooks/useClickOutside/useClickOutside.js";
83
- import { default as default82 } from "./hooks/useConversation/useConversation.js";
84
- import { default as default83 } from "./hooks/useDate/useDate.js";
85
- import { default as default84 } from "./hooks/useDebounce/useDebounce.js";
86
- import { default as default85 } from "./hooks/useDirectory/useDirectory.js";
87
- import { default as default86 } from "./hooks/useDropdown/useDropdown.js";
88
- import { default as default87 } from "./hooks/useDropzone/useDropzone.js";
89
- import { default as default88 } from "./hooks/useEdificeIcons/useEdificeIcons.js";
90
- import { default as default89 } from "./hooks/useHasWorkflow/useHasWorkflow.js";
91
- import { default as default90 } from "./hooks/useHover/useHover.js";
92
- import { default as default91 } from "./hooks/useHttpErrorToast/useHttpErrorToast.js";
93
- import { default as default92 } from "./hooks/useImage/useImage.js";
94
- import { default as default93 } from "./hooks/useInfiniteScroll/useInfiniteScroll.js";
95
- import { default as default94 } from "./hooks/useIsAdmc/useIsAdmc.js";
96
- import { default as default95 } from "./hooks/useIsAdml/useIsAdml.js";
97
- import { default as default96 } from "./hooks/useIsAdmlcOrAdmc/useIsAdmlcOrAdmc.js";
98
- import { default as default97 } from "./hooks/useKeyPress/useKeyPress.js";
99
- import { default as default98 } from "./hooks/useLibraryUrl/useLibraryUrl.js";
100
- import { default as default99 } from "./hooks/useMediaLibrary/useMediaLibrary.js";
101
- import { default as default100 } from "./hooks/usePublicConf/usePublicConf.js";
102
- import { default as default101 } from "./hooks/useScrollToTop/useScrollToTop.js";
103
- import { default as default102 } from "./modules/modals/ShareModal/hooks/useShareMutation.js";
104
- import { default as default103 } from "./hooks/useTitle/useTitle.js";
105
- import { default as default104 } from "./hooks/useToast/useToast.js";
106
- import { default as default105 } from "./hooks/useToggle/useToggle.js";
107
- import { default as default106 } from "./hooks/useTrapFocus/useTrapFocus.js";
108
- import { default as default107 } from "./hooks/useTrashedResource/useTrashedResource.js";
109
- import { default as default108 } from "./hooks/useUiOverride/useUiOverride.js";
110
- import { default as default109 } from "./modules/modals/ResourceModal/hooks/useUpdateMutation.js";
111
- import { default as default110 } from "./hooks/useUpload/useUpload.js";
112
- import { default as default111 } from "./hooks/useUploadFiles/useUploadFiles.js";
113
- import { default as default112 } from "./hooks/useUser/useUser.js";
114
- import { default as default113 } from "./hooks/useWorkspaceFile/useWorkspaceFile.js";
115
- import { default as default114 } from "./hooks/useWorkspaceFolders/useWorkspaceFolders.js";
116
- import { WORKSPACE_SHARED_FOLDER_ID, WORKSPACE_USER_FOLDER_ID, default as default115 } from "./hooks/useWorkspaceFolders/useWorkspaceFoldersTree.js";
117
- import { default as default116 } from "./hooks/useWorkspaceSearch/useWorkspaceSearch.js";
118
- import { default as default117 } from "./hooks/useXitiTrackPageLoad/useXitiTrackPageLoad.js";
119
- import { default as default118 } from "./hooks/useZendeskGuide/useZendeskGuide.js";
47
+ import { default as default46 } from "./modules/multimedia/Nextcloud/Nextcloud.js";
48
+ import { default as default47 } from "./modules/multimedia/FileCard/NextcloudFileCard.js";
49
+ import { default as default48 } from "./modules/modals/OnboardingModal/OnboardingModal.js";
50
+ import { default as default49 } from "./components/PageLayout/PageLayout.js";
51
+ import { default as default50 } from "./components/PreventPropagation/PreventPropagation.js";
52
+ import { default as default51, Root } from "./components/PromotionCard/PromotionCard.js";
53
+ import { default as default52 } from "./modules/modals/PublishModal/PublishModal.js";
54
+ import { default as default53 } from "./components/Radio/Radio.js";
55
+ import { default as default54 } from "./components/RadioCard/RadioCard.js";
56
+ import { default as default55 } from "./components/SearchBar/SearchBar.js";
57
+ import { default as default56 } from "./components/Button/SearchButton.js";
58
+ import { default as default57 } from "./components/SegmentedControl/SegmentedControl.js";
59
+ import { default as default58 } from "./components/Select/Select.js";
60
+ import { default as default59 } from "./modules/modals/ShareModal/apps/ShareBlog.js";
61
+ import { default as default60 } from "./modules/modals/ShareModal/ShareModal.js";
62
+ import { default as default61 } from "./modules/modals/ShareModal/ShareResources.js";
63
+ import { default as default62 } from "./components/Tree/components/SortableTree.js";
64
+ import { default as default63 } from "./components/StackedGroup/StackedGroup.js";
65
+ import { default as default64 } from "./components/Stepper/Stepper.js";
66
+ import { default as default65 } from "./components/Switch/Switch.js";
67
+ import { default as default66 } from "./components/Table/components/Table.js";
68
+ import { default as default67 } from "./components/TextArea/TextArea.js";
69
+ import { default as default68 } from "./components/Skeleton/TextSkeleton.js";
70
+ import { default as default69 } from "./components/Tooltip/Tooltip.js";
71
+ import { default as default70 } from "./components/Tree/components/Tree.js";
72
+ import { default as default71 } from "./components/TreeView/TreeView.js";
73
+ import { default as default72 } from "./modules/multimedia/UploadCard/UploadCard.js";
74
+ import { default as default73 } from "./modules/multimedia/UploadFiles/UploadFiles.js";
75
+ import { default as default74 } from "./modules/multimedia/VideoEmbed/VideoEmbed.js";
76
+ import { default as default75 } from "./modules/multimedia/VideoRecorder/VideoRecorder.js";
77
+ import { default as default76 } from "./components/VisuallyHidden/VisuallyHidden.js";
78
+ import { default as default77 } from "./modules/multimedia/Workspace/Workspace.js";
79
+ import { default as default78 } from "./modules/multimedia/WorkspaceFolders/WorkspaceFolders.js";
80
+ import { default as default79 } from "./hooks/useBookmark/useBookmark.js";
81
+ import { default as default80 } from "./hooks/useBreakpoint/useBreakpoint.js";
82
+ import { default as default81 } from "./hooks/useBrowserInfo/useBrowserInfo.js";
83
+ import { default as default82 } from "./hooks/useCantoo/useCantoo.js";
84
+ import { default as default83 } from "./hooks/useClickOutside/useClickOutside.js";
85
+ import { default as default84 } from "./hooks/useConversation/useConversation.js";
86
+ import { default as default85 } from "./hooks/useDate/useDate.js";
87
+ import { default as default86 } from "./hooks/useDebounce/useDebounce.js";
88
+ import { default as default87 } from "./hooks/useDirectory/useDirectory.js";
89
+ import { default as default88 } from "./hooks/useDropdown/useDropdown.js";
90
+ import { default as default89 } from "./hooks/useDropzone/useDropzone.js";
91
+ import { default as default90 } from "./hooks/useEdificeIcons/useEdificeIcons.js";
92
+ import { default as default91 } from "./hooks/useHasWorkflow/useHasWorkflow.js";
93
+ import { default as default92 } from "./hooks/useHover/useHover.js";
94
+ import { default as default93 } from "./hooks/useHttpErrorToast/useHttpErrorToast.js";
95
+ import { default as default94 } from "./hooks/useImage/useImage.js";
96
+ import { default as default95 } from "./hooks/useInfiniteScroll/useInfiniteScroll.js";
97
+ import { default as default96 } from "./hooks/useIsAdmc/useIsAdmc.js";
98
+ import { default as default97 } from "./hooks/useIsAdml/useIsAdml.js";
99
+ import { default as default98 } from "./hooks/useIsAdmlcOrAdmc/useIsAdmlcOrAdmc.js";
100
+ import { default as default99 } from "./hooks/useKeyPress/useKeyPress.js";
101
+ import { default as default100 } from "./hooks/useLibraryUrl/useLibraryUrl.js";
102
+ import { default as default101 } from "./hooks/useMediaLibrary/useMediaLibrary.js";
103
+ import { default as default102 } from "./hooks/useNextcloudSearch/useNextcloudSearch.js";
104
+ import { default as default103 } from "./hooks/usePublicConf/usePublicConf.js";
105
+ import { default as default104 } from "./hooks/useScrollToTop/useScrollToTop.js";
106
+ import { default as default105 } from "./modules/modals/ShareModal/hooks/useShareMutation.js";
107
+ import { default as default106 } from "./hooks/useTitle/useTitle.js";
108
+ import { default as default107 } from "./hooks/useToast/useToast.js";
109
+ import { default as default108 } from "./hooks/useToggle/useToggle.js";
110
+ import { default as default109 } from "./hooks/useTrapFocus/useTrapFocus.js";
111
+ import { default as default110 } from "./hooks/useTrashedResource/useTrashedResource.js";
112
+ import { default as default111 } from "./hooks/useUiOverride/useUiOverride.js";
113
+ import { default as default112 } from "./modules/modals/ResourceModal/hooks/useUpdateMutation.js";
114
+ import { default as default113 } from "./hooks/useUpload/useUpload.js";
115
+ import { default as default114 } from "./hooks/useUploadFiles/useUploadFiles.js";
116
+ import { default as default115 } from "./hooks/useUser/useUser.js";
117
+ import { default as default116 } from "./hooks/useWorkspaceFile/useWorkspaceFile.js";
118
+ import { default as default117 } from "./hooks/useWorkspaceFolders/useWorkspaceFolders.js";
119
+ import { WORKSPACE_SHARED_FOLDER_ID, WORKSPACE_USER_FOLDER_ID, default as default118 } from "./hooks/useWorkspaceFolders/useWorkspaceFoldersTree.js";
120
+ import { default as default119 } from "./hooks/useWorkspaceSearch/useWorkspaceSearch.js";
121
+ import { default as default120 } from "./hooks/useXitiTrackPageLoad/useXitiTrackPageLoad.js";
122
+ import { default as default121 } from "./hooks/useZendeskGuide/useZendeskGuide.js";
120
123
  import { AccessiblePalette, DefaultPalette } from "./components/ColorPicker/ColorPalette.js";
121
124
  import { AntProvider } from "./providers/AntThemeProvider/AntProvider.js";
122
125
  import { BetaSwitch } from "./components/BetaSwitch/BetaSwitch.js";
@@ -225,55 +228,57 @@ export {
225
228
  Menu,
226
229
  MockedProvider,
227
230
  default45 as Modal,
228
- default46 as OnboardingModal,
229
- default47 as PageLayout,
231
+ default46 as Nextcloud,
232
+ default47 as NextcloudFileCard,
233
+ default48 as OnboardingModal,
234
+ default49 as PageLayout,
230
235
  PageLayoutContext,
231
236
  Pagination,
232
237
  Popover,
233
238
  PopoverBody,
234
239
  PopoverFooter,
235
240
  PopoverHeader,
236
- default48 as PreventPropagation,
237
- default49 as PromotionCard,
238
- default50 as PublishModal,
239
- default51 as Radio,
240
- default52 as RadioCard,
241
+ default50 as PreventPropagation,
242
+ default51 as PromotionCard,
243
+ default52 as PublishModal,
244
+ default53 as Radio,
245
+ default54 as RadioCard,
241
246
  ResourceModal,
242
247
  Root,
243
- default53 as SearchBar,
244
- default54 as SearchButton,
245
- default55 as SegmentedControl,
246
- default56 as Select,
247
- default57 as ShareBlog,
248
- default58 as ShareModal,
249
- default59 as ShareResources,
250
- default60 as SortableTree,
251
- default61 as StackedGroup,
252
- default62 as Stepper,
253
- default63 as Switch,
254
- default64 as Table,
248
+ default55 as SearchBar,
249
+ default56 as SearchButton,
250
+ default57 as SegmentedControl,
251
+ default58 as Select,
252
+ default59 as ShareBlog,
253
+ default60 as ShareModal,
254
+ default61 as ShareResources,
255
+ default62 as SortableTree,
256
+ default63 as StackedGroup,
257
+ default64 as Stepper,
258
+ default65 as Switch,
259
+ default66 as Table,
255
260
  Tabs,
256
- default65 as TextArea,
257
- default66 as TextSkeleton,
261
+ default67 as TextArea,
262
+ default68 as TextSkeleton,
258
263
  Toolbar,
259
- default67 as Tooltip,
260
- default68 as Tree,
264
+ default69 as Tooltip,
265
+ default70 as Tree,
261
266
  TreeNode,
262
267
  TreeNodeFolderWrapper,
263
- default69 as TreeView,
268
+ default71 as TreeView,
264
269
  Upload,
265
- default70 as UploadCard,
266
- default71 as UploadFiles,
270
+ default72 as UploadCard,
271
+ default73 as UploadFiles,
267
272
  UserRightsList,
268
273
  UserSearch,
269
- default72 as VideoEmbed,
270
- default73 as VideoRecorder,
274
+ default74 as VideoEmbed,
275
+ default75 as VideoRecorder,
271
276
  VisibleType,
272
- default74 as VisuallyHidden,
277
+ default76 as VisuallyHidden,
273
278
  WORKSPACE_SHARED_FOLDER_ID,
274
279
  WORKSPACE_USER_FOLDER_ID,
275
- default75 as Workspace,
276
- default76 as WorkspaceFolders,
280
+ default77 as Workspace,
281
+ default78 as WorkspaceFolders,
277
282
  addNode,
278
283
  arrayUnique,
279
284
  buildTree,
@@ -304,57 +309,58 @@ export {
304
309
  setRef,
305
310
  updateNode,
306
311
  updateParentIds,
307
- default77 as useBookmark,
308
- default78 as useBreakpoint,
309
- default79 as useBrowserInfo,
310
- default80 as useCantoo,
312
+ default79 as useBookmark,
313
+ default80 as useBreakpoint,
314
+ default81 as useBrowserInfo,
315
+ default82 as useCantoo,
311
316
  useCheckable,
312
- default81 as useClickOutside,
313
- default82 as useConversation,
314
- default83 as useDate,
315
- default84 as useDebounce,
316
- default85 as useDirectory,
317
- default86 as useDropdown,
318
- default87 as useDropzone,
317
+ default83 as useClickOutside,
318
+ default84 as useConversation,
319
+ default85 as useDate,
320
+ default86 as useDebounce,
321
+ default87 as useDirectory,
322
+ default88 as useDropdown,
323
+ default89 as useDropzone,
319
324
  useDropzoneContext,
320
325
  useEdificeClient,
321
- default88 as useEdificeIcons,
326
+ default90 as useEdificeIcons,
322
327
  useEdificeTheme,
323
328
  useFileToAttachment,
324
- default89 as useHasWorkflow,
325
- default90 as useHover,
326
- default91 as useHttpErrorToast,
327
- default92 as useImage,
328
- default93 as useInfiniteScroll,
329
- default94 as useIsAdmc,
330
- default95 as useIsAdml,
331
- default96 as useIsAdmlcOrAdmc,
332
- default97 as useKeyPress,
333
- default98 as useLibraryUrl,
334
- default99 as useMediaLibrary,
329
+ default91 as useHasWorkflow,
330
+ default92 as useHover,
331
+ default93 as useHttpErrorToast,
332
+ default94 as useImage,
333
+ default95 as useInfiniteScroll,
334
+ default96 as useIsAdmc,
335
+ default97 as useIsAdml,
336
+ default98 as useIsAdmlcOrAdmc,
337
+ default99 as useKeyPress,
338
+ default100 as useLibraryUrl,
339
+ default101 as useMediaLibrary,
340
+ default102 as useNextcloudSearch,
335
341
  useOverlay,
336
342
  usePageLayout,
337
- default100 as usePublicConf,
343
+ default103 as usePublicConf,
338
344
  useScreeb,
339
- default101 as useScrollToTop,
340
- default102 as useShareMutation,
341
- default103 as useTitle,
342
- default104 as useToast,
343
- default105 as useToggle,
344
- default106 as useTrapFocus,
345
- default107 as useTrashedResource,
345
+ default104 as useScrollToTop,
346
+ default105 as useShareMutation,
347
+ default106 as useTitle,
348
+ default107 as useToast,
349
+ default108 as useToggle,
350
+ default109 as useTrapFocus,
351
+ default110 as useTrashedResource,
346
352
  useTreeSortable,
347
353
  useTreeView,
348
- default108 as useUiOverride,
349
- default109 as useUpdateMutation,
350
- default110 as useUpload,
351
- default111 as useUploadFiles,
352
- default112 as useUser,
353
- default113 as useWorkspaceFile,
354
- default114 as useWorkspaceFolders,
355
- default115 as useWorkspaceFoldersTree,
356
- default116 as useWorkspaceSearch,
357
- default117 as useXitiTrackPageLoad,
358
- default118 as useZendeskGuide,
354
+ default111 as useUiOverride,
355
+ default112 as useUpdateMutation,
356
+ default113 as useUpload,
357
+ default114 as useUploadFiles,
358
+ default115 as useUser,
359
+ default116 as useWorkspaceFile,
360
+ default117 as useWorkspaceFolders,
361
+ default118 as useWorkspaceFoldersTree,
362
+ default119 as useWorkspaceSearch,
363
+ default120 as useXitiTrackPageLoad,
364
+ default121 as useZendeskGuide,
359
365
  wrapTreeNode
360
366
  };
@@ -0,0 +1,35 @@
1
+ import { jsxs, jsx } from "react/jsx-runtime";
2
+ import illuCommunities from "@edifice.io/bootstrap/dist/images/homepage/illu-communities.svg";
3
+ import { useMeasure } from "@uidotdev/usehooks";
4
+ import { useTranslation } from "react-i18next";
5
+ import SvgIconArrowRight from "../../../icons/components/IconArrowRight.js";
6
+ import CommunityItem from "./CommunityItem.js";
7
+ import HomeCard from "../HomeCard/HomeCard.js";
8
+ import Flex from "../../../../components/Flex/Flex.js";
9
+ import Image from "../../../../components/Image/Image.js";
10
+ const NARROW_CONTAINER_WIDTH = 800, MAX_ITEMS = 4, MAX_ITEMS_NARROW = 3, Communities = ({
11
+ communitiesList = [],
12
+ handleActionClick
13
+ }) => {
14
+ const {
15
+ t
16
+ } = useTranslation(), [containerRef, {
17
+ width
18
+ }] = useMeasure(), maxItems = width !== null && width < NARROW_CONTAINER_WIDTH ? MAX_ITEMS_NARROW : MAX_ITEMS, visibleCommunities = communitiesList.slice(0, maxItems), itemWidth = `${100 / maxItems}%`;
19
+ return /* @__PURE__ */ jsxs(HomeCard, { variant: "primary", children: [
20
+ /* @__PURE__ */ jsx(HomeCard.Header, { actionLabel: communitiesList.length > 0 ? t("homepage.communities.actionLabel.seeMore") : t("homepage.communities.actionLabel.create"), actionRightIcon: /* @__PURE__ */ jsx(SvgIconArrowRight, {}), onActionClick: handleActionClick, title: t("homepage.communities.title") }),
21
+ /* @__PURE__ */ jsx(HomeCard.Content, { children: /* @__PURE__ */ jsx(Flex, { ref: containerRef, gap: "16", children: visibleCommunities.length > 0 ? visibleCommunities.map((community, index) => /* @__PURE__ */ jsx(CommunityItem, { title: community.title, communityImage: community.communityImage, onActionClick: community.onActionClick, nbNotifications: community.nbNotifications, width: itemWidth }, index)) : /* @__PURE__ */ jsxs("div", { className: "communities-empty", children: [
22
+ /* @__PURE__ */ jsx(Image, { src: illuCommunities, alt: "", "aria-hidden": "true", style: {
23
+ width: 80,
24
+ height: 80
25
+ } }),
26
+ /* @__PURE__ */ jsxs("div", { className: "communities-empty-content", children: [
27
+ /* @__PURE__ */ jsx("p", { className: "communities-empty-title", children: t("homepage.communities.subtitle", "Créez votre première communauté pour animer votre classe !") }),
28
+ /* @__PURE__ */ jsx("p", { className: "communities-empty-description", children: t("homepage.communities.description", "Vous pouvez centraliser et organiser les documents et les ressources pour vos élèves.") })
29
+ ] })
30
+ ] }) }) })
31
+ ] });
32
+ };
33
+ export {
34
+ Communities as default
35
+ };
@@ -1,9 +1,11 @@
1
1
  import { CommunitiesModel } from './useCommunities';
2
2
  export type CommunitiesContainerProps = {
3
+ /** Handle a click on a community. If undefined, the community's home page will be opened. */
3
4
  onCommunityClick?: (community: CommunitiesModel) => void;
4
- onHeaderActionClick: () => void;
5
+ /** Handle a click on the header action button. If undefined, communities (or the community creation flow) will be opened. */
6
+ onHeaderActionClick?: () => void;
5
7
  };
6
- export declare function CommunitiesContainer({ onCommunityClick, onHeaderActionClick, }: CommunitiesContainerProps): import("react/jsx-runtime").JSX.Element | "An error occurred while loading communities.";
8
+ export declare function CommunitiesContainer({ onCommunityClick: handleCommunityClick, onHeaderActionClick: handleHeaderActionClick, }: CommunitiesContainerProps): import("react/jsx-runtime").JSX.Element | "An error occurred while loading communities.";
7
9
  export declare namespace CommunitiesContainer {
8
10
  var displayName: string;
9
11
  }
@@ -0,0 +1,31 @@
1
+ import { jsx } from "react/jsx-runtime";
2
+ import { useCallback, useMemo } from "react";
3
+ import Communities from "./Communities.js";
4
+ import CommunitiesSkeleton from "./CommunitiesSkeleton.js";
5
+ import { useCommunities } from "./useCommunities.js";
6
+ function CommunitiesContainer({
7
+ onCommunityClick: handleCommunityClick = (community) => {
8
+ window.open(`/communities/id/${community.id}/home`, "_self");
9
+ },
10
+ onHeaderActionClick: handleHeaderActionClick
11
+ }) {
12
+ const {
13
+ communities,
14
+ isLoading,
15
+ error
16
+ } = useCommunities(), handleActionClick = useCallback(() => {
17
+ if (handleHeaderActionClick) {
18
+ handleHeaderActionClick();
19
+ return;
20
+ }
21
+ window.open(communities.length > 0 ? "/communities" : "/communities/create/step-type", "_self");
22
+ }, [handleHeaderActionClick, communities.length]), mappedCommunities = useMemo(() => communities.map((community) => ({
23
+ title: community.title,
24
+ communityImage: community.image ?? "",
25
+ onActionClick: () => handleCommunityClick(community)
26
+ })), [communities, handleCommunityClick]);
27
+ return isLoading ? /* @__PURE__ */ jsx(CommunitiesSkeleton, {}) : error ? "An error occurred while loading communities." : /* @__PURE__ */ jsx(Communities, { communitiesList: mappedCommunities, handleActionClick });
28
+ }
29
+ export {
30
+ CommunitiesContainer
31
+ };