@orbe-agro/client-core 5.3.86 → 5.3.89
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/dist/@ecme/assets/styles/app.css +1 -1
- package/dist/@ecme/assets/styles/components/_dialog.css +1 -1
- package/dist/@ecme/assets/styles/components/_drawer.css +1 -1
- package/dist/@ecme/assets/styles/components/_scrollbar.css +1 -1
- package/dist/@ecme/assets/styles/components/_switcher.css +1 -1
- package/dist/@ecme/assets/styles/components/_upload.css +1 -1
- package/dist/@ecme/assets/styles/components/index.css +1 -1
- package/dist/@ecme/assets/styles/tailwind/index.css +1 -1
- package/dist/@ecme/auth/AuthProvider.js +58 -62
- package/dist/@ecme/auth/AuthProvider.js.map +1 -1
- package/dist/@ecme/components/docs/DemoCard/DemoCard.js +18 -19
- package/dist/@ecme/components/docs/DemoCard/DemoCard.js.map +1 -1
- package/dist/@ecme/components/layouts/PostLoginLayout/PostLoginLayout.js +29 -30
- package/dist/@ecme/components/layouts/PostLoginLayout/PostLoginLayout.js.map +1 -1
- package/dist/@ecme/components/layouts/PostLoginLayout/components/ContentOverlay.js +56 -56
- package/dist/@ecme/components/layouts/PostLoginLayout/components/ContentOverlay.js.map +1 -1
- package/dist/@ecme/components/shared/Affix.js +9 -10
- package/dist/@ecme/components/shared/Affix.js.map +1 -1
- package/dist/@ecme/components/shared/AutoComplete.js +27 -28
- package/dist/@ecme/components/shared/AutoComplete.js.map +1 -1
- package/dist/@ecme/components/shared/CalendarView.js +19 -20
- package/dist/@ecme/components/shared/CalendarView.js.map +1 -1
- package/dist/@ecme/components/shared/ConfirmDialog.js +16 -16
- package/dist/@ecme/components/shared/ConfirmDialog.js.map +1 -1
- package/dist/@ecme/components/shared/DataTable.js +151 -151
- package/dist/@ecme/components/shared/DataTable.js.map +1 -1
- package/dist/@ecme/components/shared/DebounceInput.js +11 -12
- package/dist/@ecme/components/shared/DebounceInput.js.map +1 -1
- package/dist/@ecme/components/shared/GanttChart/GanttChart.js +20 -20
- package/dist/@ecme/components/shared/GanttChart/GanttChart.js.map +1 -1
- package/dist/@ecme/components/shared/GanttChart/TaskListTable.js +22 -22
- package/dist/@ecme/components/shared/GanttChart/TaskListTable.js.map +1 -1
- package/dist/@ecme/components/shared/ImageGallery.js +18 -18
- package/dist/@ecme/components/shared/ImageGallery.js.map +1 -1
- package/dist/@ecme/components/shared/Masonry/Masonry.js +25 -25
- package/dist/@ecme/components/shared/Masonry/Masonry.js.map +1 -1
- package/dist/@ecme/components/shared/OtpInput.js +54 -56
- package/dist/@ecme/components/shared/OtpInput.js.map +1 -1
- package/dist/@ecme/components/shared/PasswordInput.js +6 -6
- package/dist/@ecme/components/shared/PasswordInput.js.map +1 -1
- package/dist/@ecme/components/shared/RegionMap.js +9 -9
- package/dist/@ecme/components/shared/RegionMap.js.map +1 -1
- package/dist/@ecme/components/shared/RichTextEditor/RichTextEditor.js +47 -47
- package/dist/@ecme/components/shared/RichTextEditor/RichTextEditor.js.map +1 -1
- package/dist/@ecme/components/shared/UsersAvatarGroup.js +24 -24
- package/dist/@ecme/components/shared/UsersAvatarGroup.js.map +1 -1
- package/dist/@ecme/components/template/HorizontalMenuContent/HorizontalMenuContent.js +63 -69
- package/dist/@ecme/components/template/HorizontalMenuContent/HorizontalMenuContent.js.map +1 -1
- package/dist/@ecme/components/template/HorizontalMenuContent/HorizontalMenuDropdown.js +48 -48
- package/dist/@ecme/components/template/HorizontalMenuContent/HorizontalMenuDropdown.js.map +1 -1
- package/dist/@ecme/components/template/HorizontalMenuContent/HorizontalMenuDropdownContent.js +220 -231
- package/dist/@ecme/components/template/HorizontalMenuContent/HorizontalMenuDropdownContent.js.map +1 -1
- package/dist/@ecme/components/template/LanguageSelector.js +10 -13
- package/dist/@ecme/components/template/LanguageSelector.js.map +1 -1
- package/dist/@ecme/components/template/Search.js +85 -92
- package/dist/@ecme/components/template/Search.js.map +1 -1
- package/dist/@ecme/components/template/ThemeConfigurator/DirectionSwitcher.js +18 -18
- package/dist/@ecme/components/template/ThemeConfigurator/DirectionSwitcher.js.map +1 -1
- package/dist/@ecme/components/template/VerticalMenuContent/VerticalCollapsedMenuItem.js +17 -17
- package/dist/@ecme/components/template/VerticalMenuContent/VerticalCollapsedMenuItem.js.map +1 -1
- package/dist/@ecme/components/template/VerticalMenuContent/VerticalMenuContent.js +59 -59
- package/dist/@ecme/components/template/VerticalMenuContent/VerticalMenuContent.js.map +1 -1
- package/dist/@ecme/components/template/VerticalMenuContent/VerticalSingleMenuItem.js +34 -34
- package/dist/@ecme/components/template/VerticalMenuContent/VerticalSingleMenuItem.js.map +1 -1
- package/dist/@ecme/components/ui/Alert/Alert.js +29 -29
- package/dist/@ecme/components/ui/Alert/Alert.js.map +1 -1
- package/dist/@ecme/components/ui/Avatar/AvatarGroup.js +30 -30
- package/dist/@ecme/components/ui/Avatar/AvatarGroup.js.map +1 -1
- package/dist/@ecme/components/ui/Button/Button.js +66 -67
- package/dist/@ecme/components/ui/Button/Button.js.map +1 -1
- package/dist/@ecme/components/ui/Card/Card.js +39 -40
- package/dist/@ecme/components/ui/Card/Card.js.map +1 -1
- package/dist/@ecme/components/ui/Checkbox/Checkbox.js +42 -42
- package/dist/@ecme/components/ui/Checkbox/Checkbox.js.map +1 -1
- package/dist/@ecme/components/ui/Checkbox/Group.js +27 -27
- package/dist/@ecme/components/ui/Checkbox/Group.js.map +1 -1
- package/dist/@ecme/components/ui/DatePicker/BasePicker.js +67 -67
- package/dist/@ecme/components/ui/DatePicker/BasePicker.js.map +1 -1
- package/dist/@ecme/components/ui/DatePicker/Calendar.js +18 -18
- package/dist/@ecme/components/ui/DatePicker/Calendar.js.map +1 -1
- package/dist/@ecme/components/ui/DatePicker/CalendarBase.js +77 -78
- package/dist/@ecme/components/ui/DatePicker/CalendarBase.js.map +1 -1
- package/dist/@ecme/components/ui/DatePicker/DatePicker.js +67 -71
- package/dist/@ecme/components/ui/DatePicker/DatePicker.js.map +1 -1
- package/dist/@ecme/components/ui/DatePicker/DatePickerRange.js +94 -98
- package/dist/@ecme/components/ui/DatePicker/DatePickerRange.js.map +1 -1
- package/dist/@ecme/components/ui/DatePicker/DateTimepicker.js +51 -58
- package/dist/@ecme/components/ui/DatePicker/DateTimepicker.js.map +1 -1
- package/dist/@ecme/components/ui/DatePicker/tables/DateTable.js +67 -67
- package/dist/@ecme/components/ui/DatePicker/tables/DateTable.js.map +1 -1
- package/dist/@ecme/components/ui/DatePicker/tables/components/Day.js +12 -12
- package/dist/@ecme/components/ui/DatePicker/tables/components/Day.js.map +1 -1
- package/dist/@ecme/components/ui/Dialog/Dialog.js +25 -25
- package/dist/@ecme/components/ui/Dialog/Dialog.js.map +1 -1
- package/dist/@ecme/components/ui/Drawer/Drawer.js +32 -32
- package/dist/@ecme/components/ui/Drawer/Drawer.js.map +1 -1
- package/dist/@ecme/components/ui/Dropdown/DropdownItem.js +58 -58
- package/dist/@ecme/components/ui/Dropdown/DropdownItem.js.map +1 -1
- package/dist/@ecme/components/ui/Dropdown/DropdownMenu.js +99 -100
- package/dist/@ecme/components/ui/Dropdown/DropdownMenu.js.map +1 -1
- package/dist/@ecme/components/ui/Dropdown/DropdownSubItem.js +26 -26
- package/dist/@ecme/components/ui/Dropdown/DropdownSubItem.js.map +1 -1
- package/dist/@ecme/components/ui/Form/FormContainer.js +17 -17
- package/dist/@ecme/components/ui/Form/FormContainer.js.map +1 -1
- package/dist/@ecme/components/ui/Form/FormItem.js +38 -38
- package/dist/@ecme/components/ui/Form/FormItem.js.map +1 -1
- package/dist/@ecme/components/ui/Input/Input.js +50 -52
- package/dist/@ecme/components/ui/Input/Input.js.map +1 -1
- package/dist/@ecme/components/ui/InputGroup/Addon.js +12 -13
- package/dist/@ecme/components/ui/InputGroup/Addon.js.map +1 -1
- package/dist/@ecme/components/ui/InputGroup/InputGroup.js +10 -11
- package/dist/@ecme/components/ui/InputGroup/InputGroup.js.map +1 -1
- package/dist/@ecme/components/ui/Notification/Notification.js +19 -19
- package/dist/@ecme/components/ui/Notification/Notification.js.map +1 -1
- package/dist/@ecme/components/ui/Pagination/Pagination.js +45 -45
- package/dist/@ecme/components/ui/Pagination/Pagination.js.map +1 -1
- package/dist/@ecme/components/ui/Radio/Group.js +28 -28
- package/dist/@ecme/components/ui/Radio/Group.js.map +1 -1
- package/dist/@ecme/components/ui/Radio/Radio.js +42 -42
- package/dist/@ecme/components/ui/Radio/Radio.js.map +1 -1
- package/dist/@ecme/components/ui/Segment/SegmentItem.js +53 -53
- package/dist/@ecme/components/ui/Segment/SegmentItem.js.map +1 -1
- package/dist/@ecme/components/ui/Select/Select.js +40 -41
- package/dist/@ecme/components/ui/Select/Select.js.map +1 -1
- package/dist/@ecme/components/ui/Steps/StepItem.js +33 -33
- package/dist/@ecme/components/ui/Steps/StepItem.js.map +1 -1
- package/dist/@ecme/components/ui/Switcher/Switcher.js +24 -24
- package/dist/@ecme/components/ui/Switcher/Switcher.js.map +1 -1
- package/dist/@ecme/components/ui/Tabs/TabNav.js +22 -22
- package/dist/@ecme/components/ui/Tabs/TabNav.js.map +1 -1
- package/dist/@ecme/components/ui/TimeInput/AmPmInput.js +25 -27
- package/dist/@ecme/components/ui/TimeInput/AmPmInput.js.map +1 -1
- package/dist/@ecme/components/ui/TimeInput/TimeInput.js +130 -135
- package/dist/@ecme/components/ui/TimeInput/TimeInput.js.map +1 -1
- package/dist/@ecme/components/ui/TimeInput/TimeInputField.js +22 -24
- package/dist/@ecme/components/ui/TimeInput/TimeInputField.js.map +1 -1
- package/dist/@ecme/components/ui/TimeInput/TimeInputRange.js +65 -68
- package/dist/@ecme/components/ui/TimeInput/TimeInputRange.js.map +1 -1
- package/dist/@ecme/components/ui/TimeInput/utils/createAmPmHandler.js +11 -12
- package/dist/@ecme/components/ui/TimeInput/utils/createAmPmHandler.js.map +1 -1
- package/dist/@ecme/components/ui/TimeInput/utils/createTimeHandler.js +19 -20
- package/dist/@ecme/components/ui/TimeInput/utils/createTimeHandler.js.map +1 -1
- package/dist/@ecme/components/ui/Upload/Upload.js +67 -68
- package/dist/@ecme/components/ui/Upload/Upload.js.map +1 -1
- package/dist/@ecme/components/ui/hooks/useCallbackRef.js +7 -10
- package/dist/@ecme/components/ui/hooks/useCallbackRef.js.map +1 -1
- package/dist/@ecme/components/ui/hooks/useRootClose.js +32 -32
- package/dist/@ecme/components/ui/hooks/useRootClose.js.map +1 -1
- package/dist/@ecme/components/ui/hooks/useTimeout.js +12 -13
- package/dist/@ecme/components/ui/hooks/useTimeout.js.map +1 -1
- package/dist/@ecme/components/ui/toast/ToastWrapper.js +58 -61
- package/dist/@ecme/components/ui/toast/ToastWrapper.js.map +1 -1
- package/dist/@ecme/components/ui/toast/toast.js +16 -19
- package/dist/@ecme/components/ui/toast/toast.js.map +1 -1
- package/dist/@ecme/components/view/Activity/ActivityEvent.js +63 -67
- package/dist/@ecme/components/view/Activity/ActivityEvent.js.map +1 -1
- package/dist/@ecme/components/view/ChatBox/components/Attachment.js +8 -9
- package/dist/@ecme/components/view/ChatBox/components/Attachment.js.map +1 -1
- package/dist/@ecme/components/view/ChatBox/components/ChatInput.js +37 -39
- package/dist/@ecme/components/view/ChatBox/components/ChatInput.js.map +1 -1
- package/dist/@ecme/components/view/ChatBox/components/Message.js +10 -10
- package/dist/@ecme/components/view/ChatBox/components/Message.js.map +1 -1
- package/dist/@ecme/components/view/CreditCardDialog/CreditCardDialog.js +36 -37
- package/dist/@ecme/components/view/CreditCardDialog/CreditCardDialog.js.map +1 -1
- package/dist/@ecme/components/view/TaskItem/TaskItem.js +33 -33
- package/dist/@ecme/components/view/TaskItem/TaskItem.js.map +1 -1
- package/dist/@ecme/mock/fakeApi/chatFakeApi.js +16 -18
- package/dist/@ecme/mock/fakeApi/chatFakeApi.js.map +1 -1
- package/dist/@ecme/mock/fakeApi/customersFakeApi.js +10 -11
- package/dist/@ecme/mock/fakeApi/customersFakeApi.js.map +1 -1
- package/dist/@ecme/mock/fakeApi/helpCenterFakeApi.js +10 -11
- package/dist/@ecme/mock/fakeApi/helpCenterFakeApi.js.map +1 -1
- package/dist/@ecme/mock/fakeApi/mailFakeApi.js +9 -10
- package/dist/@ecme/mock/fakeApi/mailFakeApi.js.map +1 -1
- package/dist/@ecme/mock/fakeApi/ordersFakeApi.js +9 -10
- package/dist/@ecme/mock/fakeApi/ordersFakeApi.js.map +1 -1
- package/dist/@ecme/mock/fakeApi/productsFakeApi.js +7 -8
- package/dist/@ecme/mock/fakeApi/productsFakeApi.js.map +1 -1
- package/dist/@ecme/mock/fakeApi/projectsFakeApi.js +10 -11
- package/dist/@ecme/mock/fakeApi/projectsFakeApi.js.map +1 -1
- package/dist/@ecme/utils/hooks/useInfiniteScroll.js +11 -11
- package/dist/@ecme/utils/hooks/useInfiniteScroll.js.map +1 -1
- package/dist/@ecme/utils/hooks/useMenuActive.js +11 -12
- package/dist/@ecme/utils/hooks/useMenuActive.js.map +1 -1
- package/dist/@ecme/views/auth/ForgotPassword/components/ForgotPasswordForm.js +36 -37
- package/dist/@ecme/views/auth/ForgotPassword/components/ForgotPasswordForm.js.map +1 -1
- package/dist/@ecme/views/auth/OtpVerification/OtpVerification.js +14 -14
- package/dist/@ecme/views/auth/OtpVerification/OtpVerification.js.map +1 -1
- package/dist/@ecme/views/auth/OtpVerification/components/OtpVerificationForm.js +41 -42
- package/dist/@ecme/views/auth/OtpVerification/components/OtpVerificationForm.js.map +1 -1
- package/dist/@ecme/views/auth/ResetPassword/components/ResetPasswordForm.js +59 -60
- package/dist/@ecme/views/auth/ResetPassword/components/ResetPasswordForm.js.map +1 -1
- package/dist/@ecme/views/auth/SignIn/components/OauthSignIn.js +27 -27
- package/dist/@ecme/views/auth/SignIn/components/OauthSignIn.js.map +1 -1
- package/dist/@ecme/views/auth/SignIn/components/SignInForm.js +57 -58
- package/dist/@ecme/views/auth/SignIn/components/SignInForm.js.map +1 -1
- package/dist/@ecme/views/auth/SignUp/components/SignUpForm.js +37 -38
- package/dist/@ecme/views/auth/SignUp/components/SignUpForm.js.map +1 -1
- package/dist/@ecme/views/concepts/accounts/Pricing/components/PaymentDialog.js +44 -45
- package/dist/@ecme/views/concepts/accounts/Pricing/components/PaymentDialog.js.map +1 -1
- package/dist/@ecme/views/concepts/accounts/Pricing/components/Plans.js +5 -5
- package/dist/@ecme/views/concepts/accounts/Pricing/components/Plans.js.map +1 -1
- package/dist/@ecme/views/concepts/accounts/RolesPermissions/components/RolesPermissionsAccessDialog.js +34 -35
- package/dist/@ecme/views/concepts/accounts/RolesPermissions/components/RolesPermissionsAccessDialog.js.map +1 -1
- package/dist/@ecme/views/concepts/accounts/RolesPermissions/components/RolesPermissionsUserAction.js +26 -26
- package/dist/@ecme/views/concepts/accounts/RolesPermissions/components/RolesPermissionsUserAction.js.map +1 -1
- package/dist/@ecme/views/concepts/accounts/RolesPermissions/components/RolesPermissionsUserTable.js +28 -29
- package/dist/@ecme/views/concepts/accounts/RolesPermissions/components/RolesPermissionsUserTable.js.map +1 -1
- package/dist/@ecme/views/concepts/accounts/RolesPermissions/hooks/useRolePermissonsUsers.js +8 -8
- package/dist/@ecme/views/concepts/accounts/RolesPermissions/hooks/useRolePermissonsUsers.js.map +1 -1
- package/dist/@ecme/views/concepts/accounts/Settings/components/SettingMobileMenu.js +10 -11
- package/dist/@ecme/views/concepts/accounts/Settings/components/SettingMobileMenu.js.map +1 -1
- package/dist/@ecme/views/concepts/accounts/Settings/components/SettingsBilling.js +48 -49
- package/dist/@ecme/views/concepts/accounts/Settings/components/SettingsBilling.js.map +1 -1
- package/dist/@ecme/views/concepts/accounts/Settings/components/SettingsMenu.js +14 -14
- package/dist/@ecme/views/concepts/accounts/Settings/components/SettingsMenu.js.map +1 -1
- package/dist/@ecme/views/concepts/accounts/Settings/components/SettingsProfile.js +102 -103
- package/dist/@ecme/views/concepts/accounts/Settings/components/SettingsProfile.js.map +1 -1
- package/dist/@ecme/views/concepts/accounts/Settings/components/SettingsSecurity.js +34 -35
- package/dist/@ecme/views/concepts/accounts/Settings/components/SettingsSecurity.js.map +1 -1
- package/dist/@ecme/views/concepts/ai/Chat/components/ChatCustomAction.js +16 -16
- package/dist/@ecme/views/concepts/ai/Chat/components/ChatCustomAction.js.map +1 -1
- package/dist/@ecme/views/concepts/ai/Chat/components/ChatCustomContent.js +76 -78
- package/dist/@ecme/views/concepts/ai/Chat/components/ChatCustomContent.js.map +1 -1
- package/dist/@ecme/views/concepts/ai/Chat/components/ChatHistory.js +23 -23
- package/dist/@ecme/views/concepts/ai/Chat/components/ChatHistory.js.map +1 -1
- package/dist/@ecme/views/concepts/ai/Chat/components/ChatHistoryItem.js +48 -49
- package/dist/@ecme/views/concepts/ai/Chat/components/ChatHistoryItem.js.map +1 -1
- package/dist/@ecme/views/concepts/ai/Chat/components/ChatHistoryRenameDialog.js +34 -35
- package/dist/@ecme/views/concepts/ai/Chat/components/ChatHistoryRenameDialog.js.map +1 -1
- package/dist/@ecme/views/concepts/ai/Chat/components/ChatMobileNav.js +11 -14
- package/dist/@ecme/views/concepts/ai/Chat/components/ChatMobileNav.js.map +1 -1
- package/dist/@ecme/views/concepts/ai/Chat/components/ChatSideNav.js +19 -19
- package/dist/@ecme/views/concepts/ai/Chat/components/ChatSideNav.js.map +1 -1
- package/dist/@ecme/views/concepts/ai/Chat/components/ChatView.js +22 -26
- package/dist/@ecme/views/concepts/ai/Chat/components/ChatView.js.map +1 -1
- package/dist/@ecme/views/concepts/ai/Chat/store/generativeChatStore.js +18 -24
- package/dist/@ecme/views/concepts/ai/Chat/store/generativeChatStore.js.map +1 -1
- package/dist/@ecme/views/concepts/ai/Image/components/ConfigDropdown.js +22 -22
- package/dist/@ecme/views/concepts/ai/Image/components/ConfigDropdown.js.map +1 -1
- package/dist/@ecme/views/concepts/ai/Image/components/GeneratorPrompt.js +31 -32
- package/dist/@ecme/views/concepts/ai/Image/components/GeneratorPrompt.js.map +1 -1
- package/dist/@ecme/views/concepts/ai/Image/components/ImageDialog.js +31 -32
- package/dist/@ecme/views/concepts/ai/Image/components/ImageDialog.js.map +1 -1
- package/dist/@ecme/views/concepts/calendar/Calendar/Calendar.js +38 -39
- package/dist/@ecme/views/concepts/calendar/Calendar/Calendar.js.map +1 -1
- package/dist/@ecme/views/concepts/calendar/Calendar/components/EventDialog.js +68 -69
- package/dist/@ecme/views/concepts/calendar/Calendar/components/EventDialog.js.map +1 -1
- package/dist/@ecme/views/concepts/chat/Chat/components/ChatBody.js +63 -66
- package/dist/@ecme/views/concepts/chat/Chat/components/ChatBody.js.map +1 -1
- package/dist/@ecme/views/concepts/chat/Chat/components/ChatList.js +21 -22
- package/dist/@ecme/views/concepts/chat/Chat/components/ChatList.js.map +1 -1
- package/dist/@ecme/views/concepts/chat/Chat/components/ContactInfoDrawer.js +84 -85
- package/dist/@ecme/views/concepts/chat/Chat/components/ContactInfoDrawer.js.map +1 -1
- package/dist/@ecme/views/concepts/customers/CustomerDetails/ActivitySection.js +19 -19
- package/dist/@ecme/views/concepts/customers/CustomerDetails/ActivitySection.js.map +1 -1
- package/dist/@ecme/views/concepts/customers/CustomerDetails/BillingSection.js +51 -58
- package/dist/@ecme/views/concepts/customers/CustomerDetails/BillingSection.js.map +1 -1
- package/dist/@ecme/views/concepts/customers/CustomerDetails/ProfileSection.js +76 -89
- package/dist/@ecme/views/concepts/customers/CustomerDetails/ProfileSection.js.map +1 -1
- package/dist/@ecme/views/concepts/customers/CustomerForm/AddressSection.js +104 -107
- package/dist/@ecme/views/concepts/customers/CustomerForm/AddressSection.js.map +1 -1
- package/dist/@ecme/views/concepts/customers/CustomerForm/CustomerForm.js +22 -22
- package/dist/@ecme/views/concepts/customers/CustomerForm/CustomerForm.js.map +1 -1
- package/dist/@ecme/views/concepts/customers/CustomerForm/OverviewSection.js +38 -39
- package/dist/@ecme/views/concepts/customers/CustomerForm/OverviewSection.js.map +1 -1
- package/dist/@ecme/views/concepts/customers/CustomerList/hooks/useCustomerList.js +20 -20
- package/dist/@ecme/views/concepts/customers/CustomerList/hooks/useCustomerList.js.map +1 -1
- package/dist/@ecme/views/concepts/files/FileManager/components/FileItemDropdown.js +32 -33
- package/dist/@ecme/views/concepts/files/FileManager/components/FileItemDropdown.js.map +1 -1
- package/dist/@ecme/views/concepts/help-center/EditArticle/components/EditArticleHeader.js +17 -18
- package/dist/@ecme/views/concepts/help-center/EditArticle/components/EditArticleHeader.js.map +1 -1
- package/dist/@ecme/views/concepts/help-center/ManageArticle/hooks/useManageArticle.js +5 -5
- package/dist/@ecme/views/concepts/help-center/ManageArticle/hooks/useManageArticle.js.map +1 -1
- package/dist/@ecme/views/concepts/help-center/SupportHub/components/TopSection.js +12 -13
- package/dist/@ecme/views/concepts/help-center/SupportHub/components/TopSection.js.map +1 -1
- package/dist/@ecme/views/concepts/mail/Mail/components/MailDetailAction.js +28 -29
- package/dist/@ecme/views/concepts/mail/Mail/components/MailDetailAction.js.map +1 -1
- package/dist/@ecme/views/concepts/mail/Mail/components/MailDetailContent.js +63 -67
- package/dist/@ecme/views/concepts/mail/Mail/components/MailDetailContent.js.map +1 -1
- package/dist/@ecme/views/concepts/mail/Mail/components/MailDetailTitle.js +8 -8
- package/dist/@ecme/views/concepts/mail/Mail/components/MailDetailTitle.js.map +1 -1
- package/dist/@ecme/views/concepts/mail/Mail/components/MailEditor.js +36 -37
- package/dist/@ecme/views/concepts/mail/Mail/components/MailEditor.js.map +1 -1
- package/dist/@ecme/views/concepts/mail/Mail/components/MailList.js +134 -137
- package/dist/@ecme/views/concepts/mail/Mail/components/MailList.js.map +1 -1
- package/dist/@ecme/views/concepts/orders/OrderDetails/components/OrderDetailProducts.js +17 -17
- package/dist/@ecme/views/concepts/orders/OrderDetails/components/OrderDetailProducts.js.map +1 -1
- package/dist/@ecme/views/concepts/orders/OrderEdit/OrderEdit.js +35 -35
- package/dist/@ecme/views/concepts/orders/OrderEdit/OrderEdit.js.map +1 -1
- package/dist/@ecme/views/concepts/orders/OrderForm/OrderForm.js +38 -38
- package/dist/@ecme/views/concepts/orders/OrderForm/OrderForm.js.map +1 -1
- package/dist/@ecme/views/concepts/orders/OrderForm/components/BillingAddressSection.js +108 -111
- package/dist/@ecme/views/concepts/orders/OrderForm/components/BillingAddressSection.js.map +1 -1
- package/dist/@ecme/views/concepts/orders/OrderForm/components/CustomerDetailSection.js +44 -45
- package/dist/@ecme/views/concepts/orders/OrderForm/components/CustomerDetailSection.js.map +1 -1
- package/dist/@ecme/views/concepts/orders/OrderForm/components/PaymentMethodSection.js +211 -214
- package/dist/@ecme/views/concepts/orders/OrderForm/components/PaymentMethodSection.js.map +1 -1
- package/dist/@ecme/views/concepts/orders/OrderList/components/OrderListTableFilter.js +17 -17
- package/dist/@ecme/views/concepts/orders/OrderList/components/OrderListTableFilter.js.map +1 -1
- package/dist/@ecme/views/concepts/orders/OrderList/hooks/useOrderlist.js +15 -15
- package/dist/@ecme/views/concepts/orders/OrderList/hooks/useOrderlist.js.map +1 -1
- package/dist/@ecme/views/concepts/products/ProductForm/ProductForm.js +4 -4
- package/dist/@ecme/views/concepts/products/ProductForm/ProductForm.js.map +1 -1
- package/dist/@ecme/views/concepts/products/ProductForm/components/AttributeSection.js +97 -100
- package/dist/@ecme/views/concepts/products/ProductForm/components/AttributeSection.js.map +1 -1
- package/dist/@ecme/views/concepts/products/ProductForm/components/GeneralSection.js +68 -71
- package/dist/@ecme/views/concepts/products/ProductForm/components/GeneralSection.js.map +1 -1
- package/dist/@ecme/views/concepts/products/ProductForm/components/ImageSection.js +85 -86
- package/dist/@ecme/views/concepts/products/ProductForm/components/ImageSection.js.map +1 -1
- package/dist/@ecme/views/concepts/products/ProductForm/components/PricingSection.js +121 -124
- package/dist/@ecme/views/concepts/products/ProductForm/components/PricingSection.js.map +1 -1
- package/dist/@ecme/views/concepts/products/ProductList/components/ProductListSearch.js +11 -11
- package/dist/@ecme/views/concepts/products/ProductList/components/ProductListSearch.js.map +1 -1
- package/dist/@ecme/views/concepts/products/ProductList/components/ProductTableFilter.js +17 -17
- package/dist/@ecme/views/concepts/products/ProductList/components/ProductTableFilter.js.map +1 -1
- package/dist/@ecme/views/concepts/products/ProductList/hooks/useProductList.js +17 -17
- package/dist/@ecme/views/concepts/products/ProductList/hooks/useProductList.js.map +1 -1
- package/dist/@ecme/views/concepts/projects/Issue/components/IssueBody.js +101 -105
- package/dist/@ecme/views/concepts/projects/Issue/components/IssueBody.js.map +1 -1
- package/dist/@ecme/views/concepts/projects/Issue/components/IssueFooter.js +57 -58
- package/dist/@ecme/views/concepts/projects/Issue/components/IssueFooter.js.map +1 -1
- package/dist/@ecme/views/concepts/projects/ProjectDetails/components/ProjectDetailsHeader.js +51 -52
- package/dist/@ecme/views/concepts/projects/ProjectDetails/components/ProjectDetailsHeader.js.map +1 -1
- package/dist/@ecme/views/concepts/projects/ProjectDetails/components/ProjectDetailsOverview.js +22 -23
- package/dist/@ecme/views/concepts/projects/ProjectDetails/components/ProjectDetailsOverview.js.map +1 -1
- package/dist/@ecme/views/concepts/projects/ProjectDetails/components/ProjectDetailsSetting.js +45 -46
- package/dist/@ecme/views/concepts/projects/ProjectDetails/components/ProjectDetailsSetting.js.map +1 -1
- package/dist/@ecme/views/concepts/projects/ProjectDetails/components/ProjectDetailsTask.js +62 -65
- package/dist/@ecme/views/concepts/projects/ProjectDetails/components/ProjectDetailsTask.js.map +1 -1
- package/dist/@ecme/views/concepts/projects/ProjectList/components/NewProjectForm.js +52 -53
- package/dist/@ecme/views/concepts/projects/ProjectList/components/NewProjectForm.js.map +1 -1
- package/dist/@ecme/views/concepts/projects/ProjectList/components/NewTaskField.js +23 -25
- package/dist/@ecme/views/concepts/projects/ProjectList/components/NewTaskField.js.map +1 -1
- package/dist/@ecme/views/concepts/projects/ProjectList/components/ProjectListContent.js +15 -15
- package/dist/@ecme/views/concepts/projects/ProjectList/components/ProjectListContent.js.map +1 -1
- package/dist/@ecme/views/concepts/projects/ProjectList/components/ProjectListHeader.js +16 -16
- package/dist/@ecme/views/concepts/projects/ProjectList/components/ProjectListHeader.js.map +1 -1
- package/dist/@ecme/views/concepts/projects/ProjectList/hooks/useProjectList.js +9 -9
- package/dist/@ecme/views/concepts/projects/ProjectList/hooks/useProjectList.js.map +1 -1
- package/dist/@ecme/views/concepts/projects/ScrumBoard/components/AddNewColumnContent.js +40 -41
- package/dist/@ecme/views/concepts/projects/ScrumBoard/components/AddNewColumnContent.js.map +1 -1
- package/dist/@ecme/views/concepts/projects/ScrumBoard/components/AddNewTicketContent.js +33 -34
- package/dist/@ecme/views/concepts/projects/ScrumBoard/components/AddNewTicketContent.js.map +1 -1
- package/dist/@ecme/views/concepts/projects/ScrumBoard/components/BoardCardList.js +33 -33
- package/dist/@ecme/views/concepts/projects/ScrumBoard/components/BoardCardList.js.map +1 -1
- package/dist/@ecme/views/concepts/projects/ScrumBoard/components/TicketContent.js +203 -210
- package/dist/@ecme/views/concepts/projects/ScrumBoard/components/TicketContent.js.map +1 -1
- package/dist/@ecme/views/concepts/projects/Tasks/components/AddTask.js +53 -56
- package/dist/@ecme/views/concepts/projects/Tasks/components/AddTask.js.map +1 -1
- package/dist/@ecme/views/concepts/projects/Tasks/components/TaskList.js +80 -83
- package/dist/@ecme/views/concepts/projects/Tasks/components/TaskList.js.map +1 -1
- package/dist/@ecme/views/dashboards/AnalyticDashboard/components/AnalyticHeader.js +6 -6
- package/dist/@ecme/views/dashboards/AnalyticDashboard/components/AnalyticHeader.js.map +1 -1
- package/dist/@ecme/views/dashboards/EcommerceDashboard/components/Overview.js +21 -21
- package/dist/@ecme/views/dashboards/EcommerceDashboard/components/Overview.js.map +1 -1
- package/dist/@ecme/views/dashboards/EcommerceDashboard/components/RevenueByChannel.js +27 -27
- package/dist/@ecme/views/dashboards/EcommerceDashboard/components/RevenueByChannel.js.map +1 -1
- package/dist/@ecme/views/dashboards/EcommerceDashboard/components/SalesTarget.js +27 -27
- package/dist/@ecme/views/dashboards/EcommerceDashboard/components/SalesTarget.js.map +1 -1
- package/dist/@ecme/views/dashboards/MarketingDashboard/components/CreateCampaign.js +59 -60
- package/dist/@ecme/views/dashboards/MarketingDashboard/components/CreateCampaign.js.map +1 -1
- package/dist/@ecme/views/dashboards/ProjectDashboard/components/CreateEventDialog.js +76 -77
- package/dist/@ecme/views/dashboards/ProjectDashboard/components/CreateEventDialog.js.map +1 -1
- package/dist/@ecme/views/dashboards/ProjectDashboard/components/UpcomingSchedule.js +30 -30
- package/dist/@ecme/views/dashboards/ProjectDashboard/components/UpcomingSchedule.js.map +1 -1
- package/dist/@ecme/views/guide/SharedComponentsDoc/components/CustomFormatInputDoc/WithForm.js +21 -22
- package/dist/@ecme/views/guide/SharedComponentsDoc/components/CustomFormatInputDoc/WithForm.js.map +1 -1
- package/dist/@ecme/views/guide/SharedComponentsDoc/components/ImageGalleryDoc/Example.js +15 -15
- package/dist/@ecme/views/guide/SharedComponentsDoc/components/ImageGalleryDoc/Example.js.map +1 -1
- package/dist/@ecme/views/guide/SharedComponentsDoc/components/NumericInputDoc/WithForm.js +20 -21
- package/dist/@ecme/views/guide/SharedComponentsDoc/components/NumericInputDoc/WithForm.js.map +1 -1
- package/dist/@ecme/views/guide/SharedComponentsDoc/components/PatternInputDoc/WithForm.js +20 -21
- package/dist/@ecme/views/guide/SharedComponentsDoc/components/PatternInputDoc/WithForm.js.map +1 -1
- package/dist/@ecme/views/guide/SharedComponentsDoc/components/RichTextEditorDoc/WithForm.js +20 -21
- package/dist/@ecme/views/guide/SharedComponentsDoc/components/RichTextEditorDoc/WithForm.js.map +1 -1
- package/dist/@ecme/views/ui-components/data-display/Table/Editable.js +17 -18
- package/dist/@ecme/views/ui-components/data-display/Table/Editable.js.map +1 -1
- package/dist/@ecme/views/ui-components/data-display/Table/PaginationTable.js +12 -12
- package/dist/@ecme/views/ui-components/data-display/Table/PaginationTable.js.map +1 -1
- package/dist/@ecme/views/ui-components/forms/FormControl/AsyncValidation.js +28 -29
- package/dist/@ecme/views/ui-components/forms/FormControl/AsyncValidation.js.map +1 -1
- package/dist/@ecme/views/ui-components/forms/FormControl/Basic.js +21 -22
- package/dist/@ecme/views/ui-components/forms/FormControl/Basic.js.map +1 -1
- package/dist/@ecme/views/ui-components/forms/FormControl/DependentValidation.js +24 -25
- package/dist/@ecme/views/ui-components/forms/FormControl/DependentValidation.js.map +1 -1
- package/dist/@ecme/views/ui-components/forms/FormControl/DynamicForm.js +75 -79
- package/dist/@ecme/views/ui-components/forms/FormControl/DynamicForm.js.map +1 -1
- package/dist/@ecme/views/ui-components/forms/FormControl/FieldValidation.js +19 -20
- package/dist/@ecme/views/ui-components/forms/FormControl/FieldValidation.js.map +1 -1
- package/dist/@ecme/views/ui-components/forms/FormControl/MixedFormControl.js +90 -91
- package/dist/@ecme/views/ui-components/forms/FormControl/MixedFormControl.js.map +1 -1
- package/dist/@ecme/views/ui-components/forms/FormControl/SchemaValidation.js +22 -23
- package/dist/@ecme/views/ui-components/forms/FormControl/SchemaValidation.js.map +1 -1
- package/dist/@types/base/configs/api.config.d.ts +0 -19
- package/dist/@types/base/configs/api.config.d.ts.map +1 -1
- package/dist/base/assets/styles/init.css +1 -1
- package/dist/base/components/forms/ArraysForms/GenericArrayNumberFormSection.js +24 -25
- package/dist/base/components/forms/ArraysForms/GenericArrayNumberFormSection.js.map +1 -1
- package/dist/base/components/forms/ArraysForms/GenericArrayStringFormSection.js +23 -24
- package/dist/base/components/forms/ArraysForms/GenericArrayStringFormSection.js.map +1 -1
- package/dist/base/components/forms/GenericFomrsSetValue/GenericNumberFormSectionPrice.js +30 -31
- package/dist/base/components/forms/GenericFomrsSetValue/GenericNumberFormSectionPrice.js.map +1 -1
- package/dist/base/components/forms/GenericFomrsSetValue/GenericStringFormSection.js +25 -26
- package/dist/base/components/forms/GenericFomrsSetValue/GenericStringFormSection.js.map +1 -1
- package/dist/base/components/forms/GenericForms/GenericArrayFormSection.js +49 -50
- package/dist/base/components/forms/GenericForms/GenericArrayFormSection.js.map +1 -1
- package/dist/base/components/forms/GenericForms/GenericNumberFormSection.js +27 -28
- package/dist/base/components/forms/GenericForms/GenericNumberFormSection.js.map +1 -1
- package/dist/base/components/forms/GenericForms/GenericStringFormSection.js +23 -24
- package/dist/base/components/forms/GenericForms/GenericStringFormSection.js.map +1 -1
- package/dist/base/components/forms/GenericForms/GenericUploadFormSection.js +27 -28
- package/dist/base/components/forms/GenericForms/GenericUploadFormSection.js.map +1 -1
- package/dist/base/components/forms/NumberFormVariant/GenericNumberFormSectionPercentage.js +29 -30
- package/dist/base/components/forms/NumberFormVariant/GenericNumberFormSectionPercentage.js.map +1 -1
- package/dist/base/components/forms/NumberFormVariant/GenericNumberFormSectionPrice.js +27 -28
- package/dist/base/components/forms/NumberFormVariant/GenericNumberFormSectionPrice.js.map +1 -1
- package/dist/base/components/forms/NumberFormVariant/GenericNumberFormSectionWeight.js +27 -28
- package/dist/base/components/forms/NumberFormVariant/GenericNumberFormSectionWeight.js.map +1 -1
- package/dist/base/components/shared/TransferirProcessoDialog.js +10 -10
- package/dist/base/components/shared/TransferirProcessoDialog.js.map +1 -1
- package/dist/base/components/tools/NavFilter.js +68 -75
- package/dist/base/components/tools/NavFilter.js.map +1 -1
- package/dist/base/configs/api.config.js +11 -14
- package/dist/base/configs/api.config.js.map +1 -1
- package/dist/base/hooks/adm/roles/useRolesList.js +11 -11
- package/dist/base/hooks/adm/roles/useRolesList.js.map +1 -1
- package/dist/base/hooks/adm/users/useUsersList.js +10 -10
- package/dist/base/hooks/adm/users/useUsersList.js.map +1 -1
- package/dist/base/hooks/dm/businessPartner/useBusinessPartnerClienteList.js +5 -5
- package/dist/base/hooks/dm/businessPartner/useBusinessPartnerClienteList.js.map +1 -1
- package/dist/base/hooks/dm/businessPartner/useBusinessPartnerFornecedorList.js +7 -7
- package/dist/base/hooks/dm/businessPartner/useBusinessPartnerFornecedorList.js.map +1 -1
- package/dist/base/hooks/dm/businessPartner/useBusinessPartnerList.js +10 -10
- package/dist/base/hooks/dm/businessPartner/useBusinessPartnerList.js.map +1 -1
- package/dist/base/hooks/dm/canalDistribuicao/useCanalDistribuicaoByCodigoList.js +8 -8
- package/dist/base/hooks/dm/canalDistribuicao/useCanalDistribuicaoByCodigoList.js.map +1 -1
- package/dist/base/hooks/dm/canalDistribuicao/useCanalDistribuicaoList.js +8 -8
- package/dist/base/hooks/dm/canalDistribuicao/useCanalDistribuicaoList.js.map +1 -1
- package/dist/base/hooks/dm/centro/useCentroByCodigoList.js +13 -13
- package/dist/base/hooks/dm/centro/useCentroByCodigoList.js.map +1 -1
- package/dist/base/hooks/dm/centro/useCentroList.js +6 -6
- package/dist/base/hooks/dm/centro/useCentroList.js.map +1 -1
- package/dist/base/hooks/dm/condicaoPagamento/useCondicaoPagamentoList.js +4 -4
- package/dist/base/hooks/dm/condicaoPagamento/useCondicaoPagamentoList.js.map +1 -1
- package/dist/base/hooks/dm/deposito/useDepositoByCodigoList.js +9 -9
- package/dist/base/hooks/dm/deposito/useDepositoByCodigoList.js.map +1 -1
- package/dist/base/hooks/dm/deposito/useDepositoList.js +5 -5
- package/dist/base/hooks/dm/deposito/useDepositoList.js.map +1 -1
- package/dist/base/hooks/dm/deposito/useDepositosByCodigoCentroList.js +13 -13
- package/dist/base/hooks/dm/deposito/useDepositosByCodigoCentroList.js.map +1 -1
- package/dist/base/hooks/dm/equipeVenda/useEquipeVendaByCodigoList.js +8 -8
- package/dist/base/hooks/dm/equipeVenda/useEquipeVendaByCodigoList.js.map +1 -1
- package/dist/base/hooks/dm/equipeVenda/useEquipeVendaList.js +6 -6
- package/dist/base/hooks/dm/equipeVenda/useEquipeVendaList.js.map +1 -1
- package/dist/base/hooks/dm/escritorioVenda/useEscritorioVendaByCodigoList.js +10 -10
- package/dist/base/hooks/dm/escritorioVenda/useEscritorioVendaByCodigoList.js.map +1 -1
- package/dist/base/hooks/dm/escritorioVenda/useEscritorioVendaList.js +7 -7
- package/dist/base/hooks/dm/escritorioVenda/useEscritorioVendaList.js.map +1 -1
- package/dist/base/hooks/dm/formaPagamento/useFormaPagamentoByCodigoList.js +10 -10
- package/dist/base/hooks/dm/formaPagamento/useFormaPagamentoByCodigoList.js.map +1 -1
- package/dist/base/hooks/dm/formaPagamento/useFormaPagamentoList.js +1 -1
- package/dist/base/hooks/dm/formaPagamento/useFormaPagamentoList.js.map +1 -1
- package/dist/base/hooks/dm/grupoVenda/useGrupoVendaByCodigoList.js +11 -11
- package/dist/base/hooks/dm/grupoVenda/useGrupoVendaByCodigoList.js.map +1 -1
- package/dist/base/hooks/dm/grupoVenda/useGrupoVendaList.js +9 -9
- package/dist/base/hooks/dm/grupoVenda/useGrupoVendaList.js.map +1 -1
- package/dist/base/hooks/dm/incoterms/useIncotermsList.js +17 -18
- package/dist/base/hooks/dm/incoterms/useIncotermsList.js.map +1 -1
- package/dist/base/hooks/dm/produto/useProdutoByCodigoList.js +13 -13
- package/dist/base/hooks/dm/produto/useProdutoByCodigoList.js.map +1 -1
- package/dist/base/hooks/dm/produto/useProdutoByGrupoProdutoList.js +21 -21
- package/dist/base/hooks/dm/produto/useProdutoByGrupoProdutoList.js.map +1 -1
- package/dist/base/hooks/dm/produto/useProdutoFindList.js +8 -8
- package/dist/base/hooks/dm/produto/useProdutoFindList.js.map +1 -1
- package/dist/base/hooks/dm/produto/useProdutoFindMonitorList.js +11 -11
- package/dist/base/hooks/dm/produto/useProdutoFindMonitorList.js.map +1 -1
- package/dist/base/hooks/dm/produto/useProdutoIsPrecificadoRacaoList.js +9 -9
- package/dist/base/hooks/dm/produto/useProdutoIsPrecificadoRacaoList.js.map +1 -1
- package/dist/base/hooks/dm/setorAtividade/useSetorAtividadeList.js +5 -5
- package/dist/base/hooks/dm/setorAtividade/useSetorAtividadeList.js.map +1 -1
- package/dist/base/hooks/dm/tipoDocumentoVenda/useTipoDocumentoVendaByCodigoList.js +9 -9
- package/dist/base/hooks/dm/tipoDocumentoVenda/useTipoDocumentoVendaByCodigoList.js.map +1 -1
- package/dist/base/hooks/dm/tipoDocumentoVenda/useTipoDocumentoVendaList.js +9 -9
- package/dist/base/hooks/dm/tipoDocumentoVenda/useTipoDocumentoVendaList.js.map +1 -1
- package/dist/base/hooks/dm/tipoOrdemVenda/useTipoOrdemVendaByCodigoList.js +10 -10
- package/dist/base/hooks/dm/tipoOrdemVenda/useTipoOrdemVendaByCodigoList.js.map +1 -1
- package/dist/base/hooks/dm/tipoOrdemVenda/useTipoOrdemVendaList.js +9 -9
- package/dist/base/hooks/dm/tipoOrdemVenda/useTipoOrdemVendaList.js.map +1 -1
- package/dist/base/hooks/useList.js +10 -10
- package/dist/base/hooks/useList.js.map +1 -1
- package/dist/base/services/modules/transportadora/ControleDescarga/ControleDescargaService.js +15 -15
- package/dist/base/services/modules/transportadora/ControleDescarga/ControleDescargaService.js.map +1 -1
- package/dist/base/services/modules/transportadora/ControleEmbarque/ControleEmbarqueService.js +7 -7
- package/dist/base/services/modules/transportadora/ControleEmbarque/ControleEmbarqueService.js.map +1 -1
- package/dist/base/services/modules/transportadora/NaturezaCarga/NaturezaCargaService.js +5 -5
- package/dist/base/services/modules/transportadora/NaturezaCarga/NaturezaCargaService.js.map +1 -1
- package/dist/base/utils/functions/stringUtils.js +14 -15
- package/dist/base/utils/functions/stringUtils.js.map +1 -1
- package/lib/base/configs/api.config.ts +6 -7
- package/package.json +1 -1
- package/tsconfig.json +6 -1
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
import { jsxs as s, jsx as e } from "react/jsx-runtime";
|
|
2
|
-
import { useState as l, useRef as
|
|
3
|
-
import { Avatar as
|
|
2
|
+
import { useState as l, useRef as N } from "react";
|
|
3
|
+
import { Avatar as S } from "../../../../../components/ui/Avatar/index.js";
|
|
4
4
|
import "../../../../../components/ui/Button/index.js";
|
|
5
5
|
import "../../../../../components/ui/Input/index.js";
|
|
6
|
-
import
|
|
6
|
+
import k from "../../../../../components/shared/ConfirmDialog.js";
|
|
7
7
|
import "../../../../../components/ui/Form/index.js";
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import { zodResolver as
|
|
12
|
-
import { useForm as
|
|
8
|
+
import x from "../../../../../utils/classNames.js";
|
|
9
|
+
import A from "../../../../../utils/sleep.js";
|
|
10
|
+
import R from "../../../../../utils/isLastChild.js";
|
|
11
|
+
import { zodResolver as V } from "@hookform/resolvers/zod";
|
|
12
|
+
import { useForm as j, Controller as c } from "react-hook-form";
|
|
13
13
|
import { z as t } from "zod";
|
|
14
|
-
import { Form as
|
|
14
|
+
import { Form as z } from "../../../../../components/ui/Form/Form.js";
|
|
15
15
|
import m from "../../../../../components/ui/Form/FormItem.js";
|
|
16
16
|
import d from "../../../../../components/ui/Input/Input.js";
|
|
17
17
|
import p from "../../../../../components/ui/Button/Button.js";
|
|
18
|
-
const
|
|
18
|
+
const g = [
|
|
19
19
|
{
|
|
20
20
|
label: "Google Authenticator",
|
|
21
21
|
value: "googleAuthenticator",
|
|
@@ -34,26 +34,25 @@ const v = [
|
|
|
34
34
|
img: "/img/others/email.png",
|
|
35
35
|
desc: "Unique codes sent to email for confirming logins."
|
|
36
36
|
}
|
|
37
|
-
],
|
|
37
|
+
], B = t.object({
|
|
38
38
|
currentPassword: t.string().min(1, { message: "Please enter your current password!" }),
|
|
39
39
|
newPassword: t.string().min(1, { message: "Please enter your new password!" }),
|
|
40
40
|
confirmNewPassword: t.string().min(1, { message: "Please confirm your new password!" })
|
|
41
41
|
}).refine((i) => i.confirmNewPassword === i.newPassword, {
|
|
42
42
|
message: "Password not match",
|
|
43
43
|
path: ["confirmNewPassword"]
|
|
44
|
-
}),
|
|
45
|
-
var g, w, h;
|
|
44
|
+
}), Z = () => {
|
|
46
45
|
const [i, u] = l(
|
|
47
46
|
"googleAuthenticator"
|
|
48
|
-
), [
|
|
49
|
-
getValues:
|
|
50
|
-
handleSubmit:
|
|
47
|
+
), [w, a] = l(!1), [h, f] = l(!1), v = N(null), {
|
|
48
|
+
getValues: b,
|
|
49
|
+
handleSubmit: y,
|
|
51
50
|
formState: { errors: o },
|
|
52
51
|
control: n
|
|
53
|
-
} =
|
|
54
|
-
resolver: B
|
|
55
|
-
}),
|
|
56
|
-
f(!0), await
|
|
52
|
+
} = j({
|
|
53
|
+
resolver: V(B)
|
|
54
|
+
}), P = async () => {
|
|
55
|
+
f(!0), await A(1e3), console.log("getValues", b()), a(!1), f(!1);
|
|
57
56
|
};
|
|
58
57
|
return /* @__PURE__ */ s("div", { children: [
|
|
59
58
|
/* @__PURE__ */ s("div", { className: "mb-8", children: [
|
|
@@ -61,11 +60,11 @@ const v = [
|
|
|
61
60
|
/* @__PURE__ */ e("p", { children: "Remember, your password is your digital key to your account. Keep it safe, keep it secure!" })
|
|
62
61
|
] }),
|
|
63
62
|
/* @__PURE__ */ s(
|
|
64
|
-
|
|
63
|
+
z,
|
|
65
64
|
{
|
|
66
|
-
ref:
|
|
65
|
+
ref: v,
|
|
67
66
|
className: "mb-8",
|
|
68
|
-
onSubmit:
|
|
67
|
+
onSubmit: y(async () => {
|
|
69
68
|
a(!0);
|
|
70
69
|
}),
|
|
71
70
|
children: [
|
|
@@ -74,7 +73,7 @@ const v = [
|
|
|
74
73
|
{
|
|
75
74
|
label: "Current password",
|
|
76
75
|
invalid: !!o.currentPassword,
|
|
77
|
-
errorMessage:
|
|
76
|
+
errorMessage: o.currentPassword?.message,
|
|
78
77
|
children: /* @__PURE__ */ e(
|
|
79
78
|
c,
|
|
80
79
|
{
|
|
@@ -98,7 +97,7 @@ const v = [
|
|
|
98
97
|
{
|
|
99
98
|
label: "New password",
|
|
100
99
|
invalid: !!o.newPassword,
|
|
101
|
-
errorMessage:
|
|
100
|
+
errorMessage: o.newPassword?.message,
|
|
102
101
|
children: /* @__PURE__ */ e(
|
|
103
102
|
c,
|
|
104
103
|
{
|
|
@@ -122,7 +121,7 @@ const v = [
|
|
|
122
121
|
{
|
|
123
122
|
label: "Confirm new password",
|
|
124
123
|
invalid: !!o.confirmNewPassword,
|
|
125
|
-
errorMessage:
|
|
124
|
+
errorMessage: o.confirmNewPassword?.message,
|
|
126
125
|
children: /* @__PURE__ */ e(
|
|
127
126
|
c,
|
|
128
127
|
{
|
|
@@ -146,14 +145,14 @@ const v = [
|
|
|
146
145
|
}
|
|
147
146
|
),
|
|
148
147
|
/* @__PURE__ */ e(
|
|
149
|
-
|
|
148
|
+
k,
|
|
150
149
|
{
|
|
151
|
-
isOpen:
|
|
150
|
+
isOpen: w,
|
|
152
151
|
type: "warning",
|
|
153
152
|
title: "Update password",
|
|
154
153
|
confirmButtonProps: {
|
|
155
|
-
loading:
|
|
156
|
-
onClick:
|
|
154
|
+
loading: h,
|
|
155
|
+
onClick: P
|
|
157
156
|
},
|
|
158
157
|
onClose: () => a(!1),
|
|
159
158
|
onRequestClose: () => a(!1),
|
|
@@ -164,17 +163,17 @@ const v = [
|
|
|
164
163
|
/* @__PURE__ */ s("div", { className: "mb-8", children: [
|
|
165
164
|
/* @__PURE__ */ e("h4", { children: "2-Step verification" }),
|
|
166
165
|
/* @__PURE__ */ e("p", { children: "Your account holds great value to hackers. Enable two-step verification to safeguard your account!" }),
|
|
167
|
-
/* @__PURE__ */ e("div", { className: "mt-8", children:
|
|
166
|
+
/* @__PURE__ */ e("div", { className: "mt-8", children: g.map((r, C) => /* @__PURE__ */ e(
|
|
168
167
|
"div",
|
|
169
168
|
{
|
|
170
|
-
className:
|
|
169
|
+
className: x(
|
|
171
170
|
"py-6 border-gray-200 dark:border-gray-600",
|
|
172
|
-
!
|
|
171
|
+
!R(g, C) && "border-b"
|
|
173
172
|
),
|
|
174
173
|
children: /* @__PURE__ */ s("div", { className: "flex items-center justify-between gap-4", children: [
|
|
175
174
|
/* @__PURE__ */ s("div", { className: "flex items-center gap-4", children: [
|
|
176
175
|
/* @__PURE__ */ e(
|
|
177
|
-
|
|
176
|
+
S,
|
|
178
177
|
{
|
|
179
178
|
size: 35,
|
|
180
179
|
className: "bg-transparent",
|
|
@@ -212,6 +211,6 @@ const v = [
|
|
|
212
211
|
] });
|
|
213
212
|
};
|
|
214
213
|
export {
|
|
215
|
-
|
|
214
|
+
Z as default
|
|
216
215
|
};
|
|
217
216
|
//# sourceMappingURL=SettingsSecurity.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SettingsSecurity.js","sources":["../../../../../../../lib/@ecme/views/concepts/accounts/Settings/components/SettingsSecurity.tsx"],"sourcesContent":["import { useState, useRef } from 'react'\nimport Avatar from '@/components/ui/Avatar'\nimport Button from '@/components/ui/Button'\nimport Input from '@/components/ui/Input'\nimport ConfirmDialog from '@/components/shared/ConfirmDialog'\nimport { Form, FormItem } from '@/components/ui/Form'\nimport classNames from '@/utils/classNames'\nimport sleep from '@/utils/sleep'\nimport isLastChild from '@/utils/isLastChild'\nimport { zodResolver } from '@hookform/resolvers/zod'\nimport { useForm, Controller } from 'react-hook-form'\nimport { z } from 'zod'\nimport type { ZodType } from 'zod'\n\ntype PasswordSchema = {\n currentPassword: string\n newPassword: string\n confirmNewPassword: string\n}\n\nconst authenticatorList = [\n {\n label: 'Google Authenticator',\n value: 'googleAuthenticator',\n img: '/img/others/google.png',\n desc: 'Using Google Authenticator app generates time-sensitive codes for secure logins.',\n },\n {\n label: 'Okta Verify',\n value: 'oktaVerify',\n img: '/img/others/okta.png',\n desc: 'Receive push notifications from Okta Verify app on your phone for quick login approval.',\n },\n {\n label: 'E Mail verification',\n value: 'emailVerification',\n img: '/img/others/email.png',\n desc: 'Unique codes sent to email for confirming logins.',\n },\n]\n\nconst validationSchema: ZodType<PasswordSchema> = z\n .object({\n currentPassword: z\n .string()\n .min(1, { message: 'Please enter your current password!' }),\n newPassword: z\n .string()\n .min(1, { message: 'Please enter your new password!' }),\n confirmNewPassword: z\n .string()\n .min(1, { message: 'Please confirm your new password!' }),\n })\n .refine((data) => data.confirmNewPassword === data.newPassword, {\n message: 'Password not match',\n path: ['confirmNewPassword'],\n })\n\nconst SettingsSecurity = () => {\n const [selected2FaType, setSelected2FaType] = useState(\n 'googleAuthenticator',\n )\n const [confirmationOpen, setConfirmationOpen] = useState(false)\n const [isSubmitting, setIsSubmitting] = useState(false)\n\n const formRef = useRef<HTMLFormElement>(null)\n\n const {\n getValues,\n handleSubmit,\n formState: { errors },\n control,\n } = useForm<PasswordSchema>({\n resolver: zodResolver(validationSchema),\n })\n\n const handlePostSubmit = async () => {\n setIsSubmitting(true)\n await sleep(1000)\n console.log('getValues', getValues())\n setConfirmationOpen(false)\n setIsSubmitting(false)\n }\n\n const onSubmit = async () => {\n setConfirmationOpen(true)\n }\n\n return (\n <div>\n <div className=\"mb-8\">\n <h4>Password</h4>\n <p>\n Remember, your password is your digital key to your account.\n Keep it safe, keep it secure!\n </p>\n </div>\n <Form\n ref={formRef}\n className=\"mb-8\"\n onSubmit={handleSubmit(onSubmit)}\n >\n <FormItem\n label=\"Current password\"\n invalid={Boolean(errors.currentPassword)}\n errorMessage={errors.currentPassword?.message}\n >\n <Controller\n name=\"currentPassword\"\n control={control}\n render={({ field }) => (\n <Input\n type=\"password\"\n autoComplete=\"off\"\n placeholder=\"•••••••••\"\n {...field}\n />\n )}\n />\n </FormItem>\n <FormItem\n label=\"New password\"\n invalid={Boolean(errors.newPassword)}\n errorMessage={errors.newPassword?.message}\n >\n <Controller\n name=\"newPassword\"\n control={control}\n render={({ field }) => (\n <Input\n type=\"password\"\n autoComplete=\"off\"\n placeholder=\"•••••••••\"\n {...field}\n />\n )}\n />\n </FormItem>\n <FormItem\n label=\"Confirm new password\"\n invalid={Boolean(errors.confirmNewPassword)}\n errorMessage={errors.confirmNewPassword?.message}\n >\n <Controller\n name=\"confirmNewPassword\"\n control={control}\n render={({ field }) => (\n <Input\n type=\"password\"\n autoComplete=\"off\"\n placeholder=\"•••••••••\"\n {...field}\n />\n )}\n />\n </FormItem>\n <div className=\"flex justify-end\">\n <Button variant=\"solid\" type=\"submit\">\n Update\n </Button>\n </div>\n </Form>\n <ConfirmDialog\n isOpen={confirmationOpen}\n type=\"warning\"\n title=\"Update password\"\n confirmButtonProps={{\n loading: isSubmitting,\n onClick: handlePostSubmit,\n }}\n onClose={() => setConfirmationOpen(false)}\n onRequestClose={() => setConfirmationOpen(false)}\n onCancel={() => setConfirmationOpen(false)}\n >\n <p>Are you sure you want to change your password?</p>\n </ConfirmDialog>\n <div className=\"mb-8\">\n <h4>2-Step verification</h4>\n <p>\n Your account holds great value to hackers. Enable two-step\n verification to safeguard your account!\n </p>\n <div className=\"mt-8\">\n {authenticatorList.map((authOption, index) => (\n <div\n key={authOption.value}\n className={classNames(\n 'py-6 border-gray-200 dark:border-gray-600',\n !isLastChild(authenticatorList, index) &&\n 'border-b',\n )}\n >\n <div className=\"flex items-center justify-between gap-4\">\n <div className=\"flex items-center gap-4\">\n <Avatar\n size={35}\n className=\"bg-transparent\"\n src={authOption.img}\n />\n <div>\n <h6>{authOption.label}</h6>\n <span>{authOption.desc}</span>\n </div>\n </div>\n <div>\n {selected2FaType === authOption.value ? (\n <Button\n size=\"sm\"\n customColorClass={() =>\n 'border-success ring-1 ring-success text-success hover:border-success hover:ring-success hover:text-success bg-transparent'\n }\n onClick={() =>\n setSelected2FaType('')\n }\n >\n Activated\n </Button>\n ) : (\n <Button\n size=\"sm\"\n onClick={() =>\n setSelected2FaType(\n authOption.value,\n )\n }\n >\n Enable\n </Button>\n )}\n </div>\n </div>\n </div>\n ))}\n </div>\n </div>\n </div>\n )\n}\n\nexport default SettingsSecurity\n"],"names":["authenticatorList","validationSchema","z","data","SettingsSecurity","selected2FaType","setSelected2FaType","useState","confirmationOpen","setConfirmationOpen","isSubmitting","setIsSubmitting","formRef","useRef","getValues","handleSubmit","errors","control","useForm","zodResolver","handlePostSubmit","sleep","jsxs","jsx","Form","FormItem","_a","Controller","field","Input","_b","_c","Button","ConfirmDialog","authOption","index","classNames","isLastChild","Avatar"],"mappings":";;;;;;;;;;;;;;;;;AAoBA,MAAMA,IAAoB;AAAA,EACtB;AAAA,IACI,OAAO;AAAA,IACP,OAAO;AAAA,IACP,KAAK;AAAA,IACL,MAAM;AAAA,EAAA;AAAA,EAEV;AAAA,IACI,OAAO;AAAA,IACP,OAAO;AAAA,IACP,KAAK;AAAA,IACL,MAAM;AAAA,EAAA;AAAA,EAEV;AAAA,IACI,OAAO;AAAA,IACP,OAAO;AAAA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CACX,UAAA;AAAA,YAAA,gBAAAA,EAAC,OAAA,EAAI,WAAU,2BACX,UAAA;AAAA,cAAA,gBAAAC;AAAA,gBAACe;AAAA,gBAAA;AAAA,kBACG,MAAM;AAAA,kBACN,WAAU;AAAA,kBACV,KAAKJ,EAAW;AAAA,gBAAA;AAAA,cAAA;AAAA,gCAEnB,OAAA,EACG,UAAA;AAAA,gBAAA,gBAAAX,EAAC,MAAA,EAAI,YAAW,MAAA,CAAM;AAAA,gBACtB,gBAAAA,EAAC,QAAA,EAAM,UAAAW,EAAW,KAAA,CAAK;AAAA,cAAA,EAAA,CAC3B;AAAA,YAAA,GACJ;AAAA,YACA,gBAAAX,EAAC,OAAA,EACI,UAAAlB,MAAoB6B,EAAW,QAC5B,gBAAAX;AAAA,cAACS;AAAA,cAAA;AAAA,gBACG,MAAK;AAAA,gBACL,kBAAkB,MACd;AAAA,gBAEJ,SAAS,MACL1B,EAAmB,EAAE;AAAA,gBAE5B,UAAA;AAAA,cAAA;AAAA,YAAA,IAID,gBAAAiB;AAAA,cAACS;AAAA,cAAA;AAAA,gBACG,MAAK;AAAA,gBACL,SAAS,MACL1B;AAAA,kBACI4B,EAAW;AAAA,gBAAA;AAAA,gBAGtB,UAAA;AAAA,cAAA;AAAA,YAAA,EAED,CAER;AAAA,UAAA,EAAA,CACJ;AAAA,QAAA;AAAA,QA7CKA,EAAW;AAAA,MAAA,CA+CvB,EAAA,CACL;AAAA,IAAA,EAAA,CACJ;AAAA,EAAA,GACJ;AAER;"}
|
|
1
|
+
{"version":3,"file":"SettingsSecurity.js","sources":["../../../../../../../lib/@ecme/views/concepts/accounts/Settings/components/SettingsSecurity.tsx"],"sourcesContent":["import { useState, useRef } from 'react'\nimport Avatar from '@/components/ui/Avatar'\nimport Button from '@/components/ui/Button'\nimport Input from '@/components/ui/Input'\nimport ConfirmDialog from '@/components/shared/ConfirmDialog'\nimport { Form, FormItem } from '@/components/ui/Form'\nimport classNames from '@/utils/classNames'\nimport sleep from '@/utils/sleep'\nimport isLastChild from '@/utils/isLastChild'\nimport { zodResolver } from '@hookform/resolvers/zod'\nimport { useForm, Controller } from 'react-hook-form'\nimport { z } from 'zod'\nimport type { ZodType } from 'zod'\n\ntype PasswordSchema = {\n currentPassword: string\n newPassword: string\n confirmNewPassword: string\n}\n\nconst authenticatorList = [\n {\n label: 'Google Authenticator',\n value: 'googleAuthenticator',\n img: '/img/others/google.png',\n desc: 'Using Google Authenticator app generates time-sensitive codes for secure logins.',\n },\n {\n label: 'Okta Verify',\n value: 'oktaVerify',\n img: '/img/others/okta.png',\n desc: 'Receive push notifications from Okta Verify app on your phone for quick login approval.',\n },\n {\n label: 'E Mail verification',\n value: 'emailVerification',\n img: '/img/others/email.png',\n desc: 'Unique codes sent to email for confirming logins.',\n },\n]\n\nconst validationSchema: ZodType<PasswordSchema> = z\n .object({\n currentPassword: z\n .string()\n .min(1, { message: 'Please enter your current password!' }),\n newPassword: z\n .string()\n .min(1, { message: 'Please enter your new password!' }),\n confirmNewPassword: z\n .string()\n .min(1, { message: 'Please confirm your new password!' }),\n })\n .refine((data) => data.confirmNewPassword === data.newPassword, {\n message: 'Password not match',\n path: ['confirmNewPassword'],\n })\n\nconst SettingsSecurity = () => {\n const [selected2FaType, setSelected2FaType] = useState(\n 'googleAuthenticator',\n )\n const [confirmationOpen, setConfirmationOpen] = useState(false)\n const [isSubmitting, setIsSubmitting] = useState(false)\n\n const formRef = useRef<HTMLFormElement>(null)\n\n const {\n getValues,\n handleSubmit,\n formState: { errors },\n control,\n } = useForm<PasswordSchema>({\n resolver: zodResolver(validationSchema),\n })\n\n const handlePostSubmit = async () => {\n setIsSubmitting(true)\n await sleep(1000)\n console.log('getValues', getValues())\n setConfirmationOpen(false)\n setIsSubmitting(false)\n }\n\n const onSubmit = async () => {\n setConfirmationOpen(true)\n }\n\n return (\n <div>\n <div className=\"mb-8\">\n <h4>Password</h4>\n <p>\n Remember, your password is your digital key to your account.\n Keep it safe, keep it secure!\n </p>\n </div>\n <Form\n ref={formRef}\n className=\"mb-8\"\n onSubmit={handleSubmit(onSubmit)}\n >\n <FormItem\n label=\"Current password\"\n invalid={Boolean(errors.currentPassword)}\n errorMessage={errors.currentPassword?.message}\n >\n <Controller\n name=\"currentPassword\"\n control={control}\n render={({ field }) => (\n <Input\n type=\"password\"\n autoComplete=\"off\"\n placeholder=\"•••••••••\"\n {...field}\n />\n )}\n />\n </FormItem>\n <FormItem\n label=\"New password\"\n invalid={Boolean(errors.newPassword)}\n errorMessage={errors.newPassword?.message}\n >\n <Controller\n name=\"newPassword\"\n control={control}\n render={({ field }) => (\n <Input\n type=\"password\"\n autoComplete=\"off\"\n placeholder=\"•••••••••\"\n {...field}\n />\n )}\n />\n </FormItem>\n <FormItem\n label=\"Confirm new password\"\n invalid={Boolean(errors.confirmNewPassword)}\n errorMessage={errors.confirmNewPassword?.message}\n >\n <Controller\n name=\"confirmNewPassword\"\n control={control}\n render={({ field }) => (\n <Input\n type=\"password\"\n autoComplete=\"off\"\n placeholder=\"•••••••••\"\n {...field}\n />\n )}\n />\n </FormItem>\n <div className=\"flex justify-end\">\n <Button variant=\"solid\" type=\"submit\">\n Update\n </Button>\n </div>\n </Form>\n <ConfirmDialog\n isOpen={confirmationOpen}\n type=\"warning\"\n title=\"Update password\"\n confirmButtonProps={{\n loading: isSubmitting,\n onClick: handlePostSubmit,\n }}\n onClose={() => setConfirmationOpen(false)}\n onRequestClose={() => setConfirmationOpen(false)}\n onCancel={() => setConfirmationOpen(false)}\n >\n <p>Are you sure you want to change your password?</p>\n </ConfirmDialog>\n <div className=\"mb-8\">\n <h4>2-Step verification</h4>\n <p>\n Your account holds great value to hackers. Enable two-step\n verification to safeguard your account!\n </p>\n <div className=\"mt-8\">\n {authenticatorList.map((authOption, index) => (\n <div\n key={authOption.value}\n className={classNames(\n 'py-6 border-gray-200 dark:border-gray-600',\n !isLastChild(authenticatorList, index) &&\n 'border-b',\n )}\n >\n <div className=\"flex items-center justify-between gap-4\">\n <div className=\"flex items-center gap-4\">\n <Avatar\n size={35}\n className=\"bg-transparent\"\n src={authOption.img}\n />\n <div>\n <h6>{authOption.label}</h6>\n <span>{authOption.desc}</span>\n </div>\n </div>\n <div>\n {selected2FaType === authOption.value ? (\n <Button\n size=\"sm\"\n customColorClass={() =>\n 'border-success ring-1 ring-success text-success hover:border-success hover:ring-success hover:text-success bg-transparent'\n }\n onClick={() =>\n setSelected2FaType('')\n }\n >\n Activated\n </Button>\n ) : (\n <Button\n size=\"sm\"\n onClick={() =>\n setSelected2FaType(\n authOption.value,\n )\n }\n >\n Enable\n </Button>\n )}\n </div>\n </div>\n </div>\n ))}\n </div>\n </div>\n </div>\n )\n}\n\nexport default SettingsSecurity\n"],"names":["authenticatorList","validationSchema","z","data","SettingsSecurity","selected2FaType","setSelected2FaType","useState","confirmationOpen","setConfirmationOpen","isSubmitting","setIsSubmitting","formRef","useRef","getValues","handleSubmit","errors","control","useForm","zodResolver","handlePostSubmit","sleep","jsxs","jsx","Form","FormItem","Controller","field","Input","Button","ConfirmDialog","authOption","index","classNames","isLastChild","Avatar"],"mappings":";;;;;;;;;;;;;;;;;AAoBA,MAAMA,IAAoB;AAAA,EACtB;AAAA,IACI,OAAO;AAAA,IACP,OAAO;AAAA,IACP,KAAK;AAAA,IACL,MAAM;AAAA,EAAA;AAAA,EAEV;AAAA,IACI,OAAO;AAAA,IACP,OAAO;AAAA,IACP,KAAK;AAAA,IACL,MAAM;AAAA,EAAA;AAAA,EAEV;AAAA,IACI,OAAO;AAAA,IACP,OAAO;AAAA,IACP,KAAK;AAAA,IACL,MAAM;AAAA,EAAA;AAEd,GAEMC,IAA4CC,EAC7C,OAAO;AAAA,EACJ,iBAAiBA,EACZ,SACA,IAAI,GAAG,EAAE,SAAS,uCAAuC;AAAA,EAC9D,aAAaA,EACR,SACA,IAAI,GAAG,EAAE,SAAS,mCAAmC;AAAA,EAC1D,oBAAoBA,EACf,OAAA,EACA,IAAI,GAAG,EAAE,SAAS,oCAAA,CAAqC;AACh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,KAAA,CAAK;AAAA,cAAA,EAAA,CAC3B;AAAA,YAAA,GACJ;AAAA,YACA,gBAAAR,EAAC,OAAA,EACI,UAAAlB,MAAoB0B,EAAW,QAC5B,gBAAAR;AAAA,cAACM;AAAA,cAAA;AAAA,gBACG,MAAK;AAAA,gBACL,kBAAkB,MACd;AAAA,gBAEJ,SAAS,MACLvB,EAAmB,EAAE;AAAA,gBAE5B,UAAA;AAAA,cAAA;AAAA,YAAA,IAID,gBAAAiB;AAAA,cAACM;AAAA,cAAA;AAAA,gBACG,MAAK;AAAA,gBACL,SAAS,MACLvB;AAAA,kBACIyB,EAAW;AAAA,gBAAA;AAAA,gBAGtB,UAAA;AAAA,cAAA;AAAA,YAAA,EAED,CAER;AAAA,UAAA,EAAA,CACJ;AAAA,QAAA;AAAA,QA7CKA,EAAW;AAAA,MAAA,CA+CvB,EAAA,CACL;AAAA,IAAA,EAAA,CACJ;AAAA,EAAA,GACJ;AAER;"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { jsx as e, jsxs as
|
|
1
|
+
import { jsx as e, jsxs as t, Fragment as v } from "react/jsx-runtime";
|
|
2
2
|
import { useRef as N, useState as i, useEffect as F } from "react";
|
|
3
3
|
import "../../../../../components/ui/Button/index.js";
|
|
4
4
|
import "../../../../../components/ui/Input/index.js";
|
|
@@ -25,21 +25,21 @@ const g = [
|
|
|
25
25
|
{ label: "Overeactive refusal", value: "overeactiveRefusal" },
|
|
26
26
|
{ label: "Other", value: "other" }
|
|
27
27
|
], re = ({ content: s }) => {
|
|
28
|
-
const d = N(null), [
|
|
28
|
+
const d = N(null), [o, h] = i(!1), [k, T] = i(""), [b, x] = i(""), [r, n] = i({
|
|
29
29
|
type: "",
|
|
30
30
|
open: !1
|
|
31
31
|
}), p = "p-2 rounded-full hover:bg-black hover:bg-opacity-5 hover:text-gray-900 dark:hover:bg-black dark:hover:text-gray-100 dark:hover:bg-opacity-40 transition-colors duration-300 ease-in-out";
|
|
32
32
|
F(() => {
|
|
33
|
-
if (
|
|
34
|
-
const
|
|
33
|
+
if (o && s && (navigator.clipboard.writeText(s), o)) {
|
|
34
|
+
const l = setTimeout(
|
|
35
35
|
() => h(!1),
|
|
36
36
|
2e3
|
|
37
37
|
);
|
|
38
38
|
return () => {
|
|
39
|
-
clearTimeout(
|
|
39
|
+
clearTimeout(l);
|
|
40
40
|
};
|
|
41
41
|
}
|
|
42
|
-
}, [
|
|
42
|
+
}, [o, s]);
|
|
43
43
|
const a = () => {
|
|
44
44
|
n({
|
|
45
45
|
type: "",
|
|
@@ -51,14 +51,14 @@ const g = [
|
|
|
51
51
|
{ placement: "top-center" }
|
|
52
52
|
);
|
|
53
53
|
};
|
|
54
|
-
return /* @__PURE__ */
|
|
55
|
-
/* @__PURE__ */
|
|
56
|
-
/* @__PURE__ */ e(m, { title:
|
|
54
|
+
return /* @__PURE__ */ t(v, { children: [
|
|
55
|
+
/* @__PURE__ */ t("div", { className: "flex mt-0.5", children: [
|
|
56
|
+
/* @__PURE__ */ e(m, { title: o ? "Copied" : "Copy", placement: "bottom", children: /* @__PURE__ */ e(
|
|
57
57
|
"button",
|
|
58
58
|
{
|
|
59
59
|
className: c(p, "text-lg"),
|
|
60
60
|
onClick: () => h(!0),
|
|
61
|
-
children:
|
|
61
|
+
children: o ? /* @__PURE__ */ e(S, { className: "text-emerald-500" }) : /* @__PURE__ */ e(w, {})
|
|
62
62
|
}
|
|
63
63
|
) }),
|
|
64
64
|
/* @__PURE__ */ e(m, { title: "Good response", placement: "bottom", children: /* @__PURE__ */ e(
|
|
@@ -78,7 +78,7 @@ const g = [
|
|
|
78
78
|
}
|
|
79
79
|
) })
|
|
80
80
|
] }),
|
|
81
|
-
/* @__PURE__ */
|
|
81
|
+
/* @__PURE__ */ t(
|
|
82
82
|
W,
|
|
83
83
|
{
|
|
84
84
|
isOpen: r.open,
|
|
@@ -86,7 +86,7 @@ const g = [
|
|
|
86
86
|
onRequestClose: a,
|
|
87
87
|
children: [
|
|
88
88
|
/* @__PURE__ */ e("h5", { className: "mb-4", children: "Feedback" }),
|
|
89
|
-
/* @__PURE__ */
|
|
89
|
+
/* @__PURE__ */ t(B, { onSubmit: f, children: [
|
|
90
90
|
r.type === "praise" && /* @__PURE__ */ e(u, { label: "Please provide details: (optional)", children: /* @__PURE__ */ e(
|
|
91
91
|
y,
|
|
92
92
|
{
|
|
@@ -95,15 +95,15 @@ const g = [
|
|
|
95
95
|
placeholder: "What was statifying about this response?"
|
|
96
96
|
}
|
|
97
97
|
) }),
|
|
98
|
-
r.type === "blame" && /* @__PURE__ */
|
|
98
|
+
r.type === "blame" && /* @__PURE__ */ t(v, { children: [
|
|
99
99
|
/* @__PURE__ */ e(u, { label: "What type of issue do you wish to report? (optional)", children: /* @__PURE__ */ e(
|
|
100
100
|
P,
|
|
101
101
|
{
|
|
102
102
|
options: g,
|
|
103
103
|
value: g.filter(
|
|
104
|
-
(
|
|
104
|
+
(l) => l.value === k
|
|
105
105
|
),
|
|
106
|
-
onChange: (
|
|
106
|
+
onChange: (l) => T(l?.value || "")
|
|
107
107
|
}
|
|
108
108
|
) }),
|
|
109
109
|
/* @__PURE__ */ e(u, { label: "Please provide details: (optional)", children: /* @__PURE__ */ e(
|
|
@@ -116,7 +116,7 @@ const g = [
|
|
|
116
116
|
) })
|
|
117
117
|
] })
|
|
118
118
|
] }),
|
|
119
|
-
/* @__PURE__ */
|
|
119
|
+
/* @__PURE__ */ t("div", { className: "flex justify-end gap-2", children: [
|
|
120
120
|
/* @__PURE__ */ e(
|
|
121
121
|
C,
|
|
122
122
|
{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ChatCustomAction.js","sources":["../../../../../../../lib/@ecme/views/concepts/ai/Chat/components/ChatCustomAction.tsx"],"sourcesContent":["import { useRef, useState, useEffect } from 'react'\nimport Button from '@/components/ui/Button'\nimport Input from '@/components/ui/Input'\nimport Select from '@/components/ui/Select'\nimport Notification from '@/components/ui/Notification'\nimport toast from '@/components/ui/toast'\nimport { Form, FormItem } from '@/components/ui/Form'\nimport Dialog from '@/components/ui/Dialog'\nimport Tooltip from '@/components/ui/Tooltip'\nimport classNames from '@/utils/classNames'\nimport {\n TbThumbUp,\n TbThumbUpFilled,\n TbThumbDown,\n TbThumbDownFilled,\n TbCopy,\n TbCheck,\n} from 'react-icons/tb'\n\ntype ChatCustomActionProps = {\n content: string\n}\n\nconst responseOption = [\n { label: 'Not factually correct', value: 'notFactuallyCorrect' },\n { label: 'Harmful content', value: 'harmfulContent' },\n { label: 'Overeactive refusal', value: 'overeactiveRefusal' },\n { label: 'Other', value: 'other' },\n]\n\nconst ChatCustomAction = ({ content }: ChatCustomActionProps) => {\n const detailInput = useRef<HTMLTextAreaElement>(null)\n const [copied, setCopied] = useState(false)\n const [selected, setSelected] = useState('')\n const [responseSend, setResponSend] = useState('')\n const [responseDialog, setResponseDialog] = useState<{\n type: string\n open: boolean\n }>({\n type: '',\n open: false,\n })\n\n const btnClass =\n 'p-2 rounded-full hover:bg-black hover:bg-opacity-5 hover:text-gray-900 dark:hover:bg-black dark:hover:text-gray-100 dark:hover:bg-opacity-40 transition-colors duration-300 ease-in-out'\n\n useEffect(() => {\n if (copied && content) {\n navigator.clipboard.writeText(content)\n if (copied) {\n const copyFeedbackInterval = setTimeout(\n () => setCopied(false),\n 2000,\n )\n\n return () => {\n clearTimeout(copyFeedbackInterval)\n }\n }\n }\n }, [copied, content])\n\n const handleDialogClose = () => {\n setResponseDialog({\n type: '',\n open: false,\n })\n }\n\n const handleSubmit = () => {\n setResponSend(responseDialog.type)\n handleDialogClose()\n toast.push(\n <Notification type=\"success\">\n Thanks for your feedback!\n </Notification>,\n { placement: 'top-center' },\n )\n }\n\n return (\n <>\n <div className=\"flex mt-0.5\">\n <Tooltip title={copied ? 'Copied' : 'Copy'} placement=\"bottom\">\n <button\n className={classNames(btnClass, 'text-lg')}\n onClick={() => setCopied(true)}\n >\n {copied ? (\n <TbCheck className=\"text-emerald-500\" />\n ) : (\n <TbCopy />\n )}\n </button>\n </Tooltip>\n <Tooltip title=\"Good response\" placement=\"bottom\">\n <button\n className={classNames(btnClass, 'text-lg')}\n onClick={() =>\n setResponseDialog({ type: 'praise', open: true })\n }\n >\n {responseSend === 'praise' ? (\n <TbThumbUpFilled />\n ) : (\n <TbThumbUp />\n )}\n </button>\n </Tooltip>\n <Tooltip title=\"Bad response\" placement=\"bottom\">\n <button\n className={classNames(btnClass, 'text-lg')}\n onClick={() =>\n setResponseDialog({ type: 'blame', open: true })\n }\n >\n {responseSend === 'blame' ? (\n <TbThumbDownFilled />\n ) : (\n <TbThumbDown />\n )}\n </button>\n </Tooltip>\n </div>\n <Dialog\n isOpen={responseDialog.open}\n onClose={handleDialogClose}\n onRequestClose={handleDialogClose}\n >\n <h5 className=\"mb-4\">Feedback</h5>\n <Form onSubmit={handleSubmit}>\n {responseDialog.type === 'praise' && (\n <FormItem label=\"Please provide details: (optional)\">\n <Input\n ref={detailInput}\n textArea\n placeholder=\"What was statifying about this response?\"\n />\n </FormItem>\n )}\n {responseDialog.type === 'blame' && (\n <>\n <FormItem label=\"What type of issue do you wish to report? (optional)\">\n <Select\n options={responseOption}\n value={responseOption.filter(\n (response) =>\n response.value === selected,\n )}\n onChange={(option) =>\n setSelected(option?.value || '')\n }\n />\n </FormItem>\n <FormItem label=\"Please provide details: (optional)\">\n <Input\n ref={detailInput}\n textArea\n placeholder=\"What was unstatifying about this response?\"\n />\n </FormItem>\n </>\n )}\n </Form>\n <div className=\"flex justify-end gap-2\">\n <Button\n className=\"ltr:mr-2 rtl:ml-2\"\n variant=\"plain\"\n type=\"button\"\n onClick={handleDialogClose}\n >\n Cancel\n </Button>\n <Button\n variant=\"solid\"\n type=\"submit\"\n onClick={handleSubmit}\n >\n Submit\n </Button>\n </div>\n </Dialog>\n </>\n )\n}\n\nexport default ChatCustomAction\n"],"names":["responseOption","ChatCustomAction","content","detailInput","useRef","copied","setCopied","useState","selected","setSelected","responseSend","setResponSend","responseDialog","setResponseDialog","btnClass","useEffect","copyFeedbackInterval","handleDialogClose","handleSubmit","toast","jsx","Notification","jsxs","Fragment","Tooltip","classNames","TbCheck","TbCopy","TbThumbUpFilled","TbThumbUp","TbThumbDownFilled","TbThumbDown","Dialog","Form","FormItem","Input","Select","response","option","Button"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAuBA,MAAMA,IAAiB;AAAA,EACnB,EAAE,OAAO,yBAAyB,OAAO,sBAAA;AAAA,EACzC,EAAE,OAAO,mBAAmB,OAAO,iBAAA;AAAA,EACnC,EAAE,OAAO,uBAAuB,OAAO,qBAAA;AAAA,EACvC,EAAE,OAAO,SAAS,OAAO,QAAA;AAC7B,GAEMC,KAAmB,CAAC,EAAE,SAAAC,QAAqC;AAC7D,QAAMC,IAAcC,EAA4B,IAAI,GAC9C,CAACC,GAAQC,CAAS,IAAIC,EAAS,EAAK,GACpC,CAACC,GAAUC,CAAW,IAAIF,EAAS,EAAE,GACrC,CAACG,GAAcC,CAAa,IAAIJ,EAAS,EAAE,GAC3C,CAACK,GAAgBC,CAAiB,IAAIN,EAGzC;AAAA,IACC,MAAM;AAAA,IACN,MAAM;AAAA,EAAA,CACT,GAEKO,IACF;AAEJ,EAAAC,EAAU,MAAM;AACZ,QAAIV,KAAUH,MACV,UAAU,UAAU,UAAUA,CAAO,GACjCG,IAAQ;AACR,YAAMW,IAAuB;AAAA,QACzB,MAAMV,EAAU,EAAK;AAAA,QACrB;AAAA,MAAA;AAGJ,aAAO,MAAM;AACT,qBAAaU,CAAoB;AAAA,MACrC;AAAA,IACJ;AAAA,EAER,GAAG,CAACX,GAAQH,CAAO,CAAC;AAEpB,QAAMe,IAAoB,MAAM;AAC5B,IAAAJ,EAAkB;AAAA,MACd,MAAM;AAAA,MACN,MAAM;AAAA,IAAA,CACT;AAAA,EACL,GAEMK,IAAe,MAAM;AACvB,IAAAP,EAAcC,EAAe,IAAI,GACjCK,EAAA,GACAE,EAAM;AAAA,MACF,gBAAAC,EAACC,GAAA,EAAa,MAAK,WAA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ACR,MAAK;AAAA,gBACL,SAASrB;AAAA,gBACZ,UAAA;AAAA,cAAA;AAAA,YAAA;AAAA,UAED,EAAA,CACJ;AAAA,QAAA;AAAA,MAAA;AAAA,IAAA;AAAA,EACJ,GACJ;AAER;"}
|
|
1
|
+
{"version":3,"file":"ChatCustomAction.js","sources":["../../../../../../../lib/@ecme/views/concepts/ai/Chat/components/ChatCustomAction.tsx"],"sourcesContent":["import { useRef, useState, useEffect } from 'react'\nimport Button from '@/components/ui/Button'\nimport Input from '@/components/ui/Input'\nimport Select from '@/components/ui/Select'\nimport Notification from '@/components/ui/Notification'\nimport toast from '@/components/ui/toast'\nimport { Form, FormItem } from '@/components/ui/Form'\nimport Dialog from '@/components/ui/Dialog'\nimport Tooltip from '@/components/ui/Tooltip'\nimport classNames from '@/utils/classNames'\nimport {\n TbThumbUp,\n TbThumbUpFilled,\n TbThumbDown,\n TbThumbDownFilled,\n TbCopy,\n TbCheck,\n} from 'react-icons/tb'\n\ntype ChatCustomActionProps = {\n content: string\n}\n\nconst responseOption = [\n { label: 'Not factually correct', value: 'notFactuallyCorrect' },\n { label: 'Harmful content', value: 'harmfulContent' },\n { label: 'Overeactive refusal', value: 'overeactiveRefusal' },\n { label: 'Other', value: 'other' },\n]\n\nconst ChatCustomAction = ({ content }: ChatCustomActionProps) => {\n const detailInput = useRef<HTMLTextAreaElement>(null)\n const [copied, setCopied] = useState(false)\n const [selected, setSelected] = useState('')\n const [responseSend, setResponSend] = useState('')\n const [responseDialog, setResponseDialog] = useState<{\n type: string\n open: boolean\n }>({\n type: '',\n open: false,\n })\n\n const btnClass =\n 'p-2 rounded-full hover:bg-black hover:bg-opacity-5 hover:text-gray-900 dark:hover:bg-black dark:hover:text-gray-100 dark:hover:bg-opacity-40 transition-colors duration-300 ease-in-out'\n\n useEffect(() => {\n if (copied && content) {\n navigator.clipboard.writeText(content)\n if (copied) {\n const copyFeedbackInterval = setTimeout(\n () => setCopied(false),\n 2000,\n )\n\n return () => {\n clearTimeout(copyFeedbackInterval)\n }\n }\n }\n }, [copied, content])\n\n const handleDialogClose = () => {\n setResponseDialog({\n type: '',\n open: false,\n })\n }\n\n const handleSubmit = () => {\n setResponSend(responseDialog.type)\n handleDialogClose()\n toast.push(\n <Notification type=\"success\">\n Thanks for your feedback!\n </Notification>,\n { placement: 'top-center' },\n )\n }\n\n return (\n <>\n <div className=\"flex mt-0.5\">\n <Tooltip title={copied ? 'Copied' : 'Copy'} placement=\"bottom\">\n <button\n className={classNames(btnClass, 'text-lg')}\n onClick={() => setCopied(true)}\n >\n {copied ? (\n <TbCheck className=\"text-emerald-500\" />\n ) : (\n <TbCopy />\n )}\n </button>\n </Tooltip>\n <Tooltip title=\"Good response\" placement=\"bottom\">\n <button\n className={classNames(btnClass, 'text-lg')}\n onClick={() =>\n setResponseDialog({ type: 'praise', open: true })\n }\n >\n {responseSend === 'praise' ? (\n <TbThumbUpFilled />\n ) : (\n <TbThumbUp />\n )}\n </button>\n </Tooltip>\n <Tooltip title=\"Bad response\" placement=\"bottom\">\n <button\n className={classNames(btnClass, 'text-lg')}\n onClick={() =>\n setResponseDialog({ type: 'blame', open: true })\n }\n >\n {responseSend === 'blame' ? (\n <TbThumbDownFilled />\n ) : (\n <TbThumbDown />\n )}\n </button>\n </Tooltip>\n </div>\n <Dialog\n isOpen={responseDialog.open}\n onClose={handleDialogClose}\n onRequestClose={handleDialogClose}\n >\n <h5 className=\"mb-4\">Feedback</h5>\n <Form onSubmit={handleSubmit}>\n {responseDialog.type === 'praise' && (\n <FormItem label=\"Please provide details: (optional)\">\n <Input\n ref={detailInput}\n textArea\n placeholder=\"What was statifying about this response?\"\n />\n </FormItem>\n )}\n {responseDialog.type === 'blame' && (\n <>\n <FormItem label=\"What type of issue do you wish to report? (optional)\">\n <Select\n options={responseOption}\n value={responseOption.filter(\n (response) =>\n response.value === selected,\n )}\n onChange={(option) =>\n setSelected(option?.value || '')\n }\n />\n </FormItem>\n <FormItem label=\"Please provide details: (optional)\">\n <Input\n ref={detailInput}\n textArea\n placeholder=\"What was unstatifying about this response?\"\n />\n </FormItem>\n </>\n )}\n </Form>\n <div className=\"flex justify-end gap-2\">\n <Button\n className=\"ltr:mr-2 rtl:ml-2\"\n variant=\"plain\"\n type=\"button\"\n onClick={handleDialogClose}\n >\n Cancel\n </Button>\n <Button\n variant=\"solid\"\n type=\"submit\"\n onClick={handleSubmit}\n >\n Submit\n </Button>\n </div>\n </Dialog>\n </>\n )\n}\n\nexport default ChatCustomAction\n"],"names":["responseOption","ChatCustomAction","content","detailInput","useRef","copied","setCopied","useState","selected","setSelected","responseSend","setResponSend","responseDialog","setResponseDialog","btnClass","useEffect","copyFeedbackInterval","handleDialogClose","handleSubmit","toast","jsx","Notification","jsxs","Fragment","Tooltip","classNames","TbCheck","TbCopy","TbThumbUpFilled","TbThumbUp","TbThumbDownFilled","TbThumbDown","Dialog","Form","FormItem","Input","Select","response","option","Button"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAuBA,MAAMA,IAAiB;AAAA,EACnB,EAAE,OAAO,yBAAyB,OAAO,sBAAA;AAAA,EACzC,EAAE,OAAO,mBAAmB,OAAO,iBAAA;AAAA,EACnC,EAAE,OAAO,uBAAuB,OAAO,qBAAA;AAAA,EACvC,EAAE,OAAO,SAAS,OAAO,QAAA;AAC7B,GAEMC,KAAmB,CAAC,EAAE,SAAAC,QAAqC;AAC7D,QAAMC,IAAcC,EAA4B,IAAI,GAC9C,CAACC,GAAQC,CAAS,IAAIC,EAAS,EAAK,GACpC,CAACC,GAAUC,CAAW,IAAIF,EAAS,EAAE,GACrC,CAACG,GAAcC,CAAa,IAAIJ,EAAS,EAAE,GAC3C,CAACK,GAAgBC,CAAiB,IAAIN,EAGzC;AAAA,IACC,MAAM;AAAA,IACN,MAAM;AAAA,EAAA,CACT,GAEKO,IACF;AAEJ,EAAAC,EAAU,MAAM;AACZ,QAAIV,KAAUH,MACV,UAAU,UAAU,UAAUA,CAAO,GACjCG,IAAQ;AACR,YAAMW,IAAu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,kBACR,aAAY;AAAA,gBAAA;AAAA,cAAA,EAChB,CACJ;AAAA,YAAA,EAAA,CACJ;AAAA,UAAA,GAER;AAAA,UACA,gBAAAmB,EAAC,OAAA,EAAI,WAAU,0BACX,UAAA;AAAA,YAAA,gBAAAF;AAAA,cAACmB;AAAA,cAAA;AAAA,gBACG,WAAU;AAAA,gBACV,SAAQ;AAAA,gBACR,MAAK;AAAA,gBACL,SAAStB;AAAA,gBACZ,UAAA;AAAA,cAAA;AAAA,YAAA;AAAA,YAGD,gBAAAG;AAAA,cAACmB;AAAA,cAAA;AAAA,gBACG,SAAQ;AAAA,gBACR,MAAK;AAAA,gBACL,SAASrB;AAAA,gBACZ,UAAA;AAAA,cAAA;AAAA,YAAA;AAAA,UAED,EAAA,CACJ;AAAA,QAAA;AAAA,MAAA;AAAA,IAAA;AAAA,EACJ,GACJ;AAER;"}
|
|
@@ -1,111 +1,109 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { useState as
|
|
3
|
-
import
|
|
4
|
-
import { getCurrentNodeOverflow as
|
|
5
|
-
import
|
|
6
|
-
import { marked as
|
|
7
|
-
const
|
|
8
|
-
children:
|
|
9
|
-
delay:
|
|
10
|
-
onFinish:
|
|
1
|
+
import { jsx as A, Fragment as a } from "react/jsx-runtime";
|
|
2
|
+
import { useState as k, useMemo as h, createElement as j, useEffect as v } from "react";
|
|
3
|
+
import b from "../../../../../utils/hooks/useInterval .js";
|
|
4
|
+
import { getCurrentNodeOverflow as c, getStringPosition as g } from "../utils.js";
|
|
5
|
+
import E from "html-react-parser";
|
|
6
|
+
import { marked as L } from "marked";
|
|
7
|
+
const T = ({
|
|
8
|
+
children: f,
|
|
9
|
+
delay: l = 25,
|
|
10
|
+
onFinish: m = () => {
|
|
11
11
|
}
|
|
12
12
|
}) => {
|
|
13
|
-
const [
|
|
14
|
-
const
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
}), t === void 0 && typeof r == "string" && n.push(r.split(" ").length), typeof t == "object" && s(t), typeof t == "string" && n.push(t.split(" ").length), n;
|
|
13
|
+
const [o, y] = k(0), u = h(() => {
|
|
14
|
+
const r = [], n = (i) => {
|
|
15
|
+
const t = i?.props?.children;
|
|
16
|
+
return Array.isArray(i) && i.forEach((s) => {
|
|
17
|
+
typeof s == "object" ? n(s) : typeof s == "string" && r.push(s.split(" ").length);
|
|
18
|
+
}), t === void 0 && typeof i == "string" && r.push(i.split(" ").length), typeof t == "object" && n(t), typeof t == "string" && r.push(t.split(" ").length), r;
|
|
20
19
|
};
|
|
21
|
-
return
|
|
22
|
-
}, [
|
|
23
|
-
() =>
|
|
24
|
-
[
|
|
25
|
-
),
|
|
26
|
-
let
|
|
27
|
-
const
|
|
28
|
-
|
|
29
|
-
if (n > p)
|
|
20
|
+
return n(f);
|
|
21
|
+
}, [f]), C = h(
|
|
22
|
+
() => u.reduce((r, n) => r + n, 0),
|
|
23
|
+
[u]
|
|
24
|
+
), I = h(() => {
|
|
25
|
+
let r = 0, n = 0;
|
|
26
|
+
const i = (t) => {
|
|
27
|
+
if (r > o)
|
|
30
28
|
return null;
|
|
31
|
-
const
|
|
29
|
+
const s = t?.props?.children;
|
|
32
30
|
if (Array.isArray(t)) {
|
|
33
|
-
const
|
|
34
|
-
return t.forEach((
|
|
35
|
-
if (typeof
|
|
36
|
-
|
|
37
|
-
else if (typeof
|
|
38
|
-
|
|
39
|
-
const [
|
|
40
|
-
|
|
41
|
-
|
|
31
|
+
const p = [];
|
|
32
|
+
return t.forEach((e) => {
|
|
33
|
+
if (typeof e == "object")
|
|
34
|
+
p.push(i(e));
|
|
35
|
+
else if (typeof e == "string") {
|
|
36
|
+
r += e.split(" ").length, n++;
|
|
37
|
+
const [P, x] = c(u, o);
|
|
38
|
+
P < n && p.push(
|
|
39
|
+
e.slice(
|
|
42
40
|
0,
|
|
43
|
-
|
|
44
|
-
|
|
41
|
+
g(
|
|
42
|
+
e,
|
|
45
43
|
" ",
|
|
46
|
-
|
|
44
|
+
x
|
|
47
45
|
)
|
|
48
46
|
)
|
|
49
|
-
),
|
|
47
|
+
), p.push(e);
|
|
50
48
|
}
|
|
51
|
-
}),
|
|
49
|
+
}), p;
|
|
52
50
|
}
|
|
53
|
-
if (
|
|
54
|
-
|
|
55
|
-
const [
|
|
56
|
-
|
|
57
|
-
|
|
51
|
+
if (s === void 0 && typeof t == "string") {
|
|
52
|
+
r += t.split(" ").length, n++;
|
|
53
|
+
const [p, e] = c(
|
|
54
|
+
u,
|
|
55
|
+
o
|
|
58
56
|
);
|
|
59
|
-
return
|
|
57
|
+
return p < n ? t.slice(
|
|
60
58
|
0,
|
|
61
|
-
|
|
59
|
+
g(t, " ", e)
|
|
62
60
|
) : t;
|
|
63
61
|
}
|
|
64
|
-
if (typeof
|
|
65
|
-
return
|
|
62
|
+
if (typeof s == "object")
|
|
63
|
+
return j(
|
|
66
64
|
t.type,
|
|
67
|
-
t
|
|
68
|
-
|
|
65
|
+
t?.props,
|
|
66
|
+
i(s)
|
|
69
67
|
);
|
|
70
|
-
if (typeof
|
|
71
|
-
|
|
72
|
-
const [
|
|
73
|
-
|
|
74
|
-
|
|
68
|
+
if (typeof s == "string") {
|
|
69
|
+
r += s.split(" ").length, n++;
|
|
70
|
+
const [p, e] = c(
|
|
71
|
+
u,
|
|
72
|
+
o
|
|
75
73
|
);
|
|
76
|
-
return
|
|
74
|
+
return p < n ? j(
|
|
77
75
|
t.type,
|
|
78
|
-
t
|
|
79
|
-
|
|
76
|
+
t?.props,
|
|
77
|
+
s.slice(
|
|
80
78
|
0,
|
|
81
|
-
|
|
82
|
-
|
|
79
|
+
g(
|
|
80
|
+
s,
|
|
83
81
|
" ",
|
|
84
|
-
|
|
82
|
+
e
|
|
85
83
|
)
|
|
86
84
|
)
|
|
87
85
|
) : t;
|
|
88
86
|
}
|
|
89
87
|
};
|
|
90
|
-
return
|
|
91
|
-
}, [
|
|
92
|
-
return
|
|
88
|
+
return i(f);
|
|
89
|
+
}, [f, o, u]);
|
|
90
|
+
return b(
|
|
93
91
|
() => {
|
|
94
|
-
|
|
92
|
+
y((r) => (r + 1 >= C && m(), r + 1));
|
|
95
93
|
},
|
|
96
|
-
|
|
97
|
-
),
|
|
98
|
-
|
|
99
|
-
}, [
|
|
100
|
-
},
|
|
101
|
-
content:
|
|
102
|
-
triggerTyping:
|
|
103
|
-
onFinish:
|
|
94
|
+
C > o ? l : null
|
|
95
|
+
), v(() => {
|
|
96
|
+
y(0);
|
|
97
|
+
}, [f]), I;
|
|
98
|
+
}, M = ({
|
|
99
|
+
content: f = "",
|
|
100
|
+
triggerTyping: l,
|
|
101
|
+
onFinish: m
|
|
104
102
|
}) => {
|
|
105
|
-
const
|
|
106
|
-
return /* @__PURE__ */
|
|
103
|
+
const o = E(L(f));
|
|
104
|
+
return /* @__PURE__ */ A(a, { children: l ? /* @__PURE__ */ A(T, { onFinish: m, children: o }) : o });
|
|
107
105
|
};
|
|
108
106
|
export {
|
|
109
|
-
|
|
107
|
+
M as default
|
|
110
108
|
};
|
|
111
109
|
//# sourceMappingURL=ChatCustomContent.js.map
|