@edifice.io/react 2.6.4-develop-integration-demo.20260901111601 → 2.6.4-develop.20260901120004

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.
@@ -8,7 +8,6 @@ import PageLayoutOverlay from "./components/PageLayoutOverlay.js";
8
8
  import PageLayoutSidebarLeft from "./components/PageLayoutSidebarLeft.js";
9
9
  import PageLayoutSidebarRight from "./components/PageLayoutSidebarRight.js";
10
10
  import { PageLayoutContext } from "./PageLayoutContext.js";
11
- import useZendeskGuide from "../../hooks/useZendeskGuide/useZendeskGuide.js";
12
11
  function analyzeChildren(children) {
13
12
  let hasLeftSidebar = !1, hasRightSidebar = !1, breadcrumb = null, overlay = null;
14
13
  const headerChildren = [], mainChildren = [];
@@ -59,9 +58,7 @@ const Root = ({
59
58
  variant,
60
59
  scrollMode,
61
60
  noPadding
62
- }), [variant, scrollMode, noPadding]);
63
- useZendeskGuide();
64
- const {
61
+ }), [variant, scrollMode, noPadding]), {
65
62
  hasLeftSidebar,
66
63
  hasRightSidebar,
67
64
  breadcrumb,
@@ -12,8 +12,8 @@ const useTabs = ({
12
12
  currentItem && (onChange == null || onChange(currentItem));
13
13
  }, [activeTab]), useEffect(() => {
14
14
  function setTabPosition() {
15
- var _a;
16
- if (((_a = document == null ? void 0 : document.activeElement) == null ? void 0 : _a.tagName) !== "INPUT") {
15
+ const activeElement = document.activeElement;
16
+ if (!((activeElement == null ? void 0 : activeElement.tagName) === "INPUT" || (activeElement == null ? void 0 : activeElement.tagName) === "TEXTAREA" || (activeElement == null ? void 0 : activeElement.isContentEditable))) {
17
17
  const currentTabIndex = items.findIndex((item) => item.id === activeTab);
18
18
  currentTabIndex === -1 && defaultId && setActiveTab(defaultId);
19
19
  const currentTabRef = tabsRef.current[currentTabIndex];
package/dist/homepage.js CHANGED
@@ -1,17 +1,13 @@
1
- import { default as default2 } from "./modules/homepage/components/Communities/Communities.js";
2
- import { default as default3 } from "./modules/homepage/components/Communities/CommunityItem.js";
3
- import { default as default4 } from "./modules/homepage/components/Communities/CommunitiesSkeleton.js";
4
- import { default as default5 } from "./modules/homepage/components/Header/Header.js";
5
- import { default as default6 } from "./modules/homepage/components/HomeCard/HomeCard.js";
6
- import { default as default7 } from "./modules/homepage/components/LastInfos/LastInfos.js";
7
- import { default as default8 } from "./modules/homepage/components/MessageFlashList/MessageFlash.js";
8
- import { default as default9 } from "./modules/homepage/components/MessageFlashList/MessageFlashList.js";
9
- import { default as default10 } from "./modules/homepage/components/Notifications/NotificationItem.js";
10
- import { default as default11 } from "./modules/homepage/components/Notifications/NotificationList.js";
1
+ import { default as default2 } from "./modules/homepage/components/Header/Header.js";
2
+ import { default as default3 } from "./modules/homepage/components/HomeCard/HomeCard.js";
3
+ import { default as default4 } from "./modules/homepage/components/LastInfos/LastInfos.js";
4
+ import { default as default5 } from "./modules/homepage/components/MessageFlashList/MessageFlash.js";
5
+ import { default as default6 } from "./modules/homepage/components/MessageFlashList/MessageFlashList.js";
6
+ import { default as default7 } from "./modules/homepage/components/Notifications/NotificationItem.js";
7
+ import { default as default8 } from "./modules/homepage/components/Notifications/NotificationList.js";
11
8
  import { NotificationListContainer } from "./modules/homepage/components/Notifications/NotificationListContainer.js";
12
- import { default as default12 } from "./modules/homepage/components/SchoolSpace/SchoolSpace.js";
13
- import { default as default13 } from "./modules/homepage/components/UserSpace/UserSpace.js";
14
- import { CommunitiesContainer } from "./modules/homepage/components/Communities/CommunitiesContainer.js";
9
+ import { default as default9 } from "./modules/homepage/components/SchoolSpace/SchoolSpace.js";
10
+ import { default as default10 } from "./modules/homepage/components/UserSpace/UserSpace.js";
15
11
  import { Favorites } from "./modules/homepage/components/Favorites/Favorites.js";
16
12
  import { FavoritesContainer } from "./modules/homepage/components/Favorites/FavoritesContainer.js";
17
13
  import { LastInfosContainer } from "./modules/homepage/components/LastInfos/LastInfosContainer.js";
@@ -19,32 +15,22 @@ import { LastInfosList } from "./modules/homepage/components/LastInfos/LastInfos
19
15
  import { MessageFlashListContainer } from "./modules/homepage/components/MessageFlashList/MessageFlashListContainer.js";
20
16
  import { SchoolSpaceContainer } from "./modules/homepage/components/SchoolSpace/SchoolSpaceContainer.js";
21
17
  import { UserSpaceContainer } from "./modules/homepage/components/UserSpace/UserSpaceContainer.js";
22
- import { childrenQueryKeys, childrenQueryOptions, useChildren } from "./modules/homepage/components/UserSpace/hooks/useChildren.js";
23
- import { useCommunities } from "./modules/homepage/components/Communities/useCommunities.js";
24
18
  export {
25
- default2 as Communities,
26
- CommunitiesContainer,
27
- default3 as CommunitiesItem,
28
- default4 as CommunitiesSkeleton,
29
19
  Favorites,
30
20
  FavoritesContainer,
31
- default5 as Header,
32
- default6 as HomeCard,
33
- default7 as LastInfos,
21
+ default2 as Header,
22
+ default3 as HomeCard,
23
+ default4 as LastInfos,
34
24
  LastInfosContainer,
35
25
  LastInfosList,
36
- default8 as MessageFlash,
37
- default9 as MessageFlashList,
26
+ default5 as MessageFlash,
27
+ default6 as MessageFlashList,
38
28
  MessageFlashListContainer,
39
- default10 as NotificationItem,
40
- default11 as NotificationList,
29
+ default7 as NotificationItem,
30
+ default8 as NotificationList,
41
31
  NotificationListContainer,
42
- default12 as SchoolSpace,
32
+ default9 as SchoolSpace,
43
33
  SchoolSpaceContainer,
44
- default13 as UserSpace,
45
- UserSpaceContainer,
46
- childrenQueryKeys,
47
- childrenQueryOptions,
48
- useChildren,
49
- useCommunities
34
+ default10 as UserSpace,
35
+ UserSpaceContainer
50
36
  };
@@ -1,14 +1,10 @@
1
- export interface CommunityStats {
2
- totalMembers: string;
3
- memberCount: string;
4
- adminCount: string;
5
- communityId: number;
6
- }
7
1
  export interface CommunitiesModel {
8
2
  id: number | string;
9
3
  title: string;
10
- image?: string;
11
- stats?: CommunityStats;
4
+ communityImage?: string;
5
+ icon?: string;
6
+ nbNotifications?: number;
7
+ notifications?: number;
12
8
  }
13
9
  export declare function useCommunities(): {
14
10
  communities: CommunitiesModel[];
@@ -1,5 +1,5 @@
1
1
  import { odeServices } from "@edifice.io/client";
2
- import { queryOptions, useQuery } from "@tanstack/react-query";
2
+ import { useQuery, queryOptions } from "@tanstack/react-query";
3
3
  const childrenQueryKeys = {
4
4
  all: (userId) => ["children", userId]
5
5
  };
@@ -1,4 +1,3 @@
1
1
  export * from './UserSpace';
2
2
  export { default as UserSpace } from './UserSpace';
3
3
  export * from './UserSpaceContainer';
4
- export * from './hooks/useChildren';
@@ -1,4 +1,3 @@
1
- export * from './Communities';
2
1
  export * from './Favorites';
3
2
  export * from './Header';
4
3
  export * from './HomeCard';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@edifice.io/react",
3
- "version": "2.6.4-develop-integration-demo.20260901111601",
3
+ "version": "2.6.4-develop.20260901120004",
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/bootstrap": "2.6.4-develop-integration-demo.20260901111601",
144
- "@edifice.io/utilities": "2.6.4-develop-integration-demo.20260901111601",
145
- "@edifice.io/tiptap-extensions": "2.6.4-develop-integration-demo.20260901111601"
143
+ "@edifice.io/bootstrap": "2.6.4-develop.20260901120004",
144
+ "@edifice.io/tiptap-extensions": "2.6.4-develop.20260901120004",
145
+ "@edifice.io/utilities": "2.6.4-develop.20260901120004"
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/config": "2.6.4-develop-integration-demo.20260901111601",
177
- "@edifice.io/client": "2.6.4-develop-integration-demo.20260901111601"
176
+ "@edifice.io/client": "2.6.4-develop.20260901120004",
177
+ "@edifice.io/config": "2.6.4-develop.20260901120004"
178
178
  },
179
179
  "peerDependencies": {
180
180
  "@react-spring/web": "9.7.5",
@@ -1,32 +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 { useTranslation } from "react-i18next";
4
- import SvgIconArrowRight from "../../../icons/components/IconArrowRight.js";
5
- import CommunityItem from "./CommunityItem.js";
6
- import HomeCard from "../HomeCard/HomeCard.js";
7
- import Flex from "../../../../components/Flex/Flex.js";
8
- import Image from "../../../../components/Image/Image.js";
9
- const Communities = ({
10
- communitiesList = [],
11
- handleActionClick
12
- }) => {
13
- const {
14
- t
15
- } = useTranslation();
16
- return /* @__PURE__ */ jsxs(HomeCard, { variant: "primary", children: [
17
- /* @__PURE__ */ jsx(HomeCard.Header, { actionLabel: communitiesList.length > 0 ? t("homepage.widget.communities.actionLabel.seeMore", "Voir plus") : t("homepage.widget.communities.actionLabel.create", "Créer une communauté"), actionRightIcon: /* @__PURE__ */ jsx(SvgIconArrowRight, {}), onActionClick: handleActionClick, title: t("homepage.widget.communities.title", "Communautés") }),
18
- /* @__PURE__ */ jsx(HomeCard.Content, { children: /* @__PURE__ */ jsx(Flex, { gap: "16", children: communitiesList.length > 0 ? communitiesList.map((community, index) => /* @__PURE__ */ jsx(CommunityItem, { title: community.title, communityImage: community.communityImage, onActionClick: community.onActionClick, nbNotifications: community.nbNotifications }, index)) : /* @__PURE__ */ jsxs("div", { className: "communities-empty", children: [
19
- /* @__PURE__ */ jsx(Image, { src: illuCommunities, alt: "", "aria-hidden": "true", style: {
20
- width: 80,
21
- height: 80
22
- } }),
23
- /* @__PURE__ */ jsxs("div", { className: "communities-empty-content", children: [
24
- /* @__PURE__ */ jsx("p", { className: "communities-empty-title", children: t("homepage.communities.subtitle", "Créez votre première communauté pour animer votre classe !") }),
25
- /* @__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.") })
26
- ] })
27
- ] }) }) })
28
- ] });
29
- };
30
- export {
31
- Communities as default
32
- };
@@ -1,23 +0,0 @@
1
- import { jsx } from "react/jsx-runtime";
2
- import { 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,
8
- onHeaderActionClick
9
- }) {
10
- const {
11
- communities,
12
- isLoading,
13
- error
14
- } = useCommunities(), mappedCommunities = useMemo(() => communities.map((community) => ({
15
- title: community.title,
16
- communityImage: community.image ?? "",
17
- onActionClick: () => onCommunityClick == null ? void 0 : onCommunityClick(community)
18
- })), [communities, onCommunityClick]);
19
- return isLoading ? /* @__PURE__ */ jsx(CommunitiesSkeleton, {}) : error ? "An error occurred while loading communities." : /* @__PURE__ */ jsx(Communities, { communitiesList: mappedCommunities, handleActionClick: onHeaderActionClick });
20
- }
21
- export {
22
- CommunitiesContainer
23
- };
@@ -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,27 +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
- }) => {
11
- const hasNotifications = (nbNotifications ?? 0) > 0;
12
- return /* @__PURE__ */ jsxs("div", { role: "button", tabIndex: 0, onClick: onActionClick, className: clsx("communities-item", {
13
- "communities-item-has-notifications": hasNotifications
14
- }), style: {
15
- width: "25%"
16
- }, children: [
17
- hasNotifications && /* @__PURE__ */ jsx(Badge, { className: "communities-item-badge", variant: {
18
- level: "danger",
19
- type: "notification"
20
- }, children: nbNotifications }),
21
- /* @__PURE__ */ jsx(Image, { className: "communities-item-image", src: communityImage, alt: title }),
22
- /* @__PURE__ */ jsx("p", { className: "communities-item-title text-truncate text-truncate-2", children: title })
23
- ] });
24
- };
25
- export {
26
- CommunityItem as default
27
- };
@@ -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=5&fields=stats");
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
- };