@edifice.io/react 2.6.10-develop-b2school.20261021144055 → 2.6.10-develop-pedago.20261021184048

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 (143) hide show
  1. package/dist/components/Checkbox/Checkbox.js +1 -1
  2. package/dist/components/Layout/Layout.js +4 -12
  3. package/dist/components/Layout/components/Header.js +4 -4
  4. package/dist/components/Layout/components/NavLink.d.ts +3 -3
  5. package/dist/components/Layout/components/NavLink.js +3 -5
  6. package/dist/homepage.js +24 -74
  7. package/dist/hooks/useZendeskGuide/useZendeskGuide.d.ts +6 -2
  8. package/dist/hooks/useZendeskGuide/useZendeskGuide.js +8 -11
  9. package/dist/icons.js +402 -406
  10. package/dist/modules/HelpZone/HelpZone.js +8 -6
  11. package/dist/modules/HelpZone/HelpZoneContainer.js +5 -2
  12. package/dist/modules/homepage/components/Communities/Communities.js +4 -4
  13. package/dist/modules/homepage/components/Header/Header.js +22 -28
  14. package/dist/modules/homepage/components/HomeCard/HomeCardHeader.d.ts +1 -5
  15. package/dist/modules/homepage/components/HomeCard/HomeCardHeader.js +1 -1
  16. package/dist/modules/homepage/components/MessageFlashList/MessageFlash.js +1 -1
  17. package/dist/modules/homepage/components/Notifications/NotificationList.js +8 -7
  18. package/dist/modules/homepage/components/Notifications/NotificationListSkeleton.js +12 -7
  19. package/dist/modules/homepage/components/Notifications/NotificationSkeleton.js +4 -7
  20. package/dist/modules/homepage/components/Notifications/components/NotificationFilterMenu.js +5 -1
  21. package/dist/modules/homepage/components/Notifications/components/NotificationFilterModal.js +12 -10
  22. package/dist/modules/homepage/components/Notifications/components/NotificationOptionsMenu.js +9 -3
  23. package/dist/modules/homepage/components/Notifications/components/ReportNotificationModal.js +12 -6
  24. package/dist/modules/homepage/components/Notifications/components/notificationAdapter.js +10 -12
  25. package/dist/modules/homepage/components/Notifications/hooks/useNotificationList.js +10 -9
  26. package/dist/modules/homepage/components/SchoolSpace/SchoolSpaceContainer.js +1 -1
  27. package/dist/modules/homepage/{hooks → components/SchoolSpace}/useUserSchools.d.ts +2 -2
  28. package/dist/modules/homepage/{hooks → components/SchoolSpace}/useUserSchools.js +4 -4
  29. package/dist/modules/homepage/components/UsefulLinks/UsefulLinks.js +2 -2
  30. package/dist/modules/homepage/components/UsefulLinks/UsefulLinksModal.js +2 -2
  31. package/dist/modules/homepage/components/UserSpace/UserSpace.d.ts +1 -3
  32. package/dist/modules/homepage/components/UserSpace/UserSpace.js +7 -13
  33. package/dist/modules/homepage/components/UserSpace/UserSpaceContainer.d.ts +2 -4
  34. package/dist/modules/homepage/components/UserSpace/UserSpaceContainer.js +2 -3
  35. package/dist/modules/homepage/components/index.d.ts +1 -9
  36. package/dist/modules/icons/components/index.d.ts +0 -2
  37. package/dist/modules/multimedia/MediaLibrary/MediaLibrary.d.ts +2 -0
  38. package/dist/modules/multimedia/MediaLibrary/MediaLibrary.js +2 -0
  39. package/dist/modules/multimedia/MediaLibrary/MediaLibraryContext.d.ts +4 -0
  40. package/dist/modules/multimedia/MediaLibrary/innertabs/Upload.js +2 -1
  41. package/dist/modules/multimedia/MediaLibrary/innertabs/Workspace.js +3 -0
  42. package/package.json +6 -6
  43. package/dist/modules/homepage/components/Agenda/Agenda.d.ts +0 -10
  44. package/dist/modules/homepage/components/Agenda/Agenda.js +0 -54
  45. package/dist/modules/homepage/components/Agenda/AgendaContainer.d.ts +0 -1
  46. package/dist/modules/homepage/components/Agenda/AgendaContainer.js +0 -14
  47. package/dist/modules/homepage/components/Agenda/AgendaEventCard.d.ts +0 -10
  48. package/dist/modules/homepage/components/Agenda/AgendaEventCard.js +0 -30
  49. package/dist/modules/homepage/components/Agenda/hooks/useAgendaContainer.d.ts +0 -14
  50. package/dist/modules/homepage/components/Agenda/hooks/useAgendaContainer.js +0 -27
  51. package/dist/modules/homepage/components/Agenda/index.d.ts +0 -3
  52. package/dist/modules/homepage/components/Agenda/services/api/agendaService.d.ts +0 -24
  53. package/dist/modules/homepage/components/Agenda/services/api/agendaService.js +0 -45
  54. package/dist/modules/homepage/components/Agenda/services/api/index.d.ts +0 -4
  55. package/dist/modules/homepage/components/Agenda/services/api/index.js +0 -5
  56. package/dist/modules/homepage/components/Agenda/services/queries/agenda.d.ts +0 -19
  57. package/dist/modules/homepage/components/Agenda/services/queries/agenda.js +0 -26
  58. package/dist/modules/homepage/components/BriefMe/BriefMe.d.ts +0 -9
  59. package/dist/modules/homepage/components/BriefMe/BriefMe.js +0 -59
  60. package/dist/modules/homepage/components/BriefMe/BriefMeContainer.d.ts +0 -4
  61. package/dist/modules/homepage/components/BriefMe/BriefMeContainer.js +0 -17
  62. package/dist/modules/homepage/components/BriefMe/index.d.ts +0 -4
  63. package/dist/modules/homepage/components/BriefMe/types.d.ts +0 -17
  64. package/dist/modules/homepage/components/BriefMe/types.js +0 -8
  65. package/dist/modules/homepage/components/BriefMe/useBriefMe.d.ts +0 -31
  66. package/dist/modules/homepage/components/BriefMe/useBriefMe.js +0 -51
  67. package/dist/modules/homepage/components/Cantine/Cantine.d.ts +0 -7
  68. package/dist/modules/homepage/components/Cantine/Cantine.js +0 -44
  69. package/dist/modules/homepage/components/Cantine/CantineContainer.d.ts +0 -4
  70. package/dist/modules/homepage/components/Cantine/CantineContainer.js +0 -18
  71. package/dist/modules/homepage/components/Cantine/CantineModal.d.ts +0 -24
  72. package/dist/modules/homepage/components/Cantine/CantineModal.js +0 -88
  73. package/dist/modules/homepage/components/Cantine/CantineModalContainer.d.ts +0 -7
  74. package/dist/modules/homepage/components/Cantine/CantineModalContainer.js +0 -12
  75. package/dist/modules/homepage/components/Cantine/components/CantineLegend.d.ts +0 -5
  76. package/dist/modules/homepage/components/Cantine/components/CantineLegend.js +0 -22
  77. package/dist/modules/homepage/components/Cantine/components/CantineMenuSection.d.ts +0 -6
  78. package/dist/modules/homepage/components/Cantine/components/CantineMenuSection.js +0 -28
  79. package/dist/modules/homepage/components/Cantine/components/cantineLabels.d.ts +0 -12
  80. package/dist/modules/homepage/components/Cantine/components/cantineLabels.js +0 -60
  81. package/dist/modules/homepage/components/Cantine/hooks/useCantine.d.ts +0 -11
  82. package/dist/modules/homepage/components/Cantine/hooks/useCantine.js +0 -20
  83. package/dist/modules/homepage/components/Cantine/hooks/useCantineMenu.d.ts +0 -24
  84. package/dist/modules/homepage/components/Cantine/hooks/useCantineMenu.js +0 -65
  85. package/dist/modules/homepage/components/Cantine/hooks/useCantineModal.d.ts +0 -23
  86. package/dist/modules/homepage/components/Cantine/hooks/useCantineModal.js +0 -43
  87. package/dist/modules/homepage/components/Cantine/index.d.ts +0 -7
  88. package/dist/modules/homepage/components/Cantine/types.d.ts +0 -42
  89. package/dist/modules/homepage/components/GenerationHdf/GenerationHdf.d.ts +0 -16
  90. package/dist/modules/homepage/components/GenerationHdf/GenerationHdf.js +0 -48
  91. package/dist/modules/homepage/components/GenerationHdf/GenerationHdfContainer.d.ts +0 -4
  92. package/dist/modules/homepage/components/GenerationHdf/GenerationHdfContainer.js +0 -12
  93. package/dist/modules/homepage/components/GenerationHdf/formatSolde.d.ts +0 -1
  94. package/dist/modules/homepage/components/GenerationHdf/formatSolde.js +0 -6
  95. package/dist/modules/homepage/components/GenerationHdf/index.d.ts +0 -3
  96. package/dist/modules/homepage/components/GenerationHdf/useGenerationHdf.d.ts +0 -10
  97. package/dist/modules/homepage/components/GenerationHdf/useGenerationHdf.js +0 -68
  98. package/dist/modules/homepage/components/Header/AccountActionListPopover.d.ts +0 -13
  99. package/dist/modules/homepage/components/Header/AccountActionListPopover.js +0 -26
  100. package/dist/modules/homepage/components/Header/ActionItem.d.ts +0 -38
  101. package/dist/modules/homepage/components/Header/ActionItem.js +0 -34
  102. package/dist/modules/homepage/components/Header/MyAppsPopover.d.ts +0 -5
  103. package/dist/modules/homepage/components/Header/MyAppsPopover.js +0 -28
  104. package/dist/modules/homepage/components/Header/useSafeHoverPopover.js +0 -32
  105. package/dist/modules/homepage/components/Qwant/Qwant.d.ts +0 -4
  106. package/dist/modules/homepage/components/Qwant/Qwant.js +0 -41
  107. package/dist/modules/homepage/components/Qwant/QwantContainer.d.ts +0 -1
  108. package/dist/modules/homepage/components/Qwant/QwantContainer.js +0 -10
  109. package/dist/modules/homepage/components/Qwant/index.d.ts +0 -3
  110. package/dist/modules/homepage/components/Rss/Rss.d.ts +0 -11
  111. package/dist/modules/homepage/components/Rss/Rss.js +0 -64
  112. package/dist/modules/homepage/components/Rss/RssContainer.d.ts +0 -1
  113. package/dist/modules/homepage/components/Rss/RssContainer.js +0 -45
  114. package/dist/modules/homepage/components/Rss/RssFeedForm.d.ts +0 -13
  115. package/dist/modules/homepage/components/Rss/RssFeedForm.js +0 -69
  116. package/dist/modules/homepage/components/Rss/RssFeedsModal.d.ts +0 -11
  117. package/dist/modules/homepage/components/Rss/RssFeedsModal.js +0 -58
  118. package/dist/modules/homepage/components/Rss/hooks/useRssContainer.d.ts +0 -25
  119. package/dist/modules/homepage/components/Rss/hooks/useRssContainer.js +0 -43
  120. package/dist/modules/homepage/components/Rss/index.d.ts +0 -6
  121. package/dist/modules/homepage/components/Rss/services/api/index.d.ts +0 -5
  122. package/dist/modules/homepage/components/Rss/services/api/index.js +0 -5
  123. package/dist/modules/homepage/components/Rss/services/api/rssService.d.ts +0 -38
  124. package/dist/modules/homepage/components/Rss/services/api/rssService.js +0 -51
  125. package/dist/modules/homepage/components/Rss/services/queries/rss.d.ts +0 -28
  126. package/dist/modules/homepage/components/Rss/services/queries/rss.js +0 -71
  127. package/dist/modules/homepage/components/Rss/types.d.ts +0 -25
  128. package/dist/modules/homepage/components/Rss/utils.d.ts +0 -7
  129. package/dist/modules/homepage/components/Rss/utils.js +0 -19
  130. package/dist/modules/homepage/components/Universalis/Universalis.d.ts +0 -8
  131. package/dist/modules/homepage/components/Universalis/Universalis.js +0 -62
  132. package/dist/modules/homepage/components/Universalis/UniversalisContainer.d.ts +0 -1
  133. package/dist/modules/homepage/components/Universalis/UniversalisContainer.js +0 -16
  134. package/dist/modules/homepage/components/Universalis/index.d.ts +0 -3
  135. package/dist/modules/homepage/components/WidgetsPersonalizationPanel/WidgetToggle.d.ts +0 -16
  136. package/dist/modules/homepage/components/WidgetsPersonalizationPanel/WidgetToggle.js +0 -15
  137. package/dist/modules/homepage/components/WidgetsPersonalizationPanel/WidgetsPersonalizationPanel.d.ts +0 -21
  138. package/dist/modules/homepage/components/WidgetsPersonalizationPanel/WidgetsPersonalizationPanel.js +0 -47
  139. package/dist/modules/homepage/components/WidgetsPersonalizationPanel/index.d.ts +0 -2
  140. package/dist/modules/icons/components/IconAddWidget.d.ts +0 -7
  141. package/dist/modules/icons/components/IconAddWidget.js +0 -12
  142. package/dist/modules/icons/components/IconLogout.d.ts +0 -7
  143. package/dist/modules/icons/components/IconLogout.js +0 -13
