@edifice.io/react 2.6.12-develop-b2school.20261102112143 → 2.6.12-develop.20261103121017

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 (171) hide show
  1. package/dist/components/Checkbox/Checkbox.js +1 -1
  2. package/dist/components/Dropdown/DropdownItem.js +1 -17
  3. package/dist/components/Layout/Layout.js +4 -12
  4. package/dist/components/SearchBar/SearchBar.js +26 -17
  5. package/dist/components/Tree/components/Tree.d.ts +5 -2
  6. package/dist/components/Tree/components/Tree.js +7 -10
  7. package/dist/components/Tree/hooks/useTree.d.ts +0 -1
  8. package/dist/components/Tree/hooks/useTree.js +2 -6
  9. package/dist/components/Tree/types/index.d.ts +0 -7
  10. package/dist/components/index.d.ts +0 -1
  11. package/dist/homepage.js +24 -87
  12. package/dist/hooks/useDropdown/useDropdown.js +2 -2
  13. package/dist/hooks/useZendeskGuide/useZendeskGuide.d.ts +6 -2
  14. package/dist/hooks/useZendeskGuide/useZendeskGuide.js +8 -11
  15. package/dist/icons.js +404 -406
  16. package/dist/index.js +0 -2
  17. package/dist/modules/HelpZone/HelpZone.js +8 -6
  18. package/dist/modules/HelpZone/HelpZoneContainer.js +5 -2
  19. package/dist/modules/editor/components/Editor/Editor.d.ts +0 -5
  20. package/dist/modules/editor/components/Editor/Editor.js +0 -3
  21. package/dist/modules/homepage/components/Header/Header.js +21 -9
  22. package/dist/modules/homepage/components/HomeCard/HomeCardHeader.d.ts +1 -5
  23. package/dist/modules/homepage/components/HomeCard/HomeCardHeader.js +1 -1
  24. package/dist/modules/homepage/components/Notifications/NotificationList.js +8 -7
  25. package/dist/modules/homepage/components/Notifications/NotificationListSkeleton.js +12 -7
  26. package/dist/modules/homepage/components/Notifications/NotificationSkeleton.js +4 -7
  27. package/dist/modules/homepage/components/Notifications/components/NotificationFilterModal.js +13 -11
  28. package/dist/modules/homepage/components/Notifications/components/ReportNotificationModal.js +12 -6
  29. package/dist/modules/homepage/components/Notifications/components/notificationAdapter.js +10 -12
  30. package/dist/modules/homepage/components/Notifications/hooks/useNotificationList.js +10 -9
  31. package/dist/modules/homepage/components/SchoolSpace/SchoolSpaceContainer.js +1 -1
  32. package/dist/modules/homepage/{hooks → components/SchoolSpace}/useUserSchools.d.ts +2 -2
  33. package/dist/modules/homepage/{hooks → components/SchoolSpace}/useUserSchools.js +4 -4
  34. package/dist/modules/homepage/components/UsefulLinks/UsefulLinks.js +2 -2
  35. package/dist/modules/homepage/components/UsefulLinks/UsefulLinksModal.js +2 -2
  36. package/dist/modules/homepage/components/UserSpace/UserSpace.d.ts +1 -3
  37. package/dist/modules/homepage/components/UserSpace/UserSpace.js +7 -13
  38. package/dist/modules/homepage/components/UserSpace/UserSpaceContainer.d.ts +2 -4
  39. package/dist/modules/homepage/components/UserSpace/UserSpaceContainer.js +2 -3
  40. package/dist/modules/homepage/components/index.d.ts +1 -11
  41. package/dist/modules/icons/components/index.d.ts +0 -1
  42. package/dist/modules/icons/components/nav/IconCommunitiesBeta.js +7 -5
  43. package/dist/modules/icons/components/nav/IconHomeBeta.js +3 -6
  44. package/dist/modules/icons/components/nav/IconMessagesBeta.js +7 -7
  45. package/dist/modules/icons/components/nav/IconMyAppsBeta.js +3 -2
  46. package/dist/modules/icons/components/nav/IconNotificationBeta.js +4 -2
  47. package/dist/modules/multimedia/Workspace/Workspace.js +1 -1
  48. package/package.json +6 -6
  49. package/dist/components/Masonry/Masonry.d.ts +0 -40
  50. package/dist/components/Masonry/Masonry.js +0 -50
  51. package/dist/components/Masonry/index.d.ts +0 -2
  52. package/dist/modules/homepage/components/Agenda/Agenda.d.ts +0 -10
  53. package/dist/modules/homepage/components/Agenda/Agenda.js +0 -54
  54. package/dist/modules/homepage/components/Agenda/AgendaContainer.d.ts +0 -1
  55. package/dist/modules/homepage/components/Agenda/AgendaContainer.js +0 -14
  56. package/dist/modules/homepage/components/Agenda/AgendaEventCard.d.ts +0 -10
  57. package/dist/modules/homepage/components/Agenda/AgendaEventCard.js +0 -30
  58. package/dist/modules/homepage/components/Agenda/hooks/useAgendaContainer.d.ts +0 -14
  59. package/dist/modules/homepage/components/Agenda/hooks/useAgendaContainer.js +0 -27
  60. package/dist/modules/homepage/components/Agenda/index.d.ts +0 -3
  61. package/dist/modules/homepage/components/Agenda/services/api/agendaService.d.ts +0 -24
  62. package/dist/modules/homepage/components/Agenda/services/api/agendaService.js +0 -45
  63. package/dist/modules/homepage/components/Agenda/services/api/index.d.ts +0 -4
  64. package/dist/modules/homepage/components/Agenda/services/api/index.js +0 -5
  65. package/dist/modules/homepage/components/Agenda/services/queries/agenda.d.ts +0 -19
  66. package/dist/modules/homepage/components/Agenda/services/queries/agenda.js +0 -26
  67. package/dist/modules/homepage/components/BriefMe/BriefMe.d.ts +0 -9
  68. package/dist/modules/homepage/components/BriefMe/BriefMe.js +0 -59
  69. package/dist/modules/homepage/components/BriefMe/BriefMeContainer.d.ts +0 -4
  70. package/dist/modules/homepage/components/BriefMe/BriefMeContainer.js +0 -17
  71. package/dist/modules/homepage/components/BriefMe/index.d.ts +0 -4
  72. package/dist/modules/homepage/components/BriefMe/types.d.ts +0 -17
  73. package/dist/modules/homepage/components/BriefMe/types.js +0 -8
  74. package/dist/modules/homepage/components/BriefMe/useBriefMe.d.ts +0 -31
  75. package/dist/modules/homepage/components/BriefMe/useBriefMe.js +0 -51
  76. package/dist/modules/homepage/components/Cantine/Cantine.d.ts +0 -7
  77. package/dist/modules/homepage/components/Cantine/Cantine.js +0 -44
  78. package/dist/modules/homepage/components/Cantine/CantineContainer.d.ts +0 -4
  79. package/dist/modules/homepage/components/Cantine/CantineContainer.js +0 -18
  80. package/dist/modules/homepage/components/Cantine/CantineModal.d.ts +0 -24
  81. package/dist/modules/homepage/components/Cantine/CantineModal.js +0 -88
  82. package/dist/modules/homepage/components/Cantine/CantineModalContainer.d.ts +0 -7
  83. package/dist/modules/homepage/components/Cantine/CantineModalContainer.js +0 -12
  84. package/dist/modules/homepage/components/Cantine/components/CantineLegend.d.ts +0 -5
  85. package/dist/modules/homepage/components/Cantine/components/CantineLegend.js +0 -22
  86. package/dist/modules/homepage/components/Cantine/components/CantineMenuSection.d.ts +0 -6
  87. package/dist/modules/homepage/components/Cantine/components/CantineMenuSection.js +0 -28
  88. package/dist/modules/homepage/components/Cantine/components/cantineLabels.d.ts +0 -12
  89. package/dist/modules/homepage/components/Cantine/components/cantineLabels.js +0 -60
  90. package/dist/modules/homepage/components/Cantine/hooks/useCantine.d.ts +0 -11
  91. package/dist/modules/homepage/components/Cantine/hooks/useCantine.js +0 -20
  92. package/dist/modules/homepage/components/Cantine/hooks/useCantineMenu.d.ts +0 -24
  93. package/dist/modules/homepage/components/Cantine/hooks/useCantineMenu.js +0 -65
  94. package/dist/modules/homepage/components/Cantine/hooks/useCantineModal.d.ts +0 -23
  95. package/dist/modules/homepage/components/Cantine/hooks/useCantineModal.js +0 -43
  96. package/dist/modules/homepage/components/Cantine/index.d.ts +0 -7
  97. package/dist/modules/homepage/components/Cantine/types.d.ts +0 -42
  98. package/dist/modules/homepage/components/Edumalin/Edumalin.d.ts +0 -9
  99. package/dist/modules/homepage/components/Edumalin/Edumalin.js +0 -65
  100. package/dist/modules/homepage/components/Edumalin/EdumalinContainer.d.ts +0 -4
  101. package/dist/modules/homepage/components/Edumalin/EdumalinContainer.js +0 -21
  102. package/dist/modules/homepage/components/Edumalin/EdumalinModal.d.ts +0 -8
  103. package/dist/modules/homepage/components/Edumalin/EdumalinModal.js +0 -62
  104. package/dist/modules/homepage/components/Edumalin/components/EdumalinBadge.d.ts +0 -5
  105. package/dist/modules/homepage/components/Edumalin/components/EdumalinBadge.js +0 -38
  106. package/dist/modules/homepage/components/Edumalin/components/EdumalinPicture.d.ts +0 -5
  107. package/dist/modules/homepage/components/Edumalin/components/EdumalinPicture.js +0 -12
  108. package/dist/modules/homepage/components/Edumalin/index.d.ts +0 -7
  109. package/dist/modules/homepage/components/Edumalin/types.d.ts +0 -24
  110. package/dist/modules/homepage/components/Edumalin/types.js +0 -4
  111. package/dist/modules/homepage/components/Edumalin/useEdumalin.d.ts +0 -16
  112. package/dist/modules/homepage/components/Edumalin/useEdumalin.js +0 -35
  113. package/dist/modules/homepage/components/Edumalin/utils.d.ts +0 -28
  114. package/dist/modules/homepage/components/Edumalin/utils.js +0 -56
  115. package/dist/modules/homepage/components/GenerationHdf/GenerationHdf.d.ts +0 -16
  116. package/dist/modules/homepage/components/GenerationHdf/GenerationHdf.js +0 -65
  117. package/dist/modules/homepage/components/GenerationHdf/GenerationHdfContainer.d.ts +0 -4
  118. package/dist/modules/homepage/components/GenerationHdf/GenerationHdfContainer.js +0 -12
  119. package/dist/modules/homepage/components/GenerationHdf/formatSolde.d.ts +0 -1
  120. package/dist/modules/homepage/components/GenerationHdf/formatSolde.js +0 -6
  121. package/dist/modules/homepage/components/GenerationHdf/index.d.ts +0 -3
  122. package/dist/modules/homepage/components/GenerationHdf/useGenerationHdf.d.ts +0 -10
  123. package/dist/modules/homepage/components/GenerationHdf/useGenerationHdf.js +0 -69
  124. package/dist/modules/homepage/components/Qwant/Qwant.d.ts +0 -4
  125. package/dist/modules/homepage/components/Qwant/Qwant.js +0 -41
  126. package/dist/modules/homepage/components/Qwant/QwantContainer.d.ts +0 -1
  127. package/dist/modules/homepage/components/Qwant/QwantContainer.js +0 -10
  128. package/dist/modules/homepage/components/Qwant/index.d.ts +0 -3
  129. package/dist/modules/homepage/components/Rss/Rss.d.ts +0 -11
  130. package/dist/modules/homepage/components/Rss/Rss.js +0 -64
  131. package/dist/modules/homepage/components/Rss/RssContainer.d.ts +0 -1
  132. package/dist/modules/homepage/components/Rss/RssContainer.js +0 -45
  133. package/dist/modules/homepage/components/Rss/RssFeedForm.d.ts +0 -13
  134. package/dist/modules/homepage/components/Rss/RssFeedForm.js +0 -69
  135. package/dist/modules/homepage/components/Rss/RssFeedsModal.d.ts +0 -11
  136. package/dist/modules/homepage/components/Rss/RssFeedsModal.js +0 -58
  137. package/dist/modules/homepage/components/Rss/hooks/useRssContainer.d.ts +0 -25
  138. package/dist/modules/homepage/components/Rss/hooks/useRssContainer.js +0 -43
  139. package/dist/modules/homepage/components/Rss/index.d.ts +0 -6
  140. package/dist/modules/homepage/components/Rss/services/api/index.d.ts +0 -5
  141. package/dist/modules/homepage/components/Rss/services/api/index.js +0 -5
  142. package/dist/modules/homepage/components/Rss/services/api/rssService.d.ts +0 -38
  143. package/dist/modules/homepage/components/Rss/services/api/rssService.js +0 -51
  144. package/dist/modules/homepage/components/Rss/services/queries/rss.d.ts +0 -28
  145. package/dist/modules/homepage/components/Rss/services/queries/rss.js +0 -71
  146. package/dist/modules/homepage/components/Rss/types.d.ts +0 -25
  147. package/dist/modules/homepage/components/Rss/utils.d.ts +0 -7
  148. package/dist/modules/homepage/components/Rss/utils.js +0 -19
  149. package/dist/modules/homepage/components/TabsKids/components/TabsKids.d.ts +0 -43
  150. package/dist/modules/homepage/components/TabsKids/components/TabsKids.js +0 -23
  151. package/dist/modules/homepage/components/TabsKids/components/TabsKidsItem.d.ts +0 -34
  152. package/dist/modules/homepage/components/TabsKids/components/TabsKidsItem.js +0 -26
  153. package/dist/modules/homepage/components/TabsKids/components/TabsKidsList.d.ts +0 -14
  154. package/dist/modules/homepage/components/TabsKids/components/TabsKidsList.js +0 -64
  155. package/dist/modules/homepage/components/TabsKids/hooks/useTabsKidsOverflow.d.ts +0 -20
  156. package/dist/modules/homepage/components/TabsKids/hooks/useTabsKidsOverflow.js +0 -43
  157. package/dist/modules/homepage/components/TabsKids/index.d.ts +0 -3
  158. package/dist/modules/homepage/components/TabsKids/utils/visibleTabs.d.ts +0 -15
  159. package/dist/modules/homepage/components/TabsKids/utils/visibleTabs.js +0 -21
  160. package/dist/modules/homepage/components/Universalis/Universalis.d.ts +0 -8
  161. package/dist/modules/homepage/components/Universalis/Universalis.js +0 -62
  162. package/dist/modules/homepage/components/Universalis/UniversalisContainer.d.ts +0 -1
  163. package/dist/modules/homepage/components/Universalis/UniversalisContainer.js +0 -16
  164. package/dist/modules/homepage/components/Universalis/index.d.ts +0 -3
  165. package/dist/modules/homepage/components/WidgetsPersonalizationPanel/WidgetToggle.d.ts +0 -16
  166. package/dist/modules/homepage/components/WidgetsPersonalizationPanel/WidgetToggle.js +0 -15
  167. package/dist/modules/homepage/components/WidgetsPersonalizationPanel/WidgetsPersonalizationPanel.d.ts +0 -21
  168. package/dist/modules/homepage/components/WidgetsPersonalizationPanel/WidgetsPersonalizationPanel.js +0 -47
  169. package/dist/modules/homepage/components/WidgetsPersonalizationPanel/index.d.ts +0 -2
  170. package/dist/modules/icons/components/IconAddWidget.d.ts +0 -7
  171. package/dist/modules/icons/components/IconAddWidget.js +0 -12
