@edifice.io/react 2.6.13-develop-integration-demo.20261108115137 → 2.6.13-develop-integration-demo.20261108143606

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 (212) hide show
  1. package/dist/components/Checkbox/Checkbox.js +1 -1
  2. package/dist/components/Layout/Layout.js +12 -4
  3. package/dist/components/Masonry/Masonry.d.ts +40 -0
  4. package/dist/components/Masonry/Masonry.js +50 -0
  5. package/dist/components/Masonry/index.d.ts +2 -0
  6. package/dist/components/SearchBar/SearchBar.js +17 -26
  7. package/dist/components/index.d.ts +1 -0
  8. package/dist/homepage.js +110 -24
  9. package/dist/hooks/useUpload/useUpload.js +1 -1
  10. package/dist/hooks/useZendeskGuide/useZendeskGuide.d.ts +2 -6
  11. package/dist/hooks/useZendeskGuide/useZendeskGuide.js +11 -8
  12. package/dist/icons.js +406 -404
  13. package/dist/index.js +2 -0
  14. package/dist/modules/HelpZone/HelpZone.js +6 -8
  15. package/dist/modules/HelpZone/HelpZoneContainer.js +2 -5
  16. package/dist/modules/homepage/components/Agenda/Agenda.d.ts +10 -0
  17. package/dist/modules/homepage/components/Agenda/Agenda.js +54 -0
  18. package/dist/modules/homepage/components/Agenda/AgendaContainer.d.ts +1 -0
  19. package/dist/modules/homepage/components/Agenda/AgendaContainer.js +14 -0
  20. package/dist/modules/homepage/components/Agenda/AgendaEventCard.d.ts +10 -0
  21. package/dist/modules/homepage/components/Agenda/AgendaEventCard.js +30 -0
  22. package/dist/modules/homepage/components/Agenda/hooks/useAgendaContainer.d.ts +14 -0
  23. package/dist/modules/homepage/components/Agenda/hooks/useAgendaContainer.js +27 -0
  24. package/dist/modules/homepage/components/Agenda/index.d.ts +3 -0
  25. package/dist/modules/homepage/components/Agenda/services/api/agendaService.d.ts +24 -0
  26. package/dist/modules/homepage/components/Agenda/services/api/agendaService.js +45 -0
  27. package/dist/modules/homepage/components/Agenda/services/api/index.d.ts +4 -0
  28. package/dist/modules/homepage/components/Agenda/services/api/index.js +5 -0
  29. package/dist/modules/homepage/components/Agenda/services/queries/agenda.d.ts +19 -0
  30. package/dist/modules/homepage/components/Agenda/services/queries/agenda.js +26 -0
  31. package/dist/modules/homepage/components/BriefMe/BriefMe.d.ts +9 -0
  32. package/dist/modules/homepage/components/BriefMe/BriefMe.js +59 -0
  33. package/dist/modules/homepage/components/BriefMe/BriefMeContainer.d.ts +4 -0
  34. package/dist/modules/homepage/components/BriefMe/BriefMeContainer.js +17 -0
  35. package/dist/modules/homepage/components/BriefMe/index.d.ts +4 -0
  36. package/dist/modules/homepage/components/BriefMe/types.d.ts +17 -0
  37. package/dist/modules/homepage/components/BriefMe/types.js +8 -0
  38. package/dist/modules/homepage/components/BriefMe/useBriefMe.d.ts +31 -0
  39. package/dist/modules/homepage/components/BriefMe/useBriefMe.js +51 -0
  40. package/dist/modules/homepage/components/Cantine/Cantine.d.ts +7 -0
  41. package/dist/modules/homepage/components/Cantine/Cantine.js +44 -0
  42. package/dist/modules/homepage/components/Cantine/CantineContainer.d.ts +4 -0
  43. package/dist/modules/homepage/components/Cantine/CantineContainer.js +18 -0
  44. package/dist/modules/homepage/components/Cantine/CantineModal.d.ts +24 -0
  45. package/dist/modules/homepage/components/Cantine/CantineModal.js +88 -0
  46. package/dist/modules/homepage/components/Cantine/CantineModalContainer.d.ts +7 -0
  47. package/dist/modules/homepage/components/Cantine/CantineModalContainer.js +12 -0
  48. package/dist/modules/homepage/components/Cantine/components/CantineLegend.d.ts +5 -0
  49. package/dist/modules/homepage/components/Cantine/components/CantineLegend.js +22 -0
  50. package/dist/modules/homepage/components/Cantine/components/CantineMenuSection.d.ts +6 -0
  51. package/dist/modules/homepage/components/Cantine/components/CantineMenuSection.js +28 -0
  52. package/dist/modules/homepage/components/Cantine/components/cantineLabels.d.ts +12 -0
  53. package/dist/modules/homepage/components/Cantine/components/cantineLabels.js +60 -0
  54. package/dist/modules/homepage/components/Cantine/hooks/useCantine.d.ts +11 -0
  55. package/dist/modules/homepage/components/Cantine/hooks/useCantine.js +20 -0
  56. package/dist/modules/homepage/components/Cantine/hooks/useCantineMenu.d.ts +24 -0
  57. package/dist/modules/homepage/components/Cantine/hooks/useCantineMenu.js +65 -0
  58. package/dist/modules/homepage/components/Cantine/hooks/useCantineModal.d.ts +23 -0
  59. package/dist/modules/homepage/components/Cantine/hooks/useCantineModal.js +43 -0
  60. package/dist/modules/homepage/components/Cantine/index.d.ts +7 -0
  61. package/dist/modules/homepage/components/Cantine/types.d.ts +42 -0
  62. package/dist/modules/homepage/components/Captation/CaptationAudio/CaptationAudio.d.ts +7 -0
  63. package/dist/modules/homepage/components/Captation/CaptationAudio/CaptationAudio.js +44 -0
  64. package/dist/modules/homepage/components/Captation/CaptationVideo/CaptationVideo.d.ts +9 -0
  65. package/dist/modules/homepage/components/Captation/CaptationVideo/CaptationVideo.js +44 -0
  66. package/dist/modules/homepage/components/Captation/index.d.ts +2 -0
  67. package/dist/modules/homepage/components/Edumalin/Edumalin.d.ts +9 -0
  68. package/dist/modules/homepage/components/Edumalin/Edumalin.js +65 -0
  69. package/dist/modules/homepage/components/Edumalin/EdumalinContainer.d.ts +4 -0
  70. package/dist/modules/homepage/components/Edumalin/EdumalinContainer.js +21 -0
  71. package/dist/modules/homepage/components/Edumalin/EdumalinModal.d.ts +8 -0
  72. package/dist/modules/homepage/components/Edumalin/EdumalinModal.js +62 -0
  73. package/dist/modules/homepage/components/Edumalin/components/EdumalinBadge.d.ts +5 -0
  74. package/dist/modules/homepage/components/Edumalin/components/EdumalinBadge.js +38 -0
  75. package/dist/modules/homepage/components/Edumalin/components/EdumalinPicture.d.ts +5 -0
  76. package/dist/modules/homepage/components/Edumalin/components/EdumalinPicture.js +12 -0
  77. package/dist/modules/homepage/components/Edumalin/index.d.ts +7 -0
  78. package/dist/modules/homepage/components/Edumalin/types.d.ts +24 -0
  79. package/dist/modules/homepage/components/Edumalin/types.js +4 -0
  80. package/dist/modules/homepage/components/Edumalin/useEdumalin.d.ts +16 -0
  81. package/dist/modules/homepage/components/Edumalin/useEdumalin.js +35 -0
  82. package/dist/modules/homepage/components/Edumalin/utils.d.ts +28 -0
  83. package/dist/modules/homepage/components/Edumalin/utils.js +56 -0
  84. package/dist/modules/homepage/components/GenerationHdf/GenerationHdf.d.ts +16 -0
  85. package/dist/modules/homepage/components/GenerationHdf/GenerationHdf.js +65 -0
  86. package/dist/modules/homepage/components/GenerationHdf/GenerationHdfContainer.d.ts +4 -0
  87. package/dist/modules/homepage/components/GenerationHdf/GenerationHdfContainer.js +12 -0
  88. package/dist/modules/homepage/components/GenerationHdf/formatSolde.d.ts +1 -0
  89. package/dist/modules/homepage/components/GenerationHdf/formatSolde.js +6 -0
  90. package/dist/modules/homepage/components/GenerationHdf/index.d.ts +3 -0
  91. package/dist/modules/homepage/components/GenerationHdf/useGenerationHdf.d.ts +10 -0
  92. package/dist/modules/homepage/components/GenerationHdf/useGenerationHdf.js +69 -0
  93. package/dist/modules/homepage/components/Header/Header.js +8 -20
  94. package/dist/modules/homepage/components/HomeCard/HomeCardHeader.d.ts +5 -1
  95. package/dist/modules/homepage/components/HomeCard/HomeCardHeader.js +1 -1
  96. package/dist/modules/homepage/components/Mediacentre/Mediacentre.d.ts +13 -0
  97. package/dist/modules/homepage/components/Mediacentre/Mediacentre.js +57 -0
  98. package/dist/modules/homepage/components/Mediacentre/MediacentreContainer.d.ts +4 -0
  99. package/dist/modules/homepage/components/Mediacentre/MediacentreContainer.js +12 -0
  100. package/dist/modules/homepage/components/Mediacentre/components/MediacentreUniversalisSearch.d.ts +6 -0
  101. package/dist/modules/homepage/components/Mediacentre/components/MediacentreUniversalisSearch.js +30 -0
  102. package/dist/modules/homepage/components/Mediacentre/hooks/useMediacentre.d.ts +17 -0
  103. package/dist/modules/homepage/components/Mediacentre/hooks/useMediacentre.js +32 -0
  104. package/dist/modules/homepage/components/Mediacentre/index.d.ts +5 -0
  105. package/dist/modules/homepage/components/Mediacentre/services/mediacentreService.d.ts +24 -0
  106. package/dist/modules/homepage/components/Mediacentre/services/mediacentreService.js +25 -0
  107. package/dist/modules/homepage/components/Mediacentre/types.d.ts +8 -0
  108. package/dist/modules/homepage/components/MessageFlashList/MessageFlash.js +0 -2
  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/NotificationFilterModal.js +11 -13
  113. package/dist/modules/homepage/components/Notifications/components/ReportNotificationModal.js +6 -12
  114. package/dist/modules/homepage/components/Notifications/components/notificationAdapter.js +12 -10
  115. package/dist/modules/homepage/components/Notifications/hooks/useNotificationList.js +9 -10
  116. package/dist/modules/homepage/components/Qwant/Qwant.d.ts +4 -0
  117. package/dist/modules/homepage/components/Qwant/Qwant.js +41 -0
  118. package/dist/modules/homepage/components/Qwant/QwantContainer.d.ts +1 -0
  119. package/dist/modules/homepage/components/Qwant/QwantContainer.js +10 -0
  120. package/dist/modules/homepage/components/Qwant/index.d.ts +3 -0
  121. package/dist/modules/homepage/components/Rss/Rss.d.ts +11 -0
  122. package/dist/modules/homepage/components/Rss/Rss.js +64 -0
  123. package/dist/modules/homepage/components/Rss/RssContainer.d.ts +1 -0
  124. package/dist/modules/homepage/components/Rss/RssContainer.js +45 -0
  125. package/dist/modules/homepage/components/Rss/RssFeedForm.d.ts +13 -0
  126. package/dist/modules/homepage/components/Rss/RssFeedForm.js +69 -0
  127. package/dist/modules/homepage/components/Rss/RssFeedsModal.d.ts +11 -0
  128. package/dist/modules/homepage/components/Rss/RssFeedsModal.js +58 -0
  129. package/dist/modules/homepage/components/Rss/hooks/useRssContainer.d.ts +25 -0
  130. package/dist/modules/homepage/components/Rss/hooks/useRssContainer.js +43 -0
  131. package/dist/modules/homepage/components/Rss/index.d.ts +6 -0
  132. package/dist/modules/homepage/components/Rss/services/api/index.d.ts +5 -0
  133. package/dist/modules/homepage/components/Rss/services/api/index.js +5 -0
  134. package/dist/modules/homepage/components/Rss/services/api/rssService.d.ts +38 -0
  135. package/dist/modules/homepage/components/Rss/services/api/rssService.js +51 -0
  136. package/dist/modules/homepage/components/Rss/services/queries/rss.d.ts +28 -0
  137. package/dist/modules/homepage/components/Rss/services/queries/rss.js +71 -0
  138. package/dist/modules/homepage/components/Rss/types.d.ts +25 -0
  139. package/dist/modules/homepage/components/Rss/utils.d.ts +7 -0
  140. package/dist/modules/homepage/components/Rss/utils.js +19 -0
  141. package/dist/modules/homepage/components/SchoolSpace/SchoolSpaceContainer.js +1 -1
  142. package/dist/modules/homepage/components/ScreenTime/ScreenTime.d.ts +11 -0
  143. package/dist/modules/homepage/components/ScreenTime/ScreenTime.js +49 -0
  144. package/dist/modules/homepage/components/ScreenTime/ScreenTimeChart.d.ts +10 -0
  145. package/dist/modules/homepage/components/ScreenTime/ScreenTimeChart.js +115 -0
  146. package/dist/modules/homepage/components/ScreenTime/ScreenTimeContainer.d.ts +1 -0
  147. package/dist/modules/homepage/components/ScreenTime/ScreenTimeContainer.js +25 -0
  148. package/dist/modules/homepage/components/ScreenTime/ScreenTimeError.d.ts +5 -0
  149. package/dist/modules/homepage/components/ScreenTime/ScreenTimeError.js +22 -0
  150. package/dist/modules/homepage/components/ScreenTime/ScreenTimeModal.d.ts +22 -0
  151. package/dist/modules/homepage/components/ScreenTime/ScreenTimeModal.js +81 -0
  152. package/dist/modules/homepage/components/ScreenTime/hooks/useScreenTimeContainer.d.ts +14 -0
  153. package/dist/modules/homepage/components/ScreenTime/hooks/useScreenTimeContainer.js +22 -0
  154. package/dist/modules/homepage/components/ScreenTime/hooks/useScreenTimeKids.d.ts +6 -0
  155. package/dist/modules/homepage/components/ScreenTime/hooks/useScreenTimeKids.js +25 -0
  156. package/dist/modules/homepage/components/ScreenTime/hooks/useScreenTimeModal.d.ts +31 -0
  157. package/dist/modules/homepage/components/ScreenTime/hooks/useScreenTimeModal.js +34 -0
  158. package/dist/modules/homepage/components/ScreenTime/index.d.ts +6 -0
  159. package/dist/modules/homepage/components/ScreenTime/services/api/index.d.ts +4 -0
  160. package/dist/modules/homepage/components/ScreenTime/services/api/index.js +5 -0
  161. package/dist/modules/homepage/components/ScreenTime/services/api/screenTimeService.d.ts +28 -0
  162. package/dist/modules/homepage/components/ScreenTime/services/api/screenTimeService.js +39 -0
  163. package/dist/modules/homepage/components/ScreenTime/services/queries/screenTime.d.ts +23 -0
  164. package/dist/modules/homepage/components/ScreenTime/services/queries/screenTime.js +41 -0
  165. package/dist/modules/homepage/components/ScreenTime/types.d.ts +30 -0
  166. package/dist/modules/homepage/components/ScreenTime/utils.d.ts +50 -0
  167. package/dist/modules/homepage/components/ScreenTime/utils.js +115 -0
  168. package/dist/modules/homepage/components/TabsKids/components/TabsKids.d.ts +43 -0
  169. package/dist/modules/homepage/components/TabsKids/components/TabsKids.js +23 -0
  170. package/dist/modules/homepage/components/TabsKids/components/TabsKidsItem.d.ts +34 -0
  171. package/dist/modules/homepage/components/TabsKids/components/TabsKidsItem.js +26 -0
  172. package/dist/modules/homepage/components/TabsKids/components/TabsKidsList.d.ts +14 -0
  173. package/dist/modules/homepage/components/TabsKids/components/TabsKidsList.js +64 -0
  174. package/dist/modules/homepage/components/TabsKids/hooks/useTabsKidsOverflow.d.ts +20 -0
  175. package/dist/modules/homepage/components/TabsKids/hooks/useTabsKidsOverflow.js +43 -0
  176. package/dist/modules/homepage/components/TabsKids/index.d.ts +3 -0
  177. package/dist/modules/homepage/components/TabsKids/utils/visibleTabs.d.ts +15 -0
  178. package/dist/modules/homepage/components/TabsKids/utils/visibleTabs.js +21 -0
  179. package/dist/modules/homepage/components/Universalis/Universalis.d.ts +8 -0
  180. package/dist/modules/homepage/components/Universalis/Universalis.js +62 -0
  181. package/dist/modules/homepage/components/Universalis/UniversalisContainer.d.ts +1 -0
  182. package/dist/modules/homepage/components/Universalis/UniversalisContainer.js +16 -0
  183. package/dist/modules/homepage/components/Universalis/index.d.ts +3 -0
  184. package/dist/modules/homepage/components/UsefulLinks/UsefulLinks.js +2 -2
  185. package/dist/modules/homepage/components/UsefulLinks/UsefulLinksModal.js +2 -2
  186. package/dist/modules/homepage/components/UserSpace/UserSpace.d.ts +3 -1
  187. package/dist/modules/homepage/components/UserSpace/UserSpace.js +13 -7
  188. package/dist/modules/homepage/components/UserSpace/UserSpaceContainer.d.ts +4 -2
  189. package/dist/modules/homepage/components/UserSpace/UserSpaceContainer.js +3 -2
  190. package/dist/modules/homepage/components/WidgetsPersonalizationPanel/WidgetToggle.d.ts +16 -0
  191. package/dist/modules/homepage/components/WidgetsPersonalizationPanel/WidgetToggle.js +15 -0
  192. package/dist/modules/homepage/components/WidgetsPersonalizationPanel/WidgetsPersonalizationPanel.d.ts +21 -0
  193. package/dist/modules/homepage/components/WidgetsPersonalizationPanel/WidgetsPersonalizationPanel.js +47 -0
  194. package/dist/modules/homepage/components/WidgetsPersonalizationPanel/index.d.ts +2 -0
  195. package/dist/modules/homepage/components/index.d.ts +14 -0
  196. package/dist/modules/homepage/{components/SchoolSpace → hooks}/useUserSchools.d.ts +2 -2
  197. package/dist/modules/homepage/{components/SchoolSpace → hooks}/useUserSchools.js +4 -4
  198. package/dist/modules/icons/components/IconAddWidget.d.ts +7 -0
  199. package/dist/modules/icons/components/IconAddWidget.js +12 -0
  200. package/dist/modules/icons/components/index.d.ts +1 -0
  201. package/dist/modules/multimedia/AudioRecorder/AudioRecorder.d.ts +2 -0
  202. package/dist/modules/multimedia/AudioRecorder/AudioRecorder.js +24 -10
  203. package/dist/modules/multimedia/AudioRecorder/AudioRecorderTimer.js +1 -1
  204. package/dist/modules/multimedia/AudioRecorder/useAudioRecorder.d.ts +1 -0
  205. package/dist/modules/multimedia/AudioRecorder/useAudioRecorder.js +89 -50
  206. package/dist/modules/multimedia/VideoRecorder/VideoRecorder.d.ts +6 -0
  207. package/dist/modules/multimedia/VideoRecorder/VideoRecorder.js +53 -19
  208. package/dist/modules/multimedia/VideoRecorder/VideoRecorderToolbar.js +27 -27
  209. package/dist/modules/multimedia/VideoRecorder/useCameras.d.ts +2 -0
  210. package/dist/modules/multimedia/VideoRecorder/useCameras.js +10 -4
  211. package/dist/modules/multimedia/Workspace/Workspace.js +1 -1
  212. package/package.json +7 -6
