@seamly/web-ui 22.2.0 → 22.3.0-beta.2
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/components.js +449 -291
- package/build/dist/lib/components.js.map +1 -1
- package/build/dist/lib/components.min.js +1 -1
- package/build/dist/lib/components.min.js.map +1 -1
- package/build/dist/lib/hooks.js +367 -177
- package/build/dist/lib/hooks.js.map +1 -1
- package/build/dist/lib/hooks.min.js +1 -1
- package/build/dist/lib/hooks.min.js.map +1 -1
- package/build/dist/lib/index.debug.js +76 -54
- package/build/dist/lib/index.debug.js.map +1 -1
- package/build/dist/lib/index.debug.min.js +1 -1
- package/build/dist/lib/index.debug.min.js.LICENSE.txt +16 -8
- package/build/dist/lib/index.debug.min.js.map +1 -1
- package/build/dist/lib/index.js +342 -193
- package/build/dist/lib/index.js.map +1 -1
- package/build/dist/lib/index.min.js +1 -1
- package/build/dist/lib/index.min.js.map +1 -1
- package/build/dist/lib/standalone.js +350 -194
- package/build/dist/lib/standalone.js.map +1 -1
- package/build/dist/lib/standalone.min.js +1 -1
- package/build/dist/lib/standalone.min.js.map +1 -1
- package/build/dist/lib/style-guide.js +365 -194
- package/build/dist/lib/style-guide.js.map +1 -1
- package/build/dist/lib/style-guide.min.js +1 -1
- package/build/dist/lib/style-guide.min.js.map +1 -1
- package/build/dist/lib/styles.css +1 -1
- package/build/dist/lib/utils.js +504 -324
- package/build/dist/lib/utils.js.map +1 -1
- package/build/dist/lib/utils.min.js +1 -1
- package/build/dist/lib/utils.min.js.map +1 -1
- package/package.json +1 -1
- package/src/javascripts/api/errors/seamly-api-error.ts +0 -1
- package/src/javascripts/api/index.ts +16 -8
- package/src/javascripts/domains/app/actions.ts +8 -3
- package/src/javascripts/domains/interrupt/selectors.ts +3 -2
- package/src/javascripts/domains/interrupt/slice.ts +2 -0
- package/src/javascripts/domains/redux/create-debounced-async-thunk.ts +109 -0
- package/src/javascripts/domains/redux/redux.types.ts +2 -1
- package/src/javascripts/domains/store/actions.ts +38 -0
- package/src/javascripts/domains/translations/components/options-dialog/translation-option.tsx +1 -1
- package/src/javascripts/domains/visibility/actions.ts +4 -1
- package/src/javascripts/style-guide/states.js +26 -1
- package/src/javascripts/ui/components/chat-status/chat-status-action.tsx +2 -2
- package/src/javascripts/ui/components/conversation/event/{card-component.js → card-component.tsx} +6 -4
- package/src/javascripts/ui/components/conversation/event/carousel-component/components/controls.js +2 -2
- package/src/javascripts/ui/components/conversation/event/choice-prompt.js +1 -1
- package/src/javascripts/ui/components/conversation/event/event-participant.js +1 -1
- package/src/javascripts/ui/components/conversation/event/image-lightbox.js +1 -1
- package/src/javascripts/ui/components/conversation/event-divider.js +6 -1
- package/src/javascripts/ui/components/core/seamly-event-subscriber.ts +14 -30
- package/src/javascripts/ui/components/form-controls/error.js +1 -1
- package/src/javascripts/ui/components/form-controls/file-input.js +1 -1
- package/src/javascripts/ui/components/layout/agent-info.js +1 -1
- package/src/javascripts/ui/components/layout/{icon.js → icon.tsx} +74 -37
- package/src/javascripts/ui/components/options/options-button.js +1 -1
- package/src/javascripts/ui/components/suggestions/suggestions-item.js +1 -1
- package/src/javascripts/ui/components/view/window-view/window-open-button.js +9 -4
- package/src/javascripts/ui/components/widgets/lightbox.js +1 -1
- package/src/javascripts/ui/hooks/use-session-expired-command.ts +31 -2
- package/src/stylesheets/5-components/_message-card.scss +4 -3
- package/src/stylesheets/5-components/_message-count.scss +11 -9
|
@@ -2269,7 +2269,8 @@ class API {
|
|
|
2269
2269
|
});
|
|
2270
2270
|
}
|
|
2271
2271
|
getConversationUrl() {
|
|
2272
|
-
|
|
2272
|
+
const conversationUrl = this.store.get('conversationUrl');
|
|
2273
|
+
return conversationUrl;
|
|
2273
2274
|
}
|
|
2274
2275
|
hasConversation() {
|
|
2275
2276
|
return !!this.getConversationUrl();
|
|
@@ -2377,7 +2378,7 @@ class API {
|
|
|
2377
2378
|
if (error.status >= 500) {
|
|
2378
2379
|
throw new SeamlyGeneralError(error);
|
|
2379
2380
|
}
|
|
2380
|
-
throw error;
|
|
2381
|
+
throw new ApiError(error);
|
|
2381
2382
|
}
|
|
2382
2383
|
});
|
|
2383
2384
|
}
|
|
@@ -2486,7 +2487,7 @@ class API {
|
|
|
2486
2487
|
if (error.status >= 500) {
|
|
2487
2488
|
throw new SeamlyGeneralError(error);
|
|
2488
2489
|
}
|
|
2489
|
-
throw error;
|
|
2490
|
+
throw new ApiError(error);
|
|
2490
2491
|
}
|
|
2491
2492
|
});
|
|
2492
2493
|
}
|
|
@@ -2546,15 +2547,17 @@ class API {
|
|
|
2546
2547
|
}
|
|
2547
2548
|
}
|
|
2548
2549
|
_API_ready = new WeakMap(), _API_externalId = new WeakMap(), _API_conversationAuthToken = new WeakMap(), _API_layoutMode = new WeakMap(), _API_config = new WeakMap(), _API_getLocale = new WeakMap(), _API_instances = new WeakSet(), _API_getAccessToken = function _API_getAccessToken() {
|
|
2549
|
-
|
|
2550
|
+
const accessToken = this.store.get('accessToken');
|
|
2551
|
+
return accessToken;
|
|
2550
2552
|
}, _API_setAccessToken = function _API_setAccessToken(accessToken) {
|
|
2551
2553
|
this.store.set('accessToken', accessToken);
|
|
2552
2554
|
}, _API_setConversationUrl = function _API_setConversationUrl(url) {
|
|
2553
2555
|
this.store.set('conversationUrl', url);
|
|
2554
2556
|
}, _API_getChannelTopic = function _API_getChannelTopic() {
|
|
2557
|
+
const channelTopic = this.store.get('channelTopic') || this.store.get('channelName');
|
|
2555
2558
|
// The `channelName` fallback is needed for seamless client upgrades.
|
|
2556
2559
|
// TODO: Remove when all clients have been upgraded past v20.
|
|
2557
|
-
return
|
|
2560
|
+
return channelTopic;
|
|
2558
2561
|
}, _API_setChannelTopic = function _API_setChannelTopic(topic) {
|
|
2559
2562
|
this.store.set('channelTopic', topic);
|
|
2560
2563
|
}, _API_getUrlPrefix = function _API_getUrlPrefix(protocol) {
|
|
@@ -2619,7 +2622,7 @@ _API_ready = new WeakMap(), _API_externalId = new WeakMap(), _API_conversationAu
|
|
|
2619
2622
|
return {
|
|
2620
2623
|
clientName: "@seamly/web-ui",
|
|
2621
2624
|
clientVariant: api_classPrivateFieldGet(this, _API_layoutMode, "f"),
|
|
2622
|
-
clientVersion: "22.
|
|
2625
|
+
clientVersion: "22.3.0-beta.2",
|
|
2623
2626
|
currentUrl: window.location.toString(),
|
|
2624
2627
|
screenResolution: `${window.screen.width}x${window.screen.height}`,
|
|
2625
2628
|
timezone: getTimeZone(),
|
|
@@ -6453,6 +6456,62 @@ const setLocale = createAsyncThunk('setLocale', (locale, {
|
|
|
6453
6456
|
return true;
|
|
6454
6457
|
}
|
|
6455
6458
|
});
|
|
6459
|
+
;// CONCATENATED MODULE: ./src/javascripts/domains/redux/create-debounced-async-thunk.ts
|
|
6460
|
+
|
|
6461
|
+
/**
|
|
6462
|
+
* A debounced analogue of the `createAsyncThunk` from `@reduxjs/toolkit`
|
|
6463
|
+
* @param typePrefix - a string action type value
|
|
6464
|
+
* @param payloadCreator - a callback function that should return a promise containing the result of some asynchronous logic
|
|
6465
|
+
* @param debounceOptions - the debounce options object
|
|
6466
|
+
*/
|
|
6467
|
+
const createDebouncedAsyncThunk = (typePrefix, payloadCreator, debounceOptions) => {
|
|
6468
|
+
const {
|
|
6469
|
+
wait = 300,
|
|
6470
|
+
maxWait = 0,
|
|
6471
|
+
leading = false
|
|
6472
|
+
} = debounceOptions !== null && debounceOptions !== void 0 ? debounceOptions : {};
|
|
6473
|
+
let debounceTimer = null;
|
|
6474
|
+
let maxWaitTimer = null;
|
|
6475
|
+
let resolve;
|
|
6476
|
+
const cancel = () => {
|
|
6477
|
+
if (resolve) {
|
|
6478
|
+
resolve(false);
|
|
6479
|
+
resolve = undefined;
|
|
6480
|
+
}
|
|
6481
|
+
};
|
|
6482
|
+
const invoke = () => {
|
|
6483
|
+
clearTimeout(maxWaitTimer);
|
|
6484
|
+
maxWaitTimer = undefined;
|
|
6485
|
+
if (resolve) {
|
|
6486
|
+
resolve(true);
|
|
6487
|
+
resolve = undefined;
|
|
6488
|
+
}
|
|
6489
|
+
};
|
|
6490
|
+
const debounceExecutionCondition = () => {
|
|
6491
|
+
const immediate = leading && !debounceTimer;
|
|
6492
|
+
// Start debounced condition resolution
|
|
6493
|
+
clearTimeout(debounceTimer);
|
|
6494
|
+
debounceTimer = setTimeout(() => {
|
|
6495
|
+
invoke();
|
|
6496
|
+
debounceTimer = null;
|
|
6497
|
+
}, wait);
|
|
6498
|
+
if (immediate) {
|
|
6499
|
+
return true;
|
|
6500
|
+
}
|
|
6501
|
+
cancel();
|
|
6502
|
+
// Start max wait condition resolution
|
|
6503
|
+
if (maxWait && !maxWaitTimer) {
|
|
6504
|
+
maxWaitTimer = setTimeout(invoke, maxWait);
|
|
6505
|
+
}
|
|
6506
|
+
return new Promise(res => {
|
|
6507
|
+
resolve = res;
|
|
6508
|
+
});
|
|
6509
|
+
};
|
|
6510
|
+
return createAsyncThunk(typePrefix, payloadCreator, {
|
|
6511
|
+
condition: debounceExecutionCondition
|
|
6512
|
+
});
|
|
6513
|
+
};
|
|
6514
|
+
/* harmony default export */ const create_debounced_async_thunk = (createDebouncedAsyncThunk);
|
|
6456
6515
|
;// CONCATENATED MODULE: ./node_modules/reselect/es/defaultMemoize.js
|
|
6457
6516
|
// Cache implementation based on Erik Rasmussen's `lru-memoize`:
|
|
6458
6517
|
// https://github.com/erikras/lru-memoize
|
|
@@ -7009,8 +7068,9 @@ const setVisibility = createAsyncThunk('setVisibility', (requestedVisibility, {
|
|
|
7009
7068
|
if (previousVisibility === calculatedVisibility) {
|
|
7010
7069
|
return undefined;
|
|
7011
7070
|
}
|
|
7071
|
+
const visibility = api.store.get(StoreKey);
|
|
7012
7072
|
// Store the user-requested visibility in order to reinitialize after refresh
|
|
7013
|
-
api.store.set(StoreKey, Object.assign(Object.assign({},
|
|
7073
|
+
api.store.set(StoreKey, Object.assign(Object.assign({}, visibility || {}), {
|
|
7014
7074
|
[layoutMode]: requestedVisibility
|
|
7015
7075
|
}));
|
|
7016
7076
|
if (requestedVisibility) {
|
|
@@ -7074,6 +7134,7 @@ var app_actions_awaiter = undefined && undefined.__awaiter || function (thisArg,
|
|
|
7074
7134
|
|
|
7075
7135
|
|
|
7076
7136
|
|
|
7137
|
+
|
|
7077
7138
|
const initializeApp = createAsyncThunk('initializeApp', (_, {
|
|
7078
7139
|
extra: {
|
|
7079
7140
|
api,
|
|
@@ -7139,14 +7200,14 @@ const initializeApp = createAsyncThunk('initializeApp', (_, {
|
|
|
7139
7200
|
});
|
|
7140
7201
|
}
|
|
7141
7202
|
}));
|
|
7142
|
-
const resetApp =
|
|
7203
|
+
const resetApp = create_debounced_async_thunk('resetApp', (_, {
|
|
7143
7204
|
dispatch,
|
|
7144
7205
|
extra: {
|
|
7145
7206
|
api
|
|
7146
7207
|
}
|
|
7147
7208
|
}) => app_actions_awaiter(void 0, void 0, void 0, function* () {
|
|
7148
7209
|
yield api.disconnect();
|
|
7149
|
-
|
|
7210
|
+
api.clearStore();
|
|
7150
7211
|
dispatch(resetConfig());
|
|
7151
7212
|
yield dispatch(initializeConfig());
|
|
7152
7213
|
try {
|
|
@@ -7154,11 +7215,14 @@ const resetApp = createAsyncThunk('resetApp', (_, {
|
|
|
7154
7215
|
locale
|
|
7155
7216
|
} = yield dispatch(initializeApp()).unwrap();
|
|
7156
7217
|
yield dispatch(setLocale(locale));
|
|
7157
|
-
} catch (
|
|
7218
|
+
} catch (e) {
|
|
7158
7219
|
// nothing to do
|
|
7159
7220
|
}
|
|
7160
7221
|
dispatch(initializeVisibility());
|
|
7161
|
-
})
|
|
7222
|
+
}), {
|
|
7223
|
+
wait: 2000,
|
|
7224
|
+
leading: true
|
|
7225
|
+
});
|
|
7162
7226
|
;// CONCATENATED MODULE: ./src/javascripts/domains/app/hooks.js
|
|
7163
7227
|
|
|
7164
7228
|
|
|
@@ -7194,12 +7258,75 @@ const {
|
|
|
7194
7258
|
setHasResponded
|
|
7195
7259
|
} = appSlice.actions;
|
|
7196
7260
|
/* harmony default export */ const slice = (appSlice.reducer);
|
|
7261
|
+
;// CONCATENATED MODULE: ./src/javascripts/domains/store/actions.ts
|
|
7262
|
+
var store_actions_awaiter = undefined && undefined.__awaiter || function (thisArg, _arguments, P, generator) {
|
|
7263
|
+
function adopt(value) {
|
|
7264
|
+
return value instanceof P ? value : new P(function (resolve) {
|
|
7265
|
+
resolve(value);
|
|
7266
|
+
});
|
|
7267
|
+
}
|
|
7268
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
7269
|
+
function fulfilled(value) {
|
|
7270
|
+
try {
|
|
7271
|
+
step(generator.next(value));
|
|
7272
|
+
} catch (e) {
|
|
7273
|
+
reject(e);
|
|
7274
|
+
}
|
|
7275
|
+
}
|
|
7276
|
+
function rejected(value) {
|
|
7277
|
+
try {
|
|
7278
|
+
step(generator["throw"](value));
|
|
7279
|
+
} catch (e) {
|
|
7280
|
+
reject(e);
|
|
7281
|
+
}
|
|
7282
|
+
}
|
|
7283
|
+
function step(result) {
|
|
7284
|
+
result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);
|
|
7285
|
+
}
|
|
7286
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
7287
|
+
});
|
|
7288
|
+
};
|
|
7289
|
+
|
|
7290
|
+
const getConversation = createAsyncThunk('getConversation', (_, {
|
|
7291
|
+
extra: {
|
|
7292
|
+
api
|
|
7293
|
+
},
|
|
7294
|
+
rejectWithValue
|
|
7295
|
+
}) => store_actions_awaiter(void 0, void 0, void 0, function* () {
|
|
7296
|
+
try {
|
|
7297
|
+
return api.getConversation();
|
|
7298
|
+
} catch (error) {
|
|
7299
|
+
return rejectWithValue({
|
|
7300
|
+
name: error === null || error === void 0 ? void 0 : error.name,
|
|
7301
|
+
message: error === null || error === void 0 ? void 0 : error.message,
|
|
7302
|
+
langKey: error === null || error === void 0 ? void 0 : error.langKey,
|
|
7303
|
+
action: error === null || error === void 0 ? void 0 : error.action,
|
|
7304
|
+
originalEvent: error === null || error === void 0 ? void 0 : error.originalEvent,
|
|
7305
|
+
originalError: error === null || error === void 0 ? void 0 : error.originalError
|
|
7306
|
+
});
|
|
7307
|
+
}
|
|
7308
|
+
}), {
|
|
7309
|
+
condition(payload, {
|
|
7310
|
+
getState
|
|
7311
|
+
}) {
|
|
7312
|
+
var _a;
|
|
7313
|
+
const {
|
|
7314
|
+
state: {
|
|
7315
|
+
events
|
|
7316
|
+
}
|
|
7317
|
+
} = getState();
|
|
7318
|
+
const lastEvent = events[events.length - 1];
|
|
7319
|
+
const payloadLastEventId = (_a = payload === null || payload === void 0 ? void 0 : payload.lastEvent) === null || _a === void 0 ? void 0 : _a.id;
|
|
7320
|
+
return lastEvent && payloadLastEventId !== lastEvent.payload.id;
|
|
7321
|
+
}
|
|
7322
|
+
});
|
|
7197
7323
|
;// CONCATENATED MODULE: ./src/javascripts/domains/interrupt/slice.ts
|
|
7198
7324
|
|
|
7199
7325
|
|
|
7200
7326
|
|
|
7201
7327
|
|
|
7202
7328
|
|
|
7329
|
+
|
|
7203
7330
|
const slice_initialState = {
|
|
7204
7331
|
error: undefined
|
|
7205
7332
|
};
|
|
@@ -7213,7 +7340,7 @@ const interruptSlice = createSlice({
|
|
|
7213
7340
|
clearInterrupt: () => slice_initialState
|
|
7214
7341
|
},
|
|
7215
7342
|
extraReducers: builder => {
|
|
7216
|
-
builder.addCase(initializeConfig.pending, () => slice_initialState).addMatcher(isAnyOf(initializeApp.rejected, initializeConfig.rejected, setLocale.rejected, setVisibility.rejected, initializeVisibility.rejected), (state, {
|
|
7343
|
+
builder.addCase(initializeConfig.pending, () => slice_initialState).addMatcher(isAnyOf(initializeApp.rejected, initializeConfig.rejected, setLocale.rejected, setVisibility.rejected, initializeVisibility.rejected, getConversation.rejected), (state, {
|
|
7217
7344
|
payload
|
|
7218
7345
|
}) => {
|
|
7219
7346
|
state.error = payload;
|
|
@@ -9619,6 +9746,9 @@ function useInterrupt() {
|
|
|
9619
9746
|
|
|
9620
9747
|
|
|
9621
9748
|
|
|
9749
|
+
|
|
9750
|
+
|
|
9751
|
+
|
|
9622
9752
|
function useSessionExpiredCommand() {
|
|
9623
9753
|
const {
|
|
9624
9754
|
meta: {
|
|
@@ -9626,13 +9756,35 @@ function useSessionExpiredCommand() {
|
|
|
9626
9756
|
action
|
|
9627
9757
|
}
|
|
9628
9758
|
} = useInterrupt();
|
|
9759
|
+
const dispatch = useAppDispatch();
|
|
9629
9760
|
const seamlyCommands = use_seamly_commands();
|
|
9630
9761
|
const isExpiredError = (originalError === null || originalError === void 0 ? void 0 : originalError.name) === 'SeamlySessionExpiredError';
|
|
9762
|
+
const limit = (0,hooks_.useRef)(0);
|
|
9763
|
+
const limitTimer = (0,hooks_.useRef)(null);
|
|
9631
9764
|
(0,hooks_.useEffect)(() => {
|
|
9632
9765
|
if (isExpiredError && seamlyCommands[action]) {
|
|
9766
|
+
if (limit.current >= 10) {
|
|
9767
|
+
limitTimer.current = setTimeout(() => {
|
|
9768
|
+
limit.current = 0;
|
|
9769
|
+
}, 10000);
|
|
9770
|
+
const error = new SeamlyGeneralError();
|
|
9771
|
+
dispatch(setInterrupt({
|
|
9772
|
+
name: error.name,
|
|
9773
|
+
message: error.message,
|
|
9774
|
+
langKey: error.langKey,
|
|
9775
|
+
originalEvent: error.originalEvent,
|
|
9776
|
+
originalError: error.originalError,
|
|
9777
|
+
action: error.action
|
|
9778
|
+
}));
|
|
9779
|
+
return () => {};
|
|
9780
|
+
}
|
|
9781
|
+
limit.current += 1;
|
|
9633
9782
|
seamlyCommands[action]();
|
|
9634
9783
|
}
|
|
9635
|
-
|
|
9784
|
+
return () => {
|
|
9785
|
+
if (limitTimer.current) clearTimeout(limitTimer.current);
|
|
9786
|
+
};
|
|
9787
|
+
}, [action, seamlyCommands, isExpiredError, dispatch]);
|
|
9636
9788
|
}
|
|
9637
9789
|
;// CONCATENATED MODULE: ./src/javascripts/ui/hooks/use-seamly-chat.ts
|
|
9638
9790
|
var use_seamly_chat_awaiter = undefined && undefined.__awaiter || function (thisArg, _arguments, P, generator) {
|
|
@@ -10460,7 +10612,7 @@ const EventParticipant = ({
|
|
|
10460
10612
|
})
|
|
10461
10613
|
}));
|
|
10462
10614
|
}
|
|
10463
|
-
if (showName) {
|
|
10615
|
+
if (showName && participantName) {
|
|
10464
10616
|
authorInfo.push((0,jsx_runtime_namespaceObject.jsx)("span", {
|
|
10465
10617
|
className: css_className('message__author-name'),
|
|
10466
10618
|
children: participantName
|
|
@@ -10540,108 +10692,61 @@ function MessageContainer({
|
|
|
10540
10692
|
});
|
|
10541
10693
|
}
|
|
10542
10694
|
/* harmony default export */ const message_container = (MessageContainer);
|
|
10543
|
-
;// CONCATENATED MODULE: ./src/javascripts/ui/components/conversation/event/card-component.
|
|
10695
|
+
;// CONCATENATED MODULE: ./src/javascripts/ui/components/conversation/event/card-component.tsx
|
|
10544
10696
|
|
|
10545
10697
|
|
|
10546
10698
|
|
|
10547
10699
|
|
|
10548
10700
|
|
|
10549
|
-
|
|
10550
|
-
const
|
|
10551
|
-
|
|
10552
|
-
|
|
10553
|
-
|
|
10554
|
-
|
|
10555
|
-
|
|
10556
|
-
|
|
10557
|
-
|
|
10558
|
-
|
|
10559
|
-
})
|
|
10560
|
-
|
|
10561
|
-
|
|
10562
|
-
|
|
10563
|
-
|
|
10564
|
-
emitEvent
|
|
10565
|
-
} = use_seamly_commands();
|
|
10566
|
-
const descriptionId = useGeneratedId();
|
|
10567
|
-
const isMounted = (0,hooks_.useRef)();
|
|
10568
|
-
const CardActionComponent = action.type === cardTypes.navigate ? 'a' : 'button';
|
|
10569
|
-
const emitCardEvent = (0,hooks_.useCallback)(() => emitEvent(`action.${actionTypes.clickCard}`, {
|
|
10570
|
-
type: actionTypes.clickCta,
|
|
10571
|
-
originMessage: id,
|
|
10572
|
-
action
|
|
10573
|
-
}), [emitEvent, id, action]);
|
|
10574
|
-
const handleClick = (0,hooks_.useCallback)(() => {
|
|
10575
|
-
emitCardEvent();
|
|
10576
|
-
if (action.type === cardTypes.ask) {
|
|
10577
|
-
sendMessage({
|
|
10578
|
-
body: action.ask
|
|
10579
|
-
});
|
|
10580
|
-
} else if (action.type === cardTypes.topic) {
|
|
10581
|
-
const {
|
|
10582
|
-
topic: name,
|
|
10583
|
-
fallbackMessage
|
|
10584
|
-
} = action;
|
|
10585
|
-
sendAction({
|
|
10586
|
-
type: actionTypes.setTopic,
|
|
10587
|
-
body: {
|
|
10588
|
-
name,
|
|
10589
|
-
fallbackMessage
|
|
10701
|
+
const CardComponent = ({ id, action, buttonText, description, hasFocus, image, title, isCarouselItem, }) => {
|
|
10702
|
+
const cardRef = (0,hooks_.useRef)(null);
|
|
10703
|
+
const { sendMessage, sendAction, emitEvent } = use_seamly_commands();
|
|
10704
|
+
const descriptionId = useGeneratedId();
|
|
10705
|
+
const isMounted = (0,hooks_.useRef)(false);
|
|
10706
|
+
const CardActionComponent = action.type === cardTypes.navigate ? 'a' : 'button';
|
|
10707
|
+
const emitCardEvent = (0,hooks_.useCallback)(() => emitEvent(`action.${actionTypes.clickCard}`, {
|
|
10708
|
+
type: actionTypes.clickCta,
|
|
10709
|
+
originMessage: id,
|
|
10710
|
+
action,
|
|
10711
|
+
}), [emitEvent, id, action]);
|
|
10712
|
+
const handleClick = (0,hooks_.useCallback)(() => {
|
|
10713
|
+
emitCardEvent();
|
|
10714
|
+
if (action.type === cardTypes.ask) {
|
|
10715
|
+
sendMessage({ body: action.ask });
|
|
10590
10716
|
}
|
|
10591
|
-
|
|
10592
|
-
|
|
10593
|
-
|
|
10594
|
-
|
|
10595
|
-
|
|
10596
|
-
|
|
10597
|
-
target: action.newTab ? '_blank' : '_self',
|
|
10598
|
-
onClick: emitCardEvent
|
|
10599
|
-
} : {
|
|
10600
|
-
onClick: handleClick
|
|
10601
|
-
}, [action, handleClick, emitCardEvent]);
|
|
10602
|
-
(0,hooks_.useEffect)(() => {
|
|
10603
|
-
if (isCarouselItem) {
|
|
10604
|
-
if (hasFocus && isMounted.current) {
|
|
10605
|
-
window.requestAnimationFrame(() => cardRef.current.focus());
|
|
10606
|
-
} else {
|
|
10607
|
-
cardRef.current.blur();
|
|
10608
|
-
}
|
|
10609
|
-
}
|
|
10610
|
-
isMounted.current = true;
|
|
10611
|
-
}, [hasFocus, isCarouselItem]);
|
|
10612
|
-
return (0,jsx_runtime_namespaceObject.jsxs)("div", {
|
|
10613
|
-
className: css_className('card__wrapper'),
|
|
10614
|
-
id: id,
|
|
10615
|
-
tabIndex: "-1" // set tabIndex of -1 so card can be focussed
|
|
10616
|
-
,
|
|
10617
|
-
ref: cardRef,
|
|
10618
|
-
children: [(0,jsx_runtime_namespaceObject.jsx)("img", {
|
|
10619
|
-
className: css_className('card__image'),
|
|
10620
|
-
src: image,
|
|
10621
|
-
alt: ""
|
|
10622
|
-
}), (0,jsx_runtime_namespaceObject.jsxs)("div", {
|
|
10623
|
-
className: css_className('card__content'),
|
|
10624
|
-
id: id,
|
|
10625
|
-
children: [title && (0,jsx_runtime_namespaceObject.jsx)("h2", {
|
|
10626
|
-
className: css_className('card__title'),
|
|
10627
|
-
children: title
|
|
10628
|
-
}), description && (0,jsx_runtime_namespaceObject.jsx)("div", {
|
|
10629
|
-
className: css_className('card__description'),
|
|
10630
|
-
dangerouslySetInnerHTML: {
|
|
10631
|
-
__html: description
|
|
10717
|
+
else if (action.type === cardTypes.topic) {
|
|
10718
|
+
const { topic: name, fallbackMessage } = action;
|
|
10719
|
+
sendAction({
|
|
10720
|
+
type: actionTypes.setTopic,
|
|
10721
|
+
body: { name, fallbackMessage },
|
|
10722
|
+
});
|
|
10632
10723
|
}
|
|
10633
|
-
|
|
10634
|
-
|
|
10635
|
-
|
|
10636
|
-
|
|
10637
|
-
|
|
10638
|
-
|
|
10639
|
-
|
|
10640
|
-
|
|
10641
|
-
|
|
10642
|
-
|
|
10724
|
+
}, [sendMessage, action, sendAction, emitCardEvent]);
|
|
10725
|
+
const actionProps = (0,hooks_.useMemo)(() => action.type === cardTypes.navigate
|
|
10726
|
+
? {
|
|
10727
|
+
href: action.link,
|
|
10728
|
+
rel: 'noopener noreferrer',
|
|
10729
|
+
target: action.newTab ? '_blank' : '_self',
|
|
10730
|
+
onClick: emitCardEvent,
|
|
10731
|
+
}
|
|
10732
|
+
: {
|
|
10733
|
+
onClick: handleClick,
|
|
10734
|
+
}, [action, handleClick, emitCardEvent]);
|
|
10735
|
+
(0,hooks_.useEffect)(() => {
|
|
10736
|
+
if (isCarouselItem) {
|
|
10737
|
+
if (hasFocus && isMounted.current) {
|
|
10738
|
+
window.requestAnimationFrame(() => cardRef.current.focus());
|
|
10739
|
+
}
|
|
10740
|
+
else {
|
|
10741
|
+
cardRef.current.blur();
|
|
10742
|
+
}
|
|
10743
|
+
}
|
|
10744
|
+
isMounted.current = true;
|
|
10745
|
+
}, [hasFocus, isCarouselItem]);
|
|
10746
|
+
return ((0,jsx_runtime_namespaceObject.jsxs)("div", { className: css_className('card__wrapper'), id: id, tabIndex: -1, ref: cardRef, children: [image ? ((0,jsx_runtime_namespaceObject.jsx)("img", { className: css_className('card__image'), src: image, alt: "" })) : null, (0,jsx_runtime_namespaceObject.jsxs)("div", { className: css_className('card__content'), id: id, children: [title && (0,jsx_runtime_namespaceObject.jsx)("h2", { className: css_className('card__title'), children: title }), description && ((0,jsx_runtime_namespaceObject.jsx)("div", { className: css_className('card__description'), dangerouslySetInnerHTML: { __html: description } })), (0,jsx_runtime_namespaceObject.jsx)(CardActionComponent, Object.assign({ tabIndex: isCarouselItem && !hasFocus ? -1 : undefined, className: css_className('button', 'button--primary'), "aria-describedby": descriptionId }, actionProps, { children: buttonText }))] })] }));
|
|
10643
10747
|
};
|
|
10644
10748
|
/* harmony default export */ const card_component = (CardComponent);
|
|
10749
|
+
|
|
10645
10750
|
;// CONCATENATED MODULE: ./src/javascripts/ui/components/conversation/event/card-message.js
|
|
10646
10751
|
|
|
10647
10752
|
|
|
@@ -10738,7 +10843,8 @@ function CarouselMessageSlide({
|
|
|
10738
10843
|
/* harmony default export */ const icon_send_32 = ("<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"32px\" height=\"32px\" x=\"0px\" y=\"0px\" viewBox=\"0 0 32 32\"><defs/><path fill=\"#4A48C1\" d=\"M6.714,14.985l17.837-7.906c0.681-0.302,1.414,0.301,1.25,1.027L22.273,23.59\tc-0.13,0.566-0.751,0.865-1.275,0.613l-3.623-1.752l-2.334,2.287c-0.572,0.562-1.538,0.156-1.538-0.645V21.01\tc0-0.217,0.078-0.43,0.222-0.594l7.676-8.841l-10.414,7.472l-4.351-2.445C5.987,16.236,6.033,15.287,6.714,14.985L6.714,14.985z\"/></svg>");
|
|
10739
10844
|
;// CONCATENATED MODULE: ./node_modules/raw-loader/dist/cjs.js!./src/icons/icon_upload-32.svg
|
|
10740
10845
|
/* harmony default export */ const icon_upload_32 = ("<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"32px\" height=\"32px\" x=\"0px\" y=\"0px\" viewBox=\"0 0 32 32\"><defs/><path fill=\"#4A48C1\" d=\"M9.488,13.481c-0.391-0.391-0.391-1.023,0-1.414l5.805-5.805c0.026-0.026,0.06-0.036,0.088-0.058\tc0.073-0.06,0.146-0.119,0.235-0.156c0.246-0.103,0.522-0.103,0.769,0c0.093,0.039,0.171,0.101,0.249,0.165\tc0.023,0.02,0.053,0.027,0.074,0.049l5.805,5.805c0.391,0.391,0.391,1.023,0,1.414c-0.195,0.195-0.451,0.293-0.707,0.293\ts-0.512-0.098-0.707-0.293L17,9.383V20.33c0,0.553-0.447,1-1,1c-0.552,0-1-0.447-1-1V9.383l-4.098,4.098\tC10.512,13.872,9.879,13.872,9.488,13.481z M22.819,24.031H9.181c-0.552,0-1,0.447-1,1s0.448,1,1,1h13.639c0.553,0,1-0.447,1-1\tS23.372,24.031,22.819,24.031z\"/></svg>");
|
|
10741
|
-
;// CONCATENATED MODULE: ./src/javascripts/ui/components/layout/icon.
|
|
10846
|
+
;// CONCATENATED MODULE: ./src/javascripts/ui/components/layout/icon.tsx
|
|
10847
|
+
|
|
10742
10848
|
/* eslint-disable import/no-webpack-loader-syntax */
|
|
10743
10849
|
// The eslint rules are disabled for this as otherwsise we'd need to include the loader rule in all implementations
|
|
10744
10850
|
// this can again be changed when we can import pre-built packages in implementations
|
|
@@ -10763,58 +10869,70 @@ function CarouselMessageSlide({
|
|
|
10763
10869
|
|
|
10764
10870
|
|
|
10765
10871
|
|
|
10766
|
-
|
|
10767
10872
|
|
|
10768
10873
|
|
|
10769
10874
|
/* eslint-enable import/no-webpack-loader-syntax */
|
|
10770
|
-
|
|
10771
|
-
|
|
10772
|
-
|
|
10773
10875
|
const ICONS = {
|
|
10774
|
-
|
|
10775
|
-
|
|
10776
|
-
|
|
10777
|
-
|
|
10778
|
-
|
|
10779
|
-
|
|
10780
|
-
|
|
10781
|
-
|
|
10782
|
-
|
|
10783
|
-
|
|
10784
|
-
|
|
10785
|
-
|
|
10786
|
-
|
|
10787
|
-
|
|
10788
|
-
|
|
10789
|
-
|
|
10790
|
-
|
|
10791
|
-
|
|
10792
|
-
|
|
10793
|
-
|
|
10794
|
-
|
|
10795
|
-
|
|
10796
|
-
|
|
10797
|
-
|
|
10798
|
-
|
|
10799
|
-
|
|
10800
|
-
|
|
10801
|
-
|
|
10802
|
-
|
|
10803
|
-
|
|
10804
|
-
|
|
10805
|
-
|
|
10806
|
-
|
|
10807
|
-
|
|
10808
|
-
|
|
10809
|
-
|
|
10810
|
-
|
|
10811
|
-
|
|
10812
|
-
|
|
10813
|
-
|
|
10814
|
-
|
|
10815
|
-
|
|
10876
|
+
send: {
|
|
10877
|
+
32: icon_send_32,
|
|
10878
|
+
},
|
|
10879
|
+
balloon: {
|
|
10880
|
+
32: icon_balloon_32,
|
|
10881
|
+
},
|
|
10882
|
+
newTopic: {
|
|
10883
|
+
32: icon_newtopic_32,
|
|
10884
|
+
},
|
|
10885
|
+
newTranslation: {
|
|
10886
|
+
16: icon_newtranslation_16,
|
|
10887
|
+
32: icon_newtranslation_32,
|
|
10888
|
+
},
|
|
10889
|
+
avatar: {
|
|
10890
|
+
32: avatar_bot_32,
|
|
10891
|
+
},
|
|
10892
|
+
chevronDown: {
|
|
10893
|
+
8: icon_chevron_down_8,
|
|
10894
|
+
32: icon_chevron_down_32,
|
|
10895
|
+
},
|
|
10896
|
+
chevronRight: {
|
|
10897
|
+
8: icon_chevron_right_8,
|
|
10898
|
+
16: icon_chevron_right_16,
|
|
10899
|
+
},
|
|
10900
|
+
close: {
|
|
10901
|
+
8: icon_close_8,
|
|
10902
|
+
16: icon_close_16,
|
|
10903
|
+
},
|
|
10904
|
+
enlarge: {
|
|
10905
|
+
32: icon_enlarge_32,
|
|
10906
|
+
},
|
|
10907
|
+
options: {
|
|
10908
|
+
32: icon_options_32,
|
|
10909
|
+
},
|
|
10910
|
+
file: {
|
|
10911
|
+
32: icon_file_32,
|
|
10912
|
+
},
|
|
10913
|
+
upload: {
|
|
10914
|
+
32: icon_upload_32,
|
|
10915
|
+
},
|
|
10916
|
+
download: {
|
|
10917
|
+
16: icon_download_16,
|
|
10918
|
+
},
|
|
10919
|
+
error: {
|
|
10920
|
+
16: icon_error_16,
|
|
10921
|
+
},
|
|
10922
|
+
arrowLeft: {
|
|
10923
|
+
16: icon_arrow_left_16,
|
|
10924
|
+
},
|
|
10925
|
+
arrowRight: {
|
|
10926
|
+
16: icon_arrow_right_16,
|
|
10927
|
+
},
|
|
10928
|
+
check: {
|
|
10929
|
+
16: icon_check_16,
|
|
10930
|
+
32: icon_check_32,
|
|
10931
|
+
},
|
|
10816
10932
|
};
|
|
10933
|
+
const Icon = ({ name, size = '32', className, alt }) => ((0,jsx_runtime_namespaceObject.jsxs)(jsx_runtime_namespaceObject.Fragment, { children: [(0,jsx_runtime_namespaceObject.jsx)("div", { "aria-hidden": "true", className: className || css_className('icon'), dangerouslySetInnerHTML: { __html: ICONS[name][size] } }), alt && (0,jsx_runtime_namespaceObject.jsx)("span", { className: css_className('visually-hidden'), children: alt })] }));
|
|
10817
10934
|
/* harmony default export */ const layout_icon = (Icon);
|
|
10935
|
+
|
|
10818
10936
|
;// CONCATENATED MODULE: ./src/javascripts/ui/components/conversation/event/carousel-component/components/controls.js
|
|
10819
10937
|
|
|
10820
10938
|
|
|
@@ -10845,7 +10963,8 @@ function CarouselControls({
|
|
|
10845
10963
|
onClick: handlePrevious,
|
|
10846
10964
|
children: (0,jsx_runtime_namespaceObject.jsx)(layout_icon, {
|
|
10847
10965
|
name: "arrowLeft",
|
|
10848
|
-
size: "16"
|
|
10966
|
+
size: "16",
|
|
10967
|
+
alt: ""
|
|
10849
10968
|
})
|
|
10850
10969
|
}), children, (0,jsx_runtime_namespaceObject.jsx)("button", {
|
|
10851
10970
|
className: css_className('button', 'button--next'),
|
|
@@ -10853,7 +10972,8 @@ function CarouselControls({
|
|
|
10853
10972
|
onClick: handleNext,
|
|
10854
10973
|
children: (0,jsx_runtime_namespaceObject.jsx)(layout_icon, {
|
|
10855
10974
|
name: "arrowRight",
|
|
10856
|
-
size: "16"
|
|
10975
|
+
size: "16",
|
|
10976
|
+
alt: ""
|
|
10857
10977
|
})
|
|
10858
10978
|
})]
|
|
10859
10979
|
});
|
|
@@ -11140,7 +11260,8 @@ const ChoicePrompt = ({
|
|
|
11140
11260
|
"aria-describedby": descriptorId,
|
|
11141
11261
|
children: [showOptions ? t('message.choicePrompts.cancelChooseAgain') : t('message.choicePrompts.chooseAgain'), (0,jsx_runtime_namespaceObject.jsx)(layout_icon, {
|
|
11142
11262
|
name: "chevronDown",
|
|
11143
|
-
size: "8"
|
|
11263
|
+
size: "8",
|
|
11264
|
+
alt: ""
|
|
11144
11265
|
})]
|
|
11145
11266
|
}), showOptions && (0,jsx_runtime_namespaceObject.jsx)(message_container, {
|
|
11146
11267
|
type: "choice-prompt",
|
|
@@ -11200,7 +11321,8 @@ const SuggestionsItem = ({
|
|
|
11200
11321
|
className: css_className('button', 'button--primary'),
|
|
11201
11322
|
children: [hasIcon && (0,jsx_runtime_namespaceObject.jsx)(layout_icon, {
|
|
11202
11323
|
name: "chevronRight",
|
|
11203
|
-
size: "8"
|
|
11324
|
+
size: "8",
|
|
11325
|
+
alt: ""
|
|
11204
11326
|
}), question]
|
|
11205
11327
|
})
|
|
11206
11328
|
});
|
|
@@ -11430,7 +11552,8 @@ function EventDivider({
|
|
|
11430
11552
|
children: iconName ? (0,jsx_runtime_namespaceObject.jsx)(layout_icon, {
|
|
11431
11553
|
name: iconName,
|
|
11432
11554
|
size: iconSize,
|
|
11433
|
-
className: iconClassName
|
|
11555
|
+
className: iconClassName,
|
|
11556
|
+
alt: ""
|
|
11434
11557
|
}) : (0,jsx_runtime_namespaceObject.jsx)("img", {
|
|
11435
11558
|
src: graphicSrc,
|
|
11436
11559
|
className: css_className({
|
|
@@ -13318,7 +13441,8 @@ const Lightbox = ({
|
|
|
13318
13441
|
onClick: onClose,
|
|
13319
13442
|
children: [(0,jsx_runtime_namespaceObject.jsx)(layout_icon, {
|
|
13320
13443
|
name: "close",
|
|
13321
|
-
size: "16"
|
|
13444
|
+
size: "16",
|
|
13445
|
+
alt: ""
|
|
13322
13446
|
}), t('lightbox.closeLabel')]
|
|
13323
13447
|
})]
|
|
13324
13448
|
})
|
|
@@ -13366,7 +13490,8 @@ const ImageLightbox = ({
|
|
|
13366
13490
|
description
|
|
13367
13491
|
}), (0,jsx_runtime_namespaceObject.jsx)(layout_icon, {
|
|
13368
13492
|
name: "enlarge",
|
|
13369
|
-
size: "32"
|
|
13493
|
+
size: "32",
|
|
13494
|
+
alt: ""
|
|
13370
13495
|
})]
|
|
13371
13496
|
}), showLightBox && (0,jsx_runtime_namespaceObject.jsx)(lightbox, {
|
|
13372
13497
|
url: url,
|
|
@@ -13797,6 +13922,33 @@ const SeamlyActivityMonitor = ({ children }) => {
|
|
|
13797
13922
|
/* harmony default export */ const seamly_activity_monitor = (SeamlyActivityMonitor);
|
|
13798
13923
|
|
|
13799
13924
|
;// CONCATENATED MODULE: ./src/javascripts/ui/components/core/seamly-event-subscriber.ts
|
|
13925
|
+
var seamly_event_subscriber_awaiter = undefined && undefined.__awaiter || function (thisArg, _arguments, P, generator) {
|
|
13926
|
+
function adopt(value) {
|
|
13927
|
+
return value instanceof P ? value : new P(function (resolve) {
|
|
13928
|
+
resolve(value);
|
|
13929
|
+
});
|
|
13930
|
+
}
|
|
13931
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
13932
|
+
function fulfilled(value) {
|
|
13933
|
+
try {
|
|
13934
|
+
step(generator.next(value));
|
|
13935
|
+
} catch (e) {
|
|
13936
|
+
reject(e);
|
|
13937
|
+
}
|
|
13938
|
+
}
|
|
13939
|
+
function rejected(value) {
|
|
13940
|
+
try {
|
|
13941
|
+
step(generator["throw"](value));
|
|
13942
|
+
} catch (e) {
|
|
13943
|
+
reject(e);
|
|
13944
|
+
}
|
|
13945
|
+
}
|
|
13946
|
+
function step(result) {
|
|
13947
|
+
result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);
|
|
13948
|
+
}
|
|
13949
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
13950
|
+
});
|
|
13951
|
+
};
|
|
13800
13952
|
var seamly_event_subscriber_rest = undefined && undefined.__rest || function (s, e) {
|
|
13801
13953
|
var t = {};
|
|
13802
13954
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
|
|
@@ -13817,13 +13969,13 @@ var seamly_event_subscriber_rest = undefined && undefined.__rest || function (s,
|
|
|
13817
13969
|
|
|
13818
13970
|
|
|
13819
13971
|
|
|
13972
|
+
|
|
13820
13973
|
const EMITTABLE_MESSAGE_TYPES = ['text', 'choice_prompt', 'image', 'video'];
|
|
13821
13974
|
const SeamlyEventSubscriber = () => {
|
|
13822
13975
|
const api = seamly_api_hooks_useSeamlyApiContext();
|
|
13823
13976
|
const syncChannelRef = (0,hooks_.useRef)();
|
|
13824
13977
|
const messageChannelRef = (0,hooks_.useRef)();
|
|
13825
|
-
const dispatch =
|
|
13826
|
-
const events = useEvents();
|
|
13978
|
+
const dispatch = useAppDispatch();
|
|
13827
13979
|
const eventBus = (0,hooks_.useContext)(SeamlyEventBusContext);
|
|
13828
13980
|
const prevEmittedEventId = (0,hooks_.useRef)(null);
|
|
13829
13981
|
const {
|
|
@@ -14068,31 +14220,19 @@ const SeamlyEventSubscriber = () => {
|
|
|
14068
14220
|
if (syncChannelRef.current) {
|
|
14069
14221
|
(_a = api.conversation.channel) === null || _a === void 0 ? void 0 : _a.off('sync', syncChannelRef.current);
|
|
14070
14222
|
}
|
|
14071
|
-
syncChannelRef.current = api.conversation.channel.on('sync', payload => {
|
|
14072
|
-
|
|
14073
|
-
|
|
14074
|
-
const payloadLastEventId = (_a = payload === null || payload === void 0 ? void 0 : payload.lastEvent) === null || _a === void 0 ? void 0 : _a.id;
|
|
14075
|
-
if (lastEvent && payloadLastEventId === lastEvent.payload.id) {
|
|
14076
|
-
return payload;
|
|
14077
|
-
}
|
|
14078
|
-
return api.getConversation().then(history => {
|
|
14223
|
+
syncChannelRef.current = api.conversation.channel.on('sync', payload => seamly_event_subscriber_awaiter(void 0, void 0, void 0, function* () {
|
|
14224
|
+
try {
|
|
14225
|
+
const history = yield dispatch(getConversation(payload)).unwrap();
|
|
14079
14226
|
if (!history) return;
|
|
14080
14227
|
dispatch(setHistory(history));
|
|
14081
|
-
}
|
|
14082
|
-
|
|
14083
|
-
|
|
14084
|
-
|
|
14085
|
-
langKey: error === null || error === void 0 ? void 0 : error.langKey,
|
|
14086
|
-
action: error === null || error === void 0 ? void 0 : error.action,
|
|
14087
|
-
originalEvent: error === null || error === void 0 ? void 0 : error.originalEvent,
|
|
14088
|
-
originalError: error === null || error === void 0 ? void 0 : error.originalError
|
|
14089
|
-
}));
|
|
14090
|
-
});
|
|
14091
|
-
});
|
|
14228
|
+
} catch (_e) {
|
|
14229
|
+
// nothing to do, the error is handled in the thunk
|
|
14230
|
+
}
|
|
14231
|
+
}));
|
|
14092
14232
|
return true;
|
|
14093
14233
|
});
|
|
14094
14234
|
}
|
|
14095
|
-
}, [api, api.connectionInfo, api.conversation.channel,
|
|
14235
|
+
}, [api, api.connectionInfo, api.conversation.channel, dispatch]);
|
|
14096
14236
|
return null;
|
|
14097
14237
|
};
|
|
14098
14238
|
/* harmony default export */ const seamly_event_subscriber = (SeamlyEventSubscriber);
|
|
@@ -15677,7 +15817,8 @@ function error_Error({
|
|
|
15677
15817
|
className: css_className('error__message'),
|
|
15678
15818
|
children: [(0,jsx_runtime_namespaceObject.jsx)(layout_icon, {
|
|
15679
15819
|
name: "error",
|
|
15680
|
-
size: "16"
|
|
15820
|
+
size: "16",
|
|
15821
|
+
alt: ""
|
|
15681
15822
|
}), error]
|
|
15682
15823
|
})
|
|
15683
15824
|
});
|
|
@@ -16054,7 +16195,8 @@ const OptionsButton = () => {
|
|
|
16054
16195
|
"aria-disabled": !multiMenu && !firstOption.available ? 'true' : null,
|
|
16055
16196
|
children: [multiMenu && (0,jsx_runtime_namespaceObject.jsx)(layout_icon, {
|
|
16056
16197
|
name: "options",
|
|
16057
|
-
size: "32"
|
|
16198
|
+
size: "32",
|
|
16199
|
+
alt: ""
|
|
16058
16200
|
}), (0,jsx_runtime_namespaceObject.jsx)("span", {
|
|
16059
16201
|
className: css_className('button__text'),
|
|
16060
16202
|
children: multiMenu ? t('options.openButtonText') : `${firstOption.title}${!firstOption.available ? ' ' : ''}`
|
|
@@ -16077,7 +16219,7 @@ const TranslationOption = ({ label, checked, description, onChange, id, itemClas
|
|
|
16077
16219
|
onChange();
|
|
16078
16220
|
}
|
|
16079
16221
|
};
|
|
16080
|
-
return ((0,jsx_runtime_namespaceObject.jsxs)("li", { className: css_className([itemClassName, 'translation-options__item']), "aria-selected": checked, role: "option", tabIndex: 0, onClick: onChange, onKeyDown: onKeyDown, id: id, children: [(0,jsx_runtime_namespaceObject.jsx)(layout_icon, {
|
|
16222
|
+
return ((0,jsx_runtime_namespaceObject.jsxs)("li", { className: css_className([itemClassName, 'translation-options__item']), "aria-selected": checked, role: "option", tabIndex: 0, onClick: onChange, onKeyDown: onKeyDown, id: id, children: [(0,jsx_runtime_namespaceObject.jsx)(layout_icon, { name: "check", size: "16", alt: "" }), label, " ", description && (0,jsx_runtime_namespaceObject.jsxs)("span", { children: ["(", description, ")"] })] }));
|
|
16081
16223
|
};
|
|
16082
16224
|
/* harmony default export */ const translation_option = (TranslationOption);
|
|
16083
16225
|
|
|
@@ -16904,7 +17046,8 @@ function FileInput({
|
|
|
16904
17046
|
className: css_className('upload__label'),
|
|
16905
17047
|
children: [(0,jsx_runtime_namespaceObject.jsx)(layout_icon, {
|
|
16906
17048
|
name: "upload",
|
|
16907
|
-
size: "32"
|
|
17049
|
+
size: "32",
|
|
17050
|
+
alt: ""
|
|
16908
17051
|
}), (0,jsx_runtime_namespaceObject.jsxs)("div", {
|
|
16909
17052
|
children: [(0,jsx_runtime_namespaceObject.jsx)("span", {
|
|
16910
17053
|
className: css_className(['upload__label--text']),
|
|
@@ -17647,7 +17790,8 @@ const ButtonIcon = () => {
|
|
|
17647
17790
|
alt: ""
|
|
17648
17791
|
}) : (0,jsx_runtime_namespaceObject.jsx)(layout_icon, {
|
|
17649
17792
|
name: "avatar",
|
|
17650
|
-
size: "32"
|
|
17793
|
+
size: "32",
|
|
17794
|
+
alt: ""
|
|
17651
17795
|
});
|
|
17652
17796
|
};
|
|
17653
17797
|
const WindowOpenButton = ({
|
|
@@ -17675,10 +17819,14 @@ const WindowOpenButton = ({
|
|
|
17675
17819
|
"aria-label": ariaLabel,
|
|
17676
17820
|
"aria-hidden": isOpen,
|
|
17677
17821
|
onClick: handleClick,
|
|
17678
|
-
children: [(0,jsx_runtime_namespaceObject.jsx)(
|
|
17679
|
-
|
|
17680
|
-
|
|
17681
|
-
children:
|
|
17822
|
+
children: [(0,jsx_runtime_namespaceObject.jsx)(in_out_transition, {
|
|
17823
|
+
isActive: !!count,
|
|
17824
|
+
transitionStartState: transitionStartStates.notRendered,
|
|
17825
|
+
children: (0,jsx_runtime_namespaceObject.jsx)("span", {
|
|
17826
|
+
className: css_className('message-count'),
|
|
17827
|
+
"aria-hidden": "true",
|
|
17828
|
+
children: count
|
|
17829
|
+
})
|
|
17682
17830
|
}), (0,jsx_runtime_namespaceObject.jsx)(ButtonIcon, {})]
|
|
17683
17831
|
})
|
|
17684
17832
|
});
|
|
@@ -19370,6 +19518,22 @@ const cardTopic = {
|
|
|
19370
19518
|
}
|
|
19371
19519
|
}
|
|
19372
19520
|
};
|
|
19521
|
+
const cardNoImage = {
|
|
19522
|
+
type: 'message',
|
|
19523
|
+
payload: {
|
|
19524
|
+
type: 'card',
|
|
19525
|
+
id: randomId(),
|
|
19526
|
+
body: {
|
|
19527
|
+
action: {
|
|
19528
|
+
ask: '',
|
|
19529
|
+
type: 'ask'
|
|
19530
|
+
},
|
|
19531
|
+
buttonText: 'Ask about pizzas!',
|
|
19532
|
+
description: 'Pizza Margherita is a <strong>typical Neapolitan pizza</strong>.\n\nIt is made with San Marzano tomatoes, mozzarella cheese, fresh basil, salt, and extra-virgin olive oil.',
|
|
19533
|
+
title: 'Pizza Margherita'
|
|
19534
|
+
}
|
|
19535
|
+
}
|
|
19536
|
+
};
|
|
19373
19537
|
const standardState = {
|
|
19374
19538
|
base: {
|
|
19375
19539
|
category: categoryKeys.unstarted,
|
|
@@ -19607,7 +19771,7 @@ const standardState = {
|
|
|
19607
19771
|
serviceInfo: {
|
|
19608
19772
|
activeServiceSessionId: '3942159e-9878-469e-9120-f44fd6be0f35'
|
|
19609
19773
|
},
|
|
19610
|
-
events: [cardAskText, cardNavigate, cardTopic]
|
|
19774
|
+
events: [cardAskText, cardNavigate, cardTopic, cardNoImage]
|
|
19611
19775
|
},
|
|
19612
19776
|
carousel: {
|
|
19613
19777
|
category: categoryKeys.messages,
|
|
@@ -19623,7 +19787,7 @@ const standardState = {
|
|
|
19623
19787
|
type: 'carousel',
|
|
19624
19788
|
id: randomId(),
|
|
19625
19789
|
body: {
|
|
19626
|
-
cards: [cardAskText.payload.body, cardNavigate.payload.body, cardTopic.payload.body]
|
|
19790
|
+
cards: [cardAskText.payload.body, cardNavigate.payload.body, cardTopic.payload.body, cardNoImage.payload.body]
|
|
19627
19791
|
}
|
|
19628
19792
|
}
|
|
19629
19793
|
}]
|
|
@@ -20022,6 +20186,13 @@ const standardState = {
|
|
|
20022
20186
|
}
|
|
20023
20187
|
}
|
|
20024
20188
|
},
|
|
20189
|
+
config: {
|
|
20190
|
+
...baseState.config,
|
|
20191
|
+
context: {
|
|
20192
|
+
...baseState.context,
|
|
20193
|
+
locale: 'nl'
|
|
20194
|
+
}
|
|
20195
|
+
},
|
|
20025
20196
|
translations: {
|
|
20026
20197
|
...translationsSlice,
|
|
20027
20198
|
isAvailable: true,
|