@edifice.io/react 2.6.7-develop-b2school.20260929181638 → 2.6.7-develop-pedago.20260930173910
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/Alert/Alert.js +23 -47
- package/dist/components/Form/FormText.js +6 -11
- package/dist/components/Input/Input.d.ts +2 -11
- package/dist/components/Input/Input.js +21 -43
- package/dist/components/Label/Label.js +4 -4
- package/dist/components/Layout/Layout.js +15 -30
- package/dist/components/PageLayout/PageLayout.d.ts +0 -4
- package/dist/components/PageLayout/PageLayout.js +14 -37
- package/dist/components/PageLayout/components/PageLayoutContent.js +1 -5
- 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 +0 -2
- package/dist/homepage.js +3 -17
- package/dist/hooks/index.d.ts +0 -2
- package/dist/hooks/useClickOutside/useClickOutside.d.ts +1 -1
- package/dist/hooks/useClickOutside/useClickOutside.js +2 -3
- package/dist/hooks/useToast/useToast.d.ts +0 -1
- package/dist/hooks/useToast/useToast.js +9 -12
- package/dist/hooks/useZendeskGuide/useZendeskGuide.d.ts +2 -16
- package/dist/hooks/useZendeskGuide/useZendeskGuide.js +24 -58
- package/dist/icons.js +402 -404
- package/dist/index.js +160 -168
- package/dist/modules/editor/components/EditorToolbar/EditorToolbar.Typography.js +3 -3
- package/dist/modules/homepage/components/Communities/Communities.d.ts +2 -1
- package/dist/modules/homepage/components/Communities/Communities.js +14 -13
- package/dist/modules/homepage/components/Communities/CommunitiesContainer.d.ts +1 -1
- package/dist/modules/homepage/components/Communities/CommunitiesContainer.js +9 -5
- package/dist/modules/homepage/components/Communities/CommunitiesSkeleton.js +4 -7
- package/dist/modules/homepage/components/Communities/useCommunities.d.ts +4 -1
- package/dist/modules/homepage/components/Communities/useCommunities.js +8 -3
- package/dist/modules/homepage/components/Favorites/Favorites.js +2 -2
- package/dist/modules/homepage/components/Header/Header.js +4 -11
- package/dist/modules/homepage/components/HomeCard/HomeCard.d.ts +1 -1
- package/dist/modules/homepage/components/HomeCard/HomeCardHeader.d.ts +1 -15
- package/dist/modules/homepage/components/HomeCard/HomeCardHeader.js +2 -3
- package/dist/modules/homepage/components/Notifications/components/NotificationFilterModal.js +26 -36
- package/dist/modules/homepage/components/Notifications/components/ReportNotificationModal.js +1 -1
- package/dist/modules/homepage/components/Notifications/services/queries/notification.js +2 -9
- package/dist/modules/homepage/components/UserSpace/UserSpace.d.ts +1 -3
- package/dist/modules/homepage/components/UserSpace/UserSpace.js +7 -13
- package/dist/modules/homepage/components/UserSpace/UserSpaceContainer.d.ts +2 -4
- package/dist/modules/homepage/components/UserSpace/UserSpaceContainer.js +2 -3
- package/dist/modules/homepage/components/UserSpace/hooks/useProfileLinks.js +8 -18
- package/dist/modules/homepage/components/index.d.ts +1 -3
- package/dist/modules/icons/components/index.d.ts +0 -1
- package/dist/modules/widgets/index.d.ts +1 -1
- package/package.json +6 -6
- package/dist/components/LinkPill/LinkPill.d.ts +0 -41
- package/dist/components/LinkPill/LinkPill.js +0 -28
- package/dist/components/LinkPill/index.d.ts +0 -2
- package/dist/components/ModalBeta/ModalBeta.d.ts +0 -47
- package/dist/components/ModalBeta/ModalBeta.js +0 -62
- package/dist/components/ModalBeta/ModalBetaBody.d.ts +0 -19
- package/dist/components/ModalBeta/ModalBetaBody.js +0 -15
- package/dist/components/ModalBeta/ModalBetaContext.d.ts +0 -7
- package/dist/components/ModalBeta/ModalBetaContext.js +0 -15
- package/dist/components/ModalBeta/ModalBetaFooter.d.ts +0 -13
- package/dist/components/ModalBeta/ModalBetaFooter.js +0 -7
- package/dist/components/ModalBeta/ModalBetaHeader.d.ts +0 -23
- package/dist/components/ModalBeta/ModalBetaHeader.js +0 -31
- package/dist/components/ModalBeta/index.d.ts +0 -2
- package/dist/components/PageLayout/components/PageLayoutHelpZone.d.ts +0 -12
- package/dist/components/PageLayout/components/PageLayoutHelpZone.js +0 -6
- package/dist/hooks/useBackground/index.d.ts +0 -1
- package/dist/hooks/useBackground/useBackground.d.ts +0 -7
- package/dist/hooks/useBackground/useBackground.js +0 -16
- package/dist/hooks/useUserPreferences/index.d.ts +0 -1
- package/dist/hooks/useUserPreferences/useUserPreferences.d.ts +0 -9
- package/dist/hooks/useUserPreferences/useUserPreferences.js +0 -40
- package/dist/modules/HelpZone/HelpZone.d.ts +0 -13
- package/dist/modules/HelpZone/HelpZone.js +0 -52
- package/dist/modules/HelpZone/HelpZoneContainer.d.ts +0 -4
- package/dist/modules/HelpZone/HelpZoneContainer.js +0 -18
- package/dist/modules/HelpZone/index.d.ts +0 -3
- package/dist/modules/homepage/components/UsefulLinks/LinkForm.d.ts +0 -13
- package/dist/modules/homepage/components/UsefulLinks/LinkForm.js +0 -67
- package/dist/modules/homepage/components/UsefulLinks/UsefulLinks.d.ts +0 -6
- package/dist/modules/homepage/components/UsefulLinks/UsefulLinks.js +0 -31
- package/dist/modules/homepage/components/UsefulLinks/UsefulLinksContainer.d.ts +0 -1
- package/dist/modules/homepage/components/UsefulLinks/UsefulLinksContainer.js +0 -40
- package/dist/modules/homepage/components/UsefulLinks/UsefulLinksModal.d.ts +0 -11
- package/dist/modules/homepage/components/UsefulLinks/UsefulLinksModal.js +0 -65
- package/dist/modules/homepage/components/UsefulLinks/hooks/useUsefulLinksContainer.d.ts +0 -19
- package/dist/modules/homepage/components/UsefulLinks/hooks/useUsefulLinksContainer.js +0 -26
- package/dist/modules/homepage/components/UsefulLinks/index.d.ts +0 -5
- package/dist/modules/homepage/components/UsefulLinks/services/api/index.d.ts +0 -6
- package/dist/modules/homepage/components/UsefulLinks/services/api/index.js +0 -5
- package/dist/modules/homepage/components/UsefulLinks/services/api/usefulLinksService.d.ts +0 -31
- package/dist/modules/homepage/components/UsefulLinks/services/api/usefulLinksService.js +0 -50
- package/dist/modules/homepage/components/UsefulLinks/services/queries/usefulLinks.d.ts +0 -20
- package/dist/modules/homepage/components/UsefulLinks/services/queries/usefulLinks.js +0 -65
- package/dist/modules/homepage/components/WidgetsPersonalizationPanel/WidgetToggle.d.ts +0 -16
- package/dist/modules/homepage/components/WidgetsPersonalizationPanel/WidgetToggle.js +0 -15
- package/dist/modules/homepage/components/WidgetsPersonalizationPanel/WidgetsPersonalizationPanel.d.ts +0 -21
- package/dist/modules/homepage/components/WidgetsPersonalizationPanel/WidgetsPersonalizationPanel.js +0 -47
- package/dist/modules/homepage/components/WidgetsPersonalizationPanel/index.d.ts +0 -2
- package/dist/modules/icons/components/IconAddWidget.d.ts +0 -7
- package/dist/modules/icons/components/IconAddWidget.js +0 -12
- package/dist/modules/icons/components/logo/IconLogoEdificeFull.d.ts +0 -7
- package/dist/modules/icons/components/logo/IconLogoEdificeFull.js +0 -26
- package/dist/modules/icons/components/logo/IconLogoEdificeSmall.d.ts +0 -7
- package/dist/modules/icons/components/logo/IconLogoEdificeSmall.js +0 -17
- package/dist/modules/icons/components/logo/index.d.ts +0 -2
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
import { jsx, jsxs, Fragment } from "react/jsx-runtime";
|
|
2
|
-
import { forwardRef, useCallback, useEffect } from "react";
|
|
3
|
-
import { useTransition, animated } from "@react-spring/web";
|
|
4
|
-
import clsx from "clsx";
|
|
5
|
-
import ModalBetaBody from "./ModalBetaBody.js";
|
|
6
|
-
import { ModalBetaContext } from "./ModalBetaContext.js";
|
|
7
|
-
import ModalBetaFooter from "./ModalBetaFooter.js";
|
|
8
|
-
import ModalBetaHeader from "./ModalBetaHeader.js";
|
|
9
|
-
import useClickOutside from "../../hooks/useClickOutside/useClickOutside.js";
|
|
10
|
-
import useTrapFocus from "../../hooks/useTrapFocus/useTrapFocus.js";
|
|
11
|
-
import useKeyPress from "../../hooks/useKeyPress/useKeyPress.js";
|
|
12
|
-
const Root = /* @__PURE__ */ forwardRef(({
|
|
13
|
-
id,
|
|
14
|
-
isOpen,
|
|
15
|
-
onModalClose,
|
|
16
|
-
size = "m",
|
|
17
|
-
focusId,
|
|
18
|
-
children,
|
|
19
|
-
...otherDivProps
|
|
20
|
-
}, ref) => {
|
|
21
|
-
const ariaLabelId = `aria_label_${id}`, ariaDescriptionId = `aria_desc_${id}`, modalRef = useClickOutside(onModalClose, void 0, void 0, isOpen), trapRef = useTrapFocus(isOpen), setDialogRef = useCallback((node) => {
|
|
22
|
-
modalRef.current = node, trapRef.current = node;
|
|
23
|
-
}, [modalRef, trapRef]);
|
|
24
|
-
useKeyPress(onModalClose, ["Escape"]), useEffect(() => {
|
|
25
|
-
if (isOpen && (document.body.style.overflow = "hidden", focusId)) {
|
|
26
|
-
const elem = document.getElementById(focusId);
|
|
27
|
-
elem == null || elem.focus();
|
|
28
|
-
}
|
|
29
|
-
return () => {
|
|
30
|
-
document.body.style.overflow = "";
|
|
31
|
-
};
|
|
32
|
-
}, [focusId, isOpen]);
|
|
33
|
-
const modalClasses = clsx("modal-beta", `modal-beta--${size}`), modalContextValue = {
|
|
34
|
-
ariaLabelId,
|
|
35
|
-
ariaDescriptionId,
|
|
36
|
-
focusId
|
|
37
|
-
}, transition = useTransition(isOpen, {
|
|
38
|
-
from: {
|
|
39
|
-
y: -20,
|
|
40
|
-
opacity: 0
|
|
41
|
-
},
|
|
42
|
-
enter: {
|
|
43
|
-
y: 0,
|
|
44
|
-
opacity: 1
|
|
45
|
-
},
|
|
46
|
-
leave: {
|
|
47
|
-
y: 20,
|
|
48
|
-
opacity: 0
|
|
49
|
-
}
|
|
50
|
-
});
|
|
51
|
-
return /* @__PURE__ */ jsx(ModalBetaContext.Provider, { value: modalContextValue, children: transition((style, isOpen2) => /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
52
|
-
isOpen2 && /* @__PURE__ */ jsx(animated.div, { id, ref, role: "dialog", "aria-modal": "true", "aria-labelledby": ariaLabelId, "aria-describedby": ariaDescriptionId, className: modalClasses, style, tabIndex: -1, ...otherDivProps, children: /* @__PURE__ */ jsx("div", { id: `${id}_ref`, ref: setDialogRef, className: "modal-beta-dialog", children: /* @__PURE__ */ jsx("div", { className: "modal-beta-content", children }) }) }),
|
|
53
|
-
isOpen2 && /* @__PURE__ */ jsx("div", { className: "modal-beta-backdrop" })
|
|
54
|
-
] })) });
|
|
55
|
-
}), ModalBeta = Object.assign(Root, {
|
|
56
|
-
Header: ModalBetaHeader,
|
|
57
|
-
Body: ModalBetaBody,
|
|
58
|
-
Footer: ModalBetaFooter
|
|
59
|
-
});
|
|
60
|
-
export {
|
|
61
|
-
ModalBeta as default
|
|
62
|
-
};
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { ReactNode } from 'react';
|
|
2
|
-
export interface ModalBetaBodyProps {
|
|
3
|
-
/**
|
|
4
|
-
* Children
|
|
5
|
-
*/
|
|
6
|
-
children: ReactNode;
|
|
7
|
-
/**
|
|
8
|
-
* Optional class for styling purpose
|
|
9
|
-
*/
|
|
10
|
-
className?: string;
|
|
11
|
-
}
|
|
12
|
-
/**
|
|
13
|
-
* ModalBeta Body
|
|
14
|
-
*/
|
|
15
|
-
declare const ModalBetaBody: {
|
|
16
|
-
({ children, className }: ModalBetaBodyProps): import("react/jsx-runtime").JSX.Element;
|
|
17
|
-
displayName: string;
|
|
18
|
-
};
|
|
19
|
-
export default ModalBetaBody;
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { jsx } from "react/jsx-runtime";
|
|
2
|
-
import clsx from "clsx";
|
|
3
|
-
import { useModalBetaContext } from "./ModalBetaContext.js";
|
|
4
|
-
const ModalBetaBody = ({
|
|
5
|
-
children,
|
|
6
|
-
className
|
|
7
|
-
}) => {
|
|
8
|
-
const {
|
|
9
|
-
ariaDescriptionId
|
|
10
|
-
} = useModalBetaContext();
|
|
11
|
-
return /* @__PURE__ */ jsx("div", { id: ariaDescriptionId, className: clsx("modal-beta-body", className), children });
|
|
12
|
-
};
|
|
13
|
-
export {
|
|
14
|
-
ModalBetaBody as default
|
|
15
|
-
};
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
export interface ModalBetaContextProps {
|
|
2
|
-
ariaLabelId: string;
|
|
3
|
-
ariaDescriptionId: string;
|
|
4
|
-
focusId: string | undefined;
|
|
5
|
-
}
|
|
6
|
-
export declare const ModalBetaContext: import('react').Context<ModalBetaContextProps>;
|
|
7
|
-
export declare const useModalBetaContext: () => ModalBetaContextProps;
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { createContext, useContext } from "react";
|
|
2
|
-
const ModalBetaContext = /* @__PURE__ */ createContext({
|
|
3
|
-
ariaLabelId: "",
|
|
4
|
-
ariaDescriptionId: "",
|
|
5
|
-
focusId: ""
|
|
6
|
-
}), useModalBetaContext = () => {
|
|
7
|
-
const context = useContext(ModalBetaContext);
|
|
8
|
-
if (!context)
|
|
9
|
-
throw new Error("Cannot be rendered outside the ModalBeta component");
|
|
10
|
-
return context;
|
|
11
|
-
};
|
|
12
|
-
export {
|
|
13
|
-
ModalBetaContext,
|
|
14
|
-
useModalBetaContext
|
|
15
|
-
};
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { ReactNode } from 'react';
|
|
2
|
-
export interface ModalBetaFooterProps {
|
|
3
|
-
children: ReactNode;
|
|
4
|
-
}
|
|
5
|
-
/**
|
|
6
|
-
* ModalBeta Footer — right-aligns its children, typically two ButtonBeta
|
|
7
|
-
* (a ghost/tertiary action followed by the primary filled action).
|
|
8
|
-
*/
|
|
9
|
-
declare const ModalBetaFooter: {
|
|
10
|
-
({ children }: ModalBetaFooterProps): import("react/jsx-runtime").JSX.Element;
|
|
11
|
-
displayName: string;
|
|
12
|
-
};
|
|
13
|
-
export default ModalBetaFooter;
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { ReactNode } from 'react';
|
|
2
|
-
export interface ModalBetaHeaderProps {
|
|
3
|
-
/**
|
|
4
|
-
* Method called on modal close
|
|
5
|
-
*/
|
|
6
|
-
onModalClose: () => void;
|
|
7
|
-
/**
|
|
8
|
-
* Modal title
|
|
9
|
-
*/
|
|
10
|
-
children: ReactNode;
|
|
11
|
-
/**
|
|
12
|
-
* Optional text displayed below the title
|
|
13
|
-
*/
|
|
14
|
-
subtitle?: ReactNode;
|
|
15
|
-
}
|
|
16
|
-
/**
|
|
17
|
-
* ModalBeta Header
|
|
18
|
-
*/
|
|
19
|
-
declare const ModalBetaHeader: {
|
|
20
|
-
({ onModalClose, children, subtitle, }: ModalBetaHeaderProps): import("react/jsx-runtime").JSX.Element;
|
|
21
|
-
displayName: string;
|
|
22
|
-
};
|
|
23
|
-
export default ModalBetaHeader;
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
|
-
import { useRef, useEffect } from "react";
|
|
3
|
-
import { useTranslation } from "react-i18next";
|
|
4
|
-
import SvgIconClose from "../../modules/icons/components/IconClose.js";
|
|
5
|
-
import ButtonBeta from "../ButtonBeta/ButtonBeta.js";
|
|
6
|
-
import { useModalBetaContext } from "./ModalBetaContext.js";
|
|
7
|
-
const ModalBetaHeader = ({
|
|
8
|
-
onModalClose,
|
|
9
|
-
children,
|
|
10
|
-
subtitle
|
|
11
|
-
}) => {
|
|
12
|
-
const {
|
|
13
|
-
ariaLabelId,
|
|
14
|
-
focusId
|
|
15
|
-
} = useModalBetaContext(), closeButtonRef = useRef(null), {
|
|
16
|
-
t
|
|
17
|
-
} = useTranslation();
|
|
18
|
-
return useEffect(() => {
|
|
19
|
-
var _a;
|
|
20
|
-
focusId || (_a = closeButtonRef.current) == null || _a.focus();
|
|
21
|
-
}, [focusId]), /* @__PURE__ */ jsxs("div", { className: "modal-beta-header", children: [
|
|
22
|
-
/* @__PURE__ */ jsxs("div", { className: "modal-beta-title-row", children: [
|
|
23
|
-
/* @__PURE__ */ jsx("h2", { id: ariaLabelId, className: "modal-beta-title", tabIndex: -1, children }),
|
|
24
|
-
/* @__PURE__ */ jsx(ButtonBeta, { ref: closeButtonRef, "aria-label": t("close"), title: t("close"), type: "button", variant: "ghost", color: "tertiary", leftIcon: /* @__PURE__ */ jsx(SvgIconClose, {}), onClick: onModalClose })
|
|
25
|
-
] }),
|
|
26
|
-
subtitle && /* @__PURE__ */ jsx("p", { className: "modal-beta-subtitle", children: subtitle })
|
|
27
|
-
] });
|
|
28
|
-
};
|
|
29
|
-
export {
|
|
30
|
-
ModalBetaHeader as default
|
|
31
|
-
};
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Opt-in slot: renders the floating Edifice help zone (badge + support
|
|
3
|
-
* button). Requires `EdificeClientProvider` and `EdificeThemeProvider`
|
|
4
|
-
* higher in the tree (used internally by `useZendeskGuide`) — kept opt-in
|
|
5
|
-
* rather than baked into `PageLayout` itself so standalone consumers
|
|
6
|
-
* without those providers don't crash at render.
|
|
7
|
-
*/
|
|
8
|
-
declare const PageLayoutHelpZone: {
|
|
9
|
-
(): import("react/jsx-runtime").JSX.Element;
|
|
10
|
-
displayName: string;
|
|
11
|
-
};
|
|
12
|
-
export default PageLayoutHelpZone;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default as useBackground, type Background } from './useBackground';
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
export type Background = 'default' | 'pink-200' | 'yellow-200' | 'orange-200' | 'blue-200' | 'green-200';
|
|
2
|
-
declare const _default: () => {
|
|
3
|
-
background: Background;
|
|
4
|
-
isBackgroundImageOverridden: boolean;
|
|
5
|
-
productOverride: string | undefined;
|
|
6
|
-
};
|
|
7
|
-
export default _default;
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import useUiOverride from "../useUiOverride/useUiOverride.js";
|
|
2
|
-
import useUserPreferences from "../useUserPreferences/useUserPreferences.js";
|
|
3
|
-
const useBackground = () => {
|
|
4
|
-
const backgroundOverride = useUiOverride("layout.background"), backgroundDefault = useUiOverride("background.default"), {
|
|
5
|
-
preferences
|
|
6
|
-
} = useUserPreferences(), isBackgroundImageOverridden = (backgroundOverride == null ? void 0 : backgroundOverride.variant) === "image";
|
|
7
|
-
return {
|
|
8
|
-
/* Actual background is either : user's prefered value, theme-conf overriden value or 'default' */
|
|
9
|
-
background: (preferences == null ? void 0 : preferences.background) ?? (backgroundDefault == null ? void 0 : backgroundDefault.variant) ?? "default",
|
|
10
|
-
isBackgroundImageOverridden,
|
|
11
|
-
productOverride: backgroundOverride == null ? void 0 : backgroundOverride.theme
|
|
12
|
-
};
|
|
13
|
-
};
|
|
14
|
-
export {
|
|
15
|
-
useBackground as default
|
|
16
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default, useUserPreferences } from './useUserPreferences';
|
|
@@ -1,9 +0,0 @@
|
|
|
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;
|
|
@@ -1,40 +0,0 @@
|
|
|
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 as default,
|
|
39
|
-
useUserPreferences
|
|
40
|
-
};
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
export interface HelpZoneProps {
|
|
2
|
-
/** True once the support widget is loaded and can be opened. */
|
|
3
|
-
isReady: boolean;
|
|
4
|
-
/** True while the support panel is open. */
|
|
5
|
-
isOpen: boolean;
|
|
6
|
-
onOpen: () => void;
|
|
7
|
-
onClose: () => void;
|
|
8
|
-
}
|
|
9
|
-
declare const HelpZone: {
|
|
10
|
-
({ isReady, isOpen, onOpen, onClose }: HelpZoneProps): import('react').ReactPortal | null;
|
|
11
|
-
displayName: string;
|
|
12
|
-
};
|
|
13
|
-
export default HelpZone;
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
|
-
import { useState, useRef, useEffect } from "react";
|
|
3
|
-
import clsx from "clsx";
|
|
4
|
-
import { createPortal } from "react-dom";
|
|
5
|
-
import { useTranslation } from "react-i18next";
|
|
6
|
-
import SvgIconQuestion from "../icons/components/IconQuestion.js";
|
|
7
|
-
import Tooltip from "../../components/Tooltip/Tooltip.js";
|
|
8
|
-
import SvgIconLogoEdificeSmall from "../icons/components/logo/IconLogoEdificeSmall.js";
|
|
9
|
-
import SvgIconLogoEdificeFull from "../icons/components/logo/IconLogoEdificeFull.js";
|
|
10
|
-
import ButtonBeta from "../../components/ButtonBeta/ButtonBeta.js";
|
|
11
|
-
const HelpZone = ({
|
|
12
|
-
isReady,
|
|
13
|
-
isOpen,
|
|
14
|
-
onOpen,
|
|
15
|
-
onClose
|
|
16
|
-
}) => {
|
|
17
|
-
const {
|
|
18
|
-
t
|
|
19
|
-
} = useTranslation(), [portalRoot, setPortalRoot] = useState(null), [isCompact, setIsCompact] = useState(!1), questionButtonRef = useRef(null);
|
|
20
|
-
if (useEffect(() => (document.body.classList.add("help-zone-active"), setPortalRoot(document.getElementById("portal")), () => {
|
|
21
|
-
document.body.classList.remove("help-zone-active");
|
|
22
|
-
}), []), useEffect(() => {
|
|
23
|
-
if (isCompact)
|
|
24
|
-
return;
|
|
25
|
-
const goCompact = () => setIsCompact(!0), handleClick = (event) => {
|
|
26
|
-
questionButtonRef.current && event.target instanceof Node && questionButtonRef.current.contains(event.target) || goCompact();
|
|
27
|
-
};
|
|
28
|
-
return document.addEventListener("scroll", goCompact, {
|
|
29
|
-
capture: !0,
|
|
30
|
-
passive: !0
|
|
31
|
-
}), document.addEventListener("click", handleClick), () => {
|
|
32
|
-
document.removeEventListener("scroll", goCompact, {
|
|
33
|
-
capture: !0
|
|
34
|
-
}), document.removeEventListener("click", handleClick);
|
|
35
|
-
};
|
|
36
|
-
}, [isCompact]), !isReady || !portalRoot)
|
|
37
|
-
return null;
|
|
38
|
-
const handleOpenHelpZone = () => isOpen ? onClose() : onOpen();
|
|
39
|
-
return /* @__PURE__ */ createPortal(/* @__PURE__ */ jsxs("div", { className: clsx("help-zone", {
|
|
40
|
-
"help-zone--open": isOpen
|
|
41
|
-
}), "aria-hidden": isOpen, children: [
|
|
42
|
-
/* @__PURE__ */ jsx("a", { className: "help-zone-badge", href: "https://edifice.io/releases/", target: "_blank", rel: "noopener noreferrer", "aria-label": t("help-zone.edifice-releases-notes"), children: /* @__PURE__ */ jsx(Tooltip, { message: t("help-zone.edifice-releases-notes"), placement: "top", className: "help-zone-tooltip", children: /* @__PURE__ */ jsx("span", { className: clsx("help-zone-logo", {
|
|
43
|
-
"help-zone-logo--compact": isCompact,
|
|
44
|
-
"help-zone-logo--full": !isCompact
|
|
45
|
-
}), children: isCompact ? /* @__PURE__ */ jsx(SvgIconLogoEdificeSmall, { width: 18, height: 18 }) : /* @__PURE__ */ jsx(SvgIconLogoEdificeFull, { width: 81, height: 18 }) }) }) }),
|
|
46
|
-
/* @__PURE__ */ jsx("span", { className: "help-zone-divider" }),
|
|
47
|
-
/* @__PURE__ */ jsx(ButtonBeta, { ref: questionButtonRef, className: "help-zone-question", "aria-label": t("help-zone.support.open"), color: "tertiary", variant: "ghost", onClick: handleOpenHelpZone, children: /* @__PURE__ */ jsx(Tooltip, { message: t("help-zone.support.open"), placement: "top", children: /* @__PURE__ */ jsx(SvgIconQuestion, { width: 24, height: 24, color: "white" }) }) })
|
|
48
|
-
] }), portalRoot);
|
|
49
|
-
};
|
|
50
|
-
export {
|
|
51
|
-
HelpZone as default
|
|
52
|
-
};
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { jsx } from "react/jsx-runtime";
|
|
2
|
-
import HelpZone from "./HelpZone.js";
|
|
3
|
-
import useZendeskGuide from "../../hooks/useZendeskGuide/useZendeskGuide.js";
|
|
4
|
-
function getHeaderColor() {
|
|
5
|
-
return getComputedStyle(document.documentElement).getPropertyValue("--primitive-blue-400").trim();
|
|
6
|
-
}
|
|
7
|
-
function HelpZoneContainer() {
|
|
8
|
-
const headerColor = getHeaderColor(), {
|
|
9
|
-
isReady,
|
|
10
|
-
isOpen,
|
|
11
|
-
open,
|
|
12
|
-
close
|
|
13
|
-
} = useZendeskGuide(headerColor);
|
|
14
|
-
return /* @__PURE__ */ jsx(HelpZone, { isReady, isOpen, onOpen: open, onClose: close });
|
|
15
|
-
}
|
|
16
|
-
export {
|
|
17
|
-
HelpZoneContainer
|
|
18
|
-
};
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { UsefulLink, UsefulLinkPayload } from '@edifice.io/client';
|
|
2
|
-
export interface LinkFormProps {
|
|
3
|
-
mode: 'add' | 'edit';
|
|
4
|
-
/** Link being edited. Ignored (and required to be undefined) in "add" mode. */
|
|
5
|
-
link?: UsefulLink;
|
|
6
|
-
isSubmitting: boolean;
|
|
7
|
-
/** Closes the form and goes back to the management modal, without saving. */
|
|
8
|
-
onCancel: () => void;
|
|
9
|
-
/** Closes the whole modal stack. */
|
|
10
|
-
onClose: () => void;
|
|
11
|
-
onSubmit: (payload: UsefulLinkPayload) => void;
|
|
12
|
-
}
|
|
13
|
-
export declare function LinkForm({ mode, link, isSubmitting, onCancel, onClose, onSubmit, }: LinkFormProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
|
-
import { useTranslation } from "react-i18next";
|
|
3
|
-
import { useForm } from "react-hook-form";
|
|
4
|
-
import ModalBeta from "../../../../components/ModalBeta/ModalBeta.js";
|
|
5
|
-
import FormControl from "../../../../components/Form/FormControl.js";
|
|
6
|
-
import Label from "../../../../components/Label/Label.js";
|
|
7
|
-
import Input from "../../../../components/Input/Input.js";
|
|
8
|
-
import ButtonBeta from "../../../../components/ButtonBeta/ButtonBeta.js";
|
|
9
|
-
const NAME_MAX_LENGTH = 80, URL_PATTERN = /^https?:\/\/.+/i;
|
|
10
|
-
function LinkForm({
|
|
11
|
-
mode,
|
|
12
|
-
link,
|
|
13
|
-
isSubmitting,
|
|
14
|
-
onCancel,
|
|
15
|
-
onClose,
|
|
16
|
-
onSubmit
|
|
17
|
-
}) {
|
|
18
|
-
const {
|
|
19
|
-
t
|
|
20
|
-
} = useTranslation(), formId = "useful-link-form", {
|
|
21
|
-
register,
|
|
22
|
-
handleSubmit,
|
|
23
|
-
formState: {
|
|
24
|
-
errors,
|
|
25
|
-
isDirty,
|
|
26
|
-
isValid
|
|
27
|
-
}
|
|
28
|
-
} = useForm({
|
|
29
|
-
mode: "onChange",
|
|
30
|
-
defaultValues: {
|
|
31
|
-
name: (link == null ? void 0 : link.name) ?? "",
|
|
32
|
-
url: (link == null ? void 0 : link.url) ?? ""
|
|
33
|
-
}
|
|
34
|
-
}), title = t(mode === "add" ? "homepage.usefulLinks.form.addTitle" : "homepage.usefulLinks.form.editTitle"), handleFormSubmit = (data) => {
|
|
35
|
-
onSubmit({
|
|
36
|
-
name: data.name.trim(),
|
|
37
|
-
url: data.url.trim()
|
|
38
|
-
});
|
|
39
|
-
};
|
|
40
|
-
return /* @__PURE__ */ jsxs(ModalBeta, { id: "useful-link-modal", isOpen: !0, size: "l", onModalClose: onClose, children: [
|
|
41
|
-
/* @__PURE__ */ jsx(ModalBeta.Header, { onModalClose: onClose, children: title }),
|
|
42
|
-
/* @__PURE__ */ jsx(ModalBeta.Body, { children: /* @__PURE__ */ jsxs("form", { id: formId, onSubmit: handleSubmit(handleFormSubmit), children: [
|
|
43
|
-
/* @__PURE__ */ jsxs(FormControl, { id: "useful-link-name", className: "mb-16", isRequired: !0, children: [
|
|
44
|
-
/* @__PURE__ */ jsx(Label, { children: t("homepage.usefulLinks.form.name") }),
|
|
45
|
-
/* @__PURE__ */ jsx(Input, { type: "text", size: "md", maxLength: NAME_MAX_LENGTH, showCounter: !0, clearable: !0, "data-testid": "usefullinks-input-name", placeholder: t("homepage.usefulLinks.form.name.placeholder"), ...register("name", {
|
|
46
|
-
required: !0,
|
|
47
|
-
maxLength: NAME_MAX_LENGTH
|
|
48
|
-
}) })
|
|
49
|
-
] }),
|
|
50
|
-
/* @__PURE__ */ jsxs(FormControl, { id: "useful-link-url", isRequired: !0, status: errors.url ? "invalid" : void 0, children: [
|
|
51
|
-
/* @__PURE__ */ jsx(Label, { children: t("homepage.usefulLinks.form.url") }),
|
|
52
|
-
/* @__PURE__ */ jsx(Input, { type: "text", size: "md", "data-testid": "usefullinks-input-url", placeholder: t("homepage.usefulLinks.form.url.placeholder"), ...register("url", {
|
|
53
|
-
required: !0,
|
|
54
|
-
pattern: URL_PATTERN
|
|
55
|
-
}) }),
|
|
56
|
-
errors.url && /* @__PURE__ */ jsx(FormControl.Text, { children: t("homepage.usefulLinks.form.url.error") })
|
|
57
|
-
] })
|
|
58
|
-
] }) }),
|
|
59
|
-
/* @__PURE__ */ jsxs(ModalBeta.Footer, { children: [
|
|
60
|
-
/* @__PURE__ */ jsx(ButtonBeta, { type: "button", variant: "ghost", color: "tertiary", "data-testid": "usefullinks-button-cancel", onClick: onCancel, children: t("homepage.usefulLinks.form.cancel") }),
|
|
61
|
-
/* @__PURE__ */ jsx(ButtonBeta, { form: formId, type: "submit", isLoading: isSubmitting, disabled: !isValid || !isDirty || isSubmitting, "data-testid": "usefullinks-button-save", children: t("homepage.usefulLinks.form.save") })
|
|
62
|
-
] })
|
|
63
|
-
] });
|
|
64
|
-
}
|
|
65
|
-
export {
|
|
66
|
-
LinkForm
|
|
67
|
-
};
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
|
-
import { useTranslation } from "react-i18next";
|
|
3
|
-
import illuEmptyUsefulLinks from "@edifice.io/bootstrap/dist/images/homepage/illu-empty-useful-links.png";
|
|
4
|
-
import SvgIconEdit from "../../../icons/components/IconEdit.js";
|
|
5
|
-
import HomeCard from "../HomeCard/HomeCard.js";
|
|
6
|
-
import Image from "../../../../components/Image/Image.js";
|
|
7
|
-
import Flex from "../../../../components/Flex/Flex.js";
|
|
8
|
-
import LinkPill from "../../../../components/LinkPill/LinkPill.js";
|
|
9
|
-
function UsefulLinks({
|
|
10
|
-
links,
|
|
11
|
-
onEditClick
|
|
12
|
-
}) {
|
|
13
|
-
const {
|
|
14
|
-
t
|
|
15
|
-
} = useTranslation();
|
|
16
|
-
return /* @__PURE__ */ jsxs(HomeCard, { variant: "primary", children: [
|
|
17
|
-
/* @__PURE__ */ jsx(HomeCard.Header, { title: t("homepage.usefulLinks.title"), actionLabel: t("homepage.usefulLinks.edit"), actionLeftIcon: /* @__PURE__ */ jsx(SvgIconEdit, {}), onActionClick: onEditClick, actionProps: {
|
|
18
|
-
"data-testid": "usefullinks-button-edit"
|
|
19
|
-
} }),
|
|
20
|
-
/* @__PURE__ */ jsx(HomeCard.Content, { children: links.length === 0 ? /* @__PURE__ */ jsxs("div", { className: "useful-links-widget__empty", children: [
|
|
21
|
-
/* @__PURE__ */ jsx(Image, { src: illuEmptyUsefulLinks, alt: "", "aria-hidden": "true", style: {
|
|
22
|
-
width: 160,
|
|
23
|
-
height: 87
|
|
24
|
-
} }),
|
|
25
|
-
/* @__PURE__ */ jsx("p", { className: "useful-links-widget__empty-text", children: t("homepage.usefulLinks.empty") })
|
|
26
|
-
] }) : /* @__PURE__ */ jsx(Flex, { direction: "column", gap: "8", children: links.map((link) => /* @__PURE__ */ jsx(LinkPill, { href: link.url, label: link.name, "data-testid": `usefullinks-link-${link.id}` }, link.id)) }) })
|
|
27
|
-
] });
|
|
28
|
-
}
|
|
29
|
-
export {
|
|
30
|
-
UsefulLinks
|
|
31
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function UsefulLinksContainer(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import { jsxs, Fragment, jsx } from "react/jsx-runtime";
|
|
2
|
-
import { useState } from "react";
|
|
3
|
-
import { useUsefulLinksContainer } from "./hooks/useUsefulLinksContainer.js";
|
|
4
|
-
import { LinkForm } from "./LinkForm.js";
|
|
5
|
-
import { UsefulLinks } from "./UsefulLinks.js";
|
|
6
|
-
import { UsefulLinksModal } from "./UsefulLinksModal.js";
|
|
7
|
-
function UsefulLinksContainer() {
|
|
8
|
-
const [view, setView] = useState({
|
|
9
|
-
name: "closed"
|
|
10
|
-
}), {
|
|
11
|
-
links,
|
|
12
|
-
canAddLink,
|
|
13
|
-
createLink,
|
|
14
|
-
isCreating,
|
|
15
|
-
updateLink,
|
|
16
|
-
isUpdating,
|
|
17
|
-
deleteLink
|
|
18
|
-
} = useUsefulLinksContainer(), closeAll = () => setView({
|
|
19
|
-
name: "closed"
|
|
20
|
-
}), backToManage = () => setView({
|
|
21
|
-
name: "manage"
|
|
22
|
-
}), handleSubmit = async (payload) => {
|
|
23
|
-
view.name === "edit" ? await updateLink(view.link.id, payload) : await createLink(payload), backToManage();
|
|
24
|
-
};
|
|
25
|
-
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
26
|
-
/* @__PURE__ */ jsx(UsefulLinks, { links, onEditClick: () => setView({
|
|
27
|
-
name: "manage"
|
|
28
|
-
}) }),
|
|
29
|
-
/* @__PURE__ */ jsx(UsefulLinksModal, { isOpen: view.name === "manage", links, canAddLink, onClose: closeAll, onAddClick: () => setView({
|
|
30
|
-
name: "add"
|
|
31
|
-
}), onEditLink: (link) => setView({
|
|
32
|
-
name: "edit",
|
|
33
|
-
link
|
|
34
|
-
}), onDeleteLink: deleteLink }),
|
|
35
|
-
(view.name === "add" || view.name === "edit") && /* @__PURE__ */ jsx(LinkForm, { mode: view.name, link: view.name === "edit" ? view.link : void 0, isSubmitting: view.name === "edit" ? isUpdating : isCreating, onCancel: backToManage, onClose: closeAll, onSubmit: handleSubmit })
|
|
36
|
-
] });
|
|
37
|
-
}
|
|
38
|
-
export {
|
|
39
|
-
UsefulLinksContainer
|
|
40
|
-
};
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { UsefulLink } from '@edifice.io/client';
|
|
2
|
-
export interface UsefulLinksModalProps {
|
|
3
|
-
isOpen: boolean;
|
|
4
|
-
links: UsefulLink[];
|
|
5
|
-
canAddLink: boolean;
|
|
6
|
-
onClose: () => void;
|
|
7
|
-
onAddClick: () => void;
|
|
8
|
-
onEditLink: (link: UsefulLink) => void;
|
|
9
|
-
onDeleteLink: (id: string) => void;
|
|
10
|
-
}
|
|
11
|
-
export declare function UsefulLinksModal({ isOpen, links, canAddLink, onClose, onAddClick, onEditLink, onDeleteLink, }: UsefulLinksModalProps): import("react/jsx-runtime").JSX.Element;
|