-
Notifications
You must be signed in to change notification settings - Fork 1.5k
/
defaultStyleOptions.ts
311 lines (259 loc) · 12.9 KB
/
defaultStyleOptions.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
/* eslint no-magic-numbers: "off" */
import StyleOptions from './StyleOptions';
function fontFamily(fonts) {
return fonts.map(font => `'${font}'`).join(', ');
}
const DEFAULT_ACCENT = '#0063B1';
const DEFAULT_SUBTLE = '#767676'; // With contrast 4.5:1 to white
const PADDING_REGULAR = 10;
const DEFAULT_OPTIONS: Required<StyleOptions> = {
// Basic styling
accent: DEFAULT_ACCENT,
backgroundColor: 'White',
subtle: DEFAULT_SUBTLE,
paddingRegular: PADDING_REGULAR,
paddingWide: PADDING_REGULAR * 2,
fontSizeSmall: '80%',
monospaceFont: fontFamily(['Consolas', 'Courier New', 'monospace']),
primaryFont: fontFamily(['Calibri', 'Helvetica Neue', 'Arial', 'sans-serif']),
// Root
rootHeight: '100%',
rootWidth: '100%',
rootZIndex: 0, // "z-index" for the root container of Web Chat. This will form a new stacking context so "z-index" used in children won't pollute.
transitionDuration: '0s',
// Avatar
avatarBorderRadius: '50%',
avatarSize: 40,
botAvatarBackgroundColor: undefined,
botAvatarImage: undefined,
botAvatarInitials: undefined,
userAvatarBackgroundColor: undefined,
userAvatarImage: undefined,
userAvatarInitials: undefined,
showAvatarInGroup: 'status',
// Bubble
// TODO: Should we make a bubbleFromBot*
bubbleBackground: 'White',
bubbleBorderColor: '#E6E6E6',
bubbleBorderRadius: 2,
bubbleBorderStyle: 'solid',
bubbleBorderWidth: 1,
bubbleFromUserBackground: 'White',
bubbleFromUserBorderColor: '#E6E6E6',
bubbleFromUserBorderRadius: 2,
bubbleFromUserBorderStyle: 'solid',
bubbleFromUserBorderWidth: 1,
bubbleFromUserNubOffset: 0,
bubbleFromUserNubSize: undefined,
bubbleFromUserTextColor: 'Black',
bubbleImageHeight: undefined,
bubbleImageMaxHeight: 240, // Based on previously default `bubbleImageHeight` of 240px.
bubbleImageMinHeight: 240, // TODO: Should change to 180px. Based on 320px bubble width showing a 16:9 image, or `320 / (16 / 9)`. 320px bubble width is based on 360px wide of the chat canvas.
bubbleMaxWidth: undefined, // Deprecated.
bubbleMinWidth: undefined, // Deprecated.
bubbleAttachmentMaxWidth: 480, // Based off screen width = 600px
bubbleAttachmentMinWidth: 250, // min screen width = 300px; Microsoft Edge requires 372px (https://developer.microsoft.com/en-us/microsoft-edge/platform/issues/13621468/)
bubbleMessageMaxWidth: 480, // Based off screen width = 600px
bubbleMessageMinWidth: 0,
bubbleMinHeight: 40,
bubbleNubOffset: 0,
bubbleNubSize: undefined,
bubbleTextColor: 'Black',
messageActivityWordBreak: 'break-word',
// Connectivity UI
connectivityIconPadding: PADDING_REGULAR * 1.2,
connectivityMarginLeftRight: PADDING_REGULAR * 1.4,
connectivityMarginTopBottom: PADDING_REGULAR * 0.8,
connectivityTextSize: '75%',
failedConnectivity: '#C50F1F',
slowConnectivity: '#EAA300',
notificationText: '#5E5E5E',
slowConnectionAfter: 15000,
// Emoji
emojiSet: true,
// Live region - Accessibility
internalLiveRegionFadeAfter: 1000,
// Markdown
markdownExternalLinkIconImage:
'url(data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIzIDMgMTggMTgiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTcuMjUwMSA0LjUwMDE3SDEwLjc0OTVDMTEuMTYzNyA0LjUwMDE3IDExLjQ5OTUgNC44MzU5NiAxMS40OTk1IDUuMjUwMTdDMTEuNDk5NSA1LjYyOTg2IDExLjIxNzMgNS45NDM2NiAxMC44NTEzIDUuOTkzMzJMMTAuNzQ5NSA2LjAwMDE3SDcuMjQ5NzRDNi4wNzA3OSA1Ljk5OTYxIDUuMTAzNDkgNi45MDY1NiA1LjAwNzg2IDguMDYxMTJMNS4wMDAyOCA4LjIyMDAzTDUuMDAzMTIgMTYuNzUwN0M1LjAwMzQzIDE3Ljk0MTUgNS45Mjg4NSAxOC45MTYxIDcuMDk5NjYgMTguOTk0OUw3LjI1MzcxIDE5LjAwMDFMMTUuNzUxOCAxOC45ODg0QzE2Ljk0MTUgMTguOTg2OCAxNy45MTQ1IDE4LjA2MiAxNy45OTM1IDE2Ljg5MjNMMTcuOTk4NyAxNi43Mzg0VjEzLjIzMjFDMTcuOTk4NyAxMi44MTc5IDE4LjMzNDUgMTIuNDgyMSAxOC43NDg3IDEyLjQ4MjFDMTkuMTI4NCAxMi40ODIxIDE5LjQ0MjIgMTIuNzY0MyAxOS40OTE4IDEzLjEzMDNMMTkuNDk4NyAxMy4yMzIxVjE2LjczODRDMTkuNDk4NyAxOC43NDA3IDE3LjkyOTMgMjAuMzc2OSAxNS45NTI4IDIwLjQ4MjlMMTUuNzUzOCAyMC40ODg0TDcuMjU4Mjc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g1MzI0TDEyLjk5ODEgMy43NTE0NkMxMi45OTgxIDMuMzcxNzcgMTMuMjgwMyAzLjA1Nzk3IDEzLjY0NjQgMy4wMDgzMUwxMy43NDgxIDMuMDAxNDZaIiBmaWxsPSIjMjEyMTIxIiAvPjwvc3ZnPg==)',
markdownRespectCRLF: true,
markdownRenderHTML: true,
// Scroll behavior
hideScrollToEndButton: undefined, // Deprecated as of 4.14.0. Use "scrollToEndButtonBehavior" instead. Remove on or after 2023-06-02.
autoScrollSnapOnActivity: false,
autoScrollSnapOnActivityOffset: 0,
autoScrollSnapOnPage: false,
autoScrollSnapOnPageOffset: 0, // TODO: Rename from "autoScrollSnapOnPageoffset".
// Send box
hideSendBox: false,
hideUploadButton: false,
hideTelephoneKeypadButton: true,
microphoneButtonColorOnDictate: '#F33',
sendBoxBackground: 'White',
uploadAccept: undefined,
uploadMultiple: true,
sendAttachmentOn: 'send',
// Send box buttons
sendBoxButtonColor: undefined,
sendBoxButtonShadeColor: undefined,
sendBoxButtonColorOnActive: undefined,
sendBoxButtonShadeColorOnActive: '#EDEBE9',
sendBoxButtonColorOnDisabled: '#A19F9D',
sendBoxButtonShadeColorOnDisabled: '#F3F2F1',
sendBoxButtonColorOnFocus: undefined,
sendBoxButtonShadeColorOnFocus: undefined,
sendBoxButtonColorOnHover: undefined,
sendBoxButtonShadeColorOnHover: '#F3F2F1',
sendBoxButtonShadeBorderRadius: 2,
sendBoxButtonShadeInset: 2,
sendBoxButtonKeyboardFocusIndicatorBorderColor: '#605E5C',
sendBoxButtonKeyboardFocusIndicatorBorderRadius: 0,
sendBoxButtonKeyboardFocusIndicatorBorderStyle: 'solid',
sendBoxButtonKeyboardFocusIndicatorBorderWidth: 1,
sendBoxButtonKeyboardFocusIndicatorInset: 4,
sendBoxDisabledTextColor: undefined,
sendBoxHeight: 40,
sendBoxMaxHeight: 200,
sendBoxTextColor: 'Black',
// TODO: We should deprecate this because there isn't an easy way to make the width of the send box narrower than the transcript
sendBoxBorderBottom: undefined,
sendBoxBorderLeft: undefined,
sendBoxBorderRight: undefined,
sendBoxBorderTop: 'solid 1px #E6E6E6',
sendBoxPlaceholderColor: undefined,
sendBoxTextWrap: false,
sendBoxButtonAlignment: 'stretch',
// Visually show spoken text
showSpokenText: false,
spinnerAnimationBackgroundImage: undefined,
spinnerAnimationHeight: 16,
spinnerAnimationWidth: 16,
spinnerAnimationPadding: 12,
// Suggested actions
suggestedActionBorderRadius: 0,
suggestedActionHeight: 40,
suggestedActionImageHeight: 20,
suggestedActionLayout: 'carousel',
suggestedActionBackgroundColor: 'White',
suggestedActionBorderColor: undefined,
suggestedActionBorderStyle: 'solid',
suggestedActionBorderWidth: 2,
suggestedActionTextColor: undefined,
suggestedActionBackgroundColorOnActive: '#EDEBE9',
suggestedActionBorderColorOnActive: undefined,
suggestedActionBorderStyleOnActive: undefined,
suggestedActionBorderWidthOnActive: undefined,
suggestedActionTextColorOnActive: undefined,
suggestedActionBackgroundColorOnDisabled: undefined,
suggestedActionBorderColorOnDisabled: '#E6E6E6',
suggestedActionBorderStyleOnDisabled: undefined,
suggestedActionBorderWidthOnDisabled: undefined,
suggestedActionTextColorOnDisabled: undefined,
suggestedActionBackgroundColorOnFocus: undefined,
suggestedActionBorderColorOnFocus: undefined,
suggestedActionBorderStyleOnFocus: undefined,
suggestedActionBorderWidthOnFocus: undefined,
suggestedActionTextColorOnFocus: undefined,
suggestedActionBackgroundColorOnHover: '#F3F2F1',
suggestedActionBorderColorOnHover: undefined,
suggestedActionBorderStyleOnHover: undefined,
suggestedActionBorderWidthOnHover: undefined,
suggestedActionTextColorOnHover: undefined,
suggestedActionKeyboardFocusIndicatorBorderColor: '#605E5C',
suggestedActionKeyboardFocusIndicatorBorderRadius: 0,
suggestedActionKeyboardFocusIndicatorBorderStyle: 'dashed',
suggestedActionKeyboardFocusIndicatorBorderWidth: 1,
suggestedActionKeyboardFocusIndicatorInset: 2,
suggestedActionActiveBackground: undefined, // Deprecated as of 4.15.0. Remove on or after 2023-09-16.
suggestedActionBackground: undefined, // Deprecated as of 4.15.0. Remove on or after 2023-09-16.
suggestedActionDisabledBackground: undefined, // Deprecated as of 4.15.0. Remove on or after 2023-09-16.
suggestedActionDisabledBorderColor: undefined, // Deprecated as of 4.15.0. Remove on or after 2023-09-16.
suggestedActionDisabledBorderStyle: undefined, // Deprecated as of 4.15.0. Remove on or after 2023-09-16.
suggestedActionDisabledBorderWidth: undefined, // Deprecated as of 4.15.0. Remove on or after 2023-09-16.
suggestedActionDisabledTextColor: undefined, // Deprecated as of 4.15.0. Remove on or after 2023-09-16.
suggestedActionFocusBackground: undefined, // Deprecated as of 4.15.0. Remove on or after 2023-09-16.
suggestedActionHoverBackground: undefined, // Deprecated as of 4.15.0. Remove on or after 2023-09-16.
// Suggested actions carousel layout
suggestedActionsCarouselFlipperCursor: undefined,
suggestedActionsCarouselFlipperBoxWidth: 40,
suggestedActionsCarouselFlipperSize: 20,
// Suggested actions flow layout
suggestedActionsFlowMaxHeight: undefined,
// Suggested actions stacked layout
suggestedActionsStackedHeight: undefined,
suggestedActionsStackedOverflow: undefined,
suggestedActionsStackedLayoutButtonMaxHeight: undefined,
suggestedActionsStackedLayoutButtonTextWrap: false,
suggestedActionsVisualKeyboardIndicatorColor: 'Black',
suggestedActionsVisualKeyboardIndicatorStyle: 'solid',
suggestedActionsVisualKeyboardIndicatorWidth: 2,
// Timestamp
groupTimestamp: true,
sendTimeout: 20000,
sendTimeoutForAttachments: 120000,
timestampColor: undefined,
timestampFormat: 'relative',
// Transcript overlay buttons
scrollToEndButtonBehavior: 'unread',
scrollToEndButtonFontSize: '85%',
newMessagesButtonFontSize: undefined, // Deprecated as of 4.14.0, renamed to "scrollToEndButtonFontSize". Remove on or after 2023-06-02.
transcriptOverlayButtonBackground: 'rgba(0, 0, 0, .6)',
transcriptOverlayButtonBackgroundOnDisabled: 'rgba(0, 0, 0, .6)',
transcriptOverlayButtonBackgroundOnFocus: 'rgba(0, 0, 0, .8)',
transcriptOverlayButtonBackgroundOnHover: 'rgba(0, 0, 0, .8)',
transcriptOverlayButtonColor: 'White',
transcriptOverlayButtonColorOnDisabled: 'White',
transcriptOverlayButtonColorOnFocus: undefined,
transcriptOverlayButtonColorOnHover: undefined,
// Toast UI
notificationDebounceTimeout: 400,
hideToaster: false,
toasterHeight: 32,
toasterMaxHeight: 32 * 5,
toasterSingularMaxHeight: 50,
toastFontSize: '87.5%',
toastIconWidth: 36,
toastSeparatorColor: '#E8EAEC',
toastTextPadding: 6,
toastErrorBackgroundColor: '#FDE7E9',
toastErrorColor: '#A80000',
toastInfoBackgroundColor: '#CEF1FF',
toastInfoColor: '#105E7D',
toastSuccessBackgroundColor: '#DFF6DD',
toastSuccessColor: '#107C10',
toastWarnBackgroundColor: '#FFF4CE',
toastWarnColor: '#3B3A39',
// Transcript
transcriptTerminatorBackgroundColor: '#595959',
transcriptTerminatorBorderRadius: 5,
transcriptTerminatorColor: 'White',
transcriptTerminatorFontSize: 12,
transcriptActivityVisualKeyboardIndicatorColor: DEFAULT_SUBTLE,
transcriptActivityVisualKeyboardIndicatorStyle: 'dashed',
transcriptActivityVisualKeyboardIndicatorWidth: 1,
transcriptVisualKeyboardIndicatorColor: 'Black',
transcriptVisualKeyboardIndicatorStyle: 'solid',
transcriptVisualKeyboardIndicatorWidth: 2,
// Typing animation
typingAnimationBackgroundImage: undefined,
typingAnimationDuration: 5000,
typingAnimationHeight: 20,
typingAnimationWidth: 64,
// Upload thumbnail
// TODO: [P0] #3322 This is only supported in HTML.
enableUploadThumbnail: true,
uploadThumbnailContentType: 'image/jpeg',
uploadThumbnailHeight: 360,
uploadThumbnailQuality: 0.6,
uploadThumbnailWidth: 720,
// Video
videoHeight: 270, // based on bubbleMaxWidth: 480 / 16 * 9 = 270
maxMessageLength: 2000,
stylesRoot: document.head,
// Border animation
borderAnimationColor1: '#203C91',
borderAnimationColor2: '#4DD3FF',
borderAnimationColor3: '#2B8DD8',
codeBlockTheme: 'github-light-default' as const
};
export default DEFAULT_OPTIONS;