@edifice.io/react 2.6.6-develop-axios.20260923172040 → 2.6.6-develop-b2school.20260924112430

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (81) hide show
  1. package/dist/components/Form/FormText.js +11 -6
  2. package/dist/components/Input/Input.d.ts +11 -2
  3. package/dist/components/Input/Input.js +38 -21
  4. package/dist/components/Label/Label.js +4 -4
  5. package/dist/components/Layout/Layout.js +10 -5
  6. package/dist/components/LinkPill/LinkPill.d.ts +45 -0
  7. package/dist/components/LinkPill/LinkPill.js +27 -0
  8. package/dist/components/LinkPill/index.d.ts +2 -0
  9. package/dist/components/ModalBeta/ModalBeta.d.ts +47 -0
  10. package/dist/components/ModalBeta/ModalBeta.js +62 -0
  11. package/dist/components/ModalBeta/ModalBetaBody.d.ts +19 -0
  12. package/dist/components/ModalBeta/ModalBetaBody.js +15 -0
  13. package/dist/components/ModalBeta/ModalBetaContext.d.ts +7 -0
  14. package/dist/components/ModalBeta/ModalBetaContext.js +15 -0
  15. package/dist/components/ModalBeta/ModalBetaFooter.d.ts +13 -0
  16. package/dist/components/ModalBeta/ModalBetaFooter.js +7 -0
  17. package/dist/components/ModalBeta/ModalBetaHeader.d.ts +23 -0
  18. package/dist/components/ModalBeta/ModalBetaHeader.js +31 -0
  19. package/dist/components/ModalBeta/index.d.ts +2 -0
  20. package/dist/components/PageLayout/PageLayout.d.ts +4 -0
  21. package/dist/components/PageLayout/PageLayout.js +22 -12
  22. package/dist/components/PageLayout/components/PageLayoutContent.js +5 -1
  23. package/dist/components/PageLayout/components/PageLayoutHelpZone.d.ts +12 -0
  24. package/dist/components/PageLayout/components/PageLayoutHelpZone.js +6 -0
  25. package/dist/components/Table/components/Table.d.ts +2 -2
  26. package/dist/components/Table/components/TableTd.d.ts +1 -1
  27. package/dist/components/Table/components/TableTh.d.ts +1 -1
  28. package/dist/components/index.d.ts +2 -0
  29. package/dist/homepage.js +29 -28
  30. package/dist/hooks/index.d.ts +2 -0
  31. package/dist/hooks/useBackground/index.d.ts +1 -0
  32. package/dist/hooks/useBackground/useBackground.d.ts +7 -0
  33. package/dist/hooks/useBackground/useBackground.js +16 -0
  34. package/dist/hooks/useClickOutside/useClickOutside.d.ts +1 -1
  35. package/dist/hooks/useClickOutside/useClickOutside.js +3 -2
  36. package/dist/hooks/useUserPreferences/index.d.ts +1 -0
  37. package/dist/hooks/useUserPreferences/useUserPreferences.d.ts +9 -0
  38. package/dist/hooks/useUserPreferences/useUserPreferences.js +40 -0
  39. package/dist/hooks/useZendeskGuide/useZendeskGuide.d.ts +14 -2
  40. package/dist/hooks/useZendeskGuide/useZendeskGuide.js +51 -24
  41. package/dist/index.js +168 -160
  42. package/dist/modules/HelpZone/HelpZone.d.ts +13 -0
  43. package/dist/modules/HelpZone/HelpZone.js +52 -0
  44. package/dist/modules/HelpZone/HelpZoneContainer.d.ts +4 -0
  45. package/dist/modules/HelpZone/HelpZoneContainer.js +18 -0
  46. package/dist/modules/HelpZone/index.d.ts +3 -0
  47. package/dist/modules/homepage/components/Communities/CommunitiesContainer.d.ts +2 -4
  48. package/dist/modules/homepage/components/Communities/CommunityItem.d.ts +1 -2
  49. package/dist/modules/homepage/components/Communities/useCommunities.d.ts +4 -1
  50. package/dist/modules/homepage/components/Header/Header.js +11 -4
  51. package/dist/modules/homepage/components/UsefulLinks/LinkForm.d.ts +13 -0
  52. package/dist/modules/homepage/components/UsefulLinks/LinkForm.js +67 -0
  53. package/dist/modules/homepage/components/UsefulLinks/UsefulLinks.d.ts +6 -0
  54. package/dist/modules/homepage/components/UsefulLinks/UsefulLinks.js +29 -0
  55. package/dist/modules/homepage/components/UsefulLinks/UsefulLinksContainer.d.ts +1 -0
  56. package/dist/modules/homepage/components/UsefulLinks/UsefulLinksContainer.js +40 -0
  57. package/dist/modules/homepage/components/UsefulLinks/UsefulLinksModal.d.ts +11 -0
  58. package/dist/modules/homepage/components/UsefulLinks/UsefulLinksModal.js +65 -0
  59. package/dist/modules/homepage/components/UsefulLinks/hooks/useUsefulLinksContainer.d.ts +19 -0
  60. package/dist/modules/homepage/components/UsefulLinks/hooks/useUsefulLinksContainer.js +26 -0
  61. package/dist/modules/homepage/components/UsefulLinks/index.d.ts +5 -0
  62. package/dist/modules/homepage/components/UsefulLinks/services/api/index.d.ts +6 -0
  63. package/dist/modules/homepage/components/UsefulLinks/services/api/index.js +5 -0
  64. package/dist/modules/homepage/components/UsefulLinks/services/api/usefulLinksService.d.ts +31 -0
  65. package/dist/modules/homepage/components/UsefulLinks/services/api/usefulLinksService.js +50 -0
  66. package/dist/modules/homepage/components/UsefulLinks/services/queries/usefulLinks.d.ts +20 -0
  67. package/dist/modules/homepage/components/UsefulLinks/services/queries/usefulLinks.js +65 -0
  68. package/dist/modules/homepage/components/UserSpace/hooks/useProfileLinks.js +18 -8
  69. package/dist/modules/homepage/components/index.d.ts +1 -1
  70. package/dist/modules/icons/components/logo/IconLogoEdificeFull.d.ts +7 -0
  71. package/dist/modules/icons/components/logo/IconLogoEdificeFull.js +26 -0
  72. package/dist/modules/icons/components/logo/IconLogoEdificeSmall.d.ts +7 -0
  73. package/dist/modules/icons/components/logo/IconLogoEdificeSmall.js +17 -0
  74. package/dist/modules/icons/components/logo/index.d.ts +2 -0
  75. package/dist/modules/widgets/index.d.ts +1 -1
  76. package/package.json +6 -6
  77. package/dist/modules/homepage/components/Communities/Communities.js +0 -35
  78. package/dist/modules/homepage/components/Communities/CommunitiesContainer.js +0 -31
  79. package/dist/modules/homepage/components/Communities/CommunitiesSkeleton.js +0 -32
  80. package/dist/modules/homepage/components/Communities/CommunityItem.js +0 -28
  81. package/dist/modules/homepage/components/Communities/useCommunities.js +0 -25
