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

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 (24) hide show
  1. package/dist/components/Badge/Badge.d.ts +6 -1
  2. package/dist/components/Badge/Badge.js +1 -1
  3. package/dist/components/Layout/components/Header.js +0 -6
  4. package/dist/components/Layout/components/NavLink.d.ts +1 -1
  5. package/dist/components/Layout/components/NavLink.js +2 -0
  6. package/dist/components/Layout/hooks/useHeader.js +2 -3
  7. package/dist/components/PageLayout/PageLayout.js +4 -1
  8. package/dist/homepage.js +33 -19
  9. package/dist/hooks/useClickOutside/useClickOutside.d.ts +1 -1
  10. package/dist/hooks/useClickOutside/useClickOutside.js +1 -1
  11. package/dist/modules/editor/test-utils/createTestEditor.d.ts +10 -0
  12. package/dist/modules/homepage/components/Communities/Communities.js +32 -0
  13. package/dist/modules/homepage/components/Communities/CommunitiesContainer.js +23 -0
  14. package/dist/modules/homepage/components/Communities/CommunitiesSkeleton.js +32 -0
  15. package/dist/modules/homepage/components/Communities/CommunityItem.js +27 -0
  16. package/dist/modules/homepage/components/Communities/useCommunities.d.ts +8 -4
  17. package/dist/modules/homepage/components/Communities/useCommunities.js +25 -0
  18. package/dist/modules/homepage/components/UserSpace/hooks/useChildren.js +1 -1
  19. package/dist/modules/homepage/components/UserSpace/index.d.ts +1 -0
  20. package/dist/modules/homepage/components/index.d.ts +1 -0
  21. package/dist/modules/multimedia/testing/mediaHarness.d.ts +154 -0
  22. package/package.json +6 -6
  23. package/dist/modules/multimedia/LinkerCard/LinkerCard._.d.ts +0 -8
  24. package/dist/modules/multimedia/UploadCard/UploadCard._.d.ts +0 -9
@@ -6,6 +6,11 @@ export type NotificationBadgeVariant = {
6
6
  type: 'notification';
7
7
  level: 'success' | 'warning' | 'danger' | 'info';
8
8
  };
9
+ /** Badge variant : status */
10
+ export type StatusBadgeVariant = {
11
+ type: 'status';
12
+ level: 'validate' | 'success' | 'warning' | 'danger' | 'info';
13
+ };
9
14
  /** Badge variant : content */
