@edifice.io/react 2.5.22 → 2.5.23-chore-tiptap-v3.20260930150159
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/AppIcon/AppIcon.js +4 -1
- package/dist/components/Avatar/Avatar.d.ts +2 -2
- package/dist/components/Avatar/Avatar.js +2 -1
- package/dist/components/BetaSwitch/BetaSwitch.d.ts +13 -0
- package/dist/components/BetaSwitch/BetaSwitch.js +27 -0
- package/dist/components/BetaSwitch/index.d.ts +1 -0
- package/dist/components/ButtonBeta/ButtonBeta.d.ts +47 -0
- package/dist/components/ButtonBeta/ButtonBeta.js +34 -0
- package/dist/components/ButtonBeta/index.d.ts +2 -0
- package/dist/components/Dropdown/DropdownTrigger.d.ts +1 -1
- package/dist/components/Flex/Flex.js +5 -1
- package/dist/components/Logo/index.d.ts +1 -1
- package/dist/components/LogoBeta/LogoBeta.d.ts +7 -0
- package/dist/components/LogoBeta/LogoBeta.js +14 -0
- package/dist/components/LogoBeta/index.d.ts +2 -0
- package/dist/components/MediaViewer/MediaViewer.d.ts +1 -1
- package/dist/components/MediaViewer/MediaWrapper.d.ts +1 -1
- package/dist/components/PageLayout/PageLayout.d.ts +45 -0
- package/dist/components/PageLayout/PageLayout.js +94 -0
- package/dist/components/PageLayout/PageLayoutContext.d.ts +14 -0
- package/dist/components/PageLayout/PageLayoutContext.js +8 -0
- package/dist/components/PageLayout/components/PageLayoutBreadcrumb.d.ts +9 -0
- package/dist/components/PageLayout/components/PageLayoutBreadcrumb.js +10 -0
- package/dist/components/PageLayout/components/PageLayoutContent.d.ts +9 -0
- package/dist/components/PageLayout/components/PageLayoutContent.js +18 -0
- package/dist/components/PageLayout/components/PageLayoutHeader.d.ts +10 -0
- package/dist/components/PageLayout/components/PageLayoutHeader.js +18 -0
- package/dist/components/PageLayout/components/PageLayoutOverlay.d.ts +15 -0
- package/dist/components/PageLayout/components/PageLayoutOverlay.js +51 -0
- package/dist/components/PageLayout/components/PageLayoutSidebarLeft.d.ts +9 -0
- package/dist/components/PageLayout/components/PageLayoutSidebarLeft.js +18 -0
- package/dist/components/PageLayout/components/PageLayoutSidebarRight.d.ts +9 -0
- package/dist/components/PageLayout/components/PageLayoutSidebarRight.js +18 -0
- package/dist/components/PageLayout/hook/useOverlay.d.ts +5 -0
- package/dist/components/PageLayout/hook/useOverlay.js +15 -0
- package/dist/components/PageLayout/index.d.ts +4 -0
- package/dist/components/PageLayout/store/overlayStore.d.ts +15 -0
- package/dist/components/PageLayout/store/overlayStore.js +12 -0
- package/dist/components/index.d.ts +4 -0
- package/dist/editor.js +2 -0
- package/dist/homepage.js +34 -0
- package/dist/hooks/index.d.ts +1 -1
- package/dist/hooks/useEdificeIcons/useEdificeIcons.js +10 -9
- package/dist/hooks/useScreeb/index.d.ts +1 -1
- package/dist/icons-nav.js +38 -28
- package/dist/index.js +215 -202
- package/dist/modules/editor/components/BubbleMenuEditImage/BubbleMenuEditImage.js +97 -90
- package/dist/modules/editor/components/BubbleMenuEditInformationPane/BubbleMenuEditInformationPane.js +111 -95
- package/dist/modules/editor/components/EditorToolbar/EditorToolbar.js +3 -2
- package/dist/modules/editor/components/Toolbar/LinkToolbar.FloatingOptions.js +12 -0
- package/dist/modules/editor/components/Toolbar/LinkToolbar.js +5 -4
- package/dist/modules/editor/components/Toolbar/TableToolbar.js +10 -5
- 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 +1 -1
- package/dist/modules/editor/hooks/useEditorState.d.ts +20 -0
- package/dist/modules/editor/hooks/useEditorState.js +16 -0
- package/dist/modules/editor/hooks/useTipTapEditor.d.ts +1 -1
- package/dist/modules/editor/hooks/useTipTapEditor.js +4 -8
- package/dist/modules/homepage/components/Favorites/Favorites.d.ts +6 -0
- package/dist/modules/homepage/components/Favorites/Favorites.js +28 -0
- package/dist/modules/homepage/components/Favorites/FavoritesContainer.d.ts +4 -0
- package/dist/modules/homepage/components/Favorites/FavoritesContainer.js +10 -0
- package/dist/modules/homepage/components/Favorites/index.d.ts +2 -0
- package/dist/modules/homepage/components/Header/Header.d.ts +9 -0
- package/dist/modules/homepage/components/Header/Header.js +80 -0
- package/dist/modules/homepage/components/Header/index.d.ts +2 -0
- package/dist/modules/homepage/components/HomeCard/HomeCard.d.ts +37 -0
- package/dist/modules/homepage/components/HomeCard/HomeCard.js +17 -0
- package/dist/modules/homepage/components/HomeCard/HomeCardContent.d.ts +7 -0
- package/dist/modules/homepage/components/HomeCard/HomeCardContent.js +10 -0
- package/dist/modules/homepage/components/HomeCard/HomeCardHeader.d.ts +18 -0
- package/dist/modules/homepage/components/HomeCard/HomeCardHeader.js +22 -0
- package/dist/modules/homepage/components/HomeCard/index.d.ts +4 -0
- package/dist/modules/homepage/components/LastInfos/LastInfos.d.ts +49 -0
- package/dist/modules/homepage/components/LastInfos/LastInfos.js +58 -0
- package/dist/modules/homepage/components/LastInfos/LastInfosContainer.d.ts +4 -0
- package/dist/modules/homepage/components/LastInfos/LastInfosContainer.js +37 -0
- package/dist/modules/homepage/components/LastInfos/LastInfosList.d.ts +13 -0
- package/dist/modules/homepage/components/LastInfos/LastInfosList.js +31 -0
- package/dist/modules/homepage/components/LastInfos/index.d.ts +4 -0
- package/dist/modules/homepage/components/LastInfos/useLastInfos.d.ts +18 -0
- package/dist/modules/homepage/components/LastInfos/useLastInfos.js +25 -0
- package/dist/modules/homepage/components/MessageFlashList/MessageFlash.d.ts +12 -0
- package/dist/modules/homepage/components/MessageFlashList/MessageFlash.js +65 -0
- package/dist/modules/homepage/components/MessageFlashList/MessageFlashList.d.ts +12 -0
- package/dist/modules/homepage/components/MessageFlashList/MessageFlashList.js +10 -0
- package/dist/modules/homepage/components/MessageFlashList/MessageFlashListContainer.d.ts +5 -0
- package/dist/modules/homepage/components/MessageFlashList/MessageFlashListContainer.js +14 -0
- package/dist/modules/homepage/components/MessageFlashList/hooks/useMessageFlashList.d.ts +16 -0
- package/dist/modules/homepage/components/MessageFlashList/hooks/useMessageFlashList.js +19 -0
- package/dist/modules/homepage/components/MessageFlashList/index.d.ts +4 -0
- package/dist/modules/homepage/components/MessageFlashList/services/api/index.d.ts +4 -0
- package/dist/modules/homepage/components/MessageFlashList/services/api/index.js +5 -0
- package/dist/modules/homepage/components/MessageFlashList/services/api/messagesFlashService.d.ts +20 -0
- package/dist/modules/homepage/components/MessageFlashList/services/api/messagesFlashService.js +21 -0
- package/dist/modules/homepage/components/MessageFlashList/services/queries/messagesFlash.d.ts +13 -0
- package/dist/modules/homepage/components/MessageFlashList/services/queries/messagesFlash.js +31 -0
- package/dist/modules/homepage/components/Notifications/Notification.d.ts +20 -0
- package/dist/modules/homepage/components/Notifications/Notification.js +16 -0
- package/dist/modules/homepage/components/Notifications/NotificationList.d.ts +18 -0
- package/dist/modules/homepage/components/Notifications/NotificationList.js +44 -0
- package/dist/modules/homepage/components/Notifications/NotificationListContainer.d.ts +9 -0
- package/dist/modules/homepage/components/Notifications/NotificationListContainer.js +20 -0
- package/dist/modules/homepage/components/Notifications/NotificationListSkeleton.d.ts +5 -0
- package/dist/modules/homepage/components/Notifications/NotificationListSkeleton.js +17 -0
- package/dist/modules/homepage/components/Notifications/NotificationSkeleton.d.ts +3 -0
- package/dist/modules/homepage/components/Notifications/NotificationSkeleton.js +19 -0
- package/dist/modules/homepage/components/Notifications/components/NotificationItem.d.ts +24 -0
- package/dist/modules/homepage/components/Notifications/components/NotificationItem.js +28 -0
- package/dist/modules/homepage/components/Notifications/components/NotificationResource.d.ts +15 -0
- package/dist/modules/homepage/components/Notifications/components/NotificationResource.js +19 -0
- package/dist/modules/homepage/components/Notifications/components/SystemNotification.d.ts +15 -0
- package/dist/modules/homepage/components/Notifications/components/SystemNotification.js +20 -0
- package/dist/modules/homepage/components/Notifications/components/UserNotification.d.ts +15 -0
- package/dist/modules/homepage/components/Notifications/components/UserNotification.js +25 -0
- package/dist/modules/homepage/components/Notifications/components/notificationAdapter.d.ts +27 -0
- package/dist/modules/homepage/components/Notifications/components/notificationAdapter.js +53 -0
- package/dist/modules/homepage/components/Notifications/hooks/useNotificationList.d.ts +20 -0
- package/dist/modules/homepage/components/Notifications/hooks/useNotificationList.js +26 -0
- package/dist/modules/homepage/components/Notifications/index.d.ts +6 -0
- package/dist/modules/homepage/components/Notifications/services/api/index.d.ts +4 -0
- package/dist/modules/homepage/components/Notifications/services/api/index.js +5 -0
- package/dist/modules/homepage/components/Notifications/services/api/notificationService.d.ts +15 -0
- package/dist/modules/homepage/components/Notifications/services/api/notificationService.js +22 -0
- package/dist/modules/homepage/components/Notifications/services/queries/notification.d.ts +20 -0
- package/dist/modules/homepage/components/Notifications/services/queries/notification.js +40 -0
- package/dist/modules/homepage/components/SchoolSpace/SchoolSpace.d.ts +15 -0
- package/dist/modules/homepage/components/SchoolSpace/SchoolSpace.js +29 -0
- package/dist/modules/homepage/components/SchoolSpace/SchoolSpaceContainer.d.ts +4 -0
- package/dist/modules/homepage/components/SchoolSpace/SchoolSpaceContainer.js +13 -0
- package/dist/modules/homepage/components/SchoolSpace/index.d.ts +3 -0
- package/dist/modules/homepage/components/SchoolSpace/useUserSchools.d.ts +6 -0
- package/dist/modules/homepage/components/SchoolSpace/useUserSchools.js +39 -0
- package/dist/modules/homepage/components/UserSpace/UserSpace.d.ts +13 -0
- package/dist/modules/homepage/components/UserSpace/UserSpace.js +28 -0
- package/dist/modules/homepage/components/UserSpace/UserSpaceContainer.d.ts +7 -0
- package/dist/modules/homepage/components/UserSpace/UserSpaceContainer.js +19 -0
- package/dist/modules/homepage/components/UserSpace/index.d.ts +3 -0
- package/dist/modules/homepage/components/index.d.ts +8 -0
- package/dist/modules/homepage/hooks/useWidget.d.ts +6 -0
- package/dist/modules/homepage/hooks/useWidget.js +83 -0
- package/dist/modules/homepage/hooks/useWidgetPreferences.d.ts +6 -0
- package/dist/modules/homepage/hooks/useWidgetPreferences.js +34 -0
- package/dist/modules/homepage/index.d.ts +1 -0
- package/dist/modules/icons/components/nav/IconCommunitiesBeta.d.ts +7 -0
- package/dist/modules/icons/components/nav/IconCommunitiesBeta.js +18 -0
- package/dist/modules/icons/components/nav/IconHomeBeta.d.ts +7 -0
- package/dist/modules/icons/components/nav/IconHomeBeta.js +13 -0
- package/dist/modules/icons/components/{IconStarFavorite.d.ts → nav/IconMessagesBeta.d.ts} +2 -2
- package/dist/modules/icons/components/nav/IconMessagesBeta.js +18 -0
- package/dist/modules/icons/components/nav/IconMyAppsBeta.d.ts +7 -0
- package/dist/modules/icons/components/nav/IconMyAppsBeta.js +13 -0
- package/dist/modules/icons/components/nav/IconNotificationBeta.d.ts +7 -0
- package/dist/modules/icons/components/nav/IconNotificationBeta.js +14 -0
- package/dist/modules/icons/components/nav/index.d.ts +5 -0
- package/dist/modules/modals/OnboardingModal/index.d.ts +1 -1
- package/dist/node_modules/.pnpm/@tiptap_extension-floating-menu@3.31.3_@floating-ui_dom@1.6.0_@tiptap_core@3.10.2_@tiptap_pm@3.10.2__@tiptap_pm@3.10.2/node_modules/@tiptap/extension-floating-menu/dist/index.js +159 -0
- package/dist/node_modules/.pnpm/@tiptap_react@3.10.2_@floating-ui_dom@1.6.0_@tiptap_core@3.10.2_@tiptap_pm@3.10.2__@tiptap_pm_dubv75vojf3t6hpx6vhaocpyzq/node_modules/@tiptap/react/dist/menus/index.js +89 -0
- package/dist/node_modules/.pnpm/prosemirror-model@1.25.12/node_modules/prosemirror-model/dist/index.js +419 -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.2/node_modules/prosemirror-transform/dist/index.js +607 -0
- package/dist/providers/EdificeClientProvider/EdificeClientProvider.d.ts +0 -7
- package/dist/utilities/create-selectors/createSelectors.d.ts +10 -0
- package/dist/utilities/create-selectors/createSelectors.js +11 -0
- package/package.json +47 -49
- package/dist/modules/editor/components/Toolbar/LinkToolbar.TippyOptions.d.ts +0 -2
- package/dist/modules/editor/components/Toolbar/LinkToolbar.TippyOptions.js +0 -8
|
@@ -15,6 +15,6 @@ import { WorkspaceVisibility } from '@edifice.io/client';
|
|
|
15
15
|
export declare const useTipTapEditor: (editable: boolean, content: Content, focus?: FocusPosition, placeholder?: string, onContentChange?: ({ editor }: {
|
|
16
16
|
editor: any;
|
|
17
17
|
}) => void, visibility?: WorkspaceVisibility, extensions?: Extensions) => {
|
|
18
|
-
editor: import('@tiptap/core').Editor
|
|
18
|
+
editor: import('@tiptap/core').Editor;
|
|
19
19
|
editable: boolean;
|
|
20
20
|
};
|
|
@@ -9,18 +9,14 @@ import { SpeechSynthesis } from "@edifice.io/tiptap-extensions/speech-synthesis"
|
|
|
9
9
|
import { TableCell } from "@edifice.io/tiptap-extensions/table-cell";
|
|
10
10
|
import { Mathematics } from "@tiptap/extension-mathematics";
|
|
11
11
|
import Color from "@tiptap/extension-color";
|
|
12
|
-
import Focus from "@tiptap/extension-focus";
|
|
13
12
|
import FontFamily from "@tiptap/extension-font-family";
|
|
14
|
-
import
|
|
13
|
+
import { TextStyleKit } from "@tiptap/extension-text-style";
|
|
14
|
+
import { Focus, Placeholder } from "@tiptap/extensions";
|
|
15
15
|
import Subscript from "@tiptap/extension-subscript";
|
|
16
16
|
import Superscript from "@tiptap/extension-superscript";
|
|
17
|
-
import Table from "@tiptap/extension-table";
|
|
18
|
-
import TableHeader from "@tiptap/extension-table-header";
|
|
19
|
-
import TableRow from "@tiptap/extension-table-row";
|
|
17
|
+
import { TableRow, TableHeader, Table } from "@tiptap/extension-table";
|
|
20
18
|
import TextAlign from "@tiptap/extension-text-align";
|
|
21
|
-
import TextStyle from "@tiptap/extension-text-style";
|
|
22
19
|
import Typography from "@tiptap/extension-typography";
|
|
23
|
-
import Underline from "@tiptap/extension-underline";
|
|
24
20
|
import { useEditor } from "@tiptap/react";
|
|
25
21
|
import StarterKit from "@tiptap/starter-kit";
|
|
26
22
|
import { useTranslation } from "react-i18next";
|
|
@@ -57,7 +53,7 @@ const useTipTapEditor = (editable, content, focus, placeholder, onContentChange,
|
|
|
57
53
|
placeholder: t(placeholder || "tiptap.placeholder")
|
|
58
54
|
}), CustomHighlight.configure({
|
|
59
55
|
multicolor: !0
|
|
60
|
-
}),
|
|
56
|
+
}), TextStyleKit, Color, Subscript, Superscript, Table.configure({
|
|
61
57
|
resizable: !0
|
|
62
58
|
}), TableRow, TableHeader, TableCell, TextAlign.configure({
|
|
63
59
|
types: ["heading", "paragraph", "video", "audio", "iframe"]
|
|
@@ -0,0 +1,28 @@
|
|
|
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 SvgIconArrowRight from "../../../icons/components/IconArrowRight.js";
|
|
5
|
+
import HomeCard from "../HomeCard/HomeCard.js";
|
|
6
|
+
import Flex from "../../../../components/Flex/Flex.js";
|
|
7
|
+
import AppIcon from "../../../../components/AppIcon/AppIcon.js";
|
|
8
|
+
function Favorites({
|
|
9
|
+
apps,
|
|
10
|
+
onSeeAllClick = () => window.open("/welcome", "_self")
|
|
11
|
+
}) {
|
|
12
|
+
const {
|
|
13
|
+
t
|
|
14
|
+
} = useTranslation(), getAppName = (app) => app.prefix && app.prefix.length > 1 ? t(app.prefix.substring(1)) : t(app.displayName) || "";
|
|
15
|
+
return /* @__PURE__ */ jsxs(HomeCard, { variant: "secondary", children: [
|
|
16
|
+
/* @__PURE__ */ jsx(HomeCard.Header, { title: t("homepage.favorites.title", "Favoris"), actionLabel: t("homepage.favorites.all", "Mes applis"), onActionClick: onSeeAllClick, actionRightIcon: /* @__PURE__ */ jsx(SvgIconArrowRight, {}) }),
|
|
17
|
+
/* @__PURE__ */ jsx(HomeCard.Content, { children: /* @__PURE__ */ jsx("div", { className: "favorites-content", children: apps.length === 0 ? /* @__PURE__ */ jsxs(Flex, { align: "center", gap: "12", children: [
|
|
18
|
+
/* @__PURE__ */ jsx("img", { src: illuEmptyFavorite, alt: "", width: 80, height: 80 }),
|
|
19
|
+
/* @__PURE__ */ jsx("span", { className: "favorites-empty-text", children: t("homepage.favorites.empty", "Ajouter des applications à vos favoris pour les retrouver ici et y accéder rapidement !") })
|
|
20
|
+
] }) : /* @__PURE__ */ jsx(Flex, { wrap: "wrap", gap: "8 16", children: apps.map((app) => {
|
|
21
|
+
const appName = getAppName(app), opensInNewTab = app.isExternal || app.target === "_blank";
|
|
22
|
+
return /* @__PURE__ */ jsx("a", { href: app.address, "aria-label": appName, title: appName, target: opensInNewTab ? "_blank" : void 0, rel: opensInNewTab ? "noopener noreferrer" : void 0, children: /* @__PURE__ */ jsx(AppIcon, { app, size: "40", variant: "square" }) }, app.name);
|
|
23
|
+
}) }) }) })
|
|
24
|
+
] });
|
|
25
|
+
}
|
|
26
|
+
export {
|
|
27
|
+
Favorites
|
|
28
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Favorites } from "./Favorites.js";
|
|
3
|
+
import useBookmark from "../../../../hooks/useBookmark/useBookmark.js";
|
|
4
|
+
function FavoritesContainer(props) {
|
|
5
|
+
const apps = useBookmark() ?? [];
|
|
6
|
+
return /* @__PURE__ */ jsx(Favorites, { ...props, apps });
|
|
7
|
+
}
|
|
8
|
+
export {
|
|
9
|
+
FavoritesContainer
|
|
10
|
+
};
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import clsx from "clsx";
|
|
3
|
+
import { useTranslation } from "react-i18next";
|
|
4
|
+
import { useId } from "react";
|
|
5
|
+
import { Navbar } from "../../../../components/Layout/components/Navbar.js";
|
|
6
|
+
import { NavItem } from "../../../../components/Layout/components/NavItem.js";
|
|
7
|
+
import { NavLink } from "../../../../components/Layout/components/NavLink.js";
|
|
8
|
+
import useHeader from "../../../../components/Layout/hooks/useHeader.js";
|
|
9
|
+
import SvgIconCommunitiesBeta from "../../../icons/components/nav/IconCommunitiesBeta.js";
|
|
10
|
+
import SvgIconDisconnect from "../../../icons/components/nav/IconDisconnect.js";
|
|
11
|
+
import SvgIconHomeBeta from "../../../icons/components/nav/IconHomeBeta.js";
|
|
12
|
+
import SvgIconMessagesBeta from "../../../icons/components/nav/IconMessagesBeta.js";
|
|
13
|
+
import SvgIconMyAppsBeta from "../../../icons/components/nav/IconMyAppsBeta.js";
|
|
14
|
+
import SvgIconNotificationBeta from "../../../icons/components/nav/IconNotificationBeta.js";
|
|
15
|
+
import useConversation from "../../../../hooks/useConversation/useConversation.js";
|
|
16
|
+
import useUser from "../../../../hooks/useUser/useUser.js";
|
|
17
|
+
import useHasWorkflow from "../../../../hooks/useHasWorkflow/useHasWorkflow.js";
|
|
18
|
+
import { useEdificeTheme } from "../../../../providers/EdificeThemeProvider/EdificeThemeProvider.hook.js";
|
|
19
|
+
import useHover from "../../../../hooks/useHover/useHover.js";
|
|
20
|
+
import LogoBeta from "../../../../components/LogoBeta/LogoBeta.js";
|
|
21
|
+
import Badge from "../../../../components/Badge/Badge.js";
|
|
22
|
+
import VisuallyHidden from "../../../../components/VisuallyHidden/VisuallyHidden.js";
|
|
23
|
+
import ButtonBeta from "../../../../components/ButtonBeta/ButtonBeta.js";
|
|
24
|
+
import Avatar from "../../../../components/Avatar/Avatar.js";
|
|
25
|
+
import { Popover, PopoverBody } from "../../../../components/Popover/Popover.js";
|
|
26
|
+
const Header = ({
|
|
27
|
+
src = "",
|
|
28
|
+
onNotificationsClick
|
|
29
|
+
}) => {
|
|
30
|
+
const {
|
|
31
|
+
t
|
|
32
|
+
} = useTranslation(), {
|
|
33
|
+
messages
|
|
34
|
+
} = useConversation(), {
|
|
35
|
+
user,
|
|
36
|
+
avatar
|
|
37
|
+
} = useUser(), hasCarbonioPreauthWorkflow = useHasWorkflow("org.entcore.auth.controllers.CarbonioPreauthController|preauth") || !1, classes = clsx("header-beta d-print-none no-2d no-1d"), {
|
|
38
|
+
userAvatar,
|
|
39
|
+
userName,
|
|
40
|
+
communityWorkflow,
|
|
41
|
+
conversationWorflow
|
|
42
|
+
} = useHeader({
|
|
43
|
+
user,
|
|
44
|
+
avatar
|
|
45
|
+
}), {
|
|
46
|
+
theme
|
|
47
|
+
} = useEdificeTheme(), hasMessages = messages > 0, [userRef, isUserHovered] = useHover(), popoverUserId = useId(), handleNotificationsClick = () => {
|
|
48
|
+
onNotificationsClick == null || onNotificationsClick();
|
|
49
|
+
};
|
|
50
|
+
return /* @__PURE__ */ jsx("header", { className: classes, children: /* @__PURE__ */ jsxs(Navbar, { className: "px-24", children: [
|
|
51
|
+
/* @__PURE__ */ jsx(LogoBeta, { src: `${src}/img/illustrations/logo.png` }),
|
|
52
|
+
/* @__PURE__ */ jsxs("ul", { className: "navbar-nav", children: [
|
|
53
|
+
/* @__PURE__ */ jsx(NavItem, { children: /* @__PURE__ */ jsx(NavLink, { link: "/timeline/timeline", translate: t("navbar.home"), "data-testid": "header-home-button", children: /* @__PURE__ */ jsx(SvgIconHomeBeta, {}) }) }),
|
|
54
|
+
communityWorkflow && /* @__PURE__ */ jsx(NavItem, { children: /* @__PURE__ */ jsx(NavLink, { link: "/communities", translate: t("navbar.community"), "data-testid": "header-community-button", children: /* @__PURE__ */ jsx(SvgIconCommunitiesBeta, { className: "icon community" }) }) }),
|
|
55
|
+
conversationWorflow && /* @__PURE__ */ jsx(NavItem, { children: /* @__PURE__ */ jsxs(NavLink, { className: "position-relative", link: "/conversation/conversation", translate: t("conversation"), "data-testid": "header-messagerie-button", children: [
|
|
56
|
+
/* @__PURE__ */ jsx(SvgIconMessagesBeta, {}),
|
|
57
|
+
hasMessages && /* @__PURE__ */ jsx(Badge, { variant: {
|
|
58
|
+
type: "notification",
|
|
59
|
+
level: "danger"
|
|
60
|
+
}, className: "position-absolute", children: messages })
|
|
61
|
+
] }) }),
|
|
62
|
+
hasCarbonioPreauthWorkflow && /* @__PURE__ */ jsx(NavItem, { children: /* @__PURE__ */ jsxs("a", { className: "nav-link position-relative", href: "/auth/carbonio/preauth", target: "_blank", "data-testid": "header-messagerie-button", children: [
|
|
63
|
+
/* @__PURE__ */ jsx(SvgIconMessagesBeta, {}),
|
|
64
|
+
/* @__PURE__ */ jsx(VisuallyHidden, { children: t("conversation") })
|
|
65
|
+
] }) }),
|
|
66
|
+
/* @__PURE__ */ jsx(NavItem, { children: /* @__PURE__ */ jsx(NavLink, { link: "/welcome", translate: t("navbar.applications"), "data-testid": "header-my-apps-button", children: /* @__PURE__ */ jsx(SvgIconMyAppsBeta, {}) }) }),
|
|
67
|
+
/* @__PURE__ */ jsx(NavItem, { children: /* @__PURE__ */ jsx(ButtonBeta, { leftIcon: /* @__PURE__ */ jsx(SvgIconNotificationBeta, {}), variant: "ghost", onClick: handleNotificationsClick }) }),
|
|
68
|
+
/* @__PURE__ */ jsxs(NavItem, { className: "position-relative", ref: userRef, id: popoverUserId, "aria-haspopup": "true", "aria-expanded": isUserHovered, "data-testid": "header-user-menu-button", children: [
|
|
69
|
+
/* @__PURE__ */ jsx(NavLink, { link: "/userbook/mon-compte", translate: t("navbar.myaccount"), "data-testid": "header-user-profile-button", children: /* @__PURE__ */ jsx(Avatar, { alt: userName, size: "sm", src: userAvatar, variant: "circle", className: "bg-white", width: "32", height: "32" }) }),
|
|
70
|
+
/* @__PURE__ */ jsx(Popover, { className: "top-100 widget", id: popoverUserId, isVisible: isUserHovered, children: /* @__PURE__ */ jsx(PopoverBody, { children: /* @__PURE__ */ jsxs("a", { href: "/auth/logout?callback=" + ((theme == null ? void 0 : theme.logoutCallback) ?? ""), className: "nav-link d-flex align-items-center gap-8", "data-testid": "header-logout-button", children: [
|
|
71
|
+
/* @__PURE__ */ jsx(SvgIconDisconnect, { className: "icon logout" }),
|
|
72
|
+
/* @__PURE__ */ jsx("span", { id: "logout-label", className: "nav-text", children: t("navbar.disconnect") })
|
|
73
|
+
] }) }) })
|
|
74
|
+
] })
|
|
75
|
+
] })
|
|
76
|
+
] }) });
|
|
77
|
+
};
|
|
78
|
+
export {
|
|
79
|
+
Header as default
|
|
80
|
+
};
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { ComponentPropsWithoutRef, ReactNode } from 'react';
|
|
2
|
+
import { HomeCardHeaderProps } from './HomeCardHeader';
|
|
3
|
+
export type HomeCardVariant = 'user' | 'primary' | 'secondary';
|
|
4
|
+
export interface HomeCardProps extends ComponentPropsWithoutRef<'div'> {
|
|
5
|
+
/**
|
|
6
|
+
* Visual variant of the card.
|
|
7
|
+
* - `user` (default): padding 16, gap 16
|
|
8
|
+
* - `primary`: padding 8/16/16/16, gap 8
|
|
9
|
+
* - `secondary`: padding 8/16/16/16, gap 4, grey background, smaller title, no shadowbox
|
|
10
|
+
*/
|
|
11
|
+
variant?: HomeCardVariant;
|
|
12
|
+
/**
|
|
13
|
+
* Children of the card. When omitted, a default `HomeCardHeader` will be
|
|
14
|
+
* rendered using the `headerProps` prop (handy for the common case where the
|
|
15
|
+
* card only needs a header + content slot).
|
|
16
|
+
*/
|
|
17
|
+
children?: ReactNode;
|
|
18
|
+
/**
|
|
19
|
+
* Convenience prop: when provided and `children` is empty, a default
|
|
20
|
+
* `HomeCard.Header` is rendered with these props.
|
|
21
|
+
*/
|
|
22
|
+
headerProps?: HomeCardHeaderProps;
|
|
23
|
+
}
|
|
24
|
+
declare const HomeCard: {
|
|
25
|
+
({ variant, children, headerProps, className, ...rest }: HomeCardProps): import("react/jsx-runtime").JSX.Element;
|
|
26
|
+
displayName: string;
|
|
27
|
+
} & {
|
|
28
|
+
Header: {
|
|
29
|
+
({ title, actionLabel, onActionClick, actionLeftIcon, actionRightIcon, className, ...rest }: HomeCardHeaderProps): import("react/jsx-runtime").JSX.Element;
|
|
30
|
+
displayName: string;
|
|
31
|
+
};
|
|
32
|
+
Content: {
|
|
33
|
+
({ children, className, ...rest }: import('./HomeCardContent').HomeCardContentProps): import("react/jsx-runtime").JSX.Element;
|
|
34
|
+
displayName: string;
|
|
35
|
+
};
|
|
36
|
+
};
|
|
37
|
+
export default HomeCard;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import clsx from "clsx";
|
|
3
|
+
import HomeCardContent from "./HomeCardContent.js";
|
|
4
|
+
import HomeCardHeader from "./HomeCardHeader.js";
|
|
5
|
+
const Root = ({
|
|
6
|
+
variant = "user",
|
|
7
|
+
children,
|
|
8
|
+
headerProps,
|
|
9
|
+
className,
|
|
10
|
+
...rest
|
|
11
|
+
}) => /* @__PURE__ */ jsx("div", { "data-testid": "home-card", "data-variant": variant, className: clsx("home-card", `home-card--${variant}`, className), ...rest, children: headerProps && !children ? /* @__PURE__ */ jsx(HomeCardHeader, { ...headerProps }) : children }), HomeCard = Object.assign(Root, {
|
|
12
|
+
Header: HomeCardHeader,
|
|
13
|
+
Content: HomeCardContent
|
|
14
|
+
});
|
|
15
|
+
export {
|
|
16
|
+
HomeCard as default
|
|
17
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { ComponentPropsWithoutRef } from 'react';
|
|
2
|
+
export type HomeCardContentProps = ComponentPropsWithoutRef<'div'>;
|
|
3
|
+
declare const HomeCardContent: {
|
|
4
|
+
({ children, className, ...rest }: HomeCardContentProps): import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
displayName: string;
|
|
6
|
+
};
|
|
7
|
+
export default HomeCardContent;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import clsx from "clsx";
|
|
3
|
+
const HomeCardContent = ({
|
|
4
|
+
children,
|
|
5
|
+
className,
|
|
6
|
+
...rest
|
|
7
|
+
}) => /* @__PURE__ */ jsx("div", { className: clsx("home-card-content", className), ...rest, children });
|
|
8
|
+
export {
|
|
9
|
+
HomeCardContent as default
|
|
10
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { ComponentPropsWithoutRef, MouseEventHandler, ReactNode } from 'react';
|
|
2
|
+
export interface HomeCardHeaderProps extends Omit<ComponentPropsWithoutRef<'div'>, 'title'> {
|
|
3
|
+
/** Title displayed on the left side of the header. */
|
|
4
|
+
title: ReactNode;
|
|
5
|
+
/** Label of the action button displayed on the right side of the header. */
|
|
6
|
+
actionLabel?: ReactNode;
|
|
7
|
+
/** Callback invoked when the action button is clicked. */
|
|
8
|
+
onActionClick?: MouseEventHandler<HTMLButtonElement>;
|
|
9
|
+
/** Optional left icon of the action button. */
|
|
10
|
+
actionLeftIcon?: ReactNode;
|
|
11
|
+
/** Optional right icon of the action button. */
|
|
12
|
+
actionRightIcon?: ReactNode;
|
|
13
|
+
}
|
|
14
|
+
declare const HomeCardHeader: {
|
|
15
|
+
({ title, actionLabel, onActionClick, actionLeftIcon, actionRightIcon, className, ...rest }: HomeCardHeaderProps): import("react/jsx-runtime").JSX.Element;
|
|
16
|
+
displayName: string;
|
|
17
|
+
};
|
|
18
|
+
export default HomeCardHeader;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
|
+
import clsx from "clsx";
|
|
3
|
+
import Flex from "../../../../components/Flex/Flex.js";
|
|
4
|
+
import ButtonBeta from "../../../../components/ButtonBeta/ButtonBeta.js";
|
|
5
|
+
const HomeCardHeader = ({
|
|
6
|
+
title,
|
|
7
|
+
actionLabel,
|
|
8
|
+
onActionClick,
|
|
9
|
+
actionLeftIcon,
|
|
10
|
+
actionRightIcon,
|
|
11
|
+
className,
|
|
12
|
+
...rest
|
|
13
|
+
}) => {
|
|
14
|
+
const hasAction = !!actionLabel && !!onActionClick;
|
|
15
|
+
return /* @__PURE__ */ jsxs(Flex, { align: "center", justify: "between", gap: "8", className: clsx("home-card-header", className), ...rest, children: [
|
|
16
|
+
/* @__PURE__ */ jsx("h3", { className: "home-card-header-title", children: title }),
|
|
17
|
+
hasAction && /* @__PURE__ */ jsx(ButtonBeta, { color: "default", variant: "ghost", onClick: onActionClick, leftIcon: actionLeftIcon, rightIcon: actionRightIcon, "data-testid": "home-card-header-action", children: actionLabel })
|
|
18
|
+
] });
|
|
19
|
+
};
|
|
20
|
+
export {
|
|
21
|
+
HomeCardHeader as default
|
|
22
|
+
};
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
export interface LastInfosProps {
|
|
2
|
+
/**
|
|
3
|
+
* ID of the info.
|
|
4
|
+
*/
|
|
5
|
+
id: number | string;
|
|
6
|
+
/**
|
|
7
|
+
* URL of the icon to display in the upper left corner.
|
|
8
|
+
* i.e. "/workspace/document/36a04526-15a2-4e8f-adb6-cca75630e50d"
|
|
9
|
+
*/
|
|
10
|
+
icon: string;
|
|
11
|
+
/**
|
|
12
|
+
* ID of the thread to be displayed next to the icon.
|
|
13
|
+
*/
|
|
14
|
+
threadId: number | string;
|
|
15
|
+
/**
|
|
16
|
+
* Name of the thread to be displayed next to the icon.
|
|
17
|
+
* i.e. "Informations importantes"
|
|
18
|
+
*/
|
|
19
|
+
threadName: string;
|
|
20
|
+
/**
|
|
21
|
+
* Title of the info.
|
|
22
|
+
*/
|
|
23
|
+
title: string;
|
|
24
|
+
/**
|
|
25
|
+
* Content of the info.
|
|
26
|
+
*/
|
|
27
|
+
content: string;
|
|
28
|
+
/**
|
|
29
|
+
* Publication date in ISO format.
|
|
30
|
+
*/
|
|
31
|
+
publicationDate: string;
|
|
32
|
+
/**
|
|
33
|
+
* Whether the info is highlighted.
|
|
34
|
+
*/
|
|
35
|
+
isHeadline: boolean;
|
|
36
|
+
/**
|
|
37
|
+
* Name of the user who posted this info.
|
|
38
|
+
*/
|
|
39
|
+
username: string;
|
|
40
|
+
/**
|
|
41
|
+
* Handle the click event.
|
|
42
|
+
*/
|
|
43
|
+
onClick?: (threadId: number | string, id: number | string) => void;
|
|
44
|
+
}
|
|
45
|
+
declare const LastInfos: {
|
|
46
|
+
({ id, icon, threadId, threadName, content, isHeadline, title, onClick, }: LastInfosProps): import("react/jsx-runtime").JSX.Element;
|
|
47
|
+
displayName: string;
|
|
48
|
+
};
|
|
49
|
+
export default LastInfos;
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useMemo } from "react";
|
|
3
|
+
import clsx from "clsx";
|
|
4
|
+
import SvgIconActualites from "../../../icons/components/apps/IconActualites.js";
|
|
5
|
+
import Flex from "../../../../components/Flex/Flex.js";
|
|
6
|
+
const LastInfos = ({
|
|
7
|
+
id,
|
|
8
|
+
icon,
|
|
9
|
+
threadId,
|
|
10
|
+
threadName,
|
|
11
|
+
content,
|
|
12
|
+
isHeadline,
|
|
13
|
+
title,
|
|
14
|
+
onClick
|
|
15
|
+
}) => {
|
|
16
|
+
const {
|
|
17
|
+
excerpt,
|
|
18
|
+
images
|
|
19
|
+
} = useMemo(() => {
|
|
20
|
+
if (!content)
|
|
21
|
+
return {
|
|
22
|
+
excerpt: "",
|
|
23
|
+
images: []
|
|
24
|
+
};
|
|
25
|
+
const doc = new DOMParser().parseFromString(content, "text/html"), imageSources = Array.from(doc.querySelectorAll("img")).map((image) => image.getAttribute("src") ?? "").filter((src) => src.trim().length > 0);
|
|
26
|
+
return Array.from(doc.querySelectorAll("img, video, iframe, audio, embed")).forEach((mediaElement) => {
|
|
27
|
+
var _a;
|
|
28
|
+
(_a = mediaElement.parentNode) == null || _a.removeChild(mediaElement);
|
|
29
|
+
}), {
|
|
30
|
+
excerpt: (doc.body.textContent ?? "").trim(),
|
|
31
|
+
images: imageSources
|
|
32
|
+
};
|
|
33
|
+
}, [content]), previewImages = images.slice(0, 3), hasMoreImages = images.length > previewImages.length, remainingImagesCount = Math.max(images.length - previewImages.length, 0), actionLabel = `${threadName} - ${title}`;
|
|
34
|
+
return /* @__PURE__ */ jsxs("article", { className: clsx("last-infos-card", {
|
|
35
|
+
"last-infos-card-headline": isHeadline,
|
|
36
|
+
"last-infos-card-clickable": !!onClick
|
|
37
|
+
}), children: [
|
|
38
|
+
onClick && /* @__PURE__ */ jsx("button", { type: "button", className: "last-infos-card-action", onClick: () => onClick(threadId, id), "aria-label": actionLabel }),
|
|
39
|
+
/* @__PURE__ */ jsx("header", { className: "last-infos-card-header", children: /* @__PURE__ */ jsxs(Flex, { gap: "8", align: "center", justify: "start", className: "last-infos-card-thread", children: [
|
|
40
|
+
icon ? /* @__PURE__ */ jsx("img", { src: icon, alt: threadName, width: 24, height: 24, loading: "lazy", className: "last-infos-card-thread-icon" }) : /* @__PURE__ */ jsx(SvgIconActualites, { width: 24, height: 24, className: "last-infos-card-thread-icon" }),
|
|
41
|
+
/* @__PURE__ */ jsx("span", { className: "last-infos-card-thread-name", children: threadName })
|
|
42
|
+
] }) }),
|
|
43
|
+
/* @__PURE__ */ jsxs(Flex, { gap: "4", direction: "column", className: "last-infos-card-content", children: [
|
|
44
|
+
/* @__PURE__ */ jsx("div", { className: "last-infos-card-title", children: title }),
|
|
45
|
+
/* @__PURE__ */ jsx("p", { className: "last-infos-card-excerpt", children: excerpt }),
|
|
46
|
+
previewImages.length > 0 && /* @__PURE__ */ jsx("div", { className: "last-infos-card-medias", children: previewImages.map((image, index) => /* @__PURE__ */ jsxs("div", { className: "last-infos-card-media", children: [
|
|
47
|
+
/* @__PURE__ */ jsx("img", { src: image, alt: "", className: "last-infos-card-media-image", loading: "lazy" }),
|
|
48
|
+
hasMoreImages && index === 2 && /* @__PURE__ */ jsxs("div", { className: "last-infos-card-media-overlay", children: [
|
|
49
|
+
"+",
|
|
50
|
+
remainingImagesCount
|
|
51
|
+
] })
|
|
52
|
+
] }, `${image}-${index}`)) })
|
|
53
|
+
] })
|
|
54
|
+
] });
|
|
55
|
+
};
|
|
56
|
+
export {
|
|
57
|
+
LastInfos as default
|
|
58
|
+
};
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { jsxs, Fragment, jsx } from "react/jsx-runtime";
|
|
2
|
+
import { LastInfosList } from "./LastInfosList.js";
|
|
3
|
+
import { useLastInfos } from "./useLastInfos.js";
|
|
4
|
+
import TextSkeleton from "../../../../components/Skeleton/TextSkeleton.js";
|
|
5
|
+
function LastInfosContainer() {
|
|
6
|
+
const {
|
|
7
|
+
infos,
|
|
8
|
+
isLoading,
|
|
9
|
+
error
|
|
10
|
+
} = useLastInfos();
|
|
11
|
+
return isLoading ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
12
|
+
/* @__PURE__ */ jsx(TextSkeleton, { size: "lg" }),
|
|
13
|
+
/* @__PURE__ */ jsx(TextSkeleton, { size: "lg" }),
|
|
14
|
+
/* @__PURE__ */ jsx(TextSkeleton, { size: "lg" })
|
|
15
|
+
] }) : error ? error.message : /* @__PURE__ */ jsx(LastInfosList, { infos: (infos == null ? void 0 : infos.map(({
|
|
16
|
+
id,
|
|
17
|
+
content,
|
|
18
|
+
title,
|
|
19
|
+
username,
|
|
20
|
+
thread,
|
|
21
|
+
modifiedDate,
|
|
22
|
+
headline: isHeadline
|
|
23
|
+
}) => ({
|
|
24
|
+
id,
|
|
25
|
+
content,
|
|
26
|
+
title,
|
|
27
|
+
username,
|
|
28
|
+
icon: thread.icon,
|
|
29
|
+
threadId: thread.id,
|
|
30
|
+
threadName: thread.title,
|
|
31
|
+
publicationDate: modifiedDate,
|
|
32
|
+
isHeadline
|
|
33
|
+
}))) ?? [] });
|
|
34
|
+
}
|
|
35
|
+
export {
|
|
36
|
+
LastInfosContainer
|
|
37
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { LastInfosProps } from './LastInfos';
|
|
2
|
+
export interface LastInfosListProps {
|
|
3
|
+
/** List of Info to display. */
|
|
4
|
+
infos: Array<LastInfosProps>;
|
|
5
|
+
/** Handle a click on an info. If undefined, Actualites will be opened to read the info details. */
|
|
6
|
+
onInfoClick?: (threadId: number | string, id: number | string) => void;
|
|
7
|
+
/** Handle a click on the "See more" button. If undefined, Actualites will be opened. */
|
|
8
|
+
onSeeMoreClick?: () => void;
|
|
9
|
+
}
|
|
10
|
+
export declare function LastInfosList({ infos, onInfoClick: handleInfoClick, onSeeMoreClick: handleSeeMoreClick, }: LastInfosListProps): import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
export declare namespace LastInfosList {
|
|
12
|
+
var displayName: string;
|
|
13
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useTranslation } from "react-i18next";
|
|
3
|
+
import SvgIconArrowRight from "../../../icons/components/IconArrowRight.js";
|
|
4
|
+
import LastInfos from "./LastInfos.js";
|
|
5
|
+
import illuLastInfosEmptyScreen from "@edifice.io/bootstrap/dist/images/homepage/illu-last-infos-beta.svg";
|
|
6
|
+
import Flex from "../../../../components/Flex/Flex.js";
|
|
7
|
+
import ButtonBeta from "../../../../components/ButtonBeta/ButtonBeta.js";
|
|
8
|
+
import EmptyScreen from "../../../../components/EmptyScreen/EmptyScreen.js";
|
|
9
|
+
function LastInfosList({
|
|
10
|
+
infos,
|
|
11
|
+
onInfoClick: handleInfoClick = (threadId, id) => {
|
|
12
|
+
window.open(`/actualites/threads/${threadId}?info=${id}`, "_self");
|
|
13
|
+
},
|
|
14
|
+
onSeeMoreClick: handleSeeMoreClick = () => {
|
|
15
|
+
window.open("/actualites", "_self");
|
|
16
|
+
}
|
|
17
|
+
}) {
|
|
18
|
+
const {
|
|
19
|
+
t
|
|
20
|
+
} = useTranslation();
|
|
21
|
+
return /* @__PURE__ */ jsxs(Flex, { gap: "8", direction: "column", className: "last-infos-list", children: [
|
|
22
|
+
/* @__PURE__ */ jsxs(Flex, { justify: "between", align: "center", className: "last-infos-list-header", children: [
|
|
23
|
+
/* @__PURE__ */ jsx("h2", { className: "last-infos-list-title", children: t("homepage.last-infos-list.title") }),
|
|
24
|
+
/* @__PURE__ */ jsx(ButtonBeta, { color: "tertiary", variant: "ghost", className: "last-infos-list-seemore", rightIcon: /* @__PURE__ */ jsx(SvgIconArrowRight, {}), onClick: handleSeeMoreClick, children: t("homepage.last-infos-list.see.more") })
|
|
25
|
+
] }),
|
|
26
|
+
/* @__PURE__ */ jsx(Flex, { gap: "16", direction: "column", className: "last-infos-list-body", children: infos.length === 0 ? /* @__PURE__ */ jsx(EmptyScreen, { imageSrc: illuLastInfosEmptyScreen, size: 64, text: t("homepage.last-infos-list.empty") }) : infos.map((infosProps) => /* @__PURE__ */ jsx(LastInfos, { onClick: handleInfoClick, ...infosProps }, infosProps.id)) })
|
|
27
|
+
] });
|
|
28
|
+
}
|
|
29
|
+
export {
|
|
30
|
+
LastInfosList
|
|
31
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export interface LastInfosModel {
|
|
2
|
+
modifiedDate: string;
|
|
3
|
+
headline: boolean;
|
|
4
|
+
thread: {
|
|
5
|
+
id: number;
|
|
6
|
+
icon: string;
|
|
7
|
+
title: string;
|
|
8
|
+
};
|
|
9
|
+
title: string;
|
|
10
|
+
content: string;
|
|
11
|
+
username: string;
|
|
12
|
+
id: number;
|
|
13
|
+
}
|
|
14
|
+
export declare function useLastInfos(): {
|
|
15
|
+
infos: LastInfosModel[] | undefined;
|
|
16
|
+
isLoading: boolean;
|
|
17
|
+
error: Error | null;
|
|
18
|
+
};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { odeServices } from "@edifice.io/client";
|
|
2
|
+
import { useQuery, queryOptions } from "@tanstack/react-query";
|
|
3
|
+
function useLastInfos() {
|
|
4
|
+
const {
|
|
5
|
+
data,
|
|
6
|
+
isLoading,
|
|
7
|
+
error
|
|
8
|
+
} = useQuery(queryOptions({
|
|
9
|
+
queryKey: ["infos", "preview", "last", 6],
|
|
10
|
+
queryFn: async () => {
|
|
11
|
+
const http = odeServices.http(), infos = await http.get("/actualites/api/v1/infos/preview/last/6");
|
|
12
|
+
if (http.isResponseError())
|
|
13
|
+
throw new Error(http.latestResponse.statusText);
|
|
14
|
+
return infos;
|
|
15
|
+
}
|
|
16
|
+
}));
|
|
17
|
+
return {
|
|
18
|
+
infos: data,
|
|
19
|
+
isLoading,
|
|
20
|
+
error
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
export {
|
|
24
|
+
useLastInfos
|
|
25
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { IFlashMessageModel } from '@edifice.io/client';
|
|
2
|
+
export type MessageFlashProps = {
|
|
3
|
+
/** Message to display */
|
|
4
|
+
message: IFlashMessageModel;
|
|
5
|
+
/** Callback when the message is closed */
|
|
6
|
+
onCloseMessage?: (message: IFlashMessageModel) => void;
|
|
7
|
+
};
|
|
8
|
+
declare const MessageFlash: {
|
|
9
|
+
({ message, onCloseMessage }: MessageFlashProps): import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
displayName: string;
|
|
11
|
+
};
|
|
12
|
+
export default MessageFlash;
|