@edifice.io/react 2.6.0-develop-enabling.20260720144517 → 2.6.0-develop-pedago.20260721150256
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/Badge/Badge.d.ts +24 -13
- package/dist/components/Badge/Badge.js +6 -6
- package/dist/components/Layout/Layout.js +3 -10
- package/dist/components/PageLayout/store/overlayStore.js +1 -1
- package/dist/hooks/index.d.ts +0 -1
- package/dist/index.js +20 -24
- package/dist/modules/homepage/components/Header/Header.d.ts +1 -3
- package/dist/modules/homepage/components/Header/Header.js +2 -3
- package/dist/providers/MockedProvider/MockedProvider.js +3 -4
- package/dist/utilities/create-selectors/createSelectors.d.ts +10 -0
- package/dist/utilities/index.d.ts +0 -1
- package/package.json +6 -6
- package/dist/components/Layout/components/HeaderNotificationsOverlay.d.ts +0 -5
- package/dist/components/Layout/components/HeaderNotificationsOverlay.js +0 -18
- package/dist/hooks/useUiOverride/index.d.ts +0 -1
- package/dist/hooks/useUiOverride/useUiOverride.d.ts +0 -5
- package/dist/hooks/useUiOverride/useUiOverride.js +0 -13
- package/dist/utilities/create-selectors/create-selectors.d.ts +0 -37
- package/dist/utilities/create-selectors/index.d.ts +0 -1
- /package/dist/utilities/create-selectors/{create-selectors.js → createSelectors.js} +0 -0
|
@@ -6,6 +6,11 @@ export type NotificationBadgeVariant = {
|
|
|
6
6
|
type: 'notification';
|
|
7
7
|
level: 'success' | 'warning' | 'danger' | 'info';
|
|
8
8
|
};
|
|
9
|
+
/** Badge variant : status */
|
|
10
|
+
export type StatusBadgeVariant = {
|
|
11
|
+
type: 'status';
|
|
12
|
+
level: 'validate' | 'success' | 'warning' | 'danger' | 'info';
|
|
13
|
+
};
|
|
9
14
|
/** Badge variant : content */
|
|
10
15
|
export type ContentBadgeVariant = {
|
|
11
16
|
type: 'content';
|
|
@@ -27,22 +32,29 @@ export type LinkBadgeVariant = {
|
|
|
27
32
|
type: 'link';
|
|
28
33
|
};
|
|
29
34
|
/**
|
|
30
|
-
* Badge variant :
|
|
31
|
-
*
|
|
32
|
-
*
|
|
33
|
-
*
|
|
34
|
-
*
|
|
35
|
-
*
|
|
36
|
-
*
|
|
37
|
-
*
|
|
38
|
-
*
|
|
35
|
+
* Badge variant : App Version.
|
|
36
|
+
*
|
|
37
|
+
* Displays a badge showing the app version, for example: BÊTA, ALPHA, NEW or a custom version label.
|
|
38
|
+
*
|
|
39
|
+
* Default label is BÊTA unless a label is provided as a children of the component.
|
|
40
|
+
* Example of usage:
|
|
41
|
+
* <Badge variant={{ type: 'appVersion', app: myApp }}>NEW</Badge>
|
|
42
|
+
*
|
|
43
|
+
* The color prop allows to customize the badge color to match the app color (Defaults to black if not provided).
|
|
44
|
+
* Example of usage:
|
|
45
|
+
* <Badge variant={{ type: 'appVersion', color: '#823AA1' }} />
|
|
46
|
+
*
|
|
47
|
+
* If app prop is provided, the color of the App Version Badge is derived from the application colors,
|
|
48
|
+
* for example if the app provided is Blog then the Badge will have the same color as Blog app.
|
|
49
|
+
* Example of usage:
|
|
50
|
+
* <Badge variant={{ type: 'appVersion', app: blog }} />
|
|
39
51
|
*/
|
|
40
|
-
export type
|
|
41
|
-
type: '
|
|
52
|
+
export type AppVersionBadgeVariant = {
|
|
53
|
+
type: 'appVersion';
|
|
42
54
|
color?: string;
|
|
43
55
|
app?: IWebApp;
|
|
44
56
|
};
|
|
45
|
-
export type BadgeVariants = NotificationBadgeVariant | ContentBadgeVariant | ProfileBadgeVariant | ChipBadgeVariant | LinkBadgeVariant |
|
|
57
|
+
export type BadgeVariants = NotificationBadgeVariant | StatusBadgeVariant | ContentBadgeVariant | ProfileBadgeVariant | ChipBadgeVariant | LinkBadgeVariant | AppVersionBadgeVariant;
|
|
46
58
|
export interface BadgeProps extends React.ComponentPropsWithRef<'span'> {
|
|
47
59
|
/**
|
|
48
60
|
* Badge variant : notification, link or profile (Teacher|Student|Relative|Personnel)
|
|
@@ -51,7 +63,6 @@ export interface BadgeProps extends React.ComponentPropsWithRef<'span'> {
|
|
|
51
63
|
variant?: BadgeVariants;
|
|
52
64
|
/**
|
|
53
65
|
* Text or icon (or whatever) to render as children elements.
|
|
54
|
-
* Defaults to 'BÊTA' for beta variant.
|
|
55
66
|
*/
|
|
56
67
|
children?: ReactNode;
|
|
57
68
|
/**
|
|
@@ -16,16 +16,16 @@ const Badge = /* @__PURE__ */ forwardRef(({
|
|
|
16
16
|
getBackgroundLightIconClass,
|
|
17
17
|
getBorderIconClass
|
|
18
18
|
} = useEdificeIcons();
|
|
19
|
-
let
|
|
20
|
-
if (variant.type === "
|
|
19
|
+
let appVersionBadgeColorClassName = "";
|
|
20
|
+
if (variant.type === "appVersion" && variant.app) {
|
|
21
21
|
const colorAppClassName = getIconClass(variant.app), backgroundLightAppClassName = getBackgroundLightIconClass(variant.app), borderAppClassName = getBorderIconClass(variant.app);
|
|
22
|
-
|
|
22
|
+
appVersionBadgeColorClassName = `${colorAppClassName} ${backgroundLightAppClassName} ${borderAppClassName}`;
|
|
23
23
|
}
|
|
24
|
-
const classes = clsx("badge rounded-pill", (variant.type === "content" || variant.type === "user") && "background" in variant ? "bg-gray-200" : (variant.type === "content" || variant.type === "user") && !("background" in variant) ? "border border-0" : "", variant.type === "content" && `text-${variant.level}`, variant.type === "notification" && `badge-notification bg-${variant.level} text-light border border-0`, variant.type === "user" && `badge-profile-${variant.profile.toLowerCase()}`, variant.type === "link" && "badge-link border border-0", variant.type === "chip" && "bg-gray-200", variant.type === "
|
|
24
|
+
const classes = clsx("badge rounded-pill", (variant.type === "content" || variant.type === "user") && "background" in variant ? "bg-gray-200" : (variant.type === "content" || variant.type === "user") && !("background" in variant) ? "border border-0" : "", variant.type === "content" && `text-${variant.level}`, variant.type === "notification" && `badge-notification bg-${variant.level} text-light border border-0`, variant.type === "status" && `badge-status badge-status-${variant.level} caption fw-normal`, variant.type === "user" && `badge-profile-${variant.profile.toLowerCase()}`, variant.type === "link" && "badge-link border border-0", variant.type === "chip" && "bg-gray-200", variant.type === "appVersion" && appVersionBadgeColorClassName, className);
|
|
25
25
|
return /* @__PURE__ */ jsxs("span", { ref, className: classes, ...restProps, children: [
|
|
26
26
|
variant.type === "chip" && /* @__PURE__ */ jsx("div", { className: "d-flex fw-800 align-items-center", children }),
|
|
27
|
-
variant.type === "
|
|
28
|
-
variant.type !== "chip" && variant.type !== "
|
|
27
|
+
variant.type === "appVersion" && (children ?? "BÊTA"),
|
|
28
|
+
variant.type !== "chip" && variant.type !== "appVersion" && children
|
|
29
29
|
] });
|
|
30
30
|
});
|
|
31
31
|
export {
|
|
@@ -1,19 +1,15 @@
|
|
|
1
1
|
import { jsx, jsxs, Fragment } from "react/jsx-runtime";
|
|
2
|
-
import { Suspense, lazy } from "react";
|
|
3
2
|
import clsx from "clsx";
|
|
4
3
|
import { Toaster } from "react-hot-toast";
|
|
5
4
|
import { useTranslation } from "react-i18next";
|
|
6
5
|
import { useEdificeTheme } from "../../providers/EdificeThemeProvider/EdificeThemeProvider.hook.js";
|
|
7
6
|
import Header from "./components/Header.js";
|
|
8
|
-
import HeaderNotificationsOverlay from "./components/HeaderNotificationsOverlay.js";
|
|
9
|
-
import { useOverlay } from "../PageLayout/hook/useOverlay.js";
|
|
10
|
-
import useUiOverride from "../../hooks/useUiOverride/useUiOverride.js";
|
|
11
7
|
import useCookiesConsent from "../../hooks/useCookiesConsent/useCookiesConsent.js";
|
|
12
8
|
import useZendeskGuide from "../../hooks/useZendeskGuide/useZendeskGuide.js";
|
|
13
9
|
import useCantoo from "../../hooks/useCantoo/useCantoo.js";
|
|
14
10
|
import Alert from "../Alert/Alert.js";
|
|
15
11
|
import Button from "../Button/Button.js";
|
|
16
|
-
const
|
|
12
|
+
const Layout = ({
|
|
17
13
|
children,
|
|
18
14
|
headless = !1,
|
|
19
15
|
whiteBg = !0,
|
|
@@ -22,9 +18,7 @@ const HeaderV2 = /* @__PURE__ */ lazy(() => import("../../modules/homepage/compo
|
|
|
22
18
|
}) => {
|
|
23
19
|
const {
|
|
24
20
|
theme
|
|
25
|
-
} = useEdificeTheme(),
|
|
26
|
-
toggleOverlay
|
|
27
|
-
} = useOverlay(), {
|
|
21
|
+
} = useEdificeTheme(), {
|
|
28
22
|
t
|
|
29
23
|
} = useTranslation(), {
|
|
30
24
|
showCookiesConsent,
|
|
@@ -37,12 +31,11 @@ const HeaderV2 = /* @__PURE__ */ lazy(() => import("../../modules/homepage/compo
|
|
|
37
31
|
"container-fluid": !headless,
|
|
38
32
|
"rounded-4 border": (theme == null ? void 0 : theme.is1d) && !headless,
|
|
39
33
|
"mt-24": (theme == null ? void 0 : theme.is1d) && !headless
|
|
40
|
-
}, className), renderHeader = headless ? null :
|
|
34
|
+
}, className), renderHeader = headless ? null : /* @__PURE__ */ jsx(Header, { is1d: theme == null ? void 0 : theme.is1d, src: theme == null ? void 0 : theme.basePath }), renderCookies = showCookiesConsent && /* @__PURE__ */ jsx(Alert, { type: "info", className: "m-12 rgpd", isConfirm: !0, position: "bottom-right", button: /* @__PURE__ */ jsx(Button, { color: "tertiary", variant: "ghost", onClick: handleConsultCookies, children: t("rgpd.cookies.banner.button.consult") }), onClose: handleCloseCookiesConsent, children: t("rgpd.cookies.banner.text1") }), renderToaster = /* @__PURE__ */ jsx(Toaster, { containerClassName: "toaster-container", toastOptions: {
|
|
41
35
|
position: "top-right"
|
|
42
36
|
} });
|
|
43
37
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
44
38
|
renderHeader,
|
|
45
|
-
renderNotificationsOverlay,
|
|
46
39
|
/* @__PURE__ */ jsx("main", { className: classes, ...restProps, children }),
|
|
47
40
|
renderToaster,
|
|
48
41
|
renderCookies
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { create } from "zustand";
|
|
2
|
-
import { createSelectors } from "../../../utilities/create-selectors/
|
|
2
|
+
import { createSelectors } from "../../../utilities/create-selectors/createSelectors.js";
|
|
3
3
|
const useOverlayStore = createSelectors(create((set) => ({
|
|
4
4
|
overlayOpen: !1,
|
|
5
5
|
updateOverlayOpen: (value) => set((previousState) => ({
|
package/dist/hooks/index.d.ts
CHANGED
|
@@ -30,7 +30,6 @@ export * from './useToast';
|
|
|
30
30
|
export * from './useToggle';
|
|
31
31
|
export * from './useTrapFocus';
|
|
32
32
|
export * from './useTrashedResource';
|
|
33
|
-
export * from './useUiOverride';
|
|
34
33
|
export * from './useUpload';
|
|
35
34
|
export * from './useUploadFiles';
|
|
36
35
|
export * from './useUser';
|
package/dist/index.js
CHANGED
|
@@ -106,17 +106,16 @@ import { default as default104 } from "./hooks/useToast/useToast.js";
|
|
|
106
106
|
import { default as default105 } from "./hooks/useToggle/useToggle.js";
|
|
107
107
|
import { default as default106 } from "./hooks/useTrapFocus/useTrapFocus.js";
|
|
108
108
|
import { default as default107 } from "./hooks/useTrashedResource/useTrashedResource.js";
|
|
109
|
-
import { default as default108 } from "./hooks/
|
|
110
|
-
import { default as default109 } from "./
|
|
111
|
-
import { default as default110 } from "./hooks/
|
|
112
|
-
import { default as default111 } from "./hooks/
|
|
113
|
-
import { default as default112 } from "./hooks/
|
|
114
|
-
import { default as default113 } from "./hooks/
|
|
115
|
-
import { default as default114 } from "./hooks/useWorkspaceFolders/
|
|
116
|
-
import {
|
|
117
|
-
import { default as default116 } from "./hooks/
|
|
118
|
-
import { default as default117 } from "./hooks/
|
|
119
|
-
import { default as default118 } from "./hooks/useZendeskGuide/useZendeskGuide.js";
|
|
109
|
+
import { default as default108 } from "./modules/modals/ResourceModal/hooks/useUpdateMutation.js";
|
|
110
|
+
import { default as default109 } from "./hooks/useUpload/useUpload.js";
|
|
111
|
+
import { default as default110 } from "./hooks/useUploadFiles/useUploadFiles.js";
|
|
112
|
+
import { default as default111 } from "./hooks/useUser/useUser.js";
|
|
113
|
+
import { default as default112 } from "./hooks/useWorkspaceFile/useWorkspaceFile.js";
|
|
114
|
+
import { default as default113 } from "./hooks/useWorkspaceFolders/useWorkspaceFolders.js";
|
|
115
|
+
import { WORKSPACE_SHARED_FOLDER_ID, WORKSPACE_USER_FOLDER_ID, default as default114 } from "./hooks/useWorkspaceFolders/useWorkspaceFoldersTree.js";
|
|
116
|
+
import { default as default115 } from "./hooks/useWorkspaceSearch/useWorkspaceSearch.js";
|
|
117
|
+
import { default as default116 } from "./hooks/useXitiTrackPageLoad/useXitiTrackPageLoad.js";
|
|
118
|
+
import { default as default117 } from "./hooks/useZendeskGuide/useZendeskGuide.js";
|
|
120
119
|
import { AccessiblePalette, DefaultPalette } from "./components/ColorPicker/ColorPalette.js";
|
|
121
120
|
import { AntProvider } from "./providers/AntThemeProvider/AntProvider.js";
|
|
122
121
|
import { BetaSwitch } from "./components/BetaSwitch/BetaSwitch.js";
|
|
@@ -147,7 +146,6 @@ import { UserSearch } from "./components/UserSearch/UserSearch.js";
|
|
|
147
146
|
import { VisibleType } from "./components/UserSearch/types/visible.js";
|
|
148
147
|
import { buildTree, determineNewParentId, findItemIndexInTree, flattenNodes, flattenTree, generateUpdateData, getActiveAndOverNodes, getDragDepth, getIndicesToUpdate, getProjection, updateParentIds } from "./components/Tree/utilities/tree-sortable.js";
|
|
149
148
|
import { checkUserRight } from "./utilities/check-user-rights/check-user-rights.js";
|
|
150
|
-
import { createSelectors } from "./utilities/create-selectors/create-selectors.js";
|
|
151
149
|
import { emptyScreenMapping } from "./utilities/emptyscreen-mapping/emptyscreen-mapping.js";
|
|
152
150
|
import { getRotateTransitionStyle } from "./utilities/rotate-transition-style/get-rotate-transition-style.js";
|
|
153
151
|
import { invalidateQueriesWithFirstPage } from "./utilities/react-query/react-query-utils.js";
|
|
@@ -278,7 +276,6 @@ export {
|
|
|
278
276
|
arrayUnique,
|
|
279
277
|
buildTree,
|
|
280
278
|
checkUserRight,
|
|
281
|
-
createSelectors,
|
|
282
279
|
deleteNode,
|
|
283
280
|
determineNewParentId,
|
|
284
281
|
emptyScreenMapping,
|
|
@@ -345,16 +342,15 @@ export {
|
|
|
345
342
|
default107 as useTrashedResource,
|
|
346
343
|
useTreeSortable,
|
|
347
344
|
useTreeView,
|
|
348
|
-
default108 as
|
|
349
|
-
default109 as
|
|
350
|
-
default110 as
|
|
351
|
-
default111 as
|
|
352
|
-
default112 as
|
|
353
|
-
default113 as
|
|
354
|
-
default114 as
|
|
355
|
-
default115 as
|
|
356
|
-
default116 as
|
|
357
|
-
default117 as
|
|
358
|
-
default118 as useZendeskGuide,
|
|
345
|
+
default108 as useUpdateMutation,
|
|
346
|
+
default109 as useUpload,
|
|
347
|
+
default110 as useUploadFiles,
|
|
348
|
+
default111 as useUser,
|
|
349
|
+
default112 as useWorkspaceFile,
|
|
350
|
+
default113 as useWorkspaceFolders,
|
|
351
|
+
default114 as useWorkspaceFoldersTree,
|
|
352
|
+
default115 as useWorkspaceSearch,
|
|
353
|
+
default116 as useXitiTrackPageLoad,
|
|
354
|
+
default117 as useZendeskGuide,
|
|
359
355
|
wrapTreeNode
|
|
360
356
|
};
|
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
export interface HeaderProps {
|
|
2
2
|
src: string | undefined;
|
|
3
3
|
onNotificationsClick?: () => void;
|
|
4
|
-
/** Scope this header's CSS theme (`data-product`) to its own subtree, independently of the page's ambient theme. */
|
|
5
|
-
dataProduct?: string;
|
|
6
4
|
}
|
|
7
5
|
declare const Header: {
|
|
8
|
-
({ src, onNotificationsClick,
|
|
6
|
+
({ src, onNotificationsClick, }: HeaderProps): JSX.Element;
|
|
9
7
|
displayName: string;
|
|
10
8
|
};
|
|
11
9
|
export default Header;
|
|
@@ -25,8 +25,7 @@ import Avatar from "../../../../components/Avatar/Avatar.js";
|
|
|
25
25
|
import { Popover, PopoverBody } from "../../../../components/Popover/Popover.js";
|
|
26
26
|
const Header = ({
|
|
27
27
|
src = "",
|
|
28
|
-
onNotificationsClick
|
|
29
|
-
dataProduct
|
|
28
|
+
onNotificationsClick
|
|
30
29
|
}) => {
|
|
31
30
|
const {
|
|
32
31
|
t
|
|
@@ -48,7 +47,7 @@ const Header = ({
|
|
|
48
47
|
} = useEdificeTheme(), hasMessages = messages > 0, [userRef, isUserHovered] = useHover(), popoverUserId = useId(), handleNotificationsClick = () => {
|
|
49
48
|
onNotificationsClick == null || onNotificationsClick();
|
|
50
49
|
};
|
|
51
|
-
return /* @__PURE__ */ jsx("header", { className: classes,
|
|
50
|
+
return /* @__PURE__ */ jsx("header", { className: classes, children: /* @__PURE__ */ jsxs(Navbar, { className: "px-24", children: [
|
|
52
51
|
/* @__PURE__ */ jsx(LogoBeta, { src: `${src}/img/illustrations/logo.png` }),
|
|
53
52
|
/* @__PURE__ */ jsxs("ul", { className: "navbar-nav", children: [
|
|
54
53
|
/* @__PURE__ */ jsx(NavItem, { children: /* @__PURE__ */ jsx(NavLink, { link: "/timeline/timeline", translate: t("navbar.home"), "data-testid": "header-home-button", children: /* @__PURE__ */ jsx(SvgIconHomeBeta, {}) }) }),
|
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
3
|
-
import { useState } from "react";
|
|
2
|
+
import { QueryClientProvider, QueryClient } from "@tanstack/react-query";
|
|
4
3
|
import { EdificeClientContext } from "../EdificeClientProvider/EdificeClientProvider.context.js";
|
|
5
4
|
import { EdificeThemeContext } from "../EdificeThemeProvider/EdificeThemeProvider.context.js";
|
|
6
5
|
import { mockQueryResult, mockSession, mockConf } from "./MockedProvider.mocks.js";
|
|
7
|
-
const MockedProvider = ({
|
|
6
|
+
const queryClient = new QueryClient(), MockedProvider = ({
|
|
8
7
|
children
|
|
9
8
|
}) => {
|
|
10
|
-
const
|
|
9
|
+
const themeContextValue = {
|
|
11
10
|
theme: "default",
|
|
12
11
|
setTheme: vi.fn()
|
|
13
12
|
}, clientContextValue = {
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { StoreApi, UseBoundStore } from 'zustand';
|
|
2
|
+
type WithSelectors<S> = S extends {
|
|
3
|
+
getState: () => infer T;
|
|
4
|
+
} ? S & {
|
|
5
|
+
use: {
|
|
6
|
+
[K in keyof T]: () => T[K];
|
|
7
|
+
};
|
|
8
|
+
} : never;
|
|
9
|
+
export declare const createSelectors: <S extends UseBoundStore<StoreApi<object>>>(_store: S) => WithSelectors<S>;
|
|
10
|
+
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@edifice.io/react",
|
|
3
|
-
"version": "2.6.0-develop-
|
|
3
|
+
"version": "2.6.0-develop-pedago.20260721150256",
|
|
4
4
|
"description": "Edifice React Library",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react",
|
|
@@ -140,9 +140,9 @@
|
|
|
140
140
|
"swiper": "10.1.0",
|
|
141
141
|
"ua-parser-js": "1.0.36",
|
|
142
142
|
"zustand": "4.5.7",
|
|
143
|
-
"@edifice.io/bootstrap": "2.6.0-develop-
|
|
144
|
-
"@edifice.io/
|
|
145
|
-
"@edifice.io/
|
|
143
|
+
"@edifice.io/bootstrap": "2.6.0-develop-pedago.20260721150256",
|
|
144
|
+
"@edifice.io/tiptap-extensions": "2.6.0-develop-pedago.20260721150256",
|
|
145
|
+
"@edifice.io/utilities": "2.6.0-develop-pedago.20260721150256"
|
|
146
146
|
},
|
|
147
147
|
"devDependencies": {
|
|
148
148
|
"@babel/plugin-transform-react-pure-annotations": "7.27.1",
|
|
@@ -173,8 +173,8 @@
|
|
|
173
173
|
"vite": "5.4.14",
|
|
174
174
|
"vite-plugin-dts": "4.5.4",
|
|
175
175
|
"vite-tsconfig-paths": "5.1.4",
|
|
176
|
-
"@edifice.io/client": "2.6.0-develop-
|
|
177
|
-
"@edifice.io/config": "2.6.0-develop-
|
|
176
|
+
"@edifice.io/client": "2.6.0-develop-pedago.20260721150256",
|
|
177
|
+
"@edifice.io/config": "2.6.0-develop-pedago.20260721150256"
|
|
178
178
|
},
|
|
179
179
|
"peerDependencies": {
|
|
180
180
|
"@react-spring/web": "9.7.5",
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { jsx } from "react/jsx-runtime";
|
|
2
|
-
import { NotificationListContainer } from "../../../modules/homepage/components/Notifications/NotificationListContainer.js";
|
|
3
|
-
import PageLayoutOverlay from "../../PageLayout/components/PageLayoutOverlay.js";
|
|
4
|
-
import { useOverlay } from "../../PageLayout/hook/useOverlay.js";
|
|
5
|
-
const HeaderNotificationsOverlay = () => {
|
|
6
|
-
const {
|
|
7
|
-
isOverlayOpen,
|
|
8
|
-
updateOverlayOpen
|
|
9
|
-
} = useOverlay(), handleClose = () => updateOverlayOpen(!1);
|
|
10
|
-
return (
|
|
11
|
-
// NotificationList renders its own header with a close button, so
|
|
12
|
-
// PageLayoutOverlay's default close button would be redundant (double X).
|
|
13
|
-
/* @__PURE__ */ jsx(PageLayoutOverlay, { onClose: handleClose, closeButton: !1, children: isOverlayOpen && /* @__PURE__ */ jsx(NotificationListContainer, { onCloseNotifications: handleClose }) })
|
|
14
|
-
);
|
|
15
|
-
};
|
|
16
|
-
export {
|
|
17
|
-
HeaderNotificationsOverlay as default
|
|
18
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default as useUiOverride } from './useUiOverride';
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { useEdificeTheme } from "../../providers/EdificeThemeProvider/EdificeThemeProvider.hook.js";
|
|
2
|
-
function useUiOverride(key) {
|
|
3
|
-
var _a;
|
|
4
|
-
const {
|
|
5
|
-
theme
|
|
6
|
-
} = useEdificeTheme(), raw = (_a = theme == null ? void 0 : theme.uiOverrides) == null ? void 0 : _a[key];
|
|
7
|
-
return typeof raw == "string" ? {
|
|
8
|
-
variant: raw
|
|
9
|
-
} : raw;
|
|
10
|
-
}
|
|
11
|
-
export {
|
|
12
|
-
useUiOverride as default
|
|
13
|
-
};
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import { StoreApi, UseBoundStore } from 'zustand';
|
|
2
|
-
type WithSelectors<S> = S extends {
|
|
3
|
-
getState: () => infer T;
|
|
4
|
-
} ? S & {
|
|
5
|
-
use: {
|
|
6
|
-
[K in keyof T]: () => T[K];
|
|
7
|
-
};
|
|
8
|
-
} : never;
|
|
9
|
-
/**
|
|
10
|
-
* Augments a Zustand store with auto-generated, per-field selector hooks,
|
|
11
|
-
* so consumers can call `store.use.myValue()` instead of
|
|
12
|
-
* `store((s) => s.myValue)` and never forget a selector.
|
|
13
|
-
*
|
|
14
|
-
* Pattern from the Zustand docs:
|
|
15
|
-
* https://zustand.docs.pmnd.rs/guides/auto-generating-selectors
|
|
16
|
-
*
|
|
17
|
-
* @param _store - The bound store to augment.
|
|
18
|
-
* @returns The same store instance, mutated with a `use` object exposing one
|
|
19
|
-
* selector hook per state key.
|
|
20
|
-
*
|
|
21
|
-
* @remarks
|
|
22
|
-
* - The store is mutated in place; the returned reference is the input store.
|
|
23
|
-
* - Selectors are generated once, from the keys present at call time. Fields
|
|
24
|
-
* added to the state later won't get a `use.<key>` selector.
|
|
25
|
-
*
|
|
26
|
-
* @example
|
|
27
|
-
* ```ts
|
|
28
|
-
* const useBearStore = createSelectors(
|
|
29
|
-
* create<BearState>(() => ({ bears: 0 })),
|
|
30
|
-
* );
|
|
31
|
-
*
|
|
32
|
-
* // In a component:
|
|
33
|
-
* const bears = useBearStore.use.bears();
|
|
34
|
-
* ```
|
|
35
|
-
*/
|
|
36
|
-
export declare const createSelectors: <S extends UseBoundStore<StoreApi<object>>>(_store: S) => WithSelectors<S>;
|
|
37
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './create-selectors';
|
|
File without changes
|