@edifice.io/react 2.6.9-develop-b2school.20261013113840 → 2.6.9-develop-pedago.20261013143657
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/Layout/Layout.js +4 -12
- package/dist/components/Layout/components/Header.js +4 -4
- package/dist/components/Layout/components/NavLink.d.ts +3 -3
- package/dist/components/Layout/components/NavLink.js +3 -5
- package/dist/components/index.d.ts +0 -1
- package/dist/homepage.js +0 -10
- package/dist/hooks/useZendeskGuide/useZendeskGuide.d.ts +6 -2
- package/dist/hooks/useZendeskGuide/useZendeskGuide.js +8 -11
- package/dist/icons.js +402 -404
- package/dist/index.js +136 -138
- package/dist/modules/HelpZone/HelpZone.js +8 -6
- package/dist/modules/HelpZone/HelpZoneContainer.js +5 -2
- package/dist/modules/homepage/components/Header/Header.js +11 -27
- 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/MessageFlashList/MessageFlash.js +1 -1
- package/dist/modules/homepage/components/Notifications/NotificationList.js +5 -5
- package/dist/modules/homepage/components/Notifications/NotificationSkeleton.js +2 -2
- package/dist/modules/homepage/components/Notifications/components/NotificationFilterMenu.js +5 -1
- package/dist/modules/homepage/components/Notifications/components/NotificationFilterModal.js +12 -10
- package/dist/modules/homepage/components/Notifications/components/NotificationOptionsMenu.js +9 -3
- package/dist/modules/homepage/components/Notifications/components/ReportNotificationModal.js +12 -6
- package/dist/modules/homepage/components/Notifications/components/notificationAdapter.js +10 -12
- package/dist/modules/homepage/components/Notifications/hooks/useNotificationList.js +10 -9
- package/dist/modules/homepage/components/UserSpace/UserSpace.d.ts +1 -3
- package/dist/modules/homepage/components/UserSpace/UserSpace.js +7 -13
- package/dist/modules/homepage/components/UserSpace/UserSpaceContainer.d.ts +2 -4
- package/dist/modules/homepage/components/UserSpace/UserSpaceContainer.js +2 -3
- package/dist/modules/homepage/components/index.d.ts +1 -3
- package/dist/modules/icons/components/index.d.ts +0 -1
- package/dist/modules/multimedia/MediaLibrary/MediaLibrary.d.ts +2 -0
- package/dist/modules/multimedia/MediaLibrary/MediaLibrary.js +2 -0
- package/dist/modules/multimedia/MediaLibrary/MediaLibraryContext.d.ts +4 -0
- package/dist/modules/multimedia/MediaLibrary/innertabs/Upload.js +2 -1
- package/dist/modules/multimedia/MediaLibrary/innertabs/Workspace.js +3 -0
- package/package.json +6 -6
- package/dist/components/RadioTile/RadioTile.d.ts +0 -35
- package/dist/components/RadioTile/RadioTile.js +0 -22
- package/dist/components/RadioTile/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/Header/MyAppsPopover.d.ts +0 -5
- package/dist/modules/homepage/components/Header/MyAppsPopover.js +0 -28
- package/dist/modules/homepage/components/Header/useSafeHoverPopover.js +0 -32
- 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
package/dist/modules/homepage/components/Notifications/components/NotificationFilterModal.js
CHANGED
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
2
|
import clsx from "clsx";
|
|
3
|
-
import { useState, useMemo } from "react";
|
|
3
|
+
import { useState, useRef, useMemo, useEffect } from "react";
|
|
4
4
|
import { useTranslation } from "react-i18next";
|
|
5
5
|
import SvgIconCheck from "../../../../icons/components/IconCheck.js";
|
|
6
6
|
import { getAppCodeAndI18nKey } from "./notificationAdapter.js";
|
|
7
|
-
import
|
|
7
|
+
import Modal from "../../../../../components/Modal/Modal.js";
|
|
8
8
|
import Flex from "../../../../../components/Flex/Flex.js";
|
|
9
|
-
import Checkbox from "../../../../../components/Checkbox/Checkbox.js";
|
|
10
9
|
import AppIcon from "../../../../../components/AppIcon/AppIcon.js";
|
|
11
10
|
import ButtonBeta from "../../../../../components/ButtonBeta/ButtonBeta.js";
|
|
12
11
|
const NotificationFilterModal = ({
|
|
@@ -19,7 +18,7 @@ const NotificationFilterModal = ({
|
|
|
19
18
|
const {
|
|
20
19
|
t,
|
|
21
20
|
i18n
|
|
22
|
-
} = useTranslation(), [selected, setSelected] = useState(appliedTypes), allTypesSorted = useMemo(() => allTypes.map((type) => {
|
|
21
|
+
} = useTranslation(), [selected, setSelected] = useState(appliedTypes), refSelectAllCheckbox = useRef(null), allTypesSorted = useMemo(() => allTypes.map((type) => {
|
|
23
22
|
const [appCode, appI18nKey] = getAppCodeAndI18nKey(type), label = t(appI18nKey, {
|
|
24
23
|
defaultValue: appCode
|
|
25
24
|
});
|
|
@@ -36,13 +35,16 @@ const NotificationFilterModal = ({
|
|
|
36
35
|
}, toggleAll = () => {
|
|
37
36
|
setSelected(selected.length === allTypes.length ? [] : allTypes);
|
|
38
37
|
};
|
|
39
|
-
return
|
|
40
|
-
|
|
41
|
-
|
|
38
|
+
return useEffect(() => {
|
|
39
|
+
refSelectAllCheckbox.current && (refSelectAllCheckbox.current.indeterminate = selected.length > 0 && selected.length < allTypes.length);
|
|
40
|
+
}, [selected.length, allTypes.length]), /* @__PURE__ */ jsxs(Modal, { id: "notification-filter-modal", size: "lg", scrollable: !0, isOpen, onModalClose: onCancel, children: [
|
|
41
|
+
/* @__PURE__ */ jsx(Modal.Header, { onModalClose: onCancel, children: t("homepage.notifications.filter-modal.title") }),
|
|
42
|
+
/* @__PURE__ */ jsx(Modal.Subtitle, { children: t("homepage.notifications.filter-modal.subtitle") }),
|
|
43
|
+
/* @__PURE__ */ jsxs(Modal.Body, { children: [
|
|
42
44
|
/* @__PURE__ */ jsxs(Flex, { align: "center", gap: "8", className: "mb-24", children: [
|
|
43
45
|
/* @__PURE__ */ jsxs("label", { className: "notification-filter-select-all notification-filter-chip", children: [
|
|
44
46
|
/* @__PURE__ */ jsx("span", { children: t("homepage.notifications.filter-modal.select-all") }),
|
|
45
|
-
/* @__PURE__ */ jsx(
|
|
47
|
+
/* @__PURE__ */ jsx("input", { type: "checkbox", ref: refSelectAllCheckbox, checked: selected.length === allTypes.length, className: "notification-filter-checkbox", onChange: toggleAll })
|
|
46
48
|
] }),
|
|
47
49
|
/* @__PURE__ */ jsx("span", { className: "notification-filter-count", children: t("homepage.notifications.filter-modal.count", {
|
|
48
50
|
selected: selected.length,
|
|
@@ -60,11 +62,11 @@ const NotificationFilterModal = ({
|
|
|
60
62
|
}), children: [
|
|
61
63
|
/* @__PURE__ */ jsx(AppIcon, { app: appCode, size: "24", iconFit: "contain" }),
|
|
62
64
|
/* @__PURE__ */ jsx("span", { children: label }),
|
|
63
|
-
/* @__PURE__ */ jsx(
|
|
65
|
+
/* @__PURE__ */ jsx("input", { type: "checkbox", className: "notification-filter-checkbox", checked, onChange: () => toggleType(type) })
|
|
64
66
|
] }, type);
|
|
65
67
|
}) })
|
|
66
68
|
] }),
|
|
67
|
-
/* @__PURE__ */ jsxs(
|
|
69
|
+
/* @__PURE__ */ jsxs(Modal.Footer, { children: [
|
|
68
70
|
/* @__PURE__ */ jsx(ButtonBeta, { color: "tertiary", onClick: onCancel, type: "button", variant: "ghost", children: t("cancel") }),
|
|
69
71
|
/* @__PURE__ */ jsx(ButtonBeta, { color: "default", onClick: () => onApply(selected), type: "button", variant: "filled", rightIcon: /* @__PURE__ */ jsx(SvgIconCheck, {}), children: t("homepage.notifications.filter-modal.confirm") })
|
|
70
72
|
] })
|
package/dist/modules/homepage/components/Notifications/components/NotificationOptionsMenu.js
CHANGED
|
@@ -20,10 +20,16 @@ const NotificationOptionsMenu = ({
|
|
|
20
20
|
} = useDeleteNotification(), [isReportModalOpen, setIsReportModalOpen] = useState(!1);
|
|
21
21
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
22
22
|
/* @__PURE__ */ jsx(Dropdown, { overflow: !1, children: (triggerProps) => /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
23
|
-
/* @__PURE__ */ jsx(IconButton, { ...triggerProps, type: "button", "aria-label": t("homepage.notifications.options.label"
|
|
23
|
+
/* @__PURE__ */ jsx(IconButton, { ...triggerProps, type: "button", "aria-label": t("homepage.notifications.options.label", {
|
|
24
|
+
defaultValue: "Options de la notification"
|
|
25
|
+
}), color: "tertiary", variant: "ghost", icon: /* @__PURE__ */ jsx(SvgIconOptions, {}), "data-testid": "notification-item-options-button" }),
|
|
24
26
|
/* @__PURE__ */ jsxs(Dropdown.Menu, { children: [
|
|
25
|
-
/* @__PURE__ */ jsx(Dropdown.Item, { icon: /* @__PURE__ */ jsx(SvgIconAlertTriangle, {}), onClick: () => setIsReportModalOpen(!0), children: t("homepage.notifications.options.report"
|
|
26
|
-
|
|
27
|
+
/* @__PURE__ */ jsx(Dropdown.Item, { icon: /* @__PURE__ */ jsx(SvgIconAlertTriangle, {}), onClick: () => setIsReportModalOpen(!0), children: t("homepage.notifications.options.report", {
|
|
28
|
+
defaultValue: "Signaler"
|
|
29
|
+
}) }),
|
|
30
|
+
/* @__PURE__ */ jsx(Dropdown.Item, { icon: /* @__PURE__ */ jsx(SvgIconDelete, {}), onClick: () => deleteNotification(notificationId), children: t("homepage.notifications.options.delete", {
|
|
31
|
+
defaultValue: "Supprimer"
|
|
32
|
+
}) })
|
|
27
33
|
] })
|
|
28
34
|
] }) }),
|
|
29
35
|
isReportModalOpen && /* @__PURE__ */ jsx(ReportNotificationModal, { isOpen: isReportModalOpen, onCancel: () => setIsReportModalOpen(!1), onConfirm: () => {
|
package/dist/modules/homepage/components/Notifications/components/ReportNotificationModal.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
2
|
import { useTranslation } from "react-i18next";
|
|
3
3
|
import SvgIconAlertTriangle from "../../../../icons/components/IconAlertTriangle.js";
|
|
4
|
-
import
|
|
4
|
+
import Modal from "../../../../../components/Modal/Modal.js";
|
|
5
5
|
import ButtonBeta from "../../../../../components/ButtonBeta/ButtonBeta.js";
|
|
6
6
|
const ReportNotificationModal = ({
|
|
7
7
|
isOpen,
|
|
@@ -11,12 +11,18 @@ const ReportNotificationModal = ({
|
|
|
11
11
|
const {
|
|
12
12
|
t
|
|
13
13
|
} = useTranslation();
|
|
14
|
-
return /* @__PURE__ */ jsxs(
|
|
15
|
-
/* @__PURE__ */ jsx(
|
|
16
|
-
|
|
17
|
-
|
|
14
|
+
return /* @__PURE__ */ jsxs(Modal, { id: "report-notification-modal", size: "sm", isOpen, onModalClose: onCancel, children: [
|
|
15
|
+
/* @__PURE__ */ jsx(Modal.Header, { onModalClose: onCancel, children: t("homepage.notifications.report-modal.title", {
|
|
16
|
+
defaultValue: "Signaler une notification"
|
|
17
|
+
}) }),
|
|
18
|
+
/* @__PURE__ */ jsx(Modal.Body, { children: /* @__PURE__ */ jsx("p", { children: t("homepage.notifications.report-modal.body", {
|
|
19
|
+
defaultValue: "Attention ! Vous souhaitez signaler une notification inappropriée ou qui ne respecte pas les conditions d'utilisation de ONE. L'heure et l'origine de ce signalement seront enregistrées et transmises à un administrateur pour traitement."
|
|
20
|
+
}) }) }),
|
|
21
|
+
/* @__PURE__ */ jsxs(Modal.Footer, { children: [
|
|
18
22
|
/* @__PURE__ */ jsx(ButtonBeta, { color: "tertiary", onClick: onCancel, type: "button", variant: "ghost", children: t("cancel") }),
|
|
19
|
-
/* @__PURE__ */ jsx(ButtonBeta, { color: "default", onClick: onConfirm, type: "button", variant: "filled", leftIcon: /* @__PURE__ */ jsx(SvgIconAlertTriangle, {}), children: t("homepage.notifications.report-modal.confirm"
|
|
23
|
+
/* @__PURE__ */ jsx(ButtonBeta, { color: "default", onClick: onConfirm, type: "button", variant: "filled", leftIcon: /* @__PURE__ */ jsx(SvgIconAlertTriangle, {}), children: t("homepage.notifications.report-modal.confirm", {
|
|
24
|
+
defaultValue: "Signaler la notification"
|
|
25
|
+
}) })
|
|
20
26
|
] })
|
|
21
27
|
] });
|
|
22
28
|
};
|
|
@@ -8,36 +8,34 @@ const resolveNotificationResourceUri = (params, type, appCode, eventType) => {
|
|
|
8
8
|
return value;
|
|
9
9
|
}, parseNotificationMessage = (message) => message.replace(/<\/a>/gi, "</strong>").replace(/<a\b[^>]*>/gi, "<strong>"), getAppCodeAndI18nKey = (appCode) => {
|
|
10
10
|
appCode = appCode.toLowerCase();
|
|
11
|
-
|
|
11
|
+
let appI18nKey = appCode;
|
|
12
12
|
switch (appCode) {
|
|
13
|
-
case "collaborativeeditor":
|
|
14
|
-
appCode = "pad";
|
|
15
|
-
break;
|
|
16
13
|
case "collaborativewall":
|
|
17
14
|
appCode = "collaborative-wall";
|
|
18
15
|
break;
|
|
19
16
|
case "formulaire":
|
|
20
|
-
appCode = "forms";
|
|
17
|
+
appI18nKey = "formulaire", appCode = "forms";
|
|
21
18
|
break;
|
|
22
19
|
case "messagerie":
|
|
23
|
-
appCode = "conversation";
|
|
20
|
+
appI18nKey = appCode = "conversation";
|
|
24
21
|
break;
|
|
25
22
|
case "news":
|
|
26
|
-
appCode = "actualites";
|
|
23
|
+
appI18nKey = appCode = "actualites";
|
|
27
24
|
break;
|
|
28
25
|
case "homeworks":
|
|
29
26
|
appCode = "cahier-de-texte";
|
|
30
27
|
break;
|
|
31
28
|
case "userbook_motto":
|
|
29
|
+
appI18nKey = "userbook_motto", appCode = "userbook";
|
|
30
|
+
break;
|
|
32
31
|
case "userbook_mood":
|
|
33
|
-
|
|
34
|
-
appCode = "userbook";
|
|
32
|
+
appI18nKey = "userbook_mood", appCode = "userbook";
|
|
35
33
|
break;
|
|
36
|
-
case "
|
|
37
|
-
appCode = "
|
|
34
|
+
case "userbook_discovervisiblegroups":
|
|
35
|
+
appI18nKey = "userbook_discovervisiblegroups", appCode = "userbook";
|
|
38
36
|
break;
|
|
39
37
|
default:
|
|
40
|
-
appCode = appCode.replace(/_/g, "-");
|
|
38
|
+
appI18nKey = appCode = appCode.replace(/_/g, "-");
|
|
41
39
|
}
|
|
42
40
|
return [appCode, appI18nKey];
|
|
43
41
|
}, notificationAdapter = (notification) => {
|
|
@@ -14,30 +14,31 @@ const useNotificationListContainer = () => {
|
|
|
14
14
|
mutate: saveTimelinePreference
|
|
15
15
|
} = useSaveTimelinePreference(), [selectedTypes, setSelectedTypesState] = useState();
|
|
16
16
|
useEffect(() => {
|
|
17
|
-
selectedTypes === void 0 && isFetchedTypes && isFetchedPreference
|
|
17
|
+
if (selectedTypes === void 0 && isFetchedTypes && isFetchedPreference) {
|
|
18
|
+
const preferredTypes = preference == null ? void 0 : preference.type;
|
|
19
|
+
setSelectedTypesState(preferredTypes && preferredTypes.length > 0 ? preferredTypes : notificationTypes ?? []);
|
|
20
|
+
}
|
|
18
21
|
}, [selectedTypes, isFetchedTypes, isFetchedPreference, preference, notificationTypes]);
|
|
19
22
|
const setSelectedTypes = (types) => {
|
|
20
23
|
setSelectedTypesState(types), saveTimelinePreference({
|
|
21
24
|
...preference,
|
|
22
25
|
type: types
|
|
23
26
|
});
|
|
24
|
-
},
|
|
25
|
-
data,
|
|
27
|
+
}, {
|
|
28
|
+
data: notifications,
|
|
26
29
|
hasNextPage,
|
|
27
30
|
isLoading: isLoadingNotifications,
|
|
28
31
|
error: errorNotifications,
|
|
29
32
|
fetchNextPage
|
|
30
|
-
} = useNotifications(selectedTypes ?? [], isFetchedTypes && !!selectedTypes
|
|
33
|
+
} = useNotifications(selectedTypes ?? [], isFetchedTypes && !!selectedTypes);
|
|
31
34
|
return {
|
|
32
|
-
notifications
|
|
35
|
+
notifications,
|
|
33
36
|
notificationTypes,
|
|
34
37
|
selectedTypes,
|
|
35
38
|
setSelectedTypes,
|
|
36
|
-
hasNextPage
|
|
39
|
+
hasNextPage,
|
|
37
40
|
loadNextPage: () => fetchNextPage(),
|
|
38
|
-
|
|
39
|
-
// read, so this wait must count as loading too.
|
|
40
|
-
isLoading: isLoadingTypes || selectedTypes === void 0 || isLoadingNotifications,
|
|
41
|
+
isLoading: isLoadingTypes || isLoadingNotifications,
|
|
41
42
|
error: errorTypes || errorNotifications
|
|
42
43
|
};
|
|
43
44
|
}, useHasNotificationToday = () => {
|
|
@@ -5,10 +5,8 @@ export type UserSpaceProps = {
|
|
|
5
5
|
avatar: string;
|
|
6
6
|
profile: UserProfile[number];
|
|
7
7
|
children?: ReactNode;
|
|
8
|
-
/** Renders a trigger button in the top-right corner when provided. */
|
|
9
|
-
onCustomizeWidgetsClick?: () => void;
|
|
10
8
|
};
|
|
11
|
-
declare function UserSpace({ name, avatar, profile, children,
|
|
9
|
+
declare function UserSpace({ name, avatar, profile, children, }: UserSpaceProps): import("react/jsx-runtime").JSX.Element;
|
|
12
10
|
declare namespace UserSpace {
|
|
13
11
|
var displayName: string;
|
|
14
12
|
}
|
|
@@ -1,33 +1,27 @@
|
|
|
1
1
|
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
2
|
import { useTranslation } from "react-i18next";
|
|
3
|
-
import SvgIconAddWidget from "../../../icons/components/IconAddWidget.js";
|
|
4
3
|
import SvgIconClass from "../../../icons/components/IconClass.js";
|
|
5
4
|
import { useProfileLinks } from "./hooks/useProfileLinks.js";
|
|
6
5
|
import HomeCard from "../HomeCard/HomeCard.js";
|
|
7
6
|
import Flex from "../../../../components/Flex/Flex.js";
|
|
8
7
|
import Avatar from "../../../../components/Avatar/Avatar.js";
|
|
9
|
-
import IconButton from "../../../../components/Button/IconButton.js";
|
|
10
8
|
import ButtonBeta from "../../../../components/ButtonBeta/ButtonBeta.js";
|
|
11
9
|
function UserSpace({
|
|
12
10
|
name,
|
|
13
11
|
avatar,
|
|
14
12
|
profile,
|
|
15
|
-
children
|
|
16
|
-
onCustomizeWidgetsClick
|
|
13
|
+
children
|
|
17
14
|
}) {
|
|
18
15
|
const {
|
|
19
16
|
t
|
|
20
17
|
} = useTranslation(), links = useProfileLinks(profile);
|
|
21
18
|
return /* @__PURE__ */ jsxs(HomeCard, { variant: "user", footer: !!links && /* @__PURE__ */ jsx(Flex, { children: links.map((link, index) => /* @__PURE__ */ jsx(ButtonBeta, { size: "sm", variant: "ghost", leftIcon: /* @__PURE__ */ jsx(SvgIconClass, {}), onClick: () => window.location.href = link.url, children: link.text }, `${link.url}-${index}`)) }), children: [
|
|
22
|
-
/* @__PURE__ */ jsxs(Flex, { className: "user-space", direction: "row",
|
|
23
|
-
/* @__PURE__ */
|
|
24
|
-
|
|
25
|
-
/* @__PURE__ */
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
] })
|
|
29
|
-
] }),
|
|
30
|
-
onCustomizeWidgetsClick && /* @__PURE__ */ jsx(IconButton, { className: "user-space--customize-widgets", icon: /* @__PURE__ */ jsx(SvgIconAddWidget, {}), variant: "ghost", color: "tertiary", "aria-label": t("homepage.userSpace.customizeWidgets"), onClick: onCustomizeWidgetsClick })
|
|
19
|
+
/* @__PURE__ */ jsxs(Flex, { className: "user-space", direction: "row", gap: "8", children: [
|
|
20
|
+
/* @__PURE__ */ jsx(Avatar, { className: "user-space--avatar", size: "auto", alt: name, src: avatar, variant: "circle" }),
|
|
21
|
+
/* @__PURE__ */ jsxs(Flex, { direction: "column", children: [
|
|
22
|
+
/* @__PURE__ */ jsx("div", { "data-testid": "user-space-name", className: "user-space--name", children: name }),
|
|
23
|
+
/* @__PURE__ */ jsx("div", { "data-testid": "user-space-profile", className: "user-space--profile", children: t(profile) })
|
|
24
|
+
] })
|
|
31
25
|
] }),
|
|
32
26
|
children && /* @__PURE__ */ jsx(HomeCard.Content, { children })
|
|
33
27
|
] });
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
|
-
export
|
|
2
|
+
export declare function UserSpaceContainer({ children }: {
|
|
3
3
|
children?: ReactNode;
|
|
4
|
-
|
|
5
|
-
}
|
|
6
|
-
export declare function UserSpaceContainer({ children, onCustomizeWidgetsClick, }: UserSpaceContainerProps): import("react/jsx-runtime").JSX.Element | null;
|
|
4
|
+
}): import("react/jsx-runtime").JSX.Element | null;
|
|
7
5
|
export declare namespace UserSpaceContainer {
|
|
8
6
|
var displayName: string;
|
|
9
7
|
}
|
|
@@ -2,8 +2,7 @@ import { jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import UserSpace from "./UserSpace.js";
|
|
3
3
|
import useUser from "../../../../hooks/useUser/useUser.js";
|
|
4
4
|
function UserSpaceContainer({
|
|
5
|
-
children
|
|
6
|
-
onCustomizeWidgetsClick
|
|
5
|
+
children
|
|
7
6
|
}) {
|
|
8
7
|
var _a;
|
|
9
8
|
const {
|
|
@@ -13,7 +12,7 @@ function UserSpaceContainer({
|
|
|
13
12
|
} = useUser();
|
|
14
13
|
if (!user || !userDescription) return null;
|
|
15
14
|
const name = user.username || "", profile = ((_a = userDescription.profiles) == null ? void 0 : _a[0]) || "Guest";
|
|
16
|
-
return /* @__PURE__ */ jsx(UserSpace, { name, profile, avatar,
|
|
15
|
+
return /* @__PURE__ */ jsx(UserSpace, { name, profile, avatar, children });
|
|
17
16
|
}
|
|
18
17
|
export {
|
|
19
18
|
UserSpaceContainer
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
export * from './Agenda';
|
|
2
|
-
export * from './Communities';
|
|
3
1
|
export * from './Favorites';
|
|
4
2
|
export * from './Header';
|
|
5
3
|
export * from './HomeCard';
|
|
@@ -9,4 +7,4 @@ export * from './Notifications';
|
|
|
9
7
|
export * from './SchoolSpace';
|
|
10
8
|
export * from './UsefulLinks';
|
|
11
9
|
export * from './UserSpace';
|
|
12
|
-
export * from './
|
|
10
|
+
export * from './Communities';
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
export { default as IconAddUser } from './IconAddUser';
|
|
2
|
-
export { default as IconAddWidget } from './IconAddWidget';
|
|
3
2
|
export { default as IconAdd } from './IconAdd';
|
|
4
3
|
export { default as IconAdjustSettings } from './IconAdjustSettings';
|
|
5
4
|
export { default as IconAiFill } from './IconAiFill';
|
|
@@ -65,6 +65,8 @@ export interface MediaLibraryProps {
|
|
|
65
65
|
visibility: WorkspaceVisibility;
|
|
66
66
|
/** Allow selecting / uploading multiple files at once ? */
|
|
67
67
|
multiple?: boolean;
|
|
68
|
+
/** Restrict attachments to PDF files in Workspace and Upload. */
|
|
69
|
+
pdfOnly?: boolean;
|
|
68
70
|
/**
|
|
69
71
|
* Called when the user validates the modal (Add button).
|
|
70
72
|
* @param result depends on which InnerTab is visible
|
|
@@ -66,6 +66,7 @@ const orderedTabs = [
|
|
|
66
66
|
appCode,
|
|
67
67
|
visibility,
|
|
68
68
|
multiple,
|
|
69
|
+
pdfOnly,
|
|
69
70
|
onSuccess,
|
|
70
71
|
onCancel,
|
|
71
72
|
onTabChange
|
|
@@ -199,6 +200,7 @@ const orderedTabs = [
|
|
|
199
200
|
appCode,
|
|
200
201
|
visibility,
|
|
201
202
|
multiple,
|
|
203
|
+
pdfOnly,
|
|
202
204
|
type,
|
|
203
205
|
setResultCounter,
|
|
204
206
|
setResult,
|
|
@@ -7,6 +7,8 @@ export declare const MediaLibraryContext: import('react').Context<{
|
|
|
7
7
|
visibility?: WorkspaceVisibility;
|
|
8
8
|
/** Allow selecting / uploading multiple files at once ? */
|
|
9
9
|
multiple?: boolean;
|
|
10
|
+
/** Restrict attachments to PDF files in Workspace and Upload. */
|
|
11
|
+
pdfOnly?: boolean;
|
|
10
12
|
/** Type of resource to search for. */
|
|
11
13
|
type: MediaLibraryType | null;
|
|
12
14
|
/** Set the counter in the success button label. */
|
|
@@ -36,6 +38,8 @@ export declare function useMediaLibraryContext(): {
|
|
|
36
38
|
visibility?: WorkspaceVisibility;
|
|
37
39
|
/** Allow selecting / uploading multiple files at once ? */
|
|
38
40
|
multiple?: boolean;
|
|
41
|
+
/** Restrict attachments to PDF files in Workspace and Upload. */
|
|
42
|
+
pdfOnly?: boolean;
|
|
39
43
|
/** Type of resource to search for. */
|
|
40
44
|
type: MediaLibraryType | null;
|
|
41
45
|
/** Set the counter in the success button label. */
|
|
@@ -36,6 +36,7 @@ const acceptedTypes = (type) => {
|
|
|
36
36
|
t
|
|
37
37
|
} = useTranslation(), {
|
|
38
38
|
type,
|
|
39
|
+
pdfOnly,
|
|
39
40
|
visibility,
|
|
40
41
|
multiple,
|
|
41
42
|
setResult,
|
|
@@ -60,7 +61,7 @@ const acceptedTypes = (type) => {
|
|
|
60
61
|
/* @__PURE__ */ jsx(Radio, { label: t("bbm.upload.sort.alpha"), name: "media-library-upload-sort", value: "alpha", model: sortByAlpha ? "alpha" : "date", checked: sortByAlpha, onChange: () => setSortByAlpha(!0), "data-testid": "media-library-upload-sort-alpha" }),
|
|
61
62
|
/* @__PURE__ */ jsx(Radio, { label: t("bbm.upload.sort.date"), name: "media-library-upload-sort", value: "date", model: sortByAlpha ? "alpha" : "date", checked: !sortByAlpha, onChange: () => setSortByAlpha(!1), "data-testid": "media-library-upload-sort-date" })
|
|
62
63
|
] }),
|
|
63
|
-
/* @__PURE__ */ jsx(Dropzone, { multiple, accept: acceptedTypes(type ?? "embedder"), children: /* @__PURE__ */ jsx(UploadFiles, { onFilesChange: handleOnFilesChange, visibility }) })
|
|
64
|
+
/* @__PURE__ */ jsx(Dropzone, { multiple, accept: type === "attachment" && pdfOnly ? ["application/pdf"] : acceptedTypes(type ?? "embedder"), children: /* @__PURE__ */ jsx(UploadFiles, { onFilesChange: handleOnFilesChange, visibility }) })
|
|
64
65
|
] });
|
|
65
66
|
};
|
|
66
67
|
export {
|
|
@@ -4,6 +4,7 @@ import Workspace$1 from "../../Workspace/Workspace.js";
|
|
|
4
4
|
const Workspace = () => {
|
|
5
5
|
const {
|
|
6
6
|
type,
|
|
7
|
+
pdfOnly,
|
|
7
8
|
setResultCounter,
|
|
8
9
|
setResult,
|
|
9
10
|
multiple,
|
|
@@ -17,6 +18,8 @@ const Workspace = () => {
|
|
|
17
18
|
return "audio";
|
|
18
19
|
case "video":
|
|
19
20
|
return "video";
|
|
21
|
+
case "attachment":
|
|
22
|
+
return pdfOnly ? "pdf" : null;
|
|
20
23
|
default:
|
|
21
24
|
return null;
|
|
22
25
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@edifice.io/react",
|
|
3
|
-
"version": "2.6.9-develop-
|
|
3
|
+
"version": "2.6.9-develop-pedago.20261013143657",
|
|
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/utilities": "2.6.9-develop-
|
|
145
|
-
"@edifice.io/
|
|
143
|
+
"@edifice.io/bootstrap": "2.6.9-develop-pedago.20261013143657",
|
|
144
|
+
"@edifice.io/utilities": "2.6.9-develop-pedago.20261013143657",
|
|
145
|
+
"@edifice.io/tiptap-extensions": "2.6.9-develop-pedago.20261013143657"
|
|
146
146
|
},
|
|
147
147
|
"devDependencies": {
|
|
148
148
|
"@babel/plugin-transform-react-pure-annotations": "7.27.1",
|
|
@@ -173,8 +173,8 @@
|
|
|
173
173
|
"vite": "5.4.14",
|
|
174
174
|
"vite-plugin-dts": "4.5.4",
|
|
175
175
|
"vite-tsconfig-paths": "5.1.4",
|
|
176
|
-
"@edifice.io/client": "2.6.9-develop-
|
|
177
|
-
"@edifice.io/config": "2.6.9-develop-
|
|
176
|
+
"@edifice.io/client": "2.6.9-develop-pedago.20261013143657",
|
|
177
|
+
"@edifice.io/config": "2.6.9-develop-pedago.20261013143657"
|
|
178
178
|
},
|
|
179
179
|
"peerDependencies": {
|
|
180
180
|
"@react-spring/web": "9.7.5",
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import { CSSProperties, InputHTMLAttributes, ReactNode } from 'react';
|
|
2
|
-
export interface RadioTileProps extends Omit<InputHTMLAttributes<HTMLInputElement>, 'type' | 'children' | 'className' | 'style'> {
|
|
3
|
-
/**
|
|
4
|
-
* Label of the tile. Also used as the accessible name of the radio input.
|
|
5
|
-
*/
|
|
6
|
-
label: ReactNode;
|
|
7
|
-
/**
|
|
8
|
-
* Optional image: an URL, or any React node (e.g. a background preview).
|
|
9
|
-
*/
|
|
10
|
-
image?: string | ReactNode;
|
|
11
|
-
/**
|
|
12
|
-
* Layout of a tile with both an image and a label.
|
|
13
|
-
* Ignored when there is no image or when the label is hidden.
|
|
14
|
-
*/
|
|
15
|
-
orientation?: 'horizontal' | 'vertical';
|
|
16
|
-
/**
|
|
17
|
-
* Visually hide the label (it stays available to screen readers).
|
|
18
|
-
* Use it with an `image` to render an image-only tile.
|
|
19
|
-
*/
|
|
20
|
-
hideLabel?: boolean;
|
|
21
|
-
/**
|
|
22
|
-
* Additional CSS class names applied to the tile (root element).
|
|
23
|
-
*/
|
|
24
|
-
className?: string;
|
|
25
|
-
/**
|
|
26
|
-
* Inline styles applied to the tile (root element).
|
|
27
|
-
*/
|
|
28
|
-
style?: CSSProperties;
|
|
29
|
-
}
|
|
30
|
-
/**
|
|
31
|
-
* A radio input presented as a selectable tile, with a label, an image or both.
|
|
32
|
-
* Group tiles together by giving them the same `name`.
|
|
33
|
-
*/
|
|
34
|
-
declare const RadioTile: import('react').ForwardRefExoticComponent<RadioTileProps & import('react').RefAttributes<HTMLInputElement>>;
|
|
35
|
-
export default RadioTile;
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
|
-
import { forwardRef } from "react";
|
|
3
|
-
import clsx from "clsx";
|
|
4
|
-
const RadioTile = /* @__PURE__ */ forwardRef(({
|
|
5
|
-
label,
|
|
6
|
-
image,
|
|
7
|
-
orientation = "horizontal",
|
|
8
|
-
hideLabel = !1,
|
|
9
|
-
className,
|
|
10
|
-
style,
|
|
11
|
-
...inputProps
|
|
12
|
-
}, ref) => {
|
|
13
|
-
const hasImage = image != null && image !== !1;
|
|
14
|
-
return /* @__PURE__ */ jsxs("label", { className: clsx("radio-tile", `radio-tile--${hasImage ? hideLabel ? "image" : orientation === "vertical" ? "vertical" : "horizontal" : "text"}`, className), style, children: [
|
|
15
|
-
/* @__PURE__ */ jsx("input", { ref, type: "radio", className: "radio-tile__input visually-hidden", ...inputProps }),
|
|
16
|
-
hasImage && /* @__PURE__ */ jsx("span", { className: "radio-tile__image", children: typeof image == "string" ? /* @__PURE__ */ jsx("img", { src: image, alt: "", loading: "lazy" }) : image }),
|
|
17
|
-
/* @__PURE__ */ jsx("span", { className: clsx("radio-tile__label", hideLabel && "visually-hidden"), children: label })
|
|
18
|
-
] });
|
|
19
|
-
});
|
|
20
|
-
export {
|
|
21
|
-
RadioTile as default
|
|
22
|
-
};
|
|
@@ -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: (event) => {
|
|
9
|
-
window.open(`/calendar#/view/${event.calendarId}/event/${event.id}`, "_self");
|
|
10
|
-
} });
|
|
11
|
-
}
|
|
12
|
-
export {
|
|
13
|
-
AgendaContainer
|
|
14
|
-
};
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { CalendarEvent } from '@edifice.io/client';
|
|
2
|
-
import { MouseEventHandler } from 'react';
|
|
3
|
-
export interface AgendaEventCardProps {
|
|
4
|
-
event: CalendarEvent;
|
|
5
|
-
onClick?: MouseEventHandler<HTMLButtonElement>;
|
|
6
|
-
}
|
|
7
|
-
export declare const AgendaEventCard: {
|
|
8
|
-
({ event, onClick }: AgendaEventCardProps): import("react/jsx-runtime").JSX.Element;
|
|
9
|
-
displayName: string;
|
|
10
|
-
};
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
|
-
import { useTranslation } from "react-i18next";
|
|
3
|
-
import SvgIconClock from "../../../icons/components/IconClock.js";
|
|
4
|
-
import useDate from "../../../../hooks/useDate/useDate.js";
|
|
5
|
-
import Flex from "../../../../components/Flex/Flex.js";
|
|
6
|
-
const capitalize = (value) => value.charAt(0).toUpperCase() + value.slice(1), AgendaEventCard = ({
|
|
7
|
-
event,
|
|
8
|
-
onClick
|
|
9
|
-
}) => {
|
|
10
|
-
const {
|
|
11
|
-
t
|
|
12
|
-
} = useTranslation(), {
|
|
13
|
-
formatDate,
|
|
14
|
-
dateIsSame
|
|
15
|
-
} = useDate(), formatTime = (date) => formatDate(date, "HH[h]mm"), timeLabel = event.allDay ? t("homepage.agenda.allDay") : dateIsSame(event.startMoment, event.endMoment, "day") ? `${formatTime(event.startMoment)} - ${formatTime(event.endMoment)}` : t("homepage.agenda.multiDayTime", {
|
|
16
|
-
startTime: formatTime(event.startMoment),
|
|
17
|
-
endDay: capitalize(formatDate(event.endMoment, "ddd D")),
|
|
18
|
-
endTime: formatTime(event.endMoment)
|
|
19
|
-
});
|
|
20
|
-
return /* @__PURE__ */ jsxs("button", { type: "button", className: "agenda-event-card", onClick, "data-testid": "agenda-event-card", children: [
|
|
21
|
-
/* @__PURE__ */ jsxs(Flex, { align: "center", gap: "8", className: "agenda-event-card-time", children: [
|
|
22
|
-
/* @__PURE__ */ jsx(SvgIconClock, { width: "20", height: "20" }),
|
|
23
|
-
/* @__PURE__ */ jsx("span", { children: timeLabel })
|
|
24
|
-
] }),
|
|
25
|
-
/* @__PURE__ */ jsx("p", { className: "agenda-event-card-title", children: event.title })
|
|
26
|
-
] });
|
|
27
|
-
};
|
|
28
|
-
export {
|
|
29
|
-
AgendaEventCard
|
|
30
|
-
};
|