@edifice.io/react 2.6.12-develop-integration.20261103121816 → 2.6.12-develop-b2school.20261103144351

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 (235) hide show
  1. package/dist/components/Checkbox/Checkbox.js +1 -1
  2. package/dist/components/Dropdown/DropdownItem.js +17 -1
  3. package/dist/components/Layout/Layout.js +12 -4
  4. package/dist/components/Masonry/Masonry.d.ts +40 -0
  5. package/dist/components/Masonry/Masonry.js +50 -0
  6. package/dist/components/Masonry/index.d.ts +2 -0
  7. package/dist/components/SearchBar/SearchBar.js +17 -26
  8. package/dist/components/Tree/components/Tree.d.ts +2 -5
  9. package/dist/components/Tree/components/Tree.js +10 -7
  10. package/dist/components/Tree/hooks/useTree.d.ts +1 -0
  11. package/dist/components/Tree/hooks/useTree.js +6 -2
  12. package/dist/components/Tree/types/index.d.ts +7 -0
  13. package/dist/components/index.d.ts +1 -0
  14. package/dist/homepage.js +97 -28
  15. package/dist/hooks/index.d.ts +0 -1
  16. package/dist/hooks/useDropdown/useDropdown.js +2 -2
  17. package/dist/hooks/useZendeskGuide/useZendeskGuide.d.ts +2 -6
  18. package/dist/hooks/useZendeskGuide/useZendeskGuide.js +11 -8
  19. package/dist/icons-apps.js +182 -184
  20. package/dist/icons.js +406 -404
  21. package/dist/index.js +194 -198
  22. package/dist/modules/HelpZone/HelpZone.js +6 -8
  23. package/dist/modules/HelpZone/HelpZoneContainer.js +2 -5
  24. package/dist/modules/editor/components/Editor/Editor.d.ts +5 -7
  25. package/dist/modules/editor/components/Editor/Editor.js +5 -3
  26. package/dist/modules/editor/components/EditorToolbar/EditorToolbar.d.ts +1 -3
  27. package/dist/modules/editor/components/EditorToolbar/EditorToolbar.js +8 -14
  28. package/dist/modules/editor/components/NodeView/ImageNodeView.d.ts +1 -1
  29. package/dist/modules/editor/components/NodeView/ImageNodeView.js +7 -14
  30. package/dist/modules/editor/hooks/useActionOptions.d.ts +1 -1
  31. package/dist/modules/editor/hooks/useActionOptions.js +12 -12
  32. package/dist/modules/editor/hooks/useTipTapEditor.d.ts +1 -2
  33. package/dist/modules/editor/hooks/useTipTapEditor.js +2 -2
  34. package/dist/modules/homepage/components/Agenda/Agenda.d.ts +10 -0
  35. package/dist/modules/homepage/components/Agenda/Agenda.js +54 -0
  36. package/dist/modules/homepage/components/Agenda/AgendaContainer.d.ts +1 -0
  37. package/dist/modules/homepage/components/Agenda/AgendaContainer.js +14 -0
  38. package/dist/modules/homepage/components/Agenda/AgendaEventCard.d.ts +10 -0
  39. package/dist/modules/homepage/components/Agenda/AgendaEventCard.js +30 -0
  40. package/dist/modules/homepage/components/Agenda/hooks/useAgendaContainer.d.ts +14 -0
  41. package/dist/modules/homepage/components/Agenda/hooks/useAgendaContainer.js +27 -0
  42. package/dist/modules/homepage/components/Agenda/index.d.ts +3 -0
  43. package/dist/modules/homepage/components/Agenda/services/api/agendaService.d.ts +24 -0
  44. package/dist/modules/homepage/components/Agenda/services/api/agendaService.js +45 -0
  45. package/dist/modules/homepage/components/Agenda/services/api/index.d.ts +4 -0
  46. package/dist/modules/homepage/components/Agenda/services/api/index.js +5 -0
  47. package/dist/modules/homepage/components/Agenda/services/queries/agenda.d.ts +19 -0
  48. package/dist/modules/homepage/components/Agenda/services/queries/agenda.js +26 -0
  49. package/dist/modules/homepage/components/BriefMe/BriefMe.d.ts +9 -0
  50. package/dist/modules/homepage/components/BriefMe/BriefMe.js +59 -0
  51. package/dist/modules/homepage/components/BriefMe/BriefMeContainer.d.ts +4 -0
  52. package/dist/modules/homepage/components/BriefMe/BriefMeContainer.js +17 -0
  53. package/dist/modules/homepage/components/BriefMe/index.d.ts +4 -0
  54. package/dist/modules/homepage/components/BriefMe/types.d.ts +17 -0
  55. package/dist/modules/homepage/components/BriefMe/types.js +8 -0
  56. package/dist/modules/homepage/components/BriefMe/useBriefMe.d.ts +31 -0
  57. package/dist/modules/homepage/components/BriefMe/useBriefMe.js +51 -0
  58. package/dist/modules/homepage/components/Cantine/Cantine.d.ts +7 -0
  59. package/dist/modules/homepage/components/Cantine/Cantine.js +44 -0
  60. package/dist/modules/homepage/components/Cantine/CantineContainer.d.ts +4 -0
  61. package/dist/modules/homepage/components/Cantine/CantineContainer.js +18 -0
  62. package/dist/modules/homepage/components/Cantine/CantineModal.d.ts +24 -0
  63. package/dist/modules/homepage/components/Cantine/CantineModal.js +88 -0
  64. package/dist/modules/homepage/components/Cantine/CantineModalContainer.d.ts +7 -0
  65. package/dist/modules/homepage/components/Cantine/CantineModalContainer.js +12 -0
  66. package/dist/modules/homepage/components/Cantine/components/CantineLegend.d.ts +5 -0
  67. package/dist/modules/homepage/components/Cantine/components/CantineLegend.js +22 -0
  68. package/dist/modules/homepage/components/Cantine/components/CantineMenuSection.d.ts +6 -0
  69. package/dist/modules/homepage/components/Cantine/components/CantineMenuSection.js +28 -0
  70. package/dist/modules/homepage/components/Cantine/components/cantineLabels.d.ts +12 -0
  71. package/dist/modules/homepage/components/Cantine/components/cantineLabels.js +60 -0
  72. package/dist/modules/homepage/components/Cantine/hooks/useCantine.d.ts +11 -0
  73. package/dist/modules/homepage/components/Cantine/hooks/useCantine.js +20 -0
  74. package/dist/modules/homepage/components/Cantine/hooks/useCantineMenu.d.ts +24 -0
  75. package/dist/modules/homepage/components/Cantine/hooks/useCantineMenu.js +65 -0
  76. package/dist/modules/homepage/components/Cantine/hooks/useCantineModal.d.ts +23 -0
  77. package/dist/modules/homepage/components/Cantine/hooks/useCantineModal.js +43 -0
  78. package/dist/modules/homepage/components/Cantine/index.d.ts +7 -0
  79. package/dist/modules/homepage/components/Cantine/types.d.ts +42 -0
  80. package/dist/modules/homepage/components/Edumalin/Edumalin.d.ts +9 -0
  81. package/dist/modules/homepage/components/Edumalin/Edumalin.js +65 -0
  82. package/dist/modules/homepage/components/Edumalin/EdumalinContainer.d.ts +4 -0
  83. package/dist/modules/homepage/components/Edumalin/EdumalinContainer.js +21 -0
  84. package/dist/modules/homepage/components/Edumalin/EdumalinModal.d.ts +8 -0
  85. package/dist/modules/homepage/components/Edumalin/EdumalinModal.js +62 -0
  86. package/dist/modules/homepage/components/Edumalin/components/EdumalinBadge.d.ts +5 -0
  87. package/dist/modules/homepage/components/Edumalin/components/EdumalinBadge.js +38 -0
  88. package/dist/modules/homepage/components/Edumalin/components/EdumalinPicture.d.ts +5 -0
  89. package/dist/modules/homepage/components/Edumalin/components/EdumalinPicture.js +12 -0
  90. package/dist/modules/homepage/components/Edumalin/index.d.ts +7 -0
  91. package/dist/modules/homepage/components/Edumalin/types.d.ts +24 -0
  92. package/dist/modules/homepage/components/Edumalin/types.js +4 -0
  93. package/dist/modules/homepage/components/Edumalin/useEdumalin.d.ts +16 -0
  94. package/dist/modules/homepage/components/Edumalin/useEdumalin.js +35 -0
  95. package/dist/modules/homepage/components/Edumalin/utils.d.ts +28 -0
  96. package/dist/modules/homepage/components/Edumalin/utils.js +56 -0
  97. package/dist/modules/homepage/components/GenerationHdf/GenerationHdf.d.ts +16 -0
  98. package/dist/modules/homepage/components/GenerationHdf/GenerationHdf.js +65 -0
  99. package/dist/modules/homepage/components/GenerationHdf/GenerationHdfContainer.d.ts +4 -0
  100. package/dist/modules/homepage/components/GenerationHdf/GenerationHdfContainer.js +12 -0
  101. package/dist/modules/homepage/components/GenerationHdf/formatSolde.d.ts +1 -0
  102. package/dist/modules/homepage/components/GenerationHdf/formatSolde.js +6 -0
  103. package/dist/modules/homepage/components/GenerationHdf/index.d.ts +3 -0
  104. package/dist/modules/homepage/components/GenerationHdf/useGenerationHdf.d.ts +10 -0
  105. package/dist/modules/homepage/components/GenerationHdf/useGenerationHdf.js +69 -0
  106. package/dist/modules/homepage/components/Header/Header.js +9 -21
  107. package/dist/modules/homepage/components/HomeCard/HomeCardHeader.d.ts +5 -1
  108. package/dist/modules/homepage/components/HomeCard/HomeCardHeader.js +1 -1
  109. package/dist/modules/homepage/components/Notifications/NotificationList.js +7 -8
  110. package/dist/modules/homepage/components/Notifications/NotificationListSkeleton.js +7 -12
  111. package/dist/modules/homepage/components/Notifications/NotificationSkeleton.js +7 -4
  112. package/dist/modules/homepage/components/Notifications/components/CommonNotificationItem.js +9 -9
  113. package/dist/modules/homepage/components/Notifications/components/NotificationFilterModal.js +11 -13
  114. package/dist/modules/homepage/components/Notifications/components/ReportNotificationModal.js +6 -12
  115. package/dist/modules/homepage/components/Notifications/components/notificationAdapter.d.ts +1 -2
  116. package/dist/modules/homepage/components/Notifications/components/notificationAdapter.js +14 -12
  117. package/dist/modules/homepage/components/Notifications/hooks/useNotificationList.js +9 -10
  118. package/dist/modules/homepage/components/Qwant/Qwant.d.ts +4 -0
  119. package/dist/modules/homepage/components/Qwant/Qwant.js +41 -0
  120. package/dist/modules/homepage/components/Qwant/QwantContainer.d.ts +1 -0
  121. package/dist/modules/homepage/components/Qwant/QwantContainer.js +10 -0
  122. package/dist/modules/homepage/components/Qwant/index.d.ts +3 -0
  123. package/dist/modules/homepage/components/Rss/Rss.d.ts +11 -0
  124. package/dist/modules/homepage/components/Rss/Rss.js +64 -0
  125. package/dist/modules/homepage/components/Rss/RssContainer.d.ts +1 -0
  126. package/dist/modules/homepage/components/Rss/RssContainer.js +45 -0
  127. package/dist/modules/homepage/components/Rss/RssFeedForm.d.ts +13 -0
  128. package/dist/modules/homepage/components/Rss/RssFeedForm.js +69 -0
  129. package/dist/modules/homepage/components/Rss/RssFeedsModal.d.ts +11 -0
  130. package/dist/modules/homepage/components/Rss/RssFeedsModal.js +58 -0
  131. package/dist/modules/homepage/components/Rss/hooks/useRssContainer.d.ts +25 -0
  132. package/dist/modules/homepage/components/Rss/hooks/useRssContainer.js +43 -0
  133. package/dist/modules/homepage/components/Rss/index.d.ts +6 -0
  134. package/dist/modules/homepage/components/Rss/services/api/index.d.ts +5 -0
  135. package/dist/modules/homepage/components/Rss/services/api/index.js +5 -0
  136. package/dist/modules/homepage/components/Rss/services/api/rssService.d.ts +38 -0
  137. package/dist/modules/homepage/components/Rss/services/api/rssService.js +51 -0
  138. package/dist/modules/homepage/components/Rss/services/queries/rss.d.ts +28 -0
  139. package/dist/modules/homepage/components/Rss/services/queries/rss.js +71 -0
  140. package/dist/modules/homepage/components/Rss/types.d.ts +25 -0
  141. package/dist/modules/homepage/components/Rss/utils.d.ts +7 -0
  142. package/dist/modules/homepage/components/Rss/utils.js +19 -0
  143. package/dist/modules/homepage/components/SchoolSpace/SchoolSpaceContainer.js +1 -1
  144. package/dist/modules/homepage/components/ScreenTime/ScreenTime.d.ts +11 -0
  145. package/dist/modules/homepage/components/ScreenTime/ScreenTime.js +49 -0
  146. package/dist/modules/homepage/components/ScreenTime/ScreenTimeChart.d.ts +10 -0
  147. package/dist/modules/homepage/components/ScreenTime/ScreenTimeChart.js +115 -0
  148. package/dist/modules/homepage/components/ScreenTime/ScreenTimeContainer.d.ts +1 -0
  149. package/dist/modules/homepage/components/ScreenTime/ScreenTimeContainer.js +25 -0
  150. package/dist/modules/homepage/components/ScreenTime/ScreenTimeError.d.ts +5 -0
  151. package/dist/modules/homepage/components/ScreenTime/ScreenTimeError.js +22 -0
  152. package/dist/modules/homepage/components/ScreenTime/ScreenTimeModal.d.ts +22 -0
  153. package/dist/modules/homepage/components/ScreenTime/ScreenTimeModal.js +81 -0
  154. package/dist/modules/homepage/components/ScreenTime/hooks/useScreenTimeContainer.d.ts +14 -0
  155. package/dist/modules/homepage/components/ScreenTime/hooks/useScreenTimeContainer.js +22 -0
  156. package/dist/modules/homepage/components/ScreenTime/hooks/useScreenTimeKids.d.ts +6 -0
  157. package/dist/modules/homepage/components/ScreenTime/hooks/useScreenTimeKids.js +25 -0
  158. package/dist/modules/homepage/components/ScreenTime/hooks/useScreenTimeModal.d.ts +31 -0
  159. package/dist/modules/homepage/components/ScreenTime/hooks/useScreenTimeModal.js +34 -0
  160. package/dist/modules/homepage/components/ScreenTime/index.d.ts +6 -0
  161. package/dist/modules/homepage/components/ScreenTime/services/api/index.d.ts +4 -0
  162. package/dist/modules/homepage/components/ScreenTime/services/api/index.js +5 -0
  163. package/dist/modules/homepage/components/ScreenTime/services/api/screenTimeService.d.ts +28 -0
  164. package/dist/modules/homepage/components/ScreenTime/services/api/screenTimeService.js +39 -0
  165. package/dist/modules/homepage/components/ScreenTime/services/queries/screenTime.d.ts +23 -0
  166. package/dist/modules/homepage/components/ScreenTime/services/queries/screenTime.js +41 -0
  167. package/dist/modules/homepage/components/ScreenTime/types.d.ts +30 -0
  168. package/dist/modules/homepage/components/ScreenTime/utils.d.ts +50 -0
  169. package/dist/modules/homepage/components/ScreenTime/utils.js +115 -0
  170. package/dist/modules/homepage/components/TabsKids/components/TabsKids.d.ts +43 -0
  171. package/dist/modules/homepage/components/TabsKids/components/TabsKids.js +23 -0
  172. package/dist/modules/homepage/components/TabsKids/components/TabsKidsItem.d.ts +34 -0
  173. package/dist/modules/homepage/components/TabsKids/components/TabsKidsItem.js +26 -0
  174. package/dist/modules/homepage/components/TabsKids/components/TabsKidsList.d.ts +14 -0
  175. package/dist/modules/homepage/components/TabsKids/components/TabsKidsList.js +64 -0
  176. package/dist/modules/homepage/components/TabsKids/hooks/useTabsKidsOverflow.d.ts +20 -0
  177. package/dist/modules/homepage/components/TabsKids/hooks/useTabsKidsOverflow.js +43 -0
  178. package/dist/modules/homepage/components/TabsKids/index.d.ts +3 -0
  179. package/dist/modules/homepage/components/TabsKids/utils/visibleTabs.d.ts +15 -0
  180. package/dist/modules/homepage/components/TabsKids/utils/visibleTabs.js +21 -0
  181. package/dist/modules/homepage/components/Universalis/Universalis.d.ts +8 -0
  182. package/dist/modules/homepage/components/Universalis/Universalis.js +62 -0
  183. package/dist/modules/homepage/components/Universalis/UniversalisContainer.d.ts +1 -0
  184. package/dist/modules/homepage/components/Universalis/UniversalisContainer.js +16 -0
  185. package/dist/modules/homepage/components/Universalis/index.d.ts +3 -0
  186. package/dist/modules/homepage/components/UsefulLinks/UsefulLinks.js +2 -2
  187. package/dist/modules/homepage/components/UsefulLinks/UsefulLinksModal.js +2 -2
  188. package/dist/modules/homepage/components/UserSpace/UserSpace.d.ts +3 -1
  189. package/dist/modules/homepage/components/UserSpace/UserSpace.js +13 -7
  190. package/dist/modules/homepage/components/UserSpace/UserSpaceContainer.d.ts +4 -2
  191. package/dist/modules/homepage/components/UserSpace/UserSpaceContainer.js +3 -2
  192. package/dist/modules/homepage/components/WidgetsPersonalizationPanel/WidgetToggle.d.ts +16 -0
  193. package/dist/modules/homepage/components/WidgetsPersonalizationPanel/WidgetToggle.js +15 -0
  194. package/dist/modules/homepage/components/WidgetsPersonalizationPanel/WidgetsPersonalizationPanel.d.ts +21 -0
  195. package/dist/modules/homepage/components/WidgetsPersonalizationPanel/WidgetsPersonalizationPanel.js +47 -0
  196. package/dist/modules/homepage/components/WidgetsPersonalizationPanel/index.d.ts +2 -0
  197. package/dist/modules/homepage/components/index.d.ts +12 -2
  198. package/dist/modules/homepage/{components/SchoolSpace → hooks}/useUserSchools.d.ts +2 -2
  199. package/dist/modules/homepage/{components/SchoolSpace → hooks}/useUserSchools.js +4 -4
  200. package/dist/modules/icons/components/IconAddWidget.d.ts +7 -0
  201. package/dist/modules/icons/components/IconAddWidget.js +12 -0
  202. package/dist/modules/icons/components/apps/index.d.ts +0 -1
  203. package/dist/modules/icons/components/index.d.ts +1 -0
  204. package/dist/modules/icons/components/nav/IconCommunitiesBeta.js +5 -7
  205. package/dist/modules/icons/components/nav/IconHomeBeta.js +6 -3
  206. package/dist/modules/icons/components/nav/IconMessagesBeta.js +7 -7
  207. package/dist/modules/icons/components/nav/IconMyAppsBeta.js +2 -3
  208. package/dist/modules/icons/components/nav/IconNotificationBeta.js +2 -4
  209. package/dist/modules/multimedia/FileCard/index.d.ts +0 -2
  210. package/dist/modules/multimedia/Linker/InternalLinker/InternalLinker.d.ts +1 -7
  211. package/dist/modules/multimedia/Linker/InternalLinker/InternalLinker.js +0 -2
  212. package/dist/modules/multimedia/MediaLibrary/MediaLibrary.js +5 -16
  213. package/dist/modules/multimedia/MediaLibrary/innertabs/index.d.ts +0 -1
  214. package/dist/modules/multimedia/MediaLibrary/innertabs/index.js +0 -2
  215. package/dist/modules/multimedia/Workspace/Workspace.js +1 -1
  216. package/dist/modules/multimedia/index.d.ts +0 -1
  217. package/dist/multimedia.js +22 -26
  218. package/package.json +7 -6
  219. package/dist/hooks/useGoogleDriveSearch/index.d.ts +0 -1
  220. package/dist/hooks/useGoogleDriveSearch/useGoogleDriveSearch.d.ts +0 -19
  221. package/dist/hooks/useGoogleDriveSearch/useGoogleDriveSearch.js +0 -60
  222. package/dist/modules/homepage/components/AlloLycee/AlloLycee.d.ts +0 -11
  223. package/dist/modules/homepage/components/AlloLycee/AlloLycee.js +0 -32
  224. package/dist/modules/homepage/components/AlloLycee/AlloLyceeContainer.d.ts +0 -4
  225. package/dist/modules/homepage/components/AlloLycee/AlloLyceeContainer.js +0 -10
  226. package/dist/modules/homepage/components/AlloLycee/index.d.ts +0 -3
  227. package/dist/modules/icons/components/apps/IconElea.d.ts +0 -7
  228. package/dist/modules/icons/components/apps/IconElea.js +0 -23
  229. package/dist/modules/multimedia/FileCard/GoogleDriveFileCard.d.ts +0 -25
  230. package/dist/modules/multimedia/FileCard/GoogleDriveFileCard.js +0 -102
  231. package/dist/modules/multimedia/GoogleDrive/GoogleDrive.d.ts +0 -24
  232. package/dist/modules/multimedia/GoogleDrive/GoogleDrive.js +0 -103
  233. package/dist/modules/multimedia/GoogleDrive/index.d.ts +0 -2
  234. package/dist/modules/multimedia/MediaLibrary/innertabs/GoogleDrive.d.ts +0 -1
  235. package/dist/modules/multimedia/MediaLibrary/innertabs/GoogleDrive.js +0 -61
