@edifice.io/react 2.6.10-develop-b2school.20261023141442 → 2.6.10-develop-pedago.20261023145636
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.
- package/dist/components/Checkbox/Checkbox.js +1 -1
- package/dist/components/Layout/Layout.js +4 -12
- package/dist/components/Layout/components/Header.js +4 -4
- package/dist/components/Layout/components/NavLink.d.ts +3 -3
- package/dist/components/Layout/components/NavLink.js +3 -5
- package/dist/editor.js +2 -0
- package/dist/homepage.js +24 -74
- package/dist/hooks/useZendeskGuide/useZendeskGuide.d.ts +6 -2
- package/dist/hooks/useZendeskGuide/useZendeskGuide.js +8 -11
- package/dist/icons.js +402 -406
- package/dist/modules/HelpZone/HelpZone.js +8 -6
- package/dist/modules/HelpZone/HelpZoneContainer.js +5 -2
- package/dist/modules/editor/components/BubbleMenuEditImage/BubbleMenuEditImage.js +110 -91
- package/dist/modules/editor/components/BubbleMenuEditInformationPane/BubbleMenuEditInformationPane.js +123 -96
- package/dist/modules/editor/components/Editor/Editor.d.ts +0 -5
- package/dist/modules/editor/components/Editor/Editor.js +0 -3
- package/dist/modules/editor/components/EditorToolbar/EditorToolbar.HighlightColor.js +5 -8
- package/dist/modules/editor/components/EditorToolbar/EditorToolbar.TextColor.js +5 -8
- package/dist/modules/editor/components/EditorToolbar/EditorToolbar.TextSize.js +7 -3
- package/dist/modules/editor/components/EditorToolbar/EditorToolbar.Typography.js +3 -2
- package/dist/modules/editor/components/EditorToolbar/EditorToolbar.js +6 -4
- package/dist/modules/editor/components/Toolbar/FloatingMenuOptions.d.ts +29 -0
- package/dist/modules/editor/components/Toolbar/FloatingMenuOptions.js +22 -0
- package/dist/modules/editor/components/Toolbar/LinkToolbar.d.ts +6 -3
- package/dist/modules/editor/components/Toolbar/LinkToolbar.js +29 -7
- package/dist/modules/editor/components/Toolbar/TableToolbar.CellColor.js +3 -2
- package/dist/modules/editor/components/Toolbar/TableToolbar.js +65 -45
- package/dist/modules/editor/hooks/index.d.ts +1 -0
- package/dist/modules/editor/hooks/useCommentEditor.d.ts +1 -1
- package/dist/modules/editor/hooks/useCommentEditor.js +12 -4
- package/dist/modules/editor/hooks/useEditorState.d.ts +20 -0
- package/dist/modules/editor/hooks/useEditorState.js +16 -0
- package/dist/modules/editor/hooks/useLinkToolbar.d.ts +2 -2
- package/dist/modules/editor/hooks/useLinkToolbar.js +2 -1
- package/dist/modules/editor/hooks/useTipTapEditor.d.ts +3 -3
- package/dist/modules/editor/hooks/useTipTapEditor.js +81 -24
- package/dist/modules/homepage/components/Communities/Communities.js +4 -4
- package/dist/modules/homepage/components/Header/Header.js +22 -28
- package/dist/modules/homepage/components/HomeCard/HomeCardHeader.d.ts +1 -5
- package/dist/modules/homepage/components/HomeCard/HomeCardHeader.js +1 -1
- package/dist/modules/homepage/components/MessageFlashList/MessageFlash.js +1 -1
- package/dist/modules/homepage/components/Notifications/NotificationList.js +8 -7
- package/dist/modules/homepage/components/Notifications/NotificationListSkeleton.js +12 -7
- package/dist/modules/homepage/components/Notifications/NotificationSkeleton.js +4 -7
- package/dist/modules/homepage/components/Notifications/components/NotificationFilterMenu.js +5 -1
- package/dist/modules/homepage/components/Notifications/components/NotificationFilterModal.js +12 -10
- package/dist/modules/homepage/components/Notifications/components/NotificationOptionsMenu.js +9 -3
- package/dist/modules/homepage/components/Notifications/components/ReportNotificationModal.js +12 -6
- package/dist/modules/homepage/components/Notifications/components/notificationAdapter.js +10 -12
- package/dist/modules/homepage/components/Notifications/hooks/useNotificationList.js +10 -9
- package/dist/modules/homepage/components/SchoolSpace/SchoolSpaceContainer.js +1 -1
- package/dist/modules/homepage/{hooks → components/SchoolSpace}/useUserSchools.d.ts +2 -2
- package/dist/modules/homepage/{hooks → components/SchoolSpace}/useUserSchools.js +4 -4
- package/dist/modules/homepage/components/UsefulLinks/UsefulLinks.js +2 -2
- package/dist/modules/homepage/components/UsefulLinks/UsefulLinksModal.js +2 -2
- package/dist/modules/homepage/components/UserSpace/UserSpace.d.ts +1 -3
- package/dist/modules/homepage/components/UserSpace/UserSpace.js +7 -13
- package/dist/modules/homepage/components/UserSpace/UserSpaceContainer.d.ts +2 -4
- package/dist/modules/homepage/components/UserSpace/UserSpaceContainer.js +2 -3
- package/dist/modules/homepage/components/index.d.ts +1 -9
- package/dist/modules/icons/components/index.d.ts +0 -2
- package/dist/modules/modals/ResourceModal/ResourceModal.js +16 -9
- package/dist/modules/modals/ResourceModal/apps/BlogPublic.js +9 -13
- package/dist/modules/multimedia/Linker/InternalLinker/InternalLinker.d.ts +7 -1
- package/dist/modules/multimedia/Linker/InternalLinker/InternalLinker.js +2 -0
- package/dist/modules/multimedia/MediaLibrary/MediaLibrary.d.ts +2 -0
- package/dist/modules/multimedia/MediaLibrary/MediaLibrary.js +2 -0
- package/dist/modules/multimedia/MediaLibrary/MediaLibraryContext.d.ts +4 -0
- package/dist/modules/multimedia/MediaLibrary/innertabs/Upload.js +2 -1
- package/dist/modules/multimedia/MediaLibrary/innertabs/Workspace.js +3 -0
- package/dist/node_modules/.pnpm/@tiptap_extension-floating-menu@3.32.0_@floating-ui_dom@1.6.0_@tiptap_core@3.32.0_@tiptap_pm@3.32.0__@tiptap_pm@3.32.0/node_modules/@tiptap/extension-floating-menu/dist/index.js +159 -0
- package/dist/node_modules/.pnpm/@tiptap_react@3.32.0_@floating-ui_dom@1.6.0_@tiptap_core@3.32.0_@tiptap_pm@3.32.0__@tiptap_pm_6inmb43gajy4fnlwtngbwkv7um/node_modules/@tiptap/react/dist/menus/index.js +341 -0
- package/dist/node_modules/.pnpm/prosemirror-model@1.25.12/node_modules/prosemirror-model/dist/index.js +549 -0
- package/dist/node_modules/.pnpm/prosemirror-state@1.4.4/node_modules/prosemirror-state/dist/index.js +489 -0
- package/dist/node_modules/.pnpm/prosemirror-transform@1.12.4/node_modules/prosemirror-transform/dist/index.js +659 -0
- package/package.json +35 -43
- package/dist/modules/editor/components/Toolbar/LinkToolbar.TippyOptions.d.ts +0 -2
- package/dist/modules/editor/components/Toolbar/LinkToolbar.TippyOptions.js +0 -8
- package/dist/modules/homepage/components/Agenda/Agenda.d.ts +0 -10
- package/dist/modules/homepage/components/Agenda/Agenda.js +0 -54
- package/dist/modules/homepage/components/Agenda/AgendaContainer.d.ts +0 -1
- package/dist/modules/homepage/components/Agenda/AgendaContainer.js +0 -14
- package/dist/modules/homepage/components/Agenda/AgendaEventCard.d.ts +0 -10
- package/dist/modules/homepage/components/Agenda/AgendaEventCard.js +0 -30
- package/dist/modules/homepage/components/Agenda/hooks/useAgendaContainer.d.ts +0 -14
- package/dist/modules/homepage/components/Agenda/hooks/useAgendaContainer.js +0 -27
- package/dist/modules/homepage/components/Agenda/index.d.ts +0 -3
- package/dist/modules/homepage/components/Agenda/services/api/agendaService.d.ts +0 -24
- package/dist/modules/homepage/components/Agenda/services/api/agendaService.js +0 -45
- package/dist/modules/homepage/components/Agenda/services/api/index.d.ts +0 -4
- package/dist/modules/homepage/components/Agenda/services/api/index.js +0 -5
- package/dist/modules/homepage/components/Agenda/services/queries/agenda.d.ts +0 -19
- package/dist/modules/homepage/components/Agenda/services/queries/agenda.js +0 -26
- package/dist/modules/homepage/components/BriefMe/BriefMe.d.ts +0 -9
- package/dist/modules/homepage/components/BriefMe/BriefMe.js +0 -59
- package/dist/modules/homepage/components/BriefMe/BriefMeContainer.d.ts +0 -4
- package/dist/modules/homepage/components/BriefMe/BriefMeContainer.js +0 -17
- package/dist/modules/homepage/components/BriefMe/index.d.ts +0 -4
- package/dist/modules/homepage/components/BriefMe/types.d.ts +0 -17
- package/dist/modules/homepage/components/BriefMe/types.js +0 -8
- package/dist/modules/homepage/components/BriefMe/useBriefMe.d.ts +0 -31
- package/dist/modules/homepage/components/BriefMe/useBriefMe.js +0 -51
- package/dist/modules/homepage/components/Cantine/Cantine.d.ts +0 -7
- package/dist/modules/homepage/components/Cantine/Cantine.js +0 -44
- package/dist/modules/homepage/components/Cantine/CantineContainer.d.ts +0 -4
- package/dist/modules/homepage/components/Cantine/CantineContainer.js +0 -18
- package/dist/modules/homepage/components/Cantine/CantineModal.d.ts +0 -24
- package/dist/modules/homepage/components/Cantine/CantineModal.js +0 -88
- package/dist/modules/homepage/components/Cantine/CantineModalContainer.d.ts +0 -7
- package/dist/modules/homepage/components/Cantine/CantineModalContainer.js +0 -12
- package/dist/modules/homepage/components/Cantine/components/CantineLegend.d.ts +0 -5
- package/dist/modules/homepage/components/Cantine/components/CantineLegend.js +0 -22
- package/dist/modules/homepage/components/Cantine/components/CantineMenuSection.d.ts +0 -6
- package/dist/modules/homepage/components/Cantine/components/CantineMenuSection.js +0 -28
- package/dist/modules/homepage/components/Cantine/components/cantineLabels.d.ts +0 -12
- package/dist/modules/homepage/components/Cantine/components/cantineLabels.js +0 -60
- package/dist/modules/homepage/components/Cantine/hooks/useCantine.d.ts +0 -11
- package/dist/modules/homepage/components/Cantine/hooks/useCantine.js +0 -20
- package/dist/modules/homepage/components/Cantine/hooks/useCantineMenu.d.ts +0 -24
- package/dist/modules/homepage/components/Cantine/hooks/useCantineMenu.js +0 -65
- package/dist/modules/homepage/components/Cantine/hooks/useCantineModal.d.ts +0 -23
- package/dist/modules/homepage/components/Cantine/hooks/useCantineModal.js +0 -43
- package/dist/modules/homepage/components/Cantine/index.d.ts +0 -7
- package/dist/modules/homepage/components/Cantine/types.d.ts +0 -42
- package/dist/modules/homepage/components/GenerationHdf/GenerationHdf.d.ts +0 -16
- package/dist/modules/homepage/components/GenerationHdf/GenerationHdf.js +0 -48
- package/dist/modules/homepage/components/GenerationHdf/GenerationHdfContainer.d.ts +0 -4
- package/dist/modules/homepage/components/GenerationHdf/GenerationHdfContainer.js +0 -12
- package/dist/modules/homepage/components/GenerationHdf/formatSolde.d.ts +0 -1
- package/dist/modules/homepage/components/GenerationHdf/formatSolde.js +0 -6
- package/dist/modules/homepage/components/GenerationHdf/index.d.ts +0 -3
- package/dist/modules/homepage/components/GenerationHdf/useGenerationHdf.d.ts +0 -10
- package/dist/modules/homepage/components/GenerationHdf/useGenerationHdf.js +0 -68
- package/dist/modules/homepage/components/Header/AccountActionListPopover.d.ts +0 -13
- package/dist/modules/homepage/components/Header/AccountActionListPopover.js +0 -26
- package/dist/modules/homepage/components/Header/ActionItem.d.ts +0 -38
- package/dist/modules/homepage/components/Header/ActionItem.js +0 -34
- package/dist/modules/homepage/components/Header/MyAppsPopover.d.ts +0 -5
- package/dist/modules/homepage/components/Header/MyAppsPopover.js +0 -28
- package/dist/modules/homepage/components/Header/useSafeHoverPopover.js +0 -32
- package/dist/modules/homepage/components/Qwant/Qwant.d.ts +0 -4
- package/dist/modules/homepage/components/Qwant/Qwant.js +0 -41
- package/dist/modules/homepage/components/Qwant/QwantContainer.d.ts +0 -1
- package/dist/modules/homepage/components/Qwant/QwantContainer.js +0 -10
- package/dist/modules/homepage/components/Qwant/index.d.ts +0 -3
- package/dist/modules/homepage/components/Rss/Rss.d.ts +0 -11
- package/dist/modules/homepage/components/Rss/Rss.js +0 -64
- package/dist/modules/homepage/components/Rss/RssContainer.d.ts +0 -1
- package/dist/modules/homepage/components/Rss/RssContainer.js +0 -45
- package/dist/modules/homepage/components/Rss/RssFeedForm.d.ts +0 -13
- package/dist/modules/homepage/components/Rss/RssFeedForm.js +0 -69
- package/dist/modules/homepage/components/Rss/RssFeedsModal.d.ts +0 -11
- package/dist/modules/homepage/components/Rss/RssFeedsModal.js +0 -58
- package/dist/modules/homepage/components/Rss/hooks/useRssContainer.d.ts +0 -25
- package/dist/modules/homepage/components/Rss/hooks/useRssContainer.js +0 -43
- package/dist/modules/homepage/components/Rss/index.d.ts +0 -6
- package/dist/modules/homepage/components/Rss/services/api/index.d.ts +0 -5
- package/dist/modules/homepage/components/Rss/services/api/index.js +0 -5
- package/dist/modules/homepage/components/Rss/services/api/rssService.d.ts +0 -38
- package/dist/modules/homepage/components/Rss/services/api/rssService.js +0 -51
- package/dist/modules/homepage/components/Rss/services/queries/rss.d.ts +0 -28
- package/dist/modules/homepage/components/Rss/services/queries/rss.js +0 -71
- package/dist/modules/homepage/components/Rss/types.d.ts +0 -25
- package/dist/modules/homepage/components/Rss/utils.d.ts +0 -7
- package/dist/modules/homepage/components/Rss/utils.js +0 -19
- package/dist/modules/homepage/components/Universalis/Universalis.d.ts +0 -8
- package/dist/modules/homepage/components/Universalis/Universalis.js +0 -62
- package/dist/modules/homepage/components/Universalis/UniversalisContainer.d.ts +0 -1
- package/dist/modules/homepage/components/Universalis/UniversalisContainer.js +0 -16
- package/dist/modules/homepage/components/Universalis/index.d.ts +0 -3
- package/dist/modules/homepage/components/WidgetsPersonalizationPanel/WidgetToggle.d.ts +0 -16
- package/dist/modules/homepage/components/WidgetsPersonalizationPanel/WidgetToggle.js +0 -15
- package/dist/modules/homepage/components/WidgetsPersonalizationPanel/WidgetsPersonalizationPanel.d.ts +0 -21
- package/dist/modules/homepage/components/WidgetsPersonalizationPanel/WidgetsPersonalizationPanel.js +0 -47
- package/dist/modules/homepage/components/WidgetsPersonalizationPanel/index.d.ts +0 -2
- package/dist/modules/icons/components/IconAddWidget.d.ts +0 -7
- package/dist/modules/icons/components/IconAddWidget.js +0 -12
- package/dist/modules/icons/components/IconLogout.d.ts +0 -7
- package/dist/modules/icons/components/IconLogout.js +0 -13
|
@@ -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,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,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,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,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;
|