@edifice.io/react 2.2.14 → 2.3.0-develop.20250804092812

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.
Files changed (79) hide show
  1. package/dist/components/Button/Button.d.ts +1 -1
  2. package/dist/components/SearchBar/SearchBar.d.ts +33 -9
  3. package/dist/components/SearchBar/SearchBar.js +17 -2
  4. package/dist/hooks/useLibraryUrl/useLibraryUrl.d.ts +1 -1
  5. package/dist/hooks/useLibraryUrl/useLibraryUrl.js +2 -2
  6. package/dist/icons-apps.js +176 -164
  7. package/dist/icons.js +198 -190
  8. package/dist/modules/icons/components/IconLibrary.d.ts +7 -0
  9. package/dist/modules/icons/components/IconLibrary.js +12 -0
  10. package/dist/modules/icons/components/IconNotification.d.ts +7 -0
  11. package/dist/modules/icons/components/IconNotification.js +12 -0
  12. package/dist/modules/icons/components/IconStar.d.ts +7 -0
  13. package/dist/modules/icons/components/IconStar.js +13 -0
  14. package/dist/modules/icons/components/IconStarFavorite.d.ts +7 -0
  15. package/dist/modules/icons/components/IconStarFull.d.ts +7 -0
  16. package/dist/modules/icons/components/IconStarFull.js +13 -0
  17. package/dist/modules/icons/components/apps/IconAccount.js +2 -2
  18. package/dist/modules/icons/components/apps/IconActualites.js +2 -2
  19. package/dist/modules/icons/components/apps/IconAdmin.js +2 -2
  20. package/dist/modules/icons/components/apps/IconAgenda.js +3 -2
  21. package/dist/modules/icons/components/apps/IconAppointments.js +2 -2
  22. package/dist/modules/icons/components/apps/IconArchive.js +2 -2
  23. package/dist/modules/icons/components/apps/IconBlog.js +2 -2
  24. package/dist/modules/icons/components/apps/IconCahierDeTexte.js +2 -2
  25. package/dist/modules/icons/components/apps/IconCahierTextes.js +2 -2
  26. package/dist/modules/icons/components/apps/IconCalendar.js +3 -2
  27. package/dist/modules/icons/components/apps/IconCollaborativeWall.js +2 -2
  28. package/dist/modules/icons/components/apps/IconCommunity.js +2 -2
  29. package/dist/modules/icons/components/apps/IconConversation.js +2 -2
  30. package/dist/modules/icons/components/apps/IconDirectory.js +2 -2
  31. package/dist/modules/icons/components/apps/IconEdt.d.ts +7 -0
  32. package/dist/modules/icons/components/apps/IconEdt.js +12 -0
  33. package/dist/modules/icons/components/apps/IconExercizer.js +2 -2
  34. package/dist/modules/icons/components/apps/IconForms.js +2 -6
  35. package/dist/modules/icons/components/apps/IconForum.js +2 -2
  36. package/dist/modules/icons/components/apps/IconGeogebra.d.ts +7 -0
  37. package/dist/modules/icons/components/apps/IconGeogebra.js +12 -0
  38. package/dist/modules/icons/components/apps/IconLibrary.js +2 -2
  39. package/dist/modules/icons/components/apps/IconMagneto.d.ts +7 -0
  40. package/dist/modules/icons/components/apps/IconMagneto.js +13 -0
  41. package/dist/modules/icons/components/apps/IconMediacentre.js +2 -2
  42. package/dist/modules/icons/components/apps/IconMindmap.js +2 -2
  43. package/dist/modules/icons/components/apps/IconMinetest.d.ts +7 -0
  44. package/dist/modules/icons/components/apps/IconMinetest.js +12 -0
  45. package/dist/modules/icons/components/apps/IconMinibadge.d.ts +7 -0
  46. package/dist/modules/icons/components/apps/IconMinibadge.js +12 -0
  47. package/dist/modules/icons/components/apps/IconMoodle.js +2 -2
  48. package/dist/modules/icons/components/apps/IconNabook.js +6 -4
  49. package/dist/modules/icons/components/apps/IconNotebook.js +2 -2
  50. package/dist/modules/icons/components/apps/IconPad.js +2 -2
  51. package/dist/modules/icons/components/apps/IconPages.js +2 -2
  52. package/dist/modules/icons/components/apps/IconParametrage.js +2 -2
  53. package/dist/modules/icons/components/apps/IconParametrages.js +2 -2
  54. package/dist/modules/icons/components/apps/IconPoll.js +2 -2
  55. package/dist/modules/icons/components/apps/IconPresences.js +2 -6
  56. package/dist/modules/icons/components/apps/IconRack.js +2 -2
  57. package/dist/modules/icons/components/apps/IconRbs.js +2 -2
  58. package/dist/modules/icons/components/apps/IconSchoolbook.js +2 -2
  59. package/dist/modules/icons/components/apps/IconScrapbook.js +2 -2
  60. package/dist/modules/icons/components/apps/IconSettingsClass.js +2 -2
  61. package/dist/modules/icons/components/apps/IconSharebigfiles.js +2 -2
  62. package/dist/modules/icons/components/apps/IconStatistics.js +2 -2
  63. package/dist/modules/icons/components/apps/IconSupport.js +2 -2
  64. package/dist/modules/icons/components/apps/IconTimeline.js +2 -2
  65. package/dist/modules/icons/components/apps/IconTimelinegenerator.js +2 -2
  66. package/dist/modules/icons/components/apps/IconUserbook.js +2 -2
  67. package/dist/modules/icons/components/apps/IconVisioconf.js +2 -2
  68. package/dist/modules/icons/components/apps/IconVotil.d.ts +7 -0
  69. package/dist/modules/icons/components/apps/IconVotil.js +14 -0
  70. package/dist/modules/icons/components/apps/IconWebsite.js +2 -2
  71. package/dist/modules/icons/components/apps/IconWiki.js +3 -3
  72. package/dist/modules/icons/components/apps/IconWorkspace.js +2 -2
  73. package/dist/modules/icons/components/apps/index.d.ts +6 -0
  74. package/dist/modules/icons/components/index.d.ts +4 -0
  75. package/dist/modules/modals/OnboardingModal/OnboardingModal.d.ts +6 -4
  76. package/dist/modules/modals/OnboardingModal/OnboardingModal.js +27 -13
  77. package/dist/modules/modals/OnboardingModal/index.d.ts +1 -0
  78. package/dist/modules/modals/OnboardingModal/useOnboardingModal.js +4 -4
  79. package/package.json +6 -6