@@ -35,15 +35,14 @@ import { Toolbar } from "../../../../components/Toolbar/Toolbar.js";
35
35
  const EditorToolbar = ({
36
36
  mediaLibraryRef,
37
37
  toggleMathsModal,
38
- cantooEditor,
39
- multimedia = !0
38
+ cantooEditor
40
39
  }) => {
41
40
  const {
42
41
  t
43
42
  } = useTranslation(), {
44
43
  id,
45
44
  editor
46
- } = useEditorContext(), [plusOptions, listOptions, alignmentOptions] = useActionOptions(editor, toggleMathsModal, mediaLibraryRef, multimedia), {
45
+ } = useEditorContext(), [plusOptions, listOptions, alignmentOptions] = useActionOptions(editor, toggleMathsModal, mediaLibraryRef), {
47
46
  isAvailable: canRecognizeSpeech,
48
47
  isActive: speechRecognition,
49
48
  toggle: toggleSpeechRecognition
@@ -106,8 +105,7 @@ const EditorToolbar = ({
106
105
  }
107
106
  },
108
107
  name: "image",
109
- tooltip: t("tiptap.toolbar.picture"),
110
- visibility: showIf(multimedia)
108
+ tooltip: t("tiptap.toolbar.picture")
111
109
  },
112
110
  //--------------- VIDEO ---------------//
113
111
  {
@@ -122,8 +120,7 @@ const EditorToolbar = ({
122
120
  }
123
121
  },
124
122
  name: "video",
125
- tooltip: t("tiptap.toolbar.video"),
126
- visibility: showIf(multimedia)
123
+ tooltip: t("tiptap.toolbar.video")
127
124
  },
128
125
  //--------------- AUDIO ---------------//
129
126
  {
@@ -138,8 +135,7 @@ const EditorToolbar = ({
138
135
  }
139
136
  },
140
137
  name: "audio",
141
- tooltip: t("tiptap.toolbar.audio"),
142
- visibility: showIf(multimedia)
138
+ tooltip: t("tiptap.toolbar.audio")
143
139
  },
144
140
  //--------------- ATTACHMENT ---------------//
145
141
  {
@@ -154,13 +150,11 @@ const EditorToolbar = ({
154
150
  }
155
151
  },
156
152
  name: "attachment",
157
- tooltip: t("tiptap.toolbar.attachment"),
158
- visibility: showIf(multimedia)
153
+ tooltip: t("tiptap.toolbar.attachment")
159
154
  },
160
155
  {
161
156
  type: "divider",
162
- name: "div-2",
163
- visibility: showIf(multimedia)
157
+ name: "div-2"
164
158
  },
165
159
  //--------------- SPEECH TO TEXT ---------------//
166
160
  {
@@ -354,7 +348,7 @@ const EditorToolbar = ({
354
348
  visibility: showIf(hasExtension("textAlign", editor))
355
349
  }
356
350
  ];
357
- }, [alignmentOptions, canRecognizeSpeech, editor, listOptions, mediaLibraryRef, multimedia, plusOptions, speechRecognition, t, toggleSpeechRecognition]);
351
+ }, [alignmentOptions, canRecognizeSpeech, editor, listOptions, mediaLibraryRef, plusOptions, speechRecognition, t, toggleSpeechRecognition]);
358
352
  return /* @__PURE__ */ jsx("div", { className: "sticky-top z-1 editor-toolbar rounded-3", children: /* @__PURE__ */ jsx(Toolbar, { items: toolbarItems, variant: "no-shadow", className: "rounded-top-3", isBlock: !0, align: "left", ariaControls: id }) });
