@edifice.io/react 2.6.2-develop-integration-crna.20260823185851 → 2.6.2-develop-integration.20260824122250
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/Alert/Alert.js +1 -1
- package/dist/components/DatePicker/DatePicker.d.ts +0 -5
- package/dist/components/DatePicker/DatePicker.js +0 -2
- package/dist/components/Layout/Layout.js +3 -5
- package/dist/hooks/index.d.ts +1 -0
- package/dist/hooks/useNextcloudSearch/index.d.ts +1 -0
- package/dist/hooks/useNextcloudSearch/useNextcloudSearch.d.ts +12 -0
- package/dist/hooks/useNextcloudSearch/useNextcloudSearch.js +56 -0
- package/dist/icons.js +338 -340
- package/dist/index.js +152 -146
- package/dist/modules/homepage/components/Favorites/Favorites.js +4 -7
- package/dist/modules/homepage/components/HomeCard/HomeCard.d.ts +1 -5
- package/dist/modules/homepage/components/HomeCard/HomeCard.js +2 -10
- package/dist/modules/homepage/components/LastInfos/LastInfosList.js +2 -2
- package/dist/modules/homepage/components/Notifications/NotificationItem.js +4 -5
- package/dist/modules/homepage/components/Notifications/NotificationList.d.ts +1 -7
- package/dist/modules/homepage/components/Notifications/NotificationList.js +3 -10
- package/dist/modules/homepage/components/Notifications/NotificationListContainer.js +1 -4
- package/dist/modules/homepage/components/Notifications/components/CommonNotificationItem.d.ts +1 -2
- package/dist/modules/homepage/components/Notifications/components/CommonNotificationItem.js +10 -14
- package/dist/modules/homepage/components/Notifications/components/NotificationItemResource.d.ts +1 -2
- package/dist/modules/homepage/components/Notifications/components/NotificationItemResource.js +2 -3
- package/dist/modules/homepage/components/Notifications/components/SystemNotificationItem.d.ts +1 -3
- package/dist/modules/homepage/components/Notifications/components/SystemNotificationItem.js +2 -3
- package/dist/modules/homepage/components/Notifications/components/UserNotificationItem.d.ts +1 -3
- package/dist/modules/homepage/components/Notifications/components/UserNotificationItem.js +2 -3
- package/dist/modules/homepage/components/Notifications/components/notificationAdapter.d.ts +7 -22
- package/dist/modules/homepage/components/Notifications/components/notificationAdapter.js +13 -27
- package/dist/modules/homepage/components/Notifications/hooks/useNotificationList.d.ts +1 -5
- package/dist/modules/homepage/components/Notifications/hooks/useNotificationList.js +2 -22
- package/dist/modules/homepage/components/Notifications/services/api/index.d.ts +0 -2
- package/dist/modules/homepage/components/Notifications/services/api/notificationService.d.ts +0 -8
- package/dist/modules/homepage/components/Notifications/services/api/notificationService.js +0 -12
- package/dist/modules/homepage/components/Notifications/services/queries/notification.d.ts +1 -13
- package/dist/modules/homepage/components/Notifications/services/queries/notification.js +4 -41
- package/dist/modules/homepage/components/SchoolSpace/SchoolSpace.js +11 -20
- package/dist/modules/homepage/components/UserSpace/UserSpace.js +2 -5
- package/dist/modules/icons/components/index.d.ts +0 -1
- package/dist/modules/multimedia/FileCard/NextcloudFileCard.d.ts +25 -0
- package/dist/modules/multimedia/FileCard/NextcloudFileCard.js +105 -0
- package/dist/modules/multimedia/FileCard/index.d.ts +2 -0
- package/dist/modules/multimedia/MediaLibrary/MediaLibrary.d.ts +2 -2
- package/dist/modules/multimedia/MediaLibrary/MediaLibrary.js +20 -7
- package/dist/modules/multimedia/MediaLibrary/innertabs/Nextcloud.d.ts +1 -0
- package/dist/modules/multimedia/MediaLibrary/innertabs/Nextcloud.js +35 -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/Nextcloud/Nextcloud.d.ts +24 -0
- package/dist/modules/multimedia/Nextcloud/Nextcloud.js +109 -0
- package/dist/modules/multimedia/Nextcloud/index.d.ts +2 -0
- package/dist/modules/multimedia/index.d.ts +1 -0
- package/dist/multimedia.js +16 -12
- package/package.json +6 -6
- package/dist/modules/homepage/components/Communities/Communities.d.ts +0 -10
- package/dist/modules/homepage/components/Communities/CommunitiesContainer.d.ts +0 -9
- package/dist/modules/homepage/components/Communities/CommunitiesSkeleton.d.ts +0 -5
- package/dist/modules/homepage/components/Communities/CommunityItem.d.ts +0 -11
- package/dist/modules/homepage/components/Communities/index.d.ts +0 -8
- package/dist/modules/homepage/components/Communities/useCommunities.d.ts +0 -13
- package/dist/modules/homepage/components/Notifications/components/NotificationFilterMenu.d.ts +0 -16
- package/dist/modules/homepage/components/Notifications/components/NotificationFilterMenu.js +0 -29
- package/dist/modules/homepage/components/Notifications/components/NotificationFilterModal.d.ts +0 -18
- package/dist/modules/homepage/components/Notifications/components/NotificationFilterModal.js +0 -67
- package/dist/modules/homepage/components/Notifications/components/NotificationOptionsMenu.d.ts +0 -12
- package/dist/modules/homepage/components/Notifications/components/NotificationOptionsMenu.js +0 -42
- package/dist/modules/homepage/components/Notifications/components/ReportNotificationModal.d.ts +0 -13
- package/dist/modules/homepage/components/Notifications/components/ReportNotificationModal.js +0 -31
- package/dist/modules/homepage/components/UserSpace/hooks/useChildren.d.ts +0 -14
- package/dist/modules/homepage/components/UserSpace/hooks/useChildren.js +0 -23
- package/dist/modules/homepage/components/UserSpace/hooks/useProfileLinks.d.ts +0 -8
- package/dist/modules/homepage/components/UserSpace/hooks/useProfileLinks.js +0 -65
- package/dist/modules/icons/components/IconClass.d.ts +0 -7
- 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
|
|
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
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
1
|
+
import { jsx, jsxs, Fragment } from "react/jsx-runtime";
|
|
2
2
|
import { Suspense, lazy } from "react";
|
|
3
3
|
import clsx from "clsx";
|
|
4
4
|
import { Toaster } from "react-hot-toast";
|
|
@@ -22,7 +22,7 @@ const HeaderV2 = /* @__PURE__ */ lazy(() => import("../../modules/homepage/compo
|
|
|
22
22
|
}) => {
|
|
23
23
|
const {
|
|
24
24
|
theme
|
|
25
|
-
} = useEdificeTheme(), override = useUiOverride("layout.header"), isHeaderV2 = (override == null ? void 0 : override.variant) === "v2",
|
|
25
|
+
} = useEdificeTheme(), override = useUiOverride("layout.header"), isHeaderV2 = (override == null ? void 0 : override.variant) === "v2", {
|
|
26
26
|
toggleOverlay
|
|
27
27
|
} = useOverlay(), {
|
|
28
28
|
t
|
|
@@ -40,9 +40,7 @@ const HeaderV2 = /* @__PURE__ */ lazy(() => import("../../modules/homepage/compo
|
|
|
40
40
|
}, className), renderHeader = headless ? null : isHeaderV2 ? /* @__PURE__ */ jsx(Suspense, { fallback: null, children: /* @__PURE__ */ jsx(HeaderV2, { src: theme == null ? void 0 : theme.basePath, dataProduct: override == null ? void 0 : override.theme, onNotificationsClick: toggleOverlay }) }) : /* @__PURE__ */ jsx(Header, { is1d: theme == null ? void 0 : theme.is1d, src: theme == null ? void 0 : theme.basePath }), renderNotificationsOverlay = !headless && isHeaderV2 && /* @__PURE__ */ jsx(HeaderNotificationsOverlay, {}), renderCookies = showCookiesConsent && /* @__PURE__ */ jsx(Alert, { type: "info", className: "m-12 rgpd", isConfirm: !0, position: "bottom-right", button: /* @__PURE__ */ jsx(Button, { color: "tertiary", variant: "ghost", onClick: handleConsultCookies, children: t("rgpd.cookies.banner.button.consult") }), onClose: handleCloseCookiesConsent, children: t("rgpd.cookies.banner.text1") }), renderToaster = /* @__PURE__ */ jsx(Toaster, { containerClassName: "toaster-container", toastOptions: {
|
|
41
41
|
position: "top-right"
|
|
42
42
|
} });
|
|
43
|
-
return /* @__PURE__ */ jsxs(
|
|
44
|
-
"layout-has-background-image": hasBackgroundImage
|
|
45
|
-
}), "data-product": hasBackgroundImage ? backgroundOverride == null ? void 0 : backgroundOverride.theme : void 0, children: [
|
|
43
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
46
44
|
renderHeader,
|
|
47
45
|
renderNotificationsOverlay,
|
|
48
46
|
/* @__PURE__ */ jsx("main", { className: classes, ...restProps, children }),
|
package/dist/hooks/index.d.ts
CHANGED
|
@@ -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
|
+
};
|