@@ -0,0 +1,14 @@
1
+ import { jsxs, jsx } from "react/jsx-runtime";
2
+ const SvgIconVotil = ({
3
+ title,
4
+ titleId,
5
+ ...props
6
+ }) => /* @__PURE__ */ jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", id: "icon-votil_svg__vote", viewBox: "0 0 156.53 156.53", width: "24", height: "24", "aria-hidden": "true", "aria-labelledby": titleId, ...props, children: [
7
+ title ? /* @__PURE__ */ jsx("title", { id: titleId, children: title }) : null,
8
+ /* @__PURE__ */ jsx("defs", { children: /* @__PURE__ */ jsx("style", { children: ".icon-votil_svg__cls-1{fill:#fff}" }) }),
9
+ /* @__PURE__ */ jsx("path", { d: "m39.66 79.79 43.6 28.55c.78.51 1.69.78 2.62.78 1.62 0 3.13-.81 4.01-2.17l39.99-61.06c1.45-2.21.83-5.19-1.38-6.63L84.9 10.71a4.85 4.85 0 0 0-3.61-.68c-1.25.26-2.33 1-3.03 2.07L38.27 73.16c-.7 1.07-.94 2.35-.68 3.6s1 2.33 2.07 3.03M69.53 52.1c.76-1.35 2-2.32 3.49-2.73 3.07-.85 6.28.96 7.13 4.03l1.88 6.77 18.23-9.09c1.38-.69 2.95-.8 4.42-.31s2.66 1.52 3.35 2.91c.69 1.38.8 2.95.31 4.42s-1.52 2.66-2.91 3.35L80.91 73.68a5.8 5.8 0 0 1-4.94.11 5.8 5.8 0 0 1-3.23-3.74l-3.76-13.54a5.78 5.78 0 0 1 .54-4.4Z", className: "icon-votil_svg__cls-1" }),
10
+ /* @__PURE__ */ jsx("path", { d: "M134.03 99.44h-17.64c-2.64 0-4.79 2.15-4.79 4.79s2.15 4.79 4.79 4.79h12.85v23.41H32.97v-23.41h15.5c2.64 0 4.79-2.15 4.79-4.79s-2.15-4.79-4.79-4.79H28.18c-2.64 0-4.79 2.15-4.79 4.79v33c0 2.64 2.15 4.79 4.79 4.79h105.86c2.64 0 4.79-2.15 4.79-4.79v-33c0-2.64-2.15-4.79-4.79-4.79Z", className: "icon-votil_svg__cls-1" })
11
+ ] });
12
+ export {
13
+ SvgIconVotil as default
14
+ };
@@ -3,9 +3,9 @@ const SvgIconWebsite = ({
3
3
  title,
4
4
  titleId,
5
5
  ...props
6
- }) => /* @__PURE__ */ jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", width: "24", height: "24", "aria-hidden": "true", "aria-labelledby": titleId, ...props, children: [
6
+ }) => /* @__PURE__ */ jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", width: "24", height: "24", fill: "none", viewBox: "0 0 50 50", "aria-hidden": "true", "aria-labelledby": titleId, ...props, children: [
7
7
  title ? /* @__PURE__ */ jsx("title", { id: titleId, children: title }) : null,
