@logora/debate 0.4.41 → 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 (196) 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/providers/FormAuth.js +3 -6
  61. package/dist/components/auth/providers/PasswordAuth.js +6 -6
  62. package/dist/components/auth/sso_form/SSOForm.module.scss.js +20 -20
  63. package/dist/components/auth/use_auth/useAuthActions.js +24 -24
  64. package/dist/components/consultation/consultation_box/ConsultationBox.js +3 -4
  65. package/dist/components/consultation/consultation_box/ConsultationBox.module.scss.js +25 -25
  66. package/dist/components/debate/debate_box/DebateBox.module.scss.js +20 -20
  67. package/dist/components/dialog/dialog_box/DialogBox.module.scss.js +14 -14
  68. package/dist/components/dialog/dropdown/Dropdown.js +17 -19
  69. package/dist/components/dialog/dropdown/Dropdown.module.scss.js +13 -17
  70. package/dist/components/dialog/modal/Modal.module.scss.js +9 -9
  71. package/dist/components/dialog/toast/Toast.module.scss.js +18 -18
  72. package/dist/components/dialog/tooltip/Tooltip.module.scss.js +8 -8
  73. package/dist/components/embed/embed_header/EmbedHeader.module.scss.js +18 -18
  74. package/dist/components/follow/follow_button/FollowButton.module.scss.js +1 -1
  75. package/dist/components/forms/use_form_validation/useFormValidation.js +1 -1
  76. package/dist/components/gamification/badge_box/BadgeBox.module.scss.js +18 -18
  77. package/dist/components/gamification/point_box/PointBox.module.scss.js +1 -1
  78. package/dist/components/information/information_box/InformationBox.module.scss.js +4 -4
  79. package/dist/components/input/argument_input/ArgumentInput.js +167 -172
  80. package/dist/components/input/text_editor/TextEditor.js +47 -49
  81. package/dist/components/input/text_editor/TextEditor.module.scss.js +28 -28
  82. package/dist/components/input/text_editor/plugins/ToolbarPlugin.js +94 -143
  83. package/dist/components/input/text_editor/plugins/ToolbarPlugin.module.scss.js +19 -19
  84. package/dist/components/input/toggle_position/TogglePosition.module.scss.js +4 -4
  85. package/dist/components/list/paginated_list/PaginatedList.js +124 -134
  86. package/dist/components/list/paginated_list/action_bar/ActionBar.module.scss.js +12 -12
  87. package/dist/components/navbar/navbar_modal/NavbarModal.js +14 -14
  88. package/dist/components/navigation/tabs/Tabs.js +24 -85
  89. package/dist/components/navigation/tabs/Tabs.module.scss.js +9 -19
  90. package/dist/components/notification/notification_item/NotificationItem.module.scss.js +5 -5
  91. package/dist/components/notification/notification_menu/NotificationMenu.module.scss.js +2 -2
  92. package/dist/components/progress/progress_bar/ProgressBar.module.scss.js +10 -10
  93. package/dist/components/proposal/proposal_box/ProposalBox.js +56 -58
  94. package/dist/components/proposal/proposal_box/ProposalBox.module.scss.js +1 -1
  95. package/dist/components/section/section_box/SectionBox.module.scss.js +12 -12
  96. package/dist/components/share/share_button/ShareButton.js +24 -26
  97. package/dist/components/share/share_button/ShareButton.module.scss.js +3 -5
  98. package/dist/components/skeleton/user_content_skeleton/UserContentSkeleton.module.scss.js +4 -4
  99. package/dist/components/source/context_source_box/ContextSourceBox.module.scss.js +4 -4
  100. package/dist/components/source/context_source_list/ContextSourceList.module.scss.js +5 -5
  101. package/dist/components/source/source_box/SourceBox.module.scss.js +8 -8
  102. package/dist/components/source/source_list_item/SourceListItem.module.scss.js +5 -7
  103. package/dist/components/suggestion/suggestion_banner/SuggestionBanner.module.scss.js +5 -5
  104. package/dist/components/suggestion/suggestion_box/SuggestionBox.module.scss.js +1 -1
  105. package/dist/components/suggestion/suggestion_input/SuggestionInput.module.scss.js +9 -9
  106. package/dist/components/summary/argument_summary_box/ArgumentSummaryBox.module.scss.js +10 -10
  107. package/dist/components/summary/keyword_box/KeywordBox.module.scss.js +1 -1
  108. package/dist/components/summary/summary_box/SummaryBox.module.scss.js +8 -8
  109. package/dist/components/text/read_more/ReadMore.module.scss.js +4 -4
  110. package/dist/components/user/author_box/AuthorBox.js +17 -18
  111. package/dist/components/user/author_box/AuthorBox.module.scss.js +24 -24
  112. package/dist/components/user/{onboarding_modal/OnboardingModal.js → update_user_info_modal/UpdateUserInfoModal.js} +110 -115
  113. package/dist/components/user/update_user_info_modal/UpdateUserInfoModal.module.scss.js +29 -0
  114. package/dist/components/user/update_user_info_modal/useUpdateUserInfo.js +27 -0
  115. package/dist/components/user/user_box/UserBox.js +38 -48
  116. package/dist/components/user/user_box/UserBox.module.scss.js +9 -9
  117. package/dist/components/user/user_box_small/UserBoxSmall.js +18 -19
  118. package/dist/components/user/user_box_small/UserBoxSmall.module.scss.js +6 -6
  119. package/dist/components/user_content/content_footer/ContentFooter.js +92 -95
  120. package/dist/components/user_content/content_footer/ContentFooter.module.scss.js +11 -11
  121. package/dist/components/user_content/content_header/ContentHeader.module.scss.js +22 -22
  122. package/dist/components/user_content/summary_content_box/SummaryContentBox.module.scss.js +1 -1
  123. package/dist/components/user_content/use_report_content/ReportModal.module.scss.js +8 -8
  124. package/dist/components/vote/suggestion_vote_box/SuggestionVoteBox.module.scss.js +1 -1
  125. package/dist/components/vote/vote_box/VoteBox.module.scss.js +42 -42
  126. package/dist/components/vote/vote_button/VoteButton.module.scss.js +5 -5
  127. package/dist/index.js +320 -324
  128. package/package.json +1 -1
  129. package/dist/assets/components/action/back_link/BackLink.module-B9Ok2t4H.css +0 -1
  130. package/dist/assets/components/action/button/Button.module-D7nbgOES.css +0 -1
  131. package/dist/assets/components/action/icon_text_link/IconTextLink.module-CZKufK9Y.css +0 -1
  132. package/dist/assets/components/argument/argument/Argument.module-CC40BY1L.css +0 -1
  133. package/dist/assets/components/argument/argument/ReplyFooter.module-CoC9dY8T.css +0 -1
  134. package/dist/assets/components/auth/sso_form/SSOForm.module-DOw9cmCF.css +0 -1
  135. package/dist/assets/components/consultation/consultation_box/ConsultationBox.module-97r47y_e.css +0 -1
  136. package/dist/assets/components/debate/debate_box/DebateBox.module-emnqIGNF.css +0 -1
  137. package/dist/assets/components/dialog/dialog_box/DialogBox.module-ZoM8d2Ly.css +0 -1
  138. package/dist/assets/components/dialog/dropdown/Dropdown.module-BmT3rAwz.css +0 -1
  139. package/dist/assets/components/dialog/modal/Modal.module-Dt4SWx6U.css +0 -1
  140. package/dist/assets/components/dialog/toast/Toast.module-CW6j5xe7.css +0 -1
  141. package/dist/assets/components/dialog/tooltip/Tooltip.module-bQbmPiMf.css +0 -1
  142. package/dist/assets/components/embed/embed_header/EmbedHeader.module-C8RPiVBp.css +0 -1
  143. package/dist/assets/components/follow/follow_button/FollowButton.module-BjwLVTeb.css +0 -1
  144. package/dist/assets/components/gamification/badge_box/BadgeBox.module-DWqqtICw.css +0 -1
  145. package/dist/assets/components/information/information_box/InformationBox.module-DJLT957y.css +0 -1
  146. package/dist/assets/components/input/text_editor/TextEditor.module-KPtqT1Y6.css +0 -1
  147. package/dist/assets/components/input/text_editor/plugins/ToolbarPlugin.module-C3yG2biv.css +0 -1
  148. package/dist/assets/components/input/toggle_position/TogglePosition.module-H4gGmJ0V.css +0 -1
  149. package/dist/assets/components/list/paginated_list/action_bar/ActionBar.module-BDMBrj2Y.css +0 -1
  150. package/dist/assets/components/navigation/tabs/Tabs.module-50P6bk0B.css +0 -1
  151. package/dist/assets/components/notification/notification_item/NotificationItem.module-BQcDopYB.css +0 -1
  152. package/dist/assets/components/notification/notification_menu/NotificationMenu.module-DrCrfzVk.css +0 -1
  153. package/dist/assets/components/progress/progress_bar/ProgressBar.module-DoCH9Qoo.css +0 -1
  154. package/dist/assets/components/proposal/proposal_box/ProposalBox.module-D1ccjSLm.css +0 -1
  155. package/dist/assets/components/section/section_box/SectionBox.module-DF7k7Vxq.css +0 -1
  156. package/dist/assets/components/skeleton/user_content_skeleton/UserContentSkeleton.module-d4r3QpYe.css +0 -1
  157. package/dist/assets/components/source/context_source_box/ContextSourceBox.module-doiSb_NR.css +0 -1
  158. package/dist/assets/components/source/context_source_list/ContextSourceList.module-Df4z4DN-.css +0 -1
  159. package/dist/assets/components/source/source_box/SourceBox.module-CQOBgJ5n.css +0 -1
  160. package/dist/assets/components/source/source_list_item/SourceListItem.module-C5YDjksb.css +0 -1
  161. package/dist/assets/components/suggestion/suggestion_banner/SuggestionBanner.module-P95xqaUA.css +0 -1
  162. package/dist/assets/components/suggestion/suggestion_box/SuggestionBox.module-CE_Wvk-K.css +0 -1
  163. package/dist/assets/components/suggestion/suggestion_input/SuggestionInput.module-r5N57bDp.css +0 -1
  164. package/dist/assets/components/summary/argument_summary_box/ArgumentSummaryBox.module-EDxcqwRa.css +0 -1
  165. package/dist/assets/components/summary/keyword_box/KeywordBox.module-yNHAvcRh.css +0 -1
  166. package/dist/assets/components/summary/summary_box/SummaryBox.module-Bu-AnMIG.css +0 -1
  167. package/dist/assets/components/text/read_more/ReadMore.module-Bs-YaspR.css +0 -1
  168. package/dist/assets/components/user/author_box/AuthorBox.module-B8Sl2v33.css +0 -1
  169. package/dist/assets/components/user/onboarding_modal/OnboardingModal.module-CTpt3xSh.css +0 -1
  170. package/dist/assets/components/user/user_box/UserBox.module-DMFhZDAH.css +0 -1
  171. package/dist/assets/components/user/user_box_small/UserBoxSmall.module-D4Ut5xmS.css +0 -1
  172. package/dist/assets/components/user_content/content_footer/ContentFooter.module-9A9E8k5l.css +0 -1
  173. package/dist/assets/components/user_content/content_header/ContentHeader.module-CXO2IRui.css +0 -1
  174. package/dist/assets/components/user_content/summary_content_box/SummaryContentBox.module-CBlL2Xii.css +0 -1
  175. package/dist/assets/components/user_content/use_report_content/ReportModal.module-mjFuOdmL.css +0 -1
  176. package/dist/assets/components/vote/suggestion_vote_box/SuggestionVoteBox.module-CKFriPV5.css +0 -1
  177. package/dist/assets/components/vote/vote_box/VoteBox.module-Bv7WY_vr.css +0 -1
  178. package/dist/assets/components/vote/vote_button/VoteButton.module-DqD79xv_.css +0 -1
  179. package/dist/components/auth/use_auth/base64.js +0 -4
  180. package/dist/components/icons/clarin_icons/Alarm.js +0 -6
  181. package/dist/components/icons/clarin_icons/Announcement.js +0 -6
  182. package/dist/components/icons/clarin_icons/Chat.js +0 -6
  183. package/dist/components/icons/clarin_icons/CheckCircle.js +0 -9
  184. package/dist/components/icons/clarin_icons/Clock.js +0 -6
  185. package/dist/components/icons/clarin_icons/Follow.js +0 -6
  186. package/dist/components/icons/clarin_icons/MobileClose.js +0 -9
  187. package/dist/components/icons/clarin_icons/Question.js +0 -6
  188. package/dist/components/icons/clarin_icons/Search.js +0 -6
  189. package/dist/components/icons/clarin_icons/Send.js +0 -6
  190. package/dist/components/icons/clarin_icons/Share.js +0 -6
  191. package/dist/components/icons/clarin_icons/Upvote.js +0 -9
  192. package/dist/components/icons/clarin_icons/User.js +0 -9
  193. package/dist/components/icons/clarin_icons/index.js +0 -106
  194. package/dist/components/input/text_editor/plugins/IOSInsertParagraphFallbackPlugin.js +0 -34
  195. package/dist/components/user/onboarding_modal/OnboardingModal.module.scss.js +0 -29
  196. package/dist/components/user/onboarding_modal/useOnboarding.js +0 -27