@@ -0,0 +1,43 @@
1
+ import { useRef, useState, useCallback, useLayoutEffect, useMemo } from "react";
2
+ import { getVisibleCount, getVisibleIndexes } from "../utils/visibleTabs.js";
3
+ const useTabsKidsOverflow = ({
4
+ items,
5
+ activeId,
6
+ isCompact
7
+ }) => {
8
+ const tabBarRef = useRef(null), measureRef = useRef(null), [visibleCount, setVisibleCount] = useState(items.length), activeIndex = items.findIndex((item) => item.id === activeId), activeIndexRef = useRef(activeIndex);
9
+ activeIndexRef.current = activeIndex;
10
+ const updateVisibleCount = useCallback(() => {
11
+ const bar = tabBarRef.current, measure = measureRef.current;
12
+ if (!bar || !measure) return;
13
+ const barStyle = getComputedStyle(bar), available = bar.clientWidth - parseFloat(barStyle.paddingInlineStart) - parseFloat(barStyle.paddingInlineEnd), tabs = Array.from(measure.querySelectorAll(".tabs-kids-item")), trigger = measure.querySelector(".tabs-kids-measure-trigger"), gap = parseFloat(barStyle.columnGap) || 0, corner = tabs[0] && parseFloat(getComputedStyle(tabs[0], "::after").width) || 0;
14
+ setVisibleCount(getVisibleCount(tabs.map((tab) => tab.offsetWidth), activeIndexRef.current, available, gap, (trigger == null ? void 0 : trigger.offsetWidth) ?? 0, corner));
15
+ }, []);
16
+ useLayoutEffect(() => {
17
+ updateVisibleCount();
18
+ }, [updateVisibleCount, items, isCompact]), useLayoutEffect(() => {
19
+ const bar = tabBarRef.current;
20
+ if (!bar || typeof ResizeObserver > "u") return;
21
+ const observer = new ResizeObserver(() => updateVisibleCount());
22
+ return observer.observe(bar), () => observer.disconnect();
23
+ }, [updateVisibleCount]);
24
+ const {
25
+ visibleItems,
26
+ overflowItems
27
+ } = useMemo(() => {
28
+ const indexes = getVisibleIndexes(items.length, visibleCount, activeIndex);
29
+ return {
30
+ visibleItems: indexes.map((i) => items[i]),
31
+ overflowItems: items.filter((_, i) => !indexes.includes(i))
32
+ };
33
+ }, [items, visibleCount, activeIndex]);
34
+ return {
35
+ tabBarRef,
36
+ measureRef,
37
+ visibleItems,
38
+ overflowItems
39
+ };
40
+ };
41
+ export {
42
+ useTabsKidsOverflow
43
+ };
@@ -0,0 +1,3 @@
1
+ export { default as TabsKids } from './components/TabsKids';
2
+ export * from './components/TabsKids';
3
+ export type { TabsKidsItemProps } from './components/TabsKidsItem';
@@ -0,0 +1,15 @@
1
+ /**
2
+ * Returns how many tabs fit in the available space. The active tab is always
3
+ * counted, then the other tabs are added from the start until one does not
4
+ * fit. Never returns less than one.
5
+ *
6
+ * Tabs are laid out without gap between them. `gap` is the space between the
7
+ * tab list and the overflow dropdown trigger, `trigger` the width of that
8
+ * trigger, `corner` the room needed after the last tab for its inverted corner.
9
+ */
10
+ export declare const getVisibleCount: (widths: number[], activeIndex: number, available: number, gap: number, trigger: number, corner: number) => number;
11
+ /**
12
+ * Returns the indexes of the visible tabs: the first `count` items, the last
13
+ * one being replaced by the active item when it is not among them.
14
+ */
15
+ export declare const getVisibleIndexes: (length: number, count: number, activeIndex: number) => number[];
@@ -0,0 +1,21 @@
1
+ const getVisibleCount = (widths, activeIndex, available, gap, trigger, corner) => {
2
+ if (widths.reduce((sum, w) => sum + w, 0) + corner <= available) return widths.length;
3
+ const pinned = activeIndex < 0 ? 0 : activeIndex, budget = available - corner - gap - trigger;
4
+ let used = widths[pinned], count = 1;
5
+ for (let i = 0; i < widths.length; i++)
6
+ if (i !== pinned) {
7
+ if (used + widths[i] > budget) break;
8
+ used += widths[i], count++;
9
+ }
10
+ return count;
11
+ }, getVisibleIndexes = (length, count, activeIndex) => {
12
+ if (length === 0) return [];
13
+ const visibleCount = Math.max(1, Math.min(count, length)), indexes = Array.from({
14
+ length: visibleCount
15
+ }, (_, i) => i);
16
+ return activeIndex >= visibleCount && (indexes[visibleCount - 1] = activeIndex), indexes;
17
+ };
18
+ export {
19
+ getVisibleCount,
20
+ getVisibleIndexes
21
+ };
@@ -0,0 +1,8 @@
1
+ import { School } from '@edifice.io/client';
2
+ export interface UniversalisProps {
3
+ handleActionClick: () => void;
4
+ selectedSchool?: School;
5
+ onSelectedSchoolChange?: (school: School) => void;
6
+ schools?: School[];
7
+ }
8
+ export default function Universalis({ handleActionClick, selectedSchool, onSelectedSchoolChange, schools, }: UniversalisProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,62 @@
1
+ import { jsxs, jsx, Fragment } from "react/jsx-runtime";
2
+ import illuUniversalis from "@edifice.io/bootstrap/dist/images/homepage/illu-universalis.png";
3
+ import clsx from "clsx";
4
+ import { useState } from "react";
5
+ import { useForm } from "react-hook-form";
6
+ import { useTranslation } from "react-i18next";
7
+ import SvgIconExternalLink from "../../../icons/components/IconExternalLink.js";
8
+ import SvgIconRafterDown from "../../../icons/components/IconRafterDown.js";
9
+ import SvgIconSearch from "../../../icons/components/IconSearch.js";
10
+ import HomeCard from "../HomeCard/HomeCard.js";
11
+ import ButtonBeta from "../../../../components/ButtonBeta/ButtonBeta.js";
12
+ import Image from "../../../../components/Image/Image.js";
13
+ import Dropdown from "../../../../components/Dropdown/Dropdown.js";
14
+ import FormControl from "../../../../components/Form/FormControl.js";
15
+ import Input from "../../../../components/Input/Input.js";
16
+ import { getRotateTransitionStyle } from "../../../../utilities/rotate-transition-style/get-rotate-transition-style.js";
17
+ const UNIVERSALIS_ENGINE_PARAM = "www";
18
+ function Universalis({
19
+ handleActionClick,
20
+ selectedSchool,
21
+ onSelectedSchoolChange,
22
+ schools
23
+ }) {
24
+ const {
25
+ t
26
+ } = useTranslation(), {
27
+ register
28
+ } = useForm(), [isExpanded, setIsExpanded] = useState(!1), hasManySchools = !!(schools && schools.length > 1), hasUai = !!(selectedSchool != null && selectedSchool.UAI), searchLabel = t(hasUai ? "search" : "homepage.widget.universalis.noUai");
29
+ return /* @__PURE__ */ jsxs(HomeCard, { variant: "primary", children: [
30
+ /* @__PURE__ */ jsxs("div", { className: "universalis__header", children: [
31
+ /* @__PURE__ */ jsx("h3", { className: "universalis__title", children: t("homepage.widget.universalis.title") }),
32
+ /* @__PURE__ */ jsx(ButtonBeta, { className: "universalis__header-button", "data-testid": "universalis-button-open", "aria-label": t("homepage.widget.universalis.open"), onClick: handleActionClick, leftIcon: /* @__PURE__ */ jsx(SvgIconExternalLink, {}), variant: "ghost", color: "tertiary" })
33
+ ] }),
34
+ /* @__PURE__ */ jsx(HomeCard.Content, { children: /* @__PURE__ */ jsxs("div", { className: "universalis", children: [
35
+ /* @__PURE__ */ jsxs("div", { className: "universalis__intro", children: [
36
+ /* @__PURE__ */ jsx(Image, { src: illuUniversalis, alt: "Universalis Éducation", className: "universalis__logo" }),
37
+ /* @__PURE__ */ jsx("p", { className: "universalis__description", children: t("homepage.widget.universalis.description") })
38
+ ] }),
39
+ hasManySchools && /* @__PURE__ */ jsx(Dropdown, { placement: "bottom-start", onToggle: setIsExpanded, children: (triggerProps) => /* @__PURE__ */ jsxs(Fragment, { children: [
40
+ /* @__PURE__ */ jsxs("button", { ...triggerProps, type: "button", "aria-expanded": isExpanded, className: clsx("universalis__school-selector", {
41
+ "universalis__school-selector--open": isExpanded
42
+ }), children: [
43
+ /* @__PURE__ */ jsx("span", { className: "universalis__school-selector-label", children: selectedSchool == null ? void 0 : selectedSchool.name }),
44
+ /* @__PURE__ */ jsx(SvgIconRafterDown, { className: "universalis__school-selector-icon", style: getRotateTransitionStyle(isExpanded, {
45
+ degrees: 180
46
+ }) })
47
+ ] }),
48
+ /* @__PURE__ */ jsx(Dropdown.Menu, { children: schools == null ? void 0 : schools.map((school) => /* @__PURE__ */ jsx(Dropdown.Item, { onClick: () => onSelectedSchoolChange == null ? void 0 : onSelectedSchoolChange(school), children: school.name }, school.id)) })
49
+ ] }) }),
50
+ /* @__PURE__ */ jsx("form", { method: "GET", action: "https://www.universalis-edu.com/nomade/precherche/", target: "_blank", className: "universalis__search", children: /* @__PURE__ */ jsxs(FormControl, { id: "inputUniversalisQuery", className: "universalis__search-field", children: [
51
+ /* @__PURE__ */ jsx(FormControl.Label, { className: "visually-hidden", children: searchLabel }),
52
+ /* @__PURE__ */ jsx(Input, { placeholder: searchLabel, size: "md", type: "text", maxLength: 255, disabled: !hasUai, ...register("q") }),
53
+ /* @__PURE__ */ jsx("input", { type: "hidden", name: "r", value: UNIVERSALIS_ENGINE_PARAM }),
54
+ /* @__PURE__ */ jsx("input", { type: "hidden", name: "uai", value: selectedSchool == null ? void 0 : selectedSchool.UAI }),
55
+ /* @__PURE__ */ jsx(ButtonBeta, { leftIcon: /* @__PURE__ */ jsx(SvgIconSearch, {}), type: "submit", "aria-label": searchLabel, variant: "filled", color: "default", disabled: !hasUai })
56
+ ] }) })
57
+ ] }) })
58
+ ] });
59
+ }
60
+ export {
61
+ Universalis as default
62
+ };
@@ -0,0 +1 @@
1
+ export declare function UniversalisContainer(): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,16 @@
1
+ import { jsx } from "react/jsx-runtime";
2
+ import { WIDGET_NAME } from "@edifice.io/client";
3
+ import { useUserSchools } from "../../hooks/useUserSchools.js";
4
+ import Universalis from "./Universalis.js";
5
+ function UniversalisContainer() {
6
+ const {
7
+ handleSelectedSchoolChange,
8
+ ...otherProps
9
+ } = useUserSchools(WIDGET_NAME.UNIVERSALIS);
10
+ return /* @__PURE__ */ jsx(Universalis, { handleActionClick: () => {
11
+ window.open("http://www.universalis-edu.com", "_blank", "noopener,noreferrer");
12
+ }, onSelectedSchoolChange: handleSelectedSchoolChange, ...otherProps });
13
+ }
14
+ export {
15
+ UniversalisContainer
16
+ };
@@ -0,0 +1,3 @@
1
+ export * from './Universalis';
2
+ export { default as Universalis } from './Universalis';
3
+ export * from './UniversalisContainer';
@@ -1,6 +1,6 @@
1
1
  import { jsxs, jsx } from "react/jsx-runtime";
2
2
  import { useTranslation } from "react-i18next";
3
- import illuEmptyUsefulLinks from "@edifice.io/bootstrap/dist/images/homepage/illu-empty-useful-links.png";
3
+ import illuEmptyFeeds 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: illuEmptyUsefulLinks, alt: "", "aria-hidden": "true", style: {
21
+ /* @__PURE__ */ jsx(Image, { src: illuEmptyFeeds, 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 illuEmptyUsefulLinks from "@edifice.io/bootstrap/dist/images/homepage/illu-empty-useful-links.png";
3
+ import illuEmptyFeeds 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: illuEmptyUsefulLinks, alt: "", "aria-hidden": "true", style: {
32
+ /* @__PURE__ */ jsx(Image, { src: illuEmptyFeeds, alt: "", "aria-hidden": "true", style: {
33
33
  width: 200,
34
34
  height: 109
35
35
  } }),
@@ -5,8 +5,10 @@ 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;
8
10
  };
9
- declare function UserSpace({ name, avatar, profile, children, }: UserSpaceProps): import("react/jsx-runtime").JSX.Element;
11
+ declare function UserSpace({ name, avatar, profile, children, onCustomizeWidgetsClick, }: UserSpaceProps): import("react/jsx-runtime").JSX.Element;
10
12
  declare namespace UserSpace {
11
13
  var displayName: string;
12
14
  }
@@ -1,27 +1,33 @@
1
1
  import { jsxs, jsx } from "react/jsx-runtime";
2
2
  import { useTranslation } from "react-i18next";
3
+ import SvgIconAddWidget from "../../../icons/components/IconAddWidget.js";
3
4
  import SvgIconClass from "../../../icons/components/IconClass.js";
4
5
  import { useProfileLinks } from "./hooks/useProfileLinks.js";
5
6
  import HomeCard from "../HomeCard/HomeCard.js";
6
7
  import Flex from "../../../../components/Flex/Flex.js";
7
8
  import Avatar from "../../../../components/Avatar/Avatar.js";
9
+ import IconButton from "../../../../components/Button/IconButton.js";
8
10
  import ButtonBeta from "../../../../components/ButtonBeta/ButtonBeta.js";
9
11
  function UserSpace({
10
12
  name,
11
13
  avatar,
12
14
  profile,
13
- children
15
+ children,
16
+ onCustomizeWidgetsClick
14
17
  }) {
15
18
  const {
16
19
  t
17
20
  } = useTranslation(), links = useProfileLinks(profile);
18
21
  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: [
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
- ] })
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 })
25
31
  ] }),