8
- /* @__PURE__ */ jsx("path", { fill: "currentColor", d: "M17.55 14.61c0 1.01.28 1.41 1.03 1.41 1.68 0 2.74-2.13 2.74-5.67 0-5.43-3.94-8.02-8.88-8.02-5.07 0-9.68 3.4-9.68 9.83 0 6.14 4.03 9.49 10.23 9.49 2.1 0 3.52-.23 5.68-.95l.46 1.93c-2.13.69-4.41.89-6.17.89C4.83 23.52.48 19.05.48 12.16.48 5.21 5.52.5 12.48.5c7.23 0 11.06 4.32 11.06 9.62 0 4.5-1.41 7.93-5.85 7.93-2.02 0-3.34-.8-3.52-2.6-.51 2-1.9 2.6-3.77 2.6-2.51 0-4.62-1.93-4.62-5.82 0-3.92 1.85-6.34 5.17-6.34 1.75 0 2.85.69 3.34 1.78l.83-1.52h2.43v8.47zM14 10.81a2.12 2.12 0 0 0-2.16-2.25c-1.07 0-2.25.86-2.25 3.4 0 2.02.9 3.14 2.25 3.14.95 0 2.16-.6 2.16-2.27V10.8z" })
8
+ /* @__PURE__ */ jsx("path", { fill: "currentColor", d: "M34.216 29.344c0 1.68.478 2.35 1.728 2.35 2.786 0 4.56-3.55 4.56-9.454 0-9.024-6.576-13.344-14.786-13.344-8.446 0-16.128 5.664-16.128 16.368 0 10.224 6.72 15.792 17.04 15.792 3.504 0 5.856-.384 9.454-1.584l.772 3.214c-3.552 1.154-7.348 1.488-10.274 1.488-13.536 0-20.786-7.44-20.786-18.912 0-11.568 8.402-19.44 19.97-19.44 12.048 0 18.43 7.2 18.43 16.032 0 7.488-2.35 13.2-9.742 13.2-3.362 0-5.568-1.344-5.856-4.322-.864 3.312-3.168 4.322-6.29 4.322-4.176 0-7.68-3.218-7.68-9.696 0-6.528 3.074-10.56 8.594-10.56 2.928 0 4.752 1.152 5.564 2.976l1.394-2.544h4.032v14.114zm-5.902-6.336c0-2.638-1.97-3.744-3.602-3.744-1.776 0-3.742 1.438-3.742 5.664 0 3.36 1.488 5.232 3.742 5.232 1.584 0 3.602-1.008 3.602-3.792z" })
9
9
  ] });
10
10
  export {
11
11
  SvgIconWebsite as default
@@ -3,10 +3,10 @@ const SvgIconWiki = ({
3
3
  title,
4
4
  titleId,
5
5
  ...props
6
- }) => /* @__PURE__ */ jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", width: "24", height: "24", fill: "none", viewBox: "0 0 24 24", "aria-hidden": "true", "aria-labelledby": titleId, ...props, children: [
6
+ }) => /* @__PURE__ */ jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", width: "24", height: "24", fill: "none", viewBox: "0 0 50 50", "aria-hidden": "true", "aria-labelledby": titleId, ...props, children: [
7
7
  title ? /* @__PURE__ */ jsx("title", { id: titleId, children: title }) : null,
