@edifice.io/react 2.6.7-develop-b2school.20261005112514 → 2.6.7-develop-pedago.20261005162423
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/Layout/Layout.js +5 -17
- package/dist/homepage.js +2 -5
- package/dist/hooks/useZendeskGuide/useZendeskGuide.d.ts +1 -3
- package/dist/hooks/useZendeskGuide/useZendeskGuide.js +3 -10
- package/dist/icons.js +402 -404
- package/dist/modules/editor/components/EditorToolbar/EditorToolbar.Typography.js +3 -3
- package/dist/modules/homepage/components/Communities/Communities.d.ts +2 -1
- package/dist/modules/homepage/components/Communities/Communities.js +14 -13
- package/dist/modules/homepage/components/Communities/CommunitiesContainer.d.ts +1 -1
- package/dist/modules/homepage/components/Communities/CommunitiesContainer.js +9 -5
- package/dist/modules/homepage/components/Communities/CommunitiesSkeleton.js +4 -7
- package/dist/modules/homepage/components/Communities/useCommunities.d.ts +4 -1
- package/dist/modules/homepage/components/Communities/useCommunities.js +8 -3
- package/dist/modules/homepage/components/HomeCard/HomeCardHeader.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 -2
- package/dist/modules/icons/components/index.d.ts +0 -1
- package/package.json +6 -6
- 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
|
@@ -30,9 +30,9 @@ const EditorToolbarTypography = ({
|
|
|
30
30
|
label: t("tiptap.toolbar.typo.mono"),
|
|
31
31
|
className: "ff-script"
|
|
32
32
|
}, {
|
|
33
|
-
value: "
|
|
34
|
-
label: t("tiptap.toolbar.typo.
|
|
35
|
-
className: "ff-
|
|
33
|
+
value: "Marelle",
|
|
34
|
+
label: t("tiptap.toolbar.typo.marelle"),
|
|
35
|
+
className: "ff-marelle"
|
|
36
36
|
}, {
|
|
37
37
|
value: "OpenDyslexic",
|
|
38
38
|
label: t("tiptap.toolbar.typo.dyslexic"),
|
|
@@ -2,9 +2,10 @@ import { CommunityItemProps } from './CommunityItem';
|
|
|
2
2
|
export interface CommunitiesProps {
|
|
3
3
|
communitiesList?: CommunityItemProps[];
|
|
4
4
|
handleActionClick: () => void;
|
|
5
|
+
canCreateCommunity?: boolean;
|
|
5
6
|
}
|
|
6
7
|
declare const Communities: {
|
|
7
|
-
({ communitiesList, handleActionClick, }: CommunitiesProps): import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
({ communitiesList, handleActionClick, canCreateCommunity, }: CommunitiesProps): import("react/jsx-runtime").JSX.Element;
|
|
8
9
|
displayName: string;
|
|
9
10
|
};
|
|
10
11
|
export default Communities;
|
|
@@ -1,32 +1,33 @@
|
|
|
1
|
-
import { jsxs, jsx } from "react/jsx-runtime";
|
|
1
|
+
import { jsxs, jsx, Fragment } from "react/jsx-runtime";
|
|
2
2
|
import illuCommunities from "@edifice.io/bootstrap/dist/images/homepage/illu-communities.svg";
|
|
3
|
-
import { useMeasure } from "@uidotdev/usehooks";
|
|
4
3
|
import { useTranslation } from "react-i18next";
|
|
5
4
|
import SvgIconArrowRight from "../../../icons/components/IconArrowRight.js";
|
|
6
5
|
import CommunityItem from "./CommunityItem.js";
|
|
7
6
|
import HomeCard from "../HomeCard/HomeCard.js";
|
|
8
7
|
import Flex from "../../../../components/Flex/Flex.js";
|
|
9
8
|
import Image from "../../../../components/Image/Image.js";
|
|
10
|
-
const
|
|
9
|
+
const Communities = ({
|
|
11
10
|
communitiesList = [],
|
|
12
|
-
handleActionClick
|
|
11
|
+
handleActionClick,
|
|
12
|
+
canCreateCommunity = !1
|
|
13
13
|
}) => {
|
|
14
14
|
const {
|
|
15
15
|
t
|
|
16
|
-
} = useTranslation()
|
|
17
|
-
width
|
|
18
|
-
}] = useMeasure(), maxItems = width !== null && width < NARROW_CONTAINER_WIDTH ? MAX_ITEMS_NARROW : MAX_ITEMS, visibleCommunities = communitiesList.slice(0, maxItems), itemWidth = `${100 / maxItems}%`;
|
|
16
|
+
} = useTranslation();
|
|
19
17
|
return /* @__PURE__ */ jsxs(HomeCard, { variant: "primary", children: [
|
|
20
|
-
/* @__PURE__ */ jsx(HomeCard.Header, { actionLabel: communitiesList.length > 0 ? t("homepage.communities.actionLabel.seeMore") : t("homepage.communities.actionLabel.create"), actionRightIcon: /* @__PURE__ */ jsx(SvgIconArrowRight, {}), onActionClick: handleActionClick, title: t("homepage.communities.title") }),
|
|
21
|
-
/* @__PURE__ */ jsx(HomeCard.Content, { children: /* @__PURE__ */ jsx(Flex, {
|
|
18
|
+
/* @__PURE__ */ jsx(HomeCard.Header, { actionLabel: communitiesList.length > 0 || !canCreateCommunity ? t("homepage.communities.actionLabel.seeMore", "Voir plus") : t("homepage.communities.actionLabel.create", "Créer une communauté"), actionRightIcon: /* @__PURE__ */ jsx(SvgIconArrowRight, {}), onActionClick: handleActionClick, title: t("homepage.communities.title", "Mes communautés") }),
|
|
19
|
+
/* @__PURE__ */ jsx(HomeCard.Content, { className: "communities-content", children: /* @__PURE__ */ jsx(Flex, { gap: "16", children: communitiesList.length > 0 ? /* @__PURE__ */ jsx("div", { className: "communities-list", children: communitiesList.map((community, index) => /* @__PURE__ */ jsx(CommunityItem, { title: community.title, communityImage: community.communityImage, onActionClick: community.onActionClick, nbNotifications: community.nbNotifications, width: "auto" }, index)) }) : /* @__PURE__ */ jsxs("div", { className: "communities-empty", children: [
|
|
22
20
|
/* @__PURE__ */ jsx(Image, { src: illuCommunities, alt: "", "aria-hidden": "true", style: {
|
|
23
21
|
width: 80,
|
|
24
22
|
height: 80
|
|
25
23
|
} }),
|
|
26
|
-
/* @__PURE__ */
|
|
27
|
-
/* @__PURE__ */ jsx("p", { className: "communities-empty-title", children: t("homepage.communities.subtitle", "
|
|
28
|
-
/* @__PURE__ */ jsx("p", { className: "communities-empty-description", children: t("homepage.communities.description", "
|
|
29
|
-
] })
|
|
24
|
+
/* @__PURE__ */ jsx("div", { className: "communities-empty-content", children: canCreateCommunity ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
25
|
+
/* @__PURE__ */ jsx("p", { className: "communities-empty-title", children: t("homepage.communities.subtitle.teacher", "Réunissez vos élèves avec Communautés !") }),
|
|
26
|
+
/* @__PURE__ */ jsx("p", { className: "communities-empty-description", children: t("homepage.communities.description.teacher", "Centralisez et organisez les documents et les ressources pour vos groupes d'élèves.") })
|
|
27
|
+
] }) : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
28
|
+
/* @__PURE__ */ jsx("p", { className: "communities-empty-title", children: t("homepage.communities.subtitle.student", "Retrouvez toutes vos communautés ici ! ") }),
|
|
29
|
+
/* @__PURE__ */ jsx("p", { className: "communities-empty-description", children: t("homepage.communities.description.student", `Consultez l'onglet "Nouveaux partages" pour découvrir si vous avez été ajouté à une nouvelle communauté.`) })
|
|
30
|
+
] }) })
|
|
30
31
|
] }) }) })
|
|
31
32
|
] });
|
|
32
33
|
};
|
|
@@ -5,7 +5,7 @@ export type CommunitiesContainerProps = {
|
|
|
5
5
|
/** Handle a click on the header action button. If undefined, communities (or the community creation flow) will be opened. */
|
|
6
6
|
onHeaderActionClick?: () => void;
|
|
7
7
|
};
|
|
8
|
-
export declare function CommunitiesContainer({ onCommunityClick: handleCommunityClick, onHeaderActionClick: handleHeaderActionClick, }: CommunitiesContainerProps): import("react/jsx-runtime").JSX.Element | "An error occurred while loading communities.";
|
|
8
|
+
export declare function CommunitiesContainer({ onCommunityClick: handleCommunityClick, onHeaderActionClick: handleHeaderActionClick, }: CommunitiesContainerProps): import("react/jsx-runtime").JSX.Element | "An error occurred while loading communities." | null;
|
|
9
9
|
export declare namespace CommunitiesContainer {
|
|
10
10
|
var displayName: string;
|
|
11
11
|
}
|
|
@@ -3,28 +3,32 @@ import { useCallback, useMemo } from "react";
|
|
|
3
3
|
import Communities from "./Communities.js";
|
|
4
4
|
import CommunitiesSkeleton from "./CommunitiesSkeleton.js";
|
|
5
5
|
import { useCommunities } from "./useCommunities.js";
|
|
6
|
+
import useHasWorkflow from "../../../../hooks/useHasWorkflow/useHasWorkflow.js";
|
|
7
|
+
const COMMUNITY_ACCESS_WORKFLOW = "community.access", COMMUNITY_CREATE_WORKFLOW = "community.create", COMMUNITY_WORKFLOWS = [COMMUNITY_ACCESS_WORKFLOW, COMMUNITY_CREATE_WORKFLOW];
|
|
6
8
|
function CommunitiesContainer({
|
|
7
9
|
onCommunityClick: handleCommunityClick = (community) => {
|
|
8
10
|
window.open(`/communities/id/${community.id}/home`, "_self");
|
|
9
11
|
},
|
|
10
12
|
onHeaderActionClick: handleHeaderActionClick
|
|
11
13
|
}) {
|
|
12
|
-
const {
|
|
14
|
+
const rights = useHasWorkflow(COMMUNITY_WORKFLOWS), canCreateCommunity = (rights == null ? void 0 : rights[COMMUNITY_CREATE_WORKFLOW]) === !0, hasCommunitiesRight = canCreateCommunity || (rights == null ? void 0 : rights[COMMUNITY_ACCESS_WORKFLOW]) === !0, {
|
|
13
15
|
communities,
|
|
14
16
|
isLoading,
|
|
15
17
|
error
|
|
16
|
-
} = useCommunities(
|
|
18
|
+
} = useCommunities({
|
|
19
|
+
enabled: hasCommunitiesRight
|
|
20
|
+
}), handleActionClick = useCallback(() => {
|
|
17
21
|
if (handleHeaderActionClick) {
|
|
18
22
|
handleHeaderActionClick();
|
|
19
23
|
return;
|
|
20
24
|
}
|
|
21
|
-
window.open(communities.length
|
|
22
|
-
}, [handleHeaderActionClick, communities.length]), mappedCommunities = useMemo(() => communities.map((community) => ({
|
|
25
|
+
window.open(communities.length === 0 && canCreateCommunity ? "/communities/create/step-type" : "/communities", "_self");
|
|
26
|
+
}, [handleHeaderActionClick, communities.length, canCreateCommunity]), mappedCommunities = useMemo(() => communities.map((community) => ({
|
|
23
27
|
title: community.title,
|
|
24
28
|
communityImage: community.image ?? "",
|
|
25
29
|
onActionClick: () => handleCommunityClick(community)
|
|
26
30
|
})), [communities, handleCommunityClick]);
|
|
27
|
-
return isLoading ? /* @__PURE__ */ jsx(CommunitiesSkeleton, {}) : error ? "An error occurred while loading communities." : /* @__PURE__ */ jsx(Communities, { communitiesList: mappedCommunities, handleActionClick });
|
|
31
|
+
return rights === void 0 || isLoading ? /* @__PURE__ */ jsx(CommunitiesSkeleton, {}) : hasCommunitiesRight ? error ? "An error occurred while loading communities." : /* @__PURE__ */ jsx(Communities, { communitiesList: mappedCommunities, handleActionClick, canCreateCommunity }) : null;
|
|
28
32
|
}
|
|
29
33
|
export {
|
|
30
34
|
CommunitiesContainer
|
|
@@ -3,17 +3,14 @@ import HomeCard from "../HomeCard/HomeCard.js";
|
|
|
3
3
|
import Flex from "../../../../components/Flex/Flex.js";
|
|
4
4
|
import TextSkeleton from "../../../../components/Skeleton/TextSkeleton.js";
|
|
5
5
|
import ButtonSkeleton from "../../../../components/Skeleton/ButtonSkeleton.js";
|
|
6
|
-
const primaryTitleWidths = ["80%", "64%", "88%", "72%"], secondaryTitleWidths = ["56%", "44%", "60%", "48%"], CommunitiesSkeleton = () => /* @__PURE__ */ jsxs(HomeCard, { variant: "primary", "data-testid": "communities-skeleton", children: [
|
|
6
|
+
const primaryTitleWidths = ["80%", "64%", "88%", "72%", "76%", "68%"], secondaryTitleWidths = ["56%", "44%", "60%", "48%", "52%", "40%"], CommunitiesSkeleton = () => /* @__PURE__ */ jsxs(HomeCard, { variant: "primary", "data-testid": "communities-skeleton", children: [
|
|
7
7
|
/* @__PURE__ */ jsxs(Flex, { align: "center", justify: "between", gap: "8", className: "home-card-header", children: [
|
|
8
8
|
/* @__PURE__ */ jsx(TextSkeleton, { size: "lg", className: "col-5" }),
|
|
9
9
|
/* @__PURE__ */ jsx(ButtonSkeleton, { "aria-hidden": "true", size: "sm", className: "px-24", color: "tertiary" })
|
|
10
10
|
] }),
|
|
11
|
-
/* @__PURE__ */ jsx(HomeCard.Content, { children: /* @__PURE__ */ jsx(Flex, { gap: "16", children: primaryTitleWidths.map((primaryWidth, index) => /* @__PURE__ */ jsxs("div", { className: "communities-item",
|
|
12
|
-
width: "25%"
|
|
13
|
-
}, "aria-hidden": "true", children: [
|
|
11
|
+
/* @__PURE__ */ jsx(HomeCard.Content, { className: "communities-content", children: /* @__PURE__ */ jsx(Flex, { gap: "16", children: /* @__PURE__ */ jsx("div", { className: "communities-list", children: primaryTitleWidths.map((primaryWidth, index) => /* @__PURE__ */ jsxs("div", { className: "communities-item", "aria-hidden": "true", children: [
|
|
14
12
|
/* @__PURE__ */ jsx("div", { className: "communities-item-image placeholder rounded", style: {
|
|
15
|
-
display: "block"
|
|
16
|
-
aspectRatio: "1 / 1"
|
|
13
|
+
display: "block"
|
|
17
14
|
} }),
|
|
18
15
|
/* @__PURE__ */ jsxs(Flex, { direction: "column", gap: "4", className: "mt-8", children: [
|
|
19
16
|
/* @__PURE__ */ jsx("div", { style: {
|
|
@@ -25,7 +22,7 @@ const primaryTitleWidths = ["80%", "64%", "88%", "72%"], secondaryTitleWidths =
|
|
|
25
22
|
alignSelf: "center"
|
|
26
23
|
}, children: /* @__PURE__ */ jsx(TextSkeleton, { className: "col-12", size: "sm" }) })
|
|
27
24
|
] })
|
|
28
|
-
] }, primaryWidth)) }) })
|
|
25
|
+
] }, primaryWidth)) }) }) })
|
|
29
26
|
] });
|
|
30
27
|
export {
|
|
31
28
|
CommunitiesSkeleton as default
|
|
@@ -3,7 +3,10 @@ export interface CommunitiesModel {
|
|
|
3
3
|
title: string;
|
|
4
4
|
image?: string;
|
|
5
5
|
}
|
|
6
|
-
export declare
|
|
6
|
+
export declare const COMMUNITIES_PREVIEW_SIZE = 6;
|
|
7
|
+
export declare function useCommunities({ enabled }?: {
|
|
8
|
+
enabled?: boolean;
|
|
9
|
+
}): {
|
|
7
10
|
communities: CommunitiesModel[];
|
|
8
11
|
isLoading: boolean;
|
|
9
12
|
error: Error | null;
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import { odeServices } from "@edifice.io/client";
|
|
2
2
|
import { useQuery, queryOptions } from "@tanstack/react-query";
|
|
3
|
-
|
|
3
|
+
const COMMUNITIES_PREVIEW_SIZE = 6;
|
|
4
|
+
function useCommunities({
|
|
5
|
+
enabled = !0
|
|
6
|
+
} = {}) {
|
|
4
7
|
const {
|
|
5
8
|
data,
|
|
6
9
|
isLoading,
|
|
@@ -8,11 +11,12 @@ function useCommunities() {
|
|
|
8
11
|
} = useQuery(queryOptions({
|
|
9
12
|
queryKey: ["communities", "preview"],
|
|
10
13
|
queryFn: async () => {
|
|
11
|
-
const http = odeServices.http(), response = await http.get(
|
|
14
|
+
const http = odeServices.http(), response = await http.get(`/communities/api/communities?page=1&size=${COMMUNITIES_PREVIEW_SIZE}`);
|
|
12
15
|
if (http.isResponseError())
|
|
13
16
|
throw new Error(http.latestResponse.statusText);
|
|
14
17
|
return response.items;
|
|
15
|
-
}
|
|
18
|
+
},
|
|
19
|
+
enabled
|
|
16
20
|
}));
|
|
17
21
|
return {
|
|
18
22
|
communities: data ?? [],
|
|
@@ -21,5 +25,6 @@ function useCommunities() {
|
|
|
21
25
|
};
|
|
22
26
|
}
|
|
23
27
|
export {
|
|
28
|
+
COMMUNITIES_PREVIEW_SIZE,
|
|
24
29
|
useCommunities
|
|
25
30
|
};
|
|
@@ -13,9 +13,9 @@ const HomeCardHeader = ({
|
|
|
13
13
|
...rest
|
|
14
14
|
}) => {
|
|
15
15
|
const hasAction = !!actionLabel && !!onActionClick;
|
|
16
|
-
return /* @__PURE__ */ jsxs(Flex, { align: "center", justify: "between", gap: "8", className: clsx("home-card-header", className), ...rest, children: [
|
|
16
|
+
return /* @__PURE__ */ jsxs(Flex, { align: "center", justify: "between", gap: "8", wrap: "wrap", className: clsx("home-card-header", className), ...rest, children: [
|
|
17
17
|
/* @__PURE__ */ jsx("h3", { className: "home-card-header-title", children: title }),
|
|
18
|
-
hasAction && /* @__PURE__ */ jsx(ButtonBeta, { color: "tertiary", size: "sm", variant: "ghost", onClick: onActionClick, leftIcon: actionLeftIcon, rightIcon: actionRightIcon, "data-testid": "home-card-header-action", ...actionProps, children: actionLabel })
|
|
18
|
+
hasAction && /* @__PURE__ */ jsx(ButtonBeta, { color: "tertiary", size: "sm", variant: "ghost", onClick: onActionClick, className: "home-card-header-action", leftIcon: actionLeftIcon, rightIcon: actionRightIcon, "data-testid": "home-card-header-action", ...actionProps, children: actionLabel })
|
|
19
19
|
] });
|
|
20
20
|
};
|
|
21
21
|
export {
|
|
@@ -5,10 +5,8 @@ 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;
|
|
10
8
|
};
|
|
11
|
-
declare function UserSpace({ name, avatar, profile, children,
|
|
9
|
+
declare function UserSpace({ name, avatar, profile, children, }: UserSpaceProps): import("react/jsx-runtime").JSX.Element;
|
|
12
10
|
declare namespace UserSpace {
|
|
13
11
|
var displayName: string;
|
|
14
12
|
}
|
|
@@ -1,33 +1,27 @@
|
|
|
1
1
|
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
2
|
import { useTranslation } from "react-i18next";
|
|
3
|
-
import SvgIconAddWidget from "../../../icons/components/IconAddWidget.js";
|
|
4
3
|
import SvgIconClass from "../../../icons/components/IconClass.js";
|
|
5
4
|
import { useProfileLinks } from "./hooks/useProfileLinks.js";
|
|
6
5
|
import HomeCard from "../HomeCard/HomeCard.js";
|
|
7
6
|
import Flex from "../../../../components/Flex/Flex.js";
|
|
8
7
|
import Avatar from "../../../../components/Avatar/Avatar.js";
|
|
9
|
-
import IconButton from "../../../../components/Button/IconButton.js";
|
|
10
8
|
import ButtonBeta from "../../../../components/ButtonBeta/ButtonBeta.js";
|
|
11
9
|
function UserSpace({
|
|
12
10
|
name,
|
|
13
11
|
avatar,
|
|
14
12
|
profile,
|
|
15
|
-
children
|
|
16
|
-
onCustomizeWidgetsClick
|
|
13
|
+
children
|
|
17
14
|
}) {
|
|
18
15
|
const {
|
|
19
16
|
t
|
|
20
17
|
} = useTranslation(), links = useProfileLinks(profile);
|
|
21
18
|
return /* @__PURE__ */ jsxs(HomeCard, { variant: "user", footer: !!links && /* @__PURE__ */ jsx(Flex, { children: links.map((link, index) => /* @__PURE__ */ jsx(ButtonBeta, { size: "sm", variant: "ghost", leftIcon: /* @__PURE__ */ jsx(SvgIconClass, {}), onClick: () => window.location.href = link.url, children: link.text }, `${link.url}-${index}`)) }), children: [
|
|
22
|
-
/* @__PURE__ */ jsxs(Flex, { className: "user-space", direction: "row",
|
|
23
|
-
/* @__PURE__ */
|
|
24
|
-
|
|
25
|
-
/* @__PURE__ */
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
] })
|
|
29
|
-
] }),
|
|
30
|
-
onCustomizeWidgetsClick && /* @__PURE__ */ jsx(IconButton, { className: "user-space--customize-widgets", icon: /* @__PURE__ */ jsx(SvgIconAddWidget, {}), variant: "ghost", color: "tertiary", "aria-label": t("homepage.userSpace.customizeWidgets", "Personnaliser mes widgets"), onClick: onCustomizeWidgetsClick })
|
|
19
|
+
/* @__PURE__ */ jsxs(Flex, { className: "user-space", direction: "row", gap: "8", children: [
|
|
20
|
+
/* @__PURE__ */ jsx(Avatar, { className: "user-space--avatar", size: "auto", alt: name, src: avatar, variant: "circle" }),
|
|
21
|
+
/* @__PURE__ */ jsxs(Flex, { direction: "column", children: [
|
|
22
|
+
/* @__PURE__ */ jsx("div", { "data-testid": "user-space-name", className: "user-space--name", children: name }),
|
|
23
|
+
/* @__PURE__ */ jsx("div", { "data-testid": "user-space-profile", className: "user-space--profile", children: t(profile) })
|
|
24
|
+
] })
|
|
31
25
|
] }),
|
|
32
26
|
children && /* @__PURE__ */ jsx(HomeCard.Content, { children })
|
|
33
27
|
] });
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
|
-
export
|
|
2
|
+
export declare function UserSpaceContainer({ children }: {
|
|
3
3
|
children?: ReactNode;
|
|
4
|
-
|
|
5
|
-
}
|
|
6
|
-
export declare function UserSpaceContainer({ children, onCustomizeWidgetsClick, }: UserSpaceContainerProps): import("react/jsx-runtime").JSX.Element | null;
|
|
4
|
+
}): import("react/jsx-runtime").JSX.Element | null;
|
|
7
5
|
export declare namespace UserSpaceContainer {
|
|
8
6
|
var displayName: string;
|
|
9
7
|
}
|
|
@@ -2,8 +2,7 @@ import { jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import UserSpace from "./UserSpace.js";
|
|
3
3
|
import useUser from "../../../../hooks/useUser/useUser.js";
|
|
4
4
|
function UserSpaceContainer({
|
|
5
|
-
children
|
|
6
|
-
onCustomizeWidgetsClick
|
|
5
|
+
children
|
|
7
6
|
}) {
|
|
8
7
|
var _a;
|
|
9
8
|
const {
|
|
@@ -13,7 +12,7 @@ function UserSpaceContainer({
|
|
|
13
12
|
} = useUser();
|
|
14
13
|
if (!user || !userDescription) return null;
|
|
15
14
|
const name = user.username || "", profile = ((_a = userDescription.profiles) == null ? void 0 : _a[0]) || "Guest";
|
|
16
|
-
return /* @__PURE__ */ jsx(UserSpace, { name, profile, avatar,
|
|
15
|
+
return /* @__PURE__ */ jsx(UserSpace, { name, profile, avatar, children });
|
|
17
16
|
}
|
|
18
17
|
export {
|
|
19
18
|
UserSpaceContainer
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
export * from './Communities';
|
|
2
1
|
export * from './Favorites';
|
|
3
2
|
export * from './Header';
|
|
4
3
|
export * from './HomeCard';
|
|
@@ -8,4 +7,4 @@ export * from './Notifications';
|
|
|
8
7
|
export * from './SchoolSpace';
|
|
9
8
|
export * from './UsefulLinks';
|
|
10
9
|
export * from './UserSpace';
|
|
11
|
-
export * from './
|
|
10
|
+
export * from './Communities';
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
export { default as IconAddUser } from './IconAddUser';
|
|
2
|
-
export { default as IconAddWidget } from './IconAddWidget';
|
|
3
2
|
export { default as IconAdd } from './IconAdd';
|
|
4
3
|
export { default as IconAdjustSettings } from './IconAdjustSettings';
|
|
5
4
|
export { default as IconAiFill } from './IconAiFill';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@edifice.io/react",
|
|
3
|
-
"version": "2.6.7-develop-
|
|
3
|
+
"version": "2.6.7-develop-pedago.20261005162423",
|
|
4
4
|
"description": "Edifice React Library",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react",
|
|
@@ -140,9 +140,9 @@
|
|
|
140
140
|
"swiper": "10.1.0",
|
|
141
141
|
"ua-parser-js": "1.0.36",
|
|
142
142
|
"zustand": "4.5.7",
|
|
143
|
-
"@edifice.io/
|
|
144
|
-
"@edifice.io/
|
|
145
|
-
"@edifice.io/
|
|
143
|
+
"@edifice.io/tiptap-extensions": "2.6.7-develop-pedago.20261005162423",
|
|
144
|
+
"@edifice.io/utilities": "2.6.7-develop-pedago.20261005162423",
|
|
145
|
+
"@edifice.io/bootstrap": "2.6.7-develop-pedago.20261005162423"
|
|
146
146
|
},
|
|
147
147
|
"devDependencies": {
|
|
148
148
|
"@babel/plugin-transform-react-pure-annotations": "7.27.1",
|
|
@@ -173,8 +173,8 @@
|
|
|
173
173
|
"vite": "5.4.14",
|
|
174
174
|
"vite-plugin-dts": "4.5.4",
|
|
175
175
|
"vite-tsconfig-paths": "5.1.4",
|
|
176
|
-
"@edifice.io/client": "2.6.7-develop-
|
|
177
|
-
"@edifice.io/config": "2.6.7-develop-
|
|
176
|
+
"@edifice.io/client": "2.6.7-develop-pedago.20261005162423",
|
|
177
|
+
"@edifice.io/config": "2.6.7-develop-pedago.20261005162423"
|
|
178
178
|
},
|
|
179
179
|
"peerDependencies": {
|
|
180
180
|
"@react-spring/web": "9.7.5",
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { ComponentPropsWithoutRef } from 'react';
|
|
2
|
-
export interface WidgetToggleProps extends Omit<ComponentPropsWithoutRef<'button'>, 'onClick' | 'type' | 'role' | 'aria-checked'> {
|
|
3
|
-
'checked': boolean;
|
|
4
|
-
'onChange': () => void;
|
|
5
|
-
'aria-label': string;
|
|
6
|
-
}
|
|
7
|
-
/**
|
|
8
|
-
* Dedicated on/off control for a widget row in `WidgetsPersonalizationPanel`.
|
|
9
|
-
* The generic `Switch` component doesn't match this panel's design (size,
|
|
10
|
-
* filled-vs-outlined states), so this is a small purpose-built control
|
|
11
|
-
* rather than a `Switch` variant.
|
|
12
|
-
*/
|
|
13
|
-
export declare function WidgetToggle({ checked, onChange, disabled, ...rest }: WidgetToggleProps): import("react/jsx-runtime").JSX.Element;
|
|
14
|
-
export declare namespace WidgetToggle {
|
|
15
|
-
var displayName: string;
|
|
16
|
-
}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { jsx } from "react/jsx-runtime";
|
|
2
|
-
import clsx from "clsx";
|
|
3
|
-
function WidgetToggle({
|
|
4
|
-
checked,
|
|
5
|
-
onChange,
|
|
6
|
-
disabled,
|
|
7
|
-
...rest
|
|
8
|
-
}) {
|
|
9
|
-
return /* @__PURE__ */ jsx("button", { type: "button", role: "switch", "aria-checked": checked, disabled, className: clsx("widget-toggle", {
|
|
10
|
-
"widget-toggle--checked": checked
|
|
11
|
-
}), onClick: onChange, ...rest, children: /* @__PURE__ */ jsx("span", { className: "widget-toggle__knob" }) });
|
|
12
|
-
}
|
|
13
|
-
export {
|
|
14
|
-
WidgetToggle
|
|
15
|
-
};
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { ReactNode } from 'react';
|
|
2
|
-
export interface WidgetPersonalizationItem {
|
|
3
|
-
id: string;
|
|
4
|
-
label: string;
|
|
5
|
-
icon: ReactNode;
|
|
6
|
-
checked: boolean;
|
|
7
|
-
/** When true, the widget is pinned by an admin: no toggle, lock icon instead. */
|
|
8
|
-
locked?: boolean;
|
|
9
|
-
}
|
|
10
|
-
export interface WidgetsPersonalizationPanelProps {
|
|
11
|
-
items: WidgetPersonalizationItem[];
|
|
12
|
-
isLoading?: boolean;
|
|
13
|
-
onToggle: (id: string) => void;
|
|
14
|
-
onClose: () => void;
|
|
15
|
-
title?: string;
|
|
16
|
-
description?: string;
|
|
17
|
-
}
|
|
18
|
-
export declare function WidgetsPersonalizationPanel({ items, isLoading, onToggle, onClose, title, description, }: WidgetsPersonalizationPanelProps): import("react/jsx-runtime").JSX.Element;
|
|
19
|
-
export declare namespace WidgetsPersonalizationPanel {
|
|
20
|
-
var displayName: string;
|
|
21
|
-
}
|
package/dist/modules/homepage/components/WidgetsPersonalizationPanel/WidgetsPersonalizationPanel.js
DELETED
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
|
-
import { useTranslation } from "react-i18next";
|
|
3
|
-
import clsx from "clsx";
|
|
4
|
-
import SvgIconClose from "../../../icons/components/IconClose.js";
|
|
5
|
-
import SvgIconLock from "../../../icons/components/IconLock.js";
|
|
6
|
-
import { WidgetToggle } from "./WidgetToggle.js";
|
|
7
|
-
import Heading from "../../../../components/Heading/Heading.js";
|
|
8
|
-
import IconButton from "../../../../components/Button/IconButton.js";
|
|
9
|
-
import TextSkeleton from "../../../../components/Skeleton/TextSkeleton.js";
|
|
10
|
-
const SKELETON_ROWS = 5;
|
|
11
|
-
function WidgetsPersonalizationPanel({
|
|
12
|
-
items,
|
|
13
|
-
isLoading = !1,
|
|
14
|
-
onToggle,
|
|
15
|
-
onClose,
|
|
16
|
-
title,
|
|
17
|
-
description
|
|
18
|
-
}) {
|
|
19
|
-
const {
|
|
20
|
-
t
|
|
21
|
-
} = useTranslation();
|
|
22
|
-
return /* @__PURE__ */ jsxs("div", { className: "widgets-personalization-panel", children: [
|
|
23
|
-
/* @__PURE__ */ jsxs("div", { className: "widgets-personalization-panel__header", children: [
|
|
24
|
-
/* @__PURE__ */ jsx(Heading, { level: "h2", headingStyle: "h5", className: "widgets-personalization-panel__title", children: title ?? t("homepage.widgetsPersonalization.title") }),
|
|
25
|
-
/* @__PURE__ */ jsx(IconButton, { icon: /* @__PURE__ */ jsx(SvgIconClose, {}), variant: "ghost", color: "tertiary", "aria-label": t("close"), onClick: onClose, "data-testid": "widgetspersonalization-button-close" })
|
|
26
|
-
] }),
|
|
27
|
-
/* @__PURE__ */ jsx("p", { className: "widgets-personalization-panel__description", children: description ?? t("homepage.widgetsPersonalization.description") }),
|
|
28
|
-
isLoading ? /* @__PURE__ */ jsx("ul", { className: "widgets-personalization-panel__list", "aria-hidden": "true", children: Array.from({
|
|
29
|
-
length: SKELETON_ROWS
|
|
30
|
-
}).map((_, index) => /* @__PURE__ */ jsxs("li", { className: "widgets-personalization-panel__item widgets-personalization-panel__item--skeleton", children: [
|
|
31
|
-
/* @__PURE__ */ jsx(TextSkeleton, { className: "widgets-personalization-panel__item-icon-skeleton" }),
|
|
32
|
-
/* @__PURE__ */ jsx(TextSkeleton, { className: "widgets-personalization-panel__item-label-skeleton" })
|
|
33
|
-
] }, index)) }) : items.length === 0 ? /* @__PURE__ */ jsx("div", { className: "widgets-personalization-panel__empty", children: /* @__PURE__ */ jsx("p", { className: "widgets-personalization-panel__empty-text", children: t("homepage.widgetsPersonalization.empty") }) }) : /* @__PURE__ */ jsx("ul", { className: "widgets-personalization-panel__list", children: items.map((item) => /* @__PURE__ */ jsxs("li", { className: clsx("widgets-personalization-panel__item", {
|
|
34
|
-
"widgets-personalization-panel__item--checked": item.checked && !item.locked,
|
|
35
|
-
"widgets-personalization-panel__item--locked": item.locked
|
|
36
|
-
}), "data-testid": `widgetspersonalization-item-${item.id}`, children: [
|
|
37
|
-
/* @__PURE__ */ jsx("span", { className: "widgets-personalization-panel__item-icon", "aria-hidden": "true", children: item.icon }),
|
|
38
|
-
/* @__PURE__ */ jsx("span", { className: "widgets-personalization-panel__item-label", children: item.label }),
|
|
39
|
-
item.locked ? /* @__PURE__ */ jsx("span", { className: "widgets-personalization-panel__item-lock", role: "img", "aria-label": t("homepage.widgetsPersonalization.locked"), "data-testid": `widgetspersonalization-lock-${item.id}`, children: /* @__PURE__ */ jsx(SvgIconLock, {}) }) : /* @__PURE__ */ jsx(WidgetToggle, { checked: item.checked, onChange: () => onToggle(item.id), "aria-label": t("homepage.widgetsPersonalization.toggle", {
|
|
40
|
-
label: item.label
|
|
41
|
-
}), "data-testid": `widgetspersonalization-toggle-${item.id}` })
|
|
42
|
-
] }, item.id)) })
|
|
43
|
-
] });
|
|
44
|
-
}
|
|
45
|
-
export {
|
|
46
|
-
WidgetsPersonalizationPanel
|
|
47
|
-
};
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { SVGProps } from 'react';
|
|
2
|
-
interface SVGRProps {
|
|
3
|
-
title?: string;
|
|
4
|
-
titleId?: string;
|
|
5
|
-
}
|
|
6
|
-
declare const SvgIconAddWidget: ({ title, titleId, ...props }: SVGProps<SVGSVGElement> & SVGRProps) => import("react/jsx-runtime").JSX.Element;
|
|
7
|
-
export default SvgIconAddWidget;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
|
-
const SvgIconAddWidget = ({
|
|
3
|
-
title,
|
|
4
|
-
titleId,
|
|
5
|
-
...props
|
|
6
|
-
}) => /* @__PURE__ */ jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", width: "24", height: "24", fill: "none", viewBox: "0 0 20 20", "aria-hidden": "true", "aria-labelledby": titleId, ...props, children: [
|
|
7
|
-
title ? /* @__PURE__ */ jsx("title", { id: titleId, children: title }) : null,
|
|
8
|
-
/* @__PURE__ */ jsx("path", { fill: "currentColor", fillRule: "evenodd", d: "M15.834 10.833c.46 0 .833.373.833.834v2.5h2.5a.833.833 0 0 1 0 1.666h-2.5v2.5a.833.833 0 0 1-1.667 0v-2.5h-2.5a.833.833 0 0 1 0-1.666H15v-2.5c0-.46.373-.834.834-.834M8.333 3.333A.833.833 0 0 0 7.5 2.5h-5a.833.833 0 0 0-.833.833v13.334c0 .46.373.833.833.833h5c.46 0 .833-.373.833-.833zM10 16.667a2.5 2.5 0 0 1-2.5 2.5h-5a2.5 2.5 0 0 1-2.5-2.5V3.333a2.5 2.5 0 0 1 2.5-2.5h5a2.5 2.5 0 0 1 2.5 2.5zM18.334 3.333A.833.833 0 0 0 17.5 2.5h-3.333a.833.833 0 0 0-.833.833v3.334c0 .46.373.833.833.833H17.5c.46 0 .834-.373.834-.833zM20 6.667a2.5 2.5 0 0 1-2.5 2.5h-3.333a2.5 2.5 0 0 1-2.5-2.5V3.333a2.5 2.5 0 0 1 2.5-2.5H17.5a2.5 2.5 0 0 1 2.5 2.5z", clipRule: "evenodd" })
|
|
9
|
-
] });
|
|
10
|
-
export {
|
|
11
|
-
SvgIconAddWidget as default
|
|
12
|
-
};
|