@hh.ru/magritte-ui-chat-bubble 3.1.2 → 3.1.3
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.js +5 -8
- package/ChatBubble.js.map +1 -1
- package/File.js +1 -1
- package/Label.js +1 -1
- package/Media.js +1 -1
- package/Message.js +1 -1
- package/Meta.js +1 -1
- package/Reply.js +1 -1
- package/Snippet.js +1 -1
- package/Status.js +1 -1
- package/Tail.js +1 -1
- package/buttonDefaults.d.ts +32 -0
- package/buttonDefaults.js +9 -0
- package/buttonDefaults.js.map +1 -0
- package/chat-bubble-CUmiTK7p.js +5 -0
- package/chat-bubble-CUmiTK7p.js.map +1 -0
- package/index.css +63 -63
- package/index.js +2 -1
- package/index.js.map +1 -1
- package/internal/colors.d.ts +0 -3
- package/internal/colors.js +0 -3
- package/internal/colors.js.map +1 -1
- package/package.json +8 -4
- package/chat-bubble-XuR5t6Q_.js +0 -5
- package/chat-bubble-XuR5t6Q_.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-CUmiTK7p.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-CUmiTK7p.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.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import './index.css';
|
|
2
2
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
3
|
-
import { forwardRef, useRef, useState, useCallback,
|
|
3
|
+
import { forwardRef, useRef, useState, useCallback, cloneElement } from 'react';
|
|
4
4
|
import classnames from 'classnames';
|
|
5
5
|
import { useCloseByClickOutside } from '@hh.ru/magritte-common-mouse';
|
|
6
6
|
import { ButtonDefaultPropsContext } from '@hh.ru/magritte-ui-button';
|
|
@@ -16,15 +16,16 @@ import { ChatBubbleReply } from './Reply.js';
|
|
|
16
16
|
import { ChatBubbleSnippet } from './Snippet.js';
|
|
17
17
|
import { ChatBubbleStatus } from './Status.js';
|
|
18
18
|
import { Tail } from './Tail.js';
|
|
19
|
-
import {
|
|
19
|
+
import { CHAT_BUBBLE_BUTTON_DEFAULTS } from './buttonDefaults.js';
|
|
20
20
|
import { ChatBubbleErrorMenuProvider } from './internal/errorMenu.js';
|
|
21
21
|
import { ChatBubbleModeProvider } from './internal/mode.js';
|
|
22
22
|
import { flattenFragments, isMetaHost } from './internal/utils.js';
|
|
23
23
|
import { ExclamationCircleFilledSize24 } from '@hh.ru/magritte-ui-icon/icon';
|
|
24
24
|
import { Menu } from '@hh.ru/magritte-ui-menu';
|
|
25
25
|
import { Text } from '@hh.ru/magritte-ui-typography';
|
|
26
|
-
import { s as styles } from './chat-bubble-
|
|
26
|
+
import { s as styles } from './chat-bubble-CUmiTK7p.js';
|
|
27
27
|
import '@hh.ru/magritte-ui-cell';
|
|
28
|
+
import './internal/colors.js';
|
|
28
29
|
import '@hh.ru/magritte-ui-link';
|
|
29
30
|
import '@hh.ru/magritte-ui-loader';
|
|
30
31
|
import '@hh.ru/magritte-common-use-translation';
|
|
@@ -56,11 +57,7 @@ const ChatBubble = forwardRef(
|
|
|
56
57
|
const showAside = useCallback(() => setAsideShow(true), []);
|
|
57
58
|
const hideAside = useCallback(() => setAsideShow(false), []);
|
|
58
59
|
useCloseByClickOutside(rowRef, hideAside, asideShow);
|
|
59
|
-
const
|
|
60
|
-
const buttonsProps = useMemo(
|
|
61
|
-
() => ({ size: "small", stretched: true, ...colors.button }),
|
|
62
|
-
[colors]
|
|
63
|
-
);
|
|
60
|
+
const buttonsProps = CHAT_BUBBLE_BUTTON_DEFAULTS[mode];
|
|
64
61
|
const meta = /* @__PURE__ */ jsx(Meta, { mode, status, time, edited });
|
|
65
62
|
const items = flattenFragments(children);
|
|
66
63
|
const lastIndex = items.length - 1;
|
package/ChatBubble.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ChatBubble.js","sources":["src/ChatBubble.tsx"],"sourcesContent":["import { cloneElement, forwardRef, useCallback, useState, useMemo, useRef } from 'react';\nimport classnames from 'classnames';\n\nimport { useCloseByClickOutside } from '@hh.ru/magritte-common-mouse';\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 { getColors } from '@hh.ru/magritte-ui-chat-bubble/internal/colors';\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 { 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\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 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 colors = getColors(mode);\n const buttonsProps: Partial<ButtonProps> = useMemo(\n () => ({ size: 'small', stretched: true, ...colors.button }),\n [colors]\n );\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 })}\n data-qa={dataQa}\n ref={ref}\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":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAyCO,MAAM,UAAa,GAAA,UAAA;AAAA,EACtB,CACI;AAAA,IACI,KAAA;AAAA,IACA,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,GAA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,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 { 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 { 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\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 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 /**\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 })}\n data-qa={dataQa}\n ref={ref}\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":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAyCO,MAAM,UAAa,GAAA,UAAA;AAAA,EACtB,CACI;AAAA,IACI,KAAA;AAAA,IACA,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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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;;;;"}
|
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-CUmiTK7p.js';
|
|
11
11
|
import './internal/mode.js';
|
|
12
12
|
|
|
13
13
|
const ChatBubbleFileComponent = forwardRef(
|
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-CUmiTK7p.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-CUmiTK7p.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-CUmiTK7p.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-CUmiTK7p.js';
|
|
7
7
|
import './internal/mode.js';
|
|
8
8
|
import 'react';
|
|
9
9
|
|
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-CUmiTK7p.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-CUmiTK7p.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-CUmiTK7p.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-CUmiTK7p.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,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Пропы, которые ChatBubble сам проставляет кнопкам в слоте `buttons` (через `ButtonDefaultPropsContext`).
|
|
3
|
+
*
|
|
4
|
+
* Вынесено отдельным модулем не ради переиспользования в рантайме — читатель там один. Второй читатель —
|
|
5
|
+
* Code Connect-шаблоны пакета (`figma/*`): они объявляют эти же значения контекстом для вложенных кнопок, чтобы
|
|
6
|
+
* сниппет не повторял проп, который компонент и так подставляет. Значение, скопированное в шаблон литералом,
|
|
7
|
+
* разъезжается молча: поменяли здесь — сниппет продолжает публиковать прежнее, и ни сборка, ни рендер об этом
|
|
8
|
+
* не скажут.
|
|
9
|
+
*
|
|
10
|
+
* Модуль обязан оставаться чистыми данными без импортов рантайма (React, стили): шаблон инлайнится сборщиком,
|
|
11
|
+
* и всё, что сюда попадёт, поедет в бандл каждого энтри.
|
|
12
|
+
*/
|
|
13
|
+
export declare const CHAT_BUBBLE_BUTTON_DEFAULTS: {
|
|
14
|
+
readonly incoming: {
|
|
15
|
+
readonly size: 'small';
|
|
16
|
+
readonly stretched: true;
|
|
17
|
+
readonly mode: 'secondary';
|
|
18
|
+
readonly style: 'neutral';
|
|
19
|
+
};
|
|
20
|
+
readonly outgoing: {
|
|
21
|
+
readonly size: 'small';
|
|
22
|
+
readonly stretched: true;
|
|
23
|
+
readonly mode: 'primary';
|
|
24
|
+
readonly style: 'accent';
|
|
25
|
+
};
|
|
26
|
+
readonly bot: {
|
|
27
|
+
readonly size: 'small';
|
|
28
|
+
readonly stretched: true;
|
|
29
|
+
readonly mode: 'secondary';
|
|
30
|
+
readonly style: 'special';
|
|
31
|
+
};
|
|
32
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import './index.css';
|
|
2
|
+
const CHAT_BUBBLE_BUTTON_DEFAULTS = {
|
|
3
|
+
incoming: { size: "small", stretched: true, mode: "secondary", style: "neutral" },
|
|
4
|
+
outgoing: { size: "small", stretched: true, mode: "primary", style: "accent" },
|
|
5
|
+
bot: { size: "small", stretched: true, mode: "secondary", style: "special" }
|
|
6
|
+
};
|
|
7
|
+
|
|
8
|
+
export { CHAT_BUBBLE_BUTTON_DEFAULTS };
|
|
9
|
+
//# sourceMappingURL=buttonDefaults.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"buttonDefaults.js","sources":["src/buttonDefaults.ts"],"sourcesContent":["/**\n * Пропы, которые ChatBubble сам проставляет кнопкам в слоте `buttons` (через `ButtonDefaultPropsContext`).\n *\n * Вынесено отдельным модулем не ради переиспользования в рантайме — читатель там один. Второй читатель —\n * Code Connect-шаблоны пакета (`figma/*`): они объявляют эти же значения контекстом для вложенных кнопок, чтобы\n * сниппет не повторял проп, который компонент и так подставляет. Значение, скопированное в шаблон литералом,\n * разъезжается молча: поменяли здесь — сниппет продолжает публиковать прежнее, и ни сборка, ни рендер об этом\n * не скажут.\n *\n * Модуль обязан оставаться чистыми данными без импортов рантайма (React, стили): шаблон инлайнится сборщиком,\n * и всё, что сюда попадёт, поедет в бандл каждого энтри.\n */\nexport const CHAT_BUBBLE_BUTTON_DEFAULTS = {\n incoming: { size: 'small', stretched: true, mode: 'secondary', style: 'neutral' },\n outgoing: { size: 'small', stretched: true, mode: 'primary', style: 'accent' },\n bot: { size: 'small', stretched: true, mode: 'secondary', style: 'special' },\n} as const;\n"],"names":[],"mappings":"AAYO,MAAM,2BAA8B,GAAA;AAAA,EACvC,QAAA,EAAU,EAAE,IAAM,EAAA,OAAA,EAAS,WAAW,IAAM,EAAA,IAAA,EAAM,WAAa,EAAA,KAAA,EAAO,SAAU,EAAA;AAAA,EAChF,QAAA,EAAU,EAAE,IAAM,EAAA,OAAA,EAAS,WAAW,IAAM,EAAA,IAAA,EAAM,SAAW,EAAA,KAAA,EAAO,QAAS,EAAA;AAAA,EAC7E,GAAA,EAAK,EAAE,IAAM,EAAA,OAAA,EAAS,WAAW,IAAM,EAAA,IAAA,EAAM,WAAa,EAAA,KAAA,EAAO,SAAU,EAAA;AAC/E;;;;"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import './index.css';
|
|
2
|
+
var styles = {"chat-bubble":"magritte-chat-bubble___ds9CP_3-1-3","chatBubble":"magritte-chat-bubble___ds9CP_3-1-3","outgoing":"magritte-outgoing___3n00o_3-1-3","bot":"magritte-bot___Z6vZA_3-1-3","row":"magritte-row___mQNnt_3-1-3","with-buttons":"magritte-with-buttons___L-ZmQ_3-1-3","withButtons":"magritte-with-buttons___L-ZmQ_3-1-3","bubble":"magritte-bubble___NVuDI_3-1-3","with-tail":"magritte-with-tail___IdixJ_3-1-3","withTail":"magritte-with-tail___IdixJ_3-1-3","tail":"magritte-tail___E2hdk_3-1-3","tail-outgoing":"magritte-tail-outgoing___Pn3MI_3-1-3","tailOutgoing":"magritte-tail-outgoing___Pn3MI_3-1-3","buttons":"magritte-buttons___yQqBi_3-1-3","button-wide":"magritte-button-wide___QBqmM_3-1-3","buttonWide":"magritte-button-wide___QBqmM_3-1-3","aside":"magritte-aside___bTex-_3-1-3","aside-revealed":"magritte-aside-revealed___CRBl7_3-1-3","asideRevealed":"magritte-aside-revealed___CRBl7_3-1-3","error-text":"magritte-error-text___1ZxWY_3-1-3","errorText":"magritte-error-text___1ZxWY_3-1-3","file":"magritte-file___k2IKy_3-1-3","file-preview":"magritte-file-preview___eJKu8_3-1-3","filePreview":"magritte-file-preview___eJKu8_3-1-3","media":"magritte-media___9jH2k_3-1-3","media-blur":"magritte-media-blur___TbiMa_3-1-3","mediaBlur":"magritte-media-blur___TbiMa_3-1-3","media-image":"magritte-media-image___G-FkF_3-1-3","mediaImage":"magritte-media-image___G-FkF_3-1-3","media-content":"magritte-media-content___n3XbD_3-1-3","mediaContent":"magritte-media-content___n3XbD_3-1-3","media-format":"magritte-media-format___AdfCK_3-1-3","mediaFormat":"magritte-media-format___AdfCK_3-1-3","media-meta":"magritte-media-meta___oSxxr_3-1-3","mediaMeta":"magritte-media-meta___oSxxr_3-1-3","reply":"magritte-reply___-QCK7_3-1-3","reply-preview":"magritte-reply-preview___qvlNT_3-1-3","replyPreview":"magritte-reply-preview___qvlNT_3-1-3","reply-body":"magritte-reply-body___f2xx7_3-1-3","replyBody":"magritte-reply-body___f2xx7_3-1-3","snippet":"magritte-snippet___8k9xb_3-1-3","meta":"magritte-meta___1qhjm_3-1-3","edited":"magritte-edited___m-zmB_3-1-3","status":"magritte-status___dHzCt_3-1-3","message-title":"magritte-message-title___dgBFk_3-1-3","messageTitle":"magritte-message-title___dgBFk_3-1-3","label":"magritte-label___i0Wyt_3-1-3","message":"magritte-message___7TEpw_3-1-3"};
|
|
3
|
+
|
|
4
|
+
export { styles as s };
|
|
5
|
+
//# sourceMappingURL=chat-bubble-CUmiTK7p.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chat-bubble-CUmiTK7p.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;"}
|
package/index.css
CHANGED
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
--magritte-color-component-chat-bubble-snippet-background-outgoing-v26-0-2:#90ACC1;
|
|
39
39
|
--magritte-color-component-chat-bubble-snippet-line-incoming-v26-0-2:#557B96;
|
|
40
40
|
}
|
|
41
|
-
.magritte-chat-bubble___ds9CP_3-1-
|
|
41
|
+
.magritte-chat-bubble___ds9CP_3-1-3{
|
|
42
42
|
--magritte-chat-bubble-background:var(--magritte-color-component-chat-bubble-background-incoming-v26-0-2);
|
|
43
43
|
--magritte-chat-bubble-border:var(--magritte-color-component-chat-bubble-border-incoming-v26-0-2);
|
|
44
44
|
--magritte-chat-bubble-snippet-background:var(--magritte-color-component-chat-bubble-snippet-background-incoming-v26-0-2);
|
|
@@ -48,7 +48,7 @@
|
|
|
48
48
|
align-items:flex-start;
|
|
49
49
|
max-width:min(460px, calc(100% - 40px));
|
|
50
50
|
}
|
|
51
|
-
.magritte-outgoing___3n00o_3-1-
|
|
51
|
+
.magritte-outgoing___3n00o_3-1-3{
|
|
52
52
|
--magritte-chat-bubble-background:var(--magritte-color-component-chat-bubble-background-outgoing-v26-0-2);
|
|
53
53
|
--magritte-chat-bubble-border:var(--magritte-color-component-chat-bubble-border-outgoing-v26-0-2);
|
|
54
54
|
--magritte-chat-bubble-snippet-background:var(--magritte-color-component-chat-bubble-snippet-background-outgoing-v26-0-2);
|
|
@@ -56,26 +56,26 @@
|
|
|
56
56
|
align-items:flex-end;
|
|
57
57
|
margin-left:auto;
|
|
58
58
|
}
|
|
59
|
-
.magritte-bot___Z6vZA_3-1-
|
|
59
|
+
.magritte-bot___Z6vZA_3-1-3{
|
|
60
60
|
--magritte-chat-bubble-background:var(--magritte-color-component-chat-bubble-background-bot-v26-0-2);
|
|
61
61
|
--magritte-chat-bubble-border:var(--magritte-color-component-chat-bubble-border-bot-v26-0-2);
|
|
62
62
|
--magritte-chat-bubble-snippet-background:var(--magritte-color-component-chat-bubble-snippet-background-bot-v26-0-2);
|
|
63
63
|
--magritte-chat-bubble-snippet-line:var(--magritte-color-component-chat-bubble-snippet-line-bot-v26-0-2);
|
|
64
64
|
}
|
|
65
|
-
.magritte-row___mQNnt_3-1-
|
|
65
|
+
.magritte-row___mQNnt_3-1-3{
|
|
66
66
|
display:flex;
|
|
67
67
|
position:relative;
|
|
68
68
|
align-items:flex-end;
|
|
69
69
|
gap:8px;
|
|
70
70
|
max-width:100%;
|
|
71
71
|
}
|
|
72
|
-
.magritte-with-buttons___L-ZmQ_3-1-
|
|
72
|
+
.magritte-with-buttons___L-ZmQ_3-1-3 .magritte-row___mQNnt_3-1-3{
|
|
73
73
|
align-self:stretch;
|
|
74
74
|
}
|
|
75
|
-
.magritte-with-buttons___L-ZmQ_3-1-
|
|
75
|
+
.magritte-with-buttons___L-ZmQ_3-1-3 .magritte-bubble___NVuDI_3-1-3{
|
|
76
76
|
flex-grow:1;
|
|
77
77
|
}
|
|
78
|
-
.magritte-bubble___NVuDI_3-1-
|
|
78
|
+
.magritte-bubble___NVuDI_3-1-3{
|
|
79
79
|
position:relative;
|
|
80
80
|
box-sizing:border-box;
|
|
81
81
|
min-width:0;
|
|
@@ -86,34 +86,34 @@
|
|
|
86
86
|
border-radius:20px;
|
|
87
87
|
overflow-wrap:break-word;
|
|
88
88
|
}
|
|
89
|
-
.magritte-with-tail___IdixJ_3-1-
|
|
89
|
+
.magritte-with-tail___IdixJ_3-1-3 .magritte-bubble___NVuDI_3-1-3{
|
|
90
90
|
border-bottom-left-radius:0;
|
|
91
91
|
}
|
|
92
|
-
.magritte-with-tail___IdixJ_3-1-
|
|
92
|
+
.magritte-with-tail___IdixJ_3-1-3.magritte-outgoing___3n00o_3-1-3 .magritte-bubble___NVuDI_3-1-3{
|
|
93
93
|
border-bottom-left-radius:20px;
|
|
94
94
|
border-bottom-right-radius:0;
|
|
95
95
|
}
|
|
96
|
-
.magritte-tail___E2hdk_3-1-
|
|
96
|
+
.magritte-tail___E2hdk_3-1-3{
|
|
97
97
|
position:absolute;
|
|
98
98
|
bottom:-1px;
|
|
99
99
|
left:-7px;
|
|
100
100
|
}
|
|
101
|
-
.magritte-tail-outgoing___Pn3MI_3-1-
|
|
101
|
+
.magritte-tail-outgoing___Pn3MI_3-1-3{
|
|
102
102
|
left:auto;
|
|
103
103
|
right:-7px;
|
|
104
104
|
transform:scaleX(-1);
|
|
105
105
|
}
|
|
106
|
-
.magritte-buttons___yQqBi_3-1-
|
|
106
|
+
.magritte-buttons___yQqBi_3-1-3{
|
|
107
107
|
display:grid;
|
|
108
108
|
grid-template-columns:repeat(2, minmax(0, 1fr));
|
|
109
109
|
gap:8px;
|
|
110
110
|
width:100%;
|
|
111
111
|
margin-top:4px;
|
|
112
112
|
}
|
|
113
|
-
.magritte-button-wide___QBqmM_3-1-
|
|
113
|
+
.magritte-button-wide___QBqmM_3-1-3{
|
|
114
114
|
grid-column:span 2;
|
|
115
115
|
}
|
|
116
|
-
.magritte-aside___bTex-_3-1-
|
|
116
|
+
.magritte-aside___bTex-_3-1-3{
|
|
117
117
|
display:flex;
|
|
118
118
|
position:absolute;
|
|
119
119
|
top:0;
|
|
@@ -124,30 +124,30 @@
|
|
|
124
124
|
opacity:0;
|
|
125
125
|
transition:opacity var(--magritte-semantic-animation-time-s-duration-v26-0-2) ease-in-out;
|
|
126
126
|
}
|
|
127
|
-
.magritte-aside-revealed___CRBl7_3-1-
|
|
127
|
+
.magritte-aside-revealed___CRBl7_3-1-3{
|
|
128
128
|
opacity:1;
|
|
129
129
|
}
|
|
130
|
-
.magritte-outgoing___3n00o_3-1-
|
|
130
|
+
.magritte-outgoing___3n00o_3-1-3 .magritte-aside___bTex-_3-1-3{
|
|
131
131
|
left:auto;
|
|
132
132
|
right:100%;
|
|
133
133
|
padding-right:8px;
|
|
134
134
|
padding-left:0;
|
|
135
135
|
}
|
|
136
|
-
.magritte-error-text___1ZxWY_3-1-
|
|
136
|
+
.magritte-error-text___1ZxWY_3-1-3{
|
|
137
137
|
margin-top:2px;
|
|
138
138
|
}
|
|
139
|
-
.magritte-file___k2IKy_3-1-
|
|
139
|
+
.magritte-file___k2IKy_3-1-3{
|
|
140
140
|
display:flex;
|
|
141
141
|
align-items:flex-end;
|
|
142
142
|
}
|
|
143
|
-
.magritte-file-preview___eJKu8_3-1-
|
|
143
|
+
.magritte-file-preview___eJKu8_3-1-3{
|
|
144
144
|
display:block;
|
|
145
145
|
width:48px;
|
|
146
146
|
height:48px;
|
|
147
147
|
border-radius:8px;
|
|
148
148
|
object-fit:cover;
|
|
149
149
|
}
|
|
150
|
-
.magritte-media___9jH2k_3-1-
|
|
150
|
+
.magritte-media___9jH2k_3-1-3{
|
|
151
151
|
display:flex;
|
|
152
152
|
position:relative;
|
|
153
153
|
box-sizing:border-box;
|
|
@@ -159,7 +159,7 @@
|
|
|
159
159
|
overflow:hidden;
|
|
160
160
|
box-shadow:inset 0 0 0 1px var(--magritte-color-component-chat-bubble-border-image-v26-0-2);
|
|
161
161
|
}
|
|
162
|
-
.magritte-media-blur___TbiMa_3-1-
|
|
162
|
+
.magritte-media-blur___TbiMa_3-1-3{
|
|
163
163
|
position:absolute;
|
|
164
164
|
top:-96px;
|
|
165
165
|
left:-96px;
|
|
@@ -169,7 +169,7 @@
|
|
|
169
169
|
filter:blur(48px);
|
|
170
170
|
object-fit:cover;
|
|
171
171
|
}
|
|
172
|
-
.magritte-media-image___G-FkF_3-1-
|
|
172
|
+
.magritte-media-image___G-FkF_3-1-3{
|
|
173
173
|
display:block;
|
|
174
174
|
position:relative;
|
|
175
175
|
height:auto;
|
|
@@ -179,23 +179,23 @@
|
|
|
179
179
|
object-fit:contain;
|
|
180
180
|
}
|
|
181
181
|
@media (min-width: 1020px){
|
|
182
|
-
body.magritte-old-layout .magritte-media-image___G-FkF_3-1-
|
|
182
|
+
body.magritte-old-layout .magritte-media-image___G-FkF_3-1-3{
|
|
183
183
|
max-height:452px;
|
|
184
184
|
}
|
|
185
185
|
}
|
|
186
186
|
@media (min-width: 1024px){
|
|
187
|
-
body:not(.magritte-old-layout) .magritte-media-image___G-FkF_3-1-
|
|
187
|
+
body:not(.magritte-old-layout) .magritte-media-image___G-FkF_3-1-3{
|
|
188
188
|
max-height:452px;
|
|
189
189
|
}
|
|
190
190
|
}
|
|
191
|
-
.magritte-media-content___n3XbD_3-1-
|
|
191
|
+
.magritte-media-content___n3XbD_3-1-3{
|
|
192
192
|
display:flex;
|
|
193
193
|
position:absolute;
|
|
194
194
|
inset:0;
|
|
195
195
|
align-items:center;
|
|
196
196
|
justify-content:center;
|
|
197
197
|
}
|
|
198
|
-
.magritte-media-format___AdfCK_3-1-
|
|
198
|
+
.magritte-media-format___AdfCK_3-1-3{
|
|
199
199
|
display:flex;
|
|
200
200
|
position:absolute;
|
|
201
201
|
padding:2px 8px;
|
|
@@ -205,7 +205,7 @@
|
|
|
205
205
|
top:4px;
|
|
206
206
|
left:4px;
|
|
207
207
|
}
|
|
208
|
-
.magritte-media-meta___oSxxr_3-1-
|
|
208
|
+
.magritte-media-meta___oSxxr_3-1-3{
|
|
209
209
|
--magritte-ui-text-color-override:var(--magritte-color-text-constant-v26-0-2);
|
|
210
210
|
display:flex;
|
|
211
211
|
position:absolute;
|
|
@@ -217,14 +217,14 @@
|
|
|
217
217
|
bottom:4px;
|
|
218
218
|
align-items:center;
|
|
219
219
|
}
|
|
220
|
-
.magritte-media-meta___oSxxr_3-1-
|
|
221
|
-
.magritte-media-meta___oSxxr_3-1-
|
|
220
|
+
.magritte-media-meta___oSxxr_3-1-3:empty,
|
|
221
|
+
.magritte-media-meta___oSxxr_3-1-3:has(> :empty){
|
|
222
222
|
display:none;
|
|
223
223
|
}
|
|
224
|
-
.magritte-media-meta___oSxxr_3-1-
|
|
224
|
+
.magritte-media-meta___oSxxr_3-1-3 > span{
|
|
225
225
|
margin-left:0;
|
|
226
226
|
}
|
|
227
|
-
.magritte-reply___-QCK7_3-1-
|
|
227
|
+
.magritte-reply___-QCK7_3-1-3{
|
|
228
228
|
display:flex;
|
|
229
229
|
position:relative;
|
|
230
230
|
padding:8px;
|
|
@@ -235,7 +235,7 @@
|
|
|
235
235
|
align-items:center;
|
|
236
236
|
gap:8px;
|
|
237
237
|
}
|
|
238
|
-
.magritte-reply___-QCK7_3-1-
|
|
238
|
+
.magritte-reply___-QCK7_3-1-3::before{
|
|
239
239
|
content:'';
|
|
240
240
|
position:absolute;
|
|
241
241
|
top:0;
|
|
@@ -244,7 +244,7 @@
|
|
|
244
244
|
width:4px;
|
|
245
245
|
background-color:var(--magritte-chat-bubble-snippet-line);
|
|
246
246
|
}
|
|
247
|
-
.magritte-reply-preview___qvlNT_3-1-
|
|
247
|
+
.magritte-reply-preview___qvlNT_3-1-3{
|
|
248
248
|
display:block;
|
|
249
249
|
flex-shrink:0;
|
|
250
250
|
width:40px;
|
|
@@ -254,12 +254,12 @@
|
|
|
254
254
|
outline-offset:-1px;
|
|
255
255
|
object-fit:cover;
|
|
256
256
|
}
|
|
257
|
-
.magritte-reply-body___f2xx7_3-1-
|
|
257
|
+
.magritte-reply-body___f2xx7_3-1-3{
|
|
258
258
|
display:flex;
|
|
259
259
|
flex-direction:column;
|
|
260
260
|
min-width:0;
|
|
261
261
|
}
|
|
262
|
-
.magritte-snippet___8k9xb_3-1-
|
|
262
|
+
.magritte-snippet___8k9xb_3-1-3{
|
|
263
263
|
display:flex;
|
|
264
264
|
position:relative;
|
|
265
265
|
padding:8px;
|
|
@@ -270,7 +270,7 @@
|
|
|
270
270
|
flex-direction:column;
|
|
271
271
|
gap:2px;
|
|
272
272
|
}
|
|
273
|
-
.magritte-snippet___8k9xb_3-1-
|
|
273
|
+
.magritte-snippet___8k9xb_3-1-3::before{
|
|
274
274
|
content:'';
|
|
275
275
|
position:absolute;
|
|
276
276
|
top:0;
|
|
@@ -279,7 +279,7 @@
|
|
|
279
279
|
width:4px;
|
|
280
280
|
background-color:var(--magritte-chat-bubble-snippet-line);
|
|
281
281
|
}
|
|
282
|
-
.magritte-snippet___8k9xb_3-1-
|
|
282
|
+
.magritte-snippet___8k9xb_3-1-3 img{
|
|
283
283
|
display:block;
|
|
284
284
|
max-width:100%;
|
|
285
285
|
border-radius:4px;
|
|
@@ -287,7 +287,7 @@
|
|
|
287
287
|
outline-offset:-1px;
|
|
288
288
|
margin-top:6px;
|
|
289
289
|
}
|
|
290
|
-
.magritte-meta___1qhjm_3-1-
|
|
290
|
+
.magritte-meta___1qhjm_3-1-3{
|
|
291
291
|
float:right;
|
|
292
292
|
margin-left:12px;
|
|
293
293
|
white-space:nowrap;
|
|
@@ -300,53 +300,53 @@
|
|
|
300
300
|
text-transform:none;
|
|
301
301
|
text-decoration:none;
|
|
302
302
|
}
|
|
303
|
-
.magritte-edited___m-zmB_3-1-
|
|
303
|
+
.magritte-edited___m-zmB_3-1-3{
|
|
304
304
|
margin-right:4px;
|
|
305
305
|
}
|
|
306
|
-
.magritte-status___dHzCt_3-1-
|
|
306
|
+
.magritte-status___dHzCt_3-1-3{
|
|
307
307
|
display:inline-flex;
|
|
308
308
|
vertical-align:middle;
|
|
309
309
|
}
|
|
310
|
-
.magritte-status___dHzCt_3-1-
|
|
310
|
+
.magritte-status___dHzCt_3-1-3:not(:first-child){
|
|
311
311
|
margin-left:4px;
|
|
312
312
|
}
|
|
313
|
-
.magritte-message-title___dgBFk_3-1-
|
|
313
|
+
.magritte-message-title___dgBFk_3-1-3{
|
|
314
314
|
margin-bottom:4px;
|
|
315
315
|
}
|
|
316
|
-
.magritte-label___i0Wyt_3-1-
|
|
317
|
-
.magritte-label___i0Wyt_3-1-
|
|
318
|
-
.magritte-label___i0Wyt_3-1-
|
|
319
|
-
.magritte-message___7TEpw_3-1-
|
|
320
|
-
.magritte-bubble___NVuDI_3-1-
|
|
316
|
+
.magritte-label___i0Wyt_3-1-3 + .magritte-media___9jH2k_3-1-3,
|
|
317
|
+
.magritte-label___i0Wyt_3-1-3 + .magritte-message___7TEpw_3-1-3,
|
|
318
|
+
.magritte-label___i0Wyt_3-1-3 + .magritte-snippet___8k9xb_3-1-3,
|
|
319
|
+
.magritte-message___7TEpw_3-1-3 + .magritte-message___7TEpw_3-1-3,
|
|
320
|
+
.magritte-bubble___NVuDI_3-1-3 > .magritte-meta___1qhjm_3-1-3{
|
|
321
321
|
margin-top:4px;
|
|
322
322
|
}
|
|
323
|
-
.magritte-label___i0Wyt_3-1-
|
|
324
|
-
.magritte-reply___-QCK7_3-1-
|
|
325
|
-
.magritte-reply___-QCK7_3-1-
|
|
326
|
-
.magritte-reply___-QCK7_3-1-
|
|
327
|
-
.magritte-media___9jH2k_3-1-
|
|
323
|
+
.magritte-label___i0Wyt_3-1-3 + .magritte-reply___-QCK7_3-1-3,
|
|
324
|
+
.magritte-reply___-QCK7_3-1-3 + .magritte-media___9jH2k_3-1-3,
|
|
325
|
+
.magritte-reply___-QCK7_3-1-3 + .magritte-message___7TEpw_3-1-3,
|
|
326
|
+
.magritte-reply___-QCK7_3-1-3 + .magritte-snippet___8k9xb_3-1-3,
|
|
327
|
+
.magritte-media___9jH2k_3-1-3 + .magritte-snippet___8k9xb_3-1-3{
|
|
328
328
|
margin-top:8px;
|
|
329
329
|
}
|
|
330
|
-
.magritte-label___i0Wyt_3-1-
|
|
331
|
-
.magritte-reply___-QCK7_3-1-
|
|
332
|
-
.magritte-media___9jH2k_3-1-
|
|
333
|
-
.magritte-media___9jH2k_3-1-
|
|
334
|
-
.magritte-file___k2IKy_3-1-
|
|
335
|
-
.magritte-file___k2IKy_3-1-
|
|
330
|
+
.magritte-label___i0Wyt_3-1-3 + .magritte-file___k2IKy_3-1-3,
|
|
331
|
+
.magritte-reply___-QCK7_3-1-3 + .magritte-file___k2IKy_3-1-3,
|
|
332
|
+
.magritte-media___9jH2k_3-1-3 + .magritte-file___k2IKy_3-1-3,
|
|
333
|
+
.magritte-media___9jH2k_3-1-3 + .magritte-message___7TEpw_3-1-3,
|
|
334
|
+
.magritte-file___k2IKy_3-1-3 + .magritte-message___7TEpw_3-1-3,
|
|
335
|
+
.magritte-file___k2IKy_3-1-3 + .magritte-snippet___8k9xb_3-1-3{
|
|
336
336
|
margin-top:12px;
|
|
337
337
|
}
|
|
338
|
-
.magritte-message___7TEpw_3-1-
|
|
338
|
+
.magritte-message___7TEpw_3-1-3 + .magritte-snippet___8k9xb_3-1-3{
|
|
339
339
|
margin-top:16px;
|
|
340
340
|
}
|
|
341
|
-
.magritte-file___k2IKy_3-1-
|
|
341
|
+
.magritte-file___k2IKy_3-1-3 + .magritte-file___k2IKy_3-1-3{
|
|
342
342
|
margin-top:24px;
|
|
343
343
|
}
|
|
344
|
-
.magritte-label___i0Wyt_3-1-
|
|
344
|
+
.magritte-label___i0Wyt_3-1-3{
|
|
345
345
|
margin-top:-4px;
|
|
346
346
|
}
|
|
347
|
-
.magritte-bubble___NVuDI_3-1-
|
|
347
|
+
.magritte-bubble___NVuDI_3-1-3 > .magritte-media___9jH2k_3-1-3:first-child{
|
|
348
348
|
margin-top:-8px;
|
|
349
349
|
}
|
|
350
|
-
.magritte-bubble___NVuDI_3-1-
|
|
350
|
+
.magritte-bubble___NVuDI_3-1-3 > .magritte-media___9jH2k_3-1-3:not(:has( ~ :not(.magritte-tail___E2hdk_3-1-3))){
|
|
351
351
|
margin-bottom:-8px;
|
|
352
352
|
}
|
package/index.js
CHANGED
|
@@ -6,7 +6,7 @@ import 'classnames';
|
|
|
6
6
|
import '@hh.ru/magritte-common-mouse';
|
|
7
7
|
import '@hh.ru/magritte-ui-button';
|
|
8
8
|
import './Button.js';
|
|
9
|
-
import './chat-bubble-
|
|
9
|
+
import './chat-bubble-CUmiTK7p.js';
|
|
10
10
|
import './Call.js';
|
|
11
11
|
import '@hh.ru/magritte-ui-cell';
|
|
12
12
|
import './internal/colors.js';
|
|
@@ -31,4 +31,5 @@ import './Status.js';
|
|
|
31
31
|
import '@hh.ru/magritte-common-use-multiple-refs';
|
|
32
32
|
import '@hh.ru/magritte-ui-tooltip';
|
|
33
33
|
import './Tail.js';
|
|
34
|
+
import './buttonDefaults.js';
|
|
34
35
|
//# sourceMappingURL=index.js.map
|
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/internal/colors.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import type { TokenColorBackground } from '@hh.ru/magritte-design-tokens/types';
|
|
2
|
-
import type { ButtonProps } from '@hh.ru/magritte-ui-button';
|
|
3
2
|
import type { ChatBubbleMode } from '../types';
|
|
4
3
|
import type { IconColor } from '@hh.ru/magritte-ui-icon';
|
|
5
4
|
import type { LinkProps } from '@hh.ru/magritte-ui-link';
|
|
@@ -15,8 +14,6 @@ export interface ChatBubbleColors {
|
|
|
15
14
|
replyTitle: TextStyle;
|
|
16
15
|
/** Иконка статуса, лежит на фоне баббла */
|
|
17
16
|
statusIcon: IconColor;
|
|
18
|
-
/** Кнопки под бабблом */
|
|
19
|
-
button: Pick<ButtonProps, 'mode' | 'style'>;
|
|
20
17
|
/** Ссылка-действие: «Открыть», «Загрузить» */
|
|
21
18
|
link: Pick<LinkProps, 'style' | 'mode'>;
|
|
22
19
|
/** Иконка рядом со второстепенным текстом: лоадер загрузки файла */
|
package/internal/colors.js
CHANGED
|
@@ -9,7 +9,6 @@ const COLORS = {
|
|
|
9
9
|
accentText: "accent",
|
|
10
10
|
replyTitle: "accent",
|
|
11
11
|
statusIcon: "secondary",
|
|
12
|
-
button: { mode: "secondary", style: "neutral" },
|
|
13
12
|
link: { style: "accent" },
|
|
14
13
|
secondaryIcon: "secondary",
|
|
15
14
|
fileIcon: "constant",
|
|
@@ -21,7 +20,6 @@ const COLORS = {
|
|
|
21
20
|
accentText: "constant",
|
|
22
21
|
replyTitle: "constant",
|
|
23
22
|
statusIcon: "constant",
|
|
24
|
-
button: { mode: "primary", style: "accent" },
|
|
25
23
|
link: { style: "constant", mode: "secondary" },
|
|
26
24
|
secondaryIcon: "constant",
|
|
27
25
|
fileIcon: "accent",
|
|
@@ -33,7 +31,6 @@ const COLORS = {
|
|
|
33
31
|
accentText: "special",
|
|
34
32
|
replyTitle: "accent",
|
|
35
33
|
statusIcon: "special",
|
|
36
|
-
button: { mode: "secondary", style: "special" },
|
|
37
34
|
link: { style: "accent" },
|
|
38
35
|
secondaryIcon: "secondary",
|
|
39
36
|
fileIcon: "constant",
|
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
|
|
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 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 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 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 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":";;;AA4BA,MAAM,MAAmD,GAAA;AAAA,EACrD,QAAU,EAAA;AAAA,IACN,IAAM,EAAA,SAAA;AAAA,IACN,aAAe,EAAA,WAAA;AAAA,IACf,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,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,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.1.
|
|
3
|
+
"version": "3.1.3",
|
|
4
4
|
"main": "index.js",
|
|
5
5
|
"types": "index.d.ts",
|
|
6
6
|
"sideEffects": [
|
|
@@ -17,7 +17,11 @@
|
|
|
17
17
|
"ts-check": "yarn root:ts-check $(pwd)",
|
|
18
18
|
"test": "yarn root:test $(pwd)",
|
|
19
19
|
"test:types": "yarn root:test:types $(pwd)",
|
|
20
|
-
"watch": "yarn root:watch $(pwd)"
|
|
20
|
+
"watch": "yarn root:watch $(pwd)",
|
|
21
|
+
"figma-publish": "yarn root:figma-publish $(pwd)",
|
|
22
|
+
"figma-unpublish": "yarn root:figma-unpublish $(pwd)",
|
|
23
|
+
"figma-snapshot-check": "yarn root:figma-snapshot $(pwd)",
|
|
24
|
+
"figma-snapshot-update": "yarn root:figma-snapshot $(pwd) --update"
|
|
21
25
|
},
|
|
22
26
|
"dependencies": {
|
|
23
27
|
"@hh.ru/magritte-common-mouse": "1.2.2",
|
|
@@ -30,7 +34,7 @@
|
|
|
30
34
|
"@hh.ru/magritte-ui-icon": "15.1.6",
|
|
31
35
|
"@hh.ru/magritte-ui-link": "7.2.7",
|
|
32
36
|
"@hh.ru/magritte-ui-loader": "4.1.7",
|
|
33
|
-
"@hh.ru/magritte-ui-menu": "1.0.
|
|
37
|
+
"@hh.ru/magritte-ui-menu": "1.0.55",
|
|
34
38
|
"@hh.ru/magritte-ui-mock-component": "1.1.9",
|
|
35
39
|
"@hh.ru/magritte-ui-tooltip": "11.0.54",
|
|
36
40
|
"@hh.ru/magritte-ui-typography": "5.3.17"
|
|
@@ -42,5 +46,5 @@
|
|
|
42
46
|
"publishConfig": {
|
|
43
47
|
"access": "public"
|
|
44
48
|
},
|
|
45
|
-
"gitHead": "
|
|
49
|
+
"gitHead": "131da36362e0a6a8bd2f9f24a204a029f2b9a7df"
|
|
46
50
|
}
|
package/chat-bubble-XuR5t6Q_.js
DELETED
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import './index.css';
|
|
2
|
-
var styles = {"chat-bubble":"magritte-chat-bubble___ds9CP_3-1-2","chatBubble":"magritte-chat-bubble___ds9CP_3-1-2","outgoing":"magritte-outgoing___3n00o_3-1-2","bot":"magritte-bot___Z6vZA_3-1-2","row":"magritte-row___mQNnt_3-1-2","with-buttons":"magritte-with-buttons___L-ZmQ_3-1-2","withButtons":"magritte-with-buttons___L-ZmQ_3-1-2","bubble":"magritte-bubble___NVuDI_3-1-2","with-tail":"magritte-with-tail___IdixJ_3-1-2","withTail":"magritte-with-tail___IdixJ_3-1-2","tail":"magritte-tail___E2hdk_3-1-2","tail-outgoing":"magritte-tail-outgoing___Pn3MI_3-1-2","tailOutgoing":"magritte-tail-outgoing___Pn3MI_3-1-2","buttons":"magritte-buttons___yQqBi_3-1-2","button-wide":"magritte-button-wide___QBqmM_3-1-2","buttonWide":"magritte-button-wide___QBqmM_3-1-2","aside":"magritte-aside___bTex-_3-1-2","aside-revealed":"magritte-aside-revealed___CRBl7_3-1-2","asideRevealed":"magritte-aside-revealed___CRBl7_3-1-2","error-text":"magritte-error-text___1ZxWY_3-1-2","errorText":"magritte-error-text___1ZxWY_3-1-2","file":"magritte-file___k2IKy_3-1-2","file-preview":"magritte-file-preview___eJKu8_3-1-2","filePreview":"magritte-file-preview___eJKu8_3-1-2","media":"magritte-media___9jH2k_3-1-2","media-blur":"magritte-media-blur___TbiMa_3-1-2","mediaBlur":"magritte-media-blur___TbiMa_3-1-2","media-image":"magritte-media-image___G-FkF_3-1-2","mediaImage":"magritte-media-image___G-FkF_3-1-2","media-content":"magritte-media-content___n3XbD_3-1-2","mediaContent":"magritte-media-content___n3XbD_3-1-2","media-format":"magritte-media-format___AdfCK_3-1-2","mediaFormat":"magritte-media-format___AdfCK_3-1-2","media-meta":"magritte-media-meta___oSxxr_3-1-2","mediaMeta":"magritte-media-meta___oSxxr_3-1-2","reply":"magritte-reply___-QCK7_3-1-2","reply-preview":"magritte-reply-preview___qvlNT_3-1-2","replyPreview":"magritte-reply-preview___qvlNT_3-1-2","reply-body":"magritte-reply-body___f2xx7_3-1-2","replyBody":"magritte-reply-body___f2xx7_3-1-2","snippet":"magritte-snippet___8k9xb_3-1-2","meta":"magritte-meta___1qhjm_3-1-2","edited":"magritte-edited___m-zmB_3-1-2","status":"magritte-status___dHzCt_3-1-2","message-title":"magritte-message-title___dgBFk_3-1-2","messageTitle":"magritte-message-title___dgBFk_3-1-2","label":"magritte-label___i0Wyt_3-1-2","message":"magritte-message___7TEpw_3-1-2"};
|
|
3
|
-
|
|
4
|
-
export { styles as s };
|
|
5
|
-
//# sourceMappingURL=chat-bubble-XuR5t6Q_.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"chat-bubble-XuR5t6Q_.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;"}
|