8
- /* @__PURE__ */ jsx("path", { fill: "currentColor", d: "M7.64 14.568c-.82 0-1.533.09-2.114.202a.583.583 0 1 1-.22-1.145 12.3 12.3 0 0 1 2.334-.224c.922 0 1.726.1 2.377.223a.583.583 0 0 1-.216 1.146 11.6 11.6 0 0 0-2.161-.202m-2.114-4.454c.58-.112 1.294-.202 2.114-.202.837 0 1.568.09 2.16.203a.583.583 0 0 0 .217-1.146 13 13 0 0 0-2.377-.223c-.906 0-1.694.1-2.334.223a.583.583 0 1 0 .22 1.145" }),
9
- /* @__PURE__ */ jsx("path", { fill: "currentColor", d: "M16.595 3.72a18.4 18.4 0 0 1 4.841.62.6.6 0 0 1 .446.58v1.437h.324c.314 0 .569.254.569.568V20.64a.57.57 0 0 1-.71.551 19.8 19.8 0 0 0-5.08-.604h-.001a20 20 0 0 0-4.734.604.6.6 0 0 1-.237.01 29 29 0 0 0-4.742-.43 29.5 29.5 0 0 0-5.254.43.57.57 0 0 1-.666-.561V6.925c0-.314.255-.568.569-.568h.392V4.92a.6.6 0 0 1 .458-.583 20 20 0 0 1 4.539-.566c1.93-.022 3.562.243 4.778.53a18.5 18.5 0 0 1 4.508-.58Zm-5.101 1.677a18.6 18.6 0 0 0-4.172-.426h-.001a18.8 18.8 0 0 0-3.81.426V18.84c1.073-.203 2.35-.36 3.796-.379a20 20 0 0 1 4.187.376zm1.2 13.402a18.6 18.6 0 0 1 3.938-.468c1.61-.014 2.988.206 4.05.463V5.387c-.455-.108-.97-.21-1.54-.293v5.45c0 .32-.33.527-.617.387l-1.26-.61a.41.41 0 0 0-.387.005l-1.059.566a.432.432 0 0 1-.633-.381V4.986c-.956.083-1.795.235-2.492.4V18.8Z" })
8
+ /* @__PURE__ */ jsx("path", { fill: "currentColor", d: "M15.503 29.741c-1.76 0-3.292.195-4.539.435a1.252 1.252 0 1 1-.473-2.46 26.5 26.5 0 0 1 5.012-.479c1.979 0 3.706.214 5.105.479a1.252 1.252 0 0 1-.466 2.46 25 25 0 0 0-4.639-.435M10.964 20.18a24 24 0 0 1 4.539-.435c1.798 0 3.367.195 4.639.435a1.252 1.252 0 0 0 .466-2.46 27.5 27.5 0 0 0-5.105-.48c-1.945 0-3.637.215-5.012.48a1.252 1.252 0 0 0 .473 2.46" }),
9
+ /* @__PURE__ */ jsx("path", { fill: "currentColor", fillRule: "evenodd", d: "M34.73 6.45a39.6 39.6 0 0 1 10.395 1.331c.564.15.957.661.957 1.245v3.085h.697c.674 0 1.221.547 1.221 1.221V42.78a1.22 1.22 0 0 1-1.524 1.183 42.4 42.4 0 0 0-10.908-1.297h-.002a43 43 0 0 0-10.164 1.298c-.166.042-.34.048-.51.019a62.6 62.6 0 0 0-10.18-.92 63.4 63.4 0 0 0-11.283.92A1.22 1.22 0 0 1 2 42.78V13.333c0-.675.547-1.222 1.221-1.222h.841V9.026c0-.594.406-1.11.983-1.252a43 43 0 0 1 9.747-1.215 42.5 42.5 0 0 1 10.26 1.139A39.7 39.7 0 0 1 34.73 6.45m-10.952 3.6a40 40 0 0 0-8.958-.915h-.002c-3.2.03-5.973.437-8.18.916v28.861a47 47 0 0 1 8.15-.813c3.62-.05 6.517.325 8.99.808zm2.577 28.776a40 40 0 0 1 8.455-1.003c3.457-.03 6.416.44 8.696.992V10.03a37 37 0 0 0-3.307-.63v11.703a.918.918 0 0 1-1.323.83l-2.707-1.31a.88.88 0 0 0-.83.011l-2.273 1.215a.927.927 0 0 1-1.36-.818V9.168a37 37 0 0 0-5.351.861z", clipRule: "evenodd" })
10
10
  ] });
