@logora/debate 0.1.1 → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +15 -23
- package/dist/components/action/button/Button.js +1 -1
- package/dist/components/argument/argument/Argument.js +49 -49
- package/dist/components/argument/top_arguments/TopArguments.js +17 -17
- package/dist/components/auth/auth_initializer/AuthInitializer.js +5 -5
- package/dist/components/auth/auth_modal/AuthModal.js +9 -9
- package/dist/components/auth/login_form/LoginForm.js +1 -0
- package/dist/components/auth/oauth2_button/OAuth2Button.js +3 -3
- package/dist/components/auth/providers/AuthProviderFactory.js +4 -4
- package/dist/components/auth/signup_form/SignupForm.js +4 -4
- package/dist/components/auth/social_auth_form/SocialAuthForm.js +10 -10
- package/dist/components/auth/sso_form/SSOForm.js +4 -4
- package/dist/components/chart/line_chart/LineChart.js +10 -10
- package/dist/components/chart/pie_chart/PieChart.js +6 -10
- package/dist/components/consultation/consultation_box/ConsultationBox.js +19 -14
- package/dist/components/debate/debate_box/DebateBox.js +11 -11
- package/dist/components/dialog/drawer/Drawer.js +16 -16
- package/dist/components/dialog/modal/Modal.js +8 -8
- package/dist/components/dialog/toast_provider/ToastProvider.js +10 -10
- package/dist/components/hooks/use_responsive/ResponsiveProvider.js +4 -4
- package/dist/components/icons/bild_icons/Alarm.js +15 -0
- package/dist/components/icons/bild_icons/Announcement.js +20 -0
- package/dist/components/icons/bild_icons/Arrow.js +11 -0
- package/dist/components/icons/bild_icons/Blockquote.js +11 -0
- package/dist/components/icons/bild_icons/Bold.js +11 -0
- package/dist/components/icons/bild_icons/Camera.js +11 -0
- package/dist/components/icons/bild_icons/Chat.js +44 -0
- package/dist/components/icons/bild_icons/Check.js +12 -0
- package/dist/components/icons/bild_icons/CheckCircle.js +20 -0
- package/dist/components/icons/bild_icons/Checkbox.js +11 -0
- package/dist/components/icons/bild_icons/Clap.js +21 -0
- package/dist/components/icons/bild_icons/Clock.js +11 -0
- package/dist/components/icons/bild_icons/Close.js +11 -0
- package/dist/components/icons/bild_icons/Code.js +32 -0
- package/dist/components/icons/bild_icons/Community.js +11 -0
- package/dist/components/icons/bild_icons/Crown.js +12 -0
- package/dist/components/icons/bild_icons/Document.js +11 -0
- package/dist/components/icons/bild_icons/Downvote.js +11 -0
- package/dist/components/icons/bild_icons/Ellipsis.js +12 -0
- package/dist/components/icons/bild_icons/ExpertBadge.js +33 -0
- package/dist/components/icons/bild_icons/Facebook.js +11 -0
- package/dist/components/icons/bild_icons/Flag.js +11 -0
- package/dist/components/icons/bild_icons/Home.js +11 -0
- package/dist/components/icons/bild_icons/Italic.js +11 -0
- package/dist/components/icons/bild_icons/LightArrow.js +12 -0
- package/dist/components/icons/bild_icons/Link.js +11 -0
- package/dist/components/icons/bild_icons/Login.js +19 -0
- package/dist/components/icons/bild_icons/Logora.js +25 -0
- package/dist/components/icons/bild_icons/Mail.js +11 -0
- package/dist/components/icons/bild_icons/MinusCircle.js +24 -0
- package/dist/components/icons/bild_icons/MobileClose.js +19 -0
- package/dist/components/icons/bild_icons/MobileMenu.js +29 -0
- package/dist/components/icons/bild_icons/Next.js +22 -0
- package/dist/components/icons/bild_icons/OpenBlank.js +15 -0
- package/dist/components/icons/bild_icons/OrderedList.js +11 -0
- package/dist/components/icons/bild_icons/PauseCircle.js +34 -0
- package/dist/components/icons/bild_icons/Point.js +21 -0
- package/dist/components/icons/bild_icons/Question.js +18 -0
- package/dist/components/icons/bild_icons/Refresh.js +11 -0
- package/dist/components/icons/bild_icons/Reply.js +11 -0
- package/dist/components/icons/bild_icons/Search.js +11 -0
- package/dist/components/icons/bild_icons/Send.js +11 -0
- package/dist/components/icons/bild_icons/Share.js +12 -0
- package/dist/components/icons/bild_icons/SmallArrow.js +11 -0
- package/dist/components/icons/bild_icons/Source.js +11 -0
- package/dist/components/icons/bild_icons/Suggestion.js +19 -0
- package/dist/components/icons/bild_icons/Twitter.js +29 -0
- package/dist/components/icons/bild_icons/Underline.js +11 -0
- package/dist/components/icons/bild_icons/Upvote.js +11 -0
- package/dist/components/icons/bild_icons/User.js +11 -0
- package/dist/components/icons/bild_icons/Versus.js +14 -0
- package/dist/components/icons/bild_icons/Votebox.js +12 -0
- package/dist/components/icons/bild_icons/index.js +110 -0
- package/dist/components/icons/hero_icons/Alarm.js +18 -0
- package/dist/components/icons/hero_icons/Announcement.js +18 -0
- package/dist/components/icons/hero_icons/Arrow.js +18 -0
- package/dist/components/icons/hero_icons/Blockquote.js +27 -0
- package/dist/components/icons/hero_icons/Bold.js +17 -0
- package/dist/components/icons/hero_icons/Camera.js +22 -0
- package/dist/components/icons/hero_icons/Chat.js +18 -0
- package/dist/components/icons/hero_icons/Check.js +18 -0
- package/dist/components/icons/hero_icons/CheckCircle.js +20 -0
- package/dist/components/icons/hero_icons/Checkbox.js +18 -0
- package/dist/components/icons/hero_icons/Clap.js +18 -0
- package/dist/components/icons/hero_icons/Clock.js +18 -0
- package/dist/components/icons/hero_icons/Close.js +18 -0
- package/dist/components/icons/hero_icons/Code.js +18 -0
- package/dist/components/icons/hero_icons/Community.js +18 -0
- package/dist/components/icons/hero_icons/Crown.js +18 -0
- package/dist/components/icons/hero_icons/Downvote.js +18 -0
- package/dist/components/icons/hero_icons/Ellipsis.js +18 -0
- package/dist/components/icons/hero_icons/ExpertBadge.js +18 -0
- package/dist/components/icons/hero_icons/Facebook.js +11 -0
- package/dist/components/icons/hero_icons/Flag.js +11 -0
- package/dist/components/icons/hero_icons/Home.js +18 -0
- package/dist/components/icons/hero_icons/Italic.js +17 -0
- package/dist/components/icons/hero_icons/LightArrow.js +12 -0
- package/dist/components/icons/hero_icons/Link.js +18 -0
- package/dist/components/icons/hero_icons/Login.js +19 -0
- package/dist/components/icons/hero_icons/Logora.js +25 -0
- package/dist/components/icons/hero_icons/Mail.js +18 -0
- package/dist/components/icons/hero_icons/MinusCircle.js +24 -0
- package/dist/components/icons/hero_icons/MobileClose.js +18 -0
- package/dist/components/icons/hero_icons/MobileMenu.js +18 -0
- package/dist/components/icons/hero_icons/Next.js +18 -0
- package/dist/components/icons/hero_icons/OpenBlank.js +18 -0
- package/dist/components/icons/hero_icons/OrderedList.js +47 -0
- package/dist/components/icons/hero_icons/PauseCircle.js +34 -0
- package/dist/components/icons/hero_icons/Point.js +21 -0
- package/dist/components/icons/hero_icons/Question.js +18 -0
- package/dist/components/icons/hero_icons/Refresh.js +18 -0
- package/dist/components/icons/hero_icons/Reply.js +18 -0
- package/dist/components/icons/hero_icons/Search.js +18 -0
- package/dist/components/icons/hero_icons/Send.js +18 -0
- package/dist/components/icons/hero_icons/Share.js +18 -0
- package/dist/components/icons/hero_icons/SmallArrow.js +18 -0
- package/dist/components/icons/hero_icons/Source.js +18 -0
- package/dist/components/icons/hero_icons/Suggestion.js +18 -0
- package/dist/components/icons/hero_icons/Twitter.js +29 -0
- package/dist/components/icons/hero_icons/Underline.js +27 -0
- package/dist/components/icons/hero_icons/Upvote.js +18 -0
- package/dist/components/icons/hero_icons/User.js +18 -0
- package/dist/components/icons/hero_icons/Versus.js +18 -0
- package/dist/components/icons/hero_icons/Votebox.js +18 -0
- package/dist/components/icons/hero_icons/index.js +108 -0
- package/dist/components/icons/krone_icons/Alarm.js +28 -0
- package/dist/components/icons/krone_icons/Announcement.js +16 -0
- package/dist/components/icons/krone_icons/Arrow.js +11 -0
- package/dist/components/icons/krone_icons/Blockquote.js +11 -0
- package/dist/components/icons/krone_icons/Bold.js +11 -0
- package/dist/components/icons/krone_icons/Camera.js +11 -0
- package/dist/components/icons/krone_icons/Chat.js +30 -0
- package/dist/components/icons/krone_icons/Check.js +11 -0
- package/dist/components/icons/krone_icons/CheckCircle.js +20 -0
- package/dist/components/icons/krone_icons/Clap.js +30 -0
- package/dist/components/icons/krone_icons/Clock.js +11 -0
- package/dist/components/icons/krone_icons/Close.js +11 -0
- package/dist/components/icons/krone_icons/Code.js +32 -0
- package/dist/components/icons/krone_icons/Community.js +11 -0
- package/dist/components/icons/krone_icons/Crown.js +11 -0
- package/dist/components/icons/krone_icons/Document.js +11 -0
- package/dist/components/icons/krone_icons/Downvote.js +11 -0
- package/dist/components/icons/krone_icons/Ellipsis.js +18 -0
- package/dist/components/icons/krone_icons/ExpertBadge.js +30 -0
- package/dist/components/icons/krone_icons/Facebook.js +11 -0
- package/dist/components/icons/krone_icons/Flag.js +11 -0
- package/dist/components/icons/krone_icons/Home.js +30 -0
- package/dist/components/icons/krone_icons/Italic.js +11 -0
- package/dist/components/icons/krone_icons/LightArrow.js +11 -0
- package/dist/components/icons/krone_icons/Link.js +11 -0
- package/dist/components/icons/krone_icons/Login.js +18 -0
- package/dist/components/icons/krone_icons/Logora.js +25 -0
- package/dist/components/icons/krone_icons/Mail.js +11 -0
- package/dist/components/icons/krone_icons/MinusCircle.js +24 -0
- package/dist/components/icons/krone_icons/MobileClose.js +18 -0
- package/dist/components/icons/krone_icons/MobileMenu.js +29 -0
- package/dist/components/icons/krone_icons/Next.js +22 -0
- package/dist/components/icons/krone_icons/OpenBlank.js +15 -0
- package/dist/components/icons/krone_icons/OrderedList.js +11 -0
- package/dist/components/icons/krone_icons/PauseCircle.js +33 -0
- package/dist/components/icons/krone_icons/Point.js +21 -0
- package/dist/components/icons/krone_icons/Question.js +30 -0
- package/dist/components/icons/krone_icons/Refresh.js +11 -0
- package/dist/components/icons/krone_icons/Reply.js +18 -0
- package/dist/components/icons/krone_icons/Search.js +11 -0
- package/dist/components/icons/krone_icons/Send.js +26 -0
- package/dist/components/icons/krone_icons/Share.js +14 -0
- package/dist/components/icons/krone_icons/SmallArrow.js +11 -0
- package/dist/components/icons/krone_icons/Source.js +11 -0
- package/dist/components/icons/krone_icons/Suggestion.js +30 -0
- package/dist/components/icons/krone_icons/Twitter.js +29 -0
- package/dist/components/icons/krone_icons/Underline.js +11 -0
- package/dist/components/icons/krone_icons/Upvote.js +30 -0
- package/dist/components/icons/krone_icons/User.js +33 -0
- package/dist/components/icons/krone_icons/Versus.js +11 -0
- package/dist/components/icons/krone_icons/Votebox.js +30 -0
- package/dist/components/icons/krone_icons/index.js +110 -0
- package/dist/components/icons/regular_icons/Alarm.js +15 -0
- package/dist/components/icons/regular_icons/Announcement.js +20 -0
- package/dist/components/icons/regular_icons/Arrow.js +11 -0
- package/dist/components/icons/regular_icons/Blockquote.js +11 -0
- package/dist/components/icons/regular_icons/Bold.js +11 -0
- package/dist/components/icons/regular_icons/Camera.js +11 -0
- package/dist/components/icons/regular_icons/Chat.js +16 -0
- package/dist/components/icons/regular_icons/Check.js +11 -0
- package/dist/components/icons/regular_icons/CheckCircle.js +20 -0
- package/dist/components/icons/regular_icons/Checkbox.js +11 -0
- package/dist/components/icons/regular_icons/Clap.js +15 -0
- package/dist/components/icons/regular_icons/Clock.js +11 -0
- package/dist/components/icons/regular_icons/Close.js +11 -0
- package/dist/components/icons/regular_icons/Code.js +32 -0
- package/dist/components/icons/regular_icons/Community.js +11 -0
- package/dist/components/icons/regular_icons/Crown.js +11 -0
- package/dist/components/icons/regular_icons/Document.js +11 -0
- package/dist/components/icons/regular_icons/Downvote.js +11 -0
- package/dist/components/icons/regular_icons/Ellipsis.js +11 -0
- package/dist/components/icons/regular_icons/ExpertBadge.js +32 -0
- package/dist/components/icons/regular_icons/Facebook.js +11 -0
- package/dist/components/icons/regular_icons/Flag.js +11 -0
- package/dist/components/icons/regular_icons/Home.js +11 -0
- package/dist/components/icons/regular_icons/Italic.js +11 -0
- package/dist/components/icons/regular_icons/LightArrow.js +11 -0
- package/dist/components/icons/regular_icons/Link.js +11 -0
- package/dist/components/icons/regular_icons/Login.js +18 -0
- package/dist/components/icons/regular_icons/Logora.js +25 -0
- package/dist/components/icons/regular_icons/Mail.js +11 -0
- package/dist/components/icons/regular_icons/MinusCircle.js +24 -0
- package/dist/components/icons/regular_icons/MobileClose.js +18 -0
- package/dist/components/icons/regular_icons/MobileMenu.js +29 -0
- package/dist/components/icons/regular_icons/Next.js +22 -0
- package/dist/components/icons/regular_icons/OpenBlank.js +15 -0
- package/dist/components/icons/regular_icons/OrderedList.js +11 -0
- package/dist/components/icons/regular_icons/PauseCircle.js +33 -0
- package/dist/components/icons/regular_icons/Point.js +21 -0
- package/dist/components/icons/regular_icons/Question.js +18 -0
- package/dist/components/icons/regular_icons/Refresh.js +11 -0
- package/dist/components/icons/regular_icons/Reply.js +11 -0
- package/dist/components/icons/regular_icons/Search.js +11 -0
- package/dist/components/icons/regular_icons/Send.js +11 -0
- package/dist/components/icons/regular_icons/Share.js +12 -0
- package/dist/components/icons/regular_icons/SmallArrow.js +11 -0
- package/dist/components/icons/regular_icons/Source.js +11 -0
- package/dist/components/icons/regular_icons/Suggestion.js +19 -0
- package/dist/components/icons/regular_icons/Twitter.js +29 -0
- package/dist/components/icons/regular_icons/Underline.js +11 -0
- package/dist/components/icons/regular_icons/Upvote.js +11 -0
- package/dist/components/icons/regular_icons/User.js +11 -0
- package/dist/components/icons/regular_icons/Versus.js +11 -0
- package/dist/components/icons/regular_icons/Votebox.js +12 -0
- package/dist/components/icons/regular_icons/index.js +110 -0
- package/dist/components/icons/spiegel_icons/Alarm.js +15 -0
- package/dist/components/icons/spiegel_icons/Announcement.js +20 -0
- package/dist/components/icons/spiegel_icons/Arrow.js +11 -0
- package/dist/components/icons/spiegel_icons/Blockquote.js +26 -0
- package/dist/components/icons/spiegel_icons/Bold.js +16 -0
- package/dist/components/icons/spiegel_icons/Camera.js +11 -0
- package/dist/components/icons/spiegel_icons/Chat.js +12 -0
- package/dist/components/icons/spiegel_icons/Check.js +11 -0
- package/dist/components/icons/spiegel_icons/CheckCircle.js +20 -0
- package/dist/components/icons/spiegel_icons/Checkbox.js +26 -0
- package/dist/components/icons/spiegel_icons/Clap.js +26 -0
- package/dist/components/icons/spiegel_icons/Clock.js +26 -0
- package/dist/components/icons/spiegel_icons/Close.js +15 -0
- package/dist/components/icons/spiegel_icons/Code.js +32 -0
- package/dist/components/icons/spiegel_icons/Community.js +11 -0
- package/dist/components/icons/spiegel_icons/Crown.js +12 -0
- package/dist/components/icons/spiegel_icons/Downvote.js +11 -0
- package/dist/components/icons/spiegel_icons/Ellipsis.js +12 -0
- package/dist/components/icons/spiegel_icons/ExpertBadge.js +28 -0
- package/dist/components/icons/spiegel_icons/Facebook.js +16 -0
- package/dist/components/icons/spiegel_icons/Flag.js +20 -0
- package/dist/components/icons/spiegel_icons/Home.js +11 -0
- package/dist/components/icons/spiegel_icons/Italic.js +16 -0
- package/dist/components/icons/spiegel_icons/LightArrow.js +12 -0
- package/dist/components/icons/spiegel_icons/Link.js +26 -0
- package/dist/components/icons/spiegel_icons/Login.js +19 -0
- package/dist/components/icons/spiegel_icons/Logora.js +25 -0
- package/dist/components/icons/spiegel_icons/Mail.js +16 -0
- package/dist/components/icons/spiegel_icons/MinusCircle.js +20 -0
- package/dist/components/icons/spiegel_icons/MobileClose.js +19 -0
- package/dist/components/icons/spiegel_icons/MobileMenu.js +29 -0
- package/dist/components/icons/spiegel_icons/Next.js +22 -0
- package/dist/components/icons/spiegel_icons/OpenBlank.js +15 -0
- package/dist/components/icons/spiegel_icons/OrderedList.js +29 -0
- package/dist/components/icons/spiegel_icons/PauseCircle.js +20 -0
- package/dist/components/icons/spiegel_icons/Point.js +21 -0
- package/dist/components/icons/spiegel_icons/Question.js +30 -0
- package/dist/components/icons/spiegel_icons/Refresh.js +11 -0
- package/dist/components/icons/spiegel_icons/Reply.js +12 -0
- package/dist/components/icons/spiegel_icons/Search.js +11 -0
- package/dist/components/icons/spiegel_icons/Send.js +11 -0
- package/dist/components/icons/spiegel_icons/Share.js +26 -0
- package/dist/components/icons/spiegel_icons/SmallArrow.js +12 -0
- package/dist/components/icons/spiegel_icons/Source.js +11 -0
- package/dist/components/icons/spiegel_icons/Suggestion.js +16 -0
- package/dist/components/icons/spiegel_icons/Twitter.js +29 -0
- package/dist/components/icons/spiegel_icons/Underline.js +26 -0
- package/dist/components/icons/spiegel_icons/Upvote.js +11 -0
- package/dist/components/icons/spiegel_icons/User.js +11 -0
- package/dist/components/icons/spiegel_icons/Versus.js +14 -0
- package/dist/components/icons/spiegel_icons/Votebox.js +26 -0
- package/dist/components/icons/spiegel_icons/index.js +108 -0
- package/dist/components/input/argument_input/ArgumentInput.js +100 -99
- package/dist/components/input/search_input/SearchInput.js +4 -4
- package/dist/components/input/text_editor/TextEditor.js +50 -50
- package/dist/components/input/text_editor/lexicalToHtml.js +7 -7
- package/dist/components/input/text_editor/plugins/MaxLengthPlugin.js +12 -12
- package/dist/components/input/text_editor/plugins/ResetPlugin.js +6 -6
- package/dist/components/input/text_editor/plugins/SetContentPlugin.js +6 -6
- package/dist/components/input/text_editor/plugins/ToolbarPlugin.js +21 -21
- package/dist/components/intl/intl_provider/IntlProvider.js +6 -6
- package/dist/components/list/paginated_list/PaginatedList.js +16 -16
- package/dist/components/list/paginated_list/VotePaginatedList.js +6 -6
- package/dist/components/list/paginated_list/action_bar/ActionBar.js +7 -7
- package/dist/components/navbar/navbar_button/NavbarButton.js +3 -3
- package/dist/components/navbar/navbar_modal/NavbarModal.js +11 -11
- package/dist/components/notification/notification_menu/NotificationMenu.js +4 -4
- package/dist/components/proposal/proposal_box/ProposalBox.js +8 -8
- package/dist/components/share/share_box/ShareBox.js +17 -17
- package/dist/components/source/context_source_list/ContextSourceList.js +3 -3
- package/dist/components/source/source_modal/SourceModal.js +16 -16
- package/dist/components/suggestion/suggestion_banner/SuggestionBanner.js +14 -14
- package/dist/components/suggestion/suggestion_box/SuggestionBox.js +6 -6
- package/dist/components/suggestion/suggestion_input/SuggestionInput.js +13 -12
- package/dist/components/user/avatar/Avatar.js +7 -7
- package/dist/components/user/update_user_info_modal/UpdateUserInfoModal.js +17 -15
- package/dist/components/user_content/content_footer/ContentFooter.js +11 -11
- package/dist/components/user_content/summary_content_box/SummaryContentBox.js +6 -6
- package/dist/components/user_content/use_delete_content/useDeleteContent.js +7 -7
- package/dist/components/user_content/use_report_content/ReportModal.js +9 -9
- package/dist/components/vote/use_vote/useVote.js +3 -3
- package/dist/components/vote/vote_box/VoteBox.js +7 -7
- package/dist/index.js +140 -84
- package/dist/node_modules/.pnpm/@lexical_react@0.38.2_react-dom@18.3.1_react@18.3.1__react@18.3.1_yjs@13.6.30/node_modules/@lexical/react/LexicalCharacterLimitPlugin.prod.js +57 -57
- package/dist/node_modules/.pnpm/@lexical_react@0.38.2_react-dom@18.3.1_react@18.3.1__react@18.3.1_yjs@13.6.30/node_modules/@lexical/react/LexicalComposer.prod.js +14 -14
- package/dist/node_modules/.pnpm/@lexical_react@0.38.2_react-dom@18.3.1_react@18.3.1__react@18.3.1_yjs@13.6.30/node_modules/@lexical/react/LexicalContentEditable.prod.js +15 -15
- package/dist/node_modules/.pnpm/@lexical_react@0.38.2_react-dom@18.3.1_react@18.3.1__react@18.3.1_yjs@13.6.30/node_modules/@lexical/react/LexicalListPlugin.prod.js +6 -6
- package/dist/node_modules/.pnpm/@lexical_react@0.38.2_react-dom@18.3.1_react@18.3.1__react@18.3.1_yjs@13.6.30/node_modules/@lexical/react/LexicalOnChangePlugin.prod.js +1 -1
- package/dist/node_modules/.pnpm/@lexical_react@0.38.2_react-dom@18.3.1_react@18.3.1__react@18.3.1_yjs@13.6.30/node_modules/@lexical/react/LexicalRichTextPlugin.prod.js +21 -21
- package/package.json +6 -1
package/README.md
CHANGED
|
@@ -3,13 +3,11 @@
|
|
|
3
3
|
---
|
|
4
4
|
Design system for [Logora](https://logora.fr) made with React.
|
|
5
5
|
|
|
6
|
-
This repository is now running with open source tooling (pnpm, Vitest, Storybook).
|
|
7
|
-
|
|
8
6
|
## Public API contract
|
|
9
7
|
|
|
10
|
-
This package exposes a
|
|
8
|
+
This package exposes a global public API:
|
|
11
9
|
|
|
12
|
-
###
|
|
10
|
+
### Root API
|
|
13
11
|
|
|
14
12
|
```js
|
|
15
13
|
import { Button, Modal, useAuth } from "@logora/debate";
|
|
@@ -17,21 +15,10 @@ import { Button, Modal, useAuth } from "@logora/debate";
|
|
|
17
15
|
|
|
18
16
|
Use this style by default for developer experience and discoverability.
|
|
19
17
|
|
|
20
|
-
### 2) Subpath API (supported)
|
|
21
|
-
|
|
22
|
-
```js
|
|
23
|
-
import { Button } from "@logora/debate/action/button";
|
|
24
|
-
import { Modal } from "@logora/debate/dialog/modal";
|
|
25
|
-
import { useAuth } from "@logora/debate/auth/use_auth";
|
|
26
|
-
```
|
|
27
|
-
|
|
28
|
-
Use this style when you want explicit module-level imports in performance-sensitive areas.
|
|
29
|
-
|
|
30
18
|
### Tree-shaking guarantees
|
|
31
19
|
|
|
32
20
|
- JavaScript modules are tree-shakable with named ESM imports.
|
|
33
21
|
- Root imports are supported and expected to be tree-shaken by modern bundlers.
|
|
34
|
-
- Subpath imports remain available for strict control over dependency boundaries.
|
|
35
22
|
- Avoid namespace imports if tree-shaking matters:
|
|
36
23
|
|
|
37
24
|
```js
|
|
@@ -45,17 +32,10 @@ import * as Debate from "@logora/debate";
|
|
|
45
32
|
- Consumers should not need to import an extra global CSS file for standard component usage.
|
|
46
33
|
- Package `sideEffects` is limited to `*.css` and `*.scss` to preserve JS tree-shaking.
|
|
47
34
|
|
|
48
|
-
### Compatibility policy
|
|
49
|
-
|
|
50
|
-
- Paths exposed through package exports are public API.
|
|
51
|
-
- Root exports and documented subpaths follow semantic versioning.
|
|
52
|
-
- Internal files not exposed by package exports are private and may change without notice.
|
|
53
|
-
|
|
54
35
|
### Deprecation policy
|
|
55
36
|
|
|
56
37
|
- Breaking API changes are introduced only in major versions.
|
|
57
38
|
- Deprecated exports should be announced before removal.
|
|
58
|
-
- During deprecation windows, keep both old and new imports when possible.
|
|
59
39
|
|
|
60
40
|
## Installation
|
|
61
41
|
|
|
@@ -87,4 +67,16 @@ pnpm test:coverage
|
|
|
87
67
|
|
|
88
68
|
```bash
|
|
89
69
|
pnpm build-storybook
|
|
90
|
-
```
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
## Publishing a new version (npm)
|
|
73
|
+
|
|
74
|
+
```bash
|
|
75
|
+
pnpm run build
|
|
76
|
+
npm version patch -m "chore(release): %s"
|
|
77
|
+
npm login
|
|
78
|
+
git push --follow-tags origin master
|
|
79
|
+
npm publish --access public
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
Use `minor` or `major` instead of `patch` when needed.
|
|
@@ -21,7 +21,7 @@ var a = /* @__PURE__ */ e(r()), o = t(), s = ({ className: e, type: t = "button"
|
|
|
21
21
|
tabIndex: 0,
|
|
22
22
|
className: (0, a.default)(i.primaryButton, e, (s || c) && !m && i.iconOnly, (s || c) && i.withIcon, s && i.withLeftIcon, c && i.withRightIcon, r && i.active, !u && i.withoutBorder, i[l]),
|
|
23
23
|
onClick: (e) => {
|
|
24
|
-
d
|
|
24
|
+
d?.(e);
|
|
25
25
|
},
|
|
26
26
|
...h,
|
|
27
27
|
children: [
|
|
@@ -2,27 +2,27 @@ import { __toESM as e } from "../../../_virtual/_rolldown/runtime.js";
|
|
|
2
2
|
import { require_jsx_runtime as t } from "../../../node_modules/.pnpm/react@18.3.1/node_modules/react/jsx-runtime.js";
|
|
3
3
|
import { Icon as n } from "../../icons/icon/Icon.js";
|
|
4
4
|
import { require_classnames as r } from "../../../node_modules/.pnpm/classnames@2.5.1/node_modules/classnames/index.js";
|
|
5
|
-
import { Button as
|
|
6
|
-
import { useAuth as
|
|
7
|
-
import { useConfig as
|
|
8
|
-
import
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import
|
|
20
|
-
import {
|
|
21
|
-
import h from "./
|
|
5
|
+
import { Button as i } from "../../action/button/Button.js";
|
|
6
|
+
import { useAuth as a } from "../../auth/use_auth/useAuth.js";
|
|
7
|
+
import { useConfig as o } from "../../data/config_provider/useConfig.js";
|
|
8
|
+
import ee from "../../../node_modules/.pnpm/react-intl@7.1.14_react@18.3.1_typescript@5.9.3/node_modules/react-intl/lib/src/components/useIntl.js";
|
|
9
|
+
import { VotePaginatedList as te } from "../../list/paginated_list/VotePaginatedList.js";
|
|
10
|
+
import { UserContentSkeleton as ne } from "../../skeleton/user_content_skeleton/UserContentSkeleton.js";
|
|
11
|
+
import { SourceListItem as re } from "../../source/source_list_item/SourceListItem.js";
|
|
12
|
+
import { ReadMore as ie } from "../../text/read_more/ReadMore.js";
|
|
13
|
+
import { HashScroll as s } from "../../tools/hash_scroll/HashScroll.js";
|
|
14
|
+
import { useTranslatedContent as c } from "../../translation/translated_content/useTranslatedContent.js";
|
|
15
|
+
import { TranslationButton as l } from "../../translation/translation_button/TranslationButton.js";
|
|
16
|
+
import { ContentFooter as u } from "../../user_content/content_footer/ContentFooter.js";
|
|
17
|
+
import { ContentHeader as d } from "../../user_content/content_header/ContentHeader.js";
|
|
18
|
+
import { VoteButton as f } from "../../vote/vote_button/VoteButton.js";
|
|
19
|
+
import p from "./Argument.module.js";
|
|
20
|
+
import { ReplyFooter as m } from "./ReplyFooter.js";
|
|
21
|
+
import { useRichContent as h } from "./useRichContent.js";
|
|
22
22
|
import { Suspense as ae, lazy as g, useCallback as oe, useEffect as se, useState as _ } from "react";
|
|
23
23
|
//#region src/components/argument/argument/Argument.jsx
|
|
24
24
|
var v = /* @__PURE__ */ e(r()), y = t(), ce = g(() => import("../../input/argument_input/index.js")), b = ({ argument: e, argumentReplies: t, nestingLevel: r = 0, groupType: g, groupName: b, positions: x = [], disableLinks: ue = !1, parentArgument: S, flashParent: C, expandable: w, disabled: T = !1, hideFooter: E = !1, hideReplies: D, vote: O, fixedContentHeight: k = !1, enableEdition: A = !0, enableDeletion: j = !0, deleteListId: M, showModerationFeedback: N, lineCount: P = 5, replyRedirectUrl: F, hideContent: I = !1 }) => {
|
|
25
|
-
let L =
|
|
25
|
+
let L = ee(), { isLoggedIn: R, currentUser: z } = a(), B = z?.moderation_status === "banned", V = o(), [H, U] = _(!1), [de, W] = _(!1), [fe, pe] = _(!1), G = h(e), [K, q] = _(), J = c(e.content, e.language, "content", e.translation_entries), me = c(e.position?.name, e.position?.language, "name", e.position?.translation_entries), Y = `argument_${e.id}`, X = e.position && x?.map((e) => e.id).indexOf(e.position.id) + 1;
|
|
26
26
|
se(() => {
|
|
27
27
|
t !== void 0 && ve();
|
|
28
28
|
}, [t]);
|
|
@@ -37,7 +37,7 @@ var v = /* @__PURE__ */ e(r()), y = t(), ce = g(() => import("../../input/argume
|
|
|
37
37
|
U((e) => !e), q([]);
|
|
38
38
|
}, ge = (e) => {
|
|
39
39
|
if (!K?.find((t) => t.id === e.id)) return e;
|
|
40
|
-
}, _e = oe((e, t) => /* @__PURE__ */ (0, y.jsx)(
|
|
40
|
+
}, _e = oe((e, t) => /* @__PURE__ */ (0, y.jsx)(re, {
|
|
41
41
|
publisher: e.publisher,
|
|
42
42
|
url: e.source_url,
|
|
43
43
|
title: e.title,
|
|
@@ -58,22 +58,22 @@ var v = /* @__PURE__ */ e(r()), y = t(), ce = g(() => import("../../input/argume
|
|
|
58
58
|
parentArgument: e,
|
|
59
59
|
flashParent: (e) => he(`argument_${e}`)
|
|
60
60
|
});
|
|
61
|
-
return /* @__PURE__ */ (0, y.jsxs)(
|
|
61
|
+
return /* @__PURE__ */ (0, y.jsxs)(s, {
|
|
62
62
|
elementId: Y,
|
|
63
63
|
onScroll: () => W(!0),
|
|
64
64
|
children: [/* @__PURE__ */ (0, y.jsxs)("div", {
|
|
65
|
-
className: (0, v.default)(
|
|
66
|
-
[
|
|
67
|
-
[
|
|
68
|
-
},
|
|
65
|
+
className: (0, v.default)(p.argument, {
|
|
66
|
+
[p.flash]: de,
|
|
67
|
+
[p.argumentReply]: e.is_reply === !0
|
|
68
|
+
}, p[`level-${r}`], p[`position-${!(e.author.role === "editor" || e.author.role === "moderator") && X}`]),
|
|
69
69
|
id: Y,
|
|
70
70
|
children: [
|
|
71
|
-
/* @__PURE__ */ (0, y.jsx)(
|
|
71
|
+
/* @__PURE__ */ (0, y.jsx)(d, {
|
|
72
72
|
selectedContent: e.score === 99,
|
|
73
73
|
author: e.author,
|
|
74
74
|
tag: (e.author.role === "editor" || e.author.role === "moderator") && e.is_reply ? null : me.translatedContent,
|
|
75
75
|
date: e.created_at,
|
|
76
|
-
tagClassName:
|
|
76
|
+
tagClassName: p[`headerPosition-${X}`],
|
|
77
77
|
disableLinks: ue,
|
|
78
78
|
isDeleted: e.is_deleted,
|
|
79
79
|
showModerationFeedback: N ?? (e.status === "rejected" && V.moderation?.showFeedback === !0),
|
|
@@ -82,27 +82,27 @@ var v = /* @__PURE__ */ e(r()), y = t(), ce = g(() => import("../../input/argume
|
|
|
82
82
|
moderationPolicyUrl: V.provider?.userGuideUrl
|
|
83
83
|
}),
|
|
84
84
|
e.is_deleted ? /* @__PURE__ */ (0, y.jsx)("div", {
|
|
85
|
-
className:
|
|
85
|
+
className: p.argumentDeletedBody,
|
|
86
86
|
children: L.formatMessage({
|
|
87
87
|
id: "info.deleted_by_user",
|
|
88
88
|
defaultMessage: "Content deleted by the user"
|
|
89
89
|
})
|
|
90
90
|
}) : I ? /* @__PURE__ */ (0, y.jsx)("div", {
|
|
91
|
-
className:
|
|
91
|
+
className: p.argumentDeletedBody,
|
|
92
92
|
children: L.formatMessage({
|
|
93
93
|
id: "argument.argument.content_deleted",
|
|
94
94
|
defaultMessage: "This content has been removed."
|
|
95
95
|
})
|
|
96
96
|
}) : /* @__PURE__ */ (0, y.jsxs)(y.Fragment, { children: [/* @__PURE__ */ (0, y.jsxs)("div", {
|
|
97
|
-
className: (0, v.default)(
|
|
97
|
+
className: (0, v.default)(p.argumentBody, { [p.fixedHeight]: V?.layout?.showAllArgumentInEmbed === !0 ? !1 : k }),
|
|
98
98
|
children: [e.is_reply && S && /* @__PURE__ */ (0, y.jsxs)("div", {
|
|
99
|
-
className:
|
|
99
|
+
className: p.replyTo,
|
|
100
100
|
onClick: () => C(S.id),
|
|
101
101
|
children: [L.formatMessage({
|
|
102
102
|
id: "info.replying_to",
|
|
103
103
|
defaultMessage: "Replying to"
|
|
104
104
|
}), /* @__PURE__ */ (0, y.jsxs)("span", {
|
|
105
|
-
className:
|
|
105
|
+
className: p.replyingTo,
|
|
106
106
|
children: [S.is_deleted ? L.formatMessage({
|
|
107
107
|
id: "info.deleted",
|
|
108
108
|
defaultMessage: "Deleted"
|
|
@@ -111,23 +111,23 @@ var v = /* @__PURE__ */ e(r()), y = t(), ce = g(() => import("../../input/argume
|
|
|
111
111
|
height: 16
|
|
112
112
|
})]
|
|
113
113
|
})]
|
|
114
|
-
}), /* @__PURE__ */ (0, y.jsx)(
|
|
114
|
+
}), /* @__PURE__ */ (0, y.jsx)(ie, {
|
|
115
115
|
content: /* @__PURE__ */ (0, y.jsxs)(y.Fragment, { children: [
|
|
116
116
|
e.is_edited && /* @__PURE__ */ (0, y.jsx)("div", {
|
|
117
|
-
className:
|
|
117
|
+
className: p.edited,
|
|
118
118
|
children: L.formatMessage({
|
|
119
119
|
id: "argument.argument.updated",
|
|
120
120
|
defaultMessage: "Updated argument"
|
|
121
121
|
})
|
|
122
122
|
}),
|
|
123
123
|
G && !J.isTranslated ? /* @__PURE__ */ (0, y.jsx)("div", {
|
|
124
|
-
className:
|
|
124
|
+
className: p.argumentContent,
|
|
125
125
|
dangerouslySetInnerHTML: { __html: G }
|
|
126
126
|
}) : /* @__PURE__ */ (0, y.jsx)("div", {
|
|
127
|
-
className:
|
|
127
|
+
className: p.argumentContent,
|
|
128
128
|
children: J.translatedContent
|
|
129
129
|
}),
|
|
130
|
-
J.isTranslated && /* @__PURE__ */ (0, y.jsx)(
|
|
130
|
+
J.isTranslated && /* @__PURE__ */ (0, y.jsx)(l, {
|
|
131
131
|
language: e.language,
|
|
132
132
|
callback: () => J.toggleContent()
|
|
133
133
|
})
|
|
@@ -142,13 +142,13 @@ var v = /* @__PURE__ */ e(r()), y = t(), ce = g(() => import("../../input/argume
|
|
|
142
142
|
defaultMessage: "Read less"
|
|
143
143
|
}),
|
|
144
144
|
expandable: V?.layout?.showAllArgumentInEmbed === !0 ? !1 : w,
|
|
145
|
-
readMoreClassName: e.is_reply ?
|
|
145
|
+
readMoreClassName: e.is_reply ? p.replyStyle : p.argumentStyle
|
|
146
146
|
})]
|
|
147
147
|
}), e.sources?.length > 0 && /* @__PURE__ */ (0, y.jsx)("div", {
|
|
148
|
-
className:
|
|
148
|
+
className: p.argumentSourcesList,
|
|
149
149
|
children: e.sources.map(_e)
|
|
150
150
|
})] }),
|
|
151
|
-
!E && !e.is_deleted && /* @__PURE__ */ (0, y.jsx)(
|
|
151
|
+
!E && !e.is_deleted && /* @__PURE__ */ (0, y.jsx)(u, {
|
|
152
152
|
resource: e,
|
|
153
153
|
disabled: T || e.status === "rejected" || !R && V?.actions?.disableInputForVisitor === !0 || B,
|
|
154
154
|
reportType: "Message",
|
|
@@ -174,16 +174,16 @@ var v = /* @__PURE__ */ e(r()), y = t(), ce = g(() => import("../../input/argume
|
|
|
174
174
|
enableReport: !(e.score === 100 && e.manual_score),
|
|
175
175
|
enableEdition: A,
|
|
176
176
|
enableDeletion: j,
|
|
177
|
-
children: /* @__PURE__ */ (0, y.jsx)(
|
|
177
|
+
children: /* @__PURE__ */ (0, y.jsx)(f, {
|
|
178
178
|
voteableType: "Message",
|
|
179
179
|
voteableId: e.id,
|
|
180
180
|
totalUpvote: e.upvotes,
|
|
181
181
|
totalDownvote: 0,
|
|
182
|
-
activeClassName:
|
|
182
|
+
activeClassName: p[`voteButtonPosition-${X}`],
|
|
183
183
|
disabled: e.status === "rejected" || z?.id === e?.author?.id || B
|
|
184
184
|
})
|
|
185
185
|
}),
|
|
186
|
-
!E && !D && /* @__PURE__ */ (0, y.jsx)(
|
|
186
|
+
!E && !D && /* @__PURE__ */ (0, y.jsx)(m, {
|
|
187
187
|
numberReplies: e.number_replies,
|
|
188
188
|
repliesAuthors: e.replies_authors,
|
|
189
189
|
expandReplies: H,
|
|
@@ -216,15 +216,15 @@ var v = /* @__PURE__ */ e(r()), y = t(), ce = g(() => import("../../input/argume
|
|
|
216
216
|
}, `Reply${e.id}`)
|
|
217
217
|
}),
|
|
218
218
|
K?.length > 0 && H && /* @__PURE__ */ (0, y.jsx)("div", {
|
|
219
|
-
className:
|
|
219
|
+
className: p.repliesList,
|
|
220
220
|
children: K.map((e) => $(e))
|
|
221
221
|
}),
|
|
222
222
|
H && /* @__PURE__ */ (0, y.jsx)("div", {
|
|
223
|
-
className:
|
|
224
|
-
children: /* @__PURE__ */ (0, y.jsx)(
|
|
223
|
+
className: p.repliesList,
|
|
224
|
+
children: /* @__PURE__ */ (0, y.jsx)(te, {
|
|
225
225
|
voteableType: "Message",
|
|
226
226
|
currentListId: `argument_${e.id}_reply_list`,
|
|
227
|
-
loadingComponent: /* @__PURE__ */ (0, y.jsx)(
|
|
227
|
+
loadingComponent: /* @__PURE__ */ (0, y.jsx)(ne, {}),
|
|
228
228
|
resource: "messages",
|
|
229
229
|
sort: "+created_at",
|
|
230
230
|
filters: {
|
|
@@ -241,10 +241,10 @@ var v = /* @__PURE__ */ e(r()), y = t(), ce = g(() => import("../../input/argume
|
|
|
241
241
|
})
|
|
242
242
|
}),
|
|
243
243
|
K?.length > 0 && !H && /* @__PURE__ */ (0, y.jsx)("div", {
|
|
244
|
-
className:
|
|
244
|
+
className: p.repliesList,
|
|
245
245
|
children: e.number_replies > 1 && /* @__PURE__ */ (0, y.jsx)("div", {
|
|
246
|
-
className:
|
|
247
|
-
children: /* @__PURE__ */ (0, y.jsx)(
|
|
246
|
+
className: p.readMoreLink,
|
|
247
|
+
children: /* @__PURE__ */ (0, y.jsx)(i, {
|
|
248
248
|
role: "link",
|
|
249
249
|
rightIcon: /* @__PURE__ */ (0, y.jsx)(n, {
|
|
250
250
|
name: "lightArrow",
|
|
@@ -1,25 +1,25 @@
|
|
|
1
1
|
import { require_jsx_runtime as e } from "../../../node_modules/.pnpm/react@18.3.1/node_modules/react/jsx-runtime.js";
|
|
2
2
|
import { Button as t } from "../../action/button/Button.js";
|
|
3
3
|
import { useConfig as n } from "../../data/config_provider/useConfig.js";
|
|
4
|
-
import r from "
|
|
5
|
-
import
|
|
4
|
+
import { useResponsive as r } from "../../hooks/use_responsive/useResponsive.js";
|
|
5
|
+
import i from "../../../node_modules/.pnpm/react-intl@7.1.14_react@18.3.1_typescript@5.9.3/node_modules/react-intl/lib/src/components/message.js";
|
|
6
6
|
import { UserContentSkeleton as a } from "../../skeleton/user_content_skeleton/UserContentSkeleton.js";
|
|
7
|
-
import {
|
|
8
|
-
import s from "
|
|
9
|
-
import
|
|
7
|
+
import { useTranslatedContent as o } from "../../translation/translated_content/useTranslatedContent.js";
|
|
8
|
+
import { SummaryContentBox as s } from "../../user_content/summary_content_box/SummaryContentBox.js";
|
|
9
|
+
import c from "./TopArguments.module.js";
|
|
10
10
|
import "react";
|
|
11
11
|
//#region src/components/argument/top_arguments/TopArguments.jsx
|
|
12
12
|
var l = e(), u = ({ argumentFor: e, argumentAgainst: u, debateUrl: d, argumentCount: f, debate: p }) => {
|
|
13
|
-
let m = n(), { isMobile: h } =
|
|
13
|
+
let m = n(), { isMobile: h } = r(), g = o(e?.position.name, e?.position.language, "name", e?.position.translation_entries), _ = o(u?.position.name, u?.position.language, "name", u?.position.translation_entries), v = e && u ? e.score > u.score ? e : u : e || u || !1, y = (e, n, r) => /* @__PURE__ */ (0, l.jsx)(l.Fragment, { children: e ? /* @__PURE__ */ (0, l.jsx)(s, {
|
|
14
14
|
author: e.author,
|
|
15
15
|
tag: n === 0 ? g.translatedContent : _.translatedContent,
|
|
16
16
|
date: new Date(e.created_at),
|
|
17
|
-
link: d
|
|
17
|
+
link: `${d}#argument_${e.id}`,
|
|
18
18
|
content: e.content,
|
|
19
|
-
tagClassName:
|
|
19
|
+
tagClassName: c[`positionBackground-${n}`],
|
|
20
20
|
contentCount: f[n],
|
|
21
|
-
headerOneLine:
|
|
22
|
-
showFooter: !
|
|
21
|
+
headerOneLine: r,
|
|
22
|
+
showFooter: !r,
|
|
23
23
|
language: e.language,
|
|
24
24
|
translationEntries: e.translation_entries,
|
|
25
25
|
lineCount: m?.actions?.argumentLineCount ?? void 0
|
|
@@ -27,34 +27,34 @@ var l = e(), u = ({ argumentFor: e, argumentAgainst: u, debateUrl: d, argumentCo
|
|
|
27
27
|
enableAnimation: !1,
|
|
28
28
|
border: !0,
|
|
29
29
|
tag: n === 0 ? g.translatedContent : _.translatedContent,
|
|
30
|
-
tagClassName:
|
|
30
|
+
tagClassName: c[`positionBackground-${n}`],
|
|
31
31
|
children: /* @__PURE__ */ (0, l.jsx)(t, {
|
|
32
32
|
to: d,
|
|
33
33
|
external: !0,
|
|
34
34
|
"data-tid": "action_add_argument",
|
|
35
35
|
target: "_top",
|
|
36
36
|
rel: "nofollow",
|
|
37
|
-
children: /* @__PURE__ */ (0, l.jsx)(
|
|
37
|
+
children: /* @__PURE__ */ (0, l.jsx)(i, {
|
|
38
38
|
id: "argument.top_arguments.call_to_action",
|
|
39
39
|
defaultMessage: "Add an argument"
|
|
40
40
|
})
|
|
41
41
|
})
|
|
42
42
|
}) });
|
|
43
43
|
return /* @__PURE__ */ (0, l.jsx)(l.Fragment, { children: m.synthesis.newDesign !== !1 || h && m.synthesis.onlyShowTopArgument === !0 ? /* @__PURE__ */ (0, l.jsx)("div", {
|
|
44
|
-
className:
|
|
44
|
+
className: c.topArgumentsUnique,
|
|
45
45
|
"data-testid": "topArgumentsContainerUnique",
|
|
46
46
|
children: /* @__PURE__ */ (0, l.jsx)("div", {
|
|
47
|
-
className:
|
|
47
|
+
className: c.topArgument,
|
|
48
48
|
children: y(v, +(v === u), !0)
|
|
49
49
|
})
|
|
50
50
|
}) : /* @__PURE__ */ (0, l.jsxs)("div", {
|
|
51
|
-
className:
|
|
51
|
+
className: c.topArguments,
|
|
52
52
|
"data-testid": "topArgumentsContainer",
|
|
53
53
|
children: [/* @__PURE__ */ (0, l.jsx)("div", {
|
|
54
|
-
className:
|
|
54
|
+
className: c.topArgument,
|
|
55
55
|
children: y(e, 0, !1)
|
|
56
56
|
}), /* @__PURE__ */ (0, l.jsx)("div", {
|
|
57
|
-
className:
|
|
57
|
+
className: c.topArgument,
|
|
58
58
|
children: y(u, 1, !1)
|
|
59
59
|
})]
|
|
60
60
|
}) });
|
|
@@ -2,14 +2,14 @@ import { authTokenHandler as e } from "../use_auth/authTokenHandler.js";
|
|
|
2
2
|
import { useAuthActions as t } from "../use_auth/useAuthActions.js";
|
|
3
3
|
import { useAuthInterceptor as n } from "../use_auth/useAuthInterceptor.js";
|
|
4
4
|
import { useAuthRequired as r } from "../../hooks/use_auth_required/useAuthRequired.js";
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
5
|
+
import { AuthProviderFactory as i } from "../providers/AuthProviderFactory.js";
|
|
6
|
+
import { httpClient as a } from "../../data/axios_client/httpClient.js";
|
|
7
7
|
import { useEffect as o } from "react";
|
|
8
8
|
//#region src/components/auth/auth_initializer/AuthInitializer.jsx
|
|
9
9
|
var s = ({ authUrl: s, authType: c, provider: l, assertion: u }) => {
|
|
10
10
|
let d = "logora_user_token";
|
|
11
|
-
n(
|
|
12
|
-
let { getToken: f, removeToken: p } = e(
|
|
11
|
+
n(a, s, d);
|
|
12
|
+
let { getToken: f, removeToken: p } = e(a, s, d), { loginUser: m, logoutUser: h, fetchUser: g } = t(a, s, d), _ = r();
|
|
13
13
|
o(() => {
|
|
14
14
|
v();
|
|
15
15
|
}, []), o(() => {
|
|
@@ -28,7 +28,7 @@ var s = ({ authUrl: s, authType: c, provider: l, assertion: u }) => {
|
|
|
28
28
|
let t = e.getAuthorizationParams();
|
|
29
29
|
t && m(t);
|
|
30
30
|
} else h();
|
|
31
|
-
}, b = () =>
|
|
31
|
+
}, b = () => i.create(c, l, u);
|
|
32
32
|
return null;
|
|
33
33
|
};
|
|
34
34
|
//#endregion
|
|
@@ -2,18 +2,18 @@ import { require_jsx_runtime as e } from "../../../node_modules/.pnpm/react@18.3
|
|
|
2
2
|
import { useAuth as t } from "../use_auth/useAuth.js";
|
|
3
3
|
import { useAuthActions as n } from "../use_auth/useAuthActions.js";
|
|
4
4
|
import { useConfig as r } from "../../data/config_provider/useConfig.js";
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
5
|
+
import { Loader as i } from "../../progress/loader/Loader.js";
|
|
6
|
+
import { useModal as a } from "../../dialog/modal/useModal.js";
|
|
7
|
+
import { Modal as o } from "../../dialog/modal/Modal.js";
|
|
8
|
+
import { AuthProviderFactory as s } from "../providers/AuthProviderFactory.js";
|
|
9
|
+
import { httpClient as c } from "../../data/axios_client/httpClient.js";
|
|
10
10
|
import { SocialAuthForm as l } from "../social_auth_form/SocialAuthForm.js";
|
|
11
11
|
import { SSOForm as u } from "../sso_form/SSOForm.js";
|
|
12
12
|
import d from "./AuthModal.module.js";
|
|
13
13
|
import { useEffect as f, useState as p } from "react";
|
|
14
14
|
//#region src/components/auth/auth_modal/AuthModal.jsx
|
|
15
15
|
var m = e(), h = ({ onHideModal: e = null }) => {
|
|
16
|
-
let h = r(), { hideModal: g } =
|
|
16
|
+
let h = r(), { hideModal: g } = a(), { isLoggedIn: _, authError: v } = t(), [y, b] = p(!1), [x, S] = p(null), { loginUser: C } = n(c, process.env.API_AUTH_URL, "logora_user_token");
|
|
17
17
|
f(() => {
|
|
18
18
|
_ && w();
|
|
19
19
|
}, [_]), f(() => {
|
|
@@ -24,13 +24,13 @@ var m = e(), h = ({ onHideModal: e = null }) => {
|
|
|
24
24
|
}, T = (e, t, n) => {
|
|
25
25
|
S(n), b(!0), E(e, t);
|
|
26
26
|
}, E = (e, t) => {
|
|
27
|
-
C(
|
|
27
|
+
C(s.create(h.auth?.type, h.shortname, e, t).getAuthorizationParams());
|
|
28
28
|
};
|
|
29
|
-
return /* @__PURE__ */ (0, m.jsx)(
|
|
29
|
+
return /* @__PURE__ */ (0, m.jsx)(o, {
|
|
30
30
|
"data-vid": "login_modal",
|
|
31
31
|
children: /* @__PURE__ */ (0, m.jsx)("div", {
|
|
32
32
|
className: d.loginModalBody,
|
|
33
|
-
children: y ? /* @__PURE__ */ (0, m.jsx)(
|
|
33
|
+
children: y ? /* @__PURE__ */ (0, m.jsx)(i, {}) : /* @__PURE__ */ (0, m.jsx)(m.Fragment, { children: h.auth.type === "form" || h.auth.type === "social" ? /* @__PURE__ */ (0, m.jsx)(l, {
|
|
34
34
|
onSubmit: T,
|
|
35
35
|
error: v,
|
|
36
36
|
lastStep: x,
|
|
@@ -58,6 +58,7 @@ var l = /* @__PURE__ */ e(n()), u = t(), d = ({ onSubmit: e, forgotPasswordUrl:
|
|
|
58
58
|
target: "_blank",
|
|
59
59
|
role: "link",
|
|
60
60
|
className: o.forgotPassword,
|
|
61
|
+
rel: "noreferrer",
|
|
61
62
|
children: h.formatMessage({
|
|
62
63
|
id: "auth_login_form_forgot_password",
|
|
63
64
|
defaultMessage: "Forgot password ?"
|
|
@@ -6,7 +6,7 @@ import i from "./OAuth2Button.module.js";
|
|
|
6
6
|
import "react";
|
|
7
7
|
import { useLocation as a } from "react-router-dom";
|
|
8
8
|
//#region src/components/auth/oauth2_button/OAuth2Button.jsx
|
|
9
|
-
var o = /* @__PURE__ */ e(
|
|
9
|
+
var o = /* @__PURE__ */ e(n()), s = /* @__PURE__ */ e(r()), c = t(), l = ({ provider: e, authDialogUrl: t, clientId: n, redirectUri: r, scope: l, responseType: u, accessType: d = "", forceAuth: f = !1, onCode: p, onClose: m, popup: h = !0, children: g, className: _, state: v = "" }) => {
|
|
10
10
|
a();
|
|
11
11
|
let y = (t, n) => {
|
|
12
12
|
p(t, e);
|
|
@@ -18,8 +18,8 @@ var o = /* @__PURE__ */ e(r()), s = /* @__PURE__ */ e(n()), c = t(), l = ({ prov
|
|
|
18
18
|
};
|
|
19
19
|
return /* @__PURE__ */ (0, c.jsx)("div", {
|
|
20
20
|
"data-testid": "container",
|
|
21
|
-
className: (0,
|
|
22
|
-
children: h ? /* @__PURE__ */ (0, c.jsx)(
|
|
21
|
+
className: (0, o.default)(i.oauthButtonContainer, _),
|
|
22
|
+
children: h ? /* @__PURE__ */ (0, c.jsx)(s.default, {
|
|
23
23
|
url: x(),
|
|
24
24
|
onCode: y,
|
|
25
25
|
onClose: b,
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { FormAuth as e } from "./FormAuth.js";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
2
|
+
import { JWTAuth as t } from "./JWTAuth.js";
|
|
3
|
+
import { OAuth2ServerAuth as n } from "./OAuth2ServerAuth.js";
|
|
4
|
+
import { PasswordAuth as r } from "./PasswordAuth.js";
|
|
5
5
|
//#region src/components/auth/providers/AuthProviderFactory.js
|
|
6
6
|
var i = class {
|
|
7
|
-
static create = (i, a, o, s) => i === "oauth2_server" ? new
|
|
7
|
+
static create = (i, a, o, s) => i === "oauth2_server" ? new n(a, o, "oauth2_server") : i === "social" && s === "form" ? new e(a, o) : i === "social" && s === "password" ? new r(a, o) : i === "social" ? new n(a, o, s) : new t(a, o);
|
|
8
8
|
};
|
|
9
9
|
//#endregion
|
|
10
10
|
export { i as AuthProviderFactory };
|
|
@@ -5,13 +5,13 @@ import { Button as r } from "../../action/button/Button.js";
|
|
|
5
5
|
import { EMAIL_CONSENT_STORAGE_KEY as i } from "../use_auth/useAuthActions.js";
|
|
6
6
|
import a from "../../../node_modules/.pnpm/react-intl@7.1.14_react@18.3.1_typescript@5.9.3/node_modules/react-intl/lib/src/components/useIntl.js";
|
|
7
7
|
import { TextInput as o } from "../../input/text_input/TextInput.js";
|
|
8
|
-
import s from "
|
|
9
|
-
import
|
|
8
|
+
import { Toggle as s } from "../../input/toggle/Toggle.js";
|
|
9
|
+
import c from "../../../node_modules/.pnpm/@rooks_use-sessionstorage-state@4.11.2_react@18.3.1/node_modules/@rooks/use-sessionstorage-state/lib/index.esm.js";
|
|
10
10
|
import l from "./SignupForm.module.js";
|
|
11
11
|
import { useState as u } from "react";
|
|
12
12
|
//#region src/components/auth/signup_form/SignupForm.jsx
|
|
13
13
|
var d = /* @__PURE__ */ e(n()), f = t(), p = ({ onSubmit: e, providerName: t, error: n = !1 }) => {
|
|
14
|
-
let [p, m] = u(""), [h, g] = u(""), [_, v] = u(""), [y, b] = u(""), [x, S] = u(""), [C, w] =
|
|
14
|
+
let [p, m] = u(""), [h, g] = u(""), [_, v] = u(""), [y, b] = u(""), [x, S] = u(""), [C, w] = c(i, !1), [T, E] = u(""), D = a(), O = (t) => {
|
|
15
15
|
t.preventDefault(), k(y, x) && e && e(h, _, p, y, x, C);
|
|
16
16
|
}, k = (e, t) => e === t ? !0 : (E(D.formatMessage({
|
|
17
17
|
id: "auth_signup_form_password_error",
|
|
@@ -122,7 +122,7 @@ var d = /* @__PURE__ */ e(n()), f = t(), p = ({ onSubmit: e, providerName: t, er
|
|
|
122
122
|
}),
|
|
123
123
|
/* @__PURE__ */ (0, f.jsx)("div", {
|
|
124
124
|
className: l.formGroup,
|
|
125
|
-
children: /* @__PURE__ */ (0, f.jsx)(
|
|
125
|
+
children: /* @__PURE__ */ (0, f.jsx)(s, {
|
|
126
126
|
type: "checkbox",
|
|
127
127
|
name: "accepts_provider_email",
|
|
128
128
|
style: { fontSize: 18 },
|
|
@@ -3,17 +3,17 @@ import { Icon as t } from "../../icons/icon/Icon.js";
|
|
|
3
3
|
import { EMAIL_CONSENT_STORAGE_KEY as n } from "../use_auth/useAuthActions.js";
|
|
4
4
|
import r from "../../../node_modules/.pnpm/react-intl@7.1.14_react@18.3.1_typescript@5.9.3/node_modules/react-intl/lib/src/components/useIntl.js";
|
|
5
5
|
import i from "../../../node_modules/.pnpm/react-intl@7.1.14_react@18.3.1_typescript@5.9.3/node_modules/react-intl/lib/src/components/message.js";
|
|
6
|
-
import a from "
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import
|
|
6
|
+
import { FacebookLoginButton as a } from "../facebook_login_button/FacebookLoginButton.js";
|
|
7
|
+
import { GoogleLoginButton as o } from "../google_login_button/GoogleLoginButton.js";
|
|
8
|
+
import { LoginForm as s } from "../login_form/LoginForm.js";
|
|
9
|
+
import { Toggle as c } from "../../input/toggle/Toggle.js";
|
|
10
|
+
import l from "../../../node_modules/.pnpm/@rooks_use-sessionstorage-state@4.11.2_react@18.3.1/node_modules/@rooks/use-sessionstorage-state/lib/index.esm.js";
|
|
11
11
|
import { SignupForm as u } from "../signup_form/SignupForm.js";
|
|
12
12
|
import d from "./SocialAuthForm.module.js";
|
|
13
13
|
import { useState as f } from "react";
|
|
14
14
|
//#region src/components/auth/social_auth_form/SocialAuthForm.jsx
|
|
15
15
|
var p = e(), m = ({ lastStep: e, providerName: m, logoUrl: h, termsUrl: g, privacyUrl: _, forgotPasswordUrl: v, oAuthRedirectUri: y, facebookClientId: b, googleClientId: x, error: S = !1, onSubmit: C }) => {
|
|
16
|
-
let [w, T] = f(!(e === "LOGIN" || e === "SIGNUP")), [E, D] = f(e !== "SIGNUP"), [O, k] =
|
|
16
|
+
let [w, T] = f(!(e === "LOGIN" || e === "SIGNUP")), [E, D] = f(e !== "SIGNUP"), [O, k] = l(n, !1), A = r(), j = (e, t, n, r, i, a) => {
|
|
17
17
|
C({
|
|
18
18
|
uid: typeof crypto < "u" && crypto.randomUUID ? crypto.randomUUID() : "0000-0000-0000-0000",
|
|
19
19
|
first_name: e,
|
|
@@ -91,7 +91,7 @@ var p = e(), m = ({ lastStep: e, providerName: m, logoUrl: h, termsUrl: g, priva
|
|
|
91
91
|
defaultMessage: "Create your account in one click to vote and start debating !"
|
|
92
92
|
})
|
|
93
93
|
}),
|
|
94
|
-
/* @__PURE__ */ (0, p.jsx)(
|
|
94
|
+
/* @__PURE__ */ (0, p.jsx)(a, {
|
|
95
95
|
text: A.formatMessage({
|
|
96
96
|
id: "auth.social_auth_form.facebook_login",
|
|
97
97
|
defaultMessage: "Sign in with Facebook"
|
|
@@ -100,7 +100,7 @@ var p = e(), m = ({ lastStep: e, providerName: m, logoUrl: h, termsUrl: g, priva
|
|
|
100
100
|
redirectUri: y,
|
|
101
101
|
onCode: N
|
|
102
102
|
}),
|
|
103
|
-
/* @__PURE__ */ (0, p.jsx)(
|
|
103
|
+
/* @__PURE__ */ (0, p.jsx)(o, {
|
|
104
104
|
text: A.formatMessage({
|
|
105
105
|
id: "auth.social_auth_form.google_login",
|
|
106
106
|
defaultMessage: "Sign in with Google"
|
|
@@ -126,7 +126,7 @@ var p = e(), m = ({ lastStep: e, providerName: m, logoUrl: h, termsUrl: g, priva
|
|
|
126
126
|
}),
|
|
127
127
|
!E && /* @__PURE__ */ (0, p.jsx)("div", {
|
|
128
128
|
className: d.checkboxContainer,
|
|
129
|
-
children: /* @__PURE__ */ (0, p.jsx)(
|
|
129
|
+
children: /* @__PURE__ */ (0, p.jsx)(c, {
|
|
130
130
|
type: "checkbox",
|
|
131
131
|
name: "accepts_emails",
|
|
132
132
|
style: { fontSize: 18 },
|
|
@@ -175,7 +175,7 @@ var p = e(), m = ({ lastStep: e, providerName: m, logoUrl: h, termsUrl: g, priva
|
|
|
175
175
|
}),
|
|
176
176
|
E ? /* @__PURE__ */ (0, p.jsx)("div", {
|
|
177
177
|
className: d.loginFormContainer,
|
|
178
|
-
children: /* @__PURE__ */ (0, p.jsx)(
|
|
178
|
+
children: /* @__PURE__ */ (0, p.jsx)(s, {
|
|
179
179
|
onSubmit: M,
|
|
180
180
|
error: S && e === "LOGIN",
|
|
181
181
|
forgotPasswordUrl: v
|
|
@@ -6,14 +6,14 @@ import { Button as i } from "../../action/button/Button.js";
|
|
|
6
6
|
import { EMAIL_CONSENT_STORAGE_KEY as a } from "../use_auth/useAuthActions.js";
|
|
7
7
|
import o from "../../../node_modules/.pnpm/react-intl@7.1.14_react@18.3.1_typescript@5.9.3/node_modules/react-intl/lib/src/components/useIntl.js";
|
|
8
8
|
import s from "../../../node_modules/.pnpm/react-intl@7.1.14_react@18.3.1_typescript@5.9.3/node_modules/react-intl/lib/src/components/message.js";
|
|
9
|
-
import c from "
|
|
10
|
-
import
|
|
9
|
+
import { Toggle as c } from "../../input/toggle/Toggle.js";
|
|
10
|
+
import l from "../../../node_modules/.pnpm/@rooks_use-sessionstorage-state@4.11.2_react@18.3.1/node_modules/@rooks/use-sessionstorage-state/lib/index.esm.js";
|
|
11
11
|
import u from "./SSOForm.module.js";
|
|
12
12
|
import "react";
|
|
13
13
|
import { useLocation as d } from "react-router";
|
|
14
14
|
//#region src/components/auth/sso_form/SSOForm.jsx
|
|
15
15
|
var f = /* @__PURE__ */ e(r()), p = t(), m = ({ authType: e, providerName: t, loginUrl: r, signupUrl: m, termsUrl: h, logoUrl: g, clientId: _, oAuthRedirectUri: v, scope: y, redirectParameter: b = "logora_redirect", trackingParameters: x = {}, hideActions: S = !1, hideLoginButton: C = !1, showEmailConsent: w = !1, showTerms: T = !1, hideBelowButton: E = !1, error: D = !1 }) => {
|
|
16
|
-
let [O, k] = w ?
|
|
16
|
+
let [O, k] = w ? l(a, !1) : [!1, () => {}], A = o(), j = d(), M = (e) => {
|
|
17
17
|
if (typeof window < "u") {
|
|
18
18
|
let t = e === "CURRENT_LOCATION" ? window.location : e, n = new URL(t, window.location.origin), r = n.searchParams, i = new URLSearchParams(j.search);
|
|
19
19
|
r.has("code") && r.delete("code"), b && r.append(b, window.location.toString());
|
|
@@ -99,7 +99,7 @@ var f = /* @__PURE__ */ e(r()), p = t(), m = ({ authType: e, providerName: t, lo
|
|
|
99
99
|
}),
|
|
100
100
|
w ? /* @__PURE__ */ (0, p.jsx)("div", {
|
|
101
101
|
className: (0, f.default)(u.switchBox),
|
|
102
|
-
children: /* @__PURE__ */ (0, p.jsx)(
|
|
102
|
+
children: /* @__PURE__ */ (0, p.jsx)(c, {
|
|
103
103
|
type: "checkbox",
|
|
104
104
|
name: "accepts_provider_email",
|
|
105
105
|
style: { fontSize: 18 },
|