@edifice.io/react 2.5.19 → 2.5.20-develop-enabling.20260520163256
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/Layout/components/Header.js +7 -0
- package/dist/components/Layout/hooks/useHeader.js +3 -2
- package/dist/components/UserRightsList/UserRightsBookmarkRow.js +1 -1
- package/dist/components/UserRightsList/UserRightsItem.js +1 -1
- package/dist/components/UserRightsList/UserRightsList.js +1 -1
- package/dist/components/UserRightsList/types/types.d.ts +6 -1
- package/dist/hooks/index.d.ts +2 -0
- package/dist/hooks/usePublicConf/index.d.ts +1 -0
- package/dist/hooks/usePublicConf/usePublicConf.d.ts +2 -0
- package/dist/hooks/usePublicConf/usePublicConf.js +12 -0
- package/dist/hooks/useScreeb/index.d.ts +1 -0
- package/dist/hooks/useScreeb/useScreeb.d.ts +12 -0
- package/dist/hooks/useScreeb/useScreeb.js +22 -0
- package/dist/index.js +40 -34
- package/dist/modules/icons/components/nav/IconCommunities.js +1 -1
- package/dist/modules/multimedia/Linker/InternalLinker/InternalLinker.d.ts +13 -1
- package/dist/modules/multimedia/Linker/InternalLinker/InternalLinker.js +22 -6
- package/dist/modules/multimedia/LinkerCard/LinkerCard.d.ts +8 -5
- package/dist/modules/multimedia/LinkerCard/LinkerCard.js +2 -6
- package/dist/providers/EdificeScreebProvider/EdificeScreebProvider.d.ts +7 -0
- package/dist/providers/EdificeScreebProvider/EdificeScreebProvider.js +52 -0
- package/dist/providers/EdificeScreebProvider/index.d.ts +1 -0
- package/dist/providers/MockedProvider/MockedProvider.js +15 -7
- package/dist/providers/MockedProvider/MockedProvider.mocks.d.ts +6 -0
- package/dist/providers/MockedProvider/MockedProvider.mocks.js +119 -0
- package/dist/providers/index.d.ts +1 -0
- package/package.json +7 -6
|
@@ -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
|
|
@@ -21,7 +21,7 @@ const UserRightsBookmarkRow = ({
|
|
|
21
21
|
return /* @__PURE__ */ jsxs("tr", { "data-testid": "user-rights-list-bookmark-row", children: [
|
|
22
22
|
/* @__PURE__ */ jsx("td", { children: /* @__PURE__ */ jsx(SvgIconBookmark, {}) }),
|
|
23
23
|
/* @__PURE__ */ jsx("td", { children: /* @__PURE__ */ jsx(Button, { color: "tertiary", variant: "ghost", className: "fw-normal ps-0", "aria-expanded": bookmark.isExpanded, rightIcon: /* @__PURE__ */ jsx(SvgIconRafterDown, { title: bookmark.isExpanded ? t("hide") : t("show"), className: "w-16 min-w-0", style: getRotateTransitionStyle(bookmark.isExpanded) }), onClick: () => onToggleExpand(bookmark.id), children: bookmark.name }) }),
|
|
24
|
-
Object.entries(resourceRights).map(([rightName]) => /* @__PURE__ */ jsx("td", { children: /* @__PURE__ */ jsx(Checkbox, { checked: bookmark.permission.includes(rightName), onChange: () => onToggleRight(bookmark.id, rightName), disabled: isReadOnly, "aria-label": `${bookmark.name} - ${rightName}`, "data-testid": `user-rights-list-bookmark-${rightName}-checkbox` }) }, rightName)),
|
|
24
|
+
Object.entries(resourceRights).map(([rightName, rightDef]) => /* @__PURE__ */ jsx("td", { children: /* @__PURE__ */ jsx(Checkbox, { checked: bookmark.permission.includes(rightName), onChange: () => onToggleRight(bookmark.id, rightName), disabled: isReadOnly || rightDef.isReadOnlyCheckbox, "aria-label": `${bookmark.name} - ${rightName}`, "data-testid": `user-rights-list-bookmark-${rightName}-checkbox` }) }, rightName)),
|
|
25
25
|
/* @__PURE__ */ jsx("td", { children: !isReadOnly && /* @__PURE__ */ jsx(IconButton, { "data-testid": "user-rights-list-bookmark-close-button", color: "tertiary", onClick: () => onDelete(bookmark.id), icon: /* @__PURE__ */ jsx(SvgIconClose, {}), title: `${t("close")} ${bookmark.name}`, variant: "ghost" }) })
|
|
26
26
|
] });
|
|
27
27
|
};
|
|
@@ -27,7 +27,7 @@ const UserRightsItem = ({
|
|
|
27
27
|
return /* @__PURE__ */ jsxs("tr", { "data-testid": "user-rights-list-item-row", className: rowClassName, "aria-label": bookmarkName ? `${item.displayName} - ${bookmarkName}` : void 0, children: [
|
|
28
28
|
/* @__PURE__ */ jsx("td", { children: /* @__PURE__ */ jsx(Avatar, { src: getAvatarURL(item.recipientId, item.recipientType), size: "xs", alt: item.displayName, variant: "circle" }) }),
|
|
29
29
|
/* @__PURE__ */ jsx("td", { children: item.displayName }),
|
|
30
|
-
Object.entries(resourceRights).map(([rightName]) => /* @__PURE__ */ jsx("td", { "data-testid": `user-rights-list-item-${rightName}-checkbox`, children: /* @__PURE__ */ jsx(Checkbox, { checked: item.permission.includes(rightName), onChange: () => handleChange(rightName), disabled: isReadOnly, "aria-label": `${item.displayName} - ${rightName}` }) }, rightName)),
|
|
30
|
+
Object.entries(resourceRights).map(([rightName, rightDef]) => /* @__PURE__ */ jsx("td", { "data-testid": `user-rights-list-item-${rightName}-checkbox`, children: /* @__PURE__ */ jsx(Checkbox, { checked: item.permission.includes(rightName), onChange: isReadOnly || rightDef.isReadOnlyCheckbox ? void 0 : () => handleChange(rightName), disabled: isReadOnly || rightDef.isReadOnlyCheckbox, "aria-label": `${item.displayName} - ${rightName}` }) }, rightName)),
|
|
31
31
|
/* @__PURE__ */ jsx("td", { children: !isReadOnly && isDeletable && /* @__PURE__ */ jsx(IconButton, { "data-testid": "user-rights-list-close-button", color: "tertiary", onClick: () => handleDeleteItem(), icon: /* @__PURE__ */ jsx(SvgIconClose, {}), title: `${t("close")} ${item.displayName}`, variant: "ghost", type: "button" }) })
|
|
32
32
|
] });
|
|
33
33
|
};
|
|
@@ -68,7 +68,7 @@ const UserRightsList = /* @__PURE__ */ forwardRef(({
|
|
|
68
68
|
/* @__PURE__ */ jsx("thead", { children: /* @__PURE__ */ jsxs("tr", { children: [
|
|
69
69
|
/* @__PURE__ */ jsx("th", { scope: "col", className: "w-32", children: /* @__PURE__ */ jsx(VisuallyHidden, { children: t("explorer.modal.share.avatar.shared.alt") }) }),
|
|
70
70
|
/* @__PURE__ */ jsx("th", { scope: "col", children: /* @__PURE__ */ jsx(VisuallyHidden, { children: t("explorer.modal.share.search.placeholder") }) }),
|
|
71
|
-
Object.entries(resourceRights).map(([rightName]) => /* @__PURE__ */ jsx("th", { children: rightName }, rightName)),
|
|
71
|
+
Object.entries(resourceRights).map(([rightName, rightDef]) => /* @__PURE__ */ jsx("th", { children: rightDef.displayName ?? rightName }, rightName)),
|
|
72
72
|
!isReadOnly && /* @__PURE__ */ jsx("th", { scope: "col", children: /* @__PURE__ */ jsx(VisuallyHidden, { children: t("close") }) })
|
|
73
73
|
] }) }),
|
|
74
74
|
/* @__PURE__ */ jsxs("tbody", { children: [
|
|
@@ -6,8 +6,13 @@ export type ResourceRightDefinition = {
|
|
|
6
6
|
default: boolean;
|
|
7
7
|
requires: ResourceRightName[];
|
|
8
8
|
excludes: ResourceRightName[];
|
|
9
|
+
displayName?: string;
|
|
10
|
+
isReadOnlyCheckbox?: boolean;
|
|
9
11
|
};
|
|
10
|
-
|
|
12
|
+
type AtLeastOne<T extends object> = Partial<T> & {
|
|
13
|
+
[K in keyof T]: Pick<T, K>;
|
|
14
|
+
}[keyof T];
|
|
15
|
+
export type ResourceRights = AtLeastOne<Record<ResourceRightName, ResourceRightDefinition>>;
|
|
11
16
|
export interface BookmarkUser {
|
|
12
17
|
id: string;
|
|
13
18
|
displayName: string;
|
package/dist/hooks/index.d.ts
CHANGED
|
@@ -22,6 +22,8 @@ export * from './useIsAdmlcOrAdmc';
|
|
|
22
22
|
export * from './useKeyPress';
|
|
23
23
|
export * from './useLibraryUrl';
|
|
24
24
|
export * from './useMediaLibrary';
|
|
25
|
+
export * from './usePublicConf';
|
|
26
|
+
export * from './useScreeb';
|
|
25
27
|
export * from './useScrollToTop';
|
|
26
28
|
export * from './useTitle';
|
|
27
29
|
export * from './useToast';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as usePublicConf } from './usePublicConf';
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { odeServices } from "@edifice.io/client";
|
|
2
|
+
import { useQuery } from "@tanstack/react-query";
|
|
3
|
+
function usePublicConf(appCode) {
|
|
4
|
+
return useQuery({
|
|
5
|
+
queryKey: ["publicConf", appCode],
|
|
6
|
+
queryFn: () => odeServices.conf().getPublicConf(appCode),
|
|
7
|
+
staleTime: 1 / 0
|
|
8
|
+
});
|
|
9
|
+
}
|
|
10
|
+
export {
|
|
11
|
+
usePublicConf as default
|
|
12
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { useScreeb, type ScreebProperties, type ScreebSurveyHooks } from './useScreeb';
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { HooksMessageStart, HooksSurveyStart, PropertyRecord } from '@screeb/sdk-browser';
|
|
2
|
+
export type { HooksMessageStart as ScreebMessageHooks };
|
|
3
|
+
export type { HooksSurveyStart as ScreebSurveyHooks };
|
|
4
|
+
export type ScreebProperties = PropertyRecord;
|
|
5
|
+
export declare function useScreeb(): {
|
|
6
|
+
closeSurvey: () => Promise<unknown>;
|
|
7
|
+
forceTargetingCheck: () => Promise<unknown>;
|
|
8
|
+
setIdentityProperties: (properties: ScreebProperties) => Promise<unknown>;
|
|
9
|
+
trackEvent: (name: string, properties?: ScreebProperties) => Promise<unknown>;
|
|
10
|
+
triggerMessage: (messageId: string, hooks?: HooksMessageStart) => Promise<unknown>;
|
|
11
|
+
triggerSurvey: (surveyId: string, hooks?: HooksSurveyStart, hiddenFields?: ScreebProperties) => Promise<unknown>;
|
|
12
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { useScreeb as useScreeb$1 } from "@screeb/sdk-react";
|
|
2
|
+
function useScreeb() {
|
|
3
|
+
const {
|
|
4
|
+
eventTrack,
|
|
5
|
+
identityProperties,
|
|
6
|
+
messageStart,
|
|
7
|
+
surveyClose,
|
|
8
|
+
surveyStart,
|
|
9
|
+
targetingCheck
|
|
10
|
+
} = useScreeb$1();
|
|
11
|
+
return {
|
|
12
|
+
closeSurvey: () => surveyClose(),
|
|
13
|
+
forceTargetingCheck: () => targetingCheck(),
|
|
14
|
+
setIdentityProperties: (properties) => identityProperties(properties),
|
|
15
|
+
trackEvent: (name, properties) => eventTrack(name, properties),
|
|
16
|
+
triggerMessage: (messageId, hooks) => messageStart(messageId, void 0, void 0, hooks),
|
|
17
|
+
triggerSurvey: (surveyId, hooks, hiddenFields) => surveyStart(surveyId, void 0, void 0, hiddenFields, hooks)
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
export {
|
|
21
|
+
useScreeb
|
|
22
|
+
};
|
package/dist/index.js
CHANGED
|
@@ -95,29 +95,31 @@ import { default as default93 } from "./hooks/useIsAdmlcOrAdmc/useIsAdmlcOrAdmc.
|
|
|
95
95
|
import { default as default94 } from "./hooks/useKeyPress/useKeyPress.js";
|
|
96
96
|
import { default as default95 } from "./hooks/useLibraryUrl/useLibraryUrl.js";
|
|
97
97
|
import { default as default96 } from "./hooks/useMediaLibrary/useMediaLibrary.js";
|
|
98
|
-
import { default as default97 } from "./hooks/
|
|
99
|
-
import { default as default98 } from "./
|
|
100
|
-
import { default as default99 } from "./hooks/
|
|
101
|
-
import { default as default100 } from "./hooks/
|
|
102
|
-
import { default as default101 } from "./hooks/
|
|
103
|
-
import { default as default102 } from "./hooks/
|
|
104
|
-
import { default as default103 } from "./hooks/
|
|
105
|
-
import { default as default104 } from "./
|
|
106
|
-
import { default as default105 } from "./hooks/
|
|
107
|
-
import { default as default106 } from "./hooks/
|
|
108
|
-
import { default as default107 } from "./hooks/
|
|
109
|
-
import { default as default108 } from "./hooks/
|
|
110
|
-
import { default as default109 } from "./hooks/
|
|
111
|
-
import {
|
|
112
|
-
import { default as default111 } from "./hooks/
|
|
113
|
-
import { default as default112 } from "./hooks/
|
|
114
|
-
import { default as default113 } from "./hooks/
|
|
98
|
+
import { default as default97 } from "./hooks/usePublicConf/usePublicConf.js";
|
|
99
|
+
import { default as default98 } from "./hooks/useScrollToTop/useScrollToTop.js";
|
|
100
|
+
import { default as default99 } from "./modules/modals/ShareModal/hooks/useShareMutation.js";
|
|
101
|
+
import { default as default100 } from "./hooks/useTitle/useTitle.js";
|
|
102
|
+
import { default as default101 } from "./hooks/useToast/useToast.js";
|
|
103
|
+
import { default as default102 } from "./hooks/useToggle/useToggle.js";
|
|
104
|
+
import { default as default103 } from "./hooks/useTrapFocus/useTrapFocus.js";
|
|
105
|
+
import { default as default104 } from "./hooks/useTrashedResource/useTrashedResource.js";
|
|
106
|
+
import { default as default105 } from "./modules/modals/ResourceModal/hooks/useUpdateMutation.js";
|
|
107
|
+
import { default as default106 } from "./hooks/useUpload/useUpload.js";
|
|
108
|
+
import { default as default107 } from "./hooks/useUploadFiles/useUploadFiles.js";
|
|
109
|
+
import { default as default108 } from "./hooks/useUser/useUser.js";
|
|
110
|
+
import { default as default109 } from "./hooks/useWorkspaceFile/useWorkspaceFile.js";
|
|
111
|
+
import { default as default110 } from "./hooks/useWorkspaceFolders/useWorkspaceFolders.js";
|
|
112
|
+
import { WORKSPACE_SHARED_FOLDER_ID, WORKSPACE_USER_FOLDER_ID, default as default111 } from "./hooks/useWorkspaceFolders/useWorkspaceFoldersTree.js";
|
|
113
|
+
import { default as default112 } from "./hooks/useWorkspaceSearch/useWorkspaceSearch.js";
|
|
114
|
+
import { default as default113 } from "./hooks/useXitiTrackPageLoad/useXitiTrackPageLoad.js";
|
|
115
|
+
import { default as default114 } from "./hooks/useZendeskGuide/useZendeskGuide.js";
|
|
115
116
|
import { AccessiblePalette, DefaultPalette } from "./components/ColorPicker/ColorPalette.js";
|
|
116
117
|
import { AntProvider } from "./providers/AntThemeProvider/AntProvider.js";
|
|
117
118
|
import { Column, Grid } from "./components/Grid/Grid.js";
|
|
118
119
|
import { DropzoneContext, useDropzoneContext } from "./components/Dropzone/DropzoneContext.js";
|
|
119
120
|
import { EdificeClientContext } from "./providers/EdificeClientProvider/EdificeClientProvider.context.js";
|
|
120
121
|
import { EdificeClientProvider } from "./providers/EdificeClientProvider/EdificeClientProvider.js";
|
|
122
|
+
import { EdificeScreebProvider } from "./providers/EdificeScreebProvider/EdificeScreebProvider.js";
|
|
121
123
|
import { EdificeThemeContext } from "./providers/EdificeThemeProvider/EdificeThemeProvider.context.js";
|
|
122
124
|
import { EdificeThemeProvider } from "./providers/EdificeThemeProvider/EdificeThemeProvider.js";
|
|
123
125
|
import { ExternalLinker } from "./modules/multimedia/Linker/ExternalLinker/ExternalLinker.js";
|
|
@@ -147,6 +149,7 @@ import { useCheckable } from "./hooks/useCheckable/useCheckable.js";
|
|
|
147
149
|
import { useEdificeClient } from "./providers/EdificeClientProvider/EdificeClientProvider.hook.js";
|
|
148
150
|
import { useEdificeTheme } from "./providers/EdificeThemeProvider/EdificeThemeProvider.hook.js";
|
|
149
151
|
import { useFileToAttachment } from "./components/AddAttachments/hooks/useFileToAttachment.js";
|
|
152
|
+
import { useScreeb } from "./hooks/useScreeb/useScreeb.js";
|
|
150
153
|
import { useTreeSortable } from "./components/Tree/hooks/useTreeSortable.js";
|
|
151
154
|
import { useTreeView } from "./components/TreeView/hooks/useTreeView.js";
|
|
152
155
|
export {
|
|
@@ -182,6 +185,7 @@ export {
|
|
|
182
185
|
DropzoneContext,
|
|
183
186
|
EdificeClientContext,
|
|
184
187
|
EdificeClientProvider,
|
|
188
|
+
EdificeScreebProvider,
|
|
185
189
|
EdificeThemeContext,
|
|
186
190
|
EdificeThemeProvider,
|
|
187
191
|
default25 as Embed,
|
|
@@ -314,24 +318,26 @@ export {
|
|
|
314
318
|
default94 as useKeyPress,
|
|
315
319
|
default95 as useLibraryUrl,
|
|
316
320
|
default96 as useMediaLibrary,
|
|
317
|
-
default97 as
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
321
|
+
default97 as usePublicConf,
|
|
322
|
+
useScreeb,
|
|
323
|
+
default98 as useScrollToTop,
|
|
324
|
+
default99 as useShareMutation,
|
|
325
|
+
default100 as useTitle,
|
|
326
|
+
default101 as useToast,
|
|
327
|
+
default102 as useToggle,
|
|
328
|
+
default103 as useTrapFocus,
|
|
329
|
+
default104 as useTrashedResource,
|
|
324
330
|
useTreeSortable,
|
|
325
331
|
useTreeView,
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
332
|
+
default105 as useUpdateMutation,
|
|
333
|
+
default106 as useUpload,
|
|
334
|
+
default107 as useUploadFiles,
|
|
335
|
+
default108 as useUser,
|
|
336
|
+
default109 as useWorkspaceFile,
|
|
337
|
+
default110 as useWorkspaceFolders,
|
|
338
|
+
default111 as useWorkspaceFoldersTree,
|
|
339
|
+
default112 as useWorkspaceSearch,
|
|
340
|
+
default113 as useXitiTrackPageLoad,
|
|
341
|
+
default114 as useZendeskGuide,
|
|
336
342
|
wrapTreeNode
|
|
337
343
|
};
|
|
@@ -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
|
|
@@ -36,6 +36,18 @@ export interface InternalLinkerProps {
|
|
|
36
36
|
disableApplicationSelector?: boolean;
|
|
37
37
|
/** Optional callback to filter resources after loading. Applied in addition to search filters. */
|
|
38
38
|
resourceFilter?: (resource: ILinkedResource) => boolean;
|
|
39
|
+
/**
|
|
40
|
+
* When provided, replaces the built-in search/load logic entirely.
|
|
41
|
+
* Called with the current search terms and selected application whenever the search changes.
|
|
42
|
+
* The returned resources are displayed as-is (no additional filtering or sorting).
|
|
43
|
+
*/
|
|
44
|
+
onSearch?: (search: string, application?: ApplicationOption) => Promise<ILinkedResource[]>;
|
|
45
|
+
/** When true, a "load more" button is shown. The caller controls this flag. */
|
|
46
|
+
hasMoreResources?: boolean;
|
|
47
|
+
/** Called when the user clicks the "load more" button. */
|
|
48
|
+
onLoadMore?: () => void;
|
|
49
|
+
/** Label for the "load more" button. Defaults to the `bbm.linker.see.more` i18n key. */
|
|
50
|
+
loadMoreLabel?: string;
|
|
39
51
|
}
|
|
40
|
-
export declare const InternalLinker: ({ appCode, defaultAppCode, defaultResourceId, onChange, onSelect, multiple, resourceList, applicationList, showApplicationSelector, disableApplicationSelector, resourceFilter, }: InternalLinkerProps) => import("react/jsx-runtime").JSX.Element;
|
|
52
|
+
export declare const InternalLinker: ({ appCode, defaultAppCode, defaultResourceId, onChange, onSelect, multiple, resourceList, applicationList, showApplicationSelector, disableApplicationSelector, resourceFilter, onSearch, hasMoreResources, onLoadMore, loadMoreLabel, }: InternalLinkerProps) => import("react/jsx-runtime").JSX.Element;
|
|
41
53
|
export default InternalLinker;
|
|
@@ -10,6 +10,7 @@ import { useResourceSearch } from "../../../../hooks/useResourceSearch/useResour
|
|
|
10
10
|
import AppIcon from "../../../../components/AppIcon/AppIcon.js";
|
|
11
11
|
import Dropdown from "../../../../components/Dropdown/Dropdown.js";
|
|
12
12
|
import SearchBar from "../../../../components/SearchBar/SearchBar.js";
|
|
13
|
+
import Button from "../../../../components/Button/Button.js";
|
|
13
14
|
import EmptyScreen from "../../../../components/EmptyScreen/EmptyScreen.js";
|
|
14
15
|
import { emptyScreenMapping } from "../../../../utilities/emptyscreen-mapping/emptyscreen-mapping.js";
|
|
15
16
|
const InternalLinker = ({
|
|
@@ -23,7 +24,11 @@ const InternalLinker = ({
|
|
|
23
24
|
applicationList,
|
|
24
25
|
showApplicationSelector = !0,
|
|
25
26
|
disableApplicationSelector = !1,
|
|
26
|
-
resourceFilter
|
|
27
|
+
resourceFilter,
|
|
28
|
+
onSearch,
|
|
29
|
+
hasMoreResources,
|
|
30
|
+
onLoadMore,
|
|
31
|
+
loadMoreLabel
|
|
27
32
|
}) => {
|
|
28
33
|
const {
|
|
29
34
|
t
|
|
@@ -39,6 +44,14 @@ const InternalLinker = ({
|
|
|
39
44
|
return ((_a = resource.name) == null ? void 0 : _a.toLowerCase().includes(searchParam)) || ((_b = resource.creatorName) == null ? void 0 : _b.toLowerCase().includes(searchParam)) || ((_c = resource.description) == null ? void 0 : _c.toLowerCase().includes(searchParam));
|
|
40
45
|
}, []), sortResources = useCallback((resources2) => resources2.sort((a, b) => a.modifiedAt < b.modifiedAt ? 1 : -1), []), loadAndDisplayResources = useCallback((search) => {
|
|
41
46
|
async function load() {
|
|
47
|
+
if (onSearch) {
|
|
48
|
+
try {
|
|
49
|
+
setResources(await onSearch(search || "", selectedApplication));
|
|
50
|
+
} catch {
|
|
51
|
+
setResources([]);
|
|
52
|
+
}
|
|
53
|
+
return;
|
|
54
|
+
}
|
|
42
55
|
if (resourceList) {
|
|
43
56
|
let filteredResources = resourceList.filter((resource) => filterResources(resource, search));
|
|
44
57
|
resourceFilter && (filteredResources = filteredResources.filter(resourceFilter)), setResources(sortResources(filteredResources));
|
|
@@ -63,7 +76,7 @@ const InternalLinker = ({
|
|
|
63
76
|
setResources([]);
|
|
64
77
|
}
|
|
65
78
|
load();
|
|
66
|
-
}, [loadResources, selectedApplication, filterResources, sortResources, resourceList, resourceFilter]), [selectedDocuments, setSelectedDocuments] = useState([]), handleOptionClick = (option) => {
|
|
79
|
+
}, [onSearch, loadResources, selectedApplication, filterResources, sortResources, resourceList, resourceFilter]), [selectedDocuments, setSelectedDocuments] = useState([]), handleOptionClick = (option) => {
|
|
67
80
|
onChange == null || onChange(option), setSelectedApplication(option);
|
|
68
81
|
}, handleSearchChange = (event) => {
|
|
69
82
|
const newText = event.target.value;
|
|
@@ -121,10 +134,13 @@ const InternalLinker = ({
|
|
|
121
134
|
/* @__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 }) }) })
|
|
122
135
|
] }),
|
|
123
136
|
/* @__PURE__ */ jsxs("div", { className: "internal-linker flex-grow-1 w-100 rounded-bottom border gap-0 overflow-auto", children: [
|
|
124
|
-
selectedApplication && resources && resources.length > 0 && /* @__PURE__ */
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
137
|
+
selectedApplication && resources && resources.length > 0 && /* @__PURE__ */ jsxs("div", { children: [
|
|
138
|
+
resources.map((resource) => {
|
|
139
|
+
const isSelected = selectedDocuments.findIndex((doc) => doc.assetId === resource.assetId) >= 0;
|
|
140
|
+
return /* @__PURE__ */ jsx(LinkerCard, { doc: resource, isSelected, onClick: () => toggleResourceSelection(resource) }, resource.path);
|
|
141
|
+
}),
|
|
142
|
+
hasMoreResources && /* @__PURE__ */ jsx("div", { className: "d-grid gap-2 col-4 mx-auto my-24", children: /* @__PURE__ */ jsx(Button, { type: "button", color: "secondary", variant: "filled", onClick: onLoadMore, children: loadMoreLabel ?? t("bbm.linker.see.more") }) })
|
|
143
|
+
] }),
|
|
128
144
|
selectedApplication && resources && resources.length <= 0 && /* @__PURE__ */ jsx("div", { className: "d-flex justify-content-center mt-16", children: /* @__PURE__ */ jsx(EmptyScreen, { imageSrc: emptyScreenMapping[(theme == null ? void 0 : theme.bootstrapVersion) ?? "one"][selectedApplication == null ? void 0 : selectedApplication.application], text: t("bbm.linker.int.notfound"), className: "mt-16" }) }),
|
|
129
145
|
!selectedApplication && /* @__PURE__ */ jsx("div", { className: "d-flex justify-content-center mt-32", children: /* @__PURE__ */ jsx(EmptyScreen, { imageSrc: emptyScreenMapping[(theme == null ? void 0 : theme.bootstrapVersion) ?? "one"].empty, text: t("bbm.linker.int.empty"), className: "mt-32" }) })
|
|
130
146
|
] })
|
|
@@ -1,10 +1,13 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ILinkedResource } from '@edifice.io/client';
|
|
2
2
|
import { CardProps } from '../../../components';
|
|
3
|
+
/** Augments ILinkedResource with an optional pre-computed date string. */
|
|
4
|
+
export interface ILinkedResourceWithDate extends ILinkedResource {
|
|
5
|
+
/** When provided, displayed as-is instead of computing fromNow(modifiedAt). */
|
|
6
|
+
fromDate?: string;
|
|
7
|
+
}
|
|
3
8
|
export interface LinkerCardProps extends CardProps {
|
|
4
|
-
/**
|
|
5
|
-
|
|
6
|
-
* */
|
|
7
|
-
doc: IResource;
|
|
9
|
+
/** Resource to render as a card */
|
|
10
|
+
doc: ILinkedResourceWithDate;
|
|
8
11
|
}
|
|
9
12
|
declare const LinkerCard: {
|
|
10
13
|
({ doc, isClickable, isSelectable, isSelected, onClick, className, }: LinkerCardProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -16,11 +16,7 @@ const LinkerCard = ({
|
|
|
16
16
|
}) => {
|
|
17
17
|
const {
|
|
18
18
|
fromNow
|
|
19
|
-
} = useDate(),
|
|
20
|
-
fromDate
|
|
21
|
-
} = useMemo(() => ({
|
|
22
|
-
fromDate: fromNow(doc.modifiedAt)
|
|
23
|
-
}), [fromNow, doc]);
|
|
19
|
+
} = useDate(), displayDate = useMemo(() => doc.fromDate ?? fromNow(doc.modifiedAt), [doc.fromDate, doc.modifiedAt, fromNow]);
|
|
24
20
|
return /* @__PURE__ */ jsx(Card, { className: clsx("card-linker shadow-none", className), isClickable, isSelectable, isSelected, onClick, children: /* @__PURE__ */ jsxs(Card.Body, { space: "8", children: [
|
|
25
21
|
/* @__PURE__ */ jsx("div", { className: "card-image ps-8 pe-4", children: doc.thumbnail && doc.thumbnail.length > 0 ? /* @__PURE__ */ jsx(Image, { alt: "", height: 48, width: 48, src: doc.thumbnail, objectFit: "cover", className: "rounded h-full", style: {
|
|
26
22
|
aspectRatio: 1 / 1
|
|
@@ -29,7 +25,7 @@ const LinkerCard = ({
|
|
|
29
25
|
/* @__PURE__ */ jsx(Card.Text, { children: doc.name }),
|
|
30
26
|
/* @__PURE__ */ jsx(Card.Text, { className: "text-black-50", children: doc == null ? void 0 : doc.creatorName })
|
|
31
27
|
] }),
|
|
32
|
-
/* @__PURE__ */ jsx("div", { className: "d-none d-md-block text-black-50 ps-4 pe-8", children: /* @__PURE__ */ jsx(Card.Text, { children:
|
|
28
|
+
/* @__PURE__ */ jsx("div", { className: "d-none d-md-block text-black-50 ps-4 pe-8", children: /* @__PURE__ */ jsx(Card.Text, { children: displayDate }) }),
|
|
33
29
|
doc.shared && /* @__PURE__ */ jsx("div", { className: "ps-4 pe-8", children: /* @__PURE__ */ jsx(SvgIconUsers, { width: "20", height: "20" }) })
|
|
34
30
|
] }) });
|
|
35
31
|
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { HooksInit } from '@screeb/sdk-browser';
|
|
3
|
+
export type EdificeScreebProviderProps = {
|
|
4
|
+
children: ReactNode;
|
|
5
|
+
onSurveyDisplayAllowed?: HooksInit['onSurveyDisplayAllowed'];
|
|
6
|
+
};
|
|
7
|
+
export declare const EdificeScreebProvider: ({ children, onSurveyDisplayAllowed, }: EdificeScreebProviderProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { jsx, Fragment, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useEffect } from "react";
|
|
3
|
+
import { ScreebProvider, useScreeb } from "@screeb/sdk-react";
|
|
4
|
+
import { useEdificeClient } from "../EdificeClientProvider/EdificeClientProvider.hook.js";
|
|
5
|
+
import usePublicConf from "../../hooks/usePublicConf/usePublicConf.js";
|
|
6
|
+
async function hashUserId(userId) {
|
|
7
|
+
const hashBuffer = await crypto.subtle.digest("SHA-256", new TextEncoder().encode(userId));
|
|
8
|
+
return Array.from(new Uint8Array(hashBuffer)).map((b) => b.toString(16).padStart(2, "0")).join("").slice(0, 16);
|
|
9
|
+
}
|
|
10
|
+
const ScreebInitializer = ({
|
|
11
|
+
appId,
|
|
12
|
+
onSurveyDisplayAllowed
|
|
13
|
+
}) => {
|
|
14
|
+
const {
|
|
15
|
+
user
|
|
16
|
+
} = useEdificeClient(), {
|
|
17
|
+
init,
|
|
18
|
+
identityReset
|
|
19
|
+
} = useScreeb();
|
|
20
|
+
return useEffect(() => {
|
|
21
|
+
if (!user) return;
|
|
22
|
+
const hooks = onSurveyDisplayAllowed ? {
|
|
23
|
+
version: "1.0.0",
|
|
24
|
+
onSurveyDisplayAllowed
|
|
25
|
+
} : void 0;
|
|
26
|
+
hashUserId(user.userId).then((hashedId) => init(appId, hashedId, {
|
|
27
|
+
profile: user.type
|
|
28
|
+
}, hooks)).catch((error) => {
|
|
29
|
+
console.error("Failed to initialize Screeb:", error);
|
|
30
|
+
});
|
|
31
|
+
}, [user, appId, init, onSurveyDisplayAllowed]), useEffect(() => () => {
|
|
32
|
+
identityReset();
|
|
33
|
+
}, [identityReset]), null;
|
|
34
|
+
}, EdificeScreebProvider = ({
|
|
35
|
+
children,
|
|
36
|
+
onSurveyDisplayAllowed
|
|
37
|
+
}) => {
|
|
38
|
+
const {
|
|
39
|
+
appCode,
|
|
40
|
+
user,
|
|
41
|
+
userProfile
|
|
42
|
+
} = useEdificeClient(), {
|
|
43
|
+
data: publicConf
|
|
44
|
+
} = usePublicConf(appCode), appId = publicConf == null ? void 0 : publicConf["screeb-app-id"], allowedProfiles = publicConf == null ? void 0 : publicConf["screeb-allowed-profiles"], profileAllowed = !(allowedProfiles != null && allowedProfiles.length) || allowedProfiles.includes((userProfile == null ? void 0 : userProfile[0]) ?? "");
|
|
45
|
+
return !appId || !user || !profileAllowed ? /* @__PURE__ */ jsx(Fragment, { children }) : /* @__PURE__ */ jsxs(ScreebProvider, { children: [
|
|
46
|
+
/* @__PURE__ */ jsx(ScreebInitializer, { appId, onSurveyDisplayAllowed }),
|
|
47
|
+
children
|
|
48
|
+
] });
|
|
49
|
+
};
|
|
50
|
+
export {
|
|
51
|
+
EdificeScreebProvider
|
|
52
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { EdificeScreebProvider } from './EdificeScreebProvider';
|
|
@@ -1,19 +1,27 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
2
|
import { QueryClientProvider, QueryClient } from "@tanstack/react-query";
|
|
3
|
-
import {
|
|
3
|
+
import { EdificeClientContext } from "../EdificeClientProvider/EdificeClientProvider.context.js";
|
|
4
4
|
import { EdificeThemeContext } from "../EdificeThemeProvider/EdificeThemeProvider.context.js";
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
}) => /* @__PURE__ */ jsx(QueryClientProvider, { client: queryClient, children: /* @__PURE__ */ jsx(EdificeClientProvider, { params: {
|
|
8
|
-
app: "wiki"
|
|
9
|
-
}, children }) }), MockedProvider = ({
|
|
5
|
+
import { mockQueryResult, mockSession, mockConf } from "./MockedProvider.mocks.js";
|
|
6
|
+
const queryClient = new QueryClient(), MockedProvider = ({
|
|
10
7
|
children
|
|
11
8
|
}) => {
|
|
12
9
|
const themeContextValue = {
|
|
13
10
|
theme: "default",
|
|
14
11
|
setTheme: vi.fn()
|
|
12
|
+
}, clientContextValue = {
|
|
13
|
+
appCode: "wiki",
|
|
14
|
+
applications: mockConf.applications,
|
|
15
|
+
confQuery: mockQueryResult(mockConf),
|
|
16
|
+
currentApp: mockConf.currentApp,
|
|
17
|
+
currentLanguage: mockSession.currentLanguage,
|
|
18
|
+
init: !0,
|
|
19
|
+
sessionQuery: mockQueryResult(mockSession),
|
|
20
|
+
user: mockSession.user,
|
|
21
|
+
userDescription: mockSession.userDescription,
|
|
22
|
+
userProfile: mockSession.userProfile
|
|
15
23
|
};
|
|
16
|
-
return /* @__PURE__ */ jsx(
|
|
24
|
+
return /* @__PURE__ */ jsx(QueryClientProvider, { client: queryClient, children: /* @__PURE__ */ jsx(EdificeClientContext.Provider, { value: clientContextValue, children: /* @__PURE__ */ jsx(EdificeThemeContext.Provider, { value: themeContextValue, children }) }) });
|
|
17
25
|
};
|
|
18
26
|
export {
|
|
19
27
|
MockedProvider
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { IGetConf, IGetSession, IUserInfo } from '@edifice.io/client';
|
|
2
|
+
import { UseQueryResult } from '@tanstack/react-query';
|
|
3
|
+
export declare function mockQueryResult<T>(data: T): UseQueryResult<T>;
|
|
4
|
+
export declare const mockUser: IUserInfo;
|
|
5
|
+
export declare const mockSession: IGetSession;
|
|
6
|
+
export declare const mockConf: IGetConf;
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
function mockQueryResult(data) {
|
|
2
|
+
return {
|
|
3
|
+
data,
|
|
4
|
+
isSuccess: !0,
|
|
5
|
+
isLoading: !1,
|
|
6
|
+
isPending: !1,
|
|
7
|
+
isError: !1,
|
|
8
|
+
error: null,
|
|
9
|
+
status: "success",
|
|
10
|
+
fetchStatus: "idle",
|
|
11
|
+
isStale: !1,
|
|
12
|
+
isPlaceholderData: !1,
|
|
13
|
+
isFetching: !1,
|
|
14
|
+
isFetched: !0,
|
|
15
|
+
isFetchedAfterMount: !0,
|
|
16
|
+
isLoadingError: !1,
|
|
17
|
+
isRefetchError: !1,
|
|
18
|
+
isRefetching: !1,
|
|
19
|
+
dataUpdatedAt: 0,
|
|
20
|
+
errorUpdatedAt: 0,
|
|
21
|
+
failureCount: 0,
|
|
22
|
+
failureReason: null,
|
|
23
|
+
errorUpdateCount: 0,
|
|
24
|
+
refetch: vi.fn(),
|
|
25
|
+
promise: Promise.resolve(data)
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
const mockUser = {
|
|
29
|
+
classNames: [],
|
|
30
|
+
level: "",
|
|
31
|
+
login: "user.login",
|
|
32
|
+
lastName: "Last Name",
|
|
33
|
+
firstName: "First Name",
|
|
34
|
+
externalId: "external-id",
|
|
35
|
+
federated: null,
|
|
36
|
+
birthDate: "2023-09-25",
|
|
37
|
+
forceChangePassword: null,
|
|
38
|
+
needRevalidateTerms: !1,
|
|
39
|
+
deletePending: !1,
|
|
40
|
+
username: "user.name",
|
|
41
|
+
type: "ENSEIGNANT",
|
|
42
|
+
hasPw: !0,
|
|
43
|
+
functions: {
|
|
44
|
+
SUPER_ADMIN: {
|
|
45
|
+
code: "SUPER_ADMIN",
|
|
46
|
+
scope: []
|
|
47
|
+
}
|
|
48
|
+
},
|
|
49
|
+
groupsIds: ["group-id-1"],
|
|
50
|
+
federatedIDP: null,
|
|
51
|
+
optionEnabled: [],
|
|
52
|
+
userId: "91c22b66-ba1b-4fde-a3fe-95219cc18d4a",
|
|
53
|
+
structures: ["structure-id"],
|
|
54
|
+
structureNames: ["Structure Name"],
|
|
55
|
+
uai: [],
|
|
56
|
+
hasApp: !1,
|
|
57
|
+
classes: [],
|
|
58
|
+
authorizedActions: [],
|
|
59
|
+
apps: [],
|
|
60
|
+
childrenIds: [],
|
|
61
|
+
children: {},
|
|
62
|
+
widgets: [],
|
|
63
|
+
sessionMetadata: {
|
|
64
|
+
_id: "",
|
|
65
|
+
userId: "91c22b66-ba1b-4fde-a3fe-95219cc18d4a"
|
|
66
|
+
}
|
|
67
|
+
}, mockSession = {
|
|
68
|
+
user: mockUser,
|
|
69
|
+
currentLanguage: "fr",
|
|
70
|
+
quotaAndUsage: {
|
|
71
|
+
quota: 104857600,
|
|
72
|
+
storage: 27683216
|
|
73
|
+
},
|
|
74
|
+
userDescription: {
|
|
75
|
+
mood: "default",
|
|
76
|
+
health: "",
|
|
77
|
+
alertSize: !1,
|
|
78
|
+
storage: 27683216,
|
|
79
|
+
type: "USERBOOK",
|
|
80
|
+
userid: "91c22b66-ba1b-4fde-a3fe-95219cc18d4a",
|
|
81
|
+
picture: "/userbook/avatar/91c22b66-ba1b-4fde-a3fe-95219cc18d4a",
|
|
82
|
+
quota: 104857600,
|
|
83
|
+
motto: "",
|
|
84
|
+
theme: "default",
|
|
85
|
+
hobbies: []
|
|
86
|
+
},
|
|
87
|
+
userProfile: ["Teacher"],
|
|
88
|
+
bookmarkedApps: []
|
|
89
|
+
}, mockConf = {
|
|
90
|
+
app: "wiki",
|
|
91
|
+
applications: [],
|
|
92
|
+
conf: {
|
|
93
|
+
dependencies: {
|
|
94
|
+
themes: {},
|
|
95
|
+
widgets: {}
|
|
96
|
+
},
|
|
97
|
+
emitWrapper: !1,
|
|
98
|
+
overriding: []
|
|
99
|
+
},
|
|
100
|
+
currentApp: void 0,
|
|
101
|
+
theme: {
|
|
102
|
+
basePath: "",
|
|
103
|
+
bootstrapVersion: "",
|
|
104
|
+
is1d: !1,
|
|
105
|
+
logoutCallback: "",
|
|
106
|
+
skin: "default",
|
|
107
|
+
skinName: "default",
|
|
108
|
+
skins: [],
|
|
109
|
+
themeName: "default",
|
|
110
|
+
themeUrl: "",
|
|
111
|
+
npmTheme: void 0
|
|
112
|
+
}
|
|
113
|
+
};
|
|
114
|
+
export {
|
|
115
|
+
mockConf,
|
|
116
|
+
mockQueryResult,
|
|
117
|
+
mockSession,
|
|
118
|
+
mockUser
|
|
119
|
+
};
|
|
@@ -5,4 +5,5 @@ export * from './EdificeClientProvider/EdificeClientProvider.hook';
|
|
|
5
5
|
export * from './EdificeThemeProvider/EdificeThemeProvider';
|
|
6
6
|
export * from './EdificeThemeProvider/EdificeThemeProvider.context';
|
|
7
7
|
export * from './EdificeThemeProvider/EdificeThemeProvider.hook';
|
|
8
|
+
export * from './EdificeScreebProvider/EdificeScreebProvider';
|
|
8
9
|
export * from './MockedProvider/MockedProvider';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@edifice.io/react",
|
|
3
|
-
"version": "2.5.
|
|
3
|
+
"version": "2.5.20-develop-enabling.20260520163256",
|
|
4
4
|
"description": "Edifice React Library",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react",
|
|
@@ -74,6 +74,7 @@
|
|
|
74
74
|
],
|
|
75
75
|
"dependencies": {
|
|
76
76
|
"@ant-design/icons": "5.4.0",
|
|
77
|
+
"@screeb/sdk-react": "0.6.0",
|
|
77
78
|
"@dnd-kit/core": "6.3.1",
|
|
78
79
|
"@dnd-kit/sortable": "8.0.0",
|
|
79
80
|
"@dnd-kit/utilities": "3.2.2",
|
|
@@ -133,9 +134,9 @@
|
|
|
133
134
|
"react-slugify": "3.0.3",
|
|
134
135
|
"swiper": "10.1.0",
|
|
135
136
|
"ua-parser-js": "1.0.36",
|
|
136
|
-
"@edifice.io/bootstrap": "2.5.
|
|
137
|
-
"@edifice.io/
|
|
138
|
-
"@edifice.io/
|
|
137
|
+
"@edifice.io/bootstrap": "2.5.20-develop-enabling.20260520163256",
|
|
138
|
+
"@edifice.io/tiptap-extensions": "2.5.20-develop-enabling.20260520163256",
|
|
139
|
+
"@edifice.io/utilities": "2.5.20-develop-enabling.20260520163256"
|
|
139
140
|
},
|
|
140
141
|
"devDependencies": {
|
|
141
142
|
"@babel/plugin-transform-react-pure-annotations": "7.27.1",
|
|
@@ -166,8 +167,8 @@
|
|
|
166
167
|
"vite": "5.4.14",
|
|
167
168
|
"vite-plugin-dts": "4.5.4",
|
|
168
169
|
"vite-tsconfig-paths": "5.1.4",
|
|
169
|
-
"@edifice.io/client": "2.5.
|
|
170
|
-
"@edifice.io/config": "2.5.
|
|
170
|
+
"@edifice.io/client": "2.5.20-develop-enabling.20260520163256",
|
|
171
|
+
"@edifice.io/config": "2.5.20-develop-enabling.20260520163256"
|
|
171
172
|
},
|
|
172
173
|
"peerDependencies": {
|
|
173
174
|
"@react-spring/web": "9.7.5",
|