11
11
  export {
12
12
  SvgIconWiki as default
@@ -3,9 +3,9 @@ const SvgIconWorkspace = ({
3
3
  title,
4
4
  titleId,
5
5
  ...props
6
- }) => /* @__PURE__ */ jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 23 24", width: "24", height: "24", "aria-hidden": "true", "aria-labelledby": titleId, ...props, children: [
6
+ }) => /* @__PURE__ */ jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", width: "24", height: "24", fill: "none", viewBox: "0 0 50 50", "aria-hidden": "true", "aria-labelledby": titleId, ...props, children: [
7
7
  title ? /* @__PURE__ */ jsx("title", { id: titleId, children: title }) : null,
8
- /* @__PURE__ */ jsx("path", { fill: "currentColor", d: "M22.34 8.68v9.45q0 1.23-.89 2.12t-2.12.89H3.01q-1.23 0-2.12-.89T0 18.13V5.25q0-1.23.9-2.12t2.12-.9h4.3q1.23 0 2.12.9t.89 2.12v.43h9.01q1.23 0 2.12.89t.89 2.11z" })
8
+ /* @__PURE__ */ jsx("path", { fill: "currentColor", d: "M45.6 20.46v17.43a5.6 5.6 0 0 1-5.54 5.54H9.94A5.3 5.3 0 0 1 6 41.79a5.3 5.3 0 0 1-1.64-3.9V14.11A5.3 5.3 0 0 1 6 10.21a5.3 5.3 0 0 1 3.9-1.64h7.94a5.3 5.3 0 0 1 3.9 1.64 5.3 5.3 0 0 1 1.65 3.9v.8h16.67a5.6 5.6 0 0 1 5.54 5.55" })
9
9
  ] });