package/dist/index.js CHANGED
@@ -42,7 +42,6 @@ import { default as default40 } from "./components/Loading/Loading.js";
42
42
  import { default as default41 } from "./components/LoadingScreen/LoadingScreen.js";
43
43
  import { default as default42 } from "./components/Logo/Logo.js";
44
44
  import { default as default43 } from "./components/LogoBeta/LogoBeta.js";
45
- import { Masonry } from "./components/Masonry/Masonry.js";
46
45
  import { default as default44 } from "./modules/multimedia/MediaLibrary/MediaLibrary.js";
47
46
  import { default as default45 } from "./components/MediaViewer/MediaViewer.js";
48
47
  import { default as default46 } from "./components/Modal/Modal.js";
@@ -231,7 +230,6 @@ export {
231
230
  default41 as LoadingScreen,
232
231
  default42 as Logo,
233
232
  default43 as LogoBeta,
234
- Masonry,
235
233
  default44 as MediaLibrary,
236
234
  default45 as MediaViewer,
237
235
  Menu,
@@ -1,5 +1,5 @@
1
1
  import { jsxs, jsx } from "react/jsx-runtime";
2
- import { useState, useEffect } from "react";
2
+ import { useState, useRef, useEffect } from "react";
3
3
  import clsx from "clsx";
4
4
  import { createPortal } from "react-dom";
5
5
  import { useTranslation } from "react-i18next";
@@ -16,20 +16,22 @@ const HelpZone = ({
16
16
  }) => {
17
17
  const {
18
18
  t
19
- } = useTranslation(), [portalRoot, setPortalRoot] = useState(null), [isCompact, setIsCompact] = useState(!1);
19
+ } = useTranslation(), [portalRoot, setPortalRoot] = useState(null), [isCompact, setIsCompact] = useState(!1), questionButtonRef = useRef(null);
20
20
  if (useEffect(() => (document.body.classList.add("help-zone-active"), setPortalRoot(document.getElementById("portal")), () => {
21
21
  document.body.classList.remove("help-zone-active");
22
22
  }), []), useEffect(() => {
23
23
  if (isCompact)
24
24
  return;
25
- const goCompact = () => setIsCompact(!0);
25
+ const goCompact = () => setIsCompact(!0), handleClick = (event) => {
26
+ questionButtonRef.current && event.target instanceof Node && questionButtonRef.current.contains(event.target) || goCompact();
27
+ };
26
28
  return document.addEventListener("scroll", goCompact, {
27
29
  capture: !0,
28
30
  passive: !0
29
- }), () => {
31
+ }), document.addEventListener("click", handleClick), () => {
30
32
  document.removeEventListener("scroll", goCompact, {
31
33
  capture: !0
32
- });
34
+ }), document.removeEventListener("click", handleClick);
33
35
  };
34
36
  }, [isCompact]), !isReady || !portalRoot)
