@edifice.io/react 2.6.2-develop-b2school.20260814155738 → 2.6.2-develop-integration.20260819104031

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 (49) hide show
  1. package/dist/components/Alert/Alert.js +1 -1
  2. package/dist/components/DatePicker/DatePicker.d.ts +0 -5
  3. package/dist/components/DatePicker/DatePicker.js +0 -2
  4. package/dist/hooks/index.d.ts +1 -0
  5. package/dist/hooks/useNextcloudSearch/index.d.ts +1 -0
  6. package/dist/hooks/useNextcloudSearch/useNextcloudSearch.d.ts +12 -0
  7. package/dist/hooks/useNextcloudSearch/useNextcloudSearch.js +56 -0
  8. package/dist/icons.js +338 -340
  9. package/dist/index.js +152 -146
  10. package/dist/modules/homepage/components/Favorites/Favorites.js +1 -1
  11. package/dist/modules/homepage/components/HomeCard/HomeCard.d.ts +1 -5
  12. package/dist/modules/homepage/components/HomeCard/HomeCard.js +2 -10
  13. package/dist/modules/homepage/components/LastInfos/LastInfosList.js +2 -2
  14. package/dist/modules/homepage/components/Notifications/NotificationList.js +2 -2
  15. package/dist/modules/homepage/components/Notifications/components/NotificationItemResource.d.ts +1 -2
  16. package/dist/modules/homepage/components/Notifications/components/NotificationItemResource.js +2 -3
  17. package/dist/modules/homepage/components/Notifications/components/UserNotificationItem.js +1 -1
  18. package/dist/modules/homepage/components/Notifications/components/notificationAdapter.d.ts +7 -21
  19. package/dist/modules/homepage/components/Notifications/components/notificationAdapter.js +13 -26
  20. package/dist/modules/homepage/components/SchoolSpace/SchoolSpace.js +11 -20
  21. package/dist/modules/homepage/components/UserSpace/UserSpace.js +2 -5
  22. package/dist/modules/icons/components/index.d.ts +0 -1
  23. package/dist/modules/multimedia/FileCard/NextcloudFileCard.d.ts +25 -0
  24. package/dist/modules/multimedia/FileCard/NextcloudFileCard.js +105 -0
  25. package/dist/modules/multimedia/FileCard/index.d.ts +2 -0
  26. package/dist/modules/multimedia/MediaLibrary/MediaLibrary.d.ts +2 -2
  27. package/dist/modules/multimedia/MediaLibrary/MediaLibrary.js +20 -7
  28. package/dist/modules/multimedia/MediaLibrary/innertabs/Nextcloud.d.ts +1 -0
  29. package/dist/modules/multimedia/MediaLibrary/innertabs/Nextcloud.js +35 -0
  30. package/dist/modules/multimedia/MediaLibrary/innertabs/index.d.ts +1 -0
  31. package/dist/modules/multimedia/MediaLibrary/innertabs/index.js +2 -0
  32. package/dist/modules/multimedia/Nextcloud/Nextcloud.d.ts +24 -0
  33. package/dist/modules/multimedia/Nextcloud/Nextcloud.js +109 -0
  34. package/dist/modules/multimedia/Nextcloud/index.d.ts +2 -0
  35. package/dist/modules/multimedia/index.d.ts +1 -0
  36. package/dist/multimedia.js +16 -12
  37. package/package.json +6 -6
  38. package/dist/modules/homepage/components/Communities/Communities.d.ts +0 -10
  39. package/dist/modules/homepage/components/Communities/CommunitiesContainer.d.ts +0 -9
  40. package/dist/modules/homepage/components/Communities/CommunitiesSkeleton.d.ts +0 -5
  41. package/dist/modules/homepage/components/Communities/CommunityItem.d.ts +0 -11
  42. package/dist/modules/homepage/components/Communities/index.d.ts +0 -8
  43. package/dist/modules/homepage/components/Communities/useCommunities.d.ts +0 -13
  44. package/dist/modules/homepage/components/UserSpace/hooks/useChildren.d.ts +0 -14
  45. package/dist/modules/homepage/components/UserSpace/hooks/useChildren.js +0 -23
  46. package/dist/modules/homepage/components/UserSpace/hooks/useProfileLinks.d.ts +0 -8
  47. package/dist/modules/homepage/components/UserSpace/hooks/useProfileLinks.js +0 -65
  48. package/dist/modules/icons/components/IconClass.d.ts +0 -7
  49. package/dist/modules/icons/components/IconClass.js +0 -13
