@logora/debate 0.4.40 → 0.4.42

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 (198) hide show
  1. package/dist/assets/components/action/back_link/BackLink.module-nMAM5nvb.css +1 -0
  2. package/dist/assets/components/action/button/Button.module-BXkLuURK.css +1 -0
  3. package/dist/assets/components/action/icon_text_link/IconTextLink.module-B5PF-MMK.css +1 -0
  4. package/dist/assets/components/argument/argument/Argument.module-QZdPjj_i.css +1 -0
  5. package/dist/assets/components/argument/argument/ReplyFooter.module-x9Xlkt3Z.css +1 -0
  6. package/dist/assets/components/auth/sso_form/SSOForm.module-D5v2TrOv.css +1 -0
  7. package/dist/assets/components/consultation/consultation_box/ConsultationBox.module-DjNiVt-p.css +1 -0
  8. package/dist/assets/components/debate/debate_box/DebateBox.module-DTLafpl4.css +1 -0
  9. package/dist/assets/components/dialog/dialog_box/DialogBox.module-DKztqqmb.css +1 -0
  10. package/dist/assets/components/dialog/dropdown/Dropdown.module-FG2Sqrqs.css +1 -0
  11. package/dist/assets/components/dialog/modal/Modal.module-CIj-xCzY.css +1 -0
  12. package/dist/assets/components/dialog/toast/Toast.module-DJ2wSlJT.css +1 -0
  13. package/dist/assets/components/dialog/tooltip/Tooltip.module-zMXumgnX.css +1 -0
  14. package/dist/assets/components/embed/embed_header/EmbedHeader.module-CoyRY_jw.css +1 -0
  15. package/dist/assets/components/follow/follow_button/FollowButton.module-C9YXM8AM.css +1 -0
  16. package/dist/assets/components/gamification/badge_box/BadgeBox.module-BnskGH9b.css +1 -0
  17. package/dist/assets/components/gamification/point_box/{PointBox.module-Dj6cCgSB.css → PointBox.module-BlHdQyht.css} +1 -1
  18. package/dist/assets/components/information/information_box/InformationBox.module-B_MiEPn7.css +1 -0
  19. package/dist/assets/components/input/text_editor/TextEditor.module-CxuSL3l3.css +1 -0
  20. package/dist/assets/components/input/text_editor/plugins/ToolbarPlugin.module-CbPmMciY.css +1 -0
  21. package/dist/assets/components/input/toggle_position/TogglePosition.module-DDIigbfA.css +1 -0
  22. package/dist/assets/components/list/paginated_list/action_bar/ActionBar.module-DvwCbS9k.css +1 -0
  23. package/dist/assets/components/navigation/tabs/Tabs.module-CtDi0tAd.css +1 -0
  24. package/dist/assets/components/notification/notification_item/NotificationItem.module-BWdhgSy4.css +1 -0
  25. package/dist/assets/components/notification/notification_menu/NotificationMenu.module-BQwbvRIV.css +1 -0
  26. package/dist/assets/components/progress/progress_bar/ProgressBar.module-Dy-27Wf9.css +1 -0
  27. package/dist/assets/components/proposal/proposal_box/ProposalBox.module-Dm8XDnr1.css +1 -0
  28. package/dist/assets/components/section/section_box/SectionBox.module-qQs4B6bf.css +1 -0
  29. package/dist/assets/components/share/share_button/{ShareButton.module-BnVEYTzr.css → ShareButton.module-BS6STEUD.css} +1 -1
  30. package/dist/assets/components/skeleton/user_content_skeleton/UserContentSkeleton.module-DhZm1xTr.css +1 -0
  31. package/dist/assets/components/source/context_source_box/ContextSourceBox.module-78Gxjx0w.css +1 -0
  32. package/dist/assets/components/source/context_source_list/ContextSourceList.module-DUPbI-wb.css +1 -0
  33. package/dist/assets/components/source/source_box/SourceBox.module-Cu_m3E85.css +1 -0
  34. package/dist/assets/components/source/source_list_item/SourceListItem.module-fm_uHuY4.css +1 -0
  35. package/dist/assets/components/suggestion/suggestion_banner/SuggestionBanner.module-D37NVZLS.css +1 -0
  36. package/dist/assets/components/suggestion/suggestion_box/SuggestionBox.module-DHxoF0oe.css +1 -0
  37. package/dist/assets/components/suggestion/suggestion_input/SuggestionInput.module-BsEj7sF3.css +1 -0
  38. package/dist/assets/components/summary/argument_summary_box/ArgumentSummaryBox.module-DLcsyMSD.css +1 -0
  39. package/dist/assets/components/summary/keyword_box/KeywordBox.module-DHkYfW0l.css +1 -0
  40. package/dist/assets/components/summary/summary_box/SummaryBox.module-Dr9PevSJ.css +1 -0
  41. package/dist/assets/components/text/read_more/ReadMore.module-Ni_Mm8o8.css +1 -0
  42. package/dist/assets/components/user/author_box/AuthorBox.module-CbH2S-MT.css +1 -0
  43. package/dist/assets/components/user/update_user_info_modal/UpdateUserInfoModal.module-DJym6u4r.css +1 -0
  44. package/dist/assets/components/user/user_box/UserBox.module-DGKK1afI.css +1 -0
  45. package/dist/assets/components/user/user_box_small/UserBoxSmall.module-ibAw9gGE.css +1 -0
  46. package/dist/assets/components/user_content/content_footer/ContentFooter.module-ax3j7VNT.css +1 -0
  47. package/dist/assets/components/user_content/content_header/ContentHeader.module-B0VwpU-R.css +1 -0
  48. package/dist/assets/components/user_content/summary_content_box/SummaryContentBox.module-DdzWnPjq.css +1 -0
  49. package/dist/assets/components/user_content/use_report_content/ReportModal.module-BxF-D5C5.css +1 -0
  50. package/dist/assets/components/vote/suggestion_vote_box/SuggestionVoteBox.module-CZeQKWIw.css +1 -0
  51. package/dist/assets/components/vote/vote_box/VoteBox.module-D5sSSHpi.css +1 -0
  52. package/dist/assets/components/vote/vote_button/VoteButton.module-aP9ZrGSd.css +1 -0
  53. package/dist/components/action/back_link/BackLink.module.scss.js +1 -1
  54. package/dist/components/action/button/Button.module.scss.js +9 -9
  55. package/dist/components/action/icon_text_link/IconTextLink.module.scss.js +2 -2
  56. package/dist/components/argument/argument/Argument.js +112 -120
  57. package/dist/components/argument/argument/Argument.module.scss.js +40 -40
  58. package/dist/components/argument/argument/ReplyFooter.module.scss.js +8 -8
  59. package/dist/components/auth/auth_initializer/AuthInitializer.js +41 -59
  60. package/dist/components/auth/auth_modal/AuthModal.js +5 -6
  61. package/dist/components/auth/providers/FormAuth.js +3 -6
  62. package/dist/components/auth/providers/PasswordAuth.js +6 -6
  63. package/dist/components/auth/sso_form/SSOForm.js +88 -91
  64. package/dist/components/auth/sso_form/SSOForm.module.scss.js +20 -20
  65. package/dist/components/auth/use_auth/useAuthActions.js +24 -24
  66. package/dist/components/consultation/consultation_box/ConsultationBox.js +3 -4
  67. package/dist/components/consultation/consultation_box/ConsultationBox.module.scss.js +25 -25
  68. package/dist/components/debate/debate_box/DebateBox.module.scss.js +20 -20
  69. package/dist/components/dialog/dialog_box/DialogBox.module.scss.js +14 -14
  70. package/dist/components/dialog/dropdown/Dropdown.js +17 -19
  71. package/dist/components/dialog/dropdown/Dropdown.module.scss.js +13 -17
  72. package/dist/components/dialog/modal/Modal.module.scss.js +9 -9
  73. package/dist/components/dialog/toast/Toast.module.scss.js +18 -18
  74. package/dist/components/dialog/tooltip/Tooltip.module.scss.js +8 -8
  75. package/dist/components/embed/embed_header/EmbedHeader.module.scss.js +18 -18
  76. package/dist/components/follow/follow_button/FollowButton.module.scss.js +1 -1
  77. package/dist/components/forms/use_form_validation/useFormValidation.js +1 -1
  78. package/dist/components/gamification/badge_box/BadgeBox.module.scss.js +18 -18
  79. package/dist/components/gamification/point_box/PointBox.module.scss.js +1 -1
  80. package/dist/components/information/information_box/InformationBox.module.scss.js +4 -4
  81. package/dist/components/input/argument_input/ArgumentInput.js +167 -172
  82. package/dist/components/input/text_editor/TextEditor.js +47 -49
  83. package/dist/components/input/text_editor/TextEditor.module.scss.js +28 -28
  84. package/dist/components/input/text_editor/plugins/ToolbarPlugin.js +94 -143
  85. package/dist/components/input/text_editor/plugins/ToolbarPlugin.module.scss.js +19 -19
  86. package/dist/components/input/toggle_position/TogglePosition.module.scss.js +4 -4
  87. package/dist/components/list/paginated_list/PaginatedList.js +124 -134
  88. package/dist/components/list/paginated_list/action_bar/ActionBar.module.scss.js +12 -12
  89. package/dist/components/navbar/navbar_modal/NavbarModal.js +14 -14
  90. package/dist/components/navigation/tabs/Tabs.js +24 -85
  91. package/dist/components/navigation/tabs/Tabs.module.scss.js +9 -19
  92. package/dist/components/notification/notification_item/NotificationItem.module.scss.js +5 -5
  93. package/dist/components/notification/notification_menu/NotificationMenu.module.scss.js +2 -2
  94. package/dist/components/progress/progress_bar/ProgressBar.module.scss.js +10 -10
  95. package/dist/components/proposal/proposal_box/ProposalBox.js +56 -58
  96. package/dist/components/proposal/proposal_box/ProposalBox.module.scss.js +1 -1
  97. package/dist/components/section/section_box/SectionBox.module.scss.js +12 -12
  98. package/dist/components/share/share_button/ShareButton.js +24 -26
  99. package/dist/components/share/share_button/ShareButton.module.scss.js +3 -5
  100. package/dist/components/skeleton/user_content_skeleton/UserContentSkeleton.module.scss.js +4 -4
  101. package/dist/components/source/context_source_box/ContextSourceBox.module.scss.js +4 -4
  102. package/dist/components/source/context_source_list/ContextSourceList.module.scss.js +5 -5
  103. package/dist/components/source/source_box/SourceBox.module.scss.js +8 -8
  104. package/dist/components/source/source_list_item/SourceListItem.module.scss.js +5 -7
  105. package/dist/components/suggestion/suggestion_banner/SuggestionBanner.module.scss.js +5 -5
  106. package/dist/components/suggestion/suggestion_box/SuggestionBox.module.scss.js +1 -1
  107. package/dist/components/suggestion/suggestion_input/SuggestionInput.module.scss.js +9 -9
  108. package/dist/components/summary/argument_summary_box/ArgumentSummaryBox.module.scss.js +10 -10
  109. package/dist/components/summary/keyword_box/KeywordBox.module.scss.js +1 -1
  110. package/dist/components/summary/summary_box/SummaryBox.module.scss.js +8 -8
  111. package/dist/components/text/read_more/ReadMore.module.scss.js +4 -4
  112. package/dist/components/user/author_box/AuthorBox.js +17 -18
  113. package/dist/components/user/author_box/AuthorBox.module.scss.js +24 -24
  114. package/dist/components/user/{onboarding_modal/OnboardingModal.js → update_user_info_modal/UpdateUserInfoModal.js} +110 -115
  115. package/dist/components/user/update_user_info_modal/UpdateUserInfoModal.module.scss.js +29 -0
  116. package/dist/components/user/update_user_info_modal/useUpdateUserInfo.js +27 -0
  117. package/dist/components/user/user_box/UserBox.js +38 -48
  118. package/dist/components/user/user_box/UserBox.module.scss.js +9 -9
  119. package/dist/components/user/user_box_small/UserBoxSmall.js +18 -19
  120. package/dist/components/user/user_box_small/UserBoxSmall.module.scss.js +6 -6
  121. package/dist/components/user_content/content_footer/ContentFooter.js +92 -95
  122. package/dist/components/user_content/content_footer/ContentFooter.module.scss.js +11 -11
  123. package/dist/components/user_content/content_header/ContentHeader.module.scss.js +22 -22
  124. package/dist/components/user_content/summary_content_box/SummaryContentBox.module.scss.js +1 -1
  125. package/dist/components/user_content/use_report_content/ReportModal.module.scss.js +8 -8
  126. package/dist/components/vote/suggestion_vote_box/SuggestionVoteBox.module.scss.js +1 -1
  127. package/dist/components/vote/vote_box/VoteBox.module.scss.js +42 -42
  128. package/dist/components/vote/vote_button/VoteButton.module.scss.js +5 -5
  129. package/dist/index.js +320 -324
  130. package/package.json +1 -1
  131. package/dist/assets/components/action/back_link/BackLink.module-B9Ok2t4H.css +0 -1
  132. package/dist/assets/components/action/button/Button.module-D7nbgOES.css +0 -1
  133. package/dist/assets/components/action/icon_text_link/IconTextLink.module-CZKufK9Y.css +0 -1
  134. package/dist/assets/components/argument/argument/Argument.module-CC40BY1L.css +0 -1
  135. package/dist/assets/components/argument/argument/ReplyFooter.module-CoC9dY8T.css +0 -1
  136. package/dist/assets/components/auth/sso_form/SSOForm.module-DOw9cmCF.css +0 -1
  137. package/dist/assets/components/consultation/consultation_box/ConsultationBox.module-97r47y_e.css +0 -1
  138. package/dist/assets/components/debate/debate_box/DebateBox.module-emnqIGNF.css +0 -1
  139. package/dist/assets/components/dialog/dialog_box/DialogBox.module-ZoM8d2Ly.css +0 -1
  140. package/dist/assets/components/dialog/dropdown/Dropdown.module-BmT3rAwz.css +0 -1
  141. package/dist/assets/components/dialog/modal/Modal.module-Dt4SWx6U.css +0 -1
  142. package/dist/assets/components/dialog/toast/Toast.module-CW6j5xe7.css +0 -1
  143. package/dist/assets/components/dialog/tooltip/Tooltip.module-bQbmPiMf.css +0 -1
  144. package/dist/assets/components/embed/embed_header/EmbedHeader.module-C8RPiVBp.css +0 -1
  145. package/dist/assets/components/follow/follow_button/FollowButton.module-BjwLVTeb.css +0 -1
  146. package/dist/assets/components/gamification/badge_box/BadgeBox.module-DWqqtICw.css +0 -1
  147. package/dist/assets/components/information/information_box/InformationBox.module-DJLT957y.css +0 -1
  148. package/dist/assets/components/input/text_editor/TextEditor.module-KPtqT1Y6.css +0 -1
  149. package/dist/assets/components/input/text_editor/plugins/ToolbarPlugin.module-C3yG2biv.css +0 -1
  150. package/dist/assets/components/input/toggle_position/TogglePosition.module-H4gGmJ0V.css +0 -1
  151. package/dist/assets/components/list/paginated_list/action_bar/ActionBar.module-BDMBrj2Y.css +0 -1
  152. package/dist/assets/components/navigation/tabs/Tabs.module-50P6bk0B.css +0 -1
  153. package/dist/assets/components/notification/notification_item/NotificationItem.module-BQcDopYB.css +0 -1
  154. package/dist/assets/components/notification/notification_menu/NotificationMenu.module-DrCrfzVk.css +0 -1
  155. package/dist/assets/components/progress/progress_bar/ProgressBar.module-DoCH9Qoo.css +0 -1
  156. package/dist/assets/components/proposal/proposal_box/ProposalBox.module-D1ccjSLm.css +0 -1
  157. package/dist/assets/components/section/section_box/SectionBox.module-DF7k7Vxq.css +0 -1
  158. package/dist/assets/components/skeleton/user_content_skeleton/UserContentSkeleton.module-d4r3QpYe.css +0 -1
  159. package/dist/assets/components/source/context_source_box/ContextSourceBox.module-doiSb_NR.css +0 -1
  160. package/dist/assets/components/source/context_source_list/ContextSourceList.module-Df4z4DN-.css +0 -1
  161. package/dist/assets/components/source/source_box/SourceBox.module-CQOBgJ5n.css +0 -1
  162. package/dist/assets/components/source/source_list_item/SourceListItem.module-C5YDjksb.css +0 -1
  163. package/dist/assets/components/suggestion/suggestion_banner/SuggestionBanner.module-P95xqaUA.css +0 -1
  164. package/dist/assets/components/suggestion/suggestion_box/SuggestionBox.module-CE_Wvk-K.css +0 -1
  165. package/dist/assets/components/suggestion/suggestion_input/SuggestionInput.module-r5N57bDp.css +0 -1
  166. package/dist/assets/components/summary/argument_summary_box/ArgumentSummaryBox.module-EDxcqwRa.css +0 -1
  167. package/dist/assets/components/summary/keyword_box/KeywordBox.module-yNHAvcRh.css +0 -1
  168. package/dist/assets/components/summary/summary_box/SummaryBox.module-Bu-AnMIG.css +0 -1
  169. package/dist/assets/components/text/read_more/ReadMore.module-Bs-YaspR.css +0 -1
  170. package/dist/assets/components/user/author_box/AuthorBox.module-B8Sl2v33.css +0 -1
  171. package/dist/assets/components/user/onboarding_modal/OnboardingModal.module-CTpt3xSh.css +0 -1
  172. package/dist/assets/components/user/user_box/UserBox.module-DMFhZDAH.css +0 -1
  173. package/dist/assets/components/user/user_box_small/UserBoxSmall.module-D4Ut5xmS.css +0 -1
  174. package/dist/assets/components/user_content/content_footer/ContentFooter.module-9A9E8k5l.css +0 -1
  175. package/dist/assets/components/user_content/content_header/ContentHeader.module-CXO2IRui.css +0 -1
  176. package/dist/assets/components/user_content/summary_content_box/SummaryContentBox.module-CBlL2Xii.css +0 -1
  177. package/dist/assets/components/user_content/use_report_content/ReportModal.module-mjFuOdmL.css +0 -1
  178. package/dist/assets/components/vote/suggestion_vote_box/SuggestionVoteBox.module-CKFriPV5.css +0 -1
  179. package/dist/assets/components/vote/vote_box/VoteBox.module-Bv7WY_vr.css +0 -1
  180. package/dist/assets/components/vote/vote_button/VoteButton.module-DqD79xv_.css +0 -1
  181. package/dist/components/auth/use_auth/base64.js +0 -4
  182. package/dist/components/icons/clarin_icons/Alarm.js +0 -6
  183. package/dist/components/icons/clarin_icons/Announcement.js +0 -6
  184. package/dist/components/icons/clarin_icons/Chat.js +0 -6
  185. package/dist/components/icons/clarin_icons/CheckCircle.js +0 -9
  186. package/dist/components/icons/clarin_icons/Clock.js +0 -6
  187. package/dist/components/icons/clarin_icons/Follow.js +0 -6
  188. package/dist/components/icons/clarin_icons/MobileClose.js +0 -9
  189. package/dist/components/icons/clarin_icons/Question.js +0 -6
  190. package/dist/components/icons/clarin_icons/Search.js +0 -6
  191. package/dist/components/icons/clarin_icons/Send.js +0 -6
  192. package/dist/components/icons/clarin_icons/Share.js +0 -6
  193. package/dist/components/icons/clarin_icons/Upvote.js +0 -9
  194. package/dist/components/icons/clarin_icons/User.js +0 -9
  195. package/dist/components/icons/clarin_icons/index.js +0 -106
  196. package/dist/components/input/text_editor/plugins/IOSInsertParagraphFallbackPlugin.js +0 -34
  197. package/dist/components/user/onboarding_modal/OnboardingModal.module.scss.js +0 -29
  198. package/dist/components/user/onboarding_modal/useOnboarding.js +0 -27