35
37
  return null;
@@ -42,7 +44,7 @@ const HelpZone = ({
42
44
  "help-zone-logo--full": !isCompact
43
45
  }), children: isCompact ? /* @__PURE__ */ jsx(SvgIconLogoEdificeSmall, { width: 18, height: 18 }) : /* @__PURE__ */ jsx(SvgIconLogoEdificeFull, { width: 81, height: 18 }) }) }) }),
44
46
  /* @__PURE__ */ jsx("span", { className: "help-zone-divider" }),
45
- /* @__PURE__ */ jsx(ButtonBeta, { className: "help-zone-question", "aria-label": t("help-zone.support.open"), color: "tertiary", variant: "ghost", onClick: handleOpenHelpZone, children: /* @__PURE__ */ jsx(Tooltip, { message: t("help-zone.support.open"), placement: "top", children: /* @__PURE__ */ jsx(SvgIconQuestion, { width: 24, height: 24, color: "white" }) }) })
47
+ /* @__PURE__ */ jsx(ButtonBeta, { ref: questionButtonRef, className: "help-zone-question", "aria-label": t("help-zone.support.open"), color: "tertiary", variant: "ghost", onClick: handleOpenHelpZone, children: /* @__PURE__ */ jsx(Tooltip, { message: t("help-zone.support.open"), placement: "top", children: /* @__PURE__ */ jsx(SvgIconQuestion, { width: 24, height: 24, color: "white" }) }) })
46
48
  ] }), portalRoot);