@@ -64,7 +64,7 @@ const Alert = /* @__PURE__ */ forwardRef(({
64
64
  }, divContainerClasses = clsx("alert gap-12", mapping[type].classModifier, toastClasses, confirmClasses, position, className);
65
65
  return /* @__PURE__ */ jsx(Fragment, { children: isVisible ? /* @__PURE__ */ jsxs("div", { ref: refAlert, className: divContainerClasses, role: "alert", children: [
66
66
  !isConfirm && mapping[type].icon,
67
- /* @__PURE__ */ jsx("div", { className: "alert-content small flex-grow-1", children }),
67
+ /* @__PURE__ */ jsx("div", { className: "alert-content small", children }),
68
68
  button && /* @__PURE__ */ jsxs("div", { className: "ms-12", children: [
69
69
  button,
70
70
  " ",
@@ -28,11 +28,6 @@ export interface DatePickerProps extends Omit<React.HTMLAttributes<HTMLElement>,
28
28
  * Maximum selectable date
29
29
  */
30
30
  maxDate?: Date;
31
- /**
32
- * Disables the input and prevents the calendar popup from opening.
33
- * @default false
34
- */
35
- disabled?: boolean;
36
31
  }
37
32
  /**
38
33
  * Type for DatePicker ref
@@ -17,7 +17,6 @@ const DatePicker = /* @__PURE__ */ forwardRef(({
17
17
  dateFormat = "DD / MM / YYYY",
18
18
  minDate,
19
19
  maxDate,
20
- disabled,
21
20
  ...htmlProps
22
21
  }, ref) => {
23
22
  const handleChange = (date) => {
@@ -28,7 +27,6 @@ const DatePicker = /* @__PURE__ */ forwardRef(({
28
27
  format: dateFormat,
29
28
  minDate: minDate ? dayjs(minDate) : void 0,
30
29
  maxDate: maxDate ? dayjs(maxDate) : void 0,
31
- disabled,
32
30
  ref,
33
31
  // Cast necessary because AntDatePicker expects a specific type, but our API exposes only HTMLElement to avoid dependency on Ant Design-specific features.
34
32
  ...htmlProps
@@ -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,12 @@
1
+ import { ID, NextcloudDocument } from '@edifice.io/client';
2
+ import { TreeData } from '../../types';
3
+ export type NextcloudFolderNode = TreeData & {
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
+ refetchAuthStatus: () => void;
11
+ loadContent: (folderId?: ID) => void;
12
+ };
@@ -0,0 +1,56 @@
1
+ import { useReducer, useCallback } from "react";
2
+ import { odeServices } from "@edifice.io/client";
3
+ import { useQueryClient, useQuery } from "@tanstack/react-query";
4
+ import { findNodeById } from "../../components/TreeView/utilities/treeview.js";
5
+ function useNextcloudSearch(rootId, rootName, userId) {
6
+ var _a;
7
+ function treeReducer(state, action) {
8
+ switch (action.type) {
9
+ case "update": {
10
+ const node = findNodeById(state, action.folderId);
11
+ return node && (node.children = action.subfolders.map((f) => ({
12
+ id: f.path,
13
+ name: f.name
14
+ })), node.files = action.files), {
15
+ ...state
16
+ };
17
+ }
18
+ default:
19
+ throw Error("[useNextcloudSearch] Unknown action type: " + action.type);
20
+ }
21
+ }
22
+ const [root, dispatch] = useReducer(treeReducer, {
23
+ id: rootId,
24
+ name: rootName,
25
+ section: !0
26
+ }), queryClient = useQueryClient(), oauth2StatusQuery = useQuery({
27
+ queryKey: ["nextcloud", "oauth2-status", userId],
28
+ queryFn: () => odeServices.nextcloud().getOauth2Status(userId),
29
+ enabled: !!userId
30
+ }), needsAuth = !((_a = oauth2StatusQuery.data) != null && _a.connected), loadContent = useCallback(async (folderId) => {
31
+ if (!userId) return;
32
+ const path = folderId === rootId ? void 0 : folderId, payload = await queryClient.fetchQuery({
33
+ queryKey: ["nextcloud", "documents", userId, path ?? "/"],
34
+ queryFn: () => odeServices.nextcloud().listDocuments(userId, path),
35
+ staleTime: 6e4
36
+ }), subfolders = [], files = [], currentPath = path ?? "/";
37
+ payload.filter((doc) => doc.path !== currentPath).forEach((doc) => {
38
+ doc.isFolder ? subfolders.push(doc) : files.push(doc);
39
+ }), dispatch({
40
+ folderId,
41
+ subfolders,
42
+ files,
43
+ type: "update"
44
+ });
45
+ }, [rootId, userId, queryClient]);
46
+ return {
47
+ root,
48
+ needsAuth,
49
+ isCheckingAuth: oauth2StatusQuery.isLoading,
50
+ refetchAuthStatus: oauth2StatusQuery.refetch,
51
+ loadContent
52
+ };
53
+ }
54
+ export {
55
+ useNextcloudSearch as default
56
+ };