@edifice.io/react 2.2.0-develop.20250303111950 → 2.2.1

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.
@@ -11,7 +11,7 @@ function useHelp() {
11
11
  appCode
12
12
  } = useEdificeClient(), {
13
13
  theme
14
- } = useEdificeTheme(), [html, setHtml] = useState(""), [visibility, setVisibility] = useState(!0), [isModalOpen, setIsModalOpen] = useState(!1), [error, setError] = useState(!1), helpPath = theme != null && theme.is1d ? "/help-1d" : "/help-2d";
14
+ } = useEdificeTheme(), [html, setHtml] = useState(""), [visibility, setVisibility] = useState(!0), [activeSection, setActiveSection] = useState("présentation"), [isModalOpen, setIsModalOpen] = useState(!1), [error, setError] = useState(!1), helpPath = theme != null && theme.is1d ? "/help-1d" : "/help-2d";
15
15
  useEffect(() => {
16
16
  (async () => {
17
17
  let helpURL = "";
@@ -30,7 +30,7 @@ function useHelp() {
30
30
  }, [appCode, helpPath]);
31
31
  const parsedHTML = parse(html, {
32
32
  replace: (domNode) => {
33
- const typedDomNode = domNode;
33
+ const typedDomNode = domNode, isActive = typedDomNode.attribs.id === activeSection;
34
34
  if (typedDomNode.attribs && typedDomNode.attribs.id === "TOC")
35
35
  return /* @__PURE__ */ jsxs("nav", { id: "TOC", children: [
36
36
  /* @__PURE__ */ jsx(Button, { onClick: () => {
@@ -45,10 +45,12 @@ function useHelp() {
45
45
  }, children: domToReact(typedDomNode2.children, {
46
46
  replace: (domNode3) => {
47
47
  const typedDomNode3 = domNode3;
48
- if (typedDomNode3.attribs && typedDomNode3.name === "a")
49
- return /* @__PURE__ */ jsx("a", { ...attributesToProps(typedDomNode3.attribs), children: /* @__PURE__ */ jsx("span", { onClick: () => {
50
- setVisibility(!1);
51
- }, children: domToReact(typedDomNode3.children) }) });
48
+ if (typedDomNode3.attribs && typedDomNode3.name === "a") {
49
+ const sectionId = typedDomNode3.attribs.href.replace("#", "");
50
+ return /* @__PURE__ */ jsx("span", { onClick: (e) => {
51
+ e.preventDefault(), setActiveSection(sectionId), setVisibility(!1);
52
+ }, children: domToReact(typedDomNode3.children) });
53
+ }
52
54
  }
53
55
  }) });
54
56
  }
@@ -56,9 +58,7 @@ function useHelp() {
56
58
  ] });
57
59
  if (typedDomNode.attribs && typedDomNode.attribs.class === "section level2") {
58
60
  const props = attributesToProps(domNode.attribs);
59
- return /* @__PURE__ */ jsx("div", { ...props, className: "section level2", style: {
60
- display: typedDomNode.attribs.id !== "présentation" ? "none" : "block"
61
- }, children: domToReact(typedDomNode.children, {
61
+ return /* @__PURE__ */ jsx("div", { ...props, className: "section level2", hidden: !isActive, children: domToReact(typedDomNode.children, {
62
62
  replace: (domNode2) => {
63
63
  const typedDomNode2 = domNode2;
64
64
  if (typedDomNode2.attribs && typedDomNode2.name === "img") {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@edifice.io/react",
3
- "version": "2.2.0-develop.20250303111950",
3
+ "version": "2.2.1",
4
4
  "description": "Edifice React Library",
5
5
  "keywords": [
6
6
  "react",
@@ -118,9 +118,9 @@
118
118
  "react-slugify": "^3.0.3",
119
119
  "swiper": "^10.1.0",
120
120
  "ua-parser-js": "^1.0.36",
121
- "@edifice.io/bootstrap": "2.2.0-develop.20250303111950",
122
- "@edifice.io/tiptap-extensions": "2.2.0-develop.20250303111950",
123
- "@edifice.io/utilities": "2.2.0-develop.20250303111950"
121
+ "@edifice.io/bootstrap": "2.2.1",
122
+ "@edifice.io/tiptap-extensions": "2.2.1",
123
+ "@edifice.io/utilities": "2.2.1"
124
124
  },
125
125
  "devDependencies": {
126
126
  "@babel/plugin-transform-react-pure-annotations": "^7.23.3",
@@ -151,8 +151,8 @@
151
151
  "vite": "^5.4.11",
152
152
  "vite-plugin-dts": "^4.1.0",
153
153
  "vite-tsconfig-paths": "^5.0.1",
154
- "@edifice.io/client": "2.2.0-develop.20250303111950",
155
- "@edifice.io/config": "2.2.0-develop.20250303111950"
154
+ "@edifice.io/client": "2.2.1",
155
+ "@edifice.io/config": "2.2.1"
156
156
  },
157
157
  "peerDependencies": {
158
158
  "@react-spring/web": "^9.7.5",