47
49
  };
48
50
  export {
@@ -1,13 +1,16 @@
1
1
  import { jsx } from "react/jsx-runtime";
2
2
  import HelpZone from "./HelpZone.js";
3
3
  import useZendeskGuide from "../../hooks/useZendeskGuide/useZendeskGuide.js";
4
+ function getHeaderColor() {
5
+ return getComputedStyle(document.documentElement).getPropertyValue("--primitive-blue-400").trim();
6
+ }
4
7
  function HelpZoneContainer() {
5
- const {
8
+ const headerColor = getHeaderColor(), {
6
9
  isReady,
7
10
  isOpen,
8
11
  open,
9
12
  close
10
- } = useZendeskGuide();
13
+ } = useZendeskGuide(headerColor);
11
14
  return /* @__PURE__ */ jsx(HelpZone, { isReady, isOpen, onOpen: open, onClose: close });
12
15
  }
13
16
  export {
@@ -3,11 +3,6 @@ import { Content, Extensions, FocusPosition, JSONContent } from '@tiptap/react';
3
3
  export interface EditorRef {
4
4
  /** Get the current content. */
5
5
  getContent: (as: 'html' | 'json' | 'plain') => undefined | string | JSONContent;
6
- /**
7
- * Whether the editor has no content (TipTap's `editor.isEmpty`).
8
- * Evaluated on each access, so it always reflects the current document.
9
- */
10
- readonly isEmpty: boolean;
11
6
  /** Get speech synthetisis current state */
12
7
  isSpeeching: () => boolean;
13
8
  /** [De]activate speech synthetisis */
@@ -60,9 +60,6 @@ const MathsModal = /* @__PURE__ */ lazy(async () => await import("../MathsModal/
60
60
  throw `[Editor] Unknown content format ${as}`;
61
61
  }
62
62
  },
63
- get isEmpty() {
64
- return (editor == null ? void 0 : editor.isEmpty) ?? !0;
65
- },
66
63
  toogleSpeechSynthetisis: speechSynthetisis.toggle,
67
64
  isSpeeching: () => speechSynthetisis.isActivated,
68
65
  setFocus: (position) => {
@@ -63,18 +63,18 @@ const Header = ({
63
63
  onNotificationsClick == null || onNotificationsClick();
64
64
  };
65
65
  return /* @__PURE__ */ jsx("header", { className: classes, "data-product": dataProduct, children: /* @__PURE__ */ jsxs(Navbar, { className: "px-24", children: [
66
- /* @__PURE__ */ jsx(LogoBeta, { src: `${src}/img/illustrations/logo-v2.png` }),
66
+ /* @__PURE__ */ jsx(LogoBeta, { src: `${src}/img/illustrations/logo.png` }),
67
67
  /* @__PURE__ */ jsxs("ul", { className: "navbar-nav", children: [
68
- /* @__PURE__ */ jsx(NavItem, { children: /* @__PURE__ */ jsx(NavLink, { link: "/timeline/timeline", translate: t("navbar.home"), "data-testid": "header-home-button", title: t("navbar.home"), children: /* @__PURE__ */ jsx(SvgIconHomeBeta, {}) }) }),
69
- communitiesWorkflow && /* @__PURE__ */ jsx(NavItem, { children: /* @__PURE__ */ jsx(NavLink, { link: "/communities", translate: t("navbar.community"), "data-testid": "header-community-button", title: t("navbar.community"), children: /* @__PURE__ */ jsx(SvgIconCommunitiesBeta, { className: "icon community" }) }) }),
70
- conversationWorflow && /* @__PURE__ */ jsx(NavItem, { children: /* @__PURE__ */ jsxs(NavLink, { className: "position-relative", link: "/conversation/conversation", translate: t("conversation"), title: t("conversation"), "data-testid": "header-messagerie-button", children: [
68
+ /* @__PURE__ */ jsx(NavItem, { children: /* @__PURE__ */ jsx(NavLink, { link: "/timeline/timeline", translate: t("navbar.home"), "data-testid": "header-home-button", children: /* @__PURE__ */ jsx(SvgIconHomeBeta, {}) }) }),
69
+ communitiesWorkflow && /* @__PURE__ */ jsx(NavItem, { children: /* @__PURE__ */ jsx(NavLink, { link: "/communities", translate: t("navbar.community"), "data-testid": "header-community-button", children: /* @__PURE__ */ jsx(SvgIconCommunitiesBeta, { className: "icon community" }) }) }),
70
+ conversationWorflow && /* @__PURE__ */ jsx(NavItem, { children: /* @__PURE__ */ jsxs(NavLink, { className: "position-relative", link: "/conversation/conversation", translate: t("conversation"), "data-testid": "header-messagerie-button", children: [
71
71
  /* @__PURE__ */ jsx(SvgIconMessagesBeta, {}),
72
72
  hasMessages && /* @__PURE__ */ jsx(Badge, { variant: {
73
73
  type: "notification",
74
74
  level: "danger"
75
75
  }, className: "position-absolute", children: messages })
76
76
  ] }) }),
77
- hasCarbonioWorkflow && /* @__PURE__ */ jsx(NavItem, { children: /* @__PURE__ */ jsxs("a", { className: "nav-link position-relative", href: "/auth/carbonio/preauth", target: "_blank", "data-testid": "header-messagerie-button", title: t("conversation"), children: [
77
+ hasCarbonioWorkflow && /* @__PURE__ */ jsx(NavItem, { children: /* @__PURE__ */ jsxs("a", { className: "nav-link position-relative", href: "/auth/carbonio/preauth", target: "_blank", "data-testid": "header-messagerie-button", children: [
78
78
  /* @__PURE__ */ jsx(SvgIconMessagesBeta, {}),
79
79
  carbonioUnreadCount > 0 && /* @__PURE__ */ jsx(Badge, { variant: {
80
80
  type: "notification",
@@ -83,7 +83,7 @@ const Header = ({
83
83
  /* @__PURE__ */ jsx(VisuallyHidden, { children: t("conversation") })
84
84
  ] }) }),
85
85
  /* @__PURE__ */ jsxs(NavItem, { className: "position-relative", children: [
86
- /* @__PURE__ */ jsx(NavLink, { ref: myApps.setReference, link: "/welcome", title: t("navbar.applications"), translate: t("navbar.applications"), id: popoverAppsId, "aria-haspopup": "true", "aria-expanded": myApps.open, "data-testid": "header-my-apps-button", ...myApps.getReferenceProps({
86
+ /* @__PURE__ */ jsx(NavLink, { ref: myApps.setReference, link: "/welcome", translate: t("navbar.applications"), id: popoverAppsId, "aria-haspopup": "true", "aria-expanded": myApps.open, "data-testid": "header-my-apps-button", ...myApps.getReferenceProps({
87
87
  onClick: handleMyAppsClick
88
88
  }), children: /* @__PURE__ */ jsx(SvgIconMyAppsBeta, {}) }),
89
89
  /* @__PURE__ */ jsxs(Popover, { ref: myApps.setFloating, className: "my-apps-popover", id: popoverAppsId, isVisible: myApps.open, ...myApps.getFloatingProps(), children: [
@@ -91,9 +91,21 @@ const Header = ({
91
91
  /* @__PURE__ */ jsx(PopoverFooter, { className: "d-flex justify-content-center", children: /* @__PURE__ */ jsx(MyAppsPopoverFooter, {}) })
92
92
  ] })
93
93
  ] }),
94
- /* @__PURE__ */ jsxs(NavItem, { className: "position-relative navbar-nav-notification", children: [
95
- /* @__PURE__ */ jsx(ButtonBeta, { leftIcon: /* @__PURE__ */ jsx(SvgIconNotificationBeta, {}), variant: "ghost", title: t("navbar.notifications"), "data-testid": "header-notifications-button", "aria-label": t("navbar.notifications"), onClick: handleNotificationsClick }),
96
- hasNotificationToday && /* @__PURE__ */ jsx("span", { className: "navbar-nav-notification-badge", children: /* @__PURE__ */ jsx(VisuallyHidden, { children: t("navbar.notifications.new") }) })
94
+ /* @__PURE__ */ jsxs(NavItem, { className: "position-relative", children: [
95
+ /* @__PURE__ */ jsx(ButtonBeta, { leftIcon: /* @__PURE__ */ jsx(SvgIconNotificationBeta, {}), variant: "ghost", onClick: handleNotificationsClick }),
96
+ hasNotificationToday && /* @__PURE__ */ jsx("span", { style: {
97
+ position: "absolute",
98
+ top: 0,
99
+ right: 0,
100
+ width: 15,
101
+ height: 15,
102
+ background: "red",
103
+ borderRadius: "50%",
104
+ border: "2px solid white",
105
+ pointerEvents: "none",
106
+ zIndex: 1,
107
+ display: "block"
108
+ }, "aria-label": t("homepage.notifications.new-badge") })
97
109
  ] }),
98
110
  /* @__PURE__ */ jsxs(NavItem, { className: "position-relative", children: [
99
111
  /* @__PURE__ */ jsx(NavLink, { ref: userMenu.setReference, link: "/userbook/mon-compte", translate: t("navbar.myaccount"), id: popoverUserId, "aria-haspopup": "true", "aria-expanded": userMenu.open, "data-testid": "header-user-profile-button", ...userMenu.getReferenceProps(), children: /* @__PURE__ */ jsx(Avatar, { alt: userName, size: "sm", src: userAvatar, variant: "circle", className: "bg-white", width: "32", height: "32" }) }),
@@ -3,11 +3,7 @@ import { ButtonBeta } from '../../../../components';
3
3
  export interface HomeCardHeaderProps extends Omit<ComponentPropsWithoutRef<'div'>, 'title'> {
4
4
  /** Title displayed on the left side of the header. */
5
5
  title: ReactNode;
6
- /**
7
- * Label of the action button displayed on the right side of the header.
8
- * Can be omitted for an icon-only button — pass `aria-label` via
9
- * `actionProps` in that case.
10
- */
6
+ /** Label of the action button displayed on the right side of the header. */
11
7
  actionLabel?: ReactNode;
12
8
  /** Callback invoked when the action button is clicked. */
13
9
  onActionClick?: MouseEventHandler<HTMLButtonElement>;
@@ -12,7 +12,7 @@ const HomeCardHeader = ({
12
12
  className,
13
13
  ...rest
14
14
  }) => {
15
- const hasAction = !!onActionClick && (!!actionLabel || !!actionLeftIcon || !!actionRightIcon);
15
+ const hasAction = !!actionLabel && !!onActionClick;
16
16
  return /* @__PURE__ */ jsxs(Flex, { align: "center", justify: "between", gap: "8", wrap: "wrap", className: clsx("home-card-header", className), ...rest, children: [
17
17
  /* @__PURE__ */ jsx("h3", { className: "home-card-header-title", children: title }),
18
18
  hasAction && /* @__PURE__ */ jsx(ButtonBeta, { color: "tertiary", size: "sm", variant: "ghost", onClick: onActionClick, className: "home-card-header-action", leftIcon: actionLeftIcon, rightIcon: actionRightIcon, "data-testid": "home-card-header-action", ...actionProps, children: actionLabel })
@@ -14,7 +14,7 @@ import Divider from "../../../../components/Divider/Divider.js";
14
14
  const NotificationList = ({
15
15
  notifications,
16
16
  notificationTypes,
17
- selectedTypes = [],
17
+ selectedTypes,
18
18
  onFilterChange,
19
19
  onCloseNotifications,
20
20
  onLoadNextPage,
@@ -25,23 +25,24 @@ const NotificationList = ({
25
25
  t
26
26
  } = useTranslation(), loadNextRef = useInfiniteScroll({
27
27
  callback: () => onLoadNextPage == null ? void 0 : onLoadNextPage()
28
- }), handleFilterChange = (types) => onFilterChange == null ? void 0 : onFilterChange(types), handleCloseClick = () => {
28
+ }), handleCloseClick = () => {
29
29
  onCloseNotifications && onCloseNotifications();
30
30
  };
31
- return /* @__PURE__ */ jsx("section", { role: "region", className: "notification-list", children: /* @__PURE__ */ jsxs(Flex, { direction: "column", className: "notification-list-body", children: [
31
+ return /* @__PURE__ */ jsx("section", { role: "region", className: "notification-list", children: /* @__PURE__ */ jsxs(Flex, { direction: "column", children: [
32
32
  /* @__PURE__ */ jsxs(Flex, { justify: "between", align: "center", wrap: "nowrap", className: "py-16 ps-24 pe-8", children: [
33
33
  /* @__PURE__ */ jsxs(Flex, { align: "center", gap: "8", className: "notification-list-title", children: [
34
34
  /* @__PURE__ */ jsx("h4", { className: "text-truncate", children: t("homepage.notifications-list.title") }),
35
- notificationTypes && notificationTypes.length > 0 && /* @__PURE__ */ jsx(NotificationFilterMenu, { notificationTypes, selectedTypes, onFilterChange: handleFilterChange })
35
+ notificationTypes && notificationTypes.length > 0 && /* @__PURE__ */ jsx(NotificationFilterMenu, { notificationTypes, selectedTypes: selectedTypes ?? notificationTypes, onFilterChange: (types) => onFilterChange == null ? void 0 : onFilterChange(types) })
36
36
  ] }),
37
37
  onCloseNotifications && /* @__PURE__ */ jsx(ButtonBeta, { color: "tertiary", variant: "ghost", rightIcon: /* @__PURE__ */ jsx(SvgIconClose, {}), onClick: handleCloseClick, "aria-label": t("homepage.notifications-list.close"), title: t("homepage.notifications-list.close"), "data-testid": "notification-list-close-button" })
38
38
  ] }),
39
- isLoading && !(notifications != null && notifications.length) ? /* @__PURE__ */ jsx(NotificationListSkeleton, {}) : !notifications || notifications.length === 0 ? /* @__PURE__ */ jsx("div", { className: "mx-24", children: /* @__PURE__ */ jsx(EmptyScreen, { size: 135, imageSrc: illuEmptyNotification, imageAlt: t("homepage.notifications-list.empty.description"), text: t("homepage.notifications-list.empty.description") }) }) : /* @__PURE__ */ jsxs(Fragment, { children: [
40
- /* @__PURE__ */ jsx("ul", { children: notifications.map((notification, index) => /* @__PURE__ */ jsxs("li", { children: [
39
+ (notifications == null ? void 0 : notifications.length) === 0 ? /* @__PURE__ */ jsx("div", { className: "mx-24", children: /* @__PURE__ */ jsx(EmptyScreen, { size: 135, imageSrc: illuEmptyNotification, imageAlt: t("homepage.notifications-list.empty.description"), text: t("homepage.notifications-list.empty.description") }) }) : /* @__PURE__ */ jsxs(Fragment, { children: [
40
+ /* @__PURE__ */ jsx("ul", { children: notifications == null ? void 0 : notifications.map((notification, index) => /* @__PURE__ */ jsxs("li", { children: [
41
41
  /* @__PURE__ */ jsx(NotificationItem, { notification }),
42
42
  /* @__PURE__ */ jsx(Divider, { className: "border-grey-300 my-0" })
43
43
  ] }, "notification-list-" + notification._id + "-" + index)) }),
44
- hasNextPage && /* @__PURE__ */ jsx(NotificationSkeleton, { ref: loadNextRef })
44
+ hasNextPage && /* @__PURE__ */ jsx(NotificationSkeleton, { ref: loadNextRef }),
45
+ isLoading && /* @__PURE__ */ jsx(NotificationListSkeleton, {})
45
46
  ] })
46
47
  ] }) });
47
48
  };
@@ -1,12 +1,17 @@
1
- import { jsx, jsxs } from "react/jsx-runtime";
1
+ import { jsxs, jsx } from "react/jsx-runtime";
2
2
  import NotificationSkeleton from "./NotificationSkeleton.js";
3
3
  import Divider from "../../../../components/Divider/Divider.js";
4
- const SKELETON_COUNT = 8, NotificationListSkeleton = () => /* @__PURE__ */ jsx("ul", { className: "notification-list-skeleton", "aria-hidden": "true", children: Array.from({
5
- length: SKELETON_COUNT
6
- }, (_, index) => /* @__PURE__ */ jsxs("li", { children: [
7
- /* @__PURE__ */ jsx(NotificationSkeleton, {}),
8
- index < SKELETON_COUNT - 1 && /* @__PURE__ */ jsx(Divider, { className: "border-grey-300 my-0" })
9
- ] }, index)) });
4
+ const NotificationListSkeleton = () => /* @__PURE__ */ jsxs("ul", { children: [
5
+ /* @__PURE__ */ jsxs("li", { children: [
6
+ /* @__PURE__ */ jsx(NotificationSkeleton, {}),
7
+ /* @__PURE__ */ jsx(Divider, { className: "border-grey-300 my-0" })
8
+ ] }),
9
+ /* @__PURE__ */ jsxs("li", { children: [
10
+ /* @__PURE__ */ jsx(NotificationSkeleton, {}),
11
+ /* @__PURE__ */ jsx(Divider, { className: "border-grey-300 my-0" })
12
+ ] }),
13
+ /* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsx(NotificationSkeleton, {}) })
14
+ ] });
10
15
  export {
11
16
  NotificationListSkeleton as default
12
17
  };
@@ -1,14 +1,11 @@
1
1
  import { jsx, jsxs } from "react/jsx-runtime";
2
2
  import React from "react";
3
3
  import Flex from "../../../../components/Flex/Flex.js";
4
+ import Avatar from "../../../../components/Avatar/Avatar.js";
4
5
  import TextSkeleton from "../../../../components/Skeleton/TextSkeleton.js";
5
- const NotificationSkeleton = /* @__PURE__ */ React.forwardRef((_props, ref) => /* @__PURE__ */ jsx(Flex, { direction: "column", className: "notification-item", gap: "8", ref, children: /* @__PURE__ */ jsxs(Flex, { direction: "row", gap: "8", children: [
6
- /* @__PURE__ */ jsx("div", { className: "notification-item-picture", children: /* @__PURE__ */ jsx("div", { className: "placeholder col-4", style: {
7
- height: "3.2rem",
8
- width: "3.2rem",
9
- borderRadius: "50%"
10
- } }) }),
11
- /* @__PURE__ */ jsxs(Flex, { direction: "column", gap: "8", className: "notification-item-message", children: [
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-item-picture", children: /* @__PURE__ */ jsx(Avatar, { alt: "Notification Picture", variant: "circle", className: "notification-item-avatar" }) }),
8
+ /* @__PURE__ */ jsxs(Flex, { direction: "column", gap: "8", className: "notification-message", children: [
12
9
  /* @__PURE__ */ jsx(TextSkeleton, {}),
13
10
  /* @__PURE__ */ jsx(TextSkeleton, {}),
14
11
  /* @__PURE__ */ jsx("div", { className: "placeholder col-4", style: {
@@ -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 ModalBeta from "../../../../../components/ModalBeta/ModalBeta.js";
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 /* @__PURE__ */ jsxs(ModalBeta, { id: "notification-filter-modal", size: "l", isOpen, onModalClose: onCancel, children: [
40
- /* @__PURE__ */ jsx(ModalBeta.Header, { subtitle: t("homepage.notifications.filter-modal.subtitle"), onModalClose: onCancel, children: t("homepage.notifications.filter-modal.title") }),
41
- /* @__PURE__ */ jsxs(ModalBeta.Body, { children: [
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(Checkbox, { checked: selected.length === allTypes.length, indeterminate: selected.length > 0 && selected.length < allTypes.length, onChange: toggleAll })
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,
@@ -58,13 +60,13 @@ const NotificationFilterModal = ({
58
60
  return /* @__PURE__ */ jsxs("label", { className: clsx("notification-filter-chip", {
59
61
  "is-checked": checked
60
62
  }), children: [
61
- /* @__PURE__ */ jsx(AppIcon, { app: appCode, size: "24", iconFit: "contain", "aria-hidden": "true" }),
63
+ /* @__PURE__ */ jsx(AppIcon, { app: appCode, size: "24", iconFit: "contain" }),
62
64
  /* @__PURE__ */ jsx("span", { children: label }),
63
- /* @__PURE__ */ jsx(Checkbox, { checked, onChange: () => toggleType(type) })
65
+ /* @__PURE__ */ jsx("input", { type: "checkbox", className: "notification-filter-checkbox", checked, onChange: () => toggleType(type) })
64
66
  ] }, type);
65
67
  }) })
66
68
  ] }),
67
- /* @__PURE__ */ jsxs(ModalBeta.Footer, { children: [
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
  ] })
@@ -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 ModalBeta from "../../../../../components/ModalBeta/ModalBeta.js";
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(ModalBeta, { id: "report-notification-modal", size: "m", isOpen, onModalClose: onCancel, children: [
15
- /* @__PURE__ */ jsx(ModalBeta.Header, { onModalClose: onCancel, children: t("homepage.notifications.report-modal.title") }),
16
- /* @__PURE__ */ jsx(ModalBeta.Body, { children: /* @__PURE__ */ jsx("p", { children: t("homepage.notifications.report-modal.body") }) }),
17
- /* @__PURE__ */ jsxs(ModalBeta.Footer, { children: [
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
- const appI18nKey = `homepage.notification.type.${appCode}`;
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
- case "userbook_discovervisiblegroups":
34
- appCode = "userbook";
32
+ appI18nKey = "userbook_mood", appCode = "userbook";
35
33
  break;
36
- case "viescolaire":
37
- appCode = "parametrage";
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 && setSelectedTypesState((preference == null ? void 0 : preference.type) ?? notificationTypes ?? []);
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
- }, hasNoTypeSelected = (selectedTypes == null ? void 0 : selectedTypes.length) === 0, {
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 && !hasNoTypeSelected);
33
+ } = useNotifications(selectedTypes ?? [], isFetchedTypes && !!selectedTypes);
31
34
  return {
32
- notifications: hasNoTypeSelected ? [] : data,
35
+ notifications,
33
36
  notificationTypes,
34
37
  selectedTypes,
35
38
  setSelectedTypes,
36
- hasNextPage: hasNoTypeSelected ? !1 : hasNextPage,
39
+ hasNextPage,
37
40
  loadNextPage: () => fetchNextPage(),
38
- // The notification query stays disabled until the saved filter is
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 = () => {
@@ -1,6 +1,6 @@
1
1
  import { jsx } from "react/jsx-runtime";
2
2
  import SchoolSpace from "./SchoolSpace.js";
3
- import { useUserSchools } from "../../hooks/useUserSchools.js";
3
+ import { useUserSchools } from "./useUserSchools.js";
4
4
  function SchoolSpaceContainer() {
5
5
  const {
6
6
  handleSelectedSchoolChange,
@@ -1,5 +1,5 @@
1
- import { School, WidgetName } from '@edifice.io/client';
2
- export declare function useUserSchools(widgetName?: WidgetName): {
1
+ import { School } from '@edifice.io/client';
2
+ export declare function useUserSchools(): {
3
3
  schools: School[];
4
4
  selectedSchool: School | undefined;
5
5
  handleSelectedSchoolChange: (school: School) => void;
@@ -1,15 +1,15 @@
1
1
  import { WIDGET_NAME } from "@edifice.io/client";
2
2
  import { useState, useEffect } from "react";
3
- import useWidget from "./useWidget.js";
4
- import useSession from "../../../hooks/useSession/useSession.js";
5
- function useUserSchools(widgetName = WIDGET_NAME.SCHOOL) {
3
+ import useWidget from "../../hooks/useWidget.js";
4
+ import useSession from "../../../../hooks/useSession/useSession.js";
5
+ function useUserSchools() {
6
6
  var _a, _b;
7
7
  const {
8
8
  data: session
9
9
  } = useSession(), {
10
10
  preference,
11
11
  savePreference
12
- } = useWidget(widgetName), [selectedSchool, setSelectedSchool] = useState(), [schools, setSchools] = useState((_a = session == null ? void 0 : session.userDescription) == null ? void 0 : _a.schools);
12
+ } = useWidget(WIDGET_NAME.SCHOOL), [selectedSchool, setSelectedSchool] = useState(), [schools, setSchools] = useState((_a = session == null ? void 0 : session.userDescription) == null ? void 0 : _a.schools);
13
13
  return useEffect(() => {
14
14
  var _a2;
15
15
  const newSchools = (_a2 = session == null ? void 0 : session.userDescription) == null ? void 0 : _a2.schools;
@@ -1,6 +1,6 @@
1
1
  import { jsxs, jsx } from "react/jsx-runtime";
2
2
  import { useTranslation } from "react-i18next";
3
- import illuEmptyFeeds from "@edifice.io/bootstrap/dist/images/homepage/illu-empty-useful-links.png";
3
+ import illuEmptyUsefulLinks from "@edifice.io/bootstrap/dist/images/homepage/illu-empty-useful-links.png";
4
4
  import SvgIconEdit from "../../../icons/components/IconEdit.js";
5
5
  import HomeCard from "../HomeCard/HomeCard.js";
6
6
  import Image from "../../../../components/Image/Image.js";
@@ -18,7 +18,7 @@ function UsefulLinks({
18
18
  "data-testid": "usefullinks-button-edit"
19
19
  } }),
20
20
  /* @__PURE__ */ jsx(HomeCard.Content, { children: links.length === 0 ? /* @__PURE__ */ jsxs("div", { className: "useful-links-widget__empty", children: [
21
- /* @__PURE__ */ jsx(Image, { src: illuEmptyFeeds, alt: "", "aria-hidden": "true", style: {
21
+ /* @__PURE__ */ jsx(Image, { src: illuEmptyUsefulLinks, alt: "", "aria-hidden": "true", style: {
22
22
  width: 160,
23
23
  height: 87
24
24
  } }),
@@ -1,6 +1,6 @@
1
1
  import { jsx, jsxs, Fragment } from "react/jsx-runtime";
2
2
  import { useTranslation } from "react-i18next";
3
- import illuEmptyFeeds from "@edifice.io/bootstrap/dist/images/homepage/illu-empty-useful-links.png";
3
+ import illuEmptyUsefulLinks from "@edifice.io/bootstrap/dist/images/homepage/illu-empty-useful-links.png";
4
4
  import SvgIconClose from "../../../icons/components/IconClose.js";
5
5
  import SvgIconEdit from "../../../icons/components/IconEdit.js";
6
6
  import SvgIconPlus from "../../../icons/components/IconPlus.js";
@@ -29,7 +29,7 @@ function UsefulLinksModal({
29
29
  /* @__PURE__ */ jsx(ModalBeta.Body, { children: links.length === 0 ? /* @__PURE__ */ jsxs(Fragment, { children: [
30
30
  /* @__PURE__ */ jsx(Flex, { justify: "end", className: "mb-16", children: addLinkButton }),
31
31
  /* @__PURE__ */ jsxs("div", { className: "useful-links-modal__empty", children: [
32
- /* @__PURE__ */ jsx(Image, { src: illuEmptyFeeds, alt: "", "aria-hidden": "true", style: {
32
+ /* @__PURE__ */ jsx(Image, { src: illuEmptyUsefulLinks, alt: "", "aria-hidden": "true", style: {
33
33
  width: 200,
34
34
  height: 109
35
35
  } }),
@@ -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, onCustomizeWidgetsClick, }: UserSpaceProps): import("react/jsx-runtime").JSX.Element;
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", justify: "between", gap: "8", children: [
23
- /* @__PURE__ */ jsxs(Flex, { direction: "row", gap: "8", children: [
24
- /* @__PURE__ */ jsx(Avatar, { className: "user-space--avatar", size: "auto", alt: name, src: avatar, variant: "circle" }),
25
- /* @__PURE__ */ jsxs(Flex, { direction: "column", children: [
26
- /* @__PURE__ */ jsx("div", { "data-testid": "user-space-name", className: "user-space--name", children: name }),
27
- /* @__PURE__ */ jsx("div", { "data-testid": "user-space-profile", className: "user-space--profile", children: t(profile) })
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
  ] });