@edifice.io/react 2.5.24-develop-integration.20260625143746 → 2.5.24-develop-b2school.20260626115410

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 (19) hide show
  1. package/dist/homepage.js +2 -2
  2. package/dist/modules/homepage/components/Notifications/{Notification.d.ts → NotificationItem.d.ts} +3 -3
  3. package/dist/modules/homepage/components/Notifications/{Notification.js → NotificationItem.js} +6 -6
  4. package/dist/modules/homepage/components/Notifications/NotificationList.js +2 -2
  5. package/dist/modules/homepage/components/Notifications/NotificationSkeleton.js +1 -1
  6. package/dist/modules/homepage/components/Notifications/components/{NotificationItem.d.ts → CommonNotificationItem.d.ts} +2 -2
  7. package/dist/modules/homepage/components/Notifications/components/CommonNotificationItem.js +28 -0
  8. package/dist/modules/homepage/components/Notifications/components/{NotificationResource.d.ts → NotificationItemResource.d.ts} +4 -4
  9. package/dist/modules/homepage/components/Notifications/components/NotificationItemResource.js +19 -0
  10. package/dist/modules/homepage/components/Notifications/components/{SystemNotification.d.ts → SystemNotificationItem.d.ts} +4 -4
  11. package/dist/modules/homepage/components/Notifications/components/SystemNotificationItem.js +20 -0
  12. package/dist/modules/homepage/components/Notifications/components/{UserNotification.d.ts → UserNotificationItem.d.ts} +4 -4
  13. package/dist/modules/homepage/components/Notifications/components/UserNotificationItem.js +25 -0
  14. package/dist/modules/homepage/components/Notifications/index.d.ts +2 -2
  15. package/package.json +6 -6
  16. package/dist/modules/homepage/components/Notifications/components/NotificationItem.js +0 -28
  17. package/dist/modules/homepage/components/Notifications/components/NotificationResource.js +0 -19
  18. package/dist/modules/homepage/components/Notifications/components/SystemNotification.js +0 -20
  19. package/dist/modules/homepage/components/Notifications/components/UserNotification.js +0 -25
package/dist/homepage.js CHANGED
@@ -2,7 +2,7 @@ import { default as default2 } from "./modules/homepage/components/Header/Header
2
2
  import { default as default3 } from "./modules/homepage/components/HomeCard/HomeCard.js";
3
3
  import { default as default4 } from "./modules/homepage/components/LastInfos/LastInfos.js";
4
4
  import { default as default5 } from "./modules/homepage/components/MessageFlashList/MessageFlashList.js";
5
- import { default as default6 } from "./modules/homepage/components/Notifications/Notification.js";
5
+ import { default as default6 } from "./modules/homepage/components/Notifications/NotificationItem.js";
6
6
  import { default as default7 } from "./modules/homepage/components/Notifications/NotificationList.js";
7
7
  import { NotificationListContainer } from "./modules/homepage/components/Notifications/NotificationListContainer.js";
8
8
  import { default as default8 } from "./modules/homepage/components/SchoolSpace/SchoolSpace.js";