10
10
  export {
11
11
  SvgIconWorkspace as default
@@ -33,6 +33,7 @@ export { default as IconConnecteurGenerique1 } from './IconConnecteurGenerique1'
33
33
  export { default as IconConnecteurGenerique2 } from './IconConnecteurGenerique2';
34
34
  export { default as IconConversation } from './IconConversation';
35
35
  export { default as IconDirectory } from './IconDirectory';
36
+ export { default as IconEdt } from './IconEdt';
36
37
  export { default as IconEducagri } from './IconEducagri';
37
38
  export { default as IconEdumedia } from './IconEdumedia';
38
39
  export { default as IconEdumoov } from './IconEdumoov';
@@ -44,6 +45,7 @@ export { default as IconEuropress } from './IconEuropress';
44
45
  export { default as IconExercizer } from './IconExercizer';
45
46
  export { default as IconForms } from './IconForms';
46
47
  export { default as IconForum } from './IconForum';
48
+ export { default as IconGeogebra } from './IconGeogebra';
47
49
  export { default as IconGepi } from './IconGepi';
48
50
  export { default as IconGlpi } from './IconGlpi';
49
51
  export { default as IconHiboutheque } from './IconHiboutheque';
@@ -55,10 +57,13 @@ export { default as IconLesechos } from './IconLesechos';
55
57
  export { default as IconLibrary } from './IconLibrary';
56
58
  export { default as IconLsu } from './IconLsu';
57
59
  export { default as IconMadmagz } from './IconMadmagz';
60
+ export { default as IconMagneto } from './IconMagneto';
58
61
  export { default as IconMatholycee } from './IconMatholycee';
59
62
  export { default as IconMaxicours } from './IconMaxicours';
60
63
  export { default as IconMediacentre } from './IconMediacentre';
61
64
  export { default as IconMindmap } from './IconMindmap';
65
+ export { default as IconMinetest } from './IconMinetest';
66
+ export { default as IconMinibadge } from './IconMinibadge';
62
67
  export { default as IconMonorientationenligne } from './IconMonorientationenligne';
63
68
  export { default as IconMonstageenligne } from './IconMonstageenligne';
64
69
  export { default as IconMoodle } from './IconMoodle';
@@ -111,6 +116,7 @@ export { default as IconUserbook } from './IconUserbook';
111
116
  export { default as IconVideo } from './IconVideo';
112
117
  export { default as IconVieScolaire } from './IconVieScolaire';
113
118
  export { default as IconVisioconf } from './IconVisioconf';
119
+ export { default as IconVotil } from './IconVotil';
114
120
  export { default as IconWebclasseur } from './IconWebclasseur';
115
121
  export { default as IconWebsite } from './IconWebsite';
116
122
  export { default as IconWiki } from './IconWiki';
@@ -68,6 +68,7 @@ export { default as IconInbox } from './IconInbox';
68
68
  export { default as IconInfoCircle } from './IconInfoCircle';
69
69
  export { default as IconInfoRectangle } from './IconInfoRectangle';
70
70
  export { default as IconLandscape } from './IconLandscape';
71
+ export { default as IconLibrary } from './IconLibrary';
71
72
  export { default as IconLink } from './IconLink';
72
73
  export { default as IconListOrder } from './IconListOrder';
73
74
  export { default as IconLoader } from './IconLoader';
@@ -81,6 +82,7 @@ export { default as IconMic } from './IconMic';
81
82
  export { default as IconMinus } from './IconMinus';
82
83
  export { default as IconMove } from './IconMove';
83
84
  export { default as IconNoColors } from './IconNoColors';
85
+ export { default as IconNotification } from './IconNotification';
84
86
  export { default as IconOptions } from './IconOptions';
85
87
  export { default as IconOrderedList } from './IconOrderedList';
86
88
  export { default as IconPaperclip } from './IconPaperclip';
@@ -128,6 +130,8 @@ export { default as IconSortTime } from './IconSortTime';
128
130
  export { default as IconSpeechToText } from './IconSpeechToText';
129
131
  export { default as IconSplitCells } from './IconSplitCells';
130
132
  export { default as IconSquareRoot } from './IconSquareRoot';
133
+ export { default as IconStarFull } from './IconStarFull';
134
+ export { default as IconStar } from './IconStar';
131
135
  export { default as IconSubscript } from './IconSubscript';
132
136
  export { default as IconSuccessFill } from './IconSuccessFill';
133
137
  export { default as IconSuccessOutline } from './IconSuccessOutline';
@@ -34,13 +34,15 @@ interface ModalOptionsProps {
34
34
  */
35
35
  closeText?: string;
36
36
  }
37
+ export interface OnboardingModalRef {
38
+ setIsOpen: (isOpen: boolean) => void;
39
+ handleSavePreference: () => void;
40
+ }
37
41
  interface OnboardingProps {
38
42
  id: string;
39
43
  items: ModalItemsProps[];
40
44
  modalOptions?: ModalOptionsProps;
45
+ isOnboardingChange?: (isOnboarding: boolean) => void;
41
46
  }
42
- declare const OnboardingModal: {
43
- ({ id, items, modalOptions }: OnboardingProps): import('react').ReactPortal | null;
44
- displayName: string;
45
- };
47
+ declare const OnboardingModal: import('react').ForwardRefExoticComponent<OnboardingProps & import('react').RefAttributes<OnboardingModalRef>>;
46
48
  export default OnboardingModal;
@@ -1,5 +1,5 @@
1
1
  import { jsxs, jsx } from "react/jsx-runtime";
2
- import { useState, useEffect } from "react";
2
+ import { forwardRef, useState, useImperativeHandle, useEffect } from "react";
3
3
  import { createPortal } from "react-dom";
4
4
  import { useTranslation } from "react-i18next";
5
5
  import { Pagination } from "swiper/modules";
@@ -8,11 +8,12 @@ import { useOnboardingModal } from "./useOnboardingModal.js";
8
8
  import Modal from "../../../components/Modal/Modal.js";
9
9
  import Image from "../../../components/Image/Image.js";
10
10
  import Button from "../../../components/Button/Button.js";
11
- const OnboardingModal = ({
11
+ const OnboardingModal = /* @__PURE__ */ forwardRef(({
12
12
  id,
13
13
  items,
14
- modalOptions = {}
15
- }) => {
14
+ modalOptions = {},
15
+ isOnboardingChange
16
+ }, ref) => {
16
17
  var _a;
17
18
  const [swiperInstance, setSwiperInstance] = useState(), [swiperProgress, setSwiperprogress] = useState(0), {
18
19
  isOpen,
@@ -20,7 +21,12 @@ const OnboardingModal = ({
20
21
  setIsOpen,
21
22
  handleSavePreference
22
23
  } = useOnboardingModal(id);
23
- useEffect(() => {
24
+ useImperativeHandle(ref, () => ({
25
+ setIsOpen,
26
+ handleSavePreference
27
+ })), useEffect(() => {
28
+ isOnboardingChange && isOnboardingChange(isOnboarding);
29
+ }, [isOnboarding, isOnboardingChange]), useEffect(() => {
24
30
  const link = document.createElement("link");
25
31
  return link.href = "https://cdn.jsdelivr.net/npm/swiper@11/swiper-bundle.min.css", link.rel = "stylesheet", link.type = "text/css", document.head.appendChild(link), () => {
26
32
  document.head.removeChild(link);
@@ -33,9 +39,13 @@ const OnboardingModal = ({
33
39
  prevText,
34
40
  closeText,
35
41
  nextText
36
- } = modalOptions, currentTitle = (swiperInstance == null ? void 0 : swiperInstance.activeIndex) != null && ((_a = items[swiperInstance == null ? void 0 : swiperInstance.activeIndex]) != null && _a.title) ? items[swiperInstance.activeIndex].title : title;
37
- return isOnboarding ? /* @__PURE__ */ createPortal(/* @__PURE__ */ jsxs(Modal, { id: "onboarding-modal", size: "md", isOpen, focusId: "nextButtonId", onModalClose: () => setIsOpen(!1), children: [
38
- /* @__PURE__ */ jsx(Modal.Header, { onModalClose: () => setIsOpen(!1), centered: !0, children: t(currentTitle || "explorer.modal.onboarding.trash.title") }),
42
+ } = modalOptions, currentTitle = (swiperInstance == null ? void 0 : swiperInstance.activeIndex) != null && ((_a = items[swiperInstance == null ? void 0 : swiperInstance.activeIndex]) != null && _a.title) ? items[swiperInstance.activeIndex].title : title, handleCloseWithPreference = () => {
43
+ handleSavePreference(), setSwiperprogress(0);
44
+ }, handleCloseWithoutPreference = () => {
45
+ setIsOpen(!1), setSwiperprogress(0);
46
+ };
47
+ return /* @__PURE__ */ createPortal(/* @__PURE__ */ jsxs(Modal, { id: "onboarding-modal", size: "md", isOpen, focusId: "nextButtonId", onModalClose: handleCloseWithoutPreference, children: [
48
+ /* @__PURE__ */ jsx(Modal.Header, { onModalClose: handleCloseWithoutPreference, centered: !0, children: t(currentTitle || "explorer.modal.onboarding.trash.title") }),
39
49
  /* @__PURE__ */ jsx(Modal.Body, { children: /* @__PURE__ */ jsx(Swiper, { modules: [Pagination], onSwiper: (swiper) => {
40
50
  setSwiperInstance(swiper);
41
51
  }, onSlideChange: (swiper) => {
@@ -44,16 +54,20 @@ const OnboardingModal = ({
44
54
  clickable: !0
45
55
  }, children: items.map((item, index) => /* @__PURE__ */ jsxs(SwiperSlide, { children: [
46
56
  /* @__PURE__ */ jsx(Image, { width: "270", height: "140", className: "mx-auto my-12", loading: "lazy", src: item.src, alt: t(item.alt) }),
47
- /* @__PURE__ */ jsx("p", { className: "text-center", children: t(item.text) })
57
+ /* @__PURE__ */ jsx("p", { className: "text-center", dangerouslySetInnerHTML: {
58
+ __html: t(item.text)
59
+ } })
48
60
  ] }, index)) }) }),
49
61
  /* @__PURE__ */ jsxs(Modal.Footer, { children: [
50
- /* @__PURE__ */ jsx(Button, { type: "button", color: "tertiary", variant: "ghost", onClick: () => setIsOpen(!1), children: t("explorer.modal.onboarding.trash.later") }),
62
+ /* @__PURE__ */ jsx(Button, { type: "button", color: "tertiary", variant: "ghost", onClick: handleCloseWithoutPreference, children: t("explorer.modal.onboarding.trash.later") }),
51
63
  swiperProgress > 0 && /* @__PURE__ */ jsx(Button, { type: "button", color: "primary", variant: "outline", onClick: () => swiperInstance.slidePrev(), children: t(prevText || "explorer.modal.onboarding.trash.prev") }),
52
64
  swiperProgress < 1 && /* @__PURE__ */ jsx(Button, { id: "nextButtonId", type: "button", color: "primary", variant: "filled", onClick: () => swiperInstance.slideNext(), children: t(nextText || "explorer.modal.onboarding.trash.next") }),
53
- swiperProgress === 1 && /* @__PURE__ */ jsx(Button, { type: "button", color: "primary", variant: "filled", onClick: handleSavePreference, children: t(closeText || "explorer.modal.onboarding.trash.close") })
65
+ swiperProgress === 1 && /* @__PURE__ */ jsx(Button, { type: "button", color: "primary", variant: "filled", onClick: () => {
66
+ isOnboarding ? handleCloseWithPreference() : handleCloseWithoutPreference();
67
+ }, children: t(closeText || "explorer.modal.onboarding.trash.close") })
54
68
  ] })
55
- ] }), document.getElementById("portal")) : null;
56
- };
69
+ ] }), document.getElementById("portal"));
70
+ });
57
71
  export {
58
72
  OnboardingModal as default
59
73
  };
@@ -1 +1,2 @@
1
1
  export { default as OnboardingModal } from './OnboardingModal';
2
+ export type { OnboardingModalRef } from './OnboardingModal';
@@ -3,7 +3,7 @@ import { odeServices } from "@edifice.io/client";
3
3
  const getOnboardingTrash = async (key) => await odeServices.conf().getPreference(key), saveOnboardingTrash = async (key) => await odeServices.conf().savePreference(key, JSON.stringify({
4
4
  key: !1
5
5
  })), useOnboardingModal = (id) => {
6
- const [isOpen, setIsOpen] = useState(!0), [isOnboarding, setIsOnboarding] = useState(!1);
6
+ const [isOpen, setIsOpen] = useState(!1), [isOnboarding, setIsOnboarding] = useState(!1);
7
7
  return useEffect(() => {
8
8
  (async () => {
9
9
  const response = await getOnboardingTrash(id);
@@ -11,17 +11,17 @@ const getOnboardingTrash = async (key) => await odeServices.conf().getPreference
11
11
  const {
12
12
  key
13
13
  } = response;
14
- setIsOnboarding(key);
14
+ key === !0 && setIsOpen(!0), setIsOnboarding(key);
15
15
  return;
16
16
  }
17
- setIsOnboarding(!0);
17
+ setIsOnboarding(!0), setIsOpen(!0);
18
18
  })();
19
19
  }, [id]), {
20
20
  isOpen,
21
21
  setIsOpen,
22
22
  isOnboarding,
23
23
  handleSavePreference: async () => {
24
- await saveOnboardingTrash(id), setIsOpen(!1);
24
+ await saveOnboardingTrash(id), setIsOpen(!1), setIsOnboarding(!1);
25
25
  }
26
26
  };
27
27
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@edifice.io/react",
3
- "version": "2.2.14",
3
+ "version": "2.3.0-develop.20250804092812",
4
4
  "description": "Edifice React Library",
5
5
  "keywords": [
6
6
  "react",
@@ -130,9 +130,9 @@
130
130
  "react-slugify": "^3.0.3",
131
131
  "swiper": "^10.1.0",
132
132
  "ua-parser-js": "^1.0.36",
133
- "@edifice.io/bootstrap": "2.2.14",
134
- "@edifice.io/tiptap-extensions": "2.2.14",
135
- "@edifice.io/utilities": "2.2.14"
133
+ "@edifice.io/bootstrap": "2.3.0-develop.20250804092812",
134
+ "@edifice.io/tiptap-extensions": "2.3.0-develop.20250804092812",
135
+ "@edifice.io/utilities": "2.3.0-develop.20250804092812"
136
136
  },
137
137
  "devDependencies": {
138
138
  "@babel/plugin-transform-react-pure-annotations": "^7.23.3",
@@ -163,8 +163,8 @@
163
163
  "vite": "^5.4.11",
164
164
  "vite-plugin-dts": "^4.1.0",
165
165
  "vite-tsconfig-paths": "^5.0.1",
166
- "@edifice.io/client": "2.2.14",
167
- "@edifice.io/config": "2.2.14"
166
+ "@edifice.io/client": "2.3.0-develop.20250804092812",
167
+ "@edifice.io/config": "2.3.0-develop.20250804092812"
168
168
  },
169
169
  "peerDependencies": {
170
170
  "@react-spring/web": "^9.7.5",