@azure/communication-react 1.8.1-alpha-202309300012 → 1.8.1-alpha-202310050013
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/communication-react.d.ts +8 -9
- package/dist/dist-cjs/communication-react/index.js +921 -490
- package/dist/dist-cjs/communication-react/index.js.map +1 -1
- package/dist/dist-esm/acs-ui-common/src/telemetryVersion.js +1 -1
- package/dist/dist-esm/acs-ui-common/src/telemetryVersion.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/CaptionsBanner.js +5 -7
- package/dist/dist-esm/react-components/src/components/CaptionsBanner.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/ChatMessage/ChatMessageActionMenu.d.ts +2 -2
- package/dist/dist-esm/react-components/src/components/ChatMessage/ChatMessageActionMenu.js +5 -22
- package/dist/dist-esm/react-components/src/components/ChatMessage/ChatMessageActionMenu.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/ChatMessage/ChatMessageActionsFlyout.js +2 -1
- package/dist/dist-esm/react-components/src/components/ChatMessage/ChatMessageActionsFlyout.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/ChatMessage/ChatMessageComponent.d.ts +2 -3
- package/dist/dist-esm/react-components/src/components/ChatMessage/ChatMessageComponent.js +1 -1
- package/dist/dist-esm/react-components/src/components/ChatMessage/ChatMessageComponent.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/ChatMessage/ChatMessageComponentAsEditBox.d.ts +0 -5
- package/dist/dist-esm/react-components/src/components/ChatMessage/ChatMessageComponentAsEditBox.js +17 -13
- package/dist/dist-esm/react-components/src/components/ChatMessage/ChatMessageComponentAsEditBox.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/ChatMessage/ChatMessageComponentAsMessageBubble.d.ts +9 -0
- package/dist/dist-esm/react-components/src/components/ChatMessage/ChatMessageComponentAsMessageBubble.js +79 -20
- package/dist/dist-esm/react-components/src/components/ChatMessage/ChatMessageComponentAsMessageBubble.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/ImageGallery.js +8 -16
- package/dist/dist-esm/react-components/src/components/ImageGallery.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/InputBoxComponent.js +9 -8
- package/dist/dist-esm/react-components/src/components/InputBoxComponent.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/MessageThread.d.ts +15 -1
- package/dist/dist-esm/react-components/src/components/MessageThread.js +114 -93
- package/dist/dist-esm/react-components/src/components/MessageThread.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/SystemMessage.js +1 -1
- package/dist/dist-esm/react-components/src/components/SystemMessage.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/VerticalGallery.js +1 -1
- package/dist/dist-esm/react-components/src/components/VerticalGallery.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/VideoGallery/DefaultLayout.js +4 -4
- package/dist/dist-esm/react-components/src/components/VideoGallery/DefaultLayout.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/VideoGallery/FloatingLocalVideoLayout.js +6 -6
- package/dist/dist-esm/react-components/src/components/VideoGallery/FloatingLocalVideoLayout.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/VideoGallery/LargeGalleryLayout.js +4 -4
- package/dist/dist-esm/react-components/src/components/VideoGallery/LargeGalleryLayout.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/VideoGallery/Layout.d.ts +1 -1
- package/dist/dist-esm/react-components/src/components/VideoGallery/Layout.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/VideoGallery/OverflowGallery.js +4 -4
- package/dist/dist-esm/react-components/src/components/VideoGallery/OverflowGallery.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/VideoGallery/SpeakerVideoLayout.js +6 -6
- package/dist/dist-esm/react-components/src/components/VideoGallery/SpeakerVideoLayout.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/VideoGallery/styles/FloatingLocalVideo.styles.d.ts +1 -1
- package/dist/dist-esm/react-components/src/components/VideoGallery/styles/FloatingLocalVideo.styles.js +2 -2
- package/dist/dist-esm/react-components/src/components/VideoGallery/styles/FloatingLocalVideo.styles.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/VideoGallery.d.ts +2 -2
- package/dist/dist-esm/react-components/src/components/VideoGallery.js +1 -1
- package/dist/dist-esm/react-components/src/components/VideoGallery.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/styles/Captions.style.d.ts +1 -1
- package/dist/dist-esm/react-components/src/components/styles/Captions.style.js +4 -4
- package/dist/dist-esm/react-components/src/components/styles/Captions.style.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/styles/ChatMessageComponent.styles.d.ts +5 -7
- package/dist/dist-esm/react-components/src/components/styles/ChatMessageComponent.styles.js +24 -9
- package/dist/dist-esm/react-components/src/components/styles/ChatMessageComponent.styles.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/styles/EditBox.styles.d.ts +3 -2
- package/dist/dist-esm/react-components/src/components/styles/EditBox.styles.js +10 -6
- package/dist/dist-esm/react-components/src/components/styles/EditBox.styles.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/styles/ImageGallery.style.d.ts +0 -4
- package/dist/dist-esm/react-components/src/components/styles/ImageGallery.style.js +0 -10
- package/dist/dist-esm/react-components/src/components/styles/ImageGallery.style.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/styles/InputBoxComponent.style.d.ts +4 -0
- package/dist/dist-esm/react-components/src/components/styles/InputBoxComponent.style.js +8 -2
- package/dist/dist-esm/react-components/src/components/styles/InputBoxComponent.style.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/styles/MessageThread.styles.d.ts +10 -19
- package/dist/dist-esm/react-components/src/components/styles/MessageThread.styles.js +129 -119
- package/dist/dist-esm/react-components/src/components/styles/MessageThread.styles.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/styles/SendBox.styles.d.ts +8 -0
- package/dist/dist-esm/react-components/src/components/styles/SendBox.styles.js +8 -2
- package/dist/dist-esm/react-components/src/components/styles/SendBox.styles.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/styles/SystemMessage.styles.js +1 -1
- package/dist/dist-esm/react-components/src/components/styles/SystemMessage.styles.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/styles/v8StyleShim.d.ts +12 -0
- package/dist/dist-esm/react-components/src/components/styles/v8StyleShim.js +37 -0
- package/dist/dist-esm/react-components/src/components/styles/v8StyleShim.js.map +1 -0
- package/dist/dist-esm/react-components/src/components/utils/Datetime.d.ts +7 -8
- package/dist/dist-esm/react-components/src/components/utils/Datetime.js +9 -31
- package/dist/dist-esm/react-components/src/components/utils/Datetime.js.map +1 -1
- package/dist/dist-esm/react-components/src/localization/LocalizationProvider.d.ts +1 -1
- package/dist/dist-esm/react-components/src/localization/LocalizationProvider.js.map +1 -1
- package/dist/dist-esm/react-components/src/localization/locales/en-US/strings.json +2 -2
- package/dist/dist-esm/react-components/src/theming/FluentThemeProvider.d.ts +3 -4
- package/dist/dist-esm/react-components/src/theming/FluentThemeProvider.js +40 -52
- package/dist/dist-esm/react-components/src/theming/FluentThemeProvider.js.map +1 -1
- package/dist/dist-esm/react-components/src/theming/FluentV9ThemeProvider.d.ts +22 -0
- package/dist/dist-esm/react-components/src/theming/FluentV9ThemeProvider.js +29 -0
- package/dist/dist-esm/react-components/src/theming/FluentV9ThemeProvider.js.map +1 -0
- package/dist/dist-esm/react-components/src/theming/themeDuplicates.d.ts +29 -0
- package/dist/dist-esm/react-components/src/theming/themeDuplicates.js +121 -0
- package/dist/dist-esm/react-components/src/theming/themeDuplicates.js.map +1 -0
- package/dist/dist-esm/react-components/src/theming/v9ThemeShim.d.ts +12 -0
- package/dist/dist-esm/react-components/src/theming/v9ThemeShim.js +206 -0
- package/dist/dist-esm/react-components/src/theming/v9ThemeShim.js.map +1 -0
- package/dist/dist-esm/react-components/src/types/ChatMessage.d.ts +2 -2
- package/dist/dist-esm/react-components/src/types/ChatMessage.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/CallComposite.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/components/CallArrangement.d.ts +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/components/CallArrangement.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/components/MediaGallery.d.ts +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/components/MediaGallery.js +3 -3
- package/dist/dist-esm/react-composites/src/composites/CallComposite/components/MediaGallery.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/CallPage.d.ts +2 -2
- package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/CallPage.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/common/ControlBar/CommonCallControlBar.d.ts +1 -1
- package/dist/dist-esm/react-composites/src/composites/common/ControlBar/CommonCallControlBar.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/common/ControlBar/DesktopMoreButton.d.ts +1 -1
- package/dist/dist-esm/react-composites/src/composites/common/ControlBar/DesktopMoreButton.js +31 -28
- package/dist/dist-esm/react-composites/src/composites/common/ControlBar/DesktopMoreButton.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/common/Drawer/MoreDrawer.js +22 -17
- package/dist/dist-esm/react-composites/src/composites/common/Drawer/MoreDrawer.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/common/icons.js +3 -3
- package/dist/dist-esm/react-composites/src/composites/common/icons.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/localization/locales/en-US/strings.json +5 -5
- package/package.json +12 -11
- package/dist/dist-esm/northstar-wrapper/src/index.js +0 -2
- package/dist/dist-esm/northstar-wrapper/src/index.js.LICENSE.txt +0 -41
@@ -1,4 +1,4 @@
|
|
1
|
-
import { IButtonStyles
|
1
|
+
import { IButtonStyles } from '@fluentui/react';
|
2
2
|
import { CSSProperties } from 'react';
|
3
3
|
import { ComponentSlotStyle } from '../../types';
|
4
4
|
/**
|
@@ -8,44 +8,39 @@ export declare const messageThreadContainerStyle: string;
|
|
8
8
|
/**
|
9
9
|
* @private
|
10
10
|
*/
|
11
|
-
export declare const
|
12
|
-
/**
|
13
|
-
* @private
|
14
|
-
*/
|
15
|
-
export declare const chatStyle: ComponentSlotStyle;
|
11
|
+
export declare const messageThreadWrapperContainerStyle: string;
|
16
12
|
/**
|
17
13
|
* @private
|
18
14
|
*/
|
19
|
-
export declare const
|
15
|
+
export declare const noMessageStatusStyle: string;
|
20
16
|
/**
|
21
17
|
* @private
|
22
18
|
*/
|
23
|
-
export declare const
|
19
|
+
export declare const useChatStyles: () => Record<"root", string>;
|
24
20
|
/**
|
25
21
|
* @private
|
26
22
|
*/
|
27
|
-
export declare const
|
23
|
+
export declare const useChatMessageRenderStyles: () => Record<"rootCommon" | "rootMessage" | "rootMyMessage" | "bodyCommon" | "bodyMyMessage" | "bodyWithoutAvatar" | "bodyWithAvatar" | "avatarNoOverlap" | "avatarOverlap", string>;
|
28
24
|
/**
|
29
25
|
* @private
|
30
26
|
*/
|
31
|
-
export declare const
|
27
|
+
export declare const useChatMyMessageStyles: () => Record<"root" | "body" | "menu" | "menuHidden" | "bodyAttached" | "menuAttached" | "menuVisible", string>;
|
32
28
|
/**
|
33
29
|
* @private
|
34
30
|
*/
|
35
|
-
export declare const
|
31
|
+
export declare const newMessageButtonContainerStyle: string;
|
36
32
|
/**
|
37
33
|
* @private
|
38
34
|
*/
|
39
|
-
export declare const
|
35
|
+
export declare const chatMessageDateStyle: CSSProperties;
|
40
36
|
/**
|
41
37
|
* @private
|
42
38
|
*/
|
43
|
-
export declare const
|
39
|
+
export declare const useChatMessageStyles: () => Record<"root" | "body" | "bodyWithoutAvatar" | "bodyWithAvatar" | "avatarNoOverlap" | "avatarOverlap", string>;
|
44
40
|
/**
|
45
41
|
* @private
|
46
|
-
* @conditional-compile-remove(data-loss-prevention)
|
47
42
|
*/
|
48
|
-
export declare const
|
43
|
+
export declare const useChatMessageCommonStyles: () => Record<"failed" | "blocked", string>;
|
49
44
|
/**
|
50
45
|
* @private
|
51
46
|
*/
|
@@ -54,10 +49,6 @@ export declare const gutterWithAvatar: ComponentSlotStyle;
|
|
54
49
|
* @private
|
55
50
|
*/
|
56
51
|
export declare const gutterWithHiddenAvatar: ComponentSlotStyle;
|
57
|
-
/**
|
58
|
-
* @private
|
59
|
-
*/
|
60
|
-
export declare const messageStatusContainerStyle: (mine: boolean) => string;
|
61
52
|
/**
|
62
53
|
* @private
|
63
54
|
*/
|
@@ -1,6 +1,7 @@
|
|
1
1
|
// Copyright (c) Microsoft Corporation.
|
2
2
|
// Licensed under the MIT License.
|
3
3
|
import { mergeStyles } from '@fluentui/react';
|
4
|
+
import { makeStyles, shorthands, tokens } from '@fluentui/react-components';
|
4
5
|
import { MESSAGE_STATUS_INDICATOR_SIZE_REM } from './MessageStatusIndicator.styles';
|
5
6
|
// Minimum chat bubble width. This matches the minimum chat bubble width from FluentUI
|
6
7
|
// that can contain a message and a timestamp.
|
@@ -9,10 +10,11 @@ const CHAT_MESSAGE_CONTAINER_MIN_WIDTH_REM = 6.25;
|
|
9
10
|
// When calculating the width of a message we also must take into account
|
10
11
|
// the width of the avatar/gutter and the gap between the message and avatar/gutter.
|
11
12
|
const AVATAR_WIDTH_REM = 2;
|
12
|
-
const
|
13
|
+
const AVATAR_MARGIN_LEFT = 2.5;
|
14
|
+
const AVATAR_MESSAGE_GAP_REM = 0.125;
|
13
15
|
const MESSAGE_AMOUNT_OUT_FROM_EDGE_REM = 2;
|
14
16
|
// Avatars should display on top of chat messages when the chat thread is narrow
|
15
|
-
const MESSAGE_AVATAR_OVERLAP_REM = 0.
|
17
|
+
const MESSAGE_AVATAR_OVERLAP_REM = 0.925;
|
16
18
|
const CHAT_MESSAGE_ZINDEX = 1;
|
17
19
|
const AVATAR_ZINDEX = 2;
|
18
20
|
// new message button should be on top of chat message
|
@@ -28,6 +30,14 @@ export const messageThreadContainerStyle = mergeStyles({
|
|
28
30
|
position: 'relative',
|
29
31
|
alignSelf: 'center'
|
30
32
|
});
|
33
|
+
/**
|
34
|
+
* @private
|
35
|
+
*/
|
36
|
+
export const messageThreadWrapperContainerStyle = mergeStyles({
|
37
|
+
height: '100%',
|
38
|
+
width: '100%',
|
39
|
+
position: 'relative'
|
40
|
+
});
|
31
41
|
/**
|
32
42
|
* @private
|
33
43
|
*/
|
@@ -39,15 +49,90 @@ export const noMessageStatusStyle = mergeStyles({
|
|
39
49
|
/**
|
40
50
|
* @private
|
41
51
|
*/
|
42
|
-
export const
|
43
|
-
paddingBottom: '0.5rem',
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
}
|
52
|
+
export const useChatStyles = makeStyles({
|
53
|
+
root: Object.assign(Object.assign(Object.assign({ paddingTop: '0.8rem', paddingBottom: '0.5rem', paddingRight: '0.6rem', paddingLeft: '0.6rem' }, shorthands.border('none')), shorthands.overflow('auto')), {
|
54
|
+
// `height: 100%` ensures that the Chat component covers 100% of it's parents height
|
55
|
+
// to prevent intermittent scrollbars when GIFs are present in the chat.
|
56
|
+
height: '100%', '& a:link': {
|
57
|
+
color: tokens.colorBrandForegroundLink
|
58
|
+
}, '& a:visited': {
|
59
|
+
color: tokens.colorBrandForegroundLinkHover
|
60
|
+
}, '& a:hover': {
|
61
|
+
color: tokens.colorBrandForegroundLinkHover
|
62
|
+
} })
|
63
|
+
});
|
64
|
+
/**
|
65
|
+
* @private
|
66
|
+
*/
|
67
|
+
export const useChatMessageRenderStyles = makeStyles({
|
68
|
+
rootCommon: {
|
69
|
+
'&:focus-visible': Object.assign({}, shorthands.outline('0'))
|
70
|
+
},
|
71
|
+
rootMessage: Object.assign(Object.assign(Object.assign({}, shorthands.padding('0')), shorthands.margin('0')), { maxWidth: '100%', minWidth: `${CHAT_MESSAGE_CONTAINER_MIN_WIDTH_REM}rem` }),
|
72
|
+
rootMyMessage: Object.assign(Object.assign({ gridTemplateColumns: 'auto fit-content(0)', gridTemplateAreas: `
|
73
|
+
"body status"
|
74
|
+
`, columnGap: '0', gridGap: '0' }, shorthands.padding('0')), { marginTop: '0', marginRight: '0', marginBottom: '0', marginLeft: '50px', width: `calc(100% - 50px)` }),
|
75
|
+
bodyCommon: Object.assign(Object.assign({}, shorthands.padding('0')), { marginRight: '0', marginBottom: '0', backgroundColor: 'transparent', maxWidth: '100%', minWidth: `${CHAT_MESSAGE_CONTAINER_MIN_WIDTH_REM}rem` }),
|
76
|
+
bodyMyMessage: {
|
77
|
+
width: '100%',
|
78
|
+
marginTop: '0'
|
79
|
+
},
|
80
|
+
bodyWithoutAvatar: {
|
81
|
+
marginLeft: `${AVATAR_MARGIN_LEFT}rem`,
|
82
|
+
marginTop: '0'
|
83
|
+
},
|
84
|
+
bodyWithAvatar: {
|
85
|
+
marginLeft: `0`,
|
86
|
+
marginTop: '0.75rem'
|
87
|
+
},
|
88
|
+
avatarNoOverlap: {
|
89
|
+
width: `calc(100% - ${AVATAR_WIDTH_REM + MESSAGE_AMOUNT_OUT_FROM_EDGE_REM + AVATAR_MESSAGE_GAP_REM}rem)`
|
90
|
+
},
|
91
|
+
avatarOverlap: {
|
92
|
+
width: `calc(100% - ${AVATAR_WIDTH_REM + MESSAGE_AMOUNT_OUT_FROM_EDGE_REM - MESSAGE_AVATAR_OVERLAP_REM}rem)`
|
93
|
+
}
|
94
|
+
});
|
95
|
+
/**
|
96
|
+
* @private
|
97
|
+
*/
|
98
|
+
export const useChatMyMessageStyles = makeStyles({
|
99
|
+
root: {
|
100
|
+
gridTemplateColumns: 'auto auto',
|
101
|
+
gridTemplateAreas: `
|
102
|
+
". actions"
|
103
|
+
"body body"
|
104
|
+
`,
|
105
|
+
gridGap: '0',
|
106
|
+
columnGap: '0',
|
107
|
+
paddingTop: '0',
|
108
|
+
marginLeft: '0',
|
109
|
+
'&:focus-visible': Object.assign({}, shorthands.outline('0'))
|
110
|
+
},
|
111
|
+
body: Object.assign(Object.assign({ paddingBottom: '10px', marginTop: '1rem', maxWidth: '100%', minWidth: `${CHAT_MESSAGE_CONTAINER_MIN_WIDTH_REM}rem`, marginLeft: '0rem' }, shorthands.border('1px', 'solid', 'transparent')), { '&:hover ~ .fui-ChatMyMessage__actions': {
|
112
|
+
visibility: 'visible'
|
113
|
+
}, '&:focus ~ .fui-ChatMyMessage__actions': {
|
114
|
+
visibility: 'visible'
|
115
|
+
}, '& msft-mention': {
|
116
|
+
color: tokens.colorStatusWarningBackground3,
|
117
|
+
fontWeight: 600
|
118
|
+
} }),
|
119
|
+
bodyAttached: {
|
120
|
+
marginTop: '0.125rem'
|
121
|
+
},
|
122
|
+
menu: Object.assign(Object.assign({ boxShadow: tokens.shadow4, backgroundColor: tokens.colorNeutralBackground1, marginRight: '1px', position: 'absolute', top: '-2px', right: '0' }, shorthands.borderRadius(tokens.borderRadiusMedium)), { zIndex: 1, lineHeight: tokens.lineHeightBase100, visibility: 'hidden', '&:hover, &:focus': {
|
123
|
+
cursor: 'pointer',
|
124
|
+
visibility: 'visible'
|
125
|
+
} }),
|
126
|
+
menuAttached: {
|
127
|
+
top: '-18px'
|
128
|
+
},
|
129
|
+
menuHidden: {
|
130
|
+
visibility: 'hidden'
|
131
|
+
},
|
132
|
+
menuVisible: {
|
133
|
+
visibility: 'visible'
|
134
|
+
}
|
135
|
+
});
|
51
136
|
/**
|
52
137
|
* @private
|
53
138
|
*/
|
@@ -57,12 +142,6 @@ export const newMessageButtonContainerStyle = mergeStyles({
|
|
57
142
|
bottom: 0,
|
58
143
|
right: '1.5rem'
|
59
144
|
});
|
60
|
-
/**
|
61
|
-
* @private
|
62
|
-
*/
|
63
|
-
export const chatMessageStyle = {
|
64
|
-
overflowY: 'hidden'
|
65
|
-
};
|
66
145
|
/**
|
67
146
|
* @private
|
68
147
|
*/
|
@@ -72,116 +151,53 @@ export const chatMessageDateStyle = {
|
|
72
151
|
/**
|
73
152
|
* @private
|
74
153
|
*/
|
75
|
-
export const
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
marginLeft: `${messageAvatarGap}rem`,
|
80
|
-
width: `calc(100% - ${AVATAR_WIDTH_REM + MESSAGE_AMOUNT_OUT_FROM_EDGE_REM + messageAvatarGap}rem)`,
|
81
|
-
zIndex: CHAT_MESSAGE_ZINDEX,
|
82
|
-
'& msft-mention': {
|
83
|
-
color: '#D83B01',
|
84
|
-
fontWeight: 600
|
85
|
-
}
|
86
|
-
};
|
87
|
-
};
|
88
|
-
/**
|
89
|
-
* @private
|
90
|
-
*/
|
91
|
-
export const defaultMyChatMessageContainer = {
|
92
|
-
maxWidth: '100%',
|
93
|
-
minWidth: `${CHAT_MESSAGE_CONTAINER_MIN_WIDTH_REM}rem`,
|
94
|
-
marginLeft: '0rem',
|
95
|
-
// This makes message bubble show border in high contrast mode making each message distinguishable
|
96
|
-
border: '1px solid transparent'
|
97
|
-
};
|
98
|
-
/**
|
99
|
-
* @private
|
100
|
-
*/
|
101
|
-
export const FailedMyChatMessageContainer = Object.assign(Object.assign({}, defaultChatItemMessageContainer), { backgroundColor: 'rgba(168, 0, 0, 0.2)' });
|
102
|
-
/**
|
103
|
-
* @private
|
104
|
-
*/
|
105
|
-
export const defaultChatMessageContainer = (theme) => ({
|
106
|
-
maxWidth: '100%',
|
107
|
-
minWidth: `${CHAT_MESSAGE_CONTAINER_MIN_WIDTH_REM}rem`,
|
108
|
-
marginRight: '0rem',
|
109
|
-
'& img': {
|
110
|
-
maxWidth: '100% !important',
|
111
|
-
height: 'auto !important'
|
112
|
-
},
|
113
|
-
'& video': {
|
114
|
-
maxWidth: '100% !important',
|
115
|
-
height: 'auto !important'
|
154
|
+
export const useChatMessageStyles = makeStyles({
|
155
|
+
root: {
|
156
|
+
paddingTop: '0',
|
157
|
+
'&:focus-visible': Object.assign({}, shorthands.outline('0'))
|
116
158
|
},
|
117
|
-
'&
|
118
|
-
|
119
|
-
|
120
|
-
|
159
|
+
body: Object.assign(Object.assign({ maxWidth: '100%', minWidth: `${CHAT_MESSAGE_CONTAINER_MIN_WIDTH_REM}rem`, marginRight: '0rem', paddingBottom: '10px', zIndex: CHAT_MESSAGE_ZINDEX }, shorthands.border('1px', 'solid', 'transparent')), { '& > div:first-of-type': {
|
160
|
+
flexWrap: 'wrap'
|
161
|
+
}, '& msft-mention': {
|
162
|
+
color: tokens.colorStatusWarningBackground3,
|
163
|
+
fontWeight: tokens.fontWeightSemibold
|
164
|
+
}, '& img': {
|
165
|
+
maxWidth: '100% !important',
|
166
|
+
height: 'auto !important'
|
167
|
+
}, '& video': {
|
168
|
+
maxWidth: '100% !important',
|
169
|
+
height: 'auto !important'
|
170
|
+
}, '& p': Object.assign({}, shorthands.marginBlock('0.125rem')), '& blockquote': Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({ backgroundColor: tokens.colorBrandBackgroundInverted, clear: 'left', minHeight: '2.25rem', width: 'fit-content', marginTop: '7px', marginRight: '0px', marginLeft: '0px', marginBottom: '7px', paddingTop: '7px', paddingRight: '15px', paddingLeft: '15px', paddingBottom: '7px' }, shorthands.border('solid')), shorthands.borderRadius('4px')), shorthands.borderWidth('1px')), shorthands.borderColor(tokens.colorNeutralStroke1Selected)), { borderLeftWidth: '4px' }), '& table': Object.assign(Object.assign({ backgroundColor: tokens.colorBrandBackgroundInverted }, shorthands.borderColor(tokens.colorNeutralStroke1Selected)), { borderCollapse: 'collapse', tableLayout: 'auto', width: '100%', '& tr': Object.assign(Object.assign({}, shorthands.border('1px', 'solid', `${tokens.colorNeutralStroke1Selected}`)), { '& td': Object.assign(Object.assign({}, shorthands.border('1px', 'solid', `${tokens.colorNeutralStroke1Selected}`)), { wordBreak: 'normal', paddingTop: '0px', paddingRight: '5px' }) }) }) }),
|
171
|
+
bodyWithoutAvatar: {
|
172
|
+
marginTop: '0.125rem'
|
121
173
|
},
|
122
|
-
|
123
|
-
|
124
|
-
clear: 'left',
|
125
|
-
minHeight: '2.25rem',
|
126
|
-
width: 'fit-content',
|
127
|
-
margin: '7px 0px',
|
128
|
-
padding: '7px 15px',
|
129
|
-
border: 'solid',
|
130
|
-
borderRadius: '4px',
|
131
|
-
borderWidth: '1px',
|
132
|
-
borderColor: theme.palette.neutralQuaternary,
|
133
|
-
borderLeftWidth: '4px'
|
174
|
+
bodyWithAvatar: {
|
175
|
+
marginTop: `0.375rem`
|
134
176
|
},
|
135
|
-
|
136
|
-
|
137
|
-
border: theme.palette.neutralQuaternary,
|
138
|
-
borderCollapse: 'collapse',
|
139
|
-
tableLayout: 'auto',
|
140
|
-
width: '100%',
|
141
|
-
'& tr': {
|
142
|
-
border: `1px solid ${theme.palette.neutralQuaternary}`,
|
143
|
-
'& td': {
|
144
|
-
border: `1px solid ${theme.palette.neutralQuaternary}`,
|
145
|
-
wordBreak: 'normal',
|
146
|
-
padding: '0px 5px'
|
147
|
-
}
|
148
|
-
}
|
177
|
+
avatarNoOverlap: {
|
178
|
+
marginLeft: `${-AVATAR_MARGIN_LEFT + AVATAR_MESSAGE_GAP_REM}rem`
|
149
179
|
},
|
150
|
-
|
151
|
-
|
180
|
+
avatarOverlap: {
|
181
|
+
marginLeft: `${-AVATAR_MARGIN_LEFT - MESSAGE_AVATAR_OVERLAP_REM}rem`
|
182
|
+
}
|
152
183
|
});
|
153
184
|
/**
|
154
185
|
* @private
|
155
|
-
* @conditional-compile-remove(data-loss-prevention)
|
156
186
|
*/
|
157
|
-
export const
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
color: theme.palette.neutralSecondary,
|
162
|
-
'& i': {
|
163
|
-
paddingTop: '0.25rem'
|
164
|
-
},
|
165
|
-
'& p': {
|
166
|
-
// Deal with awkward padding seen in messages from Teams.
|
167
|
-
// For more info see https://github.com/Azure/communication-ui-library/pull/1507
|
168
|
-
marginBlock: '0.125rem',
|
169
|
-
paddingRight: '0.75rem',
|
170
|
-
fontStyle: 'italic'
|
187
|
+
export const useChatMessageCommonStyles = makeStyles({
|
188
|
+
failed: {
|
189
|
+
//TODO: can we reuse a theme color here?
|
190
|
+
backgroundColor: 'rgba(168, 0, 0, 0.2)'
|
171
191
|
},
|
172
|
-
'&
|
173
|
-
|
174
|
-
fontStyle: 'normal',
|
175
|
-
color: theme.palette.themePrimary,
|
176
|
-
textDecoration: 'none'
|
177
|
-
},
|
178
|
-
// This makes message bubble show border in high contrast mode making each message distinguishable
|
179
|
-
border: '1px solid transparent'
|
192
|
+
blocked: Object.assign(Object.assign({ maxWidth: '100%', minWidth: `${CHAT_MESSAGE_CONTAINER_MIN_WIDTH_REM}rem`, marginRight: '0rem', color: tokens.colorNeutralForeground2 }, shorthands.border('1px', 'solid', 'transparent')), { '& i': {
|
193
|
+
paddingTop: '0.25rem'
|
194
|
+
}, '& p': Object.assign(Object.assign({}, shorthands.marginBlock('0.125rem')), { paddingRight: '0.75rem', fontStyle: 'italic' }), '& a': Object.assign(Object.assign(Object.assign({}, shorthands.marginBlock('0.125rem')), { fontStyle: 'normal', color: tokens.colorBrandForegroundLink }), shorthands.textDecoration('none')) })
|
180
195
|
});
|
181
196
|
/**
|
182
197
|
* @private
|
183
198
|
*/
|
184
199
|
export const gutterWithAvatar = {
|
200
|
+
paddingTop: '1.65rem',
|
185
201
|
width: `${AVATAR_WIDTH_REM}rem`,
|
186
202
|
position: 'relative',
|
187
203
|
float: 'left',
|
@@ -196,12 +212,6 @@ export const gutterWithHiddenAvatar = Object.assign(Object.assign({}, gutterWith
|
|
196
212
|
// we use this hidden avatar just as a width placeholder
|
197
213
|
// the placeholder is needed for responsive bubble width
|
198
214
|
height: 0 });
|
199
|
-
/**
|
200
|
-
* @private
|
201
|
-
*/
|
202
|
-
export const messageStatusContainerStyle = (mine) => mergeStyles({
|
203
|
-
marginLeft: mine ? '0.25rem' : '0rem'
|
204
|
-
});
|
205
215
|
/**
|
206
216
|
* @private
|
207
217
|
*/
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"MessageThread.styles.js","sourceRoot":"","sources":["../../../../../../../react-components/src/components/styles/MessageThread.styles.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EAAiB,WAAW,EAAS,MAAM,iBAAiB,CAAC;AAE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;IACjC,UAAU,EAAE,EAAE,UAAU,EAAE,MAAM,EAAE;CACnC,CAAC,CAAC;AAEH;;GAEG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG,WAAW,CAAC;IACvC,WAAW,EAAE,OAAO;CACrB,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { IButtonStyles, mergeStyles, Theme } from '@fluentui/react';\nimport { CSSProperties } from 'react';\nimport { MESSAGE_STATUS_INDICATOR_SIZE_REM } from './MessageStatusIndicator.styles';\nimport { ComponentSlotStyle } from '../../types';\n\n// Minimum chat bubble width. This matches the minimum chat bubble width from FluentUI\n// that can contain a message and a timestamp.\nconst CHAT_MESSAGE_CONTAINER_MIN_WIDTH_REM = 6.25;\n\n// Chat messages should span just short of the width of the container.\n// When calculating the width of a message we also must take into account\n// the width of the avatar/gutter and the gap between the message and avatar/gutter.\nconst AVATAR_WIDTH_REM = 2;\nconst AVATAR_MESSAGE_GAP_REM = 0.5;\nconst MESSAGE_AMOUNT_OUT_FROM_EDGE_REM = 2;\n\n// Avatars should display on top of chat messages when the chat thread is narrow\nconst MESSAGE_AVATAR_OVERLAP_REM = 0.425;\nconst CHAT_MESSAGE_ZINDEX = 1;\nconst AVATAR_ZINDEX = 2;\n// new message button should be on top of chat message\nconst NEW_MESSAGE_BUTTON_ZINDEX = 2;\n\n/**\n * @private\n */\nexport const messageThreadContainerStyle = mergeStyles({\n height: '100%',\n width: '100%',\n maxHeight: '100%',\n overflow: 'auto',\n position: 'relative',\n alignSelf: 'center'\n});\n\n/**\n * @private\n */\nexport const noMessageStatusStyle = mergeStyles({\n // This should match the size of the message status indicator icon to ensure\n // multiple messages sent by the user are aligned correctly.\n width: `${MESSAGE_STATUS_INDICATOR_SIZE_REM}rem`\n});\n\n/**\n * @private\n */\nexport const chatStyle: ComponentSlotStyle = {\n paddingBottom: '0.5rem',\n paddingTop: '0.8rem',\n border: 'none',\n overflow: 'auto',\n // `height: 100%` ensures that the Chat component covers 100% of it's parents height\n // to prevent intermittent scrollbars when gifs are present in the chat.\n height: '100%'\n};\n\n/**\n * @private\n */\nexport const newMessageButtonContainerStyle = mergeStyles({\n position: 'absolute',\n zIndex: NEW_MESSAGE_BUTTON_ZINDEX,\n bottom: 0,\n right: '1.5rem'\n});\n\n/**\n * @private\n */\nexport const chatMessageStyle: CSSProperties = {\n overflowY: 'hidden'\n};\n\n/**\n * @private\n */\nexport const chatMessageDateStyle: CSSProperties = {\n fontWeight: 600\n};\n\n/**\n * @private\n */\nexport const defaultChatItemMessageContainer = (overlapAvatarAndMessage: boolean): ComponentSlotStyle => {\n const messageAvatarGap = overlapAvatarAndMessage ? -MESSAGE_AVATAR_OVERLAP_REM : AVATAR_MESSAGE_GAP_REM;\n return {\n marginRight: '0rem',\n marginLeft: `${messageAvatarGap}rem`,\n width: `calc(100% - ${AVATAR_WIDTH_REM + MESSAGE_AMOUNT_OUT_FROM_EDGE_REM + messageAvatarGap}rem)`,\n zIndex: CHAT_MESSAGE_ZINDEX,\n '& msft-mention': {\n color: '#D83B01',\n fontWeight: 600\n }\n };\n};\n\n/**\n * @private\n */\nexport const defaultMyChatMessageContainer: ComponentSlotStyle = {\n maxWidth: '100%',\n minWidth: `${CHAT_MESSAGE_CONTAINER_MIN_WIDTH_REM}rem`,\n marginLeft: '0rem',\n // This makes message bubble show border in high contrast mode making each message distinguishable\n border: '1px solid transparent'\n};\n\n/**\n * @private\n */\nexport const FailedMyChatMessageContainer: ComponentSlotStyle = {\n ...defaultChatItemMessageContainer,\n backgroundColor: 'rgba(168, 0, 0, 0.2)'\n};\n\n/**\n * @private\n */\nexport const defaultChatMessageContainer = (theme: Theme): ComponentSlotStyle => ({\n maxWidth: '100%',\n minWidth: `${CHAT_MESSAGE_CONTAINER_MIN_WIDTH_REM}rem`,\n marginRight: '0rem',\n '& img': {\n maxWidth: '100% !important', // Add !important to make sure it won't be overridden by style defined in element\n height: 'auto !important'\n },\n '& video': {\n maxWidth: '100% !important', // Add !important to make sure it won't be overridden by style defined in element\n height: 'auto !important'\n },\n '& p': {\n // Deal with awkward padding seen in messages from Teams.\n // For more info see https://github.com/Azure/communication-ui-library/pull/1507\n marginBlock: '0.125rem'\n },\n '& blockquote': {\n backgroundColor: theme.palette.white,\n clear: 'left',\n minHeight: '2.25rem',\n width: 'fit-content',\n margin: '7px 0px',\n padding: '7px 15px',\n border: 'solid',\n borderRadius: '4px',\n borderWidth: '1px',\n borderColor: theme.palette.neutralQuaternary,\n borderLeftWidth: '4px'\n },\n '& table': {\n backgroundColor: theme.palette.white,\n border: theme.palette.neutralQuaternary,\n borderCollapse: 'collapse',\n tableLayout: 'auto',\n width: '100%',\n\n '& tr': {\n border: `1px solid ${theme.palette.neutralQuaternary}`,\n\n '& td': {\n border: `1px solid ${theme.palette.neutralQuaternary}`,\n wordBreak: 'normal',\n padding: '0px 5px'\n }\n }\n },\n // This makes message bubble show border in high contrast mode making each message distinguishable\n border: '1px solid transparent'\n});\n\n/**\n * @private\n * @conditional-compile-remove(data-loss-prevention)\n */\nexport const defaultBlockedMessageStyleContainer = (theme: Theme): ComponentSlotStyle => ({\n maxWidth: '100%',\n minWidth: `${CHAT_MESSAGE_CONTAINER_MIN_WIDTH_REM}rem`,\n marginRight: '0rem',\n color: theme.palette.neutralSecondary,\n\n '& i': {\n paddingTop: '0.25rem'\n },\n\n '& p': {\n // Deal with awkward padding seen in messages from Teams.\n // For more info see https://github.com/Azure/communication-ui-library/pull/1507\n marginBlock: '0.125rem',\n paddingRight: '0.75rem',\n fontStyle: 'italic'\n },\n\n '& a': {\n marginBlock: '0.125rem',\n fontStyle: 'normal',\n color: theme.palette.themePrimary,\n textDecoration: 'none'\n },\n // This makes message bubble show border in high contrast mode making each message distinguishable\n border: '1px solid transparent'\n});\n\n/**\n * @private\n */\nexport const gutterWithAvatar: ComponentSlotStyle = {\n width: `${AVATAR_WIDTH_REM}rem`,\n position: 'relative',\n float: 'left',\n display: 'block',\n visibility: 'visible',\n zIndex: AVATAR_ZINDEX\n};\n\n/**\n * @private\n */\nexport const gutterWithHiddenAvatar: ComponentSlotStyle = {\n ...gutterWithAvatar,\n visibility: 'hidden',\n // we use this hidden avatar just as a width placeholder\n // the placeholder is needed for responsive bubble width\n height: 0\n};\n\n/**\n * @private\n */\nexport const messageStatusContainerStyle = (mine: boolean): string =>\n mergeStyles({\n marginLeft: mine ? '0.25rem' : '0rem'\n });\n\n/**\n * @private\n */\nexport const newMessageButtonStyle = mergeStyles({\n float: 'right',\n width: 'fit-content'\n});\n\n/**\n * @private\n */\nexport const buttonWithIconStyles: IButtonStyles = {\n textContainer: {\n display: 'contents'\n }\n};\n\n/**\n * @private\n */\nexport const loadPreviousMessageButtonStyle = mergeStyles({\n border: 'none',\n minHeight: '1.5rem',\n '&:hover': { background: 'none' },\n '&:active': { background: 'none' }\n});\n\n/**\n * @private\n */\nexport const DownIconStyle = mergeStyles({\n marginRight: '0.5em'\n});\n"]}
|
1
|
+
{"version":3,"file":"MessageThread.styles.js","sourceRoot":"","sources":["../../../../../../../react-components/src/components/styles/MessageThread.styles.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EAAiB,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAC7D,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAC;AAE5E,OAAO,EAAE,iCAAiC,EAAE,MAAM,iCAAiC,CAAC;AAGpF,sFAAsF;AACtF,8CAA8C;AAC9C,MAAM,oCAAoC,GAAG,IAAI,CAAC;AAElD,sEAAsE;AACtE,yEAAyE;AACzE,oFAAoF;AACpF,MAAM,gBAAgB,GAAG,CAAC,CAAC;AAC3B,MAAM,kBAAkB,GAAG,GAAG,CAAC;AAC/B,MAAM,sBAAsB,GAAG,KAAK,CAAC;AACrC,MAAM,gCAAgC,GAAG,CAAC,CAAC;AAE3C,gFAAgF;AAChF,MAAM,0BAA0B,GAAG,KAAK,CAAC;AACzC,MAAM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M;IACd,SAAS,EAAE,QAAQ;IACnB,SAAS,EAAE,EAAE,UAAU,EAAE,MAAM,EAAE;IACjC,UAAU,EAAE,EAAE,UAAU,EAAE,MAAM,EAAE;CACnC,CAAC,CAAC;AAEH;;GAEG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG,WAAW,CAAC;IACvC,WAAW,EAAE,OAAO;CACrB,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { IButtonStyles, mergeStyles } from '@fluentui/react';\nimport { makeStyles, shorthands, tokens } from '@fluentui/react-components';\nimport { CSSProperties } from 'react';\nimport { MESSAGE_STATUS_INDICATOR_SIZE_REM } from './MessageStatusIndicator.styles';\nimport { ComponentSlotStyle } from '../../types';\n\n// Minimum chat bubble width. This matches the minimum chat bubble width from FluentUI\n// that can contain a message and a timestamp.\nconst CHAT_MESSAGE_CONTAINER_MIN_WIDTH_REM = 6.25;\n\n// Chat messages should span just short of the width of the container.\n// When calculating the width of a message we also must take into account\n// the width of the avatar/gutter and the gap between the message and avatar/gutter.\nconst AVATAR_WIDTH_REM = 2;\nconst AVATAR_MARGIN_LEFT = 2.5;\nconst AVATAR_MESSAGE_GAP_REM = 0.125;\nconst MESSAGE_AMOUNT_OUT_FROM_EDGE_REM = 2;\n\n// Avatars should display on top of chat messages when the chat thread is narrow\nconst MESSAGE_AVATAR_OVERLAP_REM = 0.925;\nconst CHAT_MESSAGE_ZINDEX = 1;\nconst AVATAR_ZINDEX = 2;\n// new message button should be on top of chat message\nconst NEW_MESSAGE_BUTTON_ZINDEX = 2;\n\n/**\n * @private\n */\nexport const messageThreadContainerStyle = mergeStyles({\n height: '100%',\n width: '100%',\n maxHeight: '100%',\n overflow: 'auto',\n position: 'relative',\n alignSelf: 'center'\n});\n\n/**\n * @private\n */\nexport const messageThreadWrapperContainerStyle = mergeStyles({\n height: '100%',\n width: '100%',\n position: 'relative'\n});\n\n/**\n * @private\n */\nexport const noMessageStatusStyle = mergeStyles({\n // This should match the size of the message status indicator icon to ensure\n // multiple messages sent by the user are aligned correctly.\n width: `${MESSAGE_STATUS_INDICATOR_SIZE_REM}rem`\n});\n\n/**\n * @private\n */\nexport const useChatStyles = makeStyles({\n root: {\n paddingTop: '0.8rem',\n paddingBottom: '0.5rem',\n paddingRight: '0.6rem',\n paddingLeft: '0.6rem',\n ...shorthands.border('none'),\n ...shorthands.overflow('auto'),\n // `height: 100%` ensures that the Chat component covers 100% of it's parents height\n // to prevent intermittent scrollbars when GIFs are present in the chat.\n height: '100%',\n\n '& a:link': {\n color: tokens.colorBrandForegroundLink\n },\n '& a:visited': {\n color: tokens.colorBrandForegroundLinkHover\n },\n '& a:hover': {\n color: tokens.colorBrandForegroundLinkHover\n }\n }\n});\n\n/**\n * @private\n */\nexport const useChatMessageRenderStyles = makeStyles({\n rootCommon: {\n '&:focus-visible': {\n ...shorthands.outline('0')\n }\n },\n rootMessage: {\n ...shorthands.padding('0'),\n ...shorthands.margin('0'),\n maxWidth: '100%',\n minWidth: `${CHAT_MESSAGE_CONTAINER_MIN_WIDTH_REM}rem`\n },\n rootMyMessage: {\n gridTemplateColumns: 'auto fit-content(0)',\n gridTemplateAreas: `\n \"body status\"\n `,\n columnGap: '0',\n gridGap: '0',\n ...shorthands.padding('0'),\n marginTop: '0',\n marginRight: '0',\n marginBottom: '0',\n marginLeft: '50px',\n width: `calc(100% - 50px)`\n },\n bodyCommon: {\n ...shorthands.padding('0'),\n marginRight: '0',\n marginBottom: '0',\n backgroundColor: 'transparent',\n maxWidth: '100%',\n minWidth: `${CHAT_MESSAGE_CONTAINER_MIN_WIDTH_REM}rem`\n },\n bodyMyMessage: {\n width: '100%',\n marginTop: '0'\n },\n bodyWithoutAvatar: {\n marginLeft: `${AVATAR_MARGIN_LEFT}rem`,\n marginTop: '0'\n },\n bodyWithAvatar: {\n marginLeft: `0`,\n marginTop: '0.75rem'\n },\n avatarNoOverlap: {\n width: `calc(100% - ${AVATAR_WIDTH_REM + MESSAGE_AMOUNT_OUT_FROM_EDGE_REM + AVATAR_MESSAGE_GAP_REM}rem)`\n },\n avatarOverlap: {\n width: `calc(100% - ${AVATAR_WIDTH_REM + MESSAGE_AMOUNT_OUT_FROM_EDGE_REM - MESSAGE_AVATAR_OVERLAP_REM}rem)`\n }\n});\n\n/**\n * @private\n */\nexport const useChatMyMessageStyles = makeStyles({\n root: {\n gridTemplateColumns: 'auto auto',\n gridTemplateAreas: `\n \". actions\"\n \"body body\"\n `,\n gridGap: '0',\n columnGap: '0',\n paddingTop: '0',\n marginLeft: '0',\n '&:focus-visible': {\n ...shorthands.outline('0')\n }\n },\n body: {\n paddingBottom: '10px',\n marginTop: '1rem',\n maxWidth: '100%',\n minWidth: `${CHAT_MESSAGE_CONTAINER_MIN_WIDTH_REM}rem`,\n marginLeft: '0rem',\n // This makes message bubble show border in high contrast mode making each message distinguishable\n ...shorthands.border('1px', 'solid', 'transparent'),\n\n '&:hover ~ .fui-ChatMyMessage__actions': {\n visibility: 'visible'\n },\n '&:focus ~ .fui-ChatMyMessage__actions': {\n visibility: 'visible'\n },\n '& msft-mention': {\n color: tokens.colorStatusWarningBackground3,\n fontWeight: 600\n }\n },\n bodyAttached: {\n marginTop: '0.125rem'\n },\n menu: {\n boxShadow: tokens.shadow4,\n backgroundColor: tokens.colorNeutralBackground1,\n marginRight: '1px',\n position: 'absolute',\n top: '-2px',\n right: '0',\n ...shorthands.borderRadius(tokens.borderRadiusMedium),\n zIndex: 1,\n lineHeight: tokens.lineHeightBase100,\n visibility: 'hidden',\n\n '&:hover, &:focus': {\n cursor: 'pointer',\n visibility: 'visible'\n }\n },\n menuAttached: {\n top: '-18px'\n },\n menuHidden: {\n visibility: 'hidden'\n },\n menuVisible: {\n visibility: 'visible'\n }\n});\n\n/**\n * @private\n */\nexport const newMessageButtonContainerStyle = mergeStyles({\n position: 'absolute',\n zIndex: NEW_MESSAGE_BUTTON_ZINDEX,\n bottom: 0,\n right: '1.5rem'\n});\n\n/**\n * @private\n */\nexport const chatMessageDateStyle: CSSProperties = {\n fontWeight: 600\n};\n\n/**\n * @private\n */\nexport const useChatMessageStyles = makeStyles({\n root: {\n paddingTop: '0',\n '&:focus-visible': {\n ...shorthands.outline('0')\n }\n },\n body: {\n maxWidth: '100%',\n minWidth: `${CHAT_MESSAGE_CONTAINER_MIN_WIDTH_REM}rem`,\n marginRight: '0rem',\n paddingBottom: '10px',\n zIndex: CHAT_MESSAGE_ZINDEX,\n // This makes message bubble show border in high contrast mode making each message distinguishable\n ...shorthands.border('1px', 'solid', 'transparent'),\n '& > div:first-of-type': {\n flexWrap: 'wrap'\n },\n '& msft-mention': {\n color: tokens.colorStatusWarningBackground3,\n fontWeight: tokens.fontWeightSemibold\n },\n '& img': {\n maxWidth: '100% !important', // Add !important to make sure it won't be overridden by style defined in element\n height: 'auto !important'\n },\n '& video': {\n maxWidth: '100% !important', // Add !important to make sure it won't be overridden by style defined in element\n height: 'auto !important'\n },\n '& p': {\n // Deal with awkward padding seen in messages from Teams.\n // For more info see https://github.com/Azure/communication-ui-library/pull/1507\n ...shorthands.marginBlock('0.125rem')\n },\n '& blockquote': {\n backgroundColor: tokens.colorBrandBackgroundInverted,\n clear: 'left',\n minHeight: '2.25rem',\n width: 'fit-content',\n marginTop: '7px',\n marginRight: '0px',\n marginLeft: '0px',\n marginBottom: '7px',\n paddingTop: '7px',\n paddingRight: '15px',\n paddingLeft: '15px',\n paddingBottom: '7px',\n ...shorthands.border('solid'),\n ...shorthands.borderRadius('4px'),\n ...shorthands.borderWidth('1px'),\n ...shorthands.borderColor(tokens.colorNeutralStroke1Selected),\n borderLeftWidth: '4px'\n },\n '& table': {\n backgroundColor: tokens.colorBrandBackgroundInverted,\n ...shorthands.borderColor(tokens.colorNeutralStroke1Selected),\n borderCollapse: 'collapse',\n tableLayout: 'auto',\n width: '100%',\n\n '& tr': {\n ...shorthands.border('1px', 'solid', `${tokens.colorNeutralStroke1Selected}`),\n\n '& td': {\n ...shorthands.border('1px', 'solid', `${tokens.colorNeutralStroke1Selected}`),\n wordBreak: 'normal',\n paddingTop: '0px',\n paddingRight: '5px'\n }\n }\n }\n },\n bodyWithoutAvatar: {\n marginTop: '0.125rem'\n },\n bodyWithAvatar: {\n marginTop: `0.375rem`\n },\n avatarNoOverlap: {\n marginLeft: `${-AVATAR_MARGIN_LEFT + AVATAR_MESSAGE_GAP_REM}rem`\n },\n avatarOverlap: {\n marginLeft: `${-AVATAR_MARGIN_LEFT - MESSAGE_AVATAR_OVERLAP_REM}rem`\n }\n});\n\n/**\n * @private\n */\nexport const useChatMessageCommonStyles = makeStyles({\n failed: {\n //TODO: can we reuse a theme color here?\n backgroundColor: 'rgba(168, 0, 0, 0.2)'\n },\n blocked: {\n maxWidth: '100%',\n minWidth: `${CHAT_MESSAGE_CONTAINER_MIN_WIDTH_REM}rem`,\n marginRight: '0rem',\n color: tokens.colorNeutralForeground2,\n\n // This makes message bubble show border in high contrast mode making each message distinguishable\n ...shorthands.border('1px', 'solid', 'transparent'),\n '& i': {\n paddingTop: '0.25rem'\n },\n\n '& p': {\n // Deal with awkward padding seen in messages from Teams.\n // For more info see https://github.com/Azure/communication-ui-library/pull/1507\n ...shorthands.marginBlock('0.125rem'),\n paddingRight: '0.75rem',\n fontStyle: 'italic'\n },\n\n '& a': {\n ...shorthands.marginBlock('0.125rem'),\n fontStyle: 'normal',\n color: tokens.colorBrandForegroundLink,\n ...shorthands.textDecoration('none')\n }\n }\n});\n\n/**\n * @private\n */\nexport const gutterWithAvatar: ComponentSlotStyle = {\n paddingTop: '1.65rem',\n width: `${AVATAR_WIDTH_REM}rem`,\n position: 'relative',\n float: 'left',\n display: 'block',\n visibility: 'visible',\n zIndex: AVATAR_ZINDEX\n};\n\n/**\n * @private\n */\nexport const gutterWithHiddenAvatar: ComponentSlotStyle = {\n ...gutterWithAvatar,\n visibility: 'hidden',\n // we use this hidden avatar just as a width placeholder\n // the placeholder is needed for responsive bubble width\n height: 0\n};\n\n/**\n * @private\n */\nexport const newMessageButtonStyle = mergeStyles({\n float: 'right',\n width: 'fit-content'\n});\n\n/**\n * @private\n */\nexport const buttonWithIconStyles: IButtonStyles = {\n textContainer: {\n display: 'contents'\n }\n};\n\n/**\n * @private\n */\nexport const loadPreviousMessageButtonStyle = mergeStyles({\n border: 'none',\n minHeight: '1.5rem',\n '&:hover': { background: 'none' },\n '&:active': { background: 'none' }\n});\n\n/**\n * @private\n */\nexport const DownIconStyle = mergeStyles({\n marginRight: '0.5em'\n});\n"]}
|
@@ -34,6 +34,14 @@ export declare const fileUploadCardsStyles: string;
|
|
34
34
|
* @private
|
35
35
|
*/
|
36
36
|
export declare const fileCardBoxStyle: string;
|
37
|
+
/**
|
38
|
+
* @private
|
39
|
+
*/
|
40
|
+
export declare const defaultSendBoxInactiveBorderThicknessREM = 0.0625;
|
41
|
+
/**
|
42
|
+
* @private
|
43
|
+
*/
|
44
|
+
export declare const defaultSendBoxActiveBorderThicknessREM = 0.125;
|
37
45
|
/**
|
38
46
|
* @private
|
39
47
|
*/
|
@@ -51,8 +51,14 @@ export const fileCardBoxStyle = mergeStyles({
|
|
51
51
|
width: '100%',
|
52
52
|
padding: '0.50rem'
|
53
53
|
});
|
54
|
-
|
55
|
-
|
54
|
+
/**
|
55
|
+
* @private
|
56
|
+
*/
|
57
|
+
export const defaultSendBoxInactiveBorderThicknessREM = 0.0625;
|
58
|
+
/**
|
59
|
+
* @private
|
60
|
+
*/
|
61
|
+
export const defaultSendBoxActiveBorderThicknessREM = 0.125;
|
56
62
|
/**
|
57
63
|
* @private
|
58
64
|
*/
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"SendBox.styles.js","sourceRoot":"","sources":["../../../../../../../react-components/src/components/styles/SendBox.styles.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EAAE,WAAW,EAAiB,MAAM,iBAAiB,CAAC;AAE7D;;GAEG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG;IAC/B,aAAa,EAAE,EAAE,SAAS,EAAE,GAAG,EAAE,QAAQ,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,KAAK,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE;IACtF,IAAI,EAAE,EAAE,OAAO,EAAE,MAAM,EAAE;CAC1B,CAAC;AAEF;;GAEG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG,WAAW,CAAC;IAC9C,MAAM,EAAE,SAAS;IACjB,QAAQ,EAAE,QAAQ;IAClB;;OAEG;IACH,oBAAoB,EAAE;QACpB,SAAS,EAAE,SAAS;KACrB;CACF,CAAC,CAAC;AAEH;;GAEG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,WAAW,CAAC;IACzC,MAAM,EAAE,SAAS;IACjB,KAAK,EAAE,SAAS;CACjB,CAAC,CAAC;AAEH;;GAEG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG,WAAW,CAAC;IACvC,KAAK,EAAE,SAAS;IAChB,MAAM,EAAE,SAAS;IACjB,MAAM,EAAE,MAAM;CACf,CAAC,CAAC;AAEH;;GAEG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAG,WAAW,CAAC;IAC/C,MAAM,EAAE,2BAA2B;IACnC,SAAS,EAAE,SAAS;IACpB,QAAQ,EAAE,MAAM;CACjB,CAAC,CAAC;AAEH;;GAEG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,WAAW,CAAC;IAC1C,KAAK,EAAE,MAAM;IACb,OAAO,EAAE,SAAS;CACnB,CAAC,CAAC;AAEH,MAAM,wCAAwC,GAAG,MAAM,CAAC;
|
1
|
+
{"version":3,"file":"SendBox.styles.js","sourceRoot":"","sources":["../../../../../../../react-components/src/components/styles/SendBox.styles.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EAAE,WAAW,EAAiB,MAAM,iBAAiB,CAAC;AAE7D;;GAEG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG;IAC/B,aAAa,EAAE,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WAAW,GAAG,eAAe,CAAC,CAAC,CAAC,KAAK,CAAC,cAAc,CAAC,SAAS,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,gBAAgB,CAAC;IACtG,MAAM,iBAAiB,GAAG,eAAe,CAAC,CAAC,CAAC,KAAK,CAAC,cAAc,CAAC,SAAS,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,YAAY,CAAC;IAExG,MAAM,eAAe,GAAG,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,wCAAwC,CAAC;IAChF,MAAM,qBAAqB,GAAG,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,sCAAsC,CAAC;IAEpF,OAAO;QACL,YAAY,EAAE,KAAK,CAAC,OAAO,CAAC,cAAc;QAC1C,MAAM,EAAE,GAAG,eAAe,aAAa,WAAW,EAAE;QAEpD,mHAAmH;QACnH,uHAAuH;QACvH,MAAM,EAAE,GAAG,sCAAsC,GAAG,eAAe,KAAK;QAExE,wCAAwC,EAAE;YACxC,MAAM,EAAE,GAAG,qBAAqB,aAAa,iBAAiB,EAAE;YAChE,MAAM,EAAE,GAAG,sCAAsC,GAAG,qBAAqB,KAAK;SAC/E;KACF,CAAC;AACJ,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { mergeStyles, IStyle, Theme } from '@fluentui/react';\n\n/**\n * @private\n */\nexport const suppressIconStyle = {\n iconContainer: { minHeight: '0', minWidth: '0', height: '0', width: '0', margin: '0' },\n icon: { display: 'none' }\n};\n\n/**\n * @private\n */\nexport const sendBoxWrapperStyles = mergeStyles({\n margin: '0.25rem',\n overflow: 'hidden',\n /**\n * margin-top set for all the child components of sendbox except first\n */\n ':not(:first-child)': {\n marginTop: '0.25rem'\n }\n});\n\n/**\n * @private\n */\nexport const sendButtonStyle = mergeStyles({\n height: '2.25rem',\n width: '2.25rem'\n});\n\n/**\n * @private\n */\nexport const sendIconStyle = mergeStyles({\n width: '1.25rem',\n height: '1.25rem',\n margin: 'auto'\n});\n\n/**\n * @private\n */\nexport const fileUploadCardsStyles = mergeStyles({\n margin: '0 0.25rem 0.25rem 0.25rem',\n maxHeight: '12.5rem',\n overflow: 'auto'\n});\n\n/**\n * @private\n */\nexport const fileCardBoxStyle = mergeStyles({\n width: '100%',\n padding: '0.50rem'\n});\n\n/**\n * @private\n */\nexport const defaultSendBoxInactiveBorderThicknessREM = 0.0625;\n/**\n * @private\n */\nexport const defaultSendBoxActiveBorderThicknessREM = 0.125;\n\n/**\n * @private\n */\nexport const borderAndBoxShadowStyle = (props: {\n theme: Theme;\n hasErrorMessage: boolean;\n disabled: boolean;\n}): IStyle => {\n const { theme, hasErrorMessage, disabled } = props;\n const borderColor = hasErrorMessage ? theme.semanticColors.errorText : theme.palette.neutralSecondary;\n const borderColorActive = hasErrorMessage ? theme.semanticColors.errorText : theme.palette.themePrimary;\n\n const borderThickness = disabled ? 0 : defaultSendBoxInactiveBorderThicknessREM;\n const borderActiveThickness = disabled ? 0 : defaultSendBoxActiveBorderThicknessREM;\n\n return {\n borderRadius: theme.effects.roundedCorner4,\n border: `${borderThickness}rem solid ${borderColor}`,\n\n // The border thickness of the sendbox wrapper changes on hover, to prevent the border thickness change causing the\n // input box to shift we apply a margin to compensate. This margin is then removed on hover when the border is thicker.\n margin: `${defaultSendBoxActiveBorderThicknessREM - borderThickness}rem`,\n\n ':hover, :active, :focus, :focus-within': {\n border: `${borderActiveThickness}rem solid ${borderColorActive}`,\n margin: `${defaultSendBoxActiveBorderThicknessREM - borderActiveThickness}rem`\n }\n };\n};\n"]}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"SystemMessage.styles.js","sourceRoot":"","sources":["../../../../../../../react-components/src/components/styles/SystemMessage.styles.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAE9C;;GAEG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAG,WAAW,CAAC;IAChD,
|
1
|
+
{"version":3,"file":"SystemMessage.styles.js","sourceRoot":"","sources":["../../../../../../../react-components/src/components/styles/SystemMessage.styles.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAE9C;;GAEG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAG,WAAW,CAAC;IAChD,eAAe,EAAE,UAAU;CAC5B,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { mergeStyles } from '@fluentui/react';\n\n/**\n * @private\n */\nexport const systemMessageIconStyle = mergeStyles({\n marginInlineEnd: '0.688rem'\n});\n"]}
|
@@ -0,0 +1,12 @@
|
|
1
|
+
/// <reference types="react" />
|
2
|
+
import { IStyle } from '@fluentui/react';
|
3
|
+
import { ComponentSlotStyle } from '../../types';
|
4
|
+
/**
|
5
|
+
* Function to create a React.CSSProperties object from a v8 style object.
|
6
|
+
* This function is still not ideal
|
7
|
+
* as v8Style can use pseudo-class selectors that style objects can't process correctly.
|
8
|
+
*
|
9
|
+
* @private
|
10
|
+
*/
|
11
|
+
export declare function createStyleFromV8Style(v8Style: IStyle | ComponentSlotStyle): React.CSSProperties | undefined;
|
12
|
+
//# sourceMappingURL=v8StyleShim.d.ts.map
|
@@ -0,0 +1,37 @@
|
|
1
|
+
// Copyright (c) Microsoft Corporation.
|
2
|
+
// Licensed under the MIT License.
|
3
|
+
/**
|
4
|
+
* Function to create a React.CSSProperties object from a v8 style object.
|
5
|
+
* This function is still not ideal
|
6
|
+
* as v8Style can use pseudo-class selectors that style objects can't process correctly.
|
7
|
+
*
|
8
|
+
* @private
|
9
|
+
*/
|
10
|
+
export function createStyleFromV8Style(v8Style) {
|
11
|
+
const result = {};
|
12
|
+
if (v8Style === undefined || v8Style === null || typeof v8Style === 'boolean' || typeof v8Style === 'string') {
|
13
|
+
return undefined;
|
14
|
+
}
|
15
|
+
else if (typeof v8Style === 'object') {
|
16
|
+
// v8Style is a style object
|
17
|
+
for (const record in v8Style) {
|
18
|
+
if (typeof v8Style[record] === 'string') {
|
19
|
+
// v8Style[record] is just a simple style
|
20
|
+
const msSuffix = 'MS';
|
21
|
+
if (record.startsWith(msSuffix)) {
|
22
|
+
// React.CSSProperties uses camelCase for MS properties but v8Style uses PascalCase
|
23
|
+
const newRecord = record.substring(0, msSuffix.length).toLowerCase + record.substring(msSuffix.length);
|
24
|
+
result[newRecord] = v8Style[record];
|
25
|
+
}
|
26
|
+
else {
|
27
|
+
result[record] = v8Style[record];
|
28
|
+
}
|
29
|
+
}
|
30
|
+
else {
|
31
|
+
result[record] = createStyleFromV8Style(v8Style[record]);
|
32
|
+
}
|
33
|
+
}
|
34
|
+
}
|
35
|
+
return result;
|
36
|
+
}
|
37
|
+
//# sourceMappingURL=v8StyleShim.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"v8StyleShim.js","sourceRoot":"","sources":["../../../../../../../react-components/src/components/styles/v8StyleShim.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAKlC;;;;;;GAMG;AACH,MAAM,UAAU,sBAAsB,CAAC,OAAoC;IACzE,MAAM,MAAM,GAAG,EAAE,CAAC;IAClB,IAAI,OAAO,KAAK,SAAS,IAAI,OAAO,KAAK,IAAI,IAAI,OAAO,OAAO,KAAK,SAAS,IAAI,OAAO,OAAO,KAAK,QAAQ,EAAE;QAC5G,OAAO,SAAS,CAAC;KAClB;SAAM,IAAI,OAAO,OAAO,KAAK,QAAQ,EAAE;QACtC,4BAA4B;QAC5B,KAAK,MAAM,MAAM,IAAI,OAAO,EAAE;YAC5B,IAAI,OAAO,OAAO,CAAC,MAAM,CAAC,KAAK,QAAQ,EAAE;gBACvC,yCAAyC;gBACzC,MAAM,QAAQ,GAAG,IAAI,CAAC;gBACtB,IAAI,MAAM,CAAC,UAAU,CAAC,QAAQ,CAAC,EAAE;oBAC/B,mFAAmF;oBACnF,MAAM,SAAS,GAAG,MAAM,CAAC,SAAS,CAAC,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC,WAAW,GAAG,MAAM,CAAC,SAAS,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;oBACvG,MAAM,CAAC,SAAS,CAAC,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;iBACrC;qBAAM;oBACL,MAAM,CAAC,MAAM,CAAC,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;iBAClC;aACF;iBAAM;gBACL,MAAM,CAAC,MAAM,CAAC,GAAG,sBAAsB,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC;aAC1D;SACF;KACF;IAED,OAAO,MAAM,CAAC;AAChB,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { IStyle } from '@fluentui/react';\nimport { ComponentSlotStyle } from '../../types';\n\n/**\n * Function to create a React.CSSProperties object from a v8 style object.\n * This function is still not ideal\n * as v8Style can use pseudo-class selectors that style objects can't process correctly.\n *\n * @private\n */\nexport function createStyleFromV8Style(v8Style: IStyle | ComponentSlotStyle): React.CSSProperties | undefined {\n const result = {};\n if (v8Style === undefined || v8Style === null || typeof v8Style === 'boolean' || typeof v8Style === 'string') {\n return undefined;\n } else if (typeof v8Style === 'object') {\n // v8Style is a style object\n for (const record in v8Style) {\n if (typeof v8Style[record] === 'string') {\n // v8Style[record] is just a simple style\n const msSuffix = 'MS';\n if (record.startsWith(msSuffix)) {\n // React.CSSProperties uses camelCase for MS properties but v8Style uses PascalCase\n const newRecord = record.substring(0, msSuffix.length).toLowerCase + record.substring(msSuffix.length);\n result[newRecord] = v8Style[record];\n } else {\n result[record] = v8Style[record];\n }\n } else {\n result[record] = createStyleFromV8Style(v8Style[record]);\n }\n }\n }\n\n return result;\n}\n"]}
|
@@ -8,16 +8,15 @@ export declare const formatTimeForChatMessage: (messageDate: Date) => string;
|
|
8
8
|
*/
|
9
9
|
export declare const formatDateForChatMessage: (messageDate: Date) => string;
|
10
10
|
/**
|
11
|
-
* Given a message date object in ISO8601 and a current date object, generates a user friendly timestamp text
|
12
|
-
*
|
13
|
-
*
|
14
|
-
*
|
15
|
-
*
|
16
|
-
*
|
17
|
-
* 2021-01-10 1:30 p.m.
|
11
|
+
* Given a message date object in ISO8601 and a current date object, generates a user friendly timestamp text
|
12
|
+
* using the system locale.
|
13
|
+
* <time in locale format>.
|
14
|
+
* Yesterday <time in locale format>.
|
15
|
+
* <dateStrings day of week> <time in locale format>.
|
16
|
+
* <date in locale format> <time in locale format>.
|
18
17
|
*
|
19
18
|
* If message is after yesterday, then only show the time.
|
20
|
-
* If message is before
|
19
|
+
* If message is before yesterday and after day before yesterday, then show 'Yesterday' plus the time.
|
21
20
|
* If message is before day before yesterday and within the current week, then show 'Monday/Tuesday/etc' plus the time.
|
22
21
|
* - We consider start of the week as Sunday. If current day is Sunday, then any time before that is in previous week.
|
23
22
|
* If message is in previous or older weeks, then show date string plus the time.
|