@hh.ru/magritte-ui-chat-bubble 3.4.5 → 3.5.0
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/Button.js +1 -1
- package/Call.js +1 -1
- package/ChatBubble.d.ts +4 -0
- package/ChatBubble.js +5 -1
- package/ChatBubble.js.map +1 -1
- package/File.js +1 -1
- package/Footer.d.ts +12 -0
- package/Footer.js +17 -0
- package/Footer.js.map +1 -0
- package/Label.js +1 -1
- package/Media.js +1 -1
- package/Message.js +1 -1
- package/Meta.js +1 -1
- package/Reaction.d.ts +21 -0
- package/Reaction.js +43 -0
- package/Reaction.js.map +1 -0
- package/Reply.js +1 -1
- package/Snippet.js +1 -1
- package/Status.js +1 -1
- package/Tail.js +1 -1
- package/chat-bubble-B3D9arfs.js +5 -0
- package/chat-bubble-B3D9arfs.js.map +1 -0
- package/index.css +164 -116
- package/index.d.ts +2 -0
- package/index.js +3 -1
- package/index.js.map +1 -1
- package/index.mock.d.ts +4 -0
- package/index.mock.js +4 -0
- package/index.mock.js.map +1 -1
- package/internal/colors.d.ts +3 -1
- package/internal/colors.js +3 -0
- package/internal/colors.js.map +1 -1
- package/package.json +12 -12
- package/types.d.ts +2 -0
- package/chat-bubble-5kPu0BCa.js +0 -5
- package/chat-bubble-5kPu0BCa.js.map +0 -1
package/Button.js
CHANGED
|
@@ -3,7 +3,7 @@ import { jsx } from 'react/jsx-runtime';
|
|
|
3
3
|
import { forwardRef } from 'react';
|
|
4
4
|
import classnames from 'classnames';
|
|
5
5
|
import { Button } from '@hh.ru/magritte-ui-button';
|
|
6
|
-
import { s as styles } from './chat-bubble-
|
|
6
|
+
import { s as styles } from './chat-bubble-B3D9arfs.js';
|
|
7
7
|
|
|
8
8
|
const ChatBubbleButtonRenderFunc = ({ wide = false, ...props }, ref) => /* @__PURE__ */ jsx("div", { className: classnames({ [styles.buttonWide]: wide }), children: /* @__PURE__ */ jsx(Button, { ...props, ref }) });
|
|
9
9
|
const ChatBubbleButton = forwardRef(ChatBubbleButtonRenderFunc);
|
package/Call.js
CHANGED
|
@@ -6,7 +6,7 @@ import { useChatBubbleColors } from './internal/colors.js';
|
|
|
6
6
|
import { useChatBubbleMode } from './internal/mode.js';
|
|
7
7
|
import { markMetaHost } from './internal/utils.js';
|
|
8
8
|
import { PhoneCrossFilledSize24, PhoneArrowOutFilledSize24, PhoneArrowInFilledSize24 } from '@hh.ru/magritte-ui-icon/icon';
|
|
9
|
-
import { s as styles } from './chat-bubble-
|
|
9
|
+
import { s as styles } from './chat-bubble-B3D9arfs.js';
|
|
10
10
|
|
|
11
11
|
const ChatBubbleCallComponent = forwardRef(
|
|
12
12
|
({ "data-qa": dataQa = "chat-bubble-call", title, description, meta, state = "connected", ...props }, ref) => {
|
package/ChatBubble.d.ts
CHANGED
|
@@ -2,9 +2,11 @@ import { ChatBubbleButton } from './Button';
|
|
|
2
2
|
import { ChatBubbleCall } from './Call';
|
|
3
3
|
import { ChatBubbleErrorAction } from './ErrorAction';
|
|
4
4
|
import { ChatBubbleFile } from './File';
|
|
5
|
+
import { ChatBubbleFooter } from './Footer';
|
|
5
6
|
import { ChatBubbleLabel } from './Label';
|
|
6
7
|
import { ChatBubbleMedia } from './Media';
|
|
7
8
|
import { ChatBubbleMessage } from './Message';
|
|
9
|
+
import { ChatBubbleReaction } from './Reaction';
|
|
8
10
|
import { ChatBubbleReply } from './Reply';
|
|
9
11
|
import { ChatBubbleSnippet } from './Snippet';
|
|
10
12
|
import { ChatBubbleStatus } from './Status';
|
|
@@ -14,9 +16,11 @@ interface ChatBubbleComponents {
|
|
|
14
16
|
Call: typeof ChatBubbleCall;
|
|
15
17
|
ErrorAction: typeof ChatBubbleErrorAction;
|
|
16
18
|
File: typeof ChatBubbleFile;
|
|
19
|
+
Footer: typeof ChatBubbleFooter;
|
|
17
20
|
Label: typeof ChatBubbleLabel;
|
|
18
21
|
Media: typeof ChatBubbleMedia;
|
|
19
22
|
Message: typeof ChatBubbleMessage;
|
|
23
|
+
Reaction: typeof ChatBubbleReaction;
|
|
20
24
|
Reply: typeof ChatBubbleReply;
|
|
21
25
|
Snippet: typeof ChatBubbleSnippet;
|
|
22
26
|
Status: typeof ChatBubbleStatus;
|
package/ChatBubble.js
CHANGED
|
@@ -9,10 +9,12 @@ import { ChatBubbleButton } from './Button.js';
|
|
|
9
9
|
import { ChatBubbleCall } from './Call.js';
|
|
10
10
|
import { ChatBubbleErrorAction } from './ErrorAction.js';
|
|
11
11
|
import { ChatBubbleFile } from './File.js';
|
|
12
|
+
import { ChatBubbleFooter } from './Footer.js';
|
|
12
13
|
import { ChatBubbleLabel } from './Label.js';
|
|
13
14
|
import { ChatBubbleMedia } from './Media.js';
|
|
14
15
|
import { ChatBubbleMessage } from './Message.js';
|
|
15
16
|
import { Meta } from './Meta.js';
|
|
17
|
+
import { ChatBubbleReaction } from './Reaction.js';
|
|
16
18
|
import { ChatBubbleReply } from './Reply.js';
|
|
17
19
|
import { ChatBubbleSnippet } from './Snippet.js';
|
|
18
20
|
import { ChatBubbleStatus } from './Status.js';
|
|
@@ -24,7 +26,7 @@ import { flattenFragments, isMetaHost } from './internal/utils.js';
|
|
|
24
26
|
import { ExclamationCircleFilledSize24, BotFilledSize24 } from '@hh.ru/magritte-ui-icon/icon';
|
|
25
27
|
import { Menu } from '@hh.ru/magritte-ui-menu';
|
|
26
28
|
import { Text } from '@hh.ru/magritte-ui-typography';
|
|
27
|
-
import { s as styles } from './chat-bubble-
|
|
29
|
+
import { s as styles } from './chat-bubble-B3D9arfs.js';
|
|
28
30
|
import '@hh.ru/magritte-ui-cell';
|
|
29
31
|
import './internal/colors.js';
|
|
30
32
|
import '@hh.ru/magritte-ui-link';
|
|
@@ -166,9 +168,11 @@ ChatBubble.Button = ChatBubbleButton;
|
|
|
166
168
|
ChatBubble.Call = ChatBubbleCall;
|
|
167
169
|
ChatBubble.ErrorAction = ChatBubbleErrorAction;
|
|
168
170
|
ChatBubble.File = ChatBubbleFile;
|
|
171
|
+
ChatBubble.Footer = ChatBubbleFooter;
|
|
169
172
|
ChatBubble.Label = ChatBubbleLabel;
|
|
170
173
|
ChatBubble.Media = ChatBubbleMedia;
|
|
171
174
|
ChatBubble.Message = ChatBubbleMessage;
|
|
175
|
+
ChatBubble.Reaction = ChatBubbleReaction;
|
|
172
176
|
ChatBubble.Reply = ChatBubbleReply;
|
|
173
177
|
ChatBubble.Snippet = ChatBubbleSnippet;
|
|
174
178
|
ChatBubble.Status = ChatBubbleStatus;
|
package/ChatBubble.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ChatBubble.js","sources":["src/ChatBubble.tsx"],"sourcesContent":["import { cloneElement, forwardRef, useCallback, useState, useRef } from 'react';\nimport classnames from 'classnames';\n\nimport { useCloseByClickOutside } from '@hh.ru/magritte-common-mouse';\nimport { AvatarDefaultPropsContext, type AvatarProps } from '@hh.ru/magritte-ui-avatar';\nimport { ButtonDefaultPropsContext, type ButtonProps } from '@hh.ru/magritte-ui-button';\nimport { ChatBubbleButton } from '@hh.ru/magritte-ui-chat-bubble/Button';\nimport { ChatBubbleCall } from '@hh.ru/magritte-ui-chat-bubble/Call';\nimport { ChatBubbleErrorAction } from '@hh.ru/magritte-ui-chat-bubble/ErrorAction';\nimport { ChatBubbleFile } from '@hh.ru/magritte-ui-chat-bubble/File';\nimport { ChatBubbleLabel } from '@hh.ru/magritte-ui-chat-bubble/Label';\nimport { ChatBubbleMedia } from '@hh.ru/magritte-ui-chat-bubble/Media';\nimport { ChatBubbleMessage } from '@hh.ru/magritte-ui-chat-bubble/Message';\nimport { Meta } from '@hh.ru/magritte-ui-chat-bubble/Meta';\nimport { ChatBubbleReply } from '@hh.ru/magritte-ui-chat-bubble/Reply';\nimport { ChatBubbleSnippet } from '@hh.ru/magritte-ui-chat-bubble/Snippet';\nimport { ChatBubbleStatus } from '@hh.ru/magritte-ui-chat-bubble/Status';\nimport { Tail } from '@hh.ru/magritte-ui-chat-bubble/Tail';\nimport { CHAT_BUBBLE_BUTTON_DEFAULTS } from '@hh.ru/magritte-ui-chat-bubble/buttonDefaults';\nimport { ChatBubbleErrorMenuProvider } from '@hh.ru/magritte-ui-chat-bubble/internal/errorMenu';\nimport { ChatBubbleModeProvider } from '@hh.ru/magritte-ui-chat-bubble/internal/mode';\nimport { isMetaHost, flattenFragments } from '@hh.ru/magritte-ui-chat-bubble/internal/utils';\nimport type { ChatBubbleProps } from '@hh.ru/magritte-ui-chat-bubble/types';\nimport { BotFilledSize24, ExclamationCircleFilledSize24 } from '@hh.ru/magritte-ui-icon/icon';\nimport { Menu } from '@hh.ru/magritte-ui-menu';\nimport { Text } from '@hh.ru/magritte-ui-typography';\n\nimport styles from './chat-bubble.less';\n\nconst CHAT_BUBBLE_AVATAR_SIZE = 40;\nconst CHAT_BUBBLE_AVATAR_FOR_INCOMING_DEFAULTS: Partial<AvatarProps> = { size: CHAT_BUBBLE_AVATAR_SIZE };\nconst CHAT_BUBBLE_AVATAR_FOR_BOT_DEFAULTS: Partial<AvatarProps> = {\n mode: 'icon',\n style: 'special-secondary',\n icon: <BotFilledSize24 initialColor=\"special\" />,\n size: CHAT_BUBBLE_AVATAR_SIZE,\n};\n\ninterface ChatBubbleComponents {\n Button: typeof ChatBubbleButton;\n Call: typeof ChatBubbleCall;\n ErrorAction: typeof ChatBubbleErrorAction;\n File: typeof ChatBubbleFile;\n Label: typeof ChatBubbleLabel;\n Media: typeof ChatBubbleMedia;\n Message: typeof ChatBubbleMessage;\n Reply: typeof ChatBubbleReply;\n Snippet: typeof ChatBubbleSnippet;\n Status: typeof ChatBubbleStatus;\n}\n\nexport const ChatBubble = forwardRef<HTMLDivElement, ChatBubbleProps>(\n (\n {\n aside,\n avatar,\n avatarPlaceholder = false,\n buttons,\n children,\n header,\n edited,\n errorActions,\n mode = 'incoming',\n showTail = false,\n status,\n time,\n error = false,\n errorText,\n 'data-qa': dataQa = 'chat-bubble',\n className,\n },\n ref\n ) => {\n const rowRef = useRef<HTMLDivElement>(null);\n const activatorMenuRef = useRef<SVGElement>(null);\n\n const [menuVisible, setMenuVisible] = useState(false);\n const closeErrorMenu = useCallback(() => setMenuVisible(false), []);\n\n const [asideShow, setAsideShow] = useState(false);\n const showAside = useCallback(() => setAsideShow(true), []);\n const hideAside = useCallback(() => setAsideShow(false), []);\n\n // скрываем aside при кликах вне\n useCloseByClickOutside(rowRef, hideAside, asideShow);\n\n const buttonsProps: Partial<ButtonProps> = CHAT_BUBBLE_BUTTON_DEFAULTS[mode];\n const showAvatar = Boolean(avatar) && mode !== 'outgoing';\n const avatarPlaceholderSize = avatarPlaceholder === true ? CHAT_BUBBLE_AVATAR_SIZE : avatarPlaceholder || 0;\n const showAvatarPlaceholder = !showAvatar && avatarPlaceholderSize > 0 && mode !== 'outgoing';\n /**\n * Время отдаём последнему элементу контента\n * Позиция времени меняется, в зависимости от компонента\n * Если последний ребенок не может отрисовать, вставим meta в самый конец\n */\n const meta = <Meta mode={mode} status={status} time={time} edited={edited} />;\n const items = flattenFragments(children);\n const lastIndex = items.length - 1;\n const metaHosted = isMetaHost(items[lastIndex]);\n const content = items.map((child, index) =>\n index === lastIndex && isMetaHost(child) ? cloneElement(child, { meta }) : child\n );\n return (\n <ChatBubbleModeProvider value={mode}>\n <div\n className={classnames(className, styles.chatBubble, styles[mode], {\n [styles.withTail]: showTail,\n [styles.withButtons]: Boolean(buttons),\n [styles.withAvatar]: showAvatar || showAvatarPlaceholder,\n })}\n data-qa={dataQa}\n ref={ref}\n >\n {showAvatarPlaceholder && (\n <div\n className={styles.avatar}\n style={{ width: avatarPlaceholderSize }}\n data-qa=\"chat-bubble-avatar-placeholder\"\n />\n )}\n {showAvatar && (\n <div className={styles.avatar} data-qa=\"chat-bubble-avatar\">\n <AvatarDefaultPropsContext\n props={\n mode === 'bot'\n ? CHAT_BUBBLE_AVATAR_FOR_BOT_DEFAULTS\n : CHAT_BUBBLE_AVATAR_FOR_INCOMING_DEFAULTS\n }\n >\n {avatar}\n </AvatarDefaultPropsContext>\n </div>\n )}\n <div\n className={styles.row}\n onMouseEnter={aside ? showAside : undefined}\n onMouseLeave={aside ? hideAside : undefined}\n onClick={aside ? showAside : undefined}\n ref={rowRef}\n >\n <div className={styles.bubble}>\n {header}\n {content}\n {!metaHosted && meta}\n {showTail && <Tail />}\n </div>\n {mode === 'outgoing' && error && (\n <div>\n <ExclamationCircleFilledSize24\n ref={activatorMenuRef}\n initialColor=\"negative\"\n onClick={errorActions ? () => setMenuVisible((visible) => !visible) : undefined}\n data-qa=\"chat-bubble-error-button\"\n aria-haspopup={errorActions ? 'menu' : undefined}\n aria-expanded={errorActions ? menuVisible : undefined}\n />\n {errorActions && (\n <Menu\n activatorRef={activatorMenuRef}\n onClose={closeErrorMenu}\n placement=\"bottom-right\"\n visible={menuVisible}\n >\n <ChatBubbleErrorMenuProvider value={closeErrorMenu}>\n {errorActions}\n </ChatBubbleErrorMenuProvider>\n </Menu>\n )}\n </div>\n )}\n {aside && (\n <div\n className={classnames(styles.aside, { [styles.asideRevealed]: asideShow })}\n data-qa=\"chat-bubble-aside\"\n >\n {aside}\n </div>\n )}\n </div>\n {mode === 'outgoing' && error && errorText && (\n <div className={styles.errorText} data-qa=\"chat-bubble-error-text\">\n <Text typography=\"label-4-regular\" style=\"negative\" maxLines={2}>\n {errorText}\n </Text>\n </div>\n )}\n {buttons && (\n <ButtonDefaultPropsContext props={buttonsProps}>\n <div className={styles.buttons} data-qa=\"chat-bubble-buttons\">\n {buttons}\n </div>\n </ButtonDefaultPropsContext>\n )}\n </div>\n </ChatBubbleModeProvider>\n );\n }\n) as React.ForwardRefExoticComponent<ChatBubbleProps & React.RefAttributes<HTMLDivElement>> & ChatBubbleComponents;\n\nChatBubble.displayName = 'ChatBubble';\n\nChatBubble.Button = ChatBubbleButton;\nChatBubble.Call = ChatBubbleCall;\nChatBubble.ErrorAction = ChatBubbleErrorAction;\nChatBubble.File = ChatBubbleFile;\nChatBubble.Label = ChatBubbleLabel;\nChatBubble.Media = ChatBubbleMedia;\nChatBubble.Message = ChatBubbleMessage;\nChatBubble.Reply = ChatBubbleReply;\nChatBubble.Snippet = ChatBubbleSnippet;\nChatBubble.Status = ChatBubbleStatus;\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA6BA,MAAM,uBAA0B,GAAA,EAAA,CAAA;AAChC,MAAM,wCAAA,GAAiE,EAAE,IAAA,EAAM,uBAAwB,EAAA,CAAA;AACvG,MAAM,mCAA4D,GAAA;AAAA,EAC9D,IAAM,EAAA,MAAA;AAAA,EACN,KAAO,EAAA,mBAAA;AAAA,EACP,IAAM,kBAAA,GAAA,CAAC,eAAgB,EAAA,EAAA,YAAA,EAAa,SAAU,EAAA,CAAA;AAAA,EAC9C,IAAM,EAAA,uBAAA;AACV,CAAA,CAAA;AAeO,MAAM,UAAa,GAAA,UAAA;AAAA,EACtB,CACI;AAAA,IACI,KAAA;AAAA,IACA,MAAA;AAAA,IACA,iBAAoB,GAAA,KAAA;AAAA,IACpB,OAAA;AAAA,IACA,QAAA;AAAA,IACA,MAAA;AAAA,IACA,MAAA;AAAA,IACA,YAAA;AAAA,IACA,IAAO,GAAA,UAAA;AAAA,IACP,QAAW,GAAA,KAAA;AAAA,IACX,MAAA;AAAA,IACA,IAAA;AAAA,IACA,KAAQ,GAAA,KAAA;AAAA,IACR,SAAA;AAAA,IACA,WAAW,MAAS,GAAA,aAAA;AAAA,IACpB,SAAA;AAAA,KAEJ,GACC,KAAA;AACD,IAAM,MAAA,MAAA,GAAS,OAAuB,IAAI,CAAA,CAAA;AAC1C,IAAM,MAAA,gBAAA,GAAmB,OAAmB,IAAI,CAAA,CAAA;AAEhD,IAAA,MAAM,CAAC,WAAA,EAAa,cAAc,CAAA,GAAI,SAAS,KAAK,CAAA,CAAA;AACpD,IAAA,MAAM,iBAAiB,WAAY,CAAA,MAAM,eAAe,KAAK,CAAA,EAAG,EAAE,CAAA,CAAA;AAElE,IAAA,MAAM,CAAC,SAAA,EAAW,Y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AAA,oBAEP,QAAA,EAAA,KAAA;AAAA,mBAAA;AAAA,iBACL;AAAA,eAAA;AAAA,aAAA;AAAA,WAER;AAAA,UACC,IAAA,KAAS,cAAc,KAAS,IAAA,SAAA,wBAC5B,KAAI,EAAA,EAAA,SAAA,EAAW,OAAO,SAAW,EAAA,SAAA,EAAQ,0BACtC,QAAC,kBAAA,GAAA,CAAA,IAAA,EAAA,EAAK,YAAW,iBAAkB,EAAA,KAAA,EAAM,YAAW,QAAU,EAAA,CAAA,EACzD,qBACL,CACJ,EAAA,CAAA;AAAA,UAEH,OACG,oBAAA,GAAA,CAAC,yBAA0B,EAAA,EAAA,KAAA,EAAO,YAC9B,EAAA,QAAA,kBAAA,GAAA,CAAC,KAAI,EAAA,EAAA,SAAA,EAAW,MAAO,CAAA,OAAA,EAAS,SAAQ,EAAA,qBAAA,EACnC,mBACL,CACJ,EAAA,CAAA;AAAA,SAAA;AAAA,OAAA;AAAA,KAGZ,EAAA,CAAA,CAAA;AAAA,GAER;AACJ,EAAA;AAEA,UAAA,CAAW,WAAc,GAAA,YAAA,CAAA;AAEzB,UAAA,CAAW,MAAS,GAAA,gBAAA,CAAA;AACpB,UAAA,CAAW,IAAO,GAAA,cAAA,CAAA;AAClB,UAAA,CAAW,WAAc,GAAA,qBAAA,CAAA;AACzB,UAAA,CAAW,IAAO,GAAA,cAAA,CAAA;AAClB,UAAA,CAAW,KAAQ,GAAA,eAAA,CAAA;AACnB,UAAA,CAAW,KAAQ,GAAA,eAAA,CAAA;AACnB,UAAA,CAAW,OAAU,GAAA,iBAAA,CAAA;AACrB,UAAA,CAAW,KAAQ,GAAA,eAAA,CAAA;AACnB,UAAA,CAAW,OAAU,GAAA,iBAAA,CAAA;AACrB,UAAA,CAAW,MAAS,GAAA,gBAAA;;;;"}
|
|
1
|
+
{"version":3,"file":"ChatBubble.js","sources":["src/ChatBubble.tsx"],"sourcesContent":["import { cloneElement, forwardRef, useCallback, useState, useRef } from 'react';\nimport classnames from 'classnames';\n\nimport { useCloseByClickOutside } from '@hh.ru/magritte-common-mouse';\nimport { AvatarDefaultPropsContext, type AvatarProps } from '@hh.ru/magritte-ui-avatar';\nimport { ButtonDefaultPropsContext, type ButtonProps } from '@hh.ru/magritte-ui-button';\nimport { ChatBubbleButton } from '@hh.ru/magritte-ui-chat-bubble/Button';\nimport { ChatBubbleCall } from '@hh.ru/magritte-ui-chat-bubble/Call';\nimport { ChatBubbleErrorAction } from '@hh.ru/magritte-ui-chat-bubble/ErrorAction';\nimport { ChatBubbleFile } from '@hh.ru/magritte-ui-chat-bubble/File';\nimport { ChatBubbleFooter } from '@hh.ru/magritte-ui-chat-bubble/Footer';\nimport { ChatBubbleLabel } from '@hh.ru/magritte-ui-chat-bubble/Label';\nimport { ChatBubbleMedia } from '@hh.ru/magritte-ui-chat-bubble/Media';\nimport { ChatBubbleMessage } from '@hh.ru/magritte-ui-chat-bubble/Message';\nimport { Meta } from '@hh.ru/magritte-ui-chat-bubble/Meta';\nimport { ChatBubbleReaction } from '@hh.ru/magritte-ui-chat-bubble/Reaction';\nimport { ChatBubbleReply } from '@hh.ru/magritte-ui-chat-bubble/Reply';\nimport { ChatBubbleSnippet } from '@hh.ru/magritte-ui-chat-bubble/Snippet';\nimport { ChatBubbleStatus } from '@hh.ru/magritte-ui-chat-bubble/Status';\nimport { Tail } from '@hh.ru/magritte-ui-chat-bubble/Tail';\nimport { CHAT_BUBBLE_BUTTON_DEFAULTS } from '@hh.ru/magritte-ui-chat-bubble/buttonDefaults';\nimport { ChatBubbleErrorMenuProvider } from '@hh.ru/magritte-ui-chat-bubble/internal/errorMenu';\nimport { ChatBubbleModeProvider } from '@hh.ru/magritte-ui-chat-bubble/internal/mode';\nimport { isMetaHost, flattenFragments } from '@hh.ru/magritte-ui-chat-bubble/internal/utils';\nimport type { ChatBubbleProps } from '@hh.ru/magritte-ui-chat-bubble/types';\nimport { BotFilledSize24, ExclamationCircleFilledSize24 } from '@hh.ru/magritte-ui-icon/icon';\nimport { Menu } from '@hh.ru/magritte-ui-menu';\nimport { Text } from '@hh.ru/magritte-ui-typography';\n\nimport styles from './chat-bubble.less';\n\nconst CHAT_BUBBLE_AVATAR_SIZE = 40;\nconst CHAT_BUBBLE_AVATAR_FOR_INCOMING_DEFAULTS: Partial<AvatarProps> = { size: CHAT_BUBBLE_AVATAR_SIZE };\nconst CHAT_BUBBLE_AVATAR_FOR_BOT_DEFAULTS: Partial<AvatarProps> = {\n mode: 'icon',\n style: 'special-secondary',\n icon: <BotFilledSize24 initialColor=\"special\" />,\n size: CHAT_BUBBLE_AVATAR_SIZE,\n};\n\ninterface ChatBubbleComponents {\n Button: typeof ChatBubbleButton;\n Call: typeof ChatBubbleCall;\n ErrorAction: typeof ChatBubbleErrorAction;\n File: typeof ChatBubbleFile;\n Footer: typeof ChatBubbleFooter;\n Label: typeof ChatBubbleLabel;\n Media: typeof ChatBubbleMedia;\n Message: typeof ChatBubbleMessage;\n Reaction: typeof ChatBubbleReaction;\n Reply: typeof ChatBubbleReply;\n Snippet: typeof ChatBubbleSnippet;\n Status: typeof ChatBubbleStatus;\n}\n\nexport const ChatBubble = forwardRef<HTMLDivElement, ChatBubbleProps>(\n (\n {\n aside,\n avatar,\n avatarPlaceholder = false,\n buttons,\n children,\n header,\n edited,\n errorActions,\n mode = 'incoming',\n showTail = false,\n status,\n time,\n error = false,\n errorText,\n 'data-qa': dataQa = 'chat-bubble',\n className,\n },\n ref\n ) => {\n const rowRef = useRef<HTMLDivElement>(null);\n const activatorMenuRef = useRef<SVGElement>(null);\n\n const [menuVisible, setMenuVisible] = useState(false);\n const closeErrorMenu = useCallback(() => setMenuVisible(false), []);\n\n const [asideShow, setAsideShow] = useState(false);\n const showAside = useCallback(() => setAsideShow(true), []);\n const hideAside = useCallback(() => setAsideShow(false), []);\n\n // скрываем aside при кликах вне\n useCloseByClickOutside(rowRef, hideAside, asideShow);\n\n const buttonsProps: Partial<ButtonProps> = CHAT_BUBBLE_BUTTON_DEFAULTS[mode];\n const showAvatar = Boolean(avatar) && mode !== 'outgoing';\n const avatarPlaceholderSize = avatarPlaceholder === true ? CHAT_BUBBLE_AVATAR_SIZE : avatarPlaceholder || 0;\n const showAvatarPlaceholder = !showAvatar && avatarPlaceholderSize > 0 && mode !== 'outgoing';\n /**\n * Время отдаём последнему элементу контента\n * Позиция времени меняется, в зависимости от компонента\n * Если последний ребенок не может отрисовать, вставим meta в самый конец\n */\n const meta = <Meta mode={mode} status={status} time={time} edited={edited} />;\n const items = flattenFragments(children);\n const lastIndex = items.length - 1;\n const metaHosted = isMetaHost(items[lastIndex]);\n const content = items.map((child, index) =>\n index === lastIndex && isMetaHost(child) ? cloneElement(child, { meta }) : child\n );\n return (\n <ChatBubbleModeProvider value={mode}>\n <div\n className={classnames(className, styles.chatBubble, styles[mode], {\n [styles.withTail]: showTail,\n [styles.withButtons]: Boolean(buttons),\n [styles.withAvatar]: showAvatar || showAvatarPlaceholder,\n })}\n data-qa={dataQa}\n ref={ref}\n >\n {showAvatarPlaceholder && (\n <div\n className={styles.avatar}\n style={{ width: avatarPlaceholderSize }}\n data-qa=\"chat-bubble-avatar-placeholder\"\n />\n )}\n {showAvatar && (\n <div className={styles.avatar} data-qa=\"chat-bubble-avatar\">\n <AvatarDefaultPropsContext\n props={\n mode === 'bot'\n ? CHAT_BUBBLE_AVATAR_FOR_BOT_DEFAULTS\n : CHAT_BUBBLE_AVATAR_FOR_INCOMING_DEFAULTS\n }\n >\n {avatar}\n </AvatarDefaultPropsContext>\n </div>\n )}\n <div\n className={styles.row}\n onMouseEnter={aside ? showAside : undefined}\n onMouseLeave={aside ? hideAside : undefined}\n onClick={aside ? showAside : undefined}\n ref={rowRef}\n >\n <div className={styles.bubble}>\n {header}\n {content}\n {!metaHosted && meta}\n {showTail && <Tail />}\n </div>\n {mode === 'outgoing' && error && (\n <div>\n <ExclamationCircleFilledSize24\n ref={activatorMenuRef}\n initialColor=\"negative\"\n onClick={errorActions ? () => setMenuVisible((visible) => !visible) : undefined}\n data-qa=\"chat-bubble-error-button\"\n aria-haspopup={errorActions ? 'menu' : undefined}\n aria-expanded={errorActions ? menuVisible : undefined}\n />\n {errorActions && (\n <Menu\n activatorRef={activatorMenuRef}\n onClose={closeErrorMenu}\n placement=\"bottom-right\"\n visible={menuVisible}\n >\n <ChatBubbleErrorMenuProvider value={closeErrorMenu}>\n {errorActions}\n </ChatBubbleErrorMenuProvider>\n </Menu>\n )}\n </div>\n )}\n {aside && (\n <div\n className={classnames(styles.aside, { [styles.asideRevealed]: asideShow })}\n data-qa=\"chat-bubble-aside\"\n >\n {aside}\n </div>\n )}\n </div>\n {mode === 'outgoing' && error && errorText && (\n <div className={styles.errorText} data-qa=\"chat-bubble-error-text\">\n <Text typography=\"label-4-regular\" style=\"negative\" maxLines={2}>\n {errorText}\n </Text>\n </div>\n )}\n {buttons && (\n <ButtonDefaultPropsContext props={buttonsProps}>\n <div className={styles.buttons} data-qa=\"chat-bubble-buttons\">\n {buttons}\n </div>\n </ButtonDefaultPropsContext>\n )}\n </div>\n </ChatBubbleModeProvider>\n );\n }\n) as React.ForwardRefExoticComponent<ChatBubbleProps & React.RefAttributes<HTMLDivElement>> & ChatBubbleComponents;\n\nChatBubble.displayName = 'ChatBubble';\n\nChatBubble.Button = ChatBubbleButton;\nChatBubble.Call = ChatBubbleCall;\nChatBubble.ErrorAction = ChatBubbleErrorAction;\nChatBubble.File = ChatBubbleFile;\nChatBubble.Footer = ChatBubbleFooter;\nChatBubble.Label = ChatBubbleLabel;\nChatBubble.Media = ChatBubbleMedia;\nChatBubble.Message = ChatBubbleMessage;\nChatBubble.Reaction = ChatBubbleReaction;\nChatBubble.Reply = ChatBubbleReply;\nChatBubble.Snippet = ChatBubbleSnippet;\nChatBubble.Status = ChatBubbleStatus;\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA+BA,MAAM,uBAA0B,GAAA,EAAA,CAAA;AAChC,MAAM,wCAAA,GAAiE,EAAE,IAAA,EAAM,uB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W,iBAAkB,EAAA,KAAA,EAAM,YAAW,QAAU,EAAA,CAAA,EACzD,qBACL,CACJ,EAAA,CAAA;AAAA,UAEH,OACG,oBAAA,GAAA,CAAC,yBAA0B,EAAA,EAAA,KAAA,EAAO,YAC9B,EAAA,QAAA,kBAAA,GAAA,CAAC,KAAI,EAAA,EAAA,SAAA,EAAW,MAAO,CAAA,OAAA,EAAS,SAAQ,EAAA,qBAAA,EACnC,mBACL,CACJ,EAAA,CAAA;AAAA,SAAA;AAAA,OAAA;AAAA,KAGZ,EAAA,CAAA,CAAA;AAAA,GAER;AACJ,EAAA;AAEA,UAAA,CAAW,WAAc,GAAA,YAAA,CAAA;AAEzB,UAAA,CAAW,MAAS,GAAA,gBAAA,CAAA;AACpB,UAAA,CAAW,IAAO,GAAA,cAAA,CAAA;AAClB,UAAA,CAAW,WAAc,GAAA,qBAAA,CAAA;AACzB,UAAA,CAAW,IAAO,GAAA,cAAA,CAAA;AAClB,UAAA,CAAW,MAAS,GAAA,gBAAA,CAAA;AACpB,UAAA,CAAW,KAAQ,GAAA,eAAA,CAAA;AACnB,UAAA,CAAW,KAAQ,GAAA,eAAA,CAAA;AACnB,UAAA,CAAW,OAAU,GAAA,iBAAA,CAAA;AACrB,UAAA,CAAW,QAAW,GAAA,kBAAA,CAAA;AACtB,UAAA,CAAW,KAAQ,GAAA,eAAA,CAAA;AACnB,UAAA,CAAW,OAAU,GAAA,iBAAA,CAAA;AACrB,UAAA,CAAW,MAAS,GAAA,gBAAA;;;;"}
|
package/File.js
CHANGED
|
@@ -7,7 +7,7 @@ import { markMetaHost } from './internal/utils.js';
|
|
|
7
7
|
import { ArrowDownLineOutlinedSize24, DocumentOutlinedSize24, ExclamationTriangleOutlinedSize16 } from '@hh.ru/magritte-ui-icon/icon';
|
|
8
8
|
import { LinkDefaultPropsContext } from '@hh.ru/magritte-ui-link';
|
|
9
9
|
import { Loader } from '@hh.ru/magritte-ui-loader';
|
|
10
|
-
import { s as styles } from './chat-bubble-
|
|
10
|
+
import { s as styles } from './chat-bubble-B3D9arfs.js';
|
|
11
11
|
import './internal/mode.js';
|
|
12
12
|
|
|
13
13
|
const ChatBubbleFileComponent = forwardRef(
|
package/Footer.d.ts
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { type HTMLAttributes, type ReactNode } from 'react';
|
|
2
|
+
import { type ChatBubbleMetaHostProps } from './internal/utils';
|
|
3
|
+
export interface ChatBubbleFooterProps extends HTMLAttributes<HTMLDivElement>, ChatBubbleMetaHostProps {
|
|
4
|
+
/** Произвольное содержимое нижней строки (например, реакции) */
|
|
5
|
+
children?: ReactNode;
|
|
6
|
+
/**
|
|
7
|
+
* Значение data-qa
|
|
8
|
+
* @default chat-bubble-footer
|
|
9
|
+
*/
|
|
10
|
+
'data-qa'?: string;
|
|
11
|
+
}
|
|
12
|
+
export declare const ChatBubbleFooter: import("react").ForwardRefExoticComponent<ChatBubbleFooterProps & import("react").RefAttributes<HTMLDivElement>> & import("./internal/utils").MetaHostComponent;
|
package/Footer.js
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import './index.css';
|
|
2
|
+
import { jsxs } from 'react/jsx-runtime';
|
|
3
|
+
import { forwardRef } from 'react';
|
|
4
|
+
import { markMetaHost } from './internal/utils.js';
|
|
5
|
+
import { s as styles } from './chat-bubble-B3D9arfs.js';
|
|
6
|
+
|
|
7
|
+
const ChatBubbleFooterComponent = forwardRef(
|
|
8
|
+
({ children, "data-qa": dataQa = "chat-bubble-footer", meta, ...props }, ref) => /* @__PURE__ */ jsxs("div", { ...props, className: styles.footer, "data-qa": dataQa, ref, children: [
|
|
9
|
+
children,
|
|
10
|
+
meta
|
|
11
|
+
] })
|
|
12
|
+
);
|
|
13
|
+
ChatBubbleFooterComponent.displayName = "ChatBubbleFooter";
|
|
14
|
+
const ChatBubbleFooter = markMetaHost(ChatBubbleFooterComponent);
|
|
15
|
+
|
|
16
|
+
export { ChatBubbleFooter };
|
|
17
|
+
//# sourceMappingURL=Footer.js.map
|
package/Footer.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Footer.js","sources":["src/Footer.tsx"],"sourcesContent":["import { forwardRef, type HTMLAttributes, type ReactNode } from 'react';\n\nimport { markMetaHost, type ChatBubbleMetaHostProps } from '@hh.ru/magritte-ui-chat-bubble/internal/utils';\n\nimport styles from './chat-bubble.less';\n\nexport interface ChatBubbleFooterProps extends HTMLAttributes<HTMLDivElement>, ChatBubbleMetaHostProps {\n /** Произвольное содержимое нижней строки (например, реакции) */\n children?: ReactNode;\n /**\n * Значение data-qa\n * @default chat-bubble-footer\n */\n 'data-qa'?: string;\n}\n\n/**\n * Нижняя строка баббла. Дети — элементы одной переносимой строки, время и статус — последний элемент справа.\n * Ставится последним в `children`: время встаёт в конец последней строки, а если не помещается — строкой ниже\n */\nconst ChatBubbleFooterComponent = forwardRef<HTMLDivElement, ChatBubbleFooterProps>(\n ({ children, 'data-qa': dataQa = 'chat-bubble-footer', meta, ...props }, ref) => (\n <div {...props} className={styles.footer} data-qa={dataQa} ref={ref}>\n {children}\n {meta}\n </div>\n )\n);\n\nChatBubbleFooterComponent.displayName = 'ChatBubbleFooter';\n\nexport const ChatBubbleFooter = markMetaHost(ChatBubbleFooterComponent);\n"],"names":[],"mappings":";;;;;AAoBA,MAAM,yBAA4B,GAAA,UAAA;AAAA,EAC9B,CAAC,EAAE,QAAU,EAAA,SAAA,EAAW,SAAS,oBAAsB,EAAA,IAAA,EAAM,GAAG,KAAM,EAAA,EAAG,wBACpE,IAAA,CAAA,KAAA,EAAA,EAAK,GAAG,KAAO,EAAA,SAAA,EAAW,OAAO,MAAQ,EAAA,SAAA,EAAS,QAAQ,GACtD,EAAA,QAAA,EAAA;AAAA,IAAA,QAAA;AAAA,IACA,IAAA;AAAA,GACL,EAAA,CAAA;AAER,CAAA,CAAA;AAEA,yBAAA,CAA0B,WAAc,GAAA,kBAAA,CAAA;AAE3B,MAAA,gBAAA,GAAmB,aAAa,yBAAyB;;;;"}
|
package/Label.js
CHANGED
|
@@ -3,7 +3,7 @@ import { jsx } from 'react/jsx-runtime';
|
|
|
3
3
|
import { forwardRef } from 'react';
|
|
4
4
|
import { useChatBubbleColors } from './internal/colors.js';
|
|
5
5
|
import { Text } from '@hh.ru/magritte-ui-typography';
|
|
6
|
-
import { s as styles } from './chat-bubble-
|
|
6
|
+
import { s as styles } from './chat-bubble-B3D9arfs.js';
|
|
7
7
|
import './internal/mode.js';
|
|
8
8
|
|
|
9
9
|
const ChatBubbleLabel = forwardRef(({ children, ...props }, ref) => {
|
package/Media.js
CHANGED
|
@@ -3,7 +3,7 @@ import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
|
|
|
3
3
|
import { forwardRef } from 'react';
|
|
4
4
|
import { markMetaHost } from './internal/utils.js';
|
|
5
5
|
import { Text } from '@hh.ru/magritte-ui-typography';
|
|
6
|
-
import { s as styles } from './chat-bubble-
|
|
6
|
+
import { s as styles } from './chat-bubble-B3D9arfs.js';
|
|
7
7
|
|
|
8
8
|
const ChatBubbleMediaComponent = forwardRef(
|
|
9
9
|
({ alt, children, "data-qa": dataQa = "chat-bubble-media", meta, src, format, width, height, ...props }, ref) => {
|
package/Message.js
CHANGED
|
@@ -4,7 +4,7 @@ import { forwardRef } from 'react';
|
|
|
4
4
|
import { useChatBubbleColors } from './internal/colors.js';
|
|
5
5
|
import { markMetaHost } from './internal/utils.js';
|
|
6
6
|
import { Text } from '@hh.ru/magritte-ui-typography';
|
|
7
|
-
import { s as styles } from './chat-bubble-
|
|
7
|
+
import { s as styles } from './chat-bubble-B3D9arfs.js';
|
|
8
8
|
import './internal/mode.js';
|
|
9
9
|
|
|
10
10
|
const ChatBubbleMessageComponent = forwardRef(
|
package/Meta.js
CHANGED
|
@@ -3,7 +3,7 @@ import { jsxs, jsx } from 'react/jsx-runtime';
|
|
|
3
3
|
import { useTranslation } from '@hh.ru/magritte-common-use-translation';
|
|
4
4
|
import { getColors } from './internal/colors.js';
|
|
5
5
|
import { Text } from '@hh.ru/magritte-ui-typography';
|
|
6
|
-
import { s as styles } from './chat-bubble-
|
|
6
|
+
import { s as styles } from './chat-bubble-B3D9arfs.js';
|
|
7
7
|
import './internal/mode.js';
|
|
8
8
|
import 'react';
|
|
9
9
|
|
package/Reaction.d.ts
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { type ButtonHTMLAttributes, type ReactNode } from 'react';
|
|
2
|
+
export interface ChatBubbleReactionProps extends ButtonHTMLAttributes<HTMLButtonElement> {
|
|
3
|
+
/** Иконка реакции размером 16 */
|
|
4
|
+
icon: ReactNode;
|
|
5
|
+
/** Количество реакций: единица не показывается, больше 99 показывается как `99+` */
|
|
6
|
+
count: number;
|
|
7
|
+
/**
|
|
8
|
+
* Реакция поставлена текущим пользователем
|
|
9
|
+
* @default false
|
|
10
|
+
*/
|
|
11
|
+
active?: boolean;
|
|
12
|
+
/**
|
|
13
|
+
* Значение data-qa
|
|
14
|
+
* @default chat-bubble-reaction
|
|
15
|
+
*/
|
|
16
|
+
'data-qa'?: string;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Чип реакции. Фон и цвет счётчика зависят от `mode` баббла и `active`, ставится внутрь `ChatBubble.Footer`
|
|
20
|
+
*/
|
|
21
|
+
export declare const ChatBubbleReaction: import("react").ForwardRefExoticComponent<ChatBubbleReactionProps & import("react").RefAttributes<HTMLButtonElement>>;
|
package/Reaction.js
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import './index.css';
|
|
2
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
3
|
+
import { forwardRef } from 'react';
|
|
4
|
+
import classnames from 'classnames';
|
|
5
|
+
import { useChatBubbleColors } from './internal/colors.js';
|
|
6
|
+
import { Text } from '@hh.ru/magritte-ui-typography';
|
|
7
|
+
import { s as styles } from './chat-bubble-B3D9arfs.js';
|
|
8
|
+
import './internal/mode.js';
|
|
9
|
+
|
|
10
|
+
const MAX_COUNT = 99;
|
|
11
|
+
const ChatBubbleReaction = forwardRef(
|
|
12
|
+
({ icon, count, active = false, "data-qa": dataQa = "chat-bubble-reaction", ...props }, ref) => {
|
|
13
|
+
const colors = useChatBubbleColors();
|
|
14
|
+
return /* @__PURE__ */ jsxs(
|
|
15
|
+
"button",
|
|
16
|
+
{
|
|
17
|
+
type: "button",
|
|
18
|
+
...props,
|
|
19
|
+
className: classnames(styles.reaction, { [styles.reactionActive]: active }),
|
|
20
|
+
"aria-pressed": active,
|
|
21
|
+
"data-interactive": true,
|
|
22
|
+
"data-qa": dataQa,
|
|
23
|
+
ref,
|
|
24
|
+
children: [
|
|
25
|
+
icon,
|
|
26
|
+
count > 1 && /* @__PURE__ */ jsx(
|
|
27
|
+
Text,
|
|
28
|
+
{
|
|
29
|
+
Element: "span",
|
|
30
|
+
typography: "label-3-regular",
|
|
31
|
+
style: active ? colors.activeReactionText : colors.secondaryText,
|
|
32
|
+
children: count > MAX_COUNT ? `${MAX_COUNT}+` : count
|
|
33
|
+
}
|
|
34
|
+
)
|
|
35
|
+
]
|
|
36
|
+
}
|
|
37
|
+
);
|
|
38
|
+
}
|
|
39
|
+
);
|
|
40
|
+
ChatBubbleReaction.displayName = "ChatBubbleReaction";
|
|
41
|
+
|
|
42
|
+
export { ChatBubbleReaction };
|
|
43
|
+
//# sourceMappingURL=Reaction.js.map
|
package/Reaction.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Reaction.js","sources":["src/Reaction.tsx"],"sourcesContent":["import { forwardRef, type ButtonHTMLAttributes, type ReactNode } from 'react';\nimport classnames from 'classnames';\n\nimport { useChatBubbleColors } from '@hh.ru/magritte-ui-chat-bubble/internal/colors';\nimport { Text } from '@hh.ru/magritte-ui-typography';\n\nimport styles from './chat-bubble.less';\n\nconst MAX_COUNT = 99;\n\nexport interface ChatBubbleReactionProps extends ButtonHTMLAttributes<HTMLButtonElement> {\n /** Иконка реакции размером 16 */\n icon: ReactNode;\n /** Количество реакций: единица не показывается, больше 99 показывается как `99+` */\n count: number;\n /**\n * Реакция поставлена текущим пользователем\n * @default false\n */\n active?: boolean;\n /**\n * Значение data-qa\n * @default chat-bubble-reaction\n */\n 'data-qa'?: string;\n}\n\n/**\n * Чип реакции. Фон и цвет счётчика зависят от `mode` баббла и `active`, ставится внутрь `ChatBubble.Footer`\n */\nexport const ChatBubbleReaction = forwardRef<HTMLButtonElement, ChatBubbleReactionProps>(\n ({ icon, count, active = false, 'data-qa': dataQa = 'chat-bubble-reaction', ...props }, ref) => {\n const colors = useChatBubbleColors();\n\n return (\n <button\n type=\"button\"\n {...props}\n className={classnames(styles.reaction, { [styles.reactionActive]: active })}\n aria-pressed={active}\n data-interactive={true}\n data-qa={dataQa}\n ref={ref}\n >\n {icon}\n {count > 1 && (\n <Text\n Element=\"span\"\n typography=\"label-3-regular\"\n style={active ? colors.activeReactionText : colors.secondaryText}\n >\n {count > MAX_COUNT ? `${MAX_COUNT}+` : count}\n </Text>\n )}\n </button>\n );\n }\n);\n\nChatBubbleReaction.displayName = 'ChatBubbleReaction';\n"],"names":[],"mappings":";;;;;;;;AAQA,MAAM,SAAY,GAAA,EAAA,CAAA;AAsBX,MAAM,kBAAqB,GAAA,UAAA;AAAA,EAC9B,CAAC,EAAE,IAAM,EAAA,KAAA,EAAO,MAAS,GAAA,KAAA,EAAO,SAAW,EAAA,MAAA,GAAS,sBAAwB,EAAA,GAAG,KAAM,EAAA,EAAG,GAAQ,KAAA;AAC5F,IAAA,MAAM,SAAS,mBAAoB,EAAA,CAAA;AAEnC,IACI,uBAAA,IAAA;AAAA,MAAC,QAAA;AAAA,MAAA;AAAA,QACG,IAAK,EAAA,QAAA;AAAA,QACJ,GAAG,KAAA;AAAA,QACJ,SAAA,EAAW,UAAW,CAAA,MAAA,CAAO,QAAU,EAAA,EAAE,CAAC,MAAO,CAAA,cAAc,GAAG,MAAA,EAAQ,CAAA;AAAA,QAC1E,cAAc,EAAA,MAAA;AAAA,QACd,kBAAkB,EAAA,IAAA;AAAA,QAClB,SAAS,EAAA,MAAA;AAAA,QACT,GAAA;AAAA,QAEC,QAAA,EAAA;AAAA,UAAA,IAAA;AAAA,UACA,QAAQ,CACL,oBAAA,GAAA;AAAA,YAAC,IAAA;AAAA,YAAA;AAAA,cACG,OAAQ,EAAA,MAAA;AAAA,cACR,UAAW,EAAA,iBAAA;AAAA,cACX,KAAO,EAAA,MAAA,GAAS,MAAO,CAAA,kBAAA,GAAqB,MAAO,CAAA,aAAA;AAAA,cAElD,QAAQ,EAAA,KAAA,GAAA,SAAA,GAAY,CAAG,EAAA,SAAS,CAAM,CAAA,CAAA,GAAA,KAAA;AAAA,aAAA;AAAA,WAC3C;AAAA,SAAA;AAAA,OAAA;AAAA,KAER,CAAA;AAAA,GAER;AACJ,EAAA;AAEA,kBAAA,CAAmB,WAAc,GAAA,oBAAA;;;;"}
|
package/Reply.js
CHANGED
|
@@ -3,7 +3,7 @@ import { jsxs, jsx } from 'react/jsx-runtime';
|
|
|
3
3
|
import { forwardRef } from 'react';
|
|
4
4
|
import { useChatBubbleColors } from './internal/colors.js';
|
|
5
5
|
import { Text } from '@hh.ru/magritte-ui-typography';
|
|
6
|
-
import { s as styles } from './chat-bubble-
|
|
6
|
+
import { s as styles } from './chat-bubble-B3D9arfs.js';
|
|
7
7
|
import './internal/mode.js';
|
|
8
8
|
|
|
9
9
|
const ChatBubbleReply = forwardRef(
|
package/Snippet.js
CHANGED
|
@@ -3,7 +3,7 @@ import { jsxs, jsx } from 'react/jsx-runtime';
|
|
|
3
3
|
import { forwardRef } from 'react';
|
|
4
4
|
import { useChatBubbleColors } from './internal/colors.js';
|
|
5
5
|
import { Text } from '@hh.ru/magritte-ui-typography';
|
|
6
|
-
import { s as styles } from './chat-bubble-
|
|
6
|
+
import { s as styles } from './chat-bubble-B3D9arfs.js';
|
|
7
7
|
import './internal/mode.js';
|
|
8
8
|
|
|
9
9
|
const ChatBubbleSnippetComponent = forwardRef(
|
package/Status.js
CHANGED
|
@@ -7,7 +7,7 @@ import { getColors } from './internal/colors.js';
|
|
|
7
7
|
import { useChatBubbleMode } from './internal/mode.js';
|
|
8
8
|
import { EyeOutlinedSize16, ClockOutlinedSize16, CheckOutlinedSize16, CheckDoubleOutlinedSize16, TrashOutlinedSize16 } from '@hh.ru/magritte-ui-icon/icon';
|
|
9
9
|
import { TooltipHover } from '@hh.ru/magritte-ui-tooltip';
|
|
10
|
-
import { s as styles } from './chat-bubble-
|
|
10
|
+
import { s as styles } from './chat-bubble-B3D9arfs.js';
|
|
11
11
|
|
|
12
12
|
const ICON = {
|
|
13
13
|
sending: ClockOutlinedSize16,
|
package/Tail.js
CHANGED
|
@@ -2,7 +2,7 @@ import './index.css';
|
|
|
2
2
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
3
3
|
import classnames from 'classnames';
|
|
4
4
|
import { useChatBubbleMode } from './internal/mode.js';
|
|
5
|
-
import { s as styles } from './chat-bubble-
|
|
5
|
+
import { s as styles } from './chat-bubble-B3D9arfs.js';
|
|
6
6
|
import 'react';
|
|
7
7
|
|
|
8
8
|
const OUTLINE = "M6.5 0C6.5 7.5 5.2 11.8 1.6 13.4C0.9 13.9 0.6 14.5 1.1 14.5H7";
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import './index.css';
|
|
2
|
+
var styles = {"chat-bubble":"magritte-chat-bubble___ds9CP_3-5-0","chatBubble":"magritte-chat-bubble___ds9CP_3-5-0","outgoing":"magritte-outgoing___3n00o_3-5-0","bot":"magritte-bot___Z6vZA_3-5-0","row":"magritte-row___mQNnt_3-5-0","with-buttons":"magritte-with-buttons___L-ZmQ_3-5-0","withButtons":"magritte-with-buttons___L-ZmQ_3-5-0","bubble":"magritte-bubble___NVuDI_3-5-0","with-tail":"magritte-with-tail___IdixJ_3-5-0","withTail":"magritte-with-tail___IdixJ_3-5-0","tail":"magritte-tail___E2hdk_3-5-0","tail-outgoing":"magritte-tail-outgoing___Pn3MI_3-5-0","tailOutgoing":"magritte-tail-outgoing___Pn3MI_3-5-0","with-avatar":"magritte-with-avatar___8kYWY_3-5-0","withAvatar":"magritte-with-avatar___8kYWY_3-5-0","avatar":"magritte-avatar___khWFX_3-5-0","buttons":"magritte-buttons___yQqBi_3-5-0","button-wide":"magritte-button-wide___QBqmM_3-5-0","buttonWide":"magritte-button-wide___QBqmM_3-5-0","aside":"magritte-aside___bTex-_3-5-0","aside-revealed":"magritte-aside-revealed___CRBl7_3-5-0","asideRevealed":"magritte-aside-revealed___CRBl7_3-5-0","error-text":"magritte-error-text___1ZxWY_3-5-0","errorText":"magritte-error-text___1ZxWY_3-5-0","file":"magritte-file___k2IKy_3-5-0","file-preview":"magritte-file-preview___eJKu8_3-5-0","filePreview":"magritte-file-preview___eJKu8_3-5-0","media":"magritte-media___9jH2k_3-5-0","media-blur":"magritte-media-blur___TbiMa_3-5-0","mediaBlur":"magritte-media-blur___TbiMa_3-5-0","media-image":"magritte-media-image___G-FkF_3-5-0","mediaImage":"magritte-media-image___G-FkF_3-5-0","media-content":"magritte-media-content___n3XbD_3-5-0","mediaContent":"magritte-media-content___n3XbD_3-5-0","media-format":"magritte-media-format___AdfCK_3-5-0","mediaFormat":"magritte-media-format___AdfCK_3-5-0","media-meta":"magritte-media-meta___oSxxr_3-5-0","mediaMeta":"magritte-media-meta___oSxxr_3-5-0","reply":"magritte-reply___-QCK7_3-5-0","reply-preview":"magritte-reply-preview___qvlNT_3-5-0","replyPreview":"magritte-reply-preview___qvlNT_3-5-0","reply-body":"magritte-reply-body___f2xx7_3-5-0","replyBody":"magritte-reply-body___f2xx7_3-5-0","snippet":"magritte-snippet___8k9xb_3-5-0","meta":"magritte-meta___1qhjm_3-5-0","footer":"magritte-footer___LvGQP_3-5-0","reaction":"magritte-reaction___7AabI_3-5-0","reaction-active":"magritte-reaction-active___pWjzJ_3-5-0","reactionActive":"magritte-reaction-active___pWjzJ_3-5-0","edited":"magritte-edited___m-zmB_3-5-0","status":"magritte-status___dHzCt_3-5-0","message-title":"magritte-message-title___dgBFk_3-5-0","messageTitle":"magritte-message-title___dgBFk_3-5-0","label":"magritte-label___i0Wyt_3-5-0","message":"magritte-message___7TEpw_3-5-0"};
|
|
3
|
+
|
|
4
|
+
export { styles as s };
|
|
5
|
+
//# sourceMappingURL=chat-bubble-B3D9arfs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chat-bubble-B3D9arfs.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;"}
|
package/index.css
CHANGED
|
@@ -1,81 +1,97 @@
|
|
|
1
1
|
:root{
|
|
2
|
-
--magritte-color-background-overlay-v26-0-
|
|
3
|
-
--magritte-color-
|
|
4
|
-
--magritte-color-
|
|
5
|
-
--magritte-color-component-chat-bubble-background-
|
|
6
|
-
--magritte-color-component-chat-bubble-background-
|
|
7
|
-
--magritte-color-component-chat-bubble-
|
|
8
|
-
--magritte-color-component-chat-bubble-border-
|
|
9
|
-
--magritte-color-component-chat-bubble-border-
|
|
10
|
-
--magritte-color-component-chat-bubble-border-
|
|
11
|
-
--magritte-color-component-chat-bubble-
|
|
12
|
-
--magritte-color-component-chat-bubble-
|
|
13
|
-
--magritte-color-component-chat-bubble-
|
|
14
|
-
--magritte-color-component-chat-bubble-
|
|
15
|
-
--magritte-color-component-chat-bubble-
|
|
16
|
-
--magritte-color-component-chat-bubble-
|
|
2
|
+
--magritte-color-background-overlay-v26-0-3:#20262bad;
|
|
3
|
+
--magritte-color-stroke-state-focused-accessible-v26-0-3:#0070ff7a;
|
|
4
|
+
--magritte-color-text-constant-v26-0-3:#ffffff;
|
|
5
|
+
--magritte-color-component-chat-bubble-background-incoming-v26-0-3:#F4F6FB;
|
|
6
|
+
--magritte-color-component-chat-bubble-background-outgoing-v26-0-3:#0070ff;
|
|
7
|
+
--magritte-color-component-chat-bubble-background-bot-v26-0-3:#f9f7ff;
|
|
8
|
+
--magritte-color-component-chat-bubble-border-incoming-v26-0-3:#EEF1F7;
|
|
9
|
+
--magritte-color-component-chat-bubble-border-outgoing-v26-0-3:#0d63e3;
|
|
10
|
+
--magritte-color-component-chat-bubble-border-bot-v26-0-3:#f3eeff;
|
|
11
|
+
--magritte-color-component-chat-bubble-border-image-v26-0-3:#0000001a;
|
|
12
|
+
--magritte-color-component-chat-bubble-reactions-background-incoming-v26-0-3:#EEF1F7;
|
|
13
|
+
--magritte-color-component-chat-bubble-reactions-background-outgoing-v26-0-3:#2b7fff;
|
|
14
|
+
--magritte-color-component-chat-bubble-reactions-background-bot-v26-0-3:#f3eeff;
|
|
15
|
+
--magritte-color-component-chat-bubble-reactions-background-state-incoming-active-v26-0-3:#0070ff;
|
|
16
|
+
--magritte-color-component-chat-bubble-reactions-background-state-outgoing-active-v26-0-3:#ffffff;
|
|
17
|
+
--magritte-color-component-chat-bubble-reactions-background-state-bot-active-v26-0-3:#9054ea;
|
|
18
|
+
--magritte-color-component-chat-bubble-snippet-background-incoming-v26-0-3:#EEF1F7;
|
|
19
|
+
--magritte-color-component-chat-bubble-snippet-background-outgoing-v26-0-3:#2b7fff;
|
|
20
|
+
--magritte-color-component-chat-bubble-snippet-background-bot-v26-0-3:#f3eeff;
|
|
21
|
+
--magritte-color-component-chat-bubble-snippet-line-incoming-v26-0-3:#0070ff;
|
|
22
|
+
--magritte-color-component-chat-bubble-snippet-line-outgoing-v26-0-3:#f3f9ff;
|
|
23
|
+
--magritte-color-component-chat-bubble-snippet-line-bot-v26-0-3:#9054ea;
|
|
17
24
|
}
|
|
18
25
|
|
|
19
26
|
:root{
|
|
20
|
-
--magritte-semantic-animation-time-s-duration-v26-0-
|
|
27
|
+
--magritte-semantic-animation-time-s-duration-v26-0-3:200ms;
|
|
21
28
|
}
|
|
22
29
|
|
|
23
30
|
.magritte-night-theme{
|
|
24
|
-
--magritte-color-component-chat-bubble-background-incoming-v26-0-
|
|
25
|
-
--magritte-color-component-chat-bubble-background-outgoing-v26-0-
|
|
26
|
-
--magritte-color-component-chat-bubble-background-bot-v26-0-
|
|
27
|
-
--magritte-color-component-chat-bubble-border-incoming-v26-0-
|
|
28
|
-
--magritte-color-component-chat-bubble-border-outgoing-v26-0-
|
|
29
|
-
--magritte-color-component-chat-bubble-border-bot-v26-0-
|
|
30
|
-
--magritte-color-component-chat-bubble-snippet-background-incoming-v26-0-
|
|
31
|
-
--magritte-color-component-chat-bubble-snippet-background-outgoing-v26-0-
|
|
32
|
-
--magritte-color-component-chat-bubble-snippet-background-bot-v26-0-
|
|
31
|
+
--magritte-color-component-chat-bubble-background-incoming-v26-0-3:#262626;
|
|
32
|
+
--magritte-color-component-chat-bubble-background-outgoing-v26-0-3:#2b7fff;
|
|
33
|
+
--magritte-color-component-chat-bubble-background-bot-v26-0-3:#312F47;
|
|
34
|
+
--magritte-color-component-chat-bubble-border-incoming-v26-0-3:#303030;
|
|
35
|
+
--magritte-color-component-chat-bubble-border-outgoing-v26-0-3:#0070ff;
|
|
36
|
+
--magritte-color-component-chat-bubble-border-bot-v26-0-3:#403A59;
|
|
37
|
+
--magritte-color-component-chat-bubble-snippet-background-incoming-v26-0-3:#303030;
|
|
38
|
+
--magritte-color-component-chat-bubble-snippet-background-outgoing-v26-0-3:#468ffd;
|
|
39
|
+
--magritte-color-component-chat-bubble-snippet-background-bot-v26-0-3:#403A59;
|
|
40
|
+
--magritte-color-component-chat-bubble-reactions-background-incoming-v26-0-3:#303030;
|
|
41
|
+
--magritte-color-component-chat-bubble-reactions-background-outgoing-v26-0-3:#468ffd;
|
|
42
|
+
--magritte-color-component-chat-bubble-reactions-background-state-incoming-active-v26-0-3:#2b7fff;
|
|
33
43
|
}
|
|
34
44
|
|
|
35
45
|
.magritte-zp-day-theme{
|
|
36
|
-
--magritte-color-component-chat-bubble-background-outgoing-v26-0-
|
|
37
|
-
--magritte-color-component-chat-bubble-border-outgoing-v26-0-
|
|
38
|
-
--magritte-color-component-chat-bubble-snippet-background-outgoing-v26-0-
|
|
39
|
-
--magritte-color-component-chat-bubble-snippet-line-incoming-v26-0-
|
|
40
|
-
}
|
|
41
|
-
.magritte-chat-bubble___ds9CP_3-
|
|
42
|
-
--magritte-chat-bubble-background:var(--magritte-color-component-chat-bubble-background-incoming-v26-0-
|
|
43
|
-
--magritte-chat-bubble-border:var(--magritte-color-component-chat-bubble-border-incoming-v26-0-
|
|
44
|
-
--magritte-chat-bubble-snippet-background:var(--magritte-color-component-chat-bubble-snippet-background-incoming-v26-0-
|
|
45
|
-
--magritte-chat-bubble-snippet-line:var(--magritte-color-component-chat-bubble-snippet-line-incoming-v26-0-
|
|
46
|
+
--magritte-color-component-chat-bubble-background-outgoing-v26-0-3:#7195AF;
|
|
47
|
+
--magritte-color-component-chat-bubble-border-outgoing-v26-0-3:#557B96;
|
|
48
|
+
--magritte-color-component-chat-bubble-snippet-background-outgoing-v26-0-3:#90ACC1;
|
|
49
|
+
--magritte-color-component-chat-bubble-snippet-line-incoming-v26-0-3:#557B96;
|
|
50
|
+
}
|
|
51
|
+
.magritte-chat-bubble___ds9CP_3-5-0{
|
|
52
|
+
--magritte-chat-bubble-background:var(--magritte-color-component-chat-bubble-background-incoming-v26-0-3);
|
|
53
|
+
--magritte-chat-bubble-border:var(--magritte-color-component-chat-bubble-border-incoming-v26-0-3);
|
|
54
|
+
--magritte-chat-bubble-snippet-background:var(--magritte-color-component-chat-bubble-snippet-background-incoming-v26-0-3);
|
|
55
|
+
--magritte-chat-bubble-snippet-line:var(--magritte-color-component-chat-bubble-snippet-line-incoming-v26-0-3);
|
|
56
|
+
--magritte-chat-bubble-reaction-background:var(--magritte-color-component-chat-bubble-reactions-background-incoming-v26-0-3);
|
|
57
|
+
--magritte-chat-bubble-reaction-background-active:var(--magritte-color-component-chat-bubble-reactions-background-state-incoming-active-v26-0-3);
|
|
46
58
|
display:flex;
|
|
47
59
|
flex-direction:column;
|
|
48
60
|
align-items:flex-start;
|
|
49
61
|
max-width:min(460px, calc(100% - 40px));
|
|
50
62
|
}
|
|
51
|
-
.magritte-outgoing___3n00o_3-
|
|
52
|
-
--magritte-chat-bubble-background:var(--magritte-color-component-chat-bubble-background-outgoing-v26-0-
|
|
53
|
-
--magritte-chat-bubble-border:var(--magritte-color-component-chat-bubble-border-outgoing-v26-0-
|
|
54
|
-
--magritte-chat-bubble-snippet-background:var(--magritte-color-component-chat-bubble-snippet-background-outgoing-v26-0-
|
|
55
|
-
--magritte-chat-bubble-snippet-line:var(--magritte-color-component-chat-bubble-snippet-line-outgoing-v26-0-
|
|
63
|
+
.magritte-outgoing___3n00o_3-5-0{
|
|
64
|
+
--magritte-chat-bubble-background:var(--magritte-color-component-chat-bubble-background-outgoing-v26-0-3);
|
|
65
|
+
--magritte-chat-bubble-border:var(--magritte-color-component-chat-bubble-border-outgoing-v26-0-3);
|
|
66
|
+
--magritte-chat-bubble-snippet-background:var(--magritte-color-component-chat-bubble-snippet-background-outgoing-v26-0-3);
|
|
67
|
+
--magritte-chat-bubble-snippet-line:var(--magritte-color-component-chat-bubble-snippet-line-outgoing-v26-0-3);
|
|
68
|
+
--magritte-chat-bubble-reaction-background:var(--magritte-color-component-chat-bubble-reactions-background-outgoing-v26-0-3);
|
|
69
|
+
--magritte-chat-bubble-reaction-background-active:var(--magritte-color-component-chat-bubble-reactions-background-state-outgoing-active-v26-0-3);
|
|
56
70
|
align-items:flex-end;
|
|
57
71
|
margin-left:auto;
|
|
58
72
|
}
|
|
59
|
-
.magritte-bot___Z6vZA_3-
|
|
60
|
-
--magritte-chat-bubble-background:var(--magritte-color-component-chat-bubble-background-bot-v26-0-
|
|
61
|
-
--magritte-chat-bubble-border:var(--magritte-color-component-chat-bubble-border-bot-v26-0-
|
|
62
|
-
--magritte-chat-bubble-snippet-background:var(--magritte-color-component-chat-bubble-snippet-background-bot-v26-0-
|
|
63
|
-
--magritte-chat-bubble-snippet-line:var(--magritte-color-component-chat-bubble-snippet-line-bot-v26-0-
|
|
73
|
+
.magritte-bot___Z6vZA_3-5-0{
|
|
74
|
+
--magritte-chat-bubble-background:var(--magritte-color-component-chat-bubble-background-bot-v26-0-3);
|
|
75
|
+
--magritte-chat-bubble-border:var(--magritte-color-component-chat-bubble-border-bot-v26-0-3);
|
|
76
|
+
--magritte-chat-bubble-snippet-background:var(--magritte-color-component-chat-bubble-snippet-background-bot-v26-0-3);
|
|
77
|
+
--magritte-chat-bubble-snippet-line:var(--magritte-color-component-chat-bubble-snippet-line-bot-v26-0-3);
|
|
78
|
+
--magritte-chat-bubble-reaction-background:var(--magritte-color-component-chat-bubble-reactions-background-bot-v26-0-3);
|
|
79
|
+
--magritte-chat-bubble-reaction-background-active:var(--magritte-color-component-chat-bubble-reactions-background-state-bot-active-v26-0-3);
|
|
64
80
|
}
|
|
65
|
-
.magritte-row___mQNnt_3-
|
|
81
|
+
.magritte-row___mQNnt_3-5-0{
|
|
66
82
|
display:flex;
|
|
67
83
|
position:relative;
|
|
68
84
|
align-items:flex-end;
|
|
69
85
|
gap:8px;
|
|
70
86
|
max-width:100%;
|
|
71
87
|
}
|
|
72
|
-
.magritte-with-buttons___L-ZmQ_3-
|
|
88
|
+
.magritte-with-buttons___L-ZmQ_3-5-0 .magritte-row___mQNnt_3-5-0{
|
|
73
89
|
align-self:stretch;
|
|
74
90
|
}
|
|
75
|
-
.magritte-with-buttons___L-ZmQ_3-
|
|
91
|
+
.magritte-with-buttons___L-ZmQ_3-5-0 .magritte-bubble___NVuDI_3-5-0{
|
|
76
92
|
flex-grow:1;
|
|
77
93
|
}
|
|
78
|
-
.magritte-bubble___NVuDI_3-
|
|
94
|
+
.magritte-bubble___NVuDI_3-5-0{
|
|
79
95
|
position:relative;
|
|
80
96
|
box-sizing:border-box;
|
|
81
97
|
min-width:0;
|
|
@@ -86,52 +102,52 @@
|
|
|
86
102
|
border-radius:20px;
|
|
87
103
|
overflow-wrap:break-word;
|
|
88
104
|
}
|
|
89
|
-
.magritte-with-tail___IdixJ_3-
|
|
105
|
+
.magritte-with-tail___IdixJ_3-5-0 .magritte-bubble___NVuDI_3-5-0{
|
|
90
106
|
border-bottom-left-radius:0;
|
|
91
107
|
}
|
|
92
|
-
.magritte-with-tail___IdixJ_3-
|
|
108
|
+
.magritte-with-tail___IdixJ_3-5-0.magritte-outgoing___3n00o_3-5-0 .magritte-bubble___NVuDI_3-5-0{
|
|
93
109
|
border-bottom-left-radius:20px;
|
|
94
110
|
border-bottom-right-radius:0;
|
|
95
111
|
}
|
|
96
|
-
.magritte-tail___E2hdk_3-
|
|
112
|
+
.magritte-tail___E2hdk_3-5-0{
|
|
97
113
|
position:absolute;
|
|
98
114
|
bottom:-1px;
|
|
99
115
|
left:-7px;
|
|
100
116
|
}
|
|
101
|
-
.magritte-tail-outgoing___Pn3MI_3-
|
|
117
|
+
.magritte-tail-outgoing___Pn3MI_3-5-0{
|
|
102
118
|
left:auto;
|
|
103
119
|
right:-7px;
|
|
104
120
|
transform:scaleX(-1);
|
|
105
121
|
}
|
|
106
|
-
.magritte-with-avatar___8kYWY_3-
|
|
122
|
+
.magritte-with-avatar___8kYWY_3-5-0{
|
|
107
123
|
display:grid;
|
|
108
124
|
grid-template-columns:auto minmax(0, 1fr);
|
|
109
125
|
align-items:end;
|
|
110
126
|
justify-items:start;
|
|
111
127
|
}
|
|
112
|
-
.magritte-with-avatar___8kYWY_3-
|
|
128
|
+
.magritte-with-avatar___8kYWY_3-5-0 > :not(.magritte-avatar___khWFX_3-5-0){
|
|
113
129
|
grid-column:2;
|
|
114
130
|
}
|
|
115
|
-
.magritte-with-avatar___8kYWY_3-
|
|
131
|
+
.magritte-with-avatar___8kYWY_3-5-0.magritte-with-buttons___L-ZmQ_3-5-0 .magritte-row___mQNnt_3-5-0{
|
|
116
132
|
justify-self:stretch;
|
|
117
133
|
}
|
|
118
|
-
.magritte-avatar___khWFX_3-
|
|
134
|
+
.magritte-avatar___khWFX_3-5-0{
|
|
119
135
|
display:flex;
|
|
120
136
|
grid-row:1;
|
|
121
137
|
grid-column:1;
|
|
122
138
|
margin-right:6px;
|
|
123
139
|
}
|
|
124
|
-
.magritte-buttons___yQqBi_3-
|
|
140
|
+
.magritte-buttons___yQqBi_3-5-0{
|
|
125
141
|
display:grid;
|
|
126
142
|
grid-template-columns:repeat(2, minmax(0, 1fr));
|
|
127
143
|
gap:8px;
|
|
128
144
|
width:100%;
|
|
129
145
|
margin-top:4px;
|
|
130
146
|
}
|
|
131
|
-
.magritte-button-wide___QBqmM_3-
|
|
147
|
+
.magritte-button-wide___QBqmM_3-5-0{
|
|
132
148
|
grid-column:span 2;
|
|
133
149
|
}
|
|
134
|
-
.magritte-aside___bTex-_3-
|
|
150
|
+
.magritte-aside___bTex-_3-5-0{
|
|
135
151
|
display:flex;
|
|
136
152
|
position:absolute;
|
|
137
153
|
top:0;
|
|
@@ -140,32 +156,32 @@
|
|
|
140
156
|
align-items:flex-start;
|
|
141
157
|
padding-left:8px;
|
|
142
158
|
opacity:0;
|
|
143
|
-
transition:opacity var(--magritte-semantic-animation-time-s-duration-v26-0-
|
|
159
|
+
transition:opacity var(--magritte-semantic-animation-time-s-duration-v26-0-3) ease-in-out;
|
|
144
160
|
}
|
|
145
|
-
.magritte-aside-revealed___CRBl7_3-
|
|
161
|
+
.magritte-aside-revealed___CRBl7_3-5-0{
|
|
146
162
|
opacity:1;
|
|
147
163
|
}
|
|
148
|
-
.magritte-outgoing___3n00o_3-
|
|
164
|
+
.magritte-outgoing___3n00o_3-5-0 .magritte-aside___bTex-_3-5-0{
|
|
149
165
|
left:auto;
|
|
150
166
|
right:100%;
|
|
151
167
|
padding-right:8px;
|
|
152
168
|
padding-left:0;
|
|
153
169
|
}
|
|
154
|
-
.magritte-error-text___1ZxWY_3-
|
|
170
|
+
.magritte-error-text___1ZxWY_3-5-0{
|
|
155
171
|
margin-top:2px;
|
|
156
172
|
}
|
|
157
|
-
.magritte-file___k2IKy_3-
|
|
173
|
+
.magritte-file___k2IKy_3-5-0{
|
|
158
174
|
display:flex;
|
|
159
175
|
align-items:flex-end;
|
|
160
176
|
}
|
|
161
|
-
.magritte-file-preview___eJKu8_3-
|
|
177
|
+
.magritte-file-preview___eJKu8_3-5-0{
|
|
162
178
|
display:block;
|
|
163
179
|
width:48px;
|
|
164
180
|
height:48px;
|
|
165
181
|
border-radius:8px;
|
|
166
182
|
object-fit:cover;
|
|
167
183
|
}
|
|
168
|
-
.magritte-media___9jH2k_3-
|
|
184
|
+
.magritte-media___9jH2k_3-5-0{
|
|
169
185
|
display:flex;
|
|
170
186
|
position:relative;
|
|
171
187
|
box-sizing:border-box;
|
|
@@ -175,9 +191,9 @@
|
|
|
175
191
|
margin:0 -8px;
|
|
176
192
|
border-radius:16px;
|
|
177
193
|
overflow:hidden;
|
|
178
|
-
box-shadow:inset 0 0 0 1px var(--magritte-color-component-chat-bubble-border-image-v26-0-
|
|
194
|
+
box-shadow:inset 0 0 0 1px var(--magritte-color-component-chat-bubble-border-image-v26-0-3);
|
|
179
195
|
}
|
|
180
|
-
.magritte-media-blur___TbiMa_3-
|
|
196
|
+
.magritte-media-blur___TbiMa_3-5-0{
|
|
181
197
|
position:absolute;
|
|
182
198
|
top:-96px;
|
|
183
199
|
left:-96px;
|
|
@@ -187,7 +203,7 @@
|
|
|
187
203
|
filter:blur(48px);
|
|
188
204
|
object-fit:cover;
|
|
189
205
|
}
|
|
190
|
-
.magritte-media-image___G-FkF_3-
|
|
206
|
+
.magritte-media-image___G-FkF_3-5-0{
|
|
191
207
|
display:block;
|
|
192
208
|
position:relative;
|
|
193
209
|
height:auto;
|
|
@@ -197,52 +213,52 @@
|
|
|
197
213
|
object-fit:contain;
|
|
198
214
|
}
|
|
199
215
|
@media (min-width: 1020px){
|
|
200
|
-
body.magritte-old-layout .magritte-media-image___G-FkF_3-
|
|
216
|
+
body.magritte-old-layout .magritte-media-image___G-FkF_3-5-0{
|
|
201
217
|
max-height:452px;
|
|
202
218
|
}
|
|
203
219
|
}
|
|
204
220
|
@media (min-width: 1024px){
|
|
205
|
-
body:not(.magritte-old-layout) .magritte-media-image___G-FkF_3-
|
|
221
|
+
body:not(.magritte-old-layout) .magritte-media-image___G-FkF_3-5-0{
|
|
206
222
|
max-height:452px;
|
|
207
223
|
}
|
|
208
224
|
}
|
|
209
|
-
.magritte-media-content___n3XbD_3-
|
|
225
|
+
.magritte-media-content___n3XbD_3-5-0{
|
|
210
226
|
display:flex;
|
|
211
227
|
position:absolute;
|
|
212
228
|
inset:0;
|
|
213
229
|
align-items:center;
|
|
214
230
|
justify-content:center;
|
|
215
231
|
}
|
|
216
|
-
.magritte-media-format___AdfCK_3-
|
|
232
|
+
.magritte-media-format___AdfCK_3-5-0{
|
|
217
233
|
display:flex;
|
|
218
234
|
position:absolute;
|
|
219
235
|
padding:2px 8px;
|
|
220
|
-
background-color:var(--magritte-color-background-overlay-v26-0-
|
|
236
|
+
background-color:var(--magritte-color-background-overlay-v26-0-3);
|
|
221
237
|
border-radius:12px;
|
|
222
238
|
backdrop-filter:blur(24px);
|
|
223
239
|
top:4px;
|
|
224
240
|
left:4px;
|
|
225
241
|
}
|
|
226
|
-
.magritte-media-meta___oSxxr_3-
|
|
227
|
-
--magritte-ui-text-color-override:var(--magritte-color-text-constant-v26-0-
|
|
242
|
+
.magritte-media-meta___oSxxr_3-5-0{
|
|
243
|
+
--magritte-ui-text-color-override:var(--magritte-color-text-constant-v26-0-3);
|
|
228
244
|
display:flex;
|
|
229
245
|
position:absolute;
|
|
230
246
|
padding:2px 8px;
|
|
231
|
-
background-color:var(--magritte-color-background-overlay-v26-0-
|
|
247
|
+
background-color:var(--magritte-color-background-overlay-v26-0-3);
|
|
232
248
|
border-radius:12px;
|
|
233
249
|
backdrop-filter:blur(24px);
|
|
234
250
|
right:4px;
|
|
235
251
|
bottom:4px;
|
|
236
252
|
align-items:center;
|
|
237
253
|
}
|
|
238
|
-
.magritte-media-meta___oSxxr_3-
|
|
239
|
-
.magritte-media-meta___oSxxr_3-
|
|
254
|
+
.magritte-media-meta___oSxxr_3-5-0:empty,
|
|
255
|
+
.magritte-media-meta___oSxxr_3-5-0:has(> :empty){
|
|
240
256
|
display:none;
|
|
241
257
|
}
|
|
242
|
-
.magritte-media-meta___oSxxr_3-
|
|
258
|
+
.magritte-media-meta___oSxxr_3-5-0 > span{
|
|
243
259
|
margin-left:0;
|
|
244
260
|
}
|
|
245
|
-
.magritte-reply___-QCK7_3-
|
|
261
|
+
.magritte-reply___-QCK7_3-5-0{
|
|
246
262
|
display:flex;
|
|
247
263
|
position:relative;
|
|
248
264
|
padding:8px;
|
|
@@ -253,7 +269,7 @@
|
|
|
253
269
|
align-items:center;
|
|
254
270
|
gap:8px;
|
|
255
271
|
}
|
|
256
|
-
.magritte-reply___-QCK7_3-
|
|
272
|
+
.magritte-reply___-QCK7_3-5-0::before{
|
|
257
273
|
content:'';
|
|
258
274
|
position:absolute;
|
|
259
275
|
top:0;
|
|
@@ -262,22 +278,22 @@
|
|
|
262
278
|
width:4px;
|
|
263
279
|
background-color:var(--magritte-chat-bubble-snippet-line);
|
|
264
280
|
}
|
|
265
|
-
.magritte-reply-preview___qvlNT_3-
|
|
281
|
+
.magritte-reply-preview___qvlNT_3-5-0{
|
|
266
282
|
display:block;
|
|
267
283
|
flex-shrink:0;
|
|
268
284
|
width:40px;
|
|
269
285
|
height:40px;
|
|
270
286
|
border-radius:8px;
|
|
271
|
-
outline:1px solid var(--magritte-color-component-chat-bubble-border-image-v26-0-
|
|
287
|
+
outline:1px solid var(--magritte-color-component-chat-bubble-border-image-v26-0-3);
|
|
272
288
|
outline-offset:-1px;
|
|
273
289
|
object-fit:cover;
|
|
274
290
|
}
|
|
275
|
-
.magritte-reply-body___f2xx7_3-
|
|
291
|
+
.magritte-reply-body___f2xx7_3-5-0{
|
|
276
292
|
display:flex;
|
|
277
293
|
flex-direction:column;
|
|
278
294
|
min-width:0;
|
|
279
295
|
}
|
|
280
|
-
.magritte-snippet___8k9xb_3-
|
|
296
|
+
.magritte-snippet___8k9xb_3-5-0{
|
|
281
297
|
display:flex;
|
|
282
298
|
position:relative;
|
|
283
299
|
padding:8px;
|
|
@@ -288,7 +304,7 @@
|
|
|
288
304
|
flex-direction:column;
|
|
289
305
|
gap:2px;
|
|
290
306
|
}
|
|
291
|
-
.magritte-snippet___8k9xb_3-
|
|
307
|
+
.magritte-snippet___8k9xb_3-5-0::before{
|
|
292
308
|
content:'';
|
|
293
309
|
position:absolute;
|
|
294
310
|
top:0;
|
|
@@ -297,15 +313,15 @@
|
|
|
297
313
|
width:4px;
|
|
298
314
|
background-color:var(--magritte-chat-bubble-snippet-line);
|
|
299
315
|
}
|
|
300
|
-
.magritte-snippet___8k9xb_3-
|
|
316
|
+
.magritte-snippet___8k9xb_3-5-0 img{
|
|
301
317
|
display:block;
|
|
302
318
|
max-width:100%;
|
|
303
319
|
border-radius:4px;
|
|
304
|
-
outline:1px solid var(--magritte-color-component-chat-bubble-border-image-v26-0-
|
|
320
|
+
outline:1px solid var(--magritte-color-component-chat-bubble-border-image-v26-0-3);
|
|
305
321
|
outline-offset:-1px;
|
|
306
322
|
margin-top:6px;
|
|
307
323
|
}
|
|
308
|
-
.magritte-meta___1qhjm_3-
|
|
324
|
+
.magritte-meta___1qhjm_3-5-0{
|
|
309
325
|
float:right;
|
|
310
326
|
margin-left:12px;
|
|
311
327
|
white-space:nowrap;
|
|
@@ -318,53 +334,85 @@
|
|
|
318
334
|
text-transform:none;
|
|
319
335
|
text-decoration:none;
|
|
320
336
|
}
|
|
321
|
-
.magritte-
|
|
337
|
+
.magritte-footer___LvGQP_3-5-0{
|
|
338
|
+
display:flex;
|
|
339
|
+
flex-wrap:wrap;
|
|
340
|
+
align-items:flex-end;
|
|
341
|
+
gap:4px;
|
|
342
|
+
}
|
|
343
|
+
.magritte-footer___LvGQP_3-5-0 > .magritte-meta___1qhjm_3-5-0{
|
|
344
|
+
margin-left:auto;
|
|
345
|
+
padding-left:8px;
|
|
346
|
+
}
|
|
347
|
+
.magritte-reaction___7AabI_3-5-0{
|
|
348
|
+
display:inline-flex;
|
|
349
|
+
align-items:center;
|
|
350
|
+
gap:4px;
|
|
351
|
+
height:28px;
|
|
352
|
+
padding:0 8px;
|
|
353
|
+
border:0;
|
|
354
|
+
border-radius:16px;
|
|
355
|
+
background-color:var(--magritte-chat-bubble-reaction-background);
|
|
356
|
+
}
|
|
357
|
+
.magritte-reaction___7AabI_3-5-0:disabled{
|
|
358
|
+
cursor:default;
|
|
359
|
+
}
|
|
360
|
+
.magritte-reaction___7AabI_3-5-0.focus-visible{
|
|
361
|
+
outline:var(--magritte-color-stroke-state-focused-accessible-v26-0-3) solid 4px;
|
|
362
|
+
}
|
|
363
|
+
.magritte-reaction-active___pWjzJ_3-5-0{
|
|
364
|
+
background-color:var(--magritte-chat-bubble-reaction-background-active);
|
|
365
|
+
}
|
|
366
|
+
.magritte-edited___m-zmB_3-5-0{
|
|
322
367
|
margin-right:4px;
|
|
323
368
|
}
|
|
324
|
-
.magritte-status___dHzCt_3-
|
|
369
|
+
.magritte-status___dHzCt_3-5-0{
|
|
325
370
|
display:inline-flex;
|
|
326
371
|
vertical-align:middle;
|
|
327
372
|
}
|
|
328
|
-
.magritte-status___dHzCt_3-
|
|
373
|
+
.magritte-status___dHzCt_3-5-0:not(:first-child){
|
|
329
374
|
margin-left:4px;
|
|
330
375
|
}
|
|
331
|
-
.magritte-message-title___dgBFk_3-
|
|
376
|
+
.magritte-message-title___dgBFk_3-5-0{
|
|
332
377
|
margin-bottom:4px;
|
|
333
378
|
}
|
|
334
|
-
.magritte-label___i0Wyt_3-
|
|
335
|
-
.magritte-label___i0Wyt_3-
|
|
336
|
-
.magritte-label___i0Wyt_3-
|
|
337
|
-
.magritte-message___7TEpw_3-
|
|
338
|
-
.magritte-bubble___NVuDI_3-
|
|
379
|
+
.magritte-label___i0Wyt_3-5-0 + .magritte-media___9jH2k_3-5-0,
|
|
380
|
+
.magritte-label___i0Wyt_3-5-0 + .magritte-message___7TEpw_3-5-0,
|
|
381
|
+
.magritte-label___i0Wyt_3-5-0 + .magritte-snippet___8k9xb_3-5-0,
|
|
382
|
+
.magritte-message___7TEpw_3-5-0 + .magritte-message___7TEpw_3-5-0,
|
|
383
|
+
.magritte-bubble___NVuDI_3-5-0 > .magritte-meta___1qhjm_3-5-0{
|
|
339
384
|
margin-top:4px;
|
|
340
385
|
}
|
|
341
|
-
.magritte-label___i0Wyt_3-
|
|
342
|
-
.magritte-reply___-QCK7_3-
|
|
343
|
-
.magritte-reply___-QCK7_3-
|
|
344
|
-
.magritte-reply___-QCK7_3-
|
|
345
|
-
.magritte-media___9jH2k_3-
|
|
386
|
+
.magritte-label___i0Wyt_3-5-0 + .magritte-reply___-QCK7_3-5-0,
|
|
387
|
+
.magritte-reply___-QCK7_3-5-0 + .magritte-media___9jH2k_3-5-0,
|
|
388
|
+
.magritte-reply___-QCK7_3-5-0 + .magritte-message___7TEpw_3-5-0,
|
|
389
|
+
.magritte-reply___-QCK7_3-5-0 + .magritte-snippet___8k9xb_3-5-0,
|
|
390
|
+
.magritte-media___9jH2k_3-5-0 + .magritte-snippet___8k9xb_3-5-0{
|
|
346
391
|
margin-top:8px;
|
|
347
392
|
}
|
|
348
|
-
.magritte-label___i0Wyt_3-
|
|
349
|
-
.magritte-reply___-QCK7_3-
|
|
350
|
-
.magritte-media___9jH2k_3-
|
|
351
|
-
.magritte-media___9jH2k_3-
|
|
352
|
-
.magritte-file___k2IKy_3-
|
|
353
|
-
.magritte-file___k2IKy_3-
|
|
393
|
+
.magritte-label___i0Wyt_3-5-0 + .magritte-file___k2IKy_3-5-0,
|
|
394
|
+
.magritte-reply___-QCK7_3-5-0 + .magritte-file___k2IKy_3-5-0,
|
|
395
|
+
.magritte-media___9jH2k_3-5-0 + .magritte-file___k2IKy_3-5-0,
|
|
396
|
+
.magritte-media___9jH2k_3-5-0 + .magritte-message___7TEpw_3-5-0,
|
|
397
|
+
.magritte-file___k2IKy_3-5-0 + .magritte-message___7TEpw_3-5-0,
|
|
398
|
+
.magritte-file___k2IKy_3-5-0 + .magritte-snippet___8k9xb_3-5-0{
|
|
354
399
|
margin-top:12px;
|
|
355
400
|
}
|
|
356
|
-
.magritte-message___7TEpw_3-
|
|
401
|
+
.magritte-message___7TEpw_3-5-0 + .magritte-snippet___8k9xb_3-5-0{
|
|
402
|
+
margin-top:16px;
|
|
403
|
+
}
|
|
404
|
+
.magritte-bubble___NVuDI_3-5-0 > .magritte-footer___LvGQP_3-5-0{
|
|
357
405
|
margin-top:16px;
|
|
358
406
|
}
|
|
359
|
-
.magritte-file___k2IKy_3-
|
|
407
|
+
.magritte-file___k2IKy_3-5-0 + .magritte-file___k2IKy_3-5-0{
|
|
360
408
|
margin-top:24px;
|
|
361
409
|
}
|
|
362
|
-
.magritte-label___i0Wyt_3-
|
|
410
|
+
.magritte-label___i0Wyt_3-5-0{
|
|
363
411
|
margin-top:-4px;
|
|
364
412
|
}
|
|
365
|
-
.magritte-bubble___NVuDI_3-
|
|
413
|
+
.magritte-bubble___NVuDI_3-5-0 > .magritte-media___9jH2k_3-5-0:first-child{
|
|
366
414
|
margin-top:-8px;
|
|
367
415
|
}
|
|
368
|
-
.magritte-bubble___NVuDI_3-
|
|
416
|
+
.magritte-bubble___NVuDI_3-5-0 > .magritte-media___9jH2k_3-5-0:not(:has( ~ :not(.magritte-tail___E2hdk_3-5-0))){
|
|
369
417
|
margin-bottom:-8px;
|
|
370
418
|
}
|
package/index.d.ts
CHANGED
|
@@ -4,9 +4,11 @@ export type { ChatBubbleButtonProps } from './Button';
|
|
|
4
4
|
export type { ChatBubbleCallProps, ChatBubbleCallState } from './Call';
|
|
5
5
|
export type { ChatBubbleErrorActionProps } from './ErrorAction';
|
|
6
6
|
export type { ChatBubbleFileProps, ChatBubbleFileState } from './File';
|
|
7
|
+
export type { ChatBubbleFooterProps } from './Footer';
|
|
7
8
|
export type { ChatBubbleLabelProps } from './Label';
|
|
8
9
|
export type { ChatBubbleMediaProps } from './Media';
|
|
9
10
|
export type { ChatBubbleMessageProps } from './Message';
|
|
11
|
+
export type { ChatBubbleReactionProps } from './Reaction';
|
|
10
12
|
export type { ChatBubbleReplyProps } from './Reply';
|
|
11
13
|
export type { ChatBubbleSnippetProps } from './Snippet';
|
|
12
14
|
export type { ChatBubbleStatusProps, ChatBubbleStatusValue } from './Status';
|
package/index.js
CHANGED
|
@@ -7,7 +7,7 @@ import '@hh.ru/magritte-common-mouse';
|
|
|
7
7
|
import '@hh.ru/magritte-ui-avatar';
|
|
8
8
|
import '@hh.ru/magritte-ui-button';
|
|
9
9
|
import './Button.js';
|
|
10
|
-
import './chat-bubble-
|
|
10
|
+
import './chat-bubble-B3D9arfs.js';
|
|
11
11
|
import './Call.js';
|
|
12
12
|
import '@hh.ru/magritte-ui-cell';
|
|
13
13
|
import './internal/colors.js';
|
|
@@ -20,12 +20,14 @@ import '@hh.ru/magritte-ui-menu';
|
|
|
20
20
|
import './File.js';
|
|
21
21
|
import '@hh.ru/magritte-ui-link';
|
|
22
22
|
import '@hh.ru/magritte-ui-loader';
|
|
23
|
+
import './Footer.js';
|
|
23
24
|
import './Label.js';
|
|
24
25
|
import '@hh.ru/magritte-ui-typography';
|
|
25
26
|
import './Media.js';
|
|
26
27
|
import './Message.js';
|
|
27
28
|
import './Meta.js';
|
|
28
29
|
import '@hh.ru/magritte-common-use-translation';
|
|
30
|
+
import './Reaction.js';
|
|
29
31
|
import './Reply.js';
|
|
30
32
|
import './Snippet.js';
|
|
31
33
|
import './Status.js';
|
package/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/index.mock.d.ts
CHANGED
|
@@ -3,9 +3,11 @@ export type { ChatBubbleButtonProps } from './Button';
|
|
|
3
3
|
export type { ChatBubbleCallProps, ChatBubbleCallState } from './Call';
|
|
4
4
|
export type { ChatBubbleErrorActionProps } from './ErrorAction';
|
|
5
5
|
export type { ChatBubbleFileProps, ChatBubbleFileState } from './File';
|
|
6
|
+
export type { ChatBubbleFooterProps } from './Footer';
|
|
6
7
|
export type { ChatBubbleLabelProps } from './Label';
|
|
7
8
|
export type { ChatBubbleMediaProps } from './Media';
|
|
8
9
|
export type { ChatBubbleMessageProps } from './Message';
|
|
10
|
+
export type { ChatBubbleReactionProps } from './Reaction';
|
|
9
11
|
export type { ChatBubbleReplyProps } from './Reply';
|
|
10
12
|
export type { ChatBubbleSnippetProps } from './Snippet';
|
|
11
13
|
export type { ChatBubbleStatusProps, ChatBubbleStatusValue } from './Status';
|
|
@@ -14,9 +16,11 @@ export declare const ChatBubble: import("react").ForwardRefExoticComponent<Recor
|
|
|
14
16
|
Call: import("react").ForwardRefExoticComponent<Record<string, unknown>>;
|
|
15
17
|
ErrorAction: import("react").ForwardRefExoticComponent<Record<string, unknown>>;
|
|
16
18
|
File: import("react").ForwardRefExoticComponent<Record<string, unknown>>;
|
|
19
|
+
Footer: import("react").ForwardRefExoticComponent<Record<string, unknown>>;
|
|
17
20
|
Label: import("react").ForwardRefExoticComponent<Record<string, unknown>>;
|
|
18
21
|
Media: import("react").ForwardRefExoticComponent<Record<string, unknown>>;
|
|
19
22
|
Message: import("react").ForwardRefExoticComponent<Record<string, unknown>>;
|
|
23
|
+
Reaction: import("react").ForwardRefExoticComponent<Record<string, unknown>>;
|
|
20
24
|
Reply: import("react").ForwardRefExoticComponent<Record<string, unknown>>;
|
|
21
25
|
Snippet: import("react").ForwardRefExoticComponent<Record<string, unknown>>;
|
|
22
26
|
Status: import("react").ForwardRefExoticComponent<Record<string, unknown>>;
|
package/index.mock.js
CHANGED
|
@@ -5,9 +5,11 @@ const Button = mockComponent("ChatBubble.Button", void 0, { withChildren: true }
|
|
|
5
5
|
const Call = mockComponent("ChatBubble.Call");
|
|
6
6
|
const ErrorAction = mockComponent("ChatBubble.ErrorAction", void 0, { withChildren: true });
|
|
7
7
|
const File = mockComponent("ChatBubble.File");
|
|
8
|
+
const Footer = mockComponent("ChatBubble.Footer", void 0, { withChildren: true });
|
|
8
9
|
const Label = mockComponent("ChatBubble.Label", void 0, { withChildren: true });
|
|
9
10
|
const Media = mockComponent("ChatBubble.Media", void 0, { withChildren: true });
|
|
10
11
|
const Message = mockComponent("ChatBubble.Message", void 0, { withChildren: true });
|
|
12
|
+
const Reaction = mockComponent("ChatBubble.Reaction");
|
|
11
13
|
const Reply = mockComponent("ChatBubble.Reply", void 0, { withChildren: true });
|
|
12
14
|
const Snippet = mockComponent("ChatBubble.Snippet", void 0, { withChildren: true });
|
|
13
15
|
const Status = mockComponent("ChatBubble.Status", void 0, { withChildren: true });
|
|
@@ -16,9 +18,11 @@ const ChatBubble = Object.assign(mockComponent("ChatBubble", void 0, { withChild
|
|
|
16
18
|
Call,
|
|
17
19
|
ErrorAction,
|
|
18
20
|
File,
|
|
21
|
+
Footer,
|
|
19
22
|
Label,
|
|
20
23
|
Media,
|
|
21
24
|
Message,
|
|
25
|
+
Reaction,
|
|
22
26
|
Reply,
|
|
23
27
|
Snippet,
|
|
24
28
|
Status
|
package/index.mock.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mock.js","sources":["src/index.mock.ts"],"sourcesContent":["import { mockComponent } from '@hh.ru/magritte-ui-mock-component';\n\nexport type { ChatBubbleMode, ChatBubbleProps } from '@hh.ru/magritte-ui-chat-bubble/types';\nexport type { ChatBubbleButtonProps } from '@hh.ru/magritte-ui-chat-bubble/Button';\nexport type { ChatBubbleCallProps, ChatBubbleCallState } from '@hh.ru/magritte-ui-chat-bubble/Call';\nexport type { ChatBubbleErrorActionProps } from '@hh.ru/magritte-ui-chat-bubble/ErrorAction';\nexport type { ChatBubbleFileProps, ChatBubbleFileState } from '@hh.ru/magritte-ui-chat-bubble/File';\nexport type { ChatBubbleLabelProps } from '@hh.ru/magritte-ui-chat-bubble/Label';\nexport type { ChatBubbleMediaProps } from '@hh.ru/magritte-ui-chat-bubble/Media';\nexport type { ChatBubbleMessageProps } from '@hh.ru/magritte-ui-chat-bubble/Message';\nexport type { ChatBubbleReplyProps } from '@hh.ru/magritte-ui-chat-bubble/Reply';\nexport type { ChatBubbleSnippetProps } from '@hh.ru/magritte-ui-chat-bubble/Snippet';\nexport type { ChatBubbleStatusProps, ChatBubbleStatusValue } from '@hh.ru/magritte-ui-chat-bubble/Status';\n\nconst Button = mockComponent('ChatBubble.Button', undefined, { withChildren: true });\nconst Call = mockComponent('ChatBubble.Call');\nconst ErrorAction = mockComponent('ChatBubble.ErrorAction', undefined, { withChildren: true });\nconst File = mockComponent('ChatBubble.File');\nconst Label = mockComponent('ChatBubble.Label', undefined, { withChildren: true });\nconst Media = mockComponent('ChatBubble.Media', undefined, { withChildren: true });\nconst Message = mockComponent('ChatBubble.Message', undefined, { withChildren: true });\nconst Reply = mockComponent('ChatBubble.Reply', undefined, { withChildren: true });\nconst Snippet = mockComponent('ChatBubble.Snippet', undefined, { withChildren: true });\nconst Status = mockComponent('ChatBubble.Status', undefined, { withChildren: true });\n\nexport const ChatBubble = Object.assign(mockComponent('ChatBubble', undefined, { withChildren: true }), {\n Button,\n Call,\n ErrorAction,\n File,\n Label,\n Media,\n Message,\n Reply,\n Snippet,\n Status,\n});\n"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"index.mock.js","sources":["src/index.mock.ts"],"sourcesContent":["import { mockComponent } from '@hh.ru/magritte-ui-mock-component';\n\nexport type { ChatBubbleMode, ChatBubbleProps } from '@hh.ru/magritte-ui-chat-bubble/types';\nexport type { ChatBubbleButtonProps } from '@hh.ru/magritte-ui-chat-bubble/Button';\nexport type { ChatBubbleCallProps, ChatBubbleCallState } from '@hh.ru/magritte-ui-chat-bubble/Call';\nexport type { ChatBubbleErrorActionProps } from '@hh.ru/magritte-ui-chat-bubble/ErrorAction';\nexport type { ChatBubbleFileProps, ChatBubbleFileState } from '@hh.ru/magritte-ui-chat-bubble/File';\nexport type { ChatBubbleFooterProps } from '@hh.ru/magritte-ui-chat-bubble/Footer';\nexport type { ChatBubbleLabelProps } from '@hh.ru/magritte-ui-chat-bubble/Label';\nexport type { ChatBubbleMediaProps } from '@hh.ru/magritte-ui-chat-bubble/Media';\nexport type { ChatBubbleMessageProps } from '@hh.ru/magritte-ui-chat-bubble/Message';\nexport type { ChatBubbleReactionProps } from '@hh.ru/magritte-ui-chat-bubble/Reaction';\nexport type { ChatBubbleReplyProps } from '@hh.ru/magritte-ui-chat-bubble/Reply';\nexport type { ChatBubbleSnippetProps } from '@hh.ru/magritte-ui-chat-bubble/Snippet';\nexport type { ChatBubbleStatusProps, ChatBubbleStatusValue } from '@hh.ru/magritte-ui-chat-bubble/Status';\n\nconst Button = mockComponent('ChatBubble.Button', undefined, { withChildren: true });\nconst Call = mockComponent('ChatBubble.Call');\nconst ErrorAction = mockComponent('ChatBubble.ErrorAction', undefined, { withChildren: true });\nconst File = mockComponent('ChatBubble.File');\nconst Footer = mockComponent('ChatBubble.Footer', undefined, { withChildren: true });\nconst Label = mockComponent('ChatBubble.Label', undefined, { withChildren: true });\nconst Media = mockComponent('ChatBubble.Media', undefined, { withChildren: true });\nconst Message = mockComponent('ChatBubble.Message', undefined, { withChildren: true });\nconst Reaction = mockComponent('ChatBubble.Reaction');\nconst Reply = mockComponent('ChatBubble.Reply', undefined, { withChildren: true });\nconst Snippet = mockComponent('ChatBubble.Snippet', undefined, { withChildren: true });\nconst Status = mockComponent('ChatBubble.Status', undefined, { withChildren: true });\n\nexport const ChatBubble = Object.assign(mockComponent('ChatBubble', undefined, { withChildren: true }), {\n Button,\n Call,\n ErrorAction,\n File,\n Footer,\n Label,\n Media,\n Message,\n Reaction,\n Reply,\n Snippet,\n Status,\n});\n"],"names":[],"mappings":";;AAgBA,MAAM,SAAS,aAAc,CAAA,mBAAA,EAAqB,QAAW,EAAE,YAAA,EAAc,MAAM,CAAA,CAAA;AACnF,MAAM,IAAA,GAAO,cAAc,iBAAiB,CAAA,CAAA;AAC5C,MAAM,cAAc,aAAc,CAAA,wBAAA,EAA0B,QAAW,EAAE,YAAA,EAAc,MAAM,CAAA,CAAA;AAC7F,MAAM,IAAA,GAAO,cAAc,iBAAiB,CAAA,CAAA;AAC5C,MAAM,SAAS,aAAc,CAAA,mBAAA,EAAqB,QAAW,EAAE,YAAA,EAAc,MAAM,CAAA,CAAA;AACnF,MAAM,QAAQ,aAAc,CAAA,kBAAA,EAAoB,QAAW,EAAE,YAAA,EAAc,MAAM,CAAA,CAAA;AACjF,MAAM,QAAQ,aAAc,CAAA,kBAAA,EAAoB,QAAW,EAAE,YAAA,EAAc,MAAM,CAAA,CAAA;AACjF,MAAM,UAAU,aAAc,CAAA,oBAAA,EAAsB,QAAW,EAAE,YAAA,EAAc,MAAM,CAAA,CAAA;AACrF,MAAM,QAAA,GAAW,cAAc,qBAAqB,CAAA,CAAA;AACpD,MAAM,QAAQ,aAAc,CAAA,kBAAA,EAAoB,QAAW,EAAE,YAAA,EAAc,MAAM,CAAA,CAAA;AACjF,MAAM,UAAU,aAAc,CAAA,oBAAA,EAAsB,QAAW,EAAE,YAAA,EAAc,MAAM,CAAA,CAAA;AACrF,MAAM,SAAS,aAAc,CAAA,mBAAA,EAAqB,QAAW,EAAE,YAAA,EAAc,MAAM,CAAA,CAAA;AAEtE,MAAA,UAAA,GAAa,MAAO,CAAA,MAAA,CAAO,aAAc,CAAA,YAAA,EAAc,QAAW,EAAE,YAAA,EAAc,IAAK,EAAC,CAAG,EAAA;AAAA,EACpG,MAAA;AAAA,EACA,IAAA;AAAA,EACA,WAAA;AAAA,EACA,IAAA;AAAA,EACA,MAAA;AAAA,EACA,KAAA;AAAA,EACA,KAAA;AAAA,EACA,OAAA;AAAA,EACA,QAAA;AAAA,EACA,KAAA;AAAA,EACA,OAAA;AAAA,EACA,MAAA;AACJ,CAAC;;;;"}
|
package/internal/colors.d.ts
CHANGED
|
@@ -6,8 +6,10 @@ import type { TextStyle } from '@hh.ru/magritte-ui-typography';
|
|
|
6
6
|
export interface ChatBubbleColors {
|
|
7
7
|
/** Основной текст сообщения, названия файла, текст сниппета */
|
|
8
8
|
text: TextStyle;
|
|
9
|
-
/** Второстепенный текст: время, размер
|
|
9
|
+
/** Второстепенный текст: время, размер файла, счётчик реакции */
|
|
10
10
|
secondaryText: TextStyle;
|
|
11
|
+
/** Счётчик реакции, поставленной текущим пользователем */
|
|
12
|
+
activeReactionText: TextStyle;
|
|
11
13
|
/** Акцентный текст: имя отправителя */
|
|
12
14
|
accentText: TextStyle;
|
|
13
15
|
/** Автор цитируемого сообщения (у бота акцентный, потому отдельно от accentText) */
|
package/internal/colors.js
CHANGED
|
@@ -6,6 +6,7 @@ const COLORS = {
|
|
|
6
6
|
incoming: {
|
|
7
7
|
text: "primary",
|
|
8
8
|
secondaryText: "secondary",
|
|
9
|
+
activeReactionText: "constant",
|
|
9
10
|
accentText: "accent",
|
|
10
11
|
replyTitle: "accent",
|
|
11
12
|
statusIcon: "secondary",
|
|
@@ -17,6 +18,7 @@ const COLORS = {
|
|
|
17
18
|
outgoing: {
|
|
18
19
|
text: "constant",
|
|
19
20
|
secondaryText: "constant",
|
|
21
|
+
activeReactionText: "secondary",
|
|
20
22
|
accentText: "constant",
|
|
21
23
|
replyTitle: "constant",
|
|
22
24
|
statusIcon: "constant",
|
|
@@ -28,6 +30,7 @@ const COLORS = {
|
|
|
28
30
|
bot: {
|
|
29
31
|
text: "primary",
|
|
30
32
|
secondaryText: "secondary",
|
|
33
|
+
activeReactionText: "constant",
|
|
31
34
|
accentText: "special",
|
|
32
35
|
replyTitle: "accent",
|
|
33
36
|
statusIcon: "special",
|
package/internal/colors.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"colors.js","sources":["src/internal/colors.ts"],"sourcesContent":["import type { TokenColorBackground } from '@hh.ru/magritte-design-tokens/types';\nimport { useChatBubbleMode } from '@hh.ru/magritte-ui-chat-bubble/internal/mode';\nimport type { ChatBubbleMode } from '@hh.ru/magritte-ui-chat-bubble/types';\nimport type { IconColor } from '@hh.ru/magritte-ui-icon';\nimport type { LinkProps } from '@hh.ru/magritte-ui-link';\nimport type { TextStyle } from '@hh.ru/magritte-ui-typography';\n\nexport interface ChatBubbleColors {\n /** Основной текст сообщения, названия файла, текст сниппета */\n text: TextStyle;\n /** Второстепенный текст: время, размер
|
|
1
|
+
{"version":3,"file":"colors.js","sources":["src/internal/colors.ts"],"sourcesContent":["import type { TokenColorBackground } from '@hh.ru/magritte-design-tokens/types';\nimport { useChatBubbleMode } from '@hh.ru/magritte-ui-chat-bubble/internal/mode';\nimport type { ChatBubbleMode } from '@hh.ru/magritte-ui-chat-bubble/types';\nimport type { IconColor } from '@hh.ru/magritte-ui-icon';\nimport type { LinkProps } from '@hh.ru/magritte-ui-link';\nimport type { TextStyle } from '@hh.ru/magritte-ui-typography';\n\nexport interface ChatBubbleColors {\n /** Основной текст сообщения, названия файла, текст сниппета */\n text: TextStyle;\n /** Второстепенный текст: время, размер файла, счётчик реакции */\n secondaryText: TextStyle;\n /** Счётчик реакции, поставленной текущим пользователем */\n activeReactionText: TextStyle;\n /** Акцентный текст: имя отправителя */\n accentText: TextStyle;\n /** Автор цитируемого сообщения (у бота акцентный, потому отдельно от accentText) */\n replyTitle: TextStyle;\n /** Иконка статуса, лежит на фоне баббла */\n statusIcon: IconColor;\n /** Ссылка-действие: «Открыть», «Загрузить» */\n link: Pick<LinkProps, 'style' | 'mode'>;\n /** Иконка рядом со второстепенным текстом: лоадер загрузки файла */\n secondaryIcon: IconColor;\n /** Иконка файла */\n fileIcon: IconColor;\n /** Подложка под иконкой файла */\n fileIconBackground: TokenColorBackground;\n}\n\nconst COLORS: Record<ChatBubbleMode, ChatBubbleColors> = {\n incoming: {\n text: 'primary',\n secondaryText: 'secondary',\n activeReactionText: 'constant',\n accentText: 'accent',\n replyTitle: 'accent',\n statusIcon: 'secondary',\n link: { style: 'accent' },\n secondaryIcon: 'secondary',\n fileIcon: 'constant',\n fileIconBackground: 'accent',\n },\n outgoing: {\n text: 'constant',\n secondaryText: 'constant',\n activeReactionText: 'secondary',\n accentText: 'constant',\n replyTitle: 'constant',\n statusIcon: 'constant',\n link: { style: 'constant', mode: 'secondary' },\n secondaryIcon: 'constant',\n fileIcon: 'accent',\n fileIconBackground: 'accent-secondary',\n },\n bot: {\n text: 'primary',\n secondaryText: 'secondary',\n activeReactionText: 'constant',\n accentText: 'special',\n replyTitle: 'accent',\n statusIcon: 'special',\n link: { style: 'accent' },\n secondaryIcon: 'secondary',\n fileIcon: 'constant',\n fileIconBackground: 'special',\n },\n};\n\nexport const getColors = (mode: ChatBubbleMode): ChatBubbleColors => COLORS[mode];\n\n// Для подкомпонентов, которые сидят под mode провайдером\nexport const useChatBubbleColors = (): ChatBubbleColors => COLORS[useChatBubbleMode()];\n"],"names":[],"mappings":";;;AA8BA,MAAM,MAAmD,GAAA;AAAA,EACrD,QAAU,EAAA;AAAA,IACN,IAAM,EAAA,SAAA;AAAA,IACN,aAAe,EAAA,WAAA;AAAA,IACf,kBAAoB,EAAA,UAAA;AAAA,IACpB,UAAY,EAAA,QAAA;AAAA,IACZ,UAAY,EAAA,QAAA;AAAA,IACZ,UAAY,EAAA,WAAA;AAAA,IACZ,IAAA,EAAM,EAAE,KAAA,EAAO,QAAS,EAAA;AAAA,IACxB,aAAe,EAAA,WAAA;AAAA,IACf,QAAU,EAAA,UAAA;AAAA,IACV,kBAAoB,EAAA,QAAA;AAAA,GACxB;AAAA,EACA,QAAU,EAAA;AAAA,IACN,IAAM,EAAA,UAAA;AAAA,IACN,aAAe,EAAA,UAAA;AAAA,IACf,kBAAoB,EAAA,WAAA;AAAA,IACpB,UAAY,EAAA,UAAA;AAAA,IACZ,UAAY,EAAA,UAAA;AAAA,IACZ,UAAY,EAAA,UAAA;AAAA,IACZ,IAAM,EAAA,EAAE,KAAO,EAAA,UAAA,EAAY,MAAM,WAAY,EAAA;AAAA,IAC7C,aAAe,EAAA,UAAA;AAAA,IACf,QAAU,EAAA,QAAA;AAAA,IACV,kBAAoB,EAAA,kBAAA;AAAA,GACxB;AAAA,EACA,GAAK,EAAA;AAAA,IACD,IAAM,EAAA,SAAA;AAAA,IACN,aAAe,EAAA,WAAA;AAAA,IACf,kBAAoB,EAAA,UAAA;AAAA,IACpB,UAAY,EAAA,SAAA;AAAA,IACZ,UAAY,EAAA,QAAA;AAAA,IACZ,UAAY,EAAA,SAAA;AAAA,IACZ,IAAA,EAAM,EAAE,KAAA,EAAO,QAAS,EAAA;AAAA,IACxB,aAAe,EAAA,WAAA;AAAA,IACf,QAAU,EAAA,UAAA;AAAA,IACV,kBAAoB,EAAA,SAAA;AAAA,GACxB;AACJ,CAAA,CAAA;AAEO,MAAM,SAAY,GAAA,CAAC,IAA2C,KAAA,MAAA,CAAO,IAAI,EAAA;AAGzE,MAAM,mBAAsB,GAAA,MAAwB,MAAO,CAAA,iBAAA,EAAmB;;;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hh.ru/magritte-ui-chat-bubble",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.5.0",
|
|
4
4
|
"main": "index.js",
|
|
5
5
|
"types": "index.d.ts",
|
|
6
6
|
"sideEffects": [
|
|
@@ -27,18 +27,18 @@
|
|
|
27
27
|
"@hh.ru/magritte-common-mouse": "1.2.2",
|
|
28
28
|
"@hh.ru/magritte-common-use-multiple-refs": "1.1.13",
|
|
29
29
|
"@hh.ru/magritte-common-use-translation": "3.9.0",
|
|
30
|
-
"@hh.ru/magritte-design-tokens": "26.0.
|
|
31
|
-
"@hh.ru/magritte-ui-avatar": "8.4.
|
|
30
|
+
"@hh.ru/magritte-design-tokens": "26.0.3",
|
|
31
|
+
"@hh.ru/magritte-ui-avatar": "8.4.1",
|
|
32
32
|
"@hh.ru/magritte-ui-breakpoint": "6.1.3",
|
|
33
|
-
"@hh.ru/magritte-ui-button": "7.4.
|
|
34
|
-
"@hh.ru/magritte-ui-cell": "7.4.
|
|
35
|
-
"@hh.ru/magritte-ui-icon": "15.2.
|
|
36
|
-
"@hh.ru/magritte-ui-link": "7.3.
|
|
37
|
-
"@hh.ru/magritte-ui-loader": "4.2.
|
|
38
|
-
"@hh.ru/magritte-ui-menu": "1.1.
|
|
33
|
+
"@hh.ru/magritte-ui-button": "7.4.1",
|
|
34
|
+
"@hh.ru/magritte-ui-cell": "7.4.1",
|
|
35
|
+
"@hh.ru/magritte-ui-icon": "15.2.1",
|
|
36
|
+
"@hh.ru/magritte-ui-link": "7.3.1",
|
|
37
|
+
"@hh.ru/magritte-ui-loader": "4.2.1",
|
|
38
|
+
"@hh.ru/magritte-ui-menu": "1.1.7",
|
|
39
39
|
"@hh.ru/magritte-ui-mock-component": "1.1.9",
|
|
40
|
-
"@hh.ru/magritte-ui-tooltip": "11.1.
|
|
41
|
-
"@hh.ru/magritte-ui-typography": "5.3.
|
|
40
|
+
"@hh.ru/magritte-ui-tooltip": "11.1.1",
|
|
41
|
+
"@hh.ru/magritte-ui-typography": "5.3.18"
|
|
42
42
|
},
|
|
43
43
|
"peerDependencies": {
|
|
44
44
|
"classnames": ">=2.3.2",
|
|
@@ -47,5 +47,5 @@
|
|
|
47
47
|
"publishConfig": {
|
|
48
48
|
"access": "public"
|
|
49
49
|
},
|
|
50
|
-
"gitHead": "
|
|
50
|
+
"gitHead": "e7de6d815000917f83e54cd7b858522175d54bf6"
|
|
51
51
|
}
|
package/types.d.ts
CHANGED
|
@@ -52,7 +52,9 @@ export interface ChatBubbleProps extends Omit<HTMLAttributes<HTMLDivElement>, 'c
|
|
|
52
52
|
* - `ChatBubble.Message`
|
|
53
53
|
* - `ChatBubble.Media`
|
|
54
54
|
* - `ChatBubble.File`
|
|
55
|
+
* - `ChatBubble.Call`
|
|
55
56
|
* - `ChatBubble.Snippet`
|
|
57
|
+
* - `ChatBubble.Footer` (последним)
|
|
56
58
|
*/
|
|
57
59
|
children?: ReactNode;
|
|
58
60
|
/**
|
package/chat-bubble-5kPu0BCa.js
DELETED
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import './index.css';
|
|
2
|
-
var styles = {"chat-bubble":"magritte-chat-bubble___ds9CP_3-4-5","chatBubble":"magritte-chat-bubble___ds9CP_3-4-5","outgoing":"magritte-outgoing___3n00o_3-4-5","bot":"magritte-bot___Z6vZA_3-4-5","row":"magritte-row___mQNnt_3-4-5","with-buttons":"magritte-with-buttons___L-ZmQ_3-4-5","withButtons":"magritte-with-buttons___L-ZmQ_3-4-5","bubble":"magritte-bubble___NVuDI_3-4-5","with-tail":"magritte-with-tail___IdixJ_3-4-5","withTail":"magritte-with-tail___IdixJ_3-4-5","tail":"magritte-tail___E2hdk_3-4-5","tail-outgoing":"magritte-tail-outgoing___Pn3MI_3-4-5","tailOutgoing":"magritte-tail-outgoing___Pn3MI_3-4-5","with-avatar":"magritte-with-avatar___8kYWY_3-4-5","withAvatar":"magritte-with-avatar___8kYWY_3-4-5","avatar":"magritte-avatar___khWFX_3-4-5","buttons":"magritte-buttons___yQqBi_3-4-5","button-wide":"magritte-button-wide___QBqmM_3-4-5","buttonWide":"magritte-button-wide___QBqmM_3-4-5","aside":"magritte-aside___bTex-_3-4-5","aside-revealed":"magritte-aside-revealed___CRBl7_3-4-5","asideRevealed":"magritte-aside-revealed___CRBl7_3-4-5","error-text":"magritte-error-text___1ZxWY_3-4-5","errorText":"magritte-error-text___1ZxWY_3-4-5","file":"magritte-file___k2IKy_3-4-5","file-preview":"magritte-file-preview___eJKu8_3-4-5","filePreview":"magritte-file-preview___eJKu8_3-4-5","media":"magritte-media___9jH2k_3-4-5","media-blur":"magritte-media-blur___TbiMa_3-4-5","mediaBlur":"magritte-media-blur___TbiMa_3-4-5","media-image":"magritte-media-image___G-FkF_3-4-5","mediaImage":"magritte-media-image___G-FkF_3-4-5","media-content":"magritte-media-content___n3XbD_3-4-5","mediaContent":"magritte-media-content___n3XbD_3-4-5","media-format":"magritte-media-format___AdfCK_3-4-5","mediaFormat":"magritte-media-format___AdfCK_3-4-5","media-meta":"magritte-media-meta___oSxxr_3-4-5","mediaMeta":"magritte-media-meta___oSxxr_3-4-5","reply":"magritte-reply___-QCK7_3-4-5","reply-preview":"magritte-reply-preview___qvlNT_3-4-5","replyPreview":"magritte-reply-preview___qvlNT_3-4-5","reply-body":"magritte-reply-body___f2xx7_3-4-5","replyBody":"magritte-reply-body___f2xx7_3-4-5","snippet":"magritte-snippet___8k9xb_3-4-5","meta":"magritte-meta___1qhjm_3-4-5","edited":"magritte-edited___m-zmB_3-4-5","status":"magritte-status___dHzCt_3-4-5","message-title":"magritte-message-title___dgBFk_3-4-5","messageTitle":"magritte-message-title___dgBFk_3-4-5","label":"magritte-label___i0Wyt_3-4-5","message":"magritte-message___7TEpw_3-4-5"};
|
|
3
|
-
|
|
4
|
-
export { styles as s };
|
|
5
|
-
//# sourceMappingURL=chat-bubble-5kPu0BCa.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"chat-bubble-5kPu0BCa.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;"}
|