@edifice.io/react 2.6.6-develop-b2school.20260921132929 → 2.6.6-develop-b2school.20260923094411

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.
@@ -45,7 +45,7 @@ const HeaderV2 = /* @__PURE__ */ lazy(() => import("../../modules/homepage/compo
45
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: {
46
46
  position: "top-right"
47
47
  } });
48
- return /* @__PURE__ */ jsxs("div", { "data-product": productOverride, "data-background": background, className: clsx("layout", {
48
+ return /* @__PURE__ */ jsxs("div", { "data-product": productOverride, "data-background": theme != null && theme.is1d ? void 0 : background, className: clsx("layout", {
49
49
  "layout-has-background-image": isBackgroundImageOverridden
50
50
  }), children: [
51
51
  renderHeader,
@@ -1,5 +1,5 @@
1
1
  import { jsxs, jsx } from "react/jsx-runtime";
2
- import { useState, useEffect } from "react";
2
+ import { useState, useRef, useEffect } from "react";
3
3
  import clsx from "clsx";
4
4
  import { createPortal } from "react-dom";
5
5
  import { useTranslation } from "react-i18next";
@@ -16,31 +16,35 @@ const HelpZone = ({
16
16
  }) => {
17
17
  const {
18
18
  t
19
- } = useTranslation(), [portalRoot, setPortalRoot] = useState(null), [isCompact, setIsCompact] = useState(!1);
19
+ } = useTranslation(), [portalRoot, setPortalRoot] = useState(null), [isCompact, setIsCompact] = useState(!1), questionButtonRef = useRef(null);
20
20
  if (useEffect(() => (document.body.classList.add("help-zone-active"), setPortalRoot(document.getElementById("portal")), () => {
21
21
  document.body.classList.remove("help-zone-active");
22
22
  }), []), useEffect(() => {
23
23
  if (isCompact)
24
24
  return;
25
- const goCompact = () => setIsCompact(!0);
25
+ const goCompact = () => setIsCompact(!0), handleClick = (event) => {
26
+ questionButtonRef.current && event.target instanceof Node && questionButtonRef.current.contains(event.target) || goCompact();
27
+ };
26
28
  return document.addEventListener("scroll", goCompact, {
27
29
  capture: !0,
28
30
  passive: !0
29
- }), document.addEventListener("click", goCompact), () => {
31
+ }), document.addEventListener("click", handleClick), () => {
30
32
  document.removeEventListener("scroll", goCompact, {
31
33
  capture: !0
32
- }), document.removeEventListener("click", goCompact);
34
+ }), document.removeEventListener("click", handleClick);
33
35
  };
34
36
  }, [isCompact]), !isReady || !portalRoot)
35
37
  return null;
36
- const handleClick = () => isOpen ? onClose() : onOpen();
37
- return /* @__PURE__ */ createPortal(/* @__PURE__ */ jsxs("div", { className: "help-zone", children: [
38
- /* @__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", children: /* @__PURE__ */ jsx("span", { className: clsx("help-zone-logo", {
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", {
39
43
  "help-zone-logo--compact": isCompact,
40
44
  "help-zone-logo--full": !isCompact
41
45
  }), children: isCompact ? /* @__PURE__ */ jsx(SvgIconLogoEdificeSmall, { width: 18, height: 18 }) : /* @__PURE__ */ jsx(SvgIconLogoEdificeFull, { width: 81, height: 18 }) }) }) }),
42
46
  /* @__PURE__ */ jsx("span", { className: "help-zone-divider" }),
43
- /* @__PURE__ */ jsx(ButtonBeta, { className: "help-zone-question", "aria-label": t("help-zone.support.open"), color: "tertiary", variant: "ghost", onClick: handleClick, children: /* @__PURE__ */ jsx(Tooltip, { message: t("help-zone.support.open"), placement: "top", children: /* @__PURE__ */ jsx(SvgIconQuestion, { width: 24, height: 24, color: "white" }) }) })
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" }) }) })
44
48
  ] }), portalRoot);
45
49
  };
46
50
  export {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@edifice.io/react",
3
- "version": "2.6.6-develop-b2school.20260921132929",
3
+ "version": "2.6.6-develop-b2school.20260923094411",
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/tiptap-extensions": "2.6.6-develop-b2school.20260921132929",
144
- "@edifice.io/bootstrap": "2.6.6-develop-b2school.20260921132929",
145
- "@edifice.io/utilities": "2.6.6-develop-b2school.20260921132929"
143
+ "@edifice.io/bootstrap": "2.6.6-develop-b2school.20260923094411",
144
+ "@edifice.io/tiptap-extensions": "2.6.6-develop-b2school.20260923094411",
145
+ "@edifice.io/utilities": "2.6.6-develop-b2school.20260923094411"
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.6-develop-b2school.20260921132929",
177
- "@edifice.io/config": "2.6.6-develop-b2school.20260921132929"
176
+ "@edifice.io/client": "2.6.6-develop-b2school.20260923094411",
177
+ "@edifice.io/config": "2.6.6-develop-b2school.20260923094411"
178
178
  },
179
179
  "peerDependencies": {
180
180
  "@react-spring/web": "9.7.5",