@@ -1,65 +0,0 @@
1
- import { odeServices } from "@edifice.io/client";
2
- import { useQuery, queryOptions } from "@tanstack/react-query";
3
- import { useMemo } from "react";
4
- const CANTINE_CATEGORIES = ["entree", "plat", "accompagnement", "laitage", "dessert"];
5
- function getAllergens(item) {
6
- return Object.keys(item).filter((key) => key.startsWith("allerg_") && item[key] !== 0 && item[key] !== void 0).map((key) => key.slice(7).replace(/_/g, " "));
7
- }
8
- function normalizeDish(item, index) {
9
- var _a;
10
- const designation = (_a = item.designationMenu) == null ? void 0 : _a.trim();
11
- return {
12
- id: `${item.type}-${index}`,
13
- label: designation || item.nom,
14
- vegetarien: !!item.vegetarien,
15
- faitmaison: !!item.faitmaison,
16
- bio: !!item.bio,
17
- local: !!item.local,
18
- allergens: getAllergens(item)
19
- };
20
- }
21
- function buildSections(menu) {
22
- return CANTINE_CATEGORIES.map((category) => ({
23
- category,
24
- items: menu.filter((item) => item.type === category).map((item, index) => normalizeDish(item, index))
25
- })).filter((section) => section.items.length > 0);
26
- }
27
- function cantineMenuQueryOptions(uai, date) {
28
- return queryOptions({
29
- queryKey: ["cantine", uai, date],
30
- enabled: !!uai,
31
- // The menu is keyed by day and proxied from a slow upstream service, so
32
- // this caches it for 5 minutes instead of refetching on every remount.
33
- staleTime: 5 * 60 * 1e3,
34
- // 5 minutes
35
- queryFn: async () => {
36
- const http = odeServices.http(), body = await http.get(`/appregistry/${encodeURIComponent(uai)}/cantine/menu?date=${date}`);
37
- if (http.isResponseError())
38
- throw new Error(http.latestResponse.statusText);
39
- const lunch = Array.isArray(body == null ? void 0 : body.menu) ? body.menu : [], dinner = Array.isArray(body == null ? void 0 : body.dinnerMenu) ? body.dinnerMenu : [];
40
- return {
41
- lunch,
42
- dinner,
43
- dinnerAvailable: (body == null ? void 0 : body.dinnerAvailable) === !0 && dinner.length > 0
44
- };
45
- }
46
- });
47
- }
48
- function useCantineMenu(uai, date, requestedMenuType = "lunch") {
49
- const {
50
- data,
51
- isPending,
52
- error
53
- } = useQuery(cantineMenuQueryOptions(uai, date)), dinnerAvailable = (data == null ? void 0 : data.dinnerAvailable) === !0, menuType = requestedMenuType === "dinner" && dinnerAvailable ? "dinner" : "lunch", sections = useMemo(() => buildSections((menuType === "lunch" ? data == null ? void 0 : data.lunch : data == null ? void 0 : data.dinner) ?? []), [data, menuType]);
54
- return {
55
- sections,
56
- dinnerAvailable,
57
- menuType,
58
- status: error ? "error" : !uai || isPending ? "loading" : sections.length > 0 ? "default" : "empty"
59
- };
60
- }
61
- export {
62
- buildSections,
63
- cantineMenuQueryOptions,
64
- useCantineMenu
65
- };
@@ -1,23 +0,0 @@
1
- import { CantineMenuType } from '../types';
2
- /**
3
- * Browsing state of the full-screen canteen modal: day, school and service.
4
- *
5
- * The school picked here stays local to the modal on purpose: it must not
6
- * change the school shared with the other homepage widgets (see
7
- * `useUserSchools`), only the menu being read.
8
- */
9
- export declare function useCantineModal(): {
10
- schools: import('@edifice.io/client').School[];
11
- selectedSchool: import('@edifice.io/client').School | undefined;
12
- onSchoolChange: import('react').Dispatch<import('react').SetStateAction<string | undefined>>;
13
- hasDinner: boolean;
14
- menuType: CantineMenuType;
15
- onMenuTypeChange: import('react').Dispatch<import('react').SetStateAction<CantineMenuType>>;
16
- date: string;
17
- canGoPrevious: boolean;
18
- canGoNext: boolean;
19
- onPreviousDay: () => void;
20
- onNextDay: () => void;
21
- sections: import('..').CantineSection[];
22
- status: import('..').CantineStatus;
23
- };
@@ -1,43 +0,0 @@
1
- import { useState, useMemo } from "react";
2
- import { useUserSchools } from "../../../hooks/useUserSchools.js";
3
- import { useCantineMenu } from "./useCantineMenu.js";
4
- import useDate from "../../../../../hooks/useDate/useDate.js";
5
- const DATE_RANGE_IN_DAYS = 40, DATE_FORMAT = "YYYY-MM-DD", addDays = (date, days) => {
6
- const shifted = new Date(date);
7
- return shifted.setDate(shifted.getDate() + days), shifted;
8
- };
9
- function useCantineModal() {
10
- const {
11
- schools,
12
- selectedSchool: defaultSchool
13
- } = useUserSchools(), {
14
- formatDate
15
- } = useDate(), [schoolId, setSchoolId] = useState(), [menuType, setMenuType] = useState("lunch"), [date, setDate] = useState(() => formatDate(/* @__PURE__ */ new Date(), DATE_FORMAT)), {
16
- minDate,
17
- maxDate
18
- } = useMemo(() => {
19
- const today = /* @__PURE__ */ new Date();
20
- return {
21
- minDate: formatDate(addDays(today, -DATE_RANGE_IN_DAYS), DATE_FORMAT),
22
- maxDate: formatDate(addDays(today, DATE_RANGE_IN_DAYS), DATE_FORMAT)
23
- };
24
- }, [formatDate]), selectedSchool = schools.find((school) => school.id === schoolId) ?? defaultSchool, menu = useCantineMenu((selectedSchool == null ? void 0 : selectedSchool.UAI) ?? "", date, menuType), shiftDate = (days) => setDate((current) => formatDate(addDays(/* @__PURE__ */ new Date(`${current}T00:00:00`), days), DATE_FORMAT));
25
- return {
26
- schools,
27
- selectedSchool,
28
- onSchoolChange: setSchoolId,
29
- hasDinner: menu.dinnerAvailable,
30
- menuType: menu.menuType,
31
- onMenuTypeChange: setMenuType,
32
- date,
33
- canGoPrevious: date > minDate,
34
- canGoNext: date < maxDate,
35
- onPreviousDay: () => shiftDate(-1),
36
- onNextDay: () => shiftDate(1),
37
- sections: menu.sections,
38
- status: menu.status
39
- };
40
- }
41
- export {
42
- useCantineModal
43
- };
@@ -1,7 +0,0 @@
1
- export * from './Cantine';
2
- export { default as Cantine } from './Cantine';
3
- export * from './CantineContainer';
4
- export * from './CantineModal';
5
- export { default as CantineModal } from './CantineModal';
6
- export * from './CantineModalContainer';
7
- export type { CantineCategory, CantineDish, CantineMenuType, CantineSection, CantineStatus, } from './types';
@@ -1,42 +0,0 @@
1
- export type CantineCategory = 'entree' | 'plat' | 'accompagnement' | 'laitage' | 'dessert';
2
- /**
3
- * Raw dish shape returned by the Webgerest upstream API, forwarded unmapped by
4
- * app-registry. Everything besides `type` and `nom` is effectively optional.
5
- */
6
- export interface CantineMenuItem {
7
- type: string;
8
- nom: string;
9
- designationMenu?: string;
10
- vegetarien?: boolean;
11
- faitmaison?: boolean;
12
- bio?: boolean;
13
- local?: boolean;
14
- [key: string]: unknown;
15
- }
16
- export interface CantineMenuResponse {
17
- menu?: CantineMenuItem[];
18
- dinnerAvailable?: boolean;
19
- dinnerMenu?: CantineMenuItem[];
20
- }
21
- export interface CantineDish {
22
- id: string;
23
- label: string;
24
- vegetarien: boolean;
25
- faitmaison: boolean;
26
- bio: boolean;
27
- local: boolean;
28
- allergens: string[];
29
- }
30
- export interface CantineSection {
31
- category: CantineCategory;
32
- items: CantineDish[];
33
- }
34
- /** Both services of a given day, as exposed by app-registry. */
35
- export interface CantineMenus {
36
- lunch: CantineMenuItem[];
37
- dinner: CantineMenuItem[];
38
- /** True when the school also serves a dinner menu that day. */
39
- dinnerAvailable: boolean;
40
- }
41
- export type CantineStatus = 'loading' | 'default' | 'empty' | 'error';
42
- export type CantineMenuType = 'lunch' | 'dinner';
@@ -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,48 +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(Input, { size: "md", type: "text", inputMode: "numeric", placeholder: t("homepage.widget.generation-hdf.placeholder"), value: cardNumber, onChange: (event) => onCardNumberChange(event.target.value), disabled: isAccount, maxLength: 50 }),
39
- isError && /* @__PURE__ */ jsx(FormControl.Text, { children: t("homepage.widget.generation-hdf.error") })
40
- ] }),
41
- 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") })
42
- ] })
43
- ] }) })
44
- ] });
45
- }
46
- export {
47
- GenerationHdf as default
48
- };
@@ -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,68 +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
- if (autoLoadTriggered.current || !preferenceQuery.data) return;
42
- autoLoadTriggered.current = !0;
43
- const storedCardNb = preferenceQuery.data.cardNb;
44
- storedCardNb && (setCardNumber(storedCardNb), salesMutation.mutate({
45
- cardNb: storedCardNb,
46
- persist: !1
47
- }));
48
- }, [preferenceQuery.data, salesMutation]);
49
- const status = preferenceQuery.data ? salesMutation.isPending ? "loading" : salesMutation.isError ? "error" : salesMutation.isSuccess ? "account" : "idle" : "loading", wallets = salesMutation.data ? mapSalesToWallets(salesMutation.data) : [];
50
- return {
51
- status,
52
- cardNumber,
53
- onCardNumberChange: setCardNumber,
54
- onSubmit: (event) => {
55
- event.preventDefault(), !salesMutation.isPending && salesMutation.mutate({
56
- cardNb: cardNumber,
57
- persist: !0
58
- });
59
- },
60
- onEdit: () => {
61
- odeServices.conf().savePreference(USER_PREFS.CURSUS, {}), setCardNumber(""), salesMutation.reset();
62
- },
63
- wallets
64
- };
65
- }
66
- export {
67
- useGenerationHdf
68
- };
@@ -1,13 +0,0 @@
1
- import { PopoverProps } from '../../../../components';
2
- export interface AccountActionListPopoverProps extends Omit<PopoverProps, 'children'> {
3
- /**
4
- * Callback appended to the logout URL (from the theme configuration)
5
- */
6
- logoutCallback?: string;
7
- }
8
- /**
9
- * "Mon compte" popover of the Header v2: a white box listing the account
10
- * actions (my account, customize, logout).
11
- */
12
- export declare const AccountActionListPopover: import('react').ForwardRefExoticComponent<AccountActionListPopoverProps & import('react').RefAttributes<HTMLDivElement>>;
13
- export default AccountActionListPopover;
@@ -1,26 +0,0 @@
1
- import { jsx, jsxs } from "react/jsx-runtime";
2
- import { forwardRef } from "react";
3
- import clsx from "clsx";
4
- import { useTranslation } from "react-i18next";
5
- import SvgIconLogout from "../../../icons/components/IconLogout.js";
6
- import SvgIconSetBackground from "../../../icons/components/IconSetBackground.js";
7
- import SvgIconUser from "../../../icons/components/IconUser.js";
8
- import { ActionItem } from "./ActionItem.js";
9
- import { Popover, PopoverBody } from "../../../../components/Popover/Popover.js";
10
- const AccountActionListPopover = /* @__PURE__ */ forwardRef(({
11
- className,
12
- logoutCallback,
13
- ...restProps
14
- }, ref) => {
15
- const {
16
- t
17
- } = useTranslation();
18
- return /* @__PURE__ */ jsx(Popover, { ref, className: clsx("account-action-list-popover", className), ...restProps, children: /* @__PURE__ */ jsx(PopoverBody, { children: /* @__PURE__ */ jsxs("ul", { className: "account-action-list-popover__list", children: [
19
- /* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsx(ActionItem, { href: "/userbook/mon-compte", icon: /* @__PURE__ */ jsx(SvgIconUser, {}), "data-testid": "header-my-account-button", children: t("navbar.myaccount") }) }),
20
- /* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsx(ActionItem, { href: "/timeline/customize?callback=" + encodeURIComponent(`${window.location.pathname}${window.location.search}`), icon: /* @__PURE__ */ jsx(SvgIconSetBackground, {}), "data-testid": "header-customize-button", children: t("navbar.customize") }) }),
21
- /* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsx(ActionItem, { href: "/auth/logout?callback=" + (logoutCallback ?? ""), icon: /* @__PURE__ */ jsx(SvgIconLogout, {}), variant: "destructive", "data-testid": "header-logout-button", children: t("navbar.disconnect") }) })
22
- ] }) }) });
23
- });
24
- export {
25
- AccountActionListPopover
26
- };
@@ -1,38 +0,0 @@
1
- import { ComponentPropsWithoutRef, ReactNode } from 'react';
2
- /**
3
- * Action row (icon + label), used in the Header v2 account popover.
4
- * Rendered as a link when `href` is set (navigation), otherwise as a button
5
- * (e.g. opening a modal or triggering an in-page action).
6
- *
7
- * Context-free on purpose (no Dropdown context, no `.dropdown-item` styles):
8
- * it is meant to be reused as the item primitive when the Dropdown component
9
- * is redesigned (see ENABLING-882). The ref is forwarded to the underlying
10
- * element so a parent menu can manage focus.
11
- */
12
- interface ActionItemBaseProps {
13
- /**
14
- * Icon displayed before the label (hidden from assistive technologies)
15
- */
16
- icon?: ReactNode;
17
- /**
18
- * Label
19
- */
20
- children: ReactNode;
21
- /**
22
- * `destructive` for destructive actions (e.g. logout)
23
- */
24
- variant?: 'default' | 'destructive';
25
- className?: string;
26
- }
27
- type ActionItemLinkProps = ActionItemBaseProps & Omit<ComponentPropsWithoutRef<'a'>, keyof ActionItemBaseProps> & {
28
- /**
29
- * Link target: renders the item as a link
30
- */
31
- href: string;
32
- };
33
- type ActionItemButtonProps = ActionItemBaseProps & Omit<ComponentPropsWithoutRef<'button'>, keyof ActionItemBaseProps> & {
34
- href?: never;
35
- };
36
- export type ActionItemProps = ActionItemLinkProps | ActionItemButtonProps;
37
- export declare const ActionItem: import('react').ForwardRefExoticComponent<ActionItemProps & import('react').RefAttributes<HTMLButtonElement | HTMLAnchorElement>>;
38
- export default ActionItem;
@@ -1,34 +0,0 @@
1
- import { jsx, jsxs, Fragment } from "react/jsx-runtime";
2
- import { forwardRef } from "react";
3
- import clsx from "clsx";
4
- const isLinkProps = (props) => props.href !== void 0, getClasses = (variant, className) => clsx("action-item", {
5
- "action-item--destructive": variant === "destructive"
6
- }, className), ActionItemContent = ({
7
- icon,
8
- children
9
- }) => /* @__PURE__ */ jsxs(Fragment, { children: [
10
- icon && /* @__PURE__ */ jsx("span", { className: "action-item__icon", "aria-hidden": "true", children: icon }),
11
- /* @__PURE__ */ jsx("span", { className: "action-item__label", children })
12
- ] }), ActionItem = /* @__PURE__ */ forwardRef((props, ref) => {
13
- if (isLinkProps(props)) {
14
- const {
15
- icon: icon2,
16
- children: children2,
17
- variant: variant2 = "default",
18
- className: className2,
19
- ...rest2
20
- } = props;
21
- return /* @__PURE__ */ jsx("a", { ref, className: getClasses(variant2, className2), ...rest2, children: /* @__PURE__ */ jsx(ActionItemContent, { icon: icon2, children: children2 }) });
22
- }
23
- const {
24
- icon,
25
- children,
26
- variant = "default",
27
- className,
28
- ...rest
29
- } = props;
30
- return /* @__PURE__ */ jsx("button", { ref, type: "button", className: getClasses(variant, className), ...rest, children: /* @__PURE__ */ jsx(ActionItemContent, { icon, children }) });
31
- });
32
- export {
33
- ActionItem
34
- };
@@ -1,5 +0,0 @@
1
- import { IWebApp } from '@edifice.io/client';
2
- export declare const MyAppsPopoverFooter: () => import("react/jsx-runtime").JSX.Element;
3
- export declare const MyAppsPopoverBody: ({ bookmarkedApps, }: {
4
- bookmarkedApps: IWebApp[] | undefined;
5
- }) => import("react/jsx-runtime").JSX.Element;
@@ -1,28 +0,0 @@
1
- import { jsxs, jsx } from "react/jsx-runtime";
2
- import { useTranslation } from "react-i18next";
3
- import illuEmptyFavorite from "@edifice.io/bootstrap/dist/images/homepage/illu-empty-favorite.svg";
4
- import Flex from "../../../../components/Flex/Flex.js";
5
- import AppIcon from "../../../../components/AppIcon/AppIcon.js";
6
- const MAX_VISIBLE_APPS = 10, appToOpenOnBlank = ["Administration"], MyAppsPopoverFooter = () => {
7
- const {
8
- t
9
- } = useTranslation();
10
- return /* @__PURE__ */ jsx("a", { href: "/welcome", className: "btn-beta btn-beta-tertiary btn-beta--ghost btn-beta--small", "data-testid": "header-my-apps-popover-more", children: /* @__PURE__ */ jsx("span", { children: t("homepage.header.myapps.seeMore") }) });
11
- }, MyAppsPopoverBody = ({
12
- bookmarkedApps
13
- }) => {
14
- const {
15
- t
16
- } = useTranslation(), getAppName = (app) => app.prefix && app.prefix.length > 1 ? t(app.prefix.substring(1)) : t(app.displayName) || "";
17
- return bookmarkedApps != null && bookmarkedApps.length ? /* @__PURE__ */ jsx("div", { className: "my-apps-popover-grid", "data-testid": "header-my-apps-popover", children: bookmarkedApps.slice(0, MAX_VISIBLE_APPS).map((app, index) => {
18
- const opensInNewTab = appToOpenOnBlank.includes(app.name) || app.isExternal || app.target === "_blank", appName = getAppName(app);
19
- return /* @__PURE__ */ jsx("a", { href: app.address, title: appName, "aria-label": appName, className: "my-apps-popover-item", "data-testid": "header-my-apps-popover-item", target: opensInNewTab ? "_blank" : void 0, rel: opensInNewTab ? "noopener noreferrer" : void 0, children: /* @__PURE__ */ jsx(AppIcon, { app, size: "32" }) }, index);
20
- }) }) : /* @__PURE__ */ jsxs(Flex, { direction: "column", align: "center", gap: "8", children: [
21
- /* @__PURE__ */ jsx("img", { src: illuEmptyFavorite, alt: "", width: 50, height: 50 }),
22
- /* @__PURE__ */ jsx("span", { className: "my-apps-popover-empty-text text-center", children: t("homepage.header.myapps.empty") })
23
- ] });
24
- };
25
- export {
26
- MyAppsPopoverBody,
27
- MyAppsPopoverFooter
28
- };
@@ -1,32 +0,0 @@
1
- import { useState } from "react";
2
- import { useFloating, useHover, safePolygon, useClick, useDismiss, useFocus, useInteractions } from "@floating-ui/react";
3
- function useSafeHoverPopover({
4
- hoverEnabled = !0,
5
- clickEnabled = !1
6
- } = {}) {
7
- const [open, setOpen] = useState(!1), {
8
- refs,
9
- context
10
- } = useFloating({
11
- open,
12
- onOpenChange: setOpen
13
- }), hover = useHover(context, {
14
- enabled: hoverEnabled,
15
- handleClose: safePolygon()
16
- }), click = useClick(context, {
17
- enabled: clickEnabled
18
- }), dismiss = useDismiss(context), focus = useFocus(context), {
19
- getReferenceProps,
20
- getFloatingProps
21
- } = useInteractions([hover, click, dismiss, focus]);
22
- return {
23
- open,
24
- setReference: refs.setReference,
25
- setFloating: refs.setFloating,
26
- getReferenceProps,
27
- getFloatingProps
28
- };
29
- }
30
- export {
31
- useSafeHoverPopover
32
- };
@@ -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;