@@ -14,21 +14,20 @@ import { QuoteNode as he } from "@lexical/rich-text";
14
14
  import b from "classnames";
15
15
  import { $getRoot as ge } from "lexical";
16
16
  import { useState as f, useId as Se, useRef as xe, useEffect as M } from "react";
17
- import { useIntl as Pe } from "react-intl";
18
- import Ce from "./EditorTheme.js";
17
+ import { useIntl as Ce } from "react-intl";
18
+ import Pe from "./EditorTheme.js";
19
19
  import i from "./TextEditor.module.scss.js";
20
20
  import { AutoSavePlugin as Te } from "./plugins/AutoSavePlugin.js";
21
- import { FocusPlugin as Ie } from "./plugins/FocusPlugin.js";
22
- import { IOSInsertParagraphFallbackPlugin as Ne } from "./plugins/IOSInsertParagraphFallbackPlugin.js";
21
+ import { FocusPlugin as Ne } from "./plugins/FocusPlugin.js";
23
22
  import { MaxLengthPlugin as ve } from "./plugins/MaxLengthPlugin.js";
24
23
  import { ResetPlugin as Ee } from "./plugins/ResetPlugin.js";
25
- import { SetContentPlugin as Re } from "./plugins/SetContentPlugin.js";
26
- import { SetRichContentPlugin as be } from "./plugins/SetRichContentPlugin.js";
27
- import { ToolbarPlugin as Me } from "./plugins/ToolbarPlugin.js";
28
- import { useModal as ye } from "../../dialog/modal/useModal.js";
29
- import { SourceModal as we } from "../../source/source_modal/SourceModal.js";
30
- import { SourceListItem as Le } from "../../source/source_list_item/SourceListItem.js";
31
- const y = (l) => l?.replace(/ /g, " "), lt = ({
24
+ import { SetContentPlugin as Ie } from "./plugins/SetContentPlugin.js";
25
+ import { SetRichContentPlugin as Re } from "./plugins/SetRichContentPlugin.js";
26
+ import { ToolbarPlugin as be } from "./plugins/ToolbarPlugin.js";
27
+ import { useModal as Me } from "../../dialog/modal/useModal.js";
28
+ import { SourceModal as ye } from "../../source/source_modal/SourceModal.js";
29
+ import { SourceListItem as we } from "../../source/source_list_item/SourceListItem.js";
30
+ const y = (l) => l?.replace(/ /g, " "), st = ({
32
31
  placeholder: l,
33
32
  initialContent: w,
34
33
  initialRichContent: L,
@@ -37,50 +36,50 @@ const y = (l) => l?.replace(/ /g, " "), lt = ({
37
36
  hideSubmit: _ = !1,
38
37
  hideSourceAction: A = !1,
39
38
  onActivation: n,
40
- disabled: O = !1,
41
- handleChange: P,
39
+ disabled: B = !1,
40
+ handleChange: C,
42
41
  handleSourcesChange: h,
43
- shortBar: k = !1,
42
+ shortBar: O = !1,
44
43
  active: g = !1,
45
44
  maxLength: m,
46
- disableRichText: B = !1,
47
- editorRef: U,
48
- uid: C,
45
+ disableRichText: U = !1,
46
+ editorRef: j,
47
+ uid: P,
49
48
  allowedDomains: T = [],
50
- hideCharCount: j = !1,
49
+ hideCharCount: k = !1,
51
50
  disableAutoActivate: z = !1,
52
51
  autoFocus: a = !1,
53
- ...F
52
+ ...H
54
53
  }) => {
55
- const [s, H] = f(a || g), [J, Q] = f(""), [W, $] = f(""), [d, u] = f([]), { showModal: q } = ye(), I = Pe(), N = Se(), v = xe(!1);
54
+ const [s, J] = f(a || g), [Q, W] = f(""), [$, q] = f(""), [d, u] = f([]), { showModal: D } = Me(), N = Ce(), v = Se(), E = xe(!1);
56
55
  M(() => {
57
- a && !v.current && n && (v.current = !0, n());
56
+ a && !E.current && n && (E.current = !0, n());
58
57
  }, [a, n]), M(() => {
59
58
  p && u(p);
60
59
  }, [p]);
61
- const E = () => {
62
- s || (H(!0), n && n());
63
- }, D = {
64
- editable: !O,
65
- theme: Ce,
60
+ const I = () => {
61
+ s || (J(!0), n && n());
62
+ }, F = {
63
+ editable: !B,
64
+ theme: Pe,
66
65
  onError(t) {
67
66
  console.error("TextEditor error:", t);
68
67
  },
69
68
  nodes: [re, ie, he, ne]
70
69
  }, G = () => {
71
- E();
70
+ I();
72
71
  }, K = (t) => {
73
72
  t.read(() => {
74
73
  const o = ge().getTextContent(), r = y(o), c = JSON.stringify(t), R = y(c);
75
- Q(r), $(R), P && P(r, R);
74
+ W(r), q(R), C && C(r, R);
76
75
  });
77
76
  }, V = (t) => {
78
- const o = J, r = W, c = d;
77
+ const o = Q, r = $, c = d;
79
78
  x && (t.preventDefault(), x(o, r, c)), u([]), h?.([]);
80
79
  }, X = () => {
81
- q(
80
+ D(
82
81
  /* @__PURE__ */ e(
83
- we,
82
+ ye,
84
83
  {
85
84
  onAddSource: Y,
86
85
  allowedSources: T
@@ -100,7 +99,7 @@ const y = (l) => l?.replace(/ /g, " "), lt = ({
100
99
  return h?.(r), r;
101
100
  });
102
101
  }, ee = (t, o) => /* @__PURE__ */ e(
103
- Le,
102
+ we,
104
103
  {
105
104
  publisher: t.publisher,
106
105
  url: t.source_url,
@@ -111,7 +110,7 @@ const y = (l) => l?.replace(/ /g, " "), lt = ({
111
110
  o
112
111
  ), te = () => /* @__PURE__ */ e("div", { className: i.editorPlaceholder, children: l });
113
112
  return /* @__PURE__ */ S(oe, { children: [
114
- /* @__PURE__ */ e(ce, { initialConfig: D, children: /* @__PURE__ */ e("div", { className: i.editorContainer, onClick: G, children: /* @__PURE__ */ S(
113
+ /* @__PURE__ */ e(ce, { initialConfig: F, children: /* @__PURE__ */ e("div", { className: i.editorContainer, onClick: G, children: /* @__PURE__ */ S(
115
114
  "div",
116
115
  {
117
116
  className: b(i.editorInner, {
@@ -127,7 +126,7 @@ const y = (l) => l?.replace(/ /g, " "), lt = ({
127
126
  className: b(i.editorInput, {
128
127
  [i.editorInputInactive]: !s
129
128
  }),
130
- ...F
129
+ ...H
131
130
  }
132
131
  ),
133
132
  placeholder: l && /* @__PURE__ */ e(te, {}),
@@ -135,25 +134,25 @@ const y = (l) => l?.replace(/ /g, " "), lt = ({
135
134
  }
136
135
  ),
137
136
  /* @__PURE__ */ e(
138
- Me,
137
+ be,
139
138
  {
140
139
  hideSourceAction: A,
141
140
  hideSubmit: _,
142
- disableRichText: B,
143
- shortBar: k,
141
+ disableRichText: U,
142
+ shortBar: O,
144
143
  onSubmit: V,
145
144
  onAddSource: X,
146
145
  isActive: s || g,
147
- sourceTooltip: T?.length > 0 && I.formatMessage({
146
+ sourceTooltip: T?.length > 0 && N.formatMessage({
148
147
  id: "input.allowed_domains_tooltip",
149
148
  defaultMessage: "With the new source function, you can add links to your article."
150
149
  })
151
150
  }
152
151
  ),
153
- s && m && !j && /* @__PURE__ */ S("div", { className: i.charactersCount, children: [
152
+ s && m && !k && /* @__PURE__ */ S("div", { className: i.charactersCount, children: [
154
153
  /* @__PURE__ */ e(se, { maxLength: m }),
155
154
  " ",
156
- I.formatMessage({
155
+ N.formatMessage({
157
156
  id: "input.remaining_chars",
158
157
  defaultMessage: "remaining characters"
159
158
  })
@@ -165,17 +164,16 @@ const y = (l) => l?.replace(/ /g, " "), lt = ({
165
164
  Te,
166
165
  {
167
166
  onSetContent: z ? () => {
168
- } : E,
169
- storageUid: C || N
167
+ } : I,
168
+ storageUid: P || v
170
169
  }
171
170
  ),
172
- /* @__PURE__ */ e(Re, { content: w }),
173
- /* @__PURE__ */ e(be, { richContent: L }),
174
- /* @__PURE__ */ e(Ie, { autoFocus: a }),
175
- /* @__PURE__ */ e(Ne, {}),
171
+ /* @__PURE__ */ e(Ie, { content: w }),
172
+ /* @__PURE__ */ e(Re, { richContent: L }),
173
+ /* @__PURE__ */ e(Ne, { autoFocus: a }),
176
174
  m && /* @__PURE__ */ e(ve, { maxLength: m }),
177
- /* @__PURE__ */ e(Ee, { storageUid: C || N }),
178
- /* @__PURE__ */ e(me, { editorRef: U })
175
+ /* @__PURE__ */ e(Ee, { storageUid: P || v }),
176
+ /* @__PURE__ */ e(me, { editorRef: j })
179
177
  ]
180
178
  }
181
179
  ) }) }),
@@ -183,5 +181,5 @@ const y = (l) => l?.replace(/ /g, " "), lt = ({
183
181
  ] });
184
182
  };
185
183
  export {
186
- lt as TextEditor
184
+ st as TextEditor
187
185
  };
@@ -1,45 +1,45 @@
1
- import '../../../assets/components/input/text_editor/TextEditor.module-KPtqT1Y6.css';const t = "_ltr_43sv6_3", e = "_editorContainer_43sv6_7", o = "_editorInner_43sv6_15", r = "_editorInnerInactive_43sv6_19", i = "_editorPlaceholder_43sv6_24", s = "_editorInput_43sv6_36", n = "_editorInputInactive_43sv6_47", d = "_editorTextBold_43sv6_52", _ = "_editorTextItalic_43sv6_57", c = "_editorTextUnderline_43sv6_61", a = "_editorTextStrikethrough_43sv6_65", I = "_editorTextUnderlineStrikethrough_43sv6_69", l = "_editorParagraph_43sv6_73", v = "_editorQuote_43sv6_83", u = "_editorListOl_43sv6_93", h = "_editorListItem_43sv6_100", x = "_editorNestedListItem_43sv6_107", T = "_sourcesBox_43sv6_120", L = "_sourceList_43sv6_131", p = "_charactersCount_43sv6_142", g = {
1
+ import '../../../assets/components/input/text_editor/TextEditor.module-CxuSL3l3.css';const t = "_ltr_1k7lj_3", e = "_editorContainer_1k7lj_7", o = "_editorInner_1k7lj_14", r = "_editorInnerInactive_1k7lj_18", i = "_editorPlaceholder_1k7lj_23", n = "_editorInput_1k7lj_35", d = "_editorInputInactive_1k7lj_46", _ = "_editorTextBold_1k7lj_51", s = "_editorTextItalic_1k7lj_55", l = "_editorTextUnderline_1k7lj_59", c = "_editorTextStrikethrough_1k7lj_63", a = "_editorTextUnderlineStrikethrough_1k7lj_67", I = "_editorParagraph_1k7lj_71", k = "_editorQuote_1k7lj_81", u = "_editorListOl_1k7lj_91", h = "_editorListItem_1k7lj_98", j = "_editorNestedListItem_1k7lj_105", x = "_sourcesBox_1k7lj_118", T = "_sourceList_1k7lj_129", L = "_charactersCount_1k7lj_140", p = {
2
2
  ltr: t,
3
3
  editorContainer: e,
4
4
  editorInner: o,
5
5
  editorInnerInactive: r,
6
6
  editorPlaceholder: i,
7
- editorInput: s,
8
- editorInputInactive: n,
9
- editorTextBold: d,
10
- editorTextItalic: _,
11
- editorTextUnderline: c,
12
- editorTextStrikethrough: a,
13
- editorTextUnderlineStrikethrough: I,
14
- editorParagraph: l,
15
- editorQuote: v,
7
+ editorInput: n,
8
+ editorInputInactive: d,
9
+ editorTextBold: _,
10
+ editorTextItalic: s,
11
+ editorTextUnderline: l,
12
+ editorTextStrikethrough: c,
13
+ editorTextUnderlineStrikethrough: a,
14
+ editorParagraph: I,
15
+ editorQuote: k,
16
16
  editorListOl: u,
17
17
  editorListItem: h,
18
- editorNestedListItem: x,
19
- sourcesBox: T,
20
- sourceList: L,
21
- charactersCount: p
18
+ editorNestedListItem: j,
19
+ sourcesBox: x,
20
+ sourceList: T,
21
+ charactersCount: L
22
22
  };
23
23
  export {
24
- p as charactersCount,
25
- g as default,
24
+ L as charactersCount,
25
+ p as default,
26
26
  e as editorContainer,
27
27
  o as editorInner,
28
28
  r as editorInnerInactive,
29
- s as editorInput,
30
- n as editorInputInactive,
29
+ n as editorInput,
30
+ d as editorInputInactive,
31
31
  h as editorListItem,
32
32
  u as editorListOl,
33
- x as editorNestedListItem,
34
- l as editorParagraph,
33
+ j as editorNestedListItem,
34
+ I as editorParagraph,
35
35
  i as editorPlaceholder,
36
- v as editorQuote,
37
- d as editorTextBold,
38
- _ as editorTextItalic,
39
- a as editorTextStrikethrough,
40
- c as editorTextUnderline,
41
- I as editorTextUnderlineStrikethrough,
36
+ k as editorQuote,
37
+ _ as editorTextBold,
38
+ s as editorTextItalic,
39
+ c as editorTextStrikethrough,
40
+ l as editorTextUnderline,
41
+ a as editorTextUnderlineStrikethrough,
42
42
  t as ltr,
43
- L as sourceList,
44
- T as sourcesBox
43
+ T as sourceList,
44
+ x as sourcesBox
45
45
  };
@@ -1,129 +1,85 @@
1
- import { jsxs as L, jsx as i } from "react/jsx-runtime";
2
- import { $isListNode as k, ListNode as z, INSERT_ORDERED_LIST_COMMAND as G, $isListItemNode as w, $createListNode as X } from "@lexical/list";
3
- import { useLexicalComposerContext as J } from "@lexical/react/LexicalComposerContext";
4
- import { $isHeadingNode as W, $createQuoteNode as A } from "@lexical/rich-text";
5
- import { $setBlocksType as v } from "@lexical/selection";
6
- import { $getNearestNodeOfType as Y, mergeRegister as Z } from "@lexical/utils";
1
+ import { jsxs as N, jsx as t } from "react/jsx-runtime";
2
+ import { $isListNode as R, ListNode as w, INSERT_ORDERED_LIST_COMMAND as B, REMOVE_LIST_COMMAND as D } from "@lexical/list";
3
+ import { useLexicalComposerContext as $ } from "@lexical/react/LexicalComposerContext";
4
+ import { $isHeadingNode as q, $createQuoteNode as K } from "@lexical/rich-text";
5
+ import { $setBlocksType as M } from "@lexical/selection";
6
+ import { $getNearestNodeOfType as F, mergeRegister as U } from "@lexical/utils";
7
7
  import a from "classnames";
8
- import { $getSelection as N, $isRangeSelection as _, SELECTION_CHANGE_COMMAND as ee, FORMAT_TEXT_COMMAND as te, $createParagraphNode as E } from "lexical";
9
- import { useRef as oe, useState as g, useCallback as ie, useEffect as ae } from "react";
10
- import { useIntl as ne } from "react-intl";
8
+ import { $getSelection as g, $isRangeSelection as P, SELECTION_CHANGE_COMMAND as j, FORMAT_TEXT_COMMAND as h, $createParagraphNode as H } from "lexical";
9
+ import { useRef as Q, useState as c, useCallback as G, useEffect as V } from "react";
10
+ import { useIntl as X } from "react-intl";
11
11
  import e from "./ToolbarPlugin.module.scss.js";
12
- import { Icon as u } from "../../../icons/icon/Icon.js";
13
- import { Button as le } from "../../../action/button/Button.js";
14
- const ye = (n) => {
15
- const r = ne(), D = 1, [l] = J(), O = oe(null), [h, I] = g("paragraph"), [se, P] = g(null), [B, R] = g(!1), [$, q] = g(!1), [K, F] = g(!1), S = n.hideSubmit && n.hideSourceAction && n.disableRichText, p = ie(() => {
16
- const t = N();
17
- if (_(t)) {
18
- const c = t.anchor.getNode(), s = c.getKey() === "root" ? c : c.getTopLevelElementOrThrow(), d = s.getKey();
19
- if (l.getElementByKey(d) !== null)
20
- if (P(d), k(s)) {
21
- const o = Y(c, z), f = o ? o.getTag() : s.getTag();
22
- I(f);
12
+ import { Icon as s } from "../../../icons/icon/Icon.js";
13
+ import { Button as z } from "../../../action/button/Button.js";
14
+ const me = (l) => {
15
+ const n = X(), y = 1, [o] = $(), C = Q(null), [m, f] = c("paragraph"), [J, T] = c(null), [k, I] = c(!1), [x, A] = c(!1), [S, E] = c(!1), p = l.hideSubmit && l.hideSourceAction && l.disableRichText, b = G(() => {
16
+ const i = g();
17
+ if (P(i)) {
18
+ const d = i.anchor.getNode(), r = d.getKey() === "root" ? d : d.getTopLevelElementOrThrow(), _ = r.getKey();
19
+ if (o.getElementByKey(_) !== null)
20
+ if (T(_), R(r)) {
21
+ const u = F(d, w), O = u ? u.getTag() : r.getTag();
22
+ f(O);
23
23
  } else {
24
- const o = W(s) ? s.getTag() : s.getType();
25
- I(o);
24
+ const u = q(r) ? r.getTag() : r.getType();
25
+ f(u);
26
26
  }
27
- R(t.hasFormat("bold")), q(t.hasFormat("italic")), F(t.hasFormat("underline"));
27
+ I(i.hasFormat("bold")), A(i.hasFormat("italic")), E(i.hasFormat("underline"));
28
28
  }
29
- }, [l]);
30
- ae(() => Z(
31
- l.registerUpdateListener(({ editorState: t }) => {
32
- t.read(() => {
33
- p();
29
+ }, [o]);
30
+ V(() => U(
31
+ o.registerUpdateListener(({ editorState: i }) => {
32
+ i.read(() => {
33
+ b();
34
34
  });
35
35
  }),
36
- l.registerCommand(
37
- ee,
38
- () => (p(), !1),
39
- D
36
+ o.registerCommand(
37
+ j,
38
+ (i, d) => (b(), !1),
39
+ y
40
40
  )
41
- ), [l, p]);
42
- const b = (t) => {
43
- t.pointerType !== "touch" && t.pointerType !== "pen" && t.preventDefault();
44
- }, x = () => {
45
- setTimeout(() => {
46
- l.getEditorState().read(() => {
47
- p();
48
- });
49
- }, 0);
50
- }, T = (t) => {
51
- l.dispatchCommand(te, t);
52
- }, U = () => {
53
- l.update(() => {
54
- const t = N();
55
- if (!_(t))
56
- return;
57
- const c = t.getNodes(), s = /* @__PURE__ */ new Set();
58
- for (const m of c) {
59
- let o = m;
60
- for (; o !== null && !w(o); )
61
- o = o.getParent();
62
- w(o) && s.add(o);
63
- }
64
- const d = Array.from(s).reverse();
65
- for (const m of d) {
66
- const o = m.getParent();
67
- if (!k(o))
68
- continue;
69
- const f = E(), Q = m.getChildren();
70
- for (const M of Q)
71
- f.append(M);
72
- const y = m.getNextSiblings();
73
- if (o.insertAfter(f), y.length > 0) {
74
- const M = y[0].getValue(), C = X(o.getListType(), M);
75
- for (const V of y)
76
- C.append(V);
77
- f.insertAfter(C);
78
- }
79
- m.remove(), o.getChildrenSize() === 0 && o.remove();
80
- }
41
+ ), [o, b]);
42
+ const L = () => {
43
+ m !== "ol" ? o.dispatchCommand(B) : o.dispatchCommand(D);
44
+ }, v = () => {
45
+ m !== "quote" ? o.update(() => {
46
+ const i = g();
47
+ M(i, () => K());
48
+ }) : o.update(() => {
49
+ const i = g();
50
+ M(i, () => H());
81
51
  });
82
- }, j = () => {
83
- h !== "ol" ? l.dispatchCommand(G) : U(), x();
84
- }, H = () => {
85
- h !== "quote" ? l.update(() => {
86
- const t = N();
87
- if (_(t))
88
- if (t.isCollapsed()) {
89
- const s = t.anchor.getNode().getTopLevelElementOrThrow(), d = A();
90
- s.insertAfter(d), d.selectEnd();
91
- } else
92
- v(t, () => A());
93
- }) : l.update(() => {
94
- const t = N();
95
- _(t) && v(t, () => E());
96
- }), x();
97
52
  };
98
- return S ? null : /* @__PURE__ */ L(
53
+ return p ? null : /* @__PURE__ */ N(
99
54
  "div",
100
55
  {
101
56
  className: a(e.toolbar, {
102
- [e.toolbarIsActive]: S ? !1 : n.isActive
57
+ [e.toolbarIsActive]: p ? !1 : l.isActive
103
58
  }),
104
- ref: O,
59
+ ref: C,
105
60
  children: [
106
- n.isActive ? !n.disableRichText && /* @__PURE__ */ L(
61
+ l.isActive ? !l.disableRichText && /* @__PURE__ */ N(
107
62
  "div",
108
63
  {
109
64
  className: a(e.iconToolbar, {
110
- [e.shortBar]: n.shortBar
65
+ [e.shortBar]: l.shortBar
111
66
  }),
112
67
  children: [
113
- /* @__PURE__ */ i(
68
+ /* @__PURE__ */ t(
114
69
  "button",
115
70
  {
116
- onPointerDown: b,
117
- onClick: () => T("bold"),
71
+ onClick: () => {
72
+ o.dispatchCommand(h, "bold");
73
+ },
118
74
  type: "button",
119
- className: a(e.toolbarItem, { [e.active]: B }),
75
+ className: a(e.toolbarItem, { [e.active]: k }),
120
76
  "data-testid": "format-bold",
121
- "aria-label": r.formatMessage({
77
+ "aria-label": n.formatMessage({
122
78
  id: "input.text_editor.plugins.toolbar_plugin.bold.aria_label",
123
79
  defaultMessage: "Make text bold"
124
80
  }),
125
- children: /* @__PURE__ */ i(
126
- u,
81
+ children: /* @__PURE__ */ t(
82
+ s,
127
83
  {
128
84
  name: "bold",
129
85
  width: 24,
@@ -133,21 +89,22 @@ const ye = (n) => {
133
89
  )
134
90
  }
135
91
  ),
136
- /* @__PURE__ */ i(
92
+ /* @__PURE__ */ t(
137
93
  "button",
138
94
  {
139
- onPointerDown: b,
140
- onClick: () => T("italic"),
95
+ onClick: () => {
96
+ o.dispatchCommand(h, "italic");
97
+ },
141
98
  type: "button",
142
99
  className: a(e.toolbarItem, {
143
- [e.active]: $
100
+ [e.active]: x
144
101
  }),
145
- "aria-label": r.formatMessage({
102
+ "aria-label": n.formatMessage({
146
103
  id: "input.text_editor.plugins.toolbar_plugin.italic.aria_label",
147
104
  defaultMessage: "Make text italic"
148
105
  }),
149
- children: /* @__PURE__ */ i(
150
- u,
106
+ children: /* @__PURE__ */ t(
107
+ s,
151
108
  {
152
109
  name: "italic",
153
110
  width: 24,
@@ -157,21 +114,22 @@ const ye = (n) => {
157
114
  )
158
115
  }
159
116
  ),
160
- /* @__PURE__ */ i(
117
+ /* @__PURE__ */ t(
161
118
  "button",
162
119
  {
163
- onPointerDown: b,
164
- onClick: () => T("underline"),
120
+ onClick: () => {
121
+ o.dispatchCommand(h, "underline");
122
+ },
165
123
  type: "button",
166
124
  className: a(e.toolbarItem, {
167
- [e.active]: K
125
+ [e.active]: S
168
126
  }),
169
- "aria-label": r.formatMessage({
127
+ "aria-label": n.formatMessage({
170
128
  id: "input.text_editor.plugins.toolbar_plugin.underline.aria_label",
171
129
  defaultMessage: "Underline text"
172
130
  }),
173
- children: /* @__PURE__ */ i(
174
- u,
131
+ children: /* @__PURE__ */ t(
132
+ s,
175
133
  {
176
134
  name: "underline",
177
135
  width: 24,
@@ -181,21 +139,18 @@ const ye = (n) => {
181
139
  )
182
140
  }
183
141
  ),
184
- /* @__PURE__ */ i(
142
+ /* @__PURE__ */ t(
185
143
  "button",
186
144
  {
187
- onPointerDown: b,
188
- onClick: () => H(),
145
+ onClick: () => v(),
189
146
  type: "button",
190
- className: a(e.toolbarItem, {
191
- [e.active]: h === "quote"
192
- }),
193
- "aria-label": r.formatMessage({
147
+ className: a(e.toolbarItem, { [e.active]: m === "quote" }),
148
+ "aria-label": n.formatMessage({
194
149
  id: "input.text_editor.plugins.toolbar_plugin.blockquote.aria_label",
195
150
  defaultMessage: "Add a blockquote"
196
151
  }),
197
- children: /* @__PURE__ */ i(
198
- u,
152
+ children: /* @__PURE__ */ t(
153
+ s,
199
154
  {
200
155
  name: "blockquote",
201
156
  width: 24,
@@ -205,21 +160,18 @@ const ye = (n) => {
205
160
  )
206
161
  }
207
162
  ),
208
- /* @__PURE__ */ i(
163
+ /* @__PURE__ */ t(
209
164
  "button",
210
165
  {
211
- onPointerDown: b,
212
- onClick: () => j(),
166
+ onClick: () => L(),
213
167
  type: "button",
214
- className: a(e.toolbarItem, {
215
- [e.active]: h === "ol"
216
- }),
217
- "aria-label": r.formatMessage({
168
+ className: a(e.toolbarItem, { [e.active]: m === "ol" }),
169
+ "aria-label": n.formatMessage({
218
170
  id: "input.text_editor.plugins.toolbar_plugin.numbered_list.aria_label",
219
171
  defaultMessage: "Insert a numbered list"
220
172
  }),
221
- children: /* @__PURE__ */ i(
222
- u,
173
+ children: /* @__PURE__ */ t(
174
+ s,
223
175
  {
224
176
  name: "orderedList",
225
177
  width: 24,
@@ -229,19 +181,18 @@ const ye = (n) => {
229
181
  )
230
182
  }
231
183
  ),
232
- !n.hideSourceAction && /* @__PURE__ */ i(
184
+ !l.hideSourceAction && /* @__PURE__ */ t(
233
185
  "button",
234
186
  {
235
- onPointerDown: b,
236
- onClick: n.onAddSource,
187
+ onClick: l.onAddSource,
237
188
  type: "button",
238
189
  className: e.toolbarItem,
239
- "aria-label": r.formatMessage({
190
+ "aria-label": n.formatMessage({
240
191
  id: "input.text_editor.plugins.toolbar_plugin.add_link.aria_label",
241
192
  defaultMessage: "Add hyperlink"
242
193
  }),
243
- children: /* @__PURE__ */ i(
244
- u,
194
+ children: /* @__PURE__ */ t(
195
+ s,
245
196
  {
246
197
  name: "link",
247
198
  width: 20,
@@ -254,18 +205,18 @@ const ye = (n) => {
254
205
  ]
255
206
  }
256
207
  ) : null,
257
- /* @__PURE__ */ i("div", { className: e.actionButton, children: n.hideSubmit ? null : /* @__PURE__ */ i(
258
- le,
208
+ /* @__PURE__ */ t("div", { className: e.actionButton, children: l.hideSubmit ? null : /* @__PURE__ */ t(
209
+ z,
259
210
  {
260
211
  type: "button",
261
212
  "data-testid": "submit-button",
262
- handleClick: n.onSubmit,
213
+ handleClick: l.onSubmit,
263
214
  className: a(e.inputSubmitActionButton, e.submitAction),
264
- "aria-label": r.formatMessage({
215
+ "aria-label": n.formatMessage({
265
216
  id: "input.text_editor.plugins.toolbar_plugin.submit_button.aria_label",
266
217
  defaultMessage: "Send message"
267
218
  }),
268
- children: /* @__PURE__ */ i(u, { name: "send", width: 20, height: 20 })
219
+ children: /* @__PURE__ */ t(s, { name: "send", width: 20, height: 20 })
269
220
  }
270
221
  ) })
271
222
  ]
@@ -273,5 +224,5 @@ const ye = (n) => {
273
224
  );
274
225
  };
275
226
  export {
276
- ye as ToolbarPlugin
227
+ me as ToolbarPlugin
277
228
  };