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

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 (209) hide show
  1. package/dist/components/Checkbox/Checkbox.js +1 -1
  2. package/dist/components/Dropdown/DropdownItem.js +1 -17
  3. package/dist/components/Layout/Layout.js +4 -12
  4. package/dist/components/SearchBar/SearchBar.js +26 -17
  5. package/dist/components/Tree/components/Tree.d.ts +5 -2
  6. package/dist/components/Tree/components/Tree.js +7 -10
  7. package/dist/components/Tree/hooks/useTree.d.ts +0 -1
  8. package/dist/components/Tree/hooks/useTree.js +2 -6
  9. package/dist/components/Tree/types/index.d.ts +0 -7
  10. package/dist/components/index.d.ts +0 -1
  11. package/dist/homepage.js +28 -87
  12. package/dist/hooks/index.d.ts +1 -0
  13. package/dist/hooks/useDropdown/useDropdown.js +2 -2
  14. package/dist/hooks/useGoogleDriveSearch/index.d.ts +1 -0
  15. package/dist/hooks/useGoogleDriveSearch/useGoogleDriveSearch.d.ts +19 -0
  16. package/dist/hooks/useGoogleDriveSearch/useGoogleDriveSearch.js +60 -0
  17. package/dist/hooks/useZendeskGuide/useZendeskGuide.d.ts +6 -2
  18. package/dist/hooks/useZendeskGuide/useZendeskGuide.js +8 -11
  19. package/dist/icons-apps.js +184 -182
  20. package/dist/icons.js +404 -406
  21. package/dist/index.js +198 -194
  22. package/dist/modules/HelpZone/HelpZone.js +8 -6
  23. package/dist/modules/HelpZone/HelpZoneContainer.js +5 -2
  24. package/dist/modules/editor/components/Editor/Editor.d.ts +7 -5
  25. package/dist/modules/editor/components/Editor/Editor.js +3 -5
  26. package/dist/modules/editor/components/EditorToolbar/EditorToolbar.d.ts +3 -1
  27. package/dist/modules/editor/components/EditorToolbar/EditorToolbar.js +14 -8
  28. package/dist/modules/editor/components/NodeView/ImageNodeView.d.ts +1 -1
  29. package/dist/modules/editor/components/NodeView/ImageNodeView.js +14 -7
  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 +2 -1
  33. package/dist/modules/editor/hooks/useTipTapEditor.js +2 -2
  34. package/dist/modules/homepage/components/AlloLycee/AlloLycee.d.ts +11 -0
  35. package/dist/modules/homepage/components/AlloLycee/AlloLycee.js +32 -0
  36. package/dist/modules/homepage/components/AlloLycee/AlloLyceeContainer.d.ts +4 -0
  37. package/dist/modules/homepage/components/AlloLycee/AlloLyceeContainer.js +10 -0
  38. package/dist/modules/homepage/components/AlloLycee/index.d.ts +3 -0
  39. package/dist/modules/homepage/components/Header/Header.js +21 -9
  40. package/dist/modules/homepage/components/HomeCard/HomeCardHeader.d.ts +1 -5
  41. package/dist/modules/homepage/components/HomeCard/HomeCardHeader.js +1 -1
  42. package/dist/modules/homepage/components/Notifications/NotificationList.js +8 -7
  43. package/dist/modules/homepage/components/Notifications/NotificationListSkeleton.js +12 -7
  44. package/dist/modules/homepage/components/Notifications/NotificationSkeleton.js +4 -7
  45. package/dist/modules/homepage/components/Notifications/components/CommonNotificationItem.js +9 -9
  46. package/dist/modules/homepage/components/Notifications/components/NotificationFilterModal.js +13 -11
  47. package/dist/modules/homepage/components/Notifications/components/ReportNotificationModal.js +12 -6
  48. package/dist/modules/homepage/components/Notifications/components/notificationAdapter.d.ts +2 -1
  49. package/dist/modules/homepage/components/Notifications/components/notificationAdapter.js +12 -14
  50. package/dist/modules/homepage/components/Notifications/hooks/useNotificationList.js +10 -9
  51. package/dist/modules/homepage/components/SchoolSpace/SchoolSpaceContainer.js +1 -1
  52. package/dist/modules/homepage/{hooks → components/SchoolSpace}/useUserSchools.d.ts +2 -2
  53. package/dist/modules/homepage/{hooks → components/SchoolSpace}/useUserSchools.js +4 -4
  54. package/dist/modules/homepage/components/UsefulLinks/UsefulLinks.js +2 -2
  55. package/dist/modules/homepage/components/UsefulLinks/UsefulLinksModal.js +2 -2
  56. package/dist/modules/homepage/components/UserSpace/UserSpace.d.ts +1 -3
  57. package/dist/modules/homepage/components/UserSpace/UserSpace.js +7 -13
  58. package/dist/modules/homepage/components/UserSpace/UserSpaceContainer.d.ts +2 -4
  59. package/dist/modules/homepage/components/UserSpace/UserSpaceContainer.js +2 -3
  60. package/dist/modules/homepage/components/index.d.ts +2 -11
  61. package/dist/modules/icons/components/apps/IconElea.d.ts +7 -0
  62. package/dist/modules/icons/components/apps/IconElea.js +23 -0
  63. package/dist/modules/icons/components/apps/index.d.ts +1 -0
  64. package/dist/modules/icons/components/index.d.ts +0 -1
  65. package/dist/modules/icons/components/nav/IconCommunitiesBeta.js +7 -5
  66. package/dist/modules/icons/components/nav/IconHomeBeta.js +3 -6
  67. package/dist/modules/icons/components/nav/IconMessagesBeta.js +7 -7
  68. package/dist/modules/icons/components/nav/IconMyAppsBeta.js +3 -2
  69. package/dist/modules/icons/components/nav/IconNotificationBeta.js +4 -2
  70. package/dist/modules/multimedia/FileCard/GoogleDriveFileCard.d.ts +25 -0
  71. package/dist/modules/multimedia/FileCard/GoogleDriveFileCard.js +102 -0
  72. package/dist/modules/multimedia/FileCard/index.d.ts +2 -0
  73. package/dist/modules/multimedia/GoogleDrive/GoogleDrive.d.ts +24 -0
  74. package/dist/modules/multimedia/GoogleDrive/GoogleDrive.js +103 -0
  75. package/dist/modules/multimedia/GoogleDrive/index.d.ts +2 -0
  76. package/dist/modules/multimedia/Linker/InternalLinker/InternalLinker.d.ts +7 -1
  77. package/dist/modules/multimedia/Linker/InternalLinker/InternalLinker.js +2 -0
  78. package/dist/modules/multimedia/MediaLibrary/MediaLibrary.js +16 -5
  79. package/dist/modules/multimedia/MediaLibrary/innertabs/GoogleDrive.d.ts +1 -0
  80. package/dist/modules/multimedia/MediaLibrary/innertabs/GoogleDrive.js +61 -0
  81. package/dist/modules/multimedia/MediaLibrary/innertabs/index.d.ts +1 -0
  82. package/dist/modules/multimedia/MediaLibrary/innertabs/index.js +2 -0
  83. package/dist/modules/multimedia/Workspace/Workspace.js +1 -1
  84. package/dist/modules/multimedia/index.d.ts +1 -0
  85. package/dist/multimedia.js +26 -22
  86. package/package.json +6 -6
  87. package/dist/components/Masonry/Masonry.d.ts +0 -40
  88. package/dist/components/Masonry/Masonry.js +0 -50
  89. package/dist/components/Masonry/index.d.ts +0 -2
  90. package/dist/modules/homepage/components/Agenda/Agenda.d.ts +0 -10
  91. package/dist/modules/homepage/components/Agenda/Agenda.js +0 -54
  92. package/dist/modules/homepage/components/Agenda/AgendaContainer.d.ts +0 -1
  93. package/dist/modules/homepage/components/Agenda/AgendaContainer.js +0 -14
  94. package/dist/modules/homepage/components/Agenda/AgendaEventCard.d.ts +0 -10
  95. package/dist/modules/homepage/components/Agenda/AgendaEventCard.js +0 -30
  96. package/dist/modules/homepage/components/Agenda/hooks/useAgendaContainer.d.ts +0 -14
  97. package/dist/modules/homepage/components/Agenda/hooks/useAgendaContainer.js +0 -27
  98. package/dist/modules/homepage/components/Agenda/index.d.ts +0 -3
  99. package/dist/modules/homepage/components/Agenda/services/api/agendaService.d.ts +0 -24
  100. package/dist/modules/homepage/components/Agenda/services/api/agendaService.js +0 -45
  101. package/dist/modules/homepage/components/Agenda/services/api/index.d.ts +0 -4
  102. package/dist/modules/homepage/components/Agenda/services/api/index.js +0 -5
  103. package/dist/modules/homepage/components/Agenda/services/queries/agenda.d.ts +0 -19
  104. package/dist/modules/homepage/components/Agenda/services/queries/agenda.js +0 -26
  105. package/dist/modules/homepage/components/BriefMe/BriefMe.d.ts +0 -9
  106. package/dist/modules/homepage/components/BriefMe/BriefMe.js +0 -59
  107. package/dist/modules/homepage/components/BriefMe/BriefMeContainer.d.ts +0 -4
  108. package/dist/modules/homepage/components/BriefMe/BriefMeContainer.js +0 -17
  109. package/dist/modules/homepage/components/BriefMe/index.d.ts +0 -4
  110. package/dist/modules/homepage/components/BriefMe/types.d.ts +0 -17
  111. package/dist/modules/homepage/components/BriefMe/types.js +0 -8
  112. package/dist/modules/homepage/components/BriefMe/useBriefMe.d.ts +0 -31
  113. package/dist/modules/homepage/components/BriefMe/useBriefMe.js +0 -51
  114. package/dist/modules/homepage/components/Cantine/Cantine.d.ts +0 -7
  115. package/dist/modules/homepage/components/Cantine/Cantine.js +0 -44
  116. package/dist/modules/homepage/components/Cantine/CantineContainer.d.ts +0 -4
  117. package/dist/modules/homepage/components/Cantine/CantineContainer.js +0 -18
  118. package/dist/modules/homepage/components/Cantine/CantineModal.d.ts +0 -24
  119. package/dist/modules/homepage/components/Cantine/CantineModal.js +0 -88
  120. package/dist/modules/homepage/components/Cantine/CantineModalContainer.d.ts +0 -7
  121. package/dist/modules/homepage/components/Cantine/CantineModalContainer.js +0 -12
  122. package/dist/modules/homepage/components/Cantine/components/CantineLegend.d.ts +0 -5
  123. package/dist/modules/homepage/components/Cantine/components/CantineLegend.js +0 -22
  124. package/dist/modules/homepage/components/Cantine/components/CantineMenuSection.d.ts +0 -6
  125. package/dist/modules/homepage/components/Cantine/components/CantineMenuSection.js +0 -28
  126. package/dist/modules/homepage/components/Cantine/components/cantineLabels.d.ts +0 -12
  127. package/dist/modules/homepage/components/Cantine/components/cantineLabels.js +0 -60
  128. package/dist/modules/homepage/components/Cantine/hooks/useCantine.d.ts +0 -11
  129. package/dist/modules/homepage/components/Cantine/hooks/useCantine.js +0 -20
  130. package/dist/modules/homepage/components/Cantine/hooks/useCantineMenu.d.ts +0 -24
  131. package/dist/modules/homepage/components/Cantine/hooks/useCantineMenu.js +0 -65
  132. package/dist/modules/homepage/components/Cantine/hooks/useCantineModal.d.ts +0 -23
  133. package/dist/modules/homepage/components/Cantine/hooks/useCantineModal.js +0 -43
  134. package/dist/modules/homepage/components/Cantine/index.d.ts +0 -7
  135. package/dist/modules/homepage/components/Cantine/types.d.ts +0 -42
  136. package/dist/modules/homepage/components/Edumalin/Edumalin.d.ts +0 -9
  137. package/dist/modules/homepage/components/Edumalin/Edumalin.js +0 -65
  138. package/dist/modules/homepage/components/Edumalin/EdumalinContainer.d.ts +0 -4
  139. package/dist/modules/homepage/components/Edumalin/EdumalinContainer.js +0 -21
  140. package/dist/modules/homepage/components/Edumalin/EdumalinModal.d.ts +0 -8
  141. package/dist/modules/homepage/components/Edumalin/EdumalinModal.js +0 -62
  142. package/dist/modules/homepage/components/Edumalin/components/EdumalinBadge.d.ts +0 -5
  143. package/dist/modules/homepage/components/Edumalin/components/EdumalinBadge.js +0 -38
  144. package/dist/modules/homepage/components/Edumalin/components/EdumalinPicture.d.ts +0 -5
  145. package/dist/modules/homepage/components/Edumalin/components/EdumalinPicture.js +0 -12
  146. package/dist/modules/homepage/components/Edumalin/index.d.ts +0 -7
  147. package/dist/modules/homepage/components/Edumalin/types.d.ts +0 -24
  148. package/dist/modules/homepage/components/Edumalin/types.js +0 -4
  149. package/dist/modules/homepage/components/Edumalin/useEdumalin.d.ts +0 -16
  150. package/dist/modules/homepage/components/Edumalin/useEdumalin.js +0 -35
  151. package/dist/modules/homepage/components/Edumalin/utils.d.ts +0 -28
  152. package/dist/modules/homepage/components/Edumalin/utils.js +0 -56
  153. package/dist/modules/homepage/components/GenerationHdf/GenerationHdf.d.ts +0 -16
  154. package/dist/modules/homepage/components/GenerationHdf/GenerationHdf.js +0 -65
  155. package/dist/modules/homepage/components/GenerationHdf/GenerationHdfContainer.d.ts +0 -4
  156. package/dist/modules/homepage/components/GenerationHdf/GenerationHdfContainer.js +0 -12
  157. package/dist/modules/homepage/components/GenerationHdf/formatSolde.d.ts +0 -1
  158. package/dist/modules/homepage/components/GenerationHdf/formatSolde.js +0 -6
  159. package/dist/modules/homepage/components/GenerationHdf/index.d.ts +0 -3
  160. package/dist/modules/homepage/components/GenerationHdf/useGenerationHdf.d.ts +0 -10
  161. package/dist/modules/homepage/components/GenerationHdf/useGenerationHdf.js +0 -69
  162. package/dist/modules/homepage/components/Qwant/Qwant.d.ts +0 -4
  163. package/dist/modules/homepage/components/Qwant/Qwant.js +0 -41
  164. package/dist/modules/homepage/components/Qwant/QwantContainer.d.ts +0 -1
  165. package/dist/modules/homepage/components/Qwant/QwantContainer.js +0 -10
  166. package/dist/modules/homepage/components/Qwant/index.d.ts +0 -3
  167. package/dist/modules/homepage/components/Rss/Rss.d.ts +0 -11
  168. package/dist/modules/homepage/components/Rss/Rss.js +0 -64
  169. package/dist/modules/homepage/components/Rss/RssContainer.d.ts +0 -1
  170. package/dist/modules/homepage/components/Rss/RssContainer.js +0 -45
  171. package/dist/modules/homepage/components/Rss/RssFeedForm.d.ts +0 -13
  172. package/dist/modules/homepage/components/Rss/RssFeedForm.js +0 -69
  173. package/dist/modules/homepage/components/Rss/RssFeedsModal.d.ts +0 -11
  174. package/dist/modules/homepage/components/Rss/RssFeedsModal.js +0 -58
  175. package/dist/modules/homepage/components/Rss/hooks/useRssContainer.d.ts +0 -25
  176. package/dist/modules/homepage/components/Rss/hooks/useRssContainer.js +0 -43
  177. package/dist/modules/homepage/components/Rss/index.d.ts +0 -6
  178. package/dist/modules/homepage/components/Rss/services/api/index.d.ts +0 -5
  179. package/dist/modules/homepage/components/Rss/services/api/index.js +0 -5
  180. package/dist/modules/homepage/components/Rss/services/api/rssService.d.ts +0 -38
  181. package/dist/modules/homepage/components/Rss/services/api/rssService.js +0 -51
  182. package/dist/modules/homepage/components/Rss/services/queries/rss.d.ts +0 -28
  183. package/dist/modules/homepage/components/Rss/services/queries/rss.js +0 -71
  184. package/dist/modules/homepage/components/Rss/types.d.ts +0 -25
  185. package/dist/modules/homepage/components/Rss/utils.d.ts +0 -7
  186. package/dist/modules/homepage/components/Rss/utils.js +0 -19
  187. package/dist/modules/homepage/components/TabsKids/components/TabsKids.d.ts +0 -43
  188. package/dist/modules/homepage/components/TabsKids/components/TabsKids.js +0 -23
  189. package/dist/modules/homepage/components/TabsKids/components/TabsKidsItem.d.ts +0 -34
  190. package/dist/modules/homepage/components/TabsKids/components/TabsKidsItem.js +0 -26
  191. package/dist/modules/homepage/components/TabsKids/components/TabsKidsList.d.ts +0 -14
  192. package/dist/modules/homepage/components/TabsKids/components/TabsKidsList.js +0 -64
  193. package/dist/modules/homepage/components/TabsKids/hooks/useTabsKidsOverflow.d.ts +0 -20
  194. package/dist/modules/homepage/components/TabsKids/hooks/useTabsKidsOverflow.js +0 -43
  195. package/dist/modules/homepage/components/TabsKids/index.d.ts +0 -3
  196. package/dist/modules/homepage/components/TabsKids/utils/visibleTabs.d.ts +0 -15
  197. package/dist/modules/homepage/components/TabsKids/utils/visibleTabs.js +0 -21
  198. package/dist/modules/homepage/components/Universalis/Universalis.d.ts +0 -8
  199. package/dist/modules/homepage/components/Universalis/Universalis.js +0 -62
  200. package/dist/modules/homepage/components/Universalis/UniversalisContainer.d.ts +0 -1
  201. package/dist/modules/homepage/components/Universalis/UniversalisContainer.js +0 -16
  202. package/dist/modules/homepage/components/Universalis/index.d.ts +0 -3
  203. package/dist/modules/homepage/components/WidgetsPersonalizationPanel/WidgetToggle.d.ts +0 -16
  204. package/dist/modules/homepage/components/WidgetsPersonalizationPanel/WidgetToggle.js +0 -15
  205. package/dist/modules/homepage/components/WidgetsPersonalizationPanel/WidgetsPersonalizationPanel.d.ts +0 -21
  206. package/dist/modules/homepage/components/WidgetsPersonalizationPanel/WidgetsPersonalizationPanel.js +0 -47
  207. package/dist/modules/homepage/components/WidgetsPersonalizationPanel/index.d.ts +0 -2
  208. package/dist/modules/icons/components/IconAddWidget.d.ts +0 -7
  209. package/dist/modules/icons/components/IconAddWidget.js +0 -12