359
353
  };
360
354
  export {
@@ -1,3 +1,3 @@
1
1
  import { WorkspaceElement } from '@edifice.io/client';
2
- declare const ImageNodeView: (Component: any, uploadFile?: (file: File) => Promise<WorkspaceElement | null>) => import('@tiptap/core').Node<import('@edifice.io/tiptap-extensions/image').CustomImageOptions, any>;
2
+ declare const ImageNodeView: (Component: any, uploadFile: (file: File) => Promise<WorkspaceElement | null>) => import('@tiptap/core').Node<import('@edifice.io/tiptap-extensions/image').CustomImageOptions, any>;
3
3
  export default ImageNodeView;
@@ -1,19 +1,12 @@
1
1
  import { Image } from "@edifice.io/tiptap-extensions/image";
2
2
  import { ReactNodeViewRenderer } from "@tiptap/react";
3
- const ImageNodeView = (Component, uploadFile) => {
4
- const ImageWithNodeView = Image.extend({
5
- addNodeView() {
6
- return ReactNodeViewRenderer(Component);
7
- }
8
- });
9
- return uploadFile ? ImageWithNodeView.configure({
10
- uploadFile
11
- }) : ImageWithNodeView.extend({
12
- addProseMirrorPlugins() {
13
- return [];
14
- }
15
- });
16
- };
3
+ const ImageNodeView = (Component, uploadFile) => Image.extend({
4
+ addNodeView() {
5
+ return ReactNodeViewRenderer(Component);
6
+ }
7
+ }).configure({
8
+ uploadFile
9
+ });
17
10
  export {
18
11
  ImageNodeView as default
19
12
  };
@@ -2,4 +2,4 @@ import { RefObject } from 'react';
2
2
  import { Editor } from '@tiptap/react';
3
3
  import { DropdownMenuOptions } from '../../../components';
4
4
  import { MediaLibraryRef } from '../../multimedia';
5
- export declare const useActionOptions: (editor: Editor | null, toggleMathsModal: () => void, mediaLibraryRef: RefObject<MediaLibraryRef>, multimedia?: boolean) => DropdownMenuOptions[][];
5
+ export declare const useActionOptions: (editor: Editor | null, toggleMathsModal: () => void, mediaLibraryRef: RefObject<MediaLibraryRef>) => DropdownMenuOptions[][];
@@ -12,19 +12,10 @@ import SvgIconSubscript from "../../icons/components/IconSubscript.js";
12
12
  import SvgIconSuperscript from "../../icons/components/IconSuperscript.js";
13
13
  import SvgIconTable from "../../icons/components/IconTable.js";
14
14
  import SvgIconTextVanilla from "../../icons/components/IconTextVanilla.js";
15
- const useActionOptions = (editor, toggleMathsModal, mediaLibraryRef, multimedia = !0) => {
15
+ const useActionOptions = (editor, toggleMathsModal, mediaLibraryRef) => {
16
16
  const {
17
17
  t
18
- } = useTranslation(), embedOptions = multimedia ? [{
19
- type: "divider"
20
- }, {
21
- icon: /* @__PURE__ */ jsx(SvgIconCode, {}),
22
- label: t("tiptap.toolbar.embed.iframe"),
23
- action: () => {
24
- var _a;
25
- return (_a = mediaLibraryRef.current) == null ? void 0 : _a.show("embedder");
26
- }
27
- }] : [], options = [{
18
+ } = useTranslation(), options = [{
28
19
  icon: /* @__PURE__ */ jsx(SvgIconTextVanilla, {}),
29
20
  label: t("tiptap.toolbar.removeFormat"),
30
21
  action: () => editor == null ? void 0 : editor.chain().clearNodes().unsetAllMarks().run()
@@ -54,7 +45,16 @@ const useActionOptions = (editor, toggleMathsModal, mediaLibraryRef, multimedia
54
45
  action: () => {
55
46
  toggleMathsModal();
56
47
  }
57
- }, ...embedOptions], listOptions = [{
48
+ }, {
49
+ type: "divider"
50
+ }, {
51
+ icon: /* @__PURE__ */ jsx(SvgIconCode, {}),
52
+ label: t("tiptap.toolbar.embed.iframe"),
53
+ action: () => {
54
+ var _a;
55
+ return (_a = mediaLibraryRef.current) == null ? void 0 : _a.show("embedder");
56
+ }
57
+ }], listOptions = [{
58
58
  icon: /* @__PURE__ */ jsx(SvgIconBulletList, {}),
59
59
  label: t("tiptap.toolbar.ulist"),
60
60
  action: () => editor == null ? void 0 : editor.chain().focus().toggleBulletList().run()
@@ -10,12 +10,11 @@ import { WorkspaceVisibility } from '@edifice.io/client';
10
10
  * @param onContentChange callback to be called on content change
11
11
  * @param visibility workspace visibility
12
12
  * @param extensions extensions to add to the editor
13
- * @param multimedia truthy to upload the images pasted or dropped in the editor
14
13
  * @returns the editor instance and the editable state
15
14
  */
16
15
  export declare const useTipTapEditor: (editable: boolean, content: Content, focus?: FocusPosition, placeholder?: string, onContentChange?: ({ editor }: {
17
16
  editor: any;
18
- }) => void, visibility?: WorkspaceVisibility, extensions?: Extensions, multimedia?: boolean) => {
17
+ }) => void, visibility?: WorkspaceVisibility, extensions?: Extensions) => {
19
18
  editor: import('@tiptap/core').Editor | null;
20
19
  editable: boolean;
21
20
  };
@@ -38,7 +38,7 @@ import AttachmentNodeView from "../components/NodeView/AttachmentNodeView.js";
38
38
  import AttachmentRenderer from "../components/Renderer/AttachmentRenderer.js";
39
39
  import InformationPaneNodeView from "../components/NodeView/InformationPaneNodeView.js";
40
40
  import InformationPaneRenderer from "../components/Renderer/InformationPaneRenderer.js";
41
- const useTipTapEditor = (editable, content, focus, placeholder, onContentChange, visibility = "protected", extensions, multimedia = !0) => {
41
+ const useTipTapEditor = (editable, content, focus, placeholder, onContentChange, visibility = "protected", extensions) => {
42
42
  const {
43
43
  currentLanguage
44
44
  } = useEdificeClient(), {
@@ -65,7 +65,7 @@ const useTipTapEditor = (editable, content, focus, placeholder, onContentChange,
65
65
  levels: [1, 2]
66
66
  }), Typography, FontSize, SpeechRecognition, SpeechSynthesis.configure({
67
67
  lang: (currentLanguage == null ? void 0 : currentLanguage.length) === 2 ? `${currentLanguage}-${currentLanguage.toUpperCase()}` : "fr-FR"
68
- }), Hyperlink, FontFamily, Mathematics, Alert, IframeNodeView(MediaRenderer), VideoNodeView(MediaRenderer), AudioNodeView(AudioRenderer), LinkerNodeView(LinkerRenderer), ImageNodeView(MediaRenderer, multimedia ? uploadFile : void 0), AttachmentNodeView(AttachmentRenderer), InformationPaneNodeView(InformationPaneRenderer), ...extensions || []],
68
+ }), Hyperlink, FontFamily, Mathematics, Alert, IframeNodeView(MediaRenderer), VideoNodeView(MediaRenderer), AudioNodeView(AudioRenderer), LinkerNodeView(LinkerRenderer), ImageNodeView(MediaRenderer, uploadFile), AttachmentNodeView(AttachmentRenderer), InformationPaneNodeView(InformationPaneRenderer), ...extensions || []],
69
69
  content,
70
70
  // If the onContentChange callback is provided, we call it on every content change.
71
71
  ...onContentChange ? {
@@ -0,0 +1,10 @@
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
+ };
@@ -0,0 +1,54 @@
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
+ };
@@ -0,0 +1 @@
1
+ export declare function AgendaContainer(): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,14 @@
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: () => {
9
+ window.open("/calendar", "_self");
10
+ } });
11
+ }
12
+ export {
13
+ AgendaContainer
14
+ };
@@ -0,0 +1,10 @@
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
+ };
@@ -0,0 +1,30 @@
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
+ };
@@ -0,0 +1,14 @@
1
+ import { CalendarEvent } from '@edifice.io/client';
2
+ /** Number of upcoming events shown by the widget. */
3
+ export declare const MAX_VISIBLE_EVENTS = 3;
4
+ export interface UseAgendaContainerReturn {
5
+ events: CalendarEvent[];
6
+ isLoading: boolean;
7
+ error: Error | null;
8
+ }
9
+ /**
10
+ * Loads the current user's calendars, then their events, and keeps only the
11
+ * next `MAX_VISIBLE_EVENTS` events that haven't fully elapsed yet — an event
12
+ * still in progress (end date in the future) counts as "upcoming" too.
13
+ */
14
+ export declare const useAgendaContainer: () => UseAgendaContainerReturn;
@@ -0,0 +1,27 @@
1
+ import dayjs from "dayjs";
2
+ import { useMemo } from "react";
3
+ import { useCalendars, useEvents } from "../services/queries/agenda.js";
4
+ const MAX_VISIBLE_EVENTS = 3, useAgendaContainer = () => {
5
+ const {
6
+ data: calendars,
7
+ isLoading: isLoadingCalendars,
8
+ error: calendarsError
9
+ } = useCalendars(), calendarIds = useMemo(() => (calendars == null ? void 0 : calendars.map((calendar) => calendar.id)) ?? [], [calendars]), {
10
+ data: rawEvents,
11
+ isLoading: isLoadingEvents,
12
+ error: eventsError
13
+ } = useEvents(calendarIds, MAX_VISIBLE_EVENTS);
14
+ return {
15
+ events: useMemo(() => {
16
+ if (!rawEvents) return [];
17
+ const now = dayjs();
18
+ return rawEvents.filter((event) => dayjs(event.endMoment).isAfter(now)).sort((a, b) => dayjs(a.startMoment).diff(dayjs(b.startMoment))).slice(0, MAX_VISIBLE_EVENTS);
19
+ }, [rawEvents]),
20
+ isLoading: isLoadingCalendars || isLoadingEvents,
21
+ error: calendarsError ?? eventsError
22
+ };
23
+ };
24
+ export {
25
+ MAX_VISIBLE_EVENTS,
26
+ useAgendaContainer
27
+ };
@@ -0,0 +1,3 @@
1
+ export * from './Agenda';
2
+ export * from './AgendaContainer';
3
+ export * from './AgendaEventCard';
@@ -0,0 +1,24 @@
1
+ import { Calendar, CalendarEvent } from '@edifice.io/client';
2
+ /**
3
+ * Creates an agenda service with methods to fetch the current user's
4
+ * calendars and upcoming events (homepage "Agenda" widget).
5
+ *
6
+ * Backend contract (provisional, see IMPULS-5880/IMPULS-6095): `GET
7
+ * /calendar/calendars` lists the user's calendars, `GET
8
+ * /calendar/events/widget?calendarId=...&nb=N` returns up to `N` events for
9
+ * the given calendars. Whether that second endpoint already excludes past
10
+ * (fully elapsed) events isn't guaranteed, so callers should re-apply that
11
+ * filter themselves.
12
+ *
13
+ * @param baseURL The base URL for the agenda service API.
14
+ */
15
+ export declare const createAgendaService: (baseURL: string) => {
16
+ /**
17
+ * Get the calendars the current user can see events from.
18
+ */
19
+ getCalendars(): Promise<Calendar[]>;
20
+ /**
21
+ * Get up to `nb` events for the given calendars, in no particular order.
22
+ */
23
+ getEvents(calendarIds: string[], nb: number): Promise<CalendarEvent[]>;
24
+ };
@@ -0,0 +1,45 @@
1
+ import { odeServices } from "@edifice.io/client";
2
+ const toCalendar = ({
3
+ _id,
4
+ title,
5
+ color,
6
+ isExternal
7
+ }) => ({
8
+ id: _id,
9
+ title,
10
+ color,
11
+ isExternal
12
+ }), toCalendarEvent = ({
13
+ _id,
14
+ title,
15
+ allday,
16
+ startMoment,
17
+ endMoment,
18
+ calendar
19
+ }) => ({
20
+ id: _id,
21
+ calendarId: calendar[0],
22
+ title,
23
+ startMoment,
24
+ endMoment,
25
+ allDay: allday
26
+ }), createAgendaService = (baseURL) => ({
27
+ /**
28
+ * Get the calendars the current user can see events from.
29
+ */
30
+ async getCalendars() {
31
+ return (await odeServices.http().get(`${baseURL}/calendar/calendars`)).map(toCalendar);
32
+ },
33
+ /**
34
+ * Get up to `nb` events for the given calendars, in no particular order.
35
+ */
36
+ async getEvents(calendarIds, nb) {
37
+ if (calendarIds.length === 0)
38
+ return [];
39
+ const query = new URLSearchParams();
40
+ return calendarIds.forEach((id) => query.append("calendarId", id)), query.set("nb", String(nb)), (await odeServices.http().get(`${baseURL}/calendar/events/widget?${query.toString()}`)).map(toCalendarEvent);
41
+ }
42
+ });
43
+ export {
44
+ createAgendaService
45
+ };
@@ -0,0 +1,4 @@
1
+ export declare const agendaService: {
2
+ getCalendars(): Promise<import('@edifice.io/client').Calendar[]>;
3
+ getEvents(calendarIds: string[], nb: number): Promise<import('@edifice.io/client').CalendarEvent[]>;
4
+ };
@@ -0,0 +1,5 @@
1
+ import { createAgendaService } from "./agendaService.js";
2
+ const agendaService = createAgendaService("");
3
+ export {
4
+ agendaService
5
+ };
@@ -0,0 +1,19 @@
1
+ import { Calendar, CalendarEvent } from '@edifice.io/client';
2
+ export declare const agendaQueryKeys: {
3
+ calendars: () => readonly ["agenda", "calendars"];
4
+ events: (calendarIds: string[], nb: number) => readonly ["agenda", "events", string[], number];
5
+ };
6
+ export declare const agendaQueryOptions: {
7
+ getCalendars(): import('@tanstack/react-query').OmitKeyof<import('@tanstack/react-query').UseQueryOptions<Calendar[], Error, Calendar[], import('@tanstack/react-query').QueryKey>, "queryFn"> & {
8
+ queryFn?: import('@tanstack/react-query').QueryFunction<Calendar[], import('@tanstack/react-query').QueryKey, never> | undefined;
9
+ } & {
10
+ queryKey: import('@tanstack/react-query').DataTag<import('@tanstack/react-query').QueryKey, Calendar[]>;
11
+ };
12
+ getEvents(calendarIds: string[], nb: number): import('@tanstack/react-query').OmitKeyof<import('@tanstack/react-query').UseQueryOptions<CalendarEvent[], Error, CalendarEvent[], import('@tanstack/react-query').QueryKey>, "queryFn"> & {
13
+ queryFn?: import('@tanstack/react-query').QueryFunction<CalendarEvent[], import('@tanstack/react-query').QueryKey, never> | undefined;
14
+ } & {
15
+ queryKey: import('@tanstack/react-query').DataTag<import('@tanstack/react-query').QueryKey, CalendarEvent[]>;
16
+ };
17
+ };
18
+ export declare const useCalendars: () => import('@tanstack/react-query').UseQueryResult<Calendar[], Error>;
19
+ export declare const useEvents: (calendarIds: string[], nb: number) => import('@tanstack/react-query').UseQueryResult<CalendarEvent[], Error>;
@@ -0,0 +1,26 @@
1
+ import { useQuery, queryOptions } from "@tanstack/react-query";
2
+ import { agendaService } from "../api/index.js";
3
+ const agendaQueryKeys = {
4
+ calendars: () => ["agenda", "calendars"],
5
+ events: (calendarIds, nb) => ["agenda", "events", calendarIds, nb]
6
+ }, agendaQueryOptions = {
7
+ getCalendars() {
8
+ return queryOptions({
9
+ queryKey: agendaQueryKeys.calendars(),
10
+ queryFn: async () => agendaService.getCalendars()
11
+ });
12
+ },
13
+ getEvents(calendarIds, nb) {
14
+ return queryOptions({
15
+ queryKey: agendaQueryKeys.events(calendarIds, nb),
16
+ queryFn: async () => agendaService.getEvents(calendarIds, nb),
17
+ enabled: calendarIds.length > 0
18
+ });
19
+ }
20
+ }, useCalendars = () => useQuery(agendaQueryOptions.getCalendars()), useEvents = (calendarIds, nb) => useQuery(agendaQueryOptions.getEvents(calendarIds, nb));
21
+ export {
22
+ agendaQueryKeys,
23
+ agendaQueryOptions,
24
+ useCalendars,
25
+ useEvents
26
+ };
@@ -0,0 +1,9 @@
1
+ import { BriefMeArticle, BriefMeStatus } from './types';
2
+ export interface BriefMeProps {
3
+ handleActionClick: () => void;
4
+ status: BriefMeStatus;
5
+ category: string;
6
+ onCategoryChange: (value: string) => void;
7
+ articles: BriefMeArticle[];
8
+ }
9
+ export default function BriefMe({ handleActionClick, status, category, onCategoryChange, articles, }: BriefMeProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,59 @@
1
+ import { jsxs, jsx } from "react/jsx-runtime";
2
+ import illuEdumalinError from "@edifice.io/bootstrap/dist/images/homepage/illu-briefme-error.svg";
3
+ import clsx from "clsx";
4
+ import { useTranslation } from "react-i18next";
5
+ import SvgIconExternalLink from "../../../icons/components/IconExternalLink.js";
6
+ import HomeCard from "../HomeCard/HomeCard.js";
7
+ import IconButton from "../../../../components/Button/IconButton.js";
8
+ import SegmentedControl from "../../../../components/SegmentedControl/SegmentedControl.js";
9
+ import TextSkeleton from "../../../../components/Skeleton/TextSkeleton.js";
10
+ import Image from "../../../../components/Image/Image.js";
11
+ function BriefMe({
12
+ handleActionClick,
13
+ status,
14
+ category,
15
+ onCategoryChange,
16
+ articles
17
+ }) {
18
+ const {
19
+ t
20
+ } = useTranslation(), categoryOptions = [{
21
+ label: t("homepage.briefme.category.briefme"),
22
+ value: "briefme"
23
+ }, {
24
+ label: t("homepage.briefme.category.brief-eco"),
25
+ value: "brief-eco"
26
+ }, {
27
+ label: t("homepage.briefme.category.brief-science"),
28
+ value: "brief-science"
29
+ }];
30
+ return /* @__PURE__ */ jsxs(HomeCard, { variant: "primary", className: "briefme", children: [
31
+ /* @__PURE__ */ jsxs("div", { className: "briefme__header", children: [
32
+ /* @__PURE__ */ jsx("h3", { className: "briefme__title", children: t("homepage.briefme.title") }),
33
+ /* @__PURE__ */ jsx(IconButton, { "aria-label": t("homepage.briefme.open"), onClick: handleActionClick, icon: /* @__PURE__ */ jsx(SvgIconExternalLink, {}), variant: "ghost", color: "tertiary" })
34
+ ] }),
35
+ /* @__PURE__ */ jsxs(HomeCard.Content, { className: clsx("briefme__body", `briefme__body--${status}`), children: [
36
+ status !== "error" && /* @__PURE__ */ jsx(SegmentedControl, { "aria-label": t("homepage.briefme.categories"), options: categoryOptions, value: category, onChange: onCategoryChange, className: "briefme__categories" }),
37
+ status === "loading" && /* @__PURE__ */ jsxs("div", { className: "briefme__loading", "data-testid": "briefme-loading", children: [
38
+ /* @__PURE__ */ jsx(TextSkeleton, { size: "lg", className: "briefme__loading-item" }),
39
+ /* @__PURE__ */ jsx(TextSkeleton, { size: "lg", className: "briefme__loading-item" }),
40
+ /* @__PURE__ */ jsx(TextSkeleton, { size: "lg", className: "briefme__loading-item" })
41
+ ] }),
42
+ status === "error" && /* @__PURE__ */ jsxs("div", { className: "briefme__error", children: [
43
+ /* @__PURE__ */ jsx(Image, { src: illuEdumalinError, alt: "", className: "briefme__error-illu" }),
44
+ /* @__PURE__ */ jsxs("p", { className: "briefme__error-message", children: [
45
+ /* @__PURE__ */ jsx("span", { className: "briefme__error-line", children: t("homepage.briefme.error.connection") }),
46
+ /* @__PURE__ */ jsx("span", { className: "briefme__error-line", children: t("homepage.briefme.error.help") })
47
+ ] })
48
+ ] }),
49
+ status === "empty" && /* @__PURE__ */ jsx("p", { className: "briefme__empty", children: t("homepage.briefme.empty") }),
50
+ status === "default" && /* @__PURE__ */ jsx("ul", { className: "briefme__list", children: articles.map((article) => /* @__PURE__ */ jsxs("li", { className: "briefme__article", children: [
51
+ /* @__PURE__ */ jsx("span", { className: "briefme__article-date", children: article.date }),
52
+ /* @__PURE__ */ jsx("a", { className: "briefme__article-title", href: article.url, target: "_blank", rel: "noopener noreferrer", children: article.title })
53
+ ] }, article.id)) })
54
+ ] })
55
+ ] });
56
+ }
57
+ export {
58
+ BriefMe as default
59
+ };
@@ -0,0 +1,4 @@
1
+ export declare function BriefMeContainer(): import("react/jsx-runtime").JSX.Element;
2
+ export declare namespace BriefMeContainer {
3
+ var displayName: string;
4
+ }
@@ -0,0 +1,17 @@
1
+ import { jsx } from "react/jsx-runtime";
2
+ import BriefMe from "./BriefMe.js";
3
+ import { useBriefMe } from "./useBriefMe.js";
4
+ function BriefMeContainer() {
5
+ const {
6
+ category,
7
+ setCategory,
8
+ articles,
9
+ status
10
+ } = useBriefMe();
11
+ return /* @__PURE__ */ jsx(BriefMe, { handleActionClick: () => {
12
+ window.open("https://brief.me", "_blank", "noopener,noreferrer");
13
+ }, status, category, onCategoryChange: (value) => setCategory(value), articles });
14
+ }
15
+ export {
16
+ BriefMeContainer
17
+ };
@@ -0,0 +1,4 @@
1
+ export * from './BriefMe';
2
+ export { default as BriefMe } from './BriefMe';
3
+ export * from './BriefMeContainer';
4
+ export * from './useBriefMe';
@@ -0,0 +1,17 @@
1
+ export interface BriefMeArticle {
2
+ id: string;
3
+ date: string;
4
+ title: string;
5
+ url: string;
6
+ }
7
+ export type BriefMeStatus = 'loading' | 'default' | 'empty' | 'error';
8
+ /**
9
+ * Brief.me feeds are proxied and cached by app-registry, one endpoint per
10
+ * category. Keys match the SegmentedControl option values of `BriefMe`.
11
+ */
12
+ export declare const BRIEFME_ENDPOINTS: {
13
+ readonly briefme: "/appregistry/widget/cache/external/briefme";
14
+ readonly 'brief-eco': "/appregistry/widget/cache/external/briefeco";
15
+ readonly 'brief-science': "/appregistry/widget/cache/external/briefscience";
16
+ };
17
+ export type BriefMeCategory = keyof typeof BRIEFME_ENDPOINTS;
@@ -0,0 +1,8 @@
1
+ const BRIEFME_ENDPOINTS = {
2
+ briefme: "/appregistry/widget/cache/external/briefme",
3
+ "brief-eco": "/appregistry/widget/cache/external/briefeco",
4
+ "brief-science": "/appregistry/widget/cache/external/briefscience"
5
+ };
6
+ export {
7
+ BRIEFME_ENDPOINTS
8
+ };