@@ -24,7 +24,7 @@ export {
24
24
  LastInfosList,
25
25
  default5 as MessageFlashList,
26
26
  MessageFlashListContainer,
27
- default6 as Notification,
27
+ default6 as NotificationItem,
28
28
  default7 as NotificationList,
29
29
  NotificationListContainer,
30
30
  default8 as SchoolSpace,
@@ -11,10 +11,10 @@ export type NotificationProps = {
11
11
  * - **system** — triggered by an application event; shows the app icon.
12
12
  *
13
13
  * @example
14
- * <Notification notification={notificationModel} />
14
+ * <NotificationItem notification={notificationModel} />
15
15
  */
16
- declare const Notification: {
16
+ declare const NotificationItem: {
17
17
  ({ notification }: NotificationProps): import("react/jsx-runtime").JSX.Element;
18
18
  displayName: string;
19
19
  };
20
- export default Notification;
20
+ export default NotificationItem;
@@ -1,16 +1,16 @@
1
1
  import { jsxs, Fragment, jsx } from "react/jsx-runtime";
2
- import SystemNotification from "./components/SystemNotification.js";
3
- import UserNotification from "./components/UserNotification.js";
2
+ import SystemNotificationItem from "./components/SystemNotificationItem.js";
3
+ import UserNotificationItem from "./components/UserNotificationItem.js";
4
4
  import { notificationAdapter } from "./components/notificationAdapter.js";
5
- const Notification = ({
5
+ const NotificationItem = ({
6
6
  notification
7
7
  }) => {
8
8
  const notif = notificationAdapter(notification);
9
9
  return /* @__PURE__ */ jsxs(Fragment, { children: [
10
- notif.type === "user" && /* @__PURE__ */ jsx(UserNotification, { notification: notif }),
11
- notif.type === "system" && /* @__PURE__ */ jsx(SystemNotification, { notification: notif })
10
+ notif.type === "user" && /* @__PURE__ */ jsx(UserNotificationItem, { notification: notif }),
11
+ notif.type === "system" && /* @__PURE__ */ jsx(SystemNotificationItem, { notification: notif })
12
12
  ] });
13
13
  };
14
14
  export {
15
- Notification as default
15
+ NotificationItem as default
16
16
  };
@@ -2,7 +2,7 @@ import { jsx, jsxs, Fragment } from "react/jsx-runtime";
2
2
  import illuEmptyNotification from "@edifice.io/bootstrap/dist/images/emptyscreen/illu-notifications.png";
3
3
  import { useTranslation } from "react-i18next";
4
4
  import SvgIconClose from "../../../icons/components/IconClose.js";
5
- import Notification from "./Notification.js";
5
+ import NotificationItem from "./NotificationItem.js";
6
6
  import NotificationListSkeleton from "./NotificationListSkeleton.js";
7
7
  import NotificationSkeleton from "./NotificationSkeleton.js";
8
8
  import useInfiniteScroll from "../../../../hooks/useInfiniteScroll/useInfiniteScroll.js";
@@ -31,7 +31,7 @@ const NotificationList = ({
31
31
  ] }),
32
32
  (notifications == null ? void 0 : notifications.length) === 0 ? /* @__PURE__ */ jsx("div", { className: "mx-24", children: /* @__PURE__ */ jsx(EmptyScreen, { size: 120, imageSrc: illuEmptyNotification, imageAlt: t("homepage.notifications-list.empty.description"), text: t("homepage.notifications-list.empty.description") }) }) : /* @__PURE__ */ jsxs(Fragment, { children: [
33
33
  /* @__PURE__ */ jsx("ul", { children: notifications == null ? void 0 : notifications.map((notification, index) => /* @__PURE__ */ jsxs("li", { children: [
34
- /* @__PURE__ */ jsx(Notification, { notification }),
34
+ /* @__PURE__ */ jsx(NotificationItem, { notification }),
35
35
  /* @__PURE__ */ jsx(Divider, { className: "border-grey-300 my-0" })
36
36
  ] }, "notification-list-" + notification._id + "-" + index)) }),
37
37
  hasNextPage && /* @__PURE__ */ jsx(NotificationSkeleton, { ref: loadNextRef }),
@@ -4,7 +4,7 @@ import Flex from "../../../../components/Flex/Flex.js";
4
4
  import Avatar from "../../../../components/Avatar/Avatar.js";
5
5
  import TextSkeleton from "../../../../components/Skeleton/TextSkeleton.js";
6
6
  const NotificationSkeleton = /* @__PURE__ */ React.forwardRef((_props, ref) => /* @__PURE__ */ jsx(Flex, { direction: "column", className: "notification", gap: "8", ref, children: /* @__PURE__ */ jsxs(Flex, { direction: "row", gap: "8", children: [
7
- /* @__PURE__ */ jsx("div", { className: "notification-picture", children: /* @__PURE__ */ jsx(Avatar, { alt: "Notification Picture", variant: "circle", className: "notification-avatar" }) }),
7
+ /* @__PURE__ */ jsx("div", { className: "notification-item-picture", children: /* @__PURE__ */ jsx(Avatar, { alt: "Notification Picture", variant: "circle", className: "notification-item-avatar" }) }),
8
8
  /* @__PURE__ */ jsxs(Flex, { direction: "column", gap: "8", className: "notification-message", children: [
9
9
  /* @__PURE__ */ jsx(TextSkeleton, {}),
10
10
  /* @__PURE__ */ jsx(TextSkeleton, {}),
@@ -17,8 +17,8 @@ export type NotificationItemProps = {
17
17
  * notification comes from a user or a system event. Use `UserNotification` or
18
18
  * `SystemNotification` instead of consuming this directly.
19
19
  */
20
- declare const NotificationItem: {
20
+ declare const CommonNotificationItem: {
21
21
  ({ picture, message, date, uri, children, }: NotificationItemProps): import("react/jsx-runtime").JSX.Element;
22
22
  displayName: string;
23
23
  };
24
- export default NotificationItem;
24
+ export default CommonNotificationItem;
@@ -0,0 +1,28 @@
1
+ import { jsx, jsxs } from "react/jsx-runtime";
2
+ import useDate from "../../../../../hooks/useDate/useDate.js";
3
+ import Flex from "../../../../../components/Flex/Flex.js";
4
+ const CommonNotificationItem = ({
5
+ picture,
6
+ message,
7
+ date,
8
+ uri,
9
+ children
10
+ }) => {
11
+ const {
12
+ formatTimeAgo,
13
+ formatDate
14
+ } = useDate();
15
+ return /* @__PURE__ */ jsx(Flex, { direction: "column", className: "notification-item", gap: "8", children: /* @__PURE__ */ jsxs(Flex, { direction: "row", gap: "8", children: [
16
+ /* @__PURE__ */ jsx("div", { className: "notification-item-picture", children: picture }),
17
+ /* @__PURE__ */ jsx("a", { href: uri, "data-testid": "notification-item-content", children: /* @__PURE__ */ jsxs(Flex, { direction: "column", gap: "8", children: [
18
+ /* @__PURE__ */ jsx("div", { className: "notification-item-message", dangerouslySetInnerHTML: {
19
+ __html: message
20
+ } }),
21
+ children,
22
+ /* @__PURE__ */ jsx("p", { className: "notification-item-date", title: formatDate(date, "LLL"), children: formatTimeAgo(date) })
23
+ ] }) })
24
+ ] }) });
25
+ };
26
+ export {
27
+ CommonNotificationItem as default
28
+ };
@@ -1,4 +1,4 @@
1
- export type NotificationResourceProps = {
1
+ export type NotificationItemResourceProps = {
2
2
  appCode: string;
3
3
  };
4
4
  /**
@@ -8,8 +8,8 @@ export type NotificationResourceProps = {
8
8
  * falling back to the raw `appCode` if no translation exists.
9
9
  *
10
10
  */
11
- declare const NotificationResource: {
12
- ({ appCode }: NotificationResourceProps): import("react/jsx-runtime").JSX.Element;
11
+ declare const NotificationItemResource: {
12
+ ({ appCode, }: NotificationItemResourceProps): import("react/jsx-runtime").JSX.Element;
13
13
  displayName: string;
14
14
  };
15
- export default NotificationResource;
15
+ export default NotificationItemResource;
@@ -0,0 +1,19 @@
1
+ import { jsxs, jsx } from "react/jsx-runtime";
2
+ import { useTranslation } from "react-i18next";
3
+ import AppIcon from "../../../../../components/AppIcon/AppIcon.js";
4
+ const NotificationItemResource = ({
5
+ appCode
6
+ }) => {
7
+ const {
8
+ t
9
+ } = useTranslation(), appLabel = t(`${appCode}`, {
10
+ defaultValue: appCode
11
+ }), appCssClass = `app-${appCode}`;
12
+ return /* @__PURE__ */ jsxs("div", { className: `notification-item-resource ${appCssClass} bg-app-light`, children: [
13
+ /* @__PURE__ */ jsx("span", { className: "notification-item-resource-icon", children: /* @__PURE__ */ jsx(AppIcon, { app: appCode, size: "24", iconFit: "contain" }) }),
14
+ /* @__PURE__ */ jsx("span", { className: "notification-item-resource-name color-app", children: appLabel })
15
+ ] });
16
+ };
17
+ export {
18
+ NotificationItemResource as default
19
+ };
@@ -1,5 +1,5 @@
1
1
  import { SystemWebNotification } from './notificationAdapter';
2
- export type SystemNotificationProps = {
2
+ export type SystemNotificationItemProps = {
3
3
  notification: SystemWebNotification;
4
4
  };
5
5
  /**
@@ -8,8 +8,8 @@ export type SystemNotificationProps = {
8
8
  * Wraps `NotificationItem` — prefer using `Notification` at the top level
9
9
  * rather than this component directly.
10
10
  */
11
- declare const SystemNotification: {
12
- ({ notification }: SystemNotificationProps): import("react/jsx-runtime").JSX.Element;
11
+ declare const SystemNotificationItem: {
12
+ ({ notification, }: SystemNotificationItemProps): import("react/jsx-runtime").JSX.Element;
13
13
  displayName: string;
14
14
  };
15
- export default SystemNotification;
15
+ export default SystemNotificationItem;
@@ -0,0 +1,20 @@
1
+ import { jsx } from "react/jsx-runtime";
2
+ import { useTranslation } from "react-i18next";
3
+ import CommonNotificationItem from "./CommonNotificationItem.js";
4
+ import AppIcon from "../../../../../components/AppIcon/AppIcon.js";
5
+ const SystemNotificationItem = ({
6
+ notification
7
+ }) => {
8
+ const {
9
+ params,
10
+ message,
11
+ date,
12
+ uri
13
+ } = notification, {
14
+ t
15
+ } = useTranslation(), appName = t(params.appCode);
16
+ return /* @__PURE__ */ jsx(CommonNotificationItem, { uri, message, date, picture: /* @__PURE__ */ jsx("a", { href: uri, title: appName, "data-testid": "notification-item-app-icon", "aria-label": t("homepage.notifications.app-icon.placeholder"), children: /* @__PURE__ */ jsx(AppIcon, { app: params.appCode, size: "24", variant: "square", className: "notification-item-app-icon" }) }) });
17
+ };
18
+ export {
19
+ SystemNotificationItem as default
20
+ };
@@ -1,5 +1,5 @@
1
1
  import { UserWebNotification } from './notificationAdapter';
2
- export type UserNotificationProps = {
2
+ export type UserNotificationItemProps = {
3
3
  notification: UserWebNotification;
4
4
  };
5
5
  /**
@@ -8,8 +8,8 @@ export type UserNotificationProps = {
8
8
  * The avatar and its link are resolved via `useDirectory`. Wraps `NotificationItem`
9
9
  * — prefer using `Notification` at the top level rather than this component directly.
10
10
  */
11
- declare const UserNotification: {
12
- ({ notification }: UserNotificationProps): import("react/jsx-runtime").JSX.Element;
11
+ declare const UserNotificationItem: {
12
+ ({ notification }: UserNotificationItemProps): import("react/jsx-runtime").JSX.Element;
13
13
  displayName: string;
14
14
  };
15
- export default UserNotification;
15
+ export default UserNotificationItem;
@@ -0,0 +1,25 @@
1
+ import { jsx } from "react/jsx-runtime";
2
+ import { useTranslation } from "react-i18next";
3
+ import CommonNotificationItem from "./CommonNotificationItem.js";
4
+ import NotificationItemResource from "./NotificationItemResource.js";
5
+ import useDirectory from "../../../../../hooks/useDirectory/useDirectory.js";
6
+ import Avatar from "../../../../../components/Avatar/Avatar.js";
7
+ const UserNotificationItem = ({
8
+ notification
9
+ }) => {
10
+ const {
11
+ getAvatarURL,
12
+ getUserbookURL
13
+ } = useDirectory(), {
14
+ params,
15
+ message,
16
+ date,
17
+ uri
18
+ } = notification, {
19
+ t
20
+ } = useTranslation(), userName = t(params.username);
21
+ return /* @__PURE__ */ jsx(CommonNotificationItem, { uri, message, date, picture: /* @__PURE__ */ jsx("a", { href: getUserbookURL(params.userId, "user"), title: userName, "data-testid": "notification-item-avatar", children: /* @__PURE__ */ jsx(Avatar, { "aria-label": t("homepage.notifications.avatar.placeholder"), src: getAvatarURL(params.userId, "user"), alt: userName, variant: "circle", className: "notification-item-avatar" }) }), children: /* @__PURE__ */ jsx(NotificationItemResource, { appCode: params.appCode }) });
22
+ };
23
+ export {
24
+ UserNotificationItem as default
25
+ };
@@ -1,5 +1,5 @@
1
- export * from './Notification';
2
- export { default as Notification } from './Notification';
1
+ export * from './NotificationItem';
2
+ export { default as NotificationItem } from './NotificationItem';
3
3
  export * from './NotificationList';
4
4
  export { default as NotificationList } from './NotificationList';
5
5
  export * from './NotificationListContainer';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@edifice.io/react",
3
- "version": "2.5.24-develop-integration.20260625143746",
3
+ "version": "2.5.24-develop-b2school.20260626115410",
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/bootstrap": "2.5.24-develop-integration.20260625143746",
144
- "@edifice.io/tiptap-extensions": "2.5.24-develop-integration.20260625143746",
145
- "@edifice.io/utilities": "2.5.24-develop-integration.20260625143746"
143
+ "@edifice.io/tiptap-extensions": "2.5.24-develop-b2school.20260626115410",
144
+ "@edifice.io/utilities": "2.5.24-develop-b2school.20260626115410",
145
+ "@edifice.io/bootstrap": "2.5.24-develop-b2school.20260626115410"
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.5.24-develop-integration.20260625143746",
177
- "@edifice.io/config": "2.5.24-develop-integration.20260625143746"
176
+ "@edifice.io/client": "2.5.24-develop-b2school.20260626115410",
177
+ "@edifice.io/config": "2.5.24-develop-b2school.20260626115410"
178
178
  },
179
179
  "peerDependencies": {
180
180
  "@react-spring/web": "9.7.5",
@@ -1,28 +0,0 @@
1
- import { jsx, jsxs } from "react/jsx-runtime";
2
- import useDate from "../../../../../hooks/useDate/useDate.js";
3
- import Flex from "../../../../../components/Flex/Flex.js";
4
- const NotificationItem = ({
5
- picture,
6
- message,
7
- date,
8
- uri,
9
- children
10
- }) => {
11
- const {
12
- formatTimeAgo,
13
- formatDate
14
- } = useDate();
15
- return /* @__PURE__ */ jsx(Flex, { direction: "column", className: "notification", gap: "8", children: /* @__PURE__ */ jsxs(Flex, { direction: "row", gap: "8", children: [
16
- /* @__PURE__ */ jsx("div", { className: "notification-picture", children: picture }),
17
- /* @__PURE__ */ jsx("a", { href: uri, "data-testid": "notification-content", children: /* @__PURE__ */ jsxs(Flex, { direction: "column", gap: "8", children: [
18
- /* @__PURE__ */ jsx("div", { className: "notification-message", dangerouslySetInnerHTML: {
19
- __html: message
20
- } }),
21
- children,
22
- /* @__PURE__ */ jsx("p", { className: "notification-date", title: formatDate(date, "LLL"), children: formatTimeAgo(date) })
23
- ] }) })
24
- ] }) });
25
- };
26
- export {
27
- NotificationItem as default
28
- };
@@ -1,19 +0,0 @@
1
- import { jsxs, jsx } from "react/jsx-runtime";
2
- import { useTranslation } from "react-i18next";
3
- import AppIcon from "../../../../../components/AppIcon/AppIcon.js";
4
- const NotificationResource = ({
5
- appCode
6
- }) => {
7
- const {
8
- t
9
- } = useTranslation(), appLabel = t(`${appCode}`, {
10
- defaultValue: appCode
11
- }), appCssClass = `app-${appCode}`;
12
- return /* @__PURE__ */ jsxs("div", { className: `notification-resource ${appCssClass} bg-app-light`, children: [
13
- /* @__PURE__ */ jsx("span", { className: "notification-resource-icon", children: /* @__PURE__ */ jsx(AppIcon, { app: appCode, size: "24", iconFit: "contain" }) }),
14
- /* @__PURE__ */ jsx("span", { className: "notification-resource-name color-app", children: appLabel })
15
- ] });
16
- };
17
- export {
18
- NotificationResource as default
19
- };
@@ -1,20 +0,0 @@
1
- import { jsx } from "react/jsx-runtime";
2
- import { useTranslation } from "react-i18next";
3
- import NotificationItem from "./NotificationItem.js";
4
- import AppIcon from "../../../../../components/AppIcon/AppIcon.js";
5
- const SystemNotification = ({
6
- notification
7
- }) => {
8
- const {
9
- params,
10
- message,
11
- date,
12
- uri
13
- } = notification, {
14
- t
15
- } = useTranslation(), appName = t(params.appCode);
16
- return /* @__PURE__ */ jsx(NotificationItem, { uri, message, date, picture: /* @__PURE__ */ jsx("a", { href: uri, title: appName, "data-testid": "notification-app-icon", "aria-label": t("homepage.notifications.app-icon.placeholder"), children: /* @__PURE__ */ jsx(AppIcon, { app: params.appCode, size: "24", variant: "square", className: "notification-app-icon" }) }) });
17
- };
18
- export {
19
- SystemNotification as default
20
- };
@@ -1,25 +0,0 @@
1
- import { jsx } from "react/jsx-runtime";
2
- import { useTranslation } from "react-i18next";
3
- import NotificationItem from "./NotificationItem.js";
4
- import NotificationResource from "./NotificationResource.js";
5
- import useDirectory from "../../../../../hooks/useDirectory/useDirectory.js";
6
- import Avatar from "../../../../../components/Avatar/Avatar.js";
7
- const UserNotification = ({
8
- notification
9
- }) => {
10
- const {
11
- getAvatarURL,
12
- getUserbookURL
13
- } = useDirectory(), {
14
- params,
15
- message,
16
- date,
17
- uri
18
- } = notification, {
19
- t
20
- } = useTranslation(), userName = t(params.username);
21
- return /* @__PURE__ */ jsx(NotificationItem, { uri, message, date, picture: /* @__PURE__ */ jsx("a", { href: getUserbookURL(params.userId, "user"), title: userName, "data-testid": "notification-avatar", children: /* @__PURE__ */ jsx(Avatar, { "aria-label": t("homepage.notifications.avatar.placeholder"), src: getAvatarURL(params.userId, "user"), alt: userName, variant: "circle", className: "notification-avatar" }) }), children: /* @__PURE__ */ jsx(NotificationResource, { appCode: params.appCode }) });
22
- };
23
- export {
24
- UserNotification as default
25
- };