@edifice.io/react 2.6.5-develop-b2school.20260917151240 → 2.6.5-develop-b2school.20260917163248
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/Layout.js +10 -5
- package/dist/components/PageLayout/components/PageLayoutContent.js +5 -1
- package/dist/hooks/index.d.ts +1 -0
- package/dist/hooks/useBackground/index.d.ts +1 -0
- package/dist/hooks/useBackground/useBackground.d.ts +7 -0
- package/dist/hooks/useBackground/useBackground.js +16 -0
- package/dist/hooks/useUserPreferences/useUserPreferences.js +1 -0
- package/dist/index.js +4 -2
- package/package.json +6 -6
|
@@ -4,10 +4,11 @@ import clsx from "clsx";
|
|
|
4
4
|
import { Toaster } from "react-hot-toast";
|
|
5
5
|
import { useTranslation } from "react-i18next";
|
|
6
6
|
import { useEdificeTheme } from "../../providers/EdificeThemeProvider/EdificeThemeProvider.hook.js";
|
|
7
|
+
import { useOverlay } from "../PageLayout/hook/useOverlay.js";
|
|
7
8
|
import Header from "./components/Header.js";
|
|
8
9
|
import HeaderNotificationsOverlay from "./components/HeaderNotificationsOverlay.js";
|
|
9
|
-
import { useOverlay } from "../PageLayout/hook/useOverlay.js";
|
|
10
10
|
import useUiOverride from "../../hooks/useUiOverride/useUiOverride.js";
|
|
11
|
+
import useBackground from "../../hooks/useBackground/useBackground.js";
|
|
11
12
|
import useCookiesConsent from "../../hooks/useCookiesConsent/useCookiesConsent.js";
|
|
12
13
|
import useZendeskGuide from "../../hooks/useZendeskGuide/useZendeskGuide.js";
|
|
13
14
|
import useCantoo from "../../hooks/useCantoo/useCantoo.js";
|
|
@@ -22,7 +23,11 @@ const HeaderV2 = /* @__PURE__ */ lazy(() => import("../../modules/homepage/compo
|
|
|
22
23
|
}) => {
|
|
23
24
|
const {
|
|
24
25
|
theme
|
|
25
|
-
} = useEdificeTheme(), override = useUiOverride("layout.header"), isHeaderV2 = (override == null ? void 0 : override.variant) === "v2",
|
|
26
|
+
} = useEdificeTheme(), override = useUiOverride("layout.header"), isHeaderV2 = (override == null ? void 0 : override.variant) === "v2", {
|
|
27
|
+
productOverride,
|
|
28
|
+
background,
|
|
29
|
+
isBackgroundImageOverridden
|
|
30
|
+
} = useBackground(), {
|
|
26
31
|
toggleOverlay
|
|
27
32
|
} = useOverlay(), {
|
|
28
33
|
t
|
|
@@ -40,9 +45,9 @@ const HeaderV2 = /* @__PURE__ */ lazy(() => import("../../modules/homepage/compo
|
|
|
40
45
|
}, className), renderHeader = headless ? null : isHeaderV2 ? /* @__PURE__ */ jsx(Suspense, { fallback: null, children: /* @__PURE__ */ jsx(HeaderV2, { src: theme == null ? void 0 : theme.basePath, dataProduct: override == null ? void 0 : override.theme, onNotificationsClick: toggleOverlay }) }) : /* @__PURE__ */ jsx(Header, { is1d: theme == null ? void 0 : theme.is1d, src: theme == null ? void 0 : theme.basePath }), renderNotificationsOverlay = !headless && isHeaderV2 && /* @__PURE__ */ jsx(HeaderNotificationsOverlay, {}), 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
46
|
position: "top-right"
|
|
42
47
|
} });
|
|
43
|
-
return /* @__PURE__ */ jsxs("div", { className: clsx("layout", {
|
|
44
|
-
"layout-has-background-image":
|
|
45
|
-
}),
|
|
48
|
+
return /* @__PURE__ */ jsxs("div", { "data-product": productOverride, "data-background": background, className: clsx("layout", {
|
|
49
|
+
"layout-has-background-image": isBackgroundImageOverridden
|
|
50
|
+
}), children: [
|
|
46
51
|
renderHeader,
|
|
47
52
|
renderNotificationsOverlay,
|
|
48
53
|
/* @__PURE__ */ jsx("main", { className: classes, ...restProps, children }),
|
|
@@ -1,15 +1,19 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
2
|
import clsx from "clsx";
|
|
3
3
|
import { usePageLayout } from "../PageLayoutContext.js";
|
|
4
|
+
import useBackground from "../../../hooks/useBackground/useBackground.js";
|
|
4
5
|
const PageLayoutContent = ({
|
|
5
6
|
children,
|
|
6
7
|
className,
|
|
7
8
|
...props
|
|
8
9
|
}) => {
|
|
9
10
|
const {
|
|
11
|
+
productOverride,
|
|
12
|
+
background
|
|
13
|
+
} = useBackground(), {
|
|
10
14
|
noPadding
|
|
11
15
|
} = usePageLayout();
|
|
12
|
-
return /* @__PURE__ */ jsx("main", { className: clsx("pagelayout-content", {
|
|
16
|
+
return /* @__PURE__ */ jsx("main", { "data-product": productOverride, "data-background": background, className: clsx("pagelayout-content", {
|
|
13
17
|
"pagelayout-content--no-padding": noPadding == null ? void 0 : noPadding.content
|
|
14
18
|
}, className), ...props, children });
|
|
15
19
|
};
|
package/dist/hooks/index.d.ts
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as useBackground, type Background } from './useBackground';
|
|
@@ -0,0 +1,7 @@
|
|
|
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;
|
|
@@ -0,0 +1,16 @@
|
|
|
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
|
+
};
|
package/dist/index.js
CHANGED
|
@@ -154,6 +154,7 @@ import { emptyScreenMapping } from "./utilities/emptyscreen-mapping/emptyscreen-
|
|
|
154
154
|
import { getRotateTransitionStyle } from "./utilities/rotate-transition-style/get-rotate-transition-style.js";
|
|
155
155
|
import { invalidateQueriesWithFirstPage } from "./utilities/react-query/react-query-utils.js";
|
|
156
156
|
import { mergeRefs, setRef } from "./utilities/refs/ref.js";
|
|
157
|
+
import { default as default121 } from "./hooks/useBackground/useBackground.js";
|
|
157
158
|
import { useCheckable } from "./hooks/useCheckable/useCheckable.js";
|
|
158
159
|
import { useEdificeClient } from "./providers/EdificeClientProvider/EdificeClientProvider.hook.js";
|
|
159
160
|
import { useEdificeTheme } from "./providers/EdificeThemeProvider/EdificeThemeProvider.hook.js";
|
|
@@ -162,7 +163,7 @@ import { useOverlay } from "./components/PageLayout/hook/useOverlay.js";
|
|
|
162
163
|
import { useScreeb } from "./hooks/useScreeb/useScreeb.js";
|
|
163
164
|
import { useTreeSortable } from "./components/Tree/hooks/useTreeSortable.js";
|
|
164
165
|
import { useTreeView } from "./components/TreeView/hooks/useTreeView.js";
|
|
165
|
-
import {
|
|
166
|
+
import { default as default122 } from "./hooks/useUserPreferences/useUserPreferences.js";
|
|
166
167
|
export {
|
|
167
168
|
AccessiblePalette,
|
|
168
169
|
default2 as ActionBar,
|
|
@@ -309,6 +310,7 @@ export {
|
|
|
309
310
|
setRef,
|
|
310
311
|
updateNode,
|
|
311
312
|
updateParentIds,
|
|
313
|
+
default121 as useBackground,
|
|
312
314
|
default79 as useBookmark,
|
|
313
315
|
default80 as useBreakpoint,
|
|
314
316
|
default81 as useBrowserInfo,
|
|
@@ -355,7 +357,7 @@ export {
|
|
|
355
357
|
default112 as useUpload,
|
|
356
358
|
default113 as useUploadFiles,
|
|
357
359
|
default114 as useUser,
|
|
358
|
-
useUserPreferences,
|
|
360
|
+
default122 as useUserPreferences,
|
|
359
361
|
default115 as useWorkspaceFile,
|
|
360
362
|
default116 as useWorkspaceFolders,
|
|
361
363
|
default117 as useWorkspaceFoldersTree,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@edifice.io/react",
|
|
3
|
-
"version": "2.6.5-develop-b2school.
|
|
3
|
+
"version": "2.6.5-develop-b2school.20260917163248",
|
|
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.5-develop-b2school.
|
|
144
|
-
"@edifice.io/tiptap-extensions": "2.6.5-develop-b2school.
|
|
145
|
-
"@edifice.io/utilities": "2.6.5-develop-b2school.
|
|
143
|
+
"@edifice.io/bootstrap": "2.6.5-develop-b2school.20260917163248",
|
|
144
|
+
"@edifice.io/tiptap-extensions": "2.6.5-develop-b2school.20260917163248",
|
|
145
|
+
"@edifice.io/utilities": "2.6.5-develop-b2school.20260917163248"
|
|
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.5-develop-b2school.
|
|
177
|
-
"@edifice.io/config": "2.6.5-develop-b2school.
|
|
176
|
+
"@edifice.io/client": "2.6.5-develop-b2school.20260917163248",
|
|
177
|
+
"@edifice.io/config": "2.6.5-develop-b2school.20260917163248"
|
|
178
178
|
},
|
|
179
179
|
"peerDependencies": {
|
|
180
180
|
"@react-spring/web": "9.7.5",
|