@seamly/web-ui 20.0.0-beta.4 → 20.0.0
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/build/dist/lib/index.debug.js +19 -30
- package/build/dist/lib/index.debug.min.js +1 -1
- package/build/dist/lib/index.debug.min.js.LICENSE.txt +0 -4
- package/build/dist/lib/index.js +147 -141
- package/build/dist/lib/index.min.js +1 -1
- package/build/dist/lib/standalone.js +163 -157
- package/build/dist/lib/standalone.min.js +1 -1
- package/build/dist/lib/style-guide.js +123 -92
- package/build/dist/lib/style-guide.min.js +1 -1
- package/build/dist/lib/styles.css +1 -1
- package/package.json +1 -2
- package/src/javascripts/api/index.js +19 -10
- package/src/javascripts/api/producer.js +5 -3
- package/src/javascripts/domains/app/actions.js +23 -1
- package/src/javascripts/domains/config/hooks.js +17 -0
- package/src/javascripts/domains/config/index.js +0 -1
- package/src/javascripts/domains/config/reducer.js +4 -0
- package/src/javascripts/domains/store/index.js +1 -5
- package/src/javascripts/lib/engine/index.js +2 -1
- package/src/javascripts/style-guide/components/app.js +8 -4
- package/src/javascripts/style-guide/components/static-core.js +19 -2
- package/src/javascripts/style-guide/components/view.js +16 -3
- package/src/javascripts/style-guide/states.js +42 -41
- package/src/javascripts/style-guide/style-guide-engine.js +14 -1
- package/src/javascripts/ui/components/conversation/event/event-participant.js +10 -7
- package/src/javascripts/ui/components/conversation/event/participant.js +3 -3
- package/src/javascripts/ui/components/layout/agent-info.js +7 -11
- package/src/javascripts/ui/components/layout/chat-frame.js +1 -1
- package/src/javascripts/ui/components/layout/pre-chat-messages.js +2 -8
- package/src/javascripts/ui/components/suggestions/index.js +0 -1
- package/src/javascripts/ui/components/suggestions/suggestions-list.js +1 -1
- package/src/javascripts/ui/components/view/inline-view.js +6 -1
- package/src/javascripts/ui/components/view/window-view/index.js +2 -2
- package/src/javascripts/ui/components/view/window-view/window-open-button.js +7 -7
- package/src/javascripts/ui/utils/seamly-utils.js +9 -2
- package/src/stylesheets/3-chat/_chat.scss +10 -25
- package/src/stylesheets/5-components/_chat-status.scss +1 -5
- package/src/stylesheets/5-components/_conversation.scss +1 -1
- package/src/stylesheets/5-components/_disclaimer.scss +1 -5
- package/src/stylesheets/5-components/_interrupt.scss +21 -2
- package/src/stylesheets/5-components/_message-body.scss +23 -1
- package/src/stylesheets/5-components/_message.scss +4 -0
- package/src/stylesheets/5-components/_options.scss +0 -8
- package/src/stylesheets/5-components/_pre-chat-messages.scss +22 -19
- package/src/stylesheets/5-components/_suggestions.scss +3 -9
- package/src/stylesheets/5-components/_unstarted.scss +20 -40
- package/src/stylesheets/7-deprecated/5-components/_message.scss +1 -1
- package/src/stylesheets/7-deprecated/5-components/_modal.scss +1 -1
- package/src/stylesheets/style-guide.scss +1 -1
- package/src/javascripts/domains/config/middleware.js +0 -22
|
@@ -3164,7 +3164,7 @@ module.exports = entryVirtual('Array').map;
|
|
|
3164
3164
|
/***/ 2999:
|
|
3165
3165
|
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
|
|
3166
3166
|
|
|
3167
|
-
__webpack_require__(
|
|
3167
|
+
__webpack_require__(1876);
|
|
3168
3168
|
var entryVirtual = __webpack_require__(5703);
|
|
3169
3169
|
|
|
3170
3170
|
module.exports = entryVirtual('Array').reduce;
|
|
@@ -3172,7 +3172,7 @@ module.exports = entryVirtual('Array').reduce;
|
|
|
3172
3172
|
|
|
3173
3173
|
/***/ }),
|
|
3174
3174
|
|
|
3175
|
-
/***/
|
|
3175
|
+
/***/ 5573:
|
|
3176
3176
|
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
|
|
3177
3177
|
|
|
3178
3178
|
__webpack_require__(1490);
|
|
@@ -3426,7 +3426,7 @@ module.exports = function (it) {
|
|
|
3426
3426
|
/***/ 1060:
|
|
3427
3427
|
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
|
|
3428
3428
|
|
|
3429
|
-
var reverse = __webpack_require__(
|
|
3429
|
+
var reverse = __webpack_require__(5573);
|
|
3430
3430
|
|
|
3431
3431
|
var ArrayPrototype = Array.prototype;
|
|
3432
3432
|
|
|
@@ -7850,7 +7850,7 @@ $({ target: 'Array', proto: true, forced: !HAS_SPECIES_SUPPORT }, {
|
|
|
7850
7850
|
|
|
7851
7851
|
/***/ }),
|
|
7852
7852
|
|
|
7853
|
-
/***/
|
|
7853
|
+
/***/ 1876:
|
|
7854
7854
|
/***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
|
7855
7855
|
|
|
7856
7856
|
"use strict";
|
|
@@ -15833,24 +15833,68 @@ const useSelectorWithProps = function useSelectorWithProps(selector, props, inpu
|
|
|
15833
15833
|
function useConfig() {
|
|
15834
15834
|
return useSelector(selectConfig);
|
|
15835
15835
|
}
|
|
15836
|
-
|
|
15837
|
-
|
|
15838
|
-
|
|
15839
|
-
|
|
15840
|
-
|
|
15841
|
-
|
|
15842
|
-
|
|
15843
|
-
|
|
15844
|
-
|
|
15845
|
-
|
|
15846
|
-
|
|
15847
|
-
|
|
15836
|
+
function useParticipants() {
|
|
15837
|
+
const {
|
|
15838
|
+
agentParticipant,
|
|
15839
|
+
userParticipant
|
|
15840
|
+
} = useSelector(selectConfig);
|
|
15841
|
+
return {
|
|
15842
|
+
agent: agentParticipant,
|
|
15843
|
+
user: userParticipant
|
|
15844
|
+
};
|
|
15845
|
+
}
|
|
15846
|
+
function useStartChatIcon() {
|
|
15847
|
+
const {
|
|
15848
|
+
startChatIcon
|
|
15849
|
+
} = useSelector(selectConfig);
|
|
15850
|
+
return startChatIcon;
|
|
15851
|
+
}
|
|
15852
|
+
;// CONCATENATED MODULE: ./src/javascripts/config.js
|
|
15853
|
+
const CSS_NAME = 'cvco';
|
|
15854
|
+
const apiVersion = '2';
|
|
15855
|
+
const userParticipantId = 'seamly-client-participant'; // How long to debounce distinct changes in unread messages for before
|
|
15856
|
+
// broadcasting to the screen reader. This is done to avoid verbosity.
|
|
15857
|
+
|
|
15858
|
+
const unreadScreenReaderWait = 2000;
|
|
15859
|
+
const newMessageScreenReaderWait = 1000;
|
|
15860
|
+
const screenReaderDebounceDelaySeconds = 10;
|
|
15861
|
+
const activitySendDelay = 15000;
|
|
15862
|
+
const maxCharacterWarningLimit = 50;
|
|
15863
|
+
const maxCharacterSrDebounceDelay = 300;
|
|
15864
|
+
const defaultTransitionTimeMs = 300; // How long to wait before we decide the user isn't typing
|
|
15865
|
+
|
|
15866
|
+
const typingTimeout = 2000;
|
|
15867
|
+
const defaultConfig = {
|
|
15868
|
+
namespace: 'default',
|
|
15869
|
+
layoutMode: 'window',
|
|
15870
|
+
// "window", "inline" ("sidebar")
|
|
15871
|
+
messages: {
|
|
15872
|
+
agent: {
|
|
15873
|
+
showAvatar: false,
|
|
15874
|
+
// true, "inline"
|
|
15875
|
+
showName: false
|
|
15876
|
+
},
|
|
15877
|
+
user: {
|
|
15878
|
+
showAvatar: false,
|
|
15879
|
+
// true, "inline"
|
|
15880
|
+
showName: false
|
|
15881
|
+
},
|
|
15882
|
+
timeIndicator: {
|
|
15883
|
+
enabled: false,
|
|
15884
|
+
threshold: 3600000 // Default threshold is an hour in milliseconds
|
|
15885
|
+
|
|
15886
|
+
}
|
|
15887
|
+
}
|
|
15888
|
+
};
|
|
15848
15889
|
// EXTERNAL MODULE: ./node_modules/@babel/runtime-corejs3/core-js-stable/set-timeout.js
|
|
15849
15890
|
var set_timeout = __webpack_require__(3032);
|
|
15850
15891
|
var set_timeout_default = /*#__PURE__*/__webpack_require__.n(set_timeout);
|
|
15851
15892
|
// EXTERNAL MODULE: ./node_modules/@babel/runtime-corejs3/core-js-stable/parse-float.js
|
|
15852
15893
|
var parse_float = __webpack_require__(1238);
|
|
15853
15894
|
var parse_float_default = /*#__PURE__*/__webpack_require__.n(parse_float);
|
|
15895
|
+
// EXTERNAL MODULE: ./node_modules/@babel/runtime-corejs3/core-js-stable/instance/index-of.js
|
|
15896
|
+
var instance_index_of = __webpack_require__(1643);
|
|
15897
|
+
var instance_index_of_default = /*#__PURE__*/__webpack_require__.n(instance_index_of);
|
|
15854
15898
|
// EXTERNAL MODULE: ./node_modules/@babel/runtime-corejs3/core-js-stable/instance/reduce.js
|
|
15855
15899
|
var reduce = __webpack_require__(2366);
|
|
15856
15900
|
var reduce_default = /*#__PURE__*/__webpack_require__.n(reduce);
|
|
@@ -16068,6 +16112,15 @@ const omit = (obj, keys) => {
|
|
|
16068
16112
|
return accum;
|
|
16069
16113
|
}, {});
|
|
16070
16114
|
};
|
|
16115
|
+
// EXTERNAL MODULE: ./node_modules/@babel/runtime-corejs3/core-js-stable/instance/sort.js
|
|
16116
|
+
var sort = __webpack_require__(7302);
|
|
16117
|
+
var sort_default = /*#__PURE__*/__webpack_require__.n(sort);
|
|
16118
|
+
// EXTERNAL MODULE: ./node_modules/@babel/runtime-corejs3/core-js-stable/instance/reverse.js
|
|
16119
|
+
var reverse = __webpack_require__(7093);
|
|
16120
|
+
var reverse_default = /*#__PURE__*/__webpack_require__.n(reverse);
|
|
16121
|
+
// EXTERNAL MODULE: ./node_modules/@babel/runtime-corejs3/core-js-stable/instance/find.js
|
|
16122
|
+
var find = __webpack_require__(4473);
|
|
16123
|
+
var find_default = /*#__PURE__*/__webpack_require__.n(find);
|
|
16071
16124
|
;// CONCATENATED MODULE: ./src/javascripts/ui/utils/seamly-utils.js
|
|
16072
16125
|
|
|
16073
16126
|
|
|
@@ -16273,9 +16326,19 @@ const participantReducer = (state, action) => {
|
|
|
16273
16326
|
};
|
|
16274
16327
|
|
|
16275
16328
|
case SET_PARTICIPANT:
|
|
16329
|
+
// TODO: a) Styleguide only! b) Should be removed after styleguide overhaul.
|
|
16330
|
+
if (!state) {
|
|
16331
|
+
return {
|
|
16332
|
+
participants: {},
|
|
16333
|
+
currentAgent: ''
|
|
16334
|
+
};
|
|
16335
|
+
}
|
|
16336
|
+
|
|
16276
16337
|
const {
|
|
16277
16338
|
participants
|
|
16278
|
-
} = state
|
|
16339
|
+
} = state || {
|
|
16340
|
+
participants: {}
|
|
16341
|
+
};
|
|
16279
16342
|
const {
|
|
16280
16343
|
id,
|
|
16281
16344
|
avatar,
|
|
@@ -16824,71 +16887,6 @@ const seamlyStateReducer = (state, action) => {
|
|
|
16824
16887
|
return state;
|
|
16825
16888
|
}
|
|
16826
16889
|
};
|
|
16827
|
-
;// CONCATENATED MODULE: ./src/javascripts/domains/config/middleware.js
|
|
16828
|
-
|
|
16829
|
-
|
|
16830
|
-
function createMiddleware() {
|
|
16831
|
-
return ({
|
|
16832
|
-
dispatch
|
|
16833
|
-
}) => next => action => {
|
|
16834
|
-
var _action$config, _action$config$defaul;
|
|
16835
|
-
|
|
16836
|
-
const result = next(action);
|
|
16837
|
-
|
|
16838
|
-
switch (action.type) {
|
|
16839
|
-
case String(initialize):
|
|
16840
|
-
case String(update):
|
|
16841
|
-
if (action !== null && action !== void 0 && (_action$config = action.config) !== null && _action$config !== void 0 && (_action$config$defaul = _action$config.defaults) !== null && _action$config$defaul !== void 0 && _action$config$defaul.agentName) {
|
|
16842
|
-
var _action$config2, _action$config2$defau;
|
|
16843
|
-
|
|
16844
|
-
dispatch({
|
|
16845
|
-
type: seamlyActions.SET_HEADER_SUB_TITLE,
|
|
16846
|
-
title: action === null || action === void 0 ? void 0 : (_action$config2 = action.config) === null || _action$config2 === void 0 ? void 0 : (_action$config2$defau = _action$config2.defaults) === null || _action$config2$defau === void 0 ? void 0 : _action$config2$defau.agentName
|
|
16847
|
-
});
|
|
16848
|
-
}
|
|
16849
|
-
|
|
16850
|
-
}
|
|
16851
|
-
|
|
16852
|
-
return result;
|
|
16853
|
-
};
|
|
16854
|
-
}
|
|
16855
|
-
;// CONCATENATED MODULE: ./src/javascripts/config.js
|
|
16856
|
-
const CSS_NAME = 'cvco';
|
|
16857
|
-
const apiVersion = '2';
|
|
16858
|
-
const userParticipantId = 'seamly-client-participant'; // How long to debounce distinct changes in unread messages for before
|
|
16859
|
-
// broadcasting to the screen reader. This is done to avoid verbosity.
|
|
16860
|
-
|
|
16861
|
-
const unreadScreenReaderWait = 2000;
|
|
16862
|
-
const newMessageScreenReaderWait = 1000;
|
|
16863
|
-
const screenReaderDebounceDelaySeconds = 10;
|
|
16864
|
-
const activitySendDelay = 15000;
|
|
16865
|
-
const maxCharacterWarningLimit = 50;
|
|
16866
|
-
const maxCharacterSrDebounceDelay = 300;
|
|
16867
|
-
const defaultTransitionTimeMs = 300; // How long to wait before we decide the user isn't typing
|
|
16868
|
-
|
|
16869
|
-
const typingTimeout = 2000;
|
|
16870
|
-
const defaultConfig = {
|
|
16871
|
-
namespace: 'default',
|
|
16872
|
-
layoutMode: 'window',
|
|
16873
|
-
// "window", "inline" ("sidebar")
|
|
16874
|
-
messages: {
|
|
16875
|
-
agent: {
|
|
16876
|
-
showAvatar: false,
|
|
16877
|
-
// true, "inline"
|
|
16878
|
-
showName: false
|
|
16879
|
-
},
|
|
16880
|
-
user: {
|
|
16881
|
-
showAvatar: false,
|
|
16882
|
-
// true, "inline"
|
|
16883
|
-
showName: false
|
|
16884
|
-
},
|
|
16885
|
-
timeIndicator: {
|
|
16886
|
-
enabled: false,
|
|
16887
|
-
threshold: 3600000 // Default threshold is an hour in milliseconds
|
|
16888
|
-
|
|
16889
|
-
}
|
|
16890
|
-
}
|
|
16891
|
-
};
|
|
16892
16890
|
// EXTERNAL MODULE: ./node_modules/@babel/runtime-corejs3/core-js-stable/promise.js
|
|
16893
16891
|
var promise = __webpack_require__(3476);
|
|
16894
16892
|
var promise_default = /*#__PURE__*/__webpack_require__.n(promise);
|
|
@@ -17334,7 +17332,10 @@ const app_actions_initialize = app_utils_createThunk('initialize', async (_, {
|
|
|
17334
17332
|
const {
|
|
17335
17333
|
features,
|
|
17336
17334
|
defaultLocale,
|
|
17337
|
-
preChat
|
|
17335
|
+
preChat,
|
|
17336
|
+
agentParticipant,
|
|
17337
|
+
userParticipant,
|
|
17338
|
+
startChatIcon
|
|
17338
17339
|
} = await api.getConfig();
|
|
17339
17340
|
dispatch({
|
|
17340
17341
|
type: seamlyActions.SET_FEATURES,
|
|
@@ -17346,6 +17347,18 @@ const app_actions_initialize = app_utils_createThunk('initialize', async (_, {
|
|
|
17346
17347
|
type: 'message',
|
|
17347
17348
|
payload
|
|
17348
17349
|
}))));
|
|
17350
|
+
dispatch(update({
|
|
17351
|
+
agentParticipant,
|
|
17352
|
+
userParticipant,
|
|
17353
|
+
startChatIcon
|
|
17354
|
+
}));
|
|
17355
|
+
|
|
17356
|
+
if (agentParticipant !== null && agentParticipant !== void 0 && agentParticipant.name) {
|
|
17357
|
+
dispatch({
|
|
17358
|
+
type: seamlyActions.SET_HEADER_TITLE,
|
|
17359
|
+
title: agentParticipant.name
|
|
17360
|
+
});
|
|
17361
|
+
}
|
|
17349
17362
|
} catch (e) {
|
|
17350
17363
|
throw new SeamlyUnavailableError();
|
|
17351
17364
|
}
|
|
@@ -17422,7 +17435,7 @@ const initialState = reducer_objectSpread(reducer_objectSpread({}, defaultConfig
|
|
|
17422
17435
|
preChatEvents: []
|
|
17423
17436
|
});
|
|
17424
17437
|
|
|
17425
|
-
const configKeys = ['hideOnNoUserResponse', 'showDisclaimer', 'showFaq', 'namespace', 'customComponents', 'defaults', 'layoutMode', 'api', 'zIndex', 'context', 'appContainerClassNames', 'messages', 'visible', 'visibilityCallback', 'errorCallback'];
|
|
17438
|
+
const configKeys = ['hideOnNoUserResponse', 'showDisclaimer', 'showFaq', 'namespace', 'customComponents', 'defaults', 'layoutMode', 'api', 'zIndex', 'context', 'appContainerClassNames', 'messages', 'visible', 'visibilityCallback', 'errorCallback', 'agentParticipant', 'userParticipant', 'startChatIcon'];
|
|
17426
17439
|
|
|
17427
17440
|
const updateState = (state, {
|
|
17428
17441
|
config
|
|
@@ -17470,7 +17483,6 @@ const updateState = (state, {
|
|
|
17470
17483
|
|
|
17471
17484
|
|
|
17472
17485
|
|
|
17473
|
-
|
|
17474
17486
|
// EXTERNAL MODULE: ./node_modules/@babel/runtime-corejs3/core-js-stable/instance/flat.js
|
|
17475
17487
|
var flat = __webpack_require__(6423);
|
|
17476
17488
|
var flat_default = /*#__PURE__*/__webpack_require__.n(flat);
|
|
@@ -18767,7 +18779,7 @@ class SeamlyUnauthorizedError extends SeamlyBaseError {
|
|
|
18767
18779
|
|
|
18768
18780
|
|
|
18769
18781
|
const handledErrorTypes = [SeamlyGeneralError, SeamlyConfigurationError, SeamlySessionExpiredError, SeamlyOfflineError, SeamlyUnauthorizedError, SeamlyUnavailableError];
|
|
18770
|
-
function
|
|
18782
|
+
function createMiddleware({
|
|
18771
18783
|
api
|
|
18772
18784
|
}) {
|
|
18773
18785
|
return () => next => action => {
|
|
@@ -19872,7 +19884,7 @@ function useTranslationsContainer() {
|
|
|
19872
19884
|
|
|
19873
19885
|
|
|
19874
19886
|
|
|
19875
|
-
function
|
|
19887
|
+
function middleware_createMiddleware() {
|
|
19876
19888
|
return ({
|
|
19877
19889
|
dispatch,
|
|
19878
19890
|
getState
|
|
@@ -21530,7 +21542,7 @@ const SuggestionsList = ({
|
|
|
21530
21542
|
className: givenClassName,
|
|
21531
21543
|
suggestions = [],
|
|
21532
21544
|
onClickSuggestion,
|
|
21533
|
-
hasIcon
|
|
21545
|
+
hasIcon = true
|
|
21534
21546
|
}) => {
|
|
21535
21547
|
return jsxRuntime_module_e("ul", {
|
|
21536
21548
|
className: css_className('suggestions__list', givenClassName),
|
|
@@ -21692,7 +21704,6 @@ const Suggestions = ({
|
|
|
21692
21704
|
className: css_className('suggestions__heading'),
|
|
21693
21705
|
children: headingText
|
|
21694
21706
|
}), !!renderedSuggestions.length && jsxRuntime_module_e(suggestions_list, {
|
|
21695
|
-
hasIcon: true,
|
|
21696
21707
|
suggestions: renderedSuggestions,
|
|
21697
21708
|
onClickSuggestion: handleClick
|
|
21698
21709
|
}), footerText && !isOpen && jsxRuntime_module_e("p", {
|
|
@@ -22073,26 +22084,26 @@ const Event = ({
|
|
|
22073
22084
|
|
|
22074
22085
|
|
|
22075
22086
|
|
|
22087
|
+
|
|
22076
22088
|
const EventParticipant = ({
|
|
22077
22089
|
eventPayload
|
|
22078
22090
|
}) => {
|
|
22091
|
+
const {
|
|
22092
|
+
t
|
|
22093
|
+
} = useI18n();
|
|
22079
22094
|
const {
|
|
22080
22095
|
fromClient,
|
|
22081
22096
|
participant: participantId
|
|
22082
22097
|
} = eventPayload;
|
|
22083
22098
|
const participant = useSeamlyParticipant(participantId) || {};
|
|
22084
22099
|
const {
|
|
22085
|
-
messages
|
|
22086
|
-
defaults
|
|
22100
|
+
messages
|
|
22087
22101
|
} = useConfig();
|
|
22088
|
-
const participantName = participant && participant.name;
|
|
22102
|
+
const participantName = fromClient ? t('participants.user.name') : participant && participant.name;
|
|
22089
22103
|
const {
|
|
22090
22104
|
showAvatar,
|
|
22091
22105
|
showName
|
|
22092
22106
|
} = messages[fromClient ? 'user' : 'agent'] || {};
|
|
22093
|
-
const {
|
|
22094
|
-
userName
|
|
22095
|
-
} = defaults || {};
|
|
22096
22107
|
|
|
22097
22108
|
if (!showAvatar && !showName) {
|
|
22098
22109
|
return null;
|
|
@@ -22111,12 +22122,10 @@ const EventParticipant = ({
|
|
|
22111
22122
|
}));
|
|
22112
22123
|
}
|
|
22113
22124
|
|
|
22114
|
-
|
|
22115
|
-
|
|
22116
|
-
if (showName && authorName) {
|
|
22125
|
+
if (showName) {
|
|
22117
22126
|
authorInfo.push(jsxRuntime_module_e("span", {
|
|
22118
22127
|
className: css_className('message__author-name'),
|
|
22119
|
-
children:
|
|
22128
|
+
children: participantName
|
|
22120
22129
|
}));
|
|
22121
22130
|
}
|
|
22122
22131
|
|
|
@@ -27523,8 +27532,8 @@ const Participant = ({
|
|
|
27523
27532
|
event
|
|
27524
27533
|
}) => {
|
|
27525
27534
|
const {
|
|
27526
|
-
|
|
27527
|
-
} =
|
|
27535
|
+
agent
|
|
27536
|
+
} = useParticipants();
|
|
27528
27537
|
const {
|
|
27529
27538
|
participant
|
|
27530
27539
|
} = event.payload;
|
|
@@ -27537,7 +27546,7 @@ const Participant = ({
|
|
|
27537
27546
|
return null;
|
|
27538
27547
|
}
|
|
27539
27548
|
|
|
27540
|
-
const avatar = participant.avatar ||
|
|
27549
|
+
const avatar = participant.avatar || (agent === null || agent === void 0 ? void 0 : agent.avatar);
|
|
27541
27550
|
return jsxRuntime_module_e(EventDivider, {
|
|
27542
27551
|
graphicSrc: avatar,
|
|
27543
27552
|
graphicType: participant.avatar ? 'avatar' : undefined,
|
|
@@ -30011,7 +30020,7 @@ function ChatFrame({
|
|
|
30011
30020
|
children: [jsxRuntime_module_e(TranslationsChatStatus, {}), jsxRuntime_module_e("div", {
|
|
30012
30021
|
className: css_className('chat__container'),
|
|
30013
30022
|
children: getContent()
|
|
30014
|
-
}), jsxRuntime_module_e(AppOptions, {})]
|
|
30023
|
+
}), isOpen && jsxRuntime_module_e(AppOptions, {})]
|
|
30015
30024
|
});
|
|
30016
30025
|
}
|
|
30017
30026
|
|
|
@@ -30045,7 +30054,6 @@ const AppView = () => {
|
|
|
30045
30054
|
|
|
30046
30055
|
|
|
30047
30056
|
|
|
30048
|
-
|
|
30049
30057
|
function PreChatMessages() {
|
|
30050
30058
|
const {
|
|
30051
30059
|
preChatEvents,
|
|
@@ -30058,19 +30066,15 @@ function PreChatMessages() {
|
|
|
30058
30066
|
isOpen
|
|
30059
30067
|
} = useVisibility();
|
|
30060
30068
|
const isVisible = !(hasInterrupt || !preChatEvents.length || isOpen);
|
|
30061
|
-
return jsxRuntime_module_e(
|
|
30062
|
-
|
|
30063
|
-
|
|
30064
|
-
children: jsxRuntime_module_e("
|
|
30065
|
-
className: css_className('pre-chat-
|
|
30066
|
-
|
|
30067
|
-
|
|
30068
|
-
|
|
30069
|
-
|
|
30070
|
-
event: event
|
|
30071
|
-
})
|
|
30072
|
-
}, event.payload.id))
|
|
30073
|
-
})
|
|
30069
|
+
return isVisible && jsxRuntime_module_e("ul", {
|
|
30070
|
+
className: css_className('pre-chat-messages', `pre-chat-messages--${layoutMode}`),
|
|
30071
|
+
"aria-hidden": !isVisible,
|
|
30072
|
+
children: map_default()(preChatEvents).call(preChatEvents, event => jsxRuntime_module_e("li", {
|
|
30073
|
+
className: css_className('pre-chat-messages__message'),
|
|
30074
|
+
children: jsxRuntime_module_e(PreChatMessageEvent, {
|
|
30075
|
+
event: event
|
|
30076
|
+
})
|
|
30077
|
+
}, event.payload.id))
|
|
30074
30078
|
});
|
|
30075
30079
|
}
|
|
30076
30080
|
function PreChatMessageEvent({
|
|
@@ -30131,7 +30135,7 @@ const InlineView = () => {
|
|
|
30131
30135
|
isActive: !isOpen,
|
|
30132
30136
|
transitionStartState: transitionStartStates.rendered,
|
|
30133
30137
|
children: jsxRuntime_module_e("div", {
|
|
30134
|
-
className: css_className('unstarted-wrapper'),
|
|
30138
|
+
className: css_className('unstarted-wrapper', 'unstarted-wrapper--inline'),
|
|
30135
30139
|
children: [jsxRuntime_module_e(PreChatMessages, {}), jsxRuntime_module_e(suggestions, {})]
|
|
30136
30140
|
})
|
|
30137
30141
|
}), jsxRuntime_module_e(in_out_transition, {
|
|
@@ -30163,18 +30167,16 @@ const InlineView = () => {
|
|
|
30163
30167
|
|
|
30164
30168
|
|
|
30165
30169
|
const ButtonIcon = () => {
|
|
30170
|
+
const startChatIcon = useStartChatIcon();
|
|
30166
30171
|
const currentAgent = useSeamlyCurrentAgent();
|
|
30167
30172
|
const {
|
|
30168
30173
|
hasInterrupt
|
|
30169
30174
|
} = useInterrupt();
|
|
30170
|
-
const
|
|
30171
|
-
|
|
30172
|
-
|
|
30173
|
-
|
|
30174
|
-
|
|
30175
|
-
return avatar || startChatIcon ? jsxRuntime_module_e("img", {
|
|
30176
|
-
className: css_className(avatar ? 'avatar' : 'icon'),
|
|
30177
|
-
src: avatar || startChatIcon,
|
|
30175
|
+
const isActiveConversation = currentAgent && !hasInterrupt;
|
|
30176
|
+
const src = isActiveConversation ? currentAgent.avatar : startChatIcon;
|
|
30177
|
+
return src ? jsxRuntime_module_e("img", {
|
|
30178
|
+
className: css_className(isActiveConversation ? 'avatar' : 'icon'),
|
|
30179
|
+
src: src,
|
|
30178
30180
|
alt: ""
|
|
30179
30181
|
}) : jsxRuntime_module_e(icon, {
|
|
30180
30182
|
name: "avatar",
|
|
@@ -30300,7 +30302,7 @@ const WindowView = () => {
|
|
|
30300
30302
|
transitionStartState: transitionStartStates.notRendered,
|
|
30301
30303
|
children: jsxRuntime_module_e("div", {
|
|
30302
30304
|
className: css_className('unstarted-wrapper', 'unstarted-wrapper--window', 'unstarted-wrapper--continue'),
|
|
30303
|
-
children: jsxRuntime_module_e(
|
|
30305
|
+
children: jsxRuntime_module_e(event_text, {
|
|
30304
30306
|
event: continueChatEvent
|
|
30305
30307
|
})
|
|
30306
30308
|
})
|
|
@@ -32982,10 +32984,11 @@ function producer_objectSpread(target) { for (var i = 1; i < arguments.length; i
|
|
|
32982
32984
|
|
|
32983
32985
|
const log = debug_default()('seamly');
|
|
32984
32986
|
class ConversationProducer {
|
|
32985
|
-
constructor(url, channelName, accessToken) {
|
|
32987
|
+
constructor(url, channelName, channelTopic, accessToken) {
|
|
32986
32988
|
this.url = url;
|
|
32987
32989
|
this.accessToken = accessToken;
|
|
32988
32990
|
this.channelName = channelName;
|
|
32991
|
+
this.channelTopic = channelTopic;
|
|
32989
32992
|
this.connect();
|
|
32990
32993
|
this.socket.onError(err => {
|
|
32991
32994
|
log('[SOCKET][ERROR]', err);
|
|
@@ -33005,7 +33008,7 @@ class ConversationProducer {
|
|
|
33005
33008
|
});
|
|
33006
33009
|
this.channel.on('system', msg => {
|
|
33007
33010
|
switch (msg.type) {
|
|
33008
|
-
case '
|
|
33011
|
+
case 'attach_channel_succeeded':
|
|
33009
33012
|
this.emit({
|
|
33010
33013
|
type: 'connection',
|
|
33011
33014
|
connected: true,
|
|
@@ -33095,8 +33098,9 @@ class ConversationProducer {
|
|
|
33095
33098
|
})
|
|
33096
33099
|
});
|
|
33097
33100
|
this.socket.connect();
|
|
33098
|
-
this.channel = this.socket.channel(this.
|
|
33099
|
-
authorization: `Bearer ${this.accessToken}
|
|
33101
|
+
this.channel = this.socket.channel(this.channelTopic, {
|
|
33102
|
+
authorization: `Bearer ${this.accessToken}`,
|
|
33103
|
+
channelName: this.channelName
|
|
33100
33104
|
});
|
|
33101
33105
|
}
|
|
33102
33106
|
|
|
@@ -33288,7 +33292,8 @@ class API {
|
|
|
33288
33292
|
* @param {string} config.externalId Unique visitor identifier (optional)
|
|
33289
33293
|
* @param {boolean} config.sendEnvironment
|
|
33290
33294
|
* @param {string} namespace
|
|
33291
|
-
* @param {Object} [context={ variables: undefined, locale: undefined }]
|
|
33295
|
+
* @param {Object} [context={ channelName: undefined, variables: undefined, locale: undefined }]
|
|
33296
|
+
* @param {string} context.channelName
|
|
33292
33297
|
* @param {object} context.variables
|
|
33293
33298
|
* @param {string} context.locale
|
|
33294
33299
|
* @memberof API
|
|
@@ -33308,7 +33313,9 @@ class API {
|
|
|
33308
33313
|
};
|
|
33309
33314
|
this.config = {
|
|
33310
33315
|
sendEnvironment: config.sendEnvironment ?? true,
|
|
33311
|
-
context
|
|
33316
|
+
context: api_objectSpread(api_objectSpread({}, context), {}, {
|
|
33317
|
+
channelName: context.channelName || 'web'
|
|
33318
|
+
})
|
|
33312
33319
|
};
|
|
33313
33320
|
this.connected = false;
|
|
33314
33321
|
this.configReady = false;
|
|
@@ -33348,18 +33355,22 @@ class API {
|
|
|
33348
33355
|
return !!this.getConversationUrl();
|
|
33349
33356
|
}
|
|
33350
33357
|
|
|
33351
|
-
|
|
33352
|
-
|
|
33358
|
+
getChannelTopic() {
|
|
33359
|
+
// The `channelName` fallback is needed for seamless client upgrades.
|
|
33360
|
+
// TODO: Remove when all clients have been upgraded past v20.
|
|
33361
|
+
return this.store.get('channelTopic') || this.store.get('channelName');
|
|
33353
33362
|
}
|
|
33354
33363
|
|
|
33355
|
-
|
|
33356
|
-
this.store.set('
|
|
33364
|
+
setChannelTopic(topic) {
|
|
33365
|
+
this.store.set('channelTopic', topic);
|
|
33357
33366
|
}
|
|
33358
33367
|
|
|
33359
33368
|
clearStore() {
|
|
33360
33369
|
this.store.delete('accessToken');
|
|
33361
|
-
this.store.delete('conversationUrl');
|
|
33370
|
+
this.store.delete('conversationUrl'); // TODO: Remove `channelName` when all clients have been upgraded past v20.
|
|
33371
|
+
|
|
33362
33372
|
this.store.delete('channelName');
|
|
33373
|
+
this.store.delete('channelTopic');
|
|
33363
33374
|
}
|
|
33364
33375
|
|
|
33365
33376
|
getUrlPrefix(protocol) {
|
|
@@ -33415,9 +33426,9 @@ class API {
|
|
|
33415
33426
|
const initialState = api_objectSpread({}, conversation);
|
|
33416
33427
|
|
|
33417
33428
|
delete initialState.accessToken;
|
|
33418
|
-
delete initialState.
|
|
33429
|
+
delete initialState.channelTopic;
|
|
33419
33430
|
this.setAccessToken(conversation.accessToken);
|
|
33420
|
-
this.
|
|
33431
|
+
this.setChannelTopic(conversation.channelTopic);
|
|
33421
33432
|
this.updateUrls(body);
|
|
33422
33433
|
this.setConversationUrl(this.URLS.conversation);
|
|
33423
33434
|
return initialState;
|
|
@@ -33518,7 +33529,7 @@ class API {
|
|
|
33518
33529
|
conversationInitialState = await this.createConversation();
|
|
33519
33530
|
}
|
|
33520
33531
|
|
|
33521
|
-
this.conversationProducer = new ConversationProducer(`${this.getUrlPrefix('ws')}${this.URLS.socket}`, this.
|
|
33532
|
+
this.conversationProducer = new ConversationProducer(`${this.getUrlPrefix('ws')}${this.URLS.socket}`, this.config.context.channelName, this.getChannelTopic(), this.getAccessToken());
|
|
33522
33533
|
this.internalProducer.emit(xstream_default().create(this.conversationProducer)); // Send environment
|
|
33523
33534
|
|
|
33524
33535
|
if (this.config.sendEnvironment) {
|
|
@@ -33565,7 +33576,7 @@ class API {
|
|
|
33565
33576
|
body
|
|
33566
33577
|
}) => {
|
|
33567
33578
|
this.updateUrls(body);
|
|
33568
|
-
return omit(body.conversation, ['accessToken', '
|
|
33579
|
+
return omit(body.conversation, ['accessToken', 'channelTopic']);
|
|
33569
33580
|
}).catch(error => {
|
|
33570
33581
|
if (error.status === 401) {
|
|
33571
33582
|
throw new SeamlyUnauthorizedError(error);
|
|
@@ -33807,11 +33818,11 @@ function store_createStore({
|
|
|
33807
33818
|
api,
|
|
33808
33819
|
eventBus,
|
|
33809
33820
|
config
|
|
33810
|
-
}), createMiddleware(
|
|
33821
|
+
}), createMiddleware({
|
|
33811
33822
|
api
|
|
33812
33823
|
}), options_middleware_createMiddleware({
|
|
33813
33824
|
api
|
|
33814
|
-
}),
|
|
33825
|
+
}), middleware_createMiddleware()]
|
|
33815
33826
|
});
|
|
33816
33827
|
return store;
|
|
33817
33828
|
}
|
|
@@ -33852,8 +33863,8 @@ class Engine {
|
|
|
33852
33863
|
restConfig = _objectWithoutProperties(config, engine_excluded);
|
|
33853
33864
|
|
|
33854
33865
|
this.config = engine_objectSpread(engine_objectSpread({}, restConfig), {}, {
|
|
33855
|
-
|
|
33856
|
-
|
|
33866
|
+
namespace,
|
|
33867
|
+
showFaq: showFaq !== false
|
|
33857
33868
|
});
|
|
33858
33869
|
this.namespace = namespace;
|
|
33859
33870
|
this.parentElement = parentElement;
|
|
@@ -34176,13 +34187,8 @@ const AgentInfo = () => {
|
|
|
34176
34187
|
const {
|
|
34177
34188
|
hasInterrupt
|
|
34178
34189
|
} = useInterrupt();
|
|
34179
|
-
const
|
|
34180
|
-
|
|
34181
|
-
} = useConfig();
|
|
34182
|
-
const {
|
|
34183
|
-
startChatIcon
|
|
34184
|
-
} = defaults || {};
|
|
34185
|
-
const avatar = currentAgent && !hasInterrupt ? currentAgent.avatar : null;
|
|
34190
|
+
const startChatIcon = useStartChatIcon();
|
|
34191
|
+
const src = (currentAgent === null || currentAgent === void 0 ? void 0 : currentAgent.avatar) ?? startChatIcon;
|
|
34186
34192
|
const displaySubtitle = hasInterrupt ? '' : subTitle;
|
|
34187
34193
|
const classNames = ['message-count'];
|
|
34188
34194
|
|
|
@@ -34194,13 +34200,13 @@ const AgentInfo = () => {
|
|
|
34194
34200
|
classNames.push('message-count__empty');
|
|
34195
34201
|
}
|
|
34196
34202
|
|
|
34197
|
-
return (
|
|
34203
|
+
return (displaySubtitle || !isOpen) && jsxRuntime_module_e("div", {
|
|
34198
34204
|
className: css_className('agent-info'),
|
|
34199
34205
|
children: [jsxRuntime_module_e("div", {
|
|
34200
34206
|
className: css_className('agent-info__graphic'),
|
|
34201
|
-
children: [
|
|
34202
|
-
className: css_className(avatar ? 'avatar' : 'icon'),
|
|
34203
|
-
src:
|
|
34207
|
+
children: [src ? jsxRuntime_module_e("img", {
|
|
34208
|
+
className: css_className(currentAgent !== null && currentAgent !== void 0 && currentAgent.avatar ? 'avatar' : 'icon'),
|
|
34209
|
+
src: src,
|
|
34204
34210
|
alt: ""
|
|
34205
34211
|
}) : jsxRuntime_module_e(icon, {
|
|
34206
34212
|
name: "avatar",
|