@edifice.io/react 2.6.5-develop-pedago.20260911135210 → 2.6.5-develop-b2school.20260917151240
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/Form/FormText.js +11 -6
- package/dist/components/Input/Input.d.ts +11 -2
- package/dist/components/Input/Input.js +38 -21
- package/dist/components/Label/Label.js +4 -4
- package/dist/components/LinkPill/LinkPill.d.ts +45 -0
- package/dist/components/LinkPill/LinkPill.js +27 -0
- package/dist/components/LinkPill/index.d.ts +2 -0
- package/dist/components/ModalBeta/ModalBeta.d.ts +47 -0
- package/dist/components/ModalBeta/ModalBeta.js +62 -0
- package/dist/components/ModalBeta/ModalBetaBody.d.ts +19 -0
- package/dist/components/ModalBeta/ModalBetaBody.js +15 -0
- package/dist/components/ModalBeta/ModalBetaContext.d.ts +7 -0
- package/dist/components/ModalBeta/ModalBetaContext.js +15 -0
- package/dist/components/ModalBeta/ModalBetaFooter.d.ts +13 -0
- package/dist/components/ModalBeta/ModalBetaFooter.js +7 -0
- package/dist/components/ModalBeta/ModalBetaHeader.d.ts +23 -0
- package/dist/components/ModalBeta/ModalBetaHeader.js +31 -0
- package/dist/components/ModalBeta/index.d.ts +2 -0
- package/dist/components/PageLayout/PageLayout.d.ts +4 -0
- package/dist/components/PageLayout/PageLayout.js +22 -12
- package/dist/components/PageLayout/components/PageLayoutHelpZone.d.ts +12 -0
- package/dist/components/PageLayout/components/PageLayoutHelpZone.js +6 -0
- package/dist/components/Table/components/Table.d.ts +2 -2
- package/dist/components/Table/components/TableTd.d.ts +1 -1
- package/dist/components/Table/components/TableTh.d.ts +1 -1
- package/dist/components/index.d.ts +2 -0
- package/dist/homepage.js +12 -1
- package/dist/hooks/index.d.ts +1 -0
- package/dist/hooks/useClickOutside/useClickOutside.d.ts +1 -1
- package/dist/hooks/useClickOutside/useClickOutside.js +3 -2
- package/dist/hooks/useUserPreferences/index.d.ts +1 -0
- package/dist/hooks/useUserPreferences/useUserPreferences.d.ts +9 -0
- package/dist/hooks/useUserPreferences/useUserPreferences.js +39 -0
- package/dist/hooks/useZendeskGuide/useZendeskGuide.d.ts +14 -2
- package/dist/hooks/useZendeskGuide/useZendeskGuide.js +51 -24
- package/dist/index.js +166 -160
- package/dist/modules/HelpZone/HelpZone.d.ts +13 -0
- package/dist/modules/HelpZone/HelpZone.js +48 -0
- package/dist/modules/HelpZone/HelpZoneContainer.d.ts +4 -0
- package/dist/modules/HelpZone/HelpZoneContainer.js +18 -0
- package/dist/modules/HelpZone/index.d.ts +3 -0
- package/dist/modules/homepage/components/Header/Header.js +11 -4
- package/dist/modules/homepage/components/UsefulLinks/LinkForm.d.ts +13 -0
- package/dist/modules/homepage/components/UsefulLinks/LinkForm.js +67 -0
- package/dist/modules/homepage/components/UsefulLinks/UsefulLinks.d.ts +6 -0
- package/dist/modules/homepage/components/UsefulLinks/UsefulLinks.js +29 -0
- package/dist/modules/homepage/components/UsefulLinks/UsefulLinksContainer.d.ts +1 -0
- package/dist/modules/homepage/components/UsefulLinks/UsefulLinksContainer.js +40 -0
- package/dist/modules/homepage/components/UsefulLinks/UsefulLinksModal.d.ts +11 -0
- package/dist/modules/homepage/components/UsefulLinks/UsefulLinksModal.js +65 -0
- package/dist/modules/homepage/components/UsefulLinks/hooks/useUsefulLinksContainer.d.ts +19 -0
- package/dist/modules/homepage/components/UsefulLinks/hooks/useUsefulLinksContainer.js +26 -0
- package/dist/modules/homepage/components/UsefulLinks/index.d.ts +5 -0
- package/dist/modules/homepage/components/UsefulLinks/services/api/index.d.ts +6 -0
- package/dist/modules/homepage/components/UsefulLinks/services/api/index.js +5 -0
- package/dist/modules/homepage/components/UsefulLinks/services/api/usefulLinksService.d.ts +31 -0
- package/dist/modules/homepage/components/UsefulLinks/services/api/usefulLinksService.js +50 -0
- package/dist/modules/homepage/components/UsefulLinks/services/queries/usefulLinks.d.ts +20 -0
- package/dist/modules/homepage/components/UsefulLinks/services/queries/usefulLinks.js +65 -0
- package/dist/modules/homepage/components/UserSpace/hooks/useProfileLinks.js +18 -8
- package/dist/modules/homepage/components/index.d.ts +1 -0
- package/dist/modules/icons/components/logo/IconLogoEdificeFull.d.ts +7 -0
- package/dist/modules/icons/components/logo/IconLogoEdificeFull.js +26 -0
- package/dist/modules/icons/components/logo/IconLogoEdificeSmall.d.ts +7 -0
- package/dist/modules/icons/components/logo/IconLogoEdificeSmall.js +17 -0
- package/dist/modules/icons/components/logo/index.d.ts +2 -0
- package/dist/modules/widgets/index.d.ts +1 -1
- package/package.json +6 -6
|
@@ -28,6 +28,7 @@ export * from './Image';
|
|
|
28
28
|
export * from './Input';
|
|
29
29
|
export * from './Label';
|
|
30
30
|
export * from './Layout';
|
|
31
|
+
export * from './LinkPill';
|
|
31
32
|
export * from './List';
|
|
32
33
|
export * from './Loading';
|
|
33
34
|
export * from './LoadingScreen';
|
|
@@ -36,6 +37,7 @@ export * from './LogoBeta';
|
|
|
36
37
|
export * from './MediaViewer';
|
|
37
38
|
export * from './Menu';
|
|
38
39
|
export * from './Modal';
|
|
40
|
+
export * from './ModalBeta';
|
|
39
41
|
export * from './PageLayout';
|
|
40
42
|
export * from './Pagination';
|
|
41
43
|
export * from './Popover';
|
package/dist/homepage.js
CHANGED
|
@@ -12,8 +12,13 @@ import { Favorites } from "./modules/homepage/components/Favorites/Favorites.js"
|
|
|
12
12
|
import { FavoritesContainer } from "./modules/homepage/components/Favorites/FavoritesContainer.js";
|
|
13
13
|
import { LastInfosContainer } from "./modules/homepage/components/LastInfos/LastInfosContainer.js";
|
|
14
14
|
import { LastInfosList } from "./modules/homepage/components/LastInfos/LastInfosList.js";
|
|
15
|
+
import { LinkForm } from "./modules/homepage/components/UsefulLinks/LinkForm.js";
|
|
16
|
+
import { MAX_USEFUL_LINKS, useUsefulLinksContainer } from "./modules/homepage/components/UsefulLinks/hooks/useUsefulLinksContainer.js";
|
|
15
17
|
import { MessageFlashListContainer } from "./modules/homepage/components/MessageFlashList/MessageFlashListContainer.js";
|
|
16
18
|
import { SchoolSpaceContainer } from "./modules/homepage/components/SchoolSpace/SchoolSpaceContainer.js";
|
|
19
|
+
import { UsefulLinks } from "./modules/homepage/components/UsefulLinks/UsefulLinks.js";
|
|
20
|
+
import { UsefulLinksContainer } from "./modules/homepage/components/UsefulLinks/UsefulLinksContainer.js";
|
|
21
|
+
import { UsefulLinksModal } from "./modules/homepage/components/UsefulLinks/UsefulLinksModal.js";
|
|
17
22
|
import { UserSpaceContainer } from "./modules/homepage/components/UserSpace/UserSpaceContainer.js";
|
|
18
23
|
export {
|
|
19
24
|
Favorites,
|
|
@@ -23,6 +28,8 @@ export {
|
|
|
23
28
|
default4 as LastInfos,
|
|
24
29
|
LastInfosContainer,
|
|
25
30
|
LastInfosList,
|
|
31
|
+
LinkForm,
|
|
32
|
+
MAX_USEFUL_LINKS,
|
|
26
33
|
default5 as MessageFlash,
|
|
27
34
|
default6 as MessageFlashList,
|
|
28
35
|
MessageFlashListContainer,
|
|
@@ -31,6 +38,10 @@ export {
|
|
|
31
38
|
NotificationListContainer,
|
|
32
39
|
default9 as SchoolSpace,
|
|
33
40
|
SchoolSpaceContainer,
|
|
41
|
+
UsefulLinks,
|
|
42
|
+
UsefulLinksContainer,
|
|
43
|
+
UsefulLinksModal,
|
|
34
44
|
default10 as UserSpace,
|
|
35
|
-
UserSpaceContainer
|
|
45
|
+
UserSpaceContainer,
|
|
46
|
+
useUsefulLinksContainer
|
|
36
47
|
};
|
package/dist/hooks/index.d.ts
CHANGED
|
@@ -34,6 +34,7 @@ export * from './useUiOverride';
|
|
|
34
34
|
export * from './useUpload';
|
|
35
35
|
export * from './useUploadFiles';
|
|
36
36
|
export * from './useUser';
|
|
37
|
+
export * from './useUserPreferences';
|
|
37
38
|
export * from './useWorkspaceFile';
|
|
38
39
|
export * from './useWorkspaceFolders';
|
|
39
40
|
export * from './useWorkspaceSearch';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export default function useClickOutside<T extends HTMLElement = any>(handler: () => void, events?: string[] | null, nodes?: Array<HTMLElement | null
|
|
1
|
+
export default function useClickOutside<T extends HTMLElement = any>(handler: () => void, events?: string[] | null, nodes?: Array<HTMLElement | null>, enabled?: boolean): import('react').MutableRefObject<T | null>;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { useRef, useEffect } from "react";
|
|
2
2
|
const DEFAULT_EVENTS = ["mousedown", "touchstart"];
|
|
3
|
-
function useClickOutside(handler, events, nodes) {
|
|
3
|
+
function useClickOutside(handler, events, nodes, enabled = !0) {
|
|
4
4
|
const ref = useRef(null);
|
|
5
5
|
return useEffect(() => {
|
|
6
|
+
if (!enabled) return;
|
|
6
7
|
const listener = (event) => {
|
|
7
8
|
const {
|
|
8
9
|
target
|
|
@@ -19,7 +20,7 @@ function useClickOutside(handler, events, nodes) {
|
|
|
19
20
|
document.removeEventListener(fn, listener);
|
|
20
21
|
});
|
|
21
22
|
};
|
|
22
|
-
}, [ref, handler, nodes, events]), ref;
|
|
23
|
+
}, [ref, handler, nodes, events, enabled]), ref;
|
|
23
24
|
}
|
|
24
25
|
export {
|
|
25
26
|
useClickOutside as default
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default, useUserPreferences } from './useUserPreferences';
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export declare const USER_PREFERENCES_QUERY_KEY: string[];
|
|
2
|
+
export declare function useUserPreferences<T extends Record<string, any> = Record<string, any>>(): {
|
|
3
|
+
preferences: T | undefined;
|
|
4
|
+
isLoading: boolean;
|
|
5
|
+
isError: boolean;
|
|
6
|
+
refetch: (options?: import('@tanstack/react-query').RefetchOptions) => Promise<import('@tanstack/react-query').QueryObserverResult<T, Error>>;
|
|
7
|
+
savePreferences: (preferences: T) => Promise<T>;
|
|
8
|
+
};
|
|
9
|
+
export default useUserPreferences;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { odeServices } from "@edifice.io/client";
|
|
2
|
+
import { useQueryClient, useQuery, queryOptions, useMutation } from "@tanstack/react-query";
|
|
3
|
+
const USER_PREFERENCES_QUERY_KEY = ["user", "preferences"];
|
|
4
|
+
function useUserPreferences() {
|
|
5
|
+
const queryClient = useQueryClient(), {
|
|
6
|
+
data: preferences,
|
|
7
|
+
isLoading,
|
|
8
|
+
isError,
|
|
9
|
+
refetch
|
|
10
|
+
} = useQuery(queryOptions({
|
|
11
|
+
queryKey: USER_PREFERENCES_QUERY_KEY,
|
|
12
|
+
queryFn: () => odeServices.conf().getUserPreferences(),
|
|
13
|
+
staleTime: 15e3
|
|
14
|
+
})), mutation = useMutation({
|
|
15
|
+
mutationFn: (preferences2) => odeServices.conf().saveUserPreferences(preferences2),
|
|
16
|
+
onMutate: async (preferences2) => {
|
|
17
|
+
queryClient.setQueryData(USER_PREFERENCES_QUERY_KEY, preferences2);
|
|
18
|
+
},
|
|
19
|
+
onError: () => {
|
|
20
|
+
queryClient.invalidateQueries({
|
|
21
|
+
queryKey: USER_PREFERENCES_QUERY_KEY
|
|
22
|
+
});
|
|
23
|
+
},
|
|
24
|
+
onSuccess: (preferences2) => {
|
|
25
|
+
queryClient.setQueryData(USER_PREFERENCES_QUERY_KEY, preferences2);
|
|
26
|
+
}
|
|
27
|
+
});
|
|
28
|
+
return {
|
|
29
|
+
preferences,
|
|
30
|
+
isLoading,
|
|
31
|
+
isError,
|
|
32
|
+
refetch,
|
|
33
|
+
savePreferences: (preferences2) => mutation.mutateAsync(preferences2)
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
export {
|
|
37
|
+
USER_PREFERENCES_QUERY_KEY,
|
|
38
|
+
useUserPreferences
|
|
39
|
+
};
|
|
@@ -1,2 +1,14 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
export interface UseZendeskGuideAPI {
|
|
2
|
+
/** True once the widget script is loaded and configured. */
|
|
3
|
+
isReady: boolean;
|
|
4
|
+
/** True while the widget panel is open. */
|
|
5
|
+
isOpen: boolean;
|
|
6
|
+
open: () => void;
|
|
7
|
+
close: () => void;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Add Zendesk Guide
|
|
11
|
+
*
|
|
12
|
+
* @param headerColor Overrides the widget panel's theme color.
|
|
13
|
+
*/
|
|
14
|
+
export default function useZendeskGuide(headerColor?: string): UseZendeskGuideAPI;
|
|
@@ -5,7 +5,7 @@ import { useEdificeTheme } from "../../providers/EdificeThemeProvider/EdificeThe
|
|
|
5
5
|
import useUser from "../useUser/useUser.js";
|
|
6
6
|
import useIsAdml from "../useIsAdml/useIsAdml.js";
|
|
7
7
|
import useHasWorkflow from "../useHasWorkflow/useHasWorkflow.js";
|
|
8
|
-
function useZendeskGuide() {
|
|
8
|
+
function useZendeskGuide(headerColor) {
|
|
9
9
|
const {
|
|
10
10
|
currentLanguage
|
|
11
11
|
} = useEdificeClient(), {
|
|
@@ -14,7 +14,13 @@ function useZendeskGuide() {
|
|
|
14
14
|
isAdml
|
|
15
15
|
} = useIsAdml(), {
|
|
16
16
|
theme
|
|
17
|
-
} = useEdificeTheme(), isMobileView = window.innerWidth <= 768, hasSupportWorkflow = useHasWorkflow("net.atos.entng.support.controllers.DisplayController|view"), [locationPathname, setLocationPathname] = useState(""), [dataModule, setDataModule] = useState(void 0),
|
|
17
|
+
} = useEdificeTheme(), isMobileView = window.innerWidth <= 768, hasSupportWorkflow = useHasWorkflow("net.atos.entng.support.controllers.DisplayController|view"), [locationPathname, setLocationPathname] = useState(""), [dataModule, setDataModule] = useState(void 0), [isReady, setIsReady] = useState(!1), [isOpen, setIsOpen] = useState(!1), open = () => {
|
|
18
|
+
var _a;
|
|
19
|
+
(_a = window.zE) == null || _a.call(window, "webWidget", "open");
|
|
20
|
+
}, close = () => {
|
|
21
|
+
var _a;
|
|
22
|
+
(_a = window.zE) == null || _a.call(window, "webWidget", "close");
|
|
23
|
+
}, setZendeskGuideLabels = () => {
|
|
18
24
|
const modulePathnameSplit = locationPathname.split("/");
|
|
19
25
|
let moduleLabel = "", labels = "";
|
|
20
26
|
if (dataModule != null && dataModule.labels && Object.keys(dataModule == null ? void 0 : dataModule.labels).length > 0 && modulePathnameSplit.length > 1) {
|
|
@@ -33,8 +39,40 @@ function useZendeskGuide() {
|
|
|
33
39
|
return useEffect(() => {
|
|
34
40
|
window.location.pathname !== locationPathname && setLocationPathname(window.location.pathname), !(dataModule === void 0 || Object.keys(dataModule).length === 0) && setZendeskGuideLabels();
|
|
35
41
|
}, [window.location.pathname, dataModule]), useEffect(() => {
|
|
36
|
-
|
|
37
|
-
|
|
42
|
+
const registerWidgetHandlers = () => {
|
|
43
|
+
window.zE("webWidget:on", "open", function() {
|
|
44
|
+
setIsOpen(!0), hasSupportWorkflow && window.zE("webWidget", "updateSettings", {
|
|
45
|
+
webWidget: {
|
|
46
|
+
contactForm: {
|
|
47
|
+
suppress: !1
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
});
|
|
51
|
+
}), window.zE("webWidget:on", "close", function() {
|
|
52
|
+
setIsOpen(!1);
|
|
53
|
+
}), window.zE("webWidget:on", "userEvent", function(ref) {
|
|
54
|
+
const category = ref.category, action = ref.action, properties = ref.properties;
|
|
55
|
+
action === "Contact Form Shown" && category === "Zendesk Web Widget" && properties && properties.name === "contact-form" && hasSupportWorkflow && (window.zE("webWidget", "updateSettings", {
|
|
56
|
+
webWidget: {
|
|
57
|
+
contactForm: {
|
|
58
|
+
suppress: !0
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
}), window.zE("webWidget", "close"), window.open("/support/tickets/new", "_blank"));
|
|
62
|
+
});
|
|
63
|
+
};
|
|
64
|
+
if (document.getElementById("ze-snippet")) {
|
|
65
|
+
window.zE && (registerWidgetHandlers(), setIsReady(!0));
|
|
66
|
+
return;
|
|
67
|
+
}
|
|
68
|
+
hasSupportWorkflow !== void 0 && (async () => {
|
|
69
|
+
let zendeskGuideConfig;
|
|
70
|
+
try {
|
|
71
|
+
zendeskGuideConfig = await odeServices.http().get("/zendeskGuide/config");
|
|
72
|
+
} catch (error) {
|
|
73
|
+
console.warn("[useZendeskGuide] Failed to fetch the support widget config from `/zendeskGuide/config` — the widget (and HelpZone's button) won't show up. If you're running a local dev server, check that `/zendeskGuide` is proxied to your backend in your app's Vite dev proxy config.", error);
|
|
74
|
+
return;
|
|
75
|
+
}
|
|
38
76
|
if (zendeskGuideConfig && zendeskGuideConfig.key && zendeskGuideConfig.key !== "") {
|
|
39
77
|
const scriptZendesk = document.createElement("script");
|
|
40
78
|
scriptZendesk.id = "ze-snippet", scriptZendesk.src = `https://static.zdassets.com/ekr/snippet.js?key=${zendeskGuideConfig.key}`, document.body.appendChild(scriptZendesk).onload = () => {
|
|
@@ -45,7 +83,8 @@ function useZendeskGuide() {
|
|
|
45
83
|
}), Object.keys(zendeskGuideConfig.module).length > 0 && setDataModule(zendeskGuideConfig.module), window.zE("webWidget", "show"), window.zE("webWidget", "updateSettings", {
|
|
46
84
|
webWidget: {
|
|
47
85
|
color: {
|
|
48
|
-
theme: zendeskGuideConfig.color || "#ffc400"
|
|
86
|
+
theme: zendeskGuideConfig.color || "#ffc400",
|
|
87
|
+
header: headerColor
|
|
49
88
|
},
|
|
50
89
|
zIndex: 3,
|
|
51
90
|
launcher: {
|
|
@@ -74,28 +113,16 @@ function useZendeskGuide() {
|
|
|
74
113
|
}
|
|
75
114
|
}
|
|
76
115
|
});
|
|
77
|
-
}),
|
|
78
|
-
hasSupportWorkflow && window.zE("webWidget", "updateSettings", {
|
|
79
|
-
webWidget: {
|
|
80
|
-
contactForm: {
|
|
81
|
-
suppress: !1
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
});
|
|
85
|
-
}), window.zE("webWidget:on", "userEvent", function(ref) {
|
|
86
|
-
const category = ref.category, action = ref.action, properties = ref.properties;
|
|
87
|
-
action === "Contact Form Shown" && category === "Zendesk Web Widget" && properties && properties.name === "contact-form" && hasSupportWorkflow && (window.zE("webWidget", "updateSettings", {
|
|
88
|
-
webWidget: {
|
|
89
|
-
contactForm: {
|
|
90
|
-
suppress: !0
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
}), window.zE("webWidget", "close"), window.open("/support/tickets/new", "_blank"));
|
|
94
|
-
});
|
|
116
|
+
}), registerWidgetHandlers(), setIsReady(!0);
|
|
95
117
|
};
|
|
96
118
|
}
|
|
97
119
|
})();
|
|
98
|
-
}, [hasSupportWorkflow]),
|
|
120
|
+
}, [hasSupportWorkflow]), {
|
|
121
|
+
isReady,
|
|
122
|
+
isOpen,
|
|
123
|
+
open,
|
|
124
|
+
close
|
|
125
|
+
};
|
|
99
126
|
}
|
|
100
127
|
export {
|
|
101
128
|
useZendeskGuide as default
|