10
15
  export type ContentBadgeVariant = {
11
16
  type: 'content';
@@ -49,7 +54,7 @@ export type AppVersionBadgeVariant = {
49
54
  color?: string;
50
55
  app?: IWebApp;
51
56
  };
52
- export type BadgeVariants = NotificationBadgeVariant | ContentBadgeVariant | ProfileBadgeVariant | ChipBadgeVariant | LinkBadgeVariant | AppVersionBadgeVariant;
57
+ export type BadgeVariants = NotificationBadgeVariant | StatusBadgeVariant | ContentBadgeVariant | ProfileBadgeVariant | ChipBadgeVariant | LinkBadgeVariant | AppVersionBadgeVariant;
53
58
  export interface BadgeProps extends React.ComponentPropsWithRef<'span'> {
54
59
  /**
55
60
  * Badge variant : notification, link or profile (Teacher|Student|Relative|Personnel)
@@ -21,7 +21,7 @@ const Badge = /* @__PURE__ */ forwardRef(({
21
21
  const colorAppClassName = getIconClass(variant.app), backgroundLightAppClassName = getBackgroundLightIconClass(variant.app), borderAppClassName = getBorderIconClass(variant.app);
22
22
  appVersionBadgeColorClassName = `${colorAppClassName} ${backgroundLightAppClassName} ${borderAppClassName}`;
23
23
  }
24
- const classes = clsx("badge rounded-pill", (variant.type === "content" || variant.type === "user") && "background" in variant ? "bg-gray-200" : (variant.type === "content" || variant.type === "user") && !("background" in variant) ? "border border-0" : "", variant.type === "content" && `text-${variant.level}`, variant.type === "notification" && `badge-notification bg-${variant.level} text-light border border-0`, variant.type === "user" && `badge-profile-${variant.profile.toLowerCase()}`, variant.type === "link" && "badge-link border border-0", variant.type === "chip" && "bg-gray-200", variant.type === "appVersion" && appVersionBadgeColorClassName, className);
24
+ const classes = clsx("badge rounded-pill", (variant.type === "content" || variant.type === "user") && "background" in variant ? "bg-gray-200" : (variant.type === "content" || variant.type === "user") && !("background" in variant) ? "border border-0" : "", variant.type === "content" && `text-${variant.level}`, variant.type === "notification" && `badge-notification bg-${variant.level} text-light border border-0`, variant.type === "status" && `badge-status badge-status-${variant.level} caption fw-normal`, variant.type === "user" && `badge-profile-${variant.profile.toLowerCase()}`, variant.type === "link" && "badge-link border border-0", variant.type === "chip" && "bg-gray-200", variant.type === "appVersion" && appVersionBadgeColorClassName, className);
25
25
  return /* @__PURE__ */ jsxs("span", { ref, className: classes, ...restProps, children: [
26
26
  variant.type === "chip" && /* @__PURE__ */ jsx("div", { className: "d-flex fw-800 align-items-center", children }),
27
27
  variant.type === "appVersion" && (children ?? "BÊTA"),
@@ -5,7 +5,6 @@ import { useEdificeClient } from "../../../providers/EdificeClientProvider/Edifi
5
5
  import { useEdificeTheme } from "../../../providers/EdificeThemeProvider/EdificeThemeProvider.hook.js";
6
6
  import SvgIconRafterDown from "../../../modules/icons/components/IconRafterDown.js";
7
7
  import SvgIconCommunities from "../../../modules/icons/components/nav/IconCommunities.js";
8
- import SvgIconCommunity from "../../../modules/icons/components/nav/IconCommunity.js";
9
8
  import SvgIconDisconnect from "../../../modules/icons/components/nav/IconDisconnect.js";
10
9
  import SvgIconHome from "../../../modules/icons/components/nav/IconHome.js";
11
10
  import SvgIconMyApps from "../../../modules/icons/components/nav/IconMyApps.js";
@@ -67,7 +66,6 @@ const Header = ({
67
66
  userAvatar,
68
67
  userName,
69
68
  welcomeUser,
70
- communityWorkflow,
71
69
  communitiesWorkflow,
72
70
  conversationWorflow,
73
71
  searchWorkflow,
@@ -176,10 +174,6 @@ const Header = ({
176
174
  /* @__PURE__ */ jsx(NavItem, { children: /* @__PURE__ */ jsxs("div", { className: "dropdown", children: [
177
175
  /* @__PURE__ */ jsx("button", { className: "nav-link btn btn-naked d-md-none", type: "button", "aria-controls": "dropdown-navbar", "aria-expanded": !isCollapsed, "aria-label": t("navbar.open.menu"), onClick: toggleCollapsedNav, children: /* @__PURE__ */ jsx(SvgIconRafterDown, { className: "icon rafter-down", width: "20", height: "20", color: "#fff" }) }),
178
176
  /* @__PURE__ */ jsxs("ul", { className: `dropdown-menu dropdown-menu-end ${isCollapsed ? "" : "show"}`, id: "dropdown-navbar", children: [
179
- communityWorkflow && /* @__PURE__ */ jsx(NavItem, { children: /* @__PURE__ */ jsxs("a", { href: "/community", className: "nav-link dropdown-item", children: [
180
- /* @__PURE__ */ jsx(SvgIconCommunity, { className: "icon community" }),
181
- /* @__PURE__ */ jsx("span", { className: "nav-text", children: t("navbar.community") })
182
- ] }) }),
183
177
  communitiesWorkflow && /* @__PURE__ */ jsx(NavItem, { children: /* @__PURE__ */ jsxs("a", { href: "/communities", className: "nav-link dropdown-item", children: [
184
178
  /* @__PURE__ */ jsx(SvgIconCommunities, { className: "icon communities" }),
185
179
  /* @__PURE__ */ jsx("span", { className: "nav-text", children: t("navbar.community") })
@@ -21,4 +21,4 @@ export interface NavLinkProps<T> {
21
21
  */
22
22
  button?: boolean;
23
23
  }
24
- export declare function NavLink({ link, className, children, translate, ...restProps }: NavLinkProps<string>): import("react/jsx-runtime").JSX.Element;
24
+ export declare function NavLink({ link, className, children, translate, button, ...restProps }: NavLinkProps<string>): import("react/jsx-runtime").JSX.Element;
@@ -6,6 +6,8 @@ function NavLink({
6
6
  className,
7
7
  children,
8
8
  translate,
9
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
10
+ button,
9
11
  ...restProps
10
12
  }) {
11
13
  const classes = clsx("nav-link", className);
@@ -14,7 +14,7 @@ function useHeader({
14
14
  t
15
15
  } = useTranslation(), title = t(appCode), [isCollapsed, setIsCollapsed] = useState(!0), [appsRef, isAppsHovered] = useHover(), popoverAppsId = useId(), popoverSearchId = useId(), userAvatar = avatar, userName = user == null ? void 0 : user.username, welcomeUser = t("welcome", {
16
16
  username: user == null ? void 0 : user.firstName
17
- }), bookmarkedApps = useBookmark(), communityWorkflow = useHasWorkflow("net.atos.entng.community.controllers.CommunityController|view"), communitiesWorkflow = useHasWorkflow("community.access"), conversationWorflow = useHasWorkflow("org.entcore.conversation.controllers.ConversationController|view"), searchWorkflow = useHasWorkflow("fr.openent.searchengine.controllers.SearchEngineController|view"), toggleCollapsedNav = useCallback(() => {
17
+ }), bookmarkedApps = useBookmark(), communitiesWorkflow = useHasWorkflow("community.access"), conversationWorflow = useHasWorkflow("org.entcore.conversation.controllers.ConversationController|view"), searchWorkflow = useHasWorkflow("fr.openent.searchengine.controllers.SearchEngineController|view"), toggleCollapsedNav = useCallback(() => {
18
18
  setIsCollapsed(!isCollapsed);
19
19
  }, [isCollapsed]);
20
20
  return useMemo(() => ({
@@ -27,13 +27,12 @@ function useHeader({
27
27
  userAvatar,
28
28
  userName,
29
29
  welcomeUser,
30
- communityWorkflow,
31
30
  communitiesWorkflow,
32
31
  conversationWorflow,
33
32
  searchWorkflow,
34
33
  isCollapsed,
35
34
  toggleCollapsedNav
36
- }), [appsRef, bookmarkedApps, communitiesWorkflow, communityWorkflow, conversationWorflow, isAppsHovered, isCollapsed, popoverAppsId, popoverSearchId, searchWorkflow, title, toggleCollapsedNav, userAvatar, userName, welcomeUser]);
35
+ }), [appsRef, bookmarkedApps, communitiesWorkflow, conversationWorflow, isAppsHovered, isCollapsed, popoverAppsId, popoverSearchId, searchWorkflow, title, toggleCollapsedNav, userAvatar, userName, welcomeUser]);
37
36
  }
38
37
  export {
39
38
  useHeader as default
@@ -8,6 +8,7 @@ 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";
11
12
  function analyzeChildren(children) {
12
13
  let hasLeftSidebar = !1, hasRightSidebar = !1, breadcrumb = null, overlay = null;
13
14
  const headerChildren = [], mainChildren = [];
@@ -58,7 +59,9 @@ const Root = ({
58
59
  variant,
59
60
  scrollMode,
60
61
  noPadding
61
- }), [variant, scrollMode, noPadding]), {
62
+ }), [variant, scrollMode, noPadding]);
63
+ useZendeskGuide();
64
+ const {
62
65
  hasLeftSidebar,
63
66
  hasRightSidebar,
64
67
  breadcrumb,
package/dist/homepage.js CHANGED
@@ -1,13 +1,17 @@
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";
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";
8
11
  import { NotificationListContainer } from "./modules/homepage/components/Notifications/NotificationListContainer.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";
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";
11
15
  import { Favorites } from "./modules/homepage/components/Favorites/Favorites.js";
12
16
  import { FavoritesContainer } from "./modules/homepage/components/Favorites/FavoritesContainer.js";
13
17
  import { LastInfosContainer } from "./modules/homepage/components/LastInfos/LastInfosContainer.js";
@@ -15,22 +19,32 @@ import { LastInfosList } from "./modules/homepage/components/LastInfos/LastInfos
15
19
  import { MessageFlashListContainer } from "./modules/homepage/components/MessageFlashList/MessageFlashListContainer.js";
16
20
  import { SchoolSpaceContainer } from "./modules/homepage/components/SchoolSpace/SchoolSpaceContainer.js";
17
21
  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";
18
24
  export {
25
+ default2 as Communities,
26
+ CommunitiesContainer,
27
+ default3 as CommunitiesItem,
28
+ default4 as CommunitiesSkeleton,
19
29
  Favorites,
20
30
  FavoritesContainer,
21
- default2 as Header,
22
- default3 as HomeCard,
23
- default4 as LastInfos,
31
+ default5 as Header,
32
+ default6 as HomeCard,
33
+ default7 as LastInfos,
24
34
  LastInfosContainer,
25
35
  LastInfosList,
26
- default5 as MessageFlash,
27
- default6 as MessageFlashList,
36
+ default8 as MessageFlash,
37
+ default9 as MessageFlashList,
28
38
  MessageFlashListContainer,
29
- default7 as NotificationItem,
30
- default8 as NotificationList,
39
+ default10 as NotificationItem,
40
+ default11 as NotificationList,
31
41
  NotificationListContainer,
32
- default9 as SchoolSpace,
42
+ default12 as SchoolSpace,
33
43
  SchoolSpaceContainer,
34
- default10 as UserSpace,
35
- UserSpaceContainer
44
+ default13 as UserSpace,
45
+ UserSpaceContainer,
46
+ childrenQueryKeys,
47
+ childrenQueryOptions,
48
+ useChildren,
49
+ useCommunities
36
50
  };
@@ -1 +1 @@
1
- export default function useClickOutside<T extends HTMLElement = any>(handler: () => void, events?: string[] | null, nodes?: Array<HTMLElement | null>): import('react').MutableRefObject<T | undefined>;
1
+ export default function useClickOutside<T extends HTMLElement = any>(handler: () => void, events?: string[] | null, nodes?: Array<HTMLElement | null>): import('react').MutableRefObject<T | null>;
@@ -1,7 +1,7 @@
1
1
  import { useRef, useEffect } from "react";
2
2
  const DEFAULT_EVENTS = ["mousedown", "touchstart"];
3
3
  function useClickOutside(handler, events, nodes) {
4
- const ref = useRef();
4
+ const ref = useRef(null);
5
5
  return useEffect(() => {
6
6
  const listener = (event) => {
7
7
  const {
@@ -0,0 +1,10 @@
1
+ import { Editor, EditorOptions, Extensions } from '@tiptap/core';
2
+ /**
3
+ * Builds a real, headless (uncoupled from React) tiptap `Editor` for
4
+ * component specs that need genuine ProseMirror state - selection, commands,
5
+ * `isActive` - rather than a hand-rolled mock. Callers should call
6
+ * `.destroy()` in `afterEach` to avoid leaking editor instances across tests.
7
+ */
8
+ export declare const createTestEditor: (overrides?: {
9
+ extensions?: Extensions;
10
+ } & Partial<EditorOptions>) => Editor;
@@ -0,0 +1,32 @@
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
+ };
@@ -0,0 +1,23 @@
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
+ };
@@ -0,0 +1,32 @@
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
+ };
@@ -0,0 +1,27 @@
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,10 +1,14 @@
1
+ export interface CommunityStats {
2
+ totalMembers: string;
3
+ memberCount: string;
4
+ adminCount: string;
5
+ communityId: number;
6
+ }
1
7
  export interface CommunitiesModel {
2
8
  id: number | string;
3
9
  title: string;
4
- communityImage?: string;
5
- icon?: string;
6
- nbNotifications?: number;
7
- notifications?: number;
10
+ image?: string;
11
+ stats?: CommunityStats;
8
12
  }
9
13
  export declare function useCommunities(): {
10
14
  communities: CommunitiesModel[];
@@ -0,0 +1,25 @@
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
+ };
@@ -1,5 +1,5 @@
1
1
  import { odeServices } from "@edifice.io/client";
2
- import { useQuery, queryOptions } from "@tanstack/react-query";
2
+ import { queryOptions, useQuery } from "@tanstack/react-query";
3
3
  const childrenQueryKeys = {
4
4
  all: (userId) => ["children", userId]
5
5
  };
@@ -1,3 +1,4 @@
1
1
  export * from './UserSpace';
2
2
  export { default as UserSpace } from './UserSpace';
3
3
  export * from './UserSpaceContainer';
4
+ export * from './hooks/useChildren';
@@ -1,3 +1,4 @@
1
+ export * from './Communities';
1
2
  export * from './Favorites';
2
3
  export * from './Header';
3
4
  export * from './HomeCard';
@@ -0,0 +1,154 @@
1
+ /**
2
+ * Doubles for the browser capture APIs the recorders rely on, none of which
3
+ * jsdom implements: `navigator.mediaDevices`, `MediaStream`, `MediaRecorder`,
4
+ * and the playback methods of `HTMLMediaElement`.
5
+ *
6
+ * Shared by the audio and the video recorder specs. The Web Audio doubles
7
+ * (`AudioContext`, `AudioWorkletNode`, `Worker`) sit in the second half of this
8
+ * file, behind `installWebAudioHarness`: only `useAudioRecorder` needs them,
9
+ * but both of its specs do.
10
+ */
11
+ /** A track the component can stop to release the device. */
12
+ export declare function fakeTrack(kind?: 'audio' | 'video'): MediaStreamTrack;
13
+ /**
14
+ * `MediaStream` has to exist as a constructor, not just as a shape:
15
+ * <VideoRecorder> narrows with `srcObject instanceof MediaStream` before
16
+ * resetting it.
17
+ */
18
+ export declare class FakeMediaStream {
19
+ id: string;
20
+ private tracks;
21
+ constructor(tracks?: MediaStreamTrack[]);
22
+ static created: number;
23
+ getTracks(): MediaStreamTrack[];
24
+ }
25
+ export type FakeMediaStreamInstance = FakeMediaStream & MediaStream;
26
+ /** Records what the component asked of it, and lets a test push data back. */
27
+ export declare class FakeMediaRecorder {
28
+ static instances: FakeMediaRecorder[];
29
+ /** Mime types rejected by `isTypeSupported`, to exercise the fallbacks. */
30
+ static unsupported: string[];
31
+ state: 'inactive' | 'recording' | 'paused';
32
+ ondataavailable: ((event: {
33
+ data: Blob;
34
+ }) => void) | null;
35
+ onerror: ((event: unknown) => void) | null;
36
+ readonly stream: MediaStream;
37
+ readonly mimeType: string;
38
+ readonly start: import('vitest').Mock<(timeslice?: number) => void>;
39
+ readonly stop: import('vitest').Mock<() => void>;
40
+ readonly requestData: import('vitest').Mock<(...args: any[]) => any>;
41
+ timeslice?: number;
42
+ constructor(stream: MediaStream, options?: {
43
+ mimeType?: string;
44
+ });
45
+ static isTypeSupported(type: string): boolean;
46
+ /** Hands a chunk to the component, as the browser would every timeslice. */
47
+ emitData(blob: Blob): void;
48
+ emitError(event?: unknown): void;
49
+ }
50
+ export type MediaHarness = {
51
+ /** The stream handed over by `getUserMedia`. */
52
+ stream: FakeMediaStreamInstance;
53
+ getUserMedia: ReturnType<typeof vi.fn>;
54
+ enumerateDevices: ReturnType<typeof vi.fn>;
55
+ createObjectURL: ReturnType<typeof vi.fn>;
56
+ revokeObjectURL: ReturnType<typeof vi.fn>;
57
+ /** Every MediaRecorder built since the harness was installed. */
58
+ recorders: FakeMediaRecorder[];
59
+ /** The recorder currently in use, i.e. the last one built. */
60
+ recorder: () => FakeMediaRecorder;
61
+ };
62
+ export declare function videoInput(deviceId: string, label?: string): MediaDeviceInfo;
63
+ export declare function audioInput(deviceId?: string): MediaDeviceInfo;
64
+ /**
65
+ * Installs every double on the global scope. Call from `beforeEach`; the stubs
66
+ * are torn down by the `restoreMocks`/`unstubGlobals` handling of the runner,
67
+ * so nothing has to be undone by hand.
68
+ *
69
+ * @param devices what `enumerateDevices` should report
70
+ * @param stream the stream `getUserMedia` should resolve to
71
+ */
72
+ export declare function installMediaHarness({ devices, stream, }?: {
73
+ devices?: MediaDeviceInfo[];
74
+ stream?: FakeMediaStreamInstance;
75
+ }): MediaHarness;
76
+ /**
77
+ * Replaces the playback methods jsdom leaves unimplemented, and makes
78
+ * `currentTime` writable so the components can rewind their media element.
79
+ */
80
+ export declare function installMediaElementStubs(): void;
81
+ export declare class FakeAudioWorkletNode {
82
+ readonly context: FakeAudioContext;
83
+ readonly processorName: string;
84
+ static instances: FakeAudioWorkletNode[];
85
+ readonly connect: import('vitest').Mock<(...args: any[]) => any>;
86
+ readonly disconnect: import('vitest').Mock<(...args: any[]) => any>;
87
+ /**
88
+ * The `MessagePort` is driven by hand: the hook subscribes with
89
+ * `addEventListener`, so the listeners are replayed by `emitSamples`.
90
+ */
91
+ readonly port: {
92
+ addEventListener: import('vitest').Mock<(...args: any[]) => any>;
93
+ removeEventListener: import('vitest').Mock<(...args: any[]) => any>;
94
+ close: import('vitest').Mock<(...args: any[]) => any>;
95
+ start: import('vitest').Mock<(...args: any[]) => any>;
96
+ postMessage: import('vitest').Mock<(...args: any[]) => any>;
97
+ };
98
+ constructor(context: FakeAudioContext, processorName: string);
99
+ /** Replays a block of samples, as the AudioWorkletProcessor would. */
100
+ emitSamples(inputs: unknown): void;
101
+ }
102
+ export declare class FakeAudioContext {
103
+ static instances: FakeAudioContext[];
104
+ /** Replaceable, to exercise the addModule failure path. */
105
+ static addModule: import('vitest').Mock<(moduleURL: string) => Promise<void>>;
106
+ readonly sampleRate: number;
107
+ /** Writable: the hook reads it to compute the elapsed recording time. */
108
+ currentTime: number;
109
+ readonly destination: {
110
+ connect: import('vitest').Mock<(...args: any[]) => any>;
111
+ disconnect: import('vitest').Mock<(...args: any[]) => any>;
112
+ };
113
+ readonly close: import('vitest').Mock<(...args: any[]) => any>;
114
+ readonly suspend: import('vitest').Mock<(...args: any[]) => any>;
115
+ readonly resume: import('vitest').Mock<(...args: any[]) => any>;
116
+ readonly createMediaStreamSource: import('vitest').Mock<() => {
117
+ connect: import('vitest').Mock<(...args: any[]) => any>;
118
+ disconnect: import('vitest').Mock<(...args: any[]) => any>;
119
+ }>;
120
+ readonly audioWorklet: {
121
+ addModule: (path: string) => Promise<void>;
122
+ };
123
+ constructor(options?: {
124
+ sampleRate?: number;
125
+ });
126
+ }
127
+ export declare class FakeWorker {
128
+ readonly url: string;
129
+ static instances: FakeWorker[];
130
+ readonly postMessage: import('vitest').Mock<(...args: any[]) => any>;
131
+ readonly terminate: import('vitest').Mock<(...args: any[]) => any>;
132
+ onmessage: ((event: {
133
+ data: unknown;
134
+ }) => void) | null;
135
+ constructor(url: string);
136
+ /** Answers the last `postMessage`, as the encoder worker would. */
137
+ emit(data: unknown): void;
138
+ /** The payload of the last message the hook sent, e.g. ['wav', …]. */
139
+ lastMessage(): any;
140
+ }
141
+ export type WebAudioHarness = {
142
+ /** The context opened by the current recording. */
143
+ context: () => FakeAudioContext;
144
+ /** The worklet node processing the current recording. */
145
+ workletNode: () => FakeAudioWorkletNode;
146
+ /** The encoder worker, created once on mount. */
147
+ worker: () => FakeWorker;
148
+ addModule: typeof FakeAudioContext.addModule;
149
+ };
150
+ /**
151
+ * Installs the Web Audio doubles. Combine with `installMediaHarness`, which
152
+ * provides `getUserMedia` and the blob URL factory the encoder result needs.
153
+ */
154
+ export declare function installWebAudioHarness(): WebAudioHarness;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@edifice.io/react",
3
- "version": "2.6.3",
3
+ "version": "2.6.4-develop-integration-demo.20260901111601",
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.3",
144
- "@edifice.io/tiptap-extensions": "2.6.3",
145
- "@edifice.io/utilities": "2.6.3"
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"
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.3",
177
- "@edifice.io/config": "2.6.3"
176
+ "@edifice.io/config": "2.6.4-develop-integration-demo.20260901111601",
177
+ "@edifice.io/client": "2.6.4-develop-integration-demo.20260901111601"
178
178
  },
179
179
  "peerDependencies": {
180
180
  "@react-spring/web": "9.7.5",
@@ -1,8 +0,0 @@
1
- import { Meta, StoryObj } from '@storybook/react-vite';
2
- import { default as LinkerCard } from './LinkerCard';
3
- declare const meta: Meta<typeof LinkerCard>;
4
- export default meta;
5
- type Story = StoryObj<typeof LinkerCard>;
6
- export declare const Base: Story;
7
- export declare const TimelineGenerator: Story;
8
- export declare const Blog: Story;
@@ -1,9 +0,0 @@
1
- import { Meta, StoryObj } from '@storybook/react-vite';
2
- import { default as UploadCard } from './UploadCard';
3
- declare const meta: Meta<typeof UploadCard>;
4
- export default meta;
5
- type Story = StoryObj<typeof UploadCard>;
6
- export declare const Base: Story;
7
- export declare const IsLoading: Story;
8
- export declare const IsSuccess: Story;
9
- export declare const IsError: Story;