@antscorp/antsomi-ui 1.3.3-beta.2 → 1.3.3-beta.21
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 +78 -78
- package/dist/index.js +1 -1
- package/dist/main.css +100 -1
- package/dist/public/icons/stars_slider.png +0 -0
- package/es/assets/css/main.scss +4 -4
- package/es/assets/images/feedback.svg +3 -3
- package/es/assets/images/stars_slider.png +0 -0
- package/es/components/atoms/Alert/Alert.d.ts +4 -4
- package/es/components/atoms/Alert/Alert.js +19 -19
- package/es/components/atoms/Alert/index.d.ts +1 -1
- package/es/components/atoms/Alert/index.js +1 -1
- package/es/components/atoms/Button/Button.d.ts +1 -1
- package/es/components/atoms/Button/Button.js +1 -1
- package/es/components/atoms/Button/index.d.ts +4 -4
- package/es/components/atoms/Button/index.js +2 -2
- package/es/components/atoms/Button/test.d.ts +3 -3
- package/es/components/atoms/Button/test.js +99 -99
- package/es/components/atoms/Checkbox/Checkbox.d.ts +1 -1
- package/es/components/atoms/Checkbox/Checkbox.js +1 -1
- package/es/components/atoms/Checkbox/index.d.ts +1 -1
- package/es/components/atoms/Checkbox/index.js +1 -1
- package/es/components/atoms/Divider/Divider.d.ts +1 -1
- package/es/components/atoms/Divider/Divider.js +1 -1
- package/es/components/atoms/Divider/index.d.ts +1 -1
- package/es/components/atoms/Divider/index.js +1 -1
- package/es/components/atoms/DividerPure/DividerPure.d.ts +10 -10
- package/es/components/atoms/DividerPure/DividerPure.js +27 -27
- package/es/components/atoms/DividerPure/index.d.ts +1 -1
- package/es/components/atoms/DividerPure/index.js +1 -1
- package/es/components/atoms/DividerPure/styled.d.ts +1 -1
- package/es/components/atoms/DividerPure/styled.js +41 -41
- package/es/components/atoms/Empty/Empty.d.ts +5 -5
- package/es/components/atoms/Empty/Empty.js +2 -2
- package/es/components/atoms/Empty/index.d.ts +1 -1
- package/es/components/atoms/Empty/index.js +1 -1
- package/es/components/atoms/Flex/Flex.d.ts +2 -0
- package/es/components/atoms/Flex/Flex.js +1 -0
- package/es/components/atoms/Flex/index.d.ts +1 -0
- package/es/components/atoms/Flex/index.js +1 -0
- package/es/components/atoms/FloatButton/FloatButton.d.ts +1 -1
- package/es/components/atoms/FloatButton/FloatButton.js +1 -1
- package/es/components/atoms/FloatButton/index.d.ts +1 -1
- package/es/components/atoms/FloatButton/index.js +2 -2
- package/es/components/atoms/Grid/Grid.d.ts +3 -3
- package/es/components/atoms/Grid/Grid.js +3 -3
- package/es/components/atoms/Grid/index.d.ts +1 -1
- package/es/components/atoms/Grid/index.js +1 -1
- package/es/components/atoms/Icon/index.d.ts +10 -10
- package/es/components/atoms/Icon/index.js +36 -36
- package/es/components/atoms/Input/Input.d.ts +28 -20
- package/es/components/atoms/Input/Input.js +95 -92
- package/es/components/atoms/Input/index.d.ts +2 -2
- package/es/components/atoms/Input/index.js +1 -1
- package/es/components/atoms/Input/styled.d.ts +11 -11
- package/es/components/atoms/Input/styled.js +109 -109
- package/es/components/atoms/InputNumber/InputNumber.d.ts +6 -6
- package/es/components/atoms/InputNumber/InputNumber.js +27 -27
- package/es/components/atoms/InputNumber/index.d.ts +1 -1
- package/es/components/atoms/InputNumber/index.js +1 -1
- package/es/components/atoms/Message/Message.d.ts +1 -1
- package/es/components/atoms/Message/Message.js +1 -1
- package/es/components/atoms/Message/index.d.ts +1 -1
- package/es/components/atoms/Message/index.js +1 -1
- package/es/components/atoms/Notification/Notification.d.ts +1 -1
- package/es/components/atoms/Notification/Notification.js +1 -1
- package/es/components/atoms/Notification/index.d.ts +1 -1
- package/es/components/atoms/Notification/index.js +1 -1
- package/es/components/atoms/Pagination/Pagination.d.ts +2 -2
- package/es/components/atoms/Pagination/Pagination.js +2 -2
- package/es/components/atoms/Pagination/index.d.ts +1 -1
- package/es/components/atoms/Pagination/index.js +1 -1
- package/es/components/atoms/Popover/Popover.d.ts +4 -4
- package/es/components/atoms/Popover/Popover.js +2 -2
- package/es/components/atoms/Popover/index.d.ts +1 -1
- package/es/components/atoms/Popover/index.js +1 -1
- package/es/components/atoms/Popover/styled.d.ts +4 -4
- package/es/components/atoms/Popover/styled.js +5 -5
- package/es/components/atoms/Progress/Progress.d.ts +2 -2
- package/es/components/atoms/Progress/Progress.js +2 -2
- package/es/components/atoms/Progress/index.d.ts +1 -1
- package/es/components/atoms/Progress/index.js +1 -1
- package/es/components/atoms/Radio/Radio.d.ts +1 -1
- package/es/components/atoms/Radio/Radio.js +1 -1
- package/es/components/atoms/Radio/index.d.ts +7 -7
- package/es/components/atoms/Radio/index.js +25 -25
- package/es/components/atoms/Rate/Rate.d.ts +2 -2
- package/es/components/atoms/Rate/Rate.js +2 -2
- package/es/components/atoms/Rate/index.d.ts +1 -1
- package/es/components/atoms/Rate/index.js +1 -1
- package/es/components/atoms/RateV2/RateV2.d.ts +18 -0
- package/es/components/atoms/RateV2/RateV2.js +73 -0
- package/es/components/atoms/RateV2/index.d.ts +1 -0
- package/es/components/atoms/RateV2/index.js +1 -0
- package/es/components/atoms/RequiredLabel/index.d.ts +7 -7
- package/es/components/atoms/RequiredLabel/index.js +24 -24
- package/es/components/atoms/RequiredLabel/styled.d.ts +2 -2
- package/es/components/atoms/RequiredLabel/styled.js +10 -10
- package/es/components/atoms/ScrollBox/index.d.ts +9 -9
- package/es/components/atoms/ScrollBox/index.js +51 -51
- package/es/components/atoms/Segmented/Segmented.d.ts +2 -2
- package/es/components/atoms/Segmented/Segmented.js +2 -2
- package/es/components/atoms/Segmented/index.d.ts +1 -1
- package/es/components/atoms/Segmented/index.js +1 -1
- package/es/components/atoms/Skeleton/Skeleton.d.ts +8 -8
- package/es/components/atoms/Skeleton/Skeleton.js +2 -2
- package/es/components/atoms/Skeleton/index.d.ts +1 -1
- package/es/components/atoms/Skeleton/index.js +1 -1
- package/es/components/atoms/Slider/index.d.ts +6 -5
- package/es/components/atoms/Slider/index.js +25 -32
- package/es/components/atoms/Slider/styled.d.ts +7 -7
- package/es/components/atoms/Slider/styled.js +44 -44
- package/es/components/atoms/SliderV2/index.d.ts +6 -0
- package/es/components/atoms/SliderV2/index.js +21 -0
- package/es/components/atoms/Space/Space.d.ts +6 -6
- package/es/components/atoms/Space/Space.js +9 -9
- package/es/components/atoms/Space/index.d.ts +1 -1
- package/es/components/atoms/Space/index.js +1 -1
- package/es/components/atoms/Spin/Spin.d.ts +10 -9
- package/es/components/atoms/Spin/Spin.js +28 -28
- package/es/components/atoms/Spin/index.d.ts +1 -1
- package/es/components/atoms/Spin/index.js +1 -1
- package/es/components/atoms/Spin/styled.d.ts +1 -1
- package/es/components/atoms/Spin/styled.js +7 -7
- package/es/components/atoms/Statistic/Statistic.d.ts +1 -1
- package/es/components/atoms/Statistic/Statistic.js +2 -2
- package/es/components/atoms/Statistic/index.d.ts +1 -1
- package/es/components/atoms/Statistic/index.js +1 -1
- package/es/components/atoms/Steps/Steps.d.ts +4 -4
- package/es/components/atoms/Steps/Steps.js +2 -2
- package/es/components/atoms/Steps/index.d.ts +1 -1
- package/es/components/atoms/Steps/index.js +1 -1
- package/es/components/atoms/Switch/Switch.d.ts +2 -2
- package/es/components/atoms/Switch/Switch.js +2 -2
- package/es/components/atoms/Switch/index.d.ts +1 -1
- package/es/components/atoms/Switch/index.js +1 -1
- package/es/components/atoms/Tag/Tag.d.ts +1 -1
- package/es/components/atoms/Tag/Tag.js +1 -1
- package/es/components/atoms/Tag/index.d.ts +1 -1
- package/es/components/atoms/Tag/index.js +1 -1
- package/es/components/atoms/Text/index.d.ts +10 -10
- package/es/components/atoms/Text/index.js +27 -27
- package/es/components/atoms/Text/styled.d.ts +7 -7
- package/es/components/atoms/Text/styled.js +52 -52
- package/es/components/atoms/Timeline/Timeline.d.ts +4 -4
- package/es/components/atoms/Timeline/Timeline.js +2 -2
- package/es/components/atoms/Timeline/index.d.ts +1 -1
- package/es/components/atoms/Timeline/index.js +1 -1
- package/es/components/atoms/Tooltip/Tooltip.d.ts +1 -1
- package/es/components/atoms/Tooltip/Tooltip.js +1 -1
- package/es/components/atoms/Tooltip/index.d.ts +1 -1
- package/es/components/atoms/Tooltip/index.js +1 -1
- package/es/components/atoms/Typography/Text.d.ts +1 -1
- package/es/components/atoms/Typography/Text.js +1 -1
- package/es/components/atoms/Typography/index.d.ts +1 -1
- package/es/components/atoms/Typography/index.js +1 -1
- package/es/components/atoms/Watermark/Watermark.d.ts +2 -2
- package/es/components/atoms/Watermark/Watermark.js +2 -2
- package/es/components/atoms/Watermark/index.d.ts +1 -1
- package/es/components/atoms/Watermark/index.js +1 -1
- package/es/components/atoms/index.d.ts +36 -33
- package/es/components/atoms/index.js +35 -32
- package/es/components/common/ConfigProvider/ConfigProvider.d.ts +10 -10
- package/es/components/common/ConfigProvider/ConfigProvider.js +42 -42
- package/es/components/common/ConfigProvider/GlobalStyle.d.ts +5 -5
- package/es/components/common/ConfigProvider/GlobalStyle.js +527 -490
- package/es/components/common/ConfigProvider/index.d.ts +1 -1
- package/es/components/common/ConfigProvider/index.js +1 -1
- package/es/components/common/index.d.ts +1 -1
- package/es/components/common/index.js +1 -1
- package/es/components/icons/AccountCircle.d.ts +3 -3
- package/es/components/icons/AccountCircle.js +3 -3
- package/es/components/icons/AddShoppingCart.d.ts +3 -3
- package/es/components/icons/AddShoppingCart.js +3 -3
- package/es/components/icons/ArrowGrowIcon.d.ts +2 -1
- package/es/components/icons/ArrowGrowIcon.js +4 -4
- package/es/components/icons/AssignmentInd.d.ts +3 -3
- package/es/components/icons/AssignmentInd.js +3 -3
- package/es/components/icons/AudioRecordIcon.d.ts +2 -1
- package/es/components/icons/AudioRecordIcon.js +4 -4
- package/es/components/icons/BugIcon.d.ts +2 -1
- package/es/components/icons/BugIcon.js +4 -4
- package/es/components/icons/Call.d.ts +3 -3
- package/es/components/icons/Call.js +3 -3
- package/es/components/icons/CameraIcon.d.ts +2 -1
- package/es/components/icons/CameraIcon.js +4 -4
- package/es/components/icons/CaptureIcon.d.ts +2 -1
- package/es/components/icons/CaptureIcon.js +4 -4
- package/es/components/icons/Category.d.ts +3 -3
- package/es/components/icons/Category.js +5 -5
- package/es/components/icons/ChatBubbleOutline.d.ts +3 -3
- package/es/components/icons/ChatBubbleOutline.js +3 -3
- package/es/components/icons/CheckSlimIcon.d.ts +2 -1
- package/es/components/icons/CheckSlimIcon.js +4 -4
- package/es/components/icons/CircleNotifications.d.ts +3 -3
- package/es/components/icons/CircleNotifications.js +3 -3
- package/es/components/icons/CloseIcon.d.ts +4 -3
- package/es/components/icons/CloseIcon.js +22 -22
- package/es/components/icons/CommentIcon.d.ts +2 -1
- package/es/components/icons/CommentIcon.js +4 -4
- package/es/components/icons/ConfirmationNumber.d.ts +3 -3
- package/es/components/icons/ConfirmationNumber.js +3 -3
- package/es/components/icons/DesktopWindows.d.ts +3 -3
- package/es/components/icons/DesktopWindows.js +3 -3
- package/es/components/icons/EventIcon.d.ts +4 -3
- package/es/components/icons/EventIcon.js +18 -18
- package/es/components/icons/FactCheck.d.ts +3 -3
- package/es/components/icons/FactCheck.js +3 -3
- package/es/components/icons/FreeDrawIcon.d.ts +2 -1
- package/es/components/icons/FreeDrawIcon.js +4 -4
- package/es/components/icons/GPTIcon.d.ts +2 -1
- package/es/components/icons/GPTIcon.js +18 -18
- package/es/components/icons/GPTIconV2.d.ts +2 -1
- package/es/components/icons/GPTIconV2.js +18 -18
- package/es/components/icons/GPTIconV3.d.ts +2 -1
- package/es/components/icons/GPTIconV3.js +5 -5
- package/es/components/icons/HighlightIcon.d.ts +2 -1
- package/es/components/icons/HighlightIcon.js +4 -4
- package/es/components/icons/HightlightAlt.d.ts +3 -3
- package/es/components/icons/HightlightAlt.js +3 -3
- package/es/components/icons/HowToReg.d.ts +3 -3
- package/es/components/icons/HowToReg.js +3 -3
- package/es/components/icons/IdeaIcon.d.ts +2 -1
- package/es/components/icons/IdeaIcon.js +4 -4
- package/es/components/icons/Interactive.d.ts +3 -3
- package/es/components/icons/Interactive.js +3 -3
- package/es/components/icons/InvisibleIcon.d.ts +2 -1
- package/es/components/icons/InvisibleIcon.js +5 -5
- package/es/components/icons/List.d.ts +3 -3
- package/es/components/icons/List.js +3 -3
- package/es/components/icons/LocalMallIcon.d.ts +3 -3
- package/es/components/icons/LocalMallIcon.js +3 -3
- package/es/components/icons/MobileFriendly.d.ts +3 -3
- package/es/components/icons/MobileFriendly.js +3 -3
- package/es/components/icons/MuteIcon.d.ts +2 -1
- package/es/components/icons/MuteIcon.js +4 -4
- package/es/components/icons/NotificationsActive.d.ts +3 -3
- package/es/components/icons/NotificationsActive.js +3 -3
- package/es/components/icons/OpenUrlIcon.d.ts +2 -1
- package/es/components/icons/OpenUrlIcon.js +4 -4
- package/es/components/icons/PauseIcon.d.ts +2 -1
- package/es/components/icons/PauseIcon.js +4 -4
- package/es/components/icons/Payment.d.ts +3 -3
- package/es/components/icons/Payment.js +3 -3
- package/es/components/icons/PersonAddDisabled.d.ts +3 -3
- package/es/components/icons/PersonAddDisabled.js +4 -4
- package/es/components/icons/PhoneCallback.d.ts +3 -3
- package/es/components/icons/PhoneCallback.js +3 -3
- package/es/components/icons/PlaneIcon.d.ts +2 -1
- package/es/components/icons/PlaneIcon.js +8 -8
- package/es/components/icons/Preview.d.ts +3 -3
- package/es/components/icons/Preview.js +3 -3
- package/es/components/icons/Redeem.d.ts +3 -3
- package/es/components/icons/Redeem.js +3 -3
- package/es/components/icons/RemoveRedEye.d.ts +3 -3
- package/es/components/icons/RemoveRedEye.js +3 -3
- package/es/components/icons/RemoveShoppingCart.d.ts +3 -3
- package/es/components/icons/RemoveShoppingCart.js +3 -3
- package/es/components/icons/RequestIcon.d.ts +2 -1
- package/es/components/icons/RequestIcon.js +4 -4
- package/es/components/icons/Search.d.ts +3 -3
- package/es/components/icons/Search.js +3 -3
- package/es/components/icons/ShoppingBag.d.ts +3 -3
- package/es/components/icons/ShoppingBag.js +3 -3
- package/es/components/icons/ShoppingCart.d.ts +3 -3
- package/es/components/icons/ShoppingCart.js +3 -3
- package/es/components/icons/StopRecordIcon.d.ts +2 -1
- package/es/components/icons/StopRecordIcon.js +4 -4
- package/es/components/icons/Store.d.ts +3 -3
- package/es/components/icons/Store.js +3 -3
- package/es/components/icons/UserIcon.d.ts +2 -1
- package/es/components/icons/UserIcon.js +8 -8
- package/es/components/icons/VerticalDotsIcon.d.ts +2 -1
- package/es/components/icons/VerticalDotsIcon.js +4 -4
- package/es/components/icons/WarningIcon.d.ts +2 -1
- package/es/components/icons/WarningIcon.js +4 -4
- package/es/components/icons/Web.d.ts +3 -3
- package/es/components/icons/Web.js +3 -3
- package/es/components/icons/WebAsset.d.ts +3 -3
- package/es/components/icons/WebAsset.js +3 -3
- package/es/components/icons/index.d.ts +54 -54
- package/es/components/icons/index.js +54 -54
- package/es/components/icons/type.d.ts +3 -3
- package/es/components/icons/type.js +1 -1
- package/es/components/index.d.ts +4 -4
- package/es/components/index.js +4 -4
- package/es/components/molecules/AlignSetting/index.d.ts +19 -19
- package/es/components/molecules/AlignSetting/index.js +52 -52
- package/es/components/molecules/AlignSetting/styled.d.ts +1 -1
- package/es/components/molecules/AlignSetting/styled.js +7 -7
- package/es/components/molecules/AlignSetting/utils.d.ts +3 -3
- package/es/components/molecules/AlignSetting/utils.js +19 -19
- package/es/components/molecules/CaptureScreen/CaptureScreen.d.ts +16 -15
- package/es/components/molecules/CaptureScreen/CaptureScreen.js +834 -834
- package/es/components/molecules/CaptureScreen/components/CommentBox/CommentBox.d.ts +17 -16
- package/es/components/molecules/CaptureScreen/components/CommentBox/CommentBox.js +80 -80
- package/es/components/molecules/CaptureScreen/components/CommentBox/index.d.ts +1 -1
- package/es/components/molecules/CaptureScreen/components/CommentBox/index.js +1 -1
- package/es/components/molecules/CaptureScreen/components/CommentBox/styled.d.ts +12 -12
- package/es/components/molecules/CaptureScreen/components/CommentBox/styled.js +136 -136
- package/es/components/molecules/CaptureScreen/components/CommentBox/types.d.ts +15 -15
- package/es/components/molecules/CaptureScreen/components/CommentBox/types.js +1 -1
- package/es/components/molecules/CaptureScreen/components/Cursor/Cursor.d.ts +4 -3
- package/es/components/molecules/CaptureScreen/components/Cursor/Cursor.js +17 -17
- package/es/components/molecules/CaptureScreen/components/Cursor/index.d.ts +1 -1
- package/es/components/molecules/CaptureScreen/components/Cursor/index.js +1 -1
- package/es/components/molecules/CaptureScreen/components/Cursor/styled.d.ts +7 -7
- package/es/components/molecules/CaptureScreen/components/Cursor/styled.js +79 -79
- package/es/components/molecules/CaptureScreen/components/Cursor/types.d.ts +10 -10
- package/es/components/molecules/CaptureScreen/components/Cursor/types.js +1 -1
- package/es/components/molecules/CaptureScreen/constants.d.ts +41 -41
- package/es/components/molecules/CaptureScreen/constants.js +118 -118
- package/es/components/molecules/CaptureScreen/hooks/useImageEditor.d.ts +5 -5
- package/es/components/molecules/CaptureScreen/hooks/useImageEditor.js +103 -103
- package/es/components/molecules/CaptureScreen/index.d.ts +1 -1
- package/es/components/molecules/CaptureScreen/index.js +1 -1
- package/es/components/molecules/CaptureScreen/styled.d.ts +26 -26
- package/es/components/molecules/CaptureScreen/styled.js +255 -255
- package/es/components/molecules/CaptureScreen/themes/black.d.ts +54 -54
- package/es/components/molecules/CaptureScreen/themes/black.js +64 -64
- package/es/components/molecules/CaptureScreen/themes/white.d.ts +54 -54
- package/es/components/molecules/CaptureScreen/themes/white.js +64 -64
- package/es/components/molecules/CaptureScreen/types.d.ts +108 -108
- package/es/components/molecules/CaptureScreen/types.js +1 -1
- package/es/components/molecules/CaptureScreen/utils.d.ts +13 -13
- package/es/components/molecules/CaptureScreen/utils.js +62 -62
- package/es/components/molecules/Card/Card.d.ts +1 -1
- package/es/components/molecules/Card/Card.js +2 -2
- package/es/components/molecules/Card/index.d.ts +1 -1
- package/es/components/molecules/Card/index.js +1 -1
- package/es/components/molecules/Cascader/Cascader.d.ts +1 -1
- package/es/components/molecules/Cascader/Cascader.js +1 -1
- package/es/components/molecules/Cascader/index.d.ts +1 -1
- package/es/components/molecules/Cascader/index.js +1 -1
- package/es/components/molecules/ChatBox/ChatBox.d.ts +3 -3
- package/es/components/molecules/ChatBox/ChatBox.js +188 -188
- package/es/components/molecules/ChatBox/MessageItem.d.ts +5 -5
- package/es/components/molecules/ChatBox/MessageItem.js +66 -66
- package/es/components/molecules/ChatBox/constants.d.ts +6 -6
- package/es/components/molecules/ChatBox/constants.js +51 -51
- package/es/components/molecules/ChatBox/index.d.ts +1 -1
- package/es/components/molecules/ChatBox/index.js +1 -1
- package/es/components/molecules/ChatBox/styled.d.ts +10 -10
- package/es/components/molecules/ChatBox/styled.js +280 -280
- package/es/components/molecules/ChatBox/types.d.ts +32 -32
- package/es/components/molecules/ChatBox/types.js +1 -1
- package/es/components/molecules/Collapse/Collapse.d.ts +4 -4
- package/es/components/molecules/Collapse/Collapse.js +11 -2
- package/es/components/molecules/Collapse/index.d.ts +1 -1
- package/es/components/molecules/Collapse/index.js +1 -1
- package/es/components/molecules/ColorPicker/ChromePicker/index.d.ts +1 -1
- package/es/components/molecules/ColorPicker/ChromePicker/index.js +3 -3
- package/es/components/molecules/ColorPicker/ChromePicker/styled.d.ts +1 -1
- package/es/components/molecules/ColorPicker/ChromePicker/styled.js +15 -15
- package/es/components/molecules/ColorPicker/CustomPicker/index.d.ts +2 -2
- package/es/components/molecules/ColorPicker/CustomPicker/index.js +117 -117
- package/es/components/molecules/ColorPicker/CustomPicker/styled.d.ts +9 -9
- package/es/components/molecules/ColorPicker/CustomPicker/styled.js +104 -104
- package/es/components/molecules/ColorPicker/SketchPicker/index.d.ts +10 -10
- package/es/components/molecules/ColorPicker/SketchPicker/index.js +5 -5
- package/es/components/molecules/ColorPicker/SketchPicker/styled.d.ts +1 -1
- package/es/components/molecules/ColorPicker/SketchPicker/styled.js +10 -10
- package/es/components/molecules/ColorPicker/index.d.ts +13 -13
- package/es/components/molecules/ColorPicker/index.js +95 -95
- package/es/components/molecules/ColorPicker/styled.d.ts +1 -1
- package/es/components/molecules/ColorPicker/styled.js +10 -10
- package/es/components/molecules/ColorSetting/index.d.ts +14 -14
- package/es/components/molecules/ColorSetting/index.js +97 -97
- package/es/components/molecules/ColorSetting/styled.d.ts +7 -7
- package/es/components/molecules/ColorSetting/styled.js +42 -42
- package/es/components/molecules/DatePicker/DatePicker.d.ts +8 -8
- package/es/components/molecules/DatePicker/DatePicker.js +8 -8
- package/es/components/molecules/DatePicker/components/AdvancedPicker/AdvancedPicker.d.ts +28 -28
- package/es/components/molecules/DatePicker/components/AdvancedPicker/AdvancedPicker.js +428 -428
- package/es/components/molecules/DatePicker/components/AdvancedPicker/constants.d.ts +53 -53
- package/es/components/molecules/DatePicker/components/AdvancedPicker/constants.js +74 -74
- package/es/components/molecules/DatePicker/components/AdvancedPicker/index.d.ts +3 -3
- package/es/components/molecules/DatePicker/components/AdvancedPicker/index.js +1 -1
- package/es/components/molecules/DatePicker/components/AdvancedPicker/styled.d.ts +7 -7
- package/es/components/molecules/DatePicker/components/AdvancedPicker/styled.js +49 -49
- package/es/components/molecules/DatePicker/components/AdvancedPicker/types.d.ts +14 -14
- package/es/components/molecules/DatePicker/components/AdvancedPicker/types.js +1 -1
- package/es/components/molecules/DatePicker/components/AdvancedPicker/utils.d.ts +15 -15
- package/es/components/molecules/DatePicker/components/AdvancedPicker/utils.js +84 -84
- package/es/components/molecules/DatePicker/components/AdvancedRangePicker/AdvancedRangePicker.d.ts +15 -15
- package/es/components/molecules/DatePicker/components/AdvancedRangePicker/AdvancedRangePicker.js +70 -70
- package/es/components/molecules/DatePicker/components/AdvancedRangePicker/constants.d.ts +4 -4
- package/es/components/molecules/DatePicker/components/AdvancedRangePicker/constants.js +4 -4
- package/es/components/molecules/DatePicker/components/AdvancedRangePicker/index.d.ts +2 -2
- package/es/components/molecules/DatePicker/components/AdvancedRangePicker/index.js +1 -1
- package/es/components/molecules/DatePicker/components/AdvancedRangePicker/types.d.ts +17 -17
- package/es/components/molecules/DatePicker/components/AdvancedRangePicker/types.js +1 -1
- package/es/components/molecules/DatePicker/index.d.ts +3 -3
- package/es/components/molecules/DatePicker/index.js +1 -1
- package/es/components/molecules/Drawer/Drawer.d.ts +1 -1
- package/es/components/molecules/Drawer/Drawer.js +2 -2
- package/es/components/molecules/Drawer/index.d.ts +1 -1
- package/es/components/molecules/Drawer/index.js +1 -1
- package/es/components/molecules/Dropdown/Dropdown.d.ts +1 -1
- package/es/components/molecules/Dropdown/Dropdown.js +1 -1
- package/es/components/molecules/Dropdown/index.d.ts +1 -1
- package/es/components/molecules/Dropdown/index.js +1 -1
- package/es/components/molecules/EdgeSetting/index.d.ts +39 -39
- package/es/components/molecules/EdgeSetting/index.js +192 -192
- package/es/components/molecules/EdgeSetting/styled.d.ts +3 -3
- package/es/components/molecules/EdgeSetting/styled.js +18 -18
- package/es/components/molecules/FontFamilySelect/constants.d.ts +307 -0
- package/es/components/molecules/FontFamilySelect/constants.js +257 -0
- package/es/components/molecules/FontFamilySelect/index.d.ts +17 -0
- package/es/components/molecules/FontFamilySelect/index.js +53 -0
- package/es/components/molecules/FontSetting/constants.d.ts +3 -0
- package/es/components/molecules/FontSetting/constants.js +22 -0
- package/es/components/molecules/FontSetting/index.d.ts +24 -0
- package/es/components/molecules/FontSetting/index.js +54 -0
- package/es/components/molecules/FontSetting/types.d.ts +22 -0
- package/es/components/molecules/FontSetting/types.js +1 -0
- package/es/components/molecules/FontWeightSelect/constants.d.ts +28 -0
- package/es/components/molecules/FontWeightSelect/constants.js +11 -0
- package/es/components/molecules/FontWeightSelect/index.d.ts +9 -0
- package/es/components/molecules/FontWeightSelect/index.js +39 -0
- package/es/components/molecules/Form/Form.d.ts +1 -0
- package/es/components/molecules/Form/Form.js +1 -0
- package/es/components/molecules/Form/index.d.ts +1 -0
- package/es/components/molecules/Form/index.js +1 -0
- package/es/components/molecules/GradientSetting/index.d.ts +36 -36
- package/es/components/molecules/GradientSetting/index.js +99 -99
- package/es/components/molecules/GradientSetting/styled.d.ts +1 -1
- package/es/components/molecules/GradientSetting/styled.js +59 -59
- package/es/components/molecules/IconSelection/components/Icon/index.d.ts +10 -10
- package/es/components/molecules/IconSelection/components/Icon/index.js +28 -28
- package/es/components/molecules/IconSelection/constants.d.ts +56 -56
- package/es/components/molecules/IconSelection/constants.js +89 -89
- package/es/components/molecules/IconSelection/index.d.ts +3 -3
- package/es/components/molecules/IconSelection/index.js +143 -143
- package/es/components/molecules/IconSelection/styled.d.ts +8 -8
- package/es/components/molecules/IconSelection/styled.js +80 -80
- package/es/components/molecules/IconSelection/types.d.ts +26 -26
- package/es/components/molecules/IconSelection/types.js +2 -2
- package/es/components/molecules/IconSelection/utils.d.ts +4 -4
- package/es/components/molecules/IconSelection/utils.js +13 -13
- package/es/components/molecules/InputNumber/index.d.ts +9 -9
- package/es/components/molecules/InputNumber/index.js +81 -81
- package/es/components/molecules/InputNumberWithUnit/index.d.ts +31 -31
- package/es/components/molecules/InputNumberWithUnit/index.js +37 -37
- package/es/components/molecules/InputNumberWithUnit/styled.d.ts +1 -1
- package/es/components/molecules/InputNumberWithUnit/styled.js +20 -20
- package/es/components/molecules/InputSearch/index.d.ts +7 -7
- package/es/components/molecules/InputSearch/index.js +23 -23
- package/es/components/molecules/InputSearch/styled.d.ts +1 -1
- package/es/components/molecules/InputSearch/styled.js +48 -48
- package/es/components/molecules/Modal/Modal.d.ts +23 -23
- package/es/components/molecules/Modal/Modal.js +26 -26
- package/es/components/molecules/Modal/index.d.ts +1 -1
- package/es/components/molecules/Modal/index.js +1 -1
- package/es/components/molecules/Modal/styled.d.ts +15 -15
- package/es/components/molecules/Modal/styled.js +78 -78
- package/es/components/molecules/Popconfirm/Popconfirm.d.ts +4 -4
- package/es/components/molecules/Popconfirm/Popconfirm.js +2 -2
- package/es/components/molecules/Popconfirm/index.d.ts +1 -1
- package/es/components/molecules/Popconfirm/index.js +1 -1
- package/es/components/molecules/PopupDraggable/PopupDraggable.d.ts +6 -6
- package/es/components/molecules/PopupDraggable/PopupDraggable.js +52 -52
- package/es/components/molecules/PopupDraggable/index.d.ts +1 -1
- package/es/components/molecules/PopupDraggable/index.js +1 -1
- package/es/components/molecules/PopupDraggable/styled.d.ts +5 -5
- package/es/components/molecules/PopupDraggable/styled.js +52 -52
- package/es/components/molecules/PopupDraggable/types.d.ts +15 -15
- package/es/components/molecules/PopupDraggable/types.js +1 -1
- package/es/components/molecules/RadioGroup/index.d.ts +7 -7
- package/es/components/molecules/RadioGroup/index.js +23 -23
- package/es/components/molecules/RadioGroup/styled.d.ts +3 -3
- package/es/components/molecules/RadioGroup/styled.js +14 -14
- package/es/components/molecules/ResizeGrid/ResizeGrid.d.ts +3 -0
- package/es/components/molecules/ResizeGrid/ResizeGrid.js +353 -0
- package/es/components/molecules/ResizeGrid/components/Cell/Cell.d.ts +3 -0
- package/es/components/molecules/ResizeGrid/components/Cell/Cell.js +67 -0
- package/es/components/molecules/ResizeGrid/components/Cell/index.d.ts +1 -0
- package/es/components/molecules/ResizeGrid/components/Cell/index.js +1 -0
- package/es/components/molecules/ResizeGrid/components/Cell/styled.d.ts +3 -0
- package/es/components/molecules/ResizeGrid/components/Cell/styled.js +62 -0
- package/es/components/molecules/ResizeGrid/constant.d.ts +34 -0
- package/es/components/molecules/ResizeGrid/constant.js +108 -0
- package/es/components/molecules/ResizeGrid/index.d.ts +2 -0
- package/es/components/molecules/ResizeGrid/index.js +1 -0
- package/es/components/molecules/ResizeGrid/styled.d.ts +3 -0
- package/es/components/molecules/ResizeGrid/styled.js +20 -0
- package/es/components/molecules/ResizeGrid/types.d.ts +128 -0
- package/es/components/molecules/ResizeGrid/types.js +1 -0
- package/es/components/molecules/Result/Result.d.ts +1 -1
- package/es/components/molecules/Result/Result.js +2 -2
- package/es/components/molecules/Result/index.d.ts +1 -1
- package/es/components/molecules/Result/index.js +1 -1
- package/es/components/molecules/Select/Select.d.ts +17 -14
- package/es/components/molecules/Select/Select.js +50 -29
- package/es/components/molecules/Select/Test.d.ts +3 -2
- package/es/components/molecules/Select/Test.js +22 -22
- package/es/components/molecules/Select/index.d.ts +2 -2
- package/es/components/molecules/Select/index.js +1 -1
- package/es/components/molecules/Select/styled.d.ts +4 -4
- package/es/components/molecules/Select/styled.js +41 -41
- package/es/components/molecules/SettingWrapper/index.d.ts +12 -13
- package/es/components/molecules/SettingWrapper/index.js +20 -20
- package/es/components/molecules/SettingWrapper/styled.d.ts +5 -5
- package/es/components/molecules/SettingWrapper/styled.js +17 -17
- package/es/components/molecules/SettingWrapperPopover/index.d.ts +16 -0
- package/es/components/molecules/SettingWrapperPopover/index.js +17 -0
- package/es/components/molecules/SliderWithInputNumber/index.d.ts +11 -11
- package/es/components/molecules/SliderWithInputNumber/index.js +62 -62
- package/es/components/molecules/SliderWithInputNumber/styled.d.ts +1 -1
- package/es/components/molecules/SliderWithInputNumber/styled.js +8 -8
- package/es/components/molecules/Tabs/Tabs.d.ts +1 -1
- package/es/components/molecules/Tabs/Tabs.js +1 -1
- package/es/components/molecules/Tabs/index.d.ts +1 -1
- package/es/components/molecules/Tabs/index.js +1 -1
- package/es/components/molecules/TextDecorationSelect/constants.d.ts +19 -0
- package/es/components/molecules/TextDecorationSelect/constants.js +26 -0
- package/es/components/molecules/TextDecorationSelect/index.d.ts +15 -0
- package/es/components/molecules/TextDecorationSelect/index.js +45 -0
- package/es/components/molecules/TextTransformSelect/constants.d.ts +13 -0
- package/es/components/molecules/TextTransformSelect/constants.js +19 -0
- package/es/components/molecules/TextTransformSelect/index.d.ts +9 -0
- package/es/components/molecules/TextTransformSelect/index.js +39 -0
- package/es/components/molecules/TreeSelect/TreeSelect.d.ts +11 -11
- package/es/components/molecules/TreeSelect/TreeSelect.js +2 -2
- package/es/components/molecules/TreeSelect/index.d.ts +1 -1
- package/es/components/molecules/TreeSelect/index.js +1 -1
- package/es/components/molecules/UploadImage/MediaIcon.d.ts +3 -2
- package/es/components/molecules/UploadImage/MediaIcon.js +8 -8
- package/es/components/molecules/UploadImage/index.d.ts +33 -33
- package/es/components/molecules/UploadImage/index.js +366 -366
- package/es/components/molecules/UploadImage/styled.d.ts +13 -13
- package/es/components/molecules/UploadImage/styled.js +134 -134
- package/es/components/molecules/index.d.ts +40 -30
- package/es/components/molecules/index.js +35 -27
- package/es/components/organism/Help/Help.d.ts +5 -5
- package/es/components/organism/Help/Help.js +1005 -1005
- package/es/components/organism/Help/constants.d.ts +140 -140
- package/es/components/organism/Help/constants.js +1653 -1653
- package/es/components/organism/Help/index.d.ts +1 -1
- package/es/components/organism/Help/index.js +1 -1
- package/es/components/organism/Help/styled.d.ts +71 -71
- package/es/components/organism/Help/styled.js +264 -264
- package/es/components/organism/Help/types.d.ts +67 -67
- package/es/components/organism/Help/types.js +1 -1
- package/es/components/organism/Help/utils.d.ts +15 -15
- package/es/components/organism/Help/utils.js +82 -82
- package/es/components/organism/PositionSetting/config.d.ts +10 -10
- package/es/components/organism/PositionSetting/config.js +10 -10
- package/es/components/organism/PositionSetting/index.d.ts +15 -15
- package/es/components/organism/PositionSetting/index.js +62 -62
- package/es/components/organism/PositionSetting/styled.d.ts +1 -1
- package/es/components/organism/PositionSetting/styled.js +3 -3
- package/es/components/organism/PositionSetting/types.d.ts +10 -10
- package/es/components/organism/PositionSetting/types.js +1 -1
- package/es/components/organism/Table/CrossTabTable/CrossTabTable.d.ts +18 -18
- package/es/components/organism/Table/CrossTabTable/CrossTabTable.js +305 -305
- package/es/components/organism/Table/CrossTabTable/components/CustomCell/CustomCell.d.ts +11 -11
- package/es/components/organism/Table/CrossTabTable/components/CustomCell/CustomCell.js +22 -22
- package/es/components/organism/Table/CrossTabTable/components/CustomCell/index.d.ts +1 -1
- package/es/components/organism/Table/CrossTabTable/components/CustomCell/index.js +1 -1
- package/es/components/organism/Table/CrossTabTable/components/CustomCell/styled.d.ts +1 -1
- package/es/components/organism/Table/CrossTabTable/components/CustomCell/styled.js +13 -13
- package/es/components/organism/Table/CrossTabTable/constants.d.ts +75 -75
- package/es/components/organism/Table/CrossTabTable/constants.js +1525 -1525
- package/es/components/organism/Table/CrossTabTable/index.d.ts +1 -1
- package/es/components/organism/Table/CrossTabTable/index.js +1 -1
- package/es/components/organism/Table/CrossTabTable/styled.d.ts +1 -1
- package/es/components/organism/Table/CrossTabTable/styled.js +13 -13
- package/es/components/organism/Table/CrossTabTable/types.d.ts +1 -1
- package/es/components/organism/Table/CrossTabTable/types.js +1 -1
- package/es/components/organism/Table/CrossTabTable/utils.d.ts +1 -1
- package/es/components/organism/Table/CrossTabTable/utils.js +1 -1
- package/es/components/organism/Table/ExplorePivotTable/ExplorePivotTable.d.ts +11 -11
- package/es/components/organism/Table/ExplorePivotTable/ExplorePivotTable.js +51 -51
- package/es/components/organism/Table/ExplorePivotTable/components/CustomCell/CustomCell.d.ts +12 -12
- package/es/components/organism/Table/ExplorePivotTable/components/CustomCell/CustomCell.js +41 -41
- package/es/components/organism/Table/ExplorePivotTable/components/CustomCell/index.d.ts +1 -1
- package/es/components/organism/Table/ExplorePivotTable/components/CustomCell/index.js +1 -1
- package/es/components/organism/Table/ExplorePivotTable/components/CustomCell/styled.d.ts +3 -3
- package/es/components/organism/Table/ExplorePivotTable/components/CustomCell/styled.js +21 -21
- package/es/components/organism/Table/ExplorePivotTable/constants.d.ts +4 -4
- package/es/components/organism/Table/ExplorePivotTable/constants.js +84 -84
- package/es/components/organism/Table/ExplorePivotTable/index.d.ts +2 -2
- package/es/components/organism/Table/ExplorePivotTable/index.js +2 -2
- package/es/components/organism/Table/ExplorePivotTable/styled.d.ts +12 -12
- package/es/components/organism/Table/ExplorePivotTable/styled.js +15 -15
- package/es/components/organism/Table/ExplorePivotTable/types.d.ts +17 -17
- package/es/components/organism/Table/ExplorePivotTable/types.js +1 -1
- package/es/components/organism/Table/ExplorePivotTable/utils.d.ts +4 -4
- package/es/components/organism/Table/ExplorePivotTable/utils.js +154 -154
- package/es/components/organism/Table/Table.d.ts +1 -1
- package/es/components/organism/Table/Table.js +1 -1
- package/es/components/organism/Table/index.d.ts +2 -2
- package/es/components/organism/Table/index.js +2 -2
- package/es/components/organism/index.d.ts +3 -3
- package/es/components/organism/index.js +3 -3
- package/es/constants/gradientSetting.d.ts +83 -83
- package/es/constants/gradientSetting.js +86 -86
- package/es/constants/index.d.ts +3 -3
- package/es/constants/index.js +3 -3
- package/es/constants/keyCode.d.ts +387 -387
- package/es/constants/keyCode.js +394 -394
- package/es/constants/storybook.d.ts +12 -11
- package/es/constants/storybook.js +24 -24
- package/es/constants/theme.d.ts +12 -12
- package/es/constants/theme.js +168 -146
- package/es/hooks/index.d.ts +2 -2
- package/es/hooks/index.js +21 -21
- package/es/hooks/useDebounce.d.ts +3 -3
- package/es/hooks/useDebounce.js +15 -15
- package/es/hooks/useDeepCompareEffect.d.ts +1 -0
- package/es/hooks/useDeepCompareEffect.js +21 -0
- package/es/index.d.ts +1 -1
- package/es/index.js +1 -1
- package/es/locales/en/translation.json +66 -66
- package/es/locales/i18n.d.ts +140 -140
- package/es/locales/i18n.js +38 -38
- package/es/locales/translations.d.ts +70 -70
- package/es/locales/translations.js +35 -35
- package/es/locales/types.d.ts +15 -15
- package/es/locales/types.js +1 -1
- package/es/locales/vi/translation.json +66 -66
- package/es/models/SavedImage.d.ts +32 -32
- package/es/models/SavedImage.js +26 -26
- package/es/models/Upload.d.ts +32 -32
- package/es/models/Upload.js +21 -21
- package/es/models/model.d.ts +8 -8
- package/es/models/model.js +5 -5
- package/es/services/MediaTemplateDesign/UploadFile/index.d.ts +6 -6
- package/es/services/MediaTemplateDesign/UploadFile/index.js +75 -75
- package/es/services/Ticket.d.ts +67 -67
- package/es/services/Ticket.js +73 -73
- package/es/services/constants.d.ts +20 -20
- package/es/services/constants.js +21 -21
- package/es/services/index.d.ts +9 -9
- package/es/services/index.js +64 -64
- package/es/test.d.ts +14 -13
- package/es/test.js +162 -155
- package/es/types/index.d.ts +6 -6
- package/es/types/index.js +1 -1
- package/es/utils/color.d.ts +10 -10
- package/es/utils/color.js +61 -61
- package/es/utils/common.d.ts +53 -53
- package/es/utils/common.js +355 -355
- package/es/utils/handleError.d.ts +2 -2
- package/es/utils/handleError.js +6 -6
- package/es/utils/index.d.ts +3 -3
- package/es/utils/index.js +3 -3
- package/es/utils/loadable.d.ts +7 -7
- package/es/utils/loadable.js +10 -10
- package/es/utils/web.d.ts +10 -10
- package/es/utils/web.js +26 -26
- package/package.json +183 -182
|
@@ -1,1005 +1,1005 @@
|
|
|
1
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
-
});
|
|
9
|
-
};
|
|
10
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
|
11
|
-
var t = {};
|
|
12
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
13
|
-
t[p] = s[p];
|
|
14
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
15
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
16
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
17
|
-
t[p[i]] = s[p[i]];
|
|
18
|
-
}
|
|
19
|
-
return t;
|
|
20
|
-
};
|
|
21
|
-
/* eslint-disable jsx-a11y/iframe-has-title */
|
|
22
|
-
/* eslint-disable jsx-a11y/label-has-associated-control */
|
|
23
|
-
/* eslint-disable no-multi-str */
|
|
24
|
-
// Libraries
|
|
25
|
-
import React, { useEffect, useMemo, useRef, useState } from 'react';
|
|
26
|
-
import { isEmpty } from 'lodash';
|
|
27
|
-
import { createPortal } from 'react-dom';
|
|
28
|
-
// Assets
|
|
29
|
-
import '@antscorp/icons/main.css';
|
|
30
|
-
// Services
|
|
31
|
-
import TicketService from '@antscorp/antsomi-ui/es/services/Ticket';
|
|
32
|
-
// Component
|
|
33
|
-
import { ButtonFeedback, ControlGroup, ControlLabel, DropDown, EditorWrapper, ErrorMessage, FlexCenter, Header, HiddenBlock, IframeHelp, Image, Label, LabelTitle, Link, Overlay, PreviewBox, SendFeedback, Span, Text, TitleSearch, TreeContent, Video, Wrapper, WrapperBody, WrapperContentHelp, WrapperFooter, WrapperFooterSpace, WrapperHeader, WrapperIconEditor, WrapperImage, WrapperInputFile, WrapperLinkFiles, WrapperLinkItemFiles, WrapperLoading, WrapperSearch, } from './styled';
|
|
34
|
-
import { Button, Spin } from 'antd';
|
|
35
|
-
import Icon from '@antscorp/icons';
|
|
36
|
-
import { Editor } from '@tinymce/tinymce-react';
|
|
37
|
-
import { LoadingOutlined, QuestionCircleOutlined } from '@ant-design/icons';
|
|
38
|
-
// Atoms
|
|
39
|
-
import { Input } from '@antscorp/antsomi-ui/es/components/atoms';
|
|
40
|
-
// Molecules
|
|
41
|
-
import { PopupDraggable, Select, CaptureScreen, ChatBox, } from '@antscorp/antsomi-ui/es/components/molecules';
|
|
42
|
-
// Constants
|
|
43
|
-
import { ATTACH_CAPTURE_TYPES, ATTACH_KEYS, DEFAULT_POSITIONS, MENU_KEYS, MESSAGE_TYPE, PORTALS_ANTSOMI_PACKAGE_UI_KEY, PORTALS_ANTSOMI_PACKAGE_UI_KEY_POPUP, REPORT_TYPES, TICKET_CUSTOM_MESSAGE_KEY, } from './constants';
|
|
44
|
-
import { THEME } from '@antscorp/antsomi-ui/es/constants';
|
|
45
|
-
// Utils
|
|
46
|
-
import { base64ToFile, convertBlobToFile, generateUniqueId, mergeAudioStreams, } from '@antscorp/antsomi-ui/es/components/molecules/CaptureScreen/utils';
|
|
47
|
-
import { expendDefault, formatParams, postCustomEvent } from './utils';
|
|
48
|
-
import { CameraIcon, CaptureIcon, OpenUrlIcon, BugIcon, RequestIcon, } from '@antscorp/antsomi-ui/es/components/icons';
|
|
49
|
-
const antIcon = React.createElement(LoadingOutlined, { style: { fontSize: 40 }, spin: true });
|
|
50
|
-
const Loading = ({ isLoading, height, width }) => isLoading && (React.createElement(WrapperLoading, { className: "loader-container", height: height, width: width },
|
|
51
|
-
React.createElement(Spin, { indicator: antIcon })));
|
|
52
|
-
const Help = props => {
|
|
53
|
-
const { configs, triggerType, boundsDraggable, isShowResizeHover, children } = props;
|
|
54
|
-
const { apiKey, domainPlatform, appCode, domain, portalId, token, userId, config, domainTicket, avatar, } = configs;
|
|
55
|
-
const [isOpenDropdown, setIsOpenDropdown] = useState(false);
|
|
56
|
-
const [defaultPositionDrawActions, setDefaultPositionDrawActions] = useState(DEFAULT_POSITIONS.capture);
|
|
57
|
-
const [defaultPositionRecordActions, setDefaultPositionRecordActions] = useState(DEFAULT_POSITIONS.record);
|
|
58
|
-
const [isMainLoading, setIsMainLoading] = useState(false);
|
|
59
|
-
const [isShowPopup, setIsShowPopup] = useState(false);
|
|
60
|
-
const [title, setTitle] = useState('');
|
|
61
|
-
const [type, setType] = useState(REPORT_TYPES.HELP);
|
|
62
|
-
const [isValidAll, setIsValidAll] = useState(true);
|
|
63
|
-
const [valueInput, setValueInput] = useState({
|
|
64
|
-
title: '',
|
|
65
|
-
ticketType: '',
|
|
66
|
-
priority: 'normal',
|
|
67
|
-
category: '',
|
|
68
|
-
ownerId: Number(userId),
|
|
69
|
-
followers: [],
|
|
70
|
-
message: '',
|
|
71
|
-
files: [],
|
|
72
|
-
referenceUrl: '',
|
|
73
|
-
});
|
|
74
|
-
const [errFile, setErrFile] = useState({
|
|
75
|
-
isError: false,
|
|
76
|
-
message: '',
|
|
77
|
-
});
|
|
78
|
-
const [pathHelp, setHelp] = useState('');
|
|
79
|
-
const [urlImageDrawer, setUrlImageDrawer] = useState('');
|
|
80
|
-
const [urlVideoPreview, setUrlVideoPreview] = useState('');
|
|
81
|
-
const [imageDrew, setImageDrew] = useState({
|
|
82
|
-
imageName: '',
|
|
83
|
-
dataURL: '',
|
|
84
|
-
});
|
|
85
|
-
const [isOpenImageDrawer, setIsOpenImageDrawer] = useState(false);
|
|
86
|
-
const [captureType, setCaptureType] = useState(ATTACH_KEYS.CAPTURE);
|
|
87
|
-
const [open, setOpen] = useState(false);
|
|
88
|
-
const [dataRecorded, setDataRecorded] = useState([]);
|
|
89
|
-
const [dataListHelp, setDataListHelp] = useState([]);
|
|
90
|
-
const [isMute, setIsMute] = useState(false);
|
|
91
|
-
const [appTargeting, setAppTargeting] = useState({
|
|
92
|
-
label: '',
|
|
93
|
-
value: '',
|
|
94
|
-
});
|
|
95
|
-
const [autoExpandParent, setAutoExpandParent] = useState(true);
|
|
96
|
-
const [expandedKeys, setExpandedKeys] = useState([]);
|
|
97
|
-
const [searchValue, setSearchValue] = useState('');
|
|
98
|
-
const [allAppOptions, setAllAppOptions] = useState([]);
|
|
99
|
-
const [isForceStopRecorder, setIsForceStopRecorder] = useState(false);
|
|
100
|
-
const [isLoadingListHelp, setIsLoadingHelp] = useState(true);
|
|
101
|
-
const recorderRef = useRef();
|
|
102
|
-
const streamTracks = useRef();
|
|
103
|
-
// const showModal = (captureKey: CaptureTypeProps) => {
|
|
104
|
-
// setOpen(true);
|
|
105
|
-
// setCaptureType(captureKey);
|
|
106
|
-
// };
|
|
107
|
-
const items = useMemo(() => {
|
|
108
|
-
var _a;
|
|
109
|
-
return [
|
|
110
|
-
{
|
|
111
|
-
label: (React.createElement("a", { href: "https://docs.antsomi.com/cdp-365-user-guide-en/release-note/2023", target: "_blank", rel: "noreferrer" },
|
|
112
|
-
React.createElement(Label, { style: {
|
|
113
|
-
position: 'relative',
|
|
114
|
-
display: 'flex',
|
|
115
|
-
alignItems: 'center',
|
|
116
|
-
gap: 33,
|
|
117
|
-
width: '100%',
|
|
118
|
-
marginTop: 8,
|
|
119
|
-
} },
|
|
120
|
-
"New features & announcements",
|
|
121
|
-
React.createElement(OpenUrlIcon, { style: {
|
|
122
|
-
fill: (_a = THEME.token) === null || _a === void 0 ? void 0 : _a.colorIcon,
|
|
123
|
-
maxWidth: 24,
|
|
124
|
-
maxHeight: 24,
|
|
125
|
-
} })))),
|
|
126
|
-
key: MENU_KEYS.FEATURE_ANNOUNCEMENT,
|
|
127
|
-
},
|
|
128
|
-
{
|
|
129
|
-
label: React.createElement(Label, null, "Leave feedback"),
|
|
130
|
-
key: MENU_KEYS.FEEDBACK,
|
|
131
|
-
},
|
|
132
|
-
{
|
|
133
|
-
label: React.createElement(Label, null, "Get Help"),
|
|
134
|
-
key: MENU_KEYS.HELP,
|
|
135
|
-
},
|
|
136
|
-
{
|
|
137
|
-
label: React.createElement(Label, null, "Get ideas with ChatGPT"),
|
|
138
|
-
key: MENU_KEYS.CHAT,
|
|
139
|
-
},
|
|
140
|
-
{
|
|
141
|
-
type: 'divider',
|
|
142
|
-
},
|
|
143
|
-
{
|
|
144
|
-
label: (React.createElement("a", { href: `${domainTicket}/${portalId}/#/${userId}/tickets`, target: "_blank", rel: "noreferrer" },
|
|
145
|
-
React.createElement(Label, { className: "verify-support" }, "Verify support request"))),
|
|
146
|
-
key: MENU_KEYS.SUPPORT,
|
|
147
|
-
},
|
|
148
|
-
];
|
|
149
|
-
}, [domainTicket, portalId, userId]);
|
|
150
|
-
const modifiedDomain = useMemo(() => {
|
|
151
|
-
const regex = /^(https?:)/;
|
|
152
|
-
if (regex.test(domain)) {
|
|
153
|
-
return domain.replace(regex, '');
|
|
154
|
-
}
|
|
155
|
-
return domain;
|
|
156
|
-
}, [domain]);
|
|
157
|
-
const handleCancel = () => {
|
|
158
|
-
setOpen(false);
|
|
159
|
-
};
|
|
160
|
-
const handleClick = (data) => {
|
|
161
|
-
const { key = '' } = data;
|
|
162
|
-
switch (key) {
|
|
163
|
-
case MENU_KEYS.FEEDBACK: {
|
|
164
|
-
setType(REPORT_TYPES.FEEDBACK);
|
|
165
|
-
setTitle('Send feedback to Antsomi');
|
|
166
|
-
setIsShowPopup(true);
|
|
167
|
-
break;
|
|
168
|
-
}
|
|
169
|
-
case MENU_KEYS.HELP: {
|
|
170
|
-
fetchDataListHelp();
|
|
171
|
-
setType(REPORT_TYPES.HELP);
|
|
172
|
-
setTitle('Get Help');
|
|
173
|
-
setIsShowPopup(true);
|
|
174
|
-
break;
|
|
175
|
-
}
|
|
176
|
-
case MENU_KEYS.CHAT: {
|
|
177
|
-
setType(REPORT_TYPES.CHAT);
|
|
178
|
-
setTitle('Get ideas with ChatGPT');
|
|
179
|
-
setIsShowPopup(true);
|
|
180
|
-
break;
|
|
181
|
-
}
|
|
182
|
-
default: {
|
|
183
|
-
setIsOpenDropdown(false);
|
|
184
|
-
break;
|
|
185
|
-
}
|
|
186
|
-
}
|
|
187
|
-
};
|
|
188
|
-
const handleUploadFile = (params) => __awaiter(void 0, void 0, void 0, function* () {
|
|
189
|
-
try {
|
|
190
|
-
setIsMainLoading(true);
|
|
191
|
-
const res = yield TicketService.tickets.callApi.upload(params, domainTicket, token, config, userId, 'ticket');
|
|
192
|
-
if (res.code === 200) {
|
|
193
|
-
setValueInput(prevVal => (Object.assign(Object.assign({}, prevVal), { files: [...valueInput.files, res.data] })));
|
|
194
|
-
}
|
|
195
|
-
}
|
|
196
|
-
catch (error) {
|
|
197
|
-
// eslint-disable-next-line no-console
|
|
198
|
-
console.log('error :>', error);
|
|
199
|
-
}
|
|
200
|
-
finally {
|
|
201
|
-
setIsMainLoading(false);
|
|
202
|
-
}
|
|
203
|
-
});
|
|
204
|
-
useEffect(() => {
|
|
205
|
-
const handleFetchAllApps = () => __awaiter(void 0, void 0, void 0, function* () {
|
|
206
|
-
try {
|
|
207
|
-
setIsMainLoading(true);
|
|
208
|
-
const res = yield TicketService.tickets.callApi.getCustomFields({}, domainTicket, token, config, userId, 'get-custom-fields');
|
|
209
|
-
if (res && res.code === 200) {
|
|
210
|
-
const { data } = res;
|
|
211
|
-
if (data && Array.isArray(data.fields)) {
|
|
212
|
-
const features = data.fields.find(item => item.value === 'feature');
|
|
213
|
-
const { field_options = [] } = features || {};
|
|
214
|
-
const temp = field_options.map(app => ({
|
|
215
|
-
label: app.name,
|
|
216
|
-
value: app.value,
|
|
217
|
-
raw: app,
|
|
218
|
-
}));
|
|
219
|
-
setAppTargeting(temp[0]);
|
|
220
|
-
setAllAppOptions(temp);
|
|
221
|
-
}
|
|
222
|
-
}
|
|
223
|
-
}
|
|
224
|
-
catch (error) {
|
|
225
|
-
// eslint-disable-next-line no-console
|
|
226
|
-
console.log('error :>', error);
|
|
227
|
-
}
|
|
228
|
-
finally {
|
|
229
|
-
setIsMainLoading(false);
|
|
230
|
-
}
|
|
231
|
-
});
|
|
232
|
-
if (isEmpty(allAppOptions)) {
|
|
233
|
-
handleFetchAllApps();
|
|
234
|
-
}
|
|
235
|
-
}, [allAppOptions, config, domainTicket, token, userId]);
|
|
236
|
-
const handleOnchangeFile = e => {
|
|
237
|
-
var _a, _b;
|
|
238
|
-
const limitSize = 50 * 1024 * 1024;
|
|
239
|
-
const sizeFile = (_b = (_a = e.target) === null || _a === void 0 ? void 0 : _a.files[0]) === null || _b === void 0 ? void 0 : _b.size;
|
|
240
|
-
if (sizeFile >= limitSize) {
|
|
241
|
-
setErrFile({
|
|
242
|
-
isError: true,
|
|
243
|
-
message: '*Maximum upload file size: 50MB',
|
|
244
|
-
});
|
|
245
|
-
}
|
|
246
|
-
else {
|
|
247
|
-
const formData = new FormData();
|
|
248
|
-
formData.append('file', e.target.files[0]);
|
|
249
|
-
const params = {
|
|
250
|
-
data: formData,
|
|
251
|
-
};
|
|
252
|
-
setErrFile({
|
|
253
|
-
isError: false,
|
|
254
|
-
message: '',
|
|
255
|
-
});
|
|
256
|
-
handleUploadFile(params);
|
|
257
|
-
}
|
|
258
|
-
};
|
|
259
|
-
const handleRemoveFile = token => {
|
|
260
|
-
let newListFile = valueInput.files;
|
|
261
|
-
newListFile = newListFile.filter(list => (list === null || list === void 0 ? void 0 : list.token) !== token);
|
|
262
|
-
setValueInput(prevVal => (Object.assign(Object.assign({}, prevVal), { files: newListFile })));
|
|
263
|
-
};
|
|
264
|
-
const handleResetData = () => {
|
|
265
|
-
setUrlImageDrawer('');
|
|
266
|
-
setUrlVideoPreview('');
|
|
267
|
-
setIsValidAll(true);
|
|
268
|
-
setIsOpenDropdown(false);
|
|
269
|
-
setValueInput(prev => (Object.assign(Object.assign({}, prev), { message: '', title: '', files: [] })));
|
|
270
|
-
setIsShowPopup(false);
|
|
271
|
-
setErrFile({
|
|
272
|
-
isError: false,
|
|
273
|
-
message: '',
|
|
274
|
-
});
|
|
275
|
-
setImageDrew({
|
|
276
|
-
imageName: '',
|
|
277
|
-
dataURL: '',
|
|
278
|
-
});
|
|
279
|
-
setDataRecorded([]);
|
|
280
|
-
setSearchValue('');
|
|
281
|
-
setAutoExpandParent(false);
|
|
282
|
-
setExpandedKeys([]);
|
|
283
|
-
};
|
|
284
|
-
useEffect(() => () => handleResetData(), []);
|
|
285
|
-
useEffect(() => {
|
|
286
|
-
if (dataRecorded) {
|
|
287
|
-
const dataRecordedBlob = new Blob(dataRecorded, { type: 'video/mp4' });
|
|
288
|
-
const url = URL.createObjectURL(dataRecordedBlob);
|
|
289
|
-
setUrlVideoPreview(url);
|
|
290
|
-
}
|
|
291
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
292
|
-
}, [dataRecorded]);
|
|
293
|
-
useEffect(() => {
|
|
294
|
-
if (isForceStopRecorder && !isEmpty(dataRecorded)) {
|
|
295
|
-
setDataRecorded([]);
|
|
296
|
-
setIsForceStopRecorder(false);
|
|
297
|
-
}
|
|
298
|
-
}, [dataRecorded, isForceStopRecorder]);
|
|
299
|
-
useEffect(() => () => {
|
|
300
|
-
if (streamTracks.current) {
|
|
301
|
-
const { desktopStream, voiceStream } = streamTracks.current;
|
|
302
|
-
if (desktopStream && voiceStream) {
|
|
303
|
-
desktopStream.getTracks().forEach(track => track.stop());
|
|
304
|
-
voiceStream.getTracks().forEach(track => track.stop());
|
|
305
|
-
}
|
|
306
|
-
}
|
|
307
|
-
}, []);
|
|
308
|
-
const fetchDataListHelp = () => {
|
|
309
|
-
setIsLoadingHelp(true);
|
|
310
|
-
TicketService.help.callApi
|
|
311
|
-
.getList({ appCode, role: '1' }, domainPlatform, token, config, userId)
|
|
312
|
-
.then(res => {
|
|
313
|
-
if (res && res.data.code === 200 && res.data) {
|
|
314
|
-
const { data } = res.data;
|
|
315
|
-
setDataListHelp(data);
|
|
316
|
-
setIsLoadingHelp(false);
|
|
317
|
-
setExpandedKeys(expendDefault(data));
|
|
318
|
-
}
|
|
319
|
-
else {
|
|
320
|
-
setIsLoadingHelp(true);
|
|
321
|
-
}
|
|
322
|
-
})
|
|
323
|
-
.catch(err => {
|
|
324
|
-
// console.log('err ===>', err)
|
|
325
|
-
});
|
|
326
|
-
};
|
|
327
|
-
const handleCreateRecorder = () => __awaiter(void 0, void 0, void 0, function* () {
|
|
328
|
-
try {
|
|
329
|
-
let controller;
|
|
330
|
-
if ('CaptureController' in window &&
|
|
331
|
-
'setFocusBehavior' in window.CaptureController.prototype) {
|
|
332
|
-
controller = new window.CaptureController();
|
|
333
|
-
controller.setFocusBehavior('no-focus-change');
|
|
334
|
-
}
|
|
335
|
-
const displayMediaOptions = {
|
|
336
|
-
// preferCurrentTab: true,
|
|
337
|
-
video: {
|
|
338
|
-
cursor: 'always',
|
|
339
|
-
},
|
|
340
|
-
audio: true,
|
|
341
|
-
controller,
|
|
342
|
-
selfBrowserSurface: 'include',
|
|
343
|
-
};
|
|
344
|
-
const desktopStream = yield navigator.mediaDevices.getDisplayMedia(displayMediaOptions);
|
|
345
|
-
const voiceStream = yield navigator.mediaDevices.getUserMedia({
|
|
346
|
-
video: false,
|
|
347
|
-
audio: !isMute,
|
|
348
|
-
});
|
|
349
|
-
const tracks = [
|
|
350
|
-
...desktopStream.getVideoTracks(),
|
|
351
|
-
...mergeAudioStreams(desktopStream, voiceStream),
|
|
352
|
-
];
|
|
353
|
-
const stream = new MediaStream(tracks);
|
|
354
|
-
const recorder = new MediaRecorder(stream);
|
|
355
|
-
const data = [];
|
|
356
|
-
// ondataavailable -> fired periodically each time timeslice millisecond of media have been recorded
|
|
357
|
-
// or when the entire media is recorded if no timeslice is specified
|
|
358
|
-
recorder.ondataavailable = event => data.push(event.data);
|
|
359
|
-
const stopped = new Promise((resolve, reject) => {
|
|
360
|
-
recorder.onstop = resolve;
|
|
361
|
-
recorder.onerror = (event) => reject(event.name);
|
|
362
|
-
});
|
|
363
|
-
Promise.all([stopped, recorder]).then(() => {
|
|
364
|
-
setDataRecorded(data);
|
|
365
|
-
});
|
|
366
|
-
const videoTrack = desktopStream.getVideoTracks()[0];
|
|
367
|
-
// eslint-disable-next-line func-names
|
|
368
|
-
videoTrack.onended = function () {
|
|
369
|
-
if (recorder) {
|
|
370
|
-
recorder.stop();
|
|
371
|
-
}
|
|
372
|
-
desktopStream.getTracks().forEach(track => track.stop());
|
|
373
|
-
voiceStream.getTracks().forEach(track => track.stop());
|
|
374
|
-
setIsShowPopup(true);
|
|
375
|
-
setIsOpenImageDrawer(false);
|
|
376
|
-
};
|
|
377
|
-
recorderRef.current = recorder;
|
|
378
|
-
streamTracks.current = {
|
|
379
|
-
desktopStream,
|
|
380
|
-
voiceStream,
|
|
381
|
-
};
|
|
382
|
-
setIsForceStopRecorder(false);
|
|
383
|
-
setIsOpenImageDrawer(true);
|
|
384
|
-
handleCancel();
|
|
385
|
-
setIsShowPopup(false);
|
|
386
|
-
}
|
|
387
|
-
catch (error) {
|
|
388
|
-
console.log('error :>', error);
|
|
389
|
-
setIsShowPopup(true);
|
|
390
|
-
}
|
|
391
|
-
});
|
|
392
|
-
const handleCaptureScreen = () => __awaiter(void 0, void 0, void 0, function* () {
|
|
393
|
-
try {
|
|
394
|
-
let controller;
|
|
395
|
-
if ('CaptureController' in window &&
|
|
396
|
-
'setFocusBehavior' in window.CaptureController.prototype) {
|
|
397
|
-
controller = new window.CaptureController();
|
|
398
|
-
controller.setFocusBehavior('no-focus-change');
|
|
399
|
-
}
|
|
400
|
-
const displayMediaOptions = {
|
|
401
|
-
// preferCurrentTab: true,
|
|
402
|
-
video: {
|
|
403
|
-
displaySurface: 'browser',
|
|
404
|
-
cursor: 'always',
|
|
405
|
-
},
|
|
406
|
-
audio: false,
|
|
407
|
-
surfaceSwitching: 'include',
|
|
408
|
-
controller,
|
|
409
|
-
selfBrowserSurface: 'include',
|
|
410
|
-
};
|
|
411
|
-
// navigator.mediaDevices.enumerateDevices().then(value => {
|
|
412
|
-
// console.log('insideee.dev - list :>', value);
|
|
413
|
-
// });
|
|
414
|
-
// asking permission to use a media input to record current tab
|
|
415
|
-
const supportedConstraints = navigator.mediaDevices.getSupportedConstraints();
|
|
416
|
-
// if (supportedConstraints.displaySurface) {
|
|
417
|
-
// displayMediaOptions.video.displaySurface = 'monitor';
|
|
418
|
-
// }
|
|
419
|
-
if (supportedConstraints.width) {
|
|
420
|
-
displayMediaOptions.video.width = { ideal: 1920, max: 1920 };
|
|
421
|
-
}
|
|
422
|
-
if (supportedConstraints.height) {
|
|
423
|
-
displayMediaOptions.video.heigh = { ideal: 1080 };
|
|
424
|
-
}
|
|
425
|
-
if (supportedConstraints.aspectRatio) {
|
|
426
|
-
displayMediaOptions.video.aspectRatio = 1.777777778;
|
|
427
|
-
}
|
|
428
|
-
if (supportedConstraints.frameRate) {
|
|
429
|
-
displayMediaOptions.video.frameRate = { max: 30 };
|
|
430
|
-
}
|
|
431
|
-
const stream = yield navigator.mediaDevices.getDisplayMedia(displayMediaOptions);
|
|
432
|
-
const video = document.createElement('video');
|
|
433
|
-
video === null || video === void 0 ? void 0 : video.addEventListener('loadedmetadata', () => {
|
|
434
|
-
const canvas = document.createElement('canvas');
|
|
435
|
-
const ctx = canvas.getContext('2d');
|
|
436
|
-
// passing video width & height as canvas width & height
|
|
437
|
-
canvas.width = video.videoWidth;
|
|
438
|
-
canvas.height = video.videoHeight;
|
|
439
|
-
video.play(); // playing the video so the drawn image won't be black or blank
|
|
440
|
-
// drawing an image of the captured video stream
|
|
441
|
-
ctx === null || ctx === void 0 ? void 0 : ctx.drawImage(video, 0, 0, canvas.width, canvas.height);
|
|
442
|
-
stream.getVideoTracks()[0].stop(); // terminating first video track of the stream
|
|
443
|
-
// passing canvas data url as screenshot preview src
|
|
444
|
-
setUrlImageDrawer(canvas.toDataURL());
|
|
445
|
-
setIsOpenImageDrawer(true);
|
|
446
|
-
handleCancel();
|
|
447
|
-
setIsShowPopup(false);
|
|
448
|
-
});
|
|
449
|
-
video.srcObject = stream; // passing capture stream data as video source object
|
|
450
|
-
}
|
|
451
|
-
catch (error) {
|
|
452
|
-
// if image couldn't capture by any reason, then alert the msg
|
|
453
|
-
// eslint-disable-next-line no-console
|
|
454
|
-
console.info('Failed to capture screenshot!', error);
|
|
455
|
-
setIsShowPopup(true);
|
|
456
|
-
}
|
|
457
|
-
});
|
|
458
|
-
const callback = (type, dataIn) => {
|
|
459
|
-
switch (type) {
|
|
460
|
-
case 'ON_CLOSE_POPUP': {
|
|
461
|
-
handleResetData();
|
|
462
|
-
break;
|
|
463
|
-
}
|
|
464
|
-
case 'ON_BACK_POPUP': {
|
|
465
|
-
setType(REPORT_TYPES.HELP);
|
|
466
|
-
break;
|
|
467
|
-
}
|
|
468
|
-
case REPORT_TYPES.ISSUE: {
|
|
469
|
-
setTitle('Report an issue to Antsomi');
|
|
470
|
-
setType(type);
|
|
471
|
-
break;
|
|
472
|
-
}
|
|
473
|
-
case REPORT_TYPES.IDEA: {
|
|
474
|
-
setTitle('Request an idea to Antsomi');
|
|
475
|
-
setType(type);
|
|
476
|
-
break;
|
|
477
|
-
}
|
|
478
|
-
case 'CLOSE_DRAWER': {
|
|
479
|
-
setIsOpenImageDrawer(false);
|
|
480
|
-
setIsShowPopup(true);
|
|
481
|
-
if (captureType === ATTACH_KEYS.CAPTURE) {
|
|
482
|
-
setUrlImageDrawer('');
|
|
483
|
-
}
|
|
484
|
-
else if (captureType === ATTACH_KEYS.RECORD) {
|
|
485
|
-
setIsForceStopRecorder(true);
|
|
486
|
-
const recorder = recorderRef.current;
|
|
487
|
-
const { desktopStream, voiceStream } = streamTracks.current;
|
|
488
|
-
if (recorder && recorder.state === 'recording') {
|
|
489
|
-
recorder.stop();
|
|
490
|
-
}
|
|
491
|
-
if (desktopStream && voiceStream) {
|
|
492
|
-
desktopStream.getTracks().forEach(track => track.stop());
|
|
493
|
-
voiceStream.getTracks().forEach(track => track.stop());
|
|
494
|
-
}
|
|
495
|
-
}
|
|
496
|
-
break;
|
|
497
|
-
}
|
|
498
|
-
case 'ON_DRAWER_DONE': {
|
|
499
|
-
setIsOpenImageDrawer(false);
|
|
500
|
-
setImageDrew(dataIn);
|
|
501
|
-
setIsShowPopup(true);
|
|
502
|
-
break;
|
|
503
|
-
}
|
|
504
|
-
case 'STOP_RECORDER': {
|
|
505
|
-
setIsOpenImageDrawer(false);
|
|
506
|
-
setIsShowPopup(true);
|
|
507
|
-
streamTracks.current = undefined;
|
|
508
|
-
break;
|
|
509
|
-
}
|
|
510
|
-
case 'ON_CHANGE_MUTE': {
|
|
511
|
-
setIsMute(prevMute => !prevMute);
|
|
512
|
-
break;
|
|
513
|
-
}
|
|
514
|
-
case 'SET_POSITION_DRAG': {
|
|
515
|
-
const { name = '', x = 0, y = 0 } = dataIn;
|
|
516
|
-
if (name === ATTACH_KEYS.CAPTURE) {
|
|
517
|
-
setDefaultPositionDrawActions({ x, y });
|
|
518
|
-
}
|
|
519
|
-
if (name === ATTACH_KEYS.RECORD) {
|
|
520
|
-
setDefaultPositionRecordActions({ x, y });
|
|
521
|
-
}
|
|
522
|
-
break;
|
|
523
|
-
}
|
|
524
|
-
case 'RESET_POSITION_DRAG': {
|
|
525
|
-
setDefaultPositionDrawActions(DEFAULT_POSITIONS.capture);
|
|
526
|
-
setDefaultPositionRecordActions(DEFAULT_POSITIONS.record);
|
|
527
|
-
break;
|
|
528
|
-
}
|
|
529
|
-
default: {
|
|
530
|
-
break;
|
|
531
|
-
}
|
|
532
|
-
}
|
|
533
|
-
};
|
|
534
|
-
const handleCreateTicket = (params) => __awaiter(void 0, void 0, void 0, function* () {
|
|
535
|
-
try {
|
|
536
|
-
setIsMainLoading(true);
|
|
537
|
-
let attachments = [];
|
|
538
|
-
const { imageDrew = {}, dataRecorded = [], type = '' } = params, restParams = __rest(params, ["imageDrew", "dataRecorded", "type"]);
|
|
539
|
-
if (params.attachments && !isEmpty(params.attachments)) {
|
|
540
|
-
attachments = [...params.attachments];
|
|
541
|
-
}
|
|
542
|
-
if (imageDrew.dataURL) {
|
|
543
|
-
const imageFile = base64ToFile(imageDrew.dataURL, `${imageDrew.imageName}-${generateUniqueId()}.png`);
|
|
544
|
-
if (imageFile) {
|
|
545
|
-
const uploadFormData = new FormData();
|
|
546
|
-
uploadFormData.append('file', imageFile);
|
|
547
|
-
const uploadFileParams = {
|
|
548
|
-
data: uploadFormData,
|
|
549
|
-
};
|
|
550
|
-
const res = yield TicketService.tickets.callApi.upload(uploadFileParams, domainTicket, token, config, userId, 'ticket');
|
|
551
|
-
if (res && res.code === 200 && res.data) {
|
|
552
|
-
attachments.push(res.data.token);
|
|
553
|
-
}
|
|
554
|
-
}
|
|
555
|
-
}
|
|
556
|
-
if (!isEmpty(dataRecorded)) {
|
|
557
|
-
const blob = dataRecorded[0];
|
|
558
|
-
const blobName = `video-${generateUniqueId()}.mp4`;
|
|
559
|
-
const videoFile = convertBlobToFile(blob, blobName);
|
|
560
|
-
if (videoFile) {
|
|
561
|
-
const uploadFormData = new FormData();
|
|
562
|
-
uploadFormData.append('file', videoFile);
|
|
563
|
-
const res = yield TicketService.tickets.callApi.upload({ data: uploadFormData }, domainTicket, token, config, userId, 'ticket');
|
|
564
|
-
if (res && res.code === 200 && res.data) {
|
|
565
|
-
attachments.push(res.data.token);
|
|
566
|
-
}
|
|
567
|
-
}
|
|
568
|
-
}
|
|
569
|
-
const dataToAPI = Object.assign(Object.assign({}, restParams), { attachments, networkId: Number(portalId), ticketType: type === REPORT_TYPES.ISSUE ? 'bug' : 'request' });
|
|
570
|
-
const res = yield TicketService.tickets.callApi.createTicket(dataToAPI, domainTicket, token, config, userId);
|
|
571
|
-
if (res.code === 200) {
|
|
572
|
-
postCustomEvent(TICKET_CUSTOM_MESSAGE_KEY, {
|
|
573
|
-
type: MESSAGE_TYPE.TICKET_CREATE_STATUS,
|
|
574
|
-
value: true,
|
|
575
|
-
});
|
|
576
|
-
}
|
|
577
|
-
else {
|
|
578
|
-
postCustomEvent(TICKET_CUSTOM_MESSAGE_KEY, {
|
|
579
|
-
type: MESSAGE_TYPE.TICKET_CREATE_STATUS,
|
|
580
|
-
value: false,
|
|
581
|
-
});
|
|
582
|
-
}
|
|
583
|
-
handleResetData();
|
|
584
|
-
}
|
|
585
|
-
catch (error) {
|
|
586
|
-
// eslint-disable-next-line no-console
|
|
587
|
-
console.log('error :>', error);
|
|
588
|
-
}
|
|
589
|
-
finally {
|
|
590
|
-
setIsMainLoading(false);
|
|
591
|
-
}
|
|
592
|
-
});
|
|
593
|
-
const handleSubmit = () => {
|
|
594
|
-
if (!valueInput.title || !valueInput.message) {
|
|
595
|
-
setIsValidAll(false);
|
|
596
|
-
return;
|
|
597
|
-
}
|
|
598
|
-
if (!errFile.isError) {
|
|
599
|
-
const params = formatParams(Object.assign(Object.assign({}, valueInput), { feature: appTargeting }));
|
|
600
|
-
handleCreateTicket(Object.assign(Object.assign({}, params), { type,
|
|
601
|
-
imageDrew,
|
|
602
|
-
dataRecorded, submitterId: Number(userId) }));
|
|
603
|
-
}
|
|
604
|
-
};
|
|
605
|
-
// console.log('insideee.dev - data :>', valueInput, appTargeting, errFile);
|
|
606
|
-
const handleShareCapture = (type) => {
|
|
607
|
-
setCaptureType(type);
|
|
608
|
-
setIsShowPopup(false);
|
|
609
|
-
return () => {
|
|
610
|
-
if (type === ATTACH_KEYS.CAPTURE) {
|
|
611
|
-
handleCaptureScreen();
|
|
612
|
-
}
|
|
613
|
-
else {
|
|
614
|
-
handleCreateRecorder();
|
|
615
|
-
}
|
|
616
|
-
};
|
|
617
|
-
};
|
|
618
|
-
const handleChangeAttachFile = (key, type) => {
|
|
619
|
-
if (type === 'edit') {
|
|
620
|
-
// showModal(key);
|
|
621
|
-
handleShareCapture(key)();
|
|
622
|
-
}
|
|
623
|
-
else if (type === 'delete') {
|
|
624
|
-
if (key === ATTACH_KEYS.CAPTURE) {
|
|
625
|
-
setImageDrew({
|
|
626
|
-
imageName: '',
|
|
627
|
-
dataURL: '',
|
|
628
|
-
});
|
|
629
|
-
}
|
|
630
|
-
else if (key === ATTACH_KEYS.RECORD) {
|
|
631
|
-
setDataRecorded([]);
|
|
632
|
-
}
|
|
633
|
-
}
|
|
634
|
-
};
|
|
635
|
-
const onSelect = (selectedKeys, info) => {
|
|
636
|
-
const { node } = info;
|
|
637
|
-
const { path } = node;
|
|
638
|
-
if (path) {
|
|
639
|
-
setHelp(path);
|
|
640
|
-
setType(REPORT_TYPES.HELP_V1);
|
|
641
|
-
}
|
|
642
|
-
// console.log('selected', selectedKeys, info);
|
|
643
|
-
};
|
|
644
|
-
const onExpand = (newExpandedKeys) => {
|
|
645
|
-
setExpandedKeys(newExpandedKeys);
|
|
646
|
-
setAutoExpandParent(false);
|
|
647
|
-
};
|
|
648
|
-
const getParentKey = (key, tree) => {
|
|
649
|
-
let parentKey;
|
|
650
|
-
for (let i = 0; i < tree.length; i++) {
|
|
651
|
-
const node = tree[i];
|
|
652
|
-
if (node.children) {
|
|
653
|
-
if (node.children.some(item => item.key === key)) {
|
|
654
|
-
parentKey = node.key;
|
|
655
|
-
}
|
|
656
|
-
else if (getParentKey(key, node.children)) {
|
|
657
|
-
parentKey = getParentKey(key, node.children);
|
|
658
|
-
}
|
|
659
|
-
}
|
|
660
|
-
}
|
|
661
|
-
return parentKey;
|
|
662
|
-
};
|
|
663
|
-
// const onExpand: DirectoryTreeProps['onCheck'] = (checkedKeys, info) => {
|
|
664
|
-
// console.log('onCheck', checkedKeys, info);
|
|
665
|
-
// };
|
|
666
|
-
const dataList = [];
|
|
667
|
-
const generateList = (data) => {
|
|
668
|
-
for (let i = 0; i < data.length; i++) {
|
|
669
|
-
const node = data[i];
|
|
670
|
-
const { key, title } = node;
|
|
671
|
-
dataList.push({ key, title });
|
|
672
|
-
if (node.children) {
|
|
673
|
-
generateList(node.children);
|
|
674
|
-
}
|
|
675
|
-
}
|
|
676
|
-
};
|
|
677
|
-
generateList(dataListHelp);
|
|
678
|
-
const onChange = (e) => {
|
|
679
|
-
const { value } = e.target;
|
|
680
|
-
const newExpandedKeys = dataList
|
|
681
|
-
.map(item => {
|
|
682
|
-
if (item.title.toString().toLowerCase().indexOf(value.toLowerCase()) > -1) {
|
|
683
|
-
return getParentKey(item.key, dataListHelp);
|
|
684
|
-
}
|
|
685
|
-
return null;
|
|
686
|
-
})
|
|
687
|
-
.filter((item, i, self) => item && self.indexOf(item) === i);
|
|
688
|
-
setExpandedKeys(newExpandedKeys);
|
|
689
|
-
setSearchValue(value);
|
|
690
|
-
setAutoExpandParent(true);
|
|
691
|
-
};
|
|
692
|
-
const renderIcon = (name, style) => ({
|
|
693
|
-
'icon-ants-capture': React.createElement(CaptureIcon, { style: style }),
|
|
694
|
-
'icon-ants-camera': React.createElement(CameraIcon, { style: style }),
|
|
695
|
-
}[name]);
|
|
696
|
-
const treeData = useMemo(() => {
|
|
697
|
-
const loop = (data) => data.map(item => {
|
|
698
|
-
const strTitle = item.title;
|
|
699
|
-
const index = strTitle.toString().toLowerCase().indexOf(searchValue.toLowerCase());
|
|
700
|
-
const beforeStr = strTitle.substring(0, index);
|
|
701
|
-
const afterStr = strTitle.slice(index + searchValue.length);
|
|
702
|
-
const title = index > -1 ? (React.createElement(Span, { styles: item.children },
|
|
703
|
-
beforeStr,
|
|
704
|
-
React.createElement(TitleSearch, null, searchValue),
|
|
705
|
-
afterStr)) : (React.createElement(Span, { styles: item.children }, strTitle));
|
|
706
|
-
if (item.children) {
|
|
707
|
-
return { title, key: item.key, children: loop(item.children) };
|
|
708
|
-
}
|
|
709
|
-
return {
|
|
710
|
-
title,
|
|
711
|
-
key: item.key,
|
|
712
|
-
path: item.path,
|
|
713
|
-
};
|
|
714
|
-
});
|
|
715
|
-
return loop(dataListHelp);
|
|
716
|
-
}, [searchValue, dataListHelp]);
|
|
717
|
-
const renderAttachActions = () => ATTACH_CAPTURE_TYPES.map(item => {
|
|
718
|
-
var _a, _b, _c;
|
|
719
|
-
return (React.createElement(ControlGroup, { key: item.key, size: 10, direction: "vertical", style: { width: 'auto' } },
|
|
720
|
-
((item.key === ATTACH_KEYS.CAPTURE && imageDrew.dataURL) ||
|
|
721
|
-
(!isForceStopRecorder &&
|
|
722
|
-
!isEmpty(dataRecorded) &&
|
|
723
|
-
urlVideoPreview &&
|
|
724
|
-
item.key === ATTACH_KEYS.RECORD)) && (React.createElement(PreviewBox, null,
|
|
725
|
-
React.createElement(Overlay, { className: "overlay-preview" },
|
|
726
|
-
React.createElement(FlexCenter, { style: { height: '100%', gap: 10 } }, (_a = item.actions) === null || _a === void 0 ? void 0 : _a.map(action => {
|
|
727
|
-
var _a, _b;
|
|
728
|
-
return (React.createElement(ButtonFeedback, { key: `${item.key}-${action.key}`, height: 28, style: {
|
|
729
|
-
borderRadius: `${(_a = THEME.token) === null || _a === void 0 ? void 0 : _a.borderRadius}px`,
|
|
730
|
-
width: 34,
|
|
731
|
-
}, borderRadiusCustom: 3, icon: React.createElement(Icon, { type: action.icon, style: {
|
|
732
|
-
color: (_b = THEME.token) === null || _b === void 0 ? void 0 : _b.colorPrimary,
|
|
733
|
-
fontSize: '24px',
|
|
734
|
-
} }), onClick: () => handleChangeAttachFile(item.key, action.key) }));
|
|
735
|
-
}))),
|
|
736
|
-
item.key === ATTACH_KEYS.CAPTURE ? (React.createElement(Image, { src: imageDrew.dataURL, alt: "send feedback", isFull: true })) : (React.createElement(Video, { src: urlVideoPreview, muted: true, autoPlay: false, controls: false })))),
|
|
737
|
-
React.createElement(ButtonFeedback, { height: 28, borderRadiusCustom: 3, style: {
|
|
738
|
-
borderRadius: `${(_b = THEME.token) === null || _b === void 0 ? void 0 : _b.borderRadius}px`,
|
|
739
|
-
marginBottom: 58,
|
|
740
|
-
}, icon:
|
|
741
|
-
// <Icon
|
|
742
|
-
// type={item.icon}
|
|
743
|
-
// style={{ color: `${THEME.token?.colorPrimary}`, fontSize: '24px' }}
|
|
744
|
-
// />
|
|
745
|
-
renderIcon(item.icon, {
|
|
746
|
-
fill: (_c = THEME.token) === null || _c === void 0 ? void 0 : _c.colorPrimary,
|
|
747
|
-
maxWidth: '24px',
|
|
748
|
-
}),
|
|
749
|
-
// onClick={() => showModal(item.key)}
|
|
750
|
-
onClick: () => handleShareCapture(item.key)() }, item.label)));
|
|
751
|
-
});
|
|
752
|
-
const renderContentPopup = (type) => {
|
|
753
|
-
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
754
|
-
switch (type) {
|
|
755
|
-
case REPORT_TYPES.FEEDBACK: {
|
|
756
|
-
return (React.createElement(SendFeedback, null,
|
|
757
|
-
React.createElement(FlexCenter, null,
|
|
758
|
-
React.createElement(WrapperImage, null,
|
|
759
|
-
React.createElement(HiddenBlock, null),
|
|
760
|
-
React.createElement(Image, { src: "https://st-media-template.antsomi.com/upload/2023/06/16/aa5d68c3-40a2-425f-beb4-cb1abd89e8cb.png", alt: "send feedback", style: { maxWidth: 'unset' } }))),
|
|
761
|
-
React.createElement(FlexCenter, { style: { margin: '50px 3px 0' } },
|
|
762
|
-
React.createElement(FlexCenter, { onClick: e => {
|
|
763
|
-
e.stopPropagation();
|
|
764
|
-
callback(REPORT_TYPES.ISSUE);
|
|
765
|
-
} },
|
|
766
|
-
React.createElement(ButtonFeedback, { icon:
|
|
767
|
-
// <Icon
|
|
768
|
-
// type="icon-ants-bug"
|
|
769
|
-
// style={{ color: `${THEME.token?.colorIcon}`, fontSize: '24px' }}
|
|
770
|
-
// />
|
|
771
|
-
React.createElement(BugIcon, { style: { fill: (_a = THEME.token) === null || _a === void 0 ? void 0 : _a.colorIcon, maxWidth: '24px' } }), style: { marginRight: 15 } },
|
|
772
|
-
React.createElement(Text, null, "Report an Issue"))),
|
|
773
|
-
React.createElement(FlexCenter, { onClick: e => {
|
|
774
|
-
e.stopPropagation();
|
|
775
|
-
callback(REPORT_TYPES.IDEA);
|
|
776
|
-
} },
|
|
777
|
-
React.createElement(ButtonFeedback, { icon:
|
|
778
|
-
// <Icon
|
|
779
|
-
// type="icon-ants-idea"
|
|
780
|
-
// style={{ color: `${THEME.token?.colorIcon}`, fontSize: '24px' }}
|
|
781
|
-
// />
|
|
782
|
-
React.createElement(RequestIcon, { style: { fill: (_b = THEME.token) === null || _b === void 0 ? void 0 : _b.colorIcon, maxWidth: '24px' } }) },
|
|
783
|
-
React.createElement(Text, null, "Request an Idea"))))));
|
|
784
|
-
}
|
|
785
|
-
case REPORT_TYPES.IDEA:
|
|
786
|
-
case REPORT_TYPES.ISSUE: {
|
|
787
|
-
return (React.createElement(ControlGroup, { size: 20, direction: "vertical" },
|
|
788
|
-
React.createElement(ControlGroup, { size: 0, direction: "vertical" },
|
|
789
|
-
React.createElement(ControlLabel, null, "When you noticed this issue, what were you trying to do?"),
|
|
790
|
-
React.createElement(Select, { defaultValue: appTargeting, value: appTargeting, style: { width: '100%' }, onChange: (_, option) => setAppTargeting(option), options: allAppOptions })),
|
|
791
|
-
React.createElement(ControlGroup, { size: 0, direction: "vertical" },
|
|
792
|
-
React.createElement(ControlLabel, null,
|
|
793
|
-
"Title ",
|
|
794
|
-
React.createElement("span", { style: { color: (_c = THEME.token) === null || _c === void 0 ? void 0 : _c.red8 } }, "*")),
|
|
795
|
-
React.createElement(Input, { placeholder: "Enter ticket title", value: valueInput.title, onChange: event => {
|
|
796
|
-
const { value } = event === null || event === void 0 ? void 0 : event.target;
|
|
797
|
-
event.stopPropagation();
|
|
798
|
-
setValueInput(prev => (Object.assign(Object.assign({}, prev), { title: value })));
|
|
799
|
-
} }),
|
|
800
|
-
React.createElement(ErrorMessage, { isShow: !isValidAll && !(valueInput === null || valueInput === void 0 ? void 0 : valueInput.title) }, "*This field can't be empty")),
|
|
801
|
-
React.createElement(ControlGroup, { size: 0, direction: "vertical" },
|
|
802
|
-
React.createElement(ControlLabel, null,
|
|
803
|
-
"Message ",
|
|
804
|
-
React.createElement("span", { style: { color: (_d = THEME.token) === null || _d === void 0 ? void 0 : _d.red8 } }, "*")),
|
|
805
|
-
React.createElement(EditorWrapper, null,
|
|
806
|
-
React.createElement(Editor, { apiKey: apiKey, value: valueInput.message, init: {
|
|
807
|
-
height: 200,
|
|
808
|
-
width: '100%',
|
|
809
|
-
max_height: 800,
|
|
810
|
-
max_width: 800,
|
|
811
|
-
menubar: false,
|
|
812
|
-
plugins: [
|
|
813
|
-
'advlist autolink lists link tinydrive image emoticons charmap print preview anchor',
|
|
814
|
-
'searchreplace visualblocks code fullscreen',
|
|
815
|
-
'insertdatetime media paste code help wordcount ', //
|
|
816
|
-
],
|
|
817
|
-
toolbar: 'formatselect | bold italic underline strikethrough code | image emoticons | \
|
|
818
|
-
forecolor backcolor preview link |\
|
|
819
|
-
alignleft aligncenter alignright alignjustify outdent indent |\
|
|
820
|
-
numlist bullist checklist undo redo',
|
|
821
|
-
tinydrive_token_provider: `//${modifiedDomain}/hub/thirdparty-services/v2.0/tinymce?portalId=${portalId}&token=${token}`,
|
|
822
|
-
skin: 'snow',
|
|
823
|
-
toolbar_mode: 'sliding',
|
|
824
|
-
content_css: false,
|
|
825
|
-
branding: false,
|
|
826
|
-
resize: false,
|
|
827
|
-
statusbar: false,
|
|
828
|
-
setup(editor) {
|
|
829
|
-
editor.on('init', e => {
|
|
830
|
-
var _a;
|
|
831
|
-
editor.getBody().style.fontSize = `${(_a = THEME.token) === null || _a === void 0 ? void 0 : _a.fontSize}px`;
|
|
832
|
-
});
|
|
833
|
-
},
|
|
834
|
-
placeholder: 'Enter your comment...',
|
|
835
|
-
entity_encoding: 'raw',
|
|
836
|
-
paste_data_images: true,
|
|
837
|
-
},
|
|
838
|
-
// disabled={!!props.disabled}
|
|
839
|
-
// outputFormat='text'
|
|
840
|
-
onEditorChange: content => setValueInput(prevVal => (Object.assign(Object.assign({}, prevVal), { message: content }))) }),
|
|
841
|
-
React.createElement("div", null,
|
|
842
|
-
((_e = valueInput.files) === null || _e === void 0 ? void 0 : _e.length) > 0 && (React.createElement(WrapperLinkFiles, null, (_f = valueInput.files) === null || _f === void 0 ? void 0 : _f.map(file => {
|
|
843
|
-
var _a, _b, _c;
|
|
844
|
-
return (React.createElement(WrapperLinkItemFiles, { key: file === null || file === void 0 ? void 0 : file.token },
|
|
845
|
-
React.createElement("span", { style: {
|
|
846
|
-
display: 'flex',
|
|
847
|
-
alignItems: 'center',
|
|
848
|
-
gap: '10px',
|
|
849
|
-
} },
|
|
850
|
-
React.createElement(Icon, { type: "icon-ants-hyperlink", style: {
|
|
851
|
-
color: (_a = THEME.token) === null || _a === void 0 ? void 0 : _a.colorPrimary,
|
|
852
|
-
fontSize: '24px',
|
|
853
|
-
} }, "link"),
|
|
854
|
-
React.createElement(Text, { style: {
|
|
855
|
-
color: '#000',
|
|
856
|
-
fontSize: `${(_b = THEME.token) === null || _b === void 0 ? void 0 : _b.fontSize}px`,
|
|
857
|
-
} }, file === null || file === void 0 ? void 0 : file.file_name)),
|
|
858
|
-
React.createElement(Icon, { type: "icon-ants-remove-slim", style: {
|
|
859
|
-
color: (_c = THEME.token) === null || _c === void 0 ? void 0 : _c.colorIcon,
|
|
860
|
-
fontSize: '12px',
|
|
861
|
-
cursor: 'pointer',
|
|
862
|
-
}, onClick: () => handleRemoveFile(file === null || file === void 0 ? void 0 : file.token) }, "clear")));
|
|
863
|
-
}))),
|
|
864
|
-
React.createElement(WrapperIconEditor, { borderTop: Boolean((_g = valueInput.files) === null || _g === void 0 ? void 0 : _g.length) },
|
|
865
|
-
React.createElement(WrapperInputFile, null,
|
|
866
|
-
React.createElement("label", { htmlFor: "fileImage" },
|
|
867
|
-
React.createElement(Icon, { type: "icon-ants-hyperlink", style: {
|
|
868
|
-
color: (_h = THEME.token) === null || _h === void 0 ? void 0 : _h.colorPrimary,
|
|
869
|
-
fontSize: '24px',
|
|
870
|
-
position: 'absolute',
|
|
871
|
-
top: 0,
|
|
872
|
-
right: 0,
|
|
873
|
-
cursor: 'pointer',
|
|
874
|
-
} }, "link")),
|
|
875
|
-
React.createElement("input", { type: "file", style: {
|
|
876
|
-
position: 'absolute',
|
|
877
|
-
top: 0,
|
|
878
|
-
right: 0,
|
|
879
|
-
display: 'none',
|
|
880
|
-
}, name: "fileImage", id: "fileImage", onChange: handleOnchangeFile }))))),
|
|
881
|
-
errFile.isError ? (React.createElement(ErrorMessage, { isShow: errFile.isError }, errFile.message)) : (React.createElement(ErrorMessage, { isShow: !isValidAll && !(valueInput === null || valueInput === void 0 ? void 0 : valueInput.message) }, "*This field can't be empty"))),
|
|
882
|
-
React.createElement(ControlGroup, { size: 0, direction: "vertical" },
|
|
883
|
-
React.createElement(ControlLabel, null, "Attached Screenshot/ Video Recorded"),
|
|
884
|
-
React.createElement(FlexCenter, { style: {
|
|
885
|
-
justifyContent: 'flex-start',
|
|
886
|
-
alignItems: 'flex-start',
|
|
887
|
-
gap: 10,
|
|
888
|
-
} }, renderAttachActions()))));
|
|
889
|
-
}
|
|
890
|
-
case REPORT_TYPES.HELP: {
|
|
891
|
-
return (React.createElement(Wrapper, null,
|
|
892
|
-
React.createElement(WrapperSearch, { placeholder: "Search...", onChange: onChange }),
|
|
893
|
-
React.createElement("div", { style: { padding: '13px 15px' } },
|
|
894
|
-
React.createElement(LabelTitle, null, "Popular Help Resources"),
|
|
895
|
-
isLoadingListHelp && (React.createElement(WrapperLoading, { style: { background: 'none' }, height: "80%", width: "100%" },
|
|
896
|
-
React.createElement(Spin, { indicator: antIcon }))),
|
|
897
|
-
treeData.length > 0 &&
|
|
898
|
-
treeData.map(item => (React.createElement(WrapperContentHelp, null,
|
|
899
|
-
React.createElement(TreeContent, { onSelect: onSelect, onExpand: onExpand, treeData: [item], expandedKeys: expandedKeys, autoExpandParent: autoExpandParent })))))));
|
|
900
|
-
}
|
|
901
|
-
case REPORT_TYPES.CHAT: {
|
|
902
|
-
return (React.createElement(ChatBox, { domain: domainTicket, userId: userId, token: token, avatar: avatar, style: {
|
|
903
|
-
height: 'calc(100% - 50px)',
|
|
904
|
-
}, withoutBox: true }));
|
|
905
|
-
}
|
|
906
|
-
case REPORT_TYPES.HELP_V1: {
|
|
907
|
-
return (React.createElement(Wrapper, null,
|
|
908
|
-
React.createElement(IframeHelp, { src: pathHelp })));
|
|
909
|
-
}
|
|
910
|
-
default: {
|
|
911
|
-
return null;
|
|
912
|
-
}
|
|
913
|
-
}
|
|
914
|
-
};
|
|
915
|
-
const renderPopupLayout = (type) => {
|
|
916
|
-
var _a;
|
|
917
|
-
return (React.createElement(React.Fragment, null,
|
|
918
|
-
React.createElement(Loading, { isLoading: isMainLoading, width: "100%", height: "100%" }),
|
|
919
|
-
React.createElement(WrapperHeader, { className: "cursor" },
|
|
920
|
-
React.createElement(Header, null, title)),
|
|
921
|
-
React.createElement(WrapperBody, { className: "popup-content", style: {
|
|
922
|
-
padding: type === REPORT_TYPES.CHAT ||
|
|
923
|
-
type === REPORT_TYPES.HELP ||
|
|
924
|
-
type === REPORT_TYPES.HELP_V1
|
|
925
|
-
? '0'
|
|
926
|
-
: '13px 15px',
|
|
927
|
-
} }, renderContentPopup(type)),
|
|
928
|
-
![
|
|
929
|
-
REPORT_TYPES.FEEDBACK,
|
|
930
|
-
REPORT_TYPES.HELP,
|
|
931
|
-
REPORT_TYPES.CHAT,
|
|
932
|
-
REPORT_TYPES.HELP_V1,
|
|
933
|
-
].includes(type) && (React.createElement(WrapperFooter, null,
|
|
934
|
-
React.createElement(Button, { type: "primary", style: { marginRight: 15, fontWeight: 'bold' }, onClick: () => handleSubmit() }, "Send"),
|
|
935
|
-
React.createElement(Button, { onClick: () => callback('ON_CLOSE_POPUP') }, "Cancel"))),
|
|
936
|
-
type === REPORT_TYPES.HELP_V1 && (React.createElement(WrapperFooterSpace, null,
|
|
937
|
-
React.createElement(Button, { type: "primary", style: { marginRight: 15, fontWeight: 'bold' }, onClick: () => callback('ON_BACK_POPUP') }, "BACK"),
|
|
938
|
-
React.createElement(Link, { target: "_blank", href: pathHelp, rel: "noreferrer", style: {
|
|
939
|
-
display: 'flex',
|
|
940
|
-
alignItems: 'center',
|
|
941
|
-
gap: 7,
|
|
942
|
-
} },
|
|
943
|
-
"Open in new tab",
|
|
944
|
-
React.createElement(OpenUrlIcon, { style: {
|
|
945
|
-
fill: (_a = THEME.token) === null || _a === void 0 ? void 0 : _a.colorPrimary,
|
|
946
|
-
maxWidth: 18,
|
|
947
|
-
maxHeight: 18,
|
|
948
|
-
} }))))));
|
|
949
|
-
};
|
|
950
|
-
return (React.createElement(React.Fragment, null,
|
|
951
|
-
React.createElement(DropDown, { menu: {
|
|
952
|
-
style: { minWidth: 250, padding: 0 },
|
|
953
|
-
items: items,
|
|
954
|
-
onClick: info => handleClick(info),
|
|
955
|
-
}, onOpenChange: isOpen => setIsOpenDropdown(isOpen), trigger: triggerType, placement: "bottom", className: "dropdown-helps" }, children || (React.createElement(Button, { style: {
|
|
956
|
-
width: 36,
|
|
957
|
-
height: 36,
|
|
958
|
-
borderRadius: '5px',
|
|
959
|
-
}, icon: React.createElement(QuestionCircleOutlined, { style: {
|
|
960
|
-
color: '#666666',
|
|
961
|
-
fontSize: '24px',
|
|
962
|
-
transform: 'unset',
|
|
963
|
-
} }), className: `${isOpenDropdown ? 'antsomi-btn-default-active' : ''}`, onClick: e => e.preventDefault() }))),
|
|
964
|
-
isShowPopup &&
|
|
965
|
-
createPortal(React.createElement(PopupDraggable, { isHiddenResizing: true, bounds: boundsDraggable, isShowResizeHover: isShowResizeHover, callback: callback, styleContainer: {
|
|
966
|
-
display: 'flex',
|
|
967
|
-
flexDirection: 'column',
|
|
968
|
-
textAlign: 'left',
|
|
969
|
-
} }, renderPopupLayout(type)), document.body, PORTALS_ANTSOMI_PACKAGE_UI_KEY_POPUP),
|
|
970
|
-
isOpenImageDrawer &&
|
|
971
|
-
createPortal(React.createElement(CaptureScreen, { recorderConfigs: {
|
|
972
|
-
recorder: recorderRef.current,
|
|
973
|
-
streamTracks: streamTracks.current,
|
|
974
|
-
isMute,
|
|
975
|
-
}, defaultPositions: {
|
|
976
|
-
[ATTACH_KEYS.CAPTURE]: defaultPositionDrawActions,
|
|
977
|
-
[ATTACH_KEYS.RECORD]: defaultPositionRecordActions,
|
|
978
|
-
}, captureType: captureType, src: urlImageDrawer, callback: callback }), document.body, PORTALS_ANTSOMI_PACKAGE_UI_KEY)));
|
|
979
|
-
};
|
|
980
|
-
Help.defaultProps = {
|
|
981
|
-
triggerType: ['click'],
|
|
982
|
-
boundsDraggable: 'body',
|
|
983
|
-
isShowResizeHover: true,
|
|
984
|
-
configs: {
|
|
985
|
-
apiKey: 'scyw71pj8619analvxs56ppc2w2fj2kpy5vnmflhhc300y35',
|
|
986
|
-
domain: '//sandbox-app.cdp.asia',
|
|
987
|
-
domainTicket: 'https://sandbox-issue.antsomi.com',
|
|
988
|
-
portalId: '33167',
|
|
989
|
-
userId: '1600080515',
|
|
990
|
-
token: '5474r2x214z254a4u2a4y4m503w5p2r5a4s2g4x2l5e4',
|
|
991
|
-
domainPlatform: 'https://platform.ants.tech',
|
|
992
|
-
appCode: 'APP_API_HUB',
|
|
993
|
-
avatar: 'https://c0-platform.ants.tech/avatar/2021/09/20/bldjzfbz33.png',
|
|
994
|
-
config: {
|
|
995
|
-
p_timezone: 'Asia/Hong_Kong',
|
|
996
|
-
api_pid: 33167,
|
|
997
|
-
p_f_longdatetime: "dd MMMM 'at' HH:mm:ss",
|
|
998
|
-
user_language: 'en',
|
|
999
|
-
embeddedData: {},
|
|
1000
|
-
INSIGHT_U_OGS: 'uogs',
|
|
1001
|
-
},
|
|
1002
|
-
},
|
|
1003
|
-
children: '',
|
|
1004
|
-
};
|
|
1005
|
-
export { Help };
|
|
1
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
11
|
+
var t = {};
|
|
12
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
13
|
+
t[p] = s[p];
|
|
14
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
15
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
16
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
17
|
+
t[p[i]] = s[p[i]];
|
|
18
|
+
}
|
|
19
|
+
return t;
|
|
20
|
+
};
|
|
21
|
+
/* eslint-disable jsx-a11y/iframe-has-title */
|
|
22
|
+
/* eslint-disable jsx-a11y/label-has-associated-control */
|
|
23
|
+
/* eslint-disable no-multi-str */
|
|
24
|
+
// Libraries
|
|
25
|
+
import React, { useEffect, useMemo, useRef, useState } from 'react';
|
|
26
|
+
import { isEmpty } from 'lodash';
|
|
27
|
+
import { createPortal } from 'react-dom';
|
|
28
|
+
// Assets
|
|
29
|
+
import '@antscorp/icons/main.css';
|
|
30
|
+
// Services
|
|
31
|
+
import TicketService from '@antscorp/antsomi-ui/es/services/Ticket';
|
|
32
|
+
// Component
|
|
33
|
+
import { ButtonFeedback, ControlGroup, ControlLabel, DropDown, EditorWrapper, ErrorMessage, FlexCenter, Header, HiddenBlock, IframeHelp, Image, Label, LabelTitle, Link, Overlay, PreviewBox, SendFeedback, Span, Text, TitleSearch, TreeContent, Video, Wrapper, WrapperBody, WrapperContentHelp, WrapperFooter, WrapperFooterSpace, WrapperHeader, WrapperIconEditor, WrapperImage, WrapperInputFile, WrapperLinkFiles, WrapperLinkItemFiles, WrapperLoading, WrapperSearch, } from './styled';
|
|
34
|
+
import { Button, Spin } from 'antd';
|
|
35
|
+
import Icon from '@antscorp/icons';
|
|
36
|
+
import { Editor } from '@tinymce/tinymce-react';
|
|
37
|
+
import { LoadingOutlined, QuestionCircleOutlined } from '@ant-design/icons';
|
|
38
|
+
// Atoms
|
|
39
|
+
import { Input } from '@antscorp/antsomi-ui/es/components/atoms';
|
|
40
|
+
// Molecules
|
|
41
|
+
import { PopupDraggable, Select, CaptureScreen, ChatBox, } from '@antscorp/antsomi-ui/es/components/molecules';
|
|
42
|
+
// Constants
|
|
43
|
+
import { ATTACH_CAPTURE_TYPES, ATTACH_KEYS, DEFAULT_POSITIONS, MENU_KEYS, MESSAGE_TYPE, PORTALS_ANTSOMI_PACKAGE_UI_KEY, PORTALS_ANTSOMI_PACKAGE_UI_KEY_POPUP, REPORT_TYPES, TICKET_CUSTOM_MESSAGE_KEY, } from './constants';
|
|
44
|
+
import { THEME } from '@antscorp/antsomi-ui/es/constants';
|
|
45
|
+
// Utils
|
|
46
|
+
import { base64ToFile, convertBlobToFile, generateUniqueId, mergeAudioStreams, } from '@antscorp/antsomi-ui/es/components/molecules/CaptureScreen/utils';
|
|
47
|
+
import { expendDefault, formatParams, postCustomEvent } from './utils';
|
|
48
|
+
import { CameraIcon, CaptureIcon, OpenUrlIcon, BugIcon, RequestIcon, } from '@antscorp/antsomi-ui/es/components/icons';
|
|
49
|
+
const antIcon = React.createElement(LoadingOutlined, { style: { fontSize: 40 }, spin: true });
|
|
50
|
+
const Loading = ({ isLoading, height, width }) => isLoading && (React.createElement(WrapperLoading, { className: "loader-container", height: height, width: width },
|
|
51
|
+
React.createElement(Spin, { indicator: antIcon })));
|
|
52
|
+
const Help = props => {
|
|
53
|
+
const { configs, triggerType, boundsDraggable, isShowResizeHover, children } = props;
|
|
54
|
+
const { apiKey, domainPlatform, appCode, domain, portalId, token, userId, config, domainTicket, avatar, } = configs;
|
|
55
|
+
const [isOpenDropdown, setIsOpenDropdown] = useState(false);
|
|
56
|
+
const [defaultPositionDrawActions, setDefaultPositionDrawActions] = useState(DEFAULT_POSITIONS.capture);
|
|
57
|
+
const [defaultPositionRecordActions, setDefaultPositionRecordActions] = useState(DEFAULT_POSITIONS.record);
|
|
58
|
+
const [isMainLoading, setIsMainLoading] = useState(false);
|
|
59
|
+
const [isShowPopup, setIsShowPopup] = useState(false);
|
|
60
|
+
const [title, setTitle] = useState('');
|
|
61
|
+
const [type, setType] = useState(REPORT_TYPES.HELP);
|
|
62
|
+
const [isValidAll, setIsValidAll] = useState(true);
|
|
63
|
+
const [valueInput, setValueInput] = useState({
|
|
64
|
+
title: '',
|
|
65
|
+
ticketType: '',
|
|
66
|
+
priority: 'normal',
|
|
67
|
+
category: '',
|
|
68
|
+
ownerId: Number(userId),
|
|
69
|
+
followers: [],
|
|
70
|
+
message: '',
|
|
71
|
+
files: [],
|
|
72
|
+
referenceUrl: '',
|
|
73
|
+
});
|
|
74
|
+
const [errFile, setErrFile] = useState({
|
|
75
|
+
isError: false,
|
|
76
|
+
message: '',
|
|
77
|
+
});
|
|
78
|
+
const [pathHelp, setHelp] = useState('');
|
|
79
|
+
const [urlImageDrawer, setUrlImageDrawer] = useState('');
|
|
80
|
+
const [urlVideoPreview, setUrlVideoPreview] = useState('');
|
|
81
|
+
const [imageDrew, setImageDrew] = useState({
|
|
82
|
+
imageName: '',
|
|
83
|
+
dataURL: '',
|
|
84
|
+
});
|
|
85
|
+
const [isOpenImageDrawer, setIsOpenImageDrawer] = useState(false);
|
|
86
|
+
const [captureType, setCaptureType] = useState(ATTACH_KEYS.CAPTURE);
|
|
87
|
+
const [open, setOpen] = useState(false);
|
|
88
|
+
const [dataRecorded, setDataRecorded] = useState([]);
|
|
89
|
+
const [dataListHelp, setDataListHelp] = useState([]);
|
|
90
|
+
const [isMute, setIsMute] = useState(false);
|
|
91
|
+
const [appTargeting, setAppTargeting] = useState({
|
|
92
|
+
label: '',
|
|
93
|
+
value: '',
|
|
94
|
+
});
|
|
95
|
+
const [autoExpandParent, setAutoExpandParent] = useState(true);
|
|
96
|
+
const [expandedKeys, setExpandedKeys] = useState([]);
|
|
97
|
+
const [searchValue, setSearchValue] = useState('');
|
|
98
|
+
const [allAppOptions, setAllAppOptions] = useState([]);
|
|
99
|
+
const [isForceStopRecorder, setIsForceStopRecorder] = useState(false);
|
|
100
|
+
const [isLoadingListHelp, setIsLoadingHelp] = useState(true);
|
|
101
|
+
const recorderRef = useRef();
|
|
102
|
+
const streamTracks = useRef();
|
|
103
|
+
// const showModal = (captureKey: CaptureTypeProps) => {
|
|
104
|
+
// setOpen(true);
|
|
105
|
+
// setCaptureType(captureKey);
|
|
106
|
+
// };
|
|
107
|
+
const items = useMemo(() => {
|
|
108
|
+
var _a;
|
|
109
|
+
return [
|
|
110
|
+
{
|
|
111
|
+
label: (React.createElement("a", { href: "https://docs.antsomi.com/cdp-365-user-guide-en/release-note/2023", target: "_blank", rel: "noreferrer" },
|
|
112
|
+
React.createElement(Label, { style: {
|
|
113
|
+
position: 'relative',
|
|
114
|
+
display: 'flex',
|
|
115
|
+
alignItems: 'center',
|
|
116
|
+
gap: 33,
|
|
117
|
+
width: '100%',
|
|
118
|
+
marginTop: 8,
|
|
119
|
+
} },
|
|
120
|
+
"New features & announcements",
|
|
121
|
+
React.createElement(OpenUrlIcon, { style: {
|
|
122
|
+
fill: (_a = THEME.token) === null || _a === void 0 ? void 0 : _a.colorIcon,
|
|
123
|
+
maxWidth: 24,
|
|
124
|
+
maxHeight: 24,
|
|
125
|
+
} })))),
|
|
126
|
+
key: MENU_KEYS.FEATURE_ANNOUNCEMENT,
|
|
127
|
+
},
|
|
128
|
+
{
|
|
129
|
+
label: React.createElement(Label, null, "Leave feedback"),
|
|
130
|
+
key: MENU_KEYS.FEEDBACK,
|
|
131
|
+
},
|
|
132
|
+
{
|
|
133
|
+
label: React.createElement(Label, null, "Get Help"),
|
|
134
|
+
key: MENU_KEYS.HELP,
|
|
135
|
+
},
|
|
136
|
+
{
|
|
137
|
+
label: React.createElement(Label, null, "Get ideas with ChatGPT"),
|
|
138
|
+
key: MENU_KEYS.CHAT,
|
|
139
|
+
},
|
|
140
|
+
{
|
|
141
|
+
type: 'divider',
|
|
142
|
+
},
|
|
143
|
+
{
|
|
144
|
+
label: (React.createElement("a", { href: `${domainTicket}/${portalId}/#/${userId}/tickets`, target: "_blank", rel: "noreferrer" },
|
|
145
|
+
React.createElement(Label, { className: "verify-support" }, "Verify support request"))),
|
|
146
|
+
key: MENU_KEYS.SUPPORT,
|
|
147
|
+
},
|
|
148
|
+
];
|
|
149
|
+
}, [domainTicket, portalId, userId]);
|
|
150
|
+
const modifiedDomain = useMemo(() => {
|
|
151
|
+
const regex = /^(https?:)/;
|
|
152
|
+
if (regex.test(domain)) {
|
|
153
|
+
return domain.replace(regex, '');
|
|
154
|
+
}
|
|
155
|
+
return domain;
|
|
156
|
+
}, [domain]);
|
|
157
|
+
const handleCancel = () => {
|
|
158
|
+
setOpen(false);
|
|
159
|
+
};
|
|
160
|
+
const handleClick = (data) => {
|
|
161
|
+
const { key = '' } = data;
|
|
162
|
+
switch (key) {
|
|
163
|
+
case MENU_KEYS.FEEDBACK: {
|
|
164
|
+
setType(REPORT_TYPES.FEEDBACK);
|
|
165
|
+
setTitle('Send feedback to Antsomi');
|
|
166
|
+
setIsShowPopup(true);
|
|
167
|
+
break;
|
|
168
|
+
}
|
|
169
|
+
case MENU_KEYS.HELP: {
|
|
170
|
+
fetchDataListHelp();
|
|
171
|
+
setType(REPORT_TYPES.HELP);
|
|
172
|
+
setTitle('Get Help');
|
|
173
|
+
setIsShowPopup(true);
|
|
174
|
+
break;
|
|
175
|
+
}
|
|
176
|
+
case MENU_KEYS.CHAT: {
|
|
177
|
+
setType(REPORT_TYPES.CHAT);
|
|
178
|
+
setTitle('Get ideas with ChatGPT');
|
|
179
|
+
setIsShowPopup(true);
|
|
180
|
+
break;
|
|
181
|
+
}
|
|
182
|
+
default: {
|
|
183
|
+
setIsOpenDropdown(false);
|
|
184
|
+
break;
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
};
|
|
188
|
+
const handleUploadFile = (params) => __awaiter(void 0, void 0, void 0, function* () {
|
|
189
|
+
try {
|
|
190
|
+
setIsMainLoading(true);
|
|
191
|
+
const res = yield TicketService.tickets.callApi.upload(params, domainTicket, token, config, userId, 'ticket');
|
|
192
|
+
if (res.code === 200) {
|
|
193
|
+
setValueInput(prevVal => (Object.assign(Object.assign({}, prevVal), { files: [...valueInput.files, res.data] })));
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
catch (error) {
|
|
197
|
+
// eslint-disable-next-line no-console
|
|
198
|
+
console.log('error :>', error);
|
|
199
|
+
}
|
|
200
|
+
finally {
|
|
201
|
+
setIsMainLoading(false);
|
|
202
|
+
}
|
|
203
|
+
});
|
|
204
|
+
useEffect(() => {
|
|
205
|
+
const handleFetchAllApps = () => __awaiter(void 0, void 0, void 0, function* () {
|
|
206
|
+
try {
|
|
207
|
+
setIsMainLoading(true);
|
|
208
|
+
const res = yield TicketService.tickets.callApi.getCustomFields({}, domainTicket, token, config, userId, 'get-custom-fields');
|
|
209
|
+
if (res && res.code === 200) {
|
|
210
|
+
const { data } = res;
|
|
211
|
+
if (data && Array.isArray(data.fields)) {
|
|
212
|
+
const features = data.fields.find(item => item.value === 'feature');
|
|
213
|
+
const { field_options = [] } = features || {};
|
|
214
|
+
const temp = field_options.map(app => ({
|
|
215
|
+
label: app.name,
|
|
216
|
+
value: app.value,
|
|
217
|
+
raw: app,
|
|
218
|
+
}));
|
|
219
|
+
setAppTargeting(temp[0]);
|
|
220
|
+
setAllAppOptions(temp);
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
catch (error) {
|
|
225
|
+
// eslint-disable-next-line no-console
|
|
226
|
+
console.log('error :>', error);
|
|
227
|
+
}
|
|
228
|
+
finally {
|
|
229
|
+
setIsMainLoading(false);
|
|
230
|
+
}
|
|
231
|
+
});
|
|
232
|
+
if (isEmpty(allAppOptions)) {
|
|
233
|
+
handleFetchAllApps();
|
|
234
|
+
}
|
|
235
|
+
}, [allAppOptions, config, domainTicket, token, userId]);
|
|
236
|
+
const handleOnchangeFile = e => {
|
|
237
|
+
var _a, _b;
|
|
238
|
+
const limitSize = 50 * 1024 * 1024;
|
|
239
|
+
const sizeFile = (_b = (_a = e.target) === null || _a === void 0 ? void 0 : _a.files[0]) === null || _b === void 0 ? void 0 : _b.size;
|
|
240
|
+
if (sizeFile >= limitSize) {
|
|
241
|
+
setErrFile({
|
|
242
|
+
isError: true,
|
|
243
|
+
message: '*Maximum upload file size: 50MB',
|
|
244
|
+
});
|
|
245
|
+
}
|
|
246
|
+
else {
|
|
247
|
+
const formData = new FormData();
|
|
248
|
+
formData.append('file', e.target.files[0]);
|
|
249
|
+
const params = {
|
|
250
|
+
data: formData,
|
|
251
|
+
};
|
|
252
|
+
setErrFile({
|
|
253
|
+
isError: false,
|
|
254
|
+
message: '',
|
|
255
|
+
});
|
|
256
|
+
handleUploadFile(params);
|
|
257
|
+
}
|
|
258
|
+
};
|
|
259
|
+
const handleRemoveFile = token => {
|
|
260
|
+
let newListFile = valueInput.files;
|
|
261
|
+
newListFile = newListFile.filter(list => (list === null || list === void 0 ? void 0 : list.token) !== token);
|
|
262
|
+
setValueInput(prevVal => (Object.assign(Object.assign({}, prevVal), { files: newListFile })));
|
|
263
|
+
};
|
|
264
|
+
const handleResetData = () => {
|
|
265
|
+
setUrlImageDrawer('');
|
|
266
|
+
setUrlVideoPreview('');
|
|
267
|
+
setIsValidAll(true);
|
|
268
|
+
setIsOpenDropdown(false);
|
|
269
|
+
setValueInput(prev => (Object.assign(Object.assign({}, prev), { message: '', title: '', files: [] })));
|
|
270
|
+
setIsShowPopup(false);
|
|
271
|
+
setErrFile({
|
|
272
|
+
isError: false,
|
|
273
|
+
message: '',
|
|
274
|
+
});
|
|
275
|
+
setImageDrew({
|
|
276
|
+
imageName: '',
|
|
277
|
+
dataURL: '',
|
|
278
|
+
});
|
|
279
|
+
setDataRecorded([]);
|
|
280
|
+
setSearchValue('');
|
|
281
|
+
setAutoExpandParent(false);
|
|
282
|
+
setExpandedKeys([]);
|
|
283
|
+
};
|
|
284
|
+
useEffect(() => () => handleResetData(), []);
|
|
285
|
+
useEffect(() => {
|
|
286
|
+
if (dataRecorded) {
|
|
287
|
+
const dataRecordedBlob = new Blob(dataRecorded, { type: 'video/mp4' });
|
|
288
|
+
const url = URL.createObjectURL(dataRecordedBlob);
|
|
289
|
+
setUrlVideoPreview(url);
|
|
290
|
+
}
|
|
291
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
292
|
+
}, [dataRecorded]);
|
|
293
|
+
useEffect(() => {
|
|
294
|
+
if (isForceStopRecorder && !isEmpty(dataRecorded)) {
|
|
295
|
+
setDataRecorded([]);
|
|
296
|
+
setIsForceStopRecorder(false);
|
|
297
|
+
}
|
|
298
|
+
}, [dataRecorded, isForceStopRecorder]);
|
|
299
|
+
useEffect(() => () => {
|
|
300
|
+
if (streamTracks.current) {
|
|
301
|
+
const { desktopStream, voiceStream } = streamTracks.current;
|
|
302
|
+
if (desktopStream && voiceStream) {
|
|
303
|
+
desktopStream.getTracks().forEach(track => track.stop());
|
|
304
|
+
voiceStream.getTracks().forEach(track => track.stop());
|
|
305
|
+
}
|
|
306
|
+
}
|
|
307
|
+
}, []);
|
|
308
|
+
const fetchDataListHelp = () => {
|
|
309
|
+
setIsLoadingHelp(true);
|
|
310
|
+
TicketService.help.callApi
|
|
311
|
+
.getList({ appCode, role: '1' }, domainPlatform, token, config, userId)
|
|
312
|
+
.then(res => {
|
|
313
|
+
if (res && res.data.code === 200 && res.data) {
|
|
314
|
+
const { data } = res.data;
|
|
315
|
+
setDataListHelp(data);
|
|
316
|
+
setIsLoadingHelp(false);
|
|
317
|
+
setExpandedKeys(expendDefault(data));
|
|
318
|
+
}
|
|
319
|
+
else {
|
|
320
|
+
setIsLoadingHelp(true);
|
|
321
|
+
}
|
|
322
|
+
})
|
|
323
|
+
.catch(err => {
|
|
324
|
+
// console.log('err ===>', err)
|
|
325
|
+
});
|
|
326
|
+
};
|
|
327
|
+
const handleCreateRecorder = () => __awaiter(void 0, void 0, void 0, function* () {
|
|
328
|
+
try {
|
|
329
|
+
let controller;
|
|
330
|
+
if ('CaptureController' in window &&
|
|
331
|
+
'setFocusBehavior' in window.CaptureController.prototype) {
|
|
332
|
+
controller = new window.CaptureController();
|
|
333
|
+
controller.setFocusBehavior('no-focus-change');
|
|
334
|
+
}
|
|
335
|
+
const displayMediaOptions = {
|
|
336
|
+
// preferCurrentTab: true,
|
|
337
|
+
video: {
|
|
338
|
+
cursor: 'always',
|
|
339
|
+
},
|
|
340
|
+
audio: true,
|
|
341
|
+
controller,
|
|
342
|
+
selfBrowserSurface: 'include',
|
|
343
|
+
};
|
|
344
|
+
const desktopStream = yield navigator.mediaDevices.getDisplayMedia(displayMediaOptions);
|
|
345
|
+
const voiceStream = yield navigator.mediaDevices.getUserMedia({
|
|
346
|
+
video: false,
|
|
347
|
+
audio: !isMute,
|
|
348
|
+
});
|
|
349
|
+
const tracks = [
|
|
350
|
+
...desktopStream.getVideoTracks(),
|
|
351
|
+
...mergeAudioStreams(desktopStream, voiceStream),
|
|
352
|
+
];
|
|
353
|
+
const stream = new MediaStream(tracks);
|
|
354
|
+
const recorder = new MediaRecorder(stream);
|
|
355
|
+
const data = [];
|
|
356
|
+
// ondataavailable -> fired periodically each time timeslice millisecond of media have been recorded
|
|
357
|
+
// or when the entire media is recorded if no timeslice is specified
|
|
358
|
+
recorder.ondataavailable = event => data.push(event.data);
|
|
359
|
+
const stopped = new Promise((resolve, reject) => {
|
|
360
|
+
recorder.onstop = resolve;
|
|
361
|
+
recorder.onerror = (event) => reject(event.name);
|
|
362
|
+
});
|
|
363
|
+
Promise.all([stopped, recorder]).then(() => {
|
|
364
|
+
setDataRecorded(data);
|
|
365
|
+
});
|
|
366
|
+
const videoTrack = desktopStream.getVideoTracks()[0];
|
|
367
|
+
// eslint-disable-next-line func-names
|
|
368
|
+
videoTrack.onended = function () {
|
|
369
|
+
if (recorder) {
|
|
370
|
+
recorder.stop();
|
|
371
|
+
}
|
|
372
|
+
desktopStream.getTracks().forEach(track => track.stop());
|
|
373
|
+
voiceStream.getTracks().forEach(track => track.stop());
|
|
374
|
+
setIsShowPopup(true);
|
|
375
|
+
setIsOpenImageDrawer(false);
|
|
376
|
+
};
|
|
377
|
+
recorderRef.current = recorder;
|
|
378
|
+
streamTracks.current = {
|
|
379
|
+
desktopStream,
|
|
380
|
+
voiceStream,
|
|
381
|
+
};
|
|
382
|
+
setIsForceStopRecorder(false);
|
|
383
|
+
setIsOpenImageDrawer(true);
|
|
384
|
+
handleCancel();
|
|
385
|
+
setIsShowPopup(false);
|
|
386
|
+
}
|
|
387
|
+
catch (error) {
|
|
388
|
+
console.log('error :>', error);
|
|
389
|
+
setIsShowPopup(true);
|
|
390
|
+
}
|
|
391
|
+
});
|
|
392
|
+
const handleCaptureScreen = () => __awaiter(void 0, void 0, void 0, function* () {
|
|
393
|
+
try {
|
|
394
|
+
let controller;
|
|
395
|
+
if ('CaptureController' in window &&
|
|
396
|
+
'setFocusBehavior' in window.CaptureController.prototype) {
|
|
397
|
+
controller = new window.CaptureController();
|
|
398
|
+
controller.setFocusBehavior('no-focus-change');
|
|
399
|
+
}
|
|
400
|
+
const displayMediaOptions = {
|
|
401
|
+
// preferCurrentTab: true,
|
|
402
|
+
video: {
|
|
403
|
+
displaySurface: 'browser',
|
|
404
|
+
cursor: 'always',
|
|
405
|
+
},
|
|
406
|
+
audio: false,
|
|
407
|
+
surfaceSwitching: 'include',
|
|
408
|
+
controller,
|
|
409
|
+
selfBrowserSurface: 'include',
|
|
410
|
+
};
|
|
411
|
+
// navigator.mediaDevices.enumerateDevices().then(value => {
|
|
412
|
+
// console.log('insideee.dev - list :>', value);
|
|
413
|
+
// });
|
|
414
|
+
// asking permission to use a media input to record current tab
|
|
415
|
+
const supportedConstraints = navigator.mediaDevices.getSupportedConstraints();
|
|
416
|
+
// if (supportedConstraints.displaySurface) {
|
|
417
|
+
// displayMediaOptions.video.displaySurface = 'monitor';
|
|
418
|
+
// }
|
|
419
|
+
if (supportedConstraints.width) {
|
|
420
|
+
displayMediaOptions.video.width = { ideal: 1920, max: 1920 };
|
|
421
|
+
}
|
|
422
|
+
if (supportedConstraints.height) {
|
|
423
|
+
displayMediaOptions.video.heigh = { ideal: 1080 };
|
|
424
|
+
}
|
|
425
|
+
if (supportedConstraints.aspectRatio) {
|
|
426
|
+
displayMediaOptions.video.aspectRatio = 1.777777778;
|
|
427
|
+
}
|
|
428
|
+
if (supportedConstraints.frameRate) {
|
|
429
|
+
displayMediaOptions.video.frameRate = { max: 30 };
|
|
430
|
+
}
|
|
431
|
+
const stream = yield navigator.mediaDevices.getDisplayMedia(displayMediaOptions);
|
|
432
|
+
const video = document.createElement('video');
|
|
433
|
+
video === null || video === void 0 ? void 0 : video.addEventListener('loadedmetadata', () => {
|
|
434
|
+
const canvas = document.createElement('canvas');
|
|
435
|
+
const ctx = canvas.getContext('2d');
|
|
436
|
+
// passing video width & height as canvas width & height
|
|
437
|
+
canvas.width = video.videoWidth;
|
|
438
|
+
canvas.height = video.videoHeight;
|
|
439
|
+
video.play(); // playing the video so the drawn image won't be black or blank
|
|
440
|
+
// drawing an image of the captured video stream
|
|
441
|
+
ctx === null || ctx === void 0 ? void 0 : ctx.drawImage(video, 0, 0, canvas.width, canvas.height);
|
|
442
|
+
stream.getVideoTracks()[0].stop(); // terminating first video track of the stream
|
|
443
|
+
// passing canvas data url as screenshot preview src
|
|
444
|
+
setUrlImageDrawer(canvas.toDataURL());
|
|
445
|
+
setIsOpenImageDrawer(true);
|
|
446
|
+
handleCancel();
|
|
447
|
+
setIsShowPopup(false);
|
|
448
|
+
});
|
|
449
|
+
video.srcObject = stream; // passing capture stream data as video source object
|
|
450
|
+
}
|
|
451
|
+
catch (error) {
|
|
452
|
+
// if image couldn't capture by any reason, then alert the msg
|
|
453
|
+
// eslint-disable-next-line no-console
|
|
454
|
+
console.info('Failed to capture screenshot!', error);
|
|
455
|
+
setIsShowPopup(true);
|
|
456
|
+
}
|
|
457
|
+
});
|
|
458
|
+
const callback = (type, dataIn) => {
|
|
459
|
+
switch (type) {
|
|
460
|
+
case 'ON_CLOSE_POPUP': {
|
|
461
|
+
handleResetData();
|
|
462
|
+
break;
|
|
463
|
+
}
|
|
464
|
+
case 'ON_BACK_POPUP': {
|
|
465
|
+
setType(REPORT_TYPES.HELP);
|
|
466
|
+
break;
|
|
467
|
+
}
|
|
468
|
+
case REPORT_TYPES.ISSUE: {
|
|
469
|
+
setTitle('Report an issue to Antsomi');
|
|
470
|
+
setType(type);
|
|
471
|
+
break;
|
|
472
|
+
}
|
|
473
|
+
case REPORT_TYPES.IDEA: {
|
|
474
|
+
setTitle('Request an idea to Antsomi');
|
|
475
|
+
setType(type);
|
|
476
|
+
break;
|
|
477
|
+
}
|
|
478
|
+
case 'CLOSE_DRAWER': {
|
|
479
|
+
setIsOpenImageDrawer(false);
|
|
480
|
+
setIsShowPopup(true);
|
|
481
|
+
if (captureType === ATTACH_KEYS.CAPTURE) {
|
|
482
|
+
setUrlImageDrawer('');
|
|
483
|
+
}
|
|
484
|
+
else if (captureType === ATTACH_KEYS.RECORD) {
|
|
485
|
+
setIsForceStopRecorder(true);
|
|
486
|
+
const recorder = recorderRef.current;
|
|
487
|
+
const { desktopStream, voiceStream } = streamTracks.current;
|
|
488
|
+
if (recorder && recorder.state === 'recording') {
|
|
489
|
+
recorder.stop();
|
|
490
|
+
}
|
|
491
|
+
if (desktopStream && voiceStream) {
|
|
492
|
+
desktopStream.getTracks().forEach(track => track.stop());
|
|
493
|
+
voiceStream.getTracks().forEach(track => track.stop());
|
|
494
|
+
}
|
|
495
|
+
}
|
|
496
|
+
break;
|
|
497
|
+
}
|
|
498
|
+
case 'ON_DRAWER_DONE': {
|
|
499
|
+
setIsOpenImageDrawer(false);
|
|
500
|
+
setImageDrew(dataIn);
|
|
501
|
+
setIsShowPopup(true);
|
|
502
|
+
break;
|
|
503
|
+
}
|
|
504
|
+
case 'STOP_RECORDER': {
|
|
505
|
+
setIsOpenImageDrawer(false);
|
|
506
|
+
setIsShowPopup(true);
|
|
507
|
+
streamTracks.current = undefined;
|
|
508
|
+
break;
|
|
509
|
+
}
|
|
510
|
+
case 'ON_CHANGE_MUTE': {
|
|
511
|
+
setIsMute(prevMute => !prevMute);
|
|
512
|
+
break;
|
|
513
|
+
}
|
|
514
|
+
case 'SET_POSITION_DRAG': {
|
|
515
|
+
const { name = '', x = 0, y = 0 } = dataIn;
|
|
516
|
+
if (name === ATTACH_KEYS.CAPTURE) {
|
|
517
|
+
setDefaultPositionDrawActions({ x, y });
|
|
518
|
+
}
|
|
519
|
+
if (name === ATTACH_KEYS.RECORD) {
|
|
520
|
+
setDefaultPositionRecordActions({ x, y });
|
|
521
|
+
}
|
|
522
|
+
break;
|
|
523
|
+
}
|
|
524
|
+
case 'RESET_POSITION_DRAG': {
|
|
525
|
+
setDefaultPositionDrawActions(DEFAULT_POSITIONS.capture);
|
|
526
|
+
setDefaultPositionRecordActions(DEFAULT_POSITIONS.record);
|
|
527
|
+
break;
|
|
528
|
+
}
|
|
529
|
+
default: {
|
|
530
|
+
break;
|
|
531
|
+
}
|
|
532
|
+
}
|
|
533
|
+
};
|
|
534
|
+
const handleCreateTicket = (params) => __awaiter(void 0, void 0, void 0, function* () {
|
|
535
|
+
try {
|
|
536
|
+
setIsMainLoading(true);
|
|
537
|
+
let attachments = [];
|
|
538
|
+
const { imageDrew = {}, dataRecorded = [], type = '' } = params, restParams = __rest(params, ["imageDrew", "dataRecorded", "type"]);
|
|
539
|
+
if (params.attachments && !isEmpty(params.attachments)) {
|
|
540
|
+
attachments = [...params.attachments];
|
|
541
|
+
}
|
|
542
|
+
if (imageDrew.dataURL) {
|
|
543
|
+
const imageFile = base64ToFile(imageDrew.dataURL, `${imageDrew.imageName}-${generateUniqueId()}.png`);
|
|
544
|
+
if (imageFile) {
|
|
545
|
+
const uploadFormData = new FormData();
|
|
546
|
+
uploadFormData.append('file', imageFile);
|
|
547
|
+
const uploadFileParams = {
|
|
548
|
+
data: uploadFormData,
|
|
549
|
+
};
|
|
550
|
+
const res = yield TicketService.tickets.callApi.upload(uploadFileParams, domainTicket, token, config, userId, 'ticket');
|
|
551
|
+
if (res && res.code === 200 && res.data) {
|
|
552
|
+
attachments.push(res.data.token);
|
|
553
|
+
}
|
|
554
|
+
}
|
|
555
|
+
}
|
|
556
|
+
if (!isEmpty(dataRecorded)) {
|
|
557
|
+
const blob = dataRecorded[0];
|
|
558
|
+
const blobName = `video-${generateUniqueId()}.mp4`;
|
|
559
|
+
const videoFile = convertBlobToFile(blob, blobName);
|
|
560
|
+
if (videoFile) {
|
|
561
|
+
const uploadFormData = new FormData();
|
|
562
|
+
uploadFormData.append('file', videoFile);
|
|
563
|
+
const res = yield TicketService.tickets.callApi.upload({ data: uploadFormData }, domainTicket, token, config, userId, 'ticket');
|
|
564
|
+
if (res && res.code === 200 && res.data) {
|
|
565
|
+
attachments.push(res.data.token);
|
|
566
|
+
}
|
|
567
|
+
}
|
|
568
|
+
}
|
|
569
|
+
const dataToAPI = Object.assign(Object.assign({}, restParams), { attachments, networkId: Number(portalId), ticketType: type === REPORT_TYPES.ISSUE ? 'bug' : 'request' });
|
|
570
|
+
const res = yield TicketService.tickets.callApi.createTicket(dataToAPI, domainTicket, token, config, userId);
|
|
571
|
+
if (res.code === 200) {
|
|
572
|
+
postCustomEvent(TICKET_CUSTOM_MESSAGE_KEY, {
|
|
573
|
+
type: MESSAGE_TYPE.TICKET_CREATE_STATUS,
|
|
574
|
+
value: true,
|
|
575
|
+
});
|
|
576
|
+
}
|
|
577
|
+
else {
|
|
578
|
+
postCustomEvent(TICKET_CUSTOM_MESSAGE_KEY, {
|
|
579
|
+
type: MESSAGE_TYPE.TICKET_CREATE_STATUS,
|
|
580
|
+
value: false,
|
|
581
|
+
});
|
|
582
|
+
}
|
|
583
|
+
handleResetData();
|
|
584
|
+
}
|
|
585
|
+
catch (error) {
|
|
586
|
+
// eslint-disable-next-line no-console
|
|
587
|
+
console.log('error :>', error);
|
|
588
|
+
}
|
|
589
|
+
finally {
|
|
590
|
+
setIsMainLoading(false);
|
|
591
|
+
}
|
|
592
|
+
});
|
|
593
|
+
const handleSubmit = () => {
|
|
594
|
+
if (!valueInput.title || !valueInput.message) {
|
|
595
|
+
setIsValidAll(false);
|
|
596
|
+
return;
|
|
597
|
+
}
|
|
598
|
+
if (!errFile.isError) {
|
|
599
|
+
const params = formatParams(Object.assign(Object.assign({}, valueInput), { feature: appTargeting }));
|
|
600
|
+
handleCreateTicket(Object.assign(Object.assign({}, params), { type,
|
|
601
|
+
imageDrew,
|
|
602
|
+
dataRecorded, submitterId: Number(userId) }));
|
|
603
|
+
}
|
|
604
|
+
};
|
|
605
|
+
// console.log('insideee.dev - data :>', valueInput, appTargeting, errFile);
|
|
606
|
+
const handleShareCapture = (type) => {
|
|
607
|
+
setCaptureType(type);
|
|
608
|
+
setIsShowPopup(false);
|
|
609
|
+
return () => {
|
|
610
|
+
if (type === ATTACH_KEYS.CAPTURE) {
|
|
611
|
+
handleCaptureScreen();
|
|
612
|
+
}
|
|
613
|
+
else {
|
|
614
|
+
handleCreateRecorder();
|
|
615
|
+
}
|
|
616
|
+
};
|
|
617
|
+
};
|
|
618
|
+
const handleChangeAttachFile = (key, type) => {
|
|
619
|
+
if (type === 'edit') {
|
|
620
|
+
// showModal(key);
|
|
621
|
+
handleShareCapture(key)();
|
|
622
|
+
}
|
|
623
|
+
else if (type === 'delete') {
|
|
624
|
+
if (key === ATTACH_KEYS.CAPTURE) {
|
|
625
|
+
setImageDrew({
|
|
626
|
+
imageName: '',
|
|
627
|
+
dataURL: '',
|
|
628
|
+
});
|
|
629
|
+
}
|
|
630
|
+
else if (key === ATTACH_KEYS.RECORD) {
|
|
631
|
+
setDataRecorded([]);
|
|
632
|
+
}
|
|
633
|
+
}
|
|
634
|
+
};
|
|
635
|
+
const onSelect = (selectedKeys, info) => {
|
|
636
|
+
const { node } = info;
|
|
637
|
+
const { path } = node;
|
|
638
|
+
if (path) {
|
|
639
|
+
setHelp(path);
|
|
640
|
+
setType(REPORT_TYPES.HELP_V1);
|
|
641
|
+
}
|
|
642
|
+
// console.log('selected', selectedKeys, info);
|
|
643
|
+
};
|
|
644
|
+
const onExpand = (newExpandedKeys) => {
|
|
645
|
+
setExpandedKeys(newExpandedKeys);
|
|
646
|
+
setAutoExpandParent(false);
|
|
647
|
+
};
|
|
648
|
+
const getParentKey = (key, tree) => {
|
|
649
|
+
let parentKey;
|
|
650
|
+
for (let i = 0; i < tree.length; i++) {
|
|
651
|
+
const node = tree[i];
|
|
652
|
+
if (node.children) {
|
|
653
|
+
if (node.children.some(item => item.key === key)) {
|
|
654
|
+
parentKey = node.key;
|
|
655
|
+
}
|
|
656
|
+
else if (getParentKey(key, node.children)) {
|
|
657
|
+
parentKey = getParentKey(key, node.children);
|
|
658
|
+
}
|
|
659
|
+
}
|
|
660
|
+
}
|
|
661
|
+
return parentKey;
|
|
662
|
+
};
|
|
663
|
+
// const onExpand: DirectoryTreeProps['onCheck'] = (checkedKeys, info) => {
|
|
664
|
+
// console.log('onCheck', checkedKeys, info);
|
|
665
|
+
// };
|
|
666
|
+
const dataList = [];
|
|
667
|
+
const generateList = (data) => {
|
|
668
|
+
for (let i = 0; i < data.length; i++) {
|
|
669
|
+
const node = data[i];
|
|
670
|
+
const { key, title } = node;
|
|
671
|
+
dataList.push({ key, title });
|
|
672
|
+
if (node.children) {
|
|
673
|
+
generateList(node.children);
|
|
674
|
+
}
|
|
675
|
+
}
|
|
676
|
+
};
|
|
677
|
+
generateList(dataListHelp);
|
|
678
|
+
const onChange = (e) => {
|
|
679
|
+
const { value } = e.target;
|
|
680
|
+
const newExpandedKeys = dataList
|
|
681
|
+
.map(item => {
|
|
682
|
+
if (item.title.toString().toLowerCase().indexOf(value.toLowerCase()) > -1) {
|
|
683
|
+
return getParentKey(item.key, dataListHelp);
|
|
684
|
+
}
|
|
685
|
+
return null;
|
|
686
|
+
})
|
|
687
|
+
.filter((item, i, self) => item && self.indexOf(item) === i);
|
|
688
|
+
setExpandedKeys(newExpandedKeys);
|
|
689
|
+
setSearchValue(value);
|
|
690
|
+
setAutoExpandParent(true);
|
|
691
|
+
};
|
|
692
|
+
const renderIcon = (name, style) => ({
|
|
693
|
+
'icon-ants-capture': React.createElement(CaptureIcon, { style: style }),
|
|
694
|
+
'icon-ants-camera': React.createElement(CameraIcon, { style: style }),
|
|
695
|
+
}[name]);
|
|
696
|
+
const treeData = useMemo(() => {
|
|
697
|
+
const loop = (data) => data.map(item => {
|
|
698
|
+
const strTitle = item.title;
|
|
699
|
+
const index = strTitle.toString().toLowerCase().indexOf(searchValue.toLowerCase());
|
|
700
|
+
const beforeStr = strTitle.substring(0, index);
|
|
701
|
+
const afterStr = strTitle.slice(index + searchValue.length);
|
|
702
|
+
const title = index > -1 ? (React.createElement(Span, { styles: item.children },
|
|
703
|
+
beforeStr,
|
|
704
|
+
React.createElement(TitleSearch, null, searchValue),
|
|
705
|
+
afterStr)) : (React.createElement(Span, { styles: item.children }, strTitle));
|
|
706
|
+
if (item.children) {
|
|
707
|
+
return { title, key: item.key, children: loop(item.children) };
|
|
708
|
+
}
|
|
709
|
+
return {
|
|
710
|
+
title,
|
|
711
|
+
key: item.key,
|
|
712
|
+
path: item.path,
|
|
713
|
+
};
|
|
714
|
+
});
|
|
715
|
+
return loop(dataListHelp);
|
|
716
|
+
}, [searchValue, dataListHelp]);
|
|
717
|
+
const renderAttachActions = () => ATTACH_CAPTURE_TYPES.map(item => {
|
|
718
|
+
var _a, _b, _c;
|
|
719
|
+
return (React.createElement(ControlGroup, { key: item.key, size: 10, direction: "vertical", style: { width: 'auto' } },
|
|
720
|
+
((item.key === ATTACH_KEYS.CAPTURE && imageDrew.dataURL) ||
|
|
721
|
+
(!isForceStopRecorder &&
|
|
722
|
+
!isEmpty(dataRecorded) &&
|
|
723
|
+
urlVideoPreview &&
|
|
724
|
+
item.key === ATTACH_KEYS.RECORD)) && (React.createElement(PreviewBox, null,
|
|
725
|
+
React.createElement(Overlay, { className: "overlay-preview" },
|
|
726
|
+
React.createElement(FlexCenter, { style: { height: '100%', gap: 10 } }, (_a = item.actions) === null || _a === void 0 ? void 0 : _a.map(action => {
|
|
727
|
+
var _a, _b;
|
|
728
|
+
return (React.createElement(ButtonFeedback, { key: `${item.key}-${action.key}`, height: 28, style: {
|
|
729
|
+
borderRadius: `${(_a = THEME.token) === null || _a === void 0 ? void 0 : _a.borderRadius}px`,
|
|
730
|
+
width: 34,
|
|
731
|
+
}, borderRadiusCustom: 3, icon: React.createElement(Icon, { type: action.icon, style: {
|
|
732
|
+
color: (_b = THEME.token) === null || _b === void 0 ? void 0 : _b.colorPrimary,
|
|
733
|
+
fontSize: '24px',
|
|
734
|
+
} }), onClick: () => handleChangeAttachFile(item.key, action.key) }));
|
|
735
|
+
}))),
|
|
736
|
+
item.key === ATTACH_KEYS.CAPTURE ? (React.createElement(Image, { src: imageDrew.dataURL, alt: "send feedback", isFull: true })) : (React.createElement(Video, { src: urlVideoPreview, muted: true, autoPlay: false, controls: false })))),
|
|
737
|
+
React.createElement(ButtonFeedback, { height: 28, borderRadiusCustom: 3, style: {
|
|
738
|
+
borderRadius: `${(_b = THEME.token) === null || _b === void 0 ? void 0 : _b.borderRadius}px`,
|
|
739
|
+
marginBottom: 58,
|
|
740
|
+
}, icon:
|
|
741
|
+
// <Icon
|
|
742
|
+
// type={item.icon}
|
|
743
|
+
// style={{ color: `${THEME.token?.colorPrimary}`, fontSize: '24px' }}
|
|
744
|
+
// />
|
|
745
|
+
renderIcon(item.icon, {
|
|
746
|
+
fill: (_c = THEME.token) === null || _c === void 0 ? void 0 : _c.colorPrimary,
|
|
747
|
+
maxWidth: '24px',
|
|
748
|
+
}),
|
|
749
|
+
// onClick={() => showModal(item.key)}
|
|
750
|
+
onClick: () => handleShareCapture(item.key)() }, item.label)));
|
|
751
|
+
});
|
|
752
|
+
const renderContentPopup = (type) => {
|
|
753
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
754
|
+
switch (type) {
|
|
755
|
+
case REPORT_TYPES.FEEDBACK: {
|
|
756
|
+
return (React.createElement(SendFeedback, null,
|
|
757
|
+
React.createElement(FlexCenter, null,
|
|
758
|
+
React.createElement(WrapperImage, null,
|
|
759
|
+
React.createElement(HiddenBlock, null),
|
|
760
|
+
React.createElement(Image, { src: "https://st-media-template.antsomi.com/upload/2023/06/16/aa5d68c3-40a2-425f-beb4-cb1abd89e8cb.png", alt: "send feedback", style: { maxWidth: 'unset' } }))),
|
|
761
|
+
React.createElement(FlexCenter, { style: { margin: '50px 3px 0' } },
|
|
762
|
+
React.createElement(FlexCenter, { onClick: e => {
|
|
763
|
+
e.stopPropagation();
|
|
764
|
+
callback(REPORT_TYPES.ISSUE);
|
|
765
|
+
} },
|
|
766
|
+
React.createElement(ButtonFeedback, { icon:
|
|
767
|
+
// <Icon
|
|
768
|
+
// type="icon-ants-bug"
|
|
769
|
+
// style={{ color: `${THEME.token?.colorIcon}`, fontSize: '24px' }}
|
|
770
|
+
// />
|
|
771
|
+
React.createElement(BugIcon, { style: { fill: (_a = THEME.token) === null || _a === void 0 ? void 0 : _a.colorIcon, maxWidth: '24px' } }), style: { marginRight: 15 } },
|
|
772
|
+
React.createElement(Text, null, "Report an Issue"))),
|
|
773
|
+
React.createElement(FlexCenter, { onClick: e => {
|
|
774
|
+
e.stopPropagation();
|
|
775
|
+
callback(REPORT_TYPES.IDEA);
|
|
776
|
+
} },
|
|
777
|
+
React.createElement(ButtonFeedback, { icon:
|
|
778
|
+
// <Icon
|
|
779
|
+
// type="icon-ants-idea"
|
|
780
|
+
// style={{ color: `${THEME.token?.colorIcon}`, fontSize: '24px' }}
|
|
781
|
+
// />
|
|
782
|
+
React.createElement(RequestIcon, { style: { fill: (_b = THEME.token) === null || _b === void 0 ? void 0 : _b.colorIcon, maxWidth: '24px' } }) },
|
|
783
|
+
React.createElement(Text, null, "Request an Idea"))))));
|
|
784
|
+
}
|
|
785
|
+
case REPORT_TYPES.IDEA:
|
|
786
|
+
case REPORT_TYPES.ISSUE: {
|
|
787
|
+
return (React.createElement(ControlGroup, { size: 20, direction: "vertical" },
|
|
788
|
+
React.createElement(ControlGroup, { size: 0, direction: "vertical" },
|
|
789
|
+
React.createElement(ControlLabel, null, "When you noticed this issue, what were you trying to do?"),
|
|
790
|
+
React.createElement(Select, { defaultValue: appTargeting, value: appTargeting, style: { width: '100%' }, onChange: (_, option) => setAppTargeting(option), options: allAppOptions })),
|
|
791
|
+
React.createElement(ControlGroup, { size: 0, direction: "vertical" },
|
|
792
|
+
React.createElement(ControlLabel, null,
|
|
793
|
+
"Title ",
|
|
794
|
+
React.createElement("span", { style: { color: (_c = THEME.token) === null || _c === void 0 ? void 0 : _c.red8 } }, "*")),
|
|
795
|
+
React.createElement(Input, { placeholder: "Enter ticket title", value: valueInput.title, onChange: event => {
|
|
796
|
+
const { value } = event === null || event === void 0 ? void 0 : event.target;
|
|
797
|
+
event.stopPropagation();
|
|
798
|
+
setValueInput(prev => (Object.assign(Object.assign({}, prev), { title: value })));
|
|
799
|
+
} }),
|
|
800
|
+
React.createElement(ErrorMessage, { isShow: !isValidAll && !(valueInput === null || valueInput === void 0 ? void 0 : valueInput.title) }, "*This field can't be empty")),
|
|
801
|
+
React.createElement(ControlGroup, { size: 0, direction: "vertical" },
|
|
802
|
+
React.createElement(ControlLabel, null,
|
|
803
|
+
"Message ",
|
|
804
|
+
React.createElement("span", { style: { color: (_d = THEME.token) === null || _d === void 0 ? void 0 : _d.red8 } }, "*")),
|
|
805
|
+
React.createElement(EditorWrapper, null,
|
|
806
|
+
React.createElement(Editor, { apiKey: apiKey, value: valueInput.message, init: {
|
|
807
|
+
height: 200,
|
|
808
|
+
width: '100%',
|
|
809
|
+
max_height: 800,
|
|
810
|
+
max_width: 800,
|
|
811
|
+
menubar: false,
|
|
812
|
+
plugins: [
|
|
813
|
+
'advlist autolink lists link tinydrive image emoticons charmap print preview anchor',
|
|
814
|
+
'searchreplace visualblocks code fullscreen',
|
|
815
|
+
'insertdatetime media paste code help wordcount ', //
|
|
816
|
+
],
|
|
817
|
+
toolbar: 'formatselect | bold italic underline strikethrough code | image emoticons | \
|
|
818
|
+
forecolor backcolor preview link |\
|
|
819
|
+
alignleft aligncenter alignright alignjustify outdent indent |\
|
|
820
|
+
numlist bullist checklist undo redo',
|
|
821
|
+
tinydrive_token_provider: `//${modifiedDomain}/hub/thirdparty-services/v2.0/tinymce?portalId=${portalId}&token=${token}`,
|
|
822
|
+
skin: 'snow',
|
|
823
|
+
toolbar_mode: 'sliding',
|
|
824
|
+
content_css: false,
|
|
825
|
+
branding: false,
|
|
826
|
+
resize: false,
|
|
827
|
+
statusbar: false,
|
|
828
|
+
setup(editor) {
|
|
829
|
+
editor.on('init', e => {
|
|
830
|
+
var _a;
|
|
831
|
+
editor.getBody().style.fontSize = `${(_a = THEME.token) === null || _a === void 0 ? void 0 : _a.fontSize}px`;
|
|
832
|
+
});
|
|
833
|
+
},
|
|
834
|
+
placeholder: 'Enter your comment...',
|
|
835
|
+
entity_encoding: 'raw',
|
|
836
|
+
paste_data_images: true,
|
|
837
|
+
},
|
|
838
|
+
// disabled={!!props.disabled}
|
|
839
|
+
// outputFormat='text'
|
|
840
|
+
onEditorChange: content => setValueInput(prevVal => (Object.assign(Object.assign({}, prevVal), { message: content }))) }),
|
|
841
|
+
React.createElement("div", null,
|
|
842
|
+
((_e = valueInput.files) === null || _e === void 0 ? void 0 : _e.length) > 0 && (React.createElement(WrapperLinkFiles, null, (_f = valueInput.files) === null || _f === void 0 ? void 0 : _f.map(file => {
|
|
843
|
+
var _a, _b, _c;
|
|
844
|
+
return (React.createElement(WrapperLinkItemFiles, { key: file === null || file === void 0 ? void 0 : file.token },
|
|
845
|
+
React.createElement("span", { style: {
|
|
846
|
+
display: 'flex',
|
|
847
|
+
alignItems: 'center',
|
|
848
|
+
gap: '10px',
|
|
849
|
+
} },
|
|
850
|
+
React.createElement(Icon, { type: "icon-ants-hyperlink", style: {
|
|
851
|
+
color: (_a = THEME.token) === null || _a === void 0 ? void 0 : _a.colorPrimary,
|
|
852
|
+
fontSize: '24px',
|
|
853
|
+
} }, "link"),
|
|
854
|
+
React.createElement(Text, { style: {
|
|
855
|
+
color: '#000',
|
|
856
|
+
fontSize: `${(_b = THEME.token) === null || _b === void 0 ? void 0 : _b.fontSize}px`,
|
|
857
|
+
} }, file === null || file === void 0 ? void 0 : file.file_name)),
|
|
858
|
+
React.createElement(Icon, { type: "icon-ants-remove-slim", style: {
|
|
859
|
+
color: (_c = THEME.token) === null || _c === void 0 ? void 0 : _c.colorIcon,
|
|
860
|
+
fontSize: '12px',
|
|
861
|
+
cursor: 'pointer',
|
|
862
|
+
}, onClick: () => handleRemoveFile(file === null || file === void 0 ? void 0 : file.token) }, "clear")));
|
|
863
|
+
}))),
|
|
864
|
+
React.createElement(WrapperIconEditor, { borderTop: Boolean((_g = valueInput.files) === null || _g === void 0 ? void 0 : _g.length) },
|
|
865
|
+
React.createElement(WrapperInputFile, null,
|
|
866
|
+
React.createElement("label", { htmlFor: "fileImage" },
|
|
867
|
+
React.createElement(Icon, { type: "icon-ants-hyperlink", style: {
|
|
868
|
+
color: (_h = THEME.token) === null || _h === void 0 ? void 0 : _h.colorPrimary,
|
|
869
|
+
fontSize: '24px',
|
|
870
|
+
position: 'absolute',
|
|
871
|
+
top: 0,
|
|
872
|
+
right: 0,
|
|
873
|
+
cursor: 'pointer',
|
|
874
|
+
} }, "link")),
|
|
875
|
+
React.createElement("input", { type: "file", style: {
|
|
876
|
+
position: 'absolute',
|
|
877
|
+
top: 0,
|
|
878
|
+
right: 0,
|
|
879
|
+
display: 'none',
|
|
880
|
+
}, name: "fileImage", id: "fileImage", onChange: handleOnchangeFile }))))),
|
|
881
|
+
errFile.isError ? (React.createElement(ErrorMessage, { isShow: errFile.isError }, errFile.message)) : (React.createElement(ErrorMessage, { isShow: !isValidAll && !(valueInput === null || valueInput === void 0 ? void 0 : valueInput.message) }, "*This field can't be empty"))),
|
|
882
|
+
React.createElement(ControlGroup, { size: 0, direction: "vertical" },
|
|
883
|
+
React.createElement(ControlLabel, null, "Attached Screenshot/ Video Recorded"),
|
|
884
|
+
React.createElement(FlexCenter, { style: {
|
|
885
|
+
justifyContent: 'flex-start',
|
|
886
|
+
alignItems: 'flex-start',
|
|
887
|
+
gap: 10,
|
|
888
|
+
} }, renderAttachActions()))));
|
|
889
|
+
}
|
|
890
|
+
case REPORT_TYPES.HELP: {
|
|
891
|
+
return (React.createElement(Wrapper, null,
|
|
892
|
+
React.createElement(WrapperSearch, { placeholder: "Search...", onChange: onChange }),
|
|
893
|
+
React.createElement("div", { style: { padding: '13px 15px' } },
|
|
894
|
+
React.createElement(LabelTitle, null, "Popular Help Resources"),
|
|
895
|
+
isLoadingListHelp && (React.createElement(WrapperLoading, { style: { background: 'none' }, height: "80%", width: "100%" },
|
|
896
|
+
React.createElement(Spin, { indicator: antIcon }))),
|
|
897
|
+
treeData.length > 0 &&
|
|
898
|
+
treeData.map(item => (React.createElement(WrapperContentHelp, null,
|
|
899
|
+
React.createElement(TreeContent, { onSelect: onSelect, onExpand: onExpand, treeData: [item], expandedKeys: expandedKeys, autoExpandParent: autoExpandParent })))))));
|
|
900
|
+
}
|
|
901
|
+
case REPORT_TYPES.CHAT: {
|
|
902
|
+
return (React.createElement(ChatBox, { domain: domainTicket, userId: userId, token: token, avatar: avatar, style: {
|
|
903
|
+
height: 'calc(100% - 50px)',
|
|
904
|
+
}, withoutBox: true }));
|
|
905
|
+
}
|
|
906
|
+
case REPORT_TYPES.HELP_V1: {
|
|
907
|
+
return (React.createElement(Wrapper, null,
|
|
908
|
+
React.createElement(IframeHelp, { src: pathHelp })));
|
|
909
|
+
}
|
|
910
|
+
default: {
|
|
911
|
+
return null;
|
|
912
|
+
}
|
|
913
|
+
}
|
|
914
|
+
};
|
|
915
|
+
const renderPopupLayout = (type) => {
|
|
916
|
+
var _a;
|
|
917
|
+
return (React.createElement(React.Fragment, null,
|
|
918
|
+
React.createElement(Loading, { isLoading: isMainLoading, width: "100%", height: "100%" }),
|
|
919
|
+
React.createElement(WrapperHeader, { className: "cursor" },
|
|
920
|
+
React.createElement(Header, null, title)),
|
|
921
|
+
React.createElement(WrapperBody, { className: "popup-content", style: {
|
|
922
|
+
padding: type === REPORT_TYPES.CHAT ||
|
|
923
|
+
type === REPORT_TYPES.HELP ||
|
|
924
|
+
type === REPORT_TYPES.HELP_V1
|
|
925
|
+
? '0'
|
|
926
|
+
: '13px 15px',
|
|
927
|
+
} }, renderContentPopup(type)),
|
|
928
|
+
![
|
|
929
|
+
REPORT_TYPES.FEEDBACK,
|
|
930
|
+
REPORT_TYPES.HELP,
|
|
931
|
+
REPORT_TYPES.CHAT,
|
|
932
|
+
REPORT_TYPES.HELP_V1,
|
|
933
|
+
].includes(type) && (React.createElement(WrapperFooter, null,
|
|
934
|
+
React.createElement(Button, { type: "primary", style: { marginRight: 15, fontWeight: 'bold' }, onClick: () => handleSubmit() }, "Send"),
|
|
935
|
+
React.createElement(Button, { onClick: () => callback('ON_CLOSE_POPUP') }, "Cancel"))),
|
|
936
|
+
type === REPORT_TYPES.HELP_V1 && (React.createElement(WrapperFooterSpace, null,
|
|
937
|
+
React.createElement(Button, { type: "primary", style: { marginRight: 15, fontWeight: 'bold' }, onClick: () => callback('ON_BACK_POPUP') }, "BACK"),
|
|
938
|
+
React.createElement(Link, { target: "_blank", href: pathHelp, rel: "noreferrer", style: {
|
|
939
|
+
display: 'flex',
|
|
940
|
+
alignItems: 'center',
|
|
941
|
+
gap: 7,
|
|
942
|
+
} },
|
|
943
|
+
"Open in new tab",
|
|
944
|
+
React.createElement(OpenUrlIcon, { style: {
|
|
945
|
+
fill: (_a = THEME.token) === null || _a === void 0 ? void 0 : _a.colorPrimary,
|
|
946
|
+
maxWidth: 18,
|
|
947
|
+
maxHeight: 18,
|
|
948
|
+
} }))))));
|
|
949
|
+
};
|
|
950
|
+
return (React.createElement(React.Fragment, null,
|
|
951
|
+
React.createElement(DropDown, { menu: {
|
|
952
|
+
style: { minWidth: 250, padding: 0 },
|
|
953
|
+
items: items,
|
|
954
|
+
onClick: info => handleClick(info),
|
|
955
|
+
}, onOpenChange: isOpen => setIsOpenDropdown(isOpen), trigger: triggerType, placement: "bottom", className: "dropdown-helps" }, children || (React.createElement(Button, { style: {
|
|
956
|
+
width: 36,
|
|
957
|
+
height: 36,
|
|
958
|
+
borderRadius: '5px',
|
|
959
|
+
}, icon: React.createElement(QuestionCircleOutlined, { style: {
|
|
960
|
+
color: '#666666',
|
|
961
|
+
fontSize: '24px',
|
|
962
|
+
transform: 'unset',
|
|
963
|
+
} }), className: `${isOpenDropdown ? 'antsomi-btn-default-active' : ''}`, onClick: e => e.preventDefault() }))),
|
|
964
|
+
isShowPopup &&
|
|
965
|
+
createPortal(React.createElement(PopupDraggable, { isHiddenResizing: true, bounds: boundsDraggable, isShowResizeHover: isShowResizeHover, callback: callback, styleContainer: {
|
|
966
|
+
display: 'flex',
|
|
967
|
+
flexDirection: 'column',
|
|
968
|
+
textAlign: 'left',
|
|
969
|
+
} }, renderPopupLayout(type)), document.body, PORTALS_ANTSOMI_PACKAGE_UI_KEY_POPUP),
|
|
970
|
+
isOpenImageDrawer &&
|
|
971
|
+
createPortal(React.createElement(CaptureScreen, { recorderConfigs: {
|
|
972
|
+
recorder: recorderRef.current,
|
|
973
|
+
streamTracks: streamTracks.current,
|
|
974
|
+
isMute,
|
|
975
|
+
}, defaultPositions: {
|
|
976
|
+
[ATTACH_KEYS.CAPTURE]: defaultPositionDrawActions,
|
|
977
|
+
[ATTACH_KEYS.RECORD]: defaultPositionRecordActions,
|
|
978
|
+
}, captureType: captureType, src: urlImageDrawer, callback: callback }), document.body, PORTALS_ANTSOMI_PACKAGE_UI_KEY)));
|
|
979
|
+
};
|
|
980
|
+
Help.defaultProps = {
|
|
981
|
+
triggerType: ['click'],
|
|
982
|
+
boundsDraggable: 'body',
|
|
983
|
+
isShowResizeHover: true,
|
|
984
|
+
configs: {
|
|
985
|
+
apiKey: 'scyw71pj8619analvxs56ppc2w2fj2kpy5vnmflhhc300y35',
|
|
986
|
+
domain: '//sandbox-app.cdp.asia',
|
|
987
|
+
domainTicket: 'https://sandbox-issue.antsomi.com',
|
|
988
|
+
portalId: '33167',
|
|
989
|
+
userId: '1600080515',
|
|
990
|
+
token: '5474r2x214z254a4u2a4y4m503w5p2r5a4s2g4x2l5e4',
|
|
991
|
+
domainPlatform: 'https://platform.ants.tech',
|
|
992
|
+
appCode: 'APP_API_HUB',
|
|
993
|
+
avatar: 'https://c0-platform.ants.tech/avatar/2021/09/20/bldjzfbz33.png',
|
|
994
|
+
config: {
|
|
995
|
+
p_timezone: 'Asia/Hong_Kong',
|
|
996
|
+
api_pid: 33167,
|
|
997
|
+
p_f_longdatetime: "dd MMMM 'at' HH:mm:ss",
|
|
998
|
+
user_language: 'en',
|
|
999
|
+
embeddedData: {},
|
|
1000
|
+
INSIGHT_U_OGS: 'uogs',
|
|
1001
|
+
},
|
|
1002
|
+
},
|
|
1003
|
+
children: '',
|
|
1004
|
+
};
|
|
1005
|
+
export { Help };
|