@micromag/screen-conversation 0.3.436 → 0.3.443
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/es/index.js +17 -11
- package/lib/index.js +17 -11
- package/package.json +13 -13
package/es/index.js
CHANGED
|
@@ -388,19 +388,23 @@ var ConversationScreen = function ConversationScreen(_ref) {
|
|
|
388
388
|
var filteredMessages = (messages || []).filter(function (m) {
|
|
389
389
|
return m !== null;
|
|
390
390
|
});
|
|
391
|
-
var timings = filteredMessages.map(function (messageParams,
|
|
391
|
+
var timings = filteredMessages.map(function (messageParams, messageIndex) {
|
|
392
|
+
if (messageIndex === 0) {
|
|
393
|
+
return 0;
|
|
394
|
+
}
|
|
392
395
|
var _ref3 = messageParams || {},
|
|
393
396
|
_ref3$timing = _ref3.timing,
|
|
394
397
|
timing = _ref3$timing === void 0 ? null : _ref3$timing,
|
|
395
398
|
_ref3$message = _ref3.message,
|
|
396
399
|
message = _ref3$message === void 0 ? null : _ref3$message,
|
|
397
400
|
image = _ref3.image,
|
|
398
|
-
audio = _ref3.audio
|
|
401
|
+
audio = _ref3.audio,
|
|
402
|
+
timingOverrides = _ref3.timingOverrides;
|
|
399
403
|
if (timing !== null) {
|
|
400
404
|
return timing;
|
|
401
405
|
}
|
|
402
|
-
if (
|
|
403
|
-
return
|
|
406
|
+
if (timingOverrides !== null && timingOverrides !== void 0 && timingOverrides.enabled && Number.isFinite(timingOverrides === null || timingOverrides === void 0 ? void 0 : timingOverrides.writingDuration)) {
|
|
407
|
+
return timingOverrides.writingDuration * 1000; // seconds to milliseconds
|
|
404
408
|
}
|
|
405
409
|
|
|
406
410
|
// if the current message has an audio attachment, use the time it takes to record that message
|
|
@@ -418,11 +422,13 @@ var ConversationScreen = function ConversationScreen(_ref) {
|
|
|
418
422
|
}
|
|
419
423
|
return finalTimeMs;
|
|
420
424
|
});
|
|
421
|
-
var hesitationTimings = filteredMessages.map(function () {
|
|
422
|
-
var
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
425
|
+
var hesitationTimings = filteredMessages.map(function (messageParams, messageIndex) {
|
|
426
|
+
var timingOverrides = messageParams.timingOverrides;
|
|
427
|
+
if (messageIndex !== 0 && timingOverrides !== null && timingOverrides !== void 0 && timingOverrides.enabled && Number.isFinite(timingOverrides === null || timingOverrides === void 0 ? void 0 : timingOverrides.appearDelay)) {
|
|
428
|
+
return timingOverrides.appearDelay * 1000; // seconds to milliseconds
|
|
429
|
+
}
|
|
430
|
+
|
|
431
|
+
return defaultHesitationDelay;
|
|
426
432
|
});
|
|
427
433
|
var messagesUniqueId = useMemo(function () {
|
|
428
434
|
return (messages || []).map(function () {
|
|
@@ -438,8 +444,8 @@ var ConversationScreen = function ConversationScreen(_ref) {
|
|
|
438
444
|
scrolledBottom = _useState4[0],
|
|
439
445
|
setScrolledBottom = _useState4[1];
|
|
440
446
|
var showFooter = animationFinished && !isPlaceholder && hasFooter || !withAnimation;
|
|
441
|
-
var onScrolledBottom = useCallback(function (
|
|
442
|
-
var initial =
|
|
447
|
+
var onScrolledBottom = useCallback(function (_ref4) {
|
|
448
|
+
var initial = _ref4.initial;
|
|
443
449
|
if (initial) {
|
|
444
450
|
trackScreenEvent('scroll', 'Screen');
|
|
445
451
|
}
|
package/lib/index.js
CHANGED
|
@@ -392,19 +392,23 @@ var ConversationScreen = function ConversationScreen(_ref) {
|
|
|
392
392
|
var filteredMessages = (messages || []).filter(function (m) {
|
|
393
393
|
return m !== null;
|
|
394
394
|
});
|
|
395
|
-
var timings = filteredMessages.map(function (messageParams,
|
|
395
|
+
var timings = filteredMessages.map(function (messageParams, messageIndex) {
|
|
396
|
+
if (messageIndex === 0) {
|
|
397
|
+
return 0;
|
|
398
|
+
}
|
|
396
399
|
var _ref3 = messageParams || {},
|
|
397
400
|
_ref3$timing = _ref3.timing,
|
|
398
401
|
timing = _ref3$timing === void 0 ? null : _ref3$timing,
|
|
399
402
|
_ref3$message = _ref3.message,
|
|
400
403
|
message = _ref3$message === void 0 ? null : _ref3$message,
|
|
401
404
|
image = _ref3.image,
|
|
402
|
-
audio = _ref3.audio
|
|
405
|
+
audio = _ref3.audio,
|
|
406
|
+
timingOverrides = _ref3.timingOverrides;
|
|
403
407
|
if (timing !== null) {
|
|
404
408
|
return timing;
|
|
405
409
|
}
|
|
406
|
-
if (
|
|
407
|
-
return
|
|
410
|
+
if (timingOverrides !== null && timingOverrides !== void 0 && timingOverrides.enabled && Number.isFinite(timingOverrides === null || timingOverrides === void 0 ? void 0 : timingOverrides.writingDuration)) {
|
|
411
|
+
return timingOverrides.writingDuration * 1000; // seconds to milliseconds
|
|
408
412
|
}
|
|
409
413
|
|
|
410
414
|
// if the current message has an audio attachment, use the time it takes to record that message
|
|
@@ -422,11 +426,13 @@ var ConversationScreen = function ConversationScreen(_ref) {
|
|
|
422
426
|
}
|
|
423
427
|
return finalTimeMs;
|
|
424
428
|
});
|
|
425
|
-
var hesitationTimings = filteredMessages.map(function () {
|
|
426
|
-
var
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
429
|
+
var hesitationTimings = filteredMessages.map(function (messageParams, messageIndex) {
|
|
430
|
+
var timingOverrides = messageParams.timingOverrides;
|
|
431
|
+
if (messageIndex !== 0 && timingOverrides !== null && timingOverrides !== void 0 && timingOverrides.enabled && Number.isFinite(timingOverrides === null || timingOverrides === void 0 ? void 0 : timingOverrides.appearDelay)) {
|
|
432
|
+
return timingOverrides.appearDelay * 1000; // seconds to milliseconds
|
|
433
|
+
}
|
|
434
|
+
|
|
435
|
+
return defaultHesitationDelay;
|
|
430
436
|
});
|
|
431
437
|
var messagesUniqueId = React.useMemo(function () {
|
|
432
438
|
return (messages || []).map(function () {
|
|
@@ -442,8 +448,8 @@ var ConversationScreen = function ConversationScreen(_ref) {
|
|
|
442
448
|
scrolledBottom = _useState4[0],
|
|
443
449
|
setScrolledBottom = _useState4[1];
|
|
444
450
|
var showFooter = animationFinished && !isPlaceholder && hasFooter || !withAnimation;
|
|
445
|
-
var onScrolledBottom = React.useCallback(function (
|
|
446
|
-
var initial =
|
|
451
|
+
var onScrolledBottom = React.useCallback(function (_ref4) {
|
|
452
|
+
var initial = _ref4.initial;
|
|
447
453
|
if (initial) {
|
|
448
454
|
trackScreenEvent('scroll', 'Screen');
|
|
449
455
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@micromag/screen-conversation",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.443",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "",
|
|
6
6
|
"keywords": [
|
|
@@ -59,17 +59,17 @@
|
|
|
59
59
|
},
|
|
60
60
|
"dependencies": {
|
|
61
61
|
"@babel/runtime": "^7.13.10",
|
|
62
|
-
"@micromag/core": "^0.3.
|
|
63
|
-
"@micromag/element-background": "^0.3.
|
|
64
|
-
"@micromag/element-container": "^0.3.
|
|
65
|
-
"@micromag/element-footer": "^0.3.
|
|
66
|
-
"@micromag/element-header": "^0.3.
|
|
67
|
-
"@micromag/element-heading": "^0.3.
|
|
68
|
-
"@micromag/element-layout": "^0.3.
|
|
69
|
-
"@micromag/element-scroll": "^0.3.
|
|
70
|
-
"@micromag/element-text": "^0.3.
|
|
71
|
-
"@micromag/element-visual": "^0.3.
|
|
72
|
-
"@micromag/transforms": "^0.3.
|
|
62
|
+
"@micromag/core": "^0.3.443",
|
|
63
|
+
"@micromag/element-background": "^0.3.443",
|
|
64
|
+
"@micromag/element-container": "^0.3.443",
|
|
65
|
+
"@micromag/element-footer": "^0.3.443",
|
|
66
|
+
"@micromag/element-header": "^0.3.443",
|
|
67
|
+
"@micromag/element-heading": "^0.3.443",
|
|
68
|
+
"@micromag/element-layout": "^0.3.443",
|
|
69
|
+
"@micromag/element-scroll": "^0.3.443",
|
|
70
|
+
"@micromag/element-text": "^0.3.443",
|
|
71
|
+
"@micromag/element-visual": "^0.3.443",
|
|
72
|
+
"@micromag/transforms": "^0.3.443",
|
|
73
73
|
"classnames": "^2.2.6",
|
|
74
74
|
"lodash": "^4.17.21",
|
|
75
75
|
"prop-types": "^15.7.2",
|
|
@@ -80,5 +80,5 @@
|
|
|
80
80
|
"access": "public",
|
|
81
81
|
"registry": "https://registry.npmjs.org/"
|
|
82
82
|
},
|
|
83
|
-
"gitHead": "
|
|
83
|
+
"gitHead": "c6da9d6483b9fca577e875637405f35b2c480d05"
|
|
84
84
|
}
|