26
32
  children && /* @__PURE__ */ jsx(HomeCard.Content, { children })
27
33
  ] });
@@ -1,7 +1,9 @@
1
1
  import { ReactNode } from 'react';
2
- export declare function UserSpaceContainer({ children }: {
2
+ export interface UserSpaceContainerProps {
3
3
  children?: ReactNode;
4
- }): import("react/jsx-runtime").JSX.Element | null;
4
+ onCustomizeWidgetsClick?: () => void;
5
+ }
6
+ export declare function UserSpaceContainer({ children, onCustomizeWidgetsClick, }: UserSpaceContainerProps): import("react/jsx-runtime").JSX.Element | null;
5
7
  export declare namespace UserSpaceContainer {
6
8
  var displayName: string;
7
9
  }
@@ -2,7 +2,8 @@ import { jsx } from "react/jsx-runtime";
2
2
  import UserSpace from "./UserSpace.js";
3
3
  import useUser from "../../../../hooks/useUser/useUser.js";
4
4
  function UserSpaceContainer({
5
- children
5
+ children,
6
+ onCustomizeWidgetsClick
6
7
  }) {
7
8
  var _a;
8
9
  const {
@@ -12,7 +13,7 @@ function UserSpaceContainer({
12
13
  } = useUser();
13
14
  if (!user || !userDescription) return null;
14
15
  const name = user.username || "", profile = ((_a = userDescription.profiles) == null ? void 0 : _a[0]) || "Guest";
15
- return /* @__PURE__ */ jsx(UserSpace, { name, profile, avatar, children });
16
+ return /* @__PURE__ */ jsx(UserSpace, { name, profile, avatar, onCustomizeWidgetsClick, children });
16
17
  }
17
18
  export {
18
19
  UserSpaceContainer
@@ -0,0 +1,16 @@
1
+ import { ComponentPropsWithoutRef } from 'react';
2
+ export interface WidgetToggleProps extends Omit<ComponentPropsWithoutRef<'button'>, 'onClick' | 'type' | 'role' | 'aria-checked'> {
3
+ 'checked': boolean;
4
+ 'onChange': () => void;
5
+ 'aria-label': string;
6
+ }
7
+ /**
8
+ * Dedicated on/off control for a widget row in `WidgetsPersonalizationPanel`.
9
+ * The generic `Switch` component doesn't match this panel's design (size,
10
+ * filled-vs-outlined states), so this is a small purpose-built control
11
+ * rather than a `Switch` variant.
12
+ */
13
+ export declare function WidgetToggle({ checked, onChange, disabled, ...rest }: WidgetToggleProps): import("react/jsx-runtime").JSX.Element;
14
+ export declare namespace WidgetToggle {
15
+ var displayName: string;
16
+ }
@@ -0,0 +1,15 @@
1
+ import { jsx } from "react/jsx-runtime";
2
+ import clsx from "clsx";
3
+ function WidgetToggle({
4
+ checked,
5
+ onChange,
6
+ disabled,
7
+ ...rest
8
+ }) {
9
+ return /* @__PURE__ */ jsx("button", { type: "button", role: "switch", "aria-checked": checked, disabled, className: clsx("widget-toggle", {
10
+ "widget-toggle--checked": checked
11
+ }), onClick: onChange, ...rest, children: /* @__PURE__ */ jsx("span", { className: "widget-toggle__knob" }) });
12
+ }
13
+ export {
14
+ WidgetToggle
15
+ };
@@ -0,0 +1,21 @@
1
+ import { ReactNode } from 'react';
2
+ export interface WidgetPersonalizationItem {
3
+ id: string;
4
+ label: string;
5
+ icon: ReactNode;
6
+ checked: boolean;
7
+ /** When true, the widget is pinned by an admin: no toggle, lock icon instead. */
8
+ locked?: boolean;
9
+ }
10
+ export interface WidgetsPersonalizationPanelProps {
11
+ items: WidgetPersonalizationItem[];
12
+ isLoading?: boolean;
13
+ onToggle: (id: string) => void;
14
+ onClose: () => void;
15
+ title?: string;
16
+ description?: string;
17
+ }
18
+ export declare function WidgetsPersonalizationPanel({ items, isLoading, onToggle, onClose, title, description, }: WidgetsPersonalizationPanelProps): import("react/jsx-runtime").JSX.Element;
19
+ export declare namespace WidgetsPersonalizationPanel {
20
+ var displayName: string;
21
+ }
@@ -0,0 +1,47 @@
1
+ import { jsxs, jsx } from "react/jsx-runtime";
2
+ import { useTranslation } from "react-i18next";
3
+ import clsx from "clsx";
4
+ import SvgIconClose from "../../../icons/components/IconClose.js";
5
+ import SvgIconLock from "../../../icons/components/IconLock.js";
6
+ import { WidgetToggle } from "./WidgetToggle.js";
7
+ import Heading from "../../../../components/Heading/Heading.js";
8
+ import IconButton from "../../../../components/Button/IconButton.js";
9
+ import TextSkeleton from "../../../../components/Skeleton/TextSkeleton.js";
10
+ const SKELETON_ROWS = 5;
11
+ function WidgetsPersonalizationPanel({
12
+ items,
13
+ isLoading = !1,
14
+ onToggle,
15
+ onClose,
16
+ title,
17
+ description
18
+ }) {
19
+ const {
20
+ t
21
+ } = useTranslation();
22
+ return /* @__PURE__ */ jsxs("div", { className: "widgets-personalization-panel", children: [
23
+ /* @__PURE__ */ jsxs("div", { className: "widgets-personalization-panel__header", children: [
24
+ /* @__PURE__ */ jsx(Heading, { level: "h2", headingStyle: "h5", className: "widgets-personalization-panel__title", children: title ?? t("homepage.widgetsPersonalization.title") }),
25
+ /* @__PURE__ */ jsx(IconButton, { icon: /* @__PURE__ */ jsx(SvgIconClose, {}), variant: "ghost", color: "tertiary", "aria-label": t("close"), onClick: onClose, "data-testid": "widgetspersonalization-button-close" })
26
+ ] }),
27
+ /* @__PURE__ */ jsx("p", { className: "widgets-personalization-panel__description", children: description ?? t("homepage.widgetsPersonalization.description") }),
28
+ isLoading ? /* @__PURE__ */ jsx("ul", { className: "widgets-personalization-panel__list", "aria-hidden": "true", children: Array.from({
29
+ length: SKELETON_ROWS
30
+ }).map((_, index) => /* @__PURE__ */ jsxs("li", { className: "widgets-personalization-panel__item widgets-personalization-panel__item--skeleton", children: [
31
+ /* @__PURE__ */ jsx(TextSkeleton, { className: "widgets-personalization-panel__item-icon-skeleton" }),
32
+ /* @__PURE__ */ jsx(TextSkeleton, { className: "widgets-personalization-panel__item-label-skeleton" })
33
+ ] }, index)) }) : items.length === 0 ? /* @__PURE__ */ jsx("div", { className: "widgets-personalization-panel__empty", children: /* @__PURE__ */ jsx("p", { className: "widgets-personalization-panel__empty-text", children: t("homepage.widgetsPersonalization.empty") }) }) : /* @__PURE__ */ jsx("ul", { className: "widgets-personalization-panel__list", children: items.map((item) => /* @__PURE__ */ jsxs("li", { className: clsx("widgets-personalization-panel__item", {
34
+ "widgets-personalization-panel__item--checked": item.checked && !item.locked,
35
+ "widgets-personalization-panel__item--locked": item.locked
36
+ }), "data-testid": `widgetspersonalization-item-${item.id}`, children: [
37
+ /* @__PURE__ */ jsx("span", { className: "widgets-personalization-panel__item-icon", "aria-hidden": "true", children: item.icon }),
38
+ /* @__PURE__ */ jsx("span", { className: "widgets-personalization-panel__item-label", children: item.label }),
39
+ item.locked ? /* @__PURE__ */ jsx("span", { className: "widgets-personalization-panel__item-lock", role: "img", "aria-label": t("homepage.widgetsPersonalization.locked"), "data-testid": `widgetspersonalization-lock-${item.id}`, children: /* @__PURE__ */ jsx(SvgIconLock, {}) }) : /* @__PURE__ */ jsx(WidgetToggle, { checked: item.checked, onChange: () => onToggle(item.id), "aria-label": t("homepage.widgetsPersonalization.toggle", {
40
+ label: item.label
41
+ }), "data-testid": `widgetspersonalization-toggle-${item.id}` })
42
+ ] }, item.id)) })
43
+ ] });
44
+ }
45
+ export {
46
+ WidgetsPersonalizationPanel
47
+ };
@@ -0,0 +1,2 @@
1
+ export * from './WidgetsPersonalizationPanel';
2
+ export * from './WidgetToggle';
@@ -1,11 +1,25 @@
1
+ export * from './Agenda';
2
+ export * from './Communities';
3
+ export * from './BriefMe';
4
+ export * from './Cantine';
5
+ export * from './Captation';
6
+ export * from './Edumalin';
1
7
  export * from './Favorites';
8
+ export * from './GenerationHdf';
2
9
  export * from './Header';
3
10
  export * from './HomeCard';
4
11
  export * from './LastInfos';
12
+ export * from './Mediacentre';
5
13
  export * from './MessageFlashList';
6
14
  export * from './Notifications';
15
+ export * from './Qwant';
16
+ export * from './Rss';
7
17
  export * from './SchoolSpace';
18
+ export * from './ScreenTime';
8
19
  export * from './UsefulLinks';
20
+ export * from './Universalis';
9
21
  export * from './UserSpace';
10
22
  export * from './Communities';
11
23
  export * from './AlloRegion';
24
+ export * from './WidgetsPersonalizationPanel';
25
+ export * from './TabsKids';
@@ -1,5 +1,5 @@
1
- import { School } from '@edifice.io/client';
2
- export declare function useUserSchools(): {
1
+ import { School, WidgetName } from '@edifice.io/client';
2
+ export declare function useUserSchools(widgetName?: WidgetName): {
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 "../../hooks/useWidget.js";
4
- import useSession from "../../../../hooks/useSession/useSession.js";
5
- function useUserSchools() {
3
+ import useWidget from "./useWidget.js";
4
+ import useSession from "../../../hooks/useSession/useSession.js";
5
+ function useUserSchools(widgetName = WIDGET_NAME.SCHOOL) {
6
6
  var _a, _b;
7
7
  const {
8
8
  data: session
9
9
  } = useSession(), {
10
10
  preference,
11
11
  savePreference
12
- } = useWidget(WIDGET_NAME.SCHOOL), [selectedSchool, setSelectedSchool] = useState(), [schools, setSchools] = useState((_a = session == null ? void 0 : session.userDescription) == null ? void 0 : _a.schools);
12
+ } = useWidget(widgetName), [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;
@@ -0,0 +1,7 @@
1
+ import { SVGProps } from 'react';
2
+ interface SVGRProps {
3
+ title?: string;
4
+ titleId?: string;
5
+ }
6
+ declare const SvgIconAddWidget: ({ title, titleId, ...props }: SVGProps<SVGSVGElement> & SVGRProps) => import("react/jsx-runtime").JSX.Element;
7
+ export default SvgIconAddWidget;
@@ -0,0 +1,12 @@
1
+ import { jsxs, jsx } from "react/jsx-runtime";
2
+ const SvgIconAddWidget = ({
3
+ title,
4
+ titleId,
5
+ ...props
6
+ }) => /* @__PURE__ */ jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", width: "24", height: "24", fill: "none", viewBox: "0 0 20 20", "aria-hidden": "true", "aria-labelledby": titleId, ...props, children: [
7
+ title ? /* @__PURE__ */ jsx("title", { id: titleId, children: title }) : null,
8
+ /* @__PURE__ */ jsx("path", { fill: "currentColor", fillRule: "evenodd", d: "M15.834 10.833c.46 0 .833.373.833.834v2.5h2.5a.833.833 0 0 1 0 1.666h-2.5v2.5a.833.833 0 0 1-1.667 0v-2.5h-2.5a.833.833 0 0 1 0-1.666H15v-2.5c0-.46.373-.834.834-.834M8.333 3.333A.833.833 0 0 0 7.5 2.5h-5a.833.833 0 0 0-.833.833v13.334c0 .46.373.833.833.833h5c.46 0 .833-.373.833-.833zM10 16.667a2.5 2.5 0 0 1-2.5 2.5h-5a2.5 2.5 0 0 1-2.5-2.5V3.333a2.5 2.5 0 0 1 2.5-2.5h5a2.5 2.5 0 0 1 2.5 2.5zM18.334 3.333A.833.833 0 0 0 17.5 2.5h-3.333a.833.833 0 0 0-.833.833v3.334c0 .46.373.833.833.833H17.5c.46 0 .834-.373.834-.833zM20 6.667a2.5 2.5 0 0 1-2.5 2.5h-3.333a2.5 2.5 0 0 1-2.5-2.5V3.333a2.5 2.5 0 0 1 2.5-2.5H17.5a2.5 2.5 0 0 1 2.5 2.5z", clipRule: "evenodd" })
9
+ ] });
10
+ export {
11
+ SvgIconAddWidget as default
12
+ };
@@ -1,4 +1,5 @@
1
1
  export { default as IconAddUser } from './IconAddUser';
2
+ export { default as IconAddWidget } from './IconAddWidget';
2
3
  export { default as IconAdd } from './IconAdd';
3
4
  export { default as IconAdjustSettings } from './IconAdjustSettings';
4
5
  export { default as IconAiFill } from './IconAiFill';
@@ -4,6 +4,8 @@ export interface AudioRecorderProps {
4
4
  onRecordUpdated?: (recordURL?: string) => void;
5
5
  hideSaveAction?: boolean;
6
6
  visibility?: WorkspaceVisibility;
7
+ /** Called with the record name each time the user edits it. */
8
+ onNameChange?: (name: string) => void;
7
9
  }
8
10
  export interface AudioRecorderRef {
9
11
  save: () => Promise<WorkspaceElement | undefined>;
@@ -6,13 +6,15 @@ import SvgIconMic from "../../icons/components/IconMic.js";
6
6
  import AudioRecorderTimer from "./AudioRecorderTimer.js";
7
7
  import useAudioRecorder from "./useAudioRecorder.js";
8
8
  import FormControl from "../../../components/Form/FormControl.js";
9
+ import Label from "../../../components/Label/Label.js";
9
10
  import Input from "../../../components/Input/Input.js";
10
11
  import { Toolbar } from "../../../components/Toolbar/Toolbar.js";
11
12
  const AudioRecorder = /* @__PURE__ */ forwardRef(({
12
13
  onSaveSuccess,
13
14
  onRecordUpdated,
14
15
  hideSaveAction = !1,
15
- visibility = "protected"
16
+ visibility = "protected",
17
+ onNameChange
16
18
  }, ref) => {
17
19
  const {
18
20
  recordState,
@@ -21,6 +23,7 @@ const AudioRecorder = /* @__PURE__ */ forwardRef(({
21
23
  audioRef,
22
24
  audioNameRef,
23
25
  toolbarItems,
26
+ micError,
24
27
  maxDuration,
25
28
  handlePlayEnded,
26
29
  handleSave
@@ -34,18 +37,29 @@ const AudioRecorder = /* @__PURE__ */ forwardRef(({
34
37
  useImperativeHandle(ref, () => ({
35
38
  save: handleSave
36
39
  }));
37
- const [audioTime, setAudioTime] = useState(0), classColor = clsx({
38
- "text-danger": recordState === "RECORDING",
39
- "text-success": playState === "PLAYING"
40
+ const [audioTime, setAudioTime] = useState(0), iconClassName = clsx("audio-recorder-icon", {
41
+ "audio-recorder-icon--recording": recordState === "RECORDING",
42
+ "audio-recorder-icon--playing": playState === "PLAYING"
40
43
  }), handleTimeUpdate = (event) => {
41
44
  setAudioTime(event.target.currentTime);
42
45
  };
43
- return /* @__PURE__ */ jsxs("div", { className: "audio-recorder m-auto d-flex flex-column", children: [
44
- /* @__PURE__ */ jsx(FormControl, { id: "recordName", className: "mb-32", isRequired: !0, isReadOnly: recordState === "SAVED" || recordState === "SAVING", children: /* @__PURE__ */ jsx(Input, { type: "text", size: "sm", placeholder: t("bbm.audio.recorder.name"), ref: audioNameRef, defaultValue: getDefaultDate() }) }),
45
- /* @__PURE__ */ jsx("div", { className: "audio-recorder-icon mx-auto", children: /* @__PURE__ */ jsx(SvgIconMic, { width: 64, height: 64, className: classColor }) }),
46
- /* @__PURE__ */ jsx(AudioRecorderTimer, { recordState, playState, recordTime, audioTime, maxDuration }),
47
- /* @__PURE__ */ jsx("audio", { ref: audioRef, onEnded: handlePlayEnded, onTimeUpdate: handleTimeUpdate, children: /* @__PURE__ */ jsx("track", { default: !0, kind: "captions", srcLang: "fr", src: "" }) }),
48
- /* @__PURE__ */ jsx(Toolbar, { items: toolbarItems })
46
+ return micError ? /* @__PURE__ */ jsxs("div", { className: "audio-recorder-error", children: [
47
+ /* @__PURE__ */ jsx("div", { className: "audio-recorder-error-illustration", "aria-hidden": "true" }),
48
+ /* @__PURE__ */ jsxs("div", { className: "audio-recorder-error-text", children: [
49
+ /* @__PURE__ */ jsx("p", { className: "audio-recorder-error-title", children: t("bbm.audio.recorder.device.error.title") }),
50
+ /* @__PURE__ */ jsx("p", { className: "audio-recorder-error-description", children: t("bbm.audio.recorder.device.error.text") })
51
+ ] })
52
+ ] }) : /* @__PURE__ */ jsxs("div", { className: "audio-recorder", children: [
53
+ /* @__PURE__ */ jsxs(FormControl, { id: "recordName", isRequired: !0, isReadOnly: recordState === "SAVED" || recordState === "SAVING", children: [
54
+ /* @__PURE__ */ jsx(Label, { leftIcon: /* @__PURE__ */ jsx(SvgIconMic, { width: 18, height: 18 }), children: t("bbm.audio.recorder.name.label") }),
55
+ /* @__PURE__ */ jsx(Input, { type: "text", size: "lg", maxLength: 80, showCounter: !0, placeholder: t("bbm.audio.recorder.name"), defaultValue: getDefaultDate(), onChange: (event) => onNameChange == null ? void 0 : onNameChange(event.target.value), ref: audioNameRef })
56
+ ] }),
57
+ /* @__PURE__ */ jsxs("div", { className: "audio-recorder-controls", children: [
58
+ /* @__PURE__ */ jsx("div", { className: iconClassName, children: /* @__PURE__ */ jsx(SvgIconMic, { width: 64, height: 64 }) }),
59
+ /* @__PURE__ */ jsx(AudioRecorderTimer, { recordState, playState, recordTime, audioTime, maxDuration }),
60
+ /* @__PURE__ */ jsx("audio", { ref: audioRef, onEnded: handlePlayEnded, onTimeUpdate: handleTimeUpdate, children: /* @__PURE__ */ jsx("track", { default: !0, kind: "captions", srcLang: "fr", src: "" }) }),
61
+ /* @__PURE__ */ jsx(Toolbar, { items: toolbarItems })
62
+ ] })
49
63
  ] });
50
64
  });
51
65
  export {
@@ -9,7 +9,7 @@ const AudioRecorderTimer = ({
9
9
  recordTime,
10
10
  audioTime,
11
11
  maxDuration
12
- }) => /* @__PURE__ */ jsxs("div", { className: "audio-recorder-time my-16 mx-auto", children: [
12
+ }) => /* @__PURE__ */ jsxs("div", { className: "audio-recorder-time", children: [
13
13
  playState === "IDLE" && /* @__PURE__ */ jsxs("div", { className: "d-flex align-items-center", children: [
14
14
  recordState === "PAUSED" ? /* @__PURE__ */ jsx(SvgIconPause, { width: 12, height: 12, className: "me-8 text-danger" }) : /* @__PURE__ */ jsx(SvgIconRecord, { width: 12, height: 12, className: "me-8 text-danger" }),
15
15
  convertMsToMS(recordState !== "IDLE" ? recordTime : 0) + " / " + convertMsToMS(maxDuration)
@@ -11,6 +11,7 @@ export default function useAudioRecorder(onSaveSuccess?: (resource: WorkspaceEle
11
11
  audioRef: import('react').RefObject<HTMLAudioElement>;
12
12
  audioNameRef: import('react').RefObject<HTMLInputElement>;
13
13
  toolbarItems: ToolbarItem[];
14
+ micError: unknown;
14
15
  handlePlayEnded: () => void;
15
16
  handleSave: () => Promise<WorkspaceElement | undefined>;
16
17
  };