@zohoim/chat-components 0.0.13 → 0.0.15
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/es/ActionIcon/ActionIcon.js +57 -35
- package/es/ActionIcon/css/ActionIcon.module.css +4 -23
- package/es/ActionIcon/props/defaultProps.js +4 -2
- package/es/ActionIcon/props/propTypes.js +10 -3
- package/es/ActionIconWrapper/ActionIconWrapper.js +57 -0
- package/es/ActionIconWrapper/css/ActionIconWrapper.module.css +32 -0
- package/es/ActionIconWrapper/css/cssJSLogic.js +14 -0
- package/es/ActionIconWrapper/index.js +1 -0
- package/es/{im/IMDateTime → ActionIconWrapper}/props/defaultProps.js +3 -3
- package/es/ActionIconWrapper/props/propTypes.js +11 -0
- package/es/AttachmentBubble/AttachmentBubble.js +30 -29
- package/es/AttachmentBubble/css/AttachmentBubble.module.css +17 -15
- package/es/AttachmentBubble/props/defaultProps.js +2 -2
- package/es/AttachmentBubble/props/propTypes.js +10 -5
- package/es/AttachmentBubbleInfo/AttachmentBubbleInfo.js +13 -21
- package/es/AttachmentBubbleInfo/css/AttachmentBubbleInfo.module.css +19 -16
- package/es/AttachmentBubbleInfo/props/defaultProps.js +1 -1
- package/es/AttachmentBubbleInfo/props/propTypes.js +3 -3
- package/es/AttachmentIcon/AttachmentIcon.js +47 -0
- package/es/AttachmentIcon/css/AttachmentIcon.module.css +4 -0
- package/es/AttachmentIcon/index.js +1 -0
- package/es/{MediaControls → AttachmentIcon}/props/defaultProps.js +3 -3
- package/es/AttachmentIcon/props/propTypes.js +11 -0
- package/es/AttachmentIcon/utils/getAttachmentIconComponent.js +61 -0
- package/es/Audio/Audio.js +14 -36
- package/es/Audio/css/Audio.module.css +3 -3
- package/es/Audio/props/defaultProps.js +2 -3
- package/es/Audio/props/propTypes.js +3 -4
- package/es/AudioBubble/AudioBubble.js +32 -36
- package/es/AudioBubble/css/AudioBubble.module.css +3 -2
- package/es/AudioBubble/props/defaultProps.js +2 -3
- package/es/AudioBubble/props/propTypes.js +10 -7
- package/es/Fonts/puviFont.module.css +55 -54
- package/es/ImageBubble/ImageBubble.js +20 -20
- package/es/ImageBubble/css/ImageBubble.module.css +8 -11
- package/es/ImageBubble/props/defaultProps.js +1 -1
- package/es/ImageBubble/props/propTypes.js +5 -3
- package/es/InfoBubble/InfoBubble.js +6 -8
- package/es/InfoBubble/props/defaultProps.js +1 -1
- package/es/LazyLoadImage/LazyLoadImage.js +6 -16
- package/es/LazyLoadImage/css/LazyLoadImage.module.css +1 -0
- package/es/LazyLoadImage/props/defaultProps.js +1 -1
- package/es/LazyLoadImage/props/propTypes.js +3 -3
- package/es/LocationBubble/LocationBubble.js +17 -34
- package/es/LocationBubble/css/LocationBubble.module.css +13 -14
- package/es/LocationBubble/props/defaultProps.js +1 -1
- package/es/LocationBubble/props/propTypes.js +2 -2
- package/es/MediaBubbleWrapper/MediaBubbleWrapper.js +59 -0
- package/es/MediaBubbleWrapper/css/MediaBubbleWrapper.module.css +7 -0
- package/es/MediaBubbleWrapper/index.js +1 -0
- package/es/MediaBubbleWrapper/props/defaultProps.js +7 -0
- package/es/MediaBubbleWrapper/props/propTypes.js +16 -0
- package/es/Message/Message.js +59 -37
- package/es/Message/props/defaultProps.js +3 -3
- package/es/Message/props/propTypes.js +17 -38
- package/es/MessageAction/MessageAction.js +31 -18
- package/es/MessageAction/props/defaultProps.js +4 -4
- package/es/MessageAction/props/propTypes.js +11 -8
- package/es/MessageActions/MessageActions.js +56 -96
- package/es/MessageActions/css/MessageActions.module.css +2 -9
- package/es/MessageActions/props/defaultProps.js +2 -4
- package/es/MessageActions/props/propTypes.js +13 -19
- package/es/MessageActionsMore/MessageActionsMore.js +43 -35
- package/es/MessageActionsMore/css/MessageActionsMore.module.css +8 -5
- package/es/MessageActionsMore/props/defaultProps.js +3 -2
- package/es/MessageActionsMore/props/propTypes.js +3 -2
- package/es/MessageActionsWrapper/MessageActionsWrapper.js +36 -44
- package/es/MessageActionsWrapper/css/MessageActionsWrapper.module.css +1 -1
- package/es/MessageActionsWrapper/props/defaultProps.js +4 -5
- package/es/MessageActionsWrapper/props/propTypes.js +7 -4
- package/es/MessageAvatar/MessageAvatar.js +11 -19
- package/es/MessageAvatar/css/MessageAvatar.module.css +3 -3
- package/es/MessageAvatar/props/defaultProps.js +2 -6
- package/es/MessageAvatar/props/propTypes.js +5 -5
- package/es/MessageBox/MessageBox.js +33 -30
- package/es/MessageBox/css/MessageBox.module.css +9 -16
- package/es/MessageBox/css/cssJSLogic.js +1 -21
- package/es/MessageBox/props/defaultProps.js +1 -3
- package/es/MessageBox/props/propTypes.js +8 -7
- package/es/MessageBubble/MessageBubble.js +64 -38
- package/es/MessageBubble/css/MessageBubble.module.css +11 -8
- package/es/MessageBubble/css/cssJSLogic.js +10 -26
- package/es/MessageBubble/props/defaultProps.js +1 -1
- package/es/MessageBubble/props/propTypes.js +7 -7
- package/es/MessageStatus/MessageStatus.js +11 -11
- package/es/MessageStatus/css/MessageStatus.module.css +1 -1
- package/es/MessageStatus/css/cssJSLogic.js +13 -9
- package/es/MessageStatus/props/defaultProps.js +1 -1
- package/es/MessageStatus/props/propTypes.js +4 -14
- package/es/MoreActionItem/MoreActionItem.js +21 -33
- package/es/MoreActionItem/css/MoreActionItem.module.css +6 -14
- package/es/MoreActionItem/props/defaultProps.js +1 -5
- package/es/MoreActionItem/props/propTypes.js +6 -5
- package/es/ReplyBubble/ReplyBubble.js +58 -28
- package/es/ReplyBubble/css/ReplyBubble.module.css +17 -0
- package/es/ReplyBubble/props/defaultProps.js +3 -4
- package/es/ReplyBubble/props/propTypes.js +15 -8
- package/es/ReplyBubbleContent/ReplyBubbleContent.js +15 -25
- package/es/ReplyBubbleContent/css/ReplyBubbleContent.module.css +35 -38
- package/es/ReplyBubbleContent/props/defaultProps.js +1 -1
- package/es/ReplyBubbleContent/props/propTypes.js +4 -4
- package/es/ReplyBubbleHeader/ReplyBubbleHeader.js +27 -33
- package/es/ReplyBubbleHeader/css/ReplyBubbleHeader.module.css +25 -9
- package/es/ReplyBubbleHeader/props/defaultProps.js +2 -4
- package/es/ReplyBubbleHeader/props/propTypes.js +3 -2
- package/es/TextBubble/TextBubble.js +12 -30
- package/es/TextBubble/css/TextBubble.module.css +15 -9
- package/es/TextBubble/props/defaultProps.js +2 -5
- package/es/TextBubble/props/propTypes.js +3 -4
- package/es/Theme/{DeskAssets.js → ThemeAssets.js} +10 -6
- package/es/Theme/ThemeWrapper.js +54 -57
- package/es/Theme/{ToolttipWrapper.js → TooltipWrapper.js} +29 -25
- package/es/Theme/constants/index.js +1 -4
- package/es/Theme/crm/dark/blueFanTheme.js +5 -5
- package/es/Theme/crm/dark/blueTheme.js +5 -5
- package/es/Theme/crm/dark/commonColorVariable.js +5 -5
- package/es/Theme/crm/dark/darkBlueTheme.js +5 -5
- package/es/Theme/crm/dark/darkGreyTheme.js +5 -5
- package/es/Theme/crm/dark/greenTheme.js +5 -5
- package/es/Theme/crm/dark/orangeTheme.js +5 -5
- package/es/Theme/crm/dark/pinkTheme.js +5 -5
- package/es/Theme/crm/dark/tealTheme.js +5 -5
- package/es/Theme/crm/dark/whiteTheme.js +5 -5
- package/es/Theme/crm/light/blueFanTheme.js +5 -5
- package/es/Theme/crm/light/blueTheme.js +3 -3
- package/es/Theme/crm/light/commonColorVariable.js +3 -3
- package/es/Theme/crm/light/darkBlueTheme.js +5 -5
- package/es/Theme/crm/light/darkGreyTheme.js +5 -5
- package/es/Theme/crm/light/greenTheme.js +3 -3
- package/es/Theme/crm/light/orangeTheme.js +3 -3
- package/es/Theme/crm/light/pinkTheme.js +3 -3
- package/es/Theme/crm/light/tealTheme.js +3 -3
- package/es/Theme/crm/light/whiteTheme.js +5 -5
- package/es/Theme/crm/pureDark/blueFanTheme.js +5 -5
- package/es/Theme/crm/pureDark/blueTheme.js +5 -5
- package/es/Theme/crm/pureDark/commonColorVariable.js +3 -3
- package/es/Theme/crm/pureDark/darkBlueTheme.js +5 -5
- package/es/Theme/crm/pureDark/darkGreyTheme.js +5 -5
- package/es/Theme/crm/pureDark/greenTheme.js +5 -5
- package/es/Theme/crm/pureDark/orangeTheme.js +5 -5
- package/es/Theme/crm/pureDark/pinkTheme.js +5 -5
- package/es/Theme/crm/pureDark/tealTheme.js +5 -5
- package/es/Theme/crm/pureDark/whiteTheme.js +5 -5
- package/es/Theme/css/TooltipWrapper.module.css +2 -2
- package/es/Theme/props/defaultProps.js +2 -3
- package/es/Theme/props/propTypes.js +5 -6
- package/es/Theme/{desk/commonDeskColorVariable.js → themeVariables/commonThemeColorVariable.js} +2 -3
- package/es/Theme/{desk → themeVariables}/dark/blueTheme.js +11 -11
- package/es/Theme/{desk → themeVariables}/dark/commonColorVariable.js +1 -1
- package/es/Theme/{desk → themeVariables}/dark/greenTheme.js +8 -8
- package/es/Theme/{desk → themeVariables}/dark/orangeTheme.js +8 -8
- package/es/Theme/{desk → themeVariables}/dark/redTheme.js +8 -8
- package/es/Theme/{desk → themeVariables}/dark/yellowTheme.js +8 -8
- package/es/Theme/{desk → themeVariables}/light/blueTheme.js +8 -8
- package/es/Theme/{desk → themeVariables}/light/commonColorVariable.js +1 -1
- package/es/Theme/{desk → themeVariables}/light/greenTheme.js +8 -8
- package/es/Theme/{desk → themeVariables}/light/orangeTheme.js +7 -7
- package/es/Theme/{desk → themeVariables}/light/redTheme.js +7 -7
- package/es/Theme/{desk → themeVariables}/light/yellowTheme.js +8 -8
- package/es/Theme/{desk → themeVariables}/pureDark/blueTheme.js +8 -8
- package/es/Theme/{desk → themeVariables}/pureDark/commonColorVariable.js +1 -1
- package/es/Theme/{desk → themeVariables}/pureDark/greenTheme.js +8 -8
- package/es/Theme/{desk → themeVariables}/pureDark/orangeTheme.js +8 -8
- package/es/Theme/{desk → themeVariables}/pureDark/redTheme.js +8 -8
- package/es/Theme/{desk → themeVariables}/pureDark/yellowTheme.js +8 -8
- package/es/Theme/utils/combineConfigurations.js +17 -0
- package/es/Theme/utils/flatVariables.js +12 -0
- package/es/Theme/utils/getCustomizedCssVariables.js +19 -0
- package/es/Theme/utils/getThemeConfigurations.js +47 -175
- package/es/Theme/utils/getWrapperDivProps.js +12 -0
- package/es/Video/Video.js +13 -45
- package/es/Video/css/Video.module.css +2 -7
- package/es/Video/props/defaultProps.js +2 -3
- package/es/Video/props/propTypes.js +3 -4
- package/es/VideoBubble/VideoBubble.js +32 -35
- package/es/VideoBubble/css/VideoBubble.module.css +4 -4
- package/es/VideoBubble/props/defaultProps.js +2 -3
- package/es/VideoBubble/props/propTypes.js +11 -7
- package/es/css/common.module.css +6 -0
- package/es/icons/create-icon-components.js +30 -0
- package/es/icons/factory/common/article.svg +4 -4
- package/es/icons/factory/integrations/chInstagram.svg +2 -2
- package/es/icons/factory/integrations/chWhatsApp.svg +2 -2
- package/es/icons/factory/integrations/ttASAP.svg +6 -1
- package/es/icons/factory/integrations/ttLine.svg +8 -0
- package/es/icons/factory/integrations/ttTelegram.svg +4 -1
- package/es/icons/factory/integrations/ttTwillio.svg +8 -1
- package/es/icons/factory/integrations/ttWechat.svg +9 -1
- package/es/icons/icon.template.js +9 -8
- package/es/icons/iconSrc/common/Article.js +2 -3
- package/es/icons/iconSrc/common/index.js +1 -2
- package/es/icons/iconSrc/integrations/ChInstagram.js +2 -3
- package/es/icons/iconSrc/integrations/ChWhatsApp.js +2 -3
- package/es/icons/iconSrc/integrations/TtASAP.js +11 -15
- package/es/icons/iconSrc/integrations/{TtTwitter.js → TtLine.js} +14 -18
- package/es/icons/iconSrc/integrations/TtTelegram.js +8 -12
- package/es/icons/iconSrc/integrations/TtTwillio.js +15 -19
- package/es/icons/iconSrc/integrations/TtWechat.js +19 -20
- package/es/icons/iconSrc/integrations/index.js +1 -1
- package/es/im/ArticleBubble/ArticleBubble.js +67 -0
- package/es/im/ArticleBubble/css/ArticleBubble.module.css +57 -0
- package/es/{ArticleBubble → im/ArticleBubble}/props/defaultProps.js +1 -1
- package/es/im/ArticleBubble/props/propTypes.js +13 -0
- package/es/im/IMAutoMessageInfo/IMAutoMessageInfo.js +10 -20
- package/es/im/IMAutoMessageInfo/css/IMAutoMessageInfo.module.css +2 -3
- package/es/im/IMAutoMessageInfo/props/defaultProps.js +1 -1
- package/es/im/IMAutoMessageInfo/props/propTypes.js +11 -9
- package/es/im/IMInfoBubble/IMInfoBubble.js +6 -8
- package/es/im/IMInfoBubble/props/defaultProps.js +1 -1
- package/es/im/IMIntegrationIcon/IMIntegrationIcon.js +31 -38
- package/es/im/IMIntegrationIcon/css/IMIntegrationIcon.module.css +5 -8
- package/es/im/IMIntegrationIcon/css/cssJSLogic.js +9 -13
- package/es/im/IMIntegrationIcon/index.js +1 -2
- package/es/im/IMIntegrationIcon/props/defaultProps.js +6 -4
- package/es/im/IMIntegrationIcon/props/propTypes.js +6 -17
- package/es/im/IMMessage/IMMessage.js +97 -90
- package/es/im/IMMessage/css/IMMessage.module.css +36 -0
- package/es/im/IMMessage/css/cssJSLogic.js +16 -3
- package/es/im/IMMessage/props/defaultProps.js +3 -11
- package/es/im/IMMessage/props/propTypes.js +52 -97
- package/es/im/IMMessageContent/IMMessageContent.js +76 -65
- package/es/im/IMMessageContent/css/IMMessageContent.module.css +1 -1
- package/es/im/IMMessageContent/props/defaultProps.js +2 -3
- package/es/im/IMMessageContent/props/propTypes.js +29 -23
- package/es/im/IMMessageMeta/IMMessageMeta.js +26 -21
- package/es/im/IMMessageMeta/css/IMMessageMeta.module.css +13 -4
- package/es/im/IMMessageMeta/css/cssJSLogic.js +11 -3
- package/es/im/IMMessageMeta/props/defaultProps.js +1 -1
- package/es/im/IMMessageMeta/props/propTypes.js +17 -12
- package/es/im/IMPermaLink/IMPermaLink.js +48 -0
- package/es/im/IMPermaLink/css/IMPermaLink.module.css +14 -0
- package/es/im/{IMTicketLink → IMPermaLink}/css/cssJSLogic.js +3 -3
- package/es/im/IMPermaLink/index.js +1 -0
- package/es/im/{IMAttachmentIcon → IMPermaLink}/props/defaultProps.js +3 -3
- package/es/im/IMPermaLink/props/propTypes.js +11 -0
- package/es/im/IMReplyBubble/IMReplyBubble.js +20 -59
- package/es/im/IMReplyBubble/props/defaultProps.js +2 -4
- package/es/im/IMReplyBubble/props/propTypes.js +16 -14
- package/es/im/IMTextBubble/IMTextBubble.js +15 -31
- package/es/im/IMTextBubble/props/defaultProps.js +3 -9
- package/es/im/IMTextBubble/props/propTypes.js +22 -8
- package/es/im/css/common.module.css +6 -0
- package/es/im/index.js +2 -10
- package/es/index.js +4 -6
- package/package.json +32 -14
- package/es/ActionIcon/css/cssJSLogic.js +0 -10
- package/es/ArticleBubble/ArticleBubble.js +0 -70
- package/es/ArticleBubble/css/ArticleBubble.module.css +0 -48
- package/es/ArticleBubble/css/cssJSLogic.js +0 -34
- package/es/ArticleBubble/props/propTypes.js +0 -10
- package/es/AttachmentBubble/css/cssJSLogic.js +0 -18
- package/es/AttachmentBubbleInfo/css/cssJSLogic.js +0 -18
- package/es/Audio/css/cssJSLogic.js +0 -14
- package/es/AudioBubble/css/cssJSLogic.js +0 -20
- package/es/ImageBubble/css/cssJSLogic.js +0 -22
- package/es/LazyLoadImage/css/cssJSLogic.js +0 -10
- package/es/LocationBubble/css/cssJSLogic.js +0 -30
- package/es/MediaControls/MediaControls.js +0 -59
- package/es/MediaControls/css/MediaControls.module.css +0 -1
- package/es/MediaControls/css/cssJSLogic.js +0 -22
- package/es/MediaControls/index.js +0 -1
- package/es/MediaControls/props/propTypes.js +0 -11
- package/es/Message/css/Message.module.css +0 -0
- package/es/Message/css/cssJSLogic.js +0 -10
- package/es/MessageAction/css/MessageAction.module.css +0 -0
- package/es/MessageAction/css/cssJSLogic.js +0 -0
- package/es/MessageActions/css/cssJSLogic.js +0 -20
- package/es/MessageActionsMore/css/cssJSLogic.js +0 -28
- package/es/MessageActionsWrapper/css/cssJSLogic.js +0 -10
- package/es/MessageActionsWrapper/props/propConstants.js +0 -7
- package/es/MessageAvatar/css/cssJSLogic.js +0 -18
- package/es/MessageBubble/props/propConstants.js +0 -6
- package/es/MoreActionItem/css/cssJSLogic.js +0 -27
- package/es/ReplyBubble/css/cssJSLogic.js +0 -10
- package/es/ReplyBubbleContent/css/cssJSLogic.js +0 -22
- package/es/ReplyBubbleHeader/css/cssJSLogic.js +0 -18
- package/es/TextBubble/css/cssJSLogic.js +0 -18
- package/es/Theme/css/cssJSLogic.js +0 -14
- package/es/Video/css/cssJSLogic.js +0 -14
- package/es/VideoBubble/css/cssJSLogic.js +0 -10
- package/es/icons/factory/actions/convertTicket.svg +0 -21
- package/es/icons/factory/common/quote.svg +0 -1
- package/es/icons/factory/integrations/ttTwitter.svg +0 -1
- package/es/icons/iconSrc/actions/ConvertTicket.js +0 -25
- package/es/icons/iconSrc/actions/index.js +0 -1
- package/es/icons/iconSrc/common/Quote.js +0 -17
- package/es/im/IMArticleBubble/IMArticleBubble.js +0 -54
- package/es/im/IMArticleBubble/css/IMArticleBubble.module.css +0 -0
- package/es/im/IMArticleBubble/css/cssJSLogic.js +0 -10
- package/es/im/IMArticleBubble/index.js +0 -1
- package/es/im/IMArticleBubble/props/defaultProps.js +0 -8
- package/es/im/IMArticleBubble/props/propTypes.js +0 -14
- package/es/im/IMAttachmentBubble/IMAttachmentBubble.js +0 -62
- package/es/im/IMAttachmentBubble/css/IMAttachmentBubble.module.css +0 -1
- package/es/im/IMAttachmentBubble/css/cssJSLogic.js +0 -10
- package/es/im/IMAttachmentBubble/index.js +0 -1
- package/es/im/IMAttachmentBubble/props/defaultProps.js +0 -10
- package/es/im/IMAttachmentBubble/props/propTypes.js +0 -16
- package/es/im/IMAttachmentIcon/IMAttachmentIcon.js +0 -85
- package/es/im/IMAttachmentIcon/css/IMAttachmentIcon.module.css +0 -4
- package/es/im/IMAttachmentIcon/css/cssJSLogic.js +0 -16
- package/es/im/IMAttachmentIcon/index.js +0 -1
- package/es/im/IMAttachmentIcon/props/propTypes.js +0 -26
- package/es/im/IMAudioBubble/IMAudioBubble.js +0 -62
- package/es/im/IMAudioBubble/css/IMAudioBubble.module.css +0 -8
- package/es/im/IMAudioBubble/css/cssJSLogic.js +0 -20
- package/es/im/IMAudioBubble/index.js +0 -1
- package/es/im/IMAudioBubble/props/defaultProps.js +0 -11
- package/es/im/IMAudioBubble/props/propTypes.js +0 -17
- package/es/im/IMAutoMessageInfo/css/cssJSLogic.js +0 -10
- package/es/im/IMDateTime/IMDateTime.js +0 -40
- package/es/im/IMDateTime/css/IMDateTime.module.css +0 -10
- package/es/im/IMDateTime/css/cssJSLogic.js +0 -10
- package/es/im/IMDateTime/index.js +0 -1
- package/es/im/IMDateTime/props/propTypes.js +0 -6
- package/es/im/IMImageBubble/IMImageBubble.js +0 -50
- package/es/im/IMImageBubble/css/IMImageBubble.module.css +0 -0
- package/es/im/IMImageBubble/css/cssJSLogic.js +0 -10
- package/es/im/IMImageBubble/index.js +0 -1
- package/es/im/IMImageBubble/props/defaultProps.js +0 -7
- package/es/im/IMImageBubble/props/propTypes.js +0 -13
- package/es/im/IMIntegrationIcon/props/propConstants.js +0 -8
- package/es/im/IMLocationBubble/IMLocationBubble.js +0 -50
- package/es/im/IMLocationBubble/css/IMLocationBubble.module.css +0 -0
- package/es/im/IMLocationBubble/css/cssJSLogic.js +0 -10
- package/es/im/IMLocationBubble/index.js +0 -1
- package/es/im/IMLocationBubble/props/defaultProps.js +0 -8
- package/es/im/IMLocationBubble/props/propTypes.js +0 -11
- package/es/im/IMMessageAvatar/IMMessageAvatar.js +0 -45
- package/es/im/IMMessageAvatar/css/IMMessageAvatar.module.css +0 -0
- package/es/im/IMMessageAvatar/css/cssJSLogic.js +0 -0
- package/es/im/IMMessageAvatar/index.js +0 -1
- package/es/im/IMMessageAvatar/props/defaultProps.js +0 -12
- package/es/im/IMMessageAvatar/props/propTypes.js +0 -53
- package/es/im/IMMessageContent/css/cssJSLogic.js +0 -10
- package/es/im/IMReplyBubble/css/IMReplyBubble.module.css +0 -18
- package/es/im/IMReplyBubble/css/cssJSLogic.js +0 -10
- package/es/im/IMTextBubble/css/IMTextBubble.module.css +0 -1
- package/es/im/IMTextBubble/css/cssJSLogic.js +0 -10
- package/es/im/IMTicketLink/IMTicketLink.js +0 -46
- package/es/im/IMTicketLink/css/IMTicketLink.module.css +0 -27
- package/es/im/IMTicketLink/index.js +0 -1
- package/es/im/IMTicketLink/props/defaultProps.js +0 -6
- package/es/im/IMTicketLink/props/propTypes.js +0 -10
- package/es/im/IMVideoBubble/IMVideoBubble.js +0 -61
- package/es/im/IMVideoBubble/css/IMVideoBubble.module.css +0 -1
- package/es/im/IMVideoBubble/css/cssJSLogic.js +0 -10
- package/es/im/IMVideoBubble/index.js +0 -1
- package/es/im/IMVideoBubble/props/defaultProps.js +0 -11
- package/es/im/IMVideoBubble/props/propTypes.js +0 -17
- package/es/unused/AvatarSpace/AvatarSpace.js +0 -40
- package/es/unused/AvatarSpace/css/AvatarSpace.module.css +0 -1
- package/es/unused/AvatarSpace/css/cssJSLogic.js +0 -15
- package/es/unused/AvatarSpace/index.js +0 -1
- package/es/unused/AvatarSpace/props/defaultProps.js +0 -10
- package/es/unused/AvatarSpace/props/propConstants.js +0 -7
- package/es/unused/AvatarSpace/props/propTypes.js +0 -8
- package/es/unused/MessageBoxFooter/MessageBoxFooter.js +0 -39
- package/es/unused/MessageBoxFooter/css/MessageBoxFooter.module.css +0 -3
- package/es/unused/MessageBoxFooter/css/cssJSLogic.js +0 -10
- package/es/unused/MessageBoxFooter/index.js +0 -1
- package/es/unused/MessageBoxFooter/props/defaultProps.js +0 -5
- package/es/unused/MessageBoxFooter/props/propTypes.js +0 -6
- package/es/unused/MessageBoxHeader/MessageBoxHeader.js +0 -7
- package/es/unused/MessageBoxHeader/css/MessageBoxHeader.module.css +0 -0
- package/es/unused/MessageBoxHeader/css/cssJsLogic.js +0 -0
- package/es/unused/MessageBoxHeader/index.js +0 -2
- package/es/unused/MessageBoxHeader/props/defaultProps.js +0 -0
- package/es/unused/MessageBoxHeader/props/propTypes.js +0 -0
- package/es/unused/MessageWrapper/MessageWrapper.js +0 -36
- package/es/unused/MessageWrapper/css/MessageWrapper.module.css +0 -0
- package/es/unused/MessageWrapper/css/cssJSLogic.js +0 -10
- package/es/unused/MessageWrapper/index.js +0 -1
- package/es/unused/MessageWrapper/props/defaultProps.js +0 -6
- package/es/unused/MessageWrapper/props/propTypes.js +0 -6
- package/es/unused/TextMessage/DefaultActions.js +0 -60
- package/es/unused/TextMessage/TextMessage.js +0 -67
- package/es/unused/TextMessage/TextMessage1.js +0 -66
- package/es/unused/TextMessage/css/TextMessage.module.css +0 -5
- package/es/unused/TextMessage/css/cssJSLogic.js +0 -0
- package/es/unused/TextMessage/index.js +0 -1
- package/es/unused/TextMessage/props/defaultProps.js +0 -4
- package/es/unused/TextMessage/props/propConstants.js +0 -3
- package/es/unused/TextMessage/props/propTypes.js +0 -17
- package/es/unused/darkTheme.js +0 -9
- package/es/unused/defaultTheme.js +0 -33
- /package/es/{ArticleBubble → im/ArticleBubble}/index.js +0 -0
|
@@ -1,14 +1,17 @@
|
|
|
1
1
|
/** ** Libraries *** */
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
3
|
const messageActionPropTypes = {
|
|
4
|
-
displayText: PropTypes.string,
|
|
5
|
-
id: PropTypes.string,
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
4
|
+
displayText: PropTypes.string.isRequired,
|
|
5
|
+
id: PropTypes.string.isRequired,
|
|
6
|
+
onClick: PropTypes.func.isRequired,
|
|
7
|
+
closePopup: PropTypes.func,
|
|
8
|
+
customProps: PropTypes.shape({
|
|
9
|
+
actionIconProps: PropTypes.object,
|
|
10
|
+
moreActionItemProps: PropTypes.object
|
|
11
|
+
}),
|
|
10
12
|
iconTitle: PropTypes.string,
|
|
11
|
-
|
|
12
|
-
|
|
13
|
+
isDisabled: PropTypes.bool,
|
|
14
|
+
isShowInMore: PropTypes.bool,
|
|
15
|
+
needMoreActionItemIcon: PropTypes.bool
|
|
13
16
|
};
|
|
14
17
|
export default messageActionPropTypes;
|
|
@@ -1,81 +1,48 @@
|
|
|
1
|
-
|
|
2
|
-
/* eslint-disable react/jsx-no-bind */
|
|
3
|
-
/* eslint-disable max-len */
|
|
4
|
-
/* eslint-disable arrow-parens */
|
|
1
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
5
2
|
|
|
6
3
|
/** ** Libraries *** */
|
|
7
|
-
import React from 'react';
|
|
8
|
-
|
|
4
|
+
import React, { useCallback, Fragment } from 'react';
|
|
9
5
|
/** ** Components *** */
|
|
10
|
-
|
|
6
|
+
|
|
7
|
+
import ActionIconWrapper from '../ActionIconWrapper/ActionIconWrapper';
|
|
11
8
|
import MessageActionsWrapper from '../MessageActionsWrapper/MessageActionsWrapper';
|
|
12
9
|
import MessageAction from '../MessageAction/MessageAction';
|
|
13
|
-
|
|
14
10
|
/** ** Icons *** */
|
|
15
|
-
import ReplyIcon from '@zohodesk/icon/es/general/Reply';
|
|
16
|
-
import ReloadIcon from '@zohodesk/icon/es/general/Reload';
|
|
17
|
-
import CopyIcon from '@zohodesk/icon/es/general/Copy';
|
|
18
|
-
import DownloadIcon from '@zohodesk/icon/es/general/Cloud';
|
|
19
|
-
import DeleteIcon from '@zohodesk/icon/es/general/Delete';
|
|
20
|
-
import ForwardIcon from '@zohodesk/icon/es/channels/EmailForward';
|
|
21
|
-
import MoreIcon from '@zohodesk/icon/es/general/More';
|
|
22
|
-
import ConvertTicket from '../icons/iconSrc/actions/ConvertTicket';
|
|
23
11
|
|
|
12
|
+
import MoreIcon from '@zohodesk/icon/es/general/More';
|
|
24
13
|
/** ** Hooks *** */
|
|
14
|
+
|
|
25
15
|
import useMergeStyle from '@zohodesk/hooks/es/utils/useMergeStyle';
|
|
26
16
|
import useMessageActions from '@zohoim/chat-components-hooks/es/MessageActions/useMessageActions';
|
|
27
|
-
|
|
28
17
|
/** ** Methods *** */
|
|
29
|
-
import renderHandler from '@zohoim/chat-components-utils/es/common/renderHandler';
|
|
30
|
-
import cssJSLogic from './css/cssJSLogic';
|
|
31
18
|
|
|
19
|
+
import renderHandler from '@zohoim/chat-components-utils/es/common/renderHandler';
|
|
32
20
|
/** ** Constants *** */
|
|
21
|
+
|
|
33
22
|
import messageActionsDefaultProps from './props/defaultProps';
|
|
34
23
|
import messageActionsPropTypes from './props/propTypes';
|
|
35
|
-
import { dummyObject } from '@zohoim/chat-components-utils/es/constants';
|
|
36
|
-
import { defaultMessageActions } from '@zohoim/chat-components-utils/es/constants/messageActionConstants';
|
|
37
|
-
|
|
24
|
+
import { dummyObject } from '@zohoim/chat-components-utils/es/constants/emptyConstants';
|
|
38
25
|
/** ** CSS *** */
|
|
26
|
+
|
|
39
27
|
import style from './css/MessageActions.module.css';
|
|
40
|
-
const {
|
|
41
|
-
REPLY,
|
|
42
|
-
COPY,
|
|
43
|
-
DOWNLOAD,
|
|
44
|
-
CREATE_TICKET,
|
|
45
|
-
RESEND,
|
|
46
|
-
DELETE,
|
|
47
|
-
FORWARD
|
|
48
|
-
} = defaultMessageActions;
|
|
49
28
|
export default function MessageActions(props) {
|
|
50
29
|
const {
|
|
51
30
|
actions,
|
|
52
31
|
defaultShowCount,
|
|
53
|
-
actionIconCustomStyle,
|
|
54
|
-
moreItemCustomStyle,
|
|
55
32
|
onSelect,
|
|
33
|
+
renderSecondaryActions,
|
|
56
34
|
customStyle,
|
|
57
|
-
|
|
58
|
-
renderSecondaryActions
|
|
35
|
+
customProps
|
|
59
36
|
} = props;
|
|
37
|
+
const {
|
|
38
|
+
messageActionProps = dummyObject,
|
|
39
|
+
actionIconWrapperProps = dummyObject,
|
|
40
|
+
messageActionsWrapperProps = dummyObject
|
|
41
|
+
} = customProps;
|
|
42
|
+
/* External CSS Customization */
|
|
60
43
|
|
|
61
|
-
/* external customization */
|
|
62
44
|
const newStyle = useMergeStyle(style, customStyle);
|
|
63
|
-
|
|
64
|
-
const {
|
|
65
|
-
moreIconClass,
|
|
66
|
-
secondaryActionsClass,
|
|
67
|
-
iconStyle
|
|
68
|
-
} = cssJSLogic(props, newStyle);
|
|
69
|
-
const {
|
|
70
|
-
actionDetails
|
|
71
|
-
} = useMessageActions({
|
|
72
|
-
actions,
|
|
73
|
-
defaultRenderFunction: renderAction
|
|
74
|
-
});
|
|
75
|
-
const {
|
|
76
|
-
allActions
|
|
77
|
-
} = actionDetails;
|
|
78
|
-
function handleClickAction(_ref) {
|
|
45
|
+
const handleClickAction = useCallback(_ref => {
|
|
79
46
|
let {
|
|
80
47
|
id,
|
|
81
48
|
e
|
|
@@ -84,26 +51,10 @@ export default function MessageActions(props) {
|
|
|
84
51
|
id,
|
|
85
52
|
e
|
|
86
53
|
});
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
} = _ref2;
|
|
92
|
-
const iconMapping = {
|
|
93
|
-
[REPLY]: ReplyIcon,
|
|
94
|
-
[COPY]: CopyIcon,
|
|
95
|
-
[DOWNLOAD]: DownloadIcon,
|
|
96
|
-
[CREATE_TICKET]: ConvertTicket,
|
|
97
|
-
[RESEND]: ReloadIcon,
|
|
98
|
-
[DELETE]: DeleteIcon,
|
|
99
|
-
[FORWARD]: ForwardIcon
|
|
100
|
-
};
|
|
101
|
-
const IconComponent = iconMapping[id];
|
|
102
|
-
return IconComponent ? /*#__PURE__*/React.createElement(IconComponent, {
|
|
103
|
-
customStyle: iconStyle
|
|
104
|
-
}) : null;
|
|
105
|
-
}
|
|
106
|
-
function renderAction() {
|
|
54
|
+
}, [onSelect]);
|
|
55
|
+
/* External Action Icon */
|
|
56
|
+
|
|
57
|
+
const renderAction = useCallback(function () {
|
|
107
58
|
let {
|
|
108
59
|
id,
|
|
109
60
|
isShowInMore,
|
|
@@ -112,39 +63,48 @@ export default function MessageActions(props) {
|
|
|
112
63
|
} = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
113
64
|
const {
|
|
114
65
|
displayText,
|
|
115
|
-
iconTitle
|
|
66
|
+
iconTitle,
|
|
67
|
+
isDisabled
|
|
116
68
|
} = action || dummyObject;
|
|
117
|
-
return /*#__PURE__*/React.createElement(MessageAction, {
|
|
118
|
-
|
|
69
|
+
return /*#__PURE__*/React.createElement(MessageAction, _extends({
|
|
70
|
+
key: id,
|
|
119
71
|
closePopup: closePopup,
|
|
120
72
|
displayText: displayText,
|
|
121
73
|
iconTitle: iconTitle,
|
|
122
74
|
id: id,
|
|
123
|
-
|
|
75
|
+
isDisabled: isDisabled,
|
|
124
76
|
isShowInMore: isShowInMore,
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
}
|
|
77
|
+
onClick: handleClickAction
|
|
78
|
+
}, messageActionProps));
|
|
79
|
+
}, [handleClickAction, messageActionProps]);
|
|
80
|
+
/* Hooks handling */
|
|
81
|
+
|
|
82
|
+
const {
|
|
83
|
+
actionDetails
|
|
84
|
+
} = useMessageActions({
|
|
85
|
+
actions,
|
|
86
|
+
defaultRenderFunction: renderAction
|
|
87
|
+
});
|
|
88
|
+
const {
|
|
89
|
+
allActions
|
|
90
|
+
} = actionDetails;
|
|
91
|
+
/* Render More Icon */
|
|
92
|
+
|
|
93
|
+
const renderMoreIcon = useCallback(() => /*#__PURE__*/React.createElement("div", {
|
|
94
|
+
className: newStyle.moreIcon
|
|
95
|
+
}, /*#__PURE__*/React.createElement(MoreIcon, null)), [newStyle.moreIcon]);
|
|
96
|
+
const renderMore = useCallback(() => /*#__PURE__*/React.createElement(ActionIconWrapper, _extends({
|
|
97
|
+
renderIcon: renderMoreIcon
|
|
98
|
+
}, actionIconWrapperProps)), [actionIconWrapperProps, renderMoreIcon]);
|
|
139
99
|
const secondaryActions = renderHandler(renderSecondaryActions)();
|
|
140
|
-
return /*#__PURE__*/React.createElement(
|
|
100
|
+
return /*#__PURE__*/React.createElement(Fragment, null, /*#__PURE__*/React.createElement(MessageActionsWrapper, _extends({
|
|
141
101
|
actions: allActions,
|
|
142
102
|
defaultShowCount: defaultShowCount,
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
className: secondaryActionsClass
|
|
103
|
+
renderMoreIcon: renderMore
|
|
104
|
+
}, messageActionsWrapperProps)), secondaryActions ? /*#__PURE__*/React.createElement("div", {
|
|
105
|
+
className: newStyle.secondaryActions
|
|
147
106
|
}, secondaryActions) : null);
|
|
148
107
|
}
|
|
149
108
|
MessageActions.propTypes = messageActionsPropTypes;
|
|
150
|
-
MessageActions.defaultProps = messageActionsDefaultProps;
|
|
109
|
+
MessageActions.defaultProps = messageActionsDefaultProps;
|
|
110
|
+
MessageActions.displayName = 'MessageActions';
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
.varClass {
|
|
2
|
-
/* --
|
|
3
|
-
--imMessageActions-action_icon_size: var(--imlib_size_15);
|
|
2
|
+
/* --messageActions-secondaryActions_margin: 5px; */
|
|
4
3
|
}
|
|
5
4
|
|
|
6
5
|
[dir=ltr] .moreIcon svg {
|
|
@@ -13,7 +12,7 @@
|
|
|
13
12
|
|
|
14
13
|
.secondaryActions {
|
|
15
14
|
composes: varClass;
|
|
16
|
-
/* margin-top: var(--
|
|
15
|
+
/* margin-top: var(--messageActions-secondaryActions_margin); */
|
|
17
16
|
}
|
|
18
17
|
|
|
19
18
|
[dir=ltr] .secondaryActions {
|
|
@@ -23,9 +22,3 @@
|
|
|
23
22
|
[dir=rtl] .secondaryActions {
|
|
24
23
|
text-align: right;
|
|
25
24
|
}
|
|
26
|
-
|
|
27
|
-
.icon {
|
|
28
|
-
composes: varClass;
|
|
29
|
-
width: var(--imMessageActions-action_icon_size);
|
|
30
|
-
height: var(--imMessageActions-action_icon_size);
|
|
31
|
-
}
|
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
/** ** Constants *** */
|
|
2
|
-
import { dummyObject, dummyArray } from '@zohoim/chat-components-utils/es/constants';
|
|
2
|
+
import { dummyObject, dummyArray } from '@zohoim/chat-components-utils/es/constants/emptyConstants';
|
|
3
3
|
import { actionsDefaultShowCount } from '@zohoim/chat-components-utils/es/constants/messageActionConstants';
|
|
4
4
|
const messageActionsDefaultProps = {
|
|
5
5
|
customStyle: dummyObject,
|
|
6
|
-
|
|
7
|
-
morePopupCustomStyle: dummyObject,
|
|
8
|
-
moreItemCustomStyle: dummyObject,
|
|
6
|
+
customProps: dummyObject,
|
|
9
7
|
defaultShowCount: actionsDefaultShowCount,
|
|
10
8
|
actions: dummyArray
|
|
11
9
|
};
|
|
@@ -1,30 +1,24 @@
|
|
|
1
1
|
/** ** Libraries *** */
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
|
-
|
|
4
3
|
/** ** Constants *** */
|
|
4
|
+
|
|
5
5
|
import { defaultMessageActions } from '@zohoim/chat-components-utils/es/constants/messageActionConstants';
|
|
6
|
-
const {
|
|
7
|
-
REPLY,
|
|
8
|
-
COPY,
|
|
9
|
-
DOWNLOAD,
|
|
10
|
-
CREATE_TICKET,
|
|
11
|
-
RESEND,
|
|
12
|
-
DELETE,
|
|
13
|
-
FORWARD
|
|
14
|
-
} = defaultMessageActions;
|
|
15
6
|
const messageActionsPropTypes = {
|
|
16
7
|
actions: PropTypes.arrayOf(PropTypes.shape({
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
8
|
+
displayText: PropTypes.string.isRequired,
|
|
9
|
+
id: PropTypes.oneOfType([PropTypes.string, PropTypes.oneOf(Object.values(defaultMessageActions))]).isRequired,
|
|
10
|
+
iconTitle: PropTypes.string,
|
|
11
|
+
isDisabled: PropTypes.bool,
|
|
12
|
+
renderFunction: PropTypes.func
|
|
21
13
|
})).isRequired,
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
14
|
+
onSelect: PropTypes.func.isRequired,
|
|
15
|
+
customProps: PropTypes.shape({
|
|
16
|
+
actionIconWrapperProps: PropTypes.object,
|
|
17
|
+
messageActionProps: PropTypes.object,
|
|
18
|
+
messageActionsWrapperProps: PropTypes.object
|
|
19
|
+
}),
|
|
27
20
|
customStyle: PropTypes.object,
|
|
21
|
+
defaultShowCount: PropTypes.number,
|
|
28
22
|
renderSecondaryActions: PropTypes.func
|
|
29
23
|
};
|
|
30
24
|
export default messageActionsPropTypes;
|
|
@@ -1,32 +1,32 @@
|
|
|
1
|
-
/* eslint-disable max-len */
|
|
2
|
-
|
|
3
1
|
/** ** Libraries *** */
|
|
4
|
-
import React from 'react';
|
|
5
|
-
|
|
2
|
+
import React, { useCallback, useMemo } from 'react';
|
|
6
3
|
/** ** Components *** */
|
|
4
|
+
|
|
7
5
|
import Popup from '@zohodesk/components/lib/Popup/Popup';
|
|
8
6
|
import DropBox from '@zohodesk/components/lib/DropBox/DropBox';
|
|
9
|
-
|
|
10
7
|
/** ** Constants *** */
|
|
8
|
+
|
|
11
9
|
import messageActionsMoreDefaultProps from './props/defaultProps';
|
|
12
10
|
import messageActionsMorePropTypes from './props/propTypes';
|
|
13
11
|
import { MSG_ACTION_POPUP_PORTAL } from '../constants';
|
|
14
|
-
|
|
15
12
|
/** ** Methods *** */
|
|
16
|
-
import renderHandler from '@zohoim/chat-components-utils/es/common/renderHandler';
|
|
17
|
-
import cssJSLogic from './css/cssJSLogic';
|
|
18
13
|
|
|
14
|
+
import renderHandler from '@zohoim/chat-components-utils/es/common/renderHandler';
|
|
19
15
|
/** ** Hooks *** */
|
|
20
|
-
import useMergeStyle from '@zohodesk/hooks/es/utils/useMergeStyle';
|
|
21
16
|
|
|
17
|
+
import useMergeStyle from '@zohodesk/hooks/es/utils/useMergeStyle';
|
|
22
18
|
/** ** Styles *** */
|
|
19
|
+
|
|
23
20
|
import style from './css/MessageActionsMore.module.css';
|
|
21
|
+
|
|
24
22
|
function MessageActionsMoreComp(props) {
|
|
25
23
|
const {
|
|
26
24
|
actions,
|
|
27
25
|
renderMoreIcon,
|
|
28
26
|
customStyle,
|
|
29
27
|
popupSize,
|
|
28
|
+
defaultPopupPosition,
|
|
29
|
+
|
|
30
30
|
/** ** Popup Props *** */
|
|
31
31
|
getTargetRef,
|
|
32
32
|
getContainerRef,
|
|
@@ -40,20 +40,39 @@ function MessageActionsMoreComp(props) {
|
|
|
40
40
|
positionsOffset
|
|
41
41
|
} = props;
|
|
42
42
|
const moreIcon = renderHandler(renderMoreIcon)();
|
|
43
|
+
/* External CSS Customization */
|
|
43
44
|
|
|
44
|
-
/* External customization */
|
|
45
45
|
const newStyle = useMergeStyle(style, customStyle);
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
46
|
+
const popupClass = useMemo(() => ({
|
|
47
|
+
customDropBox: newStyle.popup,
|
|
48
|
+
customMobileDropBox: newStyle.mobilePopup,
|
|
49
|
+
customDropBoxWrap: newStyle.popupWrapper,
|
|
50
|
+
customMobileDropBoxWrap: newStyle.mobilePopupWrapper
|
|
51
|
+
}), [newStyle.popup, newStyle.mobilePopup, newStyle.popupWrapper, newStyle.mobilePopupWrapper]);
|
|
52
|
+
|
|
53
|
+
const handleTogglePopup = e => {
|
|
54
|
+
togglePopup(e, defaultPopupPosition);
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
const renderActions = useCallback(() => actions.map(action => {
|
|
58
|
+
const {
|
|
59
|
+
id,
|
|
60
|
+
renderFunction
|
|
61
|
+
} = action;
|
|
62
|
+
return renderHandler(renderFunction)({
|
|
63
|
+
id,
|
|
64
|
+
isShowInMore: true,
|
|
65
|
+
action,
|
|
66
|
+
closePopup: closePopupOnly
|
|
67
|
+
}); // id, isRenderInMorePopup
|
|
68
|
+
}), [actions, closePopupOnly]);
|
|
69
|
+
const isRenderPopup = !!(moreIcon && isPopupOpen);
|
|
51
70
|
return /*#__PURE__*/React.createElement("span", {
|
|
52
|
-
className:
|
|
53
|
-
}, moreIcon ? /*#__PURE__*/React.createElement("
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
}, moreIcon) : null,
|
|
71
|
+
className: newStyle.morePopupContainer
|
|
72
|
+
}, moreIcon ? /*#__PURE__*/React.createElement("span", {
|
|
73
|
+
ref: getTargetRef,
|
|
74
|
+
onClick: handleTogglePopup
|
|
75
|
+
}, moreIcon) : null, isRenderPopup ? /*#__PURE__*/React.createElement(DropBox, {
|
|
57
76
|
boxPosition: position,
|
|
58
77
|
customClass: popupClass,
|
|
59
78
|
getRef: getContainerRef,
|
|
@@ -63,23 +82,12 @@ function MessageActionsMoreComp(props) {
|
|
|
63
82
|
isArrow: false,
|
|
64
83
|
onClick: removeClose,
|
|
65
84
|
portalId: MSG_ACTION_POPUP_PORTAL,
|
|
66
|
-
positionMapping: positionsOffset,
|
|
67
85
|
positionsOffset: positionsOffset,
|
|
68
|
-
size: popupSize
|
|
69
|
-
|
|
70
|
-
},
|
|
71
|
-
const {
|
|
72
|
-
id,
|
|
73
|
-
renderFunction
|
|
74
|
-
} = action;
|
|
75
|
-
return renderHandler(renderFunction)({
|
|
76
|
-
id,
|
|
77
|
-
isShowInMore: true,
|
|
78
|
-
action,
|
|
79
|
-
closePopup: closePopupOnly
|
|
80
|
-
}); // id, isRenderInMorePopup
|
|
81
|
-
})) : null);
|
|
86
|
+
size: popupSize // isModel
|
|
87
|
+
|
|
88
|
+
}, renderActions()) : null);
|
|
82
89
|
}
|
|
90
|
+
|
|
83
91
|
const MessageActionsMore = Popup(MessageActionsMoreComp, '', '', {
|
|
84
92
|
isAbsolutePositioningNeeded: false
|
|
85
93
|
});
|
|
@@ -2,19 +2,22 @@
|
|
|
2
2
|
display: inline-block;
|
|
3
3
|
}
|
|
4
4
|
|
|
5
|
+
.morePopupContainer {
|
|
6
|
+
composes: container;
|
|
7
|
+
}
|
|
8
|
+
|
|
5
9
|
.popup {
|
|
6
|
-
|
|
7
|
-
padding: var(--imlib_size_10) 0;
|
|
10
|
+
padding: var(--zd_size10) 0 ;
|
|
8
11
|
}
|
|
9
12
|
|
|
10
13
|
.popupWrapper {
|
|
11
|
-
|
|
14
|
+
composes: container;
|
|
12
15
|
}
|
|
13
16
|
|
|
14
17
|
.mobilePopup {
|
|
15
|
-
|
|
18
|
+
composes: container;
|
|
16
19
|
}
|
|
17
20
|
|
|
18
21
|
.mobilePopupWrapper {
|
|
19
|
-
|
|
22
|
+
composes: container;
|
|
20
23
|
}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
/** ** Constants *** */
|
|
2
|
-
import { dummyObject, dummyArray } from '@zohoim/chat-components-utils/es/constants';
|
|
2
|
+
import { dummyObject, dummyArray } from '@zohoim/chat-components-utils/es/constants/emptyConstants';
|
|
3
3
|
const messageActionsMoreDefaultProps = {
|
|
4
4
|
customStyle: dummyObject,
|
|
5
5
|
actions: dummyArray,
|
|
6
|
-
popupSize: 'small'
|
|
6
|
+
popupSize: 'small',
|
|
7
|
+
defaultPopupPosition: 'bottomCenter'
|
|
7
8
|
};
|
|
8
9
|
export default messageActionsMoreDefaultProps;
|
|
@@ -5,8 +5,9 @@ const messageActionsMorePropTypes = {
|
|
|
5
5
|
id: PropTypes.string.isRequired,
|
|
6
6
|
renderFunction: PropTypes.func
|
|
7
7
|
})).isRequired,
|
|
8
|
-
renderMoreIcon: PropTypes.func,
|
|
8
|
+
renderMoreIcon: PropTypes.func.isRequired,
|
|
9
9
|
customStyle: PropTypes.object,
|
|
10
|
-
popupSize: PropTypes.
|
|
10
|
+
popupSize: PropTypes.oneOf(['mini', 'xmini', 'xsmall', 'small', 'medium', 'large', 'mlarge', 'xlarge', 'xxlarge', 'default']),
|
|
11
|
+
defaultPopupPosition: PropTypes.oneOf([['bottomCenter', 'bottomLeftToRight', 'bottomCenterToRight', 'bottomRightToLeft', 'bottomCenterToLeft', 'topCenter', 'topLeftToRight', 'topCenterToRight', 'topRightToLeft', 'topCenterToLeft', 'rightTopToBottom', 'rightCenterToBottom', 'rightCenter', 'rightBottomToTop', 'rightCenterToTop', 'leftTopToBottom', 'leftCenterToBottom', 'leftCenter', 'leftBottomToTop', 'leftCenterToTop', 'bottomRight', 'bottomLeft', 'topRight', 'topLeft', 'rightBottom', 'rightTop', 'leftBottom', 'leftTop']])
|
|
11
12
|
};
|
|
12
13
|
export default messageActionsMorePropTypes;
|
|
@@ -1,75 +1,67 @@
|
|
|
1
|
-
|
|
1
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
2
2
|
|
|
3
3
|
/** ** Libraries *** */
|
|
4
|
-
import React from 'react';
|
|
5
|
-
|
|
4
|
+
import React, { useCallback } from 'react';
|
|
6
5
|
/** ** Components *** */
|
|
6
|
+
|
|
7
7
|
import { Container } from '@zohodesk/components/lib/Layout';
|
|
8
8
|
import MessageActionsMore from '../MessageActionsMore/MessageActionsMore';
|
|
9
|
-
|
|
10
9
|
/** ** Hooks *** */
|
|
11
|
-
import { useMessageActionsWrapper } from '@zohoim/chat-components-hooks';
|
|
12
10
|
|
|
11
|
+
import useMessageActionsWrapper from '@zohoim/chat-components-hooks/es/MessageActionsWrapper/useMessageActionsWrapper';
|
|
13
12
|
/** ** Constants *** */
|
|
13
|
+
|
|
14
14
|
import messageActionsWrapperDefaultProps from './props/defaultProps';
|
|
15
15
|
import messageActionsWrapperPropTypes from './props/propTypes';
|
|
16
|
-
import
|
|
17
|
-
|
|
16
|
+
import { dummyArray, dummyObject } from '@zohoim/chat-components-utils/es/constants/emptyConstants';
|
|
18
17
|
/** ** Methods *** */
|
|
18
|
+
|
|
19
19
|
import renderHandler from '@zohoim/chat-components-utils/es/common/renderHandler';
|
|
20
20
|
import useMergeStyle from '@zohodesk/hooks/es/utils/useMergeStyle';
|
|
21
|
-
import cssJSLogic from './css/cssJSLogic';
|
|
22
|
-
|
|
23
21
|
/** ** Style *** */
|
|
22
|
+
|
|
24
23
|
import style from './css/MessageActionsWrapper.module.css';
|
|
25
|
-
function MessageActionsWrapper(props) {
|
|
24
|
+
export default function MessageActionsWrapper(props) {
|
|
26
25
|
const {
|
|
27
26
|
actions,
|
|
28
27
|
renderMoreIcon,
|
|
29
28
|
defaultShowCount,
|
|
30
29
|
customStyle,
|
|
31
|
-
|
|
30
|
+
customProps
|
|
32
31
|
} = props;
|
|
32
|
+
const {
|
|
33
|
+
messageActionsMoreProps = dummyObject
|
|
34
|
+
} = customProps;
|
|
35
|
+
/* External CSS Customization */
|
|
33
36
|
|
|
34
|
-
/* external customization */
|
|
35
37
|
const newStyle = useMergeStyle(style, customStyle);
|
|
36
|
-
/* css classnames added based on logic */
|
|
37
|
-
const {
|
|
38
|
-
actionsClass
|
|
39
|
-
} = cssJSLogic(props, newStyle);
|
|
40
38
|
const {
|
|
41
39
|
isShowMore: isShowMoreIcon,
|
|
42
|
-
|
|
40
|
+
actions: defaultActions = dummyArray,
|
|
41
|
+
moreActions = dummyArray
|
|
43
42
|
} = useMessageActionsWrapper(actions, defaultShowCount);
|
|
44
|
-
const {
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
return
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
actions: moreActions,
|
|
63
|
-
customStyle: morePopupCustomStyle,
|
|
64
|
-
renderMoreIcon: renderMoreIcon
|
|
65
|
-
}) : null));
|
|
66
|
-
}
|
|
43
|
+
const renderDefaultActions = useCallback(() => defaultActions.map(action => {
|
|
44
|
+
const {
|
|
45
|
+
id,
|
|
46
|
+
renderFunction
|
|
47
|
+
} = action;
|
|
48
|
+
return renderHandler(renderFunction)({
|
|
49
|
+
id,
|
|
50
|
+
isShowInMore: false,
|
|
51
|
+
action
|
|
52
|
+
}); // id, isRenderInMorePopup
|
|
53
|
+
}), [defaultActions]);
|
|
54
|
+
const renderMoreActions = useCallback(() => /*#__PURE__*/React.createElement(MessageActionsMore, _extends({
|
|
55
|
+
actions: moreActions,
|
|
56
|
+
renderMoreIcon: renderMoreIcon
|
|
57
|
+
}, messageActionsMoreProps)), [moreActions, renderMoreIcon, messageActionsMoreProps]);
|
|
58
|
+
const renderRow = useCallback(() => /*#__PURE__*/React.createElement(Container, {
|
|
59
|
+
alignBox: "row"
|
|
60
|
+
}, renderDefaultActions(), isShowMoreIcon ? renderMoreActions() : null), [renderDefaultActions, renderMoreActions, isShowMoreIcon]);
|
|
67
61
|
return /*#__PURE__*/React.createElement("div", {
|
|
68
|
-
className:
|
|
62
|
+
className: newStyle.messageActionsWrapper
|
|
69
63
|
}, renderRow(defaultActions, isShowMoreIcon));
|
|
70
64
|
}
|
|
71
65
|
MessageActionsWrapper.defaultProps = messageActionsWrapperDefaultProps;
|
|
72
66
|
MessageActionsWrapper.propTypes = messageActionsWrapperPropTypes;
|
|
73
|
-
MessageActionsWrapper.
|
|
74
|
-
MessageActionsWrapper.displayName = 'MessageActionsWrapper';
|
|
75
|
-
export default MessageActionsWrapper;
|
|
67
|
+
MessageActionsWrapper.displayName = 'MessageActionsWrapper';
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
/** ** Constants *** */
|
|
2
|
-
import { dummyObject
|
|
3
|
-
import
|
|
2
|
+
import { dummyObject } from '@zohoim/chat-components-utils/es/constants/emptyConstants';
|
|
3
|
+
import { actionsDefaultShowCount } from '@zohoim/chat-components-utils/es/constants/messageActionConstants';
|
|
4
4
|
const messageActionsWrapperDefaultProps = {
|
|
5
|
-
actions: dummyArray,
|
|
6
5
|
customStyle: dummyObject,
|
|
7
|
-
|
|
8
|
-
defaultShowCount:
|
|
6
|
+
customProps: dummyObject,
|
|
7
|
+
defaultShowCount: actionsDefaultShowCount
|
|
9
8
|
};
|
|
10
9
|
export default messageActionsWrapperDefaultProps;
|
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
/** ** Libraries *** */
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
|
-
const
|
|
4
|
-
renderMoreIcon: PropTypes.func,
|
|
3
|
+
const messageActionsWrapperPropTypes = {
|
|
5
4
|
actions: PropTypes.arrayOf(PropTypes.shape({
|
|
6
5
|
id: PropTypes.string.isRequired,
|
|
7
6
|
renderFunction: PropTypes.func
|
|
8
7
|
})).isRequired,
|
|
8
|
+
customProps: PropTypes.shape({
|
|
9
|
+
messageActionsMoreProps: PropTypes.object
|
|
10
|
+
}),
|
|
11
|
+
customStyle: PropTypes.object,
|
|
9
12
|
defaultShowCount: PropTypes.number,
|
|
10
|
-
|
|
13
|
+
renderMoreIcon: PropTypes.func
|
|
11
14
|
};
|
|
12
|
-
export default
|
|
15
|
+
export default messageActionsWrapperPropTypes;
|