@@ -1,35 +0,0 @@
1
- import { jsxs, jsx } from "react/jsx-runtime";
2
- import illuCommunities from "@edifice.io/bootstrap/dist/images/homepage/illu-communities.svg";
3
- import { useMeasure } from "@uidotdev/usehooks";
4
- import { useTranslation } from "react-i18next";
5
- import SvgIconArrowRight from "../../../icons/components/IconArrowRight.js";
6
- import CommunityItem from "./CommunityItem.js";
7
- import HomeCard from "../HomeCard/HomeCard.js";
8
- import Flex from "../../../../components/Flex/Flex.js";
9
- import Image from "../../../../components/Image/Image.js";
10
- const NARROW_CONTAINER_WIDTH = 800, MAX_ITEMS = 4, MAX_ITEMS_NARROW = 3, Communities = ({
11
- communitiesList = [],
12
- handleActionClick
13
- }) => {
14
- const {
15
- t
16
- } = useTranslation(), [containerRef, {
17
- width
18
- }] = useMeasure(), maxItems = width !== null && width < NARROW_CONTAINER_WIDTH ? MAX_ITEMS_NARROW : MAX_ITEMS, visibleCommunities = communitiesList.slice(0, maxItems), itemWidth = `${100 / maxItems}%`;
19
- 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, { ref: containerRef, gap: "16", children: visibleCommunities.length > 0 ? visibleCommunities.map((community, index) => /* @__PURE__ */ jsx(CommunityItem, { title: community.title, communityImage: community.communityImage, onActionClick: community.onActionClick, nbNotifications: community.nbNotifications, width: itemWidth }, index)) : /* @__PURE__ */ jsxs("div", { className: "communities-empty", children: [
22
- /* @__PURE__ */ jsx(Image, { src: illuCommunities, alt: "", "aria-hidden": "true", style: {
23
- width: 80,
24
- height: 80
25
- } }),
26
- /* @__PURE__ */ jsxs("div", { className: "communities-empty-content", children: [
27
- /* @__PURE__ */ jsx("p", { className: "communities-empty-title", children: t("homepage.communities.subtitle", "Créez votre première communauté pour animer votre classe !") }),
28
- /* @__PURE__ */ jsx("p", { className: "communities-empty-description", children: t("homepage.communities.description", "Vous pouvez centraliser et organiser les documents et les ressources pour vos élèves.") })
29
- ] })
30
- ] }) }) })
31
- ] });
32
- };
33
- export {
34
- Communities as default
35
- };
@@ -1,31 +0,0 @@
1
- import { jsx } from "react/jsx-runtime";
2
- import { useCallback, useMemo } from "react";
3
- import Communities from "./Communities.js";
4
- import CommunitiesSkeleton from "./CommunitiesSkeleton.js";
5
- import { useCommunities } from "./useCommunities.js";
6
- function CommunitiesContainer({
7
- onCommunityClick: handleCommunityClick = (community) => {
8
- window.open(`/communities/id/${community.id}/home`, "_self");
9
- },
10
- onHeaderActionClick: handleHeaderActionClick
11
- }) {
12
- const {
13
- communities,
14
- isLoading,
15
- error
16
- } = useCommunities(), handleActionClick = useCallback(() => {
17
- if (handleHeaderActionClick) {
18
- handleHeaderActionClick();
19
- return;
20
- }
21
- window.open(communities.length > 0 ? "/communities" : "/communities/create/step-type", "_self");
22
- }, [handleHeaderActionClick, communities.length]), mappedCommunities = useMemo(() => communities.map((community) => ({
23
- title: community.title,
24
- communityImage: community.image ?? "",
25
- onActionClick: () => handleCommunityClick(community)
26
- })), [communities, handleCommunityClick]);
27
- return isLoading ? /* @__PURE__ */ jsx(CommunitiesSkeleton, {}) : error ? "An error occurred while loading communities." : /* @__PURE__ */ jsx(Communities, { communitiesList: mappedCommunities, handleActionClick });
28
- }
29
- export {
30
- CommunitiesContainer
31
- };
@@ -1,32 +0,0 @@
1
- import { jsxs, jsx } from "react/jsx-runtime";
2
- import HomeCard from "../HomeCard/HomeCard.js";
3
- import Flex from "../../../../components/Flex/Flex.js";
4
- import TextSkeleton from "../../../../components/Skeleton/TextSkeleton.js";
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: [
7
- /* @__PURE__ */ jsxs(Flex, { align: "center", justify: "between", gap: "8", className: "home-card-header", children: [
8
- /* @__PURE__ */ jsx(TextSkeleton, { size: "lg", className: "col-5" }),
9
- /* @__PURE__ */ jsx(ButtonSkeleton, { "aria-hidden": "true", size: "sm", className: "px-24", color: "tertiary" })
10
- ] }),
11
- /* @__PURE__ */ jsx(HomeCard.Content, { children: /* @__PURE__ */ jsx(Flex, { gap: "16", children: primaryTitleWidths.map((primaryWidth, index) => /* @__PURE__ */ jsxs("div", { className: "communities-item", style: {
12
- width: "25%"
13
- }, "aria-hidden": "true", children: [
14
- /* @__PURE__ */ jsx("div", { className: "communities-item-image placeholder rounded", style: {
15
- display: "block",
16
- aspectRatio: "1 / 1"
17
- } }),
18
- /* @__PURE__ */ jsxs(Flex, { direction: "column", gap: "4", className: "mt-8", children: [
19
- /* @__PURE__ */ jsx("div", { style: {
20
- width: primaryWidth,
21
- alignSelf: "center"
22
- }, children: /* @__PURE__ */ jsx(TextSkeleton, { className: "col-12", size: "sm" }) }),
23
- /* @__PURE__ */ jsx("div", { style: {
24
- width: secondaryTitleWidths[index],
25
- alignSelf: "center"
26
- }, children: /* @__PURE__ */ jsx(TextSkeleton, { className: "col-12", size: "sm" }) })
27
- ] })
28
- ] }, primaryWidth)) }) })
29
- ] });
30
- export {
31
- CommunitiesSkeleton as default
32
- };
@@ -1,28 +0,0 @@
1
- import { jsxs, jsx } from "react/jsx-runtime";
2
- import clsx from "clsx";
3
- import Badge from "../../../../components/Badge/Badge.js";
4
- import Image from "../../../../components/Image/Image.js";
5
- const CommunityItem = ({
6
- title,
7
- communityImage,
8
- nbNotifications,
9
- onActionClick,
10
- width = "25%"
11
- }) => {
12
- const hasNotifications = (nbNotifications ?? 0) > 0;
13
- return /* @__PURE__ */ jsxs("div", { role: "button", tabIndex: 0, onClick: onActionClick, className: clsx("communities-item", {
14
- "communities-item-has-notifications": hasNotifications
15
- }), style: {
16
- width
17
- }, children: [
18
- hasNotifications && /* @__PURE__ */ jsx(Badge, { className: "communities-item-badge", variant: {
19
- level: "danger",
20
- type: "notification"
21
- }, children: nbNotifications }),
22
- /* @__PURE__ */ jsx(Image, { className: "communities-item-image", src: communityImage, alt: title }),
23
- /* @__PURE__ */ jsx("p", { className: "communities-item-title text-truncate text-truncate-2", children: title })
24
- ] });
25
- };
26
- export {
27
- CommunityItem as default
28
- };
@@ -1,25 +0,0 @@
1
- import { odeServices } from "@edifice.io/client";
2
- import { useQuery, queryOptions } from "@tanstack/react-query";
3
- function useCommunities() {
4
- const {
5
- data,
6
- isLoading,
7
- error
8
- } = useQuery(queryOptions({
9
- queryKey: ["communities", "preview"],
10
- queryFn: async () => {
11
- const http = odeServices.http(), response = await http.get("/communities/api/communities?page=1&size=4");
12
- if (http.isResponseError())
13
- throw new Error(http.latestResponse.statusText);
14
- return response.items;
15
- }
16
- }));
17
- return {
18
- communities: data ?? [],
19
- isLoading,
20
- error
21
- };
22
- }
23
- export {
24
- useCommunities
25
- };