@edifice.io/react 2.6.11 → 2.6.12-develop-b2school.20261102112143
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/Dropdown/DropdownItem.js +17 -1
- package/dist/components/Layout/Layout.js +12 -4
- 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 +5 -3
- package/dist/components/Masonry/Masonry.d.ts +40 -0
- package/dist/components/Masonry/Masonry.js +50 -0
- package/dist/components/Masonry/index.d.ts +2 -0
- package/dist/components/SearchBar/SearchBar.js +17 -26
- package/dist/components/Tree/components/Tree.d.ts +2 -5
- package/dist/components/Tree/components/Tree.js +10 -7
- package/dist/components/Tree/hooks/useTree.d.ts +1 -0
- package/dist/components/Tree/hooks/useTree.js +6 -2
- package/dist/components/Tree/types/index.d.ts +7 -0
- package/dist/components/index.d.ts +1 -0
- package/dist/homepage.js +87 -24
- package/dist/hooks/useDropdown/useDropdown.js +2 -2
- package/dist/hooks/useZendeskGuide/useZendeskGuide.d.ts +2 -6
- package/dist/hooks/useZendeskGuide/useZendeskGuide.js +11 -8
- package/dist/icons.js +406 -402
- package/dist/index.js +2 -0
- package/dist/modules/HelpZone/HelpZone.js +6 -8
- package/dist/modules/HelpZone/HelpZoneContainer.js +2 -5
- package/dist/modules/editor/components/Editor/Editor.d.ts +5 -0
- package/dist/modules/editor/components/Editor/Editor.js +3 -0
- package/dist/modules/homepage/components/Agenda/Agenda.d.ts +10 -0
- package/dist/modules/homepage/components/Agenda/Agenda.js +54 -0
- package/dist/modules/homepage/components/Agenda/AgendaContainer.d.ts +1 -0
- package/dist/modules/homepage/components/Agenda/AgendaContainer.js +14 -0
- package/dist/modules/homepage/components/Agenda/AgendaEventCard.d.ts +10 -0
- package/dist/modules/homepage/components/Agenda/AgendaEventCard.js +30 -0
- package/dist/modules/homepage/components/Agenda/hooks/useAgendaContainer.d.ts +14 -0
- package/dist/modules/homepage/components/Agenda/hooks/useAgendaContainer.js +27 -0
- package/dist/modules/homepage/components/Agenda/index.d.ts +3 -0
- package/dist/modules/homepage/components/Agenda/services/api/agendaService.d.ts +24 -0
- package/dist/modules/homepage/components/Agenda/services/api/agendaService.js +45 -0
- package/dist/modules/homepage/components/Agenda/services/api/index.d.ts +4 -0
- package/dist/modules/homepage/components/Agenda/services/api/index.js +5 -0
- package/dist/modules/homepage/components/Agenda/services/queries/agenda.d.ts +19 -0
- package/dist/modules/homepage/components/Agenda/services/queries/agenda.js +26 -0
- package/dist/modules/homepage/components/BriefMe/BriefMe.d.ts +9 -0
- package/dist/modules/homepage/components/BriefMe/BriefMe.js +59 -0
- package/dist/modules/homepage/components/BriefMe/BriefMeContainer.d.ts +4 -0
- package/dist/modules/homepage/components/BriefMe/BriefMeContainer.js +17 -0
- package/dist/modules/homepage/components/BriefMe/index.d.ts +4 -0
- package/dist/modules/homepage/components/BriefMe/types.d.ts +17 -0
- package/dist/modules/homepage/components/BriefMe/types.js +8 -0
- package/dist/modules/homepage/components/BriefMe/useBriefMe.d.ts +31 -0
- package/dist/modules/homepage/components/BriefMe/useBriefMe.js +51 -0
- package/dist/modules/homepage/components/Cantine/Cantine.d.ts +7 -0
- package/dist/modules/homepage/components/Cantine/Cantine.js +44 -0
- package/dist/modules/homepage/components/Cantine/CantineContainer.d.ts +4 -0
- package/dist/modules/homepage/components/Cantine/CantineContainer.js +18 -0
- package/dist/modules/homepage/components/Cantine/CantineModal.d.ts +24 -0
- package/dist/modules/homepage/components/Cantine/CantineModal.js +88 -0
- package/dist/modules/homepage/components/Cantine/CantineModalContainer.d.ts +7 -0
- package/dist/modules/homepage/components/Cantine/CantineModalContainer.js +12 -0
- package/dist/modules/homepage/components/Cantine/components/CantineLegend.d.ts +5 -0
- package/dist/modules/homepage/components/Cantine/components/CantineLegend.js +22 -0
- package/dist/modules/homepage/components/Cantine/components/CantineMenuSection.d.ts +6 -0
- package/dist/modules/homepage/components/Cantine/components/CantineMenuSection.js +28 -0
- package/dist/modules/homepage/components/Cantine/components/cantineLabels.d.ts +12 -0
- package/dist/modules/homepage/components/Cantine/components/cantineLabels.js +60 -0
- package/dist/modules/homepage/components/Cantine/hooks/useCantine.d.ts +11 -0
- package/dist/modules/homepage/components/Cantine/hooks/useCantine.js +20 -0
- package/dist/modules/homepage/components/Cantine/hooks/useCantineMenu.d.ts +24 -0
- package/dist/modules/homepage/components/Cantine/hooks/useCantineMenu.js +65 -0
- package/dist/modules/homepage/components/Cantine/hooks/useCantineModal.d.ts +23 -0
- package/dist/modules/homepage/components/Cantine/hooks/useCantineModal.js +43 -0
- package/dist/modules/homepage/components/Cantine/index.d.ts +7 -0
- package/dist/modules/homepage/components/Cantine/types.d.ts +42 -0
- package/dist/modules/homepage/components/Communities/Communities.js +4 -4
- package/dist/modules/homepage/components/Edumalin/Edumalin.d.ts +9 -0
- package/dist/modules/homepage/components/Edumalin/Edumalin.js +65 -0
- package/dist/modules/homepage/components/Edumalin/EdumalinContainer.d.ts +4 -0
- package/dist/modules/homepage/components/Edumalin/EdumalinContainer.js +21 -0
- package/dist/modules/homepage/components/Edumalin/EdumalinModal.d.ts +8 -0
- package/dist/modules/homepage/components/Edumalin/EdumalinModal.js +62 -0
- package/dist/modules/homepage/components/Edumalin/components/EdumalinBadge.d.ts +5 -0
- package/dist/modules/homepage/components/Edumalin/components/EdumalinBadge.js +38 -0
- package/dist/modules/homepage/components/Edumalin/components/EdumalinPicture.d.ts +5 -0
- package/dist/modules/homepage/components/Edumalin/components/EdumalinPicture.js +12 -0
- package/dist/modules/homepage/components/Edumalin/index.d.ts +7 -0
- package/dist/modules/homepage/components/Edumalin/types.d.ts +24 -0
- package/dist/modules/homepage/components/Edumalin/types.js +4 -0
- package/dist/modules/homepage/components/Edumalin/useEdumalin.d.ts +16 -0
- package/dist/modules/homepage/components/Edumalin/useEdumalin.js +35 -0
- package/dist/modules/homepage/components/Edumalin/utils.d.ts +28 -0
- package/dist/modules/homepage/components/Edumalin/utils.js +56 -0
- package/dist/modules/homepage/components/GenerationHdf/GenerationHdf.d.ts +16 -0
- package/dist/modules/homepage/components/GenerationHdf/GenerationHdf.js +65 -0
- package/dist/modules/homepage/components/GenerationHdf/GenerationHdfContainer.d.ts +4 -0
- package/dist/modules/homepage/components/GenerationHdf/GenerationHdfContainer.js +12 -0
- package/dist/modules/homepage/components/GenerationHdf/formatSolde.d.ts +1 -0
- package/dist/modules/homepage/components/GenerationHdf/formatSolde.js +6 -0
- package/dist/modules/homepage/components/GenerationHdf/index.d.ts +3 -0
- package/dist/modules/homepage/components/GenerationHdf/useGenerationHdf.d.ts +10 -0
- package/dist/modules/homepage/components/GenerationHdf/useGenerationHdf.js +69 -0
- package/dist/modules/homepage/components/Header/AccountActionListPopover.d.ts +13 -0
- package/dist/modules/homepage/components/Header/AccountActionListPopover.js +26 -0
- package/dist/modules/homepage/components/Header/ActionItem.d.ts +38 -0
- package/dist/modules/homepage/components/Header/ActionItem.js +34 -0
- package/dist/modules/homepage/components/Header/Header.js +34 -40
- package/dist/modules/homepage/components/Header/MyAppsPopover.d.ts +5 -0
- package/dist/modules/homepage/components/Header/MyAppsPopover.js +28 -0
- package/dist/modules/homepage/components/Header/useSafeHoverPopover.js +32 -0
- package/dist/modules/homepage/components/HomeCard/HomeCardHeader.d.ts +5 -1
- 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 +7 -8
- package/dist/modules/homepage/components/Notifications/NotificationListSkeleton.js +7 -12
- package/dist/modules/homepage/components/Notifications/NotificationSkeleton.js +7 -4
- package/dist/modules/homepage/components/Notifications/components/NotificationFilterMenu.js +1 -5
- package/dist/modules/homepage/components/Notifications/components/NotificationFilterModal.js +11 -13
- package/dist/modules/homepage/components/Notifications/components/NotificationOptionsMenu.js +3 -9
- package/dist/modules/homepage/components/Notifications/components/ReportNotificationModal.js +6 -12
- package/dist/modules/homepage/components/Notifications/components/notificationAdapter.js +12 -10
- package/dist/modules/homepage/components/Notifications/hooks/useNotificationList.js +9 -10
- package/dist/modules/homepage/components/Qwant/Qwant.d.ts +4 -0
- package/dist/modules/homepage/components/Qwant/Qwant.js +41 -0
- package/dist/modules/homepage/components/Qwant/QwantContainer.d.ts +1 -0
- package/dist/modules/homepage/components/Qwant/QwantContainer.js +10 -0
- package/dist/modules/homepage/components/Qwant/index.d.ts +3 -0
- package/dist/modules/homepage/components/Rss/Rss.d.ts +11 -0
- package/dist/modules/homepage/components/Rss/Rss.js +64 -0
- package/dist/modules/homepage/components/Rss/RssContainer.d.ts +1 -0
- package/dist/modules/homepage/components/Rss/RssContainer.js +45 -0
- package/dist/modules/homepage/components/Rss/RssFeedForm.d.ts +13 -0
- package/dist/modules/homepage/components/Rss/RssFeedForm.js +69 -0
- package/dist/modules/homepage/components/Rss/RssFeedsModal.d.ts +11 -0
- package/dist/modules/homepage/components/Rss/RssFeedsModal.js +58 -0
- package/dist/modules/homepage/components/Rss/hooks/useRssContainer.d.ts +25 -0
- package/dist/modules/homepage/components/Rss/hooks/useRssContainer.js +43 -0
- package/dist/modules/homepage/components/Rss/index.d.ts +6 -0
- package/dist/modules/homepage/components/Rss/services/api/index.d.ts +5 -0
- package/dist/modules/homepage/components/Rss/services/api/index.js +5 -0
- package/dist/modules/homepage/components/Rss/services/api/rssService.d.ts +38 -0
- package/dist/modules/homepage/components/Rss/services/api/rssService.js +51 -0
- package/dist/modules/homepage/components/Rss/services/queries/rss.d.ts +28 -0
- package/dist/modules/homepage/components/Rss/services/queries/rss.js +71 -0
- package/dist/modules/homepage/components/Rss/types.d.ts +25 -0
- package/dist/modules/homepage/components/Rss/utils.d.ts +7 -0
- package/dist/modules/homepage/components/Rss/utils.js +19 -0
- package/dist/modules/homepage/components/SchoolSpace/SchoolSpaceContainer.js +1 -1
- package/dist/modules/homepage/components/TabsKids/components/TabsKids.d.ts +43 -0
- package/dist/modules/homepage/components/TabsKids/components/TabsKids.js +23 -0
- package/dist/modules/homepage/components/TabsKids/components/TabsKidsItem.d.ts +34 -0
- package/dist/modules/homepage/components/TabsKids/components/TabsKidsItem.js +26 -0
- package/dist/modules/homepage/components/TabsKids/components/TabsKidsList.d.ts +14 -0
- package/dist/modules/homepage/components/TabsKids/components/TabsKidsList.js +64 -0
- package/dist/modules/homepage/components/TabsKids/hooks/useTabsKidsOverflow.d.ts +20 -0
- package/dist/modules/homepage/components/TabsKids/hooks/useTabsKidsOverflow.js +43 -0
- package/dist/modules/homepage/components/TabsKids/index.d.ts +3 -0
- package/dist/modules/homepage/components/TabsKids/utils/visibleTabs.d.ts +15 -0
- package/dist/modules/homepage/components/TabsKids/utils/visibleTabs.js +21 -0
- package/dist/modules/homepage/components/Universalis/Universalis.d.ts +8 -0
- package/dist/modules/homepage/components/Universalis/Universalis.js +62 -0
- package/dist/modules/homepage/components/Universalis/UniversalisContainer.d.ts +1 -0
- package/dist/modules/homepage/components/Universalis/UniversalisContainer.js +16 -0
- package/dist/modules/homepage/components/Universalis/index.d.ts +3 -0
- 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 +3 -1
- package/dist/modules/homepage/components/UserSpace/UserSpace.js +13 -7
- package/dist/modules/homepage/components/UserSpace/UserSpaceContainer.d.ts +4 -2
- package/dist/modules/homepage/components/UserSpace/UserSpaceContainer.js +3 -2
- package/dist/modules/homepage/components/WidgetsPersonalizationPanel/WidgetToggle.d.ts +16 -0
- package/dist/modules/homepage/components/WidgetsPersonalizationPanel/WidgetToggle.js +15 -0
- package/dist/modules/homepage/components/WidgetsPersonalizationPanel/WidgetsPersonalizationPanel.d.ts +21 -0
- package/dist/modules/homepage/components/WidgetsPersonalizationPanel/WidgetsPersonalizationPanel.js +47 -0
- package/dist/modules/homepage/components/WidgetsPersonalizationPanel/index.d.ts +2 -0
- package/dist/modules/homepage/components/index.d.ts +11 -1
- package/dist/modules/homepage/{components/SchoolSpace → hooks}/useUserSchools.d.ts +2 -2
- package/dist/modules/homepage/{components/SchoolSpace → hooks}/useUserSchools.js +4 -4
- package/dist/modules/icons/components/IconAddWidget.d.ts +7 -0
- package/dist/modules/icons/components/IconAddWidget.js +12 -0
- package/dist/modules/icons/components/IconLogout.d.ts +7 -0
- package/dist/modules/icons/components/IconLogout.js +13 -0
- package/dist/modules/icons/components/index.d.ts +2 -0
- package/dist/modules/icons/components/nav/IconCommunitiesBeta.js +5 -7
- package/dist/modules/icons/components/nav/IconHomeBeta.js +6 -3
- package/dist/modules/icons/components/nav/IconMessagesBeta.js +7 -7
- package/dist/modules/icons/components/nav/IconMyAppsBeta.js +2 -3
- package/dist/modules/icons/components/nav/IconNotificationBeta.js +2 -4
- package/dist/modules/multimedia/Workspace/Workspace.js +1 -1
- package/package.json +7 -6
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { RssChannel } from '../api/rssService';
|
|
2
|
+
import { RssArticle } from '../../types';
|
|
3
|
+
export declare const rssQueryKeys: {
|
|
4
|
+
all: () => readonly ["rss"];
|
|
5
|
+
channel: () => readonly ["rss", "channel"];
|
|
6
|
+
articles: (url: string) => readonly ["rss", "articles", string];
|
|
7
|
+
};
|
|
8
|
+
export declare const rssQueryOptions: {
|
|
9
|
+
getChannel(): import('@tanstack/react-query').OmitKeyof<import('@tanstack/react-query').UseQueryOptions<RssChannel, Error, RssChannel, import('@tanstack/react-query').QueryKey>, "queryFn"> & {
|
|
10
|
+
queryFn?: import('@tanstack/react-query').QueryFunction<RssChannel, import('@tanstack/react-query').QueryKey, never> | undefined;
|
|
11
|
+
} & {
|
|
12
|
+
queryKey: import('@tanstack/react-query').DataTag<import('@tanstack/react-query').QueryKey, RssChannel>;
|
|
13
|
+
};
|
|
14
|
+
getArticles(url: string): import('@tanstack/react-query').OmitKeyof<import('@tanstack/react-query').UseQueryOptions<RssArticle[], Error, RssArticle[], import('@tanstack/react-query').QueryKey>, "queryFn"> & {
|
|
15
|
+
queryFn?: import('@tanstack/react-query').QueryFunction<RssArticle[], import('@tanstack/react-query').QueryKey, never> | undefined;
|
|
16
|
+
} & {
|
|
17
|
+
queryKey: import('@tanstack/react-query').DataTag<import('@tanstack/react-query').QueryKey, RssArticle[]>;
|
|
18
|
+
};
|
|
19
|
+
};
|
|
20
|
+
export declare const useRssChannel: () => import('@tanstack/react-query').UseQueryResult<RssChannel, Error>;
|
|
21
|
+
export declare const useRssArticles: (url: string | undefined) => import('@tanstack/react-query').UseQueryResult<RssArticle[], Error>;
|
|
22
|
+
/**
|
|
23
|
+
* Saves the whole feeds array (the backend has no per-feed route), with an
|
|
24
|
+
* optimistic update so that adding, editing and deleting feel immediate.
|
|
25
|
+
*/
|
|
26
|
+
export declare const useSaveRssFeeds: () => import('@tanstack/react-query').UseMutationResult<string, Error, RssChannel, {
|
|
27
|
+
previousChannel: RssChannel | undefined;
|
|
28
|
+
}>;
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { useQuery, useQueryClient, useMutation, queryOptions } from "@tanstack/react-query";
|
|
2
|
+
import { rssService } from "../api/index.js";
|
|
3
|
+
const rssQueryKeys = {
|
|
4
|
+
all: () => ["rss"],
|
|
5
|
+
channel: () => [...rssQueryKeys.all(), "channel"],
|
|
6
|
+
articles: (url) => [...rssQueryKeys.all(), "articles", url]
|
|
7
|
+
}, rssQueryOptions = {
|
|
8
|
+
getChannel() {
|
|
9
|
+
return queryOptions({
|
|
10
|
+
queryKey: rssQueryKeys.channel(),
|
|
11
|
+
queryFn: async () => rssService.getChannel()
|
|
12
|
+
});
|
|
13
|
+
},
|
|
14
|
+
getArticles(url) {
|
|
15
|
+
return queryOptions({
|
|
16
|
+
queryKey: rssQueryKeys.articles(url),
|
|
17
|
+
queryFn: async () => rssService.getArticles(url),
|
|
18
|
+
// An invalid feed URL won't fix itself: show the error state right away.
|
|
19
|
+
retry: !1
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
}, useRssChannel = () => useQuery(rssQueryOptions.getChannel()), useRssArticles = (url) => useQuery({
|
|
23
|
+
...rssQueryOptions.getArticles(url ?? ""),
|
|
24
|
+
enabled: !!url
|
|
25
|
+
}), useSaveRssFeeds = () => {
|
|
26
|
+
const queryClient = useQueryClient();
|
|
27
|
+
return useMutation({
|
|
28
|
+
mutationFn: ({
|
|
29
|
+
channelId,
|
|
30
|
+
feeds
|
|
31
|
+
}) => rssService.saveFeeds(channelId, feeds),
|
|
32
|
+
onMutate: async ({
|
|
33
|
+
channelId,
|
|
34
|
+
feeds
|
|
35
|
+
}) => {
|
|
36
|
+
await queryClient.cancelQueries({
|
|
37
|
+
queryKey: rssQueryKeys.channel()
|
|
38
|
+
});
|
|
39
|
+
const previousChannel = queryClient.getQueryData(rssQueryKeys.channel());
|
|
40
|
+
return queryClient.setQueryData(rssQueryKeys.channel(), {
|
|
41
|
+
channelId,
|
|
42
|
+
feeds
|
|
43
|
+
}), {
|
|
44
|
+
previousChannel
|
|
45
|
+
};
|
|
46
|
+
},
|
|
47
|
+
onSuccess: (channelId, {
|
|
48
|
+
feeds
|
|
49
|
+
}) => {
|
|
50
|
+
queryClient.setQueryData(rssQueryKeys.channel(), {
|
|
51
|
+
channelId,
|
|
52
|
+
feeds
|
|
53
|
+
});
|
|
54
|
+
},
|
|
55
|
+
onError: (_error, _variables, context) => {
|
|
56
|
+
context != null && context.previousChannel && queryClient.setQueryData(rssQueryKeys.channel(), context.previousChannel);
|
|
57
|
+
},
|
|
58
|
+
onSettled: () => {
|
|
59
|
+
queryClient.invalidateQueries({
|
|
60
|
+
queryKey: rssQueryKeys.channel()
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
});
|
|
64
|
+
};
|
|
65
|
+
export {
|
|
66
|
+
rssQueryKeys,
|
|
67
|
+
rssQueryOptions,
|
|
68
|
+
useRssArticles,
|
|
69
|
+
useRssChannel,
|
|
70
|
+
useSaveRssFeeds
|
|
71
|
+
};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* An RSS feed followed by the user from the homepage "RSS" widget.
|
|
3
|
+
* Feeds have no id: they are stored as an ordered array in the user's
|
|
4
|
+
* RSS channel and identified by their position in it.
|
|
5
|
+
*/
|
|
6
|
+
export interface RssFeed {
|
|
7
|
+
title: string;
|
|
8
|
+
link: string;
|
|
9
|
+
/** Legacy number of articles to display, kept as-is when editing. */
|
|
10
|
+
show?: number;
|
|
11
|
+
}
|
|
12
|
+
export type RssFeedPayload = Pick<RssFeed, 'title' | 'link'>;
|
|
13
|
+
/**
|
|
14
|
+
* An article of an RSS feed, as parsed by the rss backend module.
|
|
15
|
+
*/
|
|
16
|
+
export interface RssArticle {
|
|
17
|
+
title: string;
|
|
18
|
+
link: string;
|
|
19
|
+
/** May contain HTML. */
|
|
20
|
+
description: string;
|
|
21
|
+
/** RFC 822 date, e.g. "Tue, 21 Jul 2026 08:00:00 +0200". */
|
|
22
|
+
pubDate: string;
|
|
23
|
+
}
|
|
24
|
+
/** Fetch status of the selected feed's articles. */
|
|
25
|
+
export type RssArticlesStatus = 'loading' | 'error' | 'success';
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Same rule as the legacy RSS widget: an http(s) URL whose last path
|
|
3
|
+
* segment either has a feed extension or no extension at all.
|
|
4
|
+
*/
|
|
5
|
+
export declare function isValidRssFeedUrl(value: string): boolean;
|
|
6
|
+
/** Feed descriptions may contain HTML: only keep their text. */
|
|
7
|
+
export declare function htmlToText(html: string): string;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
const FEED_EXTENSIONS = [".rss", ".xml", ".rdf", ".atom", ".feed"];
|
|
2
|
+
function isValidRssFeedUrl(value) {
|
|
3
|
+
let url;
|
|
4
|
+
try {
|
|
5
|
+
url = new URL(value.trim());
|
|
6
|
+
} catch {
|
|
7
|
+
return !1;
|
|
8
|
+
}
|
|
9
|
+
if (url.protocol !== "http:" && url.protocol !== "https:") return !1;
|
|
10
|
+
const pathname = url.pathname.toLowerCase();
|
|
11
|
+
return !(pathname.split("/").pop() ?? "").includes(".") || FEED_EXTENSIONS.some((extension) => pathname.endsWith(extension));
|
|
12
|
+
}
|
|
13
|
+
function htmlToText(html) {
|
|
14
|
+
return (new DOMParser().parseFromString(html, "text/html").body.textContent ?? "").trim();
|
|
15
|
+
}
|
|
16
|
+
export {
|
|
17
|
+
htmlToText,
|
|
18
|
+
isValidRssFeedUrl
|
|
19
|
+
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
2
|
import SchoolSpace from "./SchoolSpace.js";
|
|
3
|
-
import { useUserSchools } from "
|
|
3
|
+
import { useUserSchools } from "../../hooks/useUserSchools.js";
|
|
4
4
|
function SchoolSpaceContainer() {
|
|
5
5
|
const {
|
|
6
6
|
handleSelectedSchoolChange,
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { TabsKidsItemProps } from './TabsKidsItem';
|
|
3
|
+
export interface TabsKidsProps {
|
|
4
|
+
/**
|
|
5
|
+
* Items to be displayed
|
|
6
|
+
*/
|
|
7
|
+
items: TabsKidsItemProps[];
|
|
8
|
+
/**
|
|
9
|
+
* Identifier of the selected item (controlled)
|
|
10
|
+
*/
|
|
11
|
+
activeId: string;
|
|
12
|
+
/**
|
|
13
|
+
* Get notified when an item is selected
|
|
14
|
+
*/
|
|
15
|
+
onChange: (id: string) => void;
|
|
16
|
+
/**
|
|
17
|
+
* Content of the selected tab, rendered in a panel below the tab bar
|
|
18
|
+
*/
|
|
19
|
+
children?: ReactNode;
|
|
20
|
+
/**
|
|
21
|
+
* Display the tab bar, even with a single item. When hidden, only the panel
|
|
22
|
+
* of the active item is rendered (e.g. for a student viewing their own data)
|
|
23
|
+
* @default true
|
|
24
|
+
*/
|
|
25
|
+
showTabBar?: boolean;
|
|
26
|
+
/**
|
|
27
|
+
* Accessible name of the tab list
|
|
28
|
+
*/
|
|
29
|
+
ariaLabel?: string;
|
|
30
|
+
/**
|
|
31
|
+
* Accessible name of the overflow dropdown trigger
|
|
32
|
+
*/
|
|
33
|
+
overflowLabel?: string;
|
|
34
|
+
/**
|
|
35
|
+
* Additional class name
|
|
36
|
+
*/
|
|
37
|
+
className?: string;
|
|
38
|
+
}
|
|
39
|
+
export declare const TabsKids: {
|
|
40
|
+
({ items, activeId, onChange, children, showTabBar, ariaLabel, overflowLabel, className, }: TabsKidsProps): import("react/jsx-runtime").JSX.Element;
|
|
41
|
+
displayName: string;
|
|
42
|
+
};
|
|
43
|
+
export default TabsKids;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
|
+
import clsx from "clsx";
|
|
3
|
+
import TabsKidsList from "./TabsKidsList.js";
|
|
4
|
+
const COMPACT_THRESHOLD = 3, TabsKids = ({
|
|
5
|
+
items,
|
|
6
|
+
activeId,
|
|
7
|
+
onChange,
|
|
8
|
+
children,
|
|
9
|
+
showTabBar = !0,
|
|
10
|
+
ariaLabel,
|
|
11
|
+
overflowLabel,
|
|
12
|
+
className
|
|
13
|
+
}) => {
|
|
14
|
+
const hasTabs = showTabBar && items.length > 0, activeItem = items.find((item) => item.id === activeId);
|
|
15
|
+
return /* @__PURE__ */ jsxs("div", { className: clsx("tabs-kids", className), children: [
|
|
16
|
+
hasTabs && /* @__PURE__ */ jsx(TabsKidsList, { items, activeId, onSelect: onChange, isCompact: items.length >= COMPACT_THRESHOLD, ariaLabel, overflowLabel }),
|
|
17
|
+
activeItem && /* @__PURE__ */ jsx("div", { id: hasTabs ? `tabs-kids-panel-${activeId}` : void 0, role: hasTabs ? "tabpanel" : "region", "aria-labelledby": hasTabs ? `tabs-kids-${activeId}` : void 0, "aria-label": hasTabs ? void 0 : activeItem.label, className: "tabs-kids-panel", children })
|
|
18
|
+
] });
|
|
19
|
+
};
|
|
20
|
+
export {
|
|
21
|
+
TabsKids,
|
|
22
|
+
TabsKids as default
|
|
23
|
+
};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { KeyboardEvent, Ref } from 'react';
|
|
2
|
+
export interface TabsKidsItemProps {
|
|
3
|
+
/**
|
|
4
|
+
* Item identifier
|
|
5
|
+
*/
|
|
6
|
+
id: string;
|
|
7
|
+
/**
|
|
8
|
+
* Item label
|
|
9
|
+
*/
|
|
10
|
+
label: string;
|
|
11
|
+
/**
|
|
12
|
+
* Optional avatar URL displayed before the label
|
|
13
|
+
*/
|
|
14
|
+
avatar?: string;
|
|
15
|
+
}
|
|
16
|
+
interface TabsKidsItemInternalProps extends TabsKidsItemProps {
|
|
17
|
+
isActive: boolean;
|
|
18
|
+
/**
|
|
19
|
+
* Display only the initial of the label when the tab is inactive
|
|
20
|
+
*/
|
|
21
|
+
isCompact: boolean;
|
|
22
|
+
/**
|
|
23
|
+
* Hidden copy only used to measure the tab width: no id nor tab semantics
|
|
24
|
+
*/
|
|
25
|
+
isMeasure?: boolean;
|
|
26
|
+
onSelect?: (id: string) => void;
|
|
27
|
+
onKeyDown?: (event: KeyboardEvent<HTMLButtonElement>) => void;
|
|
28
|
+
buttonRef?: Ref<HTMLButtonElement>;
|
|
29
|
+
}
|
|
30
|
+
declare const TabsKidsItem: {
|
|
31
|
+
({ id, label, avatar, isActive, isCompact, isMeasure, onSelect, onKeyDown, buttonRef, }: TabsKidsItemInternalProps): import("react/jsx-runtime").JSX.Element;
|
|
32
|
+
displayName: string;
|
|
33
|
+
};
|
|
34
|
+
export default TabsKidsItem;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
|
+
import clsx from "clsx";
|
|
3
|
+
import Avatar from "../../../../../components/Avatar/Avatar.js";
|
|
4
|
+
const TabsKidsItem = ({
|
|
5
|
+
id,
|
|
6
|
+
label,
|
|
7
|
+
avatar,
|
|
8
|
+
isActive,
|
|
9
|
+
isCompact,
|
|
10
|
+
isMeasure = !1,
|
|
11
|
+
onSelect,
|
|
12
|
+
onKeyDown,
|
|
13
|
+
buttonRef
|
|
14
|
+
}) => {
|
|
15
|
+
const isAbbreviated = isCompact && !isActive, displayedLabel = isAbbreviated ? `${label.trim().charAt(0).toUpperCase()}.` : label;
|
|
16
|
+
return /* @__PURE__ */ jsxs("button", { ref: buttonRef, type: "button", role: isMeasure ? void 0 : "tab", id: isMeasure ? void 0 : `tabs-kids-${id}`, "aria-selected": isMeasure ? void 0 : isActive, "aria-controls": isActive && !isMeasure ? `tabs-kids-panel-${id}` : void 0, tabIndex: isActive && !isMeasure ? 0 : -1, title: isMeasure ? void 0 : label, "aria-label": isAbbreviated && !isMeasure ? label : void 0, className: clsx("tabs-kids-item", {
|
|
17
|
+
active: isActive,
|
|
18
|
+
compact: isAbbreviated
|
|
19
|
+
}), onClick: () => onSelect == null ? void 0 : onSelect(id), onKeyDown, children: [
|
|
20
|
+
avatar && /* @__PURE__ */ jsx("span", { className: "tabs-kids-item-avatar", children: /* @__PURE__ */ jsx(Avatar, { alt: "", size: "xs", variant: "circle", src: avatar }) }),
|
|
21
|
+
/* @__PURE__ */ jsx("span", { className: "tabs-kids-item-label", children: displayedLabel })
|
|
22
|
+
] });
|
|
23
|
+
};
|
|
24
|
+
export {
|
|
25
|
+
TabsKidsItem as default
|
|
26
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { TabsKidsItemProps } from './TabsKidsItem';
|
|
2
|
+
interface TabsKidsListProps {
|
|
3
|
+
items: TabsKidsItemProps[];
|
|
4
|
+
activeId: string;
|
|
5
|
+
onSelect: (id: string) => void;
|
|
6
|
+
isCompact: boolean;
|
|
7
|
+
ariaLabel?: string;
|
|
8
|
+
overflowLabel?: string;
|
|
9
|
+
}
|
|
10
|
+
declare const TabsKidsList: {
|
|
11
|
+
({ items, activeId, onSelect, isCompact, ariaLabel, overflowLabel, }: TabsKidsListProps): import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
displayName: string;
|
|
13
|
+
};
|
|
14
|
+
export default TabsKidsList;
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { jsxs, jsx, Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { useRef } from "react";
|
|
3
|
+
import SvgIconUsers from "../../../../icons/components/IconUsers.js";
|
|
4
|
+
import { useTabsKidsOverflow } from "../hooks/useTabsKidsOverflow.js";
|
|
5
|
+
import TabsKidsItem from "./TabsKidsItem.js";
|
|
6
|
+
import { useTranslation } from "react-i18next";
|
|
7
|
+
import Dropdown from "../../../../../components/Dropdown/Dropdown.js";
|
|
8
|
+
import ButtonBeta from "../../../../../components/ButtonBeta/ButtonBeta.js";
|
|
9
|
+
const TabsKidsList = ({
|
|
10
|
+
items,
|
|
11
|
+
activeId,
|
|
12
|
+
onSelect,
|
|
13
|
+
isCompact,
|
|
14
|
+
ariaLabel,
|
|
15
|
+
overflowLabel
|
|
16
|
+
}) => {
|
|
17
|
+
const {
|
|
18
|
+
t
|
|
19
|
+
} = useTranslation(), tabsRef = useRef([]), {
|
|
20
|
+
tabBarRef,
|
|
21
|
+
measureRef,
|
|
22
|
+
visibleItems,
|
|
23
|
+
overflowItems
|
|
24
|
+
} = useTabsKidsOverflow({
|
|
25
|
+
items,
|
|
26
|
+
activeId,
|
|
27
|
+
isCompact
|
|
28
|
+
}), handleKeyDown = (event, order) => {
|
|
29
|
+
var _a;
|
|
30
|
+
const last = visibleItems.length - 1;
|
|
31
|
+
let next;
|
|
32
|
+
switch (event.key) {
|
|
33
|
+
case "ArrowRight":
|
|
34
|
+
next = order === last ? 0 : order + 1;
|
|
35
|
+
break;
|
|
36
|
+
case "ArrowLeft":
|
|
37
|
+
next = order === 0 ? last : order - 1;
|
|
38
|
+
break;
|
|
39
|
+
case "Home":
|
|
40
|
+
next = 0;
|
|
41
|
+
break;
|
|
42
|
+
case "End":
|
|
43
|
+
next = last;
|
|
44
|
+
break;
|
|
45
|
+
}
|
|
46
|
+
next !== void 0 && (event.preventDefault(), (_a = tabsRef.current[next]) == null || _a.focus(), onSelect(visibleItems[next].id));
|
|
47
|
+
};
|
|
48
|
+
return /* @__PURE__ */ jsxs("div", { className: "tabs-kids-bar", ref: tabBarRef, children: [
|
|
49
|
+
/* @__PURE__ */ jsx("div", { className: "tabs-kids-list", role: "tablist", "aria-label": ariaLabel, children: visibleItems.map((item, order) => /* @__PURE__ */ jsx(TabsKidsItem, { ...item, isActive: item.id === activeId, isCompact, onSelect, onKeyDown: (event) => handleKeyDown(event, order), buttonRef: (el) => {
|
|
50
|
+
tabsRef.current[order] = el;
|
|
51
|
+
} }, item.id)) }),
|
|
52
|
+
overflowItems.length > 0 && /* @__PURE__ */ jsx("div", { className: "tabs-kids-overflow", children: /* @__PURE__ */ jsx(Dropdown, { placement: "bottom-end", children: (triggerProps) => /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
53
|
+
/* @__PURE__ */ jsx(ButtonBeta, { ...triggerProps, type: "button", "aria-label": overflowLabel ?? t("homepage.tabsKids.see.more", "Voir plus"), color: "default", variant: "ghost", leftIcon: /* @__PURE__ */ jsx(SvgIconUsers, {}) }),
|
|
54
|
+
/* @__PURE__ */ jsx(Dropdown.Menu, { children: overflowItems.map((item) => /* @__PURE__ */ jsx(Dropdown.RadioItem, { value: item.id, model: activeId, onChange: onSelect, children: item.label }, item.id)) })
|
|
55
|
+
] }) }) }),
|
|
56
|
+
/* @__PURE__ */ jsx("div", { className: "tabs-kids-measure", "aria-hidden": "true", children: /* @__PURE__ */ jsxs("div", { className: "tabs-kids-measure-content", ref: measureRef, children: [
|
|
57
|
+
items.map((item) => /* @__PURE__ */ jsx(TabsKidsItem, { ...item, isActive: item.id === activeId, isCompact, isMeasure: !0 }, item.id)),
|
|
58
|
+
/* @__PURE__ */ jsx("div", { className: "tabs-kids-overflow tabs-kids-measure-trigger", children: /* @__PURE__ */ jsx(ButtonBeta, { tabIndex: -1, "aria-label": "", color: "default", variant: "ghost", leftIcon: /* @__PURE__ */ jsx(SvgIconUsers, {}) }) })
|
|
59
|
+
] }) })
|
|
60
|
+
] });
|
|
61
|
+
};
|
|
62
|
+
export {
|
|
63
|
+
TabsKidsList as default
|
|
64
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { TabsKidsItemProps } from '../components/TabsKidsItem';
|
|
2
|
+
interface UseTabsKidsOverflowProps {
|
|
3
|
+
items: TabsKidsItemProps[];
|
|
4
|
+
activeId: string;
|
|
5
|
+
isCompact: boolean;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* Splits the items between the visible tabs and the overflow dropdown,
|
|
9
|
+
* according to the space available in the tab bar.
|
|
10
|
+
*
|
|
11
|
+
* Tied to the markup of `TabsKidsList`: `measureRef` must contain a hidden
|
|
12
|
+
* copy of every `.tabs-kids-item` and the `.tabs-kids-measure-trigger`.
|
|
13
|
+
*/
|
|
14
|
+
export declare const useTabsKidsOverflow: ({ items, activeId, isCompact, }: UseTabsKidsOverflowProps) => {
|
|
15
|
+
tabBarRef: import('react').RefObject<HTMLDivElement>;
|
|
16
|
+
measureRef: import('react').RefObject<HTMLDivElement>;
|
|
17
|
+
visibleItems: TabsKidsItemProps[];
|
|
18
|
+
overflowItems: TabsKidsItemProps[];
|
|
19
|
+
};
|
|
20
|
+
export {};
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { useRef, useState, useCallback, useLayoutEffect, useMemo } from "react";
|
|
2
|
+
import { getVisibleCount, getVisibleIndexes } from "../utils/visibleTabs.js";
|
|
3
|
+
const useTabsKidsOverflow = ({
|
|
4
|
+
items,
|
|
5
|
+
activeId,
|
|
6
|
+
isCompact
|
|
7
|
+
}) => {
|
|
8
|
+
const tabBarRef = useRef(null), measureRef = useRef(null), [visibleCount, setVisibleCount] = useState(items.length), activeIndex = items.findIndex((item) => item.id === activeId), activeIndexRef = useRef(activeIndex);
|
|
9
|
+
activeIndexRef.current = activeIndex;
|
|
10
|
+
const updateVisibleCount = useCallback(() => {
|
|
11
|
+
const bar = tabBarRef.current, measure = measureRef.current;
|
|
12
|
+
if (!bar || !measure) return;
|
|
13
|
+
const barStyle = getComputedStyle(bar), available = bar.clientWidth - parseFloat(barStyle.paddingInlineStart) - parseFloat(barStyle.paddingInlineEnd), tabs = Array.from(measure.querySelectorAll(".tabs-kids-item")), trigger = measure.querySelector(".tabs-kids-measure-trigger"), gap = parseFloat(barStyle.columnGap) || 0, corner = tabs[0] && parseFloat(getComputedStyle(tabs[0], "::after").width) || 0;
|
|
14
|
+
setVisibleCount(getVisibleCount(tabs.map((tab) => tab.offsetWidth), activeIndexRef.current, available, gap, (trigger == null ? void 0 : trigger.offsetWidth) ?? 0, corner));
|
|
15
|
+
}, []);
|
|
16
|
+
useLayoutEffect(() => {
|
|
17
|
+
updateVisibleCount();
|
|
18
|
+
}, [updateVisibleCount, items, isCompact]), useLayoutEffect(() => {
|
|
19
|
+
const bar = tabBarRef.current;
|
|
20
|
+
if (!bar || typeof ResizeObserver > "u") return;
|
|
21
|
+
const observer = new ResizeObserver(() => updateVisibleCount());
|
|
22
|
+
return observer.observe(bar), () => observer.disconnect();
|
|
23
|
+
}, [updateVisibleCount]);
|
|
24
|
+
const {
|
|
25
|
+
visibleItems,
|
|
26
|
+
overflowItems
|
|
27
|
+
} = useMemo(() => {
|
|
28
|
+
const indexes = getVisibleIndexes(items.length, visibleCount, activeIndex);
|
|
29
|
+
return {
|
|
30
|
+
visibleItems: indexes.map((i) => items[i]),
|
|
31
|
+
overflowItems: items.filter((_, i) => !indexes.includes(i))
|
|
32
|
+
};
|
|
33
|
+
}, [items, visibleCount, activeIndex]);
|
|
34
|
+
return {
|
|
35
|
+
tabBarRef,
|
|
36
|
+
measureRef,
|
|
37
|
+
visibleItems,
|
|
38
|
+
overflowItems
|
|
39
|
+
};
|
|
40
|
+
};
|
|
41
|
+
export {
|
|
42
|
+
useTabsKidsOverflow
|
|
43
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Returns how many tabs fit in the available space. The active tab is always
|
|
3
|
+
* counted, then the other tabs are added from the start until one does not
|
|
4
|
+
* fit. Never returns less than one.
|
|
5
|
+
*
|
|
6
|
+
* Tabs are laid out without gap between them. `gap` is the space between the
|
|
7
|
+
* tab list and the overflow dropdown trigger, `trigger` the width of that
|
|
8
|
+
* trigger, `corner` the room needed after the last tab for its inverted corner.
|
|
9
|
+
*/
|
|
10
|
+
export declare const getVisibleCount: (widths: number[], activeIndex: number, available: number, gap: number, trigger: number, corner: number) => number;
|
|
11
|
+
/**
|
|
12
|
+
* Returns the indexes of the visible tabs: the first `count` items, the last
|
|
13
|
+
* one being replaced by the active item when it is not among them.
|
|
14
|
+
*/
|
|
15
|
+
export declare const getVisibleIndexes: (length: number, count: number, activeIndex: number) => number[];
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
const getVisibleCount = (widths, activeIndex, available, gap, trigger, corner) => {
|
|
2
|
+
if (widths.reduce((sum, w) => sum + w, 0) + corner <= available) return widths.length;
|
|
3
|
+
const pinned = activeIndex < 0 ? 0 : activeIndex, budget = available - corner - gap - trigger;
|
|
4
|
+
let used = widths[pinned], count = 1;
|
|
5
|
+
for (let i = 0; i < widths.length; i++)
|
|
6
|
+
if (i !== pinned) {
|
|
7
|
+
if (used + widths[i] > budget) break;
|
|
8
|
+
used += widths[i], count++;
|
|
9
|
+
}
|
|
10
|
+
return count;
|
|
11
|
+
}, getVisibleIndexes = (length, count, activeIndex) => {
|
|
12
|
+
if (length === 0) return [];
|
|
13
|
+
const visibleCount = Math.max(1, Math.min(count, length)), indexes = Array.from({
|
|
14
|
+
length: visibleCount
|
|
15
|
+
}, (_, i) => i);
|
|
16
|
+
return activeIndex >= visibleCount && (indexes[visibleCount - 1] = activeIndex), indexes;
|
|
17
|
+
};
|
|
18
|
+
export {
|
|
19
|
+
getVisibleCount,
|
|
20
|
+
getVisibleIndexes
|
|
21
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { School } from '@edifice.io/client';
|
|
2
|
+
export interface UniversalisProps {
|
|
3
|
+
handleActionClick: () => void;
|
|
4
|
+
selectedSchool?: School;
|
|
5
|
+
onSelectedSchoolChange?: (school: School) => void;
|
|
6
|
+
schools?: School[];
|
|
7
|
+
}
|
|
8
|
+
export default function Universalis({ handleActionClick, selectedSchool, onSelectedSchoolChange, schools, }: UniversalisProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { jsxs, jsx, Fragment } from "react/jsx-runtime";
|
|
2
|
+
import illuUniversalis from "@edifice.io/bootstrap/dist/images/homepage/illu-universalis.png";
|
|
3
|
+
import clsx from "clsx";
|
|
4
|
+
import { useState } from "react";
|
|
5
|
+
import { useForm } from "react-hook-form";
|
|
6
|
+
import { useTranslation } from "react-i18next";
|
|
7
|
+
import SvgIconExternalLink from "../../../icons/components/IconExternalLink.js";
|
|
8
|
+
import SvgIconRafterDown from "../../../icons/components/IconRafterDown.js";
|
|
9
|
+
import SvgIconSearch from "../../../icons/components/IconSearch.js";
|
|
10
|
+
import HomeCard from "../HomeCard/HomeCard.js";
|
|
11
|
+
import ButtonBeta from "../../../../components/ButtonBeta/ButtonBeta.js";
|
|
12
|
+
import Image from "../../../../components/Image/Image.js";
|
|
13
|
+
import Dropdown from "../../../../components/Dropdown/Dropdown.js";
|
|
14
|
+
import FormControl from "../../../../components/Form/FormControl.js";
|
|
15
|
+
import Input from "../../../../components/Input/Input.js";
|
|
16
|
+
import { getRotateTransitionStyle } from "../../../../utilities/rotate-transition-style/get-rotate-transition-style.js";
|
|
17
|
+
const UNIVERSALIS_ENGINE_PARAM = "www";
|
|
18
|
+
function Universalis({
|
|
19
|
+
handleActionClick,
|
|
20
|
+
selectedSchool,
|
|
21
|
+
onSelectedSchoolChange,
|
|
22
|
+
schools
|
|
23
|
+
}) {
|
|
24
|
+
const {
|
|
25
|
+
t
|
|
26
|
+
} = useTranslation(), {
|
|
27
|
+
register
|
|
28
|
+
} = useForm(), [isExpanded, setIsExpanded] = useState(!1), hasManySchools = !!(schools && schools.length > 1), hasUai = !!(selectedSchool != null && selectedSchool.UAI), searchLabel = t(hasUai ? "search" : "homepage.widget.universalis.noUai");
|
|
29
|
+
return /* @__PURE__ */ jsxs(HomeCard, { variant: "primary", children: [
|
|
30
|
+
/* @__PURE__ */ jsxs("div", { className: "universalis__header", children: [
|
|
31
|
+
/* @__PURE__ */ jsx("h3", { className: "universalis__title", children: t("homepage.widget.universalis.title") }),
|
|
32
|
+
/* @__PURE__ */ jsx(ButtonBeta, { className: "universalis__header-button", "data-testid": "universalis-button-open", "aria-label": t("homepage.widget.universalis.open"), onClick: handleActionClick, leftIcon: /* @__PURE__ */ jsx(SvgIconExternalLink, {}), variant: "ghost", color: "tertiary" })
|
|
33
|
+
] }),
|
|
34
|
+
/* @__PURE__ */ jsx(HomeCard.Content, { children: /* @__PURE__ */ jsxs("div", { className: "universalis", children: [
|
|
35
|
+
/* @__PURE__ */ jsxs("div", { className: "universalis__intro", children: [
|
|
36
|
+
/* @__PURE__ */ jsx(Image, { src: illuUniversalis, alt: "Universalis Éducation", className: "universalis__logo" }),
|
|
37
|
+
/* @__PURE__ */ jsx("p", { className: "universalis__description", children: t("homepage.widget.universalis.description") })
|
|
38
|
+
] }),
|
|
39
|
+
hasManySchools && /* @__PURE__ */ jsx(Dropdown, { placement: "bottom-start", onToggle: setIsExpanded, children: (triggerProps) => /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
40
|
+
/* @__PURE__ */ jsxs("button", { ...triggerProps, type: "button", "aria-expanded": isExpanded, className: clsx("universalis__school-selector", {
|
|
41
|
+
"universalis__school-selector--open": isExpanded
|
|
42
|
+
}), children: [
|
|
43
|
+
/* @__PURE__ */ jsx("span", { className: "universalis__school-selector-label", children: selectedSchool == null ? void 0 : selectedSchool.name }),
|
|
44
|
+
/* @__PURE__ */ jsx(SvgIconRafterDown, { className: "universalis__school-selector-icon", style: getRotateTransitionStyle(isExpanded, {
|
|
45
|
+
degrees: 180
|
|
46
|
+
}) })
|
|
47
|
+
] }),
|
|
48
|
+
/* @__PURE__ */ jsx(Dropdown.Menu, { children: schools == null ? void 0 : schools.map((school) => /* @__PURE__ */ jsx(Dropdown.Item, { onClick: () => onSelectedSchoolChange == null ? void 0 : onSelectedSchoolChange(school), children: school.name }, school.id)) })
|
|
49
|
+
] }) }),
|
|
50
|
+
/* @__PURE__ */ jsx("form", { method: "GET", action: "https://www.universalis-edu.com/nomade/precherche/", target: "_blank", className: "universalis__search", children: /* @__PURE__ */ jsxs(FormControl, { id: "inputUniversalisQuery", className: "universalis__search-field", children: [
|
|
51
|
+
/* @__PURE__ */ jsx(FormControl.Label, { className: "visually-hidden", children: searchLabel }),
|
|
52
|
+
/* @__PURE__ */ jsx(Input, { placeholder: searchLabel, size: "md", type: "text", maxLength: 255, disabled: !hasUai, ...register("q") }),
|
|
53
|
+
/* @__PURE__ */ jsx("input", { type: "hidden", name: "r", value: UNIVERSALIS_ENGINE_PARAM }),
|
|
54
|
+
/* @__PURE__ */ jsx("input", { type: "hidden", name: "uai", value: selectedSchool == null ? void 0 : selectedSchool.UAI }),
|
|
55
|
+
/* @__PURE__ */ jsx(ButtonBeta, { leftIcon: /* @__PURE__ */ jsx(SvgIconSearch, {}), type: "submit", "aria-label": searchLabel, variant: "filled", color: "default", disabled: !hasUai })
|
|
56
|
+
] }) })
|
|
57
|
+
] }) })
|
|
58
|
+
] });
|
|
59
|
+
}
|
|
60
|
+
export {
|
|
61
|
+
Universalis as default
|
|
62
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function UniversalisContainer(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { WIDGET_NAME } from "@edifice.io/client";
|
|
3
|
+
import { useUserSchools } from "../../hooks/useUserSchools.js";
|
|
4
|
+
import Universalis from "./Universalis.js";
|
|
5
|
+
function UniversalisContainer() {
|
|
6
|
+
const {
|
|
7
|
+
handleSelectedSchoolChange,
|
|
8
|
+
...otherProps
|
|
9
|
+
} = useUserSchools(WIDGET_NAME.UNIVERSALIS);
|
|
10
|
+
return /* @__PURE__ */ jsx(Universalis, { handleActionClick: () => {
|
|
11
|
+
window.open("http://www.universalis-edu.com", "_blank", "noopener,noreferrer");
|
|
12
|
+
}, onSelectedSchoolChange: handleSelectedSchoolChange, ...otherProps });
|
|
13
|
+
}
|
|
14
|
+
export {
|
|
15
|
+
UniversalisContainer
|
|
16
|
+
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
2
|
import { useTranslation } from "react-i18next";
|
|
3
|
-
import
|
|
3
|
+
import illuEmptyFeeds from "@edifice.io/bootstrap/dist/images/homepage/illu-empty-useful-links.png";
|
|
4
4
|
import SvgIconEdit from "../../../icons/components/IconEdit.js";
|
|
5
5
|
import HomeCard from "../HomeCard/HomeCard.js";
|
|
6
6
|
import Image from "../../../../components/Image/Image.js";
|
|
@@ -18,7 +18,7 @@ function UsefulLinks({
|
|
|
18
18
|
"data-testid": "usefullinks-button-edit"
|
|
19
19
|
} }),
|
|
20
20
|
/* @__PURE__ */ jsx(HomeCard.Content, { children: links.length === 0 ? /* @__PURE__ */ jsxs("div", { className: "useful-links-widget__empty", children: [
|
|
21
|
-
/* @__PURE__ */ jsx(Image, { src:
|
|
21
|
+
/* @__PURE__ */ jsx(Image, { src: illuEmptyFeeds, alt: "", "aria-hidden": "true", style: {
|
|
22
22
|
width: 160,
|
|
23
23
|
height: 87
|
|
24
24
|
} }),
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx, jsxs, Fragment } from "react/jsx-runtime";
|
|
2
2
|
import { useTranslation } from "react-i18next";
|
|
3
|
-
import
|
|
3
|
+
import illuEmptyFeeds from "@edifice.io/bootstrap/dist/images/homepage/illu-empty-useful-links.png";
|
|
4
4
|
import SvgIconClose from "../../../icons/components/IconClose.js";
|
|
5
5
|
import SvgIconEdit from "../../../icons/components/IconEdit.js";
|
|
6
6
|
import SvgIconPlus from "../../../icons/components/IconPlus.js";
|
|
@@ -29,7 +29,7 @@ function UsefulLinksModal({
|
|
|
29
29
|
/* @__PURE__ */ jsx(ModalBeta.Body, { children: links.length === 0 ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
30
30
|
/* @__PURE__ */ jsx(Flex, { justify: "end", className: "mb-16", children: addLinkButton }),
|
|
31
31
|
/* @__PURE__ */ jsxs("div", { className: "useful-links-modal__empty", children: [
|
|
32
|
-
/* @__PURE__ */ jsx(Image, { src:
|
|
32
|
+
/* @__PURE__ */ jsx(Image, { src: illuEmptyFeeds, alt: "", "aria-hidden": "true", style: {
|
|
33
33
|
width: 200,
|
|
34
34
|
height: 109
|
|
35
35
|
} }),
|
|
@@ -5,8 +5,10 @@ export type UserSpaceProps = {
|
|
|
5
5
|
avatar: string;
|
|
6
6
|
profile: UserProfile[number];
|
|
7
7
|
children?: ReactNode;
|
|
8
|
+
/** Renders a trigger button in the top-right corner when provided. */
|
|
9
|
+
onCustomizeWidgetsClick?: () => void;
|
|
8
10
|
};
|
|
9
|
-
declare function UserSpace({ name, avatar, profile, children, }: UserSpaceProps): import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
declare function UserSpace({ name, avatar, profile, children, onCustomizeWidgetsClick, }: UserSpaceProps): import("react/jsx-runtime").JSX.Element;
|
|
10
12
|
declare namespace UserSpace {
|
|
11
13
|
var displayName: string;
|
|
12
14
|
}
|