@@ -1,7 +0,0 @@
1
- export * from './Edumalin';
2
- export { default as Edumalin } from './Edumalin';
3
- export * from './EdumalinContainer';
4
- export * from './EdumalinModal';
5
- export { default as EdumalinModal } from './EdumalinModal';
6
- export * from './types';
7
- export * from './useEdumalin';
@@ -1,24 +0,0 @@
1
- /** A content published by Édumalin, as relayed by app-registry. */
2
- export interface EdumalinItem {
3
- title: string;
4
- description?: string;
5
- picture?: string;
6
- type?: {
7
- name: string;
8
- };
9
- /** Webinar date and time. */
10
- dateTime?: string;
11
- /** Webinar duration, in minutes. */
12
- duration?: number;
13
- /** RDV location, as a Google Maps URL. */
14
- googleMap?: string;
15
- buttonLink?: string;
16
- buttonTitle?: string;
17
- }
18
- export type EdumalinStatus = 'loading' | 'default' | 'empty' | 'connectionError' | 'loadError';
19
- export interface EdumalinError {
20
- code: number;
21
- message: string;
22
- }
23
- export declare const EDUMALIN_TYPES: readonly ["webinar", "announcement", "news", "rdv", "testimonial", "replay", "podcast", "tutorial", "other"];
24
- export type EdumalinType = (typeof EDUMALIN_TYPES)[number];
@@ -1,4 +0,0 @@
1
- const EDUMALIN_TYPES = ["webinar", "announcement", "news", "rdv", "testimonial", "replay", "podcast", "tutorial", "other"];
2
- export {
3
- EDUMALIN_TYPES
4
- };
@@ -1,16 +0,0 @@
1
- import { EdumalinError, EdumalinItem, EdumalinStatus } from './types';
2
- export declare const edumalinQueryOptions: import('@tanstack/react-query').OmitKeyof<import('@tanstack/react-query').UseQueryOptions<EdumalinItem[], EdumalinError, EdumalinItem[], import('@tanstack/react-query').QueryKey>, "queryFn"> & {
3
- queryFn?: import('@tanstack/react-query').QueryFunction<EdumalinItem[], import('@tanstack/react-query').QueryKey, never> | undefined;
4
- } & {
5
- queryKey: import('@tanstack/react-query').DataTag<import('@tanstack/react-query').QueryKey, EdumalinItem[]>;
6
- };
7
- /**
8
- * Loads the Édumalin contents of the user's profile (first 3, in the order
9
- * sent by Édumalin) and the GAR link of the selected school.
10
- */
11
- export declare function useEdumalin(): {
12
- status: EdumalinStatus;
13
- items: EdumalinItem[];
14
- error: EdumalinError | null;
15
- edumalinUrl: string;
16
- };
@@ -1,35 +0,0 @@
1
- import { odeServices } from "@edifice.io/client";
2
- import { queryOptions, useQuery } from "@tanstack/react-query";
3
- import { useUserSchools } from "../../hooks/useUserSchools.js";
4
- import { parseEdumalinError, EDUMALIN_UNAUTHORIZED, buildGarLink } from "./utils.js";
5
- const EDUMALIN_MAX_ITEMS = 3, edumalinQueryOptions = queryOptions({
6
- queryKey: ["edumalin"],
7
- retry: !1,
8
- queryFn: async () => {
9
- const http = odeServices.http();
10
- try {
11
- return (await http.get("/appregistry/edumalin/widget")).data ?? [];
12
- } catch (body) {
13
- throw parseEdumalinError(body, http.latestResponse);
14
- }
15
- }
16
- });
17
- function useEdumalin() {
18
- const {
19
- selectedSchool
20
- } = useUserSchools(), {
21
- data,
22
- isLoading,
23
- error
24
- } = useQuery(edumalinQueryOptions), items = (data ?? []).slice(0, EDUMALIN_MAX_ITEMS);
25
- return {
26
- status: error ? error.message === EDUMALIN_UNAUTHORIZED ? "connectionError" : "loadError" : isLoading ? "loading" : items.length > 0 ? "default" : "empty",
27
- items,
28
- error,
29
- edumalinUrl: buildGarLink(selectedSchool)
30
- };
31
- }
32
- export {
33
- edumalinQueryOptions,
34
- useEdumalin
35
- };
@@ -1,28 +0,0 @@
1
- import { School } from '@edifice.io/client';
2
- import { EdumalinError, EdumalinType } from './types';
3
- /** Error code sent by app-registry when it cannot authenticate to Édumalin. */
4
- export declare const EDUMALIN_UNAUTHORIZED = "edumalin.widget.unauthorized";
5
- /**
6
- * The backend wraps every failure in `{ error: <string> }`. That string is
7
- * either a plain message or a JSON payload (its own error code, or the error
8
- * Édumalin returned), in which case its `message`, then `error`, is shown.
9
- * Any other body (network failure, proxy error page…) shows the status text.
10
- */
11
- export declare function parseEdumalinError(body: unknown, { status, statusText }: {
12
- status: number;
13
- statusText: string;
14
- }): EdumalinError;
15
- /**
16
- * Édumalin type names aren't normalized (e.g. "Temoignage" without accent),
17
- * so they are matched ignoring case and accents. Unknown types are "other".
18
- */
19
- export declare function getEdumalinType(name?: string): EdumalinType;
20
- /** Only absolute http(s) URLs coming from Édumalin are trusted. */
21
- export declare function isHttpUrl(url?: string): url is string;
22
- export declare function getPictureUrl(picture?: string): string | undefined;
23
- /**
24
- * Édumalin is reached through the GAR, which logs the user in when given the
25
- * school UAI and the GAR code taken from its exports, both base64-encoded.
26
- * Without a school, the user lands on the public website instead.
27
- */
28
- export declare function buildGarLink(school?: School): string;
@@ -1,56 +0,0 @@
1
- const EDUMALIN_UNAUTHORIZED = "edumalin.widget.unauthorized", EDUMALIN_GAR_URL = "https://idp-auth.gar.education.fr/domaineGar?idENT=ID_ENT&idEtab=ID_ETAB&idRessource=ark:/19496/UVdpWxn8N78r24", EDUMALIN_PUBLIC_URL = "https://edumalin.fr/";
2
- function parseEdumalinError(body, {
3
- status,
4
- statusText
5
- }) {
6
- const raw = typeof body == "object" && body !== null && "error" in body ? body.error : void 0;
7
- if (typeof raw != "string") return {
8
- code: status,
9
- message: statusText
10
- };
11
- try {
12
- const payload = JSON.parse(raw);
13
- return {
14
- code: status,
15
- message: String(payload.message ?? payload.error ?? raw)
16
- };
17
- } catch {
18
- return {
19
- code: status,
20
- message: raw
21
- };
22
- }
23
- }
24
- const TYPE_BY_NAME = {
25
- webinaire: "webinar",
26
- annonce: "announcement",
27
- actualite: "news",
28
- rdv: "rdv",
29
- temoignage: "testimonial",
30
- replay: "replay",
31
- podcast: "podcast",
32
- tutoriel: "tutorial"
33
- };
34
- function getEdumalinType(name) {
35
- const key = (name ?? "").normalize("NFD").replace(new RegExp("\\p{Diacritic}", "gu"), "").toLowerCase();
36
- return TYPE_BY_NAME[key] ?? "other";
37
- }
38
- function isHttpUrl(url) {
39
- return !!url && /^https?:\/\//.test(url);
40
- }
41
- function getPictureUrl(picture) {
42
- return isHttpUrl(picture) ? encodeURI(picture) : void 0;
43
- }
44
- function buildGarLink(school) {
45
- if (!school) return EDUMALIN_PUBLIC_URL;
46
- const schoolExports = school.exports ?? [], garExport = schoolExports.find((entry) => entry.startsWith("GAR-")), garCode = garExport ? garExport.replace("GAR-", "") : schoolExports[0] ?? "";
47
- return EDUMALIN_GAR_URL.replace("ID_ETAB", btoa(school.UAI ?? "")).replace("ID_ENT", btoa(garCode));
48
- }
49
- export {
50
- EDUMALIN_UNAUTHORIZED,
51
- buildGarLink,
52
- getEdumalinType,
53
- getPictureUrl,
54
- isHttpUrl,
55
- parseEdumalinError
56
- };
@@ -1,16 +0,0 @@
1
- import { FormEvent } from 'react';
2
- export type GenerationHdfStatus = 'idle' | 'loading' | 'error' | 'account';
3
- export interface GenerationHdfWallet {
4
- label: string;
5
- amount: string;
6
- }
7
- export interface GenerationHdfProps {
8
- handleActionClick: () => void;
9
- status: GenerationHdfStatus;
10
- cardNumber: string;
11
- onCardNumberChange: (value: string) => void;
12
- onSubmit: (event: FormEvent<HTMLFormElement>) => void;
13
- onEdit: () => void;
14
- wallets: GenerationHdfWallet[];
15
- }
16
- export default function GenerationHdf({ handleActionClick, status, cardNumber, onCardNumberChange, onSubmit, onEdit, wallets, }: GenerationHdfProps): import("react/jsx-runtime").JSX.Element;
@@ -1,65 +0,0 @@
1
- import { jsxs, jsx } from "react/jsx-runtime";
2
- import illuGenerationHdf from "@edifice.io/bootstrap/dist/images/homepage/illu-generation-hdf.svg";
3
- import { useTranslation } from "react-i18next";
4
- import SvgIconExternalLink from "../../../icons/components/IconExternalLink.js";
5
- import HomeCard from "../HomeCard/HomeCard.js";
6
- import ButtonBeta from "../../../../components/ButtonBeta/ButtonBeta.js";
7
- import Image from "../../../../components/Image/Image.js";
8
- import FormControl from "../../../../components/Form/FormControl.js";
9
- import Input from "../../../../components/Input/Input.js";
10
- function GenerationHdf({
11
- handleActionClick,
12
- status,
13
- cardNumber,
14
- onCardNumberChange,
15
- onSubmit,
16
- onEdit,
17
- wallets
18
- }) {
19
- const {
20
- t
21
- } = useTranslation(), isAccount = status === "account", isLoading = status === "loading", isError = status === "error";
22
- return /* @__PURE__ */ jsxs(HomeCard, { variant: "primary", children: [
23
- /* @__PURE__ */ jsxs("div", { className: "generation-hdf__header", children: [
24
- /* @__PURE__ */ jsx("h3", { className: "generation-hdf__title", children: t("homepage.widget.generation-hdf.title") }),
25
- /* @__PURE__ */ jsx(ButtonBeta, { "data-testid": "generation-hdf-button-open", "aria-label": t("homepage.widget.generation-hdf.open"), onClick: handleActionClick, leftIcon: /* @__PURE__ */ jsx(SvgIconExternalLink, {}), variant: "ghost", color: "tertiary" })
26
- ] }),
27
- /* @__PURE__ */ jsx(HomeCard.Content, { children: /* @__PURE__ */ jsxs("div", { className: "generation-hdf", children: [
28
- /* @__PURE__ */ jsx(Image, { src: illuGenerationHdf, alt: "Génération #HDF", className: "generation-hdf__logo" }),
29
- isAccount ? /* @__PURE__ */ jsxs("div", { className: "generation-hdf__account", children: [
30
- /* @__PURE__ */ jsx("h4", { className: "generation-hdf__account-title", children: t("homepage.widget.generation-hdf.wallets-title") }),
31
- /* @__PURE__ */ jsx("ul", { className: "generation-hdf__wallets", children: wallets.map((wallet, index) => /* @__PURE__ */ jsxs("li", { className: "generation-hdf__wallet", children: [
32
- /* @__PURE__ */ jsx("span", { className: "generation-hdf__wallet-label", children: wallet.label }),
33
- /* @__PURE__ */ jsx("span", { className: "generation-hdf__wallet-amount", children: wallet.amount })
34
- ] }, index)) })
35
- ] }) : /* @__PURE__ */ jsx("p", { className: "generation-hdf__description", children: t("homepage.widget.generation-hdf.description") }),
36
- /* @__PURE__ */ jsxs("form", { className: "generation-hdf__form", onSubmit, children: [
37
- /* @__PURE__ */ jsxs(FormControl, { id: "generationHdfCardNumber", className: "generation-hdf__field", status: isError ? "invalid" : void 0, children: [
38
- /* @__PURE__ */ jsx(
39
- Input,
40
- {
41
- size: "md",
42
- type: "text",
43
- inputMode: "numeric",
44
- placeholder: t("homepage.widget.generation-hdf.placeholder"),
45
- value: cardNumber,
46
- onChangeCapture: (event) => {
47
- event.currentTarget.value = event.currentTarget.value.replace(/\D/g, "");
48
- },
49
- onChange: (event) => onCardNumberChange(event.target.value),
50
- disabled: isAccount,
51
- maxLength: 12,
52
- showCounter: !0
53
- },
54
- isAccount ? "account" : "form"
55
- ),
56
- isError && /* @__PURE__ */ jsx(FormControl.Text, { children: t("homepage.widget.generation-hdf.error") })
57
- ] }),
58
- isAccount ? /* @__PURE__ */ jsx(ButtonBeta, { type: "button", variant: "outline", color: "default", onClick: onEdit, children: t("homepage.widget.generation-hdf.edit") }) : /* @__PURE__ */ jsx(ButtonBeta, { type: "submit", variant: "outline", color: "default", isLoading, disabled: !cardNumber.trim(), children: t("homepage.widget.generation-hdf.submit") })
59
- ] })
60
- ] }) })
61
- ] });
62
- }
63
- export {
64
- GenerationHdf as default
65
- };
@@ -1,4 +0,0 @@
1
- export declare function GenerationHdfContainer(): import("react/jsx-runtime").JSX.Element;
2
- export declare namespace GenerationHdfContainer {
3
- var displayName: string;
4
- }
@@ -1,12 +0,0 @@
1
- import { jsx } from "react/jsx-runtime";
2
- import GenerationHdf from "./GenerationHdf.js";
3
- import { useGenerationHdf } from "./useGenerationHdf.js";
4
- function GenerationHdfContainer() {
5
- const generationHdf = useGenerationHdf();
6
- return /* @__PURE__ */ jsx(GenerationHdf, { handleActionClick: () => {
7
- window.open("https://generation.hautsdefrance.fr", "_blank", "noopener,noreferrer");
8
- }, ...generationHdf });
9
- }
10
- export {
11
- GenerationHdfContainer
12
- };
@@ -1 +0,0 @@
1
- export declare function formatSolde(soldeStr: string): string;
@@ -1,6 +0,0 @@
1
- function formatSolde(soldeStr) {
2
- return typeof soldeStr != "string" || soldeStr.length === 0 ? soldeStr : soldeStr.length === 1 ? `0,0${soldeStr}` : soldeStr.length === 2 ? `0,${soldeStr}` : `${soldeStr.substring(0, soldeStr.length - 2)},${soldeStr.substring(soldeStr.length - 2)}`;
3
- }
4
- export {
5
- formatSolde
6
- };
@@ -1,3 +0,0 @@
1
- export * from './GenerationHdf';
2
- export { default as GenerationHdf } from './GenerationHdf';
3
- export * from './GenerationHdfContainer';
@@ -1,10 +0,0 @@
1
- import { FormEvent } from 'react';
2
- import { GenerationHdfStatus, GenerationHdfWallet } from './GenerationHdf';
3
- export declare function useGenerationHdf(): {
4
- status: GenerationHdfStatus;
5
- cardNumber: string;
6
- onCardNumberChange: import('react').Dispatch<import('react').SetStateAction<string>>;
7
- onSubmit: (event: FormEvent<HTMLFormElement>) => void;
8
- onEdit: () => void;
9
- wallets: GenerationHdfWallet[];
10
- };
@@ -1,69 +0,0 @@
1
- import { odeServices, USER_PREFS } from "@edifice.io/client";
2
- import { useQuery, useMutation } from "@tanstack/react-query";
3
- import { useState, useRef, useEffect } from "react";
4
- import { formatSolde } from "./formatSolde.js";
5
- function mapSalesToWallets(data) {
6
- return (data.sales ?? []).map((sale) => {
7
- var _a;
8
- const wallet = (_a = data.wallets) == null ? void 0 : _a.find((w) => w.code === sale.numPM);
9
- return {
10
- label: (wallet == null ? void 0 : wallet.libelle) ?? "",
11
- amount: `${formatSolde(sale.solde)} €`
12
- };
13
- });
14
- }
15
- async function fetchSales(cardNb) {
16
- const http = odeServices.http(), data = await http.get("/cursus/sales", {
17
- queryParams: {
18
- cardNb
19
- }
20
- });
21
- if (http.isResponseError())
22
- throw new Error(http.latestResponse.statusText);
23
- return data;
24
- }
25
- function useGenerationHdf() {
26
- const [cardNumber, setCardNumber] = useState(""), autoLoadTriggered = useRef(!1), preferenceQuery = useQuery({
27
- queryKey: ["cursus", "preference"],
28
- queryFn: () => odeServices.conf().getPreference(USER_PREFS.CURSUS)
29
- }), salesMutation = useMutation({
30
- mutationFn: async ({
31
- cardNb,
32
- persist
33
- }) => {
34
- const data = await fetchSales(cardNb);
35
- return persist && await odeServices.conf().savePreference(USER_PREFS.CURSUS, {
36
- cardNb
37
- }), data;
38
- }
39
- });
40
- useEffect(() => {
41
- var _a;
42
- if (autoLoadTriggered.current || !preferenceQuery.isSuccess) return;
43
- autoLoadTriggered.current = !0;
44
- const storedCardNb = (_a = preferenceQuery.data) == null ? void 0 : _a.cardNb;
45
- storedCardNb && (setCardNumber(storedCardNb), salesMutation.mutate({
46
- cardNb: storedCardNb,
47
- persist: !1
48
- }));
49
- }, [preferenceQuery.isSuccess, preferenceQuery.data, salesMutation]);
50
- const status = preferenceQuery.isPending || salesMutation.isPending ? "loading" : salesMutation.isError ? "error" : salesMutation.isSuccess ? "account" : "idle", wallets = salesMutation.data ? mapSalesToWallets(salesMutation.data) : [];
51
- return {
52
- status,
53
- cardNumber,
54
- onCardNumberChange: setCardNumber,
55
- onSubmit: (event) => {
56
- event.preventDefault(), !salesMutation.isPending && salesMutation.mutate({
57
- cardNb: cardNumber,
58
- persist: !0
59
- });
60
- },
61
- onEdit: () => {
62
- odeServices.conf().savePreference(USER_PREFS.CURSUS, {}), setCardNumber(""), salesMutation.reset();
63
- },
64
- wallets
65
- };
66
- }
67
- export {
68
- useGenerationHdf
69
- };
@@ -1,4 +0,0 @@
1
- export interface QwantProps {
2
- handleActionClick: () => void;
3
- }
4
- export default function Qwant({ handleActionClick }: QwantProps): import("react/jsx-runtime").JSX.Element;
@@ -1,41 +0,0 @@
1
- import { jsxs, jsx } from "react/jsx-runtime";
2
- import illuQwant from "@edifice.io/bootstrap/dist/images/homepage/illu-qwant.png";
3
- import { useForm } from "react-hook-form";
4
- import { useTranslation } from "react-i18next";
5
- import SvgIconExternalLink from "../../../icons/components/IconExternalLink.js";
6
- import SvgIconSearch from "../../../icons/components/IconSearch.js";
7
- import HomeCard from "../HomeCard/HomeCard.js";
8
- import ButtonBeta from "../../../../components/ButtonBeta/ButtonBeta.js";
9
- import Image from "../../../../components/Image/Image.js";
10
- import FormControl from "../../../../components/Form/FormControl.js";
11
- import Input from "../../../../components/Input/Input.js";
12
- function Qwant({
13
- handleActionClick
14
- }) {
15
- const {
16
- t
17
- } = useTranslation(), {
18
- register
19
- } = useForm();
20
- return /* @__PURE__ */ jsxs(HomeCard, { variant: "primary", children: [
21
- /* @__PURE__ */ jsxs("div", { className: "qwant__header", children: [
22
- /* @__PURE__ */ jsx("h3", { className: "qwant__title", children: t("homepage.widget.qwant.title") }),
23
- /* @__PURE__ */ jsx(ButtonBeta, { className: "qwant__header-button", "data-testid": "qwant-button-open", "aria-label": t("homepage.widget.qwant.open"), onClick: handleActionClick, leftIcon: /* @__PURE__ */ jsx(SvgIconExternalLink, {}), variant: "ghost", color: "tertiary" })
24
- ] }),
25
- /* @__PURE__ */ jsx(HomeCard.Content, { children: /* @__PURE__ */ jsxs("div", { className: "qwant", children: [
26
- /* @__PURE__ */ jsxs("div", { className: "qwant__intro", children: [
27
- /* @__PURE__ */ jsx(Image, { src: illuQwant, alt: "Qwant", className: "qwant__logo" }),
28
- /* @__PURE__ */ jsx("p", { className: "qwant__description", children: t("homepage.widget.qwant.description") })
29
- ] }),
30
- /* @__PURE__ */ jsx("form", { method: "GET", action: "https://www.qwant.com", target: "_blank", className: "qwant__search", children: /* @__PURE__ */ jsxs(FormControl, { id: "inputQwantQuery", className: "qwant__search-field", children: [
31
- /* @__PURE__ */ jsx(FormControl.Label, { className: "visually-hidden", children: t("search") }),
32
- /* @__PURE__ */ jsx(Input, { "data-testid": "qwant-search-input", placeholder: t("search"), size: "md", type: "text", maxLength: 255, ...register("q") }),
33
- /* @__PURE__ */ jsx("input", { type: "hidden", name: "l", value: "fr" }),
34
- /* @__PURE__ */ jsx(ButtonBeta, { leftIcon: /* @__PURE__ */ jsx(SvgIconSearch, {}), type: "submit", "aria-label": t("search"), variant: "filled", color: "default" })
35
- ] }) })
36
- ] }) })
37
- ] });
38
- }
39
- export {
40
- Qwant as default
41
- };
@@ -1 +0,0 @@
1
- export declare function QwantContainer(): import("react/jsx-runtime").JSX.Element;
@@ -1,10 +0,0 @@
1
- import { jsx } from "react/jsx-runtime";
2
- import Qwant from "./Qwant.js";
3
- function QwantContainer() {
4
- return /* @__PURE__ */ jsx(Qwant, { handleActionClick: () => {
5
- window.open("https://www.qwant.com", "_blank", "noopener,noreferrer");
6
- } });
7
- }
8
- export {
9
- QwantContainer
10
- };
@@ -1,3 +0,0 @@
1
- export * from './Qwant';
2
- export { default as Qwant } from './Qwant';
3
- export * from './QwantContainer';
@@ -1,11 +0,0 @@
1
- import { RssArticle, RssArticlesStatus, RssFeed } from './types';
2
- export interface RssProps {
3
- feeds: RssFeed[];
4
- isLoading?: boolean;
5
- selectedIndex: number;
6
- onSelectFeed: (index: number) => void;
7
- articles: RssArticle[];
8
- articlesStatus: RssArticlesStatus;
9
- onEditClick: () => void;
10
- }
11
- export declare function Rss({ feeds, isLoading, selectedIndex, onSelectFeed, articles, articlesStatus, onEditClick, }: RssProps): import("react/jsx-runtime").JSX.Element;
@@ -1,64 +0,0 @@
1
- import { jsxs, jsx } from "react/jsx-runtime";
2
- import clsx from "clsx";
3
- import { useTranslation } from "react-i18next";
4
- import illuEmptyArticles from "@edifice.io/bootstrap/dist/images/homepage/illu-rss-empty-articles.svg";
5
- import illuError from "@edifice.io/bootstrap/dist/images/homepage/illu-rss-error.svg";
6
- import illuEmptyFeeds from "@edifice.io/bootstrap/dist/images/homepage/illu-empty-useful-links.png";
7
- import SvgIconEdit from "../../../icons/components/IconEdit.js";
8
- import SvgIconPlus from "../../../icons/components/IconPlus.js";
9
- import { htmlToText } from "./utils.js";
10
- import useDate from "../../../../hooks/useDate/useDate.js";
11
- import HomeCard from "../HomeCard/HomeCard.js";
12
- import ButtonBeta from "../../../../components/ButtonBeta/ButtonBeta.js";
13
- import Image from "../../../../components/Image/Image.js";
14
- import TextSkeleton from "../../../../components/Skeleton/TextSkeleton.js";
15
- const SKELETON_ARTICLES = [0, 1, 2];
16
- function Rss({
17
- feeds,
18
- isLoading = !1,
19
- selectedIndex,
20
- onSelectFeed,
21
- articles,
22
- articlesStatus,
23
- onEditClick
24
- }) {
25
- const {
26
- t
27
- } = useTranslation(), {
28
- formatDate
29
- } = useDate(), hasFeeds = feeds.length > 0, renderArticles = (status) => status === "loading" ? /* @__PURE__ */ jsx("div", { className: "rss-widget__articles", "data-testid": "rss-skeleton", children: SKELETON_ARTICLES.map((key) => /* @__PURE__ */ jsxs("div", { className: "rss-widget__article", "aria-hidden": "true", children: [
30
- /* @__PURE__ */ jsx(TextSkeleton, { className: "rss-widget__skeleton-title" }),
31
- /* @__PURE__ */ jsx(TextSkeleton, { size: "xs", className: "rss-widget__skeleton-date" }),
32
- /* @__PURE__ */ jsx(TextSkeleton, { size: "sm" }),
33
- /* @__PURE__ */ jsx(TextSkeleton, { size: "sm" })
34
- ] }, key)) }) : status === "error" ? /* @__PURE__ */ jsxs("div", { className: "rss-widget__state", children: [
35
- /* @__PURE__ */ jsx("div", { className: "rss-widget__state-illustration", children: /* @__PURE__ */ jsx(Image, { src: illuError, alt: "", "aria-hidden": "true", className: "rss-widget__error-image" }) }),
36
- /* @__PURE__ */ jsx("p", { className: "rss-widget__state-text", children: t("homepage.widget.rss.error") })
37
- ] }) : articles.length === 0 ? /* @__PURE__ */ jsxs("div", { className: "rss-widget__state", children: [
38
- /* @__PURE__ */ jsx(Image, { src: illuEmptyArticles, alt: "", "aria-hidden": "true", className: "rss-widget__empty-articles-image" }),
39
- /* @__PURE__ */ jsx("p", { className: "rss-widget__state-text", children: t("homepage.widget.rss.noArticles") })
40
- ] }) : /* @__PURE__ */ jsx("div", { className: "rss-widget__articles", children: articles.map((article, index) => /* @__PURE__ */ jsxs("a", { href: article.link, target: "_blank", rel: "noopener noreferrer", className: "rss-widget__article", "data-testid": `rss-link-article-${index}`, children: [
41
- /* @__PURE__ */ jsx("span", { className: "rss-widget__article-title", children: article.title }),
42
- article.pubDate && /* @__PURE__ */ jsx("span", { className: "rss-widget__article-date", children: formatDate(new Date(article.pubDate), "dddd D MMMM YYYY") }),
43
- article.description && /* @__PURE__ */ jsx("span", { className: "rss-widget__article-description", children: htmlToText(article.description) })
44
- ] }, `${article.link}-${index}`)) });
45
- return /* @__PURE__ */ jsxs(HomeCard, { variant: "primary", children: [
46
- /* @__PURE__ */ jsxs("div", { className: "rss-widget__header", children: [
47
- /* @__PURE__ */ jsx("h3", { className: "rss-widget__title", children: t("homepage.widget.rss.title") }),
48
- !isLoading && (hasFeeds ? /* @__PURE__ */ jsx(ButtonBeta, { type: "button", variant: "ghost", color: "tertiary", leftIcon: /* @__PURE__ */ jsx(SvgIconEdit, {}), "aria-label": t("homepage.widget.rss.edit"), "data-testid": "rss-button-edit", onClick: onEditClick }) : /* @__PURE__ */ jsx(ButtonBeta, { type: "button", variant: "ghost", color: "tertiary", size: "sm", rightIcon: /* @__PURE__ */ jsx(SvgIconPlus, {}), "data-testid": "rss-button-add", onClick: onEditClick, children: t("homepage.widget.rss.add") }))
49
- ] }),
50
- /* @__PURE__ */ jsx(HomeCard.Content, { children: /* @__PURE__ */ jsxs("div", { className: "rss-widget", children: [
51
- !isLoading && !hasFeeds && /* @__PURE__ */ jsxs("div", { className: "rss-widget__empty", children: [
52
- /* @__PURE__ */ jsx(Image, { src: illuEmptyFeeds, alt: "", "aria-hidden": "true", className: "rss-widget__empty-image" }),
53
- /* @__PURE__ */ jsx("p", { className: "rss-widget__state-text", children: t("homepage.widget.rss.empty") })
54
- ] }),
55
- !isLoading && hasFeeds && /* @__PURE__ */ jsx("div", { className: "rss-widget__feeds", role: "group", "aria-label": t("homepage.widget.rss.feeds"), children: feeds.map((feed, index) => /* @__PURE__ */ jsx("button", { type: "button", className: clsx("rss-widget__chip", {
56
- "rss-widget__chip-active": index === selectedIndex
57
- }), "aria-pressed": index === selectedIndex, "data-testid": `rss-button-feed-${index}`, onClick: () => onSelectFeed(index), children: feed.title }, `${feed.link}-${index}`)) }),
58
- (isLoading || hasFeeds) && renderArticles(isLoading ? "loading" : articlesStatus)
59
- ] }) })
60
- ] });
61
- }
62
- export {
63
- Rss
64
- };
@@ -1 +0,0 @@
1
- export declare function RssContainer(): import("react/jsx-runtime").JSX.Element;
@@ -1,45 +0,0 @@
1
- import { jsxs, Fragment, jsx } from "react/jsx-runtime";
2
- import { useState } from "react";
3
- import { useRssContainer } from "./hooks/useRssContainer.js";
4
- import { Rss } from "./Rss.js";
5
- import { RssFeedForm } from "./RssFeedForm.js";
6
- import { RssFeedsModal } from "./RssFeedsModal.js";
7
- function RssContainer() {
8
- const [view, setView] = useState({
9
- name: "closed"
10
- }), {
11
- feeds,
12
- isLoading,
13
- canAddFeed,
14
- selectedIndex,
15
- selectFeed,
16
- articles,
17
- articlesStatus,
18
- addFeed,
19
- updateFeed,
20
- deleteFeed,
21
- isSaving
22
- } = useRssContainer(), closeAll = () => setView({
23
- name: "closed"
24
- }), backToManage = () => setView({
25
- name: "manage"
26
- }), handleSubmit = (payload) => {
27
- view.name === "edit" ? updateFeed(view.index, payload, backToManage) : addFeed(payload, backToManage);
28
- };
29
- return /* @__PURE__ */ jsxs(Fragment, { children: [
30
- /* @__PURE__ */ jsx(Rss, { feeds, isLoading, selectedIndex, onSelectFeed: selectFeed, articles, articlesStatus, onEditClick: () => setView({
31
- name: "manage"
32
- }) }),
33
- /* @__PURE__ */ jsx(RssFeedsModal, { isOpen: view.name === "manage", feeds, canAddFeed, onClose: closeAll, onAddClick: () => setView({
34
- name: "add"
35
- }), onEditFeed: (index) => setView({
36
- name: "edit",
37
- index,
38
- feed: feeds[index]
39
- }), onDeleteFeed: deleteFeed }),
40
- (view.name === "add" || view.name === "edit") && /* @__PURE__ */ jsx(RssFeedForm, { mode: view.name, feed: view.name === "edit" ? view.feed : void 0, isSubmitting: isSaving, onCancel: backToManage, onClose: closeAll, onSubmit: handleSubmit })
41
- ] });
42
- }
43
- export {
44
- RssContainer
45
- };
@@ -1,13 +0,0 @@
1
- import { RssFeed, RssFeedPayload } from './types';
2
- export interface RssFeedFormProps {
3
- mode: 'add' | 'edit';
4
- /** Feed being edited. Ignored in "add" mode. */
5
- feed?: RssFeed;
6
- isSubmitting: boolean;
7
- /** Closes the form and goes back to the management modal, without saving. */
8
- onCancel: () => void;
9
- /** Closes the whole modal stack. */
10
- onClose: () => void;
11
- onSubmit: (payload: RssFeedPayload) => void;
12
- }
13
- export declare function RssFeedForm({ mode, feed, isSubmitting, onCancel, onClose, onSubmit, }: RssFeedFormProps): import("react/jsx-runtime").JSX.Element;