@edifice.io/react 2.5.16-develop-integration.20260410124947 → 2.5.16-develop-pedago.20260413164323
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/Dropdown/Dropdown.d.ts +2 -6
- package/dist/components/Dropdown/Dropdown.js +6 -21
- package/dist/components/Dropdown/DropdownCheckboxItem.d.ts +1 -6
- package/dist/components/Dropdown/DropdownCheckboxItem.js +6 -18
- package/dist/components/Dropdown/DropdownContext.d.ts +0 -5
- package/dist/components/Dropdown/DropdownItem.d.ts +1 -6
- package/dist/components/Dropdown/DropdownItem.js +6 -20
- package/dist/components/Layout/components/Header.js +7 -0
- package/dist/components/Layout/hooks/useHeader.js +3 -2
- package/dist/components/index.d.ts +0 -1
- package/dist/hooks/useDropdown/useDropdown.js +8 -7
- package/dist/hooks/useZendeskGuide/useZendeskGuide.js +1 -1
- package/dist/index.js +0 -2
- package/dist/modules/icons/components/nav/IconCommunities.js +1 -1
- package/dist/modules/multimedia/Linker/InternalLinker/InternalLinker.d.ts +3 -1
- package/dist/modules/multimedia/Linker/InternalLinker/InternalLinker.js +2 -1
- package/package.json +6 -6
- package/dist/components/Dropdown/DropdownSearchInput.d.ts +0 -20
- package/dist/components/Dropdown/DropdownSearchInput.js +0 -25
- package/dist/components/Pagination/Pagination.d.ts +0 -17
- package/dist/components/Pagination/Pagination.js +0 -14
- package/dist/components/Pagination/index.d.ts +0 -1
|
@@ -81,7 +81,7 @@ declare const Dropdown: import('react').ForwardRefExoticComponent<DropdownProps
|
|
|
81
81
|
Trigger: import('react').ForwardRefExoticComponent<Omit<import('./DropdownTrigger').DropdownTriggerProps, "ref"> & import('react').RefAttributes<HTMLButtonElement>>;
|
|
82
82
|
Menu: import('react').ForwardRefExoticComponent<Omit<import('./DropdownMenu').DropdownMenuProps, "ref"> & import('react').RefAttributes<HTMLDivElement>>;
|
|
83
83
|
Item: {
|
|
84
|
-
({ type, icon, onClick, children, className, minWidth, disabled,
|
|
84
|
+
({ type, icon, onClick, children, className, minWidth, disabled, ...restProps }: import('./DropdownItem').DropdownItemProps): import("react/jsx-runtime").JSX.Element;
|
|
85
85
|
displayName: string;
|
|
86
86
|
};
|
|
87
87
|
Separator: {
|
|
@@ -89,7 +89,7 @@ declare const Dropdown: import('react').ForwardRefExoticComponent<DropdownProps
|
|
|
89
89
|
displayName: string;
|
|
90
90
|
};
|
|
91
91
|
CheckboxItem: {
|
|
92
|
-
({ children, value, model, onChange,
|
|
92
|
+
({ children, value, model, onChange, }: DropdownCheckboxItem): import("react/jsx-runtime").JSX.Element;
|
|
93
93
|
displayName: string;
|
|
94
94
|
};
|
|
95
95
|
RadioItem: {
|
|
@@ -97,9 +97,5 @@ declare const Dropdown: import('react').ForwardRefExoticComponent<DropdownProps
|
|
|
97
97
|
displayName: string;
|
|
98
98
|
};
|
|
99
99
|
MenuGroup: import('react').ForwardRefExoticComponent<import('./DropdownMenuGroup').DropdownMenuGroupProps & import('react').RefAttributes<HTMLDivElement>>;
|
|
100
|
-
SearchInput: {
|
|
101
|
-
({ placeholder, noResultsLabel, onSearch, }: import('./DropdownSearchInput').DropdownSearchInputProps): import("react/jsx-runtime").JSX.Element;
|
|
102
|
-
displayName: string;
|
|
103
|
-
};
|
|
104
100
|
};
|
|
105
101
|
export default Dropdown;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
|
-
import { forwardRef,
|
|
2
|
+
import { forwardRef, useImperativeHandle, useMemo, useEffect } from "react";
|
|
3
3
|
import clsx from "clsx";
|
|
4
4
|
import useDropdown from "../../hooks/useDropdown/useDropdown.js";
|
|
5
5
|
import DropdownCheckboxItem from "./DropdownCheckboxItem.js";
|
|
@@ -8,7 +8,6 @@ import DropdownItem from "./DropdownItem.js";
|
|
|
8
8
|
import DropdownMenu from "./DropdownMenu.js";
|
|
9
9
|
import DropdownMenuGroup from "./DropdownMenuGroup.js";
|
|
10
10
|
import DropdownRadioItem from "./DropdownRadioItem.js";
|
|
11
|
-
import DropdownSearchInput from "./DropdownSearchInput.js";
|
|
12
11
|
import DropdownSeparator from "./DropdownSeparator.js";
|
|
13
12
|
import DropdownTrigger from "./DropdownTrigger.js";
|
|
14
13
|
import useClickOutside from "../../hooks/useClickOutside/useClickOutside.js";
|
|
@@ -25,15 +24,7 @@ const Root = /* @__PURE__ */ forwardRef(({
|
|
|
25
24
|
openOnSpace = !0,
|
|
26
25
|
focusOnMouseEnter = !0
|
|
27
26
|
}, refDropdown) => {
|
|
28
|
-
const
|
|
29
|
-
matchMapRef.current.set(id, isMatch);
|
|
30
|
-
const next = [...matchMapRef.current.values()].some(Boolean);
|
|
31
|
-
setHasMatches((prev) => prev !== next ? next : prev);
|
|
32
|
-
}, []), unregisterMatch = useCallback((id) => {
|
|
33
|
-
matchMapRef.current.delete(id);
|
|
34
|
-
const next = matchMapRef.current.size === 0 || [...matchMapRef.current.values()].some(Boolean);
|
|
35
|
-
setHasMatches((prev) => prev !== next ? next : prev);
|
|
36
|
-
}, []), {
|
|
27
|
+
const {
|
|
37
28
|
visible,
|
|
38
29
|
isFocused,
|
|
39
30
|
triggerProps,
|
|
@@ -67,19 +58,14 @@ const Root = /* @__PURE__ */ forwardRef(({
|
|
|
67
58
|
block,
|
|
68
59
|
setVisible,
|
|
69
60
|
openDropdown,
|
|
70
|
-
closeDropdown
|
|
71
|
-
|
|
72
|
-
setSearchQuery,
|
|
73
|
-
hasMatches,
|
|
74
|
-
reportMatch,
|
|
75
|
-
unregisterMatch
|
|
76
|
-
}), [visible, isFocused, triggerProps, menuProps, itemProps, itemRefs, block, setVisible, openDropdown, closeDropdown, searchQuery, hasMatches, reportMatch, unregisterMatch]), dropdown = clsx("dropdown", {
|
|
61
|
+
closeDropdown
|
|
62
|
+
}), [visible, isFocused, triggerProps, menuProps, itemProps, itemRefs, block, setVisible, openDropdown, closeDropdown]), dropdown = clsx("dropdown", {
|
|
77
63
|
"w-100": block,
|
|
78
64
|
"dropdown-nowrap": noWrap,
|
|
79
65
|
overflow
|
|
80
66
|
});
|
|
81
67
|
return useEffect(() => {
|
|
82
|
-
onToggle == null || onToggle(visible)
|
|
68
|
+
onToggle == null || onToggle(visible);
|
|
83
69
|
}, [visible]), /* @__PURE__ */ jsx(DropdownContext.Provider, { value, children: /* @__PURE__ */ jsx("div", { ref, className: dropdown, children: typeof children == "function" ? children(triggerProps, itemRefs, setVisible) : children }) });
|
|
84
70
|
}), Dropdown = /* @__PURE__ */ Object.assign(Root, {
|
|
85
71
|
Trigger: DropdownTrigger,
|
|
@@ -88,8 +74,7 @@ const Root = /* @__PURE__ */ forwardRef(({
|
|
|
88
74
|
Separator: DropdownSeparator,
|
|
89
75
|
CheckboxItem: DropdownCheckboxItem,
|
|
90
76
|
RadioItem: DropdownRadioItem,
|
|
91
|
-
MenuGroup: DropdownMenuGroup
|
|
92
|
-
SearchInput: DropdownSearchInput
|
|
77
|
+
MenuGroup: DropdownMenuGroup
|
|
93
78
|
});
|
|
94
79
|
export {
|
|
95
80
|
Dropdown as default
|
|
@@ -16,14 +16,9 @@ interface DropdownCheckboxItem {
|
|
|
16
16
|
* OnKeyDown handler
|
|
17
17
|
*/
|
|
18
18
|
onChange: (value: string | number) => void;
|
|
19
|
-
/**
|
|
20
|
-
* Value used to filter this item when `Dropdown.SearchInput` is present.
|
|
21
|
-
* If provided, the item is hidden when the search query doesn't match.
|
|
22
|
-
*/
|
|
23
|
-
searchValue?: string;
|
|
24
19
|
}
|
|
25
20
|
declare const DropdownCheckboxItem: {
|
|
26
|
-
({ children, value, model, onChange,
|
|
21
|
+
({ children, value, model, onChange, }: DropdownCheckboxItem): import("react/jsx-runtime").JSX.Element;
|
|
27
22
|
displayName: string;
|
|
28
23
|
};
|
|
29
24
|
export default DropdownCheckboxItem;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { useId
|
|
2
|
+
import { useId } from "react";
|
|
3
3
|
import clsx from "clsx";
|
|
4
4
|
import { useDropdownContext } from "./DropdownContext.js";
|
|
5
5
|
import Checkbox from "../Checkbox/Checkbox.js";
|
|
@@ -7,20 +7,16 @@ const DropdownCheckboxItem = ({
|
|
|
7
7
|
children,
|
|
8
8
|
value,
|
|
9
9
|
model,
|
|
10
|
-
onChange
|
|
11
|
-
searchValue
|
|
10
|
+
onChange
|
|
12
11
|
}) => {
|
|
13
12
|
const {
|
|
14
13
|
itemProps,
|
|
15
14
|
itemRefs,
|
|
16
|
-
isFocused
|
|
17
|
-
|
|
18
|
-
reportMatch,
|
|
19
|
-
unregisterMatch
|
|
20
|
-
} = useDropdownContext(), id = useId(), {
|
|
15
|
+
isFocused
|
|
16
|
+
} = useDropdownContext(), {
|
|
21
17
|
onMenuItemKeyDown,
|
|
22
18
|
onMenuItemMouseEnter
|
|
23
|
-
} = itemProps,
|
|
19
|
+
} = itemProps, id = useId(), checked = model.includes(value), checkboxProps = {
|
|
24
20
|
value,
|
|
25
21
|
model,
|
|
26
22
|
checked,
|
|
@@ -28,15 +24,7 @@ const DropdownCheckboxItem = ({
|
|
|
28
24
|
}, dropdownCheckboxItem = clsx("dropdown-item c-pointer", {
|
|
29
25
|
focus: isFocused === id
|
|
30
26
|
});
|
|
31
|
-
return
|
|
32
|
-
if (searchValue !== void 0)
|
|
33
|
-
return reportMatch(id, !isFiltered), () => unregisterMatch(id);
|
|
34
|
-
}, [id, isFiltered, searchValue, reportMatch, unregisterMatch]), isFiltered ? /* @__PURE__ */ jsx("div", { "aria-hidden": "true", style: {
|
|
35
|
-
visibility: "hidden",
|
|
36
|
-
height: 0,
|
|
37
|
-
overflow: "hidden",
|
|
38
|
-
pointerEvents: "none"
|
|
39
|
-
}, children: /* @__PURE__ */ jsx("div", { className: "dropdown-item", children: /* @__PURE__ */ jsx("div", { className: "d-flex gap-8 align-items-center justify-content-between position-relative", children }) }) }) : /* @__PURE__ */ jsx("div", { id, ref: (el) => itemRefs.current[id] = el, role: "menuitemcheckbox", "aria-checked": checked, onMouseUp: () => onChange(value), onKeyDown: (event) => onMenuItemKeyDown(event, () => onChange(value)), onMouseEnter: onMenuItemMouseEnter, tabIndex: checked ? 0 : -1, className: dropdownCheckboxItem, children: /* @__PURE__ */ jsxs("div", { className: "d-flex gap-8 align-items-center justify-content-between position-relative", children: [
|
|
27
|
+
return /* @__PURE__ */ jsx("div", { id, ref: (el) => itemRefs.current[id] = el, role: "menuitemcheckbox", "aria-checked": checked, onMouseUp: () => onChange(value), onKeyDown: (event) => onMenuItemKeyDown(event, () => onChange(value)), onMouseEnter: onMenuItemMouseEnter, tabIndex: checked ? 0 : -1, className: dropdownCheckboxItem, children: /* @__PURE__ */ jsxs("div", { className: "d-flex gap-8 align-items-center justify-content-between position-relative", children: [
|
|
40
28
|
children,
|
|
41
29
|
/* @__PURE__ */ jsx(Checkbox, { ...checkboxProps })
|
|
42
30
|
] }) });
|
|
@@ -2,11 +2,6 @@ import { UseDropdownProps } from '../../hooks/useDropdown/useDropdown';
|
|
|
2
2
|
type OmittedProps = Omit<UseDropdownProps, 'triggerRef' | 'menuRef'>;
|
|
3
3
|
export interface DropdownContextProps extends OmittedProps {
|
|
4
4
|
block?: boolean;
|
|
5
|
-
searchQuery: string;
|
|
6
|
-
setSearchQuery: (query: string) => void;
|
|
7
|
-
hasMatches: boolean;
|
|
8
|
-
reportMatch: (id: string, isMatch: boolean) => void;
|
|
9
|
-
unregisterMatch: (id: string) => void;
|
|
10
5
|
}
|
|
11
6
|
export declare const DropdownContext: import('react').Context<DropdownContextProps | null>;
|
|
12
7
|
export declare const useDropdownContext: () => DropdownContextProps;
|
|
@@ -29,14 +29,9 @@ export interface DropdownItemProps {
|
|
|
29
29
|
* Disabled status
|
|
30
30
|
*/
|
|
31
31
|
disabled?: boolean;
|
|
32
|
-
/**
|
|
33
|
-
* Value used to filter this item when `Dropdown.SearchInput` is present.
|
|
34
|
-
* If provided, the item is hidden when the search query doesn't match.
|
|
35
|
-
*/
|
|
36
|
-
searchValue?: string;
|
|
37
32
|
}
|
|
38
33
|
declare const DropdownItem: {
|
|
39
|
-
({ type, icon, onClick, children, className, minWidth, disabled,
|
|
34
|
+
({ type, icon, onClick, children, className, minWidth, disabled, ...restProps }: DropdownItemProps): import("react/jsx-runtime").JSX.Element;
|
|
40
35
|
displayName: string;
|
|
41
36
|
};
|
|
42
37
|
export default DropdownItem;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { useId
|
|
2
|
+
import { useId } from "react";
|
|
3
3
|
import clsx from "clsx";
|
|
4
4
|
import { useDropdownContext } from "./DropdownContext.js";
|
|
5
5
|
const DropdownItem = ({
|
|
@@ -10,28 +10,19 @@ const DropdownItem = ({
|
|
|
10
10
|
className,
|
|
11
11
|
minWidth,
|
|
12
12
|
disabled,
|
|
13
|
-
searchValue,
|
|
14
13
|
...restProps
|
|
15
14
|
}) => {
|
|
16
15
|
const {
|
|
17
16
|
itemProps,
|
|
18
17
|
itemRefs,
|
|
19
|
-
isFocused
|
|
20
|
-
|
|
21
|
-
reportMatch,
|
|
22
|
-
unregisterMatch
|
|
23
|
-
} = useDropdownContext(), id = useId(), {
|
|
18
|
+
isFocused
|
|
19
|
+
} = useDropdownContext(), {
|
|
24
20
|
onMenuItemKeyDown,
|
|
25
21
|
onMenuItemMouseEnter,
|
|
26
22
|
onMenuItemClick
|
|
27
|
-
} = itemProps,
|
|
28
|
-
useLayoutEffect(() => {
|
|
29
|
-
if (searchValue !== void 0)
|
|
30
|
-
return reportMatch(id, !isFiltered), () => unregisterMatch(id);
|
|
31
|
-
}, [id, isFiltered, searchValue, reportMatch, unregisterMatch]);
|
|
32
|
-
const handleOnClick = (event) => {
|
|
23
|
+
} = itemProps, handleOnClick = (event) => {
|
|
33
24
|
disabled || (onClick == null || onClick(event), type === "action" && (onMenuItemClick(), event.stopPropagation()));
|
|
34
|
-
}, dropdownItem = clsx("dropdown-item", {
|
|
25
|
+
}, id = useId(), dropdownItem = clsx("dropdown-item", {
|
|
35
26
|
focus: isFocused === id
|
|
36
27
|
}, {
|
|
37
28
|
"text-gray-600": disabled
|
|
@@ -40,12 +31,7 @@ const DropdownItem = ({
|
|
|
40
31
|
minWidth: `${minWidth}px`
|
|
41
32
|
}
|
|
42
33
|
};
|
|
43
|
-
return
|
|
44
|
-
display: "none"
|
|
45
|
-
}, children: /* @__PURE__ */ jsx("div", { className: "dropdown-item", children: /* @__PURE__ */ jsxs("div", { className: "d-flex gap-8 align-items-center", children: [
|
|
46
|
-
icon,
|
|
47
|
-
children
|
|
48
|
-
] }) }) }) : /* @__PURE__ */ jsx("div", { id, role: "menuitem", style, ref: (el) => itemRefs.current[id] = el, tabIndex: isFocused === id ? 0 : -1, className: dropdownItem, "aria-current": isFocused === id, onClick: handleOnClick, onMouseEnter: onMenuItemMouseEnter, onKeyDown: (event) => onMenuItemKeyDown(event, onClick), ...restProps, children: /* @__PURE__ */ jsxs("div", { className: "d-flex gap-8 align-items-center", children: [
|
|
34
|
+
return /* @__PURE__ */ jsx("div", { id, role: "menuitem", style, ref: (el) => itemRefs.current[id] = el, tabIndex: isFocused === id ? 0 : -1, className: dropdownItem, "aria-current": isFocused === id, onClick: handleOnClick, onMouseEnter: onMenuItemMouseEnter, onKeyDown: (event) => onMenuItemKeyDown(event, onClick), ...restProps, children: /* @__PURE__ */ jsxs("div", { className: "d-flex gap-8 align-items-center", children: [
|
|
49
35
|
icon,
|
|
50
36
|
children
|
|
51
37
|
] }) });
|
|
@@ -4,6 +4,7 @@ import { useTranslation } from "react-i18next";
|
|
|
4
4
|
import { useEdificeClient } from "../../../providers/EdificeClientProvider/EdificeClientProvider.hook.js";
|
|
5
5
|
import { useEdificeTheme } from "../../../providers/EdificeThemeProvider/EdificeThemeProvider.hook.js";
|
|
6
6
|
import SvgIconRafterDown from "../../../modules/icons/components/IconRafterDown.js";
|
|
7
|
+
import SvgIconCommunities from "../../../modules/icons/components/nav/IconCommunities.js";
|
|
7
8
|
import SvgIconCommunity from "../../../modules/icons/components/nav/IconCommunity.js";
|
|
8
9
|
import SvgIconDisconnect from "../../../modules/icons/components/nav/IconDisconnect.js";
|
|
9
10
|
import SvgIconHome from "../../../modules/icons/components/nav/IconHome.js";
|
|
@@ -67,6 +68,7 @@ const Header = ({
|
|
|
67
68
|
userName,
|
|
68
69
|
welcomeUser,
|
|
69
70
|
communityWorkflow,
|
|
71
|
+
communitiesWorkflow,
|
|
70
72
|
conversationWorflow,
|
|
71
73
|
searchWorkflow,
|
|
72
74
|
isCollapsed,
|
|
@@ -97,6 +99,7 @@ const Header = ({
|
|
|
97
99
|
/* @__PURE__ */ jsx(SvgIconOneMessaging, { className: "icon notification" }),
|
|
98
100
|
/* @__PURE__ */ jsx(VisuallyHidden, { children: t("navbar.messages") })
|
|
99
101
|
] }) }),
|
|
102
|
+
communitiesWorkflow && /* @__PURE__ */ jsx(NavItem, { children: /* @__PURE__ */ jsx(NavLink, { link: "/communities", translate: t("navbar.community"), children: /* @__PURE__ */ jsx(SvgIconCommunities, { className: "icon communities text-purple-500" }) }) }),
|
|
100
103
|
/* @__PURE__ */ jsx(NavItem, { children: /* @__PURE__ */ jsx(NavLink, { link: "/userbook/mon-compte", className: "dropdown-item", translate: t("navbar.myaccount"), children: /* @__PURE__ */ jsx(SvgIconOneProfile, { className: "icon user" }) }) }),
|
|
101
104
|
currentLanguage === "fr" && hasOldHelpEnableWorkflow ? /* @__PURE__ */ jsxs(NavItem, { children: [
|
|
102
105
|
/* @__PURE__ */ jsxs("button", { className: "nav-link", onClick: () => {
|
|
@@ -177,6 +180,10 @@ const Header = ({
|
|
|
177
180
|
/* @__PURE__ */ jsx(SvgIconCommunity, { className: "icon community" }),
|
|
178
181
|
/* @__PURE__ */ jsx("span", { className: "nav-text", children: t("navbar.community") })
|
|
179
182
|
] }) }),
|
|
183
|
+
communitiesWorkflow && /* @__PURE__ */ jsx(NavItem, { children: /* @__PURE__ */ jsxs("a", { href: "/communities", className: "nav-link dropdown-item", children: [
|
|
184
|
+
/* @__PURE__ */ jsx(SvgIconCommunities, { className: "icon communities" }),
|
|
185
|
+
/* @__PURE__ */ jsx("span", { className: "nav-text", children: t("navbar.community") })
|
|
186
|
+
] }) }),
|
|
180
187
|
searchWorkflow ? /* @__PURE__ */ jsx(SearchEngine, {}) : null,
|
|
181
188
|
/* @__PURE__ */ jsx(NavItem, { children: /* @__PURE__ */ jsxs("a", { href: "/userbook/mon-compte", className: "nav-link dropdown-item", children: [
|
|
182
189
|
/* @__PURE__ */ jsx(Avatar, { alt: userName, size: "sm", src: userAvatar, variant: "circle", className: "bg-white", width: "32", height: "32" }),
|
|
@@ -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"), conversationWorflow = useHasWorkflow("org.entcore.conversation.controllers.ConversationController|view"), searchWorkflow = useHasWorkflow("fr.openent.searchengine.controllers.SearchEngineController|view"), toggleCollapsedNav = useCallback(() => {
|
|
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(() => {
|
|
18
18
|
setIsCollapsed(!isCollapsed);
|
|
19
19
|
}, [isCollapsed]);
|
|
20
20
|
return useMemo(() => ({
|
|
@@ -28,11 +28,12 @@ function useHeader({
|
|
|
28
28
|
userName,
|
|
29
29
|
welcomeUser,
|
|
30
30
|
communityWorkflow,
|
|
31
|
+
communitiesWorkflow,
|
|
31
32
|
conversationWorflow,
|
|
32
33
|
searchWorkflow,
|
|
33
34
|
isCollapsed,
|
|
34
35
|
toggleCollapsedNav
|
|
35
|
-
}), [appsRef, bookmarkedApps, communityWorkflow, conversationWorflow, isAppsHovered, isCollapsed, popoverAppsId, popoverSearchId, searchWorkflow, title, toggleCollapsedNav, userAvatar, userName, welcomeUser]);
|
|
36
|
+
}), [appsRef, bookmarkedApps, communitiesWorkflow, communityWorkflow, conversationWorflow, isAppsHovered, isCollapsed, popoverAppsId, popoverSearchId, searchWorkflow, title, toggleCollapsedNav, userAvatar, userName, welcomeUser]);
|
|
36
37
|
}
|
|
37
38
|
export {
|
|
38
39
|
useHeader as default
|
|
@@ -47,16 +47,17 @@ const useDropdown = (placement, extraTriggerKeyDownHandler, isTriggerHovered = !
|
|
|
47
47
|
}
|
|
48
48
|
}
|
|
49
49
|
}, [activeIndex]);
|
|
50
|
-
const
|
|
51
|
-
const
|
|
52
|
-
setActiveIndex((prevIndex) => (prevIndex + 1) %
|
|
50
|
+
const nextItem = () => {
|
|
51
|
+
const itemCount = Object.values(itemRefs.current).length;
|
|
52
|
+
setActiveIndex((prevIndex) => (prevIndex + 1) % itemCount);
|
|
53
53
|
}, previousItem = () => {
|
|
54
|
-
const
|
|
55
|
-
setActiveIndex((prevIndex) => (prevIndex - 1 +
|
|
54
|
+
const itemCount = Object.values(itemRefs.current).length;
|
|
55
|
+
setActiveIndex((prevIndex) => (prevIndex - 1 + itemCount) % itemCount);
|
|
56
56
|
}, firstItem = () => {
|
|
57
57
|
setActiveIndex(0);
|
|
58
58
|
}, lastItem = () => {
|
|
59
|
-
|
|
59
|
+
const itemCount = Object.values(itemRefs.current).length;
|
|
60
|
+
setActiveIndex(itemCount - 1);
|
|
60
61
|
}, openDropdown = useCallback(() => {
|
|
61
62
|
setVisible(!0);
|
|
62
63
|
}, []), closeDropdown = useCallback(() => {
|
|
@@ -89,7 +90,7 @@ const useDropdown = (placement, extraTriggerKeyDownHandler, isTriggerHovered = !
|
|
|
89
90
|
extraTriggerKeyDownHandler == null || extraTriggerKeyDownHandler(event), stopEvents(flag, event);
|
|
90
91
|
}, [closeDropdown, openDropdown]), onMenuItemMouseEnter = (event) => {
|
|
91
92
|
if (focusOnMouseEnter) {
|
|
92
|
-
const index = Object.values(itemRefs.current).
|
|
93
|
+
const index = Object.values(itemRefs.current).findIndex((item) => item.id === event.currentTarget.getAttribute("id"));
|
|
93
94
|
setActiveIndex(index);
|
|
94
95
|
}
|
|
95
96
|
}, onMenuItemKeyDown = useCallback((event, onSuccess) => {
|
package/dist/index.js
CHANGED
|
@@ -126,7 +126,6 @@ import { Layout } from "./components/Layout/Layout.js";
|
|
|
126
126
|
import { List } from "./components/List/List.js";
|
|
127
127
|
import { Menu } from "./components/Menu/components/Menu.js";
|
|
128
128
|
import { MockedProvider } from "./providers/MockedProvider/MockedProvider.js";
|
|
129
|
-
import { Pagination } from "./components/Pagination/Pagination.js";
|
|
130
129
|
import { Popover, PopoverBody, PopoverFooter, PopoverHeader } from "./components/Popover/Popover.js";
|
|
131
130
|
import { ResourceModal } from "./modules/modals/ResourceModal/ResourceModal.js";
|
|
132
131
|
import { Tabs } from "./components/Tabs/components/Tabs.js";
|
|
@@ -211,7 +210,6 @@ export {
|
|
|
211
210
|
MockedProvider,
|
|
212
211
|
default43 as Modal,
|
|
213
212
|
default44 as OnboardingModal,
|
|
214
|
-
Pagination,
|
|
215
213
|
Popover,
|
|
216
214
|
PopoverBody,
|
|
217
215
|
PopoverFooter,
|
|
@@ -5,7 +5,7 @@ const SvgIconCommunities = ({
|
|
|
5
5
|
...props
|
|
6
6
|
}) => /* @__PURE__ */ jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", width: "24", height: "24", viewBox: "0 0 50 50", "aria-hidden": "true", "aria-labelledby": titleId, ...props, children: [
|
|
7
7
|
title ? /* @__PURE__ */ jsx("title", { id: titleId, children: title }) : null,
|
|
8
|
-
/* @__PURE__ */ jsx("path", { d: "M25.807 33.165c4.726.17 8 3.997 8 8.5 0 .984-.795 1.775-1.775 1.775H18.977a1.774 1.774 0 0 1-1.776-1.775v-.201h-.004a8.303 8.303 0 0 1 8.61-8.299M8.61 24.451c4.726.17 8.001 3.997 8.001 8.5 0 .984-.796 1.776-1.775 1.776H1.776A1.774 1.774 0 0 1 0 32.95v-.201a8.303 8.303 0 0 1 8.61-8.299M41.61 24.006c4.499.162 8.001 3.996 8.001 8.5 0 .984-.796 1.775-1.775 1.775H34.779a1.774 1.774 0 0 1-1.775-1.775v-.201H33a8.303 8.303 0 0 1 8.61-8.3M25.142 20a5.143 5.143 0 1 1 0 10.285 5.143 5.143 0 0 1 0-10.285M8.308 11.627a5.141 5.141 0 1 1 0 10.282 5.141 5.141 0 0 1 0-10.282M41.691 11.627a5.142 5.142 0 1 1 .001 10.284 5.142 5.142 0 0 1 0-10.284M24.997 5.557a5.143 5.143 0 1 1 0 10.285 5.143 5.143 0 0 1 0-10.285" })
|
|
8
|
+
/* @__PURE__ */ jsx("path", { fill: "currentColor", d: "M25.807 33.165c4.726.17 8 3.997 8 8.5 0 .984-.795 1.775-1.775 1.775H18.977a1.774 1.774 0 0 1-1.776-1.775v-.201h-.004a8.303 8.303 0 0 1 8.61-8.299M8.61 24.451c4.726.17 8.001 3.997 8.001 8.5 0 .984-.796 1.776-1.775 1.776H1.776A1.774 1.774 0 0 1 0 32.95v-.201a8.303 8.303 0 0 1 8.61-8.299M41.61 24.006c4.499.162 8.001 3.996 8.001 8.5 0 .984-.796 1.775-1.775 1.775H34.779a1.774 1.774 0 0 1-1.775-1.775v-.201H33a8.303 8.303 0 0 1 8.61-8.3M25.142 20a5.143 5.143 0 1 1 0 10.285 5.143 5.143 0 0 1 0-10.285M8.308 11.627a5.141 5.141 0 1 1 0 10.282 5.141 5.141 0 0 1 0-10.282M41.691 11.627a5.142 5.142 0 1 1 .001 10.284 5.142 5.142 0 0 1 0-10.284M24.997 5.557a5.143 5.143 0 1 1 0 10.285 5.143 5.143 0 0 1 0-10.285" })
|
|
9
9
|
] });
|
|
10
10
|
export {
|
|
11
11
|
SvgIconCommunities as default
|
|
@@ -32,8 +32,10 @@ export interface InternalLinkerProps {
|
|
|
32
32
|
applicationList?: ApplicationOption[];
|
|
33
33
|
/** Whether to show the application selector */
|
|
34
34
|
showApplicationSelector?: boolean;
|
|
35
|
+
/** Disable application selecetor */
|
|
36
|
+
disableApplicationSelector?: boolean;
|
|
35
37
|
/** Optional callback to filter resources after loading. Applied in addition to search filters. */
|
|
36
38
|
resourceFilter?: (resource: ILinkedResource) => boolean;
|
|
37
39
|
}
|
|
38
|
-
export declare const InternalLinker: ({ appCode, defaultAppCode, defaultResourceId, onChange, onSelect, multiple, resourceList, applicationList, showApplicationSelector, resourceFilter, }: InternalLinkerProps) => import("react/jsx-runtime").JSX.Element;
|
|
40
|
+
export declare const InternalLinker: ({ appCode, defaultAppCode, defaultResourceId, onChange, onSelect, multiple, resourceList, applicationList, showApplicationSelector, disableApplicationSelector, resourceFilter, }: InternalLinkerProps) => import("react/jsx-runtime").JSX.Element;
|
|
39
41
|
export default InternalLinker;
|
|
@@ -22,6 +22,7 @@ const InternalLinker = ({
|
|
|
22
22
|
resourceList,
|
|
23
23
|
applicationList,
|
|
24
24
|
showApplicationSelector = !0,
|
|
25
|
+
disableApplicationSelector = !1,
|
|
25
26
|
resourceFilter
|
|
26
27
|
}) => {
|
|
27
28
|
const {
|
|
@@ -114,7 +115,7 @@ const InternalLinker = ({
|
|
|
114
115
|
/* @__PURE__ */ jsx(Dropdown.Trigger, { icon: /* @__PURE__ */ jsx("div", { className: "pe-8", children: (selectedApplication == null ? void 0 : selectedApplication.icon) || /* @__PURE__ */ jsx(SvgIconApplications, {}) }), label: /* @__PURE__ */ jsxs("span", { className: "d-md-inline d-sm-none", children: [
|
|
115
116
|
" ",
|
|
116
117
|
t((selectedApplication == null ? void 0 : selectedApplication.displayName) || "bbm.linker.int.choose")
|
|
117
|
-
] }), variant: "ghost", size: "md" }),
|
|
118
|
+
] }), variant: "ghost", size: "md", disabled: disableApplicationSelector }),
|
|
118
119
|
/* @__PURE__ */ jsx(Dropdown.Menu, { children: options == null ? void 0 : options.map((option) => /* @__PURE__ */ jsx(Dropdown.Item, { icon: option.icon, onClick: () => handleOptionClick(option), children: option.displayName }, option.application)) })
|
|
119
120
|
] }) }),
|
|
120
121
|
/* @__PURE__ */ jsx("div", { className: "flex-grow-1 align-self-center", children: /* @__PURE__ */ jsx("form", { className: "gap-16 d-flex w-100 align-items-center px-16 py-8", onSubmit: handleSubmit, children: /* @__PURE__ */ jsx(SearchBar, { isVariant: !0, placeholder: t("search"), size: "lg", className: "w-100", disabled: !selectedApplication, onChange: handleSearchChange }) }) })
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@edifice.io/react",
|
|
3
|
-
"version": "2.5.16-develop-
|
|
3
|
+
"version": "2.5.16-develop-pedago.20260413164323",
|
|
4
4
|
"description": "Edifice React Library",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react",
|
|
@@ -135,9 +135,9 @@
|
|
|
135
135
|
"swiper": "^10.1.0",
|
|
136
136
|
"ua-parser-js": "^1.0.36",
|
|
137
137
|
"react-pdf": "10.2.0",
|
|
138
|
-
"@edifice.io/bootstrap": "2.5.16-develop-
|
|
139
|
-
"@edifice.io/tiptap-extensions": "2.5.16-develop-
|
|
140
|
-
"@edifice.io/utilities": "2.5.16-develop-
|
|
138
|
+
"@edifice.io/bootstrap": "2.5.16-develop-pedago.20260413164323",
|
|
139
|
+
"@edifice.io/tiptap-extensions": "2.5.16-develop-pedago.20260413164323",
|
|
140
|
+
"@edifice.io/utilities": "2.5.16-develop-pedago.20260413164323"
|
|
141
141
|
},
|
|
142
142
|
"devDependencies": {
|
|
143
143
|
"@babel/plugin-transform-react-pure-annotations": "^7.23.3",
|
|
@@ -168,8 +168,8 @@
|
|
|
168
168
|
"vite": "^5.4.11",
|
|
169
169
|
"vite-plugin-dts": "^4.1.0",
|
|
170
170
|
"vite-tsconfig-paths": "^5.0.1",
|
|
171
|
-
"@edifice.io/
|
|
172
|
-
"@edifice.io/
|
|
171
|
+
"@edifice.io/config": "2.5.16-develop-pedago.20260413164323",
|
|
172
|
+
"@edifice.io/client": "2.5.16-develop-pedago.20260413164323"
|
|
173
173
|
},
|
|
174
174
|
"peerDependencies": {
|
|
175
175
|
"@react-spring/web": "^9.7.5",
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
export interface DropdownSearchInputProps {
|
|
2
|
-
/**
|
|
3
|
-
* Placeholder text for the search input
|
|
4
|
-
*/
|
|
5
|
-
placeholder?: string;
|
|
6
|
-
/**
|
|
7
|
-
* Label shown when no items match the search query
|
|
8
|
-
*/
|
|
9
|
-
noResultsLabel?: string;
|
|
10
|
-
/**
|
|
11
|
-
* Called whenever the search query changes.
|
|
12
|
-
* Useful to track the current query outside the Dropdown context.
|
|
13
|
-
*/
|
|
14
|
-
onSearch?: (query: string) => void;
|
|
15
|
-
}
|
|
16
|
-
declare const DropdownSearchInput: {
|
|
17
|
-
({ placeholder, noResultsLabel, onSearch, }: DropdownSearchInputProps): import("react/jsx-runtime").JSX.Element;
|
|
18
|
-
displayName: string;
|
|
19
|
-
};
|
|
20
|
-
export default DropdownSearchInput;
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
|
-
import { useDropdownContext } from "./DropdownContext.js";
|
|
3
|
-
import SearchBar from "../SearchBar/SearchBar.js";
|
|
4
|
-
const DropdownSearchInput = ({
|
|
5
|
-
placeholder = "Rechercher...",
|
|
6
|
-
noResultsLabel = "Pas de résultat",
|
|
7
|
-
onSearch
|
|
8
|
-
}) => {
|
|
9
|
-
const {
|
|
10
|
-
searchQuery,
|
|
11
|
-
setSearchQuery,
|
|
12
|
-
hasMatches
|
|
13
|
-
} = useDropdownContext();
|
|
14
|
-
return /* @__PURE__ */ jsxs("div", { className: "px-8 pb-8", children: [
|
|
15
|
-
/* @__PURE__ */ jsx(SearchBar, { isVariant: !0, clearable: !0, size: "md", placeholder, value: searchQuery, onChange: (e) => {
|
|
16
|
-
setSearchQuery(e.target.value), onSearch == null || onSearch(e.target.value);
|
|
17
|
-
}, onKeyDown: (e) => {
|
|
18
|
-
["ArrowUp", "ArrowDown", "Enter", " "].includes(e.key) && e.stopPropagation();
|
|
19
|
-
} }),
|
|
20
|
-
searchQuery && !hasMatches && /* @__PURE__ */ jsx("p", { className: "body-2 text-gray-700 text-center mt-8 mb-0", children: noResultsLabel })
|
|
21
|
-
] });
|
|
22
|
-
};
|
|
23
|
-
export {
|
|
24
|
-
DropdownSearchInput as default
|
|
25
|
-
};
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
export interface PaginationProps {
|
|
2
|
-
/** Current page (1-based) */
|
|
3
|
-
current: number;
|
|
4
|
-
/** Total number of items */
|
|
5
|
-
total: number;
|
|
6
|
-
/** Number of items per page */
|
|
7
|
-
pageSize: number;
|
|
8
|
-
/** Called when the page changes */
|
|
9
|
-
onChange: (page: number) => void;
|
|
10
|
-
/** Optional class for styling purpose */
|
|
11
|
-
className?: string;
|
|
12
|
-
}
|
|
13
|
-
/**
|
|
14
|
-
* Pagination component for navigating through pages of results.
|
|
15
|
-
* Wraps antd Pagination with a simplified, stable API.
|
|
16
|
-
*/
|
|
17
|
-
export declare function Pagination({ current, total, pageSize, onChange, className, }: PaginationProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { jsx } from "react/jsx-runtime";
|
|
2
|
-
import { Pagination as Pagination$1 } from "antd";
|
|
3
|
-
function Pagination({
|
|
4
|
-
current,
|
|
5
|
-
total,
|
|
6
|
-
pageSize,
|
|
7
|
-
onChange,
|
|
8
|
-
className
|
|
9
|
-
}) {
|
|
10
|
-
return /* @__PURE__ */ jsx(Pagination$1, { align: "center", showSizeChanger: !1, current, total, pageSize, onChange, className });
|
|
11
|
-
}
|
|
12
|
-
export {
|
|
13
|
-
Pagination
|
|
14
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './Pagination';
|