@@ -1,70 +1,52 @@
1
- import { jsx as l, Fragment as y } from "react/jsx-runtime";
2
- import { useState as I, useEffect as g } from "react";
3
- import { useConfig as L } from "../../data/config_provider/useConfig.js";
4
- import { useDataProvider as O } from "../../data/data_provider/useDataProvider.js";
5
- import { useAuthInterceptor as q } from "../use_auth/useAuthInterceptor.js";
6
- import { authTokenHandler as S } from "../use_auth/authTokenHandler.js";
7
- import { useAuthActions as T } from "../use_auth/useAuthActions.js";
8
- import { useAuthRequired as _ } from "../../hooks/use_auth_required/useAuthRequired.js";
9
- import { useAuth as z } from "../use_auth/useAuth.js";
10
- import { AuthProviderFactory as M } from "../providers/AuthProviderFactory.js";
11
- import { OnboardingModal as j } from "../../user/onboarding_modal/OnboardingModal.js";
12
- import { httpClient as u } from "../../data/axios_client/httpClient.js";
13
- const X = ({ authUrl: n, authType: i, provider: p, assertion: w }) => {
14
- const s = "logora_user_token", e = L(), v = O();
15
- q(u, n, s);
16
- const [A, c] = I(!1), { getToken: C, removeToken: P } = S(
17
- u,
1
+ import { useEffect as u } from "react";
2
+ import { useAuthInterceptor as v } from "../use_auth/useAuthInterceptor.js";
3
+ import { authTokenHandler as w } from "../use_auth/authTokenHandler.js";
4
+ import { useAuthActions as q } from "../use_auth/useAuthActions.js";
5
+ import { useAuthRequired as I } from "../../hooks/use_auth_required/useAuthRequired.js";
6
+ import { AuthProviderFactory as P } from "../providers/AuthProviderFactory.js";
7
+ import { httpClient as n } from "../../data/axios_client/httpClient.js";
8
+ const U = ({ authUrl: o, authType: c, provider: a, assertion: m }) => {
9
+ const r = "logora_user_token";
10
+ v(n, o, r);
11
+ const { getToken: f, removeToken: h } = w(
18
12
  n,
19
- s
20
- ), { loginUser: m, logoutUser: b, fetchUser: k } = T(
21
- u,
13
+ o,
14
+ r
15
+ ), { loginUser: d, logoutUser: l, fetchUser: A } = q(
22
16
  n,
23
- s
24
- ), h = _(), { setIsLoggingIn: x, currentUser: E } = z();
25
- g(() => {
26
- a();
27
- }, []), g(() => {
17
+ o,
18
+ r
19
+ ), i = I();
20
+ u(() => {
21
+ p();
22
+ }, []), u(() => {
28
23
  if (typeof window < "u")
29
- return window.addEventListener("logora:authentication:require", h), window.addEventListener("logora:authentication:refresh", a), () => {
30
- window.removeEventListener("logora:authentication:require", h), window.removeEventListener("logora:authentication:refresh", a);
24
+ return window.addEventListener(
25
+ "logora:authentication:require",
26
+ i
27
+ ), () => {
28
+ window.removeEventListener(
29
+ "logora:authentication:require",
30
+ i
31
+ );
31
32
  };
32
33
  }, []);
33
- const a = () => {
34
- const o = f(), t = C();
34
+ const p = () => {
35
+ const e = g(), t = f();
35
36
  if (t) {
36
- const r = t.session_id;
37
- o.isSameUser(r) ? k() : (P(), d(o));
37
+ const k = t.session_id;
38
+ e.isSameUser(k) ? A() : (h(), s(e));
38
39
  } else
39
- d(o);
40
- }, d = (o) => {
41
- if (o.shouldInitAuth()) {
42
- const t = o.getAuthorizationParams();
43
- if (t) {
44
- if (i !== "social" && i !== "oauth2_server" && e.auth?.showOnboardingBeforeLogin === !0) {
45
- c(!0);
46
- return;
47
- }
48
- m(t);
49
- }
40
+ s(e);
41
+ }, s = (e) => {
42
+ if (e.shouldInitAuth()) {
43
+ const t = e.getAuthorizationParams();
44
+ t && d(t);
50
45
  } else
51
- b();
52
- }, U = async (o) => {
53
- const r = f().getAuthorizationParams();
54
- await m(r), await v.update("users", E.slug, o), c(!1);
55
- }, f = () => M.create(i, p, w);
56
- return /* @__PURE__ */ l(y, { children: A && /* @__PURE__ */ l(
57
- j,
58
- {
59
- pendingAuth: !0,
60
- onConsentConfirmed: U,
61
- showTerms: e.auth?.hideCgu !== !0,
62
- showEmailConsent: e.auth?.showEmailConsent,
63
- termsUrl: e.provider?.cguUrl || "https://www.logora.com/blog-posts/cgu",
64
- privacyUrl: e.provider?.privacyUrl || "https://www.logora.com/blog-posts/privacy-policy"
65
- }
66
- ) });
46
+ l();
47
+ }, g = () => P.create(c, a, m);
48
+ return null;
67
49
  };
68
50
  export {
69
- X as AuthInitializer
51
+ U as AuthInitializer
70
52
  };
@@ -5,15 +5,15 @@ import { useConfig as I } from "../../data/config_provider/useConfig.js";
5
5
  import { useModal as y } from "../../dialog/modal/useModal.js";
6
6
  import { useAuth as C } from "../use_auth/useAuth.js";
7
7
  import { useAuthActions as E } from "../use_auth/useAuthActions.js";
8
- import { httpClient as T } from "../../data/axios_client/httpClient.js";
9
- import { Modal as P } from "../../dialog/modal/Modal.js";
8
+ import { httpClient as P } from "../../data/axios_client/httpClient.js";
9
+ import { Modal as T } from "../../dialog/modal/Modal.js";
10
10
  import { Loader as R } from "../../progress/loader/Loader.js";
11
11
  import { SocialAuthForm as B } from "../social_auth_form/SocialAuthForm.js";
12
12
  import { SSOForm as L } from "../sso_form/SSOForm.js";
13
13
  import { AuthProviderFactory as M } from "../providers/AuthProviderFactory.js";
14
14
  const $ = ({ onHideModal: s = null }) => {
15
15
  const o = I(), { hideModal: c } = y(), { isLoggedIn: l, authError: r } = C(), [p, n] = h(!1), [e, d] = h(null), { loginUser: g } = E(
16
- T,
16
+ P,
17
17
  process.env.API_AUTH_URL,
18
18
  "logora_user_token"
19
19
  );
@@ -35,7 +35,7 @@ const $ = ({ onHideModal: s = null }) => {
35
35
  ).getAuthorizationParams();
36
36
  g(v);
37
37
  };
38
- return /* @__PURE__ */ t(P, { "data-vid": "login_modal", children: /* @__PURE__ */ t("div", { className: w.loginModalBody, children: p ? /* @__PURE__ */ t(R, {}) : /* @__PURE__ */ t(_, { children: o.auth.type === "form" || o.auth.type === "social" ? /* @__PURE__ */ t(
38
+ return /* @__PURE__ */ t(T, { "data-vid": "login_modal", children: /* @__PURE__ */ t("div", { className: w.loginModalBody, children: p ? /* @__PURE__ */ t(R, {}) : /* @__PURE__ */ t(_, { children: o.auth.type === "form" || o.auth.type === "social" ? /* @__PURE__ */ t(
39
39
  B,
40
40
  {
41
41
  onSubmit: A,
@@ -69,8 +69,7 @@ const $ = ({ onHideModal: s = null }) => {
69
69
  hideLoginButton: o.auth.hideModalLoginButton,
70
70
  showEmailConsent: o.auth.showEmailConsent,
71
71
  showTerms: o.auth.hideCgu !== !0,
72
- hideBelowButton: o.auth.hideBelowButton,
73
- hideTerms: o.auth.hideTerms
72
+ hideBelowButton: o.auth.hideBelowButton
74
73
  }
75
74
  ) }) }) });
76
75
  };
@@ -1,6 +1,5 @@
1
1
  import { AuthProvider as s } from "./AuthProvider.js";
2
- import { utf8ToBase64url as e } from "../use_auth/base64.js";
3
- class u extends s {
2
+ class o extends s {
4
3
  constructor(t, r) {
5
4
  super(), this.providerName = t, this.userData = r;
6
5
  }
@@ -12,10 +11,8 @@ class u extends s {
12
11
  return !0;
13
12
  }
14
13
  getAssertion() {
15
- if (!this.userData || typeof this.userData != "object")
16
- return null;
17
14
  const t = JSON.stringify(this.userData);
18
- return e(t);
15
+ return btoa(t);
19
16
  }
20
17
  getAuthorizationParams() {
21
18
  return {
@@ -28,5 +25,5 @@ class u extends s {
28
25
  }
29
26
  }
30
27
  export {
31
- u as FormAuth
28
+ o as FormAuth
32
29
  };
@@ -1,17 +1,17 @@
1
- import { AuthProvider as t } from "./AuthProvider.js";
2
- class i extends t {
3
- constructor(s, r) {
4
- super(), this.providerName = s, this.userData = r;
1
+ import { AuthProvider as e } from "./AuthProvider.js";
2
+ class i extends e {
3
+ constructor(r, s) {
4
+ super(), this.providerName = r, this.userData = s;
5
5
  }
6
6
  shouldInitAuth() {
7
7
  return !!this.userData;
8
8
  }
9
9
  getSessionId = () => null;
10
- isSameUser(s) {
10
+ isSameUser(r) {
11
11
  return !0;
12
12
  }
13
13
  getAuthorizationParams() {
14
- return !this.userData?.email || !this.userData?.password ? null : {
14
+ return {
15
15
  grant_type: "password",
16
16
  username: this.userData.email,
17
17
  password: this.userData.password,
@@ -1,17 +1,17 @@
1
- import { jsxs as o, jsx as e, Fragment as d } from "react/jsx-runtime";
2
- import D from "@rooks/use-sessionstorage-state";
3
- import Y from "classnames";
1
+ import { jsxs as n, jsx as e, Fragment as m } from "react/jsx-runtime";
2
+ import G from "@rooks/use-sessionstorage-state";
3
+ import D from "classnames";
4
4
  import "react";
5
- import { useIntl as z, FormattedMessage as w } from "react-intl";
6
- import { useLocation as H } from "react-router";
5
+ import { useIntl as Y, FormattedMessage as w } from "react-intl";
6
+ import { useLocation as z } from "react-router";
7
7
  import a from "./SSOForm.module.scss.js";
8
- import { EMAIL_CONSENT_STORAGE_KEY as K } from "../use_auth/useAuthActions.js";
9
- import { Icon as V } from "../../icons/icon/Icon.js";
10
- import { Button as W } from "../../action/button/Button.js";
11
- import { Toggle as $ } from "../../input/toggle/Toggle.js";
12
- const ne = ({
8
+ import { EMAIL_CONSENT_STORAGE_KEY as H } from "../use_auth/useAuthActions.js";
9
+ import { Icon as K } from "../../icons/icon/Icon.js";
10
+ import { Button as V } from "../../action/button/Button.js";
11
+ import { Toggle as W } from "../../input/toggle/Toggle.js";
12
+ const oe = ({
13
13
  authType: v,
14
- providerName: c,
14
+ providerName: d,
15
15
  loginUrl: M,
16
16
  signupUrl: b,
17
17
  termsUrl: N,
@@ -26,27 +26,26 @@ const ne = ({
26
26
  showEmailConsent: g = !1,
27
27
  showTerms: L = !1,
28
28
  hideBelowButton: R = !1,
29
- hideTerms: x = !1,
30
- error: A = !1
29
+ error: x = !1
31
30
  }) => {
32
- const [h, C] = g ? D(K, !1) : [!1, () => {
33
- }], n = z(), m = H(), T = (t) => {
31
+ const [h, A] = g ? G(H, !1) : [!1, () => {
32
+ }], o = Y(), c = z(), C = (t) => {
34
33
  if (typeof window < "u") {
35
- const s = t === "CURRENT_LOCATION" ? window.location : t, i = new URL(s, window.location.origin), l = i.searchParams, F = new URLSearchParams(m.search);
34
+ const s = t === "CURRENT_LOCATION" ? window.location : t, i = new URL(s, window.location.origin), l = i.searchParams, E = new URLSearchParams(c.search);
36
35
  l.has("code") && l.delete("code"), f && l.append(f, window.location.toString());
37
- for (const [_, j] of Object.entries(U)) {
38
- let r = j;
36
+ for (const [_, F] of Object.entries(U)) {
37
+ let r = F;
39
38
  if (r) {
40
- const G = m.pathname.slice(
39
+ const j = c.pathname.slice(
41
40
  0,
42
- m.pathname.lastIndexOf("/")
41
+ c.pathname.lastIndexOf("/")
43
42
  );
44
43
  r = r.replace(
45
44
  "{{UTM_CAMPAIGN}}",
46
- F.get("utm_campaign")
45
+ E.get("utm_campaign")
47
46
  ), r = r.replace(
48
47
  "{{CURRENT_PATH}}",
49
- decodeURIComponent(G)
48
+ decodeURIComponent(j)
50
49
  );
51
50
  }
52
51
  _ === "metadata" && r && (r = window.btoa(r)), l.append(_, encodeURIComponent(r));
@@ -54,15 +53,15 @@ const ne = ({
54
53
  return i.search = l.toString(), i.toString();
55
54
  }
56
55
  return "";
57
- }, O = (t) => {
56
+ }, T = (t) => {
58
57
  const s = new URL(t);
59
58
  if (s.searchParams.delete("code"), s.searchParams.append("client_id", S), s.searchParams.append("redirect_uri", y), s.searchParams.append("scope", I), s.searchParams.append("response_type", "code"), typeof window < "u") {
60
59
  const i = new URL(window.location.href);
61
60
  i.searchParams.delete("code"), s.searchParams.append("state", window.btoa(i.toString()));
62
61
  }
63
62
  return s.href;
64
- }, p = (t) => v === "oauth2_server" ? O(t) : T(t), B = p(M), E = p(b);
65
- return /* @__PURE__ */ o("div", { className: a.ssoForm, children: [
63
+ }, p = (t) => v === "oauth2_server" ? T(t) : C(t), O = p(M), B = p(b);
64
+ return /* @__PURE__ */ n("div", { className: a.ssoForm, children: [
66
65
  /* @__PURE__ */ e("div", { className: a.logo, children: u ? /* @__PURE__ */ e(
67
66
  "img",
68
67
  {
@@ -70,10 +69,10 @@ const ne = ({
70
69
  width: 100,
71
70
  className: a.logoImage,
72
71
  src: u,
73
- alt: `Logo ${c}`
72
+ alt: `Logo ${d}`
74
73
  }
75
74
  ) : /* @__PURE__ */ e(
76
- V,
75
+ K,
77
76
  {
78
77
  name: "next",
79
78
  "aria-hidden": "true",
@@ -82,41 +81,41 @@ const ne = ({
82
81
  className: a.loginIcon
83
82
  }
84
83
  ) }),
85
- /* @__PURE__ */ o("div", { className: a.mainText, children: [
86
- /* @__PURE__ */ o("div", { className: a.title, children: [
87
- n.formatMessage({
84
+ /* @__PURE__ */ n("div", { className: a.mainText, children: [
85
+ /* @__PURE__ */ n("div", { className: a.title, children: [
86
+ o.formatMessage({
88
87
  id: "auth.sso_form.title",
89
88
  defaultMessage: "Debate now !"
90
89
  }),
91
90
  /* @__PURE__ */ e("br", {})
92
91
  ] }),
93
- n.formatMessage(
92
+ o.formatMessage(
94
93
  {
95
94
  id: "auth.sso_form.subtitle",
96
95
  defaultMessage: "Sign up right now and receive alerts by email."
97
96
  },
98
- { provider: c }
97
+ { provider: d }
99
98
  )
100
99
  ] }),
101
- P ? null : /* @__PURE__ */ o(d, { children: [
100
+ P ? null : /* @__PURE__ */ n(m, { children: [
102
101
  /* @__PURE__ */ e(
103
- W,
102
+ V,
104
103
  {
105
104
  "data-tid": "link_signup",
106
105
  "data-testid": "signup-button",
107
106
  className: a.loginButton,
108
- to: E,
107
+ to: B,
109
108
  external: !0,
110
109
  border: !1,
111
- children: n.formatMessage({
110
+ children: o.formatMessage({
112
111
  id: "auth.sso_form.signup",
113
112
  defaultMessage: "Sign up"
114
113
  })
115
114
  }
116
115
  ),
117
- R ? null : /* @__PURE__ */ o(d, { children: [
118
- k === !0 ? null : /* @__PURE__ */ o("div", { className: a.cgu, children: [
119
- n.formatMessage({
116
+ R ? null : /* @__PURE__ */ n(m, { children: [
117
+ k === !0 ? null : /* @__PURE__ */ n("div", { className: a.cgu, children: [
118
+ o.formatMessage({
120
119
  id: "auth.sso_form.already_account",
121
120
  defaultMessage: "Already have an account ?"
122
121
  }),
@@ -127,70 +126,68 @@ const ne = ({
127
126
  "data-testid": "signin-link",
128
127
  "data-tid": "link_login",
129
128
  rel: "nofollow",
130
- href: B,
131
- children: n.formatMessage({
129
+ href: O,
130
+ children: o.formatMessage({
132
131
  id: "auth.sso_form.signin",
133
132
  defaultMessage: "Sign in"
134
133
  })
135
134
  }
136
135
  )
137
136
  ] }),
138
- x ? null : /* @__PURE__ */ o(d, { children: [
139
- g ? /* @__PURE__ */ e("div", { className: Y(a.switchBox), children: /* @__PURE__ */ e(
140
- $,
141
- {
142
- type: "checkbox",
143
- name: "accepts_provider_email",
144
- style: { fontSize: 18 },
145
- checked: h,
146
- label: n.formatMessage(
147
- {
148
- id: "auth.sso_form.consent_label",
149
- defaultMessage: "I agree to receive emails from the editor"
150
- },
151
- { variable: c }
152
- ),
153
- onInputChanged: (t) => C(!h),
154
- "data-testid": "accepts-email-input"
155
- }
156
- ) }) : null,
157
- A ? /* @__PURE__ */ e("div", { className: a.error, children: n.formatMessage({
158
- id: "auth.sso_form.error",
159
- defaultMessage: "An error occurred during sign in. Please try again in a few moments."
160
- }) }) : null,
161
- L && /* @__PURE__ */ o(d, { children: [
162
- /* @__PURE__ */ e("div", { className: a.cguButton, children: /* @__PURE__ */ e(
163
- w,
164
- {
165
- id: "auth.sso_form.terms",
166
- defaultMessage: "By clicking on « Sign up », I declare that I have read the <var1> General Conditions of Use </var1> of the debate space and accept them",
167
- values: {
168
- var1: (t) => /* @__PURE__ */ e(
169
- "a",
170
- {
171
- className: a.termsTarget,
172
- target: "_blank",
173
- href: N,
174
- rel: "noreferrer",
175
- children: t
176
- }
177
- )
178
- }
179
- }
180
- ) }),
181
- /* @__PURE__ */ e("div", { className: a.cguButton, children: /* @__PURE__ */ e(
182
- w,
137
+ g ? /* @__PURE__ */ e("div", { className: D(a.switchBox), children: /* @__PURE__ */ e(
138
+ W,
139
+ {
140
+ type: "checkbox",
141
+ name: "accepts_provider_email",
142
+ style: { fontSize: 18 },
143
+ checked: h,
144
+ label: o.formatMessage(
183
145
  {
184
- id: "auth.sso_form.data_terms",
185
- defaultMessage: "Your personal data are being processed by the Editor. For more information and to exercise your rights, see our personal data policy available on the site."
146
+ id: "auth.sso_form.consent_label",
147
+ defaultMessage: "I agree to receive emails from the editor"
148
+ },
149
+ { variable: d }
150
+ ),
151
+ onInputChanged: (t) => A(!h),
152
+ "data-testid": "accepts-email-input"
153
+ }
154
+ ) }) : null,
155
+ x ? /* @__PURE__ */ e("div", { className: a.error, children: o.formatMessage({
156
+ id: "auth.sso_form.error",
157
+ defaultMessage: "An error occurred during sign in. Please try again in a few moments."
158
+ }) }) : null,
159
+ L && /* @__PURE__ */ n(m, { children: [
160
+ /* @__PURE__ */ e("div", { className: a.cguButton, children: /* @__PURE__ */ e(
161
+ w,
162
+ {
163
+ id: "auth.sso_form.terms",
164
+ defaultMessage: "By clicking on « Sign up », I declare that I have read the <var1> General Conditions of Use </var1> of the debate space and accept them",
165
+ values: {
166
+ var1: (t) => /* @__PURE__ */ e(
167
+ "a",
168
+ {
169
+ className: a.termsTarget,
170
+ target: "_blank",
171
+ href: N,
172
+ rel: "noreferrer",
173
+ children: t
174
+ }
175
+ )
186
176
  }
187
- ) })
188
- ] })
177
+ }
178
+ ) }),
179
+ /* @__PURE__ */ e("div", { className: a.cguButton, children: /* @__PURE__ */ e(
180
+ w,
181
+ {
182
+ id: "auth.sso_form.data_terms",
183
+ defaultMessage: "Your personal data are being processed by the Editor. For more information and to exercise your rights, see our personal data policy available on the site."
184
+ }
185
+ ) })
189
186
  ] })
190
187
  ] })
191
188
  ] })
192
189
  ] });
193
190
  };
194
191
  export {
195
- ne as SSOForm
192
+ oe as SSOForm
196
193
  };
@@ -1,31 +1,31 @@
1
- import '../../../assets/components/auth/sso_form/SSOForm.module-DOw9cmCF.css';const o = "_ssoForm_idw02_3", t = "_logo_idw02_9", _ = "_logoImage_idw02_21", n = "_loginIcon_idw02_27", s = "_mainText_idw02_41", i = "_title_idw02_66", g = "_loginButton_idw02_72", c = "_cgu_idw02_77", e = "_signupButton_idw02_102", r = "_cguButton_idw02_109", u = "_switchBox_idw02_122", l = "_error_idw02_127", w = "_termsTarget_idw02_132", d = {
1
+ import '../../../assets/components/auth/sso_form/SSOForm.module-D5v2TrOv.css';const o = "_ssoForm_p3zvc_3", t = "_logo_p3zvc_9", c = "_logoImage_p3zvc_21", _ = "_loginIcon_p3zvc_27", n = "_mainText_p3zvc_41", s = "_title_p3zvc_65", g = "_loginButton_p3zvc_70", e = "_cgu_p3zvc_75", r = "_signupButton_p3zvc_99", u = "_cguButton_p3zvc_106", i = "_switchBox_p3zvc_118", l = "_error_p3zvc_123", p = "_termsTarget_p3zvc_128", v = {
2
2
  ssoForm: o,
3
3
  logo: t,
4
- logoImage: _,
5
- loginIcon: n,
6
- mainText: s,
7
- title: i,
4
+ logoImage: c,
5
+ loginIcon: _,
6
+ mainText: n,
7
+ title: s,
8
8
  loginButton: g,
9
- cgu: c,
10
- signupButton: e,
11
- cguButton: r,
12
- switchBox: u,
9
+ cgu: e,
10
+ signupButton: r,
11
+ cguButton: u,
12
+ switchBox: i,
13
13
  error: l,
14
- termsTarget: w
14
+ termsTarget: p
15
15
  };
16
16
  export {
17
- c as cgu,
18
- r as cguButton,
19
- d as default,
17
+ e as cgu,
18
+ u as cguButton,
19
+ v as default,
20
20
  l as error,
21
21
  g as loginButton,
22
- n as loginIcon,
22
+ _ as loginIcon,
23
23
  t as logo,
24
- _ as logoImage,
25
- s as mainText,
26
- e as signupButton,
24
+ c as logoImage,
25
+ n as mainText,
26
+ r as signupButton,
27
27
  o as ssoForm,
28
- u as switchBox,
29
- w as termsTarget,
30
- i as title
28
+ i as switchBox,
29
+ p as termsTarget,
30
+ s as title
31
31
  };
@@ -1,30 +1,30 @@
1
1
  import { authTokenHandler as E } from "./authTokenHandler.js";
2
2
  import { useAuth as w } from "./useAuth.js";
3
3
  import { useDataProvider as v } from "../../data/data_provider/useDataProvider.js";
4
- const A = "logora:emailConsent", L = (c, u, f) => {
5
- const { removeToken: a, fetchToken: d } = E(
6
- c,
4
+ const I = "logora:emailConsent", L = (i, u, d) => {
5
+ const { removeToken: r, fetchToken: f } = E(
6
+ i,
7
7
  u,
8
- f
9
- ), { setCurrentUser: n, setIsLoggedIn: s, setIsLoggingIn: t, setAuthError: r } = w(), l = v(), h = (e) => {
10
- if (!e) {
11
- r(!0), t(!1);
12
- return;
13
- }
14
- return d(e).then((o) => i()).catch((o) => {
15
- r(o);
8
+ d
9
+ ), { setCurrentUser: o, setIsLoggedIn: n, setIsLoggingIn: s, setAuthError: a } = w(), h = v(), l = (e) => {
10
+ f(e).then((t) => {
11
+ c();
12
+ }).catch((t) => {
13
+ a(t);
16
14
  });
17
15
  }, g = () => {
18
- s(!1), t(!1), n({}), a(), sessionStorage.removeItem(A), p();
19
- }, i = () => l.getOneWithToken("me", "").then((e) => {
20
- if (e.data.success) {
21
- const o = e.data.data.resource;
22
- n(o), s(!0), t(!1), m(o);
23
- } else
24
- r(!0), s(!1), t(!1), n({}), a();
25
- }).catch((e) => {
26
- r(!0), s(!1), t(!1), n({}), a();
27
- }), m = (e) => {
16
+ n(!1), s(!1), o({}), r(), p();
17
+ }, c = () => {
18
+ h.getOneWithToken("me", "").then((e) => {
19
+ if (e.data.success) {
20
+ const t = e.data.data.resource;
21
+ o(t), n(!0), s(!1), m(t);
22
+ } else
23
+ a(!0), n(!1), s(!1), o({}), r();
24
+ }).catch((e) => {
25
+ a(!0), n(!1), s(!1), o({}), r();
26
+ });
27
+ }, m = (e) => {
28
28
  typeof window < "u" && window.dispatchEvent(
29
29
  new CustomEvent("logora:authentication:success", {
30
30
  detail: {
@@ -36,12 +36,12 @@ const A = "logora:emailConsent", L = (c, u, f) => {
36
36
  typeof window < "u" && window.dispatchEvent(new CustomEvent("logora:authentication:logout"));
37
37
  };
38
38
  return {
39
- loginUser: h,
39
+ loginUser: l,
40
40
  logoutUser: g,
41
- fetchUser: i
41
+ fetchUser: c
42
42
  };
43
43
  };
44
44
  export {
45
- A as EMAIL_CONSENT_STORAGE_KEY,
45
+ I as EMAIL_CONSENT_STORAGE_KEY,
46
46
  L as useAuthActions
47
47
  };
@@ -1,7 +1,7 @@
1
1
  import { jsx as t, Fragment as g, jsxs as s } from "react/jsx-runtime";
2
2
  import i from "classnames";
3
3
  import { useMemo as p } from "react";
4
- import { useIntl as h, FormattedMessage as f } from "react-intl";
4
+ import { useIntl as f, FormattedMessage as h } from "react-intl";
5
5
  import o from "./ConsultationBox.module.scss.js";
6
6
  import { useRoutes as v } from "../../data/config_provider/useRoutes.js";
7
7
  import { useResponsive as N } from "../../hooks/use_responsive/useResponsive.js";
@@ -11,7 +11,7 @@ import { Tooltip as m } from "../../dialog/tooltip/Tooltip.js";
11
11
  import { Icon as d } from "../../icons/icon/Icon.js";
12
12
  import { ProgressBar as x } from "../../progress/progress_bar/ProgressBar.js";
13
13
  const P = ({ consultation: e, showVoteProgress: u = !0 }) => {
14
- const a = h(), l = p(() => /* @__PURE__ */ new Date()), c = new Date(e.ends_at), n = v(), { isMobile: I } = N();
14
+ const a = f(), l = p(() => /* @__PURE__ */ new Date()), c = new Date(e.ends_at), n = v(), { isMobile: I } = N();
15
15
  return /* @__PURE__ */ t(g, { children: /* @__PURE__ */ s("div", { className: o.container, children: [
16
16
  /* @__PURE__ */ s("div", { className: o.consultationImageBox, children: [
17
17
  /* @__PURE__ */ t(
@@ -26,7 +26,6 @@ const P = ({ consultation: e, showVoteProgress: u = !0 }) => {
26
26
  loading: "lazy",
27
27
  className: o.consultationImage,
28
28
  src: e.image_url,
29
- height: 200,
30
29
  alt: a.formatMessage({
31
30
  id: "consultation.consultation_box.alt",
32
31
  defaultMessage: "Presentation image for the consultation"
@@ -36,7 +35,7 @@ const P = ({ consultation: e, showVoteProgress: u = !0 }) => {
36
35
  }
37
36
  ),
38
37
  e.ends_at && c < l && /* @__PURE__ */ t("div", { className: i(o.consultationTime, o.ended), children: /* @__PURE__ */ t("span", { children: /* @__PURE__ */ t(
39
- f,
38
+ h,
40
39
  {
41
40
  id: "consultation.consultation_box.consultation_ended",
42
41
  defaultMessage: "Consultation ended"