@micromag/screen-conversation 0.3.829 → 0.4.4
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/assets/css/styles.css +1 -1
- package/es/index.d.ts +125 -0
- package/es/index.js +77 -136
- package/es/styles.css +1 -0
- package/package.json +22 -21
package/assets/css/styles.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.
|
|
1
|
+
.container{display:-ms-flexbox;display:flex;height:100%;overflow:hidden;position:relative;width:100%;-ms-flex-align:center;align-items:center;-ms-flex-pack:start;justify-content:flex-start}.container .background{height:100%;left:0;position:absolute;top:0;width:100%;z-index:0}.container .content{z-index:1}.container .conversationHeader{font-style:italic;padding-bottom:16px;width:100%}.container .empty{height:200px}.container .title{padding-bottom:16px}.container .footer{-webkit-transition:opacity .2s ease-out;transition:opacity .2s ease-out}.container .footer a{padding:0}.container .footer.disabled{opacity:0;pointer-events:none}.layout{-webkit-transition:padding .2s ease-out;transition:padding .2s ease-out}.messageContainer{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:start;color:#000;justify-content:flex-start}.messageContainer .message{background-color:#fff;margin:1px 0;max-width:80%;word-wrap:break-word}.messageContainer .message>:first-child{padding-top:10px}.messageContainer .message.normalLeft{border-radius:1px 15px 15px}.messageContainer .message.inBetweenLeft{border-radius:1px 15px 15px 1px}.messageContainer .message.normalRight{background-color:#58afff;border-radius:15px 1px 15px 15px}.messageContainer .message.inBetweenRight{background-color:#58afff;border-radius:15px 1px 1px 15px}.messageContainer .message.last{margin:1px 0 16px}.messageContainer .messageBody>*{padding-bottom:10px;padding-left:10px;padding-right:10px}.messageContainer .speakerDetails{display:-ms-flexbox;display:flex;width:100%;-ms-flex-align:center;align-items:center;-ms-flex-pack:start;justify-content:flex-start;padding-left:10px;padding-right:10px}.messageContainer .speakerDetails.right{-ms-flex-direction:row-reverse;flex-direction:row-reverse}.messageContainer .avatarContainer{height:30px;margin-right:10px;width:30px}.messageContainer .avatarContainer.right{margin-left:10px;margin-right:0}.messageContainer .avatar{border-radius:50%;display:inline-block;height:100%;-o-object-fit:cover;object-fit:cover;width:100%}.messageContainer .imageContainer{height:100%;padding-bottom:10px;width:100%}.messageContainer.withAnimation .message{-webkit-animation:appear .18s ease forwards;animation:appear .18s ease forwards}.messageContainer.withAnimation .message.normalLeft{-webkit-transform:translate(-300px) scale(.5);-ms-transform:translate(-300px) scale(.5);transform:translate(-300px) scale(.5)}.messageContainer.withAnimation .message.inBetweenLeft{border-radius:1px 15px 15px 1px}.messageContainer.withAnimation .message.normalRight{-webkit-transform:translate(300px) scale(.5);-ms-transform:translate(300px) scale(.5);transform:translate(300px) scale(.5)}.messageContainer.withAnimation .message:first-child{-webkit-animation:appear 0s ease forwards;animation:appear 0s ease forwards}@-webkit-keyframes appear{to{-webkit-transform:translate(0) scale(1);transform:translate(0) scale(1)}}@keyframes appear{to{-webkit-transform:translate(0) scale(1);transform:translate(0) scale(1)}}.messageContainer .loadingContainer{color:#fff;display:-ms-flexbox;display:flex}.messageContainer .loading,.messageContainer .loadingContainer{-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center}.messageContainer .loading{background:#fff;border-radius:10px;display:-ms-inline-flexbox;display:inline-flex;margin:5px 0 10px;padding:7px 10px}.messageContainer .loading .dot{-webkit-animation:bounce .35s linear infinite alternate;animation:bounce .35s linear infinite alternate;background:#000;border-radius:50%;height:5px;margin-right:4px;width:5px}.messageContainer .loading .dot:nth-child(2){-webkit-animation-delay:.08s;animation-delay:.08s}.messageContainer .loading .dot:nth-child(3){-webkit-animation-delay:.16s;animation-delay:.16s;margin-right:0}@-webkit-keyframes bounce{0%{opacity:.5;-webkit-transform:translateY(-2px);transform:translateY(-2px)}to{opacity:1;-webkit-transform:translateY(2px);transform:translateY(2px)}}@keyframes bounce{0%{opacity:.5;-webkit-transform:translateY(-2px);transform:translateY(-2px)}to{opacity:1;-webkit-transform:translateY(2px);transform:translateY(2px)}}.messageContainer .loadingSpeakerName{font-size:12px;font-style:italic;margin:0 5px;opacity:.6}.messageContainer.right{-ms-flex-pack:end;justify-content:flex-end}.messageContainer.right .loadingContainer{-ms-flex-direction:row-reverse;flex-direction:row-reverse}.messageContainer:last-child .message.last{margin-bottom:0}.audioMessageContainer{display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row;position:relative}.audioMessageContainer .playButtonContainer{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;height:3em;width:2em;-ms-flex-align:start;align-items:flex-start;-ms-flex-pack:center;justify-content:center;margin-left:0;margin-right:.5rem}.audioMessageContainer .button{background:transparent;border:0;height:100%;left:0;position:absolute;top:0;width:100%}.audioMessageContainer .audioMessage{height:3em;min-width:7em;-ms-flex-positive:1;flex-grow:1}.audioMessageContainer .icon{height:2em;width:2em}
|
package/es/index.d.ts
ADDED
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import { HeadingElement, BackgroundElement, Header, Footer, Conversation, Transitions } from '@micromag/core';
|
|
3
|
+
|
|
4
|
+
interface ConversationScreenProps {
|
|
5
|
+
title?: HeadingElement | null;
|
|
6
|
+
timing?: 'instant' | 'sequence';
|
|
7
|
+
readingSpeed?: number;
|
|
8
|
+
spacing?: number;
|
|
9
|
+
background?: BackgroundElement | null;
|
|
10
|
+
header?: Header | null;
|
|
11
|
+
footer?: Footer | null;
|
|
12
|
+
current?: boolean;
|
|
13
|
+
preload?: boolean;
|
|
14
|
+
type?: string | null;
|
|
15
|
+
conversation?: Conversation | null;
|
|
16
|
+
transitions?: Transitions | null;
|
|
17
|
+
className?: string | null;
|
|
18
|
+
}
|
|
19
|
+
declare function ConversationScreen({ title, timing: timingMode, readingSpeed, spacing, background, header, footer, current, preload, type, conversation, transitions, className, }: ConversationScreenProps): react_jsx_runtime.JSX.Element;
|
|
20
|
+
|
|
21
|
+
declare const _default: {
|
|
22
|
+
id: string;
|
|
23
|
+
type: string;
|
|
24
|
+
group: {
|
|
25
|
+
label: {
|
|
26
|
+
defaultMessage: string;
|
|
27
|
+
description: string;
|
|
28
|
+
};
|
|
29
|
+
order: number;
|
|
30
|
+
};
|
|
31
|
+
title: {
|
|
32
|
+
defaultMessage: string;
|
|
33
|
+
description: string;
|
|
34
|
+
};
|
|
35
|
+
component: typeof ConversationScreen;
|
|
36
|
+
layouts: string[];
|
|
37
|
+
fields: ({
|
|
38
|
+
name: string;
|
|
39
|
+
type: string;
|
|
40
|
+
options: {
|
|
41
|
+
value: string;
|
|
42
|
+
label: string;
|
|
43
|
+
}[];
|
|
44
|
+
label: {
|
|
45
|
+
defaultMessage: string;
|
|
46
|
+
description: string;
|
|
47
|
+
};
|
|
48
|
+
theme?: undefined;
|
|
49
|
+
defaultValue?: undefined;
|
|
50
|
+
} | {
|
|
51
|
+
name: string;
|
|
52
|
+
type: string;
|
|
53
|
+
theme: {
|
|
54
|
+
textStyle: string;
|
|
55
|
+
badge?: undefined;
|
|
56
|
+
callToAction?: undefined;
|
|
57
|
+
};
|
|
58
|
+
label: {
|
|
59
|
+
defaultMessage: string;
|
|
60
|
+
description: string;
|
|
61
|
+
};
|
|
62
|
+
options?: undefined;
|
|
63
|
+
defaultValue?: undefined;
|
|
64
|
+
} | {
|
|
65
|
+
name: string;
|
|
66
|
+
type: string;
|
|
67
|
+
label: {
|
|
68
|
+
defaultMessage: string;
|
|
69
|
+
description: string;
|
|
70
|
+
};
|
|
71
|
+
options?: undefined;
|
|
72
|
+
theme?: undefined;
|
|
73
|
+
defaultValue?: undefined;
|
|
74
|
+
} | {
|
|
75
|
+
name: string;
|
|
76
|
+
type: string;
|
|
77
|
+
defaultValue: number;
|
|
78
|
+
label: {
|
|
79
|
+
defaultMessage: string;
|
|
80
|
+
description: string;
|
|
81
|
+
};
|
|
82
|
+
options?: undefined;
|
|
83
|
+
theme?: undefined;
|
|
84
|
+
} | {
|
|
85
|
+
name: string;
|
|
86
|
+
type: string;
|
|
87
|
+
label: {
|
|
88
|
+
defaultMessage: string;
|
|
89
|
+
description: string;
|
|
90
|
+
};
|
|
91
|
+
theme: {
|
|
92
|
+
badge: {
|
|
93
|
+
label: {
|
|
94
|
+
textStyle: string;
|
|
95
|
+
};
|
|
96
|
+
boxStyle: string;
|
|
97
|
+
};
|
|
98
|
+
textStyle?: undefined;
|
|
99
|
+
callToAction?: undefined;
|
|
100
|
+
};
|
|
101
|
+
options?: undefined;
|
|
102
|
+
defaultValue?: undefined;
|
|
103
|
+
} | {
|
|
104
|
+
name: string;
|
|
105
|
+
type: string;
|
|
106
|
+
label: {
|
|
107
|
+
defaultMessage: string;
|
|
108
|
+
description: string;
|
|
109
|
+
};
|
|
110
|
+
theme: {
|
|
111
|
+
callToAction: {
|
|
112
|
+
label: {
|
|
113
|
+
textStyle: string;
|
|
114
|
+
};
|
|
115
|
+
boxStyle: string;
|
|
116
|
+
};
|
|
117
|
+
textStyle?: undefined;
|
|
118
|
+
badge?: undefined;
|
|
119
|
+
};
|
|
120
|
+
options?: undefined;
|
|
121
|
+
defaultValue?: undefined;
|
|
122
|
+
})[];
|
|
123
|
+
};
|
|
124
|
+
|
|
125
|
+
export { ConversationScreen, _default as default };
|
package/es/index.js
CHANGED
|
@@ -3,10 +3,8 @@ import _defineProperty from '@babel/runtime/helpers/defineProperty';
|
|
|
3
3
|
import _toConsumableArray from '@babel/runtime/helpers/toConsumableArray';
|
|
4
4
|
import _slicedToArray from '@babel/runtime/helpers/slicedToArray';
|
|
5
5
|
import classNames from 'classnames';
|
|
6
|
-
import PropTypes from 'prop-types';
|
|
7
6
|
import React, { useState, useMemo, useEffect, useRef, useCallback } from 'react';
|
|
8
7
|
import { v1 } from 'uuid';
|
|
9
|
-
import { PropTypes as PropTypes$1 } from '@micromag/core';
|
|
10
8
|
import { PlayIcon, PauseIcon, Button, ScreenElement, Transitions } from '@micromag/core/components';
|
|
11
9
|
import { useScreenSize, useViewerContext, useViewerWebView, usePlaybackContext, usePlaybackMediaRef, useScreenRenderContext } from '@micromag/core/contexts';
|
|
12
10
|
import { useTrackScreenEvent, useDimensionObserver } from '@micromag/core/hooks';
|
|
@@ -23,28 +21,19 @@ import Text from '@micromag/element-text';
|
|
|
23
21
|
import Visual from '@micromag/element-visual';
|
|
24
22
|
import Audio from '@micromag/element-audio';
|
|
25
23
|
|
|
26
|
-
var styles = {"container":"
|
|
24
|
+
var styles = {"container":"container","background":"background","content":"content","empty":"empty","title":"title","footer":"footer","disabled":"disabled","layout":"layout","messageContainer":"messageContainer","message":"message","normalLeft":"normalLeft","inBetweenLeft":"inBetweenLeft","normalRight":"normalRight","inBetweenRight":"inBetweenRight","last":"last","messageBody":"messageBody","speakerDetails":"speakerDetails","right":"right","avatarContainer":"avatarContainer","avatar":"avatar","imageContainer":"imageContainer","withAnimation":"withAnimation","loadingContainer":"loadingContainer","loading":"loading","dot":"dot","loadingSpeakerName":"loadingSpeakerName","audioMessageContainer":"audioMessageContainer","playButtonContainer":"playButtonContainer","button":"button","audioMessage":"audioMessage","icon":"icon"};
|
|
27
25
|
|
|
28
|
-
|
|
29
|
-
audio
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
nextAudioMessageId: null,
|
|
40
|
-
className: null
|
|
41
|
-
};
|
|
42
|
-
var ConversationAudioAttachment = function ConversationAudioAttachment(_ref) {
|
|
43
|
-
var audio = _ref.audio,
|
|
44
|
-
audioEventsChannelName = _ref.audioEventsChannelName,
|
|
45
|
-
messageId = _ref.messageId,
|
|
46
|
-
nextAudioMessageId = _ref.nextAudioMessageId,
|
|
47
|
-
className = _ref.className;
|
|
26
|
+
function ConversationAudioAttachment(_ref) {
|
|
27
|
+
var _ref$audio = _ref.audio,
|
|
28
|
+
audio = _ref$audio === void 0 ? null : _ref$audio,
|
|
29
|
+
_ref$audioEventsChann = _ref.audioEventsChannelName,
|
|
30
|
+
audioEventsChannelName = _ref$audioEventsChann === void 0 ? null : _ref$audioEventsChann,
|
|
31
|
+
_ref$messageId = _ref.messageId,
|
|
32
|
+
messageId = _ref$messageId === void 0 ? null : _ref$messageId,
|
|
33
|
+
_ref$nextAudioMessage = _ref.nextAudioMessageId,
|
|
34
|
+
nextAudioMessageId = _ref$nextAudioMessage === void 0 ? null : _ref$nextAudioMessage,
|
|
35
|
+
_ref$className = _ref.className,
|
|
36
|
+
className = _ref$className === void 0 ? null : _ref$className;
|
|
48
37
|
var _useState = useState(true),
|
|
49
38
|
_useState2 = _slicedToArray(_useState, 2),
|
|
50
39
|
paused = _useState2[0],
|
|
@@ -108,67 +97,43 @@ var ConversationAudioAttachment = function ConversationAudioAttachment(_ref) {
|
|
|
108
97
|
onClick: togglePaused,
|
|
109
98
|
className: styles.button
|
|
110
99
|
}));
|
|
111
|
-
}
|
|
112
|
-
ConversationAudioAttachment.propTypes = propTypes$2;
|
|
113
|
-
ConversationAudioAttachment.defaultProps = defaultProps$2;
|
|
100
|
+
}
|
|
114
101
|
|
|
115
|
-
|
|
116
|
-
message
|
|
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
|
-
speakerStyle: null,
|
|
151
|
-
className: null,
|
|
152
|
-
audioEventsChannelName: null
|
|
153
|
-
};
|
|
154
|
-
var ConversationMessage = function ConversationMessage(_ref) {
|
|
155
|
-
var message = _ref.message,
|
|
156
|
-
messageId = _ref.messageId,
|
|
157
|
-
previousMessage = _ref.previousMessage,
|
|
158
|
-
nextMessage = _ref.nextMessage,
|
|
159
|
-
nextAudioMessageId = _ref.nextAudioMessageId,
|
|
160
|
-
nextMessageState = _ref.nextMessageState,
|
|
161
|
-
currentSpeaker = _ref.currentSpeaker,
|
|
162
|
-
conversationTiming = _ref.conversationTiming,
|
|
163
|
-
typingTiming = _ref.typingTiming,
|
|
164
|
-
onChange = _ref.onChange,
|
|
165
|
-
withAnimation = _ref.withAnimation,
|
|
166
|
-
active = _ref.active,
|
|
167
|
-
isPlaying = _ref.isPlaying,
|
|
168
|
-
messageStyle = _ref.messageStyle,
|
|
169
|
-
speakerStyle = _ref.speakerStyle,
|
|
170
|
-
className = _ref.className,
|
|
171
|
-
audioEventsChannelName = _ref.audioEventsChannelName;
|
|
102
|
+
function ConversationMessage(_ref) {
|
|
103
|
+
var _ref$message = _ref.message,
|
|
104
|
+
message = _ref$message === void 0 ? null : _ref$message,
|
|
105
|
+
_ref$messageId = _ref.messageId,
|
|
106
|
+
messageId = _ref$messageId === void 0 ? null : _ref$messageId,
|
|
107
|
+
_ref$previousMessage = _ref.previousMessage,
|
|
108
|
+
previousMessage = _ref$previousMessage === void 0 ? null : _ref$previousMessage,
|
|
109
|
+
_ref$nextMessage = _ref.nextMessage,
|
|
110
|
+
nextMessage = _ref$nextMessage === void 0 ? null : _ref$nextMessage,
|
|
111
|
+
_ref$nextAudioMessage = _ref.nextAudioMessageId,
|
|
112
|
+
nextAudioMessageId = _ref$nextAudioMessage === void 0 ? null : _ref$nextAudioMessage,
|
|
113
|
+
_ref$nextMessageState = _ref.nextMessageState,
|
|
114
|
+
nextMessageState = _ref$nextMessageState === void 0 ? null : _ref$nextMessageState,
|
|
115
|
+
_ref$currentSpeaker = _ref.currentSpeaker,
|
|
116
|
+
currentSpeaker = _ref$currentSpeaker === void 0 ? null : _ref$currentSpeaker,
|
|
117
|
+
_ref$conversationTimi = _ref.conversationTiming,
|
|
118
|
+
conversationTiming = _ref$conversationTimi === void 0 ? null : _ref$conversationTimi,
|
|
119
|
+
_ref$typingTiming = _ref.typingTiming,
|
|
120
|
+
typingTiming = _ref$typingTiming === void 0 ? null : _ref$typingTiming,
|
|
121
|
+
_ref$onChange = _ref.onChange,
|
|
122
|
+
onChange = _ref$onChange === void 0 ? null : _ref$onChange,
|
|
123
|
+
_ref$withAnimation = _ref.withAnimation,
|
|
124
|
+
withAnimation = _ref$withAnimation === void 0 ? false : _ref$withAnimation,
|
|
125
|
+
_ref$active = _ref.active,
|
|
126
|
+
active = _ref$active === void 0 ? false : _ref$active,
|
|
127
|
+
_ref$isPlaying = _ref.isPlaying,
|
|
128
|
+
isPlaying = _ref$isPlaying === void 0 ? false : _ref$isPlaying,
|
|
129
|
+
_ref$messageStyle = _ref.messageStyle,
|
|
130
|
+
messageStyle = _ref$messageStyle === void 0 ? null : _ref$messageStyle,
|
|
131
|
+
_ref$speakerStyle = _ref.speakerStyle,
|
|
132
|
+
speakerStyle = _ref$speakerStyle === void 0 ? null : _ref$speakerStyle,
|
|
133
|
+
_ref$className = _ref.className,
|
|
134
|
+
className = _ref$className === void 0 ? null : _ref$className,
|
|
135
|
+
_ref$audioEventsChann = _ref.audioEventsChannelName,
|
|
136
|
+
audioEventsChannelName = _ref$audioEventsChann === void 0 ? null : _ref$audioEventsChann;
|
|
172
137
|
var _ref2 = message || {},
|
|
173
138
|
messageBody = _ref2.message,
|
|
174
139
|
_ref2$image = _ref2.image,
|
|
@@ -278,57 +243,35 @@ var ConversationMessage = function ConversationMessage(_ref) {
|
|
|
278
243
|
audioEventsChannelName: audioEventsChannelName,
|
|
279
244
|
className: classNames(styles.audioAttachment, styles.afterText)
|
|
280
245
|
}) : null))) : null;
|
|
281
|
-
}
|
|
282
|
-
ConversationMessage.propTypes = propTypes$1;
|
|
283
|
-
ConversationMessage.defaultProps = defaultProps$1;
|
|
246
|
+
}
|
|
284
247
|
|
|
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
|
-
|
|
312
|
-
preload: true,
|
|
313
|
-
type: null,
|
|
314
|
-
conversation: null,
|
|
315
|
-
transitions: null,
|
|
316
|
-
className: null
|
|
317
|
-
};
|
|
318
|
-
var ConversationScreen = function ConversationScreen(_ref) {
|
|
319
|
-
var title = _ref.title,
|
|
320
|
-
timingMode = _ref.timing,
|
|
321
|
-
readingSpeed = _ref.readingSpeed,
|
|
322
|
-
spacing = _ref.spacing,
|
|
323
|
-
background = _ref.background,
|
|
324
|
-
header = _ref.header,
|
|
325
|
-
footer = _ref.footer,
|
|
326
|
-
current = _ref.current,
|
|
327
|
-
preload = _ref.preload,
|
|
328
|
-
type = _ref.type,
|
|
329
|
-
conversation = _ref.conversation,
|
|
330
|
-
transitions = _ref.transitions,
|
|
331
|
-
className = _ref.className;
|
|
248
|
+
function ConversationScreen(_ref) {
|
|
249
|
+
var _ref$title = _ref.title,
|
|
250
|
+
title = _ref$title === void 0 ? null : _ref$title,
|
|
251
|
+
_ref$timing = _ref.timing,
|
|
252
|
+
timingMode = _ref$timing === void 0 ? 'sequence' : _ref$timing,
|
|
253
|
+
_ref$readingSpeed = _ref.readingSpeed,
|
|
254
|
+
readingSpeed = _ref$readingSpeed === void 0 ? 255 : _ref$readingSpeed,
|
|
255
|
+
_ref$spacing = _ref.spacing,
|
|
256
|
+
spacing = _ref$spacing === void 0 ? 20 : _ref$spacing,
|
|
257
|
+
_ref$background = _ref.background,
|
|
258
|
+
background = _ref$background === void 0 ? null : _ref$background,
|
|
259
|
+
_ref$header = _ref.header,
|
|
260
|
+
header = _ref$header === void 0 ? null : _ref$header,
|
|
261
|
+
_ref$footer = _ref.footer,
|
|
262
|
+
footer = _ref$footer === void 0 ? null : _ref$footer,
|
|
263
|
+
_ref$current = _ref.current,
|
|
264
|
+
current = _ref$current === void 0 ? true : _ref$current,
|
|
265
|
+
_ref$preload = _ref.preload,
|
|
266
|
+
preload = _ref$preload === void 0 ? true : _ref$preload,
|
|
267
|
+
_ref$type = _ref.type,
|
|
268
|
+
type = _ref$type === void 0 ? null : _ref$type,
|
|
269
|
+
_ref$conversation = _ref.conversation,
|
|
270
|
+
conversation = _ref$conversation === void 0 ? null : _ref$conversation,
|
|
271
|
+
_ref$transitions = _ref.transitions,
|
|
272
|
+
transitions = _ref$transitions === void 0 ? null : _ref$transitions,
|
|
273
|
+
_ref$className = _ref.className,
|
|
274
|
+
className = _ref$className === void 0 ? null : _ref$className;
|
|
332
275
|
var _useScreenSize = useScreenSize(),
|
|
333
276
|
width = _useScreenSize.width,
|
|
334
277
|
height = _useScreenSize.height,
|
|
@@ -586,9 +529,7 @@ var ConversationScreen = function ConversationScreen(_ref) {
|
|
|
586
529
|
withoutVideo: isPreview,
|
|
587
530
|
className: styles.background
|
|
588
531
|
}) : null);
|
|
589
|
-
}
|
|
590
|
-
ConversationScreen.propTypes = propTypes;
|
|
591
|
-
ConversationScreen.defaultProps = defaultProps;
|
|
532
|
+
}
|
|
592
533
|
|
|
593
534
|
var definition = {
|
|
594
535
|
id: 'conversation',
|
package/es/styles.css
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.container{display:-ms-flexbox;display:flex;height:100%;overflow:hidden;position:relative;width:100%;-ms-flex-align:center;align-items:center;-ms-flex-pack:start;justify-content:flex-start}.container .background{height:100%;left:0;position:absolute;top:0;width:100%;z-index:0}.container .content{z-index:1}.container .conversationHeader{font-style:italic;padding-bottom:16px;width:100%}.container .empty{height:200px}.container .title{padding-bottom:16px}.container .footer{-webkit-transition:opacity .2s ease-out;transition:opacity .2s ease-out}.container .footer a{padding:0}.container .footer.disabled{opacity:0;pointer-events:none}.layout{-webkit-transition:padding .2s ease-out;transition:padding .2s ease-out}.messageContainer{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:start;color:#000;justify-content:flex-start}.messageContainer .message{background-color:#fff;margin:1px 0;max-width:80%;word-wrap:break-word}.messageContainer .message>:first-child{padding-top:10px}.messageContainer .message.normalLeft{border-radius:1px 15px 15px}.messageContainer .message.inBetweenLeft{border-radius:1px 15px 15px 1px}.messageContainer .message.normalRight{background-color:#58afff;border-radius:15px 1px 15px 15px}.messageContainer .message.inBetweenRight{background-color:#58afff;border-radius:15px 1px 1px 15px}.messageContainer .message.last{margin:1px 0 16px}.messageContainer .messageBody>*{padding-bottom:10px;padding-left:10px;padding-right:10px}.messageContainer .speakerDetails{display:-ms-flexbox;display:flex;width:100%;-ms-flex-align:center;align-items:center;-ms-flex-pack:start;justify-content:flex-start;padding-left:10px;padding-right:10px}.messageContainer .speakerDetails.right{-ms-flex-direction:row-reverse;flex-direction:row-reverse}.messageContainer .avatarContainer{height:30px;margin-right:10px;width:30px}.messageContainer .avatarContainer.right{margin-left:10px;margin-right:0}.messageContainer .avatar{border-radius:50%;display:inline-block;height:100%;-o-object-fit:cover;object-fit:cover;width:100%}.messageContainer .imageContainer{height:100%;padding-bottom:10px;width:100%}.messageContainer.withAnimation .message{-webkit-animation:appear .18s ease forwards;animation:appear .18s ease forwards}.messageContainer.withAnimation .message.normalLeft{-webkit-transform:translate(-300px) scale(.5);-ms-transform:translate(-300px) scale(.5);transform:translate(-300px) scale(.5)}.messageContainer.withAnimation .message.inBetweenLeft{border-radius:1px 15px 15px 1px}.messageContainer.withAnimation .message.normalRight{-webkit-transform:translate(300px) scale(.5);-ms-transform:translate(300px) scale(.5);transform:translate(300px) scale(.5)}.messageContainer.withAnimation .message:first-child{-webkit-animation:appear 0s ease forwards;animation:appear 0s ease forwards}@-webkit-keyframes appear{to{-webkit-transform:translate(0) scale(1);transform:translate(0) scale(1)}}@keyframes appear{to{-webkit-transform:translate(0) scale(1);transform:translate(0) scale(1)}}.messageContainer .loadingContainer{color:#fff;display:-ms-flexbox;display:flex}.messageContainer .loading,.messageContainer .loadingContainer{-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center}.messageContainer .loading{background:#fff;border-radius:10px;display:-ms-inline-flexbox;display:inline-flex;margin:5px 0 10px;padding:7px 10px}.messageContainer .loading .dot{-webkit-animation:bounce .35s linear infinite alternate;animation:bounce .35s linear infinite alternate;background:#000;border-radius:50%;height:5px;margin-right:4px;width:5px}.messageContainer .loading .dot:nth-child(2){-webkit-animation-delay:.08s;animation-delay:.08s}.messageContainer .loading .dot:nth-child(3){-webkit-animation-delay:.16s;animation-delay:.16s;margin-right:0}@-webkit-keyframes bounce{0%{opacity:.5;-webkit-transform:translateY(-2px);transform:translateY(-2px)}to{opacity:1;-webkit-transform:translateY(2px);transform:translateY(2px)}}@keyframes bounce{0%{opacity:.5;-webkit-transform:translateY(-2px);transform:translateY(-2px)}to{opacity:1;-webkit-transform:translateY(2px);transform:translateY(2px)}}.messageContainer .loadingSpeakerName{font-size:12px;font-style:italic;margin:0 5px;opacity:.6}.messageContainer.right{-ms-flex-pack:end;justify-content:flex-end}.messageContainer.right .loadingContainer{-ms-flex-direction:row-reverse;flex-direction:row-reverse}.messageContainer:last-child .message.last{margin-bottom:0}.audioMessageContainer{display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row;position:relative}.audioMessageContainer .playButtonContainer{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;height:3em;width:2em;-ms-flex-align:start;align-items:flex-start;-ms-flex-pack:center;justify-content:center;margin-left:0;margin-right:.5rem}.audioMessageContainer .button{background:transparent;border:0;height:100%;left:0;position:absolute;top:0;width:100%}.audioMessageContainer .audioMessage{height:3em;min-width:7em;-ms-flex-positive:1;flex-grow:1}.audioMessageContainer .icon{height:2em;width:2em}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@micromag/screen-conversation",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.4",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "",
|
|
6
6
|
"keywords": [
|
|
@@ -35,6 +35,7 @@
|
|
|
35
35
|
"style": "assets/css/styles.css",
|
|
36
36
|
"exports": {
|
|
37
37
|
".": {
|
|
38
|
+
"types": "./es/index.d.ts",
|
|
38
39
|
"import": "./es/index.js"
|
|
39
40
|
},
|
|
40
41
|
"./assets/css/styles": "./assets/css/styles.css",
|
|
@@ -48,38 +49,38 @@
|
|
|
48
49
|
"scripts": {
|
|
49
50
|
"clean": "rm -rf es && rm -rf lib && rm -rf assets",
|
|
50
51
|
"prepublishOnly": "npm run build",
|
|
51
|
-
"build": "../../scripts/prepare-package.sh"
|
|
52
|
+
"build": "../../scripts/prepare-package.sh --types"
|
|
52
53
|
},
|
|
53
54
|
"devDependencies": {
|
|
54
|
-
"react": "^
|
|
55
|
-
"react-dom": "^
|
|
55
|
+
"react": "^19.2.0",
|
|
56
|
+
"react-dom": "^18.3.0 || ^19.0.0"
|
|
56
57
|
},
|
|
57
58
|
"peerDependencies": {
|
|
58
|
-
"react": "^
|
|
59
|
-
"react-dom": "^
|
|
59
|
+
"react": "^19.2.0",
|
|
60
|
+
"react-dom": "^18.3.0 || ^19.0.0"
|
|
60
61
|
},
|
|
61
62
|
"dependencies": {
|
|
62
63
|
"@babel/runtime": "^7.13.10",
|
|
63
|
-
"@micromag/core": "^0.
|
|
64
|
-
"@micromag/element-background": "^0.
|
|
65
|
-
"@micromag/element-container": "^0.
|
|
66
|
-
"@micromag/element-footer": "^0.
|
|
67
|
-
"@micromag/element-header": "^0.
|
|
68
|
-
"@micromag/element-heading": "^0.
|
|
69
|
-
"@micromag/element-layout": "^0.
|
|
70
|
-
"@micromag/element-scroll": "^0.
|
|
71
|
-
"@micromag/element-text": "^0.
|
|
72
|
-
"@micromag/element-visual": "^0.
|
|
73
|
-
"@micromag/transforms": "^0.
|
|
64
|
+
"@micromag/core": "^0.4.4",
|
|
65
|
+
"@micromag/element-background": "^0.4.4",
|
|
66
|
+
"@micromag/element-container": "^0.4.4",
|
|
67
|
+
"@micromag/element-footer": "^0.4.4",
|
|
68
|
+
"@micromag/element-header": "^0.4.4",
|
|
69
|
+
"@micromag/element-heading": "^0.4.4",
|
|
70
|
+
"@micromag/element-layout": "^0.4.4",
|
|
71
|
+
"@micromag/element-scroll": "^0.4.4",
|
|
72
|
+
"@micromag/element-text": "^0.4.4",
|
|
73
|
+
"@micromag/element-visual": "^0.4.4",
|
|
74
|
+
"@micromag/transforms": "^0.4.4",
|
|
74
75
|
"classnames": "^2.2.6",
|
|
75
|
-
"lodash": "^4.17.
|
|
76
|
-
"
|
|
77
|
-
"react-intl": "^6.6.4",
|
|
76
|
+
"lodash": "^4.17.23",
|
|
77
|
+
"react-intl": "^8.1.3",
|
|
78
78
|
"uuid": "^9.0.0"
|
|
79
79
|
},
|
|
80
80
|
"publishConfig": {
|
|
81
81
|
"access": "public",
|
|
82
82
|
"registry": "https://registry.npmjs.org/"
|
|
83
83
|
},
|
|
84
|
-
"gitHead": "
|
|
84
|
+
"gitHead": "04b8519c3a3ddace5a21497e22faa11865d57f6d",
|
|
85
|
+
"types": "es/index.d.ts"
|
|
85
86
|
}
|